Copyright (c) 2013 Samsung Electronics Co., Ltd. All rights reserved.
Except as noted, this software is licensed under Apache License, Version 2.
-Please, see the LICENSE.APLv2 file for Apache License terms and conditions.
\ No newline at end of file
+Please, see the LICENSE.APLv2 file for Apache License terms and conditions.
+
+============================================================
+Notices for file(s):
+/org.tizen.common/lib/ant.jar
+------------------------------------------------------------
+Apache License, Version 2.0
+http://ant.apache.org/
+
+============================================================
+Notices for file(s):
+/org.tizen.common/lib/commons-collections-3.2.1.jar
+/org.tizen.common/lib/commons-io-2.4.jar
+/org.tizen.common/lib/commons-pool-1.6.jar
+------------------------------------------------------------
+Apache License, Version 2.0
+http://commons.apache.org/
+
+============================================================
+Notices for file(s):
+/org.tizen.common/lib/freemarker.jar
+------------------------------------------------------------
+BSD
+http://freemarker.sourceforge.net/
+
+============================================================
+Notices for file(s):
+/org.tizen.common.verrari.realm/lib/jackson-core-lgpl-1.9.7.jar
+/org.tizen.common.verrari.realm/lib/jackson-mapper-lgpl-1.9.7.jar
+------------------------------------------------------------
+LGPL, Version 2.1
+http://jackson.codehaus.org/
+
+============================================================
+Notices for file(s):
+/org.tizen.common.verrari/lib/jsoup-1.6.3.jar
+------------------------------------------------------------
+MIT
+http://jsoup.org/
+
+============================================================
+Notices for file(s):
+/org.tizen.common/lib/log4j-1.2.17.jar
+------------------------------------------------------------
+Apache License, Version 2.0
+http://logging.apache.org/log4j/1.2/
+
+============================================================
+Notices for file(s):
+/org.tizen.common/lib/slf4j-api-1.6.4.jar
+/org.tizen.common/lib/slf4j-log4j12-1.6.4.jar
+------------------------------------------------------------
+The Artistic License
+http://www.slf4j.org/
+
+============================================================
+Notices for file(s):
+/org.tizen.common/lib/xmlsec-1.5.3.jar
+------------------------------------------------------------
+Apache License, Version 2.0
+http://santuario.apache.org/
Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name
Bundle-SymbolicName: org.tizen.common.connection;singleton:=true
-Bundle-Version: 1.0.0.qualifier
+Bundle-Version: 2.0.0.qualifier
Bundle-Activator: org.tizen.common.connection.ConnectionPlugin
Bundle-Vendor: %Bundle-Vendor
Require-Bundle: org.eclipse.ui,
// The shared instance
private static ConnectionPlugin plugin;
- private IDevice currentDevice;
+ private IDevice currentDevice = null;
private final ArrayList<ISelectionListener> listeners = new ArrayList<ISelectionListener>();
public int os;
public static final int LINUX = 0;
public static final int WINDOWS = 1;
-
+
/**
* Implements for FileEntry changed status.
*/
*/
public void stop(BundleContext context) throws Exception {
plugin = null;
+
int deviceCnt = SmartDevelopmentBridge.getBridge().getDevices().length;
if (deviceCnt==0)
{
package org.tizen.common.connection.ddmuilib;
import org.eclipse.core.runtime.IProgressMonitor;
-
+import org.eclipse.swt.widgets.Label;
+import org.tizen.common.ui.dialog.TransferProgressMonitorDialog;
+import org.tizen.common.util.SWTUtil;
import org.tizen.sdblib.SyncService.ISyncProgressMonitor;
/**
*/
public class SyncProgressMonitor implements ISyncProgressMonitor {
+ private TransferProgressMonitorDialog dialog;
private IProgressMonitor mMonitor;
private String mName;
+
+ private String labelFrom = "From: ";
+ private String labelTo = "To: ";
+ private String labelSize = "Size: ";
- public SyncProgressMonitor(IProgressMonitor monitor, String name) {
+ public SyncProgressMonitor(TransferProgressMonitorDialog tmd,IProgressMonitor monitor, String name) {
+ dialog = tmd;
mMonitor = monitor;
mName = name;
}
}
public void startSubTask(String name) {
- mMonitor.subTask(name);
+ final Label fromLabel = dialog.getFromLabel();
+ final Label toLabel = dialog.getToLabel();
+ final Label sizeLabel = dialog.getSizeLabel();
+
+ if (fromLabel.isDisposed() || toLabel.isDisposed() || sizeLabel.isDisposed()) {
+ return;
+ }
+
+ final String fromStr;
+ final String toStr;
+ final String sizeStr;
+
+ String[] subTasks = name.split("\t");
+ if (name == null || subTasks.length != 3) {
+ fromStr = subTasks[0];
+ toStr = "";
+ sizeStr = "";
+ } else {
+ fromStr = labelFrom + subTasks[0];
+ toStr = labelTo + subTasks[1];
+ sizeStr = labelSize + subTasks[2];
+ }
+
+ SWTUtil.asyncExec(new Runnable()
+ {
+ @Override
+ public void run() {
+ fromLabel.setText(dialog.shortenText(fromStr, fromLabel));
+ toLabel.setText(dialog.shortenText(toStr, toLabel));
+ sizeLabel.setText(dialog.shortenText(sizeStr, sizeLabel));
+ }
+ });
}
}
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.IInputValidator;
import org.eclipse.jface.dialogs.InputDialog;
-import org.eclipse.jface.dialogs.ProgressMonitorDialog;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.viewers.TreeViewer;
import org.tizen.common.connection.preference.TizenConnectionExplorerPreferencePage;
import org.tizen.common.connection.sdblib.dnd.FileEntryTransfer;
import org.tizen.common.connection.ui.ConnectionUIMessages;
+import org.tizen.common.ui.dialog.TransferProgressMonitorDialog;
import org.tizen.common.ui.view.console.AnsicodeAdapter;
import org.tizen.common.ui.view.console.ConsoleManager;
import org.tizen.common.util.DialogUtil;
FileEntry entry = getSingleFileEntry();
FileDialog dlg = new FileDialog(parent.getShell(), SWT.OPEN);
-
+
setDialog(dlg, "Push the Files");
String[] fileName = new String[1];
final FileEntry[] entryArray = entries.toArray(new FileEntry[entries.size()]);
// get a progress dialog
- final ProgressMonitorDialog pmd = new ProgressMonitorDialog(parent.getShell());
- pmd.run(true, true, new IRunnableWithProgress()
+ final TransferProgressMonitorDialog tmd = new TransferProgressMonitorDialog(parent.getShell());
+
+ tmd.run(true, true, new IRunnableWithProgress()
{
@Override
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException
{
int timeOut = ConnectionPlugin.getDefault().getPreferenceStore().getInt(TizenConnectionExplorerPreferencePage.KEY_PUSHPULL_TIMEOUT);
// create a monitor wrapper around the jface monitor
- SyncResult result = sync.pull(entryArray, localDirectory, (ISyncProgressMonitor) new SyncProgressMonitor(monitor,
+ SyncResult result = sync.pull(entryArray, localDirectory, (ISyncProgressMonitor) new SyncProgressMonitor(tmd,monitor,
"Pulling file(s) from the device"), timeOut);
if (result.getCode() != SyncService.RESULT_OK)
final SyncService sync = currentDevice.getSyncService();
if (sync != null)
{
- new ProgressMonitorDialog(parent.getShell()).run(true, true, new IRunnableWithProgress()
+ final TransferProgressMonitorDialog tmd = new TransferProgressMonitorDialog(parent.getShell());
+
+ tmd.run(true, true, new IRunnableWithProgress()
{
@Override
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException
{
int timeOut = ConnectionPlugin.getDefault().getPreferenceStore().getInt(TizenConnectionExplorerPreferencePage.KEY_PUSHPULL_TIMEOUT);
- SyncResult result = sync.push(files, remoteDirectory, (ISyncProgressMonitor) new SyncProgressMonitor(monitor,
+ SyncResult result = sync.push(files, remoteDirectory, (ISyncProgressMonitor) new SyncProgressMonitor(tmd, monitor,
"Pushing file(s) to the device"), timeOut);
if (result.getCode() != SyncService.RESULT_OK)
{
entry = devices[0].getFileListingService().getRoot();
for (TreeItem item : tree.getItems())
{
- if (item.getText().equals(entry.getName()))
+ if (item.getText().equals(ConnectionExplorerLabelProvider.getDeviceSerialWithName(entry)))
{
tree.setSelection(item);
}
@Override
public void selectionChanged(final FileEntry selectedEntry)
{
-
if (selectedEntry == null)
{
return;
{
item.setForeground(colors.errorColor);
item.setText(1, "Error");
-
- } else if (msg.data.logLevel == LogLevel.WARN)
+ }else if (msg.data.logLevel == LogLevel.WARN)
{
item.setForeground(colors.warningColor);
item.setText(1, "Warning");
CONNECTION_EXPLORER_GROUP_TIMEOUT=Timeouts
CONNECTION_EXPLORER_TIMEOUT_CAUTION='0' means waiting forever
-CONNECTION_EXPLORER_LABEL_TIMEOUT=Timeout to transfer files (ms):
+CONNECTION_EXPLORER_LABEL_TIMEOUT=Connection time out to transfer files (ms):
CONNECTION_EXPLORER_GROUP_EMULATOR_MANAGER=Emulator Manager Path
CONNECTION_EXPLORER_LABEL_LOCATION=Location:
import java.io.IOException;
import java.util.concurrent.atomic.AtomicBoolean;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IContributionItem;
import org.eclipse.jface.action.IMenuListener;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.ToolBar;
import org.eclipse.swt.widgets.ToolItem;
import org.eclipse.swt.widgets.Tree;
import org.eclipse.swt.widgets.TreeItem;
+import org.eclipse.ui.IPartListener2;
+import org.eclipse.ui.IWorkbenchPartReference;
+import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.contexts.IContextService;
import org.eclipse.ui.part.ViewPart;
import org.tizen.common.TizenHelpContextIds;
import org.tizen.common.connection.ConnectionPlugin;
import org.tizen.common.connection.explorer.ConnectionExplorerPanel;
+import org.tizen.common.connection.log.LogUIMessages;
import org.tizen.common.connection.preference.TizenConnectionExplorerPreferencePage;
import org.tizen.common.core.application.InstallPathConfig;
import org.tizen.common.util.HostUtil;
+import org.tizen.common.util.NotificationType;
+import org.tizen.common.util.NotifierDialog;
+import org.tizen.common.util.SWTUtil;
import org.tizen.common.util.log.Logger;
import org.tizen.sdblib.FileListingService.FileEntry;
import org.tizen.sdblib.IDevice;
import org.tizen.sdblib.MultiLineReceiver;
import org.tizen.sdblib.SmartDevelopmentBridge;
-public class ConnectionExplorer extends ViewPart
-{
+public class ConnectionExplorer extends ViewPart implements IPartListener2 {
private ConnectionExplorerPanel panel;
private Composite parent;
private MenuManager menuMgr;
private static ConnectionExplorer explorer;
-
+
public static String PLATFORMLOG_ON = "1";
public static String PLATFORMLOG_OFF = "0";
- synchronized public static ConnectionExplorer gerDefault()
- {
- if (explorer == null)
- {
+ synchronized public static ConnectionExplorer gerDefault() {
+ if (explorer == null) {
explorer = new ConnectionExplorer();
}
return explorer;
}
@Override
- public void dispose()
- {
+ public void dispose() {
+ IWorkbenchWindow workbenchWindow = getSite().getWorkbenchWindow();
+ workbenchWindow.getPartService().removePartListener(this);
}
@Override
- public void createPartControl(Composite p)
- {
+ public void createPartControl(Composite p) {
+ IWorkbenchWindow workbenchWindow = getSite().getWorkbenchWindow();
+ workbenchWindow.getPartService().addPartListener(this);
+
parent = p;
PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, TizenHelpContextIds.HELP_COMMON_CONNECTION_EXPLORER_CONTEXT);
parent.setLayoutData(new GridData(GridData.FILL_VERTICAL));
panel.setToolItems(pushToolItem, pullToolItem, emulManagerToolItem);
- panel.setActions(subNewMenu, actionPush, actionPull, actionRefresh, actionRename, actionProperty, actionDelete, subLogMenu);
+ panel.setActions(subNewMenu, actionPush, actionPull, actionRefresh, actionRename, actionProperty, actionDelete,
+ subLogMenu);
}
- private void createFileExplorerView(Composite parent)
- {
+ private void createFileExplorerView(Composite parent) {
// device explorer
panel = new ConnectionExplorerPanel();
panel.createPanel(parent);
- panel.getTreeViewer().getTree().addKeyListener(new KeyAdapter()
- {
+ panel.getTreeViewer().getTree().addKeyListener(new KeyAdapter() {
@Override
- public void keyPressed(KeyEvent e)
- {
+ public void keyPressed(KeyEvent e) {
handleKeyPressed(e);
}
@Override
- public void keyReleased(KeyEvent e)
- {
+ public void keyReleased(KeyEvent e) {
}
});
}
- private void handleKeyPressed(KeyEvent event)
- {
+ private void handleKeyPressed(KeyEvent event) {
Tree tree = (Tree) event.widget;
int length = tree.getSelectionCount();
- if (event.keyCode == SWT.F5)
- {
- if (length == 1)
- {
+ if (event.keyCode == SWT.F5) {
+ if (length == 1) {
actionRefresh();
}
- } else if (event.keyCode == SWT.F2)
- {
- if (length == 1)
- {
+ } else if (event.keyCode == SWT.F2) {
+ if (length == 1) {
actionRename();
}
- } else if (event.keyCode == SWT.DEL)
- {
+ } else if (event.keyCode == SWT.DEL) {
actionDelete();
}
- if ((event.stateMask == SWT.ALT) && (event.keyCode == SWT.CR))
- {
+ if ((event.stateMask == SWT.ALT) && (event.keyCode == SWT.CR)) {
actionShowProperty();
}
}
- private void actionAddFile()
- {
+ private void actionAddFile() {
panel.addNewFileSelection();
}
- private void actionAddFolder()
- {
+ private void actionAddFolder() {
panel.addNewFolderSelection();
}
- private void actionPush()
- {
+ private void actionPush() {
panel.pushIntoSelection();
}
- private void actionPull()
- {
+ private void actionPull() {
panel.pullSelection();
}
- private void actionRefresh()
- {
+ private void actionRefresh() {
panel.refreshSelection();
}
- private void actionDelete()
- {
+ private void actionDelete() {
panel.deleteSelection();
}
- private void actionRename()
- {
+ private void actionRename() {
panel.renameSelection();
}
- private void actionShowProperty()
- {
+ private void actionShowProperty() {
panel.showPropertySelection(getSite());
}
- private void actionSetPlatformLog(boolean setON)
- {
+ private void actionSetPlatformLog(boolean setON) {
panel.setPlatformLogOnOff(setON);
}
+
/*
* make actions
*/
- private void makeActions()
- {
+ private void makeActions() {
subNewMenu = new MenuManager(ConnectionUIMessages.Explorer_ConetextMenu_New, null);
- actionAddFile = new Action()
- {
+ actionAddFile = new Action() {
@Override
- public void run()
- {
+ public void run() {
actionAddFile();
}
};
actionAddFile.setText(ConnectionUIMessages.Explorer_ConetextMenu_File);
- actionAddFolder = new Action()
- {
+ actionAddFolder = new Action() {
@Override
- public void run()
- {
+ public void run() {
actionAddFolder();
}
};
actionAddFolder.setText(ConnectionUIMessages.Explorer_ConetextMenu_Folder);
- actionPush = new Action()
- {
+ actionPush = new Action() {
@Override
- public void run()
- {
+ public void run() {
actionPush();
}
};
actionPush.setText(ConnectionUIMessages.Explorer_ConetextMenu_Push);
- actionPull = new Action()
- {
+ actionPull = new Action() {
@Override
- public void run()
- {
+ public void run() {
actionPull();
}
};
actionPull.setText(ConnectionUIMessages.Explorer_ConetextMenu_Pull);
// Add refresh action
- actionRefresh = new Action()
- {
+ actionRefresh = new Action() {
@Override
- public void run()
- {
+ public void run() {
actionRefresh();
}
};
actionRefresh.setText(ConnectionUIMessages.Explorer_ConetextMenu_Refresh);
actionRefresh.setActionDefinitionId("org.tizen.common.connection.refresh");
- actionRename = new Action()
- {
+ actionRename = new Action() {
@Override
- public void run()
- {
+ public void run() {
actionRename();
}
};
actionRename.setText(ConnectionUIMessages.Explorer_ConetextMenu_Rename);
actionRename.setActionDefinitionId("org.tizen.common.connection.rename");
- actionDelete = new Action()
- {
+ actionDelete = new Action() {
@Override
- public void run()
- {
+ public void run() {
actionDelete();
}
};
actionDelete.setText(ConnectionUIMessages.Explorer_ConetextMenu_Delete);
actionDelete.setActionDefinitionId("org.tizen.common.connection.delete");
- actionProperty = new Action()
- {
+ actionProperty = new Action() {
@Override
- public void run()
- {
+ public void run() {
panel.showPropertySelection(getSite());
}
};
subLogMenu = new MenuManager(ConnectionUIMessages.Explorer_ConetextMenu_Log, null);
- actionPlatformLogOn = new Action()
- {
+ actionPlatformLogOn = new Action() {
@Override
- public void run()
- {
+ public void run() {
actionSetPlatformLog(true);
}
};
actionPlatformLogOn.setText(ConnectionUIMessages.Explorer_ConetextMenu_Log_On);
-
- actionPlatformLogOff = new Action()
- {
+
+ actionPlatformLogOff = new Action() {
@Override
- public void run()
- {
+ public void run() {
actionSetPlatformLog(false);
}
};
actionPlatformLogOff.setText(ConnectionUIMessages.Explorer_ConetextMenu_Log_Off);
}
- private void initContextMenu()
- {
- // initalize the context menu
+ private void initContextMenu() {
+ // initialize the context menu
menuMgr = new MenuManager("Connection Explorer MenuMgr"); //$NON-NLS-1$
menuMgr.setRemoveAllWhenShown(true);
- menuMgr.addMenuListener(new IMenuListener()
- {
+ menuMgr.addMenuListener(new IMenuListener() {
@Override
- public void menuAboutToShow(IMenuManager manager)
- {
+ public void menuAboutToShow(IMenuManager manager) {
fillContextMenu(manager);
}
});
panel.getTreeViewer().getTree().setMenu(menu);
getSite().registerContextMenu(menuMgr, panel.getTreeViewer());
- menuMgr.addMenuListener(new IMenuListener()
- {
+ menuMgr.addMenuListener(new IMenuListener() {
@Override
- public void menuAboutToShow(IMenuManager manager)
- {
+ public void menuAboutToShow(IMenuManager manager) {
// Remove team menu from our menu
IContributionItem[] items = manager.getItems();
- if (items != null)
- {
- for (IContributionItem item : items)
- {
- if (("team.main").equals(item.getId()))
- {
+ if (items != null) {
+ for (IContributionItem item : items) {
+ if (("team.main").equals(item.getId())) {
manager.remove(item);
break;
}
});
}
- private void activateContext()
- {
+ private void activateContext() {
IContextService contextService = (IContextService) getSite().getService(IContextService.class);
contextService.activateContext("org.tizen.common.connection.delete.context");
contextService.activateContext("org.tizen.common.connection.rename.context");
}
- private void fillContextMenu(IMenuManager manager)
- {
+ private void fillContextMenu(IMenuManager manager) {
subNewMenu.add(actionAddFile);
subNewMenu.add(actionAddFolder);
manager.add(subNewMenu);
actionPlatformLogOn.setChecked(isOn);
actionPlatformLogOff.setChecked(!isOn);
}
-
- private boolean isPlatformLogOn()
- {
+
+ private boolean isPlatformLogOn() {
TreeItem[] items = panel.getTreeViewer().getTree().getSelection();
- FileEntry file = (FileEntry)items[0].getData();
+ FileEntry file = (FileEntry) items[0].getData();
IDevice[] devices = SmartDevelopmentBridge.getBridge().getDevices();
final AtomicBoolean result = new AtomicBoolean(false);
- for(IDevice device : devices)
- {
- if(file.getName().equals(device.getDeviceName()))
- {
+ for (IDevice device : devices) {
+ if (file.getName().equals(device.getDeviceName())) {
String command = "dlogctrl get platformlog";
try {
- device.executeShellCommand(command, new MultiLineReceiver()
- {
+ device.executeShellCommand(command, new MultiLineReceiver() {
@Override
- public void processNewLines(String[] lines)
- {
+ public void processNewLines(String[] lines) {
boolean isOn = lines[0].equals(PLATFORMLOG_ON);
boolean isOff = lines[0].equals(PLATFORMLOG_OFF);
- if(isOn || isOff)
- {
- if(isOn)
- {
+ if (isOn || isOff) {
+ if (isOn) {
result.set(true);
}
- if(!subLogMenu.isVisible())
- {
+ if (!subLogMenu.isVisible()) {
subLogMenu.setVisible(true);
}
- }
- else
- {
- MessageDialog.openError(parent.getShell(), ConnectionUIMessages.Explorer_Message_PlatformLogError, lines[0] ); //$NON-NLS-1$
+ } else {
+ MessageDialog.openError(parent.getShell(),
+ ConnectionUIMessages.Explorer_Message_PlatformLogError, lines[0]); //$NON-NLS-1$
subLogMenu.setVisible(false);
}
}
return result.get();
}
- private void createToolBar(Composite shell, Object layoutData)
- {
+ private void createToolBar(Composite shell, Object layoutData) {
toolBar = new ToolBar(shell, SWT.NULL);
toolBar.setLayoutData(layoutData);
emulManagerToolItem = new ToolItem(toolBar, SWT.PUSH);
emulManagerToolItem.setImage(ConnectionPlugin.getImageDescriptorFromPlugin("icons/emulator_manager.gif").createImage());
emulManagerToolItem.setToolTipText(ConnectionUIMessages.Explorer_Tooltip_EmulatorManager);
- emulManagerToolItem.addSelectionListener(new SelectionAdapter()
- {
+ emulManagerToolItem.addSelectionListener(new SelectionAdapter() {
@Override
- public void widgetSelected(SelectionEvent e)
- {
- try
- {
+ public void widgetSelected(SelectionEvent e) {
+ try {
startEmulatorManager();
- } catch (Exception e1)
- {
+ } catch (Exception e1) {
Logger.error("Fail to start Emulator Manager", e1.getMessage());
}
}
pushToolItem = new ToolItem(toolBar, SWT.PUSH);
pushToolItem.setImage(ConnectionPlugin.getImageDescriptorFromPlugin("icons/push.gif").createImage());
pushToolItem.setToolTipText(ConnectionUIMessages.Explorer_Tooltip_Push);
- pushToolItem.addSelectionListener(new SelectionAdapter()
- {
+ pushToolItem.addSelectionListener(new SelectionAdapter() {
@Override
- public void widgetSelected(SelectionEvent e)
- {
+ public void widgetSelected(SelectionEvent e) {
panel.pushIntoSelection();
}
});
pullToolItem = new ToolItem(toolBar, SWT.PUSH);
pullToolItem.setImage(ConnectionPlugin.getImageDescriptorFromPlugin("icons/pull.gif").createImage());
pullToolItem.setToolTipText(ConnectionUIMessages.Explorer_Tooltip_Pull);
- pullToolItem.addSelectionListener(new SelectionAdapter()
- {
+ pullToolItem.addSelectionListener(new SelectionAdapter() {
@Override
- public void widgetSelected(SelectionEvent e)
- {
+ public void widgetSelected(SelectionEvent e) {
panel.pullSelection();
}
});
pullToolItem.setEnabled(false);
- new ToolItem(toolBar, SWT.SEPARATOR); // Separator
+ new ToolItem(toolBar, SWT.SEPARATOR); // Separator
}
@Override
- public void setFocus()
- {
- if(parent != null)
- {
+ public void setFocus() {
+ if (parent != null) {
parent.setFocus();
}
}
- public static void startEmulatorManager() throws Exception
- {
+ public static void startEmulatorManager() throws Exception {
int osType = ConnectionPlugin.getDefault().os;
int linuxType = ConnectionPlugin.LINUX;
- String exePath = ConnectionPlugin.getDefault().getPreferenceStore().getString(TizenConnectionExplorerPreferencePage.KEY_EMULATOR_MANAGER_PATH);
- if (exePath.equals("") || (!exePath.equals("") && !HostUtil.exists(exePath)))
- {
+ String exePath = ConnectionPlugin.getDefault().getPreferenceStore()
+ .getString(TizenConnectionExplorerPreferencePage.KEY_EMULATOR_MANAGER_PATH);
+ if (exePath.equals("") || (!exePath.equals("") && !HostUtil.exists(exePath))) {
throw new Exception(ConnectionUIMessages.Explorer_Message_EmulatorError);
}
// FIXME : should implement the lines below based on windows system.
String command = exePath;
- if (osType == linuxType)
- {
+ if (osType == linuxType) {
command = command + " 1>/dev/null 2>/dev/null &";
HostUtil.execute(command);
- } else
- {
+ } else {
HostUtil.batchExecute(command, null, new File(InstallPathConfig.getEmulatorPath()));
}
}
+
+ @Override
+ public void partActivated(IWorkbenchPartReference partRef) {
+ }
+
+ @Override
+ public void partBroughtToTop(IWorkbenchPartReference partRef) {
+ }
+
+ @Override
+ public void partClosed(IWorkbenchPartReference partRef) {
+ if (ConnectionPlugin.ID_CONNECTION_VIEW.equals(partRef.getId())) {
+ ConnectionPlugin.getDefault().setCurrentDevice(null);
+ SWTUtil.syncExec(new Runnable()
+ {
+ @Override
+ public void run() {
+ NotifierDialog.notify(ConnectionUIMessages.Explorer_Closed_Title, ConnectionUIMessages.Explorer_Closed_Message, NotificationType.WARN);
+ }
+ });
+ }
+ }
+
+ @Override
+ public void partDeactivated(IWorkbenchPartReference partRef) {
+ }
+
+ @Override
+ public void partOpened(IWorkbenchPartReference partRef) {
+ }
+
+ @Override
+ public void partHidden(IWorkbenchPartReference partRef) {
+ }
+
+ @Override
+ public void partVisible(IWorkbenchPartReference partRef) {
+ }
+
+ @Override
+ public void partInputChanged(IWorkbenchPartReference partRef) {
+ }
}
\ No newline at end of file
{
private static final String BUNDLE_NAME = ConnectionUIMessages.class.getPackage().getName() + ".ConnectionUIMessages"; //$NON-NLS-1$
+ public static String Explorer_Closed_Message;
+ public static String Explorer_Closed_Title;
+
public static String Explorer_ConetextMenu_New;
public static String Explorer_ConetextMenu_File;
public static String Explorer_ConetextMenu_Folder;
+Explorer_Closed_Title = Connection Explorer is closed
+Explorer_Closed_Message = Connection Explorer is closed\nYou can open it by Window > Show View > Connection Explorer menu.
+
Explorer_ConetextMenu_New = New
Explorer_ConetextMenu_File = File
Explorer_ConetextMenu_Folder = Folder
*/
package org.tizen.common.connection.ui;
-import java.io.IOException;
-
import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Tree;
import org.eclipse.swt.widgets.TreeColumn;
import org.eclipse.swt.widgets.TreeItem;
-import org.tizen.common.TizenPlatformConstants;
import org.tizen.common.connection.ConnectionPlugin;
-import org.tizen.common.util.log.Logger;
import org.tizen.sdblib.FileListingService.FileEntry;
import org.tizen.sdblib.IDevice;
-import org.tizen.sdblib.MultiLineReceiver;
public class TizenRemoteFileDialog {
public enum TizenRemoteFileDialogResult {
private Tree pathTree;
private TreeViewer pathTreeViewer;
private Composite upper;
+ private boolean enableMultiSelection = false;
TizenRemoteFileContentProvider remoteContentProvider = null;
createControls(shell);
}
+ public TizenRemoteFileDialog(Shell parent, String dlgTitle, IDevice device, boolean isDirOnly, String defaultPath, boolean enableMultiSelection) {
+ this(parent, dlgTitle, device, isDirOnly, defaultPath);
+ this.enableMultiSelection = enableMultiSelection;
+ }
+
public TizenRemoteFileDialogResult open() {
shell.open();
runEventLoop(shell);
private void createPathTree(Composite pParent) {
// if add SWT.VIRTUAL, horizontal scrol is not shown in case of Linux
- pathTree = new Tree(pParent, SWT.MULTI | SWT.FULL_SELECTION);
+ int style = SWT.FULL_SELECTION;
+ if (enableMultiSelection) {
+ style = style | SWT.MULTI;
+ }
+ pathTree = new Tree(pParent, style);
+
setTreeLayout(pathTree);
}
display.update();
}
- private void setDefaultPath(final String corePath) {
- if (corePath == null) {
- defaultPath = "/";
- }
-
- String command = "ls " + TizenPlatformConstants.PRIVATE_PLATFORM_CORE_PATH + "/*/files/core.* 2&>/dev/null | wc -l";
-
- try {
- this.device.executeShellCommand(command, new MultiLineReceiver() {
- @Override
- public void processNewLines(String[] lines) {
- defaultPath = "0".equals(lines[0]) ? corePath : TizenPlatformConstants.PRIVATE_PLATFORM_CORE_PATH;
- }
- });
- } catch (IOException e) {
- Logger.error("Problem occurred while executing command '" + command + "'", e.getMessage(), e);
+ private void setDefaultPath(final String basePath) {
+ if (basePath == null) {
+ this.defaultPath = "/";
+ } else {
+ this.defaultPath = basePath;
}
}
}
Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name
Bundle-SymbolicName: org.tizen.common.externals
-Bundle-Version: 1.0.0.qualifier
+Bundle-Version: 2.0.0.qualifier
Bundle-Activator: org.tizen.common.externals.ExternalsPlugin
Bundle-Vendor: %Bundle-Vendor
Require-Bundle: org.eclipse.ui,
import org.eclipse.swt.graphics.Rectangle;\r
import org.eclipse.swt.widgets.Canvas;\r
import org.eclipse.swt.widgets.Composite;\r
+import org.eclipse.swt.widgets.Control;\r
import org.eclipse.swt.widgets.Event;\r
import org.eclipse.swt.widgets.Listener;\r
import org.mihalis.opal.utils.SWTGraphicUtil;\r
FlatButton.this.selection = !FlatButton.this.selection;\r
}\r
}\r
-\r
});\r
+ \r
+ addListener( SWT.Traverse, new Listener() {\r
+ @Override\r
+ public void handleEvent(Event event) {\r
+ switch( event.detail ) {\r
+ case SWT.TRAVERSE_ARROW_NEXT :\r
+ event.doit = true;\r
+ traverseButton( true, event );\r
+ break;\r
+ case SWT.TRAVERSE_ARROW_PREVIOUS :\r
+ event.doit = true;\r
+ traverseButton( false, event );\r
+ break;\r
+ }\r
+ }\r
+ });\r
+ \r
}\r
\r
+ private void traverseButton(boolean next, Event event) {\r
+ Control[] childrens = getParent().getChildren(); // get button container's childs\r
+ List<Control> list = new ArrayList<Control>();\r
+ \r
+ // get valid control\r
+ for ( Control child : childrens ) {\r
+ if ( child instanceof FlatButton && !child.isDisposed() ) {\r
+ list.add( child );\r
+ }\r
+ }\r
+ \r
+ // get current index\r
+ int indexOf = list.indexOf( this );\r
+ if ( indexOf == -1 ) {\r
+ return;\r
+ }\r
+ \r
+ // calculate item index\r
+ if ( next ) { // next item \r
+ indexOf = ( indexOf > list.size() - 2 ) ? indexOf : ( indexOf + 1 );\r
+ } else { // previous item\r
+ indexOf = ( indexOf < 1 ) ? indexOf : ( indexOf - 1 ) ;\r
+ }\r
+ \r
+ Control chosenCtrl = list.get( indexOf );\r
+ chosenCtrl.notifyListeners( SWT.MouseUp, event );\r
+ chosenCtrl.setFocus();\r
+ }\r
+ \r
private void initializeDefaultColors() {\r
this.backgroundColor = getDisplay().getSystemColor(SWT.COLOR_WHITE);\r
this.selectedColor = new Color(getDisplay(), 0, 112, 192);\r
-<?xml version="1.0" encoding="UTF-8"?>\r
-<feature\r
- id="org.tizen.common.feature"\r
- label="Tizen Common"\r
- version="1.0.0.qualifier"\r
- plugin="org.tizen.common"\r
- license-feature="org.tizen.base.feature">\r
-\r
- <description>\r
- Common library for Tizen SDK.\r
- </description>\r
-\r
- <copyright>\r
- Copyright (c)\r
- </copyright>\r
-\r
- <license url="license.html">\r
- Tizen SDK
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+ id="org.tizen.common.feature"
+ label="Tizen Common"
+ version="2.0.0.qualifier"
+ plugin="org.tizen.common"
+ license-feature="org.tizen.base.feature">
-Tizen SDK contains software portions licensed under various open source licenses as well as proprietary components. All open source software portions ("Open Source Software") are licensed under the open source licenses that accompany such Open Source Software.
-
-The licenses governing the Open Source Software are available at: http://developer.tizen.org/download/tizen_sdk_opensource_license.html
+ <description>
+ Common library for Tizen SDK.
+ </description>
-Except for the Open Source Software contained in Tizen SDK, all other software portions contained in Tizen SDK are governed by the terms and conditions of the Tizen Software Development Kit License Agreement, available at: http://developer.tizen.org/download/samsung_sdk_license.html
+ <copyright>
+ Copyright (c) 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ </copyright>
-You may access and download Tizen SDK Open Source Software at: http://developer.tizen.org/download/tizenopensdk.tar.gz
+ <plugin
+ id="org.tizen.common"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
-BY CLICKING THE "I AGREE" BUTTON OR BY USING ANY PART OF TIZEN SDK, YOU AGREE (ON BEHALF OF YOURSELF AND/OR YOUR COMPANY) TO THE OPEN SOURCE SOFTWARE LICENSE TERMS AND THE TIZEN SOFTWARE DEVELOPMENT KIT LICENSE AGREEMENT. IF YOU DO NOT AGREE WITH THE OPEN SOURCE SOFTWARE LICENSE TERMS OR THE TIZEN SOFTWARE DEVELOPMENT KIT LICENSE AGREEMENT, YOU MAY NOT DOWNLOAD OR USE TIZEN SDK.\r
- </license>\r
-\r
- <plugin\r
- id="org.tizen.common"\r
- download-size="0"\r
- install-size="0"\r
- version="0.0.0"\r
- unpack="false"/>\r
-\r
- <plugin\r
- id="org.tizen.common.connection"\r
- download-size="0"\r
- install-size="0"\r
- version="0.0.0"\r
- unpack="false"/>\r
-\r
- <plugin\r
- id="org.tizen.common.externals"\r
- download-size="0"\r
- install-size="0"\r
- version="0.0.0"\r
- unpack="false"/>\r
-\r
- <plugin\r
- id="org.tizen.common.verrari"\r
- download-size="0"\r
- install-size="0"\r
- version="0.0.0"\r
- unpack="false"/>\r
-\r
- <plugin\r
- id="org.tizen.common.sign"\r
- download-size="0"\r
- install-size="0"\r
- version="0.0.0"\r
- unpack="false"/>\r
-\r
- <plugin\r
- id="org.tizen.common.sdblib"\r
- download-size="0"\r
- install-size="0"\r
- version="0.0.0"\r
- unpack="false"/>\r
-\r
- <plugin\r
- id="org.tizen.common.verrari.realm"\r
- download-size="0"\r
- install-size="0"\r
- version="0.0.0"\r
- unpack="false"/>\r
-\r
-</feature>\r
+ <plugin
+ id="org.tizen.common.connection"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.tizen.common.externals"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.tizen.common.verrari"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.tizen.common.sign"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.tizen.common.sdblib"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.tizen.common.verrari.realm"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.tizen.common.project"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+</feature>
+++ /dev/null
-<?xml version="1.0" encoding="ISO-8859-1" ?>\r
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml">\r
-<head>\r
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />\r
-<title>Tizen SOFTWARE DEVELOPMENT KIT ("SDK") LICENSE AGREEMENT</title>\r
-</head>\r
-\r
-<body lang="EN-US">\r
- <p align="center">Tizen SDK</p><br /><br />\r
-\r
-Tizen SDK contains software portions licensed under various open source licenses as well as proprietary components. All open source software portions ("Open Source Software") are licensed under the open source\r
-licenses that accompany such Open Source Software.<br/><br/>\r
-\r
-The licenses governing the Open Source Software are available at:<br />\r
-<a href="https://developer.tizen.org/tizen-sdk-opensource-license">https://developer.tizen.org/tizen-sdk-opensource-license</a><br /><br />\r
- \r
-Except for the Open Source Software and proprietary components contributed from companies other than Samsung, contained in Tizen SDK, all other software portions contained in Tizen SDK are governed by the\r
-terms and conditions of the Samsung Tizen SDK License Agreement, available at:<br />\r
-<a href="https://developer.tizen.org/tizen-sdk-license">https://developer.tizen.org/tizen-sdk-license</a><br /><br />\r
-\r
-The licenses of all proprietary components contributed from companies other than Samsung will be either displayed as part of their respective installers or accessed inside installation package archive of each\r
-component.\r
-\r
-You may access and download Tizen SDK Open Source Software at:<br />\r
-<a href="http://developer.tizen.org/download/tizenopensdk.tar.gz">http://developer.tizen.org/download/tizenopensdk.tar.gz</a><br /><br />\r
-BY CLICKING THE "I AGREE" BUTTON OR BY USING ANY PART OF TIZEN SDK, YOU AGREE (ON BEHALF OF YOURSELF AND/OR YOUR COMPANY) TO THE OPEN SOURCE SOFTWARE LICENSE TERMS, THE SAMSUNG TIZEN SDK LICENSE AGREEMENT AND THE LICENSES OF ALL PROPRIETARY COMPONENTS CONTRIBUTED FROM COMPANIES OTHER THAN SAMSUNG. If you do not agree with the Open Source Software license terms or the SAMSUNG TIZEN SDK LICENSE AGREEMENT or THE LICENSES OF ALL PROPRIETARY COMPONENTS CONTRIBUTED FROM COMPANIES OTHER THAN SAMSUNG, you may not download or use Tizen SDK.\r
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="src" path="test/src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.tizen.common.project</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
--- /dev/null
+#Thu Jan 31 17:54:08 KST 2013
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
--- /dev/null
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name
+Bundle-SymbolicName: org.tizen.common.project
+Bundle-Version: 2.0.0.qualifier
+Bundle-Activator: org.tizen.common.project.Activator
+Bundle-Vendor: %Bundle-Vendor
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.tizen.common
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-ActivationPolicy: lazy
+Import-Package: org.eclipse.core.filesystem,
+ org.eclipse.core.resources
+Export-Package: org.tizen.common.project,
+ org.tizen.common.project.util
--- /dev/null
+Bundle-Name = Tizen Common Project Tools
+Bundle-Vendor = The Linux Foundation
--- /dev/null
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ OSGI-INF/
--- /dev/null
+package org.tizen.common.project;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.tizen.common.project"; //$NON-NLS-1$
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+}
--- /dev/null
+package org.tizen.common.project;
+
+public final class CommonProjectConstants {
+
+ public final static int PROJECT_NAME_MIN_LENGTH = 3;
+ public final static int PROJECT_NAME_MAX_LENGTH = 50;
+ public final static String PROJECT_NAME_PATTERN;
+
+ public final static char[] INVALID_RESOURCE_CHARACTERS;
+
+ static {
+ PROJECT_NAME_PATTERN = "^[a-zA-Z][a-zA-Z0-9-]{" //$NON-NLS-1$
+ + ( PROJECT_NAME_MIN_LENGTH - 1 ) + "," //$NON-NLS-1$
+ + ( PROJECT_NAME_MAX_LENGTH - 1 ) + "}$"; //$NON-NLS-1$
+ // Regular Expression Note :
+ // A first character must have case-insensitive alphabet.
+ // Next characters have case-insensitive alphabet or numeric or hyphen
+ // Total character length scope is a minimum of 3 and maximum of 50 characters.
+
+ INVALID_RESOURCE_CHARACTERS = new char[] { '`', '#', '$', ':' };
+ }
+}
--- /dev/null
+package org.tizen.common.project.util;
+
+import org.eclipse.osgi.util.NLS;
+
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.tizen.common.project.util.messages"; //$NON-NLS-1$
+ public static String ValidationUtil_AlreadyExistProject;
+ public static String ValidationUtil_InvalidProjectName;
+ public static String ValidationUtil_InvalidProjectNameLength;
+ public static String ValidationUtil_InvalidSegment;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
--- /dev/null
+/*
+ * Common
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * NamKoong Ho <ho.namkoong@samsung.com>
+ * Jihoon Song <jihoon80.song@samsung.com>
+ * BonYong Lee <bonyong.lee@samsung.com>
+ * Kangho Kim <kh5325.kim@samsung.com>
+ *
+ * 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.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.common.project.util;
+
+import java.io.File;
+import java.net.URI;
+
+import org.eclipse.core.filesystem.EFS;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.osgi.util.NLS;
+import org.tizen.common.project.CommonProjectConstants;
+import org.tizen.common.util.Assert;
+import org.tizen.common.util.StringUtil;
+
+/**
+ * Project Validation Util
+ *
+ * Helper related to the web project validation
+ *
+ * @author Jihoon Song{@literal <jihoon80.song@samsung.com>} (S-Core)
+ */
+public abstract class ProjectValidationUtil {
+
+ /**
+ * Validate project name using name pattern
+ *
+ * @param projectName
+ * @return If it is valid name, return true.
+ */
+ public static boolean isValidName(String projectName) {
+ Assert.notNull( projectName );
+
+ return projectName.matches( CommonProjectConstants.PROJECT_NAME_PATTERN );
+ }
+
+ /**
+ * Validate project name length
+ *
+ * @param projectName
+ * @return If it is valid name, return true.
+ */
+ public static boolean isValidNameLength(String projectName) {
+ Assert.notNull( projectName );
+
+ final int nameLength = projectName.length();
+ return CommonProjectConstants.PROJECT_NAME_MIN_LENGTH <= nameLength &&
+ nameLength <= CommonProjectConstants.PROJECT_NAME_MAX_LENGTH;
+ }
+
+ /**
+ * Validate whether segment have invalid char or not
+ *
+ * @param location project URI
+ * @return If have invalid character, return it. if not, return empty string.
+ */
+ public static String getInvalidChar(URI location) {
+ Assert.notNull( location );
+
+ if ( EFS.SCHEME_FILE.equals( location.getScheme() ) ) {
+ IPath pathPart = new Path( location.getSchemeSpecificPart() );
+ for ( String segment : pathPart.segments() ) {
+ for ( char invalidChar : CommonProjectConstants.INVALID_RESOURCE_CHARACTERS ) {
+ if ( segment.indexOf( invalidChar ) != -1 ) {
+ return String.valueOf( invalidChar );
+ }
+ }
+ }
+ }
+
+ return StringUtil.EMPTY_STRING;
+ }
+
+ /**
+ * Validate whether project really exist, or not
+ * @param location
+ * @return
+ */
+ public static boolean isExistProject(URI location) {
+ Assert.notNull( location );
+
+ return new File( location ).exists();
+ }
+
+ /**
+ * Validate a project location without the eclipse default validation
+ *
+ * @param projectName the project name
+ * @param projectLocation the real full path of this project
+ * @return error message. If no errors, return null.
+ */
+ public static String getValidatedMsgAboutLocation(String projectName, URI projectLocation) {
+ if ( ! isValidNameLength( projectName ) ) {
+ return NLS.bind( Messages.ValidationUtil_InvalidProjectNameLength,
+ CommonProjectConstants.PROJECT_NAME_MIN_LENGTH - 1,
+ CommonProjectConstants.PROJECT_NAME_MAX_LENGTH + 1);
+ }
+
+ if ( ! isValidName( projectName ) ) {
+ return Messages.ValidationUtil_InvalidProjectName;
+ }
+
+ String invalidChar = getInvalidChar( projectLocation );
+ if ( ! invalidChar.isEmpty() ) {
+ return NLS.bind( Messages.ValidationUtil_InvalidSegment, invalidChar );
+ }
+
+ if ( isExistProject( projectLocation ) ) {
+ return Messages.ValidationUtil_AlreadyExistProject;
+ }
+
+ return StringUtil.EMPTY_STRING;
+ }
+}
--- /dev/null
+ValidationUtil_AlreadyExistProject=Project already exists or with a difference case
+ValidationUtil_InvalidProjectName=Invalid character is used in the project name
+ValidationUtil_InvalidProjectNameLength=Project name length should be longer than {0} and shorter than {1} characters
+ValidationUtil_InvalidSegment={0} is an invalid character in resource name.
--- /dev/null
+package org.tizen.common.project.util;
+
+import java.io.File;
+import java.net.URI;
+
+import org.junit.Test;
+import org.tizen.common.util.StringUtil;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+
+
+public class ProjectValidationUtilTest {
+
+ protected abstract class NullTestSuite {
+
+ public abstract void testMethod() throws Exception;
+
+ public void run() throws Exception {
+ try {
+ testMethod();
+ fail( "This method must throw IllegalArgumentException" );
+ } catch (IllegalArgumentException e) {
+ // Success test
+ }
+ }
+ }
+
+ @Test
+ public void test_isValidProjectName() throws Exception {
+ // Null test
+ new NullTestSuite() {
+ @Override
+ public void testMethod() throws Exception {
+ ProjectValidationUtil.isValidName( null );
+ }
+ }.run();
+
+ final Object[][] TEST_CASES = new Object[][] {
+ new Object[] { "", false },
+ new Object[] { "ab", false },
+ new Object[] { "1ab", false },
+ new Object[] { "ab_", false },
+ new Object[] { "abc", true },
+ new Object[] { "a1-", true },
+ new Object[] { "abcdefghij0123456789012345678901234567890123456789", true },
+ new Object[] { "abcdefghij01234567890123456789012345678901234567890", false }
+ };
+
+ for ( Object[] TEST_CASE : TEST_CASES ) {
+ String projectName = (String) TEST_CASE[0];
+ boolean expectResult = (Boolean) TEST_CASE[1];
+ assertEquals( ProjectValidationUtil.isValidName( projectName ), expectResult );
+ }
+ }
+
+ @Test
+ public void test_isValidProjectNameLength() throws Exception {
+ // Null test
+ new NullTestSuite() {
+ @Override
+ public void testMethod() throws Exception {
+ ProjectValidationUtil.isValidNameLength( null );
+ }
+ }.run();
+
+ final Object[][] TEST_CASES = new Object[][] {
+ new Object[] { "", false },
+ new Object[] { "ab", false },
+ new Object[] { "1ab", true },
+ new Object[] { "ab_", true },
+ new Object[] { "abc", true },
+ new Object[] { "a1-", true },
+ new Object[] { "abcdefghij0123456789012345678901234567890123456789", true },
+ new Object[] { "abcdefghij01234567890123456789012345678901234567890", false }
+ };
+
+ for ( Object[] TEST_CASE : TEST_CASES ) {
+ String projectName = (String) TEST_CASE[0];
+ boolean expectResult = (Boolean) TEST_CASE[1];
+ assertEquals( ProjectValidationUtil.isValidNameLength( projectName ), expectResult );
+ }
+ }
+
+ @Test
+ public void test_isContainedInvalidChar() throws Exception {
+ // Null test
+ new NullTestSuite() {
+ @Override
+ public void testMethod() throws Exception {
+ ProjectValidationUtil.getInvalidChar( null );
+ }
+ }.run();
+
+ final Object[][] TEST_CASES = new Object[][] {
+ new Object[] { "", StringUtil.EMPTY_STRING },
+ new Object[] { "ab", StringUtil.EMPTY_STRING },
+ new Object[] { "1ab", StringUtil.EMPTY_STRING },
+ new Object[] { "ab_", StringUtil.EMPTY_STRING },
+ new Object[] { "ab`", "`" },
+ new Object[] { "a#b", "#" },
+ new Object[] { "a$b", "$" },
+ new Object[] { "a:v", ":" }
+ };
+
+
+ for ( Object[] TEST_CASE : TEST_CASES ) {
+ String segment = (String) TEST_CASE[0];
+ String expectResult = (String) TEST_CASE[1];
+
+ URI segmentURI = new File( segment ).toURI();
+
+ assertEquals( ProjectValidationUtil.getInvalidChar( segmentURI ), expectResult );
+ }
+ }
+
+}
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
-Bundle-Name: Tizen Common sdblib
+Bundle-Name: %Bundle-Name
+Bundle-Vendor: %Bundle-Vendor
Bundle-SymbolicName: org.tizen.common.sdblib
-Bundle-Vendor: The Linux Foundation
-Bundle-Version: 1.0.0.qualifier
+Bundle-Version: 2.0.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Export-Package: org.tizen.sdblib
--- /dev/null
+Bundle-Name = Tizen Common sdblib
+Bundle-Vendor = The Linux Foundation
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
- .
+ .,\
+ OSGI-INF/
import org.tizen.sdblib.SyncService.SyncResult;
-
-
/**
* A Device. It can be a physical device or an emulator.
*/
final class Device implements IDevice {
-
- private final static int INSTALL_TIMEOUT = 2*60*1000; //2min
+
+ private final static int INSTALL_TIMEOUT = 2 * 60 * 1000; // 2min
final static String COMMAND_ARCHITECTURE_INFO = "uname -m";
final static String EMULATOR = "emulator";
final static String COMMAND_DEVICE_TYPE = "[ -f /dev/samsung_sdb ] || echo " + EMULATOR;
+ public final static String DEFAULT_APP_INSTALL_PATH = "/opt/usr/apps";
+ public final static String PKG_TOOL_INSTALL_PATH_COMMAND = "/usr/bin/pkgcmd -a";
+ public final static String PKG_TOOL_INSTALL_PATH_COMMAND_RESULT = "Tizen Application Installation Path:";
/** Serial number of the device */
private String mSerialNumber = null;
private DeviceMonitor mMonitor;
private static final String LOG_TAG = "Device";
-
+
private SdbShellProcess sdbShellProcess = null;
+
+ private String appInstallPath = "";
public String getSerialNumber() {
return mSerialNumber;
return mState == DeviceState.OFFLINE;
}
- public SyncService getSyncService()
- throws TimeoutException, SdbCommandRejectedException, IOException {
+ public SyncService getSyncService() throws TimeoutException, SdbCommandRejectedException, IOException {
SyncService syncService = new SyncService(SmartDevelopmentBridge.getSocketAddress(), this);
if (syncService.openSync()) {
return syncService;
- }
+ }
return null;
}
public FileListingService getFileListingService() {
return new FileListingService(this);
}
-
+
public SdbShellProcess executeShellCommand(String command) throws IOException {
- SmartDevelopmentBridge sdb = SmartDevelopmentBridge.getBridge();
- if (sdb == null)
- return null;
- String sdbPath = sdb.getSdbOsLocation();
- if (sdbPath == null)
- return null;
- if (mSerialNumber == null)
- return null;
-
- String sdbShellCmd = sdbPath + " -s " + mSerialNumber + " shell";
- Process pSdb = Runtime.getRuntime().exec(sdbShellCmd);
- sdbShellProcess = new SdbShellProcess(pSdb, command);
- return sdbShellProcess;
+ SmartDevelopmentBridge sdb = SmartDevelopmentBridge.getBridge();
+ if (sdb == null)
+ return null;
+ String sdbPath = sdb.getSdbOsLocation();
+ if (sdbPath == null)
+ return null;
+ if (mSerialNumber == null)
+ return null;
+
+ String sdbShellCmd = sdbPath + " -s " + mSerialNumber + " shell";
+ Process pSdb = Runtime.getRuntime().exec(sdbShellCmd);
+ sdbShellProcess = new SdbShellProcess(pSdb, command);
+ return sdbShellProcess;
}
-
- public void executeShellCommand(String command, IShellOutputReceiver receiver)
- throws TimeoutException, SdbCommandRejectedException, ShellCommandUnresponsiveException,
- IOException {
- SdbHelper.executeRemoteCommand(SmartDevelopmentBridge.getSocketAddress(), command, this,
- receiver, SdbPreferences.getTimeOut());
+
+ public void executeShellCommand(String command, IShellOutputReceiver receiver) throws TimeoutException,
+ SdbCommandRejectedException, ShellCommandUnresponsiveException, IOException {
+ SdbHelper.executeRemoteCommand(SmartDevelopmentBridge.getSocketAddress(), command, this, receiver,
+ SdbPreferences.getTimeOut());
}
- public void executeShellCommand(String command, IShellOutputReceiver receiver,
- int maxTimeToOutputResponse)
- throws TimeoutException, SdbCommandRejectedException, ShellCommandUnresponsiveException,
- IOException {
- SdbHelper.executeRemoteCommand(SmartDevelopmentBridge.getSocketAddress(), command, this,
- receiver, maxTimeToOutputResponse);
+ public void executeShellCommand(String command, IShellOutputReceiver receiver, int maxTimeToOutputResponse)
+ throws TimeoutException, SdbCommandRejectedException, ShellCommandUnresponsiveException, IOException {
+ SdbHelper.executeRemoteCommand(SmartDevelopmentBridge.getSocketAddress(), command, this, receiver,
+ maxTimeToOutputResponse);
}
- public void runEventLogService(LogReceiver receiver)
- throws TimeoutException, SdbCommandRejectedException, IOException {
+ public void runEventLogService(LogReceiver receiver) throws TimeoutException, SdbCommandRejectedException, IOException {
SdbHelper.runEventLogService(SmartDevelopmentBridge.getSocketAddress(), this, receiver);
}
- public void runLogService(String logname, LogReceiver receiver)
- throws TimeoutException, SdbCommandRejectedException, IOException {
+ public void runLogService(String logname, LogReceiver receiver) throws TimeoutException, SdbCommandRejectedException,
+ IOException {
SdbHelper.runLogService(SmartDevelopmentBridge.getSocketAddress(), this, logname, receiver);
}
- public void createForward(int localPort, int remotePort)
- throws TimeoutException, SdbCommandRejectedException, IOException {
+ public void createForward(int localPort, int remotePort) throws TimeoutException, SdbCommandRejectedException, IOException {
SdbHelper.createForward(SmartDevelopmentBridge.getSocketAddress(), this, localPort, remotePort);
}
- public void removeForward(int localPort, int remotePort)
- throws TimeoutException, SdbCommandRejectedException, IOException {
+ public void removeForward(int localPort, int remotePort) throws TimeoutException, SdbCommandRejectedException, IOException {
SdbHelper.removeForward(SmartDevelopmentBridge.getSocketAddress(), this, localPort, remotePort);
}
return mMonitor;
}
+ /**
+ * This method is for updating device state information
+ * and notify the listener of a modified IDevice.
+ *
+ * @param changeMask
+ */
void update(int changeMask) {
mMonitor.getServer().deviceChanged(this, changeMask);
}
- public String syncPackageToDevice(String localFilePath)
- throws IOException, SdbCommandRejectedException, TimeoutException {
+ /**
+ * This method is for updating device state and name information
+ * and notify the listener of a modified IDevice.
+ *
+ * @param changeMask
+ * @param name changed name
+ */
+ void update(int changeMask, String name) {
+ mDeviceName = name;
+ update(changeMask);
+ }
+
+ public String syncPackageToDevice(String localFilePath) throws IOException, SdbCommandRejectedException, TimeoutException {
try {
String packageFileName = getFileName(localFilePath);
- String remoteFilePath = String.format("/opt/apps/tmp/%1$s", packageFileName); //$NON-NLS-1$
+ String remoteFilePath = String.format("/tmp/%1$s", packageFileName); //$NON-NLS-1$
- Log.d(packageFileName, String.format("Uploading %1$s onto device '%2$s'",
- packageFileName, getSerialNumber()));
+ Log.d(packageFileName, String.format("Uploading %1$s onto device '%2$s'", packageFileName, getSerialNumber()));
SyncService sync = getSyncService();
if (sync != null) {
- String message = String.format("Uploading file onto device '%1$s'",
- getSerialNumber());
+ String message = String.format("Uploading file onto device '%1$s'", getSerialNumber());
Log.d(LOG_TAG, message);
- SyncResult result = sync.pushFile(localFilePath, remoteFilePath,
- SyncService.getNullProgressMonitor());
+ SyncResult result = sync.pushFile(localFilePath, remoteFilePath, SyncService.getNullProgressMonitor());
if (result.getCode() != SyncService.RESULT_OK) {
- throw new IOException(String.format("Unable to upload file: %1$s",
- result.getMessage()));
+ throw new IOException(String.format("Unable to upload file: %1$s", result.getMessage()));
}
} else {
throw new IOException("Unable to open sync connection!");
Log.e(LOG_TAG, "Unable to open sync connection! Timeout.");
throw e;
} catch (IOException e) {
- Log.e(LOG_TAG, String.format("Unable to open sync connection! reason: %1$s",
- e.getMessage()));
+ Log.e(LOG_TAG, String.format("Unable to open sync connection! reason: %1$s", e.getMessage()));
throw e;
}
}
/**
* Helper method to retrieve the file name given a local file path
- * @param filePath full directory path to file
+ *
+ * @param filePath
+ * full directory path to file
* @return {@link String} file name
*/
private String getFileName(String filePath) {
/**
* {@inheritDoc}
*/
- public void removeRemotePackage(String remoteFilePath)
- throws TimeoutException, SdbCommandRejectedException, ShellCommandUnresponsiveException,
- IOException {
+ public void removeRemotePackage(String remoteFilePath) throws TimeoutException, SdbCommandRejectedException,
+ ShellCommandUnresponsiveException, IOException {
// now we delete the app we sync'ed
try {
executeShellCommand("rm " + remoteFilePath, new NullOutputReceiver(), INSTALL_TIMEOUT);
} catch (IOException e) {
- Log.e(LOG_TAG, String.format("Failed to delete temporary package: %1$s",
- e.getMessage()));
+ Log.e(LOG_TAG, String.format("Failed to delete temporary package: %1$s", e.getMessage()));
throw e;
}
}
- public Arch getArch()
- {
+ public Arch getArch() {
return mArch;
}
- public void checkArchitecture()
- {
- try
- {
+ public void checkArchitecture() {
+ try {
executeShellCommand(COMMAND_ARCHITECTURE_INFO, new ArchInfoReceiver());
- } catch (Exception e)
- {
- Log.e("sdb", "execute " + COMMAND_ARCHITECTURE_INFO + " failed:" + e);
+ } catch (Exception e) {
+ Log.e("sdb", "execute " + COMMAND_ARCHITECTURE_INFO + " failed:" + e);
}
}
-
- public void checkDeviceType()
- {
- try
- {
+
+ public void checkDeviceType() {
+ try {
executeShellCommand(COMMAND_DEVICE_TYPE, new DeviceTypeReceiver());
- } catch (Exception e)
- {
- Log.e("sdb", "execute " + COMMAND_DEVICE_TYPE + " failed:" + e);
+ } catch (Exception e) {
+ Log.e("sdb", "execute " + COMMAND_DEVICE_TYPE + " failed:" + e);
+ }
+ }
+
+ @Override
+ public String getAppInstallPath() {
+ if ( appInstallPath.isEmpty() ) {
+ try {
+ executeShellCommand(PKG_TOOL_INSTALL_PATH_COMMAND, new AppInstallPathReceiver());
+ } catch (Exception e) {
+ appInstallPath = "";
+ Log.e("sdb", "execute " + PKG_TOOL_INSTALL_PATH_COMMAND + " failed:" + e);
+ }
}
+ return appInstallPath;
}
- class ArchInfoReceiver extends MultiLineReceiver
- {
+ class AppInstallPathReceiver extends MultiLineReceiver {
@Override
- public void processNewLines(String[] lines)
- {
- if(lines[0] != null && !lines[0].contains(Arch.ARM.getArch()))
- {
+ public void processNewLines(String[] lines) {
+ for ( String line : lines ) {
+ if ( line.startsWith(Device.PKG_TOOL_INSTALL_PATH_COMMAND_RESULT) ) {
+ appInstallPath = line.replaceFirst(Device.PKG_TOOL_INSTALL_PATH_COMMAND_RESULT, "");
+ appInstallPath = appInstallPath.trim();
+ break;
+ }
+ }
+ }
+ }
+
+ class ArchInfoReceiver extends MultiLineReceiver {
+ @Override
+ public void processNewLines(String[] lines) {
+ boolean bFound = false;
+ for(String line : lines) {
+ if(line != null) {
+ if((line.toLowerCase().contains(Arch.ARM.getArch()))) {
+ bFound = true;
+ break;
+ }
+ }
+ }
+ if(bFound) {
+ mArch = Arch.ARM;
+ } else {
mArch = Arch.X86;
}
}
}
- class DeviceTypeReceiver extends MultiLineReceiver
- {
+ class DeviceTypeReceiver extends MultiLineReceiver {
@Override
- public void processNewLines(String[] lines)
- {
- if(EMULATOR.equals(lines[0]))
- {
- mIsEmulator = true;
+ public void processNewLines(String[] lines) {
+ for(String line : lines) {
+ if(line != null) {
+ if(EMULATOR.equals(line.toLowerCase())) {
+ mIsEmulator = true;
+ break;
+ }
+ }
}
}
}
import org.tizen.sdblib.IDevice.DeviceState;
import org.tizen.sdblib.SdbHelper.SdbResponse;
-
/**
* A Device monitor. This connects to the Smart Development Bridge and get device.
*/
private final ArrayList<Device> mDevices = new ArrayList<Device>();
/**
- * Creates a new {@link DeviceMonitor} object and links it to the running
- * {@link SmartDevelopmentBridge} object.
- * @param server the running {@link SmartDevelopmentBridge}.
+ * Creates a new {@link DeviceMonitor} object and links it to the running {@link SmartDevelopmentBridge} object.
+ *
+ * @param server
+ * the running {@link SmartDevelopmentBridge}.
*/
DeviceMonitor(SmartDevelopmentBridge server) {
mServer = server;
}
}
-
-
/**
* Returns if the monitor is currently connected to the debug bridge server.
+ *
* @return
*/
boolean isMonitoring() {
Log.d("DeviceMonitor", "start sdb");
if (mServer.startSdb() == false) {
mRestartAttemptCount++;
- Log.e("DeviceMonitor",
- "sdb restart attempts: " + mRestartAttemptCount);
+ Log.e("DeviceMonitor", "sdb restart attempts: " + mRestartAttemptCount);
}
waitABit();
} else {
// read the incoming message
processIncomingDeviceData(length);
- // flag the fact that we have build the list at least once.
+ // flag the fact that we have build the list at least
+ // once.
mInitialDeviceListDone = true;
}
}
/**
* Attempts to connect to the debug bridge server.
+ *
* @return a connect socket if success, null otherwise
*/
private SocketChannel openSdbConnection() {
}
/**
- *
+ *
* @return
* @throws IOException
*/
try {
SdbHelper.write(mMainSdbConnection, request);
- SdbResponse resp = SdbHelper.readSdbResponse(mMainSdbConnection,
- false /* readDiagString */);
+ SdbResponse resp = SdbHelper.readSdbResponse(mMainSdbConnection, false /* readDiagString */);
if (resp.okay == false) {
// request was refused by sdb!
/**
* Processes an incoming device message from the socket
+ *
* @param socket
* @param length
* @throws IOException
String[] param = d.split("\t"); // $NON-NLS-1$
if (param.length == 3) {
// new sdb uses only serial numbers to identify devices
- Device device = new Device(this, param[0].trim() /*serialnumber*/,
- DeviceState.getState(param[1].trim()),
- param[2].trim() /*device name*/);
+ Device device = new Device(this, param[0].trim() /* serialnumber */, DeviceState.getState(param[1].trim()),
+ param[2].trim() /* device name */);
- //add the device to the list
+ // add the device to the list
list.add(device);
Log.d("DeviceMonitor", "deviceData: " + device.getSerialNumber() + " added to list");
}
}
/**
- * Updates the device list with the new items received from the monitoring service.
+ * Updates the device list with the new items received from the monitoring service.
*/
private void updateDevices(ArrayList<Device> newList) {
// because we are going to call mServer.deviceDisconnected which will acquire this lock
synchronized (mDevices) {
// For each device in the current list, we look for a matching the new list.
// * if we find it, we update the current object with whatever new information
- // there is
- // (mostly state change, if the device becomes ready, we query for build info).
- // We also remove the device from the new list to mark it as "processed"
+ // there is (mostly state change, if the device becomes ready, we query for build info).
+ // We also remove the device from the new list to mark it as "processed"
// * if we do not find it, we remove it from the current list.
// Once this is done, the new list contains device we aren't monitoring yet, so we
// add them to the list, and start monitoring them.
- for (int d = 0 ; d < mDevices.size() ;) {
+ for (int d = 0; d < mDevices.size();) {
Device device = mDevices.get(d);
// look for a similar device in the new list.
int count = newList.size();
boolean foundMatch = false;
- for (int dd = 0 ; dd < count ; dd++) {
+ for (int dd = 0; dd < count; dd++) {
Device newDevice = newList.get(dd);
// see if it matches in id and serial number.
if (newDevice.getSerialNumber().equals(device.getSerialNumber())) {
if (device.getState() != newDevice.getState()) {
device.setState(newDevice.getState());
- //should to check architecture if device is an emulator and state changed from "off-lined" to "on-lined"
- if(device.getState() == DeviceState.ONLINE)
- {
+ // should to check architecture if device is an
+ // emulator and state changed from "off-lined" to "on-lined"
+ if (device.getState() == DeviceState.ONLINE) {
device.checkArchitecture();
device.checkDeviceType();
Log.d("DeviceMonitor", "updateDevices: " + device.getSerialNumber() + " onlined");
- device.update(Device.CHANGE_STATE);
+ device.update(Device.CHANGE_STATE, newDevice.getDeviceName());
}
}
// remove the new device from the list since it's been used
}
if (foundMatch == false) {
- // the device is gone, we need to remove it, and keep current index
- // to process the next one.
+ // the device is gone, we need to remove it, and keep current index to process the next one.
removeDevice(device);
mServer.deviceDisconnected(device);
Log.d("DeviceMonitor", "updateDevices: " + device.getSerialNumber() + " off-lined");
}
}
- // at this point we should still have some new devices in newList, so we
- // process them.
+ // at this point we should still have some new devices in newList, so we process them.
for (Device newDevice : newList) {
- //should to check architecture if new device is an emulator on-lined
- if(newDevice.isOnline())
- {
+ // should to check architecture if new device is an emulator on-lined
+ if (newDevice.isOnline()) {
newDevice.checkArchitecture();
newDevice.checkDeviceType();
}
mDevices.remove(device);
}
-
/**
* Reads the length of the next message from a socket.
- * @param socket The {@link SocketChannel} to read from.
+ *
+ * @param socket
+ * The {@link SocketChannel} to read from.
* @return the length, or 0 (zero) if no data is available from the socket.
- * @throws IOException if the connection failed.
+ * @throws IOException
+ * if the connection failed.
*/
private int readLength(SocketChannel socket, byte[] buffer) throws IOException {
String msg = read(socket, buffer);
// we'll throw an exception below.
Log.e("sdb", "parse integer failed:" + nfe);
}
- }
+ }
// we receive something we can't read. It's better to reset the connection at this point.
throw new IOException("Unable to read length");
/**
* Fills a buffer from a socket.
+ *
* @param socket
* @param buffer
* @return the content of the buffer as a string, or null if it failed to convert the buffer.
void removeRemotePackage(String remoteFilePath)
throws TimeoutException, SdbCommandRejectedException, ShellCommandUnresponsiveException,
IOException;
+
+ /**
+ * Returns application's installation path.
+ */
+ String getAppInstallPath();
}
mChannel.close();
} catch (IOException e2) {
// we want to throw the original exception, so we ignore this one.
- Log.e("sdb", "close failed:" + e2);
+ Log.e("sdb", "close failed:" + e2);
}
mChannel = null;
}
mChannel.close();
} catch (IOException e2) {
// we want to throw the original exception, so we ignore this one.
- Log.e("sdb", "close failed:" + e);
+ Log.e("sdb", "close failed:" + e);
}
mChannel = null;
}
mChannel.close();
} catch (IOException e) {
// nothing to be done really...
- Log.e("sdb", "close failed:" + e);
+ Log.e("sdb", "close failed:" + e);
}
mChannel = null;
}
*/
private static String errorCodeToString(int code) {
switch (code) {
- case RESULT_OK:
- return "Success.";
- case RESULT_CANCELED:
- return "Transfer canceled by the user.";
- case RESULT_UNKNOWN_ERROR:
- return "Unknown Error.";
- case RESULT_CONNECTION_ERROR:
- return "sdb Connection Error.";
- case RESULT_NO_REMOTE_OBJECT:
- return "Remote object doesn't exist!";
- case RESULT_TARGET_IS_FILE:
- return "Target object is a file.";
- case RESULT_NO_DIR_TARGET:
- return "Target directory doesn't exist.";
- case RESULT_REMOTE_PATH_ENCODING:
- return "Remote Path encoding is not supported.";
- case RESULT_REMOTE_PATH_LENGTH:
- return "Remove path is too long.";
- case RESULT_FILE_WRITE_ERROR:
- return "Writing local file failed!";
- case RESULT_FILE_READ_ERROR:
- return "Reading local file failed!";
- case RESULT_NO_LOCAL_FILE:
- return "Local file doesn't exist.";
- case RESULT_LOCAL_IS_DIRECTORY:
- return "Local path is a directory.";
- case RESULT_REMOTE_IS_FILE:
- return "Remote path is a file.";
- case RESULT_BUFFER_OVERRUN:
- return "Receiving too much data.";
- case RESULT_CONNECTION_TIMEOUT:
- return "timeout";
- case RESULT_FILE_EXIST:
- return "File exists.";
- case RESULT_FAIL_DELETE_FILE:
- return "Fail delete file.";
- case RESULT_FAIL_CREATE_FILE:
- return "Fail create file.";
+ case RESULT_OK:
+ return "Success.";
+ case RESULT_CANCELED:
+ return "Transfer canceled by the user.";
+ case RESULT_UNKNOWN_ERROR:
+ return "Unknown Error.";
+ case RESULT_CONNECTION_ERROR:
+ return "sdb Connection Error.";
+ case RESULT_NO_REMOTE_OBJECT:
+ return "Remote object doesn't exist!";
+ case RESULT_TARGET_IS_FILE:
+ return "Target object is a file.";
+ case RESULT_NO_DIR_TARGET:
+ return "Target directory doesn't exist.";
+ case RESULT_REMOTE_PATH_ENCODING:
+ return "Remote Path encoding is not supported.";
+ case RESULT_REMOTE_PATH_LENGTH:
+ return "Remove path is too long.";
+ case RESULT_FILE_WRITE_ERROR:
+ return "Writing local file failed!";
+ case RESULT_FILE_READ_ERROR:
+ return "Reading local file failed!";
+ case RESULT_NO_LOCAL_FILE:
+ return "Local file doesn't exist.";
+ case RESULT_LOCAL_IS_DIRECTORY:
+ return "Local path is a directory.";
+ case RESULT_REMOTE_IS_FILE:
+ return "Remote path is a file.";
+ case RESULT_BUFFER_OVERRUN:
+ return "Receiving too much data.";
+ case RESULT_CONNECTION_TIMEOUT:
+ return "timeout";
+ case RESULT_FILE_EXIST:
+ return "File exists.";
+ case RESULT_FAIL_DELETE_FILE:
+ return "Fail delete file.";
+ case RESULT_FAIL_CREATE_FILE:
+ return "Fail create file.";
}
throw new RuntimeException();
return result;
}
-
+
/**
* Pulls file(s) or folder(s).
* @param entries the remote item(s) to pull
for (String path : local) {
files.add(new File(path));
}
-
+
monitor.start(-1);
-
+
monitor.startSubTask(MESSAGE_SIZECHECKING);
// get the total count of the bytes to transfer
}
TransferInfo sizeInfo = new TransferInfo();
-
+
monitor.start(sizeInfo.downSizing(total));
SyncResult result = doPush(fileArray, remote.getFullPath(), monitor, sizeInfo, timeOut);
return count;
}
-
+
/**
* compute the recursive file size of all the files in the list. Folder
* have a weight of 1.
return count;
}
-
+
/**
* compute the recursive file size of all the files in the list. Folder
* have a weight of 1.
return count;
}
-
+
/**
* compute the recursive file size of all the files in the list. Folder
* have a weight of 1.
return count;
}
-
+
/**
* compute the recursive file size of all the files in the list. Folder
* have a weight of 1.
return new SyncResult(RESULT_OK);
}
-
+
/**
* Pulls multiple files/folders recursively.
* @param entries The list of entry to pull
}
// get type (we only pull directory and files for now)
-// monitor.startSubTask(e.getFullPath());
+ // monitor.startSubTask(e.getFullPath());
transferInfo.setDest(e.getFullPath());
String dest = localPath + File.separator + e.getName();
SyncResult result;
ISyncProgressMonitor monitor) {
return doPullFile(remotePath, localPath, monitor, null, SdbPreferences.getTimeOut());
}
-
+
/**
* Pulls a remote file
* @param remotePath the remote file (length max is 1024)
} catch (IOException e) {
return new SyncResult(RESULT_FILE_WRITE_ERROR, e);
}
-
+
if(transferInfo != null)
{
transferInfo.monitorAdvance(length, monitor);
} catch (IOException e) {
return new SyncResult(RESULT_FILE_WRITE_ERROR, e);
}
-
+
return new SyncResult(RESULT_OK);
}
remoteFile = remotePath + "/" + f.getName();
}
transferInfo.setDest(remoteFile);
-
+
if (f.isDirectory()) {
// append the name of the directory to the remote path
-// String dest = remotePath + "/" + f.getName(); // $NON-NLS-1S
-// monitor.startSubTask(dest);
+ // String dest = remotePath + "/" + f.getName(); // $NON-NLS-1S
+ // monitor.startSubTask(dest);
SyncResult result = doPush(f.listFiles(), remoteFile, monitor, transferInfo, timeOut);
if (result.mCode != RESULT_OK) {
monitor.advance(1);
} else if (f.isFile()) {
// append the name of the file to the remote path
-// String remoteFile = remotePath + "/" + f.getName(); // $NON-NLS-1S
-// monitor.startSubTask(remoteFile);
-// transferInfo.fileName = remoteFile;
+ // String remoteFile = remotePath + "/" + f.getName(); // $NON-NLS-1S
+ // monitor.startSubTask(remoteFile);
+ // transferInfo.fileName = remoteFile;
SyncResult result = doPushFile(f.getAbsolutePath(), remoteFile, monitor, transferInfo, timeOut);
if (result.mCode != RESULT_OK) {
return result;
ISyncProgressMonitor monitor) {
return doPushFile( localPath, remotePath, monitor, null, SdbPreferences.getTimeOut());
}
-
+
/**
* Push a single file with permission 755
* @param localPath the local file to push
private int remains = 0;
private long total_size = 0;
private long transfered_size = 0;
-
+
TransferInfo(){}
/**
{
to = dest;
}
-
+
public void setSrc(String src)
{
from = src;
public void monitorAdvance(int count, ISyncProgressMonitor monitor)
{
transfered_size += count;
-
+
int size = remains + count ;
if(size > rate)
{
remains = size;
}
-
+
if(from != null)
{
- monitor.startSubTask(String.format("From\t\"%s\"\tto\t\"%s\"\n( %s / %s ) ", from, to, getSizeAndUnit(transfered_size), total_sizeAndunit));
+ monitor.startSubTask(String.format("%s\t%s\t( %s / %s )", from, to, getSizeAndUnit(transfered_size), total_sizeAndunit));
}
}
switch(index)
{
- case 0:
- unit = "B";
- break;
- case 1:
- unit = "KB";
- break;
- case 2:
- unit = "MB";
- break;
- case 3:
- unit = "GB";
- return String.format("%.2f %s", size_for_GB, unit);
+ case 0:
+ unit = "B";
+ break;
+ case 1:
+ unit = "KB";
+ break;
+ case 2:
+ unit = "MB";
+ break;
+ case 3:
+ unit = "GB";
+ return String.format("%.2f %s", size_for_GB, unit);
}
return String.format("%d %s", short_size, unit);
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
+ <classpathentry exported="true" kind="lib" path="lib/commons-codec-1.4.jar"/>
<classpathentry exported="true" kind="lib" path="lib/HashSign.jar"/>
<classpathentry exported="true" kind="lib" path="lib/xmlsec-1.5.3.jar"/>
<classpathentry exported="true" kind="lib" path="lib/CertificateGenerator.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
+ <classpathentry kind="src" path="test/src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name
Bundle-SymbolicName: org.tizen.common.sign; singleton:=true
-Bundle-Version: 1.0.0.qualifier
+Bundle-Version: 2.0.0.qualifier
Bundle-Activator: org.tizen.common.sign.Activator
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
- org.tizen.common
+ org.tizen.common,
+ org.eclipse.help
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Import-Package: org.eclipse.core.resources
Bundle-ClassPath: lib/CertificateGenerator.jar,
.,
lib/HashSign.jar,
- lib/xmlsec-1.5.3.jar
+ lib/xmlsec-1.5.3.jar,
+ lib/commons-codec-1.4.jar
lib/HashSign.jar,\
lib/xmlsec-1.5.3.jar,\
about_files/,\
- about.html
+ about.html,\
+ lib/commons-codec-1.4.jar
name="%page.name">
</page>
</extension>
-
+
+ <extension
+ point="org.tizen.common.prompter">
+ <prompter
+ class="org.tizen.common.sign.SigningPrompter"
+ scope="org.tizen.common.sign.signer.SignatureGenerator">
+ </prompter>
+ </extension>
</plugin>
--- /dev/null
+package org.tizen.common.sign;
+
+import static org.tizen.common.util.SWTUtil.syncExec;
+
+import java.util.concurrent.atomic.AtomicBoolean;
+
+import org.tizen.common.core.command.CommandCancelException;
+import org.tizen.common.core.command.prompter.SWTPrompter;
+import org.tizen.common.sign.exception.SigningErrorDialog;
+
+public class SigningPrompter extends SWTPrompter {
+
+ @Override
+ public void error(final String message) {
+ final AtomicBoolean isCanceled = new AtomicBoolean( false );
+
+ syncExec( new Runnable() {
+ @Override
+ public void run() {
+ final SigningErrorDialog dialog = new SigningErrorDialog( message );
+ if ( SigningErrorDialog.CANCEL == dialog.open() ) {
+ isCanceled.set( true );
+ }
+ }
+ } );
+
+ if ( isCanceled.get() ) {
+ throw new CommandCancelException();
+ }
+ }
+
+}
return;
}
- if ( !SigningProfileUtil.hasPassword( authorItem ) ||
- ( hasDistributor && !SigningProfileUtil.hasPassword( distributorItem ) ) ) {
+ if ( ! authorItem.hasPassword() ||
+ ( hasDistributor && ! distributorItem.hasPassword() ) ) {
ArrayList<UserField> fieldList = new ArrayList<UserField>();
}
protected boolean isValidItem(SigningProfileItem item) {
- if ( item == null ) {
- return false;
- }
-
- return SigningProfileUtil.hasKeyLocation( item );
+ return item == null ? false : item.hasKeyLocation();
}
protected SigningProfileItem getItem(boolean author) {
--- /dev/null
+/*
+ * Web IDE - sign
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * BonYong Lee <bonyong.lee@samsung.com>
+ *
+ * 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.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+package org.tizen.common.sign.command;
+
+import java.io.IOException;
+import java.util.List;
+
+import org.apache.commons.lang3.time.StopWatch;
+import org.tizen.common.core.command.ExecutionContext;
+import org.tizen.common.core.command.Executor;
+import org.tizen.common.core.command.Policy;
+import org.tizen.common.core.command.file.FileHandlingCommand;
+import org.tizen.common.core.command.policy.MessagePolicy;
+import org.tizen.common.file.FileHandler;
+import org.tizen.common.file.FileHandler.Attribute;
+import org.tizen.common.file.FileHandler.Type;
+import org.tizen.common.sign.exception.CertificationException;
+import org.tizen.common.sign.preferences.SigningProfileItem;
+import org.tizen.common.sign.signer.TizenSigner;
+import org.tizen.common.sign.util.SignatureUtility;
+import org.tizen.common.util.Assert;
+import org.tizen.common.util.StringUtil;
+
+
+public class SignCommand extends FileHandlingCommand<Object> {
+
+ // active profile name
+ protected String profileName;
+
+ protected List<SigningProfileItem> profileItems;
+
+ // categorized profiles
+ protected SigningProfileItem authorProfile = null;
+ protected SigningProfileItem distributor1Profile = null;
+ protected SigningProfileItem distributor2Profile = null;
+
+ protected boolean bRDS;
+
+
+ // Constructor
+ public SignCommand(final String root, final String profileName, final List<SigningProfileItem> profileItems) {
+ this( root, profileName, profileItems, false );
+ }
+
+ public SignCommand(final String root, final String profileName, final List<SigningProfileItem> profileItems, boolean bRDS) {
+ this.path = root;
+ this.profileName = profileName;
+ this.profileItems = profileItems;
+ this.bRDS = bRDS;
+ }
+
+ protected String getActiveProfileName() {
+ return this.profileName;
+ }
+
+ public void run(final Executor executor, final ExecutionContext context) throws IOException, CertificationException {
+ final FileHandler handler = context.getFileHandler();
+ Assert.notNull( handler );
+
+ if ( !handler.is( this.path, Attribute.EXISTS ) ) {
+ logger.error( "{} doesn't exist", this.path );
+// final Policy policy = context.getPolicy( Policy.NONEXIST_IN_PROJECT );
+// final MessagePolicy messagePolicy = policy.adapt( MessagePolicy.class );
+//
+// messagePolicy.print( context.getPrompter(), "{0} doesn't exist", this.path );
+ return ;
+ }
+
+ final String appDirPath = (String) handler.get( this.path, Attribute.PATH );
+
+ // categorize profile
+ categorizeProfiles();
+
+ // remove old signatures
+ for ( String child : handler.list( appDirPath ) ) {
+ Object type = handler.get( child, Attribute.TYPE );
+ if ( Type.FILE.equals( type ) ) {
+ Object nameObj = handler.get( child, Attribute.NAME );
+ if ( nameObj instanceof String ) {
+ String name = (String) nameObj;
+ if ( SignatureUtility.isSignatureFile( name ) ) {
+ handler.removeFile( child );
+ }
+ }
+ }
+ }
+
+ StopWatch stopWatch = new StopWatch();
+ try {
+ stopWatch.start();
+
+ // If option for launch is false, must have author profile.
+ if ( this.authorProfile != null ) {
+ signAuthor( appDirPath, this.authorProfile );
+ signDistributor1( appDirPath, this.distributor1Profile );
+ if ( this.distributor2Profile != null ) {
+ signDistributor2( appDirPath, this.distributor2Profile );
+ }
+ } else if ( this.distributor1Profile != null ) {
+ // sign developer profile only, no check
+ signDistributor1( appDirPath, this.distributor1Profile );
+ } else {
+ logger.error( "Profiles is not set. Author : {}, Dist1 : {}", this.authorProfile, this.distributor1Profile );
+ }
+ } catch (Exception e) {
+ context.getPrompter().error( e.getMessage() );
+ throw new CertificationException( "Can't create XML Signature file", e );
+ } catch (OutOfMemoryError e) {
+ context.getPrompter().error( e.getMessage() );
+ throw new CertificationException( "Can't create XML Signature file", e );
+ } finally {
+ logger.info( "Elapsed time for sign : {}ms", stopWatch.getTime() );
+ }
+ }
+
+ private void categorizeProfiles() {
+ for ( SigningProfileItem profileItem : this.profileItems ) {
+ if ( !StringUtil.isEmpty( profileItem.getKeyLocation() ) ) {
+ if ( profileItem.isAuthor() && this.authorProfile == null ) {
+ this.authorProfile = profileItem;
+ } else if ( this.distributor1Profile == null ) {
+ this.distributor1Profile = profileItem;
+ } else if ( this.distributor2Profile == null ) {
+ this.distributor2Profile = profileItem;
+ } else {
+ break;
+ }
+ }
+ }
+ }
+
+ private void signAuthor(String appDirPath, SigningProfileItem profileItem) throws Exception {
+ if ( this.bRDS ) {
+ TizenSigner.authorIncrementalSign( appDirPath,
+ getContentFilePath( profileItem ),
+ getContentFilePasswd( profileItem ),
+ getCaCertPath( profileItem ),
+ getRootCertPath( profileItem ) );
+ } else {
+ TizenSigner.authorSign( appDirPath,
+ getContentFilePath( profileItem ),
+ getContentFilePasswd( profileItem ),
+ getCaCertPath( profileItem ),
+ getRootCertPath( profileItem ) );
+ }
+ }
+
+ private void signDistributor1(String appDirPath, SigningProfileItem profileItem) throws Exception {
+ if ( this.bRDS ) {
+ TizenSigner.distIncrementalSign( appDirPath,
+ getContentFilePath( profileItem ),
+ getContentFilePasswd( profileItem ),
+ getCaCertPath( profileItem ),
+ getRootCertPath( profileItem ),
+ 1);
+ } else {
+ TizenSigner.distSign( appDirPath,
+ getContentFilePath( profileItem ),
+ getContentFilePasswd( profileItem ),
+ getCaCertPath( profileItem ),
+ getRootCertPath( profileItem ),
+ 1);
+ }
+ }
+
+ private void signDistributor2(String appDirPath, SigningProfileItem profileItem) throws Exception {
+ if ( this.bRDS ) {
+ TizenSigner.dist2IncrementalSignWithParameterCheck( appDirPath,
+ getContentFilePath( profileItem ),
+ getContentFilePasswd( profileItem ),
+ getCaCertPath( profileItem ),
+ getRootCertPath( profileItem )
+ );
+ } else {
+ TizenSigner.dist2SignWithParameterCheck( appDirPath,
+ getContentFilePath( profileItem ),
+ getContentFilePasswd( profileItem ),
+ getCaCertPath( profileItem ),
+ getRootCertPath( profileItem )
+ );
+ }
+ }
+
+ private String filterEmptyString(String msg, String content) {
+ String trimmedContent = StringUtil.trim( content );
+ logger.debug( msg, trimmedContent );
+ return ( trimmedContent != null && trimmedContent.isEmpty() ) ? null : trimmedContent;
+ }
+
+ private String getContentFilePath( final SigningProfileItem profileItem ) {
+ return filterEmptyString( "profile key path : {}" , profileItem.getKeyLocation() );
+ }
+
+ private String getContentFilePasswd( final SigningProfileItem profileItem ) {
+ return filterEmptyString( "profile key password : {}" , new String( profileItem.getPassword() ) );
+ }
+
+ private String getCaCertPath( final SigningProfileItem profileItem ) {
+ return filterEmptyString( "profile CA path : {}" , profileItem.getCAPath() );
+ }
+
+ private String getRootCertPath( final SigningProfileItem profileItem ) {
+ return filterEmptyString( "profile RootCA path : {}" , profileItem.getRootCAPath() );
+ }
+}
--- /dev/null
+/*
+ * Common - sign
+ *
+ * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jihoon Song <jihoon80.song@samsung.com>
+ * BonYong Lee <bonyong.lee@samsung.com>
+ * Kangho Kim <kh5325.kim@samsung.com>
+ *
+ * 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.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+package org.tizen.common.sign.model;
+
+import java.io.BufferedOutputStream;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.tizen.common.rds.DeltaResourceInfo;
+import org.tizen.common.util.Assert;
+import org.tizen.common.util.IOUtil;
+import org.tizen.common.sign.util.SignatureUtility;
+
+/**
+ * This class intends to manage a temporary delta information file
+ *
+ * @author JIhoon Song {@literal<jihoon80.song@samsung.com>}
+ */
+public class DeltaListResource {
+
+ protected final Logger logger = LoggerFactory.getLogger( getClass() );
+
+ public static final String FILENAME = ".delta.lst";
+
+ protected final String[][] typeKeyValue = { // { DeltaType, WritableCharacter }
+ { DeltaResourceInfo.TYPE_MODIFY, "C" }, // created, modified
+ { DeltaResourceInfo.TYPE_DELETE, "D" } // deleted
+ };
+
+ public static final String DELIMETER = "__DEL__";
+
+ protected IProject project; // target project
+ protected IContainer cwd; // build resource path
+ protected File listFile;
+
+
+ public DeltaListResource(IProject project, IContainer workgingFolder) {
+ Assert.notNull( project );
+ Assert.notNull( workgingFolder );
+
+ this.project = project;
+ this.cwd = workgingFolder;
+ this.listFile = this.cwd.getLocation().append( FILENAME ).toFile();
+ }
+
+ /**
+ * create a delta information file.
+ *
+ * @param deltaInfoList list using {@link org.tizen.common.rds.RdsDeployer#getDelta() }
+ * @param targetPathMap In case of difference with current working relative paths,
+ * will set a map of resources about the target directory.
+ * If this is null or no have info, use a current working relative path.
+ * @throws IOException
+ */
+ public void createListResource(List<DeltaResourceInfo> deltaInfoList, Map<DeltaResourceInfo, String> targetPathMap) throws IOException {
+ Assert.notNull( deltaInfoList );
+
+ logger.info( "create delta list for RDS" );
+
+ OutputStream os = null;
+ try {
+ os = new FileOutputStream( this.listFile );
+ os = new BufferedOutputStream( os );
+
+ final StringBuilder strBuilder = new StringBuilder();
+
+ IPath cwdLocation = this.cwd.getLocation();
+ for ( DeltaResourceInfo deltaInfo : deltaInfoList ) {
+ // make relative path
+ final IPath fullPath = new Path( deltaInfo.getFullPath() );
+ final IPath relativePath = fullPath.makeRelativeTo( cwdLocation );
+ if ( ! checkValidPath( relativePath ) ) {
+ continue;
+ }
+
+ // make list format ex. "/abc/def/ghi.jklC__DEL__def/ghi.jkl\n"
+
+ // ex. "/abc/def/ghi.jkl"
+ strBuilder.append( deltaInfo.getFullPath() );
+
+ // ex. "C"
+ for ( String[] type : this.typeKeyValue ) {
+ if ( type[0].equals( deltaInfo.getType() ) ) {
+ strBuilder.append( type[1] );
+ break;
+ }
+ }
+
+ // ex. "__DEL__"
+ strBuilder.append( DELIMETER );
+
+ // ex. "def/ghi.jkl"
+ if ( targetPathMap != null && targetPathMap.containsKey( deltaInfo ) ) {
+ strBuilder.append( targetPathMap.get( deltaInfo ) );
+ } else {
+ // default relative path
+ strBuilder.append( relativePath.toString() );
+ }
+
+ strBuilder.append( '\n' );
+ }
+
+ logger.debug( strBuilder.toString() );
+
+ os.write( strBuilder.toString().getBytes() );
+ } finally {
+ IOUtil.tryClose( os );
+ }
+ }
+
+ /**
+ * create a delta information file.
+ *
+ * @param deltaInfoList list using {@link org.tizen.common.rds.RdsDeployer#getDelta() }
+ * @throws IOException
+ */
+ public void createListResource(List<DeltaResourceInfo> deltaInfoList) throws IOException {
+ createListResource( deltaInfoList, null );
+ }
+
+ protected boolean checkValidPath(IPath path) {
+ Assert.notNull( path );
+
+ // if the parent path is not equalled
+ String firstSegment = path.segment( 0 );
+ if ( "..".equals( firstSegment ) ) {
+ return false;
+ }
+
+ // if hidden resource
+ String name = path.lastSegment();
+ if ( name.startsWith( "." ) ) {
+ return false;
+ }
+
+ // if signature resource
+ if ( SignatureUtility.isSignatureFile( firstSegment ) ) {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * a delta information file getter
+ * @return File. Because this may not exist, it is necessary to check a exist file.
+ */
+ public File getListResource() {
+ return this.listFile;
+ }
+
+ /**
+ * current working folder getter
+ * @return IContainer is equal to result of {@link BuildResourceManager#getLastWorkingFolder(IProject)}
+ */
+ public IContainer getCurrentWorkingFolder() {
+ return this.cwd;
+ }
+
+ /**
+ * remove a delta information file
+ * @return true if the file is successfully deleted or if don't neccessary to delete this file
+ */
+ public boolean removeListResource() {
+ Assert.notNull( this.listFile );
+
+ logger.debug( "remove {}", this.listFile.getAbsolutePath() );
+
+ return this.listFile.exists() && this.listFile.isFile() ? this.listFile.delete() : true;
+ }
+}
String DISTRIBUTOR_1ST = DISTRIBUTOR + "1";
String DISTRIBUTOR_2ND = DISTRIBUTOR + "2";
+ public static final String SIGNATURE_META_FILE = ".manifest.tmp";
+
}
AUTOINSERT_BTN=Insert signature at launching
PROFILES_COLUMN1=Certificate path
-PROFILES_COLUMN2=Pass
+PROFILES_COLUMN2=Password
PROFILES_COLUMN3=CA path(Optional)
PROFILES_COLUMN4=Root CA path(Optional)
PROFILES_ADD_BTN=Add
import org.eclipse.jface.dialogs.InputDialog;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.preference.PreferencePage;
+import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.jface.viewers.CellEditor;
import org.eclipse.jface.viewers.IFontProvider;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Link;
import org.eclipse.swt.widgets.ScrollBar;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.eclipse.ui.PlatformUI;
+import org.tizen.common.TizenHelpContextIds;
import org.tizen.common.sign.Activator;
import org.tizen.common.sign.model.Certification.KeyExtension;
import org.tizen.common.sign.util.SigningProfileUtil;
public class SigningPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
public static final String PREFERENCE_PAGE_ID = "org.tizen.common.sign.preferences.SigningPreferencePage"; //$NON-NLS-1$
+ private static final int GROUP_VINDENT = 5;
+
List<SigningProfile> profileList;
private TableViewer authorTableViewer;
private TableViewer distributorTableViewer;
private Button clearButton;
private Button distClearButton;
- public static String testCertKey = "testCert"; //$NON-NLS-1$
- private Button testCertButton;
-
private IPreferenceStore preferenceStore;
public SigningPreferencePage() {
layout.marginHeight = 0;
composite.setLayout(layout);
composite.setLayoutData(new GridData(GridData.FILL_BOTH));
- createTestCertButton(composite);
createProfileListButtons(composite);
createProfileItemsTable(composite);
return parent;
if (defaultButton != null) {
defaultButton.setVisible(false);
}
+
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, TizenHelpContextIds.HELP_COMMON_CERTIFICATE_GENERTOR_CONTEXT);
}
-
+
@Override
protected void contributeButtons(Composite parent) {
GridLayout layout = createGridLayout(3);
labelComposite.setLayout(compLayout);
GridData compData = new GridData(GridData.FILL_HORIZONTAL);
labelComposite.setLayoutData(compData);
-
-// final Label noteLabel = new Label(labelComposite, SWT.NONE);
-// noteLabel.setText( Messages.NOTE_LABEL );
-// noteLabel.setFont( new Font( getDisplay(), boldFont( noteLabel.getParent().getFont() ) ) );
-// GridData noteData = new GridData();
-// noteData.verticalAlignment = SWT.TOP;
-// noteLabel.setLayoutData( noteData );
-
-// Label label = new Label(labelComposite, SWT.WRAP);
-// Font smallFont = new Font(Display.getDefault(), smallFont(label.getParent().getFont()));
-// label.setFont(smallFont);
-// label.setText( Messages.NOTE_DESC );
}
- private void createTestCertButton(Composite composite) {
- this.testCertButton = new Button(composite, SWT.LEFT | SWT.CHECK);
- this.testCertButton.setText( Messages.AUTOINSERT_BTN );
-
- // get preference value
- //FIXME make default value false release a4 RC1
- preferenceStore.setDefault( testCertKey, false );
- testCertButton.setSelection(preferenceStore.getBoolean(testCertKey));
-
- this.testCertButton.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- preferenceStore.setValue(testCertKey, testCertButton.getSelection());
- }
- });
-
- GridData gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- this.testCertButton.setLayoutData(gridData);
- this.testCertButton.setFont( composite.getFont() );
- }
-
private void createProfileItemButtons(Composite composite) {
//Add clear button
composite.addControlListener(new ControlListenerImpl(composite, profileItemTableComposite, profileItemButtonComposite));
}
+ protected Composite createNoteComposite(Font font, Composite composite,
+ String title, String message, SelectionListener listener) {
+ Composite messageComposite = new Composite(composite, SWT.NONE);
+ GridLayout messageLayout = new GridLayout();
+ messageLayout.numColumns = 2;
+ messageLayout.marginWidth = 0;
+ messageLayout.marginHeight = 0;
+ messageComposite.setLayout(messageLayout);
+ messageComposite.setLayoutData(new GridData(
+ GridData.HORIZONTAL_ALIGN_FILL));
+ messageComposite.setFont(font);
+
+ final Label noteLabel = new Label(messageComposite, SWT.BOLD);
+ noteLabel.setText(title);
+ noteLabel.setFont(JFaceResources.getFontRegistry().getBold(
+ JFaceResources.DIALOG_FONT));
+ noteLabel
+ .setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING));
+
+ Link messageLabel = new Link(messageComposite, SWT.WRAP);
+ messageLabel.setText(message);
+ messageLabel.setFont(font);
+ messageLabel.addSelectionListener(listener);
+ return messageComposite;
+ }
+
+ private void addNote(Composite parent, String noteMessage, SelectionListener listener) {
+ Composite noteControl= createNoteComposite(JFaceResources.getDialogFont(), parent,
+ "Note:", noteMessage, listener);
+ GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
+ gd.verticalIndent = GROUP_VINDENT;
+ noteControl.setLayoutData(gd);
+ }
+
private void createAuthorSignatureComp(final Group profileItemComosite) {
//Create author signature group
Label authorLabel = new Label(authorComposite, SWT.NONE);
authorLabel.setText(UIMessages.getString("org.tizen.common.sign.authorsigtitle")); //$NON-NLS-1$
+ addNote(authorComposite, UIMessages.getString("org.tizen.common.sign.note.certificate_generator"), new SelectionListener() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ PlatformUI.getWorkbench().getHelpSystem().displayHelp(TizenHelpContextIds.HELP_COMMON_CERTIFICATE_GENERTOR_CONTEXT);
+ }
+
+ @Override
+ public void widgetDefaultSelected(SelectionEvent e) {
+ }
+ });
+
final Composite composite = new Composite(authorComposite, SWT.NONE);
composite.setLayout(createGridLayout(2));
GridData data = new GridData(GridData.FILL_BOTH);
public FontData[] smallFont(Font font) {
FontData[] datas = font.getFontData();
for (FontData data : datas)
+ {
data.setHeight(data.getHeight() - 1);
+ }
return datas;
}
package org.tizen.common.sign.preferences;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.Collections;
import java.util.List;
public class SigningProfile {
- protected String profileName;
-
- ArrayList<SigningProfileItem> profileItemList = new ArrayList<SigningProfileItem>();
-
- SigningProfileItem authorItem = null;
-
- public String getProfileName() {
- return profileName;
- }
-
- public void setProfileName(String profileName) {
- this.profileName = profileName;
- }
-
-
- public void addProfileItem(SigningProfileItem item){
- profileItemList.add(item);
- }
-
- public void removeProfileItem(SigningProfileItem item){
- profileItemList.remove(item);
- }
-
- public List<SigningProfileItem> getProfileItemList() {
- return Collections.unmodifiableList( profileItemList );
- }
-
- public void setAuthorItem(SigningProfileItem authorItem) {
- this.authorItem = authorItem;
- }
-
- public SigningProfileItem getAuthorItem() {
- return authorItem;
- }
-
+ protected String profileName;
+ protected SigningProfileItem authorItem = null;
+ protected final List<SigningProfileItem> profileItemList = new ArrayList<SigningProfileItem>();
+
+
+ public String getProfileName() {
+ return profileName;
+ }
+
+ public void setProfileName(String profileName) {
+ this.profileName = profileName;
+ }
+
+ public void addProfileItem(SigningProfileItem item) {
+ this.profileItemList.add( item );
+ }
+
+ public void removeProfileItem(SigningProfileItem item){
+ this.profileItemList.remove( item );
+ }
+
+ public List<SigningProfileItem> getProfileItemList() {
+ return Collections.unmodifiableList( this.profileItemList );
+ }
+
+ public void setAuthorItem(SigningProfileItem authorItem) {
+ this.authorItem = authorItem;
+ }
+
+ public SigningProfileItem getAuthorItem() {
+ return authorItem;
+ }
+
+ public SigningProfileItem getDistributorItem(int index) {
+ int size = this.profileItemList.size();
+ if ( index < 0 || index >= size ) {
+ return null;
+ }
+
+ return this.profileItemList.get( index );
+ }
+
+ public void initialize(Collection<? extends SigningProfileItem> itemList) {
+ this.setAuthorItem( null );
+ this.profileItemList.clear();
+
+ for ( SigningProfileItem item : itemList ) {
+ if ( item.isAuthor() ) {
+ this.setAuthorItem( item );
+ } else {
+ this.addProfileItem( item );
+ }
+ }
+ }
}
return this.keyLocation;
}
+ public
+ boolean
+ hasKeyLocation()
+ {
+ if ( this.keyLocation == null ) {
+ return false;
+ }
+
+ return ! this.keyLocation.trim().isEmpty();
+ }
+
/**
* Set key location path
*
return password;
}
+
+ /**
+ * Whether a profile item has password or not
+ *
+ * @param item {@link SigningProfileItem}
+ * @return If has password, return true. otherwise, return false.
+ */
+ public boolean hasPassword() {
+ if ( this.password == null ) {
+ return false;
+ }
+
+ return ! new String( this.password ).trim().isEmpty();
+ }
+
/**
* Set password for certification file
*
org.tizen.common.sign.distrierrordialogtitle=Error generating Distributor Signature
org.tizen.common.sign.authcerterror=Problem generating Author signature. Aborting Author Signature generation.
org.tizen.common.sign.checkauthorcertificate=Please check the signing configurations at
-org.tizen.common.sign.preference=Signing Preferences
+org.tizen.common.sign.preference=Preferences > Secure Profiles
+org.tizen.common.sign.profileerrormsg=Active secure profile is not set. Please check the signing configurations at <a>{0}</a>.
org.tizen.common.sign.authkeyerror=Problem loading Author private key. Aborting Author Signature generation.
org.tizen.common.sign.authcertkeyerror=Problem generating Author Signature. Aborting Author Signature generation.
org.tizen.common.sign.districerterror=Problem generating Distributor signature. Aborting Distributor Signature generation.
org.tizen.common.sign.certificatevaliditymessage1=The certificate corresponding to
org.tizen.common.sign.certificatevaliditymessage2=is not valid.\nThe certificate is not valid before
org.tizen.common.sign.certificatevaliditymessage3=and after
+
+org.tizen.common.sign.note.certificate_generator=See <a>'Certificate Generator'</a> documentation to generate an author signature.
--- /dev/null
+/*
+ * Common - sign
+ *
+ * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jihoon Song <jihoon80.song@samsung.com>
+ * BonYong Lee <bonyong.lee@samsung.com>
+ * Kangho Kim <kh5325.kim@samsung.com>
+ *
+ * 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.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+package org.tizen.common.sign.signer;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.tizen.common.CommonPlugin;
+import org.tizen.common.TizenPlatformConstants;
+import org.tizen.common.core.command.ExecutionContext;
+import org.tizen.common.sign.command.ReadSigningProfileFileCommand;
+import org.tizen.common.sign.command.SignCommand;
+import org.tizen.common.sign.preferences.Messages;
+import org.tizen.common.sign.preferences.SigningPreferencePage;
+import org.tizen.common.sign.preferences.SigningProfileItem;
+import org.tizen.common.sign.preferences.UIMessages;
+import org.tizen.common.sign.util.SigningProfileUtil;
+import org.tizen.common.util.StringUtil;
+
+
+/**
+ * This class intends to generate signature files.
+ * but, distributed parts is not integrated yet.
+ *
+ * @author JIhoon Song {@literal<jihoon80.song@samsung.com>}
+ */
+public class SignatureGenerator {
+
+ protected final Logger logger = LoggerFactory.getLogger( getClass() );
+
+ protected ExecutionContext newCtx;
+
+ protected IPreferenceStore pStore;
+
+ protected boolean bRDS = false;
+
+
+ // Constructor
+ public SignatureGenerator() {
+ this.newCtx =CommonPlugin.getDefault().getExecutor().getContext();
+
+ this.pStore = SigningProfileUtil.getPreferenceStore();
+ }
+
+ public SigningProfileItem findAuthor(List<SigningProfileItem> profileItems) {
+ for (SigningProfileItem profileItem : profileItems) {
+ if ( profileItem.isAuthor() ) {
+ if ( !StringUtil.isEmpty( profileItem.getKeyLocation() ) ) {
+ return profileItem;
+ }
+ }
+ }
+
+ return null;
+ }
+
+ public boolean hasAuthor(List<SigningProfileItem> profileItems) {
+ return findAuthor( profileItems ) != null;
+ }
+
+ protected boolean getInsertSignatureOption() {
+ return TizenPlatformConstants.SIGNING_DEFAULT;
+ }
+
+ protected String getActiveProfileName() {
+ return this.pStore.getString( SigningPreferencePage.defaultProfileKey );
+ }
+
+ /**
+ * Load activated profile items with a developer profile from profiles.xml
+ * If cannot find a key location in the author certificate, pop up the error dialog with a preference link.
+ *
+ * @return If profile items are nothing, return a developer profile item only. otherwise, return default profile items with a developer profile item
+ * @throws IOException
+ */
+ public List<SigningProfileItem> loadProfiles() throws IOException {
+ List<SigningProfileItem> profileItems = new ArrayList<SigningProfileItem>();
+
+ // Always add a developer certificate first because must be "signature1.xml"
+ profileItems.add( SigningProfileUtil.createDeveloperItem() );
+
+ while ( getInsertSignatureOption() ) {
+ // read profiles
+ final ReadSigningProfileFileCommand readProfile =
+ new ReadSigningProfileFileCommand( SigningProfileUtil.getProfilesPath(), getActiveProfileName() );
+ CommonPlugin.getDefault().getExecutor().execute( readProfile );
+
+ // check requirements in profile
+ if ( hasAuthor( readProfile.getProfileItems() ) ) {
+ profileItems.addAll( readProfile.getProfileItems() );
+ break;
+ }
+
+ // interact user for setting profiles
+ final String error = Messages.bind( UIMessages.getString( "org.tizen.common.sign.profileerrormsg" ),
+ UIMessages.getString("org.tizen.common.sign.preference") );
+ this.newCtx.getPrompter().error( error );
+
+ // retry reading
+ }
+
+ return profileItems;
+ }
+
+ public void sign(String path, List<SigningProfileItem> profileItems) {
+ final SignCommand command = new SignCommand( path, getActiveProfileName(), profileItems, isRDSMode() );
+ command.setExcludes( new String[] { ".*", "*~" } );
+ CommonPlugin.getDefault().getExecutor().execute( this.newCtx, command );
+ }
+
+ public void setRDSMode(boolean bRDS) {
+ this.bRDS = bRDS;
+ }
+
+ public boolean isRDSMode() {
+ return this.bRDS;
+ }
+}
HashingSigning.DistributorSignature(targetDir, distP12Path, distPass, distCAPath, distRootPath, distNumber);
}
+ public static void authorIncrementalSign(String targetDir, String authorP12Path, String authorPass, String authorCAPath, String rootCaPath) throws Exception{
+ checkNullParameters(targetDir, authorP12Path, authorPass);
+ HashingSigning.AuthorSignatureRDS(targetDir, authorP12Path, authorPass, authorCAPath, null);
+ }
+
+ public static void distIncrementalSign(String targetDir, String distP12Path, String distPass, String distCAPath, String distRootPath, int distNumber) throws Exception{
+ checkNullParameters(targetDir, distP12Path, distPass);
+ HashingSigning.DistributorSignatureRDS(targetDir, distP12Path, distPass, distCAPath, distRootPath, distNumber);
+ }
+
private static void checkNullParameters(String targetDir, String p12Path, String pass) throws IllegalArgumentException{
String emptyParameter = null;
if(StringUtil.isEmpty(targetDir)) {
distSign(targetDir, dist2P12Path, dist2Pass, dist2CAPath, dist2RootPath, 2);
}
}
+
+ public static void dist2IncrementalSignWithParameterCheck(String targetDir, String dist2P12Path, String dist2Pass, String dist2CAPath, String dist2RootPath) throws Exception{
+ if(!StringUtil.isEmpty(dist2P12Path) && !StringUtil.isEmpty(dist2Pass)) {
+ if(StringUtil.isEmpty(dist2CAPath) || StringUtil.isEmpty(dist2RootPath)) {
+ dist2CAPath = null;
+ dist2RootPath = null;
+ }
+ distIncrementalSign(targetDir, dist2P12Path, dist2Pass, dist2CAPath, dist2RootPath, 2);
+ }
+ }
}
--- /dev/null
+/*
+ * Common - sign
+ *
+ * Copyright (C) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jihoon Song <jihoon80.song@samsung.com>
+ * Kangho Kim <kh5325.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.common.sign.util;
+
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+public class SignatureUtility {
+
+ public static final String AUTHOR_PREFIX = "author-signature"; //$NON-NLS-1$
+ public static final String DISTRIBUTOR_PREFIX = "signature"; //$NON-NLS-1$
+ public static final String PERIOD = "."; //$NON-NLS-1$
+ public static final String EXTENSION = "xml"; //$NON-NLS-1$
+
+ private static final String regExp = "(" //$NON-NLS-1$
+ + DISTRIBUTOR_PREFIX
+ + "(1|2|3|4|5|6|7|8|9)(\\d)*" //$NON-NLS-1$
+ + PERIOD + EXTENSION
+ + ")"; //$NON-NLS-1$
+
+ private static final Pattern pattern = Pattern.compile( regExp );
+
+
+ public static boolean isSignatureFile(String name) {
+ if ( isAuthorSignatureFile( name ) ) {
+ return true;
+ }
+
+ return isDistributorSignatureFile( name );
+ }
+
+ public static boolean isAuthorSignatureFile(String name) {
+ return name.equalsIgnoreCase( AUTHOR_PREFIX + PERIOD + EXTENSION );
+ }
+
+ public static boolean isDistributorSignatureFile(String name) {
+ final Matcher matcher = pattern.matcher( name );
+ return matcher.matches();
+ }
+
+}
\ No newline at end of file
public static final String DISTRIBUTOR1_P12 = "tizen-distributor-signer.p12";
public static final String DISTRIBUTOR1_CA = "tizen-distributor-ca.cer";
public static final String DISTRIBUTOR1_PWD = "tizenpkcs12passfordsigner";
+ public static final String SIGNATURE_DIRECTORY = ".sign";
public static String getAuthorCAPath() {
String result = FileUtil.appendPath(InstallPathConfig.getSDKPath(), CERTIFICATE_PATH);
result = FileUtil.appendPath(result, DISTRIBUTOR1_CA);
return result;
}
+
+ /**
+ * Returns signature's directory path for native project only.
+ *
+ * @return String
+ */
+ public static String getSignatureDirectory() {
+ return SIGNATURE_DIRECTORY + "/";
+ }
}
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.jface.preference.IPreferenceStore;
import org.slf4j.Logger;
try {
pass = CipherUtil.getEncryptedString(pass);
}
- catch ( final Exception e )
+ catch ( final InvalidKeyException e )
+ {
+ logger.error("Exception occurred while encrypting signing password", e);
+ }
+ catch ( final IllegalBlockSizeException e )
+ {
+ logger.error("Exception occurred while encrypting signing password", e);
+ }
+ catch ( final BadPaddingException e )
{
logger.error("Exception occurred while encrypting signing password", e);
}
return null;
}
- public static boolean hasKeyLocation( final SigningProfileItem item ) {
- Assert.notNull( item );
-
- final String keyLocation = item.getKeyLocation();
-
- return ( keyLocation == null ) ? false : !keyLocation.trim().isEmpty();
- }
-
- /**
- * Whether a profile item has password or not
- * @param item {@link SigningProfileItem}
- * @return If has password, return true. otherwise, return false.
- */
- public static boolean hasPassword( final SigningProfileItem item ) {
- Assert.notNull( item );
-
- final char[] password = item.getPassword();
-
- return ( password == null ) ? false : !( new String( password ).trim().isEmpty() );
- }
-
/**
* Getter for element by profile name
* @param doc Document
--- /dev/null
+/*
+ * Common
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jihoon Song <jihoon80.song@samsung.com>
+ * Hyeongseok Heo <hyeongseok.heo@samsung.com>
+ * BonYong Lee <bonyong.lee@samsung.com>
+ *
+ * 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.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.common.sign;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.io.File;
+import java.io.IOException;
+
+import hashsign.HashingSigning;
+
+import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.tizen.common.util.FileUtil;
+import org.tizen.common.util.OSChecker;
+
+
+/**
+ * Test case for {@link HashingSigning}
+ *
+ * @author JIhoon Song {@literal<jihoon80.song@samsung.com>}
+ */
+public class HashingSigningTest {
+
+ protected final Logger logger = LoggerFactory.getLogger( getClass() );
+
+ public final String TEST_DIR = "test/test_files";
+ public final String NONEXISTFOLDER = "test/test_nonexist";
+ public final String TEST_SPECIAL_DIR;
+
+ public final String TEST_FILE = "test.txt";
+
+ public final String AUTHOR_SIGNATURE = "author-signature.xml";
+ public final String DISTRIBUTOR1_SIGNATURE = "signature1.xml";
+ public final String DISTRIBUTOR2_SIGNATURE = "signature2.xml";
+
+ public final String P12_KEY = "key/samsung.devmode.sdk.cert.p12";
+ public final String P12_PASSWORD = "1234";
+
+
+ // Constructor
+ public HashingSigningTest() {
+ // Not allowed special characters :
+ // -- Linux : \\ $ ` : #
+ // -- Windows : \\ * ? " < > | $ ` : #
+
+ if ( OSChecker.isWindows() ) {
+ TEST_SPECIAL_DIR = "test/~!@%^&()_+-=[]{};',.";
+ } else {
+ TEST_SPECIAL_DIR = "test/~!@%^&*()_+|-=[]{};'<>?,.";
+ }
+ }
+
+ protected void createTestFile(String appDirPath) throws IOException {
+ if ( appDirPath == null ) {
+ return;
+ }
+
+ // make directory
+ File appDir = new File( appDirPath );
+ if ( !appDir.exists() ) {
+ appDir.mkdirs();
+ }
+
+ // create test source
+ String srcTextFile = FileUtil.appendPath( appDirPath, TEST_FILE );
+ FileUtil.createTextFile( new File( srcTextFile ), TEST_FILE, null );
+ }
+
+ protected void removeTestFile(String appDirPath) {
+ if ( appDirPath == null ) {
+ return;
+ }
+
+ File appDir = new File( appDirPath );
+ if ( appDir.exists() ) {
+ FileUtil.recursiveDelete( appDir );
+ }
+ }
+
+ protected void safeRemoveFile(String path) {
+ if ( path == null ) {
+ return;
+ }
+
+ File file = new File( path );
+ if ( file.exists() ) {
+ file.delete();
+ }
+ }
+
+ /**
+ * Test {@link HashingSigning#AuthorSignature(String, String,String, String, String)}
+ *
+ * @throws Exception in case of failure in test
+ *
+ * @see HashingSigning#AuthorSignature(String, String,String, String, String)
+ */
+ @Test
+ public void test_signAuthor() throws IOException {
+ final Object[][] TEST_CASES = new Object[][] {
+ new Object[] { null, null, null, null, null, IllegalStateException.class, null }, // null app path test
+ new Object[] { NONEXISTFOLDER, null, null, null, null, null, null }, // non-exist app path test
+ new Object[] { TEST_DIR, null, null, null, null, IllegalStateException.class, null }, // null p12 path test
+ new Object[] { TEST_DIR, "aaa", null, null, null, null, null }, // wrong p12 path test : silence fail
+ new Object[] { TEST_DIR, P12_KEY, null, null, null, null, null }, // null password test : silence fail with NPE stack trace
+ new Object[] { TEST_DIR, P12_KEY, "wrong", null, null, IOException.class, null }, // wrong password
+ new Object[] { TEST_DIR, P12_KEY, P12_PASSWORD, null, null, null, AUTHOR_SIGNATURE },
+ new Object[] { TEST_SPECIAL_DIR, P12_KEY, P12_PASSWORD, null, null, null, AUTHOR_SIGNATURE },
+ new Object[] { "test/한글", P12_KEY, P12_PASSWORD, null, null, null, AUTHOR_SIGNATURE },
+ };
+
+ int test_sequence = 0;
+ for ( final Object[] TEST_CASE : TEST_CASES ) {
+ final String appDirPath = (String) TEST_CASE[0];
+ final String pkContentFilePath = (String) TEST_CASE[1];
+ final String pkContentFilePasswd = (String) TEST_CASE[2];
+ final String caCertPath = (String) TEST_CASE[3];
+ final String rootCertPath = (String) TEST_CASE[4];
+ final Object expectedException = TEST_CASE[5];
+ final String expectedFile = (String) TEST_CASE[6];
+
+ test_sequence++;
+
+ // create test directory & source
+ if ( !NONEXISTFOLDER.equals( appDirPath ) ) {
+ createTestFile( appDirPath );
+ }
+
+ // get signature file path
+ String expectedFilePath = null;
+ if ( expectedFile != null ) {
+ expectedFilePath = FileUtil.appendPath( appDirPath, expectedFile );
+ }
+
+ try {
+ logger.info( test_sequence + "th test start" );
+
+ // run test function
+ HashingSigning.AuthorSignature( appDirPath, pkContentFilePath, pkContentFilePasswd, caCertPath, rootCertPath );
+
+ // in case of an exception
+ if ( expectedException != null ) {
+ fail( test_sequence + "th HashingSigning.AuthorSignature() must be throw exception" );
+ }
+
+ // no exception
+ if ( expectedFile != null ) {
+ // check a created signature file
+ assertTrue( test_sequence + "th Expected file exist : " + expectedFilePath, FileUtil.isExist( expectedFilePath ) );
+ } else {
+ // not created signature file, but an exception is not occurred.
+ // will print exception stack traces in the console
+ }
+ } catch (Exception e) {
+ assertEquals( test_sequence + "th a kind of exceptions : ", expectedException, e.getClass() );
+ } finally {
+ // crear a created signature file
+ safeRemoveFile( expectedFile );
+
+ // clear test directory & source
+ removeTestFile( appDirPath );
+ }
+ }
+ }
+
+ /**
+ * Test {@link HashingSigning#DistributorSignature(String, String,String, String, String, int)}
+ *
+ * @throws Exception in case of failure in test
+ *
+ * @see HashingSigning#DistributorSignature(String, String,String, String, String, int)
+ */
+ @Test
+ public void test_signDistributor() throws IOException {
+ final Object[][] TEST_CASES = new Object[][] {
+ new Object[] { null, null, null, null, null, 1, IllegalStateException.class, null }, // null app path test
+ new Object[] { NONEXISTFOLDER, null, null, null, null, 1, null, null }, // non-exist app path test
+ new Object[] { TEST_DIR, null, null, null, null, 1, IllegalStateException.class, null }, // null p12 path test
+ new Object[] { TEST_DIR, "aaa", null, null, null, 1, null, null }, // wrong p12 path test : silence fail
+ new Object[] { TEST_DIR, P12_KEY, null, null, null, 1, null, null }, // null password test : silence fail with NPE stack trace
+ new Object[] { TEST_DIR, P12_KEY, "wrong", null, null, 1, IOException.class, null }, // wrong password
+ new Object[] { TEST_DIR, P12_KEY, P12_PASSWORD, null, null, 1, null, DISTRIBUTOR1_SIGNATURE },
+ new Object[] { TEST_SPECIAL_DIR, P12_KEY, P12_PASSWORD, null, null, 1, null, DISTRIBUTOR1_SIGNATURE },
+ new Object[] { "test/한글", P12_KEY, P12_PASSWORD, null, null, 1, null, DISTRIBUTOR1_SIGNATURE },
+ new Object[] { TEST_DIR, P12_KEY, P12_PASSWORD, null, null, 2, null, DISTRIBUTOR2_SIGNATURE },
+ new Object[] { TEST_SPECIAL_DIR, P12_KEY, P12_PASSWORD, null, null, 2, null, DISTRIBUTOR2_SIGNATURE },
+ new Object[] { "test/한글", P12_KEY, P12_PASSWORD, null, null, 2, null, DISTRIBUTOR2_SIGNATURE },
+ };
+
+ int test_sequence = 0;
+ for ( final Object[] TEST_CASE : TEST_CASES ) {
+ final String appDirPath = (String) TEST_CASE[0];
+ final String pkContentFilePath = (String) TEST_CASE[1];
+ final String pkContentFilePasswd = (String) TEST_CASE[2];
+ final String caCertPath = (String) TEST_CASE[3];
+ final String rootCertPath = (String) TEST_CASE[4];
+ final int distNumber = (Integer) TEST_CASE[5];
+ final Object expectedException = TEST_CASE[6];
+ final String expectedFile = (String) TEST_CASE[7];
+
+ test_sequence++;
+
+ // create test directory & source
+ if ( !NONEXISTFOLDER.equals( appDirPath ) ) {
+ createTestFile( appDirPath );
+ }
+
+ // get signature file path
+ String expectedFilePath = null;
+ if ( expectedFile != null ) {
+ expectedFilePath = FileUtil.appendPath( appDirPath, expectedFile );
+ }
+
+ try {
+ logger.info( test_sequence + "th test start" );
+
+ // run test function
+ HashingSigning.DistributorSignature(appDirPath, pkContentFilePath, pkContentFilePasswd, caCertPath, rootCertPath, distNumber );
+
+ // in case of an exception
+ if ( expectedException != null ) {
+ fail( test_sequence + "th HashingSigning.AuthorSignature() must be throw exception" );
+ }
+
+ // no exception
+ if ( expectedFile != null ) {
+ // check a created signature file
+ assertTrue( test_sequence + "th Expected file exist : " + expectedFilePath, FileUtil.isExist( expectedFilePath ) );
+ } else {
+ // not created signature file, but an exception is not occurred.
+ // will print exception stack traces in the console
+ }
+ } catch (Exception e) {
+ // test exception
+ assertEquals( test_sequence + "th a kind of exceptions : ", expectedException, e.getClass() );
+ } finally {
+ // crear a created signature file
+ safeRemoveFile( expectedFile );
+
+ // clear test directory & source
+ removeTestFile( appDirPath );
+ }
+ }
+ }
+}
--- /dev/null
+analyseLocally=true\r
+eclipse.preferences.version=1\r
+projectArtifactId=common-eplugin\r
+projectBranch=\r
+projectGroupId=ide\r
+serverUrl=http\://172.21.17.104/sonar\r
+version=1\r
Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name
Bundle-SymbolicName: org.tizen.common.verrari.realm
-Bundle-Version: 1.0.0.qualifier
+Bundle-Version: 2.0.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-Vendor: %Bundle-Vendor
Require-Bundle: org.tizen.common;bundle-version="1.0.0",
}\r
catch ( final IOException e )\r
{\r
- logger.error( "Unreachable block" );\r
+ throw new IllegalStateException( "Unreachable block" );\r
}\r
}\r
mapper.setMappings( mappingMap );\r
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.2//EN" "http://www.puppycrawl.com/dtds/configuration_1_2.dtd"><!-- Generated by Sonar --><module name="Checker"><module name="SuppressionCommentFilter"/><module name="TreeWalker"><module name="FileContentsHolder"/> <module name="UnusedImports"><property name="severity" value="info"/></module><module name="TodoComment"><property name="severity" value="info"/></module><module name="AvoidStarImport"><property name="severity" value="info"/></module><module name="MissingSwitchDefault"><property name="severity" value="warning"/></module><module name="DefaultComesLast"><property name="severity" value="warning"/></module></module></module>
\ No newline at end of file
--- /dev/null
+<FindBugsFilter/>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated by Sonar -->
+<FindBugsFilter>
+ <Match>
+ <Bug pattern="NP_CLONE_COULD_RETURN_NULL"/>
+ </Match>
+ <Match>
+ <Bug pattern="NM_CONFUSING"/>
+ </Match>
+ <Match>
+ <Bug pattern="FI_EMPTY"/>
+ </Match>
+ <Match>
+ <Bug pattern="DM_EXIT"/>
+ </Match>
+ <Match>
+ <Bug pattern="ODR_OPEN_DATABASE_RESOURCE"/>
+ </Match>
+ <Match>
+ <Bug pattern="ODR_OPEN_DATABASE_RESOURCE_EXCEPTION_PATH"/>
+ </Match>
+ <Match>
+ <Bug pattern="OS_OPEN_STREAM"/>
+ </Match>
+ <Match>
+ <Bug pattern="OS_OPEN_STREAM_EXCEPTION_PATH"/>
+ </Match>
+ <Match>
+ <Bug pattern="DE_MIGHT_DROP"/>
+ </Match>
+ <Match>
+ <Bug pattern="DE_MIGHT_IGNORE"/>
+ </Match>
+ <Match>
+ <Bug pattern="NP_BOOLEAN_RETURN_NULL"/>
+ </Match>
+ <Match>
+ <Bug pattern="RC_REF_COMPARISON"/>
+ </Match>
+ <Match>
+ <Bug pattern="NP_TOSTRING_COULD_RETURN_NULL"/>
+ </Match>
+ <Match>
+ <Bug pattern="GC_UNCHECKED_TYPE_IN_GENERIC_CALL"/>
+ </Match>
+ <Match>
+ <Bug pattern="NM_FUTURE_KEYWORD_USED_AS_MEMBER_IDENTIFIER"/>
+ </Match>
+ <Match>
+ <Bug pattern="NM_FUTURE_KEYWORD_USED_AS_IDENTIFIER"/>
+ </Match>
+ <Match>
+ <Bug pattern="NP_NULL_INSTANCEOF"/>
+ </Match>
+ <Match>
+ <Bug pattern="IL_INFINITE_LOOP"/>
+ </Match>
+ <Match>
+ <Bug pattern="IL_INFINITE_RECURSIVE_LOOP"/>
+ </Match>
+ <Match>
+ <Bug pattern="INT_BAD_COMPARISON_WITH_NONNEGATIVE_VALUE"/>
+ </Match>
+ <Match>
+ <Bug pattern="EC_UNRELATED_INTERFACES"/>
+ </Match>
+ <Match>
+ <Bug pattern="EC_UNRELATED_TYPES"/>
+ </Match>
+ <Match>
+ <Bug pattern="EC_UNRELATED_CLASS_AND_INTERFACE"/>
+ </Match>
+ <Match>
+ <Bug pattern="EC_NULL_ARG"/>
+ </Match>
+ <Match>
+ <Bug pattern="NP_CLOSING_NULL"/>
+ </Match>
+ <Match>
+ <Bug pattern="SA_FIELD_DOUBLE_ASSIGNMENT"/>
+ </Match>
+ <Match>
+ <Bug pattern="EQ_ALWAYS_FALSE"/>
+ </Match>
+ <Match>
+ <Bug pattern="EQ_ALWAYS_TRUE"/>
+ </Match>
+ <Match>
+ <Bug pattern="EC_INCOMPATIBLE_ARRAY_COMPARE"/>
+ </Match>
+ <Match>
+ <Bug pattern="RV_EXCEPTION_NOT_THROWN"/>
+ </Match>
+ <Match>
+ <Bug pattern="RE_CANT_USE_FILE_SEPARATOR_AS_REGULAR_EXPRESSION"/>
+ </Match>
+ <Match>
+ <Bug pattern="VA_FORMAT_STRING_ILLEGAL"/>
+ </Match>
+ <Match>
+ <Bug pattern="BC_IMPOSSIBLE_CAST"/>
+ </Match>
+ <Match>
+ <Bug pattern="BC_IMPOSSIBLE_DOWNCAST"/>
+ </Match>
+ <Match>
+ <Bug pattern="BC_IMPOSSIBLE_DOWNCAST_OF_TOARRAY"/>
+ </Match>
+ <Match>
+ <Bug pattern="BIT_AND"/>
+ </Match>
+ <Match>
+ <Bug pattern="BIT_IOR"/>
+ </Match>
+ <Match>
+ <Bug pattern="ICAST_INT_CAST_TO_DOUBLE_PASSED_TO_CEIL"/>
+ </Match>
+ <Match>
+ <Bug pattern="ICAST_INT_CAST_TO_FLOAT_PASSED_TO_ROUND"/>
+ </Match>
+ <Match>
+ <Bug pattern="INT_BAD_REM_BY_1"/>
+ </Match>
+ <Match>
+ <Bug pattern="RE_BAD_SYNTAX_FOR_REGULAR_EXPRESSION"/>
+ </Match>
+ <Match>
+ <Bug pattern="NP_NULL_PARAM_DEREF"/>
+ </Match>
+ <Match>
+ <Bug pattern="NP_NULL_PARAM_DEREF_ALL_TARGETS_DANGEROUS"/>
+ </Match>
+ <Match>
+ <Bug pattern="NP_NONNULL_PARAM_VIOLATION"/>
+ </Match>
+ <Match>
+ <Bug pattern="NP_ARGUMENT_MIGHT_BE_NULL"/>
+ </Match>
+ <Match>
+ <Bug pattern="NP_NONNULL_RETURN_VIOLATION"/>
+ </Match>
+ <Match>
+ <Bug pattern="NP_ALWAYS_NULL"/>
+ </Match>
+ <Match>
+ <Bug pattern="NP_ALWAYS_NULL_EXCEPTION"/>
+ </Match>
+ <Match>
+ <Bug pattern="NP_GUARANTEED_DEREF"/>
+ </Match>
+ <Match>
+ <Bug pattern="RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE"/>
+ </Match>
+ <Match>
+ <Bug pattern="NP_NULL_ON_SOME_PATH"/>
+ </Match>
+ <Match>
+ <Bug pattern="NP_NULL_ON_SOME_PATH_EXCEPTION"/>
+ </Match>
+ <Match>
+ <Bug pattern="RpC_REPEATED_CONDITIONAL_TEST"/>
+ </Match>
+ <Match>
+ <Bug pattern="UR_UNINIT_READ"/>
+ </Match>
+ <Match>
+ <Bug pattern="UCF_USELESS_CONTROL_FLOW_NEXT_LINE"/>
+ </Match>
+ <Match>
+ <Bug pattern="EC_UNRELATED_TYPES_USING_POINTER_EQUALITY"/>
+ </Match>
+ <Match>
+ <Bug pattern="NP_GUARANTEED_DEREF_ON_EXCEPTION_PATH"/>
+ </Match>
+ <Match>
+ <Bug pattern="NM_VERY_CONFUSING"/>
+ </Match>
+ <Match>
+ <Bug pattern="SF_DEAD_STORE_DUE_TO_SWITCH_FALLTHROUGH"/>
+ </Match>
+ <Match>
+ <Bug pattern="SF_DEAD_STORE_DUE_TO_SWITCH_FALLTHROUGH_TO_THROW"/>
+ </Match>
+ <Match>
+ <Bug pattern="DMI_HARDCODED_ABSOLUTE_FILENAME"/>
+ </Match>
+ <Match>
+ <Bug pattern="DLS_DEAD_LOCAL_STORE_OF_NULL"/>
+ </Match>
+ <Match>
+ <Bug pattern="DLS_DEAD_LOCAL_STORE"/>
+ </Match>
+ <Match>
+ <Bug pattern="NP_DEREFERENCE_OF_READLINE_VALUE"/>
+ </Match>
+ <Match>
+ <Bug pattern="SA_LOCAL_DOUBLE_ASSIGNMENT"/>
+ </Match>
+ <Match>
+ <Bug pattern="NP_IMMEDIATE_DEREFERENCE_OF_READLINE"/>
+ </Match>
+ <Match>
+ <Bug pattern="BC_VACUOUS_INSTANCEOF"/>
+ </Match>
+ <Match>
+ <Bug pattern="ICAST_IDIV_CAST_TO_DOUBLE"/>
+ </Match>
+ <Match>
+ <Bug pattern="NP_LOAD_OF_KNOWN_NULL_VALUE"/>
+ </Match>
+ <Match>
+ <Bug pattern="NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE"/>
+ </Match>
+ <Match>
+ <Bug pattern="NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE"/>
+ </Match>
+ <Match>
+ <Bug pattern="NP_NULL_ON_SOME_PATH_MIGHT_BE_INFEASIBLE"/>
+ </Match>
+ <Match>
+ <Bug pattern="NS_DANGEROUS_NON_SHORT_CIRCUIT"/>
+ </Match>
+ <Match>
+ <Bug pattern="RCN_REDUNDANT_COMPARISON_TWO_NULL_VALUES"/>
+ </Match>
+ <Match>
+ <Bug pattern="RCN_REDUNDANT_NULLCHECK_OF_NULL_VALUE"/>
+ </Match>
+ <Match>
+ <Bug pattern="SA_LOCAL_SELF_ASSIGNMENT"/>
+ </Match>
+ <Match>
+ <Bug pattern="BC_UNCONFIRMED_CAST"/>
+ </Match>
+ <Match>
+ <Bug pattern="UCF_USELESS_CONTROL_FLOW"/>
+ </Match>
+ <Match>
+ <Bug pattern="OBL_UNSATISFIED_OBLIGATION"/>
+ </Match>
+ <Match>
+ <Bug pattern="ESync_EMPTY_SYNC"/>
+ </Match>
+ <Match>
+ <Bug pattern="DMI_COLLECTION_OF_URLS"/>
+ </Match>
+ <Match>
+ <Bug pattern="UPM_UNCALLED_PRIVATE_METHOD"/>
+ </Match>
+ <Match>
+ <Bug pattern="DMI_BLOCKING_METHODS_ON_URL"/>
+ </Match>
+ <Match>
+ <Bug pattern="URF_UNREAD_FIELD"/>
+ </Match>
+ <Match>
+ <Bug pattern="SS_SHOULD_BE_STATIC"/>
+ </Match>
+ <Match>
+ <Bug pattern="DMI_EMPTY_DB_PASSWORD"/>
+ </Match>
+ <Match>
+ <Bug pattern="DMI_CONSTANT_DB_PASSWORD"/>
+ </Match>
+ <Match>
+ <Bug pattern="SF_SWITCH_FALLTHROUGH"/>
+ </Match>
+</FindBugsFilter>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<?xml-stylesheet type="text/xsl" href="http://findbugs.sourceforge.net/xsl/default.xsl"?>
+
+<BugCollection version="1.3.9" sequence="0" timestamp="1355815803514" analysisTimestamp="1355819061611" release="">
+ <Project>
+ <Jar>Z:\common-eplugin\org.tizen.common.verrari.realm\bin</Jar>
+ <AuxClasspathEntry>Z:\common-eplugin\org.tizen.common.verrari.realm\org.tizen.common.verrari.realm\lib\jackson-core-lgpl-1.9.7.jar</AuxClasspathEntry>
+ <AuxClasspathEntry>Z:\common-eplugin\org.tizen.common.verrari.realm\org.tizen.common.verrari.realm\lib\jackson-mapper-lgpl-1.9.7.jar</AuxClasspathEntry>
+ <AuxClasspathEntry>C:\Program Files\Java\jdk1.6.0_32\jre\lib\resources.jar</AuxClasspathEntry>
+ <AuxClasspathEntry>C:\Program Files\Java\jdk1.6.0_32\jre\lib\rt.jar</AuxClasspathEntry>
+ <AuxClasspathEntry>C:\Program Files\Java\jdk1.6.0_32\jre\lib\jsse.jar</AuxClasspathEntry>
+ <AuxClasspathEntry>C:\Program Files\Java\jdk1.6.0_32\jre\lib\jce.jar</AuxClasspathEntry>
+ <AuxClasspathEntry>C:\Program Files\Java\jdk1.6.0_32\jre\lib\charsets.jar</AuxClasspathEntry>
+ <AuxClasspathEntry>C:\Program Files\Java\jdk1.6.0_32\jre\lib\ext\dnsns.jar</AuxClasspathEntry>
+ <AuxClasspathEntry>C:\Program Files\Java\jdk1.6.0_32\jre\lib\ext\localedata.jar</AuxClasspathEntry>
+ <AuxClasspathEntry>C:\Program Files\Java\jdk1.6.0_32\jre\lib\ext\sunjce_provider.jar</AuxClasspathEntry>
+ <AuxClasspathEntry>C:\Program Files\eclipse37\plugins\org.junit_4.8.2.v4_8_2_v20110321-1705\junit.jar</AuxClasspathEntry>
+ <AuxClasspathEntry>C:\Users\bylee\AppData\Local\Temp\findbugs945166737468633245.jar</AuxClasspathEntry>
+ <AuxClasspathEntry>C:\Users\bylee\AppData\Local\Temp\findbugs2160014671323692735.jar</AuxClasspathEntry>
+ <SrcDir>Z:\common-eplugin\org.tizen.common.verrari.realm\src</SrcDir>
+ <SrcDir>Z:\common-eplugin\org.tizen.common.verrari.realm\test\src</SrcDir>
+ <WrkDir>Z:\common-eplugin\org.tizen.common.verrari.realm\target\sonar-embedder-work\target</WrkDir>
+ </Project>
+ <Errors errors="2" missingClasses="42">
+ <Error>
+ <ErrorMessage>Cannot open codebase filesystem:Z:\common-eplugin\org.tizen.common.verrari.realm\org.tizen.common.verrari.realm\lib\jackson-core-lgpl-1.9.7.jar</ErrorMessage>
+ <Exception>java.io.FileNotFoundException: Z:\common-eplugin\org.tizen.common.verrari.realm\org.tizen.common.verrari.realm\lib\jackson-core-lgpl-1.9.7.jar (지정된 경로를 찾을 수 없습니다)</Exception>
+ <StackTrace>java.util.zip.ZipFile.open(Native Method)</StackTrace>
+ <StackTrace>java.util.zip.ZipFile.<init>(Unknown Source)</StackTrace>
+ <StackTrace>java.util.zip.ZipFile.<init>(Unknown Source)</StackTrace>
+ <StackTrace>edu.umd.cs.findbugs.classfile.impl.ZipFileCodeBase.<init>(ZipFileCodeBase.java:53)</StackTrace>
+ <StackTrace>edu.umd.cs.findbugs.classfile.impl.ZipCodeBaseFactory.countUsingZipFile(ZipCodeBaseFactory.java:92)</StackTrace>
+ <StackTrace>edu.umd.cs.findbugs.classfile.impl.ZipCodeBaseFactory.makeZipCodeBase(ZipCodeBaseFactory.java:46)</StackTrace>
+ <StackTrace>edu.umd.cs.findbugs.classfile.impl.ClassFactory.createFilesystemCodeBase(ClassFactory.java:97)</StackTrace>
+ <StackTrace>edu.umd.cs.findbugs.classfile.impl.FilesystemCodeBaseLocator.openCodeBase(FilesystemCodeBaseLocator.java:75)</StackTrace>
+ <StackTrace>edu.umd.cs.findbugs.classfile.impl.ClassPathBuilder.processWorkList(ClassPathBuilder.java:564)</StackTrace>
+ <StackTrace>edu.umd.cs.findbugs.classfile.impl.ClassPathBuilder.build(ClassPathBuilder.java:195)</StackTrace>
+ <StackTrace>edu.umd.cs.findbugs.FindBugs2.buildClassPath(FindBugs2.java:584)</StackTrace>
+ <StackTrace>edu.umd.cs.findbugs.FindBugs2.execute(FindBugs2.java:181)</StackTrace>
+ <StackTrace>org.sonar.plugins.findbugs.FindbugsExecutor$FindbugsTask.call(FindbugsExecutor.java:126)</StackTrace>
+ <StackTrace>java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)</StackTrace>
+ <StackTrace>java.util.concurrent.FutureTask.run(Unknown Source)</StackTrace>
+ <StackTrace>java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)</StackTrace>
+ <StackTrace>java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)</StackTrace>
+ <StackTrace>java.lang.Thread.run(Unknown Source)</StackTrace>
+ </Error>
+ <Error>
+ <ErrorMessage>Cannot open codebase filesystem:Z:\common-eplugin\org.tizen.common.verrari.realm\org.tizen.common.verrari.realm\lib\jackson-mapper-lgpl-1.9.7.jar</ErrorMessage>
+ <Exception>java.io.FileNotFoundException: Z:\common-eplugin\org.tizen.common.verrari.realm\org.tizen.common.verrari.realm\lib\jackson-mapper-lgpl-1.9.7.jar (지정된 경로를 찾을 수 없습니다)</Exception>
+ <StackTrace>java.util.zip.ZipFile.open(Native Method)</StackTrace>
+ <StackTrace>java.util.zip.ZipFile.<init>(Unknown Source)</StackTrace>
+ <StackTrace>java.util.zip.ZipFile.<init>(Unknown Source)</StackTrace>
+ <StackTrace>edu.umd.cs.findbugs.classfile.impl.ZipFileCodeBase.<init>(ZipFileCodeBase.java:53)</StackTrace>
+ <StackTrace>edu.umd.cs.findbugs.classfile.impl.ZipCodeBaseFactory.countUsingZipFile(ZipCodeBaseFactory.java:92)</StackTrace>
+ <StackTrace>edu.umd.cs.findbugs.classfile.impl.ZipCodeBaseFactory.makeZipCodeBase(ZipCodeBaseFactory.java:46)</StackTrace>
+ <StackTrace>edu.umd.cs.findbugs.classfile.impl.ClassFactory.createFilesystemCodeBase(ClassFactory.java:97)</StackTrace>
+ <StackTrace>edu.umd.cs.findbugs.classfile.impl.FilesystemCodeBaseLocator.openCodeBase(FilesystemCodeBaseLocator.java:75)</StackTrace>
+ <StackTrace>edu.umd.cs.findbugs.classfile.impl.ClassPathBuilder.processWorkList(ClassPathBuilder.java:564)</StackTrace>
+ <StackTrace>edu.umd.cs.findbugs.classfile.impl.ClassPathBuilder.build(ClassPathBuilder.java:195)</StackTrace>
+ <StackTrace>edu.umd.cs.findbugs.FindBugs2.buildClassPath(FindBugs2.java:584)</StackTrace>
+ <StackTrace>edu.umd.cs.findbugs.FindBugs2.execute(FindBugs2.java:181)</StackTrace>
+ <StackTrace>org.sonar.plugins.findbugs.FindbugsExecutor$FindbugsTask.call(FindbugsExecutor.java:126)</StackTrace>
+ <StackTrace>java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)</StackTrace>
+ <StackTrace>java.util.concurrent.FutureTask.run(Unknown Source)</StackTrace>
+ <StackTrace>java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)</StackTrace>
+ <StackTrace>java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)</StackTrace>
+ <StackTrace>java.lang.Thread.run(Unknown Source)</StackTrace>
+ </Error>
+ <MissingClass>org.codehaus.jackson.JsonNode</MissingClass>
+ <MissingClass>org.codehaus.jackson.map.ObjectMapper</MissingClass>
+ <MissingClass>org.hamcrest.Description</MissingClass>
+ <MissingClass>org.hamcrest.Matcher</MissingClass>
+ <MissingClass>org.hamcrest.StringDescription</MissingClass>
+ <MissingClass>org.mockito.Matchers</MissingClass>
+ <MissingClass>org.mockito.Mockito</MissingClass>
+ <MissingClass>org.mockito.stubbing.OngoingStubbing</MissingClass>
+ <MissingClass>org.slf4j.Logger</MissingClass>
+ <MissingClass>org.slf4j.LoggerFactory</MissingClass>
+ <MissingClass>org.tizen.common.FactoryWithArgument</MissingClass>
+ <MissingClass>org.tizen.common.classloader.ClassSource</MissingClass>
+ <MissingClass>org.tizen.common.classloader.CustomClassLoader</MissingClass>
+ <MissingClass>org.tizen.common.classloader.JarClassSource</MissingClass>
+ <MissingClass>org.tizen.common.core.command.ExecutionContext</MissingClass>
+ <MissingClass>org.tizen.common.core.command.Prompter</MissingClass>
+ <MissingClass>org.tizen.common.core.command.UntrackedException</MissingClass>
+ <MissingClass>org.tizen.common.file.FileHandler</MissingClass>
+ <MissingClass>org.tizen.common.file.Filter</MissingClass>
+ <MissingClass>org.tizen.common.file.SimpleFileFilter</MissingClass>
+ <MissingClass>org.tizen.common.file.filter.WildCardFilterFactory</MissingClass>
+ <MissingClass>org.tizen.common.util.ArrayUtil</MissingClass>
+ <MissingClass>org.tizen.common.util.Assert</MissingClass>
+ <MissingClass>org.tizen.common.util.FilenameUtil</MissingClass>
+ <MissingClass>org.tizen.common.util.IOUtil</MissingClass>
+ <MissingClass>org.tizen.common.util.MapUtil</MissingClass>
+ <MissingClass>org.tizen.common.util.ReflectionUtil</MissingClass>
+ <MissingClass>org.tizen.common.util.StringUtil</MissingClass>
+ <MissingClass>org.tizen.common.util.io.Buffer</MissingClass>
+ <MissingClass>org.tizen.common.util.io.BufferInputStream</MissingClass>
+ <MissingClass>org.tizen.common.util.io.BufferOutputStream</MissingClass>
+ <MissingClass>org.tizen.common.verrari.IModelProvider</MissingClass>
+ <MissingClass>org.tizen.common.verrari.ITemplate</MissingClass>
+ <MissingClass>org.tizen.common.verrari.ITemplateEngine</MissingClass>
+ <MissingClass>org.tizen.common.verrari.ITemplateProvider</MissingClass>
+ <MissingClass>org.tizen.common.verrari.TemplateContext</MissingClass>
+ <MissingClass>org.tizen.common.verrari.TemplateException</MissingClass>
+ <MissingClass>org.tizen.common.verrari.engine.TemplateEngineFactory</MissingClass>
+ <MissingClass>org.tizen.common.verrari.model.ModelManager</MissingClass>
+ <MissingClass>org.tizen.common.verrari.template.InMemoryTemplate</MissingClass>
+ <MissingClass>org.tizen.common.verrari.template.TemplateManager</MissingClass>
+ <MissingClass>org.tizen.common.verrari.util.BufferFactory</MissingClass>
+ </Errors>
+ <FindBugsSummary timestamp="Tue, 18 Dec 2012 16:30:03 +0900" total_classes="30" referenced_classes="96" total_bugs="0" total_size="719" num_packages="6" vm_version="20.7-b02" cpu_seconds="1.70" clock_seconds="3.01" peak_mbytes="859.58" alloc_mbytes="993.62" gc_seconds="0.01">
+ <FileStats path="org/tizen/common/verrari/AbstractTestCase.java" bugCount="0" size="18"/>
+ <FileStats path="org/tizen/common/verrari/AttributeConfiguable.java" bugCount="0" size="2"/>
+ <FileStats path="org/tizen/common/verrari/AttributeContainer.java" bugCount="0" size="3"/>
+ <FileStats path="org/tizen/common/verrari/Condition.java" bugCount="0" size="34"/>
+ <FileStats path="org/tizen/common/verrari/Realm.java" bugCount="0" size="2"/>
+ <FileStats path="org/tizen/common/verrari/RealmFactory.java" bugCount="0" size="88"/>
+ <FileStats path="org/tizen/common/verrari/RealmFactoryTest.java" bugCount="0" size="16"/>
+ <FileStats path="org/tizen/common/verrari/SearchableRealm.java" bugCount="0" size="2"/>
+ <FileStats path="org/tizen/common/verrari/Storage.java" bugCount="0" size="3"/>
+ <FileStats path="org/tizen/common/verrari/Template.java" bugCount="0" size="2"/>
+ <FileStats path="org/tizen/common/verrari/exception/InvalidMapperException.java" bugCount="0" size="8"/>
+ <FileStats path="org/tizen/common/verrari/exception/UnsupportedVersionException.java" bugCount="0" size="4"/>
+ <FileStats path="org/tizen/common/verrari/realm/CompositeRealm.java" bugCount="0" size="18"/>
+ <FileStats path="org/tizen/common/verrari/realm/Query.java" bugCount="0" size="2"/>
+ <FileStats path="org/tizen/common/verrari/realm/RealmConstants.java" bugCount="0" size="13"/>
+ <FileStats path="org/tizen/common/verrari/realm/StandardRealm.java" bugCount="0" size="51"/>
+ <FileStats path="org/tizen/common/verrari/realm/StandardRealmTest.java" bugCount="0" size="14"/>
+ <FileStats path="org/tizen/common/verrari/realm/StandardSearchableRealm.java" bugCount="0" size="50"/>
+ <FileStats path="org/tizen/common/verrari/storage/FileStorage.java" bugCount="0" size="32"/>
+ <FileStats path="org/tizen/common/verrari/template/Mapper.java" bugCount="0" size="3"/>
+ <FileStats path="org/tizen/common/verrari/template/StandardMapper.java" bugCount="0" size="41"/>
+ <FileStats path="org/tizen/common/verrari/template/StandardMapperTest.java" bugCount="0" size="20"/>
+ <FileStats path="org/tizen/common/verrari/template/StandardTemplate.java" bugCount="0" size="180"/>
+ <FileStats path="org/tizen/common/verrari/template/StandardTemplateTest.java" bugCount="0" size="34"/>
+ <FileStats path="org/tizen/common/verrari/template/TemplateConstants.java" bugCount="0" size="16"/>
+ <FileStats path="org/tizen/common/verrari/util/QueryFactory.java" bugCount="0" size="49"/>
+ <FileStats path="org/tizen/common/verrari/util/QueryFactoryTest.java" bugCount="0" size="14"/>
+ <PackageStats package="org.tizen.common.verrari" total_bugs="0" total_types="11" total_size="170">
+ <ClassStats class="org.tizen.common.verrari.AbstractTestCase" sourceFile="AbstractTestCase.java" interface="false" size="18" bugs="0"/>
+ <ClassStats class="org.tizen.common.verrari.AttributeConfiguable" sourceFile="AttributeConfiguable.java" interface="true" size="2" bugs="0"/>
+ <ClassStats class="org.tizen.common.verrari.AttributeContainer" sourceFile="AttributeContainer.java" interface="true" size="3" bugs="0"/>
+ <ClassStats class="org.tizen.common.verrari.Condition" sourceFile="Condition.java" interface="false" size="20" bugs="0"/>
+ <ClassStats class="org.tizen.common.verrari.Condition$Operation" sourceFile="Condition.java" interface="false" size="14" bugs="0"/>
+ <ClassStats class="org.tizen.common.verrari.Realm" sourceFile="Realm.java" interface="true" size="2" bugs="0"/>
+ <ClassStats class="org.tizen.common.verrari.RealmFactory" sourceFile="RealmFactory.java" interface="false" size="88" bugs="0"/>
+ <ClassStats class="org.tizen.common.verrari.RealmFactoryTest" sourceFile="RealmFactoryTest.java" interface="false" size="16" bugs="0"/>
+ <ClassStats class="org.tizen.common.verrari.SearchableRealm" sourceFile="SearchableRealm.java" interface="true" size="2" bugs="0"/>
+ <ClassStats class="org.tizen.common.verrari.Storage" sourceFile="Storage.java" interface="true" size="3" bugs="0"/>
+ <ClassStats class="org.tizen.common.verrari.Template" sourceFile="Template.java" interface="true" size="2" bugs="0"/>
+ </PackageStats>
+ <PackageStats package="org.tizen.common.verrari.exception" total_bugs="0" total_types="2" total_size="12">
+ <ClassStats class="org.tizen.common.verrari.exception.InvalidMapperException" sourceFile="InvalidMapperException.java" interface="false" size="8" bugs="0"/>
+ <ClassStats class="org.tizen.common.verrari.exception.UnsupportedVersionException" sourceFile="UnsupportedVersionException.java" interface="false" size="4" bugs="0"/>
+ </PackageStats>
+ <PackageStats package="org.tizen.common.verrari.realm" total_bugs="0" total_types="6" total_size="148">
+ <ClassStats class="org.tizen.common.verrari.realm.CompositeRealm" sourceFile="CompositeRealm.java" interface="false" size="18" bugs="0"/>
+ <ClassStats class="org.tizen.common.verrari.realm.Query" sourceFile="Query.java" interface="true" size="2" bugs="0"/>
+ <ClassStats class="org.tizen.common.verrari.realm.RealmConstants" sourceFile="RealmConstants.java" interface="false" size="13" bugs="0"/>
+ <ClassStats class="org.tizen.common.verrari.realm.StandardRealm" sourceFile="StandardRealm.java" interface="false" size="51" bugs="0"/>
+ <ClassStats class="org.tizen.common.verrari.realm.StandardRealmTest" sourceFile="StandardRealmTest.java" interface="false" size="14" bugs="0"/>
+ <ClassStats class="org.tizen.common.verrari.realm.StandardSearchableRealm" sourceFile="StandardSearchableRealm.java" interface="false" size="50" bugs="0"/>
+ </PackageStats>
+ <PackageStats package="org.tizen.common.verrari.storage" total_bugs="0" total_types="2" total_size="32">
+ <ClassStats class="org.tizen.common.verrari.storage.FileStorage" sourceFile="FileStorage.java" interface="false" size="18" bugs="0"/>
+ <ClassStats class="org.tizen.common.verrari.storage.FileStorage$1" sourceFile="FileStorage.java" interface="false" size="14" bugs="0"/>
+ </PackageStats>
+ <PackageStats package="org.tizen.common.verrari.template" total_bugs="0" total_types="6" total_size="294">
+ <ClassStats class="org.tizen.common.verrari.template.Mapper" sourceFile="Mapper.java" interface="true" size="3" bugs="0"/>
+ <ClassStats class="org.tizen.common.verrari.template.StandardMapper" sourceFile="StandardMapper.java" interface="false" size="41" bugs="0"/>
+ <ClassStats class="org.tizen.common.verrari.template.StandardMapperTest" sourceFile="StandardMapperTest.java" interface="false" size="20" bugs="0"/>
+ <ClassStats class="org.tizen.common.verrari.template.StandardTemplate" sourceFile="StandardTemplate.java" interface="false" size="180" bugs="0"/>
+ <ClassStats class="org.tizen.common.verrari.template.StandardTemplateTest" sourceFile="StandardTemplateTest.java" interface="false" size="34" bugs="0"/>
+ <ClassStats class="org.tizen.common.verrari.template.TemplateConstants" sourceFile="TemplateConstants.java" interface="false" size="16" bugs="0"/>
+ </PackageStats>
+ <PackageStats package="org.tizen.common.verrari.util" total_bugs="0" total_types="3" total_size="63">
+ <ClassStats class="org.tizen.common.verrari.util.QueryFactory" sourceFile="QueryFactory.java" interface="false" size="28" bugs="0"/>
+ <ClassStats class="org.tizen.common.verrari.util.QueryFactory$PatternQuery" sourceFile="QueryFactory.java" interface="false" size="21" bugs="0"/>
+ <ClassStats class="org.tizen.common.verrari.util.QueryFactoryTest" sourceFile="QueryFactoryTest.java" interface="false" size="14" bugs="0"/>
+ </PackageStats>
+ <FindBugsProfile>
+ <ClassProfile name="edu.umd.cs.findbugs.detect.NoteDirectlyRelevantTypeQualifiers" totalMilliseconds="12" invocations="96" avgMicrosecondsPerInvocation="129" maxMicrosecondsPerInvocation="1219" standardDeviationMircosecondsPerInvocation="207"/>
+ <ClassProfile name="edu.umd.cs.findbugs.detect.CalledMethods" totalMilliseconds="18" invocations="96" avgMicrosecondsPerInvocation="189" maxMicrosecondsPerInvocation="9500" standardDeviationMircosecondsPerInvocation="967"/>
+ <ClassProfile name="edu.umd.cs.findbugs.detect.FindRefComparison$SpecialTypeAnalysis" totalMilliseconds="18" invocations="78" avgMicrosecondsPerInvocation="235" maxMicrosecondsPerInvocation="3948" standardDeviationMircosecondsPerInvocation="490"/>
+ <ClassProfile name="edu.umd.cs.findbugs.detect.FieldItemSummary" totalMilliseconds="18" invocations="96" avgMicrosecondsPerInvocation="197" maxMicrosecondsPerInvocation="2049" standardDeviationMircosecondsPerInvocation="333"/>
+ <ClassProfile name="edu.umd.cs.findbugs.ba.npe.NullDerefAndRedundantComparisonFinder" totalMilliseconds="20" invocations="86" avgMicrosecondsPerInvocation="238" maxMicrosecondsPerInvocation="2054" standardDeviationMircosecondsPerInvocation="375"/>
+ <ClassProfile name="edu.umd.cs.findbugs.classfile.engine.bcel.TypeDataflowFactory" totalMilliseconds="21" invocations="89" avgMicrosecondsPerInvocation="240" maxMicrosecondsPerInvocation="2283" standardDeviationMircosecondsPerInvocation="359"/>
+ <ClassProfile name="edu.umd.cs.findbugs.OpcodeStack$JumpInfoFactory" totalMilliseconds="23" invocations="1479" avgMicrosecondsPerInvocation="15" maxMicrosecondsPerInvocation="352" standardDeviationMircosecondsPerInvocation="25"/>
+ <ClassProfile name="edu.umd.cs.findbugs.classfile.engine.bcel.ValueNumberDataflowFactory" totalMilliseconds="24" invocations="121" avgMicrosecondsPerInvocation="203" maxMicrosecondsPerInvocation="2342" standardDeviationMircosecondsPerInvocation="342"/>
+ <ClassProfile name="edu.umd.cs.findbugs.classfile.engine.bcel.UnconditionalValueDerefDataflowFactory" totalMilliseconds="24" invocations="87" avgMicrosecondsPerInvocation="283" maxMicrosecondsPerInvocation="2611" standardDeviationMircosecondsPerInvocation="465"/>
+ <ClassProfile name="edu.umd.cs.findbugs.classfile.engine.bcel.IsNullValueDataflowFactory" totalMilliseconds="27" invocations="87" avgMicrosecondsPerInvocation="314" maxMicrosecondsPerInvocation="2577" standardDeviationMircosecondsPerInvocation="497"/>
+ <ClassProfile name="edu.umd.cs.findbugs.classfile.engine.ClassInfoAnalysisEngine" totalMilliseconds="35" invocations="620" avgMicrosecondsPerInvocation="57" maxMicrosecondsPerInvocation="843" standardDeviationMircosecondsPerInvocation="82"/>
+ <ClassProfile name="edu.umd.cs.findbugs.classfile.impl.ZipCodeBaseFactory" totalMilliseconds="58" invocations="13" avgMicrosecondsPerInvocation="4520" maxMicrosecondsPerInvocation="24200" standardDeviationMircosecondsPerInvocation="6094"/>
+ <ClassProfile name="edu.umd.cs.findbugs.classfile.engine.ClassDataAnalysisEngine" totalMilliseconds="878" invocations="622" avgMicrosecondsPerInvocation="1413" maxMicrosecondsPerInvocation="9694" standardDeviationMircosecondsPerInvocation="1519"/>
+ </FindBugsProfile>
+ </FindBugsSummary>
+ <ClassFeatures></ClassFeatures>
+ <History></History>
+</BugCollection>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<pmd version="4.2.5" timestamp="2012-12-18T17:24:28.946">\r
+<file name="Z:\common-eplugin\org.tizen.common.verrari.realm\src\org\tizen\common\verrari\template\StandardTemplate.java">\r
+<violation beginline="486" endline="488" begincolumn="13" endcolumn="13" rule="EmptyCatchBlock" ruleset="Basic Rules" package="org.tizen.common.verrari.template" class="StandardTemplate" method="getMapper" externalInfoUrl="http://pmd.sourceforge.net/rules/basic.html#EmptyCatchBlock" priority="2">\r
+Avoid empty catch blocks\r
+</violation>\r
+</file>\r
+</pmd>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<ruleset>\r
+ <rule ref="rulesets/strictexception.xml/AvoidCatchingNPE">\r
+ <priority>2</priority>\r
+ </rule>\r
+ <rule ref="rulesets/strictexception.xml/AvoidRethrowingException">\r
+ <priority>2</priority>\r
+ </rule>\r
+ <rule ref="rulesets/strictexception.xml/AvoidThrowingNullPointerException">\r
+ <priority>2</priority>\r
+ </rule>\r
+ <rule ref="rulesets/strictexception.xml/AvoidThrowingRawExceptionTypes">\r
+ <priority>2</priority>\r
+ </rule>\r
+ <rule ref="rulesets/basic.xml/AvoidUsingHardCodedIP">\r
+ <priority>3</priority>\r
+ </rule>\r
+ <rule ref="rulesets/basic.xml/EmptyInitializer">\r
+ <priority>3</priority>\r
+ </rule>\r
+ <rule ref="rulesets/basic.xml/BrokenNullCheck">\r
+ <priority>2</priority>\r
+ </rule>\r
+ <rule ref="rulesets/strictexception.xml/DoNotExtendJavaLangError">\r
+ <priority>2</priority>\r
+ </rule>\r
+ <rule ref="rulesets/basic.xml/EmptyCatchBlock">\r
+ <priority>2</priority>\r
+ </rule>\r
+ <rule ref="rulesets/finalizers.xml/EmptyFinalizer">\r
+ <priority>2</priority>\r
+ </rule>\r
+ <rule ref="rulesets/basic.xml/EmptyFinallyBlock">\r
+ <priority>2</priority>\r
+ </rule>\r
+ <rule ref="rulesets/basic.xml/EmptyIfStmt">\r
+ <priority>2</priority>\r
+ </rule>\r
+ <rule ref="rulesets/design.xml/EmptyMethodInAbstractClassShouldBeAbstract">\r
+ <priority>2</priority>\r
+ </rule>\r
+ <rule ref="rulesets/basic.xml/EmptyStatementNotInLoop">\r
+ <priority>2</priority>\r
+ </rule>\r
+ <rule ref="rulesets/basic.xml/EmptyStaticInitializer">\r
+ <priority>2</priority>\r
+ </rule>\r
+ <rule ref="rulesets/basic.xml/EmptySwitchStatements">\r
+ <priority>2</priority>\r
+ </rule>\r
+ <rule ref="rulesets/basic.xml/EmptySynchronizedBlock">\r
+ <priority>2</priority>\r
+ </rule>\r
+ <rule ref="rulesets/basic.xml/EmptyTryBlock">\r
+ <priority>2</priority>\r
+ </rule>\r
+ <rule ref="rulesets/basic.xml/EmptyWhileStmt">\r
+ <priority>2</priority>\r
+ </rule>\r
+ <rule ref="rulesets/strictexception.xml/ExceptionAsFlowControl">\r
+ <priority>2</priority>\r
+ </rule>\r
+ <rule ref="rulesets/braces.xml/ForLoopsMustUseBraces">\r
+ <priority>4</priority>\r
+ </rule>\r
+ <rule ref="rulesets/braces.xml/IfElseStmtsMustUseBraces">\r
+ <priority>4</priority>\r
+ </rule>\r
+ <rule ref="rulesets/braces.xml/IfStmtsMustUseBraces">\r
+ <priority>4</priority>\r
+ </rule>\r
+ <rule ref="rulesets/basic.xml/MisplacedNullCheck">\r
+ <priority>2</priority>\r
+ </rule>\r
+ <rule ref="rulesets/design.xml/MissingBreakInSwitch">\r
+ <priority>2</priority>\r
+ </rule>\r
+ <rule ref="rulesets/strictexception.xml/AvoidThrowingNewInstanceOfSameException">\r
+ <priority>2</priority>\r
+ </rule>\r
+ <rule ref="rulesets/strictexception.xml/DoNotThrowExceptionInFinally">\r
+ <priority>2</priority>\r
+ </rule>\r
+ <rule ref="rulesets/unusedcode.xml/UnusedLocalVariable">\r
+ <priority>3</priority>\r
+ </rule>\r
+ <rule ref="rulesets/controversial.xml/UnusedModifier">\r
+ <priority>5</priority>\r
+ </rule>\r
+</ruleset>\r
+\r
Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name
Bundle-SymbolicName: org.tizen.common.verrari
-Bundle-Version: 1.0.0.qualifier
+Bundle-Version: 2.0.0.qualifier
Bundle-Activator: org.tizen.common.verrari.Activator
Bundle-Vendor: %Bundle-Vendor
Require-Bundle: org.eclipse.ui,
{
final Template freemarkerTemplate = cfg.getTemplate( templateKey );
Assert.notNull( freemarkerTemplate, "Template is null for " + templateKey );
-
final IModelProvider adapter = new FreemarkerModelManager( modelProvider );
freemarkerTemplate.process( adapter, new OutputStreamWriter( output ) );
}
@Override
public String translateFunction(String contents) {
// $@{ApplicationID()} ---> ${ApplicationID()}
+ // $@{AppID=ApplicationID()} ---> <#assign AppID="${ApplicationID()}"> ${AppID}
Pattern pattern = Pattern.compile(REGEX_FUNCTION);
Matcher matcher = pattern.matcher(contents);
String translatedContents = contents;
while (matcher.find()) {
- translatedContents = translatedContents.replace(matcher.group(), matcher.group().replace("$@", "$")); //$NON-NLS-1$ //$NON-NLS-2$
+ String matchGroup = matcher.group();
+ if (matchGroup.contains("=")) { //$NON-NLS-1$
+ matchGroup = matchGroup.replace("$@{", "").replace("}", ""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ String[] arguments = matchGroup.split("="); //$NON-NLS-1$
+ String assignFunction = String.format("<#assign %s=\"${%s}\">${%s}", arguments[0].trim(), arguments[1].trim(), arguments[0].trim()); //$NON-NLS-1$
+ translatedContents = translatedContents.replace(matcher.group(), assignFunction);
+ } else {
+ translatedContents = translatedContents.replace(matcher.group(), matcher.group().replace("$@", "$")); //$NON-NLS-1$ //$NON-NLS-2$
+ }
}
return translatedContents;
}
public abstract class TemplateTransformer {
// Template Common Notation
- // $# line comment
+ // $# line comment
public static final String REGEX_LINECOMMENT = "(\\$\\#).*"; //$NON-NLS-1$
// $${key|"default"}
public static final String REGEX_TRANSFORM = "(\\$\\$\\{)(.*?)(\\})"; //$NON-NLS-1$
- // $@{fun()}
+ // $@{fun()} // $@{localVariable=fun()}
public static final String REGEX_FUNCTION = "(\\$\\@\\{)(.*?)(\\})"; //$NON-NLS-1$
// $$include{templateKey}
public static final String REGEX_INCLUDE = "(\\$\\$include)(.*?)(\\})"; //$NON-NLS-1$
<?xml version="1.0" encoding="UTF-8"?>
<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets" id="http://yourdomain/$${WidgetID|"WidgetID"}" version="1.0.0" viewmodes="maximized">
- <tizen:application id="$@{APPLICATIONID()}" required_version="1.0"/>
+ <tizen:application id="$@{APPID=APPLICATIONID()}.$${WidgetID|"WidgetID"}" package="$${APPID}" required_version="1.0"/>
<content src="index.html"/>
<icon src="icon.png"/>
<name>$${WidgetID|"WidgetID"}</name>
/*
-* jQuery Mobile Framework 1.1.0 db342b1f315c282692791aa870455901fdb46a55
+* jQuery Mobile Framework Git Build: SHA1: b49cc06499abf8f987cf90f35349cfac0918c939 <> Date: Tue Oct 2 11:22:34 2012 -0700
* http://jquerymobile.com
*
-* Copyright 2011 (c) jQuery Project
-* Dual licensed under the MIT or GPL Version 2 licenses.
+* Copyright 2012 jQuery Foundation and other contributors
+* Released under the MIT license.
* http://jquery.org/license
*
*/
+
+
/* Swatches */
/* A
-----------------------------------------------------------------------------------------------------------*/
.ui-bar-a {
border: 1px solid #333 /*{a-bar-border}*/;
- background: #111111 /*{a-bar-background-color}*/;
- color: #ffffff /*{a-bar-color}*/;
+ background: #111 /*{a-bar-background-color}*/;
+ color: #fff /*{a-bar-color}*/;
font-weight: bold;
- text-shadow: 0 /*{a-bar-shadow-x}*/ -1px /*{a-bar-shadow-y}*/ 1px /*{a-bar-shadow-radius}*/ #000000 /*{a-bar-shadow-color}*/;
+ text-shadow: 0 /*{a-bar-shadow-x}*/ -1px /*{a-bar-shadow-y}*/ 1px /*{a-bar-shadow-radius}*/ #000 /*{a-bar-shadow-color}*/;
background-image: -webkit-gradient(linear, left top, left bottom, from( #3c3c3c /*{a-bar-background-start}*/), to( #111 /*{a-bar-background-end}*/)); /* Saf4+, Chrome */
background-image: -webkit-linear-gradient( #3c3c3c /*{a-bar-background-start}*/, #111 /*{a-bar-background-end}*/); /* Chrome 10+, Saf5.1+ */
background-image: -moz-linear-gradient( #3c3c3c /*{a-bar-background-start}*/, #111 /*{a-bar-background-end}*/); /* FF3.6 */
background-image: -o-linear-gradient( #3c3c3c /*{a-bar-background-start}*/, #111 /*{a-bar-background-end}*/); /* Opera 11.10+ */
background-image: linear-gradient( #3c3c3c /*{a-bar-background-start}*/, #111 /*{a-bar-background-end}*/);
}
-.ui-bar-a,
-.ui-bar-a input,
-.ui-bar-a select,
-.ui-bar-a textarea,
+.ui-bar-a,
+.ui-bar-a input,
+.ui-bar-a select,
+.ui-bar-a textarea,
.ui-bar-a button {
font-family: Helvetica, Arial, sans-serif /*{global-font-family}*/;
}
.ui-bar-a .ui-link-inherit {
color: #fff /*{a-bar-color}*/;
}
-.ui-bar-a .ui-link {
+.ui-bar-a a.ui-link {
color: #7cc4e7 /*{a-bar-link-color}*/;
font-weight: bold;
}
-.ui-bar-a .ui-link:hover {
- color: #2489CE /*{a-bar-link-hover}*/;
+.ui-bar-a a.ui-link:visited {
+ color: #2489ce /*{a-bar-link-visited}*/;
}
-.ui-bar-a .ui-link:active {
- color: #2489CE /*{a-bar-link-active}*/;
+.ui-bar-a a.ui-link:hover {
+ color: #2489ce /*{a-bar-link-hover}*/;
}
-.ui-bar-a .ui-link:visited {
- color: #2489CE /*{a-bar-link-visited}*/;
+.ui-bar-a a.ui-link:active {
+ color: #2489ce /*{a-bar-link-active}*/;
}
.ui-body-a,
.ui-overlay-a {
color: #fff /*{a-body-color}*/;
}
.ui-body-a .ui-link {
- color: #2489CE /*{a-body-link-color}*/;
+ color: #2489ce /*{a-body-link-color}*/;
font-weight: bold;
}
+.ui-body-a .ui-link:visited {
+ color: #2489ce /*{a-body-link-visited}*/;
+}
.ui-body-a .ui-link:hover {
- color: #2489CE /*{a-body-link-hover}*/;
+ color: #2489ce /*{a-body-link-hover}*/;
}
.ui-body-a .ui-link:active {
- color: #2489CE /*{a-body-link-active}*/;
-}
-.ui-body-a .ui-link:visited {
- color: #2489CE /*{a-body-link-visited}*/;
+ color: #2489ce /*{a-body-link-active}*/;
}
.ui-btn-up-a {
border: 1px solid #111 /*{a-bup-border}*/;
font-weight: bold;
color: #fff /*{a-bup-color}*/;
text-shadow: 0 /*{a-bup-shadow-x}*/ 1px /*{a-bup-shadow-y}*/ 1px /*{a-bup-shadow-radius}*/ #111 /*{a-bup-shadow-color}*/;
- background-image: -webkit-gradient(linear, left top, left bottom, from( #444444 /*{a-bup-background-start}*/), to( #2d2d2d /*{a-bup-background-end}*/)); /* Saf4+, Chrome */
- background-image: -webkit-linear-gradient( #444444 /*{a-bup-background-start}*/, #2d2d2d /*{a-bup-background-end}*/); /* Chrome 10+, Saf5.1+ */
- background-image: -moz-linear-gradient( #444444 /*{a-bup-background-start}*/, #2d2d2d /*{a-bup-background-end}*/); /* FF3.6 */
- background-image: -ms-linear-gradient( #444444 /*{a-bup-background-start}*/, #2d2d2d /*{a-bup-background-end}*/); /* IE10 */
- background-image: -o-linear-gradient( #444444 /*{a-bup-background-start}*/, #2d2d2d /*{a-bup-background-end}*/); /* Opera 11.10+ */
- background-image: linear-gradient( #444444 /*{a-bup-background-start}*/, #2d2d2d /*{a-bup-background-end}*/);
-}
+ background-image: -webkit-gradient(linear, left top, left bottom, from( #444 /*{a-bup-background-start}*/), to( #2d2d2d /*{a-bup-background-end}*/)); /* Saf4+, Chrome */
+ background-image: -webkit-linear-gradient( #444 /*{a-bup-background-start}*/, #2d2d2d /*{a-bup-background-end}*/); /* Chrome 10+, Saf5.1+ */
+ background-image: -moz-linear-gradient( #444 /*{a-bup-background-start}*/, #2d2d2d /*{a-bup-background-end}*/); /* FF3.6 */
+ background-image: -ms-linear-gradient( #444 /*{a-bup-background-start}*/, #2d2d2d /*{a-bup-background-end}*/); /* IE10 */
+ background-image: -o-linear-gradient( #444 /*{a-bup-background-start}*/, #2d2d2d /*{a-bup-background-end}*/); /* Opera 11.10+ */
+ background-image: linear-gradient( #444 /*{a-bup-background-start}*/, #2d2d2d /*{a-bup-background-end}*/);
+}
+.ui-btn-up-a:visited,
.ui-btn-up-a a.ui-link-inherit {
color: #fff /*{a-bup-color}*/;
}
.ui-btn-hover-a {
border: 1px solid #000 /*{a-bhover-border}*/;
- background: #444444 /*{a-bhover-background-color}*/;
+ background: #444 /*{a-bhover-background-color}*/;
font-weight: bold;
color: #fff /*{a-bhover-color}*/;
text-shadow: 0 /*{a-bhover-shadow-x}*/ 1px /*{a-bhover-shadow-y}*/ 1px /*{a-bhover-shadow-radius}*/ #111 /*{a-bhover-shadow-color}*/;
- background-image: -webkit-gradient(linear, left top, left bottom, from( #555555 /*{a-bhover-background-start}*/), to( #383838 /*{a-bhover-background-end}*/)); /* Saf4+, Chrome */
- background-image: -webkit-linear-gradient( #555555 /*{a-bhover-background-start}*/, #383838 /*{a-bhover-background-end}*/); /* Chrome 10+, Saf5.1+ */
- background-image: -moz-linear-gradient( #555555 /*{a-bhover-background-start}*/, #383838 /*{a-bhover-background-end}*/); /* FF3.6 */
- background-image: -ms-linear-gradient( #555555 /*{a-bhover-background-start}*/, #383838 /*{a-bhover-background-end}*/); /* IE10 */
- background-image: -o-linear-gradient( #555555 /*{a-bhover-background-start}*/, #383838 /*{a-bhover-background-end}*/); /* Opera 11.10+ */
- background-image: linear-gradient( #555555 /*{a-bhover-background-start}*/, #383838 /*{a-bhover-background-end}*/);
-}
+ background-image: -webkit-gradient(linear, left top, left bottom, from( #555 /*{a-bhover-background-start}*/), to( #383838 /*{a-bhover-background-end}*/)); /* Saf4+, Chrome */
+ background-image: -webkit-linear-gradient( #555 /*{a-bhover-background-start}*/, #383838 /*{a-bhover-background-end}*/); /* Chrome 10+, Saf5.1+ */
+ background-image: -moz-linear-gradient( #555 /*{a-bhover-background-start}*/, #383838 /*{a-bhover-background-end}*/); /* FF3.6 */
+ background-image: -ms-linear-gradient( #555 /*{a-bhover-background-start}*/, #383838 /*{a-bhover-background-end}*/); /* IE10 */
+ background-image: -o-linear-gradient( #555 /*{a-bhover-background-start}*/, #383838 /*{a-bhover-background-end}*/); /* Opera 11.10+ */
+ background-image: linear-gradient( #555 /*{a-bhover-background-start}*/, #383838 /*{a-bhover-background-end}*/);
+}
+.ui-btn-hover-a:visited,
+.ui-btn-hover-a:hover,
.ui-btn-hover-a a.ui-link-inherit {
color: #fff /*{a-bhover-color}*/;
}
background-image: -o-linear-gradient( #202020 /*{a-bdown-background-start}*/, #2c2c2c /*{a-bdown-background-end}*/); /* Opera 11.10+ */
background-image: linear-gradient( #202020 /*{a-bdown-background-start}*/, #2c2c2c /*{a-bdown-background-end}*/);
}
+.ui-btn-down-a:visited,
+.ui-btn-down-a:hover,
.ui-btn-down-a a.ui-link-inherit {
color: #fff /*{a-bdown-color}*/;
}
.ui-bar-b .ui-link-inherit {
color: #fff /*{b-bar-color}*/;
}
-.ui-bar-b .ui-link {
+.ui-bar-b a.ui-link {
color: #ddf0f8 /*{b-bar-link-color}*/;
font-weight: bold;
}
-.ui-bar-b .ui-link:hover {
+.ui-bar-b a.ui-link:visited {
+ color: #ddf0f8 /*{b-bar-link-visited}*/;
+}
+.ui-bar-b a.ui-link:hover {
color: #ddf0f8 /*{b-bar-link-hover}*/;
}
-.ui-bar-b .ui-link:active {
+.ui-bar-b a.ui-link:active {
color: #ddf0f8 /*{b-bar-link-active}*/;
}
-.ui-bar-b .ui-link:visited {
- color: #ddf0f8 /*{b-bar-link-visited}*/;
-}
.ui-body-b,
.ui-overlay-b {
border: 1px solid #999 /*{b-body-border}*/;
background: #f3f3f3 /*{b-body-background-color}*/;
- color: #222222 /*{b-body-color}*/;
+ color: #222 /*{b-body-color}*/;
text-shadow: 0 /*{b-body-shadow-x}*/ 1px /*{b-body-shadow-y}*/ 0 /*{b-body-shadow-radius}*/ #fff /*{b-body-shadow-color}*/;
font-weight: normal;
background-image: -webkit-gradient(linear, left top, left bottom, from( #ddd /*{b-body-background-start}*/), to( #ccc /*{b-body-background-end}*/)); /* Saf4+, Chrome */
font-family: Helvetica, Arial, sans-serif /*{global-font-family}*/;
}
.ui-body-b .ui-link-inherit {
- color: #333333 /*{b-body-color}*/;
+ color: #333 /*{b-body-color}*/;
}
.ui-body-b .ui-link {
- color: #2489CE /*{b-body-link-color}*/;
+ color: #2489ce /*{b-body-link-color}*/;
font-weight: bold;
}
+.ui-body-b .ui-link:visited {
+ color: #2489ce /*{b-body-link-visited}*/;
+}
.ui-body-b .ui-link:hover {
- color: #2489CE /*{b-body-link-hover}*/;
+ color: #2489ce /*{b-body-link-hover}*/;
}
.ui-body-b .ui-link:active {
- color: #2489CE /*{b-body-link-active}*/;
-}
-.ui-body-b .ui-link:visited {
- color: #2489CE /*{b-body-link-visited}*/;
+ color: #2489ce /*{b-body-link-active}*/;
}
.ui-btn-up-b {
border: 1px solid #044062 /*{b-bup-border}*/;
background-image: -o-linear-gradient( #5f9cc5 /*{b-bup-background-start}*/, #396b9e /*{b-bup-background-end}*/); /* Opera 11.10+ */
background-image: linear-gradient( #5f9cc5 /*{b-bup-background-start}*/, #396b9e /*{b-bup-background-end}*/);
}
+.ui-btn-up-b:visited,
.ui-btn-up-b a.ui-link-inherit {
color: #fff /*{b-bup-color}*/;
}
background-image: -o-linear-gradient( #6facd5 /*{b-bhover-background-start}*/, #4272a4 /*{b-bhover-background-end}*/); /* Opera 11.10+ */
background-image: linear-gradient( #6facd5 /*{b-bhover-background-start}*/, #4272a4 /*{b-bhover-background-end}*/);
}
+.ui-btn-hover-b:visited,
+.ui-btn-hover-b:hover,
.ui-btn-hover-b a.ui-link-inherit {
color: #fff /*{b-bhover-color}*/;
}
background-image: -o-linear-gradient( #295b8e /*{b-bdown-background-start}*/, #3e79b5 /*{b-bdown-background-end}*/); /* Opera 11.10+ */
background-image: linear-gradient( #295b8e /*{b-bdown-background-start}*/, #3e79b5 /*{b-bdown-background-end}*/);
}
+.ui-btn-down-b:visited,
+.ui-btn-down-b:hover,
.ui-btn-down-b a.ui-link-inherit {
color: #fff /*{b-bdown-color}*/;
}
/* C
-----------------------------------------------------------------------------------------------------------*/
.ui-bar-c {
- border: 1px solid #B3B3B3 /*{c-bar-border}*/;
- background: #eeeeee /*{c-bar-background-color}*/;
- color: #3E3E3E /*{c-bar-color}*/;
+ border: 1px solid #b3b3b3 /*{c-bar-border}*/;
+ background: #eee /*{c-bar-background-color}*/;
+ color: #3e3e3e /*{c-bar-color}*/;
font-weight: bold;
text-shadow: 0 /*{c-bar-shadow-x}*/ 1px /*{c-bar-shadow-y}*/ 1px /*{c-bar-shadow-radius}*/ #fff /*{c-bar-shadow-color}*/;
background-image: -webkit-gradient(linear, left top, left bottom, from( #f0f0f0 /*{c-bar-background-start}*/), to( #ddd /*{c-bar-background-end}*/)); /* Saf4+, Chrome */
background-image: linear-gradient( #f0f0f0 /*{c-bar-background-start}*/, #ddd /*{c-bar-background-end}*/);
}
.ui-bar-c .ui-link-inherit {
- color: #3E3E3E /*{c-bar-color}*/;
+ color: #3e3e3e /*{c-bar-color}*/;
}
-.ui-bar-c .ui-link {
+.ui-bar-c a.ui-link {
color: #7cc4e7 /*{c-bar-link-color}*/;
font-weight: bold;
}
-.ui-bar-c .ui-link:hover {
- color: #2489CE /*{c-bar-link-hover}*/;
+.ui-bar-c a.ui-link:visited {
+ color: #2489ce /*{c-bar-link-visited}*/;
}
-.ui-bar-c .ui-link:active {
- color: #2489CE /*{c-bar-link-active}*/;
+.ui-bar-c a.ui-link:hover {
+ color: #2489ce /*{c-bar-link-hover}*/;
}
-.ui-bar-c .ui-link:visited {
- color: #2489CE /*{c-bar-link-visited}*/;
+.ui-bar-c a.ui-link:active {
+ color: #2489ce /*{c-bar-link-active}*/;
}
.ui-bar-c,
.ui-bar-c input,
.ui-body-c,
.ui-overlay-c {
border: 1px solid #aaa /*{c-body-border}*/;
- color: #333333 /*{c-body-color}*/;
+ color: #333 /*{c-body-color}*/;
text-shadow: 0 /*{c-body-shadow-x}*/ 1px /*{c-body-shadow-y}*/ 0 /*{c-body-shadow-radius}*/ #fff /*{c-body-shadow-color}*/;
background: #f9f9f9 /*{c-body-background-color}*/;
- background-image: -webkit-gradient(linear, left top, left bottom, from( #f9f9f9 /*{c-body-background-start}*/), to( #eeeeee /*{c-body-background-end}*/)); /* Saf4+, Chrome */
- background-image: -webkit-linear-gradient( #f9f9f9 /*{c-body-background-start}*/, #eeeeee /*{c-body-background-end}*/); /* Chrome 10+, Saf5.1+ */
- background-image: -moz-linear-gradient( #f9f9f9 /*{c-body-background-start}*/, #eeeeee /*{c-body-background-end}*/); /* FF3.6 */
- background-image: -ms-linear-gradient( #f9f9f9 /*{c-body-background-start}*/, #eeeeee /*{c-body-background-end}*/); /* IE10 */
- background-image: -o-linear-gradient( #f9f9f9 /*{c-body-background-start}*/, #eeeeee /*{c-body-background-end}*/); /* Opera 11.10+ */
- background-image: linear-gradient( #f9f9f9 /*{c-body-background-start}*/, #eeeeee /*{c-body-background-end}*/);
+ background-image: -webkit-gradient(linear, left top, left bottom, from( #f9f9f9 /*{c-body-background-start}*/), to( #eee /*{c-body-background-end}*/)); /* Saf4+, Chrome */
+ background-image: -webkit-linear-gradient( #f9f9f9 /*{c-body-background-start}*/, #eee /*{c-body-background-end}*/); /* Chrome 10+, Saf5.1+ */
+ background-image: -moz-linear-gradient( #f9f9f9 /*{c-body-background-start}*/, #eee /*{c-body-background-end}*/); /* FF3.6 */
+ background-image: -ms-linear-gradient( #f9f9f9 /*{c-body-background-start}*/, #eee /*{c-body-background-end}*/); /* IE10 */
+ background-image: -o-linear-gradient( #f9f9f9 /*{c-body-background-start}*/, #eee /*{c-body-background-end}*/); /* Opera 11.10+ */
+ background-image: linear-gradient( #f9f9f9 /*{c-body-background-start}*/, #eee /*{c-body-background-end}*/);
}
.ui-overlay-c {
background-image: none;
font-family: Helvetica, Arial, sans-serif /*{global-font-family}*/;
}
.ui-body-c .ui-link-inherit {
- color: #333333 /*{c-body-color}*/;
+ color: #333 /*{c-body-color}*/;
}
.ui-body-c .ui-link {
- color: #2489CE /*{c-body-link-color}*/;
+ color: #2489ce /*{c-body-link-color}*/;
font-weight: bold;
}
+.ui-body-c .ui-link:visited {
+ color: #2489ce /*{c-body-link-visited}*/;
+}
.ui-body-c .ui-link:hover {
- color: #2489CE /*{c-body-link-hover}*/;
+ color: #2489ce /*{c-body-link-hover}*/;
}
.ui-body-c .ui-link:active {
- color: #2489CE /*{c-body-link-active}*/;
-}
-.ui-body-c .ui-link:visited {
- color: #2489CE /*{c-body-link-visited}*/;
+ color: #2489ce /*{c-body-link-active}*/;
}
.ui-btn-up-c {
border: 1px solid #ccc /*{c-bup-border}*/;
background: #eee /*{c-bup-background-color}*/;
font-weight: bold;
color: #222 /*{c-bup-color}*/;
- text-shadow: 0 /*{c-bup-shadow-x}*/ 1px /*{c-bup-shadow-y}*/ 0 /*{c-bup-shadow-radius}*/ #ffffff /*{c-bup-shadow-color}*/;
- background-image: -webkit-gradient(linear, left top, left bottom, from( #ffffff /*{c-bup-background-start}*/), to( #f1f1f1 /*{c-bup-background-end}*/)); /* Saf4+, Chrome */
- background-image: -webkit-linear-gradient( #ffffff /*{c-bup-background-start}*/, #f1f1f1 /*{c-bup-background-end}*/); /* Chrome 10+, Saf5.1+ */
- background-image: -moz-linear-gradient( #ffffff /*{c-bup-background-start}*/, #f1f1f1 /*{c-bup-background-end}*/); /* FF3.6 */
- background-image: -ms-linear-gradient( #ffffff /*{c-bup-background-start}*/, #f1f1f1 /*{c-bup-background-end}*/); /* IE10 */
- background-image: -o-linear-gradient( #ffffff /*{c-bup-background-start}*/, #f1f1f1 /*{c-bup-background-end}*/); /* Opera 11.10+ */
- background-image: linear-gradient( #ffffff /*{c-bup-background-start}*/, #f1f1f1 /*{c-bup-background-end}*/);
-}
+ text-shadow: 0 /*{c-bup-shadow-x}*/ 1px /*{c-bup-shadow-y}*/ 0 /*{c-bup-shadow-radius}*/ #fff /*{c-bup-shadow-color}*/;
+ background-image: -webkit-gradient(linear, left top, left bottom, from( #fff /*{c-bup-background-start}*/), to( #f1f1f1 /*{c-bup-background-end}*/)); /* Saf4+, Chrome */
+ background-image: -webkit-linear-gradient( #fff /*{c-bup-background-start}*/, #f1f1f1 /*{c-bup-background-end}*/); /* Chrome 10+, Saf5.1+ */
+ background-image: -moz-linear-gradient( #fff /*{c-bup-background-start}*/, #f1f1f1 /*{c-bup-background-end}*/); /* FF3.6 */
+ background-image: -ms-linear-gradient( #fff /*{c-bup-background-start}*/, #f1f1f1 /*{c-bup-background-end}*/); /* IE10 */
+ background-image: -o-linear-gradient( #fff /*{c-bup-background-start}*/, #f1f1f1 /*{c-bup-background-end}*/); /* Opera 11.10+ */
+ background-image: linear-gradient( #fff /*{c-bup-background-start}*/, #f1f1f1 /*{c-bup-background-end}*/);
+}
+.ui-btn-up-c:visited,
.ui-btn-up-c a.ui-link-inherit {
- color: #2F3E46 /*{c-bup-color}*/;
+ color: #2f3e46 /*{c-bup-color}*/;
}
.ui-btn-hover-c {
border: 1px solid #bbb /*{c-bhover-border}*/;
background: #dfdfdf /*{c-bhover-background-color}*/;
font-weight: bold;
color: #222 /*{c-bhover-color}*/;
- text-shadow: 0 /*{c-bhover-shadow-x}*/ 1px /*{c-bhover-shadow-y}*/ 0 /*{c-bhover-shadow-radius}*/ #ffffff /*{c-bhover-shadow-color}*/;
+ text-shadow: 0 /*{c-bhover-shadow-x}*/ 1px /*{c-bhover-shadow-y}*/ 0 /*{c-bhover-shadow-radius}*/ #fff /*{c-bhover-shadow-color}*/;
background-image: -webkit-gradient(linear, left top, left bottom, from( #f6f6f6 /*{c-bhover-background-start}*/), to( #e0e0e0 /*{c-bhover-background-end}*/)); /* Saf4+, Chrome */
- background-image: -webkit-linear-gradient( #f9f9f9 /*{c-bhover-background-start}*/, #e0e0e0 /*{c-bhover-background-end}*/); /* Chrome 10+, Saf5.1+ */
+ background-image: -webkit-linear-gradient( #f6f6f6 /*{c-bhover-background-start}*/, #e0e0e0 /*{c-bhover-background-end}*/); /* Chrome 10+, Saf5.1+ */
background-image: -moz-linear-gradient( #f6f6f6 /*{c-bhover-background-start}*/, #e0e0e0 /*{c-bhover-background-end}*/); /* FF3.6 */
background-image: -ms-linear-gradient( #f6f6f6 /*{c-bhover-background-start}*/, #e0e0e0 /*{c-bhover-background-end}*/); /* IE10 */
background-image: -o-linear-gradient( #f6f6f6 /*{c-bhover-background-start}*/, #e0e0e0 /*{c-bhover-background-end}*/); /* Opera 11.10+ */
background-image: linear-gradient( #f6f6f6 /*{c-bhover-background-start}*/, #e0e0e0 /*{c-bhover-background-end}*/);
}
+.ui-btn-hover-c:visited,
+.ui-btn-hover-c:hover,
.ui-btn-hover-c a.ui-link-inherit {
- color: #2F3E46 /*{c-bhover-color}*/;
+ color: #2f3e46 /*{c-bhover-color}*/;
}
.ui-btn-down-c {
border: 1px solid #bbb /*{c-bdown-border}*/;
background: #d6d6d6 /*{c-bdown-background-color}*/;
font-weight: bold;
color: #222 /*{c-bdown-color}*/;
- text-shadow: 0 /*{c-bdown-shadow-x}*/ 1px /*{c-bdown-shadow-y}*/ 0 /*{c-bdown-shadow-radius}*/ #ffffff /*{c-bdown-shadow-color}*/;
+ text-shadow: 0 /*{c-bdown-shadow-x}*/ 1px /*{c-bdown-shadow-y}*/ 0 /*{c-bdown-shadow-radius}*/ #fff /*{c-bdown-shadow-color}*/;
background-image: -webkit-gradient(linear, left top, left bottom, from( #d0d0d0 /*{c-bdown-background-start}*/), to( #dfdfdf /*{c-bdown-background-end}*/)); /* Saf4+, Chrome */
background-image: -webkit-linear-gradient( #d0d0d0 /*{c-bdown-background-start}*/, #dfdfdf /*{c-bdown-background-end}*/); /* Chrome 10+, Saf5.1+ */
background-image: -moz-linear-gradient( #d0d0d0 /*{c-bdown-background-start}*/, #dfdfdf /*{c-bdown-background-end}*/); /* FF3.6 */
background-image: -o-linear-gradient( #d0d0d0 /*{c-bdown-background-start}*/, #dfdfdf /*{c-bdown-background-end}*/); /* Opera 11.10+ */
background-image: linear-gradient( #d0d0d0 /*{c-bdown-background-start}*/, #dfdfdf /*{c-bdown-background-end}*/);
}
+.ui-btn-down-c:visited,
+.ui-btn-down-c:hover,
.ui-btn-down-c a.ui-link-inherit {
- color: #2F3E46 /*{c-bdown-color}*/;
+ color: #2f3e46 /*{c-bdown-color}*/;
}
.ui-btn-up-c,
.ui-btn-hover-c,
border: 1px solid #bbb /*{d-bar-border}*/;
background: #bbb /*{d-bar-background-color}*/;
color: #333 /*{d-bar-color}*/;
+ font-weight: bold;
text-shadow: 0 /*{d-bar-shadow-x}*/ 1px /*{d-bar-shadow-y}*/ 0 /*{d-bar-shadow-radius}*/ #eee /*{d-bar-shadow-color}*/;
background-image: -webkit-gradient(linear, left top, left bottom, from( #ddd /*{d-bar-background-start}*/), to( #bbb /*{d-bar-background-end}*/)); /* Saf4+, Chrome */
background-image: -webkit-linear-gradient( #ddd /*{d-bar-background-start}*/, #bbb /*{d-bar-background-end}*/); /* Chrome 10+, Saf5.1+ */
font-family: Helvetica, Arial, sans-serif /*{global-font-family}*/;
}
.ui-bar-d .ui-link-inherit {
- color: #333333 /*{d-bar-color}*/;
+ color: #333 /*{d-bar-color}*/;
}
-.ui-bar-d .ui-link {
- color: #2489CE /*{d-bar-link-color}*/;
+.ui-bar-d a.ui-link {
+ color: #2489ce /*{d-bar-link-color}*/;
font-weight: bold;
}
-.ui-bar-d .ui-link:hover {
- color: #2489CE /*{d-bar-link-hover}*/;
+.ui-bar-d a.ui-link:visited {
+ color: #2489ce /*{d-bar-link-visited}*/;
}
-.ui-bar-d .ui-link:active {
- color: #2489CE /*{d-bar-link-active}*/;
+.ui-bar-d a.ui-link:hover {
+ color: #2489ce /*{d-bar-link-hover}*/;
}
-.ui-bar-d .ui-link:visited {
- color: #2489CE /*{d-bar-link-visited}*/;
+.ui-bar-d a.ui-link:active {
+ color: #2489ce /*{d-bar-link-active}*/;
}
.ui-body-d,
.ui-overlay-d {
border: 1px solid #bbb /*{d-body-border}*/;
- color: #333333 /*{d-body-color}*/;
+ color: #333 /*{d-body-color}*/;
text-shadow: 0 /*{d-body-shadow-x}*/ 1px /*{d-body-shadow-y}*/ 0 /*{d-body-shadow-radius}*/ #fff /*{d-body-shadow-color}*/;
- background: #ffffff /*{d-body-background-color}*/;
- background-image: -webkit-gradient(linear, left top, left bottom, from( #fff), to( #fff /*{d-body-background-end}*/)); /* Saf4+, Chrome */
+ background: #fff /*{d-body-background-color}*/;
+ background-image: -webkit-gradient(linear, left top, left bottom, from( #fff /*{d-body-background-start}*/), to( #fff /*{d-body-background-end}*/)); /* Saf4+, Chrome */
background-image: -webkit-linear-gradient( #fff /*{d-body-background-start}*/, #fff /*{d-body-background-end}*/); /* Chrome 10+, Saf5.1+ */
background-image: -moz-linear-gradient( #fff /*{d-body-background-start}*/, #fff /*{d-body-background-end}*/); /* FF3.6 */
background-image: -ms-linear-gradient( #fff /*{d-body-background-start}*/, #fff /*{d-body-background-end}*/); /* IE10 */
font-family: Helvetica, Arial, sans-serif /*{global-font-family}*/;
}
.ui-body-d .ui-link-inherit {
- color: #333333 /*{d-body-color}*/;
+ color: #333 /*{d-body-color}*/;
}
.ui-body-d .ui-link {
- color: #2489CE /*{d-body-link-color}*/;
+ color: #2489ce /*{d-body-link-color}*/;
font-weight: bold;
}
+.ui-body-d .ui-link:visited {
+ color: #2489ce /*{d-body-link-visited}*/;
+}
.ui-body-d .ui-link:hover {
- color: #2489CE /*{d-body-link-hover}*/;
+ color: #2489ce /*{d-body-link-hover}*/;
}
.ui-body-d .ui-link:active {
- color: #2489CE /*{d-body-link-active}*/;
-}
-.ui-body-d .ui-link:visited {
- color: #2489CE /*{d-body-link-visited}*/;
+ color: #2489ce /*{d-body-link-active}*/;
}
.ui-btn-up-d {
border: 1px solid #bbb /*{d-bup-border}*/;
font-weight: bold;
color: #333 /*{d-bup-color}*/;
text-shadow: 0 /*{d-bup-shadow-x}*/ 1px /*{d-bup-shadow-y}*/ 0 /*{d-bup-shadow-radius}*/ #fff /*{d-bup-shadow-color}*/;
- background-image: -webkit-gradient(linear, left top, left bottom, from( #fafafa), to( #f6f6f6 /*{d-bup-background-end}*/)); /* Saf4+, Chrome */
+ background-image: -webkit-gradient(linear, left top, left bottom, from( #fafafa /*{d-bup-background-start}*/), to( #f6f6f6 /*{d-bup-background-end}*/)); /* Saf4+, Chrome */
background-image: -webkit-linear-gradient( #fafafa /*{d-bup-background-start}*/, #f6f6f6 /*{d-bup-background-end}*/); /* Chrome 10+, Saf5.1+ */
background-image: -moz-linear-gradient( #fafafa /*{d-bup-background-start}*/, #f6f6f6 /*{d-bup-background-end}*/); /* FF3.6 */
background-image: -ms-linear-gradient( #fafafa /*{d-bup-background-start}*/, #f6f6f6 /*{d-bup-background-end}*/); /* IE10 */
background-image: -o-linear-gradient( #fafafa /*{d-bup-background-start}*/, #f6f6f6 /*{d-bup-background-end}*/); /* Opera 11.10+ */
background-image: linear-gradient( #fafafa /*{d-bup-background-start}*/, #f6f6f6 /*{d-bup-background-end}*/);
}
+.ui-btn-up-d:visited,
.ui-btn-up-d a.ui-link-inherit {
color: #333 /*{d-bup-color}*/;
}
.ui-btn-hover-d {
border: 1px solid #aaa /*{d-bhover-border}*/;
- background: #eeeeee /*{d-bhover-background-color}*/;
+ background: #eee /*{d-bhover-background-color}*/;
font-weight: bold;
color: #333 /*{d-bhover-color}*/;
cursor: pointer;
text-shadow: 0 /*{d-bhover-shadow-x}*/ 1px /*{d-bhover-shadow-y}*/ 0 /*{d-bhover-shadow-radius}*/ #fff /*{d-bhover-shadow-color}*/;
- background-image: -webkit-gradient(linear, left top, left bottom, from( #eee), to( #fff /*{d-bhover-background-end}*/)); /* Saf4+, Chrome */
+ background-image: -webkit-gradient(linear, left top, left bottom, from( #eee /*{d-bhover-background-start}*/), to( #fff /*{d-bhover-background-end}*/)); /* Saf4+, Chrome */
background-image: -webkit-linear-gradient( #eee /*{d-bhover-background-start}*/, #fff /*{d-bhover-background-end}*/); /* Chrome 10+, Saf5.1+ */
background-image: -moz-linear-gradient( #eee /*{d-bhover-background-start}*/, #fff /*{d-bhover-background-end}*/); /* FF3.6 */
background-image: -ms-linear-gradient( #eee /*{d-bhover-background-start}*/, #fff /*{d-bhover-background-end}*/); /* IE10 */
background-image: -o-linear-gradient( #eee /*{d-bhover-background-start}*/, #fff /*{d-bhover-background-end}*/); /* Opera 11.10+ */
background-image: linear-gradient( #eee /*{d-bhover-background-start}*/, #fff /*{d-bhover-background-end}*/);
}
+.ui-btn-hover-d:visited,
+.ui-btn-hover-d:hover,
.ui-btn-hover-d a.ui-link-inherit {
color: #333 /*{d-bhover-color}*/;
}
background: #eee /*{d-bdown-background-color}*/;
font-weight: bold;
color: #333 /*{d-bdown-color}*/;
- text-shadow: 0 /*{d-bdown-shadow-x}*/ 1px /*{d-bdown-shadow-y}*/ 0 /*{d-bdown-shadow-radius}*/ #ffffff /*{d-bdown-shadow-color}*/;
+ text-shadow: 0 /*{d-bdown-shadow-x}*/ 1px /*{d-bdown-shadow-y}*/ 0 /*{d-bdown-shadow-radius}*/ #fff /*{d-bdown-shadow-color}*/;
background-image: -webkit-gradient(linear, left top, left bottom, from( #e5e5e5 /*{d-bdown-background-start}*/), to( #f2f2f2 /*{d-bdown-background-end}*/)); /* Saf4+, Chrome */
background-image: -webkit-linear-gradient( #e5e5e5 /*{d-bdown-background-start}*/, #f2f2f2 /*{d-bdown-background-end}*/); /* Chrome 10+, Saf5.1+ */
background-image: -moz-linear-gradient( #e5e5e5 /*{d-bdown-background-start}*/, #f2f2f2 /*{d-bdown-background-end}*/); /* FF3.6 */
background-image: -o-linear-gradient( #e5e5e5 /*{d-bdown-background-start}*/, #f2f2f2 /*{d-bdown-background-end}*/); /* Opera 11.10+ */
background-image: linear-gradient( #e5e5e5 /*{d-bdown-background-start}*/, #f2f2f2 /*{d-bdown-background-end}*/);
}
+.ui-btn-down-d:visited,
+.ui-btn-down-d:hover,
.ui-btn-down-d a.ui-link-inherit {
color: #333 /*{d-bdown-color}*/;
}
/* E
-----------------------------------------------------------------------------------------------------------*/
.ui-bar-e {
- border: 1px solid #F7C942 /*{e-bar-border}*/;
+ border: 1px solid #f7c942 /*{e-bar-border}*/;
background: #fadb4e /*{e-bar-background-color}*/;
color: #333 /*{e-bar-color}*/;
+ font-weight: bold;
text-shadow: 0 /*{e-bar-shadow-x}*/ 1px /*{e-bar-shadow-y}*/ 0 /*{e-bar-shadow-radius}*/ #fff /*{e-bar-shadow-color}*/;
background-image: -webkit-gradient(linear, left top, left bottom, from( #fceda7 /*{e-bar-background-start}*/), to( #fbef7e /*{e-bar-background-end}*/)); /* Saf4+, Chrome */
background-image: -webkit-linear-gradient( #fceda7 /*{e-bar-background-start}*/, #fbef7e /*{e-bar-background-end}*/); /* Chrome 10+, Saf5.1+ */
font-family: Helvetica, Arial, sans-serif /*{global-font-family}*/;
}
.ui-bar-e .ui-link-inherit {
- color: #333333 /*{e-bar-color}*/;
+ color: #333 /*{e-bar-color}*/;
}
-.ui-bar-e .ui-link {
- color: #2489CE /*{e-bar-link-color}*/;
+.ui-bar-e a.ui-link {
+ color: #2489ce /*{e-bar-link-color}*/;
font-weight: bold;
}
-.ui-bar-e .ui-link:hover {
- color: #2489CE /*{e-bar-link-hover}*/;
+.ui-bar-e a.ui-link:visited {
+ color: #2489ce /*{e-bar-link-visited}*/;
}
-.ui-bar-e .ui-link:active {
- color: #2489CE /*{e-bar-link-active}*/;
+.ui-bar-e a.ui-link:hover {
+ color: #2489ce /*{e-bar-link-hover}*/;
}
-.ui-bar-e .ui-link:visited {
- color: #2489CE /*{e-bar-link-visited}*/;
+.ui-bar-e a.ui-link:active {
+ color: #2489ce /*{e-bar-link-active}*/;
}
.ui-body-e,
.ui-overlay-e {
- border: 1px solid #F7C942 /*{e-body-border}*/;
- color: #222222 /*{e-body-color}*/;
+ border: 1px solid #f7c942 /*{e-body-border}*/;
+ color: #222 /*{e-body-color}*/;
text-shadow: 0 /*{e-body-shadow-x}*/ 1px /*{e-body-shadow-y}*/ 0 /*{e-body-shadow-radius}*/ #fff /*{e-body-shadow-color}*/;
background: #fff9df /*{e-body-background-color}*/;
background-image: -webkit-gradient(linear, left top, left bottom, from( #fffadf /*{e-body-background-start}*/), to( #fff3a5 /*{e-body-background-end}*/)); /* Saf4+, Chrome */
font-family: Helvetica, Arial, sans-serif /*{global-font-family}*/;
}
.ui-body-e .ui-link-inherit {
- color: #333333 /*{e-body-color}*/;
+ color: #222 /*{e-body-color}*/;
}
.ui-body-e .ui-link {
- color: #2489CE /*{e-body-link-color}*/;
+ color: #2489ce /*{e-body-link-color}*/;
font-weight: bold;
}
+.ui-body-e .ui-link:visited {
+ color: #2489ce /*{e-body-link-visited}*/;
+}
.ui-body-e .ui-link:hover {
- color: #2489CE /*{e-body-link-hover}*/;
+ color: #2489ce /*{e-body-link-hover}*/;
}
.ui-body-e .ui-link:active {
- color: #2489CE /*{e-body-link-active}*/;
-}
-.ui-body-e .ui-link:visited {
- color: #2489CE /*{e-body-link-visited}*/;
+ color: #2489ce /*{e-body-link-active}*/;
}
.ui-btn-up-e {
- border: 1px solid #F4C63f /*{e-bup-border}*/;
+ border: 1px solid #f4c63f /*{e-bup-border}*/;
background: #fadb4e /*{e-bup-background-color}*/;
font-weight: bold;
color: #222 /*{e-bup-color}*/;
background-image: -o-linear-gradient( #ffefaa /*{e-bup-background-start}*/, #ffe155 /*{e-bup-background-end}*/); /* Opera 11.10+ */
background-image: linear-gradient( #ffefaa /*{e-bup-background-start}*/, #ffe155 /*{e-bup-background-end}*/);
}
+.ui-btn-up-e:visited,
.ui-btn-up-e a.ui-link-inherit {
color: #222 /*{e-bup-color}*/;
}
.ui-btn-hover-e {
- border: 1px solid #F2C43d /*{e-bhover-border}*/;
+ border: 1px solid #f2c43d /*{e-bhover-border}*/;
background: #fbe26f /*{e-bhover-background-color}*/;
font-weight: bold;
color: #111 /*{e-bhover-color}*/;
background-image: -o-linear-gradient( #fff5ba /*{e-bhover-background-start}*/, #fbdd52 /*{e-bhover-background-end}*/); /* Opera 11.10+ */
background-image: linear-gradient( #fff5ba /*{e-bhover-background-start}*/, #fbdd52 /*{e-bhover-background-end}*/);
}
+.ui-btn-hover-e:visited,
+.ui-btn-hover-e:hover,
.ui-btn-hover-e a.ui-link-inherit {
color: #333 /*{e-bhover-color}*/;
}
.ui-btn-down-e {
- border: 1px solid #F2C43d /*{e-bdown-border}*/;
+ border: 1px solid #f2c43d /*{e-bdown-border}*/;
background: #fceda7 /*{e-bdown-background-color}*/;
font-weight: bold;
color: #111 /*{e-bdown-color}*/;
- text-shadow: 0 /*{e-bdown-shadow-x}*/ 1px /*{e-bdown-shadow-y}*/ 0 /*{e-bdown-shadow-radius}*/ #ffffff /*{e-bdown-shadow-color}*/;
+ text-shadow: 0 /*{e-bdown-shadow-x}*/ 1px /*{e-bdown-shadow-y}*/ 0 /*{e-bdown-shadow-radius}*/ #fff /*{e-bdown-shadow-color}*/;
background-image: -webkit-gradient(linear, left top, left bottom, from( #f8d94c /*{e-bdown-background-start}*/), to( #fadb4e /*{e-bdown-background-end}*/)); /* Saf4+, Chrome */
background-image: -webkit-linear-gradient( #f8d94c /*{e-bdown-background-start}*/, #fadb4e /*{e-bdown-background-end}*/); /* Chrome 10+, Saf5.1+ */
background-image: -moz-linear-gradient( #f8d94c /*{e-bdown-background-start}*/, #fadb4e /*{e-bdown-background-end}*/); /* FF3.6 */
background-image: -o-linear-gradient( #f8d94c /*{e-bdown-background-start}*/, #fadb4e /*{e-bdown-background-end}*/); /* Opera 11.10+ */
background-image: linear-gradient( #f8d94c /*{e-bdown-background-start}*/, #fadb4e /*{e-bdown-background-end}*/);
}
+.ui-btn-down-e:visited,
+.ui-btn-down-e:hover,
.ui-btn-down-e a.ui-link-inherit {
color: #333 /*{e-bdown-color}*/;
}
background-image: linear-gradient( #5393c5 /*{global-active-background-start}*/, #6facd5 /*{global-active-background-end}*/);
font-family: Helvetica, Arial, sans-serif /*{global-font-family}*/;
}
+.ui-btn-active:visited,
+.ui-btn-active:hover,
.ui-btn-active a.ui-link-inherit {
color: #fff /*{global-active-color}*/;
}
/* Interaction cues
-----------------------------------------------------------------------------------------------------------*/
.ui-disabled {
- opacity: .3;
+ filter: Alpha(Opacity=30);
+ opacity: .3;
+ zoom: 1;
}
.ui-disabled,
.ui-disabled a {
cursor: default !important;
pointer-events: none;
}
-.ui-disabled .ui-btn-text {
- -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(opacity=30)";
- filter: alpha(opacity=30);
- zoom: 1;
-}
/* Icons
-----------------------------------------------------------------------------------------------------------*/
.ui-icon,
background-position: -720px 50%;
}
/* checks,radios */
-.ui-checkbox .ui-icon {
+.ui-checkbox .ui-icon,
+.ui-selectmenu-list .ui-icon {
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
/* radius clip workaround for cleaning up corner trapping */
.ui-corner-tl,
.ui-corner-tr,
-.ui-corner-bl,
+.ui-corner-bl,
.ui-corner-br,
.ui-corner-top,
-.ui-corner-bottom,
+.ui-corner-bottom,
.ui-corner-right,
.ui-corner-left,
.ui-corner-all,
.ui-btn-corner-tl,
.ui-btn-corner-tr,
-.ui-btn-corner-bl,
+.ui-btn-corner-bl,
.ui-btn-corner-br,
.ui-btn-corner-top,
-.ui-btn-corner-bottom,
+.ui-btn-corner-bottom,
.ui-btn-corner-right,
.ui-btn-corner-left,
.ui-btn-corner-all {
-----------------------------------------------------------------------------------------------------------*/
.ui-overlay {
background: #666;
- opacity: .5;
filter: Alpha(Opacity=50);
+ opacity: .5;
position: absolute;
width: 100%;
height: 100%;
}
/* Focus state - set here for specificity (note: these classes are added by JavaScript)
-----------------------------------------------------------------------------------------------------------*/
-.ui-btn:focus {
+.ui-btn:focus, .ui-link-inherit:focus {
outline: 0;
}
+.ui-btn.ui-focus {
+ z-index: 1;
+}
.ui-focus,
.ui-btn:focus {
- -moz-box-shadow: 0px 0px 12px #387bbe /*{global-active-background-color}*/;
- -webkit-box-shadow: 0px 0px 12px #387bbe /*{global-active-background-color}*/;
- box-shadow: 0px 0px 12px #387bbe /*{global-active-background-color}*/;
+ -moz-box-shadow: inset 0px 0px 3px #387bbe /*{global-active-background-color}*/, 0px 0px 9px #387bbe /*{global-active-background-color}*/;
+ -webkit-box-shadow: inset 0px 0px 3px #387bbe /*{global-active-background-color}*/, 0px 0px 9px #387bbe /*{global-active-background-color}*/;
+ box-shadow: inset 0px 0px 3px #387bbe /*{global-active-background-color}*/, 0px 0px 9px #387bbe /*{global-active-background-color}*/;
+}
+.ui-input-text.ui-focus,
+.ui-input-search.ui-focus {
+ -moz-box-shadow: 0px 0px 12px #387bbe /*{global-active-background-color}*/;
+ -webkit-box-shadow: 0px 0px 12px #387bbe /*{global-active-background-color}*/;
+ box-shadow: 0px 0px 12px #387bbe /*{global-active-background-color}*/;
}
/* unset box shadow in browsers that don't do it right
-----------------------------------------------------------------------------------------------------------*/
}
/* ...and bring back focus */
.ui-mobile-nosupport-boxshadow .ui-focus,
-.ui-mobile-nosupport-boxshadow .ui-btn:focus {
+.ui-mobile-nosupport-boxshadow .ui-btn:focus,
+.ui-mobile-nosupport-boxshadow .ui-link-inherit:focus {
outline-width: 1px;
- outline-style: dotted;
+ outline-style: auto;
}
/* some unsets - more probably needed */
.ui-mobile, .ui-mobile body { height: 99.9%; }
.ui-mobile fieldset, .ui-page { padding: 0; margin: 0; }
.ui-mobile a img, .ui-mobile fieldset { border-width: 0; }
/* responsive page widths */
-.ui-mobile-viewport { margin: 0; overflow-x: visible; -webkit-text-size-adjust: none; -ms-text-size-adjust:none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); }
+.ui-mobile-viewport { margin: 0; overflow-x: visible; -webkit-text-size-adjust: 100%; -ms-text-size-adjust:none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); }
/* Issue #2066 */
body.ui-mobile-viewport,
div.ui-mobile-viewport { overflow-x: hidden; }
}
/* loading screen */
.ui-loading .ui-loader { display: block; }
-.ui-loader { display: none; z-index: 9999999; position: fixed; top: 50%; box-shadow: 0 1px 1px -1px #fff; left: 50%; border:0; }
-.ui-loader-default { background: none; opacity: .18; width: 46px; height: 46px; margin-left: -23px; margin-top: -23px; }
-.ui-loader-verbose { width: 200px; opacity: .88; height: auto; margin-left: -110px; margin-top: -43px; padding: 10px; }
+.ui-loader { display: none; z-index: 9999999; position: fixed; top: 50%; left: 50%; border:0; }
+.ui-loader-default { background: none; filter: Alpha(Opacity=18); opacity: .18; width: 46px; height: 46px; margin-left: -23px; margin-top: -23px; }
+.ui-loader-verbose { width: 200px; filter: Alpha(Opacity=88); opacity: .88; box-shadow: 0 1px 1px -1px #fff; height: auto; margin-left: -110px; margin-top: -43px; padding: 10px; }
.ui-loader-default h1 { font-size: 0; width: 0; height: 0; overflow: hidden; }
.ui-loader-verbose h1 { font-size: 16px; margin: 0; text-align: center; }
.ui-loader .ui-icon { background-color: #000; display: block; margin: 0; width: 44px; height: 44px; padding: 1px; -webkit-border-radius: 36px; -moz-border-radius: 36px; border-radius: 36px; }
-.ui-loader-verbose .ui-icon { margin: 0 auto 10px; opacity: .75; }
-.ui-loader-textonly { padding: 15px; margin-left: -115px; }
+.ui-loader-verbose .ui-icon { margin: 0 auto 10px; filter: Alpha(Opacity=75); opacity: .75; }
+.ui-loader-textonly { padding: 15px; margin-left: -115px; }
.ui-loader-textonly .ui-icon { display: none; }
.ui-loader-fakefix { position: absolute; }
/*fouc*/
.ui-mobile-rendering > * { visibility: hidden; }
/*headers, content panels*/
-.ui-bar, .ui-body { position: relative; padding: .4em 15px; overflow: hidden; display: block; clear:both; }
+.ui-bar, .ui-body { position: relative; padding: .4em 15px; overflow: hidden; display: block; clear:both; }
.ui-bar { font-size: 16px; margin: 0; }
.ui-bar h1, .ui-bar h2, .ui-bar h3, .ui-bar h4, .ui-bar h5, .ui-bar h6 { margin: 0; padding: 0; font-size: 16px; display: inline-block; }
-.ui-header, .ui-footer { position: relative; border-left-width: 0; border-right-width: 0; }
+.ui-header, .ui-footer { position: relative; border-left-width: 0; border-right-width: 0; zoom: 1; }
.ui-header .ui-btn-left,
.ui-header .ui-btn-right,
.ui-footer .ui-btn-left,
.ui-footer .ui-btn-right { right: 5px; }
.ui-footer .ui-btn-icon-notext,
.ui-header .ui-btn-icon-notext { top: 6px; }
-.ui-header .ui-title, .ui-footer .ui-title { min-height: 1.1em; text-align: center; font-size: 16px; display: block; margin: .6em 30% .8em; padding: 0; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; outline: 0 !important; }
-.ui-footer .ui-title { margin: .6em 15px .8em; }
+.ui-header .ui-title, .ui-footer .ui-title { min-height: 1.1em; text-align: center; font-size: 16px; display: block; margin: .6em 30% .8em; padding: 0; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; outline: 0 !important; }
+.ui-footer .ui-title { margin: .6em 15px .8em; }
/*content area*/
.ui-content { border-width: 0; overflow: visible; overflow-x: hidden; padding: 15px; }
/* icons sizing */
/* non-js content hiding */
.ui-nojs { position: absolute; left: -9999px; }
/* accessible content hiding */
-.ui-hide-label label,
+.ui-hide-label label.ui-input-text, .ui-hide-label label.ui-select, .ui-hide-label label.ui-slider, .ui-hide-label label.ui-submit, .ui-hide-label .ui-controlgroup-label,
.ui-hidden-accessible { position: absolute !important; left: -9999px; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); }
/* Transitions originally inspired by those from jQtouch, nice work, folks */
.ui-mobile-viewport-transitioning,
width: 100%;
height: 100%;
overflow: hidden;
+ -webkit-box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+}
+.ui-page-pre-in {
+ opacity: 0;
}
.in {
-webkit-animation-timing-function: ease-out;
-webkit-animation-timing-function: ease-in;
-webkit-animation-duration: 225ms;
-moz-animation-timing-function: ease-in;
- -moz-animation-duration: 225;
+ -moz-animation-duration: 225ms;
}
@-webkit-keyframes fadein {
from { opacity: 0; }
}
/* content configurations. */
.ui-grid-a, .ui-grid-b, .ui-grid-c, .ui-grid-d { overflow: hidden; }
-.ui-block-a, .ui-block-b, .ui-block-c, .ui-block-d, .ui-block-e { margin: 0; padding: 0; border: 0; float: left; min-height:1px;}
+.ui-block-a, .ui-block-b, .ui-block-c, .ui-block-d, .ui-block-e { margin: 0; padding: 0; border: 0; float: left; min-height: 1px; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; -ms-box-sizing: border-box; box-sizing: border-box; }
/* grid solo: 100 - single item fallback */
-.ui-grid-solo .ui-block-a { width: 100%; float: none; }
+.ui-grid-solo .ui-block-a { display: block; float: none; }
+/* Lower percentages for older browsers (i.e. IE7) to prevent wrapping. -.5px to fix BB5 wrap issue. */
/* grid a: 50/50 */
-.ui-grid-a .ui-block-a, .ui-grid-a .ui-block-b { width: 50%; }
+.ui-grid-a .ui-block-a, .ui-grid-a .ui-block-b { width: 49.95%; }
+.ui-grid-a > :nth-child(n) { width: 50%; margin-right: -.5px; }
.ui-grid-a .ui-block-a { clear: left; }
/* grid b: 33/33/33 */
-.ui-grid-b .ui-block-a, .ui-grid-b .ui-block-b, .ui-grid-b .ui-block-c { width: 33.333%; }
+.ui-grid-b .ui-block-a, .ui-grid-b .ui-block-b, .ui-grid-b .ui-block-c { width: 33.25%; }
+.ui-grid-b > :nth-child(n) { width: 33.333%; margin-right: -.5px; }
.ui-grid-b .ui-block-a { clear: left; }
/* grid c: 25/25/25/25 */
-.ui-grid-c .ui-block-a, .ui-grid-c .ui-block-b, .ui-grid-c .ui-block-c, .ui-grid-c .ui-block-d { width: 25%; }
+.ui-grid-c .ui-block-a, .ui-grid-c .ui-block-b, .ui-grid-c .ui-block-c, .ui-grid-c .ui-block-d { width: 24.925%; }
+.ui-grid-c > :nth-child(n) { width: 25%; margin-right: -.5px; }
.ui-grid-c .ui-block-a { clear: left; }
/* grid d: 20/20/20/20/20 */
-.ui-grid-d .ui-block-a, .ui-grid-d .ui-block-b, .ui-grid-d .ui-block-c, .ui-grid-d .ui-block-d, .ui-grid-d .ui-block-e { width: 20%; }
+.ui-grid-d .ui-block-a, .ui-grid-d .ui-block-b, .ui-grid-d .ui-block-c, .ui-grid-d .ui-block-d, .ui-grid-d .ui-block-e { width: 19.925%; }
+.ui-grid-d > :nth-child(n) { width: 20%; }
.ui-grid-d .ui-block-a { clear: left; }
/* fixed page header & footer configuration */
.ui-header-fixed,
}
.ui-header-fullscreen,
.ui-footer-fullscreen {
+ filter: Alpha(Opacity=90);
opacity: .9;
}
.ui-page-header-fixed {
- padding-top: 2.5em;
+ padding-top: 2.6875em;
}
.ui-page-footer-fixed {
- padding-bottom: 3em;
+ padding-bottom: 2.6875em;
}
.ui-page-header-fullscreen .ui-content,
.ui-page-footer-fullscreen .ui-content {
}
.ui-page-header-fullscreen .ui-fixed-hidden,
.ui-page-footer-fullscreen .ui-fixed-hidden {
- left: -99999em;
+ left: -9999px;
}
.ui-header-fixed .ui-btn,
.ui-footer-fixed .ui-btn {
z-index: 10;
}
-.ui-navbar { overflow: hidden; }
-.ui-navbar ul, .ui-navbar-expanded ul { list-style:none; padding: 0; margin: 0; position: relative; display: block; border: 0;}
-.ui-navbar-collapsed ul { float: left; width: 75%; margin-right: -2px; }
-.ui-navbar-collapsed .ui-navbar-toggle { float: left; width: 25%; }
-.ui-navbar li.ui-navbar-truncate { position: absolute; left: -9999px; top: -9999px; }
-.ui-navbar li .ui-btn, .ui-navbar .ui-navbar-toggle .ui-btn { display: block; font-size: 12px; text-align: center; margin: 0; border-right-width: 0; max-width: 100%; }
-.ui-navbar li .ui-btn { margin-right: -1px; }
-.ui-navbar li .ui-btn:last-child { margin-right: 0; }
-.ui-header .ui-navbar li .ui-btn, .ui-header .ui-navbar .ui-navbar-toggle .ui-btn,
-.ui-footer .ui-navbar li .ui-btn, .ui-footer .ui-navbar .ui-navbar-toggle .ui-btn { border-top-width: 0; border-bottom-width: 0; }
-.ui-navbar .ui-btn-inner { padding-left: 2px; padding-right: 2px; }
-.ui-navbar-noicons li .ui-btn .ui-btn-inner, .ui-navbar-noicons .ui-navbar-toggle .ui-btn-inner { padding-top: .8em; padding-bottom: .9em; }
-/*expanded page styles*/
-.ui-navbar-expanded .ui-btn { margin: 0; font-size: 14px; }
-.ui-navbar-expanded .ui-btn-inner { padding-left: 5px; padding-right: 5px; }
-.ui-navbar-expanded .ui-btn-icon-top .ui-btn-inner { padding: 45px 5px 15px; text-align: center; }
-.ui-navbar-expanded .ui-btn-icon-top .ui-icon { top: 15px; }
-.ui-navbar-expanded .ui-btn-icon-bottom .ui-btn-inner { padding: 15px 5px 45px; text-align: center; }
-.ui-navbar-expanded .ui-btn-icon-bottom .ui-icon { bottom: 15px; }
-.ui-navbar-expanded li .ui-btn .ui-btn-inner { min-height: 2.5em; }
-.ui-navbar-expanded .ui-navbar-noicons .ui-btn .ui-btn-inner { padding-top: 1.8em; padding-bottom: 1.9em; }
-.ui-btn { display: block; text-align: center; cursor:pointer; position: relative; margin: .5em 5px; padding: 0; }
-.ui-mini { margin: .25em 5px; }
-.ui-btn-inner { padding: .6em 20px; min-width: .75em; display: block; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; position: relative; zoom: 1; }
+.ui-navbar { max-width: 100%; }
+.ui-navbar.ui-mini { margin: 0; }
+.ui-navbar ul:before, .ui-navbar ul:after { content: " "; display: table; }
+.ui-navbar ul:after { clear: both; }
+.ui-navbar ul { list-style:none; margin: 0; padding: 0; position: relative; display: block; border: 0; max-width: 100%; overflow: visible; zoom: 1; }
+.ui-navbar li .ui-btn { display: block; text-align: center; margin: 0 -1px 0 0; border-right-width: 0; }
+.ui-navbar li .ui-btn-icon-right .ui-icon { right: 6px; }
+/* add border if not in header/footer (full width) */
+.ui-navbar li:last-child .ui-btn,
+.ui-navbar .ui-grid-duo .ui-block-b .ui-btn { margin-right: 0; border-right-width: 1px; }
+.ui-header .ui-navbar li:last-child .ui-btn,
+.ui-footer .ui-navbar li:last-child .ui-btn,
+.ui-header .ui-navbar .ui-grid-duo .ui-block-b .ui-btn,
+.ui-footer .ui-navbar .ui-grid-duo .ui-block-b .ui-btn { margin-right: -1px; border-right-width: 0; }
+.ui-navbar .ui-grid-duo li.ui-block-a:last-child .ui-btn { margin-right: -1px; border-right-width: 1px; }
+.ui-header .ui-navbar li .ui-btn,
+.ui-footer .ui-navbar li .ui-btn { border-top-width: 0; border-bottom-width: 0; }
+/* fixing gaps caused by subpixel problem */
+.ui-header .ui-navbar .ui-grid-b li.ui-block-c .ui-btn,
+.ui-footer .ui-navbar .ui-grid-b li.ui-block-c .ui-btn { margin-right: -5px; }
+.ui-header .ui-navbar .ui-grid-c li.ui-block-d .ui-btn,
+.ui-footer .ui-navbar .ui-grid-c li.ui-block-d .ui-btn,
+.ui-header .ui-navbar .ui-grid-d li.ui-block-e .ui-btn,
+.ui-footer .ui-navbar .ui-grid-d li.ui-block-e .ui-btn { margin-right: -4px; }
+.ui-header .ui-navbar .ui-grid-b li.ui-block-c .ui-btn-icon-right .ui-icon,
+.ui-footer .ui-navbar .ui-grid-b li.ui-block-c .ui-btn-icon-right .ui-icon,
+.ui-header .ui-navbar .ui-grid-c li.ui-block-d .ui-btn-icon-right .ui-icon,
+.ui-footer .ui-navbar .ui-grid-c li.ui-block-d .ui-btn-icon-right .ui-icon,
+.ui-header .ui-navbar .ui-grid-d li.ui-block-e .ui-btn-icon-right .ui-icon,
+.ui-footer .ui-navbar .ui-grid-d li.ui-block-e .ui-btn-icon-right .ui-icon { right: 8px; }
+.ui-navbar li .ui-btn .ui-btn-inner { padding-top: .7em; padding-bottom: .8em }
+.ui-navbar li .ui-btn-icon-top .ui-btn-inner { padding-top: 30px; }
+.ui-navbar li .ui-btn-icon-bottom .ui-btn-inner { padding-bottom: 30px; }
+.ui-btn { display: block; text-align: center; cursor:pointer; position: relative; margin: .5em 0; padding: 0; }
+.ui-mini { margin-top: .25em; margin-bottom: .25em; }
+.ui-btn-left, .ui-btn-right, .ui-input-clear, .ui-btn-inline,
+.ui-grid-a .ui-btn, .ui-grid-b .ui-btn, .ui-grid-c .ui-btn, .ui-grid-d .ui-btn, .ui-grid-e .ui-btn, .ui-grid-solo .ui-btn { margin-right: 5px; margin-left: 5px; }
+.ui-btn-inner { font-size: 16px; padding: .6em 20px; min-width: .75em; display: block; position: relative; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; zoom: 1; }
.ui-btn input, .ui-btn button { z-index: 2; }
-.ui-btn-left, .ui-btn-right, .ui-btn-inline { display: inline-block; }
+.ui-btn-left, .ui-btn-right, .ui-btn-inline { display: inline-block; vertical-align: middle; }
+.ui-mobile .ui-btn-left, .ui-mobile .ui-btn-right { margin: 0; } /* .ui-mobile to increase specificity level */
.ui-btn-block { display: block; }
-.ui-header .ui-btn,
-.ui-footer .ui-btn { display: inline-block; margin: 0; }
+.ui-header > .ui-btn,
+.ui-footer > .ui-btn { display: inline-block; margin: 0; }
+.ui-header .ui-btn-block,
+.ui-footer .ui-btn-block { display: block; }
.ui-header .ui-btn-inner,
.ui-footer .ui-btn-inner,
.ui-mini .ui-btn-inner { font-size: 12.5px; padding: .55em 11px .5em; }
-.ui-header .ui-fullsize .ui-btn-inner,
-.ui-footer .ui-fullsize .ui-btn-inner { font-size: 16px; padding: .6em 25px; }
+.ui-fullsize .ui-btn-inner,
+.ui-fullsize .ui-btn-inner { font-size: 16px; padding: .6em 20px; }
.ui-btn-icon-notext { width: 24px; height: 24px; }
.ui-btn-icon-notext .ui-btn-inner { padding: 0; height: 100%; }
-.ui-btn-icon-notext .ui-btn-inner .ui-icon { margin: 2px 1px 2px 3px; }
-.ui-btn-text { position: relative; z-index: 1; width: 100%; }
+.ui-btn-icon-notext .ui-btn-inner .ui-icon { margin: 2px 1px 2px 3px; float: left; }
+.ui-btn-text { position: relative; z-index: 1; width: 100%; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; }
.ui-btn-icon-notext .ui-btn-text { position: absolute; left: -9999px; }
.ui-btn-icon-left .ui-btn-inner { padding-left: 40px; }
.ui-btn-icon-right .ui-btn-inner { padding-right: 40px; }
.ui-btn-icon-bottom .ui-btn-inner { padding-bottom: 40px; }
.ui-header .ui-btn-icon-left .ui-btn-inner,
.ui-footer .ui-btn-icon-left .ui-btn-inner,
+.ui-mini.ui-btn-icon-left .ui-btn-inner,
.ui-mini .ui-btn-icon-left .ui-btn-inner { padding-left: 30px; }
.ui-header .ui-btn-icon-right .ui-btn-inner,
.ui-footer .ui-btn-icon-right .ui-btn-inner,
+.ui-mini.ui-btn-icon-right .ui-btn-inner,
.ui-mini .ui-btn-icon-right .ui-btn-inner { padding-right: 30px; }
.ui-header .ui-btn-icon-top .ui-btn-inner,
-.ui-footer .ui-btn-icon-top .ui-btn-inner,
-.ui-mini .ui-btn-icon-top .ui-btn-inner { padding: 30px 3px .5em 3px; }
+.ui-footer .ui-btn-icon-top .ui-btn-inner { padding: 30px 3px .5em 3px; }
+.ui-mini.ui-btn-icon-top .ui-btn-inner,
+.ui-mini .ui-btn-icon-top .ui-btn-inner { padding-top: 30px; }
.ui-header .ui-btn-icon-bottom .ui-btn-inner,
-.ui-footer .ui-btn-icon-bottom .ui-btn-inner,
-.ui-mini .ui-btn-icon-bottom .ui-btn-inner { padding: .55em 3px 30px 3px; }
+.ui-footer .ui-btn-icon-bottom .ui-btn-inner { padding: .55em 3px 30px 3px; }
+.ui-mini.ui-btn-icon-bottom .ui-btn-inner,
+.ui-mini .ui-btn-icon-bottom .ui-btn-inner { padding-bottom: 30px; }
/*btn icon positioning*/
.ui-btn-icon-notext .ui-icon { display: block; z-index: 0;}
-.ui-btn-icon-left .ui-btn-inner .ui-icon, .ui-btn-icon-right .ui-btn-inner .ui-icon { position: absolute; top: 50%; margin-top: -9px; }
-.ui-btn-icon-top .ui-btn-inner .ui-icon, .ui-btn-icon-bottom .ui-btn-inner .ui-icon { position: absolute; left: 50%; margin-left: -9px; }
+.ui-btn-icon-left > .ui-btn-inner > .ui-icon, .ui-btn-icon-right > .ui-btn-inner > .ui-icon { position: absolute; top: 50%; margin-top: -9px; }
+.ui-btn-icon-top .ui-btn-inner .ui-icon, .ui-btn-icon-bottom .ui-btn-inner .ui-icon { position: absolute; left: 50%; margin-left: -9px; }
.ui-btn-icon-left .ui-icon { left: 10px; }
.ui-btn-icon-right .ui-icon { right: 10px; }
.ui-btn-icon-top .ui-icon { top: 10px; }
.ui-mini.ui-btn-icon-bottom .ui-icon,
.ui-mini .ui-btn-icon-bottom .ui-icon { bottom: 5px; }
/*hiding native button,inputs */
-.ui-btn-hidden { position: absolute; top: 0; left: 0; width: 100%; height: 100%; -webkit-appearance: button; opacity: .1; cursor: pointer; background: #fff; background: rgba(255,255,255,0); filter: Alpha(Opacity=.0001); font-size: 1px; border: none; text-indent: -9999px; }
-.ui-collapsible { margin: .5em 0; }
-.ui-collapsible-heading { font-size: 16px; display: block; margin: 0 -8px; padding: 0; border-width: 0 0 1px 0; position: relative; }
-.ui-collapsible-heading a { text-align: left; margin: 0; }
+.ui-btn-hidden { position: absolute; top: 0; left: 0; width: 100%; height: 100%; -webkit-appearance: none; cursor: pointer; background: #fff; background: rgba(255,255,255,0); filter: Alpha(Opacity=0); opacity: .1; font-size: 1px; border: none; text-indent: -9999px; }
+/* Fixes IE/WP filter alpha opacity bugs */
+.ui-disabled .ui-btn-hidden { display: none; }
+.ui-disabled { z-index: 1; }
+.ui-field-contain .ui-btn.ui-submit { margin: 0; }
+label.ui-submit { font-size: 16px; line-height: 1.4; font-weight: normal; margin: 0 0 .3em; display: block; }
+@media all and (min-width: 450px){
+ .ui-field-contain label.ui-submit { vertical-align: top; display: inline-block; width: 20%; margin: 0 2% 0 0; }
+ .ui-field-contain .ui-btn.ui-submit { width: 78%; display: inline-block; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; -ms-box-sizing: border-box; box-sizing: border-box; }
+ .ui-hide-label .ui-btn.ui-submit { width: auto; display: block; }
+}
+.ui-collapsible-inset { margin: .5em 0; }
+.ui-collapsible-heading { font-size: 16px; display: block; margin: 0 -15px; padding: 0; position: relative; }
+.ui-collapsible-inset .ui-collapsible-heading { margin: 0; }
+.ui-collapsible-heading .ui-btn { text-align: left; margin: 0; border-left-width: 0; border-right-width: 0; }
+.ui-collapsible-inset .ui-collapsible-heading .ui-btn { border-right-width: 1px; border-left-width: 1px; }
+.ui-collapsible-collapsed + .ui-collapsible:not(.ui-collapsible-inset) .ui-collapsible-heading .ui-btn { border-top-width: 0; }
+.ui-collapsible-set .ui-collapsible:not(.ui-collapsible-inset) .ui-collapsible-heading .ui-btn { border-top-width: 1px; }
.ui-collapsible-heading .ui-btn-inner,
.ui-collapsible-heading .ui-btn-icon-left .ui-btn-inner { padding-left: 40px; }
.ui-collapsible-heading .ui-btn-icon-right .ui-btn-inner { padding-left: 12px; padding-right: 40px; }
.ui-collapsible-heading .ui-btn-icon-top .ui-btn-inner,
.ui-collapsible-heading .ui-btn-icon-bottom .ui-btn-inner { padding-right: 40px; text-align: center; }
-.ui-collapsible-heading a span.ui-btn { position: absolute; left: 6px; top: 50%; margin: -12px 0 0 0; width: 20px; height: 20px; padding: 1px 0px 1px 2px; text-indent: -9999px; }
-.ui-collapsible-heading a span.ui-btn .ui-btn-inner { padding: 10px 0; }
-.ui-collapsible-heading a span.ui-btn .ui-icon { left: 0; margin-top: -10px; }
+.ui-collapsible-heading .ui-btn span.ui-btn { position: absolute; left: 6px; top: 50%; margin: -12px 0 0 0; width: 20px; height: 20px; padding: 1px 0px 1px 2px; text-indent: -9999px; }
+.ui-collapsible-heading .ui-btn span.ui-btn .ui-btn-inner { padding: 10px 0; }
+.ui-collapsible-heading .ui-btn span.ui-btn .ui-icon { left: 0; margin-top: -10px; }
.ui-collapsible-heading-status { position: absolute; top: -9999px; left:0px; }
.ui-collapsible-content {
display: block;
- margin: 0 -8px;
- padding: 10px 16px;
- border-top: none; /* Overrides ui-btn-up-* */
- background-image: none; /* Overrides ui-btn-up-* */
- font-weight: normal; /* Overrides ui-btn-up-* */
-}
+ margin: 0 -15px;
+ padding: 10px 15px;
+ border-left-width: 0;
+ border-right-width: 0;
+ border-top: none; /* Overrides ui-body-* */
+ background-image: none; /* Overrides ui-body-* */
+}
+.ui-collapsible-inset .ui-collapsible-content { margin: 0; border-right-width: 1px; border-left-width: 1px; }
.ui-collapsible-content-collapsed { display: none; }
.ui-collapsible-set { margin: .5em 0; }
.ui-collapsible-set .ui-collapsible { margin: -1px 0 0; }
-.ui-controlgroup, fieldset.ui-controlgroup { padding: 0; margin: 0em 0 .5em; zoom: 1; }
-.ui-bar .ui-controlgroup { margin: 0 .3em; }
+.ui-collapsible-set .ui-collapsible:first-child { margin-top: 0; }
+.ui-controlgroup, fieldset.ui-controlgroup { padding: 0; margin: .5em 0; zoom: 1; }
+.ui-controlgroup.ui-mini, fieldset.ui-controlgroup.ui-mini { margin: .25em 0; }
+.ui-field-contain .ui-controlgroup, .ui-field-contain fieldset.ui-controlgroup { margin: 0; }
+.ui-bar .ui-controlgroup { margin: 0 5px; }
.ui-controlgroup-label { font-size: 16px; line-height: 1.4; font-weight: normal; margin: 0 0 .4em; }
-.ui-controlgroup-controls { display: block; width: 100%;}
.ui-controlgroup li { list-style: none; }
.ui-controlgroup-vertical .ui-btn,
-.ui-controlgroup-vertical .ui-checkbox, .ui-controlgroup-vertical .ui-radio { margin: 0; border-bottom-width: 0; }
-.ui-controlgroup-controls label.ui-select { position: absolute; left: -9999px; }
+.ui-controlgroup-vertical .ui-checkbox, .ui-controlgroup-vertical .ui-radio { margin: 0; border-bottom-width: 0; }
.ui-controlgroup-vertical .ui-controlgroup-last { border-bottom-width: 1px; }
-.ui-controlgroup-horizontal { padding: 0; }
-.ui-controlgroup-horizontal .ui-btn-inner { text-align:center; }
-.ui-controlgroup-horizontal .ui-btn, .ui-controlgroup-horizontal .ui-select { display: inline-block; margin: 0 -6px 0 0; }
+.ui-controlgroup-controls label.ui-select { position: absolute; left: -9999px; }
+.ui-controlgroup .ui-btn-icon-notext { width: auto; height: auto; top: auto; }
+.ui-controlgroup .ui-btn-icon-notext .ui-btn-inner { height: 20px; padding: .6em 20px .6em 20px }
+.ui-controlgroup-horizontal .ui-btn-icon-notext .ui-btn-inner { width: 18px; }
+.ui-controlgroup.ui-mini .ui-btn-icon-notext .ui-btn-inner,
+.ui-header .ui-controlgroup .ui-btn-icon-notext .ui-btn-inner,
+.ui-footer .ui-controlgroup .ui-btn-icon-notext .ui-btn-inner { height: 16px; padding: .55em 11px .5em 11px; }
+.ui-controlgroup .ui-btn-icon-notext .ui-btn-inner .ui-icon { position: absolute; top: 50%; right: 50%; margin: -9px -9px 0 0; }
+.ui-controlgroup-horizontal .ui-controlgroup-controls:before,
+.ui-controlgroup-horizontal .ui-controlgroup-controls:after { content: ""; display: table; }
+.ui-controlgroup-horizontal .ui-controlgroup-controls:after { clear: both; }
+.ui-controlgroup-horizontal .ui-controlgroup-controls { display: inline-block; vertical-align: middle; zoom: 1; }
+.ui-controlgroup-horizontal .ui-btn-inner { text-align: center; }
+.ui-controlgroup-horizontal.ui-mini .ui-btn-inner { height: 16px; line-height: 16px; }
+.ui-controlgroup-horizontal .ui-btn, .ui-controlgroup-horizontal .ui-select,
.ui-controlgroup-horizontal .ui-checkbox, .ui-controlgroup-horizontal .ui-radio { float: left; clear: none; margin: 0 -1px 0 0; }
-.ui-controlgroup-horizontal .ui-checkbox .ui-btn, .ui-controlgroup-horizontal .ui-radio .ui-btn,
+.ui-controlgroup-horizontal .ui-select .ui-btn,
+.ui-controlgroup-horizontal .ui-checkbox .ui-btn, .ui-controlgroup-horizontal .ui-radio .ui-btn { float: none; margin: 0; }
+.ui-controlgroup-horizontal .ui-controlgroup-last, .ui-controlgroup-horizontal .ui-select:last-child,
.ui-controlgroup-horizontal .ui-checkbox:last-child, .ui-controlgroup-horizontal .ui-radio:last-child { margin-right: 0; }
-.ui-controlgroup-horizontal .ui-controlgroup-last { margin-right: 0; }
-.ui-controlgroup .ui-checkbox label, .ui-controlgroup .ui-radio label { font-size: 16px; }
-/* conflicts with listview..
-.ui-controlgroup .ui-btn-icon-notext { width: 30px; height: 30px; text-indent: -9999px; }
-.ui-controlgroup .ui-btn-icon-notext .ui-btn-inner { padding: 5px 6px 5px 5px; }
-*/
+.ui-controlgroup .ui-checkbox label, .ui-controlgroup .ui-radio label { font-size: 16px; }
@media all and (min-width: 450px){
- .ui-field-contain .ui-controlgroup-label { vertical-align: top; display: inline-block; width: 20%; margin: 0 2% 0 0; }
- .ui-field-contain .ui-controlgroup-controls { width: 60%; display: inline-block; }
- .ui-field-contain .ui-controlgroup .ui-select { width: 100%; }
+ .ui-field-contain .ui-controlgroup-label { vertical-align: top; display: inline-block; width: 20%; margin: 0 2% 0 0; }
+ .ui-field-contain .ui-controlgroup-controls { width: 78%; display: inline-block; }
+ .ui-field-contain .ui-controlgroup .ui-select { width: 100%; display: block; }
.ui-field-contain .ui-controlgroup-horizontal .ui-select { width: auto; }
+ .ui-hide-label .ui-controlgroup-controls { width: 100%; }
}
.ui-dialog {
background: none !important; /* this is to ensure that dialog theming does not apply (by default at least) on the page div */
}
-.ui-dialog-contain { width: 92.5%; max-width: 500px; margin: 10% auto 15px auto; padding: 0; }
-.ui-dialog .ui-header {
- margin-top: 15%;
- border: none;
- overflow: hidden;
+.ui-dialog-contain {
+ width: 92.5%;
+ max-width: 500px;
+ margin: 10% auto 15px auto;
+ padding: 0;
+ position: relative;
+ top: -15px;
}
-.ui-dialog .ui-header,
-.ui-dialog .ui-content,
-.ui-dialog .ui-footer {
+.ui-dialog-contain > .ui-header,
+.ui-dialog-contain > .ui-content,
+.ui-dialog-contain > .ui-footer {
display: block;
position: relative;
width: auto;
+ margin: 0;
}
-.ui-dialog .ui-header,
-.ui-dialog .ui-footer {
+.ui-dialog-contain > .ui-header {
+ border: none;
+ overflow: hidden;
z-index: 10;
padding: 0;
}
-.ui-dialog .ui-footer {
+.ui-dialog-contain > .ui-content {
+ padding: 15px;
+}
+.ui-dialog-contain > .ui-footer {
+ z-index: 10;
padding: 0 15px;
}
-.ui-dialog .ui-content {
- padding: 15px;
+.ui-popup-open .ui-header-fixed,
+.ui-popup-open .ui-footer-fixed {
+ position: absolute !important; /* See line #553 of popup.js */
+}
+.ui-popup-screen {
+ background-image: url(data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==); /* Necessary to set some form of background to ensure element is clickable in IE6/7. While legacy IE won't understand the data-URI'd image, it ensures no additional requests occur in all other browsers with little overhead. */
+ top: 0px;
+ left: 0px;
+ right: 0px;
+ bottom: 1px;
+ position: absolute;
+ filter: Alpha(Opacity=0);
+ opacity: 0;
+ z-index: 1099;
+}
+.ui-popup-screen.in {
+ opacity: 0.5;
+ filter: Alpha(Opacity=50);
+}
+.ui-popup-screen.out {
+ opacity: 0;
+ filter: Alpha(Opacity=0);
+}
+.ui-popup-container {
+ z-index: 1100;
+ display: inline-block;
+ position: absolute;
+ padding: 0;
+ outline: 0;
+}
+.ui-popup {
+ position: relative;
+}
+.ui-popup.ui-content,
+.ui-popup .ui-content {
+ overflow: visible;
}
-.ui-dialog {
- margin-top: -15px;
+.ui-popup > p,
+.ui-popup > h1,
+.ui-popup > h2,
+.ui-popup > h3,
+.ui-popup > h4,
+.ui-popup > h5,
+.ui-popup > h6 {
+ margin: .5em 7px;
}
-.ui-checkbox, .ui-radio { position: relative; clear: both; margin: .2em 0 .5em; z-index: 1; }
-.ui-checkbox .ui-btn, .ui-radio .ui-btn { margin: 0; text-align: left; z-index: 2; }
+.ui-popup > span {
+ display: block;
+ margin: .5em 7px;
+}
+.ui-popup .ui-title {
+ font-size: 16px;
+ font-weight: bold;
+ margin-top: .5em;
+ margin-bottom: .5em;
+}
+.ui-popup-container .ui-content > p,
+.ui-popup-container .ui-content > h1,
+.ui-popup-container .ui-content > h2,
+.ui-popup-container .ui-content > h3,
+.ui-popup-container .ui-content > h4,
+.ui-popup-container .ui-content > h5,
+.ui-popup-container .ui-content > h6 {
+ margin: .5em 0;
+}
+.ui-popup-container .ui-content > span {
+ margin: 0;
+}
+.ui-popup-container .ui-content > p:first-child,
+.ui-popup-container .ui-content > h1:first-child,
+.ui-popup-container .ui-content > h2:first-child,
+.ui-popup-container .ui-content > h3:first-child,
+.ui-popup-container .ui-content > h4:first-child,
+.ui-popup-container .ui-content > h5:first-child,
+.ui-popup-container .ui-content > h6:first-child {
+ margin-top: 0;
+}
+.ui-popup-container .ui-content > p:last-child,
+.ui-popup-container .ui-content > h1:last-child,
+.ui-popup-container .ui-content > h2:last-child,
+.ui-popup-container .ui-content > h3:last-child,
+.ui-popup-container .ui-content > h4:last-child,
+.ui-popup-container .ui-content > h5:last-child,
+.ui-popup-container .ui-content > h6:last-child {
+ margin-bottom: 0;
+}
+.ui-popup > img {
+ width: auto;
+ height: auto;
+ max-width: 100%;
+ max-height: 100%;
+ vertical-align: middle;
+}
+.ui-popup iframe {
+ vertical-align: middle;
+}
+@media all and (min-width: 450px){
+ .ui-popup .ui-field-contain label.ui-submit,
+ .ui-popup .ui-field-contain .ui-controlgroup-label,
+ .ui-popup .ui-field-contain label.ui-select,
+ .ui-popup .ui-field-contain label.ui-input-text {
+ font-size: 16px; line-height: 1.4; display: block; font-weight: normal; margin: 0 0 .3em;
+ }
+ .ui-popup .ui-field-contain .ui-btn.ui-submit,
+ .ui-popup .ui-field-contain .ui-controlgroup-controls,
+ .ui-popup .ui-field-contain .ui-select,
+ .ui-popup .ui-field-contain input.ui-input-text,
+ .ui-popup .ui-field-contain textarea.ui-input-text,
+ .ui-popup .ui-field-contain .ui-input-search {
+ width: 100%; display: block;
+ }
+}
+.ui-popup > .ui-btn-left,
+.ui-popup > .ui-btn-right {
+ position: absolute;
+ top: -9px;
+ margin: 0;
+ z-index: 1101;
+}
+.ui-popup > .ui-btn-left { left: -9px; }
+.ui-popup > .ui-btn-right { right: -9px; }
+.ui-popup.ui-corner-all > .ui-header,
+.ui-popup.ui-corner-all ~ .ui-content,
+.ui-popup.ui-corner-all > .ui-content:first-child {
+ -webkit-border-top-left-radius: inherit;
+ border-top-left-radius: inherit;
+ -webkit-border-top-right-radius: inherit;
+ border-top-right-radius: inherit;
+}
+.ui-popup.ui-corner-all > .ui-content,
+.ui-popup.ui-corner-all > .ui-footer,
+.ui-popup.ui-corner-all > .ui-header:nth-child(n):last-child {
+ -webkit-border-bottom-left-radius: inherit;
+ border-bottom-left-radius: inherit;
+ -webkit-border-bottom-right-radius: inherit;
+ border-bottom-right-radius: inherit;
+}
+.ui-popup.ui-corner-all > .ui-content:nth-child(2),
+.ui-popup.ui-corner-all > .ui-header:nth-child(2) {
+ -webkit-border-top-left-radius: 0;
+ border-top-left-radius: 0;
+ -webkit-border-top-right-radius: 0;
+ border-top-right-radius: 0;
+}
+.ui-popup.ui-corner-all > .ui-content:nth-last-child(1n+2),
+.ui-popup.ui-corner-all > .ui-footer:nth-last-child(1n+2) {
+ -webkit-border-bottom-left-radius: 0;
+ border-bottom-left-radius: 0;
+ -webkit-border-bottom-right-radius: 0;
+ border-bottom-right-radius: 0;
+}
+.ui-popup.ui-corner-all > .ui-header:only-child,
+.ui-popup.ui-corner-all > .ui-footer:only-child {
+ -webkit-border-radius: inherit;
+ border-radius: inherit;
+}
+.ui-checkbox, .ui-radio { position: relative; clear: both; margin: 0; z-index: 1; }
+.ui-checkbox .ui-btn, .ui-radio .ui-btn { margin-top: .5em; margin-bottom: .5em; text-align: left; z-index: 2; }
+.ui-checkbox .ui-btn.ui-mini, .ui-radio .ui-btn.ui-mini { margin: .25em 0; }
+.ui-controlgroup .ui-checkbox .ui-btn, .ui-controlgroup .ui-radio .ui-btn { margin: 0; }
.ui-checkbox .ui-btn-inner, .ui-radio .ui-btn-inner { white-space: normal; }
.ui-checkbox .ui-btn-icon-left .ui-btn-inner,.ui-radio .ui-btn-icon-left .ui-btn-inner { padding-left: 45px; }
.ui-checkbox .ui-mini.ui-btn-icon-left .ui-btn-inner,.ui-radio .ui-mini.ui-btn-icon-left .ui-btn-inner { padding-left: 36px; }
.ui-checkbox .ui-btn-icon-right .ui-icon, .ui-radio .ui-btn-icon-right .ui-icon { right: 15px; }
.ui-checkbox .ui-mini.ui-btn-icon-right .ui-icon, .ui-radio .ui-mini.ui-btn-icon-right .ui-icon { right: 9px; }
/* input, label positioning */
-.ui-checkbox input,.ui-radio input { position:absolute; left:20px; top:50%; width: 10px; height: 10px; margin:-5px 0 0 0; outline: 0 !important; z-index: 1; }
+.ui-checkbox input,.ui-radio input { position:absolute; left:20px; top:50%; width: 10px; height: 10px; margin:-5px 0 0 0; outline: 0 !important; z-index: 1; }
.ui-field-contain, fieldset.ui-field-contain { padding: .8em 0; margin: 0; border-width: 0 0 1px 0; overflow: visible; }
-.ui-field-contain:first-child { border-top-width: 0; }
-.ui-header .ui-field-contain-left,
-.ui-header .ui-field-contain-right {
- position: absolute;
- top: 0;
- width: 25%;
-}
-.ui-header .ui-field-contain-left {
- left: 1em;
-}
-.ui-header .ui-field-contain-right {
- right: 1em;
-}
+.ui-field-contain:last-child { border-bottom-width: 0; }
+.ui-field-contain { max-width: 100%; } /* This prevents horizontal scrollbar in IE7 */
@media all and (min-width: 450px){
.ui-field-contain, .ui-mobile fieldset.ui-field-contain { border-width: 0; padding: 0; margin: 1em 0; }
}
.ui-select { display: block; position: relative; }
.ui-select select { position: absolute; left: -9999px; top: -9999px; }
-.ui-select .ui-btn { overflow: hidden; opacity: 1; margin: 0; }
-/* Fixes #2588 — When Windows Phone 7.5 (Mango) tries to calculate a numeric opacity for a select—including “inherit”—without explicitly specifying an opacity on the parent to give it context, a bug appears where clicking elsewhere on the page after opening the select will open the select again. */
-.ui-select .ui-btn select { cursor: pointer; -webkit-appearance: button; left: 0; top:0; width: 100%; min-height: 1.5em; min-height: 100%; height: 3em; max-height: 100%; opacity: 0; -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; filter: alpha(opacity=0); z-index: 2; }
+.ui-select .ui-btn { overflow: hidden; opacity: 1; }
+.ui-field-contain .ui-select .ui-btn { margin: 0; }
+/* Fixes #2588: When Windows Phone 7.5 (Mango) tries to calculate a numeric opacity for a select (including "inherit") without explicitly specifying an opacity on the parent to give it context, a bug appears where clicking elsewhere on the page after opening the select will open the select again. */
+.ui-select .ui-btn select { cursor: pointer; -webkit-appearance: none; left: 0; top:0; width: 100%; min-height: 1.5em; min-height: 100%; height: 3em; max-height: 100%; filter: Alpha(Opacity=0); opacity: 0; z-index: 2; }
.ui-select .ui-disabled { opacity: .3; }
-@-moz-document url-prefix() {.ui-select .ui-btn select { opacity: 0.0001; }}
-.ui-select .ui-btn select.ui-select-nativeonly { opacity: 1; text-indent: 0; }
-.ui-select .ui-btn-icon-right .ui-btn-inner { padding-right: 45px; }
-.ui-select .ui-btn-icon-right .ui-icon { right: 15px; }
-.ui-select .ui-mini.ui-btn-icon-right .ui-icon { right: 7px; }
+/* Display none because of issues with IE/WP's filter alpha opacity */
+.ui-select .ui-disabled select { display: none; }
+@-moz-document url-prefix() { .ui-select .ui-btn select { opacity: 0.0001; }}
+.ui-select .ui-btn.ui-select-nativeonly { border-radius: 0; border: 0; }
+.ui-select .ui-btn.ui-select-nativeonly select { opacity: 1; text-indent: 0; display: block; }
+.ui-select .ui-disabled.ui-select-nativeonly .ui-btn-inner { opacity: 0; }
+.ui-select .ui-btn-icon-right .ui-btn-inner, .ui-select .ui-li-has-count .ui-btn-inner { padding-right: 45px; }
+.ui-select .ui-mini.ui-btn-icon-right .ui-btn-inner { padding-right: 32px; }
+.ui-select .ui-btn-icon-right.ui-li-has-count .ui-btn-inner { padding-right: 80px; }
+.ui-select .ui-mini.ui-btn-icon-right.ui-li-has-count .ui-btn-inner { padding-right: 67px; }
+.ui-select .ui-btn-icon-right .ui-icon { right: 15px; }
+.ui-select .ui-mini.ui-btn-icon-right .ui-icon { right: 7px; }
+.ui-select .ui-btn-icon-right.ui-li-has-count .ui-li-count { right: 45px; }
+.ui-select .ui-mini.ui-btn-icon-right.ui-li-has-count .ui-li-count { right: 32px; }
/* labels */
-label.ui-select { font-size: 16px; line-height: 1.4; font-weight: normal; margin: 0 0 .3em; display: block; }
+label.ui-select { font-size: 16px; line-height: 1.4; font-weight: normal; margin: 0 0 .3em; display: block; }
/*listbox*/
.ui-select .ui-btn-text, .ui-selectmenu .ui-btn-text { display: block; min-height: 1em; overflow: hidden !important;
/* This !important is required for iPad Safari specifically. See https://github.com/jquery/jquery-mobile/issues/2647 */ }
.ui-select .ui-btn-text { text-overflow: ellipsis; }
-.ui-selectmenu { position: absolute; padding: 0; z-index: 1100 !important; width: 80%; max-width: 350px; padding: 6px; }
+.ui-selectmenu { padding: 6px; min-width: 160px; }
.ui-selectmenu .ui-listview { margin: 0; }
.ui-selectmenu .ui-btn.ui-li-divider { cursor: default; }
-.ui-selectmenu-hidden { top: -9999px; left: -9999px; }
-.ui-selectmenu-screen { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 99; }
+.ui-selectmenu-hidden { top: -99999px; left: -9999px; }
.ui-screen-hidden, .ui-selectmenu-list .ui-li .ui-icon { display: none; }
.ui-selectmenu-list .ui-li .ui-icon { display: block; }
.ui-li.ui-selectmenu-placeholder { display: none; }
+.ui-selectmenu .ui-header { margin: 0; padding: 0; }
.ui-selectmenu .ui-header .ui-title { margin: 0.6em 46px 0.8em; }
-@media all and (min-width: 450px){
- .ui-field-contain label.ui-select { vertical-align: top; display: inline-block; width: 20%; margin: 0 2% 0 0; }
- .ui-field-contain .ui-select { width: 60%; display: inline-block; }
-}
+@media all and (min-width: 450px){
+ .ui-field-contain label.ui-select { vertical-align: top; display: inline-block; width: 20%; margin: 0 2% 0 0; }
+ .ui-field-contain .ui-select { width: 78%; display: inline-block; }
+ .ui-hide-label .ui-select { width: 100%; }
+}
/* when no placeholder is defined in a multiple select, the header height doesn't even extend past the close button. this shim's content in there */
.ui-selectmenu .ui-header h1:after { content: '.'; visibility: hidden; }
label.ui-input-text { font-size: 16px; line-height: 1.4; display: block; font-weight: normal; margin: 0 0 .3em; }
-input.ui-input-text, textarea.ui-input-text { background-image: none; padding: .4em; line-height: 1.4; font-size: 16px; display: block; width: 97%; outline: 0; }
-.ui-header input.ui-input-text,
-.ui-footer input.ui-input-text { margin-left: 1.25%; padding: .4em 1%; width: 95.5% } /* Note that padding left/right on text inputs is factored into how the element is displayed in Firefox, but does not actually pad the text inside it. */
- input.ui-input-text { -webkit-appearance: none; }
+input.ui-input-text, textarea.ui-input-text { background-image: none; padding: .4em; margin: .5em 0; line-height: 1.4; font-size: 16px; display: block; width: 100%; outline: 0; }
+input.ui-input-text.ui-mini, textarea.ui-input-text.ui-mini { margin: .25em 0; }
+.ui-field-contain input.ui-input-text, .ui-field-contain textarea.ui-input-text { margin: 0; }
+input.ui-input-text, textarea.ui-input-text, .ui-input-search { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; -ms-box-sizing: border-box; box-sizing: border-box; }
+input.ui-input-text { -webkit-appearance: none; }
textarea.ui-input-text { height: 50px; -webkit-transition: height 200ms linear; -moz-transition: height 200ms linear; -o-transition: height 200ms linear; transition: height 200ms linear; }
-.ui-input-search { padding: 0 30px; background-image: none; position: relative; }
+.ui-input-search { padding: 0 30px; margin: .5em 0; background-image: none; position: relative; }
+.ui-input-search.ui-mini { margin: .25em 0; }
+.ui-field-contain .ui-input-search { margin: 0; }
.ui-icon-searchfield:after { position: absolute; left: 7px; top: 50%; margin-top: -9px; content: ""; width: 18px; height: 18px; opacity: .5; }
.ui-input-search input.ui-input-text { border: none; width: 98%; padding: .4em 0; margin: 0; display: block; background: transparent none; outline: 0 !important; }
.ui-input-search .ui-input-clear { position: absolute; right: 0; top: 50%; margin-top: -13px; }
.ui-input-search .ui-input-clear-hidden { display: none; }
input.ui-mini, .ui-mini input, textarea.ui-mini { font-size: 14px; }
textarea.ui-mini { height: 45px; }
-/* orientation adjustments - incomplete!*/
@media all and (min-width: 450px){
- .ui-field-contain label.ui-input-text { vertical-align: top; display: inline-block; width: 20%; margin: 0 2% 0 0 }
+ .ui-field-contain label.ui-input-text { vertical-align: top; display: inline-block; width: 20%; margin: 0 2% 0 0 }
.ui-field-contain input.ui-input-text,
.ui-field-contain textarea.ui-input-text,
- .ui-field-contain .ui-input-search { width: 60%; display: inline-block; }
- .ui-field-contain .ui-input-search { width: 50%; }
+ .ui-field-contain .ui-input-search { width: 78%; display: inline-block; }
.ui-hide-label input.ui-input-text,
.ui-hide-label textarea.ui-input-text,
- .ui-hide-label .ui-input-search { padding: .4em; width: 97%; }
+ .ui-hide-label .ui-input-search { width: 100%; }
.ui-input-search input.ui-input-text { width: 98%; /*echos rule from above*/ }
}
-.ui-listview { margin: 0; counter-reset: listnumbering; }
+.ui-listview { margin: 0; }
+ol.ui-listview, ol.ui-listview .ui-li-divider { counter-reset: listnumbering; }
.ui-content .ui-listview { margin: -15px; }
-.ui-content .ui-listview-inset { margin: 1em 0; }
+.ui-collapsible-content > .ui-listview { margin: -10px -15px; }
+.ui-content .ui-listview-inset { margin: 1em 0; }
+.ui-collapsible-content .ui-listview-inset { margin: .5em 0; }
.ui-listview, .ui-li { list-style:none; padding:0; }
.ui-li, .ui-li.ui-field-contain { display: block; margin:0; position: relative; overflow: visible; text-align: left; border-width: 0; border-top-width: 1px; }
-.ui-li .ui-btn-text a.ui-link-inherit { text-overflow: ellipsis; overflow: hidden; white-space: nowrap; }
-.ui-li-divider, .ui-li-static { padding: .5em 15px; font-size: 14px; font-weight: bold; }
-.ui-li-divider { counter-reset: listnumbering; }
-ol.ui-listview .ui-link-inherit:before, ol.ui-listview .ui-li-static:before, .ui-li-dec { font-size: .8em; display: inline-block; padding-right: .3em; font-weight: normal;counter-increment: listnumbering; content: counter(listnumbering) ". "; }
+.ui-li.ui-btn { margin: 0; }
+.ui-li .ui-btn-text a.ui-link-inherit { text-overflow: ellipsis; overflow: hidden; white-space: nowrap; }
+.ui-li-static { background-image: none; }
+.ui-li-divider { padding: .5em 15px; font-size: 14px; font-weight: bold; }
+ol.ui-listview .ui-link-inherit:before, ol.ui-listview .ui-li-static:before, .ui-li-dec { font-size: .8em; display: inline-block; padding-right: .3em; font-weight: normal; counter-increment: listnumbering; content: counter(listnumbering) ". "; }
ol.ui-listview .ui-li-jsnumbering:before { content: "" !important; } /* to avoid chance of duplication */
.ui-listview-inset .ui-li { border-right-width: 1px; border-left-width: 1px; }
-.ui-li:last-child, .ui-li.ui-field-contain:last-child { border-bottom-width: 1px; }
+.ui-li-last, .ui-li.ui-field-contain.ui-li-last { border-bottom-width: 1px; }
+.ui-collapsible [class*="ui-body"] > .ui-listview:not(.ui-listview-inset) .ui-li-last { border-bottom-width: 0; }
+.ui-collapsible-content > .ui-listview:not(.ui-listview-inset) .ui-li:first-child { border-top-width: 0; }
+.ui-collapsible-content > .ui-listview:not(.ui-listview-inset),
+.ui-collapsible-content > .ui-listview:not(.ui-listview-inset) .ui-li-last { -webkit-border-bottom-left-radius: inherit; -webkit-border-bottom-right-radius: inherit; border-bottom-left-radius: inherit; border-bottom-right-radius: inherit; }
+.ui-collapsible-content > .ui-listview:not(.ui-listview-inset) .ui-li-last .ui-li-link-alt { -webkit-border-bottom-right-radius: inherit; border-bottom-right-radius: inherit; }
.ui-li>.ui-btn-inner { display: block; position: relative; padding: 0; }
-.ui-li .ui-btn-inner a.ui-link-inherit, .ui-li-static.ui-li { padding: .7em 15px .7em 15px; display: block; }
+.ui-li .ui-btn-inner a.ui-link-inherit, .ui-li-static.ui-li { padding: .7em 15px; display: block; }
.ui-li-has-thumb .ui-btn-inner a.ui-link-inherit, .ui-li-static.ui-li-has-thumb { min-height: 60px; padding-left: 100px; }
-.ui-li-has-icon .ui-btn-inner a.ui-link-inherit, .ui-li-static.ui-li-has-icon { min-height: 20px; padding-left: 40px; }
-.ui-li-has-count .ui-btn-inner a.ui-link-inherit, .ui-li-static.ui-li-has-count { padding-right: 45px; }
-.ui-li-has-arrow .ui-btn-inner a.ui-link-inherit, .ui-li-static.ui-li-has-arrow { padding-right: 30px; }
+.ui-li-has-icon .ui-btn-inner a.ui-link-inherit, .ui-li-static.ui-li-has-icon { min-height: 20px; padding-left: 40px; }
+.ui-li-has-count .ui-btn-inner a.ui-link-inherit, .ui-li-static.ui-li-has-count, .ui-li-divider.ui-li-has-count { padding-right: 45px; }
+.ui-li-has-arrow .ui-btn-inner a.ui-link-inherit, .ui-li-static.ui-li-has-arrow { padding-right: 40px; }
.ui-li-has-arrow.ui-li-has-count .ui-btn-inner a.ui-link-inherit, .ui-li-static.ui-li-has-arrow.ui-li-has-count { padding-right: 75px; }
-.ui-li-has-count .ui-btn-text { padding-right: 15px; }
-.ui-li-heading { font-size: 16px; font-weight: bold; display: block; margin: .6em 0; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; }
-.ui-li-desc { font-size: 12px; font-weight: normal; display: block; margin: -.5em 0 .6em; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; }
+.ui-li-heading { font-size: 16px; font-weight: bold; display: block; margin: .6em 0; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; }
+.ui-li-desc { font-size: 12px; font-weight: normal; display: block; margin: -.5em 0 .6em; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; }
.ui-li-thumb, .ui-listview .ui-li-icon { position: absolute; left: 1px; top: 0; max-height: 80px; max-width: 80px; }
-.ui-listview .ui-li-icon { max-height: 40px; max-width: 40px; left: 10px; top: .9em; }
+.ui-listview .ui-li-icon { max-height: 16px; max-width: 16px; left: 10px; top: .9em; }
.ui-li-thumb, .ui-listview .ui-li-icon, .ui-li-content { float: left; margin-right: 10px; }
.ui-li-aside { float: right; width: 50%; text-align: right; margin: .3em 0; }
@media all and (min-width: 480px){
.ui-li-aside { width: 45%; }
}
.ui-li-divider { cursor: default; }
-.ui-li-has-alt .ui-btn-inner a.ui-link-inherit, .ui-li-static.ui-li-has-alt { padding-right: 95px; }
-.ui-li-has-count .ui-li-count { position: absolute; font-size: 11px; font-weight: bold; padding: .2em .5em; top: 50%; margin-top: -.9em; right: 48px; }
-.ui-li-divider .ui-li-count, .ui-li-static .ui-li-count { right: 10px; }
-.ui-li-has-alt .ui-li-count { right: 55px; }
+.ui-li-has-alt .ui-btn-inner a.ui-link-inherit, .ui-li-static.ui-li-has-alt { padding-right: 53px; }
+.ui-li-has-alt.ui-li-has-count .ui-btn-inner a.ui-link-inherit, .ui-li-static.ui-li-has-alt.ui-li-has-count { padding-right: 88px; }
+.ui-li-has-count .ui-li-count { position: absolute; font-size: 11px; font-weight: bold; padding: .2em .5em; top: 50%; margin-top: -.9em; right: 10px; }
+.ui-li-has-count.ui-li-divider .ui-li-count, .ui-li-has-count .ui-link-inherit .ui-li-count { margin-top: -.95em; }
+.ui-li-has-arrow.ui-li-has-count .ui-li-count { right: 40px; }
+.ui-li-has-alt.ui-li-has-count .ui-li-count { right: 53px; }
.ui-li-link-alt { position: absolute; width: 40px; height: 100%; border-width: 0; border-left-width: 1px; top: 0; right: 0; margin: 0; padding: 0; z-index: 2; }
-.ui-li-link-alt .ui-btn { overflow: hidden; position: absolute; right: 8px; top: 50%; margin: -11px 0 0 0; border-bottom-width: 1px; z-index: -1;}
+.ui-li-link-alt .ui-btn { overflow: hidden; position: absolute; right: 8px; top: 50%; margin: -13px 0 0 0; border-bottom-width: 1px; z-index: -1;}
.ui-li-link-alt .ui-btn-inner { padding: 0; height: 100%; position: absolute; width: 100%; top: 0; left: 0;}
-.ui-li-link-alt .ui-btn .ui-icon { right: 50%; margin-right: -9px; }
+.ui-li-link-alt .ui-btn .ui-icon { right: 50%; margin-right: -9px; }
+.ui-li-link-alt .ui-btn-icon-notext .ui-btn-inner .ui-icon { position: absolute; top: 50%; margin-top: -9px; }
.ui-listview * .ui-btn-inner > .ui-btn > .ui-btn-inner { border-top: 0px; }
-.ui-listview-filter { border-width: 0; overflow: hidden; margin: -15px -15px 15px -15px }
+.ui-listview-filter { border-width: 0; overflow: hidden; margin: -15px -15px 15px -15px; }
+.ui-collapsible-content .ui-listview-filter { margin: -10px -15px 10px -15px; border-bottom: inherit; }
+.ui-listview-filter-inset { margin: -15px -5px; background: transparent; }
+.ui-collapsible-content .ui-listview-filter-inset { margin: -5px; border-bottom-width: 0; }
.ui-listview-filter .ui-input-search { margin: 5px; width: auto; display: block; }
-.ui-listview-filter-inset { margin: -15px -5px -15px -5px; background: transparent; }
-.ui-li.ui-screen-hidden{display:none;}
+.ui-li.ui-screen-hidden{ display:none; }
/* Odd iPad positioning issue. */
@media only screen and (min-device-width: 768px) and (max-device-width: 1024px) {
.ui-li .ui-btn-text { overflow: visible; }
}
-label.ui-slider { font-size: 16px; line-height: 1.4; font-weight: normal; margin: 0 0 .3em; display: block; }
+label.ui-slider { font-size: 16px; line-height: 1.4; font-weight: normal; margin: 0 0 .3em; display: block; }
input.ui-slider-input,
-.ui-field-contain input.ui-slider-input { display: inline-block; width: 50px; }
+.ui-field-contain input.ui-slider-input { display: inline-block; width: 50px; background-image: none; padding: .4em; margin: .5em 0; line-height: 1.4; font-size: 16px; outline: 0; }
+input.ui-slider-input.ui-mini,
+.ui-field-contain input.ui-slider-input.ui-mini { width: 45px; margin: .25em 0; font-size: 14px; }
+.ui-field-contain input.ui-slider-input { margin: 0; }
+input.ui-slider-input, .ui-field-contain input.ui-slider-input { -webkit-box-sizing: content-box; -moz-box-sizing: content-box; -ms-box-sizing: content-box; box-sizing: content-box; }
+/* Fixes input fields being to small on Safari/Mac because of the up and down arrows. */
+.ui-slider-input::-webkit-outer-spin-button { margin: 0; }
select.ui-slider-switch { display: none; }
div.ui-slider { position: relative; display: inline-block; overflow: visible; height: 15px; padding: 0; margin: 0 2% 0 20px; top: 4px; width: 65%; }
-div.ui-slider-mini { height: 12px; margin-left: 10px; }
+div.ui-slider-mini { height: 12px; margin-left: 10px; top: 2px; }
div.ui-slider-bg { border: none; height: 100%; padding-right: 8px; }
-.ui-controlgroup a.ui-slider-handle, a.ui-slider-handle { position: absolute; z-index: 1; top: 50%; width: 28px; height: 28px; margin-top: -15px; margin-left: -15px; outline: 0; }
-a.ui-slider-handle .ui-btn-inner { padding: 0; height: 100%; }
+.ui-controlgroup a.ui-slider-handle, a.ui-btn.ui-slider-handle { position: absolute; z-index: 1; top: 50%; width: 28px; height: 28px; margin: -15px 0 0 -15px; outline: 0; }
+a.ui-btn.ui-slider-handle .ui-btn-inner { padding: 0; height: 100%; }
div.ui-slider-mini a.ui-slider-handle { height: 14px; width: 14px; margin: -8px 0 0 -7px; }
-div.ui-slider-mini a.ui-slider-handle .ui-btn-inner { height: 30px; width: 30px; padding: 0; margin: -9px 0 0 -9px; }
+div.ui-slider-mini a.ui-slider-handle .ui-btn-inner { height: 30px; width: 30px; padding: 0; margin: -9px 0 0 -9px; border-top: none; }
@media all and (min-width: 450px){
.ui-field-contain label.ui-slider { vertical-align: top; display: inline-block; width: 20%; margin: 0 2% 0 0; }
.ui-field-contain div.ui-slider { width: 43%; }
}
div.ui-slider-switch { height: 32px; margin-left: 0; width: 5.8em; }
a.ui-slider-handle-snapping { -webkit-transition: left 70ms linear; -moz-transition: left 70ms linear; }
-div.ui-slider-switch .ui-slider-handle { margin-top: 1px; }
+div.ui-slider-switch .ui-slider-handle { margin: 1px 0 0 -15px; }
.ui-slider-inneroffset { margin: 0 16px; position: relative; z-index: 1; }
div.ui-slider-switch.ui-slider-mini { width: 5em; height: 29px; }
div.ui-slider-switch.ui-slider-mini .ui-slider-inneroffset { margin: 0 15px 0 14px; }
--- /dev/null
+/*!
+ * jQuery JavaScript Library v1.8.2
+ * http://jquery.com/
+ *
+ * Includes Sizzle.js
+ * http://sizzlejs.com/
+ *
+ * Copyright 2012 jQuery Foundation and other contributors
+ * Released under the MIT license
+ * http://jquery.org/license
+ *
+ * Date: Thu Sep 20 2012 21:13:05 GMT-0400 (Eastern Daylight Time)
+ */
+(function( window, undefined ) {
+var
+ // A central reference to the root jQuery(document)
+ rootjQuery,
+
+ // The deferred used on DOM ready
+ readyList,
+
+ // Use the correct document accordingly with window argument (sandbox)
+ document = window.document,
+ location = window.location,
+ navigator = window.navigator,
+
+ // Map over jQuery in case of overwrite
+ _jQuery = window.jQuery,
+
+ // Map over the $ in case of overwrite
+ _$ = window.$,
+
+ // Save a reference to some core methods
+ core_push = Array.prototype.push,
+ core_slice = Array.prototype.slice,
+ core_indexOf = Array.prototype.indexOf,
+ core_toString = Object.prototype.toString,
+ core_hasOwn = Object.prototype.hasOwnProperty,
+ core_trim = String.prototype.trim,
+
+ // Define a local copy of jQuery
+ jQuery = function( selector, context ) {
+ // The jQuery object is actually just the init constructor 'enhanced'
+ return new jQuery.fn.init( selector, context, rootjQuery );
+ },
+
+ // Used for matching numbers
+ core_pnum = /[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,
+
+ // Used for detecting and trimming whitespace
+ core_rnotwhite = /\S/,
+ core_rspace = /\s+/,
+
+ // Make sure we trim BOM and NBSP (here's looking at you, Safari 5.0 and IE)
+ rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
+
+ // A simple way to check for HTML strings
+ // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
+ rquickExpr = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,
+
+ // Match a standalone tag
+ rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>|)$/,
+
+ // JSON RegExp
+ rvalidchars = /^[\],:{}\s]*$/,
+ rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,
+ rvalidescape = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,
+ rvalidtokens = /"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,
+
+ // Matches dashed string for camelizing
+ rmsPrefix = /^-ms-/,
+ rdashAlpha = /-([\da-z])/gi,
+
+ // Used by jQuery.camelCase as callback to replace()
+ fcamelCase = function( all, letter ) {
+ return ( letter + "" ).toUpperCase();
+ },
+
+ // The ready event handler and self cleanup method
+ DOMContentLoaded = function() {
+ if ( document.addEventListener ) {
+ document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false );
+ jQuery.ready();
+ } else if ( document.readyState === "complete" ) {
+ // we're here because readyState === "complete" in oldIE
+ // which is good enough for us to call the dom ready!
+ document.detachEvent( "onreadystatechange", DOMContentLoaded );
+ jQuery.ready();
+ }
+ },
+
+ // [[Class]] -> type pairs
+ class2type = {};
+
+jQuery.fn = jQuery.prototype = {
+ constructor: jQuery,
+ init: function( selector, context, rootjQuery ) {
+ var match, elem, ret, doc;
+
+ // Handle $(""), $(null), $(undefined), $(false)
+ if ( !selector ) {
+ return this;
+ }
+
+ // Handle $(DOMElement)
+ if ( selector.nodeType ) {
+ this.context = this[0] = selector;
+ this.length = 1;
+ return this;
+ }
+
+ // Handle HTML strings
+ if ( typeof selector === "string" ) {
+ if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) {
+ // Assume that strings that start and end with <> are HTML and skip the regex check
+ match = [ null, selector, null ];
+
+ } else {
+ match = rquickExpr.exec( selector );
+ }
+
+ // Match html or make sure no context is specified for #id
+ if ( match && (match[1] || !context) ) {
+
+ // HANDLE: $(html) -> $(array)
+ if ( match[1] ) {
+ context = context instanceof jQuery ? context[0] : context;
+ doc = ( context && context.nodeType ? context.ownerDocument || context : document );
+
+ // scripts is true for back-compat
+ selector = jQuery.parseHTML( match[1], doc, true );
+ if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) {
+ this.attr.call( selector, context, true );
+ }
+
+ return jQuery.merge( this, selector );
+
+ // HANDLE: $(#id)
+ } else {
+ elem = document.getElementById( match[2] );
+
+ // Check parentNode to catch when Blackberry 4.6 returns
+ // nodes that are no longer in the document #6963
+ if ( elem && elem.parentNode ) {
+ // Handle the case where IE and Opera return items
+ // by name instead of ID
+ if ( elem.id !== match[2] ) {
+ return rootjQuery.find( selector );
+ }
+
+ // Otherwise, we inject the element directly into the jQuery object
+ this.length = 1;
+ this[0] = elem;
+ }
+
+ this.context = document;
+ this.selector = selector;
+ return this;
+ }
+
+ // HANDLE: $(expr, $(...))
+ } else if ( !context || context.jquery ) {
+ return ( context || rootjQuery ).find( selector );
+
+ // HANDLE: $(expr, context)
+ // (which is just equivalent to: $(context).find(expr)
+ } else {
+ return this.constructor( context ).find( selector );
+ }
+
+ // HANDLE: $(function)
+ // Shortcut for document ready
+ } else if ( jQuery.isFunction( selector ) ) {
+ return rootjQuery.ready( selector );
+ }
+
+ if ( selector.selector !== undefined ) {
+ this.selector = selector.selector;
+ this.context = selector.context;
+ }
+
+ return jQuery.makeArray( selector, this );
+ },
+
+ // Start with an empty selector
+ selector: "",
+
+ // The current version of jQuery being used
+ jquery: "1.8.2",
+
+ // The default length of a jQuery object is 0
+ length: 0,
+
+ // The number of elements contained in the matched element set
+ size: function() {
+ return this.length;
+ },
+
+ toArray: function() {
+ return core_slice.call( this );
+ },
+
+ // Get the Nth element in the matched element set OR
+ // Get the whole matched element set as a clean array
+ get: function( num ) {
+ return num == null ?
+
+ // Return a 'clean' array
+ this.toArray() :
+
+ // Return just the object
+ ( num < 0 ? this[ this.length + num ] : this[ num ] );
+ },
+
+ // Take an array of elements and push it onto the stack
+ // (returning the new matched element set)
+ pushStack: function( elems, name, selector ) {
+
+ // Build a new jQuery matched element set
+ var ret = jQuery.merge( this.constructor(), elems );
+
+ // Add the old object onto the stack (as a reference)
+ ret.prevObject = this;
+
+ ret.context = this.context;
+
+ if ( name === "find" ) {
+ ret.selector = this.selector + ( this.selector ? " " : "" ) + selector;
+ } else if ( name ) {
+ ret.selector = this.selector + "." + name + "(" + selector + ")";
+ }
+
+ // Return the newly-formed element set
+ return ret;
+ },
+
+ // Execute a callback for every element in the matched set.
+ // (You can seed the arguments with an array of args, but this is
+ // only used internally.)
+ each: function( callback, args ) {
+ return jQuery.each( this, callback, args );
+ },
+
+ ready: function( fn ) {
+ // Add the callback
+ jQuery.ready.promise().done( fn );
+
+ return this;
+ },
+
+ eq: function( i ) {
+ i = +i;
+ return i === -1 ?
+ this.slice( i ) :
+ this.slice( i, i + 1 );
+ },
+
+ first: function() {
+ return this.eq( 0 );
+ },
+
+ last: function() {
+ return this.eq( -1 );
+ },
+
+ slice: function() {
+ return this.pushStack( core_slice.apply( this, arguments ),
+ "slice", core_slice.call(arguments).join(",") );
+ },
+
+ map: function( callback ) {
+ return this.pushStack( jQuery.map(this, function( elem, i ) {
+ return callback.call( elem, i, elem );
+ }));
+ },
+
+ end: function() {
+ return this.prevObject || this.constructor(null);
+ },
+
+ // For internal use only.
+ // Behaves like an Array's method, not like a jQuery method.
+ push: core_push,
+ sort: [].sort,
+ splice: [].splice
+};
+
+// Give the init function the jQuery prototype for later instantiation
+jQuery.fn.init.prototype = jQuery.fn;
+
+jQuery.extend = jQuery.fn.extend = function() {
+ var options, name, src, copy, copyIsArray, clone,
+ target = arguments[0] || {},
+ i = 1,
+ length = arguments.length,
+ deep = false;
+
+ // Handle a deep copy situation
+ if ( typeof target === "boolean" ) {
+ deep = target;
+ target = arguments[1] || {};
+ // skip the boolean and the target
+ i = 2;
+ }
+
+ // Handle case when target is a string or something (possible in deep copy)
+ if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
+ target = {};
+ }
+
+ // extend jQuery itself if only one argument is passed
+ if ( length === i ) {
+ target = this;
+ --i;
+ }
+
+ for ( ; i < length; i++ ) {
+ // Only deal with non-null/undefined values
+ if ( (options = arguments[ i ]) != null ) {
+ // Extend the base object
+ for ( name in options ) {
+ src = target[ name ];
+ copy = options[ name ];
+
+ // Prevent never-ending loop
+ if ( target === copy ) {
+ continue;
+ }
+
+ // Recurse if we're merging plain objects or arrays
+ if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
+ if ( copyIsArray ) {
+ copyIsArray = false;
+ clone = src && jQuery.isArray(src) ? src : [];
+
+ } else {
+ clone = src && jQuery.isPlainObject(src) ? src : {};
+ }
+
+ // Never move original objects, clone them
+ target[ name ] = jQuery.extend( deep, clone, copy );
+
+ // Don't bring in undefined values
+ } else if ( copy !== undefined ) {
+ target[ name ] = copy;
+ }
+ }
+ }
+ }
+
+ // Return the modified object
+ return target;
+};
+
+jQuery.extend({
+ noConflict: function( deep ) {
+ if ( window.$ === jQuery ) {
+ window.$ = _$;
+ }
+
+ if ( deep && window.jQuery === jQuery ) {
+ window.jQuery = _jQuery;
+ }
+
+ return jQuery;
+ },
+
+ // Is the DOM ready to be used? Set to true once it occurs.
+ isReady: false,
+
+ // A counter to track how many items to wait for before
+ // the ready event fires. See #6781
+ readyWait: 1,
+
+ // Hold (or release) the ready event
+ holdReady: function( hold ) {
+ if ( hold ) {
+ jQuery.readyWait++;
+ } else {
+ jQuery.ready( true );
+ }
+ },
+
+ // Handle when the DOM is ready
+ ready: function( wait ) {
+
+ // Abort if there are pending holds or we're already ready
+ if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
+ return;
+ }
+
+ // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
+ if ( !document.body ) {
+ return setTimeout( jQuery.ready, 1 );
+ }
+
+ // Remember that the DOM is ready
+ jQuery.isReady = true;
+
+ // If a normal DOM Ready event fired, decrement, and wait if need be
+ if ( wait !== true && --jQuery.readyWait > 0 ) {
+ return;
+ }
+
+ // If there are functions bound, to execute
+ readyList.resolveWith( document, [ jQuery ] );
+
+ // Trigger any bound ready events
+ if ( jQuery.fn.trigger ) {
+ jQuery( document ).trigger("ready").off("ready");
+ }
+ },
+
+ // See test/unit/core.js for details concerning isFunction.
+ // Since version 1.3, DOM methods and functions like alert
+ // aren't supported. They return false on IE (#2968).
+ isFunction: function( obj ) {
+ return jQuery.type(obj) === "function";
+ },
+
+ isArray: Array.isArray || function( obj ) {
+ return jQuery.type(obj) === "array";
+ },
+
+ isWindow: function( obj ) {
+ return obj != null && obj == obj.window;
+ },
+
+ isNumeric: function( obj ) {
+ return !isNaN( parseFloat(obj) ) && isFinite( obj );
+ },
+
+ type: function( obj ) {
+ return obj == null ?
+ String( obj ) :
+ class2type[ core_toString.call(obj) ] || "object";
+ },
+
+ isPlainObject: function( obj ) {
+ // Must be an Object.
+ // Because of IE, we also have to check the presence of the constructor property.
+ // Make sure that DOM nodes and window objects don't pass through, as well
+ if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
+ return false;
+ }
+
+ try {
+ // Not own constructor property must be Object
+ if ( obj.constructor &&
+ !core_hasOwn.call(obj, "constructor") &&
+ !core_hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
+ return false;
+ }
+ } catch ( e ) {
+ // IE8,9 Will throw exceptions on certain host objects #9897
+ return false;
+ }
+
+ // Own properties are enumerated firstly, so to speed up,
+ // if last one is own, then all properties are own.
+
+ var key;
+ for ( key in obj ) {}
+
+ return key === undefined || core_hasOwn.call( obj, key );
+ },
+
+ isEmptyObject: function( obj ) {
+ var name;
+ for ( name in obj ) {
+ return false;
+ }
+ return true;
+ },
+
+ error: function( msg ) {
+ throw new Error( msg );
+ },
+
+ // data: string of html
+ // context (optional): If specified, the fragment will be created in this context, defaults to document
+ // scripts (optional): If true, will include scripts passed in the html string
+ parseHTML: function( data, context, scripts ) {
+ var parsed;
+ if ( !data || typeof data !== "string" ) {
+ return null;
+ }
+ if ( typeof context === "boolean" ) {
+ scripts = context;
+ context = 0;
+ }
+ context = context || document;
+
+ // Single tag
+ if ( (parsed = rsingleTag.exec( data )) ) {
+ return [ context.createElement( parsed[1] ) ];
+ }
+
+ parsed = jQuery.buildFragment( [ data ], context, scripts ? null : [] );
+ return jQuery.merge( [],
+ (parsed.cacheable ? jQuery.clone( parsed.fragment ) : parsed.fragment).childNodes );
+ },
+
+ parseJSON: function( data ) {
+ if ( !data || typeof data !== "string") {
+ return null;
+ }
+
+ // Make sure leading/trailing whitespace is removed (IE can't handle it)
+ data = jQuery.trim( data );
+
+ // Attempt to parse using the native JSON parser first
+ if ( window.JSON && window.JSON.parse ) {
+ return window.JSON.parse( data );
+ }
+
+ // Make sure the incoming data is actual JSON
+ // Logic borrowed from http://json.org/json2.js
+ if ( rvalidchars.test( data.replace( rvalidescape, "@" )
+ .replace( rvalidtokens, "]" )
+ .replace( rvalidbraces, "")) ) {
+
+ return ( new Function( "return " + data ) )();
+
+ }
+ jQuery.error( "Invalid JSON: " + data );
+ },
+
+ // Cross-browser xml parsing
+ parseXML: function( data ) {
+ var xml, tmp;
+ if ( !data || typeof data !== "string" ) {
+ return null;
+ }
+ try {
+ if ( window.DOMParser ) { // Standard
+ tmp = new DOMParser();
+ xml = tmp.parseFromString( data , "text/xml" );
+ } else { // IE
+ xml = new ActiveXObject( "Microsoft.XMLDOM" );
+ xml.async = "false";
+ xml.loadXML( data );
+ }
+ } catch( e ) {
+ xml = undefined;
+ }
+ if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) {
+ jQuery.error( "Invalid XML: " + data );
+ }
+ return xml;
+ },
+
+ noop: function() {},
+
+ // Evaluates a script in a global context
+ // Workarounds based on findings by Jim Driscoll
+ // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context
+ globalEval: function( data ) {
+ if ( data && core_rnotwhite.test( data ) ) {
+ // We use execScript on Internet Explorer
+ // We use an anonymous function so that context is window
+ // rather than jQuery in Firefox
+ ( window.execScript || function( data ) {
+ window[ "eval" ].call( window, data );
+ } )( data );
+ }
+ },
+
+ // Convert dashed to camelCase; used by the css and data modules
+ // Microsoft forgot to hump their vendor prefix (#9572)
+ camelCase: function( string ) {
+ return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
+ },
+
+ nodeName: function( elem, name ) {
+ return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
+ },
+
+ // args is for internal usage only
+ each: function( obj, callback, args ) {
+ var name,
+ i = 0,
+ length = obj.length,
+ isObj = length === undefined || jQuery.isFunction( obj );
+
+ if ( args ) {
+ if ( isObj ) {
+ for ( name in obj ) {
+ if ( callback.apply( obj[ name ], args ) === false ) {
+ break;
+ }
+ }
+ } else {
+ for ( ; i < length; ) {
+ if ( callback.apply( obj[ i++ ], args ) === false ) {
+ break;
+ }
+ }
+ }
+
+ // A special, fast, case for the most common use of each
+ } else {
+ if ( isObj ) {
+ for ( name in obj ) {
+ if ( callback.call( obj[ name ], name, obj[ name ] ) === false ) {
+ break;
+ }
+ }
+ } else {
+ for ( ; i < length; ) {
+ if ( callback.call( obj[ i ], i, obj[ i++ ] ) === false ) {
+ break;
+ }
+ }
+ }
+ }
+
+ return obj;
+ },
+
+ // Use native String.trim function wherever possible
+ trim: core_trim && !core_trim.call("\uFEFF\xA0") ?
+ function( text ) {
+ return text == null ?
+ "" :
+ core_trim.call( text );
+ } :
+
+ // Otherwise use our own trimming functionality
+ function( text ) {
+ return text == null ?
+ "" :
+ ( text + "" ).replace( rtrim, "" );
+ },
+
+ // results is for internal usage only
+ makeArray: function( arr, results ) {
+ var type,
+ ret = results || [];
+
+ if ( arr != null ) {
+ // The window, strings (and functions) also have 'length'
+ // Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930
+ type = jQuery.type( arr );
+
+ if ( arr.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( arr ) ) {
+ core_push.call( ret, arr );
+ } else {
+ jQuery.merge( ret, arr );
+ }
+ }
+
+ return ret;
+ },
+
+ inArray: function( elem, arr, i ) {
+ var len;
+
+ if ( arr ) {
+ if ( core_indexOf ) {
+ return core_indexOf.call( arr, elem, i );
+ }
+
+ len = arr.length;
+ i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0;
+
+ for ( ; i < len; i++ ) {
+ // Skip accessing in sparse arrays
+ if ( i in arr && arr[ i ] === elem ) {
+ return i;
+ }
+ }
+ }
+
+ return -1;
+ },
+
+ merge: function( first, second ) {
+ var l = second.length,
+ i = first.length,
+ j = 0;
+
+ if ( typeof l === "number" ) {
+ for ( ; j < l; j++ ) {
+ first[ i++ ] = second[ j ];
+ }
+
+ } else {
+ while ( second[j] !== undefined ) {
+ first[ i++ ] = second[ j++ ];
+ }
+ }
+
+ first.length = i;
+
+ return first;
+ },
+
+ grep: function( elems, callback, inv ) {
+ var retVal,
+ ret = [],
+ i = 0,
+ length = elems.length;
+ inv = !!inv;
+
+ // Go through the array, only saving the items
+ // that pass the validator function
+ for ( ; i < length; i++ ) {
+ retVal = !!callback( elems[ i ], i );
+ if ( inv !== retVal ) {
+ ret.push( elems[ i ] );
+ }
+ }
+
+ return ret;
+ },
+
+ // arg is for internal usage only
+ map: function( elems, callback, arg ) {
+ var value, key,
+ ret = [],
+ i = 0,
+ length = elems.length,
+ // jquery objects are treated as arrays
+ isArray = elems instanceof jQuery || length !== undefined && typeof length === "number" && ( ( length > 0 && elems[ 0 ] && elems[ length -1 ] ) || length === 0 || jQuery.isArray( elems ) ) ;
+
+ // Go through the array, translating each of the items to their
+ if ( isArray ) {
+ for ( ; i < length; i++ ) {
+ value = callback( elems[ i ], i, arg );
+
+ if ( value != null ) {
+ ret[ ret.length ] = value;
+ }
+ }
+
+ // Go through every key on the object,
+ } else {
+ for ( key in elems ) {
+ value = callback( elems[ key ], key, arg );
+
+ if ( value != null ) {
+ ret[ ret.length ] = value;
+ }
+ }
+ }
+
+ // Flatten any nested arrays
+ return ret.concat.apply( [], ret );
+ },
+
+ // A global GUID counter for objects
+ guid: 1,
+
+ // Bind a function to a context, optionally partially applying any
+ // arguments.
+ proxy: function( fn, context ) {
+ var tmp, args, proxy;
+
+ if ( typeof context === "string" ) {
+ tmp = fn[ context ];
+ context = fn;
+ fn = tmp;
+ }
+
+ // Quick check to determine if target is callable, in the spec
+ // this throws a TypeError, but we will just return undefined.
+ if ( !jQuery.isFunction( fn ) ) {
+ return undefined;
+ }
+
+ // Simulated bind
+ args = core_slice.call( arguments, 2 );
+ proxy = function() {
+ return fn.apply( context, args.concat( core_slice.call( arguments ) ) );
+ };
+
+ // Set the guid of unique handler to the same of original handler, so it can be removed
+ proxy.guid = fn.guid = fn.guid || jQuery.guid++;
+
+ return proxy;
+ },
+
+ // Multifunctional method to get and set values of a collection
+ // The value/s can optionally be executed if it's a function
+ access: function( elems, fn, key, value, chainable, emptyGet, pass ) {
+ var exec,
+ bulk = key == null,
+ i = 0,
+ length = elems.length;
+
+ // Sets many values
+ if ( key && typeof key === "object" ) {
+ for ( i in key ) {
+ jQuery.access( elems, fn, i, key[i], 1, emptyGet, value );
+ }
+ chainable = 1;
+
+ // Sets one value
+ } else if ( value !== undefined ) {
+ // Optionally, function values get executed if exec is true
+ exec = pass === undefined && jQuery.isFunction( value );
+
+ if ( bulk ) {
+ // Bulk operations only iterate when executing function values
+ if ( exec ) {
+ exec = fn;
+ fn = function( elem, key, value ) {
+ return exec.call( jQuery( elem ), value );
+ };
+
+ // Otherwise they run against the entire set
+ } else {
+ fn.call( elems, value );
+ fn = null;
+ }
+ }
+
+ if ( fn ) {
+ for (; i < length; i++ ) {
+ fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass );
+ }
+ }
+
+ chainable = 1;
+ }
+
+ return chainable ?
+ elems :
+
+ // Gets
+ bulk ?
+ fn.call( elems ) :
+ length ? fn( elems[0], key ) : emptyGet;
+ },
+
+ now: function() {
+ return ( new Date() ).getTime();
+ }
+});
+
+jQuery.ready.promise = function( obj ) {
+ if ( !readyList ) {
+
+ readyList = jQuery.Deferred();
+
+ // Catch cases where $(document).ready() is called after the browser event has already occurred.
+ // we once tried to use readyState "interactive" here, but it caused issues like the one
+ // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15
+ if ( document.readyState === "complete" ) {
+ // Handle it asynchronously to allow scripts the opportunity to delay ready
+ setTimeout( jQuery.ready, 1 );
+
+ // Standards-based browsers support DOMContentLoaded
+ } else if ( document.addEventListener ) {
+ // Use the handy event callback
+ document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false );
+
+ // A fallback to window.onload, that will always work
+ window.addEventListener( "load", jQuery.ready, false );
+
+ // If IE event model is used
+ } else {
+ // Ensure firing before onload, maybe late but safe also for iframes
+ document.attachEvent( "onreadystatechange", DOMContentLoaded );
+
+ // A fallback to window.onload, that will always work
+ window.attachEvent( "onload", jQuery.ready );
+
+ // If IE and not a frame
+ // continually check to see if the document is ready
+ var top = false;
+
+ try {
+ top = window.frameElement == null && document.documentElement;
+ } catch(e) {}
+
+ if ( top && top.doScroll ) {
+ (function doScrollCheck() {
+ if ( !jQuery.isReady ) {
+
+ try {
+ // Use the trick by Diego Perini
+ // http://javascript.nwbox.com/IEContentLoaded/
+ top.doScroll("left");
+ } catch(e) {
+ return setTimeout( doScrollCheck, 50 );
+ }
+
+ // and execute any waiting functions
+ jQuery.ready();
+ }
+ })();
+ }
+ }
+ }
+ return readyList.promise( obj );
+};
+
+// Populate the class2type map
+jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) {
+ class2type[ "[object " + name + "]" ] = name.toLowerCase();
+});
+
+// All jQuery objects should point back to these
+rootjQuery = jQuery(document);
+// String to Object options format cache
+var optionsCache = {};
+
+// Convert String-formatted options into Object-formatted ones and store in cache
+function createOptions( options ) {
+ var object = optionsCache[ options ] = {};
+ jQuery.each( options.split( core_rspace ), function( _, flag ) {
+ object[ flag ] = true;
+ });
+ return object;
+}
+
+/*
+ * Create a callback list using the following parameters:
+ *
+ * options: an optional list of space-separated options that will change how
+ * the callback list behaves or a more traditional option object
+ *
+ * By default a callback list will act like an event callback list and can be
+ * "fired" multiple times.
+ *
+ * Possible options:
+ *
+ * once: will ensure the callback list can only be fired once (like a Deferred)
+ *
+ * memory: will keep track of previous values and will call any callback added
+ * after the list has been fired right away with the latest "memorized"
+ * values (like a Deferred)
+ *
+ * unique: will ensure a callback can only be added once (no duplicate in the list)
+ *
+ * stopOnFalse: interrupt callings when a callback returns false
+ *
+ */
+jQuery.Callbacks = function( options ) {
+
+ // Convert options from String-formatted to Object-formatted if needed
+ // (we check in cache first)
+ options = typeof options === "string" ?
+ ( optionsCache[ options ] || createOptions( options ) ) :
+ jQuery.extend( {}, options );
+
+ var // Last fire value (for non-forgettable lists)
+ memory,
+ // Flag to know if list was already fired
+ fired,
+ // Flag to know if list is currently firing
+ firing,
+ // First callback to fire (used internally by add and fireWith)
+ firingStart,
+ // End of the loop when firing
+ firingLength,
+ // Index of currently firing callback (modified by remove if needed)
+ firingIndex,
+ // Actual callback list
+ list = [],
+ // Stack of fire calls for repeatable lists
+ stack = !options.once && [],
+ // Fire callbacks
+ fire = function( data ) {
+ memory = options.memory && data;
+ fired = true;
+ firingIndex = firingStart || 0;
+ firingStart = 0;
+ firingLength = list.length;
+ firing = true;
+ for ( ; list && firingIndex < firingLength; firingIndex++ ) {
+ if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) {
+ memory = false; // To prevent further calls using add
+ break;
+ }
+ }
+ firing = false;
+ if ( list ) {
+ if ( stack ) {
+ if ( stack.length ) {
+ fire( stack.shift() );
+ }
+ } else if ( memory ) {
+ list = [];
+ } else {
+ self.disable();
+ }
+ }
+ },
+ // Actual Callbacks object
+ self = {
+ // Add a callback or a collection of callbacks to the list
+ add: function() {
+ if ( list ) {
+ // First, we save the current length
+ var start = list.length;
+ (function add( args ) {
+ jQuery.each( args, function( _, arg ) {
+ var type = jQuery.type( arg );
+ if ( type === "function" && ( !options.unique || !self.has( arg ) ) ) {
+ list.push( arg );
+ } else if ( arg && arg.length && type !== "string" ) {
+ // Inspect recursively
+ add( arg );
+ }
+ });
+ })( arguments );
+ // Do we need to add the callbacks to the
+ // current firing batch?
+ if ( firing ) {
+ firingLength = list.length;
+ // With memory, if we're not firing then
+ // we should call right away
+ } else if ( memory ) {
+ firingStart = start;
+ fire( memory );
+ }
+ }
+ return this;
+ },
+ // Remove a callback from the list
+ remove: function() {
+ if ( list ) {
+ jQuery.each( arguments, function( _, arg ) {
+ var index;
+ while( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
+ list.splice( index, 1 );
+ // Handle firing indexes
+ if ( firing ) {
+ if ( index <= firingLength ) {
+ firingLength--;
+ }
+ if ( index <= firingIndex ) {
+ firingIndex--;
+ }
+ }
+ }
+ });
+ }
+ return this;
+ },
+ // Control if a given callback is in the list
+ has: function( fn ) {
+ return jQuery.inArray( fn, list ) > -1;
+ },
+ // Remove all callbacks from the list
+ empty: function() {
+ list = [];
+ return this;
+ },
+ // Have the list do nothing anymore
+ disable: function() {
+ list = stack = memory = undefined;
+ return this;
+ },
+ // Is it disabled?
+ disabled: function() {
+ return !list;
+ },
+ // Lock the list in its current state
+ lock: function() {
+ stack = undefined;
+ if ( !memory ) {
+ self.disable();
+ }
+ return this;
+ },
+ // Is it locked?
+ locked: function() {
+ return !stack;
+ },
+ // Call all callbacks with the given context and arguments
+ fireWith: function( context, args ) {
+ args = args || [];
+ args = [ context, args.slice ? args.slice() : args ];
+ if ( list && ( !fired || stack ) ) {
+ if ( firing ) {
+ stack.push( args );
+ } else {
+ fire( args );
+ }
+ }
+ return this;
+ },
+ // Call all the callbacks with the given arguments
+ fire: function() {
+ self.fireWith( this, arguments );
+ return this;
+ },
+ // To know if the callbacks have already been called at least once
+ fired: function() {
+ return !!fired;
+ }
+ };
+
+ return self;
+};
+jQuery.extend({
+
+ Deferred: function( func ) {
+ var tuples = [
+ // action, add listener, listener list, final state
+ [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ],
+ [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ],
+ [ "notify", "progress", jQuery.Callbacks("memory") ]
+ ],
+ state = "pending",
+ promise = {
+ state: function() {
+ return state;
+ },
+ always: function() {
+ deferred.done( arguments ).fail( arguments );
+ return this;
+ },
+ then: function( /* fnDone, fnFail, fnProgress */ ) {
+ var fns = arguments;
+ return jQuery.Deferred(function( newDefer ) {
+ jQuery.each( tuples, function( i, tuple ) {
+ var action = tuple[ 0 ],
+ fn = fns[ i ];
+ // deferred[ done | fail | progress ] for forwarding actions to newDefer
+ deferred[ tuple[1] ]( jQuery.isFunction( fn ) ?
+ function() {
+ var returned = fn.apply( this, arguments );
+ if ( returned && jQuery.isFunction( returned.promise ) ) {
+ returned.promise()
+ .done( newDefer.resolve )
+ .fail( newDefer.reject )
+ .progress( newDefer.notify );
+ } else {
+ newDefer[ action + "With" ]( this === deferred ? newDefer : this, [ returned ] );
+ }
+ } :
+ newDefer[ action ]
+ );
+ });
+ fns = null;
+ }).promise();
+ },
+ // Get a promise for this deferred
+ // If obj is provided, the promise aspect is added to the object
+ promise: function( obj ) {
+ return obj != null ? jQuery.extend( obj, promise ) : promise;
+ }
+ },
+ deferred = {};
+
+ // Keep pipe for back-compat
+ promise.pipe = promise.then;
+
+ // Add list-specific methods
+ jQuery.each( tuples, function( i, tuple ) {
+ var list = tuple[ 2 ],
+ stateString = tuple[ 3 ];
+
+ // promise[ done | fail | progress ] = list.add
+ promise[ tuple[1] ] = list.add;
+
+ // Handle state
+ if ( stateString ) {
+ list.add(function() {
+ // state = [ resolved | rejected ]
+ state = stateString;
+
+ // [ reject_list | resolve_list ].disable; progress_list.lock
+ }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );
+ }
+
+ // deferred[ resolve | reject | notify ] = list.fire
+ deferred[ tuple[0] ] = list.fire;
+ deferred[ tuple[0] + "With" ] = list.fireWith;
+ });
+
+ // Make the deferred a promise
+ promise.promise( deferred );
+
+ // Call given func if any
+ if ( func ) {
+ func.call( deferred, deferred );
+ }
+
+ // All done!
+ return deferred;
+ },
+
+ // Deferred helper
+ when: function( subordinate /* , ..., subordinateN */ ) {
+ var i = 0,
+ resolveValues = core_slice.call( arguments ),
+ length = resolveValues.length,
+
+ // the count of uncompleted subordinates
+ remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,
+
+ // the master Deferred. If resolveValues consist of only a single Deferred, just use that.
+ deferred = remaining === 1 ? subordinate : jQuery.Deferred(),
+
+ // Update function for both resolve and progress values
+ updateFunc = function( i, contexts, values ) {
+ return function( value ) {
+ contexts[ i ] = this;
+ values[ i ] = arguments.length > 1 ? core_slice.call( arguments ) : value;
+ if( values === progressValues ) {
+ deferred.notifyWith( contexts, values );
+ } else if ( !( --remaining ) ) {
+ deferred.resolveWith( contexts, values );
+ }
+ };
+ },
+
+ progressValues, progressContexts, resolveContexts;
+
+ // add listeners to Deferred subordinates; treat others as resolved
+ if ( length > 1 ) {
+ progressValues = new Array( length );
+ progressContexts = new Array( length );
+ resolveContexts = new Array( length );
+ for ( ; i < length; i++ ) {
+ if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {
+ resolveValues[ i ].promise()
+ .done( updateFunc( i, resolveContexts, resolveValues ) )
+ .fail( deferred.reject )
+ .progress( updateFunc( i, progressContexts, progressValues ) );
+ } else {
+ --remaining;
+ }
+ }
+ }
+
+ // if we're not waiting on anything, resolve the master
+ if ( !remaining ) {
+ deferred.resolveWith( resolveContexts, resolveValues );
+ }
+
+ return deferred.promise();
+ }
+});
+jQuery.support = (function() {
+
+ var support,
+ all,
+ a,
+ select,
+ opt,
+ input,
+ fragment,
+ eventName,
+ i,
+ isSupported,
+ clickFn,
+ div = document.createElement("div");
+
+ // Preliminary tests
+ div.setAttribute( "className", "t" );
+ div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
+
+ all = div.getElementsByTagName("*");
+ a = div.getElementsByTagName("a")[ 0 ];
+ a.style.cssText = "top:1px;float:left;opacity:.5";
+
+ // Can't get basic test support
+ if ( !all || !all.length ) {
+ return {};
+ }
+
+ // First batch of supports tests
+ select = document.createElement("select");
+ opt = select.appendChild( document.createElement("option") );
+ input = div.getElementsByTagName("input")[ 0 ];
+
+ support = {
+ // IE strips leading whitespace when .innerHTML is used
+ leadingWhitespace: ( div.firstChild.nodeType === 3 ),
+
+ // Make sure that tbody elements aren't automatically inserted
+ // IE will insert them into empty tables
+ tbody: !div.getElementsByTagName("tbody").length,
+
+ // Make sure that link elements get serialized correctly by innerHTML
+ // This requires a wrapper element in IE
+ htmlSerialize: !!div.getElementsByTagName("link").length,
+
+ // Get the style information from getAttribute
+ // (IE uses .cssText instead)
+ style: /top/.test( a.getAttribute("style") ),
+
+ // Make sure that URLs aren't manipulated
+ // (IE normalizes it by default)
+ hrefNormalized: ( a.getAttribute("href") === "/a" ),
+
+ // Make sure that element opacity exists
+ // (IE uses filter instead)
+ // Use a regex to work around a WebKit issue. See #5145
+ opacity: /^0.5/.test( a.style.opacity ),
+
+ // Verify style float existence
+ // (IE uses styleFloat instead of cssFloat)
+ cssFloat: !!a.style.cssFloat,
+
+ // Make sure that if no value is specified for a checkbox
+ // that it defaults to "on".
+ // (WebKit defaults to "" instead)
+ checkOn: ( input.value === "on" ),
+
+ // Make sure that a selected-by-default option has a working selected property.
+ // (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
+ optSelected: opt.selected,
+
+ // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
+ getSetAttribute: div.className !== "t",
+
+ // Tests for enctype support on a form(#6743)
+ enctype: !!document.createElement("form").enctype,
+
+ // Makes sure cloning an html5 element does not cause problems
+ // Where outerHTML is undefined, this still works
+ html5Clone: document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav></:nav>",
+
+ // jQuery.support.boxModel DEPRECATED in 1.8 since we don't support Quirks Mode
+ boxModel: ( document.compatMode === "CSS1Compat" ),
+
+ // Will be defined later
+ submitBubbles: true,
+ changeBubbles: true,
+ focusinBubbles: false,
+ deleteExpando: true,
+ noCloneEvent: true,
+ inlineBlockNeedsLayout: false,
+ shrinkWrapBlocks: false,
+ reliableMarginRight: true,
+ boxSizingReliable: true,
+ pixelPosition: false
+ };
+
+ // Make sure checked status is properly cloned
+ input.checked = true;
+ support.noCloneChecked = input.cloneNode( true ).checked;
+
+ // Make sure that the options inside disabled selects aren't marked as disabled
+ // (WebKit marks them as disabled)
+ select.disabled = true;
+ support.optDisabled = !opt.disabled;
+
+ // Test to see if it's possible to delete an expando from an element
+ // Fails in Internet Explorer
+ try {
+ delete div.test;
+ } catch( e ) {
+ support.deleteExpando = false;
+ }
+
+ if ( !div.addEventListener && div.attachEvent && div.fireEvent ) {
+ div.attachEvent( "onclick", clickFn = function() {
+ // Cloning a node shouldn't copy over any
+ // bound event handlers (IE does this)
+ support.noCloneEvent = false;
+ });
+ div.cloneNode( true ).fireEvent("onclick");
+ div.detachEvent( "onclick", clickFn );
+ }
+
+ // Check if a radio maintains its value
+ // after being appended to the DOM
+ input = document.createElement("input");
+ input.value = "t";
+ input.setAttribute( "type", "radio" );
+ support.radioValue = input.value === "t";
+
+ input.setAttribute( "checked", "checked" );
+
+ // #11217 - WebKit loses check when the name is after the checked attribute
+ input.setAttribute( "name", "t" );
+
+ div.appendChild( input );
+ fragment = document.createDocumentFragment();
+ fragment.appendChild( div.lastChild );
+
+ // WebKit doesn't clone checked state correctly in fragments
+ support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked;
+
+ // Check if a disconnected checkbox will retain its checked
+ // value of true after appended to the DOM (IE6/7)
+ support.appendChecked = input.checked;
+
+ fragment.removeChild( input );
+ fragment.appendChild( div );
+
+ // Technique from Juriy Zaytsev
+ // http://perfectionkills.com/detecting-event-support-without-browser-sniffing/
+ // We only care about the case where non-standard event systems
+ // are used, namely in IE. Short-circuiting here helps us to
+ // avoid an eval call (in setAttribute) which can cause CSP
+ // to go haywire. See: https://developer.mozilla.org/en/Security/CSP
+ if ( div.attachEvent ) {
+ for ( i in {
+ submit: true,
+ change: true,
+ focusin: true
+ }) {
+ eventName = "on" + i;
+ isSupported = ( eventName in div );
+ if ( !isSupported ) {
+ div.setAttribute( eventName, "return;" );
+ isSupported = ( typeof div[ eventName ] === "function" );
+ }
+ support[ i + "Bubbles" ] = isSupported;
+ }
+ }
+
+ // Run tests that need a body at doc ready
+ jQuery(function() {
+ var container, div, tds, marginDiv,
+ divReset = "padding:0;margin:0;border:0;display:block;overflow:hidden;",
+ body = document.getElementsByTagName("body")[0];
+
+ if ( !body ) {
+ // Return for frameset docs that don't have a body
+ return;
+ }
+
+ container = document.createElement("div");
+ container.style.cssText = "visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px";
+ body.insertBefore( container, body.firstChild );
+
+ // Construct the test element
+ div = document.createElement("div");
+ container.appendChild( div );
+
+ // Check if table cells still have offsetWidth/Height when they are set
+ // to display:none and there are still other visible table cells in a
+ // table row; if so, offsetWidth/Height are not reliable for use when
+ // determining if an element has been hidden directly using
+ // display:none (it is still safe to use offsets if a parent element is
+ // hidden; don safety goggles and see bug #4512 for more information).
+ // (only IE 8 fails this test)
+ div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>";
+ tds = div.getElementsByTagName("td");
+ tds[ 0 ].style.cssText = "padding:0;margin:0;border:0;display:none";
+ isSupported = ( tds[ 0 ].offsetHeight === 0 );
+
+ tds[ 0 ].style.display = "";
+ tds[ 1 ].style.display = "none";
+
+ // Check if empty table cells still have offsetWidth/Height
+ // (IE <= 8 fail this test)
+ support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 );
+
+ // Check box-sizing and margin behavior
+ div.innerHTML = "";
+ div.style.cssText = "box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;";
+ support.boxSizing = ( div.offsetWidth === 4 );
+ support.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== 1 );
+
+ // NOTE: To any future maintainer, we've window.getComputedStyle
+ // because jsdom on node.js will break without it.
+ if ( window.getComputedStyle ) {
+ support.pixelPosition = ( window.getComputedStyle( div, null ) || {} ).top !== "1%";
+ support.boxSizingReliable = ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px";
+
+ // Check if div with explicit width and no margin-right incorrectly
+ // gets computed margin-right based on width of container. For more
+ // info see bug #3333
+ // Fails in WebKit before Feb 2011 nightlies
+ // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
+ marginDiv = document.createElement("div");
+ marginDiv.style.cssText = div.style.cssText = divReset;
+ marginDiv.style.marginRight = marginDiv.style.width = "0";
+ div.style.width = "1px";
+ div.appendChild( marginDiv );
+ support.reliableMarginRight =
+ !parseFloat( ( window.getComputedStyle( marginDiv, null ) || {} ).marginRight );
+ }
+
+ if ( typeof div.style.zoom !== "undefined" ) {
+ // Check if natively block-level elements act like inline-block
+ // elements when setting their display to 'inline' and giving
+ // them layout
+ // (IE < 8 does this)
+ div.innerHTML = "";
+ div.style.cssText = divReset + "width:1px;padding:1px;display:inline;zoom:1";
+ support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 );
+
+ // Check if elements with layout shrink-wrap their children
+ // (IE 6 does this)
+ div.style.display = "block";
+ div.style.overflow = "visible";
+ div.innerHTML = "<div></div>";
+ div.firstChild.style.width = "5px";
+ support.shrinkWrapBlocks = ( div.offsetWidth !== 3 );
+
+ container.style.zoom = 1;
+ }
+
+ // Null elements to avoid leaks in IE
+ body.removeChild( container );
+ container = div = tds = marginDiv = null;
+ });
+
+ // Null elements to avoid leaks in IE
+ fragment.removeChild( div );
+ all = a = select = opt = input = fragment = div = null;
+
+ return support;
+})();
+var rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/,
+ rmultiDash = /([A-Z])/g;
+
+jQuery.extend({
+ cache: {},
+
+ deletedIds: [],
+
+ // Remove at next major release (1.9/2.0)
+ uuid: 0,
+
+ // Unique for each copy of jQuery on the page
+ // Non-digits removed to match rinlinejQuery
+ expando: "jQuery" + ( jQuery.fn.jquery + Math.random() ).replace( /\D/g, "" ),
+
+ // The following elements throw uncatchable exceptions if you
+ // attempt to add expando properties to them.
+ noData: {
+ "embed": true,
+ // Ban all objects except for Flash (which handle expandos)
+ "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
+ "applet": true
+ },
+
+ hasData: function( elem ) {
+ elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];
+ return !!elem && !isEmptyDataObject( elem );
+ },
+
+ data: function( elem, name, data, pvt /* Internal Use Only */ ) {
+ if ( !jQuery.acceptData( elem ) ) {
+ return;
+ }
+
+ var thisCache, ret,
+ internalKey = jQuery.expando,
+ getByName = typeof name === "string",
+
+ // We have to handle DOM nodes and JS objects differently because IE6-7
+ // can't GC object references properly across the DOM-JS boundary
+ isNode = elem.nodeType,
+
+ // Only DOM nodes need the global jQuery cache; JS object data is
+ // attached directly to the object so GC can occur automatically
+ cache = isNode ? jQuery.cache : elem,
+
+ // Only defining an ID for JS objects if its cache already exists allows
+ // the code to shortcut on the same path as a DOM node with no cache
+ id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey;
+
+ // Avoid doing any more work than we need to when trying to get data on an
+ // object that has no data at all
+ if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && getByName && data === undefined ) {
+ return;
+ }
+
+ if ( !id ) {
+ // Only DOM nodes need a new unique ID for each element since their data
+ // ends up in the global cache
+ if ( isNode ) {
+ elem[ internalKey ] = id = jQuery.deletedIds.pop() || jQuery.guid++;
+ } else {
+ id = internalKey;
+ }
+ }
+
+ if ( !cache[ id ] ) {
+ cache[ id ] = {};
+
+ // Avoids exposing jQuery metadata on plain JS objects when the object
+ // is serialized using JSON.stringify
+ if ( !isNode ) {
+ cache[ id ].toJSON = jQuery.noop;
+ }
+ }
+
+ // An object can be passed to jQuery.data instead of a key/value pair; this gets
+ // shallow copied over onto the existing cache
+ if ( typeof name === "object" || typeof name === "function" ) {
+ if ( pvt ) {
+ cache[ id ] = jQuery.extend( cache[ id ], name );
+ } else {
+ cache[ id ].data = jQuery.extend( cache[ id ].data, name );
+ }
+ }
+
+ thisCache = cache[ id ];
+
+ // jQuery data() is stored in a separate object inside the object's internal data
+ // cache in order to avoid key collisions between internal data and user-defined
+ // data.
+ if ( !pvt ) {
+ if ( !thisCache.data ) {
+ thisCache.data = {};
+ }
+
+ thisCache = thisCache.data;
+ }
+
+ if ( data !== undefined ) {
+ thisCache[ jQuery.camelCase( name ) ] = data;
+ }
+
+ // Check for both converted-to-camel and non-converted data property names
+ // If a data property was specified
+ if ( getByName ) {
+
+ // First Try to find as-is property data
+ ret = thisCache[ name ];
+
+ // Test for null|undefined property data
+ if ( ret == null ) {
+
+ // Try to find the camelCased property
+ ret = thisCache[ jQuery.camelCase( name ) ];
+ }
+ } else {
+ ret = thisCache;
+ }
+
+ return ret;
+ },
+
+ removeData: function( elem, name, pvt /* Internal Use Only */ ) {
+ if ( !jQuery.acceptData( elem ) ) {
+ return;
+ }
+
+ var thisCache, i, l,
+
+ isNode = elem.nodeType,
+
+ // See jQuery.data for more information
+ cache = isNode ? jQuery.cache : elem,
+ id = isNode ? elem[ jQuery.expando ] : jQuery.expando;
+
+ // If there is already no cache entry for this object, there is no
+ // purpose in continuing
+ if ( !cache[ id ] ) {
+ return;
+ }
+
+ if ( name ) {
+
+ thisCache = pvt ? cache[ id ] : cache[ id ].data;
+
+ if ( thisCache ) {
+
+ // Support array or space separated string names for data keys
+ if ( !jQuery.isArray( name ) ) {
+
+ // try the string as a key before any manipulation
+ if ( name in thisCache ) {
+ name = [ name ];
+ } else {
+
+ // split the camel cased version by spaces unless a key with the spaces exists
+ name = jQuery.camelCase( name );
+ if ( name in thisCache ) {
+ name = [ name ];
+ } else {
+ name = name.split(" ");
+ }
+ }
+ }
+
+ for ( i = 0, l = name.length; i < l; i++ ) {
+ delete thisCache[ name[i] ];
+ }
+
+ // If there is no data left in the cache, we want to continue
+ // and let the cache object itself get destroyed
+ if ( !( pvt ? isEmptyDataObject : jQuery.isEmptyObject )( thisCache ) ) {
+ return;
+ }
+ }
+ }
+
+ // See jQuery.data for more information
+ if ( !pvt ) {
+ delete cache[ id ].data;
+
+ // Don't destroy the parent cache unless the internal data object
+ // had been the only thing left in it
+ if ( !isEmptyDataObject( cache[ id ] ) ) {
+ return;
+ }
+ }
+
+ // Destroy the cache
+ if ( isNode ) {
+ jQuery.cleanData( [ elem ], true );
+
+ // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080)
+ } else if ( jQuery.support.deleteExpando || cache != cache.window ) {
+ delete cache[ id ];
+
+ // When all else fails, null
+ } else {
+ cache[ id ] = null;
+ }
+ },
+
+ // For internal use only.
+ _data: function( elem, name, data ) {
+ return jQuery.data( elem, name, data, true );
+ },
+
+ // A method for determining if a DOM node can handle the data expando
+ acceptData: function( elem ) {
+ var noData = elem.nodeName && jQuery.noData[ elem.nodeName.toLowerCase() ];
+
+ // nodes accept data unless otherwise specified; rejection can be conditional
+ return !noData || noData !== true && elem.getAttribute("classid") === noData;
+ }
+});
+
+jQuery.fn.extend({
+ data: function( key, value ) {
+ var parts, part, attr, name, l,
+ elem = this[0],
+ i = 0,
+ data = null;
+
+ // Gets all values
+ if ( key === undefined ) {
+ if ( this.length ) {
+ data = jQuery.data( elem );
+
+ if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) {
+ attr = elem.attributes;
+ for ( l = attr.length; i < l; i++ ) {
+ name = attr[i].name;
+
+ if ( !name.indexOf( "data-" ) ) {
+ name = jQuery.camelCase( name.substring(5) );
+
+ dataAttr( elem, name, data[ name ] );
+ }
+ }
+ jQuery._data( elem, "parsedAttrs", true );
+ }
+ }
+
+ return data;
+ }
+
+ // Sets multiple values
+ if ( typeof key === "object" ) {
+ return this.each(function() {
+ jQuery.data( this, key );
+ });
+ }
+
+ parts = key.split( ".", 2 );
+ parts[1] = parts[1] ? "." + parts[1] : "";
+ part = parts[1] + "!";
+
+ return jQuery.access( this, function( value ) {
+
+ if ( value === undefined ) {
+ data = this.triggerHandler( "getData" + part, [ parts[0] ] );
+
+ // Try to fetch any internally stored data first
+ if ( data === undefined && elem ) {
+ data = jQuery.data( elem, key );
+ data = dataAttr( elem, key, data );
+ }
+
+ return data === undefined && parts[1] ?
+ this.data( parts[0] ) :
+ data;
+ }
+
+ parts[1] = value;
+ this.each(function() {
+ var self = jQuery( this );
+
+ self.triggerHandler( "setData" + part, parts );
+ jQuery.data( this, key, value );
+ self.triggerHandler( "changeData" + part, parts );
+ });
+ }, null, value, arguments.length > 1, null, false );
+ },
+
+ removeData: function( key ) {
+ return this.each(function() {
+ jQuery.removeData( this, key );
+ });
+ }
+});
+
+function dataAttr( elem, key, data ) {
+ // If nothing was found internally, try to fetch any
+ // data from the HTML5 data-* attribute
+ if ( data === undefined && elem.nodeType === 1 ) {
+
+ var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
+
+ data = elem.getAttribute( name );
+
+ if ( typeof data === "string" ) {
+ try {
+ data = data === "true" ? true :
+ data === "false" ? false :
+ data === "null" ? null :
+ // Only convert to a number if it doesn't change the string
+ +data + "" === data ? +data :
+ rbrace.test( data ) ? jQuery.parseJSON( data ) :
+ data;
+ } catch( e ) {}
+
+ // Make sure we set the data so it isn't changed later
+ jQuery.data( elem, key, data );
+
+ } else {
+ data = undefined;
+ }
+ }
+
+ return data;
+}
+
+// checks a cache object for emptiness
+function isEmptyDataObject( obj ) {
+ var name;
+ for ( name in obj ) {
+
+ // if the public data object is empty, the private is still empty
+ if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) {
+ continue;
+ }
+ if ( name !== "toJSON" ) {
+ return false;
+ }
+ }
+
+ return true;
+}
+jQuery.extend({
+ queue: function( elem, type, data ) {
+ var queue;
+
+ if ( elem ) {
+ type = ( type || "fx" ) + "queue";
+ queue = jQuery._data( elem, type );
+
+ // Speed up dequeue by getting out quickly if this is just a lookup
+ if ( data ) {
+ if ( !queue || jQuery.isArray(data) ) {
+ queue = jQuery._data( elem, type, jQuery.makeArray(data) );
+ } else {
+ queue.push( data );
+ }
+ }
+ return queue || [];
+ }
+ },
+
+ dequeue: function( elem, type ) {
+ type = type || "fx";
+
+ var queue = jQuery.queue( elem, type ),
+ startLength = queue.length,
+ fn = queue.shift(),
+ hooks = jQuery._queueHooks( elem, type ),
+ next = function() {
+ jQuery.dequeue( elem, type );
+ };
+
+ // If the fx queue is dequeued, always remove the progress sentinel
+ if ( fn === "inprogress" ) {
+ fn = queue.shift();
+ startLength--;
+ }
+
+ if ( fn ) {
+
+ // Add a progress sentinel to prevent the fx queue from being
+ // automatically dequeued
+ if ( type === "fx" ) {
+ queue.unshift( "inprogress" );
+ }
+
+ // clear up the last queue stop function
+ delete hooks.stop;
+ fn.call( elem, next, hooks );
+ }
+
+ if ( !startLength && hooks ) {
+ hooks.empty.fire();
+ }
+ },
+
+ // not intended for public consumption - generates a queueHooks object, or returns the current one
+ _queueHooks: function( elem, type ) {
+ var key = type + "queueHooks";
+ return jQuery._data( elem, key ) || jQuery._data( elem, key, {
+ empty: jQuery.Callbacks("once memory").add(function() {
+ jQuery.removeData( elem, type + "queue", true );
+ jQuery.removeData( elem, key, true );
+ })
+ });
+ }
+});
+
+jQuery.fn.extend({
+ queue: function( type, data ) {
+ var setter = 2;
+
+ if ( typeof type !== "string" ) {
+ data = type;
+ type = "fx";
+ setter--;
+ }
+
+ if ( arguments.length < setter ) {
+ return jQuery.queue( this[0], type );
+ }
+
+ return data === undefined ?
+ this :
+ this.each(function() {
+ var queue = jQuery.queue( this, type, data );
+
+ // ensure a hooks for this queue
+ jQuery._queueHooks( this, type );
+
+ if ( type === "fx" && queue[0] !== "inprogress" ) {
+ jQuery.dequeue( this, type );
+ }
+ });
+ },
+ dequeue: function( type ) {
+ return this.each(function() {
+ jQuery.dequeue( this, type );
+ });
+ },
+ // Based off of the plugin by Clint Helfers, with permission.
+ // http://blindsignals.com/index.php/2009/07/jquery-delay/
+ delay: function( time, type ) {
+ time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
+ type = type || "fx";
+
+ return this.queue( type, function( next, hooks ) {
+ var timeout = setTimeout( next, time );
+ hooks.stop = function() {
+ clearTimeout( timeout );
+ };
+ });
+ },
+ clearQueue: function( type ) {
+ return this.queue( type || "fx", [] );
+ },
+ // Get a promise resolved when queues of a certain type
+ // are emptied (fx is the type by default)
+ promise: function( type, obj ) {
+ var tmp,
+ count = 1,
+ defer = jQuery.Deferred(),
+ elements = this,
+ i = this.length,
+ resolve = function() {
+ if ( !( --count ) ) {
+ defer.resolveWith( elements, [ elements ] );
+ }
+ };
+
+ if ( typeof type !== "string" ) {
+ obj = type;
+ type = undefined;
+ }
+ type = type || "fx";
+
+ while( i-- ) {
+ tmp = jQuery._data( elements[ i ], type + "queueHooks" );
+ if ( tmp && tmp.empty ) {
+ count++;
+ tmp.empty.add( resolve );
+ }
+ }
+ resolve();
+ return defer.promise( obj );
+ }
+});
+var nodeHook, boolHook, fixSpecified,
+ rclass = /[\t\r\n]/g,
+ rreturn = /\r/g,
+ rtype = /^(?:button|input)$/i,
+ rfocusable = /^(?:button|input|object|select|textarea)$/i,
+ rclickable = /^a(?:rea|)$/i,
+ rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,
+ getSetAttribute = jQuery.support.getSetAttribute;
+
+jQuery.fn.extend({
+ attr: function( name, value ) {
+ return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 );
+ },
+
+ removeAttr: function( name ) {
+ return this.each(function() {
+ jQuery.removeAttr( this, name );
+ });
+ },
+
+ prop: function( name, value ) {
+ return jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 );
+ },
+
+ removeProp: function( name ) {
+ name = jQuery.propFix[ name ] || name;
+ return this.each(function() {
+ // try/catch handles cases where IE balks (such as removing a property on window)
+ try {
+ this[ name ] = undefined;
+ delete this[ name ];
+ } catch( e ) {}
+ });
+ },
+
+ addClass: function( value ) {
+ var classNames, i, l, elem,
+ setClass, c, cl;
+
+ if ( jQuery.isFunction( value ) ) {
+ return this.each(function( j ) {
+ jQuery( this ).addClass( value.call(this, j, this.className) );
+ });
+ }
+
+ if ( value && typeof value === "string" ) {
+ classNames = value.split( core_rspace );
+
+ for ( i = 0, l = this.length; i < l; i++ ) {
+ elem = this[ i ];
+
+ if ( elem.nodeType === 1 ) {
+ if ( !elem.className && classNames.length === 1 ) {
+ elem.className = value;
+
+ } else {
+ setClass = " " + elem.className + " ";
+
+ for ( c = 0, cl = classNames.length; c < cl; c++ ) {
+ if ( setClass.indexOf( " " + classNames[ c ] + " " ) < 0 ) {
+ setClass += classNames[ c ] + " ";
+ }
+ }
+ elem.className = jQuery.trim( setClass );
+ }
+ }
+ }
+ }
+
+ return this;
+ },
+
+ removeClass: function( value ) {
+ var removes, className, elem, c, cl, i, l;
+
+ if ( jQuery.isFunction( value ) ) {
+ return this.each(function( j ) {
+ jQuery( this ).removeClass( value.call(this, j, this.className) );
+ });
+ }
+ if ( (value && typeof value === "string") || value === undefined ) {
+ removes = ( value || "" ).split( core_rspace );
+
+ for ( i = 0, l = this.length; i < l; i++ ) {
+ elem = this[ i ];
+ if ( elem.nodeType === 1 && elem.className ) {
+
+ className = (" " + elem.className + " ").replace( rclass, " " );
+
+ // loop over each item in the removal list
+ for ( c = 0, cl = removes.length; c < cl; c++ ) {
+ // Remove until there is nothing to remove,
+ while ( className.indexOf(" " + removes[ c ] + " ") >= 0 ) {
+ className = className.replace( " " + removes[ c ] + " " , " " );
+ }
+ }
+ elem.className = value ? jQuery.trim( className ) : "";
+ }
+ }
+ }
+
+ return this;
+ },
+
+ toggleClass: function( value, stateVal ) {
+ var type = typeof value,
+ isBool = typeof stateVal === "boolean";
+
+ if ( jQuery.isFunction( value ) ) {
+ return this.each(function( i ) {
+ jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
+ });
+ }
+
+ return this.each(function() {
+ if ( type === "string" ) {
+ // toggle individual class names
+ var className,
+ i = 0,
+ self = jQuery( this ),
+ state = stateVal,
+ classNames = value.split( core_rspace );
+
+ while ( (className = classNames[ i++ ]) ) {
+ // check each className given, space separated list
+ state = isBool ? state : !self.hasClass( className );
+ self[ state ? "addClass" : "removeClass" ]( className );
+ }
+
+ } else if ( type === "undefined" || type === "boolean" ) {
+ if ( this.className ) {
+ // store className if set
+ jQuery._data( this, "__className__", this.className );
+ }
+
+ // toggle whole className
+ this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || "";
+ }
+ });
+ },
+
+ hasClass: function( selector ) {
+ var className = " " + selector + " ",
+ i = 0,
+ l = this.length;
+ for ( ; i < l; i++ ) {
+ if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) {
+ return true;
+ }
+ }
+
+ return false;
+ },
+
+ val: function( value ) {
+ var hooks, ret, isFunction,
+ elem = this[0];
+
+ if ( !arguments.length ) {
+ if ( elem ) {
+ hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];
+
+ if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
+ return ret;
+ }
+
+ ret = elem.value;
+
+ return typeof ret === "string" ?
+ // handle most common string cases
+ ret.replace(rreturn, "") :
+ // handle cases where value is null/undef or number
+ ret == null ? "" : ret;
+ }
+
+ return;
+ }
+
+ isFunction = jQuery.isFunction( value );
+
+ return this.each(function( i ) {
+ var val,
+ self = jQuery(this);
+
+ if ( this.nodeType !== 1 ) {
+ return;
+ }
+
+ if ( isFunction ) {
+ val = value.call( this, i, self.val() );
+ } else {
+ val = value;
+ }
+
+ // Treat null/undefined as ""; convert numbers to string
+ if ( val == null ) {
+ val = "";
+ } else if ( typeof val === "number" ) {
+ val += "";
+ } else if ( jQuery.isArray( val ) ) {
+ val = jQuery.map(val, function ( value ) {
+ return value == null ? "" : value + "";
+ });
+ }
+
+ hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
+
+ // If set returns undefined, fall back to normal setting
+ if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
+ this.value = val;
+ }
+ });
+ }
+});
+
+jQuery.extend({
+ valHooks: {
+ option: {
+ get: function( elem ) {
+ // attributes.value is undefined in Blackberry 4.7 but
+ // uses .value. See #6932
+ var val = elem.attributes.value;
+ return !val || val.specified ? elem.value : elem.text;
+ }
+ },
+ select: {
+ get: function( elem ) {
+ var value, i, max, option,
+ index = elem.selectedIndex,
+ values = [],
+ options = elem.options,
+ one = elem.type === "select-one";
+
+ // Nothing was selected
+ if ( index < 0 ) {
+ return null;
+ }
+
+ // Loop through all the selected options
+ i = one ? index : 0;
+ max = one ? index + 1 : options.length;
+ for ( ; i < max; i++ ) {
+ option = options[ i ];
+
+ // Don't return options that are disabled or in a disabled optgroup
+ if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) &&
+ (!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) {
+
+ // Get the specific value for the option
+ value = jQuery( option ).val();
+
+ // We don't need an array for one selects
+ if ( one ) {
+ return value;
+ }
+
+ // Multi-Selects return an array
+ values.push( value );
+ }
+ }
+
+ // Fixes Bug #2551 -- select.val() broken in IE after form.reset()
+ if ( one && !values.length && options.length ) {
+ return jQuery( options[ index ] ).val();
+ }
+
+ return values;
+ },
+
+ set: function( elem, value ) {
+ var values = jQuery.makeArray( value );
+
+ jQuery(elem).find("option").each(function() {
+ this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0;
+ });
+
+ if ( !values.length ) {
+ elem.selectedIndex = -1;
+ }
+ return values;
+ }
+ }
+ },
+
+ // Unused in 1.8, left in so attrFn-stabbers won't die; remove in 1.9
+ attrFn: {},
+
+ attr: function( elem, name, value, pass ) {
+ var ret, hooks, notxml,
+ nType = elem.nodeType;
+
+ // don't get/set attributes on text, comment and attribute nodes
+ if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
+ return;
+ }
+
+ if ( pass && jQuery.isFunction( jQuery.fn[ name ] ) ) {
+ return jQuery( elem )[ name ]( value );
+ }
+
+ // Fallback to prop when attributes are not supported
+ if ( typeof elem.getAttribute === "undefined" ) {
+ return jQuery.prop( elem, name, value );
+ }
+
+ notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
+
+ // All attributes are lowercase
+ // Grab necessary hook if one is defined
+ if ( notxml ) {
+ name = name.toLowerCase();
+ hooks = jQuery.attrHooks[ name ] || ( rboolean.test( name ) ? boolHook : nodeHook );
+ }
+
+ if ( value !== undefined ) {
+
+ if ( value === null ) {
+ jQuery.removeAttr( elem, name );
+ return;
+
+ } else if ( hooks && "set" in hooks && notxml && (ret = hooks.set( elem, value, name )) !== undefined ) {
+ return ret;
+
+ } else {
+ elem.setAttribute( name, value + "" );
+ return value;
+ }
+
+ } else if ( hooks && "get" in hooks && notxml && (ret = hooks.get( elem, name )) !== null ) {
+ return ret;
+
+ } else {
+
+ ret = elem.getAttribute( name );
+
+ // Non-existent attributes return null, we normalize to undefined
+ return ret === null ?
+ undefined :
+ ret;
+ }
+ },
+
+ removeAttr: function( elem, value ) {
+ var propName, attrNames, name, isBool,
+ i = 0;
+
+ if ( value && elem.nodeType === 1 ) {
+
+ attrNames = value.split( core_rspace );
+
+ for ( ; i < attrNames.length; i++ ) {
+ name = attrNames[ i ];
+
+ if ( name ) {
+ propName = jQuery.propFix[ name ] || name;
+ isBool = rboolean.test( name );
+
+ // See #9699 for explanation of this approach (setting first, then removal)
+ // Do not do this for boolean attributes (see #10870)
+ if ( !isBool ) {
+ jQuery.attr( elem, name, "" );
+ }
+ elem.removeAttribute( getSetAttribute ? name : propName );
+
+ // Set corresponding property to false for boolean attributes
+ if ( isBool && propName in elem ) {
+ elem[ propName ] = false;
+ }
+ }
+ }
+ }
+ },
+
+ attrHooks: {
+ type: {
+ set: function( elem, value ) {
+ // We can't allow the type property to be changed (since it causes problems in IE)
+ if ( rtype.test( elem.nodeName ) && elem.parentNode ) {
+ jQuery.error( "type property can't be changed" );
+ } else if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) {
+ // Setting the type on a radio button after the value resets the value in IE6-9
+ // Reset value to it's default in case type is set after value
+ // This is for element creation
+ var val = elem.value;
+ elem.setAttribute( "type", value );
+ if ( val ) {
+ elem.value = val;
+ }
+ return value;
+ }
+ }
+ },
+ // Use the value property for back compat
+ // Use the nodeHook for button elements in IE6/7 (#1954)
+ value: {
+ get: function( elem, name ) {
+ if ( nodeHook && jQuery.nodeName( elem, "button" ) ) {
+ return nodeHook.get( elem, name );
+ }
+ return name in elem ?
+ elem.value :
+ null;
+ },
+ set: function( elem, value, name ) {
+ if ( nodeHook && jQuery.nodeName( elem, "button" ) ) {
+ return nodeHook.set( elem, value, name );
+ }
+ // Does not return so that setAttribute is also used
+ elem.value = value;
+ }
+ }
+ },
+
+ propFix: {
+ tabindex: "tabIndex",
+ readonly: "readOnly",
+ "for": "htmlFor",
+ "class": "className",
+ maxlength: "maxLength",
+ cellspacing: "cellSpacing",
+ cellpadding: "cellPadding",
+ rowspan: "rowSpan",
+ colspan: "colSpan",
+ usemap: "useMap",
+ frameborder: "frameBorder",
+ contenteditable: "contentEditable"
+ },
+
+ prop: function( elem, name, value ) {
+ var ret, hooks, notxml,
+ nType = elem.nodeType;
+
+ // don't get/set properties on text, comment and attribute nodes
+ if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
+ return;
+ }
+
+ notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
+
+ if ( notxml ) {
+ // Fix name and attach hooks
+ name = jQuery.propFix[ name ] || name;
+ hooks = jQuery.propHooks[ name ];
+ }
+
+ if ( value !== undefined ) {
+ if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
+ return ret;
+
+ } else {
+ return ( elem[ name ] = value );
+ }
+
+ } else {
+ if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
+ return ret;
+
+ } else {
+ return elem[ name ];
+ }
+ }
+ },
+
+ propHooks: {
+ tabIndex: {
+ get: function( elem ) {
+ // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
+ // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
+ var attributeNode = elem.getAttributeNode("tabindex");
+
+ return attributeNode && attributeNode.specified ?
+ parseInt( attributeNode.value, 10 ) :
+ rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
+ 0 :
+ undefined;
+ }
+ }
+ }
+});
+
+// Hook for boolean attributes
+boolHook = {
+ get: function( elem, name ) {
+ // Align boolean attributes with corresponding properties
+ // Fall back to attribute presence where some booleans are not supported
+ var attrNode,
+ property = jQuery.prop( elem, name );
+ return property === true || typeof property !== "boolean" && ( attrNode = elem.getAttributeNode(name) ) && attrNode.nodeValue !== false ?
+ name.toLowerCase() :
+ undefined;
+ },
+ set: function( elem, value, name ) {
+ var propName;
+ if ( value === false ) {
+ // Remove boolean attributes when set to false
+ jQuery.removeAttr( elem, name );
+ } else {
+ // value is true since we know at this point it's type boolean and not false
+ // Set boolean attributes to the same name and set the DOM property
+ propName = jQuery.propFix[ name ] || name;
+ if ( propName in elem ) {
+ // Only set the IDL specifically if it already exists on the element
+ elem[ propName ] = true;
+ }
+
+ elem.setAttribute( name, name.toLowerCase() );
+ }
+ return name;
+ }
+};
+
+// IE6/7 do not support getting/setting some attributes with get/setAttribute
+if ( !getSetAttribute ) {
+
+ fixSpecified = {
+ name: true,
+ id: true,
+ coords: true
+ };
+
+ // Use this for any attribute in IE6/7
+ // This fixes almost every IE6/7 issue
+ nodeHook = jQuery.valHooks.button = {
+ get: function( elem, name ) {
+ var ret;
+ ret = elem.getAttributeNode( name );
+ return ret && ( fixSpecified[ name ] ? ret.value !== "" : ret.specified ) ?
+ ret.value :
+ undefined;
+ },
+ set: function( elem, value, name ) {
+ // Set the existing or create a new attribute node
+ var ret = elem.getAttributeNode( name );
+ if ( !ret ) {
+ ret = document.createAttribute( name );
+ elem.setAttributeNode( ret );
+ }
+ return ( ret.value = value + "" );
+ }
+ };
+
+ // Set width and height to auto instead of 0 on empty string( Bug #8150 )
+ // This is for removals
+ jQuery.each([ "width", "height" ], function( i, name ) {
+ jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
+ set: function( elem, value ) {
+ if ( value === "" ) {
+ elem.setAttribute( name, "auto" );
+ return value;
+ }
+ }
+ });
+ });
+
+ // Set contenteditable to false on removals(#10429)
+ // Setting to empty string throws an error as an invalid value
+ jQuery.attrHooks.contenteditable = {
+ get: nodeHook.get,
+ set: function( elem, value, name ) {
+ if ( value === "" ) {
+ value = "false";
+ }
+ nodeHook.set( elem, value, name );
+ }
+ };
+}
+
+
+// Some attributes require a special call on IE
+if ( !jQuery.support.hrefNormalized ) {
+ jQuery.each([ "href", "src", "width", "height" ], function( i, name ) {
+ jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
+ get: function( elem ) {
+ var ret = elem.getAttribute( name, 2 );
+ return ret === null ? undefined : ret;
+ }
+ });
+ });
+}
+
+if ( !jQuery.support.style ) {
+ jQuery.attrHooks.style = {
+ get: function( elem ) {
+ // Return undefined in the case of empty string
+ // Normalize to lowercase since IE uppercases css property names
+ return elem.style.cssText.toLowerCase() || undefined;
+ },
+ set: function( elem, value ) {
+ return ( elem.style.cssText = value + "" );
+ }
+ };
+}
+
+// Safari mis-reports the default selected property of an option
+// Accessing the parent's selectedIndex property fixes it
+if ( !jQuery.support.optSelected ) {
+ jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, {
+ get: function( elem ) {
+ var parent = elem.parentNode;
+
+ if ( parent ) {
+ parent.selectedIndex;
+
+ // Make sure that it also works with optgroups, see #5701
+ if ( parent.parentNode ) {
+ parent.parentNode.selectedIndex;
+ }
+ }
+ return null;
+ }
+ });
+}
+
+// IE6/7 call enctype encoding
+if ( !jQuery.support.enctype ) {
+ jQuery.propFix.enctype = "encoding";
+}
+
+// Radios and checkboxes getter/setter
+if ( !jQuery.support.checkOn ) {
+ jQuery.each([ "radio", "checkbox" ], function() {
+ jQuery.valHooks[ this ] = {
+ get: function( elem ) {
+ // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified
+ return elem.getAttribute("value") === null ? "on" : elem.value;
+ }
+ };
+ });
+}
+jQuery.each([ "radio", "checkbox" ], function() {
+ jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], {
+ set: function( elem, value ) {
+ if ( jQuery.isArray( value ) ) {
+ return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );
+ }
+ }
+ });
+});
+var rformElems = /^(?:textarea|input|select)$/i,
+ rtypenamespace = /^([^\.]*|)(?:\.(.+)|)$/,
+ rhoverHack = /(?:^|\s)hover(\.\S+|)\b/,
+ rkeyEvent = /^key/,
+ rmouseEvent = /^(?:mouse|contextmenu)|click/,
+ rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
+ hoverHack = function( events ) {
+ return jQuery.event.special.hover ? events : events.replace( rhoverHack, "mouseenter$1 mouseleave$1" );
+ };
+
+/*
+ * Helper functions for managing events -- not part of the public interface.
+ * Props to Dean Edwards' addEvent library for many of the ideas.
+ */
+jQuery.event = {
+
+ add: function( elem, types, handler, data, selector ) {
+
+ var elemData, eventHandle, events,
+ t, tns, type, namespaces, handleObj,
+ handleObjIn, handlers, special;
+
+ // Don't attach events to noData or text/comment nodes (allow plain objects tho)
+ if ( elem.nodeType === 3 || elem.nodeType === 8 || !types || !handler || !(elemData = jQuery._data( elem )) ) {
+ return;
+ }
+
+ // Caller can pass in an object of custom data in lieu of the handler
+ if ( handler.handler ) {
+ handleObjIn = handler;
+ handler = handleObjIn.handler;
+ selector = handleObjIn.selector;
+ }
+
+ // Make sure that the handler has a unique ID, used to find/remove it later
+ if ( !handler.guid ) {
+ handler.guid = jQuery.guid++;
+ }
+
+ // Init the element's event structure and main handler, if this is the first
+ events = elemData.events;
+ if ( !events ) {
+ elemData.events = events = {};
+ }
+ eventHandle = elemData.handle;
+ if ( !eventHandle ) {
+ elemData.handle = eventHandle = function( e ) {
+ // Discard the second event of a jQuery.event.trigger() and
+ // when an event is called after a page has unloaded
+ return typeof jQuery !== "undefined" && (!e || jQuery.event.triggered !== e.type) ?
+ jQuery.event.dispatch.apply( eventHandle.elem, arguments ) :
+ undefined;
+ };
+ // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events
+ eventHandle.elem = elem;
+ }
+
+ // Handle multiple events separated by a space
+ // jQuery(...).bind("mouseover mouseout", fn);
+ types = jQuery.trim( hoverHack(types) ).split( " " );
+ for ( t = 0; t < types.length; t++ ) {
+
+ tns = rtypenamespace.exec( types[t] ) || [];
+ type = tns[1];
+ namespaces = ( tns[2] || "" ).split( "." ).sort();
+
+ // If event changes its type, use the special event handlers for the changed type
+ special = jQuery.event.special[ type ] || {};
+
+ // If selector defined, determine special event api type, otherwise given type
+ type = ( selector ? special.delegateType : special.bindType ) || type;
+
+ // Update special based on newly reset type
+ special = jQuery.event.special[ type ] || {};
+
+ // handleObj is passed to all event handlers
+ handleObj = jQuery.extend({
+ type: type,
+ origType: tns[1],
+ data: data,
+ handler: handler,
+ guid: handler.guid,
+ selector: selector,
+ needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
+ namespace: namespaces.join(".")
+ }, handleObjIn );
+
+ // Init the event handler queue if we're the first
+ handlers = events[ type ];
+ if ( !handlers ) {
+ handlers = events[ type ] = [];
+ handlers.delegateCount = 0;
+
+ // Only use addEventListener/attachEvent if the special events handler returns false
+ if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
+ // Bind the global event handler to the element
+ if ( elem.addEventListener ) {
+ elem.addEventListener( type, eventHandle, false );
+
+ } else if ( elem.attachEvent ) {
+ elem.attachEvent( "on" + type, eventHandle );
+ }
+ }
+ }
+
+ if ( special.add ) {
+ special.add.call( elem, handleObj );
+
+ if ( !handleObj.handler.guid ) {
+ handleObj.handler.guid = handler.guid;
+ }
+ }
+
+ // Add to the element's handler list, delegates in front
+ if ( selector ) {
+ handlers.splice( handlers.delegateCount++, 0, handleObj );
+ } else {
+ handlers.push( handleObj );
+ }
+
+ // Keep track of which events have ever been used, for event optimization
+ jQuery.event.global[ type ] = true;
+ }
+
+ // Nullify elem to prevent memory leaks in IE
+ elem = null;
+ },
+
+ global: {},
+
+ // Detach an event or set of events from an element
+ remove: function( elem, types, handler, selector, mappedTypes ) {
+
+ var t, tns, type, origType, namespaces, origCount,
+ j, events, special, eventType, handleObj,
+ elemData = jQuery.hasData( elem ) && jQuery._data( elem );
+
+ if ( !elemData || !(events = elemData.events) ) {
+ return;
+ }
+
+ // Once for each type.namespace in types; type may be omitted
+ types = jQuery.trim( hoverHack( types || "" ) ).split(" ");
+ for ( t = 0; t < types.length; t++ ) {
+ tns = rtypenamespace.exec( types[t] ) || [];
+ type = origType = tns[1];
+ namespaces = tns[2];
+
+ // Unbind all events (on this namespace, if provided) for the element
+ if ( !type ) {
+ for ( type in events ) {
+ jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
+ }
+ continue;
+ }
+
+ special = jQuery.event.special[ type ] || {};
+ type = ( selector? special.delegateType : special.bindType ) || type;
+ eventType = events[ type ] || [];
+ origCount = eventType.length;
+ namespaces = namespaces ? new RegExp("(^|\\.)" + namespaces.split(".").sort().join("\\.(?:.*\\.|)") + "(\\.|$)") : null;
+
+ // Remove matching events
+ for ( j = 0; j < eventType.length; j++ ) {
+ handleObj = eventType[ j ];
+
+ if ( ( mappedTypes || origType === handleObj.origType ) &&
+ ( !handler || handler.guid === handleObj.guid ) &&
+ ( !namespaces || namespaces.test( handleObj.namespace ) ) &&
+ ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
+ eventType.splice( j--, 1 );
+
+ if ( handleObj.selector ) {
+ eventType.delegateCount--;
+ }
+ if ( special.remove ) {
+ special.remove.call( elem, handleObj );
+ }
+ }
+ }
+
+ // Remove generic event handler if we removed something and no more handlers exist
+ // (avoids potential for endless recursion during removal of special event handlers)
+ if ( eventType.length === 0 && origCount !== eventType.length ) {
+ if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
+ jQuery.removeEvent( elem, type, elemData.handle );
+ }
+
+ delete events[ type ];
+ }
+ }
+
+ // Remove the expando if it's no longer used
+ if ( jQuery.isEmptyObject( events ) ) {
+ delete elemData.handle;
+
+ // removeData also checks for emptiness and clears the expando if empty
+ // so use it instead of delete
+ jQuery.removeData( elem, "events", true );
+ }
+ },
+
+ // Events that are safe to short-circuit if no handlers are attached.
+ // Native DOM events should not be added, they may have inline handlers.
+ customEvent: {
+ "getData": true,
+ "setData": true,
+ "changeData": true
+ },
+
+ trigger: function( event, data, elem, onlyHandlers ) {
+ // Don't do events on text and comment nodes
+ if ( elem && (elem.nodeType === 3 || elem.nodeType === 8) ) {
+ return;
+ }
+
+ // Event object or event type
+ var cache, exclusive, i, cur, old, ontype, special, handle, eventPath, bubbleType,
+ type = event.type || event,
+ namespaces = [];
+
+ // focus/blur morphs to focusin/out; ensure we're not firing them right now
+ if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
+ return;
+ }
+
+ if ( type.indexOf( "!" ) >= 0 ) {
+ // Exclusive events trigger only for the exact event (no namespaces)
+ type = type.slice(0, -1);
+ exclusive = true;
+ }
+
+ if ( type.indexOf( "." ) >= 0 ) {
+ // Namespaced trigger; create a regexp to match event type in handle()
+ namespaces = type.split(".");
+ type = namespaces.shift();
+ namespaces.sort();
+ }
+
+ if ( (!elem || jQuery.event.customEvent[ type ]) && !jQuery.event.global[ type ] ) {
+ // No jQuery handlers for this event type, and it can't have inline handlers
+ return;
+ }
+
+ // Caller can pass in an Event, Object, or just an event type string
+ event = typeof event === "object" ?
+ // jQuery.Event object
+ event[ jQuery.expando ] ? event :
+ // Object literal
+ new jQuery.Event( type, event ) :
+ // Just the event type (string)
+ new jQuery.Event( type );
+
+ event.type = type;
+ event.isTrigger = true;
+ event.exclusive = exclusive;
+ event.namespace = namespaces.join( "." );
+ event.namespace_re = event.namespace? new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)") : null;
+ ontype = type.indexOf( ":" ) < 0 ? "on" + type : "";
+
+ // Handle a global trigger
+ if ( !elem ) {
+
+ // TODO: Stop taunting the data cache; remove global events and always attach to document
+ cache = jQuery.cache;
+ for ( i in cache ) {
+ if ( cache[ i ].events && cache[ i ].events[ type ] ) {
+ jQuery.event.trigger( event, data, cache[ i ].handle.elem, true );
+ }
+ }
+ return;
+ }
+
+ // Clean up the event in case it is being reused
+ event.result = undefined;
+ if ( !event.target ) {
+ event.target = elem;
+ }
+
+ // Clone any incoming data and prepend the event, creating the handler arg list
+ data = data != null ? jQuery.makeArray( data ) : [];
+ data.unshift( event );
+
+ // Allow special events to draw outside the lines
+ special = jQuery.event.special[ type ] || {};
+ if ( special.trigger && special.trigger.apply( elem, data ) === false ) {
+ return;
+ }
+
+ // Determine event propagation path in advance, per W3C events spec (#9951)
+ // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
+ eventPath = [[ elem, special.bindType || type ]];
+ if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
+
+ bubbleType = special.delegateType || type;
+ cur = rfocusMorph.test( bubbleType + type ) ? elem : elem.parentNode;
+ for ( old = elem; cur; cur = cur.parentNode ) {
+ eventPath.push([ cur, bubbleType ]);
+ old = cur;
+ }
+
+ // Only add window if we got to document (e.g., not plain obj or detached DOM)
+ if ( old === (elem.ownerDocument || document) ) {
+ eventPath.push([ old.defaultView || old.parentWindow || window, bubbleType ]);
+ }
+ }
+
+ // Fire handlers on the event path
+ for ( i = 0; i < eventPath.length && !event.isPropagationStopped(); i++ ) {
+
+ cur = eventPath[i][0];
+ event.type = eventPath[i][1];
+
+ handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" );
+ if ( handle ) {
+ handle.apply( cur, data );
+ }
+ // Note that this is a bare JS function and not a jQuery handler
+ handle = ontype && cur[ ontype ];
+ if ( handle && jQuery.acceptData( cur ) && handle.apply && handle.apply( cur, data ) === false ) {
+ event.preventDefault();
+ }
+ }
+ event.type = type;
+
+ // If nobody prevented the default action, do it now
+ if ( !onlyHandlers && !event.isDefaultPrevented() ) {
+
+ if ( (!special._default || special._default.apply( elem.ownerDocument, data ) === false) &&
+ !(type === "click" && jQuery.nodeName( elem, "a" )) && jQuery.acceptData( elem ) ) {
+
+ // Call a native DOM method on the target with the same name name as the event.
+ // Can't use an .isFunction() check here because IE6/7 fails that test.
+ // Don't do default actions on window, that's where global variables be (#6170)
+ // IE<9 dies on focus/blur to hidden element (#1486)
+ if ( ontype && elem[ type ] && ((type !== "focus" && type !== "blur") || event.target.offsetWidth !== 0) && !jQuery.isWindow( elem ) ) {
+
+ // Don't re-trigger an onFOO event when we call its FOO() method
+ old = elem[ ontype ];
+
+ if ( old ) {
+ elem[ ontype ] = null;
+ }
+
+ // Prevent re-triggering of the same event, since we already bubbled it above
+ jQuery.event.triggered = type;
+ elem[ type ]();
+ jQuery.event.triggered = undefined;
+
+ if ( old ) {
+ elem[ ontype ] = old;
+ }
+ }
+ }
+ }
+
+ return event.result;
+ },
+
+ dispatch: function( event ) {
+
+ // Make a writable jQuery.Event from the native event object
+ event = jQuery.event.fix( event || window.event );
+
+ var i, j, cur, ret, selMatch, matched, matches, handleObj, sel, related,
+ handlers = ( (jQuery._data( this, "events" ) || {} )[ event.type ] || []),
+ delegateCount = handlers.delegateCount,
+ args = core_slice.call( arguments ),
+ run_all = !event.exclusive && !event.namespace,
+ special = jQuery.event.special[ event.type ] || {},
+ handlerQueue = [];
+
+ // Use the fix-ed jQuery.Event rather than the (read-only) native event
+ args[0] = event;
+ event.delegateTarget = this;
+
+ // Call the preDispatch hook for the mapped type, and let it bail if desired
+ if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
+ return;
+ }
+
+ // Determine handlers that should run if there are delegated events
+ // Avoid non-left-click bubbling in Firefox (#3861)
+ if ( delegateCount && !(event.button && event.type === "click") ) {
+
+ for ( cur = event.target; cur != this; cur = cur.parentNode || this ) {
+
+ // Don't process clicks (ONLY) on disabled elements (#6911, #8165, #11382, #11764)
+ if ( cur.disabled !== true || event.type !== "click" ) {
+ selMatch = {};
+ matches = [];
+ for ( i = 0; i < delegateCount; i++ ) {
+ handleObj = handlers[ i ];
+ sel = handleObj.selector;
+
+ if ( selMatch[ sel ] === undefined ) {
+ selMatch[ sel ] = handleObj.needsContext ?
+ jQuery( sel, this ).index( cur ) >= 0 :
+ jQuery.find( sel, this, null, [ cur ] ).length;
+ }
+ if ( selMatch[ sel ] ) {
+ matches.push( handleObj );
+ }
+ }
+ if ( matches.length ) {
+ handlerQueue.push({ elem: cur, matches: matches });
+ }
+ }
+ }
+ }
+
+ // Add the remaining (directly-bound) handlers
+ if ( handlers.length > delegateCount ) {
+ handlerQueue.push({ elem: this, matches: handlers.slice( delegateCount ) });
+ }
+
+ // Run delegates first; they may want to stop propagation beneath us
+ for ( i = 0; i < handlerQueue.length && !event.isPropagationStopped(); i++ ) {
+ matched = handlerQueue[ i ];
+ event.currentTarget = matched.elem;
+
+ for ( j = 0; j < matched.matches.length && !event.isImmediatePropagationStopped(); j++ ) {
+ handleObj = matched.matches[ j ];
+
+ // Triggered event must either 1) be non-exclusive and have no namespace, or
+ // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace).
+ if ( run_all || (!event.namespace && !handleObj.namespace) || event.namespace_re && event.namespace_re.test( handleObj.namespace ) ) {
+
+ event.data = handleObj.data;
+ event.handleObj = handleObj;
+
+ ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler )
+ .apply( matched.elem, args );
+
+ if ( ret !== undefined ) {
+ event.result = ret;
+ if ( ret === false ) {
+ event.preventDefault();
+ event.stopPropagation();
+ }
+ }
+ }
+ }
+ }
+
+ // Call the postDispatch hook for the mapped type
+ if ( special.postDispatch ) {
+ special.postDispatch.call( this, event );
+ }
+
+ return event.result;
+ },
+
+ // Includes some event props shared by KeyEvent and MouseEvent
+ // *** attrChange attrName relatedNode srcElement are not normalized, non-W3C, deprecated, will be removed in 1.8 ***
+ props: "attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
+
+ fixHooks: {},
+
+ keyHooks: {
+ props: "char charCode key keyCode".split(" "),
+ filter: function( event, original ) {
+
+ // Add which for key events
+ if ( event.which == null ) {
+ event.which = original.charCode != null ? original.charCode : original.keyCode;
+ }
+
+ return event;
+ }
+ },
+
+ mouseHooks: {
+ props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
+ filter: function( event, original ) {
+ var eventDoc, doc, body,
+ button = original.button,
+ fromElement = original.fromElement;
+
+ // Calculate pageX/Y if missing and clientX/Y available
+ if ( event.pageX == null && original.clientX != null ) {
+ eventDoc = event.target.ownerDocument || document;
+ doc = eventDoc.documentElement;
+ body = eventDoc.body;
+
+ event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 );
+ event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 );
+ }
+
+ // Add relatedTarget, if necessary
+ if ( !event.relatedTarget && fromElement ) {
+ event.relatedTarget = fromElement === event.target ? original.toElement : fromElement;
+ }
+
+ // Add which for click: 1 === left; 2 === middle; 3 === right
+ // Note: button is not normalized, so don't use it
+ if ( !event.which && button !== undefined ) {
+ event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );
+ }
+
+ return event;
+ }
+ },
+
+ fix: function( event ) {
+ if ( event[ jQuery.expando ] ) {
+ return event;
+ }
+
+ // Create a writable copy of the event object and normalize some properties
+ var i, prop,
+ originalEvent = event,
+ fixHook = jQuery.event.fixHooks[ event.type ] || {},
+ copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;
+
+ event = jQuery.Event( originalEvent );
+
+ for ( i = copy.length; i; ) {
+ prop = copy[ --i ];
+ event[ prop ] = originalEvent[ prop ];
+ }
+
+ // Fix target property, if necessary (#1925, IE 6/7/8 & Safari2)
+ if ( !event.target ) {
+ event.target = originalEvent.srcElement || document;
+ }
+
+ // Target should not be a text node (#504, Safari)
+ if ( event.target.nodeType === 3 ) {
+ event.target = event.target.parentNode;
+ }
+
+ // For mouse/key events, metaKey==false if it's undefined (#3368, #11328; IE6/7/8)
+ event.metaKey = !!event.metaKey;
+
+ return fixHook.filter? fixHook.filter( event, originalEvent ) : event;
+ },
+
+ special: {
+ load: {
+ // Prevent triggered image.load events from bubbling to window.load
+ noBubble: true
+ },
+
+ focus: {
+ delegateType: "focusin"
+ },
+ blur: {
+ delegateType: "focusout"
+ },
+
+ beforeunload: {
+ setup: function( data, namespaces, eventHandle ) {
+ // We only want to do this special case on windows
+ if ( jQuery.isWindow( this ) ) {
+ this.onbeforeunload = eventHandle;
+ }
+ },
+
+ teardown: function( namespaces, eventHandle ) {
+ if ( this.onbeforeunload === eventHandle ) {
+ this.onbeforeunload = null;
+ }
+ }
+ }
+ },
+
+ simulate: function( type, elem, event, bubble ) {
+ // Piggyback on a donor event to simulate a different one.
+ // Fake originalEvent to avoid donor's stopPropagation, but if the
+ // simulated event prevents default then we do the same on the donor.
+ var e = jQuery.extend(
+ new jQuery.Event(),
+ event,
+ { type: type,
+ isSimulated: true,
+ originalEvent: {}
+ }
+ );
+ if ( bubble ) {
+ jQuery.event.trigger( e, null, elem );
+ } else {
+ jQuery.event.dispatch.call( elem, e );
+ }
+ if ( e.isDefaultPrevented() ) {
+ event.preventDefault();
+ }
+ }
+};
+
+// Some plugins are using, but it's undocumented/deprecated and will be removed.
+// The 1.7 special event interface should provide all the hooks needed now.
+jQuery.event.handle = jQuery.event.dispatch;
+
+jQuery.removeEvent = document.removeEventListener ?
+ function( elem, type, handle ) {
+ if ( elem.removeEventListener ) {
+ elem.removeEventListener( type, handle, false );
+ }
+ } :
+ function( elem, type, handle ) {
+ var name = "on" + type;
+
+ if ( elem.detachEvent ) {
+
+ // #8545, #7054, preventing memory leaks for custom events in IE6-8 –
+ // detachEvent needed property on element, by name of that event, to properly expose it to GC
+ if ( typeof elem[ name ] === "undefined" ) {
+ elem[ name ] = null;
+ }
+
+ elem.detachEvent( name, handle );
+ }
+ };
+
+jQuery.Event = function( src, props ) {
+ // Allow instantiation without the 'new' keyword
+ if ( !(this instanceof jQuery.Event) ) {
+ return new jQuery.Event( src, props );
+ }
+
+ // Event object
+ if ( src && src.type ) {
+ this.originalEvent = src;
+ this.type = src.type;
+
+ // Events bubbling up the document may have been marked as prevented
+ // by a handler lower down the tree; reflect the correct value.
+ this.isDefaultPrevented = ( src.defaultPrevented || src.returnValue === false ||
+ src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse;
+
+ // Event type
+ } else {
+ this.type = src;
+ }
+
+ // Put explicitly provided properties onto the event object
+ if ( props ) {
+ jQuery.extend( this, props );
+ }
+
+ // Create a timestamp if incoming event doesn't have one
+ this.timeStamp = src && src.timeStamp || jQuery.now();
+
+ // Mark it as fixed
+ this[ jQuery.expando ] = true;
+};
+
+function returnFalse() {
+ return false;
+}
+function returnTrue() {
+ return true;
+}
+
+// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
+// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
+jQuery.Event.prototype = {
+ preventDefault: function() {
+ this.isDefaultPrevented = returnTrue;
+
+ var e = this.originalEvent;
+ if ( !e ) {
+ return;
+ }
+
+ // if preventDefault exists run it on the original event
+ if ( e.preventDefault ) {
+ e.preventDefault();
+
+ // otherwise set the returnValue property of the original event to false (IE)
+ } else {
+ e.returnValue = false;
+ }
+ },
+ stopPropagation: function() {
+ this.isPropagationStopped = returnTrue;
+
+ var e = this.originalEvent;
+ if ( !e ) {
+ return;
+ }
+ // if stopPropagation exists run it on the original event
+ if ( e.stopPropagation ) {
+ e.stopPropagation();
+ }
+ // otherwise set the cancelBubble property of the original event to true (IE)
+ e.cancelBubble = true;
+ },
+ stopImmediatePropagation: function() {
+ this.isImmediatePropagationStopped = returnTrue;
+ this.stopPropagation();
+ },
+ isDefaultPrevented: returnFalse,
+ isPropagationStopped: returnFalse,
+ isImmediatePropagationStopped: returnFalse
+};
+
+// Create mouseenter/leave events using mouseover/out and event-time checks
+jQuery.each({
+ mouseenter: "mouseover",
+ mouseleave: "mouseout"
+}, function( orig, fix ) {
+ jQuery.event.special[ orig ] = {
+ delegateType: fix,
+ bindType: fix,
+
+ handle: function( event ) {
+ var ret,
+ target = this,
+ related = event.relatedTarget,
+ handleObj = event.handleObj,
+ selector = handleObj.selector;
+
+ // For mousenter/leave call the handler if related is outside the target.
+ // NB: No relatedTarget if the mouse left/entered the browser window
+ if ( !related || (related !== target && !jQuery.contains( target, related )) ) {
+ event.type = handleObj.origType;
+ ret = handleObj.handler.apply( this, arguments );
+ event.type = fix;
+ }
+ return ret;
+ }
+ };
+});
+
+// IE submit delegation
+if ( !jQuery.support.submitBubbles ) {
+
+ jQuery.event.special.submit = {
+ setup: function() {
+ // Only need this for delegated form submit events
+ if ( jQuery.nodeName( this, "form" ) ) {
+ return false;
+ }
+
+ // Lazy-add a submit handler when a descendant form may potentially be submitted
+ jQuery.event.add( this, "click._submit keypress._submit", function( e ) {
+ // Node name check avoids a VML-related crash in IE (#9807)
+ var elem = e.target,
+ form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined;
+ if ( form && !jQuery._data( form, "_submit_attached" ) ) {
+ jQuery.event.add( form, "submit._submit", function( event ) {
+ event._submit_bubble = true;
+ });
+ jQuery._data( form, "_submit_attached", true );
+ }
+ });
+ // return undefined since we don't need an event listener
+ },
+
+ postDispatch: function( event ) {
+ // If form was submitted by the user, bubble the event up the tree
+ if ( event._submit_bubble ) {
+ delete event._submit_bubble;
+ if ( this.parentNode && !event.isTrigger ) {
+ jQuery.event.simulate( "submit", this.parentNode, event, true );
+ }
+ }
+ },
+
+ teardown: function() {
+ // Only need this for delegated form submit events
+ if ( jQuery.nodeName( this, "form" ) ) {
+ return false;
+ }
+
+ // Remove delegated handlers; cleanData eventually reaps submit handlers attached above
+ jQuery.event.remove( this, "._submit" );
+ }
+ };
+}
+
+// IE change delegation and checkbox/radio fix
+if ( !jQuery.support.changeBubbles ) {
+
+ jQuery.event.special.change = {
+
+ setup: function() {
+
+ if ( rformElems.test( this.nodeName ) ) {
+ // IE doesn't fire change on a check/radio until blur; trigger it on click
+ // after a propertychange. Eat the blur-change in special.change.handle.
+ // This still fires onchange a second time for check/radio after blur.
+ if ( this.type === "checkbox" || this.type === "radio" ) {
+ jQuery.event.add( this, "propertychange._change", function( event ) {
+ if ( event.originalEvent.propertyName === "checked" ) {
+ this._just_changed = true;
+ }
+ });
+ jQuery.event.add( this, "click._change", function( event ) {
+ if ( this._just_changed && !event.isTrigger ) {
+ this._just_changed = false;
+ }
+ // Allow triggered, simulated change events (#11500)
+ jQuery.event.simulate( "change", this, event, true );
+ });
+ }
+ return false;
+ }
+ // Delegated event; lazy-add a change handler on descendant inputs
+ jQuery.event.add( this, "beforeactivate._change", function( e ) {
+ var elem = e.target;
+
+ if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "_change_attached" ) ) {
+ jQuery.event.add( elem, "change._change", function( event ) {
+ if ( this.parentNode && !event.isSimulated && !event.isTrigger ) {
+ jQuery.event.simulate( "change", this.parentNode, event, true );
+ }
+ });
+ jQuery._data( elem, "_change_attached", true );
+ }
+ });
+ },
+
+ handle: function( event ) {
+ var elem = event.target;
+
+ // Swallow native change events from checkbox/radio, we already triggered them above
+ if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) {
+ return event.handleObj.handler.apply( this, arguments );
+ }
+ },
+
+ teardown: function() {
+ jQuery.event.remove( this, "._change" );
+
+ return !rformElems.test( this.nodeName );
+ }
+ };
+}
+
+// Create "bubbling" focus and blur events
+if ( !jQuery.support.focusinBubbles ) {
+ jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
+
+ // Attach a single capturing handler while someone wants focusin/focusout
+ var attaches = 0,
+ handler = function( event ) {
+ jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );
+ };
+
+ jQuery.event.special[ fix ] = {
+ setup: function() {
+ if ( attaches++ === 0 ) {
+ document.addEventListener( orig, handler, true );
+ }
+ },
+ teardown: function() {
+ if ( --attaches === 0 ) {
+ document.removeEventListener( orig, handler, true );
+ }
+ }
+ };
+ });
+}
+
+jQuery.fn.extend({
+
+ on: function( types, selector, data, fn, /*INTERNAL*/ one ) {
+ var origFn, type;
+
+ // Types can be a map of types/handlers
+ if ( typeof types === "object" ) {
+ // ( types-Object, selector, data )
+ if ( typeof selector !== "string" ) { // && selector != null
+ // ( types-Object, data )
+ data = data || selector;
+ selector = undefined;
+ }
+ for ( type in types ) {
+ this.on( type, selector, data, types[ type ], one );
+ }
+ return this;
+ }
+
+ if ( data == null && fn == null ) {
+ // ( types, fn )
+ fn = selector;
+ data = selector = undefined;
+ } else if ( fn == null ) {
+ if ( typeof selector === "string" ) {
+ // ( types, selector, fn )
+ fn = data;
+ data = undefined;
+ } else {
+ // ( types, data, fn )
+ fn = data;
+ data = selector;
+ selector = undefined;
+ }
+ }
+ if ( fn === false ) {
+ fn = returnFalse;
+ } else if ( !fn ) {
+ return this;
+ }
+
+ if ( one === 1 ) {
+ origFn = fn;
+ fn = function( event ) {
+ // Can use an empty set, since event contains the info
+ jQuery().off( event );
+ return origFn.apply( this, arguments );
+ };
+ // Use same guid so caller can remove using origFn
+ fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
+ }
+ return this.each( function() {
+ jQuery.event.add( this, types, fn, data, selector );
+ });
+ },
+ one: function( types, selector, data, fn ) {
+ return this.on( types, selector, data, fn, 1 );
+ },
+ off: function( types, selector, fn ) {
+ var handleObj, type;
+ if ( types && types.preventDefault && types.handleObj ) {
+ // ( event ) dispatched jQuery.Event
+ handleObj = types.handleObj;
+ jQuery( types.delegateTarget ).off(
+ handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType,
+ handleObj.selector,
+ handleObj.handler
+ );
+ return this;
+ }
+ if ( typeof types === "object" ) {
+ // ( types-object [, selector] )
+ for ( type in types ) {
+ this.off( type, selector, types[ type ] );
+ }
+ return this;
+ }
+ if ( selector === false || typeof selector === "function" ) {
+ // ( types [, fn] )
+ fn = selector;
+ selector = undefined;
+ }
+ if ( fn === false ) {
+ fn = returnFalse;
+ }
+ return this.each(function() {
+ jQuery.event.remove( this, types, fn, selector );
+ });
+ },
+
+ bind: function( types, data, fn ) {
+ return this.on( types, null, data, fn );
+ },
+ unbind: function( types, fn ) {
+ return this.off( types, null, fn );
+ },
+
+ live: function( types, data, fn ) {
+ jQuery( this.context ).on( types, this.selector, data, fn );
+ return this;
+ },
+ die: function( types, fn ) {
+ jQuery( this.context ).off( types, this.selector || "**", fn );
+ return this;
+ },
+
+ delegate: function( selector, types, data, fn ) {
+ return this.on( types, selector, data, fn );
+ },
+ undelegate: function( selector, types, fn ) {
+ // ( namespace ) or ( selector, types [, fn] )
+ return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn );
+ },
+
+ trigger: function( type, data ) {
+ return this.each(function() {
+ jQuery.event.trigger( type, data, this );
+ });
+ },
+ triggerHandler: function( type, data ) {
+ if ( this[0] ) {
+ return jQuery.event.trigger( type, data, this[0], true );
+ }
+ },
+
+ toggle: function( fn ) {
+ // Save reference to arguments for access in closure
+ var args = arguments,
+ guid = fn.guid || jQuery.guid++,
+ i = 0,
+ toggler = function( event ) {
+ // Figure out which function to execute
+ var lastToggle = ( jQuery._data( this, "lastToggle" + fn.guid ) || 0 ) % i;
+ jQuery._data( this, "lastToggle" + fn.guid, lastToggle + 1 );
+
+ // Make sure that clicks stop
+ event.preventDefault();
+
+ // and execute the function
+ return args[ lastToggle ].apply( this, arguments ) || false;
+ };
+
+ // link all the functions, so any of them can unbind this click handler
+ toggler.guid = guid;
+ while ( i < args.length ) {
+ args[ i++ ].guid = guid;
+ }
+
+ return this.click( toggler );
+ },
+
+ hover: function( fnOver, fnOut ) {
+ return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
+ }
+});
+
+jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
+ "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
+ "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) {
+
+ // Handle event binding
+ jQuery.fn[ name ] = function( data, fn ) {
+ if ( fn == null ) {
+ fn = data;
+ data = null;
+ }
+
+ return arguments.length > 0 ?
+ this.on( name, null, data, fn ) :
+ this.trigger( name );
+ };
+
+ if ( rkeyEvent.test( name ) ) {
+ jQuery.event.fixHooks[ name ] = jQuery.event.keyHooks;
+ }
+
+ if ( rmouseEvent.test( name ) ) {
+ jQuery.event.fixHooks[ name ] = jQuery.event.mouseHooks;
+ }
+});
+/*!\r
+ * Sizzle CSS Selector Engine\r
+ * Copyright 2012 jQuery Foundation and other contributors\r
+ * Released under the MIT license\r
+ * http://sizzlejs.com/\r
+ */\r
+(function( window, undefined ) {\r
+\r
+var cachedruns,\r
+ assertGetIdNotName,\r
+ Expr,\r
+ getText,\r
+ isXML,\r
+ contains,\r
+ compile,\r
+ sortOrder,\r
+ hasDuplicate,\r
+ outermostContext,\r
+\r
+ baseHasDuplicate = true,\r
+ strundefined = "undefined",\r
+\r
+ expando = ( "sizcache" + Math.random() ).replace( ".", "" ),\r
+\r
+ Token = String,\r
+ document = window.document,\r
+ docElem = document.documentElement,\r
+ dirruns = 0,\r
+ done = 0,\r
+ pop = [].pop,\r
+ push = [].push,\r
+ slice = [].slice,\r
+ // Use a stripped-down indexOf if a native one is unavailable\r
+ indexOf = [].indexOf || function( elem ) {\r
+ var i = 0,\r
+ len = this.length;\r
+ for ( ; i < len; i++ ) {\r
+ if ( this[i] === elem ) {\r
+ return i;\r
+ }\r
+ }\r
+ return -1;\r
+ },\r
+\r
+ // Augment a function for special use by Sizzle\r
+ markFunction = function( fn, value ) {\r
+ fn[ expando ] = value == null || value;\r
+ return fn;\r
+ },\r
+\r
+ createCache = function() {\r
+ var cache = {},\r
+ keys = [];\r
+\r
+ return markFunction(function( key, value ) {\r
+ // Only keep the most recent entries\r
+ if ( keys.push( key ) > Expr.cacheLength ) {\r
+ delete cache[ keys.shift() ];\r
+ }\r
+\r
+ return (cache[ key ] = value);\r
+ }, cache );\r
+ },\r
+\r
+ classCache = createCache(),\r
+ tokenCache = createCache(),\r
+ compilerCache = createCache(),\r
+\r
+ // Regex\r
+\r
+ // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace\r
+ whitespace = "[\\x20\\t\\r\\n\\f]",\r
+ // http://www.w3.org/TR/css3-syntax/#characters\r
+ characterEncoding = "(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",\r
+\r
+ // Loosely modeled on CSS identifier characters\r
+ // An unquoted value should be a CSS identifier (http://www.w3.org/TR/css3-selectors/#attribute-selectors)\r
+ // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier\r
+ identifier = characterEncoding.replace( "w", "w#" ),\r
+\r
+ // Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors\r
+ operators = "([*^$|!~]?=)",\r
+ attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace +\r
+ "*(?:" + operators + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]",\r
+\r
+ // Prefer arguments not in parens/brackets,\r
+ // then attribute selectors and non-pseudos (denoted by :),\r
+ // then anything else\r
+ // These preferences are here to reduce the number of selectors\r
+ // needing tokenize in the PSEUDO preFilter\r
+ pseudos = ":(" + characterEncoding + ")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:" + attributes + ")|[^:]|\\\\.)*|.*))\\)|)",\r
+\r
+ // For matchExpr.POS and matchExpr.needsContext\r
+ pos = ":(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace +\r
+ "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)",\r
+\r
+ // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter\r
+ rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),\r
+\r
+ rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),\r
+ rcombinators = new RegExp( "^" + whitespace + "*([\\x20\\t\\r\\n\\f>+~])" + whitespace + "*" ),\r
+ rpseudo = new RegExp( pseudos ),\r
+\r
+ // Easily-parseable/retrievable ID or TAG or CLASS selectors\r
+ rquickExpr = /^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,\r
+\r
+ rnot = /^:not/,\r
+ rsibling = /[\x20\t\r\n\f]*[+~]/,\r
+ rendsWithNot = /:not\($/,\r
+\r
+ rheader = /h\d/i,\r
+ rinputs = /input|select|textarea|button/i,\r
+\r
+ rbackslash = /\\(?!\\)/g,\r
+\r
+ matchExpr = {\r
+ "ID": new RegExp( "^#(" + characterEncoding + ")" ),\r
+ "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ),\r
+ "NAME": new RegExp( "^\\[name=['\"]?(" + characterEncoding + ")['\"]?\\]" ),\r
+ "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ),\r
+ "ATTR": new RegExp( "^" + attributes ),\r
+ "PSEUDO": new RegExp( "^" + pseudos ),\r
+ "POS": new RegExp( pos, "i" ),\r
+ "CHILD": new RegExp( "^:(only|nth|first|last)-child(?:\\(" + whitespace +\r
+ "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +\r
+ "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),\r
+ // For use in libraries implementing .is()\r
+ "needsContext": new RegExp( "^" + whitespace + "*[>+~]|" + pos, "i" )\r
+ },\r
+\r
+ // Support\r
+\r
+ // Used for testing something on an element\r
+ assert = function( fn ) {\r
+ var div = document.createElement("div");\r
+\r
+ try {\r
+ return fn( div );\r
+ } catch (e) {\r
+ return false;\r
+ } finally {\r
+ // release memory in IE\r
+ div = null;\r
+ }\r
+ },\r
+\r
+ // Check if getElementsByTagName("*") returns only elements\r
+ assertTagNameNoComments = assert(function( div ) {\r
+ div.appendChild( document.createComment("") );\r
+ return !div.getElementsByTagName("*").length;\r
+ }),\r
+\r
+ // Check if getAttribute returns normalized href attributes\r
+ assertHrefNotNormalized = assert(function( div ) {\r
+ div.innerHTML = "<a href='#'></a>";\r
+ return div.firstChild && typeof div.firstChild.getAttribute !== strundefined &&\r
+ div.firstChild.getAttribute("href") === "#";\r
+ }),\r
+\r
+ // Check if attributes should be retrieved by attribute nodes\r
+ assertAttributes = assert(function( div ) {\r
+ div.innerHTML = "<select></select>";\r
+ var type = typeof div.lastChild.getAttribute("multiple");\r
+ // IE8 returns a string for some attributes even when not present\r
+ return type !== "boolean" && type !== "string";\r
+ }),\r
+\r
+ // Check if getElementsByClassName can be trusted\r
+ assertUsableClassName = assert(function( div ) {\r
+ // Opera can't find a second classname (in 9.6)\r
+ div.innerHTML = "<div class='hidden e'></div><div class='hidden'></div>";\r
+ if ( !div.getElementsByClassName || !div.getElementsByClassName("e").length ) {\r
+ return false;\r
+ }\r
+\r
+ // Safari 3.2 caches class attributes and doesn't catch changes\r
+ div.lastChild.className = "e";\r
+ return div.getElementsByClassName("e").length === 2;\r
+ }),\r
+\r
+ // Check if getElementById returns elements by name\r
+ // Check if getElementsByName privileges form controls or returns elements by ID\r
+ assertUsableName = assert(function( div ) {\r
+ // Inject content\r
+ div.id = expando + 0;\r
+ div.innerHTML = "<a name='" + expando + "'></a><div name='" + expando + "'></div>";\r
+ docElem.insertBefore( div, docElem.firstChild );\r
+\r
+ // Test\r
+ var pass = document.getElementsByName &&\r
+ // buggy browsers will return fewer than the correct 2\r
+ document.getElementsByName( expando ).length === 2 +\r
+ // buggy browsers will return more than the correct 0\r
+ document.getElementsByName( expando + 0 ).length;\r
+ assertGetIdNotName = !document.getElementById( expando );\r
+\r
+ // Cleanup\r
+ docElem.removeChild( div );\r
+\r
+ return pass;\r
+ });\r
+\r
+// If slice is not available, provide a backup\r
+try {\r
+ slice.call( docElem.childNodes, 0 )[0].nodeType;\r
+} catch ( e ) {\r
+ slice = function( i ) {\r
+ var elem,\r
+ results = [];\r
+ for ( ; (elem = this[i]); i++ ) {\r
+ results.push( elem );\r
+ }\r
+ return results;\r
+ };\r
+}\r
+\r
+function Sizzle( selector, context, results, seed ) {\r
+ results = results || [];\r
+ context = context || document;\r
+ var match, elem, xml, m,\r
+ nodeType = context.nodeType;\r
+\r
+ if ( !selector || typeof selector !== "string" ) {\r
+ return results;\r
+ }\r
+\r
+ if ( nodeType !== 1 && nodeType !== 9 ) {\r
+ return [];\r
+ }\r
+\r
+ xml = isXML( context );\r
+\r
+ if ( !xml && !seed ) {\r
+ if ( (match = rquickExpr.exec( selector )) ) {\r
+ // Speed-up: Sizzle("#ID")\r
+ if ( (m = match[1]) ) {\r
+ if ( nodeType === 9 ) {\r
+ elem = context.getElementById( m );\r
+ // Check parentNode to catch when Blackberry 4.6 returns\r
+ // nodes that are no longer in the document #6963\r
+ if ( elem && elem.parentNode ) {\r
+ // Handle the case where IE, Opera, and Webkit return items\r
+ // by name instead of ID\r
+ if ( elem.id === m ) {\r
+ results.push( elem );\r
+ return results;\r
+ }\r
+ } else {\r
+ return results;\r
+ }\r
+ } else {\r
+ // Context is not a document\r
+ if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) &&\r
+ contains( context, elem ) && elem.id === m ) {\r
+ results.push( elem );\r
+ return results;\r
+ }\r
+ }\r
+\r
+ // Speed-up: Sizzle("TAG")\r
+ } else if ( match[2] ) {\r
+ push.apply( results, slice.call(context.getElementsByTagName( selector ), 0) );\r
+ return results;\r
+\r
+ // Speed-up: Sizzle(".CLASS")\r
+ } else if ( (m = match[3]) && assertUsableClassName && context.getElementsByClassName ) {\r
+ push.apply( results, slice.call(context.getElementsByClassName( m ), 0) );\r
+ return results;\r
+ }\r
+ }\r
+ }\r
+\r
+ // All others\r
+ return select( selector.replace( rtrim, "$1" ), context, results, seed, xml );\r
+}\r
+\r
+Sizzle.matches = function( expr, elements ) {\r
+ return Sizzle( expr, null, null, elements );\r
+};\r
+\r
+Sizzle.matchesSelector = function( elem, expr ) {\r
+ return Sizzle( expr, null, null, [ elem ] ).length > 0;\r
+};\r
+\r
+// Returns a function to use in pseudos for input types\r
+function createInputPseudo( type ) {\r
+ return function( elem ) {\r
+ var name = elem.nodeName.toLowerCase();\r
+ return name === "input" && elem.type === type;\r
+ };\r
+}\r
+\r
+// Returns a function to use in pseudos for buttons\r
+function createButtonPseudo( type ) {\r
+ return function( elem ) {\r
+ var name = elem.nodeName.toLowerCase();\r
+ return (name === "input" || name === "button") && elem.type === type;\r
+ };\r
+}\r
+\r
+// Returns a function to use in pseudos for positionals\r
+function createPositionalPseudo( fn ) {\r
+ return markFunction(function( argument ) {\r
+ argument = +argument;\r
+ return markFunction(function( seed, matches ) {\r
+ var j,\r
+ matchIndexes = fn( [], seed.length, argument ),\r
+ i = matchIndexes.length;\r
+\r
+ // Match elements found at the specified indexes\r
+ while ( i-- ) {\r
+ if ( seed[ (j = matchIndexes[i]) ] ) {\r
+ seed[j] = !(matches[j] = seed[j]);\r
+ }\r
+ }\r
+ });\r
+ });\r
+}\r
+\r
+/**\r
+ * Utility function for retrieving the text value of an array of DOM nodes\r
+ * @param {Array|Element} elem\r
+ */\r
+getText = Sizzle.getText = function( elem ) {\r
+ var node,\r
+ ret = "",\r
+ i = 0,\r
+ nodeType = elem.nodeType;\r
+\r
+ if ( nodeType ) {\r
+ if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {\r
+ // Use textContent for elements\r
+ // innerText usage removed for consistency of new lines (see #11153)\r
+ if ( typeof elem.textContent === "string" ) {\r
+ return elem.textContent;\r
+ } else {\r
+ // Traverse its children\r
+ for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {\r
+ ret += getText( elem );\r
+ }\r
+ }\r
+ } else if ( nodeType === 3 || nodeType === 4 ) {\r
+ return elem.nodeValue;\r
+ }\r
+ // Do not include comment or processing instruction nodes\r
+ } else {\r
+\r
+ // If no nodeType, this is expected to be an array\r
+ for ( ; (node = elem[i]); i++ ) {\r
+ // Do not traverse comment nodes\r
+ ret += getText( node );\r
+ }\r
+ }\r
+ return ret;\r
+};\r
+\r
+isXML = Sizzle.isXML = function( elem ) {\r
+ // documentElement is verified for cases where it doesn't yet exist\r
+ // (such as loading iframes in IE - #4833)\r
+ var documentElement = elem && (elem.ownerDocument || elem).documentElement;\r
+ return documentElement ? documentElement.nodeName !== "HTML" : false;\r
+};\r
+\r
+// Element contains another\r
+contains = Sizzle.contains = docElem.contains ?\r
+ function( a, b ) {\r
+ var adown = a.nodeType === 9 ? a.documentElement : a,\r
+ bup = b && b.parentNode;\r
+ return a === bup || !!( bup && bup.nodeType === 1 && adown.contains && adown.contains(bup) );\r
+ } :\r
+ docElem.compareDocumentPosition ?\r
+ function( a, b ) {\r
+ return b && !!( a.compareDocumentPosition( b ) & 16 );\r
+ } :\r
+ function( a, b ) {\r
+ while ( (b = b.parentNode) ) {\r
+ if ( b === a ) {\r
+ return true;\r
+ }\r
+ }\r
+ return false;\r
+ };\r
+\r
+Sizzle.attr = function( elem, name ) {\r
+ var val,\r
+ xml = isXML( elem );\r
+\r
+ if ( !xml ) {\r
+ name = name.toLowerCase();\r
+ }\r
+ if ( (val = Expr.attrHandle[ name ]) ) {\r
+ return val( elem );\r
+ }\r
+ if ( xml || assertAttributes ) {\r
+ return elem.getAttribute( name );\r
+ }\r
+ val = elem.getAttributeNode( name );\r
+ return val ?\r
+ typeof elem[ name ] === "boolean" ?\r
+ elem[ name ] ? name : null :\r
+ val.specified ? val.value : null :\r
+ null;\r
+};\r
+\r
+Expr = Sizzle.selectors = {\r
+\r
+ // Can be adjusted by the user\r
+ cacheLength: 50,\r
+\r
+ createPseudo: markFunction,\r
+\r
+ match: matchExpr,\r
+\r
+ // IE6/7 return a modified href\r
+ attrHandle: assertHrefNotNormalized ?\r
+ {} :\r
+ {\r
+ "href": function( elem ) {\r
+ return elem.getAttribute( "href", 2 );\r
+ },\r
+ "type": function( elem ) {\r
+ return elem.getAttribute("type");\r
+ }\r
+ },\r
+\r
+ find: {\r
+ "ID": assertGetIdNotName ?\r
+ function( id, context, xml ) {\r
+ if ( typeof context.getElementById !== strundefined && !xml ) {\r
+ var m = context.getElementById( id );\r
+ // Check parentNode to catch when Blackberry 4.6 returns\r
+ // nodes that are no longer in the document #6963\r
+ return m && m.parentNode ? [m] : [];\r
+ }\r
+ } :\r
+ function( id, context, xml ) {\r
+ if ( typeof context.getElementById !== strundefined && !xml ) {\r
+ var m = context.getElementById( id );\r
+\r
+ return m ?\r
+ m.id === id || typeof m.getAttributeNode !== strundefined && m.getAttributeNode("id").value === id ?\r
+ [m] :\r
+ undefined :\r
+ [];\r
+ }\r
+ },\r
+\r
+ "TAG": assertTagNameNoComments ?\r
+ function( tag, context ) {\r
+ if ( typeof context.getElementsByTagName !== strundefined ) {\r
+ return context.getElementsByTagName( tag );\r
+ }\r
+ } :\r
+ function( tag, context ) {\r
+ var results = context.getElementsByTagName( tag );\r
+\r
+ // Filter out possible comments\r
+ if ( tag === "*" ) {\r
+ var elem,\r
+ tmp = [],\r
+ i = 0;\r
+\r
+ for ( ; (elem = results[i]); i++ ) {\r
+ if ( elem.nodeType === 1 ) {\r
+ tmp.push( elem );\r
+ }\r
+ }\r
+\r
+ return tmp;\r
+ }\r
+ return results;\r
+ },\r
+\r
+ "NAME": assertUsableName && function( tag, context ) {\r
+ if ( typeof context.getElementsByName !== strundefined ) {\r
+ return context.getElementsByName( name );\r
+ }\r
+ },\r
+\r
+ "CLASS": assertUsableClassName && function( className, context, xml ) {\r
+ if ( typeof context.getElementsByClassName !== strundefined && !xml ) {\r
+ return context.getElementsByClassName( className );\r
+ }\r
+ }\r
+ },\r
+\r
+ relative: {\r
+ ">": { dir: "parentNode", first: true },\r
+ " ": { dir: "parentNode" },\r
+ "+": { dir: "previousSibling", first: true },\r
+ "~": { dir: "previousSibling" }\r
+ },\r
+\r
+ preFilter: {\r
+ "ATTR": function( match ) {\r
+ match[1] = match[1].replace( rbackslash, "" );\r
+\r
+ // Move the given value to match[3] whether quoted or unquoted\r
+ match[3] = ( match[4] || match[5] || "" ).replace( rbackslash, "" );\r
+\r
+ if ( match[2] === "~=" ) {\r
+ match[3] = " " + match[3] + " ";\r
+ }\r
+\r
+ return match.slice( 0, 4 );\r
+ },\r
+\r
+ "CHILD": function( match ) {\r
+ /* matches from matchExpr["CHILD"]\r
+ 1 type (only|nth|...)\r
+ 2 argument (even|odd|\d*|\d*n([+-]\d+)?|...)\r
+ 3 xn-component of xn+y argument ([+-]?\d*n|)\r
+ 4 sign of xn-component\r
+ 5 x of xn-component\r
+ 6 sign of y-component\r
+ 7 y of y-component\r
+ */\r
+ match[1] = match[1].toLowerCase();\r
+\r
+ if ( match[1] === "nth" ) {\r
+ // nth-child requires argument\r
+ if ( !match[2] ) {\r
+ Sizzle.error( match[0] );\r
+ }\r
+\r
+ // numeric x and y parameters for Expr.filter.CHILD\r
+ // remember that false/true cast respectively to 0/1\r
+ match[3] = +( match[3] ? match[4] + (match[5] || 1) : 2 * ( match[2] === "even" || match[2] === "odd" ) );\r
+ match[4] = +( ( match[6] + match[7] ) || match[2] === "odd" );\r
+\r
+ // other types prohibit arguments\r
+ } else if ( match[2] ) {\r
+ Sizzle.error( match[0] );\r
+ }\r
+\r
+ return match;\r
+ },\r
+\r
+ "PSEUDO": function( match ) {\r
+ var unquoted, excess;\r
+ if ( matchExpr["CHILD"].test( match[0] ) ) {\r
+ return null;\r
+ }\r
+\r
+ if ( match[3] ) {\r
+ match[2] = match[3];\r
+ } else if ( (unquoted = match[4]) ) {\r
+ // Only check arguments that contain a pseudo\r
+ if ( rpseudo.test(unquoted) &&\r
+ // Get excess from tokenize (recursively)\r
+ (excess = tokenize( unquoted, true )) &&\r
+ // advance to the next closing parenthesis\r
+ (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {\r
+\r
+ // excess is a negative index\r
+ unquoted = unquoted.slice( 0, excess );\r
+ match[0] = match[0].slice( 0, excess );\r
+ }\r
+ match[2] = unquoted;\r
+ }\r
+\r
+ // Return only captures needed by the pseudo filter method (type and argument)\r
+ return match.slice( 0, 3 );\r
+ }\r
+ },\r
+\r
+ filter: {\r
+ "ID": assertGetIdNotName ?\r
+ function( id ) {\r
+ id = id.replace( rbackslash, "" );\r
+ return function( elem ) {\r
+ return elem.getAttribute("id") === id;\r
+ };\r
+ } :\r
+ function( id ) {\r
+ id = id.replace( rbackslash, "" );\r
+ return function( elem ) {\r
+ var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id");\r
+ return node && node.value === id;\r
+ };\r
+ },\r
+\r
+ "TAG": function( nodeName ) {\r
+ if ( nodeName === "*" ) {\r
+ return function() { return true; };\r
+ }\r
+ nodeName = nodeName.replace( rbackslash, "" ).toLowerCase();\r
+\r
+ return function( elem ) {\r
+ return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;\r
+ };\r
+ },\r
+\r
+ "CLASS": function( className ) {\r
+ var pattern = classCache[ expando ][ className ];\r
+ if ( !pattern ) {\r
+ pattern = classCache( className, new RegExp("(^|" + whitespace + ")" + className + "(" + whitespace + "|$)") );\r
+ }\r
+ return function( elem ) {\r
+ return pattern.test( elem.className || (typeof elem.getAttribute !== strundefined && elem.getAttribute("class")) || "" );\r
+ };\r
+ },\r
+\r
+ "ATTR": function( name, operator, check ) {\r
+ return function( elem, context ) {\r
+ var result = Sizzle.attr( elem, name );\r
+\r
+ if ( result == null ) {\r
+ return operator === "!=";\r
+ }\r
+ if ( !operator ) {\r
+ return true;\r
+ }\r
+\r
+ result += "";\r
+\r
+ return operator === "=" ? result === check :\r
+ operator === "!=" ? result !== check :\r
+ operator === "^=" ? check && result.indexOf( check ) === 0 :\r
+ operator === "*=" ? check && result.indexOf( check ) > -1 :\r
+ operator === "$=" ? check && result.substr( result.length - check.length ) === check :\r
+ operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 :\r
+ operator === "|=" ? result === check || result.substr( 0, check.length + 1 ) === check + "-" :\r
+ false;\r
+ };\r
+ },\r
+\r
+ "CHILD": function( type, argument, first, last ) {\r
+\r
+ if ( type === "nth" ) {\r
+ return function( elem ) {\r
+ var node, diff,\r
+ parent = elem.parentNode;\r
+\r
+ if ( first === 1 && last === 0 ) {\r
+ return true;\r
+ }\r
+\r
+ if ( parent ) {\r
+ diff = 0;\r
+ for ( node = parent.firstChild; node; node = node.nextSibling ) {\r
+ if ( node.nodeType === 1 ) {\r
+ diff++;\r
+ if ( elem === node ) {\r
+ break;\r
+ }\r
+ }\r
+ }\r
+ }\r
+\r
+ // Incorporate the offset (or cast to NaN), then check against cycle size\r
+ diff -= last;\r
+ return diff === first || ( diff % first === 0 && diff / first >= 0 );\r
+ };\r
+ }\r
+\r
+ return function( elem ) {\r
+ var node = elem;\r
+\r
+ switch ( type ) {\r
+ case "only":\r
+ case "first":\r
+ while ( (node = node.previousSibling) ) {\r
+ if ( node.nodeType === 1 ) {\r
+ return false;\r
+ }\r
+ }\r
+\r
+ if ( type === "first" ) {\r
+ return true;\r
+ }\r
+\r
+ node = elem;\r
+\r
+ /* falls through */\r
+ case "last":\r
+ while ( (node = node.nextSibling) ) {\r
+ if ( node.nodeType === 1 ) {\r
+ return false;\r
+ }\r
+ }\r
+\r
+ return true;\r
+ }\r
+ };\r
+ },\r
+\r
+ "PSEUDO": function( pseudo, argument ) {\r
+ // pseudo-class names are case-insensitive\r
+ // http://www.w3.org/TR/selectors/#pseudo-classes\r
+ // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters\r
+ // Remember that setFilters inherits from pseudos\r
+ var args,\r
+ fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||\r
+ Sizzle.error( "unsupported pseudo: " + pseudo );\r
+\r
+ // The user may use createPseudo to indicate that\r
+ // arguments are needed to create the filter function\r
+ // just as Sizzle does\r
+ if ( fn[ expando ] ) {\r
+ return fn( argument );\r
+ }\r
+\r
+ // But maintain support for old signatures\r
+ if ( fn.length > 1 ) {\r
+ args = [ pseudo, pseudo, "", argument ];\r
+ return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?\r
+ markFunction(function( seed, matches ) {\r
+ var idx,\r
+ matched = fn( seed, argument ),\r
+ i = matched.length;\r
+ while ( i-- ) {\r
+ idx = indexOf.call( seed, matched[i] );\r
+ seed[ idx ] = !( matches[ idx ] = matched[i] );\r
+ }\r
+ }) :\r
+ function( elem ) {\r
+ return fn( elem, 0, args );\r
+ };\r
+ }\r
+\r
+ return fn;\r
+ }\r
+ },\r
+\r
+ pseudos: {\r
+ "not": markFunction(function( selector ) {\r
+ // Trim the selector passed to compile\r
+ // to avoid treating leading and trailing\r
+ // spaces as combinators\r
+ var input = [],\r
+ results = [],\r
+ matcher = compile( selector.replace( rtrim, "$1" ) );\r
+\r
+ return matcher[ expando ] ?\r
+ markFunction(function( seed, matches, context, xml ) {\r
+ var elem,\r
+ unmatched = matcher( seed, null, xml, [] ),\r
+ i = seed.length;\r
+\r
+ // Match elements unmatched by `matcher`\r
+ while ( i-- ) {\r
+ if ( (elem = unmatched[i]) ) {\r
+ seed[i] = !(matches[i] = elem);\r
+ }\r
+ }\r
+ }) :\r
+ function( elem, context, xml ) {\r
+ input[0] = elem;\r
+ matcher( input, null, xml, results );\r
+ return !results.pop();\r
+ };\r
+ }),\r
+\r
+ "has": markFunction(function( selector ) {\r
+ return function( elem ) {\r
+ return Sizzle( selector, elem ).length > 0;\r
+ };\r
+ }),\r
+\r
+ "contains": markFunction(function( text ) {\r
+ return function( elem ) {\r
+ return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;\r
+ };\r
+ }),\r
+\r
+ "enabled": function( elem ) {\r
+ return elem.disabled === false;\r
+ },\r
+\r
+ "disabled": function( elem ) {\r
+ return elem.disabled === true;\r
+ },\r
+\r
+ "checked": function( elem ) {\r
+ // In CSS3, :checked should return both checked and selected elements\r
+ // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked\r
+ var nodeName = elem.nodeName.toLowerCase();\r
+ return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);\r
+ },\r
+\r
+ "selected": function( elem ) {\r
+ // Accessing this property makes selected-by-default\r
+ // options in Safari work properly\r
+ if ( elem.parentNode ) {\r
+ elem.parentNode.selectedIndex;\r
+ }\r
+\r
+ return elem.selected === true;\r
+ },\r
+\r
+ "parent": function( elem ) {\r
+ return !Expr.pseudos["empty"]( elem );\r
+ },\r
+\r
+ "empty": function( elem ) {\r
+ // http://www.w3.org/TR/selectors/#empty-pseudo\r
+ // :empty is only affected by element nodes and content nodes(including text(3), cdata(4)),\r
+ // not comment, processing instructions, or others\r
+ // Thanks to Diego Perini for the nodeName shortcut\r
+ // Greater than "@" means alpha characters (specifically not starting with "#" or "?")\r
+ var nodeType;\r
+ elem = elem.firstChild;\r
+ while ( elem ) {\r
+ if ( elem.nodeName > "@" || (nodeType = elem.nodeType) === 3 || nodeType === 4 ) {\r
+ return false;\r
+ }\r
+ elem = elem.nextSibling;\r
+ }\r
+ return true;\r
+ },\r
+\r
+ "header": function( elem ) {\r
+ return rheader.test( elem.nodeName );\r
+ },\r
+\r
+ "text": function( elem ) {\r
+ var type, attr;\r
+ // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc)\r
+ // use getAttribute instead to test this case\r
+ return elem.nodeName.toLowerCase() === "input" &&\r
+ (type = elem.type) === "text" &&\r
+ ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === type );\r
+ },\r
+\r
+ // Input types\r
+ "radio": createInputPseudo("radio"),\r
+ "checkbox": createInputPseudo("checkbox"),\r
+ "file": createInputPseudo("file"),\r
+ "password": createInputPseudo("password"),\r
+ "image": createInputPseudo("image"),\r
+\r
+ "submit": createButtonPseudo("submit"),\r
+ "reset": createButtonPseudo("reset"),\r
+\r
+ "button": function( elem ) {\r
+ var name = elem.nodeName.toLowerCase();\r
+ return name === "input" && elem.type === "button" || name === "button";\r
+ },\r
+\r
+ "input": function( elem ) {\r
+ return rinputs.test( elem.nodeName );\r
+ },\r
+\r
+ "focus": function( elem ) {\r
+ var doc = elem.ownerDocument;\r
+ return elem === doc.activeElement && (!doc.hasFocus || doc.hasFocus()) && !!(elem.type || elem.href);\r
+ },\r
+\r
+ "active": function( elem ) {\r
+ return elem === elem.ownerDocument.activeElement;\r
+ },\r
+\r
+ // Positional types\r
+ "first": createPositionalPseudo(function( matchIndexes, length, argument ) {\r
+ return [ 0 ];\r
+ }),\r
+\r
+ "last": createPositionalPseudo(function( matchIndexes, length, argument ) {\r
+ return [ length - 1 ];\r
+ }),\r
+\r
+ "eq": createPositionalPseudo(function( matchIndexes, length, argument ) {\r
+ return [ argument < 0 ? argument + length : argument ];\r
+ }),\r
+\r
+ "even": createPositionalPseudo(function( matchIndexes, length, argument ) {\r
+ for ( var i = 0; i < length; i += 2 ) {\r
+ matchIndexes.push( i );\r
+ }\r
+ return matchIndexes;\r
+ }),\r
+\r
+ "odd": createPositionalPseudo(function( matchIndexes, length, argument ) {\r
+ for ( var i = 1; i < length; i += 2 ) {\r
+ matchIndexes.push( i );\r
+ }\r
+ return matchIndexes;\r
+ }),\r
+\r
+ "lt": createPositionalPseudo(function( matchIndexes, length, argument ) {\r
+ for ( var i = argument < 0 ? argument + length : argument; --i >= 0; ) {\r
+ matchIndexes.push( i );\r
+ }\r
+ return matchIndexes;\r
+ }),\r
+\r
+ "gt": createPositionalPseudo(function( matchIndexes, length, argument ) {\r
+ for ( var i = argument < 0 ? argument + length : argument; ++i < length; ) {\r
+ matchIndexes.push( i );\r
+ }\r
+ return matchIndexes;\r
+ })\r
+ }\r
+};\r
+\r
+function siblingCheck( a, b, ret ) {\r
+ if ( a === b ) {\r
+ return ret;\r
+ }\r
+\r
+ var cur = a.nextSibling;\r
+\r
+ while ( cur ) {\r
+ if ( cur === b ) {\r
+ return -1;\r
+ }\r
+\r
+ cur = cur.nextSibling;\r
+ }\r
+\r
+ return 1;\r
+}\r
+\r
+sortOrder = docElem.compareDocumentPosition ?\r
+ function( a, b ) {\r
+ if ( a === b ) {\r
+ hasDuplicate = true;\r
+ return 0;\r
+ }\r
+\r
+ return ( !a.compareDocumentPosition || !b.compareDocumentPosition ?\r
+ a.compareDocumentPosition :\r
+ a.compareDocumentPosition(b) & 4\r
+ ) ? -1 : 1;\r
+ } :\r
+ function( a, b ) {\r
+ // The nodes are identical, we can exit early\r
+ if ( a === b ) {\r
+ hasDuplicate = true;\r
+ return 0;\r
+\r
+ // Fallback to using sourceIndex (in IE) if it's available on both nodes\r
+ } else if ( a.sourceIndex && b.sourceIndex ) {\r
+ return a.sourceIndex - b.sourceIndex;\r
+ }\r
+\r
+ var al, bl,\r
+ ap = [],\r
+ bp = [],\r
+ aup = a.parentNode,\r
+ bup = b.parentNode,\r
+ cur = aup;\r
+\r
+ // If the nodes are siblings (or identical) we can do a quick check\r
+ if ( aup === bup ) {\r
+ return siblingCheck( a, b );\r
+\r
+ // If no parents were found then the nodes are disconnected\r
+ } else if ( !aup ) {\r
+ return -1;\r
+\r
+ } else if ( !bup ) {\r
+ return 1;\r
+ }\r
+\r
+ // Otherwise they're somewhere else in the tree so we need\r
+ // to build up a full list of the parentNodes for comparison\r
+ while ( cur ) {\r
+ ap.unshift( cur );\r
+ cur = cur.parentNode;\r
+ }\r
+\r
+ cur = bup;\r
+\r
+ while ( cur ) {\r
+ bp.unshift( cur );\r
+ cur = cur.parentNode;\r
+ }\r
+\r
+ al = ap.length;\r
+ bl = bp.length;\r
+\r
+ // Start walking down the tree looking for a discrepancy\r
+ for ( var i = 0; i < al && i < bl; i++ ) {\r
+ if ( ap[i] !== bp[i] ) {\r
+ return siblingCheck( ap[i], bp[i] );\r
+ }\r
+ }\r
+\r
+ // We ended someplace up the tree so do a sibling check\r
+ return i === al ?\r
+ siblingCheck( a, bp[i], -1 ) :\r
+ siblingCheck( ap[i], b, 1 );\r
+ };\r
+\r
+// Always assume the presence of duplicates if sort doesn't\r
+// pass them to our comparison function (as in Google Chrome).\r
+[0, 0].sort( sortOrder );\r
+baseHasDuplicate = !hasDuplicate;\r
+\r
+// Document sorting and removing duplicates\r
+Sizzle.uniqueSort = function( results ) {\r
+ var elem,\r
+ i = 1;\r
+\r
+ hasDuplicate = baseHasDuplicate;\r
+ results.sort( sortOrder );\r
+\r
+ if ( hasDuplicate ) {\r
+ for ( ; (elem = results[i]); i++ ) {\r
+ if ( elem === results[ i - 1 ] ) {\r
+ results.splice( i--, 1 );\r
+ }\r
+ }\r
+ }\r
+\r
+ return results;\r
+};\r
+\r
+Sizzle.error = function( msg ) {\r
+ throw new Error( "Syntax error, unrecognized expression: " + msg );\r
+};\r
+\r
+function tokenize( selector, parseOnly ) {\r
+ var matched, match, tokens, type, soFar, groups, preFilters,\r
+ cached = tokenCache[ expando ][ selector ];\r
+\r
+ if ( cached ) {\r
+ return parseOnly ? 0 : cached.slice( 0 );\r
+ }\r
+\r
+ soFar = selector;\r
+ groups = [];\r
+ preFilters = Expr.preFilter;\r
+\r
+ while ( soFar ) {\r
+\r
+ // Comma and first run\r
+ if ( !matched || (match = rcomma.exec( soFar )) ) {\r
+ if ( match ) {\r
+ soFar = soFar.slice( match[0].length );\r
+ }\r
+ groups.push( tokens = [] );\r
+ }\r
+\r
+ matched = false;\r
+\r
+ // Combinators\r
+ if ( (match = rcombinators.exec( soFar )) ) {\r
+ tokens.push( matched = new Token( match.shift() ) );\r
+ soFar = soFar.slice( matched.length );\r
+\r
+ // Cast descendant combinators to space\r
+ matched.type = match[0].replace( rtrim, " " );\r
+ }\r
+\r
+ // Filters\r
+ for ( type in Expr.filter ) {\r
+ if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||\r
+ // The last two arguments here are (context, xml) for backCompat\r
+ (match = preFilters[ type ]( match, document, true ))) ) {\r
+\r
+ tokens.push( matched = new Token( match.shift() ) );\r
+ soFar = soFar.slice( matched.length );\r
+ matched.type = type;\r
+ matched.matches = match;\r
+ }\r
+ }\r
+\r
+ if ( !matched ) {\r
+ break;\r
+ }\r
+ }\r
+\r
+ // Return the length of the invalid excess\r
+ // if we're just parsing\r
+ // Otherwise, throw an error or return tokens\r
+ return parseOnly ?\r
+ soFar.length :\r
+ soFar ?\r
+ Sizzle.error( selector ) :\r
+ // Cache the tokens\r
+ tokenCache( selector, groups ).slice( 0 );\r
+}\r
+\r
+function addCombinator( matcher, combinator, base ) {\r
+ var dir = combinator.dir,\r
+ checkNonElements = base && combinator.dir === "parentNode",\r
+ doneName = done++;\r
+\r
+ return combinator.first ?\r
+ // Check against closest ancestor/preceding element\r
+ function( elem, context, xml ) {\r
+ while ( (elem = elem[ dir ]) ) {\r
+ if ( checkNonElements || elem.nodeType === 1 ) {\r
+ return matcher( elem, context, xml );\r
+ }\r
+ }\r
+ } :\r
+\r
+ // Check against all ancestor/preceding elements\r
+ function( elem, context, xml ) {\r
+ // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching\r
+ if ( !xml ) {\r
+ var cache,\r
+ dirkey = dirruns + " " + doneName + " ",\r
+ cachedkey = dirkey + cachedruns;\r
+ while ( (elem = elem[ dir ]) ) {\r
+ if ( checkNonElements || elem.nodeType === 1 ) {\r
+ if ( (cache = elem[ expando ]) === cachedkey ) {\r
+ return elem.sizset;\r
+ } else if ( typeof cache === "string" && cache.indexOf(dirkey) === 0 ) {\r
+ if ( elem.sizset ) {\r
+ return elem;\r
+ }\r
+ } else {\r
+ elem[ expando ] = cachedkey;\r
+ if ( matcher( elem, context, xml ) ) {\r
+ elem.sizset = true;\r
+ return elem;\r
+ }\r
+ elem.sizset = false;\r
+ }\r
+ }\r
+ }\r
+ } else {\r
+ while ( (elem = elem[ dir ]) ) {\r
+ if ( checkNonElements || elem.nodeType === 1 ) {\r
+ if ( matcher( elem, context, xml ) ) {\r
+ return elem;\r
+ }\r
+ }\r
+ }\r
+ }\r
+ };\r
+}\r
+\r
+function elementMatcher( matchers ) {\r
+ return matchers.length > 1 ?\r
+ function( elem, context, xml ) {\r
+ var i = matchers.length;\r
+ while ( i-- ) {\r
+ if ( !matchers[i]( elem, context, xml ) ) {\r
+ return false;\r
+ }\r
+ }\r
+ return true;\r
+ } :\r
+ matchers[0];\r
+}\r
+\r
+function condense( unmatched, map, filter, context, xml ) {\r
+ var elem,\r
+ newUnmatched = [],\r
+ i = 0,\r
+ len = unmatched.length,\r
+ mapped = map != null;\r
+\r
+ for ( ; i < len; i++ ) {\r
+ if ( (elem = unmatched[i]) ) {\r
+ if ( !filter || filter( elem, context, xml ) ) {\r
+ newUnmatched.push( elem );\r
+ if ( mapped ) {\r
+ map.push( i );\r
+ }\r
+ }\r
+ }\r
+ }\r
+\r
+ return newUnmatched;\r
+}\r
+\r
+function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {\r
+ if ( postFilter && !postFilter[ expando ] ) {\r
+ postFilter = setMatcher( postFilter );\r
+ }\r
+ if ( postFinder && !postFinder[ expando ] ) {\r
+ postFinder = setMatcher( postFinder, postSelector );\r
+ }\r
+ return markFunction(function( seed, results, context, xml ) {\r
+ // Positional selectors apply to seed elements, so it is invalid to follow them with relative ones\r
+ if ( seed && postFinder ) {\r
+ return;\r
+ }\r
+\r
+ var i, elem, postFilterIn,\r
+ preMap = [],\r
+ postMap = [],\r
+ preexisting = results.length,\r
+\r
+ // Get initial elements from seed or context\r
+ elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [], seed ),\r
+\r
+ // Prefilter to get matcher input, preserving a map for seed-results synchronization\r
+ matcherIn = preFilter && ( seed || !selector ) ?\r
+ condense( elems, preMap, preFilter, context, xml ) :\r
+ elems,\r
+\r
+ matcherOut = matcher ?\r
+ // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,\r
+ postFinder || ( seed ? preFilter : preexisting || postFilter ) ?\r
+\r
+ // ...intermediate processing is necessary\r
+ [] :\r
+\r
+ // ...otherwise use results directly\r
+ results :\r
+ matcherIn;\r
+\r
+ // Find primary matches\r
+ if ( matcher ) {\r
+ matcher( matcherIn, matcherOut, context, xml );\r
+ }\r
+\r
+ // Apply postFilter\r
+ if ( postFilter ) {\r
+ postFilterIn = condense( matcherOut, postMap );\r
+ postFilter( postFilterIn, [], context, xml );\r
+\r
+ // Un-match failing elements by moving them back to matcherIn\r
+ i = postFilterIn.length;\r
+ while ( i-- ) {\r
+ if ( (elem = postFilterIn[i]) ) {\r
+ matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);\r
+ }\r
+ }\r
+ }\r
+\r
+ // Keep seed and results synchronized\r
+ if ( seed ) {\r
+ // Ignore postFinder because it can't coexist with seed\r
+ i = preFilter && matcherOut.length;\r
+ while ( i-- ) {\r
+ if ( (elem = matcherOut[i]) ) {\r
+ seed[ preMap[i] ] = !(results[ preMap[i] ] = elem);\r
+ }\r
+ }\r
+ } else {\r
+ matcherOut = condense(\r
+ matcherOut === results ?\r
+ matcherOut.splice( preexisting, matcherOut.length ) :\r
+ matcherOut\r
+ );\r
+ if ( postFinder ) {\r
+ postFinder( null, results, matcherOut, xml );\r
+ } else {\r
+ push.apply( results, matcherOut );\r
+ }\r
+ }\r
+ });\r
+}\r
+\r
+function matcherFromTokens( tokens ) {\r
+ var checkContext, matcher, j,\r
+ len = tokens.length,\r
+ leadingRelative = Expr.relative[ tokens[0].type ],\r
+ implicitRelative = leadingRelative || Expr.relative[" "],\r
+ i = leadingRelative ? 1 : 0,\r
+\r
+ // The foundational matcher ensures that elements are reachable from top-level context(s)\r
+ matchContext = addCombinator( function( elem ) {\r
+ return elem === checkContext;\r
+ }, implicitRelative, true ),\r
+ matchAnyContext = addCombinator( function( elem ) {\r
+ return indexOf.call( checkContext, elem ) > -1;\r
+ }, implicitRelative, true ),\r
+ matchers = [ function( elem, context, xml ) {\r
+ return ( !leadingRelative && ( xml || context !== outermostContext ) ) || (\r
+ (checkContext = context).nodeType ?\r
+ matchContext( elem, context, xml ) :\r
+ matchAnyContext( elem, context, xml ) );\r
+ } ];\r
+\r
+ for ( ; i < len; i++ ) {\r
+ if ( (matcher = Expr.relative[ tokens[i].type ]) ) {\r
+ matchers = [ addCombinator( elementMatcher( matchers ), matcher ) ];\r
+ } else {\r
+ // The concatenated values are (context, xml) for backCompat\r
+ matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );\r
+\r
+ // Return special upon seeing a positional matcher\r
+ if ( matcher[ expando ] ) {\r
+ // Find the next relative operator (if any) for proper handling\r
+ j = ++i;\r
+ for ( ; j < len; j++ ) {\r
+ if ( Expr.relative[ tokens[j].type ] ) {\r
+ break;\r
+ }\r
+ }\r
+ return setMatcher(\r
+ i > 1 && elementMatcher( matchers ),\r
+ i > 1 && tokens.slice( 0, i - 1 ).join("").replace( rtrim, "$1" ),\r
+ matcher,\r
+ i < j && matcherFromTokens( tokens.slice( i, j ) ),\r
+ j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),\r
+ j < len && tokens.join("")\r
+ );\r
+ }\r
+ matchers.push( matcher );\r
+ }\r
+ }\r
+\r
+ return elementMatcher( matchers );\r
+}\r
+\r
+function matcherFromGroupMatchers( elementMatchers, setMatchers ) {\r
+ var bySet = setMatchers.length > 0,\r
+ byElement = elementMatchers.length > 0,\r
+ superMatcher = function( seed, context, xml, results, expandContext ) {\r
+ var elem, j, matcher,\r
+ setMatched = [],\r
+ matchedCount = 0,\r
+ i = "0",\r
+ unmatched = seed && [],\r
+ outermost = expandContext != null,\r
+ contextBackup = outermostContext,\r
+ // We must always have either seed elements or context\r
+ elems = seed || byElement && Expr.find["TAG"]( "*", expandContext && context.parentNode || context ),\r
+ // Nested matchers should use non-integer dirruns\r
+ dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.E);\r
+\r
+ if ( outermost ) {\r
+ outermostContext = context !== document && context;\r
+ cachedruns = superMatcher.el;\r
+ }\r
+\r
+ // Add elements passing elementMatchers directly to results\r
+ for ( ; (elem = elems[i]) != null; i++ ) {\r
+ if ( byElement && elem ) {\r
+ for ( j = 0; (matcher = elementMatchers[j]); j++ ) {\r
+ if ( matcher( elem, context, xml ) ) {\r
+ results.push( elem );\r
+ break;\r
+ }\r
+ }\r
+ if ( outermost ) {\r
+ dirruns = dirrunsUnique;\r
+ cachedruns = ++superMatcher.el;\r
+ }\r
+ }\r
+\r
+ // Track unmatched elements for set filters\r
+ if ( bySet ) {\r
+ // They will have gone through all possible matchers\r
+ if ( (elem = !matcher && elem) ) {\r
+ matchedCount--;\r
+ }\r
+\r
+ // Lengthen the array for every element, matched or not\r
+ if ( seed ) {\r
+ unmatched.push( elem );\r
+ }\r
+ }\r
+ }\r
+\r
+ // Apply set filters to unmatched elements\r
+ matchedCount += i;\r
+ if ( bySet && i !== matchedCount ) {\r
+ for ( j = 0; (matcher = setMatchers[j]); j++ ) {\r
+ matcher( unmatched, setMatched, context, xml );\r
+ }\r
+\r
+ if ( seed ) {\r
+ // Reintegrate element matches to eliminate the need for sorting\r
+ if ( matchedCount > 0 ) {\r
+ while ( i-- ) {\r
+ if ( !(unmatched[i] || setMatched[i]) ) {\r
+ setMatched[i] = pop.call( results );\r
+ }\r
+ }\r
+ }\r
+\r
+ // Discard index placeholder values to get only actual matches\r
+ setMatched = condense( setMatched );\r
+ }\r
+\r
+ // Add matches to results\r
+ push.apply( results, setMatched );\r
+\r
+ // Seedless set matches succeeding multiple successful matchers stipulate sorting\r
+ if ( outermost && !seed && setMatched.length > 0 &&\r
+ ( matchedCount + setMatchers.length ) > 1 ) {\r
+\r
+ Sizzle.uniqueSort( results );\r
+ }\r
+ }\r
+\r
+ // Override manipulation of globals by nested matchers\r
+ if ( outermost ) {\r
+ dirruns = dirrunsUnique;\r
+ outermostContext = contextBackup;\r
+ }\r
+\r
+ return unmatched;\r
+ };\r
+\r
+ superMatcher.el = 0;\r
+ return bySet ?\r
+ markFunction( superMatcher ) :\r
+ superMatcher;\r
+}\r
+\r
+compile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) {\r
+ var i,\r
+ setMatchers = [],\r
+ elementMatchers = [],\r
+ cached = compilerCache[ expando ][ selector ];\r
+\r
+ if ( !cached ) {\r
+ // Generate a function of recursive functions that can be used to check each element\r
+ if ( !group ) {\r
+ group = tokenize( selector );\r
+ }\r
+ i = group.length;\r
+ while ( i-- ) {\r
+ cached = matcherFromTokens( group[i] );\r
+ if ( cached[ expando ] ) {\r
+ setMatchers.push( cached );\r
+ } else {\r
+ elementMatchers.push( cached );\r
+ }\r
+ }\r
+\r
+ // Cache the compiled function\r
+ cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );\r
+ }\r
+ return cached;\r
+};\r
+\r
+function multipleContexts( selector, contexts, results, seed ) {\r
+ var i = 0,\r
+ len = contexts.length;\r
+ for ( ; i < len; i++ ) {\r
+ Sizzle( selector, contexts[i], results, seed );\r
+ }\r
+ return results;\r
+}\r
+\r
+function select( selector, context, results, seed, xml ) {\r
+ var i, tokens, token, type, find,\r
+ match = tokenize( selector ),\r
+ j = match.length;\r
+\r
+ if ( !seed ) {\r
+ // Try to minimize operations if there is only one group\r
+ if ( match.length === 1 ) {\r
+\r
+ // Take a shortcut and set the context if the root selector is an ID\r
+ tokens = match[0] = match[0].slice( 0 );\r
+ if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&\r
+ context.nodeType === 9 && !xml &&\r
+ Expr.relative[ tokens[1].type ] ) {\r
+\r
+ context = Expr.find["ID"]( token.matches[0].replace( rbackslash, "" ), context, xml )[0];\r
+ if ( !context ) {\r
+ return results;\r
+ }\r
+\r
+ selector = selector.slice( tokens.shift().length );\r
+ }\r
+\r
+ // Fetch a seed set for right-to-left matching\r
+ for ( i = matchExpr["POS"].test( selector ) ? -1 : tokens.length - 1; i >= 0; i-- ) {\r
+ token = tokens[i];\r
+\r
+ // Abort if we hit a combinator\r
+ if ( Expr.relative[ (type = token.type) ] ) {\r
+ break;\r
+ }\r
+ if ( (find = Expr.find[ type ]) ) {\r
+ // Search, expanding context for leading sibling combinators\r
+ if ( (seed = find(\r
+ token.matches[0].replace( rbackslash, "" ),\r
+ rsibling.test( tokens[0].type ) && context.parentNode || context,\r
+ xml\r
+ )) ) {\r
+\r
+ // If seed is empty or no tokens remain, we can return early\r
+ tokens.splice( i, 1 );\r
+ selector = seed.length && tokens.join("");\r
+ if ( !selector ) {\r
+ push.apply( results, slice.call( seed, 0 ) );\r
+ return results;\r
+ }\r
+\r
+ break;\r
+ }\r
+ }\r
+ }\r
+ }\r
+ }\r
+\r
+ // Compile and execute a filtering function\r
+ // Provide `match` to avoid retokenization if we modified the selector above\r
+ compile( selector, match )(\r
+ seed,\r
+ context,\r
+ xml,\r
+ results,\r
+ rsibling.test( selector )\r
+ );\r
+ return results;\r
+}\r
+\r
+if ( document.querySelectorAll ) {\r
+ (function() {\r
+ var disconnectedMatch,\r
+ oldSelect = select,\r
+ rescape = /'|\\/g,\r
+ rattributeQuotes = /\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,\r
+\r
+ // qSa(:focus) reports false when true (Chrome 21),\r
+ // A support test would require too much code (would include document ready)\r
+ rbuggyQSA = [":focus"],\r
+\r
+ // matchesSelector(:focus) reports false when true (Chrome 21),\r
+ // matchesSelector(:active) reports false when true (IE9/Opera 11.5)\r
+ // A support test would require too much code (would include document ready)\r
+ // just skip matchesSelector for :active\r
+ rbuggyMatches = [ ":active", ":focus" ],\r
+ matches = docElem.matchesSelector ||\r
+ docElem.mozMatchesSelector ||\r
+ docElem.webkitMatchesSelector ||\r
+ docElem.oMatchesSelector ||\r
+ docElem.msMatchesSelector;\r
+\r
+ // Build QSA regex\r
+ // Regex strategy adopted from Diego Perini\r
+ assert(function( div ) {\r
+ // Select is set to empty string on purpose\r
+ // This is to test IE's treatment of not explictly\r
+ // setting a boolean content attribute,\r
+ // since its presence should be enough\r
+ // http://bugs.jquery.com/ticket/12359\r
+ div.innerHTML = "<select><option selected=''></option></select>";\r
+\r
+ // IE8 - Some boolean attributes are not treated correctly\r
+ if ( !div.querySelectorAll("[selected]").length ) {\r
+ rbuggyQSA.push( "\\[" + whitespace + "*(?:checked|disabled|ismap|multiple|readonly|selected|value)" );\r
+ }\r
+\r
+ // Webkit/Opera - :checked should return selected option elements\r
+ // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked\r
+ // IE8 throws error here (do not put tests after this one)\r
+ if ( !div.querySelectorAll(":checked").length ) {\r
+ rbuggyQSA.push(":checked");\r
+ }\r
+ });\r
+\r
+ assert(function( div ) {\r
+\r
+ // Opera 10-12/IE9 - ^= $= *= and empty values\r
+ // Should not select anything\r
+ div.innerHTML = "<p test=''></p>";\r
+ if ( div.querySelectorAll("[test^='']").length ) {\r
+ rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:\"\"|'')" );\r
+ }\r
+\r
+ // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)\r
+ // IE8 throws error here (do not put tests after this one)\r
+ div.innerHTML = "<input type='hidden'/>";\r
+ if ( !div.querySelectorAll(":enabled").length ) {\r
+ rbuggyQSA.push(":enabled", ":disabled");\r
+ }\r
+ });\r
+\r
+ // rbuggyQSA always contains :focus, so no need for a length check\r
+ rbuggyQSA = /* rbuggyQSA.length && */ new RegExp( rbuggyQSA.join("|") );\r
+\r
+ select = function( selector, context, results, seed, xml ) {\r
+ // Only use querySelectorAll when not filtering,\r
+ // when this is not xml,\r
+ // and when no QSA bugs apply\r
+ if ( !seed && !xml && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {\r
+ var groups, i,\r
+ old = true,\r
+ nid = expando,\r
+ newContext = context,\r
+ newSelector = context.nodeType === 9 && selector;\r
+\r
+ // qSA works strangely on Element-rooted queries\r
+ // We can work around this by specifying an extra ID on the root\r
+ // and working up from there (Thanks to Andrew Dupont for the technique)\r
+ // IE 8 doesn't work on object elements\r
+ if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {\r
+ groups = tokenize( selector );\r
+\r
+ if ( (old = context.getAttribute("id")) ) {\r
+ nid = old.replace( rescape, "\\$&" );\r
+ } else {\r
+ context.setAttribute( "id", nid );\r
+ }\r
+ nid = "[id='" + nid + "'] ";\r
+\r
+ i = groups.length;\r
+ while ( i-- ) {\r
+ groups[i] = nid + groups[i].join("");\r
+ }\r
+ newContext = rsibling.test( selector ) && context.parentNode || context;\r
+ newSelector = groups.join(",");\r
+ }\r
+\r
+ if ( newSelector ) {\r
+ try {\r
+ push.apply( results, slice.call( newContext.querySelectorAll(\r
+ newSelector\r
+ ), 0 ) );\r
+ return results;\r
+ } catch(qsaError) {\r
+ } finally {\r
+ if ( !old ) {\r
+ context.removeAttribute("id");\r
+ }\r
+ }\r
+ }\r
+ }\r
+\r
+ return oldSelect( selector, context, results, seed, xml );\r
+ };\r
+\r
+ if ( matches ) {\r
+ assert(function( div ) {\r
+ // Check to see if it's possible to do matchesSelector\r
+ // on a disconnected node (IE 9)\r
+ disconnectedMatch = matches.call( div, "div" );\r
+\r
+ // This should fail with an exception\r
+ // Gecko does not error, returns false instead\r
+ try {\r
+ matches.call( div, "[test!='']:sizzle" );\r
+ rbuggyMatches.push( "!=", pseudos );\r
+ } catch ( e ) {}\r
+ });\r
+\r
+ // rbuggyMatches always contains :active and :focus, so no need for a length check\r
+ rbuggyMatches = /* rbuggyMatches.length && */ new RegExp( rbuggyMatches.join("|") );\r
+\r
+ Sizzle.matchesSelector = function( elem, expr ) {\r
+ // Make sure that attribute selectors are quoted\r
+ expr = expr.replace( rattributeQuotes, "='$1']" );\r
+\r
+ // rbuggyMatches always contains :active, so no need for an existence check\r
+ if ( !isXML( elem ) && !rbuggyMatches.test( expr ) && (!rbuggyQSA || !rbuggyQSA.test( expr )) ) {\r
+ try {\r
+ var ret = matches.call( elem, expr );\r
+\r
+ // IE 9's matchesSelector returns false on disconnected nodes\r
+ if ( ret || disconnectedMatch ||\r
+ // As well, disconnected nodes are said to be in a document\r
+ // fragment in IE 9\r
+ elem.document && elem.document.nodeType !== 11 ) {\r
+ return ret;\r
+ }\r
+ } catch(e) {}\r
+ }\r
+\r
+ return Sizzle( expr, null, null, [ elem ] ).length > 0;\r
+ };\r
+ }\r
+ })();\r
+}\r
+\r
+// Deprecated\r
+Expr.pseudos["nth"] = Expr.pseudos["eq"];\r
+\r
+// Back-compat\r
+function setFilters() {}\r
+Expr.filters = setFilters.prototype = Expr.pseudos;\r
+Expr.setFilters = new setFilters();\r
+\r
+// Override sizzle attribute retrieval
+Sizzle.attr = jQuery.attr;
+jQuery.find = Sizzle;
+jQuery.expr = Sizzle.selectors;
+jQuery.expr[":"] = jQuery.expr.pseudos;
+jQuery.unique = Sizzle.uniqueSort;
+jQuery.text = Sizzle.getText;
+jQuery.isXMLDoc = Sizzle.isXML;
+jQuery.contains = Sizzle.contains;
+\r
+\r
+})( window );\r
+var runtil = /Until$/,
+ rparentsprev = /^(?:parents|prev(?:Until|All))/,
+ isSimple = /^.[^:#\[\.,]*$/,
+ rneedsContext = jQuery.expr.match.needsContext,
+ // methods guaranteed to produce a unique set when starting from a unique set
+ guaranteedUnique = {
+ children: true,
+ contents: true,
+ next: true,
+ prev: true
+ };
+
+jQuery.fn.extend({
+ find: function( selector ) {
+ var i, l, length, n, r, ret,
+ self = this;
+
+ if ( typeof selector !== "string" ) {
+ return jQuery( selector ).filter(function() {
+ for ( i = 0, l = self.length; i < l; i++ ) {
+ if ( jQuery.contains( self[ i ], this ) ) {
+ return true;
+ }
+ }
+ });
+ }
+
+ ret = this.pushStack( "", "find", selector );
+
+ for ( i = 0, l = this.length; i < l; i++ ) {
+ length = ret.length;
+ jQuery.find( selector, this[i], ret );
+
+ if ( i > 0 ) {
+ // Make sure that the results are unique
+ for ( n = length; n < ret.length; n++ ) {
+ for ( r = 0; r < length; r++ ) {
+ if ( ret[r] === ret[n] ) {
+ ret.splice(n--, 1);
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ return ret;
+ },
+
+ has: function( target ) {
+ var i,
+ targets = jQuery( target, this ),
+ len = targets.length;
+
+ return this.filter(function() {
+ for ( i = 0; i < len; i++ ) {
+ if ( jQuery.contains( this, targets[i] ) ) {
+ return true;
+ }
+ }
+ });
+ },
+
+ not: function( selector ) {
+ return this.pushStack( winnow(this, selector, false), "not", selector);
+ },
+
+ filter: function( selector ) {
+ return this.pushStack( winnow(this, selector, true), "filter", selector );
+ },
+
+ is: function( selector ) {
+ return !!selector && (
+ typeof selector === "string" ?
+ // If this is a positional/relative selector, check membership in the returned set
+ // so $("p:first").is("p:last") won't return true for a doc with two "p".
+ rneedsContext.test( selector ) ?
+ jQuery( selector, this.context ).index( this[0] ) >= 0 :
+ jQuery.filter( selector, this ).length > 0 :
+ this.filter( selector ).length > 0 );
+ },
+
+ closest: function( selectors, context ) {
+ var cur,
+ i = 0,
+ l = this.length,
+ ret = [],
+ pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ?
+ jQuery( selectors, context || this.context ) :
+ 0;
+
+ for ( ; i < l; i++ ) {
+ cur = this[i];
+
+ while ( cur && cur.ownerDocument && cur !== context && cur.nodeType !== 11 ) {
+ if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) {
+ ret.push( cur );
+ break;
+ }
+ cur = cur.parentNode;
+ }
+ }
+
+ ret = ret.length > 1 ? jQuery.unique( ret ) : ret;
+
+ return this.pushStack( ret, "closest", selectors );
+ },
+
+ // Determine the position of an element within
+ // the matched set of elements
+ index: function( elem ) {
+
+ // No argument, return index in parent
+ if ( !elem ) {
+ return ( this[0] && this[0].parentNode ) ? this.prevAll().length : -1;
+ }
+
+ // index in selector
+ if ( typeof elem === "string" ) {
+ return jQuery.inArray( this[0], jQuery( elem ) );
+ }
+
+ // Locate the position of the desired element
+ return jQuery.inArray(
+ // If it receives a jQuery object, the first element is used
+ elem.jquery ? elem[0] : elem, this );
+ },
+
+ add: function( selector, context ) {
+ var set = typeof selector === "string" ?
+ jQuery( selector, context ) :
+ jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ),
+ all = jQuery.merge( this.get(), set );
+
+ return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ?
+ all :
+ jQuery.unique( all ) );
+ },
+
+ addBack: function( selector ) {
+ return this.add( selector == null ?
+ this.prevObject : this.prevObject.filter(selector)
+ );
+ }
+});
+
+jQuery.fn.andSelf = jQuery.fn.addBack;
+
+// A painfully simple check to see if an element is disconnected
+// from a document (should be improved, where feasible).
+function isDisconnected( node ) {
+ return !node || !node.parentNode || node.parentNode.nodeType === 11;
+}
+
+function sibling( cur, dir ) {
+ do {
+ cur = cur[ dir ];
+ } while ( cur && cur.nodeType !== 1 );
+
+ return cur;
+}
+
+jQuery.each({
+ parent: function( elem ) {
+ var parent = elem.parentNode;
+ return parent && parent.nodeType !== 11 ? parent : null;
+ },
+ parents: function( elem ) {
+ return jQuery.dir( elem, "parentNode" );
+ },
+ parentsUntil: function( elem, i, until ) {
+ return jQuery.dir( elem, "parentNode", until );
+ },
+ next: function( elem ) {
+ return sibling( elem, "nextSibling" );
+ },
+ prev: function( elem ) {
+ return sibling( elem, "previousSibling" );
+ },
+ nextAll: function( elem ) {
+ return jQuery.dir( elem, "nextSibling" );
+ },
+ prevAll: function( elem ) {
+ return jQuery.dir( elem, "previousSibling" );
+ },
+ nextUntil: function( elem, i, until ) {
+ return jQuery.dir( elem, "nextSibling", until );
+ },
+ prevUntil: function( elem, i, until ) {
+ return jQuery.dir( elem, "previousSibling", until );
+ },
+ siblings: function( elem ) {
+ return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem );
+ },
+ children: function( elem ) {
+ return jQuery.sibling( elem.firstChild );
+ },
+ contents: function( elem ) {
+ return jQuery.nodeName( elem, "iframe" ) ?
+ elem.contentDocument || elem.contentWindow.document :
+ jQuery.merge( [], elem.childNodes );
+ }
+}, function( name, fn ) {
+ jQuery.fn[ name ] = function( until, selector ) {
+ var ret = jQuery.map( this, fn, until );
+
+ if ( !runtil.test( name ) ) {
+ selector = until;
+ }
+
+ if ( selector && typeof selector === "string" ) {
+ ret = jQuery.filter( selector, ret );
+ }
+
+ ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret;
+
+ if ( this.length > 1 && rparentsprev.test( name ) ) {
+ ret = ret.reverse();
+ }
+
+ return this.pushStack( ret, name, core_slice.call( arguments ).join(",") );
+ };
+});
+
+jQuery.extend({
+ filter: function( expr, elems, not ) {
+ if ( not ) {
+ expr = ":not(" + expr + ")";
+ }
+
+ return elems.length === 1 ?
+ jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] :
+ jQuery.find.matches(expr, elems);
+ },
+
+ dir: function( elem, dir, until ) {
+ var matched = [],
+ cur = elem[ dir ];
+
+ while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {
+ if ( cur.nodeType === 1 ) {
+ matched.push( cur );
+ }
+ cur = cur[dir];
+ }
+ return matched;
+ },
+
+ sibling: function( n, elem ) {
+ var r = [];
+
+ for ( ; n; n = n.nextSibling ) {
+ if ( n.nodeType === 1 && n !== elem ) {
+ r.push( n );
+ }
+ }
+
+ return r;
+ }
+});
+
+// Implement the identical functionality for filter and not
+function winnow( elements, qualifier, keep ) {
+
+ // Can't pass null or undefined to indexOf in Firefox 4
+ // Set to 0 to skip string check
+ qualifier = qualifier || 0;
+
+ if ( jQuery.isFunction( qualifier ) ) {
+ return jQuery.grep(elements, function( elem, i ) {
+ var retVal = !!qualifier.call( elem, i, elem );
+ return retVal === keep;
+ });
+
+ } else if ( qualifier.nodeType ) {
+ return jQuery.grep(elements, function( elem, i ) {
+ return ( elem === qualifier ) === keep;
+ });
+
+ } else if ( typeof qualifier === "string" ) {
+ var filtered = jQuery.grep(elements, function( elem ) {
+ return elem.nodeType === 1;
+ });
+
+ if ( isSimple.test( qualifier ) ) {
+ return jQuery.filter(qualifier, filtered, !keep);
+ } else {
+ qualifier = jQuery.filter( qualifier, filtered );
+ }
+ }
+
+ return jQuery.grep(elements, function( elem, i ) {
+ return ( jQuery.inArray( elem, qualifier ) >= 0 ) === keep;
+ });
+}
+function createSafeFragment( document ) {
+ var list = nodeNames.split( "|" ),
+ safeFrag = document.createDocumentFragment();
+
+ if ( safeFrag.createElement ) {
+ while ( list.length ) {
+ safeFrag.createElement(
+ list.pop()
+ );
+ }
+ }
+ return safeFrag;
+}
+
+var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" +
+ "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",
+ rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g,
+ rleadingWhitespace = /^\s+/,
+ rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
+ rtagName = /<([\w:]+)/,
+ rtbody = /<tbody/i,
+ rhtml = /<|&#?\w+;/,
+ rnoInnerhtml = /<(?:script|style|link)/i,
+ rnocache = /<(?:script|object|embed|option|style)/i,
+ rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"),
+ rcheckableType = /^(?:checkbox|radio)$/,
+ // checked="checked" or checked
+ rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
+ rscriptType = /\/(java|ecma)script/i,
+ rcleanScript = /^\s*<!(?:\[CDATA\[|\-\-)|[\]\-]{2}>\s*$/g,
+ wrapMap = {
+ option: [ 1, "<select multiple='multiple'>", "</select>" ],
+ legend: [ 1, "<fieldset>", "</fieldset>" ],
+ thead: [ 1, "<table>", "</table>" ],
+ tr: [ 2, "<table><tbody>", "</tbody></table>" ],
+ td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
+ col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],
+ area: [ 1, "<map>", "</map>" ],
+ _default: [ 0, "", "" ]
+ },
+ safeFragment = createSafeFragment( document ),
+ fragmentDiv = safeFragment.appendChild( document.createElement("div") );
+
+wrapMap.optgroup = wrapMap.option;
+wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
+wrapMap.th = wrapMap.td;
+
+// IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags,
+// unless wrapped in a div with non-breaking characters in front of it.
+if ( !jQuery.support.htmlSerialize ) {
+ wrapMap._default = [ 1, "X<div>", "</div>" ];
+}
+
+jQuery.fn.extend({
+ text: function( value ) {
+ return jQuery.access( this, function( value ) {
+ return value === undefined ?
+ jQuery.text( this ) :
+ this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) );
+ }, null, value, arguments.length );
+ },
+
+ wrapAll: function( html ) {
+ if ( jQuery.isFunction( html ) ) {
+ return this.each(function(i) {
+ jQuery(this).wrapAll( html.call(this, i) );
+ });
+ }
+
+ if ( this[0] ) {
+ // The elements to wrap the target around
+ var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);
+
+ if ( this[0].parentNode ) {
+ wrap.insertBefore( this[0] );
+ }
+
+ wrap.map(function() {
+ var elem = this;
+
+ while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
+ elem = elem.firstChild;
+ }
+
+ return elem;
+ }).append( this );
+ }
+
+ return this;
+ },
+
+ wrapInner: function( html ) {
+ if ( jQuery.isFunction( html ) ) {
+ return this.each(function(i) {
+ jQuery(this).wrapInner( html.call(this, i) );
+ });
+ }
+
+ return this.each(function() {
+ var self = jQuery( this ),
+ contents = self.contents();
+
+ if ( contents.length ) {
+ contents.wrapAll( html );
+
+ } else {
+ self.append( html );
+ }
+ });
+ },
+
+ wrap: function( html ) {
+ var isFunction = jQuery.isFunction( html );
+
+ return this.each(function(i) {
+ jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html );
+ });
+ },
+
+ unwrap: function() {
+ return this.parent().each(function() {
+ if ( !jQuery.nodeName( this, "body" ) ) {
+ jQuery( this ).replaceWith( this.childNodes );
+ }
+ }).end();
+ },
+
+ append: function() {
+ return this.domManip(arguments, true, function( elem ) {
+ if ( this.nodeType === 1 || this.nodeType === 11 ) {
+ this.appendChild( elem );
+ }
+ });
+ },
+
+ prepend: function() {
+ return this.domManip(arguments, true, function( elem ) {
+ if ( this.nodeType === 1 || this.nodeType === 11 ) {
+ this.insertBefore( elem, this.firstChild );
+ }
+ });
+ },
+
+ before: function() {
+ if ( !isDisconnected( this[0] ) ) {
+ return this.domManip(arguments, false, function( elem ) {
+ this.parentNode.insertBefore( elem, this );
+ });
+ }
+
+ if ( arguments.length ) {
+ var set = jQuery.clean( arguments );
+ return this.pushStack( jQuery.merge( set, this ), "before", this.selector );
+ }
+ },
+
+ after: function() {
+ if ( !isDisconnected( this[0] ) ) {
+ return this.domManip(arguments, false, function( elem ) {
+ this.parentNode.insertBefore( elem, this.nextSibling );
+ });
+ }
+
+ if ( arguments.length ) {
+ var set = jQuery.clean( arguments );
+ return this.pushStack( jQuery.merge( this, set ), "after", this.selector );
+ }
+ },
+
+ // keepData is for internal use only--do not document
+ remove: function( selector, keepData ) {
+ var elem,
+ i = 0;
+
+ for ( ; (elem = this[i]) != null; i++ ) {
+ if ( !selector || jQuery.filter( selector, [ elem ] ).length ) {
+ if ( !keepData && elem.nodeType === 1 ) {
+ jQuery.cleanData( elem.getElementsByTagName("*") );
+ jQuery.cleanData( [ elem ] );
+ }
+
+ if ( elem.parentNode ) {
+ elem.parentNode.removeChild( elem );
+ }
+ }
+ }
+
+ return this;
+ },
+
+ empty: function() {
+ var elem,
+ i = 0;
+
+ for ( ; (elem = this[i]) != null; i++ ) {
+ // Remove element nodes and prevent memory leaks
+ if ( elem.nodeType === 1 ) {
+ jQuery.cleanData( elem.getElementsByTagName("*") );
+ }
+
+ // Remove any remaining nodes
+ while ( elem.firstChild ) {
+ elem.removeChild( elem.firstChild );
+ }
+ }
+
+ return this;
+ },
+
+ clone: function( dataAndEvents, deepDataAndEvents ) {
+ dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
+ deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
+
+ return this.map( function () {
+ return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
+ });
+ },
+
+ html: function( value ) {
+ return jQuery.access( this, function( value ) {
+ var elem = this[0] || {},
+ i = 0,
+ l = this.length;
+
+ if ( value === undefined ) {
+ return elem.nodeType === 1 ?
+ elem.innerHTML.replace( rinlinejQuery, "" ) :
+ undefined;
+ }
+
+ // See if we can take a shortcut and just use innerHTML
+ if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
+ ( jQuery.support.htmlSerialize || !rnoshimcache.test( value ) ) &&
+ ( jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value ) ) &&
+ !wrapMap[ ( rtagName.exec( value ) || ["", ""] )[1].toLowerCase() ] ) {
+
+ value = value.replace( rxhtmlTag, "<$1></$2>" );
+
+ try {
+ for (; i < l; i++ ) {
+ // Remove element nodes and prevent memory leaks
+ elem = this[i] || {};
+ if ( elem.nodeType === 1 ) {
+ jQuery.cleanData( elem.getElementsByTagName( "*" ) );
+ elem.innerHTML = value;
+ }
+ }
+
+ elem = 0;
+
+ // If using innerHTML throws an exception, use the fallback method
+ } catch(e) {}
+ }
+
+ if ( elem ) {
+ this.empty().append( value );
+ }
+ }, null, value, arguments.length );
+ },
+
+ replaceWith: function( value ) {
+ if ( !isDisconnected( this[0] ) ) {
+ // Make sure that the elements are removed from the DOM before they are inserted
+ // this can help fix replacing a parent with child elements
+ if ( jQuery.isFunction( value ) ) {
+ return this.each(function(i) {
+ var self = jQuery(this), old = self.html();
+ self.replaceWith( value.call( this, i, old ) );
+ });
+ }
+
+ if ( typeof value !== "string" ) {
+ value = jQuery( value ).detach();
+ }
+
+ return this.each(function() {
+ var next = this.nextSibling,
+ parent = this.parentNode;
+
+ jQuery( this ).remove();
+
+ if ( next ) {
+ jQuery(next).before( value );
+ } else {
+ jQuery(parent).append( value );
+ }
+ });
+ }
+
+ return this.length ?
+ this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value ) :
+ this;
+ },
+
+ detach: function( selector ) {
+ return this.remove( selector, true );
+ },
+
+ domManip: function( args, table, callback ) {
+
+ // Flatten any nested arrays
+ args = [].concat.apply( [], args );
+
+ var results, first, fragment, iNoClone,
+ i = 0,
+ value = args[0],
+ scripts = [],
+ l = this.length;
+
+ // We can't cloneNode fragments that contain checked, in WebKit
+ if ( !jQuery.support.checkClone && l > 1 && typeof value === "string" && rchecked.test( value ) ) {
+ return this.each(function() {
+ jQuery(this).domManip( args, table, callback );
+ });
+ }
+
+ if ( jQuery.isFunction(value) ) {
+ return this.each(function(i) {
+ var self = jQuery(this);
+ args[0] = value.call( this, i, table ? self.html() : undefined );
+ self.domManip( args, table, callback );
+ });
+ }
+
+ if ( this[0] ) {
+ results = jQuery.buildFragment( args, this, scripts );
+ fragment = results.fragment;
+ first = fragment.firstChild;
+
+ if ( fragment.childNodes.length === 1 ) {
+ fragment = first;
+ }
+
+ if ( first ) {
+ table = table && jQuery.nodeName( first, "tr" );
+
+ // Use the original fragment for the last item instead of the first because it can end up
+ // being emptied incorrectly in certain situations (#8070).
+ // Fragments from the fragment cache must always be cloned and never used in place.
+ for ( iNoClone = results.cacheable || l - 1; i < l; i++ ) {
+ callback.call(
+ table && jQuery.nodeName( this[i], "table" ) ?
+ findOrAppend( this[i], "tbody" ) :
+ this[i],
+ i === iNoClone ?
+ fragment :
+ jQuery.clone( fragment, true, true )
+ );
+ }
+ }
+
+ // Fix #11809: Avoid leaking memory
+ fragment = first = null;
+
+ if ( scripts.length ) {
+ jQuery.each( scripts, function( i, elem ) {
+ if ( elem.src ) {
+ if ( jQuery.ajax ) {
+ jQuery.ajax({
+ url: elem.src,
+ type: "GET",
+ dataType: "script",
+ async: false,
+ global: false,
+ "throws": true
+ });
+ } else {
+ jQuery.error("no ajax");
+ }
+ } else {
+ jQuery.globalEval( ( elem.text || elem.textContent || elem.innerHTML || "" ).replace( rcleanScript, "" ) );
+ }
+
+ if ( elem.parentNode ) {
+ elem.parentNode.removeChild( elem );
+ }
+ });
+ }
+ }
+
+ return this;
+ }
+});
+
+function findOrAppend( elem, tag ) {
+ return elem.getElementsByTagName( tag )[0] || elem.appendChild( elem.ownerDocument.createElement( tag ) );
+}
+
+function cloneCopyEvent( src, dest ) {
+
+ if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) {
+ return;
+ }
+
+ var type, i, l,
+ oldData = jQuery._data( src ),
+ curData = jQuery._data( dest, oldData ),
+ events = oldData.events;
+
+ if ( events ) {
+ delete curData.handle;
+ curData.events = {};
+
+ for ( type in events ) {
+ for ( i = 0, l = events[ type ].length; i < l; i++ ) {
+ jQuery.event.add( dest, type, events[ type ][ i ] );
+ }
+ }
+ }
+
+ // make the cloned public data object a copy from the original
+ if ( curData.data ) {
+ curData.data = jQuery.extend( {}, curData.data );
+ }
+}
+
+function cloneFixAttributes( src, dest ) {
+ var nodeName;
+
+ // We do not need to do anything for non-Elements
+ if ( dest.nodeType !== 1 ) {
+ return;
+ }
+
+ // clearAttributes removes the attributes, which we don't want,
+ // but also removes the attachEvent events, which we *do* want
+ if ( dest.clearAttributes ) {
+ dest.clearAttributes();
+ }
+
+ // mergeAttributes, in contrast, only merges back on the
+ // original attributes, not the events
+ if ( dest.mergeAttributes ) {
+ dest.mergeAttributes( src );
+ }
+
+ nodeName = dest.nodeName.toLowerCase();
+
+ if ( nodeName === "object" ) {
+ // IE6-10 improperly clones children of object elements using classid.
+ // IE10 throws NoModificationAllowedError if parent is null, #12132.
+ if ( dest.parentNode ) {
+ dest.outerHTML = src.outerHTML;
+ }
+
+ // This path appears unavoidable for IE9. When cloning an object
+ // element in IE9, the outerHTML strategy above is not sufficient.
+ // If the src has innerHTML and the destination does not,
+ // copy the src.innerHTML into the dest.innerHTML. #10324
+ if ( jQuery.support.html5Clone && (src.innerHTML && !jQuery.trim(dest.innerHTML)) ) {
+ dest.innerHTML = src.innerHTML;
+ }
+
+ } else if ( nodeName === "input" && rcheckableType.test( src.type ) ) {
+ // IE6-8 fails to persist the checked state of a cloned checkbox
+ // or radio button. Worse, IE6-7 fail to give the cloned element
+ // a checked appearance if the defaultChecked value isn't also set
+
+ dest.defaultChecked = dest.checked = src.checked;
+
+ // IE6-7 get confused and end up setting the value of a cloned
+ // checkbox/radio button to an empty string instead of "on"
+ if ( dest.value !== src.value ) {
+ dest.value = src.value;
+ }
+
+ // IE6-8 fails to return the selected option to the default selected
+ // state when cloning options
+ } else if ( nodeName === "option" ) {
+ dest.selected = src.defaultSelected;
+
+ // IE6-8 fails to set the defaultValue to the correct value when
+ // cloning other types of input fields
+ } else if ( nodeName === "input" || nodeName === "textarea" ) {
+ dest.defaultValue = src.defaultValue;
+
+ // IE blanks contents when cloning scripts
+ } else if ( nodeName === "script" && dest.text !== src.text ) {
+ dest.text = src.text;
+ }
+
+ // Event data gets referenced instead of copied if the expando
+ // gets copied too
+ dest.removeAttribute( jQuery.expando );
+}
+
+jQuery.buildFragment = function( args, context, scripts ) {
+ var fragment, cacheable, cachehit,
+ first = args[ 0 ];
+
+ // Set context from what may come in as undefined or a jQuery collection or a node
+ // Updated to fix #12266 where accessing context[0] could throw an exception in IE9/10 &
+ // also doubles as fix for #8950 where plain objects caused createDocumentFragment exception
+ context = context || document;
+ context = !context.nodeType && context[0] || context;
+ context = context.ownerDocument || context;
+
+ // Only cache "small" (1/2 KB) HTML strings that are associated with the main document
+ // Cloning options loses the selected state, so don't cache them
+ // IE 6 doesn't like it when you put <object> or <embed> elements in a fragment
+ // Also, WebKit does not clone 'checked' attributes on cloneNode, so don't cache
+ // Lastly, IE6,7,8 will not correctly reuse cached fragments that were created from unknown elems #10501
+ if ( args.length === 1 && typeof first === "string" && first.length < 512 && context === document &&
+ first.charAt(0) === "<" && !rnocache.test( first ) &&
+ (jQuery.support.checkClone || !rchecked.test( first )) &&
+ (jQuery.support.html5Clone || !rnoshimcache.test( first )) ) {
+
+ // Mark cacheable and look for a hit
+ cacheable = true;
+ fragment = jQuery.fragments[ first ];
+ cachehit = fragment !== undefined;
+ }
+
+ if ( !fragment ) {
+ fragment = context.createDocumentFragment();
+ jQuery.clean( args, context, fragment, scripts );
+
+ // Update the cache, but only store false
+ // unless this is a second parsing of the same content
+ if ( cacheable ) {
+ jQuery.fragments[ first ] = cachehit && fragment;
+ }
+ }
+
+ return { fragment: fragment, cacheable: cacheable };
+};
+
+jQuery.fragments = {};
+
+jQuery.each({
+ appendTo: "append",
+ prependTo: "prepend",
+ insertBefore: "before",
+ insertAfter: "after",
+ replaceAll: "replaceWith"
+}, function( name, original ) {
+ jQuery.fn[ name ] = function( selector ) {
+ var elems,
+ i = 0,
+ ret = [],
+ insert = jQuery( selector ),
+ l = insert.length,
+ parent = this.length === 1 && this[0].parentNode;
+
+ if ( (parent == null || parent && parent.nodeType === 11 && parent.childNodes.length === 1) && l === 1 ) {
+ insert[ original ]( this[0] );
+ return this;
+ } else {
+ for ( ; i < l; i++ ) {
+ elems = ( i > 0 ? this.clone(true) : this ).get();
+ jQuery( insert[i] )[ original ]( elems );
+ ret = ret.concat( elems );
+ }
+
+ return this.pushStack( ret, name, insert.selector );
+ }
+ };
+});
+
+function getAll( elem ) {
+ if ( typeof elem.getElementsByTagName !== "undefined" ) {
+ return elem.getElementsByTagName( "*" );
+
+ } else if ( typeof elem.querySelectorAll !== "undefined" ) {
+ return elem.querySelectorAll( "*" );
+
+ } else {
+ return [];
+ }
+}
+
+// Used in clean, fixes the defaultChecked property
+function fixDefaultChecked( elem ) {
+ if ( rcheckableType.test( elem.type ) ) {
+ elem.defaultChecked = elem.checked;
+ }
+}
+
+jQuery.extend({
+ clone: function( elem, dataAndEvents, deepDataAndEvents ) {
+ var srcElements,
+ destElements,
+ i,
+ clone;
+
+ if ( jQuery.support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) {
+ clone = elem.cloneNode( true );
+
+ // IE<=8 does not properly clone detached, unknown element nodes
+ } else {
+ fragmentDiv.innerHTML = elem.outerHTML;
+ fragmentDiv.removeChild( clone = fragmentDiv.firstChild );
+ }
+
+ if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) &&
+ (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) {
+ // IE copies events bound via attachEvent when using cloneNode.
+ // Calling detachEvent on the clone will also remove the events
+ // from the original. In order to get around this, we use some
+ // proprietary methods to clear the events. Thanks to MooTools
+ // guys for this hotness.
+
+ cloneFixAttributes( elem, clone );
+
+ // Using Sizzle here is crazy slow, so we use getElementsByTagName instead
+ srcElements = getAll( elem );
+ destElements = getAll( clone );
+
+ // Weird iteration because IE will replace the length property
+ // with an element if you are cloning the body and one of the
+ // elements on the page has a name or id of "length"
+ for ( i = 0; srcElements[i]; ++i ) {
+ // Ensure that the destination node is not null; Fixes #9587
+ if ( destElements[i] ) {
+ cloneFixAttributes( srcElements[i], destElements[i] );
+ }
+ }
+ }
+
+ // Copy the events from the original to the clone
+ if ( dataAndEvents ) {
+ cloneCopyEvent( elem, clone );
+
+ if ( deepDataAndEvents ) {
+ srcElements = getAll( elem );
+ destElements = getAll( clone );
+
+ for ( i = 0; srcElements[i]; ++i ) {
+ cloneCopyEvent( srcElements[i], destElements[i] );
+ }
+ }
+ }
+
+ srcElements = destElements = null;
+
+ // Return the cloned set
+ return clone;
+ },
+
+ clean: function( elems, context, fragment, scripts ) {
+ var i, j, elem, tag, wrap, depth, div, hasBody, tbody, len, handleScript, jsTags,
+ safe = context === document && safeFragment,
+ ret = [];
+
+ // Ensure that context is a document
+ if ( !context || typeof context.createDocumentFragment === "undefined" ) {
+ context = document;
+ }
+
+ // Use the already-created safe fragment if context permits
+ for ( i = 0; (elem = elems[i]) != null; i++ ) {
+ if ( typeof elem === "number" ) {
+ elem += "";
+ }
+
+ if ( !elem ) {
+ continue;
+ }
+
+ // Convert html string into DOM nodes
+ if ( typeof elem === "string" ) {
+ if ( !rhtml.test( elem ) ) {
+ elem = context.createTextNode( elem );
+ } else {
+ // Ensure a safe container in which to render the html
+ safe = safe || createSafeFragment( context );
+ div = context.createElement("div");
+ safe.appendChild( div );
+
+ // Fix "XHTML"-style tags in all browsers
+ elem = elem.replace(rxhtmlTag, "<$1></$2>");
+
+ // Go to html and back, then peel off extra wrappers
+ tag = ( rtagName.exec( elem ) || ["", ""] )[1].toLowerCase();
+ wrap = wrapMap[ tag ] || wrapMap._default;
+ depth = wrap[0];
+ div.innerHTML = wrap[1] + elem + wrap[2];
+
+ // Move to the right depth
+ while ( depth-- ) {
+ div = div.lastChild;
+ }
+
+ // Remove IE's autoinserted <tbody> from table fragments
+ if ( !jQuery.support.tbody ) {
+
+ // String was a <table>, *may* have spurious <tbody>
+ hasBody = rtbody.test(elem);
+ tbody = tag === "table" && !hasBody ?
+ div.firstChild && div.firstChild.childNodes :
+
+ // String was a bare <thead> or <tfoot>
+ wrap[1] === "<table>" && !hasBody ?
+ div.childNodes :
+ [];
+
+ for ( j = tbody.length - 1; j >= 0 ; --j ) {
+ if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) {
+ tbody[ j ].parentNode.removeChild( tbody[ j ] );
+ }
+ }
+ }
+
+ // IE completely kills leading whitespace when innerHTML is used
+ if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
+ div.insertBefore( context.createTextNode( rleadingWhitespace.exec(elem)[0] ), div.firstChild );
+ }
+
+ elem = div.childNodes;
+
+ // Take out of fragment container (we need a fresh div each time)
+ div.parentNode.removeChild( div );
+ }
+ }
+
+ if ( elem.nodeType ) {
+ ret.push( elem );
+ } else {
+ jQuery.merge( ret, elem );
+ }
+ }
+
+ // Fix #11356: Clear elements from safeFragment
+ if ( div ) {
+ elem = div = safe = null;
+ }
+
+ // Reset defaultChecked for any radios and checkboxes
+ // about to be appended to the DOM in IE 6/7 (#8060)
+ if ( !jQuery.support.appendChecked ) {
+ for ( i = 0; (elem = ret[i]) != null; i++ ) {
+ if ( jQuery.nodeName( elem, "input" ) ) {
+ fixDefaultChecked( elem );
+ } else if ( typeof elem.getElementsByTagName !== "undefined" ) {
+ jQuery.grep( elem.getElementsByTagName("input"), fixDefaultChecked );
+ }
+ }
+ }
+
+ // Append elements to a provided document fragment
+ if ( fragment ) {
+ // Special handling of each script element
+ handleScript = function( elem ) {
+ // Check if we consider it executable
+ if ( !elem.type || rscriptType.test( elem.type ) ) {
+ // Detach the script and store it in the scripts array (if provided) or the fragment
+ // Return truthy to indicate that it has been handled
+ return scripts ?
+ scripts.push( elem.parentNode ? elem.parentNode.removeChild( elem ) : elem ) :
+ fragment.appendChild( elem );
+ }
+ };
+
+ for ( i = 0; (elem = ret[i]) != null; i++ ) {
+ // Check if we're done after handling an executable script
+ if ( !( jQuery.nodeName( elem, "script" ) && handleScript( elem ) ) ) {
+ // Append to fragment and handle embedded scripts
+ fragment.appendChild( elem );
+ if ( typeof elem.getElementsByTagName !== "undefined" ) {
+ // handleScript alters the DOM, so use jQuery.merge to ensure snapshot iteration
+ jsTags = jQuery.grep( jQuery.merge( [], elem.getElementsByTagName("script") ), handleScript );
+
+ // Splice the scripts into ret after their former ancestor and advance our index beyond them
+ ret.splice.apply( ret, [i + 1, 0].concat( jsTags ) );
+ i += jsTags.length;
+ }
+ }
+ }
+ }
+
+ return ret;
+ },
+
+ cleanData: function( elems, /* internal */ acceptData ) {
+ var data, id, elem, type,
+ i = 0,
+ internalKey = jQuery.expando,
+ cache = jQuery.cache,
+ deleteExpando = jQuery.support.deleteExpando,
+ special = jQuery.event.special;
+
+ for ( ; (elem = elems[i]) != null; i++ ) {
+
+ if ( acceptData || jQuery.acceptData( elem ) ) {
+
+ id = elem[ internalKey ];
+ data = id && cache[ id ];
+
+ if ( data ) {
+ if ( data.events ) {
+ for ( type in data.events ) {
+ if ( special[ type ] ) {
+ jQuery.event.remove( elem, type );
+
+ // This is a shortcut to avoid jQuery.event.remove's overhead
+ } else {
+ jQuery.removeEvent( elem, type, data.handle );
+ }
+ }
+ }
+
+ // Remove cache only if it was not already removed by jQuery.event.remove
+ if ( cache[ id ] ) {
+
+ delete cache[ id ];
+
+ // IE does not allow us to delete expando properties from nodes,
+ // nor does it have a removeAttribute function on Document nodes;
+ // we must handle all of these cases
+ if ( deleteExpando ) {
+ delete elem[ internalKey ];
+
+ } else if ( elem.removeAttribute ) {
+ elem.removeAttribute( internalKey );
+
+ } else {
+ elem[ internalKey ] = null;
+ }
+
+ jQuery.deletedIds.push( id );
+ }
+ }
+ }
+ }
+ }
+});
+// Limit scope pollution from any deprecated API
+(function() {
+
+var matched, browser;
+
+// Use of jQuery.browser is frowned upon.
+// More details: http://api.jquery.com/jQuery.browser
+// jQuery.uaMatch maintained for back-compat
+jQuery.uaMatch = function( ua ) {
+ ua = ua.toLowerCase();
+
+ var match = /(chrome)[ \/]([\w.]+)/.exec( ua ) ||
+ /(webkit)[ \/]([\w.]+)/.exec( ua ) ||
+ /(opera)(?:.*version|)[ \/]([\w.]+)/.exec( ua ) ||
+ /(msie) ([\w.]+)/.exec( ua ) ||
+ ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec( ua ) ||
+ [];
+
+ return {
+ browser: match[ 1 ] || "",
+ version: match[ 2 ] || "0"
+ };
+};
+
+matched = jQuery.uaMatch( navigator.userAgent );
+browser = {};
+
+if ( matched.browser ) {
+ browser[ matched.browser ] = true;
+ browser.version = matched.version;
+}
+
+// Chrome is Webkit, but Webkit is also Safari.
+if ( browser.chrome ) {
+ browser.webkit = true;
+} else if ( browser.webkit ) {
+ browser.safari = true;
+}
+
+jQuery.browser = browser;
+
+jQuery.sub = function() {
+ function jQuerySub( selector, context ) {
+ return new jQuerySub.fn.init( selector, context );
+ }
+ jQuery.extend( true, jQuerySub, this );
+ jQuerySub.superclass = this;
+ jQuerySub.fn = jQuerySub.prototype = this();
+ jQuerySub.fn.constructor = jQuerySub;
+ jQuerySub.sub = this.sub;
+ jQuerySub.fn.init = function init( selector, context ) {
+ if ( context && context instanceof jQuery && !(context instanceof jQuerySub) ) {
+ context = jQuerySub( context );
+ }
+
+ return jQuery.fn.init.call( this, selector, context, rootjQuerySub );
+ };
+ jQuerySub.fn.init.prototype = jQuerySub.fn;
+ var rootjQuerySub = jQuerySub(document);
+ return jQuerySub;
+};
+
+})();
+var curCSS, iframe, iframeDoc,
+ ralpha = /alpha\([^)]*\)/i,
+ ropacity = /opacity=([^)]*)/,
+ rposition = /^(top|right|bottom|left)$/,
+ // swappable if display is none or starts with table except "table", "table-cell", or "table-caption"
+ // see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
+ rdisplayswap = /^(none|table(?!-c[ea]).+)/,
+ rmargin = /^margin/,
+ rnumsplit = new RegExp( "^(" + core_pnum + ")(.*)$", "i" ),
+ rnumnonpx = new RegExp( "^(" + core_pnum + ")(?!px)[a-z%]+$", "i" ),
+ rrelNum = new RegExp( "^([-+])=(" + core_pnum + ")", "i" ),
+ elemdisplay = {},
+
+ cssShow = { position: "absolute", visibility: "hidden", display: "block" },
+ cssNormalTransform = {
+ letterSpacing: 0,
+ fontWeight: 400
+ },
+
+ cssExpand = [ "Top", "Right", "Bottom", "Left" ],
+ cssPrefixes = [ "Webkit", "O", "Moz", "ms" ],
+
+ eventsToggle = jQuery.fn.toggle;
+
+// return a css property mapped to a potentially vendor prefixed property
+function vendorPropName( style, name ) {
+
+ // shortcut for names that are not vendor prefixed
+ if ( name in style ) {
+ return name;
+ }
+
+ // check for vendor prefixed names
+ var capName = name.charAt(0).toUpperCase() + name.slice(1),
+ origName = name,
+ i = cssPrefixes.length;
+
+ while ( i-- ) {
+ name = cssPrefixes[ i ] + capName;
+ if ( name in style ) {
+ return name;
+ }
+ }
+
+ return origName;
+}
+
+function isHidden( elem, el ) {
+ elem = el || elem;
+ return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem );
+}
+
+function showHide( elements, show ) {
+ var elem, display,
+ values = [],
+ index = 0,
+ length = elements.length;
+
+ for ( ; index < length; index++ ) {
+ elem = elements[ index ];
+ if ( !elem.style ) {
+ continue;
+ }
+ values[ index ] = jQuery._data( elem, "olddisplay" );
+ if ( show ) {
+ // Reset the inline display of this element to learn if it is
+ // being hidden by cascaded rules or not
+ if ( !values[ index ] && elem.style.display === "none" ) {
+ elem.style.display = "";
+ }
+
+ // Set elements which have been overridden with display: none
+ // in a stylesheet to whatever the default browser style is
+ // for such an element
+ if ( elem.style.display === "" && isHidden( elem ) ) {
+ values[ index ] = jQuery._data( elem, "olddisplay", css_defaultDisplay(elem.nodeName) );
+ }
+ } else {
+ display = curCSS( elem, "display" );
+
+ if ( !values[ index ] && display !== "none" ) {
+ jQuery._data( elem, "olddisplay", display );
+ }
+ }
+ }
+
+ // Set the display of most of the elements in a second loop
+ // to avoid the constant reflow
+ for ( index = 0; index < length; index++ ) {
+ elem = elements[ index ];
+ if ( !elem.style ) {
+ continue;
+ }
+ if ( !show || elem.style.display === "none" || elem.style.display === "" ) {
+ elem.style.display = show ? values[ index ] || "" : "none";
+ }
+ }
+
+ return elements;
+}
+
+jQuery.fn.extend({
+ css: function( name, value ) {
+ return jQuery.access( this, function( elem, name, value ) {
+ return value !== undefined ?
+ jQuery.style( elem, name, value ) :
+ jQuery.css( elem, name );
+ }, name, value, arguments.length > 1 );
+ },
+ show: function() {
+ return showHide( this, true );
+ },
+ hide: function() {
+ return showHide( this );
+ },
+ toggle: function( state, fn2 ) {
+ var bool = typeof state === "boolean";
+
+ if ( jQuery.isFunction( state ) && jQuery.isFunction( fn2 ) ) {
+ return eventsToggle.apply( this, arguments );
+ }
+
+ return this.each(function() {
+ if ( bool ? state : isHidden( this ) ) {
+ jQuery( this ).show();
+ } else {
+ jQuery( this ).hide();
+ }
+ });
+ }
+});
+
+jQuery.extend({
+ // Add in style property hooks for overriding the default
+ // behavior of getting and setting a style property
+ cssHooks: {
+ opacity: {
+ get: function( elem, computed ) {
+ if ( computed ) {
+ // We should always get a number back from opacity
+ var ret = curCSS( elem, "opacity" );
+ return ret === "" ? "1" : ret;
+
+ }
+ }
+ }
+ },
+
+ // Exclude the following css properties to add px
+ cssNumber: {
+ "fillOpacity": true,
+ "fontWeight": true,
+ "lineHeight": true,
+ "opacity": true,
+ "orphans": true,
+ "widows": true,
+ "zIndex": true,
+ "zoom": true
+ },
+
+ // Add in properties whose names you wish to fix before
+ // setting or getting the value
+ cssProps: {
+ // normalize float css property
+ "float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat"
+ },
+
+ // Get and set the style property on a DOM Node
+ style: function( elem, name, value, extra ) {
+ // Don't set styles on text and comment nodes
+ if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
+ return;
+ }
+
+ // Make sure that we're working with the right name
+ var ret, type, hooks,
+ origName = jQuery.camelCase( name ),
+ style = elem.style;
+
+ name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) );
+
+ // gets hook for the prefixed version
+ // followed by the unprefixed version
+ hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
+
+ // Check if we're setting a value
+ if ( value !== undefined ) {
+ type = typeof value;
+
+ // convert relative number strings (+= or -=) to relative numbers. #7345
+ if ( type === "string" && (ret = rrelNum.exec( value )) ) {
+ value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) );
+ // Fixes bug #9237
+ type = "number";
+ }
+
+ // Make sure that NaN and null values aren't set. See: #7116
+ if ( value == null || type === "number" && isNaN( value ) ) {
+ return;
+ }
+
+ // If a number was passed in, add 'px' to the (except for certain CSS properties)
+ if ( type === "number" && !jQuery.cssNumber[ origName ] ) {
+ value += "px";
+ }
+
+ // If a hook was provided, use that value, otherwise just set the specified value
+ if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) {
+ // Wrapped to prevent IE from throwing errors when 'invalid' values are provided
+ // Fixes bug #5509
+ try {
+ style[ name ] = value;
+ } catch(e) {}
+ }
+
+ } else {
+ // If a hook was provided get the non-computed value from there
+ if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {
+ return ret;
+ }
+
+ // Otherwise just get the value from the style object
+ return style[ name ];
+ }
+ },
+
+ css: function( elem, name, numeric, extra ) {
+ var val, num, hooks,
+ origName = jQuery.camelCase( name );
+
+ // Make sure that we're working with the right name
+ name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) );
+
+ // gets hook for the prefixed version
+ // followed by the unprefixed version
+ hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
+
+ // If a hook was provided get the computed value from there
+ if ( hooks && "get" in hooks ) {
+ val = hooks.get( elem, true, extra );
+ }
+
+ // Otherwise, if a way to get the computed value exists, use that
+ if ( val === undefined ) {
+ val = curCSS( elem, name );
+ }
+
+ //convert "normal" to computed value
+ if ( val === "normal" && name in cssNormalTransform ) {
+ val = cssNormalTransform[ name ];
+ }
+
+ // Return, converting to number if forced or a qualifier was provided and val looks numeric
+ if ( numeric || extra !== undefined ) {
+ num = parseFloat( val );
+ return numeric || jQuery.isNumeric( num ) ? num || 0 : val;
+ }
+ return val;
+ },
+
+ // A method for quickly swapping in/out CSS properties to get correct calculations
+ swap: function( elem, options, callback ) {
+ var ret, name,
+ old = {};
+
+ // Remember the old values, and insert the new ones
+ for ( name in options ) {
+ old[ name ] = elem.style[ name ];
+ elem.style[ name ] = options[ name ];
+ }
+
+ ret = callback.call( elem );
+
+ // Revert the old values
+ for ( name in options ) {
+ elem.style[ name ] = old[ name ];
+ }
+
+ return ret;
+ }
+});
+
+// NOTE: To any future maintainer, we've window.getComputedStyle
+// because jsdom on node.js will break without it.
+if ( window.getComputedStyle ) {
+ curCSS = function( elem, name ) {
+ var ret, width, minWidth, maxWidth,
+ computed = window.getComputedStyle( elem, null ),
+ style = elem.style;
+
+ if ( computed ) {
+
+ ret = computed[ name ];
+ if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {
+ ret = jQuery.style( elem, name );
+ }
+
+ // A tribute to the "awesome hack by Dean Edwards"
+ // Chrome < 17 and Safari 5.0 uses "computed value" instead of "used value" for margin-right
+ // Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels
+ // this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values
+ if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) {
+ width = style.width;
+ minWidth = style.minWidth;
+ maxWidth = style.maxWidth;
+
+ style.minWidth = style.maxWidth = style.width = ret;
+ ret = computed.width;
+
+ style.width = width;
+ style.minWidth = minWidth;
+ style.maxWidth = maxWidth;
+ }
+ }
+
+ return ret;
+ };
+} else if ( document.documentElement.currentStyle ) {
+ curCSS = function( elem, name ) {
+ var left, rsLeft,
+ ret = elem.currentStyle && elem.currentStyle[ name ],
+ style = elem.style;
+
+ // Avoid setting ret to empty string here
+ // so we don't default to auto
+ if ( ret == null && style && style[ name ] ) {
+ ret = style[ name ];
+ }
+
+ // From the awesome hack by Dean Edwards
+ // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
+
+ // If we're not dealing with a regular pixel number
+ // but a number that has a weird ending, we need to convert it to pixels
+ // but not position css attributes, as those are proportional to the parent element instead
+ // and we can't measure the parent instead because it might trigger a "stacking dolls" problem
+ if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) {
+
+ // Remember the original values
+ left = style.left;
+ rsLeft = elem.runtimeStyle && elem.runtimeStyle.left;
+
+ // Put in the new values to get a computed value out
+ if ( rsLeft ) {
+ elem.runtimeStyle.left = elem.currentStyle.left;
+ }
+ style.left = name === "fontSize" ? "1em" : ret;
+ ret = style.pixelLeft + "px";
+
+ // Revert the changed values
+ style.left = left;
+ if ( rsLeft ) {
+ elem.runtimeStyle.left = rsLeft;
+ }
+ }
+
+ return ret === "" ? "auto" : ret;
+ };
+}
+
+function setPositiveNumber( elem, value, subtract ) {
+ var matches = rnumsplit.exec( value );
+ return matches ?
+ Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) :
+ value;
+}
+
+function augmentWidthOrHeight( elem, name, extra, isBorderBox ) {
+ var i = extra === ( isBorderBox ? "border" : "content" ) ?
+ // If we already have the right measurement, avoid augmentation
+ 4 :
+ // Otherwise initialize for horizontal or vertical properties
+ name === "width" ? 1 : 0,
+
+ val = 0;
+
+ for ( ; i < 4; i += 2 ) {
+ // both box models exclude margin, so add it if we want it
+ if ( extra === "margin" ) {
+ // we use jQuery.css instead of curCSS here
+ // because of the reliableMarginRight CSS hook!
+ val += jQuery.css( elem, extra + cssExpand[ i ], true );
+ }
+
+ // From this point on we use curCSS for maximum performance (relevant in animations)
+ if ( isBorderBox ) {
+ // border-box includes padding, so remove it if we want content
+ if ( extra === "content" ) {
+ val -= parseFloat( curCSS( elem, "padding" + cssExpand[ i ] ) ) || 0;
+ }
+
+ // at this point, extra isn't border nor margin, so remove border
+ if ( extra !== "margin" ) {
+ val -= parseFloat( curCSS( elem, "border" + cssExpand[ i ] + "Width" ) ) || 0;
+ }
+ } else {
+ // at this point, extra isn't content, so add padding
+ val += parseFloat( curCSS( elem, "padding" + cssExpand[ i ] ) ) || 0;
+
+ // at this point, extra isn't content nor padding, so add border
+ if ( extra !== "padding" ) {
+ val += parseFloat( curCSS( elem, "border" + cssExpand[ i ] + "Width" ) ) || 0;
+ }
+ }
+ }
+
+ return val;
+}
+
+function getWidthOrHeight( elem, name, extra ) {
+
+ // Start with offset property, which is equivalent to the border-box value
+ var val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
+ valueIsBorderBox = true,
+ isBorderBox = jQuery.support.boxSizing && jQuery.css( elem, "boxSizing" ) === "border-box";
+
+ // some non-html elements return undefined for offsetWidth, so check for null/undefined
+ // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
+ // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668
+ if ( val <= 0 || val == null ) {
+ // Fall back to computed then uncomputed css if necessary
+ val = curCSS( elem, name );
+ if ( val < 0 || val == null ) {
+ val = elem.style[ name ];
+ }
+
+ // Computed unit is not pixels. Stop here and return.
+ if ( rnumnonpx.test(val) ) {
+ return val;
+ }
+
+ // we need the check for style in case a browser which returns unreliable values
+ // for getComputedStyle silently falls back to the reliable elem.style
+ valueIsBorderBox = isBorderBox && ( jQuery.support.boxSizingReliable || val === elem.style[ name ] );
+
+ // Normalize "", auto, and prepare for extra
+ val = parseFloat( val ) || 0;
+ }
+
+ // use the active box-sizing model to add/subtract irrelevant styles
+ return ( val +
+ augmentWidthOrHeight(
+ elem,
+ name,
+ extra || ( isBorderBox ? "border" : "content" ),
+ valueIsBorderBox
+ )
+ ) + "px";
+}
+
+
+// Try to determine the default display value of an element
+function css_defaultDisplay( nodeName ) {
+ if ( elemdisplay[ nodeName ] ) {
+ return elemdisplay[ nodeName ];
+ }
+
+ var elem = jQuery( "<" + nodeName + ">" ).appendTo( document.body ),
+ display = elem.css("display");
+ elem.remove();
+
+ // If the simple way fails,
+ // get element's real default display by attaching it to a temp iframe
+ if ( display === "none" || display === "" ) {
+ // Use the already-created iframe if possible
+ iframe = document.body.appendChild(
+ iframe || jQuery.extend( document.createElement("iframe"), {
+ frameBorder: 0,
+ width: 0,
+ height: 0
+ })
+ );
+
+ // Create a cacheable copy of the iframe document on first call.
+ // IE and Opera will allow us to reuse the iframeDoc without re-writing the fake HTML
+ // document to it; WebKit & Firefox won't allow reusing the iframe document.
+ if ( !iframeDoc || !iframe.createElement ) {
+ iframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document;
+ iframeDoc.write("<!doctype html><html><body>");
+ iframeDoc.close();
+ }
+
+ elem = iframeDoc.body.appendChild( iframeDoc.createElement(nodeName) );
+
+ display = curCSS( elem, "display" );
+ document.body.removeChild( iframe );
+ }
+
+ // Store the correct default display
+ elemdisplay[ nodeName ] = display;
+
+ return display;
+}
+
+jQuery.each([ "height", "width" ], function( i, name ) {
+ jQuery.cssHooks[ name ] = {
+ get: function( elem, computed, extra ) {
+ if ( computed ) {
+ // certain elements can have dimension info if we invisibly show them
+ // however, it must have a current display style that would benefit from this
+ if ( elem.offsetWidth === 0 && rdisplayswap.test( curCSS( elem, "display" ) ) ) {
+ return jQuery.swap( elem, cssShow, function() {
+ return getWidthOrHeight( elem, name, extra );
+ });
+ } else {
+ return getWidthOrHeight( elem, name, extra );
+ }
+ }
+ },
+
+ set: function( elem, value, extra ) {
+ return setPositiveNumber( elem, value, extra ?
+ augmentWidthOrHeight(
+ elem,
+ name,
+ extra,
+ jQuery.support.boxSizing && jQuery.css( elem, "boxSizing" ) === "border-box"
+ ) : 0
+ );
+ }
+ };
+});
+
+if ( !jQuery.support.opacity ) {
+ jQuery.cssHooks.opacity = {
+ get: function( elem, computed ) {
+ // IE uses filters for opacity
+ return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ?
+ ( 0.01 * parseFloat( RegExp.$1 ) ) + "" :
+ computed ? "1" : "";
+ },
+
+ set: function( elem, value ) {
+ var style = elem.style,
+ currentStyle = elem.currentStyle,
+ opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "",
+ filter = currentStyle && currentStyle.filter || style.filter || "";
+
+ // IE has trouble with opacity if it does not have layout
+ // Force it by setting the zoom level
+ style.zoom = 1;
+
+ // if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652
+ if ( value >= 1 && jQuery.trim( filter.replace( ralpha, "" ) ) === "" &&
+ style.removeAttribute ) {
+
+ // Setting style.filter to null, "" & " " still leave "filter:" in the cssText
+ // if "filter:" is present at all, clearType is disabled, we want to avoid this
+ // style.removeAttribute is IE Only, but so apparently is this code path...
+ style.removeAttribute( "filter" );
+
+ // if there there is no filter style applied in a css rule, we are done
+ if ( currentStyle && !currentStyle.filter ) {
+ return;
+ }
+ }
+
+ // otherwise, set new filter values
+ style.filter = ralpha.test( filter ) ?
+ filter.replace( ralpha, opacity ) :
+ filter + " " + opacity;
+ }
+ };
+}
+
+// These hooks cannot be added until DOM ready because the support test
+// for it is not run until after DOM ready
+jQuery(function() {
+ if ( !jQuery.support.reliableMarginRight ) {
+ jQuery.cssHooks.marginRight = {
+ get: function( elem, computed ) {
+ // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
+ // Work around by temporarily setting element display to inline-block
+ return jQuery.swap( elem, { "display": "inline-block" }, function() {
+ if ( computed ) {
+ return curCSS( elem, "marginRight" );
+ }
+ });
+ }
+ };
+ }
+
+ // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
+ // getComputedStyle returns percent when specified for top/left/bottom/right
+ // rather than make the css module depend on the offset module, we just check for it here
+ if ( !jQuery.support.pixelPosition && jQuery.fn.position ) {
+ jQuery.each( [ "top", "left" ], function( i, prop ) {
+ jQuery.cssHooks[ prop ] = {
+ get: function( elem, computed ) {
+ if ( computed ) {
+ var ret = curCSS( elem, prop );
+ // if curCSS returns percentage, fallback to offset
+ return rnumnonpx.test( ret ) ? jQuery( elem ).position()[ prop ] + "px" : ret;
+ }
+ }
+ };
+ });
+ }
+
+});
+
+if ( jQuery.expr && jQuery.expr.filters ) {
+ jQuery.expr.filters.hidden = function( elem ) {
+ return ( elem.offsetWidth === 0 && elem.offsetHeight === 0 ) || (!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display) || curCSS( elem, "display" )) === "none");
+ };
+
+ jQuery.expr.filters.visible = function( elem ) {
+ return !jQuery.expr.filters.hidden( elem );
+ };
+}
+
+// These hooks are used by animate to expand properties
+jQuery.each({
+ margin: "",
+ padding: "",
+ border: "Width"
+}, function( prefix, suffix ) {
+ jQuery.cssHooks[ prefix + suffix ] = {
+ expand: function( value ) {
+ var i,
+
+ // assumes a single number if not a string
+ parts = typeof value === "string" ? value.split(" ") : [ value ],
+ expanded = {};
+
+ for ( i = 0; i < 4; i++ ) {
+ expanded[ prefix + cssExpand[ i ] + suffix ] =
+ parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
+ }
+
+ return expanded;
+ }
+ };
+
+ if ( !rmargin.test( prefix ) ) {
+ jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
+ }
+});
+var r20 = /%20/g,
+ rbracket = /\[\]$/,
+ rCRLF = /\r?\n/g,
+ rinput = /^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,
+ rselectTextarea = /^(?:select|textarea)/i;
+
+jQuery.fn.extend({
+ serialize: function() {
+ return jQuery.param( this.serializeArray() );
+ },
+ serializeArray: function() {
+ return this.map(function(){
+ return this.elements ? jQuery.makeArray( this.elements ) : this;
+ })
+ .filter(function(){
+ return this.name && !this.disabled &&
+ ( this.checked || rselectTextarea.test( this.nodeName ) ||
+ rinput.test( this.type ) );
+ })
+ .map(function( i, elem ){
+ var val = jQuery( this ).val();
+
+ return val == null ?
+ null :
+ jQuery.isArray( val ) ?
+ jQuery.map( val, function( val, i ){
+ return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
+ }) :
+ { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
+ }).get();
+ }
+});
+
+//Serialize an array of form elements or a set of
+//key/values into a query string
+jQuery.param = function( a, traditional ) {
+ var prefix,
+ s = [],
+ add = function( key, value ) {
+ // If value is a function, invoke it and return its value
+ value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value );
+ s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
+ };
+
+ // Set traditional to true for jQuery <= 1.3.2 behavior.
+ if ( traditional === undefined ) {
+ traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional;
+ }
+
+ // If an array was passed in, assume that it is an array of form elements.
+ if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
+ // Serialize the form elements
+ jQuery.each( a, function() {
+ add( this.name, this.value );
+ });
+
+ } else {
+ // If traditional, encode the "old" way (the way 1.3.2 or older
+ // did it), otherwise encode params recursively.
+ for ( prefix in a ) {
+ buildParams( prefix, a[ prefix ], traditional, add );
+ }
+ }
+
+ // Return the resulting serialization
+ return s.join( "&" ).replace( r20, "+" );
+};
+
+function buildParams( prefix, obj, traditional, add ) {
+ var name;
+
+ if ( jQuery.isArray( obj ) ) {
+ // Serialize array item.
+ jQuery.each( obj, function( i, v ) {
+ if ( traditional || rbracket.test( prefix ) ) {
+ // Treat each array item as a scalar.
+ add( prefix, v );
+
+ } else {
+ // If array item is non-scalar (array or object), encode its
+ // numeric index to resolve deserialization ambiguity issues.
+ // Note that rack (as of 1.0.0) can't currently deserialize
+ // nested arrays properly, and attempting to do so may cause
+ // a server error. Possible fixes are to modify rack's
+ // deserialization algorithm or to provide an option or flag
+ // to force array serialization to be shallow.
+ buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add );
+ }
+ });
+
+ } else if ( !traditional && jQuery.type( obj ) === "object" ) {
+ // Serialize object item.
+ for ( name in obj ) {
+ buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
+ }
+
+ } else {
+ // Serialize scalar item.
+ add( prefix, obj );
+ }
+}
+var
+ // Document location
+ ajaxLocParts,
+ ajaxLocation,
+
+ rhash = /#.*$/,
+ rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL
+ // #7653, #8125, #8152: local protocol detection
+ rlocalProtocol = /^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,
+ rnoContent = /^(?:GET|HEAD)$/,
+ rprotocol = /^\/\//,
+ rquery = /\?/,
+ rscript = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
+ rts = /([?&])_=[^&]*/,
+ rurl = /^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,
+
+ // Keep a copy of the old load method
+ _load = jQuery.fn.load,
+
+ /* Prefilters
+ * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
+ * 2) These are called:
+ * - BEFORE asking for a transport
+ * - AFTER param serialization (s.data is a string if s.processData is true)
+ * 3) key is the dataType
+ * 4) the catchall symbol "*" can be used
+ * 5) execution will start with transport dataType and THEN continue down to "*" if needed
+ */
+ prefilters = {},
+
+ /* Transports bindings
+ * 1) key is the dataType
+ * 2) the catchall symbol "*" can be used
+ * 3) selection will start with transport dataType and THEN go to "*" if needed
+ */
+ transports = {},
+
+ // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
+ allTypes = ["*/"] + ["*"];
+
+// #8138, IE may throw an exception when accessing
+// a field from window.location if document.domain has been set
+try {
+ ajaxLocation = location.href;
+} catch( e ) {
+ // Use the href attribute of an A element
+ // since IE will modify it given document.location
+ ajaxLocation = document.createElement( "a" );
+ ajaxLocation.href = "";
+ ajaxLocation = ajaxLocation.href;
+}
+
+// Segment location into parts
+ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];
+
+// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
+function addToPrefiltersOrTransports( structure ) {
+
+ // dataTypeExpression is optional and defaults to "*"
+ return function( dataTypeExpression, func ) {
+
+ if ( typeof dataTypeExpression !== "string" ) {
+ func = dataTypeExpression;
+ dataTypeExpression = "*";
+ }
+
+ var dataType, list, placeBefore,
+ dataTypes = dataTypeExpression.toLowerCase().split( core_rspace ),
+ i = 0,
+ length = dataTypes.length;
+
+ if ( jQuery.isFunction( func ) ) {
+ // For each dataType in the dataTypeExpression
+ for ( ; i < length; i++ ) {
+ dataType = dataTypes[ i ];
+ // We control if we're asked to add before
+ // any existing element
+ placeBefore = /^\+/.test( dataType );
+ if ( placeBefore ) {
+ dataType = dataType.substr( 1 ) || "*";
+ }
+ list = structure[ dataType ] = structure[ dataType ] || [];
+ // then we add to the structure accordingly
+ list[ placeBefore ? "unshift" : "push" ]( func );
+ }
+ }
+ };
+}
+
+// Base inspection function for prefilters and transports
+function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR,
+ dataType /* internal */, inspected /* internal */ ) {
+
+ dataType = dataType || options.dataTypes[ 0 ];
+ inspected = inspected || {};
+
+ inspected[ dataType ] = true;
+
+ var selection,
+ list = structure[ dataType ],
+ i = 0,
+ length = list ? list.length : 0,
+ executeOnly = ( structure === prefilters );
+
+ for ( ; i < length && ( executeOnly || !selection ); i++ ) {
+ selection = list[ i ]( options, originalOptions, jqXHR );
+ // If we got redirected to another dataType
+ // we try there if executing only and not done already
+ if ( typeof selection === "string" ) {
+ if ( !executeOnly || inspected[ selection ] ) {
+ selection = undefined;
+ } else {
+ options.dataTypes.unshift( selection );
+ selection = inspectPrefiltersOrTransports(
+ structure, options, originalOptions, jqXHR, selection, inspected );
+ }
+ }
+ }
+ // If we're only executing or nothing was selected
+ // we try the catchall dataType if not done already
+ if ( ( executeOnly || !selection ) && !inspected[ "*" ] ) {
+ selection = inspectPrefiltersOrTransports(
+ structure, options, originalOptions, jqXHR, "*", inspected );
+ }
+ // unnecessary when only executing (prefilters)
+ // but it'll be ignored by the caller in that case
+ return selection;
+}
+
+// A special extend for ajax options
+// that takes "flat" options (not to be deep extended)
+// Fixes #9887
+function ajaxExtend( target, src ) {
+ var key, deep,
+ flatOptions = jQuery.ajaxSettings.flatOptions || {};
+ for ( key in src ) {
+ if ( src[ key ] !== undefined ) {
+ ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];
+ }
+ }
+ if ( deep ) {
+ jQuery.extend( true, target, deep );
+ }
+}
+
+jQuery.fn.load = function( url, params, callback ) {
+ if ( typeof url !== "string" && _load ) {
+ return _load.apply( this, arguments );
+ }
+
+ // Don't do a request if no elements are being requested
+ if ( !this.length ) {
+ return this;
+ }
+
+ var selector, type, response,
+ self = this,
+ off = url.indexOf(" ");
+
+ if ( off >= 0 ) {
+ selector = url.slice( off, url.length );
+ url = url.slice( 0, off );
+ }
+
+ // If it's a function
+ if ( jQuery.isFunction( params ) ) {
+
+ // We assume that it's the callback
+ callback = params;
+ params = undefined;
+
+ // Otherwise, build a param string
+ } else if ( params && typeof params === "object" ) {
+ type = "POST";
+ }
+
+ // Request the remote document
+ jQuery.ajax({
+ url: url,
+
+ // if "type" variable is undefined, then "GET" method will be used
+ type: type,
+ dataType: "html",
+ data: params,
+ complete: function( jqXHR, status ) {
+ if ( callback ) {
+ self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] );
+ }
+ }
+ }).done(function( responseText ) {
+
+ // Save response for use in complete callback
+ response = arguments;
+
+ // See if a selector was specified
+ self.html( selector ?
+
+ // Create a dummy div to hold the results
+ jQuery("<div>")
+
+ // inject the contents of the document in, removing the scripts
+ // to avoid any 'Permission Denied' errors in IE
+ .append( responseText.replace( rscript, "" ) )
+
+ // Locate the specified elements
+ .find( selector ) :
+
+ // If not, just inject the full result
+ responseText );
+
+ });
+
+ return this;
+};
+
+// Attach a bunch of functions for handling common AJAX events
+jQuery.each( "ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split( " " ), function( i, o ){
+ jQuery.fn[ o ] = function( f ){
+ return this.on( o, f );
+ };
+});
+
+jQuery.each( [ "get", "post" ], function( i, method ) {
+ jQuery[ method ] = function( url, data, callback, type ) {
+ // shift arguments if data argument was omitted
+ if ( jQuery.isFunction( data ) ) {
+ type = type || callback;
+ callback = data;
+ data = undefined;
+ }
+
+ return jQuery.ajax({
+ type: method,
+ url: url,
+ data: data,
+ success: callback,
+ dataType: type
+ });
+ };
+});
+
+jQuery.extend({
+
+ getScript: function( url, callback ) {
+ return jQuery.get( url, undefined, callback, "script" );
+ },
+
+ getJSON: function( url, data, callback ) {
+ return jQuery.get( url, data, callback, "json" );
+ },
+
+ // Creates a full fledged settings object into target
+ // with both ajaxSettings and settings fields.
+ // If target is omitted, writes into ajaxSettings.
+ ajaxSetup: function( target, settings ) {
+ if ( settings ) {
+ // Building a settings object
+ ajaxExtend( target, jQuery.ajaxSettings );
+ } else {
+ // Extending ajaxSettings
+ settings = target;
+ target = jQuery.ajaxSettings;
+ }
+ ajaxExtend( target, settings );
+ return target;
+ },
+
+ ajaxSettings: {
+ url: ajaxLocation,
+ isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
+ global: true,
+ type: "GET",
+ contentType: "application/x-www-form-urlencoded; charset=UTF-8",
+ processData: true,
+ async: true,
+ /*
+ timeout: 0,
+ data: null,
+ dataType: null,
+ username: null,
+ password: null,
+ cache: null,
+ throws: false,
+ traditional: false,
+ headers: {},
+ */
+
+ accepts: {
+ xml: "application/xml, text/xml",
+ html: "text/html",
+ text: "text/plain",
+ json: "application/json, text/javascript",
+ "*": allTypes
+ },
+
+ contents: {
+ xml: /xml/,
+ html: /html/,
+ json: /json/
+ },
+
+ responseFields: {
+ xml: "responseXML",
+ text: "responseText"
+ },
+
+ // List of data converters
+ // 1) key format is "source_type destination_type" (a single space in-between)
+ // 2) the catchall symbol "*" can be used for source_type
+ converters: {
+
+ // Convert anything to text
+ "* text": window.String,
+
+ // Text to html (true = no transformation)
+ "text html": true,
+
+ // Evaluate text as a json expression
+ "text json": jQuery.parseJSON,
+
+ // Parse text as xml
+ "text xml": jQuery.parseXML
+ },
+
+ // For options that shouldn't be deep extended:
+ // you can add your own custom options here if
+ // and when you create one that shouldn't be
+ // deep extended (see ajaxExtend)
+ flatOptions: {
+ context: true,
+ url: true
+ }
+ },
+
+ ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
+ ajaxTransport: addToPrefiltersOrTransports( transports ),
+
+ // Main method
+ ajax: function( url, options ) {
+
+ // If url is an object, simulate pre-1.5 signature
+ if ( typeof url === "object" ) {
+ options = url;
+ url = undefined;
+ }
+
+ // Force options to be an object
+ options = options || {};
+
+ var // ifModified key
+ ifModifiedKey,
+ // Response headers
+ responseHeadersString,
+ responseHeaders,
+ // transport
+ transport,
+ // timeout handle
+ timeoutTimer,
+ // Cross-domain detection vars
+ parts,
+ // To know if global events are to be dispatched
+ fireGlobals,
+ // Loop variable
+ i,
+ // Create the final options object
+ s = jQuery.ajaxSetup( {}, options ),
+ // Callbacks context
+ callbackContext = s.context || s,
+ // Context for global events
+ // It's the callbackContext if one was provided in the options
+ // and if it's a DOM node or a jQuery collection
+ globalEventContext = callbackContext !== s &&
+ ( callbackContext.nodeType || callbackContext instanceof jQuery ) ?
+ jQuery( callbackContext ) : jQuery.event,
+ // Deferreds
+ deferred = jQuery.Deferred(),
+ completeDeferred = jQuery.Callbacks( "once memory" ),
+ // Status-dependent callbacks
+ statusCode = s.statusCode || {},
+ // Headers (they are sent all at once)
+ requestHeaders = {},
+ requestHeadersNames = {},
+ // The jqXHR state
+ state = 0,
+ // Default abort message
+ strAbort = "canceled",
+ // Fake xhr
+ jqXHR = {
+
+ readyState: 0,
+
+ // Caches the header
+ setRequestHeader: function( name, value ) {
+ if ( !state ) {
+ var lname = name.toLowerCase();
+ name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
+ requestHeaders[ name ] = value;
+ }
+ return this;
+ },
+
+ // Raw string
+ getAllResponseHeaders: function() {
+ return state === 2 ? responseHeadersString : null;
+ },
+
+ // Builds headers hashtable if needed
+ getResponseHeader: function( key ) {
+ var match;
+ if ( state === 2 ) {
+ if ( !responseHeaders ) {
+ responseHeaders = {};
+ while( ( match = rheaders.exec( responseHeadersString ) ) ) {
+ responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];
+ }
+ }
+ match = responseHeaders[ key.toLowerCase() ];
+ }
+ return match === undefined ? null : match;
+ },
+
+ // Overrides response content-type header
+ overrideMimeType: function( type ) {
+ if ( !state ) {
+ s.mimeType = type;
+ }
+ return this;
+ },
+
+ // Cancel the request
+ abort: function( statusText ) {
+ statusText = statusText || strAbort;
+ if ( transport ) {
+ transport.abort( statusText );
+ }
+ done( 0, statusText );
+ return this;
+ }
+ };
+
+ // Callback for when everything is done
+ // It is defined here because jslint complains if it is declared
+ // at the end of the function (which would be more logical and readable)
+ function done( status, nativeStatusText, responses, headers ) {
+ var isSuccess, success, error, response, modified,
+ statusText = nativeStatusText;
+
+ // Called once
+ if ( state === 2 ) {
+ return;
+ }
+
+ // State is "done" now
+ state = 2;
+
+ // Clear timeout if it exists
+ if ( timeoutTimer ) {
+ clearTimeout( timeoutTimer );
+ }
+
+ // Dereference transport for early garbage collection
+ // (no matter how long the jqXHR object will be used)
+ transport = undefined;
+
+ // Cache response headers
+ responseHeadersString = headers || "";
+
+ // Set readyState
+ jqXHR.readyState = status > 0 ? 4 : 0;
+
+ // Get response data
+ if ( responses ) {
+ response = ajaxHandleResponses( s, jqXHR, responses );
+ }
+
+ // If successful, handle type chaining
+ if ( status >= 200 && status < 300 || status === 304 ) {
+
+ // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
+ if ( s.ifModified ) {
+
+ modified = jqXHR.getResponseHeader("Last-Modified");
+ if ( modified ) {
+ jQuery.lastModified[ ifModifiedKey ] = modified;
+ }
+ modified = jqXHR.getResponseHeader("Etag");
+ if ( modified ) {
+ jQuery.etag[ ifModifiedKey ] = modified;
+ }
+ }
+
+ // If not modified
+ if ( status === 304 ) {
+
+ statusText = "notmodified";
+ isSuccess = true;
+
+ // If we have data
+ } else {
+
+ isSuccess = ajaxConvert( s, response );
+ statusText = isSuccess.state;
+ success = isSuccess.data;
+ error = isSuccess.error;
+ isSuccess = !error;
+ }
+ } else {
+ // We extract error from statusText
+ // then normalize statusText and status for non-aborts
+ error = statusText;
+ if ( !statusText || status ) {
+ statusText = "error";
+ if ( status < 0 ) {
+ status = 0;
+ }
+ }
+ }
+
+ // Set data for the fake xhr object
+ jqXHR.status = status;
+ jqXHR.statusText = ( nativeStatusText || statusText ) + "";
+
+ // Success/Error
+ if ( isSuccess ) {
+ deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
+ } else {
+ deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
+ }
+
+ // Status-dependent callbacks
+ jqXHR.statusCode( statusCode );
+ statusCode = undefined;
+
+ if ( fireGlobals ) {
+ globalEventContext.trigger( "ajax" + ( isSuccess ? "Success" : "Error" ),
+ [ jqXHR, s, isSuccess ? success : error ] );
+ }
+
+ // Complete
+ completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
+
+ if ( fireGlobals ) {
+ globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
+ // Handle the global AJAX counter
+ if ( !( --jQuery.active ) ) {
+ jQuery.event.trigger( "ajaxStop" );
+ }
+ }
+ }
+
+ // Attach deferreds
+ deferred.promise( jqXHR );
+ jqXHR.success = jqXHR.done;
+ jqXHR.error = jqXHR.fail;
+ jqXHR.complete = completeDeferred.add;
+
+ // Status-dependent callbacks
+ jqXHR.statusCode = function( map ) {
+ if ( map ) {
+ var tmp;
+ if ( state < 2 ) {
+ for ( tmp in map ) {
+ statusCode[ tmp ] = [ statusCode[tmp], map[tmp] ];
+ }
+ } else {
+ tmp = map[ jqXHR.status ];
+ jqXHR.always( tmp );
+ }
+ }
+ return this;
+ };
+
+ // Remove hash character (#7531: and string promotion)
+ // Add protocol if not provided (#5866: IE7 issue with protocol-less urls)
+ // We also use the url parameter if available
+ s.url = ( ( url || s.url ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
+
+ // Extract dataTypes list
+ s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().split( core_rspace );
+
+ // A cross-domain request is in order when we have a protocol:host:port mismatch
+ if ( s.crossDomain == null ) {
+ parts = rurl.exec( s.url.toLowerCase() ) || false;
+ s.crossDomain = parts && ( parts.join(":") + ( parts[ 3 ] ? "" : parts[ 1 ] === "http:" ? 80 : 443 ) ) !==
+ ( ajaxLocParts.join(":") + ( ajaxLocParts[ 3 ] ? "" : ajaxLocParts[ 1 ] === "http:" ? 80 : 443 ) );
+ }
+
+ // Convert data if not already a string
+ if ( s.data && s.processData && typeof s.data !== "string" ) {
+ s.data = jQuery.param( s.data, s.traditional );
+ }
+
+ // Apply prefilters
+ inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
+
+ // If request was aborted inside a prefilter, stop there
+ if ( state === 2 ) {
+ return jqXHR;
+ }
+
+ // We can fire global events as of now if asked to
+ fireGlobals = s.global;
+
+ // Uppercase the type
+ s.type = s.type.toUpperCase();
+
+ // Determine if request has content
+ s.hasContent = !rnoContent.test( s.type );
+
+ // Watch for a new set of requests
+ if ( fireGlobals && jQuery.active++ === 0 ) {
+ jQuery.event.trigger( "ajaxStart" );
+ }
+
+ // More options handling for requests with no content
+ if ( !s.hasContent ) {
+
+ // If data is available, append data to url
+ if ( s.data ) {
+ s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.data;
+ // #9682: remove data so that it's not used in an eventual retry
+ delete s.data;
+ }
+
+ // Get ifModifiedKey before adding the anti-cache parameter
+ ifModifiedKey = s.url;
+
+ // Add anti-cache in url if needed
+ if ( s.cache === false ) {
+
+ var ts = jQuery.now(),
+ // try replacing _= if it is there
+ ret = s.url.replace( rts, "$1_=" + ts );
+
+ // if nothing was replaced, add timestamp to the end
+ s.url = ret + ( ( ret === s.url ) ? ( rquery.test( s.url ) ? "&" : "?" ) + "_=" + ts : "" );
+ }
+ }
+
+ // Set the correct header, if data is being sent
+ if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
+ jqXHR.setRequestHeader( "Content-Type", s.contentType );
+ }
+
+ // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
+ if ( s.ifModified ) {
+ ifModifiedKey = ifModifiedKey || s.url;
+ if ( jQuery.lastModified[ ifModifiedKey ] ) {
+ jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ ifModifiedKey ] );
+ }
+ if ( jQuery.etag[ ifModifiedKey ] ) {
+ jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ ifModifiedKey ] );
+ }
+ }
+
+ // Set the Accepts header for the server, depending on the dataType
+ jqXHR.setRequestHeader(
+ "Accept",
+ s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
+ s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
+ s.accepts[ "*" ]
+ );
+
+ // Check for headers option
+ for ( i in s.headers ) {
+ jqXHR.setRequestHeader( i, s.headers[ i ] );
+ }
+
+ // Allow custom headers/mimetypes and early abort
+ if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
+ // Abort if not done already and return
+ return jqXHR.abort();
+
+ }
+
+ // aborting is no longer a cancellation
+ strAbort = "abort";
+
+ // Install callbacks on deferreds
+ for ( i in { success: 1, error: 1, complete: 1 } ) {
+ jqXHR[ i ]( s[ i ] );
+ }
+
+ // Get transport
+ transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
+
+ // If no transport, we auto-abort
+ if ( !transport ) {
+ done( -1, "No Transport" );
+ } else {
+ jqXHR.readyState = 1;
+ // Send global event
+ if ( fireGlobals ) {
+ globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
+ }
+ // Timeout
+ if ( s.async && s.timeout > 0 ) {
+ timeoutTimer = setTimeout( function(){
+ jqXHR.abort( "timeout" );
+ }, s.timeout );
+ }
+
+ try {
+ state = 1;
+ transport.send( requestHeaders, done );
+ } catch (e) {
+ // Propagate exception as error if not done
+ if ( state < 2 ) {
+ done( -1, e );
+ // Simply rethrow otherwise
+ } else {
+ throw e;
+ }
+ }
+ }
+
+ return jqXHR;
+ },
+
+ // Counter for holding the number of active queries
+ active: 0,
+
+ // Last-Modified header cache for next request
+ lastModified: {},
+ etag: {}
+
+});
+
+/* Handles responses to an ajax request:
+ * - sets all responseXXX fields accordingly
+ * - finds the right dataType (mediates between content-type and expected dataType)
+ * - returns the corresponding response
+ */
+function ajaxHandleResponses( s, jqXHR, responses ) {
+
+ var ct, type, finalDataType, firstDataType,
+ contents = s.contents,
+ dataTypes = s.dataTypes,
+ responseFields = s.responseFields;
+
+ // Fill responseXXX fields
+ for ( type in responseFields ) {
+ if ( type in responses ) {
+ jqXHR[ responseFields[type] ] = responses[ type ];
+ }
+ }
+
+ // Remove auto dataType and get content-type in the process
+ while( dataTypes[ 0 ] === "*" ) {
+ dataTypes.shift();
+ if ( ct === undefined ) {
+ ct = s.mimeType || jqXHR.getResponseHeader( "content-type" );
+ }
+ }
+
+ // Check if we're dealing with a known content-type
+ if ( ct ) {
+ for ( type in contents ) {
+ if ( contents[ type ] && contents[ type ].test( ct ) ) {
+ dataTypes.unshift( type );
+ break;
+ }
+ }
+ }
+
+ // Check to see if we have a response for the expected dataType
+ if ( dataTypes[ 0 ] in responses ) {
+ finalDataType = dataTypes[ 0 ];
+ } else {
+ // Try convertible dataTypes
+ for ( type in responses ) {
+ if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {
+ finalDataType = type;
+ break;
+ }
+ if ( !firstDataType ) {
+ firstDataType = type;
+ }
+ }
+ // Or just use first one
+ finalDataType = finalDataType || firstDataType;
+ }
+
+ // If we found a dataType
+ // We add the dataType to the list if needed
+ // and return the corresponding response
+ if ( finalDataType ) {
+ if ( finalDataType !== dataTypes[ 0 ] ) {
+ dataTypes.unshift( finalDataType );
+ }
+ return responses[ finalDataType ];
+ }
+}
+
+// Chain conversions given the request and the original response
+function ajaxConvert( s, response ) {
+
+ var conv, conv2, current, tmp,
+ // Work with a copy of dataTypes in case we need to modify it for conversion
+ dataTypes = s.dataTypes.slice(),
+ prev = dataTypes[ 0 ],
+ converters = {},
+ i = 0;
+
+ // Apply the dataFilter if provided
+ if ( s.dataFilter ) {
+ response = s.dataFilter( response, s.dataType );
+ }
+
+ // Create converters map with lowercased keys
+ if ( dataTypes[ 1 ] ) {
+ for ( conv in s.converters ) {
+ converters[ conv.toLowerCase() ] = s.converters[ conv ];
+ }
+ }
+
+ // Convert to each sequential dataType, tolerating list modification
+ for ( ; (current = dataTypes[++i]); ) {
+
+ // There's only work to do if current dataType is non-auto
+ if ( current !== "*" ) {
+
+ // Convert response if prev dataType is non-auto and differs from current
+ if ( prev !== "*" && prev !== current ) {
+
+ // Seek a direct converter
+ conv = converters[ prev + " " + current ] || converters[ "* " + current ];
+
+ // If none found, seek a pair
+ if ( !conv ) {
+ for ( conv2 in converters ) {
+
+ // If conv2 outputs current
+ tmp = conv2.split(" ");
+ if ( tmp[ 1 ] === current ) {
+
+ // If prev can be converted to accepted input
+ conv = converters[ prev + " " + tmp[ 0 ] ] ||
+ converters[ "* " + tmp[ 0 ] ];
+ if ( conv ) {
+ // Condense equivalence converters
+ if ( conv === true ) {
+ conv = converters[ conv2 ];
+
+ // Otherwise, insert the intermediate dataType
+ } else if ( converters[ conv2 ] !== true ) {
+ current = tmp[ 0 ];
+ dataTypes.splice( i--, 0, current );
+ }
+
+ break;
+ }
+ }
+ }
+ }
+
+ // Apply converter (if not an equivalence)
+ if ( conv !== true ) {
+
+ // Unless errors are allowed to bubble, catch and return them
+ if ( conv && s["throws"] ) {
+ response = conv( response );
+ } else {
+ try {
+ response = conv( response );
+ } catch ( e ) {
+ return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current };
+ }
+ }
+ }
+ }
+
+ // Update prev for next iteration
+ prev = current;
+ }
+ }
+
+ return { state: "success", data: response };
+}
+var oldCallbacks = [],
+ rquestion = /\?/,
+ rjsonp = /(=)\?(?=&|$)|\?\?/,
+ nonce = jQuery.now();
+
+// Default jsonp settings
+jQuery.ajaxSetup({
+ jsonp: "callback",
+ jsonpCallback: function() {
+ var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) );
+ this[ callback ] = true;
+ return callback;
+ }
+});
+
+// Detect, normalize options and install callbacks for jsonp requests
+jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
+
+ var callbackName, overwritten, responseContainer,
+ data = s.data,
+ url = s.url,
+ hasCallback = s.jsonp !== false,
+ replaceInUrl = hasCallback && rjsonp.test( url ),
+ replaceInData = hasCallback && !replaceInUrl && typeof data === "string" &&
+ !( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") &&
+ rjsonp.test( data );
+
+ // Handle iff the expected data type is "jsonp" or we have a parameter to set
+ if ( s.dataTypes[ 0 ] === "jsonp" || replaceInUrl || replaceInData ) {
+
+ // Get callback name, remembering preexisting value associated with it
+ callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ?
+ s.jsonpCallback() :
+ s.jsonpCallback;
+ overwritten = window[ callbackName ];
+
+ // Insert callback into url or form data
+ if ( replaceInUrl ) {
+ s.url = url.replace( rjsonp, "$1" + callbackName );
+ } else if ( replaceInData ) {
+ s.data = data.replace( rjsonp, "$1" + callbackName );
+ } else if ( hasCallback ) {
+ s.url += ( rquestion.test( url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
+ }
+
+ // Use data converter to retrieve json after script execution
+ s.converters["script json"] = function() {
+ if ( !responseContainer ) {
+ jQuery.error( callbackName + " was not called" );
+ }
+ return responseContainer[ 0 ];
+ };
+
+ // force json dataType
+ s.dataTypes[ 0 ] = "json";
+
+ // Install callback
+ window[ callbackName ] = function() {
+ responseContainer = arguments;
+ };
+
+ // Clean-up function (fires after converters)
+ jqXHR.always(function() {
+ // Restore preexisting value
+ window[ callbackName ] = overwritten;
+
+ // Save back as free
+ if ( s[ callbackName ] ) {
+ // make sure that re-using the options doesn't screw things around
+ s.jsonpCallback = originalSettings.jsonpCallback;
+
+ // save the callback name for future use
+ oldCallbacks.push( callbackName );
+ }
+
+ // Call if it was a function and we have a response
+ if ( responseContainer && jQuery.isFunction( overwritten ) ) {
+ overwritten( responseContainer[ 0 ] );
+ }
+
+ responseContainer = overwritten = undefined;
+ });
+
+ // Delegate to script
+ return "script";
+ }
+});
+// Install script dataType
+jQuery.ajaxSetup({
+ accepts: {
+ script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
+ },
+ contents: {
+ script: /javascript|ecmascript/
+ },
+ converters: {
+ "text script": function( text ) {
+ jQuery.globalEval( text );
+ return text;
+ }
+ }
+});
+
+// Handle cache's special case and global
+jQuery.ajaxPrefilter( "script", function( s ) {
+ if ( s.cache === undefined ) {
+ s.cache = false;
+ }
+ if ( s.crossDomain ) {
+ s.type = "GET";
+ s.global = false;
+ }
+});
+
+// Bind script tag hack transport
+jQuery.ajaxTransport( "script", function(s) {
+
+ // This transport only deals with cross domain requests
+ if ( s.crossDomain ) {
+
+ var script,
+ head = document.head || document.getElementsByTagName( "head" )[0] || document.documentElement;
+
+ return {
+
+ send: function( _, callback ) {
+
+ script = document.createElement( "script" );
+
+ script.async = "async";
+
+ if ( s.scriptCharset ) {
+ script.charset = s.scriptCharset;
+ }
+
+ script.src = s.url;
+
+ // Attach handlers for all browsers
+ script.onload = script.onreadystatechange = function( _, isAbort ) {
+
+ if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) {
+
+ // Handle memory leak in IE
+ script.onload = script.onreadystatechange = null;
+
+ // Remove the script
+ if ( head && script.parentNode ) {
+ head.removeChild( script );
+ }
+
+ // Dereference the script
+ script = undefined;
+
+ // Callback if not abort
+ if ( !isAbort ) {
+ callback( 200, "success" );
+ }
+ }
+ };
+ // Use insertBefore instead of appendChild to circumvent an IE6 bug.
+ // This arises when a base node is used (#2709 and #4378).
+ head.insertBefore( script, head.firstChild );
+ },
+
+ abort: function() {
+ if ( script ) {
+ script.onload( 0, 1 );
+ }
+ }
+ };
+ }
+});
+var xhrCallbacks,
+ // #5280: Internet Explorer will keep connections alive if we don't abort on unload
+ xhrOnUnloadAbort = window.ActiveXObject ? function() {
+ // Abort all pending requests
+ for ( var key in xhrCallbacks ) {
+ xhrCallbacks[ key ]( 0, 1 );
+ }
+ } : false,
+ xhrId = 0;
+
+// Functions to create xhrs
+function createStandardXHR() {
+ try {
+ return new window.XMLHttpRequest();
+ } catch( e ) {}
+}
+
+function createActiveXHR() {
+ try {
+ return new window.ActiveXObject( "Microsoft.XMLHTTP" );
+ } catch( e ) {}
+}
+
+// Create the request object
+// (This is still attached to ajaxSettings for backward compatibility)
+jQuery.ajaxSettings.xhr = window.ActiveXObject ?
+ /* Microsoft failed to properly
+ * implement the XMLHttpRequest in IE7 (can't request local files),
+ * so we use the ActiveXObject when it is available
+ * Additionally XMLHttpRequest can be disabled in IE7/IE8 so
+ * we need a fallback.
+ */
+ function() {
+ return !this.isLocal && createStandardXHR() || createActiveXHR();
+ } :
+ // For all other browsers, use the standard XMLHttpRequest object
+ createStandardXHR;
+
+// Determine support properties
+(function( xhr ) {
+ jQuery.extend( jQuery.support, {
+ ajax: !!xhr,
+ cors: !!xhr && ( "withCredentials" in xhr )
+ });
+})( jQuery.ajaxSettings.xhr() );
+
+// Create transport if the browser can provide an xhr
+if ( jQuery.support.ajax ) {
+
+ jQuery.ajaxTransport(function( s ) {
+ // Cross domain only allowed if supported through XMLHttpRequest
+ if ( !s.crossDomain || jQuery.support.cors ) {
+
+ var callback;
+
+ return {
+ send: function( headers, complete ) {
+
+ // Get a new xhr
+ var handle, i,
+ xhr = s.xhr();
+
+ // Open the socket
+ // Passing null username, generates a login popup on Opera (#2865)
+ if ( s.username ) {
+ xhr.open( s.type, s.url, s.async, s.username, s.password );
+ } else {
+ xhr.open( s.type, s.url, s.async );
+ }
+
+ // Apply custom fields if provided
+ if ( s.xhrFields ) {
+ for ( i in s.xhrFields ) {
+ xhr[ i ] = s.xhrFields[ i ];
+ }
+ }
+
+ // Override mime type if needed
+ if ( s.mimeType && xhr.overrideMimeType ) {
+ xhr.overrideMimeType( s.mimeType );
+ }
+
+ // X-Requested-With header
+ // For cross-domain requests, seeing as conditions for a preflight are
+ // akin to a jigsaw puzzle, we simply never set it to be sure.
+ // (it can always be set on a per-request basis or even using ajaxSetup)
+ // For same-domain requests, won't change header if already provided.
+ if ( !s.crossDomain && !headers["X-Requested-With"] ) {
+ headers[ "X-Requested-With" ] = "XMLHttpRequest";
+ }
+
+ // Need an extra try/catch for cross domain requests in Firefox 3
+ try {
+ for ( i in headers ) {
+ xhr.setRequestHeader( i, headers[ i ] );
+ }
+ } catch( _ ) {}
+
+ // Do send the request
+ // This may raise an exception which is actually
+ // handled in jQuery.ajax (so no try/catch here)
+ xhr.send( ( s.hasContent && s.data ) || null );
+
+ // Listener
+ callback = function( _, isAbort ) {
+
+ var status,
+ statusText,
+ responseHeaders,
+ responses,
+ xml;
+
+ // Firefox throws exceptions when accessing properties
+ // of an xhr when a network error occurred
+ // http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE)
+ try {
+
+ // Was never called and is aborted or complete
+ if ( callback && ( isAbort || xhr.readyState === 4 ) ) {
+
+ // Only called once
+ callback = undefined;
+
+ // Do not keep as active anymore
+ if ( handle ) {
+ xhr.onreadystatechange = jQuery.noop;
+ if ( xhrOnUnloadAbort ) {
+ delete xhrCallbacks[ handle ];
+ }
+ }
+
+ // If it's an abort
+ if ( isAbort ) {
+ // Abort it manually if needed
+ if ( xhr.readyState !== 4 ) {
+ xhr.abort();
+ }
+ } else {
+ status = xhr.status;
+ responseHeaders = xhr.getAllResponseHeaders();
+ responses = {};
+ xml = xhr.responseXML;
+
+ // Construct response list
+ if ( xml && xml.documentElement /* #4958 */ ) {
+ responses.xml = xml;
+ }
+
+ // When requesting binary data, IE6-9 will throw an exception
+ // on any attempt to access responseText (#11426)
+ try {
+ responses.text = xhr.responseText;
+ } catch( _ ) {
+ }
+
+ // Firefox throws an exception when accessing
+ // statusText for faulty cross-domain requests
+ try {
+ statusText = xhr.statusText;
+ } catch( e ) {
+ // We normalize with Webkit giving an empty statusText
+ statusText = "";
+ }
+
+ // Filter status for non standard behaviors
+
+ // If the request is local and we have data: assume a success
+ // (success with no data won't get notified, that's the best we
+ // can do given current implementations)
+ if ( !status && s.isLocal && !s.crossDomain ) {
+ status = responses.text ? 200 : 404;
+ // IE - #1450: sometimes returns 1223 when it should be 204
+ } else if ( status === 1223 ) {
+ status = 204;
+ }
+ }
+ }
+ } catch( firefoxAccessException ) {
+ if ( !isAbort ) {
+ complete( -1, firefoxAccessException );
+ }
+ }
+
+ // Call complete if needed
+ if ( responses ) {
+ complete( status, statusText, responses, responseHeaders );
+ }
+ };
+
+ if ( !s.async ) {
+ // if we're in sync mode we fire the callback
+ callback();
+ } else if ( xhr.readyState === 4 ) {
+ // (IE6 & IE7) if it's in cache and has been
+ // retrieved directly we need to fire the callback
+ setTimeout( callback, 0 );
+ } else {
+ handle = ++xhrId;
+ if ( xhrOnUnloadAbort ) {
+ // Create the active xhrs callbacks list if needed
+ // and attach the unload handler
+ if ( !xhrCallbacks ) {
+ xhrCallbacks = {};
+ jQuery( window ).unload( xhrOnUnloadAbort );
+ }
+ // Add to list of active xhrs callbacks
+ xhrCallbacks[ handle ] = callback;
+ }
+ xhr.onreadystatechange = callback;
+ }
+ },
+
+ abort: function() {
+ if ( callback ) {
+ callback(0,1);
+ }
+ }
+ };
+ }
+ });
+}
+var fxNow, timerId,
+ rfxtypes = /^(?:toggle|show|hide)$/,
+ rfxnum = new RegExp( "^(?:([-+])=|)(" + core_pnum + ")([a-z%]*)$", "i" ),
+ rrun = /queueHooks$/,
+ animationPrefilters = [ defaultPrefilter ],
+ tweeners = {
+ "*": [function( prop, value ) {
+ var end, unit,
+ tween = this.createTween( prop, value ),
+ parts = rfxnum.exec( value ),
+ target = tween.cur(),
+ start = +target || 0,
+ scale = 1,
+ maxIterations = 20;
+
+ if ( parts ) {
+ end = +parts[2];
+ unit = parts[3] || ( jQuery.cssNumber[ prop ] ? "" : "px" );
+
+ // We need to compute starting value
+ if ( unit !== "px" && start ) {
+ // Iteratively approximate from a nonzero starting point
+ // Prefer the current property, because this process will be trivial if it uses the same units
+ // Fallback to end or a simple constant
+ start = jQuery.css( tween.elem, prop, true ) || end || 1;
+
+ do {
+ // If previous iteration zeroed out, double until we get *something*
+ // Use a string for doubling factor so we don't accidentally see scale as unchanged below
+ scale = scale || ".5";
+
+ // Adjust and apply
+ start = start / scale;
+ jQuery.style( tween.elem, prop, start + unit );
+
+ // Update scale, tolerating zero or NaN from tween.cur()
+ // And breaking the loop if scale is unchanged or perfect, or if we've just had enough
+ } while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations );
+ }
+
+ tween.unit = unit;
+ tween.start = start;
+ // If a +=/-= token was provided, we're doing a relative animation
+ tween.end = parts[1] ? start + ( parts[1] + 1 ) * end : end;
+ }
+ return tween;
+ }]
+ };
+
+// Animations created synchronously will run synchronously
+function createFxNow() {
+ setTimeout(function() {
+ fxNow = undefined;
+ }, 0 );
+ return ( fxNow = jQuery.now() );
+}
+
+function createTweens( animation, props ) {
+ jQuery.each( props, function( prop, value ) {
+ var collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ),
+ index = 0,
+ length = collection.length;
+ for ( ; index < length; index++ ) {
+ if ( collection[ index ].call( animation, prop, value ) ) {
+
+ // we're done with this property
+ return;
+ }
+ }
+ });
+}
+
+function Animation( elem, properties, options ) {
+ var result,
+ index = 0,
+ tweenerIndex = 0,
+ length = animationPrefilters.length,
+ deferred = jQuery.Deferred().always( function() {
+ // don't match elem in the :animated selector
+ delete tick.elem;
+ }),
+ tick = function() {
+ var currentTime = fxNow || createFxNow(),
+ remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
+ percent = 1 - ( remaining / animation.duration || 0 ),
+ index = 0,
+ length = animation.tweens.length;
+
+ for ( ; index < length ; index++ ) {
+ animation.tweens[ index ].run( percent );
+ }
+
+ deferred.notifyWith( elem, [ animation, percent, remaining ]);
+
+ if ( percent < 1 && length ) {
+ return remaining;
+ } else {
+ deferred.resolveWith( elem, [ animation ] );
+ return false;
+ }
+ },
+ animation = deferred.promise({
+ elem: elem,
+ props: jQuery.extend( {}, properties ),
+ opts: jQuery.extend( true, { specialEasing: {} }, options ),
+ originalProperties: properties,
+ originalOptions: options,
+ startTime: fxNow || createFxNow(),
+ duration: options.duration,
+ tweens: [],
+ createTween: function( prop, end, easing ) {
+ var tween = jQuery.Tween( elem, animation.opts, prop, end,
+ animation.opts.specialEasing[ prop ] || animation.opts.easing );
+ animation.tweens.push( tween );
+ return tween;
+ },
+ stop: function( gotoEnd ) {
+ var index = 0,
+ // if we are going to the end, we want to run all the tweens
+ // otherwise we skip this part
+ length = gotoEnd ? animation.tweens.length : 0;
+
+ for ( ; index < length ; index++ ) {
+ animation.tweens[ index ].run( 1 );
+ }
+
+ // resolve when we played the last frame
+ // otherwise, reject
+ if ( gotoEnd ) {
+ deferred.resolveWith( elem, [ animation, gotoEnd ] );
+ } else {
+ deferred.rejectWith( elem, [ animation, gotoEnd ] );
+ }
+ return this;
+ }
+ }),
+ props = animation.props;
+
+ propFilter( props, animation.opts.specialEasing );
+
+ for ( ; index < length ; index++ ) {
+ result = animationPrefilters[ index ].call( animation, elem, props, animation.opts );
+ if ( result ) {
+ return result;
+ }
+ }
+
+ createTweens( animation, props );
+
+ if ( jQuery.isFunction( animation.opts.start ) ) {
+ animation.opts.start.call( elem, animation );
+ }
+
+ jQuery.fx.timer(
+ jQuery.extend( tick, {
+ anim: animation,
+ queue: animation.opts.queue,
+ elem: elem
+ })
+ );
+
+ // attach callbacks from options
+ return animation.progress( animation.opts.progress )
+ .done( animation.opts.done, animation.opts.complete )
+ .fail( animation.opts.fail )
+ .always( animation.opts.always );
+}
+
+function propFilter( props, specialEasing ) {
+ var index, name, easing, value, hooks;
+
+ // camelCase, specialEasing and expand cssHook pass
+ for ( index in props ) {
+ name = jQuery.camelCase( index );
+ easing = specialEasing[ name ];
+ value = props[ index ];
+ if ( jQuery.isArray( value ) ) {
+ easing = value[ 1 ];
+ value = props[ index ] = value[ 0 ];
+ }
+
+ if ( index !== name ) {
+ props[ name ] = value;
+ delete props[ index ];
+ }
+
+ hooks = jQuery.cssHooks[ name ];
+ if ( hooks && "expand" in hooks ) {
+ value = hooks.expand( value );
+ delete props[ name ];
+
+ // not quite $.extend, this wont overwrite keys already present.
+ // also - reusing 'index' from above because we have the correct "name"
+ for ( index in value ) {
+ if ( !( index in props ) ) {
+ props[ index ] = value[ index ];
+ specialEasing[ index ] = easing;
+ }
+ }
+ } else {
+ specialEasing[ name ] = easing;
+ }
+ }
+}
+
+jQuery.Animation = jQuery.extend( Animation, {
+
+ tweener: function( props, callback ) {
+ if ( jQuery.isFunction( props ) ) {
+ callback = props;
+ props = [ "*" ];
+ } else {
+ props = props.split(" ");
+ }
+
+ var prop,
+ index = 0,
+ length = props.length;
+
+ for ( ; index < length ; index++ ) {
+ prop = props[ index ];
+ tweeners[ prop ] = tweeners[ prop ] || [];
+ tweeners[ prop ].unshift( callback );
+ }
+ },
+
+ prefilter: function( callback, prepend ) {
+ if ( prepend ) {
+ animationPrefilters.unshift( callback );
+ } else {
+ animationPrefilters.push( callback );
+ }
+ }
+});
+
+function defaultPrefilter( elem, props, opts ) {
+ var index, prop, value, length, dataShow, tween, hooks, oldfire,
+ anim = this,
+ style = elem.style,
+ orig = {},
+ handled = [],
+ hidden = elem.nodeType && isHidden( elem );
+
+ // handle queue: false promises
+ if ( !opts.queue ) {
+ hooks = jQuery._queueHooks( elem, "fx" );
+ if ( hooks.unqueued == null ) {
+ hooks.unqueued = 0;
+ oldfire = hooks.empty.fire;
+ hooks.empty.fire = function() {
+ if ( !hooks.unqueued ) {
+ oldfire();
+ }
+ };
+ }
+ hooks.unqueued++;
+
+ anim.always(function() {
+ // doing this makes sure that the complete handler will be called
+ // before this completes
+ anim.always(function() {
+ hooks.unqueued--;
+ if ( !jQuery.queue( elem, "fx" ).length ) {
+ hooks.empty.fire();
+ }
+ });
+ });
+ }
+
+ // height/width overflow pass
+ if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) {
+ // Make sure that nothing sneaks out
+ // Record all 3 overflow attributes because IE does not
+ // change the overflow attribute when overflowX and
+ // overflowY are set to the same value
+ opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
+
+ // Set display property to inline-block for height/width
+ // animations on inline elements that are having width/height animated
+ if ( jQuery.css( elem, "display" ) === "inline" &&
+ jQuery.css( elem, "float" ) === "none" ) {
+
+ // inline-level elements accept inline-block;
+ // block-level elements need to be inline with layout
+ if ( !jQuery.support.inlineBlockNeedsLayout || css_defaultDisplay( elem.nodeName ) === "inline" ) {
+ style.display = "inline-block";
+
+ } else {
+ style.zoom = 1;
+ }
+ }
+ }
+
+ if ( opts.overflow ) {
+ style.overflow = "hidden";
+ if ( !jQuery.support.shrinkWrapBlocks ) {
+ anim.done(function() {
+ style.overflow = opts.overflow[ 0 ];
+ style.overflowX = opts.overflow[ 1 ];
+ style.overflowY = opts.overflow[ 2 ];
+ });
+ }
+ }
+
+
+ // show/hide pass
+ for ( index in props ) {
+ value = props[ index ];
+ if ( rfxtypes.exec( value ) ) {
+ delete props[ index ];
+ if ( value === ( hidden ? "hide" : "show" ) ) {
+ continue;
+ }
+ handled.push( index );
+ }
+ }
+
+ length = handled.length;
+ if ( length ) {
+ dataShow = jQuery._data( elem, "fxshow" ) || jQuery._data( elem, "fxshow", {} );
+ if ( hidden ) {
+ jQuery( elem ).show();
+ } else {
+ anim.done(function() {
+ jQuery( elem ).hide();
+ });
+ }
+ anim.done(function() {
+ var prop;
+ jQuery.removeData( elem, "fxshow", true );
+ for ( prop in orig ) {
+ jQuery.style( elem, prop, orig[ prop ] );
+ }
+ });
+ for ( index = 0 ; index < length ; index++ ) {
+ prop = handled[ index ];
+ tween = anim.createTween( prop, hidden ? dataShow[ prop ] : 0 );
+ orig[ prop ] = dataShow[ prop ] || jQuery.style( elem, prop );
+
+ if ( !( prop in dataShow ) ) {
+ dataShow[ prop ] = tween.start;
+ if ( hidden ) {
+ tween.end = tween.start;
+ tween.start = prop === "width" || prop === "height" ? 1 : 0;
+ }
+ }
+ }
+ }
+}
+
+function Tween( elem, options, prop, end, easing ) {
+ return new Tween.prototype.init( elem, options, prop, end, easing );
+}
+jQuery.Tween = Tween;
+
+Tween.prototype = {
+ constructor: Tween,
+ init: function( elem, options, prop, end, easing, unit ) {
+ this.elem = elem;
+ this.prop = prop;
+ this.easing = easing || "swing";
+ this.options = options;
+ this.start = this.now = this.cur();
+ this.end = end;
+ this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );
+ },
+ cur: function() {
+ var hooks = Tween.propHooks[ this.prop ];
+
+ return hooks && hooks.get ?
+ hooks.get( this ) :
+ Tween.propHooks._default.get( this );
+ },
+ run: function( percent ) {
+ var eased,
+ hooks = Tween.propHooks[ this.prop ];
+
+ if ( this.options.duration ) {
+ this.pos = eased = jQuery.easing[ this.easing ](
+ percent, this.options.duration * percent, 0, 1, this.options.duration
+ );
+ } else {
+ this.pos = eased = percent;
+ }
+ this.now = ( this.end - this.start ) * eased + this.start;
+
+ if ( this.options.step ) {
+ this.options.step.call( this.elem, this.now, this );
+ }
+
+ if ( hooks && hooks.set ) {
+ hooks.set( this );
+ } else {
+ Tween.propHooks._default.set( this );
+ }
+ return this;
+ }
+};
+
+Tween.prototype.init.prototype = Tween.prototype;
+
+Tween.propHooks = {
+ _default: {
+ get: function( tween ) {
+ var result;
+
+ if ( tween.elem[ tween.prop ] != null &&
+ (!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) {
+ return tween.elem[ tween.prop ];
+ }
+
+ // passing any value as a 4th parameter to .css will automatically
+ // attempt a parseFloat and fallback to a string if the parse fails
+ // so, simple values such as "10px" are parsed to Float.
+ // complex values such as "rotate(1rad)" are returned as is.
+ result = jQuery.css( tween.elem, tween.prop, false, "" );
+ // Empty strings, null, undefined and "auto" are converted to 0.
+ return !result || result === "auto" ? 0 : result;
+ },
+ set: function( tween ) {
+ // use step hook for back compat - use cssHook if its there - use .style if its
+ // available and use plain properties where available
+ if ( jQuery.fx.step[ tween.prop ] ) {
+ jQuery.fx.step[ tween.prop ]( tween );
+ } else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) {
+ jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
+ } else {
+ tween.elem[ tween.prop ] = tween.now;
+ }
+ }
+ }
+};
+
+// Remove in 2.0 - this supports IE8's panic based approach
+// to setting things on disconnected nodes
+
+Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
+ set: function( tween ) {
+ if ( tween.elem.nodeType && tween.elem.parentNode ) {
+ tween.elem[ tween.prop ] = tween.now;
+ }
+ }
+};
+
+jQuery.each([ "toggle", "show", "hide" ], function( i, name ) {
+ var cssFn = jQuery.fn[ name ];
+ jQuery.fn[ name ] = function( speed, easing, callback ) {
+ return speed == null || typeof speed === "boolean" ||
+ // special check for .toggle( handler, handler, ... )
+ ( !i && jQuery.isFunction( speed ) && jQuery.isFunction( easing ) ) ?
+ cssFn.apply( this, arguments ) :
+ this.animate( genFx( name, true ), speed, easing, callback );
+ };
+});
+
+jQuery.fn.extend({
+ fadeTo: function( speed, to, easing, callback ) {
+
+ // show any hidden elements after setting opacity to 0
+ return this.filter( isHidden ).css( "opacity", 0 ).show()
+
+ // animate to the value specified
+ .end().animate({ opacity: to }, speed, easing, callback );
+ },
+ animate: function( prop, speed, easing, callback ) {
+ var empty = jQuery.isEmptyObject( prop ),
+ optall = jQuery.speed( speed, easing, callback ),
+ doAnimation = function() {
+ // Operate on a copy of prop so per-property easing won't be lost
+ var anim = Animation( this, jQuery.extend( {}, prop ), optall );
+
+ // Empty animations resolve immediately
+ if ( empty ) {
+ anim.stop( true );
+ }
+ };
+
+ return empty || optall.queue === false ?
+ this.each( doAnimation ) :
+ this.queue( optall.queue, doAnimation );
+ },
+ stop: function( type, clearQueue, gotoEnd ) {
+ var stopQueue = function( hooks ) {
+ var stop = hooks.stop;
+ delete hooks.stop;
+ stop( gotoEnd );
+ };
+
+ if ( typeof type !== "string" ) {
+ gotoEnd = clearQueue;
+ clearQueue = type;
+ type = undefined;
+ }
+ if ( clearQueue && type !== false ) {
+ this.queue( type || "fx", [] );
+ }
+
+ return this.each(function() {
+ var dequeue = true,
+ index = type != null && type + "queueHooks",
+ timers = jQuery.timers,
+ data = jQuery._data( this );
+
+ if ( index ) {
+ if ( data[ index ] && data[ index ].stop ) {
+ stopQueue( data[ index ] );
+ }
+ } else {
+ for ( index in data ) {
+ if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
+ stopQueue( data[ index ] );
+ }
+ }
+ }
+
+ for ( index = timers.length; index--; ) {
+ if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) {
+ timers[ index ].anim.stop( gotoEnd );
+ dequeue = false;
+ timers.splice( index, 1 );
+ }
+ }
+
+ // start the next in the queue if the last step wasn't forced
+ // timers currently will call their complete callbacks, which will dequeue
+ // but only if they were gotoEnd
+ if ( dequeue || !gotoEnd ) {
+ jQuery.dequeue( this, type );
+ }
+ });
+ }
+});
+
+// Generate parameters to create a standard animation
+function genFx( type, includeWidth ) {
+ var which,
+ attrs = { height: type },
+ i = 0;
+
+ // if we include width, step value is 1 to do all cssExpand values,
+ // if we don't include width, step value is 2 to skip over Left and Right
+ includeWidth = includeWidth? 1 : 0;
+ for( ; i < 4 ; i += 2 - includeWidth ) {
+ which = cssExpand[ i ];
+ attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
+ }
+
+ if ( includeWidth ) {
+ attrs.opacity = attrs.width = type;
+ }
+
+ return attrs;
+}
+
+// Generate shortcuts for custom animations
+jQuery.each({
+ slideDown: genFx("show"),
+ slideUp: genFx("hide"),
+ slideToggle: genFx("toggle"),
+ fadeIn: { opacity: "show" },
+ fadeOut: { opacity: "hide" },
+ fadeToggle: { opacity: "toggle" }
+}, function( name, props ) {
+ jQuery.fn[ name ] = function( speed, easing, callback ) {
+ return this.animate( props, speed, easing, callback );
+ };
+});
+
+jQuery.speed = function( speed, easing, fn ) {
+ var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
+ complete: fn || !fn && easing ||
+ jQuery.isFunction( speed ) && speed,
+ duration: speed,
+ easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
+ };
+
+ opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
+ opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;
+
+ // normalize opt.queue - true/undefined/null -> "fx"
+ if ( opt.queue == null || opt.queue === true ) {
+ opt.queue = "fx";
+ }
+
+ // Queueing
+ opt.old = opt.complete;
+
+ opt.complete = function() {
+ if ( jQuery.isFunction( opt.old ) ) {
+ opt.old.call( this );
+ }
+
+ if ( opt.queue ) {
+ jQuery.dequeue( this, opt.queue );
+ }
+ };
+
+ return opt;
+};
+
+jQuery.easing = {
+ linear: function( p ) {
+ return p;
+ },
+ swing: function( p ) {
+ return 0.5 - Math.cos( p*Math.PI ) / 2;
+ }
+};
+
+jQuery.timers = [];
+jQuery.fx = Tween.prototype.init;
+jQuery.fx.tick = function() {
+ var timer,
+ timers = jQuery.timers,
+ i = 0;
+
+ for ( ; i < timers.length; i++ ) {
+ timer = timers[ i ];
+ // Checks the timer has not already been removed
+ if ( !timer() && timers[ i ] === timer ) {
+ timers.splice( i--, 1 );
+ }
+ }
+
+ if ( !timers.length ) {
+ jQuery.fx.stop();
+ }
+};
+
+jQuery.fx.timer = function( timer ) {
+ if ( timer() && jQuery.timers.push( timer ) && !timerId ) {
+ timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval );
+ }
+};
+
+jQuery.fx.interval = 13;
+
+jQuery.fx.stop = function() {
+ clearInterval( timerId );
+ timerId = null;
+};
+
+jQuery.fx.speeds = {
+ slow: 600,
+ fast: 200,
+ // Default speed
+ _default: 400
+};
+
+// Back Compat <1.8 extension point
+jQuery.fx.step = {};
+
+if ( jQuery.expr && jQuery.expr.filters ) {
+ jQuery.expr.filters.animated = function( elem ) {
+ return jQuery.grep(jQuery.timers, function( fn ) {
+ return elem === fn.elem;
+ }).length;
+ };
+}
+var rroot = /^(?:body|html)$/i;
+
+jQuery.fn.offset = function( options ) {
+ if ( arguments.length ) {
+ return options === undefined ?
+ this :
+ this.each(function( i ) {
+ jQuery.offset.setOffset( this, options, i );
+ });
+ }
+
+ var docElem, body, win, clientTop, clientLeft, scrollTop, scrollLeft,
+ box = { top: 0, left: 0 },
+ elem = this[ 0 ],
+ doc = elem && elem.ownerDocument;
+
+ if ( !doc ) {
+ return;
+ }
+
+ if ( (body = doc.body) === elem ) {
+ return jQuery.offset.bodyOffset( elem );
+ }
+
+ docElem = doc.documentElement;
+
+ // Make sure it's not a disconnected DOM node
+ if ( !jQuery.contains( docElem, elem ) ) {
+ return box;
+ }
+
+ // If we don't have gBCR, just use 0,0 rather than error
+ // BlackBerry 5, iOS 3 (original iPhone)
+ if ( typeof elem.getBoundingClientRect !== "undefined" ) {
+ box = elem.getBoundingClientRect();
+ }
+ win = getWindow( doc );
+ clientTop = docElem.clientTop || body.clientTop || 0;
+ clientLeft = docElem.clientLeft || body.clientLeft || 0;
+ scrollTop = win.pageYOffset || docElem.scrollTop;
+ scrollLeft = win.pageXOffset || docElem.scrollLeft;
+ return {
+ top: box.top + scrollTop - clientTop,
+ left: box.left + scrollLeft - clientLeft
+ };
+};
+
+jQuery.offset = {
+
+ bodyOffset: function( body ) {
+ var top = body.offsetTop,
+ left = body.offsetLeft;
+
+ if ( jQuery.support.doesNotIncludeMarginInBodyOffset ) {
+ top += parseFloat( jQuery.css(body, "marginTop") ) || 0;
+ left += parseFloat( jQuery.css(body, "marginLeft") ) || 0;
+ }
+
+ return { top: top, left: left };
+ },
+
+ setOffset: function( elem, options, i ) {
+ var position = jQuery.css( elem, "position" );
+
+ // set position first, in-case top/left are set even on static elem
+ if ( position === "static" ) {
+ elem.style.position = "relative";
+ }
+
+ var curElem = jQuery( elem ),
+ curOffset = curElem.offset(),
+ curCSSTop = jQuery.css( elem, "top" ),
+ curCSSLeft = jQuery.css( elem, "left" ),
+ calculatePosition = ( position === "absolute" || position === "fixed" ) && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1,
+ props = {}, curPosition = {}, curTop, curLeft;
+
+ // need to be able to calculate position if either top or left is auto and position is either absolute or fixed
+ if ( calculatePosition ) {
+ curPosition = curElem.position();
+ curTop = curPosition.top;
+ curLeft = curPosition.left;
+ } else {
+ curTop = parseFloat( curCSSTop ) || 0;
+ curLeft = parseFloat( curCSSLeft ) || 0;
+ }
+
+ if ( jQuery.isFunction( options ) ) {
+ options = options.call( elem, i, curOffset );
+ }
+
+ if ( options.top != null ) {
+ props.top = ( options.top - curOffset.top ) + curTop;
+ }
+ if ( options.left != null ) {
+ props.left = ( options.left - curOffset.left ) + curLeft;
+ }
+
+ if ( "using" in options ) {
+ options.using.call( elem, props );
+ } else {
+ curElem.css( props );
+ }
+ }
+};
+
+
+jQuery.fn.extend({
+
+ position: function() {
+ if ( !this[0] ) {
+ return;
+ }
+
+ var elem = this[0],
+
+ // Get *real* offsetParent
+ offsetParent = this.offsetParent(),
+
+ // Get correct offsets
+ offset = this.offset(),
+ parentOffset = rroot.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset();
+
+ // Subtract element margins
+ // note: when an element has margin: auto the offsetLeft and marginLeft
+ // are the same in Safari causing offset.left to incorrectly be 0
+ offset.top -= parseFloat( jQuery.css(elem, "marginTop") ) || 0;
+ offset.left -= parseFloat( jQuery.css(elem, "marginLeft") ) || 0;
+
+ // Add offsetParent borders
+ parentOffset.top += parseFloat( jQuery.css(offsetParent[0], "borderTopWidth") ) || 0;
+ parentOffset.left += parseFloat( jQuery.css(offsetParent[0], "borderLeftWidth") ) || 0;
+
+ // Subtract the two offsets
+ return {
+ top: offset.top - parentOffset.top,
+ left: offset.left - parentOffset.left
+ };
+ },
+
+ offsetParent: function() {
+ return this.map(function() {
+ var offsetParent = this.offsetParent || document.body;
+ while ( offsetParent && (!rroot.test(offsetParent.nodeName) && jQuery.css(offsetParent, "position") === "static") ) {
+ offsetParent = offsetParent.offsetParent;
+ }
+ return offsetParent || document.body;
+ });
+ }
+});
+
+
+// Create scrollLeft and scrollTop methods
+jQuery.each( {scrollLeft: "pageXOffset", scrollTop: "pageYOffset"}, function( method, prop ) {
+ var top = /Y/.test( prop );
+
+ jQuery.fn[ method ] = function( val ) {
+ return jQuery.access( this, function( elem, method, val ) {
+ var win = getWindow( elem );
+
+ if ( val === undefined ) {
+ return win ? (prop in win) ? win[ prop ] :
+ win.document.documentElement[ method ] :
+ elem[ method ];
+ }
+
+ if ( win ) {
+ win.scrollTo(
+ !top ? val : jQuery( win ).scrollLeft(),
+ top ? val : jQuery( win ).scrollTop()
+ );
+
+ } else {
+ elem[ method ] = val;
+ }
+ }, method, val, arguments.length, null );
+ };
+});
+
+function getWindow( elem ) {
+ return jQuery.isWindow( elem ) ?
+ elem :
+ elem.nodeType === 9 ?
+ elem.defaultView || elem.parentWindow :
+ false;
+}
+// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
+jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
+ jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) {
+ // margin is only for outerHeight, outerWidth
+ jQuery.fn[ funcName ] = function( margin, value ) {
+ var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
+ extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
+
+ return jQuery.access( this, function( elem, type, value ) {
+ var doc;
+
+ if ( jQuery.isWindow( elem ) ) {
+ // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there
+ // isn't a whole lot we can do. See pull request at this URL for discussion:
+ // https://github.com/jquery/jquery/pull/764
+ return elem.document.documentElement[ "client" + name ];
+ }
+
+ // Get document width or height
+ if ( elem.nodeType === 9 ) {
+ doc = elem.documentElement;
+
+ // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], whichever is greatest
+ // unfortunately, this causes bug #3838 in IE6/8 only, but there is currently no good, small way to fix it.
+ return Math.max(
+ elem.body[ "scroll" + name ], doc[ "scroll" + name ],
+ elem.body[ "offset" + name ], doc[ "offset" + name ],
+ doc[ "client" + name ]
+ );
+ }
+
+ return value === undefined ?
+ // Get width or height on the element, requesting but not forcing parseFloat
+ jQuery.css( elem, type, value, extra ) :
+
+ // Set width or height on the element
+ jQuery.style( elem, type, value, extra );
+ }, type, chainable ? margin : undefined, chainable, null );
+ };
+ });
+});
+// Expose jQuery to the global object
+window.jQuery = window.$ = jQuery;
+
+// Expose jQuery as an AMD module, but only for AMD loaders that
+// understand the issues with loading multiple versions of jQuery
+// in a page that all might call define(). The loader will indicate
+// they have special allowances for multiple jQuery versions by
+// specifying define.amd.jQuery = true. Register as a named module,
+// since jQuery can be concatenated with other files that may use define,
+// but not use a proper concatenation script that understands anonymous
+// AMD modules. A named AMD is safest and most robust way to register.
+// Lowercase jquery is used because AMD module names are derived from
+// file names, and jQuery is normally delivered in a lowercase file name.
+// Do this after creating the global so that if an AMD module wants to call
+// noConflict to hide this version of jQuery, it will work.
+if ( typeof define === "function" && define.amd && define.amd.jQuery ) {
+ define( "jquery", [], function () { return jQuery; } );
+}
+
+})( window );
/*
-* jQuery Mobile Framework 1.1.0 db342b1f315c282692791aa870455901fdb46a55
+* jQuery Mobile Framework Git Build: SHA1: b49cc06499abf8f987cf90f35349cfac0918c939 <> Date: Tue Oct 2 11:22:34 2012 -0700
* http://jquerymobile.com
*
-* Copyright 2011 (c) jQuery Project
-* Dual licensed under the MIT or GPL Version 2 licenses.
+* Copyright 2012 jQuery Foundation and other contributors
+* Released under the MIT license.
* http://jquery.org/license
*
*/
+
+
(function ( root, doc, factory ) {
if ( typeof define === "function" && define.amd ) {
// AMD. Register as an anonymous module.
// Browser globals
factory( root.jQuery, root, doc );
}
-}( this, document, function ( $, window, document, undefined ) {
-
-
-// This plugin is an experiment for abstracting away the touch and mouse
-// events so that developers don't have to worry about which method of input
-// the device their document is loaded on supports.
-//
-// The idea here is to allow the developer to register listeners for the
-// basic mouse events, such as mousedown, mousemove, mouseup, and click,
-// and the plugin will take care of registering the correct listeners
-// behind the scenes to invoke the listener at the fastest possible time
-// for that device, while still retaining the order of event firing in
-// the traditional mouse environment, should multiple handlers be registered
-// on the same element for different events.
-//
-// The current version exposes the following virtual events to jQuery bind methods:
-// "vmouseover vmousedown vmousemove vmouseup vclick vmouseout vmousecancel"
+}( this, document, function ( jQuery, window, document, undefined ) {
+(function( $, window, undefined ) {
-(function( $, window, document, undefined ) {
+ var nsNormalizeDict = {};
-var dataPropertyName = "virtualMouseBindings",
- touchTargetPropertyName = "virtualTouchID",
- virtualEventNames = "vmouseover vmousedown vmousemove vmouseup vclick vmouseout vmousecancel".split( " " ),
- touchEventProps = "clientX clientY pageX pageY screenX screenY".split( " " ),
- mouseHookProps = $.event.mouseHooks ? $.event.mouseHooks.props : [],
- mouseEventProps = $.event.props.concat( mouseHookProps ),
- activeDocHandlers = {},
- resetTimerID = 0,
- startX = 0,
- startY = 0,
- didScroll = false,
- clickBlockList = [],
- blockMouseTriggers = false,
- blockTouchTriggers = false,
- eventCaptureSupported = "addEventListener" in document,
- $document = $( document ),
- nextTouchID = 1,
- lastTouchID = 0;
+ // jQuery.mobile configurable options
+ $.mobile = $.extend( {}, {
-$.vmouse = {
- moveDistanceThreshold: 10,
- clickDistanceThreshold: 10,
- resetTimerDuration: 1500
-};
+ // Version of the jQuery Mobile Framework
+ version: "1.2.0",
-function getNativeEvent( event ) {
+ // Namespace used framework-wide for data-attrs. Default is no namespace
+ ns: "",
- while ( event && typeof event.originalEvent !== "undefined" ) {
- event = event.originalEvent;
- }
- return event;
-}
+ // Define the url parameter used for referencing widget-generated sub-pages.
+ // Translates to to example.html&ui-page=subpageIdentifier
+ // hash segment before &ui-page= is used to make Ajax request
+ subPageUrlKey: "ui-page",
-function createVirtualEvent( event, eventType ) {
+ // Class assigned to page currently in view, and during transitions
+ activePageClass: "ui-page-active",
- var t = event.type,
- oe, props, ne, prop, ct, touch, i, j;
+ // Class used for "active" button state, from CSS framework
+ activeBtnClass: "ui-btn-active",
- event = $.Event(event);
- event.type = eventType;
+ // Class used for "focus" form element state, from CSS framework
+ focusClass: "ui-focus",
- oe = event.originalEvent;
- props = $.event.props;
+ // Automatically handle clicks and form submissions through Ajax, when same-domain
+ ajaxEnabled: true,
- // addresses separation of $.event.props in to $.event.mouseHook.props and Issue 3280
- // https://github.com/jquery/jquery-mobile/issues/3280
- if ( t.search( /^(mouse|click)/ ) > -1 ) {
- props = mouseEventProps;
- }
+ // Automatically load and show pages based on location.hash
+ hashListeningEnabled: true,
- // copy original event properties over to the new event
- // this would happen if we could call $.event.fix instead of $.Event
- // but we don't have a way to force an event to be fixed multiple times
- if ( oe ) {
- for ( i = props.length, prop; i; ) {
- prop = props[ --i ];
- event[ prop ] = oe[ prop ];
- }
- }
+ // disable to prevent jquery from bothering with links
+ linkBindingEnabled: true,
- // make sure that if the mouse and click virtual events are generated
- // without a .which one is defined
- if ( t.search(/mouse(down|up)|click/) > -1 && !event.which ){
- event.which = 1;
- }
+ // Set default page transition - 'none' for no transitions
+ defaultPageTransition: "fade",
- if ( t.search(/^touch/) !== -1 ) {
- ne = getNativeEvent( oe );
- t = ne.touches;
- ct = ne.changedTouches;
- touch = ( t && t.length ) ? t[0] : ( (ct && ct.length) ? ct[ 0 ] : undefined );
+ // Set maximum window width for transitions to apply - 'false' for no limit
+ maxTransitionWidth: false,
- if ( touch ) {
- for ( j = 0, len = touchEventProps.length; j < len; j++){
- prop = touchEventProps[ j ];
- event[ prop ] = touch[ prop ];
- }
- }
- }
+ // Minimum scroll distance that will be remembered when returning to a page
+ minScrollBack: 250,
- return event;
-}
+ // DEPRECATED: the following property is no longer in use, but defined until 2.0 to prevent conflicts
+ touchOverflowEnabled: false,
-function getVirtualBindingFlags( element ) {
+ // Set default dialog transition - 'none' for no transitions
+ defaultDialogTransition: "pop",
- var flags = {},
- b, k;
+ // Error response message - appears when an Ajax page request fails
+ pageLoadErrorMessage: "Error Loading Page",
- while ( element ) {
+ // For error messages, which theme does the box uses?
+ pageLoadErrorMessageTheme: "e",
- b = $.data( element, dataPropertyName );
+ // replace calls to window.history.back with phonegaps navigation helper
+ // where it is provided on the window object
+ phonegapNavigationEnabled: false,
- for ( k in b ) {
- if ( b[ k ] ) {
- flags[ k ] = flags.hasVirtualBinding = true;
- }
- }
- element = element.parentNode;
- }
- return flags;
-}
+ //automatically initialize the DOM when it's ready
+ autoInitializePage: true,
-function getClosestElementWithVirtualBinding( element, eventType ) {
- var b;
- while ( element ) {
+ pushStateEnabled: true,
- b = $.data( element, dataPropertyName );
+ // allows users to opt in to ignoring content by marking a parent element as
+ // data-ignored
+ ignoreContentEnabled: false,
- if ( b && ( !eventType || b[ eventType ] ) ) {
- return element;
- }
- element = element.parentNode;
- }
- return null;
-}
+ // turn of binding to the native orientationchange due to android orientation behavior
+ orientationChangeEnabled: true,
-function enableTouchBindings() {
- blockTouchTriggers = false;
-}
+ buttonMarkup: {
+ hoverDelay: 200
+ },
-function disableTouchBindings() {
- blockTouchTriggers = true;
-}
+ // TODO might be useful upstream in jquery itself ?
+ keyCode: {
+ ALT: 18,
+ BACKSPACE: 8,
+ CAPS_LOCK: 20,
+ COMMA: 188,
+ COMMAND: 91,
+ COMMAND_LEFT: 91, // COMMAND
+ COMMAND_RIGHT: 93,
+ CONTROL: 17,
+ DELETE: 46,
+ DOWN: 40,
+ END: 35,
+ ENTER: 13,
+ ESCAPE: 27,
+ HOME: 36,
+ INSERT: 45,
+ LEFT: 37,
+ MENU: 93, // COMMAND_RIGHT
+ NUMPAD_ADD: 107,
+ NUMPAD_DECIMAL: 110,
+ NUMPAD_DIVIDE: 111,
+ NUMPAD_ENTER: 108,
+ NUMPAD_MULTIPLY: 106,
+ NUMPAD_SUBTRACT: 109,
+ PAGE_DOWN: 34,
+ PAGE_UP: 33,
+ PERIOD: 190,
+ RIGHT: 39,
+ SHIFT: 16,
+ SPACE: 32,
+ TAB: 9,
+ UP: 38,
+ WINDOWS: 91 // COMMAND
+ },
-function enableMouseBindings() {
- lastTouchID = 0;
- clickBlockList.length = 0;
- blockMouseTriggers = false;
+ // Scroll page vertically: scroll to 0 to hide iOS address bar, or pass a Y value
+ silentScroll: function( ypos ) {
+ if ( $.type( ypos ) !== "number" ) {
+ ypos = $.mobile.defaultHomeScroll;
+ }
- // When mouse bindings are enabled, our
- // touch bindings are disabled.
- disableTouchBindings();
-}
+ // prevent scrollstart and scrollstop events
+ $.event.special.scrollstart.enabled = false;
-function disableMouseBindings() {
- // When mouse bindings are disabled, our
- // touch bindings are enabled.
- enableTouchBindings();
-}
+ setTimeout( function() {
+ window.scrollTo( 0, ypos );
+ $( document ).trigger( "silentscroll", { x: 0, y: ypos });
+ }, 20 );
-function startResetTimer() {
- clearResetTimer();
- resetTimerID = setTimeout(function(){
- resetTimerID = 0;
- enableMouseBindings();
- }, $.vmouse.resetTimerDuration );
-}
+ setTimeout( function() {
+ $.event.special.scrollstart.enabled = true;
+ }, 150 );
+ },
-function clearResetTimer() {
- if ( resetTimerID ){
- clearTimeout( resetTimerID );
- resetTimerID = 0;
- }
-}
+ // Expose our cache for testing purposes.
+ nsNormalizeDict: nsNormalizeDict,
-function triggerVirtualEvent( eventType, event, flags ) {
- var ve;
+ // Take a data attribute property, prepend the namespace
+ // and then camel case the attribute string. Add the result
+ // to our nsNormalizeDict so we don't have to do this again.
+ nsNormalize: function( prop ) {
+ if ( !prop ) {
+ return;
+ }
- if ( ( flags && flags[ eventType ] ) ||
- ( !flags && getClosestElementWithVirtualBinding( event.target, eventType ) ) ) {
+ return nsNormalizeDict[ prop ] || ( nsNormalizeDict[ prop ] = $.camelCase( $.mobile.ns + prop ) );
+ },
- ve = createVirtualEvent( event, eventType );
+ // Find the closest parent with a theme class on it. Note that
+ // we are not using $.fn.closest() on purpose here because this
+ // method gets called quite a bit and we need it to be as fast
+ // as possible.
+ getInheritedTheme: function( el, defaultTheme ) {
+ var e = el[ 0 ],
+ ltr = "",
+ re = /ui-(bar|body|overlay)-([a-z])\b/,
+ c, m;
- $( event.target).trigger( ve );
- }
+ while ( e ) {
+ c = e.className || "";
+ if ( c && ( m = re.exec( c ) ) && ( ltr = m[ 2 ] ) ) {
+ // We found a parent with a theme class
+ // on it so bail from this loop.
+ break;
+ }
- return ve;
-}
+ e = e.parentNode;
+ }
-function mouseEventCallback( event ) {
- var touchID = $.data(event.target, touchTargetPropertyName);
+ // Return the theme letter we found, if none, return the
+ // specified default.
- if ( !blockMouseTriggers && ( !lastTouchID || lastTouchID !== touchID ) ){
- var ve = triggerVirtualEvent( "v" + event.type, event );
- if ( ve ) {
- if ( ve.isDefaultPrevented() ) {
- event.preventDefault();
- }
- if ( ve.isPropagationStopped() ) {
- event.stopPropagation();
- }
- if ( ve.isImmediatePropagationStopped() ) {
- event.stopImmediatePropagation();
- }
- }
- }
-}
+ return ltr || defaultTheme || "a";
+ },
-function handleTouchStart( event ) {
+ // TODO the following $ and $.fn extensions can/probably should be moved into jquery.mobile.core.helpers
+ //
+ // Find the closest javascript page element to gather settings data jsperf test
+ // http://jsperf.com/single-complex-selector-vs-many-complex-selectors/edit
+ // possibly naive, but it shows that the parsing overhead for *just* the page selector vs
+ // the page and dialog selector is negligable. This could probably be speed up by
+ // doing a similar parent node traversal to the one found in the inherited theme code above
+ closestPageData: function( $target ) {
+ return $target
+ .closest( ':jqmData(role="page"), :jqmData(role="dialog")' )
+ .data( "page" );
+ },
- var touches = getNativeEvent( event ).touches,
- target, flags;
+ enhanceable: function( $set ) {
+ return this.haveParents( $set, "enhance" );
+ },
- if ( touches && touches.length === 1 ) {
+ hijackable: function( $set ) {
+ return this.haveParents( $set, "ajax" );
+ },
- target = event.target;
- flags = getVirtualBindingFlags( target );
+ haveParents: function( $set, attr ) {
+ if ( !$.mobile.ignoreContentEnabled ) {
+ return $set;
+ }
- if ( flags.hasVirtualBinding ) {
+ var count = $set.length,
+ $newSet = $(),
+ e, $element, excluded;
- lastTouchID = nextTouchID++;
- $.data( target, touchTargetPropertyName, lastTouchID );
+ for ( var i = 0; i < count; i++ ) {
+ $element = $set.eq( i );
+ excluded = false;
+ e = $set[ i ];
- clearResetTimer();
+ while ( e ) {
+ var c = e.getAttribute ? e.getAttribute( "data-" + $.mobile.ns + attr ) : "";
- disableMouseBindings();
- didScroll = false;
+ if ( c === "false" ) {
+ excluded = true;
+ break;
+ }
- var t = getNativeEvent( event ).touches[ 0 ];
- startX = t.pageX;
- startY = t.pageY;
+ e = e.parentNode;
+ }
- triggerVirtualEvent( "vmouseover", event, flags );
- triggerVirtualEvent( "vmousedown", event, flags );
+ if ( !excluded ) {
+ $newSet = $newSet.add( $element );
+ }
+ }
+
+ return $newSet;
+ },
+
+ getScreenHeight: function() {
+ // Native innerHeight returns more accurate value for this across platforms,
+ // jQuery version is here as a normalized fallback for platforms like Symbian
+ return window.innerHeight || $( window ).height();
}
- }
-}
+ }, $.mobile );
-function handleScroll( event ) {
- if ( blockTouchTriggers ) {
- return;
- }
+ // Mobile version of data and removeData and hasData methods
+ // ensures all data is set and retrieved using jQuery Mobile's data namespace
+ $.fn.jqmData = function( prop, value ) {
+ var result;
+ if ( typeof prop !== "undefined" ) {
+ if ( prop ) {
+ prop = $.mobile.nsNormalize( prop );
+ }
- if ( !didScroll ) {
- triggerVirtualEvent( "vmousecancel", event, getVirtualBindingFlags( event.target ) );
- }
+ // undefined is permitted as an explicit input for the second param
+ // in this case it returns the value and does not set it to undefined
+ if( arguments.length < 2 || value === undefined ){
+ result = this.data( prop );
+ } else {
+ result = this.data( prop, value );
+ }
+ }
+ return result;
+ };
- didScroll = true;
- startResetTimer();
-}
+ $.jqmData = function( elem, prop, value ) {
+ var result;
+ if ( typeof prop !== "undefined" ) {
+ result = $.data( elem, prop ? $.mobile.nsNormalize( prop ) : prop, value );
+ }
+ return result;
+ };
-function handleTouchMove( event ) {
- if ( blockTouchTriggers ) {
- return;
- }
+ $.fn.jqmRemoveData = function( prop ) {
+ return this.removeData( $.mobile.nsNormalize( prop ) );
+ };
- var t = getNativeEvent( event ).touches[ 0 ],
- didCancel = didScroll,
- moveThreshold = $.vmouse.moveDistanceThreshold;
- didScroll = didScroll ||
- ( Math.abs(t.pageX - startX) > moveThreshold ||
- Math.abs(t.pageY - startY) > moveThreshold ),
- flags = getVirtualBindingFlags( event.target );
+ $.jqmRemoveData = function( elem, prop ) {
+ return $.removeData( elem, $.mobile.nsNormalize( prop ) );
+ };
- if ( didScroll && !didCancel ) {
- triggerVirtualEvent( "vmousecancel", event, flags );
- }
+ $.fn.removeWithDependents = function() {
+ $.removeWithDependents( this );
+ };
- triggerVirtualEvent( "vmousemove", event, flags );
- startResetTimer();
-}
+ $.removeWithDependents = function( elem ) {
+ var $elem = $( elem );
-function handleTouchEnd( event ) {
- if ( blockTouchTriggers ) {
- return;
- }
+ ( $elem.jqmData( 'dependents' ) || $() ).remove();
+ $elem.remove();
+ };
- disableTouchBindings();
+ $.fn.addDependents = function( newDependents ) {
+ $.addDependents( $( this ), newDependents );
+ };
- var flags = getVirtualBindingFlags( event.target ),
- t;
- triggerVirtualEvent( "vmouseup", event, flags );
+ $.addDependents = function( elem, newDependents ) {
+ var dependents = $( elem ).jqmData( 'dependents' ) || $();
- if ( !didScroll ) {
- var ve = triggerVirtualEvent( "vclick", event, flags );
- if ( ve && ve.isDefaultPrevented() ) {
- // The target of the mouse events that follow the touchend
- // event don't necessarily match the target used during the
- // touch. This means we need to rely on coordinates for blocking
- // any click that is generated.
- t = getNativeEvent( event ).changedTouches[ 0 ];
- clickBlockList.push({
- touchID: lastTouchID,
- x: t.clientX,
- y: t.clientY
- });
+ $( elem ).jqmData( 'dependents', $.merge( dependents, newDependents ) );
+ };
- // Prevent any mouse events that follow from triggering
- // virtual event notifications.
- blockMouseTriggers = true;
- }
- }
- triggerVirtualEvent( "vmouseout", event, flags);
- didScroll = false;
+ // note that this helper doesn't attempt to handle the callback
+ // or setting of an html elements text, its only purpose is
+ // to return the html encoded version of the text in all cases. (thus the name)
+ $.fn.getEncodedText = function() {
+ return $( "<div/>" ).text( $( this ).text() ).html();
+ };
- startResetTimer();
-}
+ // fluent helper function for the mobile namespaced equivalent
+ $.fn.jqmEnhanceable = function() {
+ return $.mobile.enhanceable( this );
+ };
-function hasVirtualBindings( ele ) {
- var bindings = $.data( ele, dataPropertyName ),
- k;
+ $.fn.jqmHijackable = function() {
+ return $.mobile.hijackable( this );
+ };
- if ( bindings ) {
- for ( k in bindings ) {
- if ( bindings[ k ] ) {
- return true;
- }
- }
- }
- return false;
-}
+ // Monkey-patching Sizzle to filter the :jqmData selector
+ var oldFind = $.find,
+ jqmDataRE = /:jqmData\(([^)]*)\)/g;
-function dummyMouseHandler(){}
+ $.find = function( selector, context, ret, extra ) {
+ selector = selector.replace( jqmDataRE, "[data-" + ( $.mobile.ns || "" ) + "$1]" );
-function getSpecialEventObject( eventType ) {
- var realType = eventType.substr( 1 );
+ return oldFind.call( this, selector, context, ret, extra );
+ };
- return {
- setup: function( data, namespace ) {
- // If this is the first virtual mouse binding for this element,
- // add a bindings object to its data.
+ $.extend( $.find, oldFind );
- if ( !hasVirtualBindings( this ) ) {
- $.data( this, dataPropertyName, {});
- }
+ $.find.matches = function( expr, set ) {
+ return $.find( expr, null, null, set );
+ };
- // If setup is called, we know it is the first binding for this
- // eventType, so initialize the count for the eventType to zero.
- var bindings = $.data( this, dataPropertyName );
- bindings[ eventType ] = true;
+ $.find.matchesSelector = function( node, expr ) {
+ return $.find( expr, null, null, [ node ] ).length > 0;
+ };
+})( jQuery, this );
- // If this is the first virtual mouse event for this type,
- // register a global handler on the document.
- activeDocHandlers[ eventType ] = ( activeDocHandlers[ eventType ] || 0 ) + 1;
+/*!
+ * jQuery UI Widget v1.9.0-beta.1
+ *
+ * Copyright 2012, https://github.com/jquery/jquery-ui/blob/1.9.0-beta.1/AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Widget
+ */
+(function( $, undefined ) {
- if ( activeDocHandlers[ eventType ] === 1 ) {
- $document.bind( realType, mouseEventCallback );
- }
+var uuid = 0,
+ slice = Array.prototype.slice,
+ _cleanData = $.cleanData;
+$.cleanData = function( elems ) {
+ for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
+ try {
+ $( elem ).triggerHandler( "remove" );
+ // http://bugs.jquery.com/ticket/8235
+ } catch( e ) {}
+ }
+ _cleanData( elems );
+};
- // Some browsers, like Opera Mini, won't dispatch mouse/click events
- // for elements unless they actually have handlers registered on them.
- // To get around this, we register dummy handlers on the elements.
+$.widget = function( name, base, prototype ) {
+ var fullName, existingConstructor, constructor, basePrototype,
+ namespace = name.split( "." )[ 0 ];
- $( this ).bind( realType, dummyMouseHandler );
+ name = name.split( "." )[ 1 ];
+ fullName = namespace + "-" + name;
- // For now, if event capture is not supported, we rely on mouse handlers.
- if ( eventCaptureSupported ) {
- // If this is the first virtual mouse binding for the document,
- // register our touchstart handler on the document.
+ if ( !prototype ) {
+ prototype = base;
+ base = $.Widget;
+ }
- activeDocHandlers[ "touchstart" ] = ( activeDocHandlers[ "touchstart" ] || 0) + 1;
+ // create selector for plugin
+ $.expr[ ":" ][ fullName ] = function( elem ) {
+ return !!$.data( elem, fullName );
+ };
- if (activeDocHandlers[ "touchstart" ] === 1) {
- $document.bind( "touchstart", handleTouchStart )
- .bind( "touchend", handleTouchEnd )
+ $[ namespace ] = $[ namespace ] || {};
+ existingConstructor = $[ namespace ][ name ];
+ constructor = $[ namespace ][ name ] = function( options, element ) {
+ // allow instantiation without "new" keyword
+ if ( !this._createWidget ) {
+ return new constructor( options, element );
+ }
- // On touch platforms, touching the screen and then dragging your finger
- // causes the window content to scroll after some distance threshold is
- // exceeded. On these platforms, a scroll prevents a click event from being
- // dispatched, and on some platforms, even the touchend is suppressed. To
- // mimic the suppression of the click event, we need to watch for a scroll
- // event. Unfortunately, some platforms like iOS don't dispatch scroll
- // events until *AFTER* the user lifts their finger (touchend). This means
- // we need to watch both scroll and touchmove events to figure out whether
- // or not a scroll happenens before the touchend event is fired.
+ // allow instantiation without initializing for simple inheritance
+ // must use "new" keyword (the code above always passes args)
+ if ( arguments.length ) {
+ this._createWidget( options, element );
+ }
+ };
+ // extend with the existing constructor to carry over any static properties
+ $.extend( constructor, existingConstructor, {
+ version: prototype.version,
+ // copy the object used to create the prototype in case we need to
+ // redefine the widget later
+ _proto: $.extend( {}, prototype ),
+ // track widgets that inherit from this widget in case this widget is
+ // redefined after a widget inherits from it
+ _childConstructors: []
+ });
- .bind( "touchmove", handleTouchMove )
- .bind( "scroll", handleScroll );
- }
- }
- },
+ basePrototype = new base();
+ // we need to make the options hash a property directly on the new instance
+ // otherwise we'll modify the options hash on the prototype that we're
+ // inheriting from
+ basePrototype.options = $.widget.extend( {}, basePrototype.options );
+ $.each( prototype, function( prop, value ) {
+ if ( $.isFunction( value ) ) {
+ prototype[ prop ] = (function() {
+ var _super = function() {
+ return base.prototype[ prop ].apply( this, arguments );
+ },
+ _superApply = function( args ) {
+ return base.prototype[ prop ].apply( this, args );
+ };
+ return function() {
+ var __super = this._super,
+ __superApply = this._superApply,
+ returnValue;
- teardown: function( data, namespace ) {
- // If this is the last virtual binding for this eventType,
- // remove its global handler from the document.
+ this._super = _super;
+ this._superApply = _superApply;
- --activeDocHandlers[ eventType ];
+ returnValue = value.apply( this, arguments );
- if ( !activeDocHandlers[ eventType ] ) {
- $document.unbind( realType, mouseEventCallback );
+ this._super = __super;
+ this._superApply = __superApply;
+
+ return returnValue;
+ };
+ })();
+ }
+ });
+ constructor.prototype = $.widget.extend( basePrototype, {
+ // TODO: remove support for widgetEventPrefix
+ // always use the name + a colon as the prefix, e.g., draggable:start
+ // don't prefix for widgets that aren't DOM-based
+ widgetEventPrefix: name
+ }, prototype, {
+ constructor: constructor,
+ namespace: namespace,
+ widgetName: name,
+ // TODO remove widgetBaseClass, see #8155
+ widgetBaseClass: fullName,
+ widgetFullName: fullName
+ });
+
+ // If this widget is being redefined then we need to find all widgets that
+ // are inheriting from it and redefine all of them so that they inherit from
+ // the new version of this widget. We're essentially trying to replace one
+ // level in the prototype chain.
+ if ( existingConstructor ) {
+ $.each( existingConstructor._childConstructors, function( i, child ) {
+ var childPrototype = child.prototype;
+
+ // redefine the child widget using the same prototype that was
+ // originally used, but inherit from the new version of the base
+ $.widget( childPrototype.namespace + "." + childPrototype.widgetName, constructor, child._proto );
+ });
+ // remove the list of existing child constructors from the old constructor
+ // so the old child constructors can be garbage collected
+ delete existingConstructor._childConstructors;
+ } else {
+ base._childConstructors.push( constructor );
+ }
+
+ $.widget.bridge( name, constructor );
+};
+
+$.widget.extend = function( target ) {
+ var input = slice.call( arguments, 1 ),
+ inputIndex = 0,
+ inputLength = input.length,
+ key,
+ value;
+ for ( ; inputIndex < inputLength; inputIndex++ ) {
+ for ( key in input[ inputIndex ] ) {
+ value = input[ inputIndex ][ key ];
+ if (input[ inputIndex ].hasOwnProperty( key ) && value !== undefined ) {
+ target[ key ] = $.isPlainObject( value ) ? $.widget.extend( {}, target[ key ], value ) : value;
}
+ }
+ }
+ return target;
+};
- if ( eventCaptureSupported ) {
- // If this is the last virtual mouse binding in existence,
- // remove our document touchstart listener.
+$.widget.bridge = function( name, object ) {
+ var fullName = object.prototype.widgetFullName;
+ $.fn[ name ] = function( options ) {
+ var isMethodCall = typeof options === "string",
+ args = slice.call( arguments, 1 ),
+ returnValue = this;
- --activeDocHandlers[ "touchstart" ];
+ // allow multiple hashes to be passed on init
+ options = !isMethodCall && args.length ?
+ $.widget.extend.apply( null, [ options ].concat(args) ) :
+ options;
- if ( !activeDocHandlers[ "touchstart" ] ) {
- $document.unbind( "touchstart", handleTouchStart )
- .unbind( "touchmove", handleTouchMove )
- .unbind( "touchend", handleTouchEnd )
- .unbind( "scroll", handleScroll );
+ if ( isMethodCall ) {
+ this.each(function() {
+ var methodValue,
+ instance = $.data( this, fullName );
+ if ( !instance ) {
+ return $.error( "cannot call methods on " + name + " prior to initialization; " +
+ "attempted to call method '" + options + "'" );
}
- }
+ if ( !$.isFunction( instance[options] ) || options.charAt( 0 ) === "_" ) {
+ return $.error( "no such method '" + options + "' for " + name + " widget instance" );
+ }
+ methodValue = instance[ options ].apply( instance, args );
+ if ( methodValue !== instance && methodValue !== undefined ) {
+ returnValue = methodValue && methodValue.jquery ?
+ returnValue.pushStack( methodValue.get() ) :
+ methodValue;
+ return false;
+ }
+ });
+ } else {
+ this.each(function() {
+ var instance = $.data( this, fullName );
+ if ( instance ) {
+ instance.option( options || {} )._init();
+ } else {
+ new object( options, this );
+ }
+ });
+ }
- var $this = $( this ),
- bindings = $.data( this, dataPropertyName );
+ return returnValue;
+ };
+};
- // teardown may be called when an element was
- // removed from the DOM. If this is the case,
- // jQuery core may have already stripped the element
- // of any data bindings so we need to check it before
- // using it.
- if ( bindings ) {
- bindings[ eventType ] = false;
- }
+$.Widget = function( options, element ) {};
+$.Widget._childConstructors = [];
- // Unregister the dummy event handler.
+$.Widget.prototype = {
+ widgetName: "widget",
+ widgetEventPrefix: "",
+ defaultElement: "<div>",
+ options: {
+ disabled: false,
- $this.unbind( realType, dummyMouseHandler );
+ // callbacks
+ create: null
+ },
+ _createWidget: function( options, element ) {
+ element = $( element || this.defaultElement || this )[ 0 ];
+ this.element = $( element );
+ this.uuid = uuid++;
+ this.eventNamespace = "." + this.widgetName + this.uuid;
+ this.options = $.widget.extend( {},
+ this.options,
+ this._getCreateOptions(),
+ options );
- // If this is the last virtual mouse binding on the
- // element, remove the binding data from the element.
+ this.bindings = $();
+ this.hoverable = $();
+ this.focusable = $();
- if ( !hasVirtualBindings( this ) ) {
- $this.removeData( dataPropertyName );
+ if ( element !== this ) {
+ // 1.9 BC for #7810
+ // TODO remove dual storage
+ $.data( element, this.widgetName, this );
+ $.data( element, this.widgetFullName, this );
+ this._on({ remove: "destroy" });
+ this.document = $( element.style ?
+ // element within the document
+ element.ownerDocument :
+ // element is window or document
+ element.document || element );
+ this.window = $( this.document[0].defaultView || this.document[0].parentWindow );
+ }
+
+ this._create();
+ this._trigger( "create", null, this._getCreateEventData() );
+ this._init();
+ },
+ _getCreateOptions: $.noop,
+ _getCreateEventData: $.noop,
+ _create: $.noop,
+ _init: $.noop,
+
+ destroy: function() {
+ this._destroy();
+ // we can probably remove the unbind calls in 2.0
+ // all event bindings should go through this._on()
+ this.element
+ .unbind( this.eventNamespace )
+ // 1.9 BC for #7810
+ // TODO remove dual storage
+ .removeData( this.widgetName )
+ .removeData( this.widgetFullName )
+ // support: jquery <1.6.3
+ // http://bugs.jquery.com/ticket/9413
+ .removeData( $.camelCase( this.widgetFullName ) );
+ this.widget()
+ .unbind( this.eventNamespace )
+ .removeAttr( "aria-disabled" )
+ .removeClass(
+ this.widgetFullName + "-disabled " +
+ "ui-state-disabled" );
+
+ // clean up events and states
+ this.bindings.unbind( this.eventNamespace );
+ this.hoverable.removeClass( "ui-state-hover" );
+ this.focusable.removeClass( "ui-state-focus" );
+ },
+ _destroy: $.noop,
+
+ widget: function() {
+ return this.element;
+ },
+
+ option: function( key, value ) {
+ var options = key,
+ parts,
+ curOption,
+ i;
+
+ if ( arguments.length === 0 ) {
+ // don't return a reference to the internal hash
+ return $.widget.extend( {}, this.options );
+ }
+
+ if ( typeof key === "string" ) {
+ // handle nested keys, e.g., "foo.bar" => { foo: { bar: ___ } }
+ options = {};
+ parts = key.split( "." );
+ key = parts.shift();
+ if ( parts.length ) {
+ curOption = options[ key ] = $.widget.extend( {}, this.options[ key ] );
+ for ( i = 0; i < parts.length - 1; i++ ) {
+ curOption[ parts[ i ] ] = curOption[ parts[ i ] ] || {};
+ curOption = curOption[ parts[ i ] ];
+ }
+ key = parts.pop();
+ if ( value === undefined ) {
+ return curOption[ key ] === undefined ? null : curOption[ key ];
+ }
+ curOption[ key ] = value;
+ } else {
+ if ( value === undefined ) {
+ return this.options[ key ] === undefined ? null : this.options[ key ];
+ }
+ options[ key ] = value;
}
}
- };
-}
-// Expose our custom events to the jQuery bind/unbind mechanism.
+ this._setOptions( options );
-for ( var i = 0; i < virtualEventNames.length; i++ ){
- $.event.special[ virtualEventNames[ i ] ] = getSpecialEventObject( virtualEventNames[ i ] );
-}
+ return this;
+ },
+ _setOptions: function( options ) {
+ var key;
-// Add a capture click handler to block clicks.
-// Note that we require event capture support for this so if the device
-// doesn't support it, we punt for now and rely solely on mouse events.
-if ( eventCaptureSupported ) {
- document.addEventListener( "click", function( e ){
- var cnt = clickBlockList.length,
- target = e.target,
- x, y, ele, i, o, touchID;
+ for ( key in options ) {
+ this._setOption( key, options[ key ] );
+ }
- if ( cnt ) {
- x = e.clientX;
- y = e.clientY;
- threshold = $.vmouse.clickDistanceThreshold;
+ return this;
+ },
+ _setOption: function( key, value ) {
+ this.options[ key ] = value;
- // The idea here is to run through the clickBlockList to see if
- // the current click event is in the proximity of one of our
- // vclick events that had preventDefault() called on it. If we find
- // one, then we block the click.
- //
- // Why do we have to rely on proximity?
- //
- // Because the target of the touch event that triggered the vclick
- // can be different from the target of the click event synthesized
- // by the browser. The target of a mouse/click event that is syntehsized
- // from a touch event seems to be implementation specific. For example,
- // some browsers will fire mouse/click events for a link that is near
- // a touch event, even though the target of the touchstart/touchend event
- // says the user touched outside the link. Also, it seems that with most
- // browsers, the target of the mouse/click event is not calculated until the
- // time it is dispatched, so if you replace an element that you touched
- // with another element, the target of the mouse/click will be the new
- // element underneath that point.
- //
- // Aside from proximity, we also check to see if the target and any
- // of its ancestors were the ones that blocked a click. This is necessary
- // because of the strange mouse/click target calculation done in the
- // Android 2.1 browser, where if you click on an element, and there is a
- // mouse/click handler on one of its ancestors, the target will be the
- // innermost child of the touched element, even if that child is no where
- // near the point of touch.
+ if ( key === "disabled" ) {
+ this.widget()
+ .toggleClass( this.widgetFullName + "-disabled ui-state-disabled", !!value )
+ .attr( "aria-disabled", value );
+ this.hoverable.removeClass( "ui-state-hover" );
+ this.focusable.removeClass( "ui-state-focus" );
+ }
- ele = target;
+ return this;
+ },
- while ( ele ) {
- for ( i = 0; i < cnt; i++ ) {
- o = clickBlockList[ i ];
- touchID = 0;
+ enable: function() {
+ return this._setOption( "disabled", false );
+ },
+ disable: function() {
+ return this._setOption( "disabled", true );
+ },
- if ( ( ele === target && Math.abs( o.x - x ) < threshold && Math.abs( o.y - y ) < threshold ) ||
- $.data( ele, touchTargetPropertyName ) === o.touchID ) {
- // XXX: We may want to consider removing matches from the block list
- // instead of waiting for the reset timer to fire.
- e.preventDefault();
- e.stopPropagation();
- return;
- }
+ _on: function( element, handlers ) {
+ // no element argument, shuffle and use this.element
+ if ( !handlers ) {
+ handlers = element;
+ element = this.element;
+ } else {
+ // accept selectors, DOM elements
+ element = $( element );
+ this.bindings = this.bindings.add( element );
+ }
+
+ var instance = this;
+ $.each( handlers, function( event, handler ) {
+ function handlerProxy() {
+ // allow widgets to customize the disabled handling
+ // - disabled as an array instead of boolean
+ // - disabled class as method for disabling individual parts
+ if ( instance.options.disabled === true ||
+ $( this ).hasClass( "ui-state-disabled" ) ) {
+ return;
}
- ele = ele.parentNode;
+ return ( typeof handler === "string" ? instance[ handler ] : handler )
+ .apply( instance, arguments );
}
- }
- }, true);
-}
-})( jQuery, window, document );
+ // copy the guid so direct unbinding works
+ if ( typeof handler !== "string" ) {
+ handlerProxy.guid = handler.guid =
+ handler.guid || handlerProxy.guid || $.guid++;
+ }
+ var match = event.match( /^(\w+)\s*(.*)$/ ),
+ eventName = match[1] + instance.eventNamespace,
+ selector = match[2];
+ if ( selector ) {
+ instance.widget().delegate( selector, eventName, handlerProxy );
+ } else {
+ element.bind( eventName, handlerProxy );
+ }
+ });
+ },
-// Script: jQuery hashchange event
-//
-// *Version: 1.3, Last updated: 7/21/2010*
-//
-// Project Home - http://benalman.com/projects/jquery-hashchange-plugin/
-// GitHub - http://github.com/cowboy/jquery-hashchange/
-// Source - http://github.com/cowboy/jquery-hashchange/raw/master/jquery.ba-hashchange.js
-// (Minified) - http://github.com/cowboy/jquery-hashchange/raw/master/jquery.ba-hashchange.min.js (0.8kb gzipped)
-//
-// About: License
-//
-// Copyright (c) 2010 "Cowboy" Ben Alman,
-// Dual licensed under the MIT and GPL licenses.
-// http://benalman.com/about/license/
-//
-// About: Examples
-//
-// These working examples, complete with fully commented code, illustrate a few
-// ways in which this plugin can be used.
-//
-// hashchange event - http://benalman.com/code/projects/jquery-hashchange/examples/hashchange/
-// document.domain - http://benalman.com/code/projects/jquery-hashchange/examples/document_domain/
-//
-// About: Support and Testing
-//
-// Information about what version or versions of jQuery this plugin has been
-// tested with, what browsers it has been tested in, and where the unit tests
-// reside (so you can test it yourself).
-//
-// jQuery Versions - 1.2.6, 1.3.2, 1.4.1, 1.4.2
-// Browsers Tested - Internet Explorer 6-8, Firefox 2-4, Chrome 5-6, Safari 3.2-5,
-// Opera 9.6-10.60, iPhone 3.1, Android 1.6-2.2, BlackBerry 4.6-5.
-// Unit Tests - http://benalman.com/code/projects/jquery-hashchange/unit/
-//
-// About: Known issues
-//
-// While this jQuery hashchange event implementation is quite stable and
-// robust, there are a few unfortunate browser bugs surrounding expected
-// hashchange event-based behaviors, independent of any JavaScript
-// window.onhashchange abstraction. See the following examples for more
-// information:
-//
-// Chrome: Back Button - http://benalman.com/code/projects/jquery-hashchange/examples/bug-chrome-back-button/
-// Firefox: Remote XMLHttpRequest - http://benalman.com/code/projects/jquery-hashchange/examples/bug-firefox-remote-xhr/
-// WebKit: Back Button in an Iframe - http://benalman.com/code/projects/jquery-hashchange/examples/bug-webkit-hash-iframe/
-// Safari: Back Button from a different domain - http://benalman.com/code/projects/jquery-hashchange/examples/bug-safari-back-from-diff-domain/
-//
-// Also note that should a browser natively support the window.onhashchange
-// event, but not report that it does, the fallback polling loop will be used.
-//
-// About: Release History
-//
-// 1.3 - (7/21/2010) Reorganized IE6/7 Iframe code to make it more
-// "removable" for mobile-only development. Added IE6/7 document.title
-// support. Attempted to make Iframe as hidden as possible by using
-// techniques from http://www.paciellogroup.com/blog/?p=604. Added
-// support for the "shortcut" format $(window).hashchange( fn ) and
-// $(window).hashchange() like jQuery provides for built-in events.
-// Renamed jQuery.hashchangeDelay to <jQuery.fn.hashchange.delay> and
-// lowered its default value to 50. Added <jQuery.fn.hashchange.domain>
-// and <jQuery.fn.hashchange.src> properties plus document-domain.html
-// file to address access denied issues when setting document.domain in
-// IE6/7.
-// 1.2 - (2/11/2010) Fixed a bug where coming back to a page using this plugin
-// from a page on another domain would cause an error in Safari 4. Also,
-// IE6/7 Iframe is now inserted after the body (this actually works),
-// which prevents the page from scrolling when the event is first bound.
-// Event can also now be bound before DOM ready, but it won't be usable
-// before then in IE6/7.
-// 1.1 - (1/21/2010) Incorporated document.documentMode test to fix IE8 bug
-// where browser version is incorrectly reported as 8.0, despite
-// inclusion of the X-UA-Compatible IE=EmulateIE7 meta tag.
-// 1.0 - (1/9/2010) Initial Release. Broke out the jQuery BBQ event.special
-// window.onhashchange functionality into a separate plugin for users
-// who want just the basic event & back button support, without all the
-// extra awesomeness that BBQ provides. This plugin will be included as
-// part of jQuery BBQ, but also be available separately.
+ _off: function( element, eventName ) {
+ eventName = (eventName || "").split( " " ).join( this.eventNamespace + " " ) + this.eventNamespace;
+ element.unbind( eventName ).undelegate( eventName );
+ },
-(function($,window,undefined){
- // Reused string.
- var str_hashchange = 'hashchange',
-
- // Method / object references.
- doc = document,
- fake_onhashchange,
- special = $.event.special,
-
- // Does the browser support window.onhashchange? Note that IE8 running in
- // IE7 compatibility mode reports true for 'onhashchange' in window, even
- // though the event isn't supported, so also test document.documentMode.
- doc_mode = doc.documentMode,
- supports_onhashchange = 'on' + str_hashchange in window && ( doc_mode === undefined || doc_mode > 7 );
-
- // Get location.hash (or what you'd expect location.hash to be) sans any
- // leading #. Thanks for making this necessary, Firefox!
- function get_fragment( url ) {
- url = url || location.href;
- return '#' + url.replace( /^[^#]*#?(.*)$/, '$1' );
- };
-
- // Method: jQuery.fn.hashchange
- //
- // Bind a handler to the window.onhashchange event or trigger all bound
- // window.onhashchange event handlers. This behavior is consistent with
- // jQuery's built-in event handlers.
- //
- // Usage:
- //
- // > jQuery(window).hashchange( [ handler ] );
- //
- // Arguments:
- //
- // handler - (Function) Optional handler to be bound to the hashchange
- // event. This is a "shortcut" for the more verbose form:
- // jQuery(window).bind( 'hashchange', handler ). If handler is omitted,
- // all bound window.onhashchange event handlers will be triggered. This
- // is a shortcut for the more verbose
- // jQuery(window).trigger( 'hashchange' ). These forms are described in
- // the <hashchange event> section.
- //
- // Returns:
- //
- // (jQuery) The initial jQuery collection of elements.
-
- // Allow the "shortcut" format $(elem).hashchange( fn ) for binding and
- // $(elem).hashchange() for triggering, like jQuery does for built-in events.
- $.fn[ str_hashchange ] = function( fn ) {
- return fn ? this.bind( str_hashchange, fn ) : this.trigger( str_hashchange );
- };
-
- // Property: jQuery.fn.hashchange.delay
- //
- // The numeric interval (in milliseconds) at which the <hashchange event>
- // polling loop executes. Defaults to 50.
-
- // Property: jQuery.fn.hashchange.domain
- //
- // If you're setting document.domain in your JavaScript, and you want hash
- // history to work in IE6/7, not only must this property be set, but you must
- // also set document.domain BEFORE jQuery is loaded into the page. This
- // property is only applicable if you are supporting IE6/7 (or IE8 operating
- // in "IE7 compatibility" mode).
- //
- // In addition, the <jQuery.fn.hashchange.src> property must be set to the
- // path of the included "document-domain.html" file, which can be renamed or
- // modified if necessary (note that the document.domain specified must be the
- // same in both your main JavaScript as well as in this file).
- //
- // Usage:
- //
- // jQuery.fn.hashchange.domain = document.domain;
-
- // Property: jQuery.fn.hashchange.src
- //
- // If, for some reason, you need to specify an Iframe src file (for example,
- // when setting document.domain as in <jQuery.fn.hashchange.domain>), you can
- // do so using this property. Note that when using this property, history
- // won't be recorded in IE6/7 until the Iframe src file loads. This property
- // is only applicable if you are supporting IE6/7 (or IE8 operating in "IE7
- // compatibility" mode).
- //
- // Usage:
- //
- // jQuery.fn.hashchange.src = 'path/to/file.html';
-
- $.fn[ str_hashchange ].delay = 50;
- /*
- $.fn[ str_hashchange ].domain = null;
- $.fn[ str_hashchange ].src = null;
- */
-
- // Event: hashchange event
- //
- // Fired when location.hash changes. In browsers that support it, the native
- // HTML5 window.onhashchange event is used, otherwise a polling loop is
- // initialized, running every <jQuery.fn.hashchange.delay> milliseconds to
- // see if the hash has changed. In IE6/7 (and IE8 operating in "IE7
- // compatibility" mode), a hidden Iframe is created to allow the back button
- // and hash-based history to work.
- //
- // Usage as described in <jQuery.fn.hashchange>:
- //
- // > // Bind an event handler.
- // > jQuery(window).hashchange( function(e) {
- // > var hash = location.hash;
- // > ...
- // > });
- // >
- // > // Manually trigger the event handler.
- // > jQuery(window).hashchange();
- //
- // A more verbose usage that allows for event namespacing:
- //
- // > // Bind an event handler.
- // > jQuery(window).bind( 'hashchange', function(e) {
- // > var hash = location.hash;
- // > ...
- // > });
- // >
- // > // Manually trigger the event handler.
- // > jQuery(window).trigger( 'hashchange' );
- //
- // Additional Notes:
- //
- // * The polling loop and Iframe are not created until at least one handler
- // is actually bound to the 'hashchange' event.
- // * If you need the bound handler(s) to execute immediately, in cases where
- // a location.hash exists on page load, via bookmark or page refresh for
- // example, use jQuery(window).hashchange() or the more verbose
- // jQuery(window).trigger( 'hashchange' ).
- // * The event can be bound before DOM ready, but since it won't be usable
- // before then in IE6/7 (due to the necessary Iframe), recommended usage is
- // to bind it inside a DOM ready handler.
-
- // Override existing $.event.special.hashchange methods (allowing this plugin
- // to be defined after jQuery BBQ in BBQ's source code).
- special[ str_hashchange ] = $.extend( special[ str_hashchange ], {
-
- // Called only when the first 'hashchange' event is bound to window.
- setup: function() {
- // If window.onhashchange is supported natively, there's nothing to do..
- if ( supports_onhashchange ) { return false; }
-
- // Otherwise, we need to create our own. And we don't want to call this
- // until the user binds to the event, just in case they never do, since it
- // will create a polling loop and possibly even a hidden Iframe.
- $( fake_onhashchange.start );
- },
-
- // Called only when the last 'hashchange' event is unbound from window.
- teardown: function() {
- // If window.onhashchange is supported natively, there's nothing to do..
- if ( supports_onhashchange ) { return false; }
-
- // Otherwise, we need to stop ours (if possible).
- $( fake_onhashchange.stop );
- }
-
- });
-
- // fake_onhashchange does all the work of triggering the window.onhashchange
- // event for browsers that don't natively support it, including creating a
- // polling loop to watch for hash changes and in IE 6/7 creating a hidden
- // Iframe to enable back and forward.
- fake_onhashchange = (function(){
- var self = {},
- timeout_id,
-
- // Remember the initial hash so it doesn't get triggered immediately.
- last_hash = get_fragment(),
-
- fn_retval = function(val){ return val; },
- history_set = fn_retval,
- history_get = fn_retval;
-
- // Start the polling loop.
- self.start = function() {
- timeout_id || poll();
- };
-
- // Stop the polling loop.
- self.stop = function() {
- timeout_id && clearTimeout( timeout_id );
- timeout_id = undefined;
- };
-
- // This polling loop checks every $.fn.hashchange.delay milliseconds to see
- // if location.hash has changed, and triggers the 'hashchange' event on
- // window when necessary.
- function poll() {
- var hash = get_fragment(),
- history_hash = history_get( last_hash );
-
- if ( hash !== last_hash ) {
- history_set( last_hash = hash, history_hash );
-
- $(window).trigger( str_hashchange );
-
- } else if ( history_hash !== last_hash ) {
- location.href = location.href.replace( /#.*/, '' ) + history_hash;
- }
-
- timeout_id = setTimeout( poll, $.fn[ str_hashchange ].delay );
- };
-
- // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
- // vvvvvvvvvvvvvvvvvvv REMOVE IF NOT SUPPORTING IE6/7/8 vvvvvvvvvvvvvvvvvvv
- // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
- $.browser.msie && !supports_onhashchange && (function(){
- // Not only do IE6/7 need the "magical" Iframe treatment, but so does IE8
- // when running in "IE7 compatibility" mode.
-
- var iframe,
- iframe_src;
-
- // When the event is bound and polling starts in IE 6/7, create a hidden
- // Iframe for history handling.
- self.start = function(){
- if ( !iframe ) {
- iframe_src = $.fn[ str_hashchange ].src;
- iframe_src = iframe_src && iframe_src + get_fragment();
-
- // Create hidden Iframe. Attempt to make Iframe as hidden as possible
- // by using techniques from http://www.paciellogroup.com/blog/?p=604.
- iframe = $('<iframe tabindex="-1" title="empty"/>').hide()
-
- // When Iframe has completely loaded, initialize the history and
- // start polling.
- .one( 'load', function(){
- iframe_src || history_set( get_fragment() );
- poll();
- })
-
- // Load Iframe src if specified, otherwise nothing.
- .attr( 'src', iframe_src || 'javascript:0' )
-
- // Append Iframe after the end of the body to prevent unnecessary
- // initial page scrolling (yes, this works).
- .insertAfter( 'body' )[0].contentWindow;
-
- // Whenever `document.title` changes, update the Iframe's title to
- // prettify the back/next history menu entries. Since IE sometimes
- // errors with "Unspecified error" the very first time this is set
- // (yes, very useful) wrap this with a try/catch block.
- doc.onpropertychange = function(){
- try {
- if ( event.propertyName === 'title' ) {
- iframe.document.title = doc.title;
- }
- } catch(e) {}
- };
-
- }
- };
-
- // Override the "stop" method since an IE6/7 Iframe was created. Even
- // if there are no longer any bound event handlers, the polling loop
- // is still necessary for back/next to work at all!
- self.stop = fn_retval;
-
- // Get history by looking at the hidden Iframe's location.hash.
- history_get = function() {
- return get_fragment( iframe.location.href );
- };
-
- // Set a new history item by opening and then closing the Iframe
- // document, *then* setting its location.hash. If document.domain has
- // been set, update that as well.
- history_set = function( hash, history_hash ) {
- var iframe_doc = iframe.document,
- domain = $.fn[ str_hashchange ].domain;
-
- if ( hash !== history_hash ) {
- // Update Iframe with any initial `document.title` that might be set.
- iframe_doc.title = doc.title;
-
- // Opening the Iframe's document after it has been closed is what
- // actually adds a history entry.
- iframe_doc.open();
-
- // Set document.domain for the Iframe document as well, if necessary.
- domain && iframe_doc.write( '<script>document.domain="' + domain + '"</script>' );
-
- iframe_doc.close();
-
- // Update the Iframe's hash, for great justice.
- iframe.location.hash = hash;
- }
- };
-
- })();
- // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- // ^^^^^^^^^^^^^^^^^^^ REMOVE IF NOT SUPPORTING IE6/7/8 ^^^^^^^^^^^^^^^^^^^
- // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
- return self;
- })();
-
-})(jQuery,this);
+ _delay: function( handler, delay ) {
+ function handlerProxy() {
+ return ( typeof handler === "string" ? instance[ handler ] : handler )
+ .apply( instance, arguments );
+ }
+ var instance = this;
+ return setTimeout( handlerProxy, delay || 0 );
+ },
+
+ _hoverable: function( element ) {
+ this.hoverable = this.hoverable.add( element );
+ this._on( element, {
+ mouseenter: function( event ) {
+ $( event.currentTarget ).addClass( "ui-state-hover" );
+ },
+ mouseleave: function( event ) {
+ $( event.currentTarget ).removeClass( "ui-state-hover" );
+ }
+ });
+ },
+
+ _focusable: function( element ) {
+ this.focusable = this.focusable.add( element );
+ this._on( element, {
+ focusin: function( event ) {
+ $( event.currentTarget ).addClass( "ui-state-focus" );
+ },
+ focusout: function( event ) {
+ $( event.currentTarget ).removeClass( "ui-state-focus" );
+ }
+ });
+ },
+
+ _trigger: function( type, event, data ) {
+ var prop, orig,
+ callback = this.options[ type ];
+
+ data = data || {};
+ event = $.Event( event );
+ event.type = ( type === this.widgetEventPrefix ?
+ type :
+ this.widgetEventPrefix + type ).toLowerCase();
+ // the original event may come from any element
+ // so we need to reset the target on the new event
+ event.target = this.element[ 0 ];
+
+ // copy original event properties over to the new event
+ orig = event.originalEvent;
+ if ( orig ) {
+ for ( prop in orig ) {
+ if ( !( prop in event ) ) {
+ event[ prop ] = orig[ prop ];
+ }
+ }
+ }
+
+ this.element.trigger( event, data );
+ return !( $.isFunction( callback ) &&
+ callback.apply( this.element[0], [ event ].concat( data ) ) === false ||
+ event.isDefaultPrevented() );
+ }
+};
+
+$.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) {
+ $.Widget.prototype[ "_" + method ] = function( element, options, callback ) {
+ if ( typeof options === "string" ) {
+ options = { effect: options };
+ }
+ var hasOptions,
+ effectName = !options ?
+ method :
+ options === true || typeof options === "number" ?
+ defaultEffect :
+ options.effect || defaultEffect;
+ options = options || {};
+ if ( typeof options === "number" ) {
+ options = { duration: options };
+ }
+ hasOptions = !$.isEmptyObject( options );
+ options.complete = callback;
+ if ( options.delay ) {
+ element.delay( options.delay );
+ }
+ if ( hasOptions && $.effects && ( $.effects.effect[ effectName ] || $.uiBackCompat !== false && $.effects[ effectName ] ) ) {
+ element[ method ]( options );
+ } else if ( effectName !== method && element[ effectName ] ) {
+ element[ effectName ]( options.duration, options.easing, callback );
+ } else {
+ element.queue(function( next ) {
+ $( this )[ method ]();
+ if ( callback ) {
+ callback.call( element[ 0 ] );
+ }
+ next();
+ });
+ }
+ };
+});
+
+// DEPRECATED
+if ( $.uiBackCompat !== false ) {
+ $.Widget.prototype._getCreateOptions = function() {
+ return $.metadata && $.metadata.get( this.element[0] )[ this.widgetName ];
+ };
+}
+
+})( jQuery );
+
+(function( $, undefined ) {
+
+$.widget( "mobile.widget", {
+ // decorate the parent _createWidget to trigger `widgetinit` for users
+ // who wish to do post post `widgetcreate` alterations/additions
+ //
+ // TODO create a pull request for jquery ui to trigger this event
+ // in the original _createWidget
+ _createWidget: function() {
+ $.Widget.prototype._createWidget.apply( this, arguments );
+ this._trigger( 'init' );
+ },
+
+ _getCreateOptions: function() {
+
+ var elem = this.element,
+ options = {};
+
+ $.each( this.options, function( option ) {
+
+ var value = elem.jqmData( option.replace( /[A-Z]/g, function( c ) {
+ return "-" + c.toLowerCase();
+ })
+ );
+
+ if ( value !== undefined ) {
+ options[ option ] = value;
+ }
+ });
+
+ return options;
+ },
+
+ enhanceWithin: function( target, useKeepNative ) {
+ this.enhance( $( this.options.initSelector, $( target )), useKeepNative );
+ },
+
+ enhance: function( targets, useKeepNative ) {
+ var page, keepNative, $widgetElements = $( targets ), self = this;
+
+ // if ignoreContentEnabled is set to true the framework should
+ // only enhance the selected elements when they do NOT have a
+ // parent with the data-namespace-ignore attribute
+ $widgetElements = $.mobile.enhanceable( $widgetElements );
+
+ if ( useKeepNative && $widgetElements.length ) {
+ // TODO remove dependency on the page widget for the keepNative.
+ // Currently the keepNative value is defined on the page prototype so
+ // the method is as well
+ page = $.mobile.closestPageData( $widgetElements );
+ keepNative = ( page && page.keepNativeSelector()) || "";
+
+ $widgetElements = $widgetElements.not( keepNative );
+ }
+
+ $widgetElements[ this.widgetName ]();
+ },
+
+ raise: function( msg ) {
+ throw "Widget [" + this.widgetName + "]: " + msg;
+ }
+});
+
+})( jQuery );
+
+
+(function( $, window ) {
+ // DEPRECATED
+ // NOTE global mobile object settings
+ $.extend( $.mobile, {
+ // DEPRECATED Should the text be visble in the loading message?
+ loadingMessageTextVisible: undefined,
+
+ // DEPRECATED When the text is visible, what theme does the loading box use?
+ loadingMessageTheme: undefined,
+
+ // DEPRECATED default message setting
+ loadingMessage: undefined,
+
+ // DEPRECATED
+ // Turn on/off page loading message. Theme doubles as an object argument
+ // with the following shape: { theme: '', text: '', html: '', textVisible: '' }
+ // NOTE that the $.mobile.loading* settings and params past the first are deprecated
+ showPageLoadingMsg: function( theme, msgText, textonly ) {
+ $.mobile.loading( 'show', theme, msgText, textonly );
+ },
+
+ // DEPRECATED
+ hidePageLoadingMsg: function() {
+ $.mobile.loading( 'hide' );
+ },
+
+ loading: function() {
+ this.loaderWidget.loader.apply( this.loaderWidget, arguments );
+ }
+ });
+
+ // TODO move loader class down into the widget settings
+ var loaderClass = "ui-loader", $html = $( "html" ), $window = $( window );
+
+ $.widget( "mobile.loader", {
+ // NOTE if the global config settings are defined they will override these
+ // options
+ options: {
+ // the theme for the loading message
+ theme: "a",
+
+ // whether the text in the loading message is shown
+ textVisible: false,
+
+ // custom html for the inner content of the loading message
+ html: "",
+
+ // the text to be displayed when the popup is shown
+ text: "loading"
+ },
+
+ defaultHtml: "<div class='" + loaderClass + "'>" +
+ "<span class='ui-icon ui-icon-loading'></span>" +
+ "<h1></h1>" +
+ "</div>",
+
+ // For non-fixed supportin browsers. Position at y center (if scrollTop supported), above the activeBtn (if defined), or just 100px from top
+ fakeFixLoader: function() {
+ var activeBtn = $( "." + $.mobile.activeBtnClass ).first();
+
+ this.element
+ .css({
+ top: $.support.scrollTop && $window.scrollTop() + $window.height() / 2 ||
+ activeBtn.length && activeBtn.offset().top || 100
+ });
+ },
+
+ // check position of loader to see if it appears to be "fixed" to center
+ // if not, use abs positioning
+ checkLoaderPosition: function() {
+ var offset = this.element.offset(),
+ scrollTop = $window.scrollTop(),
+ screenHeight = $.mobile.getScreenHeight();
+
+ if ( offset.top < scrollTop || ( offset.top - scrollTop ) > screenHeight ) {
+ this.element.addClass( "ui-loader-fakefix" );
+ this.fakeFixLoader();
+ $window
+ .unbind( "scroll", this.checkLoaderPosition )
+ .bind( "scroll", this.fakeFixLoader );
+ }
+ },
+
+ resetHtml: function() {
+ this.element.html( $( this.defaultHtml ).html() );
+ },
+
+ // Turn on/off page loading message. Theme doubles as an object argument
+ // with the following shape: { theme: '', text: '', html: '', textVisible: '' }
+ // NOTE that the $.mobile.loading* settings and params past the first are deprecated
+ // TODO sweet jesus we need to break some of this out
+ show: function( theme, msgText, textonly ) {
+ var textVisible, message, $header, loadSettings;
+
+ this.resetHtml();
+
+ // use the prototype options so that people can set them globally at
+ // mobile init. Consistency, it's what's for dinner
+ if ( $.type(theme) === "object" ) {
+ loadSettings = $.extend( {}, this.options, theme );
+
+ // prefer object property from the param then the old theme setting
+ theme = loadSettings.theme || $.mobile.loadingMessageTheme;
+ } else {
+ loadSettings = this.options;
+
+ // here we prefer the them value passed as a string argument, then
+ // we prefer the global option because we can't use undefined default
+ // prototype options, then the prototype option
+ theme = theme || $.mobile.loadingMessageTheme || loadSettings.theme;
+ }
+
+ // set the message text, prefer the param, then the settings object
+ // then loading message
+ message = msgText || $.mobile.loadingMessage || loadSettings.text;
+
+ // prepare the dom
+ $html.addClass( "ui-loading" );
+
+ if ( $.mobile.loadingMessage !== false || loadSettings.html ) {
+ // boolean values require a bit more work :P, supports object properties
+ // and old settings
+ if ( $.mobile.loadingMessageTextVisible !== undefined ) {
+ textVisible = $.mobile.loadingMessageTextVisible;
+ } else {
+ textVisible = loadSettings.textVisible;
+ }
+
+ // add the proper css given the options (theme, text, etc)
+ // Force text visibility if the second argument was supplied, or
+ // if the text was explicitly set in the object args
+ this.element.attr("class", loaderClass +
+ " ui-corner-all ui-body-" + theme +
+ " ui-loader-" + ( textVisible || msgText || theme.text ? "verbose" : "default" ) +
+ ( loadSettings.textonly || textonly ? " ui-loader-textonly" : "" ) );
+
+ // TODO verify that jquery.fn.html is ok to use in both cases here
+ // this might be overly defensive in preventing unknowing xss
+ // if the html attribute is defined on the loading settings, use that
+ // otherwise use the fallbacks from above
+ if ( loadSettings.html ) {
+ this.element.html( loadSettings.html );
+ } else {
+ this.element.find( "h1" ).text( message );
+ }
+
+ // attach the loader to the DOM
+ this.element.appendTo( $.mobile.pageContainer );
+
+ // check that the loader is visible
+ this.checkLoaderPosition();
+
+ // on scroll check the loader position
+ $window.bind( "scroll", $.proxy( this.checkLoaderPosition, this ) );
+ }
+ },
+
+ hide: function() {
+ $html.removeClass( "ui-loading" );
+
+ if ( $.mobile.loadingMessage ) {
+ this.element.removeClass( "ui-loader-fakefix" );
+ }
+
+ $( window ).unbind( "scroll", $.proxy( this.fakeFixLoader, this) );
+ $( window ).unbind( "scroll", $.proxy( this.checkLoaderPosition, this ) );
+ }
+ });
+
+ $window.bind( 'pagecontainercreate', function() {
+ $.mobile.loaderWidget = $.mobile.loaderWidget || $( $.mobile.loader.prototype.defaultHtml ).loader();
+ });
+})(jQuery, this);
+
+
+
+// This plugin is an experiment for abstracting away the touch and mouse
+// events so that developers don't have to worry about which method of input
+// the device their document is loaded on supports.
+//
+// The idea here is to allow the developer to register listeners for the
+// basic mouse events, such as mousedown, mousemove, mouseup, and click,
+// and the plugin will take care of registering the correct listeners
+// behind the scenes to invoke the listener at the fastest possible time
+// for that device, while still retaining the order of event firing in
+// the traditional mouse environment, should multiple handlers be registered
+// on the same element for different events.
+//
+// The current version exposes the following virtual events to jQuery bind methods:
+// "vmouseover vmousedown vmousemove vmouseup vclick vmouseout vmousecancel"
+
+(function( $, window, document, undefined ) {
+
+var dataPropertyName = "virtualMouseBindings",
+ touchTargetPropertyName = "virtualTouchID",
+ virtualEventNames = "vmouseover vmousedown vmousemove vmouseup vclick vmouseout vmousecancel".split( " " ),
+ touchEventProps = "clientX clientY pageX pageY screenX screenY".split( " " ),
+ mouseHookProps = $.event.mouseHooks ? $.event.mouseHooks.props : [],
+ mouseEventProps = $.event.props.concat( mouseHookProps ),
+ activeDocHandlers = {},
+ resetTimerID = 0,
+ startX = 0,
+ startY = 0,
+ didScroll = false,
+ clickBlockList = [],
+ blockMouseTriggers = false,
+ blockTouchTriggers = false,
+ eventCaptureSupported = "addEventListener" in document,
+ $document = $( document ),
+ nextTouchID = 1,
+ lastTouchID = 0, threshold;
+
+$.vmouse = {
+ moveDistanceThreshold: 10,
+ clickDistanceThreshold: 10,
+ resetTimerDuration: 1500
+};
+
+function getNativeEvent( event ) {
+
+ while ( event && typeof event.originalEvent !== "undefined" ) {
+ event = event.originalEvent;
+ }
+ return event;
+}
+
+function createVirtualEvent( event, eventType ) {
+
+ var t = event.type,
+ oe, props, ne, prop, ct, touch, i, j, len;
+
+ event = $.Event( event );
+ event.type = eventType;
+
+ oe = event.originalEvent;
+ props = $.event.props;
+
+ // addresses separation of $.event.props in to $.event.mouseHook.props and Issue 3280
+ // https://github.com/jquery/jquery-mobile/issues/3280
+ if ( t.search( /^(mouse|click)/ ) > -1 ) {
+ props = mouseEventProps;
+ }
+
+ // copy original event properties over to the new event
+ // this would happen if we could call $.event.fix instead of $.Event
+ // but we don't have a way to force an event to be fixed multiple times
+ if ( oe ) {
+ for ( i = props.length, prop; i; ) {
+ prop = props[ --i ];
+ event[ prop ] = oe[ prop ];
+ }
+ }
+
+ // make sure that if the mouse and click virtual events are generated
+ // without a .which one is defined
+ if ( t.search(/mouse(down|up)|click/) > -1 && !event.which ) {
+ event.which = 1;
+ }
+
+ if ( t.search(/^touch/) !== -1 ) {
+ ne = getNativeEvent( oe );
+ t = ne.touches;
+ ct = ne.changedTouches;
+ touch = ( t && t.length ) ? t[0] : ( ( ct && ct.length ) ? ct[ 0 ] : undefined );
+
+ if ( touch ) {
+ for ( j = 0, len = touchEventProps.length; j < len; j++) {
+ prop = touchEventProps[ j ];
+ event[ prop ] = touch[ prop ];
+ }
+ }
+ }
+
+ return event;
+}
+
+function getVirtualBindingFlags( element ) {
+
+ var flags = {},
+ b, k;
+
+ while ( element ) {
+
+ b = $.data( element, dataPropertyName );
+
+ for ( k in b ) {
+ if ( b[ k ] ) {
+ flags[ k ] = flags.hasVirtualBinding = true;
+ }
+ }
+ element = element.parentNode;
+ }
+ return flags;
+}
+
+function getClosestElementWithVirtualBinding( element, eventType ) {
+ var b;
+ while ( element ) {
+
+ b = $.data( element, dataPropertyName );
+
+ if ( b && ( !eventType || b[ eventType ] ) ) {
+ return element;
+ }
+ element = element.parentNode;
+ }
+ return null;
+}
+
+function enableTouchBindings() {
+ blockTouchTriggers = false;
+}
+
+function disableTouchBindings() {
+ blockTouchTriggers = true;
+}
+
+function enableMouseBindings() {
+ lastTouchID = 0;
+ clickBlockList.length = 0;
+ blockMouseTriggers = false;
+
+ // When mouse bindings are enabled, our
+ // touch bindings are disabled.
+ disableTouchBindings();
+}
+
+function disableMouseBindings() {
+ // When mouse bindings are disabled, our
+ // touch bindings are enabled.
+ enableTouchBindings();
+}
+
+function startResetTimer() {
+ clearResetTimer();
+ resetTimerID = setTimeout( function() {
+ resetTimerID = 0;
+ enableMouseBindings();
+ }, $.vmouse.resetTimerDuration );
+}
+
+function clearResetTimer() {
+ if ( resetTimerID ) {
+ clearTimeout( resetTimerID );
+ resetTimerID = 0;
+ }
+}
+
+function triggerVirtualEvent( eventType, event, flags ) {
+ var ve;
+
+ if ( ( flags && flags[ eventType ] ) ||
+ ( !flags && getClosestElementWithVirtualBinding( event.target, eventType ) ) ) {
+
+ ve = createVirtualEvent( event, eventType );
+
+ $( event.target).trigger( ve );
+ }
+
+ return ve;
+}
+
+function mouseEventCallback( event ) {
+ var touchID = $.data( event.target, touchTargetPropertyName );
+
+ if ( !blockMouseTriggers && ( !lastTouchID || lastTouchID !== touchID ) ) {
+ var ve = triggerVirtualEvent( "v" + event.type, event );
+ if ( ve ) {
+ if ( ve.isDefaultPrevented() ) {
+ event.preventDefault();
+ }
+ if ( ve.isPropagationStopped() ) {
+ event.stopPropagation();
+ }
+ if ( ve.isImmediatePropagationStopped() ) {
+ event.stopImmediatePropagation();
+ }
+ }
+ }
+}
+
+function handleTouchStart( event ) {
+
+ var touches = getNativeEvent( event ).touches,
+ target, flags;
+
+ if ( touches && touches.length === 1 ) {
+
+ target = event.target;
+ flags = getVirtualBindingFlags( target );
+
+ if ( flags.hasVirtualBinding ) {
+
+ lastTouchID = nextTouchID++;
+ $.data( target, touchTargetPropertyName, lastTouchID );
+
+ clearResetTimer();
+
+ disableMouseBindings();
+ didScroll = false;
+
+ var t = getNativeEvent( event ).touches[ 0 ];
+ startX = t.pageX;
+ startY = t.pageY;
+
+ triggerVirtualEvent( "vmouseover", event, flags );
+ triggerVirtualEvent( "vmousedown", event, flags );
+ }
+ }
+}
+
+function handleScroll( event ) {
+ if ( blockTouchTriggers ) {
+ return;
+ }
+
+ if ( !didScroll ) {
+ triggerVirtualEvent( "vmousecancel", event, getVirtualBindingFlags( event.target ) );
+ }
+
+ didScroll = true;
+ startResetTimer();
+}
+
+function handleTouchMove( event ) {
+ if ( blockTouchTriggers ) {
+ return;
+ }
+
+ var t = getNativeEvent( event ).touches[ 0 ],
+ didCancel = didScroll,
+ moveThreshold = $.vmouse.moveDistanceThreshold,
+ flags = getVirtualBindingFlags( event.target );
+
+ didScroll = didScroll ||
+ ( Math.abs( t.pageX - startX ) > moveThreshold ||
+ Math.abs( t.pageY - startY ) > moveThreshold );
+
+
+ if ( didScroll && !didCancel ) {
+ triggerVirtualEvent( "vmousecancel", event, flags );
+ }
+
+ triggerVirtualEvent( "vmousemove", event, flags );
+ startResetTimer();
+}
+
+function handleTouchEnd( event ) {
+ if ( blockTouchTriggers ) {
+ return;
+ }
+
+ disableTouchBindings();
+
+ var flags = getVirtualBindingFlags( event.target ),
+ t;
+ triggerVirtualEvent( "vmouseup", event, flags );
+
+ if ( !didScroll ) {
+ var ve = triggerVirtualEvent( "vclick", event, flags );
+ if ( ve && ve.isDefaultPrevented() ) {
+ // The target of the mouse events that follow the touchend
+ // event don't necessarily match the target used during the
+ // touch. This means we need to rely on coordinates for blocking
+ // any click that is generated.
+ t = getNativeEvent( event ).changedTouches[ 0 ];
+ clickBlockList.push({
+ touchID: lastTouchID,
+ x: t.clientX,
+ y: t.clientY
+ });
+
+ // Prevent any mouse events that follow from triggering
+ // virtual event notifications.
+ blockMouseTriggers = true;
+ }
+ }
+ triggerVirtualEvent( "vmouseout", event, flags);
+ didScroll = false;
+
+ startResetTimer();
+}
+
+function hasVirtualBindings( ele ) {
+ var bindings = $.data( ele, dataPropertyName ),
+ k;
+
+ if ( bindings ) {
+ for ( k in bindings ) {
+ if ( bindings[ k ] ) {
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
+function dummyMouseHandler() {}
+
+function getSpecialEventObject( eventType ) {
+ var realType = eventType.substr( 1 );
+
+ return {
+ setup: function( data, namespace ) {
+ // If this is the first virtual mouse binding for this element,
+ // add a bindings object to its data.
+
+ if ( !hasVirtualBindings( this ) ) {
+ $.data( this, dataPropertyName, {} );
+ }
+
+ // If setup is called, we know it is the first binding for this
+ // eventType, so initialize the count for the eventType to zero.
+ var bindings = $.data( this, dataPropertyName );
+ bindings[ eventType ] = true;
+
+ // If this is the first virtual mouse event for this type,
+ // register a global handler on the document.
+
+ activeDocHandlers[ eventType ] = ( activeDocHandlers[ eventType ] || 0 ) + 1;
+
+ if ( activeDocHandlers[ eventType ] === 1 ) {
+ $document.bind( realType, mouseEventCallback );
+ }
+
+ // Some browsers, like Opera Mini, won't dispatch mouse/click events
+ // for elements unless they actually have handlers registered on them.
+ // To get around this, we register dummy handlers on the elements.
+
+ $( this ).bind( realType, dummyMouseHandler );
+
+ // For now, if event capture is not supported, we rely on mouse handlers.
+ if ( eventCaptureSupported ) {
+ // If this is the first virtual mouse binding for the document,
+ // register our touchstart handler on the document.
+
+ activeDocHandlers[ "touchstart" ] = ( activeDocHandlers[ "touchstart" ] || 0) + 1;
+
+ if ( activeDocHandlers[ "touchstart" ] === 1 ) {
+ $document.bind( "touchstart", handleTouchStart )
+ .bind( "touchend", handleTouchEnd )
+
+ // On touch platforms, touching the screen and then dragging your finger
+ // causes the window content to scroll after some distance threshold is
+ // exceeded. On these platforms, a scroll prevents a click event from being
+ // dispatched, and on some platforms, even the touchend is suppressed. To
+ // mimic the suppression of the click event, we need to watch for a scroll
+ // event. Unfortunately, some platforms like iOS don't dispatch scroll
+ // events until *AFTER* the user lifts their finger (touchend). This means
+ // we need to watch both scroll and touchmove events to figure out whether
+ // or not a scroll happenens before the touchend event is fired.
+
+ .bind( "touchmove", handleTouchMove )
+ .bind( "scroll", handleScroll );
+ }
+ }
+ },
+
+ teardown: function( data, namespace ) {
+ // If this is the last virtual binding for this eventType,
+ // remove its global handler from the document.
+
+ --activeDocHandlers[ eventType ];
+
+ if ( !activeDocHandlers[ eventType ] ) {
+ $document.unbind( realType, mouseEventCallback );
+ }
+
+ if ( eventCaptureSupported ) {
+ // If this is the last virtual mouse binding in existence,
+ // remove our document touchstart listener.
+
+ --activeDocHandlers[ "touchstart" ];
+
+ if ( !activeDocHandlers[ "touchstart" ] ) {
+ $document.unbind( "touchstart", handleTouchStart )
+ .unbind( "touchmove", handleTouchMove )
+ .unbind( "touchend", handleTouchEnd )
+ .unbind( "scroll", handleScroll );
+ }
+ }
+
+ var $this = $( this ),
+ bindings = $.data( this, dataPropertyName );
+
+ // teardown may be called when an element was
+ // removed from the DOM. If this is the case,
+ // jQuery core may have already stripped the element
+ // of any data bindings so we need to check it before
+ // using it.
+ if ( bindings ) {
+ bindings[ eventType ] = false;
+ }
+
+ // Unregister the dummy event handler.
+
+ $this.unbind( realType, dummyMouseHandler );
+
+ // If this is the last virtual mouse binding on the
+ // element, remove the binding data from the element.
+
+ if ( !hasVirtualBindings( this ) ) {
+ $this.removeData( dataPropertyName );
+ }
+ }
+ };
+}
+
+// Expose our custom events to the jQuery bind/unbind mechanism.
+
+for ( var i = 0; i < virtualEventNames.length; i++ ) {
+ $.event.special[ virtualEventNames[ i ] ] = getSpecialEventObject( virtualEventNames[ i ] );
+}
+
+// Add a capture click handler to block clicks.
+// Note that we require event capture support for this so if the device
+// doesn't support it, we punt for now and rely solely on mouse events.
+if ( eventCaptureSupported ) {
+ document.addEventListener( "click", function( e ) {
+ var cnt = clickBlockList.length,
+ target = e.target,
+ x, y, ele, i, o, touchID;
-/*!
- * jQuery UI Widget @VERSION
- *
- * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Widget
- */
+ if ( cnt ) {
+ x = e.clientX;
+ y = e.clientY;
+ threshold = $.vmouse.clickDistanceThreshold;
-(function( $, undefined ) {
+ // The idea here is to run through the clickBlockList to see if
+ // the current click event is in the proximity of one of our
+ // vclick events that had preventDefault() called on it. If we find
+ // one, then we block the click.
+ //
+ // Why do we have to rely on proximity?
+ //
+ // Because the target of the touch event that triggered the vclick
+ // can be different from the target of the click event synthesized
+ // by the browser. The target of a mouse/click event that is syntehsized
+ // from a touch event seems to be implementation specific. For example,
+ // some browsers will fire mouse/click events for a link that is near
+ // a touch event, even though the target of the touchstart/touchend event
+ // says the user touched outside the link. Also, it seems that with most
+ // browsers, the target of the mouse/click event is not calculated until the
+ // time it is dispatched, so if you replace an element that you touched
+ // with another element, the target of the mouse/click will be the new
+ // element underneath that point.
+ //
+ // Aside from proximity, we also check to see if the target and any
+ // of its ancestors were the ones that blocked a click. This is necessary
+ // because of the strange mouse/click target calculation done in the
+ // Android 2.1 browser, where if you click on an element, and there is a
+ // mouse/click handler on one of its ancestors, the target will be the
+ // innermost child of the touched element, even if that child is no where
+ // near the point of touch.
-// jQuery 1.4+
-if ( $.cleanData ) {
- var _cleanData = $.cleanData;
- $.cleanData = function( elems ) {
- for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
- $( elem ).triggerHandler( "remove" );
- }
- _cleanData( elems );
- };
-} else {
- var _remove = $.fn.remove;
- $.fn.remove = function( selector, keepData ) {
- return this.each(function() {
- if ( !keepData ) {
- if ( !selector || $.filter( selector, [ this ] ).length ) {
- $( "*", this ).add( [ this ] ).each(function() {
- $( this ).triggerHandler( "remove" );
- });
+ ele = target;
+
+ while ( ele ) {
+ for ( i = 0; i < cnt; i++ ) {
+ o = clickBlockList[ i ];
+ touchID = 0;
+
+ if ( ( ele === target && Math.abs( o.x - x ) < threshold && Math.abs( o.y - y ) < threshold ) ||
+ $.data( ele, touchTargetPropertyName ) === o.touchID ) {
+ // XXX: We may want to consider removing matches from the block list
+ // instead of waiting for the reset timer to fire.
+ e.preventDefault();
+ e.stopPropagation();
+ return;
+ }
}
+ ele = ele.parentNode;
}
- return _remove.call( $(this), selector, keepData );
- });
- };
+ }
+ }, true);
}
+})( jQuery, window, document );
-$.widget = function( name, base, prototype ) {
- var namespace = name.split( "." )[ 0 ],
- fullName;
- name = name.split( "." )[ 1 ];
- fullName = namespace + "-" + name;
+ (function( $, undefined ) {
+ var support = {
+ touch: "ontouchend" in document
+ };
- if ( !prototype ) {
- prototype = base;
- base = $.Widget;
+ $.mobile = $.mobile || {};
+ $.mobile.support = $.mobile.support || {};
+ $.extend( $.support, support );
+ $.extend( $.mobile.support, support );
+ }( jQuery ));
+
+
+(function( $, window, undefined ) {
+ // add new event shortcuts
+ $.each( ( "touchstart touchmove touchend " +
+ "tap taphold " +
+ "swipe swipeleft swiperight " +
+ "scrollstart scrollstop" ).split( " " ), function( i, name ) {
+
+ $.fn[ name ] = function( fn ) {
+ return fn ? this.bind( name, fn ) : this.trigger( name );
+ };
+
+ // jQuery < 1.8
+ if ( $.attrFn ) {
+ $.attrFn[ name ] = true;
+ }
+ });
+
+ var supportTouch = $.mobile.support.touch,
+ scrollEvent = "touchmove scroll",
+ touchStartEvent = supportTouch ? "touchstart" : "mousedown",
+ touchStopEvent = supportTouch ? "touchend" : "mouseup",
+ touchMoveEvent = supportTouch ? "touchmove" : "mousemove";
+
+ function triggerCustomEvent( obj, eventType, event ) {
+ var originalType = event.type;
+ event.type = eventType;
+ $.event.handle.call( obj, event );
+ event.type = originalType;
}
- // create selector for plugin
- $.expr[ ":" ][ fullName ] = function( elem ) {
- return !!$.data( elem, name );
- };
+ // also handles scrollstop
+ $.event.special.scrollstart = {
- $[ namespace ] = $[ namespace ] || {};
- $[ namespace ][ name ] = function( options, element ) {
- // allow instantiation without initializing for simple inheritance
- if ( arguments.length ) {
- this._createWidget( options, element );
+ enabled: true,
+
+ setup: function() {
+
+ var thisObject = this,
+ $this = $( thisObject ),
+ scrolling,
+ timer;
+
+ function trigger( event, state ) {
+ scrolling = state;
+ triggerCustomEvent( thisObject, scrolling ? "scrollstart" : "scrollstop", event );
+ }
+
+ // iPhone triggers scroll after a small delay; use touchmove instead
+ $this.bind( scrollEvent, function( event ) {
+
+ if ( !$.event.special.scrollstart.enabled ) {
+ return;
+ }
+
+ if ( !scrolling ) {
+ trigger( event, true );
+ }
+
+ clearTimeout( timer );
+ timer = setTimeout( function() {
+ trigger( event, false );
+ }, 50 );
+ });
}
};
- var basePrototype = new base();
- // we need to make the options hash a property directly on the new instance
- // otherwise we'll modify the options hash on the prototype that we're
- // inheriting from
-// $.each( basePrototype, function( key, val ) {
-// if ( $.isPlainObject(val) ) {
-// basePrototype[ key ] = $.extend( {}, val );
-// }
-// });
- basePrototype.options = $.extend( true, {}, basePrototype.options );
- $[ namespace ][ name ].prototype = $.extend( true, basePrototype, {
- namespace: namespace,
- widgetName: name,
- widgetEventPrefix: $[ namespace ][ name ].prototype.widgetEventPrefix || name,
- widgetBaseClass: fullName
- }, prototype );
+ // also handles taphold
+ $.event.special.tap = {
+ tapholdThreshold: 750,
- $.widget.bridge( name, $[ namespace ][ name ] );
-};
+ setup: function() {
+ var thisObject = this,
+ $this = $( thisObject );
-$.widget.bridge = function( name, object ) {
- $.fn[ name ] = function( options ) {
- var isMethodCall = typeof options === "string",
- args = Array.prototype.slice.call( arguments, 1 ),
- returnValue = this;
+ $this.bind( "vmousedown", function( event ) {
- // allow multiple hashes to be passed on init
- options = !isMethodCall && args.length ?
- $.extend.apply( null, [ true, options ].concat(args) ) :
- options;
+ if ( event.which && event.which !== 1 ) {
+ return false;
+ }
- // prevent calls to internal methods
- if ( isMethodCall && options.charAt( 0 ) === "_" ) {
- return returnValue;
- }
+ var origTarget = event.target,
+ origEvent = event.originalEvent,
+ timer;
- if ( isMethodCall ) {
- this.each(function() {
- var instance = $.data( this, name );
- if ( !instance ) {
- throw "cannot call methods on " + name + " prior to initialization; " +
- "attempted to call method '" + options + "'";
+ function clearTapTimer() {
+ clearTimeout( timer );
}
- if ( !$.isFunction( instance[options] ) ) {
- throw "no such method '" + options + "' for " + name + " widget instance";
+
+ function clearTapHandlers() {
+ clearTapTimer();
+
+ $this.unbind( "vclick", clickHandler )
+ .unbind( "vmouseup", clearTapTimer );
+ $( document ).unbind( "vmousecancel", clearTapHandlers );
}
- var methodValue = instance[ options ].apply( instance, args );
- if ( methodValue !== instance && methodValue !== undefined ) {
- returnValue = methodValue;
- return false;
+
+ function clickHandler( event ) {
+ clearTapHandlers();
+
+ // ONLY trigger a 'tap' event if the start target is
+ // the same as the stop target.
+ if ( origTarget === event.target ) {
+ triggerCustomEvent( thisObject, "tap", event );
+ }
}
+
+ $this.bind( "vmouseup", clearTapTimer )
+ .bind( "vclick", clickHandler );
+ $( document ).bind( "vmousecancel", clearTapHandlers );
+
+ timer = setTimeout( function() {
+ triggerCustomEvent( thisObject, "taphold", $.Event( "taphold", { target: origTarget } ) );
+ }, $.event.special.tap.tapholdThreshold );
});
- } else {
- this.each(function() {
- var instance = $.data( this, name );
- if ( instance ) {
- instance.option( options || {} )._init();
- } else {
- $.data( this, name, new object( options, this ) );
+ }
+ };
+
+ // also handles swipeleft, swiperight
+ $.event.special.swipe = {
+ scrollSupressionThreshold: 30, // More than this horizontal displacement, and we will suppress scrolling.
+
+ durationThreshold: 1000, // More time than this, and it isn't a swipe.
+
+ horizontalDistanceThreshold: 30, // Swipe horizontal displacement must be more than this.
+
+ verticalDistanceThreshold: 75, // Swipe vertical displacement must be less than this.
+
+ setup: function() {
+ var thisObject = this,
+ $this = $( thisObject );
+
+ $this.bind( touchStartEvent, function( event ) {
+ var data = event.originalEvent.touches ?
+ event.originalEvent.touches[ 0 ] : event,
+ start = {
+ time: ( new Date() ).getTime(),
+ coords: [ data.pageX, data.pageY ],
+ origin: $( event.target )
+ },
+ stop;
+
+ function moveHandler( event ) {
+
+ if ( !start ) {
+ return;
+ }
+
+ var data = event.originalEvent.touches ?
+ event.originalEvent.touches[ 0 ] : event;
+
+ stop = {
+ time: ( new Date() ).getTime(),
+ coords: [ data.pageX, data.pageY ]
+ };
+
+ // prevent scrolling
+ if ( Math.abs( start.coords[ 0 ] - stop.coords[ 0 ] ) > $.event.special.swipe.scrollSupressionThreshold ) {
+ event.preventDefault();
+ }
}
+
+ $this.bind( touchMoveEvent, moveHandler )
+ .one( touchStopEvent, function( event ) {
+ $this.unbind( touchMoveEvent, moveHandler );
+
+ if ( start && stop ) {
+ if ( stop.time - start.time < $.event.special.swipe.durationThreshold &&
+ Math.abs( start.coords[ 0 ] - stop.coords[ 0 ] ) > $.event.special.swipe.horizontalDistanceThreshold &&
+ Math.abs( start.coords[ 1 ] - stop.coords[ 1 ] ) < $.event.special.swipe.verticalDistanceThreshold ) {
+
+ start.origin.trigger( "swipe" )
+ .trigger( start.coords[0] > stop.coords[ 0 ] ? "swipeleft" : "swiperight" );
+ }
+ }
+ start = stop = undefined;
+ });
});
}
-
- return returnValue;
};
-};
-
-$.Widget = function( options, element ) {
- // allow instantiation without initializing for simple inheritance
- if ( arguments.length ) {
- this._createWidget( options, element );
- }
-};
+ $.each({
+ scrollstop: "scrollstart",
+ taphold: "tap",
+ swipeleft: "swipe",
+ swiperight: "swipe"
+ }, function( event, sourceEvent ) {
+
+ $.event.special[ event ] = {
+ setup: function() {
+ $( this ).bind( sourceEvent, $.noop );
+ }
+ };
+ });
-$.Widget.prototype = {
- widgetName: "widget",
- widgetEventPrefix: "",
- options: {
- disabled: false
- },
- _createWidget: function( options, element ) {
- // $.widget.bridge stores the plugin instance, but we do it anyway
- // so that it's stored even before the _create function runs
- $.data( element, this.widgetName, this );
- this.element = $( element );
- this.options = $.extend( true, {},
- this.options,
- this._getCreateOptions(),
- options );
+})( jQuery, this );
- var self = this;
- this.element.bind( "remove." + this.widgetName, function() {
- self.destroy();
+ (function( $, undefined ) {
+ $.extend( $.support, {
+ orientation: "orientation" in window && "onorientationchange" in window
});
+ }( jQuery ));
- this._create();
- this._trigger( "create" );
- this._init();
- },
- _getCreateOptions: function() {
- var options = {};
- if ( $.metadata ) {
- options = $.metadata.get( element )[ this.widgetName ];
- }
- return options;
- },
- _create: function() {},
- _init: function() {},
- destroy: function() {
- this.element
- .unbind( "." + this.widgetName )
- .removeData( this.widgetName );
- this.widget()
- .unbind( "." + this.widgetName )
- .removeAttr( "aria-disabled" )
- .removeClass(
- this.widgetBaseClass + "-disabled " +
- "ui-state-disabled" );
- },
+ // throttled resize event
+ (function( $ ) {
+ $.event.special.throttledresize = {
+ setup: function() {
+ $( this ).bind( "resize", handler );
+ },
+ teardown: function() {
+ $( this ).unbind( "resize", handler );
+ }
+ };
- widget: function() {
- return this.element;
- },
+ var throttle = 250,
+ handler = function() {
+ curr = ( new Date() ).getTime();
+ diff = curr - lastCall;
+
+ if ( diff >= throttle ) {
+
+ lastCall = curr;
+ $( this ).trigger( "throttledresize" );
+
+ } else {
+
+ if ( heldCall ) {
+ clearTimeout( heldCall );
+ }
+
+ // Promise a held call will still execute
+ heldCall = setTimeout( handler, throttle - diff );
+ }
+ },
+ lastCall = 0,
+ heldCall,
+ curr,
+ diff;
+ })( jQuery );
+
+(function( $, window ) {
+ var win = $( window ),
+ event_name = "orientationchange",
+ special_event,
+ get_orientation,
+ last_orientation,
+ initial_orientation_is_landscape,
+ initial_orientation_is_default,
+ portrait_map = { "0": true, "180": true };
+
+ // It seems that some device/browser vendors use window.orientation values 0 and 180 to
+ // denote the "default" orientation. For iOS devices, and most other smart-phones tested,
+ // the default orientation is always "portrait", but in some Android and RIM based tablets,
+ // the default orientation is "landscape". The following code attempts to use the window
+ // dimensions to figure out what the current orientation is, and then makes adjustments
+ // to the to the portrait_map if necessary, so that we can properly decode the
+ // window.orientation value whenever get_orientation() is called.
+ //
+ // Note that we used to use a media query to figure out what the orientation the browser
+ // thinks it is in:
+ //
+ // initial_orientation_is_landscape = $.mobile.media("all and (orientation: landscape)");
+ //
+ // but there was an iPhone/iPod Touch bug beginning with iOS 4.2, up through iOS 5.1,
+ // where the browser *ALWAYS* applied the landscape media query. This bug does not
+ // happen on iPad.
+
+ if ( $.support.orientation ) {
+
+ // Check the window width and height to figure out what the current orientation
+ // of the device is at this moment. Note that we've initialized the portrait map
+ // values to 0 and 180, *AND* we purposely check for landscape so that if we guess
+ // wrong, , we default to the assumption that portrait is the default orientation.
+ // We use a threshold check below because on some platforms like iOS, the iPhone
+ // form-factor can report a larger width than height if the user turns on the
+ // developer console. The actual threshold value is somewhat arbitrary, we just
+ // need to make sure it is large enough to exclude the developer console case.
- option: function( key, value ) {
- var options = key;
+ var ww = window.innerWidth || $( window ).width(),
+ wh = window.innerHeight || $( window ).height(),
+ landscape_threshold = 50;
- if ( arguments.length === 0 ) {
- // don't return a reference to the internal hash
- return $.extend( {}, this.options );
- }
+ initial_orientation_is_landscape = ww > wh && ( ww - wh ) > landscape_threshold;
- if (typeof key === "string" ) {
- if ( value === undefined ) {
- return this.options[ key ];
- }
- options = {};
- options[ key ] = value;
- }
- this._setOptions( options );
+ // Now check to see if the current window.orientation is 0 or 180.
+ initial_orientation_is_default = portrait_map[ window.orientation ];
- return this;
- },
- _setOptions: function( options ) {
- var self = this;
- $.each( options, function( key, value ) {
- self._setOption( key, value );
- });
+ // If the initial orientation is landscape, but window.orientation reports 0 or 180, *OR*
+ // if the initial orientation is portrait, but window.orientation reports 90 or -90, we
+ // need to flip our portrait_map values because landscape is the default orientation for
+ // this device/browser.
+ if ( ( initial_orientation_is_landscape && initial_orientation_is_default ) || ( !initial_orientation_is_landscape && !initial_orientation_is_default ) ) {
+ portrait_map = { "-90": true, "90": true };
+ }
+ }
- return this;
- },
- _setOption: function( key, value ) {
- this.options[ key ] = value;
+ $.event.special.orientationchange = $.extend( {}, $.event.special.orientationchange, {
+ setup: function() {
+ // If the event is supported natively, return false so that jQuery
+ // will bind to the event using DOM methods.
+ if ( $.support.orientation && !$.event.special.orientationchange.disabled ) {
+ return false;
+ }
- if ( key === "disabled" ) {
- this.widget()
- [ value ? "addClass" : "removeClass"](
- this.widgetBaseClass + "-disabled" + " " +
- "ui-state-disabled" )
- .attr( "aria-disabled", value );
- }
+ // Get the current orientation to avoid initial double-triggering.
+ last_orientation = get_orientation();
- return this;
- },
+ // Because the orientationchange event doesn't exist, simulate the
+ // event by testing window dimensions on resize.
+ win.bind( "throttledresize", handler );
+ },
+ teardown: function() {
+ // If the event is not supported natively, return false so that
+ // jQuery will unbind the event using DOM methods.
+ if ( $.support.orientation && !$.event.special.orientationchange.disabled ) {
+ return false;
+ }
- enable: function() {
- return this._setOption( "disabled", false );
- },
- disable: function() {
- return this._setOption( "disabled", true );
- },
+ // Because the orientationchange event doesn't exist, unbind the
+ // resize event handler.
+ win.unbind( "throttledresize", handler );
+ },
+ add: function( handleObj ) {
+ // Save a reference to the bound event handler.
+ var old_handler = handleObj.handler;
- _trigger: function( type, event, data ) {
- var callback = this.options[ type ];
- event = $.Event( event );
- event.type = ( type === this.widgetEventPrefix ?
- type :
- this.widgetEventPrefix + type ).toLowerCase();
- data = data || {};
+ handleObj.handler = function( event ) {
+ // Modify event object, adding the .orientation property.
+ event.orientation = get_orientation();
- // copy original event properties over to the new event
- // this would happen if we could call $.event.fix instead of $.Event
- // but we don't have a way to force an event to be fixed multiple times
- if ( event.originalEvent ) {
- for ( var i = $.event.props.length, prop; i; ) {
- prop = $.event.props[ --i ];
- event[ prop ] = event.originalEvent[ prop ];
- }
+ // Call the originally-bound event handler and return its result.
+ return old_handler.apply( this, arguments );
+ };
}
+ });
- this.element.trigger( event, data );
+ // If the event is not supported natively, this handler will be bound to
+ // the window resize event to simulate the orientationchange event.
+ function handler() {
+ // Get the current orientation.
+ var orientation = get_orientation();
- return !( $.isFunction(callback) &&
- callback.call( this.element[0], event, data ) === false ||
- event.isDefaultPrevented() );
+ if ( orientation !== last_orientation ) {
+ // The orientation has changed, so trigger the orientationchange event.
+ last_orientation = orientation;
+ win.trigger( event_name );
+ }
}
-};
-})( jQuery );
+ // Get the current page orientation. This method is exposed publicly, should it
+ // be needed, as jQuery.event.special.orientationchange.orientation()
+ $.event.special.orientationchange.orientation = get_orientation = function() {
+ var isPortrait = true, elem = document.documentElement;
-(function( $, undefined ) {
+ // prefer window orientation to the calculation based on screensize as
+ // the actual screen resize takes place before or after the orientation change event
+ // has been fired depending on implementation (eg android 2.3 is before, iphone after).
+ // More testing is required to determine if a more reliable method of determining the new screensize
+ // is possible when orientationchange is fired. (eg, use media queries + element + opacity)
+ if ( $.support.orientation ) {
+ // if the window orientation registers as 0 or 180 degrees report
+ // portrait, otherwise landscape
+ isPortrait = portrait_map[ window.orientation ];
+ } else {
+ isPortrait = elem && elem.clientWidth / elem.clientHeight < 1.1;
+ }
-$.widget( "mobile.widget", {
- // decorate the parent _createWidget to trigger `widgetinit` for users
- // who wish to do post post `widgetcreate` alterations/additions
- //
- // TODO create a pull request for jquery ui to trigger this event
- // in the original _createWidget
- _createWidget: function() {
- $.Widget.prototype._createWidget.apply( this, arguments );
- this._trigger( 'init' );
- },
+ return isPortrait ? "portrait" : "landscape";
+ };
- _getCreateOptions: function() {
+ $.fn[ event_name ] = function( fn ) {
+ return fn ? this.bind( event_name, fn ) : this.trigger( event_name );
+ };
- var elem = this.element,
- options = {};
+ // jQuery < 1.8
+ if ( $.attrFn ) {
+ $.attrFn[ event_name ] = true;
+ }
- $.each( this.options, function( option ) {
+}( jQuery, this ));
- var value = elem.jqmData( option.replace( /[A-Z]/g, function( c ) {
- return "-" + c.toLowerCase();
- })
- );
- if ( value !== undefined ) {
- options[ option ] = value;
- }
- });
+(function( $, undefined ) {
- return options;
- },
+var $window = $( window ),
+ $html = $( "html" );
- enhanceWithin: function( target, useKeepNative ) {
- this.enhance( $( this.options.initSelector, $( target )), useKeepNative );
- },
+/* $.mobile.media method: pass a CSS media type or query and get a bool return
+ note: this feature relies on actual media query support for media queries, though types will work most anywhere
+ examples:
+ $.mobile.media('screen') // tests for screen media type
+ $.mobile.media('screen and (min-width: 480px)') // tests for screen media type with window width > 480px
+ $.mobile.media('@media screen and (-webkit-min-device-pixel-ratio: 2)') // tests for webkit 2x pixel ratio (iPhone 4)
+*/
+$.mobile.media = (function() {
+ // TODO: use window.matchMedia once at least one UA implements it
+ var cache = {},
+ testDiv = $( "<div id='jquery-mediatest'></div>" ),
+ fakeBody = $( "<body>" ).append( testDiv );
- enhance: function( targets, useKeepNative ) {
- var page, keepNative, $widgetElements = $( targets ), self = this;
+ return function( query ) {
+ if ( !( query in cache ) ) {
+ var styleBlock = document.createElement( "style" ),
+ cssrule = "@media " + query + " { #jquery-mediatest { position:absolute; } }";
- // if ignoreContentEnabled is set to true the framework should
- // only enhance the selected elements when they do NOT have a
- // parent with the data-namespace-ignore attribute
- $widgetElements = $.mobile.enhanceable( $widgetElements );
+ //must set type for IE!
+ styleBlock.type = "text/css";
- if ( useKeepNative && $widgetElements.length ) {
- // TODO remove dependency on the page widget for the keepNative.
- // Currently the keepNative value is defined on the page prototype so
- // the method is as well
- page = $.mobile.closestPageData( $widgetElements );
- keepNative = (page && page.keepNativeSelector()) || "";
+ if ( styleBlock.styleSheet ) {
+ styleBlock.styleSheet.cssText = cssrule;
+ } else {
+ styleBlock.appendChild( document.createTextNode(cssrule) );
+ }
- $widgetElements = $widgetElements.not( keepNative );
+ $html.prepend( fakeBody ).prepend( styleBlock );
+ cache[ query ] = testDiv.css( "position" ) === "absolute";
+ fakeBody.add( styleBlock ).remove();
}
+ return cache[ query ];
+ };
+})();
- $widgetElements[ this.widgetName ]();
- },
+})(jQuery);
- raise: function( msg ) {
- throw "Widget [" + this.widgetName + "]: " + msg;
- }
-});
+(function( $, undefined ) {
-})( jQuery );
+// thx Modernizr
+function propExists( prop ) {
+ var uc_prop = prop.charAt( 0 ).toUpperCase() + prop.substr( 1 ),
+ props = ( prop + " " + vendors.join( uc_prop + " " ) + uc_prop ).split( " " );
-(function( $, window, undefined ) {
+ for ( var v in props ) {
+ if ( fbCSS[ props[ v ] ] !== undefined ) {
+ return true;
+ }
+ }
+}
- var nsNormalizeDict = {};
+var fakeBody = $( "<body>" ).prependTo( "html" ),
+ fbCSS = fakeBody[ 0 ].style,
+ vendors = [ "Webkit", "Moz", "O" ],
+ webos = "palmGetResource" in window, //only used to rule out scrollTop
+ opera = window.opera,
+ operamini = window.operamini && ({}).toString.call( window.operamini ) === "[object OperaMini]",
+ bb = window.blackberry && !propExists( "-webkit-transform" ); //only used to rule out box shadow, as it's filled opaque on BB 5 and lower
- // jQuery.mobile configurable options
- $.mobile = $.extend( {}, {
- // Version of the jQuery Mobile Framework
- version: "1.1.0",
+function validStyle( prop, value, check_vend ) {
+ var div = document.createElement( 'div' ),
+ uc = function( txt ) {
+ return txt.charAt( 0 ).toUpperCase() + txt.substr( 1 );
+ },
+ vend_pref = function( vend ) {
+ return "-" + vend.charAt( 0 ).toLowerCase() + vend.substr( 1 ) + "-";
+ },
+ check_style = function( vend ) {
+ var vend_prop = vend_pref( vend ) + prop + ": " + value + ";",
+ uc_vend = uc( vend ),
+ propStyle = uc_vend + uc( prop );
- // Namespace used framework-wide for data-attrs. Default is no namespace
- ns: "",
+ div.setAttribute( "style", vend_prop );
- // Define the url parameter used for referencing widget-generated sub-pages.
- // Translates to to example.html&ui-page=subpageIdentifier
- // hash segment before &ui-page= is used to make Ajax request
- subPageUrlKey: "ui-page",
+ if ( !!div.style[ propStyle ] ) {
+ ret = true;
+ }
+ },
+ check_vends = check_vend ? [ check_vend ] : vendors,
+ ret;
- // Class assigned to page currently in view, and during transitions
- activePageClass: "ui-page-active",
+ for( var i = 0; i < check_vends.length; i++ ) {
+ check_style( check_vends[i] );
+ }
+ return !!ret;
+}
- // Class used for "active" button state, from CSS framework
- activeBtnClass: "ui-btn-active",
+// Thanks to Modernizr src for this test idea. `perspective` check is limited to Moz to prevent a false positive for 3D transforms on Android.
+function transform3dTest() {
+ var prop = "transform-3d";
+ return validStyle( 'perspective', '10px', 'moz' ) || $.mobile.media( "(-" + vendors.join( "-" + prop + "),(-" ) + "-" + prop + "),(" + prop + ")" );
+}
- // Class used for "focus" form element state, from CSS framework
- focusClass: "ui-focus",
+// Test for dynamic-updating base tag support ( allows us to avoid href,src attr rewriting )
+function baseTagTest() {
+ var fauxBase = location.protocol + "//" + location.host + location.pathname + "ui-dir/",
+ base = $( "head base" ),
+ fauxEle = null,
+ href = "",
+ link, rebase;
- // Automatically handle clicks and form submissions through Ajax, when same-domain
- ajaxEnabled: true,
+ if ( !base.length ) {
+ base = fauxEle = $( "<base>", { "href": fauxBase }).appendTo( "head" );
+ } else {
+ href = base.attr( "href" );
+ }
- // Automatically load and show pages based on location.hash
- hashListeningEnabled: true,
+ link = $( "<a href='testurl' />" ).prependTo( fakeBody );
+ rebase = link[ 0 ].href;
+ base[ 0 ].href = href || location.pathname;
- // disable to prevent jquery from bothering with links
- linkBindingEnabled: true,
+ if ( fauxEle ) {
+ fauxEle.remove();
+ }
+ return rebase.indexOf( fauxBase ) === 0;
+}
- // Set default page transition - 'none' for no transitions
- defaultPageTransition: "fade",
+// Thanks Modernizr
+function cssPointerEventsTest() {
+ var element = document.createElement( 'x' ),
+ documentElement = document.documentElement,
+ getComputedStyle = window.getComputedStyle,
+ supports;
- // Set maximum window width for transitions to apply - 'false' for no limit
- maxTransitionWidth: false,
+ if ( !( 'pointerEvents' in element.style ) ) {
+ return false;
+ }
- // Minimum scroll distance that will be remembered when returning to a page
- minScrollBack: 250,
+ element.style.pointerEvents = 'auto';
+ element.style.pointerEvents = 'x';
+ documentElement.appendChild( element );
+ supports = getComputedStyle &&
+ getComputedStyle( element, '' ).pointerEvents === 'auto';
+ documentElement.removeChild( element );
+ return !!supports;
+}
- // DEPRECATED: the following property is no longer in use, but defined until 2.0 to prevent conflicts
- touchOverflowEnabled: false,
+function boundingRect() {
+ var div = document.createElement( "div" );
+ return typeof div.getBoundingClientRect !== "undefined";
+}
- // Set default dialog transition - 'none' for no transitions
- defaultDialogTransition: "pop",
+// non-UA-based IE version check by James Padolsey, modified by jdalton - from http://gist.github.com/527683
+// allows for inclusion of IE 6+, including Windows Mobile 7
+$.extend( $.mobile, { browser: {} } );
+$.mobile.browser.ie = (function() {
+ var v = 3,
+ div = document.createElement( "div" ),
+ a = div.all || [];
- // Show loading message during Ajax requests
- // if false, message will not appear, but loading classes will still be toggled on html el
- loadingMessage: "loading",
+ do {
+ div.innerHTML = "<!--[if gt IE " + ( ++v ) + "]><br><![endif]-->";
+ } while( a[0] );
- // Error response message - appears when an Ajax page request fails
- pageLoadErrorMessage: "Error Loading Page",
+ return v > 4 ? v : !v;
+})();
- // Should the text be visble in the loading message?
- loadingMessageTextVisible: false,
- // When the text is visible, what theme does the loading box use?
- loadingMessageTheme: "a",
+$.extend( $.support, {
+ cssTransitions: "WebKitTransitionEvent" in window || validStyle( 'transition', 'height 100ms linear' ) && !opera,
+ pushState: "pushState" in history && "replaceState" in history,
+ mediaquery: $.mobile.media( "only all" ),
+ cssPseudoElement: !!propExists( "content" ),
+ touchOverflow: !!propExists( "overflowScrolling" ),
+ cssTransform3d: transform3dTest(),
+ boxShadow: !!propExists( "boxShadow" ) && !bb,
+ scrollTop: ( "pageXOffset" in window || "scrollTop" in document.documentElement || "scrollTop" in fakeBody[ 0 ] ) && !webos && !operamini,
+ dynamicBaseTag: baseTagTest(),
+ cssPointerEvents: cssPointerEventsTest(),
+ boundingRect: boundingRect()
+});
- // For error messages, which theme does the box uses?
- pageLoadErrorMessageTheme: "e",
+fakeBody.remove();
- //automatically initialize the DOM when it's ready
- autoInitializePage: true,
- pushStateEnabled: true,
+// $.mobile.ajaxBlacklist is used to override ajaxEnabled on platforms that have known conflicts with hash history updates (BB5, Symbian)
+// or that generally work better browsing in regular http for full page refreshes (Opera Mini)
+// Note: This detection below is used as a last resort.
+// We recommend only using these detection methods when all other more reliable/forward-looking approaches are not possible
+var nokiaLTE7_3 = (function() {
- // allows users to opt in to ignoring content by marking a parent element as
- // data-ignored
- ignoreContentEnabled: false,
+ var ua = window.navigator.userAgent;
- // turn of binding to the native orientationchange due to android orientation behavior
- orientationChangeEnabled: true,
+ //The following is an attempt to match Nokia browsers that are running Symbian/s60, with webkit, version 7.3 or older
+ return ua.indexOf( "Nokia" ) > -1 &&
+ ( ua.indexOf( "Symbian/3" ) > -1 || ua.indexOf( "Series60/5" ) > -1 ) &&
+ ua.indexOf( "AppleWebKit" ) > -1 &&
+ ua.match( /(BrowserNG|NokiaBrowser)\/7\.[0-3]/ );
+})();
- buttonMarkup: {
- hoverDelay: 200
- },
+// Support conditions that must be met in order to proceed
+// default enhanced qualifications are media query support OR IE 7+
- // TODO might be useful upstream in jquery itself ?
- keyCode: {
- ALT: 18,
- BACKSPACE: 8,
- CAPS_LOCK: 20,
- COMMA: 188,
- COMMAND: 91,
- COMMAND_LEFT: 91, // COMMAND
- COMMAND_RIGHT: 93,
- CONTROL: 17,
- DELETE: 46,
- DOWN: 40,
- END: 35,
- ENTER: 13,
- ESCAPE: 27,
- HOME: 36,
- INSERT: 45,
- LEFT: 37,
- MENU: 93, // COMMAND_RIGHT
- NUMPAD_ADD: 107,
- NUMPAD_DECIMAL: 110,
- NUMPAD_DIVIDE: 111,
- NUMPAD_ENTER: 108,
- NUMPAD_MULTIPLY: 106,
- NUMPAD_SUBTRACT: 109,
- PAGE_DOWN: 34,
- PAGE_UP: 33,
- PERIOD: 190,
- RIGHT: 39,
- SHIFT: 16,
- SPACE: 32,
- TAB: 9,
- UP: 38,
- WINDOWS: 91 // COMMAND
- },
+$.mobile.gradeA = function() {
+ return ( $.support.mediaquery || $.mobile.browser.ie && $.mobile.browser.ie >= 7 ) && ( $.support.boundingRect || $.fn.jquery.match(/1\.[0-7+]\.[0-9+]?/) !== null );
+};
- // Scroll page vertically: scroll to 0 to hide iOS address bar, or pass a Y value
- silentScroll: function( ypos ) {
- if ( $.type( ypos ) !== "number" ) {
- ypos = $.mobile.defaultHomeScroll;
- }
+$.mobile.ajaxBlacklist =
+ // BlackBerry browsers, pre-webkit
+ window.blackberry && !window.WebKitPoint ||
+ // Opera Mini
+ operamini ||
+ // Symbian webkits pre 7.3
+ nokiaLTE7_3;
- // prevent scrollstart and scrollstop events
- $.event.special.scrollstart.enabled = false;
+// Lastly, this workaround is the only way we've found so far to get pre 7.3 Symbian webkit devices
+// to render the stylesheets when they're referenced before this script, as we'd recommend doing.
+// This simply reappends the CSS in place, which for some reason makes it apply
+if ( nokiaLTE7_3 ) {
+ $(function() {
+ $( "head link[rel='stylesheet']" ).attr( "rel", "alternate stylesheet" ).attr( "rel", "stylesheet" );
+ });
+}
- setTimeout(function() {
- window.scrollTo( 0, ypos );
- $( document ).trigger( "silentscroll", { x: 0, y: ypos });
- }, 20 );
+// For ruling out shadows via css
+if ( !$.support.boxShadow ) {
+ $( "html" ).addClass( "ui-mobile-nosupport-boxshadow" );
+}
- setTimeout(function() {
- $.event.special.scrollstart.enabled = true;
- }, 150 );
- },
+})( jQuery );
- // Expose our cache for testing purposes.
- nsNormalizeDict: nsNormalizeDict,
+(function( $, undefined ) {
- // Take a data attribute property, prepend the namespace
- // and then camel case the attribute string. Add the result
- // to our nsNormalizeDict so we don't have to do this again.
- nsNormalize: function( prop ) {
- if ( !prop ) {
- return;
- }
+$.widget( "mobile.page", $.mobile.widget, {
+ options: {
+ theme: "c",
+ domCache: false,
+ keepNativeDefault: ":jqmData(role='none'), :jqmData(role='nojs')"
+ },
- return nsNormalizeDict[ prop ] || ( nsNormalizeDict[ prop ] = $.camelCase( $.mobile.ns + prop ) );
- },
+ _create: function() {
+
+ var self = this;
+
+ // if false is returned by the callbacks do not create the page
+ if ( self._trigger( "beforecreate" ) === false ) {
+ return false;
+ }
- getInheritedTheme: function( el, defaultTheme ) {
+ self.element
+ .attr( "tabindex", "0" )
+ .addClass( "ui-page ui-body-" + self.options.theme )
+ .bind( "pagebeforehide", function() {
+ self.removeContainerBackground();
+ } )
+ .bind( "pagebeforeshow", function() {
+ self.setContainerBackground();
+ } );
- // Find the closest parent with a theme class on it. Note that
- // we are not using $.fn.closest() on purpose here because this
- // method gets called quite a bit and we need it to be as fast
- // as possible.
+ },
+
+ removeContainerBackground: function() {
+ $.mobile.pageContainer.removeClass( "ui-overlay-" + $.mobile.getInheritedTheme( this.element.parent() ) );
+ },
+
+ // set the page container background to the page theme
+ setContainerBackground: function( theme ) {
+ if ( this.options.theme ) {
+ $.mobile.pageContainer.addClass( "ui-overlay-" + ( theme || this.options.theme ) );
+ }
+ },
- var e = el[ 0 ],
- ltr = "",
- re = /ui-(bar|body|overlay)-([a-z])\b/,
- c, m;
+ keepNativeSelector: function() {
+ var options = this.options,
+ keepNativeDefined = options.keepNative && $.trim( options.keepNative );
- while ( e ) {
- var c = e.className || "";
- if ( ( m = re.exec( c ) ) && ( ltr = m[ 2 ] ) ) {
- // We found a parent with a theme class
- // on it so bail from this loop.
- break;
- }
- e = e.parentNode;
- }
+ if ( keepNativeDefined && options.keepNative !== options.keepNativeDefault ) {
+ return [options.keepNative, options.keepNativeDefault].join( ", " );
+ }
- // Return the theme letter we found, if none, return the
- // specified default.
+ return options.keepNativeDefault;
+ }
+});
+})( jQuery );
- return ltr || defaultTheme || "a";
- },
+// Script: jQuery hashchange event
+//
+// *Version: 1.3, Last updated: 7/21/2010*
+//
+// Project Home - http://benalman.com/projects/jquery-hashchange-plugin/
+// GitHub - http://github.com/cowboy/jquery-hashchange/
+// Source - http://github.com/cowboy/jquery-hashchange/raw/master/jquery.ba-hashchange.js
+// (Minified) - http://github.com/cowboy/jquery-hashchange/raw/master/jquery.ba-hashchange.min.js (0.8kb gzipped)
+//
+// About: License
+//
+// Copyright (c) 2010 "Cowboy" Ben Alman,
+// Dual licensed under the MIT and GPL licenses.
+// http://benalman.com/about/license/
+//
+// About: Examples
+//
+// These working examples, complete with fully commented code, illustrate a few
+// ways in which this plugin can be used.
+//
+// hashchange event - http://benalman.com/code/projects/jquery-hashchange/examples/hashchange/
+// document.domain - http://benalman.com/code/projects/jquery-hashchange/examples/document_domain/
+//
+// About: Support and Testing
+//
+// Information about what version or versions of jQuery this plugin has been
+// tested with, what browsers it has been tested in, and where the unit tests
+// reside (so you can test it yourself).
+//
+// jQuery Versions - 1.2.6, 1.3.2, 1.4.1, 1.4.2
+// Browsers Tested - Internet Explorer 6-8, Firefox 2-4, Chrome 5-6, Safari 3.2-5,
+// Opera 9.6-10.60, iPhone 3.1, Android 1.6-2.2, BlackBerry 4.6-5.
+// Unit Tests - http://benalman.com/code/projects/jquery-hashchange/unit/
+//
+// About: Known issues
+//
+// While this jQuery hashchange event implementation is quite stable and
+// robust, there are a few unfortunate browser bugs surrounding expected
+// hashchange event-based behaviors, independent of any JavaScript
+// window.onhashchange abstraction. See the following examples for more
+// information:
+//
+// Chrome: Back Button - http://benalman.com/code/projects/jquery-hashchange/examples/bug-chrome-back-button/
+// Firefox: Remote XMLHttpRequest - http://benalman.com/code/projects/jquery-hashchange/examples/bug-firefox-remote-xhr/
+// WebKit: Back Button in an Iframe - http://benalman.com/code/projects/jquery-hashchange/examples/bug-webkit-hash-iframe/
+// Safari: Back Button from a different domain - http://benalman.com/code/projects/jquery-hashchange/examples/bug-safari-back-from-diff-domain/
+//
+// Also note that should a browser natively support the window.onhashchange
+// event, but not report that it does, the fallback polling loop will be used.
+//
+// About: Release History
+//
+// 1.3 - (7/21/2010) Reorganized IE6/7 Iframe code to make it more
+// "removable" for mobile-only development. Added IE6/7 document.title
+// support. Attempted to make Iframe as hidden as possible by using
+// techniques from http://www.paciellogroup.com/blog/?p=604. Added
+// support for the "shortcut" format $(window).hashchange( fn ) and
+// $(window).hashchange() like jQuery provides for built-in events.
+// Renamed jQuery.hashchangeDelay to <jQuery.fn.hashchange.delay> and
+// lowered its default value to 50. Added <jQuery.fn.hashchange.domain>
+// and <jQuery.fn.hashchange.src> properties plus document-domain.html
+// file to address access denied issues when setting document.domain in
+// IE6/7.
+// 1.2 - (2/11/2010) Fixed a bug where coming back to a page using this plugin
+// from a page on another domain would cause an error in Safari 4. Also,
+// IE6/7 Iframe is now inserted after the body (this actually works),
+// which prevents the page from scrolling when the event is first bound.
+// Event can also now be bound before DOM ready, but it won't be usable
+// before then in IE6/7.
+// 1.1 - (1/21/2010) Incorporated document.documentMode test to fix IE8 bug
+// where browser version is incorrectly reported as 8.0, despite
+// inclusion of the X-UA-Compatible IE=EmulateIE7 meta tag.
+// 1.0 - (1/9/2010) Initial Release. Broke out the jQuery BBQ event.special
+// window.onhashchange functionality into a separate plugin for users
+// who want just the basic event & back button support, without all the
+// extra awesomeness that BBQ provides. This plugin will be included as
+// part of jQuery BBQ, but also be available separately.
- // TODO the following $ and $.fn extensions can/probably should be moved into jquery.mobile.core.helpers
- //
- // Find the closest javascript page element to gather settings data jsperf test
- // http://jsperf.com/single-complex-selector-vs-many-complex-selectors/edit
- // possibly naive, but it shows that the parsing overhead for *just* the page selector vs
- // the page and dialog selector is negligable. This could probably be speed up by
- // doing a similar parent node traversal to the one found in the inherited theme code above
- closestPageData: function( $target ) {
- return $target
- .closest(':jqmData(role="page"), :jqmData(role="dialog")')
- .data("page");
- },
+(function( $, window, undefined ) {
+ // Reused string.
+ var str_hashchange = 'hashchange',
+
+ // Method / object references.
+ doc = document,
+ fake_onhashchange,
+ special = $.event.special,
+
+ // Does the browser support window.onhashchange? Note that IE8 running in
+ // IE7 compatibility mode reports true for 'onhashchange' in window, even
+ // though the event isn't supported, so also test document.documentMode.
+ doc_mode = doc.documentMode,
+ supports_onhashchange = 'on' + str_hashchange in window && ( doc_mode === undefined || doc_mode > 7 );
+
+ // Get location.hash (or what you'd expect location.hash to be) sans any
+ // leading #. Thanks for making this necessary, Firefox!
+ function get_fragment( url ) {
+ url = url || location.href;
+ return '#' + url.replace( /^[^#]*#?(.*)$/, '$1' );
+ };
+
+ // Method: jQuery.fn.hashchange
+ //
+ // Bind a handler to the window.onhashchange event or trigger all bound
+ // window.onhashchange event handlers. This behavior is consistent with
+ // jQuery's built-in event handlers.
+ //
+ // Usage:
+ //
+ // > jQuery(window).hashchange( [ handler ] );
+ //
+ // Arguments:
+ //
+ // handler - (Function) Optional handler to be bound to the hashchange
+ // event. This is a "shortcut" for the more verbose form:
+ // jQuery(window).bind( 'hashchange', handler ). If handler is omitted,
+ // all bound window.onhashchange event handlers will be triggered. This
+ // is a shortcut for the more verbose
+ // jQuery(window).trigger( 'hashchange' ). These forms are described in
+ // the <hashchange event> section.
+ //
+ // Returns:
+ //
+ // (jQuery) The initial jQuery collection of elements.
+
+ // Allow the "shortcut" format $(elem).hashchange( fn ) for binding and
+ // $(elem).hashchange() for triggering, like jQuery does for built-in events.
+ $.fn[ str_hashchange ] = function( fn ) {
+ return fn ? this.bind( str_hashchange, fn ) : this.trigger( str_hashchange );
+ };
+
+ // Property: jQuery.fn.hashchange.delay
+ //
+ // The numeric interval (in milliseconds) at which the <hashchange event>
+ // polling loop executes. Defaults to 50.
+
+ // Property: jQuery.fn.hashchange.domain
+ //
+ // If you're setting document.domain in your JavaScript, and you want hash
+ // history to work in IE6/7, not only must this property be set, but you must
+ // also set document.domain BEFORE jQuery is loaded into the page. This
+ // property is only applicable if you are supporting IE6/7 (or IE8 operating
+ // in "IE7 compatibility" mode).
+ //
+ // In addition, the <jQuery.fn.hashchange.src> property must be set to the
+ // path of the included "document-domain.html" file, which can be renamed or
+ // modified if necessary (note that the document.domain specified must be the
+ // same in both your main JavaScript as well as in this file).
+ //
+ // Usage:
+ //
+ // jQuery.fn.hashchange.domain = document.domain;
+
+ // Property: jQuery.fn.hashchange.src
+ //
+ // If, for some reason, you need to specify an Iframe src file (for example,
+ // when setting document.domain as in <jQuery.fn.hashchange.domain>), you can
+ // do so using this property. Note that when using this property, history
+ // won't be recorded in IE6/7 until the Iframe src file loads. This property
+ // is only applicable if you are supporting IE6/7 (or IE8 operating in "IE7
+ // compatibility" mode).
+ //
+ // Usage:
+ //
+ // jQuery.fn.hashchange.src = 'path/to/file.html';
+
+ $.fn[ str_hashchange ].delay = 50;
+ /*
+ $.fn[ str_hashchange ].domain = null;
+ $.fn[ str_hashchange ].src = null;
+ */
+
+ // Event: hashchange event
+ //
+ // Fired when location.hash changes. In browsers that support it, the native
+ // HTML5 window.onhashchange event is used, otherwise a polling loop is
+ // initialized, running every <jQuery.fn.hashchange.delay> milliseconds to
+ // see if the hash has changed. In IE6/7 (and IE8 operating in "IE7
+ // compatibility" mode), a hidden Iframe is created to allow the back button
+ // and hash-based history to work.
+ //
+ // Usage as described in <jQuery.fn.hashchange>:
+ //
+ // > // Bind an event handler.
+ // > jQuery(window).hashchange( function(e) {
+ // > var hash = location.hash;
+ // > ...
+ // > });
+ // >
+ // > // Manually trigger the event handler.
+ // > jQuery(window).hashchange();
+ //
+ // A more verbose usage that allows for event namespacing:
+ //
+ // > // Bind an event handler.
+ // > jQuery(window).bind( 'hashchange', function(e) {
+ // > var hash = location.hash;
+ // > ...
+ // > });
+ // >
+ // > // Manually trigger the event handler.
+ // > jQuery(window).trigger( 'hashchange' );
+ //
+ // Additional Notes:
+ //
+ // * The polling loop and Iframe are not created until at least one handler
+ // is actually bound to the 'hashchange' event.
+ // * If you need the bound handler(s) to execute immediately, in cases where
+ // a location.hash exists on page load, via bookmark or page refresh for
+ // example, use jQuery(window).hashchange() or the more verbose
+ // jQuery(window).trigger( 'hashchange' ).
+ // * The event can be bound before DOM ready, but since it won't be usable
+ // before then in IE6/7 (due to the necessary Iframe), recommended usage is
+ // to bind it inside a DOM ready handler.
+
+ // Override existing $.event.special.hashchange methods (allowing this plugin
+ // to be defined after jQuery BBQ in BBQ's source code).
+ special[ str_hashchange ] = $.extend( special[ str_hashchange ], {
+
+ // Called only when the first 'hashchange' event is bound to window.
+ setup: function() {
+ // If window.onhashchange is supported natively, there's nothing to do..
+ if ( supports_onhashchange ) { return false; }
+
+ // Otherwise, we need to create our own. And we don't want to call this
+ // until the user binds to the event, just in case they never do, since it
+ // will create a polling loop and possibly even a hidden Iframe.
+ $( fake_onhashchange.start );
+ },
+
+ // Called only when the last 'hashchange' event is unbound from window.
+ teardown: function() {
+ // If window.onhashchange is supported natively, there's nothing to do..
+ if ( supports_onhashchange ) { return false; }
+
+ // Otherwise, we need to stop ours (if possible).
+ $( fake_onhashchange.stop );
+ }
+
+ });
+
+ // fake_onhashchange does all the work of triggering the window.onhashchange
+ // event for browsers that don't natively support it, including creating a
+ // polling loop to watch for hash changes and in IE 6/7 creating a hidden
+ // Iframe to enable back and forward.
+ fake_onhashchange = (function() {
+ var self = {},
+ timeout_id,
+
+ // Remember the initial hash so it doesn't get triggered immediately.
+ last_hash = get_fragment(),
+
+ fn_retval = function( val ) { return val; },
+ history_set = fn_retval,
+ history_get = fn_retval;
+
+ // Start the polling loop.
+ self.start = function() {
+ timeout_id || poll();
+ };
+
+ // Stop the polling loop.
+ self.stop = function() {
+ timeout_id && clearTimeout( timeout_id );
+ timeout_id = undefined;
+ };
+
+ // This polling loop checks every $.fn.hashchange.delay milliseconds to see
+ // if location.hash has changed, and triggers the 'hashchange' event on
+ // window when necessary.
+ function poll() {
+ var hash = get_fragment(),
+ history_hash = history_get( last_hash );
+
+ if ( hash !== last_hash ) {
+ history_set( last_hash = hash, history_hash );
+
+ $(window).trigger( str_hashchange );
+
+ } else if ( history_hash !== last_hash ) {
+ location.href = location.href.replace( /#.*/, '' ) + history_hash;
+ }
+
+ timeout_id = setTimeout( poll, $.fn[ str_hashchange ].delay );
+ };
+
+ // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
+ // vvvvvvvvvvvvvvvvvvv REMOVE IF NOT SUPPORTING IE6/7/8 vvvvvvvvvvvvvvvvvvv
+ // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
+ $.browser.msie && !supports_onhashchange && (function() {
+ // Not only do IE6/7 need the "magical" Iframe treatment, but so does IE8
+ // when running in "IE7 compatibility" mode.
+
+ var iframe,
+ iframe_src;
+
+ // When the event is bound and polling starts in IE 6/7, create a hidden
+ // Iframe for history handling.
+ self.start = function() {
+ if ( !iframe ) {
+ iframe_src = $.fn[ str_hashchange ].src;
+ iframe_src = iframe_src && iframe_src + get_fragment();
+
+ // Create hidden Iframe. Attempt to make Iframe as hidden as possible
+ // by using techniques from http://www.paciellogroup.com/blog/?p=604.
+ iframe = $('<iframe tabindex="-1" title="empty"/>').hide()
+
+ // When Iframe has completely loaded, initialize the history and
+ // start polling.
+ .one( 'load', function() {
+ iframe_src || history_set( get_fragment() );
+ poll();
+ })
+
+ // Load Iframe src if specified, otherwise nothing.
+ .attr( 'src', iframe_src || 'javascript:0' )
+
+ // Append Iframe after the end of the body to prevent unnecessary
+ // initial page scrolling (yes, this works).
+ .insertAfter( 'body' )[0].contentWindow;
+
+ // Whenever `document.title` changes, update the Iframe's title to
+ // prettify the back/next history menu entries. Since IE sometimes
+ // errors with "Unspecified error" the very first time this is set
+ // (yes, very useful) wrap this with a try/catch block.
+ doc.onpropertychange = function() {
+ try {
+ if ( event.propertyName === 'title' ) {
+ iframe.document.title = doc.title;
+ }
+ } catch(e) {}
+ };
+
+ }
+ };
+
+ // Override the "stop" method since an IE6/7 Iframe was created. Even
+ // if there are no longer any bound event handlers, the polling loop
+ // is still necessary for back/next to work at all!
+ self.stop = fn_retval;
+
+ // Get history by looking at the hidden Iframe's location.hash.
+ history_get = function() {
+ return get_fragment( iframe.location.href );
+ };
+
+ // Set a new history item by opening and then closing the Iframe
+ // document, *then* setting its location.hash. If document.domain has
+ // been set, update that as well.
+ history_set = function( hash, history_hash ) {
+ var iframe_doc = iframe.document,
+ domain = $.fn[ str_hashchange ].domain;
+
+ if ( hash !== history_hash ) {
+ // Update Iframe with any initial `document.title` that might be set.
+ iframe_doc.title = doc.title;
+
+ // Opening the Iframe's document after it has been closed is what
+ // actually adds a history entry.
+ iframe_doc.open();
+
+ // Set document.domain for the Iframe document as well, if necessary.
+ domain && iframe_doc.write( '<script>document.domain="' + domain + '"</script>' );
+
+ iframe_doc.close();
+
+ // Update the Iframe's hash, for great justice.
+ iframe.location.hash = hash;
+ }
+ };
+
+ })();
+ // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ // ^^^^^^^^^^^^^^^^^^^ REMOVE IF NOT SUPPORTING IE6/7/8 ^^^^^^^^^^^^^^^^^^^
+ // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+ return self;
+ })();
+
+})(jQuery,this);
- enhanceable: function( $set ) {
- return this.haveParents( $set, "enhance" );
- },
- hijackable: function( $set ) {
- return this.haveParents( $set, "ajax" );
- },
+(function( $, window, undefined ) {
- haveParents: function( $set, attr ) {
- if( !$.mobile.ignoreContentEnabled ){
- return $set;
- }
+var createHandler = function( sequential ) {
- var count = $set.length,
- $newSet = $(),
- e, $element, excluded;
+ // Default to sequential
+ if ( sequential === undefined ) {
+ sequential = true;
+ }
- for ( var i = 0; i < count; i++ ) {
- $element = $set.eq( i );
- excluded = false;
- e = $set[ i ];
+ return function( name, reverse, $to, $from ) {
- while ( e ) {
- var c = e.getAttribute ? e.getAttribute( "data-" + $.mobile.ns + attr ) : "";
+ var deferred = new $.Deferred(),
+ reverseClass = reverse ? " reverse" : "",
+ active = $.mobile.urlHistory.getActive(),
+ toScroll = active.lastScroll || $.mobile.defaultHomeScroll,
+ screenHeight = $.mobile.getScreenHeight(),
+ maxTransitionOverride = $.mobile.maxTransitionWidth !== false && $( window ).width() > $.mobile.maxTransitionWidth,
+ none = !$.support.cssTransitions || maxTransitionOverride || !name || name === "none" || Math.max( $( window ).scrollTop(), toScroll ) > $.mobile.getMaxScrollForTransition(),
+ toPreClass = " ui-page-pre-in",
+ toggleViewportClass = function() {
+ $.mobile.pageContainer.toggleClass( "ui-mobile-viewport-transitioning viewport-" + name );
+ },
+ scrollPage = function() {
+ // By using scrollTo instead of silentScroll, we can keep things better in order
+ // Just to be precautios, disable scrollstart listening like silentScroll would
+ $.event.special.scrollstart.enabled = false;
- if ( c === "false" ) {
- excluded = true;
- break;
- }
+ window.scrollTo( 0, toScroll );
- e = e.parentNode;
+ // reenable scrollstart listening like silentScroll would
+ setTimeout( function() {
+ $.event.special.scrollstart.enabled = true;
+ }, 150 );
+ },
+ cleanFrom = function() {
+ $from
+ .removeClass( $.mobile.activePageClass + " out in reverse " + name )
+ .height( "" );
+ },
+ startOut = function() {
+ // if it's not sequential, call the doneOut transition to start the TO page animating in simultaneously
+ if ( !sequential ) {
+ doneOut();
}
-
- if ( !excluded ) {
- $newSet = $newSet.add( $element );
+ else {
+ $from.animationComplete( doneOut );
}
- }
-
- return $newSet;
- }
- }, $.mobile );
-
- // Mobile version of data and removeData and hasData methods
- // ensures all data is set and retrieved using jQuery Mobile's data namespace
- $.fn.jqmData = function( prop, value ) {
- var result;
- if ( typeof prop != "undefined" ) {
- if ( prop ) {
- prop = $.mobile.nsNormalize( prop );
- }
- result = this.data.apply( this, arguments.length < 2 ? [ prop ] : [ prop, value ] );
- }
- return result;
- };
-
- $.jqmData = function( elem, prop, value ) {
- var result;
- if ( typeof prop != "undefined" ) {
- result = $.data( elem, prop ? $.mobile.nsNormalize( prop ) : prop, value );
- }
- return result;
- };
-
- $.fn.jqmRemoveData = function( prop ) {
- return this.removeData( $.mobile.nsNormalize( prop ) );
- };
-
- $.jqmRemoveData = function( elem, prop ) {
- return $.removeData( elem, $.mobile.nsNormalize( prop ) );
- };
-
- $.fn.removeWithDependents = function() {
- $.removeWithDependents( this );
- };
-
- $.removeWithDependents = function( elem ) {
- var $elem = $( elem );
-
- ( $elem.jqmData('dependents') || $() ).remove();
- $elem.remove();
- };
-
- $.fn.addDependents = function( newDependents ) {
- $.addDependents( $(this), newDependents );
- };
-
- $.addDependents = function( elem, newDependents ) {
- var dependents = $(elem).jqmData( 'dependents' ) || $();
- $(elem).jqmData( 'dependents', $.merge(dependents, newDependents) );
- };
+ // Set the from page's height and start it transitioning out
+ // Note: setting an explicit height helps eliminate tiling in the transitions
+ $from
+ .height( screenHeight + $( window ).scrollTop() )
+ .addClass( name + " out" + reverseClass );
+ },
- // note that this helper doesn't attempt to handle the callback
- // or setting of an html elements text, its only purpose is
- // to return the html encoded version of the text in all cases. (thus the name)
- $.fn.getEncodedText = function() {
- return $( "<div/>" ).text( $(this).text() ).html();
- };
+ doneOut = function() {
- // fluent helper function for the mobile namespaced equivalent
- $.fn.jqmEnhanceable = function() {
- return $.mobile.enhanceable( this );
- };
+ if ( $from && sequential ) {
+ cleanFrom();
+ }
- $.fn.jqmHijackable = function() {
- return $.mobile.hijackable( this );
- };
+ startIn();
+ },
- // Monkey-patching Sizzle to filter the :jqmData selector
- var oldFind = $.find,
- jqmDataRE = /:jqmData\(([^)]*)\)/g;
+ startIn = function() {
- $.find = function( selector, context, ret, extra ) {
- selector = selector.replace( jqmDataRE, "[data-" + ( $.mobile.ns || "" ) + "$1]" );
+ // Prevent flickering in phonegap container: see comments at #4024 regarding iOS
+ $to.css( "z-index", -10 );
- return oldFind.call( this, selector, context, ret, extra );
- };
+ $to.addClass( $.mobile.activePageClass + toPreClass );
- $.extend( $.find, oldFind );
+ // Send focus to page as it is now display: block
+ $.mobile.focusPage( $to );
- $.find.matches = function( expr, set ) {
- return $.find( expr, null, null, set );
- };
+ // Set to page height
+ $to.height( screenHeight + toScroll );
- $.find.matchesSelector = function( node, expr ) {
- return $.find( expr, null, null, [ node ] ).length > 0;
- };
-})( jQuery, this );
+ scrollPage();
+ // Restores visibility of the new page: added together with $to.css( "z-index", -10 );
+ $to.css( "z-index", "" );
-(function( $, undefined ) {
+ if ( !none ) {
+ $to.animationComplete( doneIn );
+ }
-var $window = $( window ),
- $html = $( "html" );
+ $to
+ .removeClass( toPreClass )
+ .addClass( name + " in" + reverseClass );
-/* $.mobile.media method: pass a CSS media type or query and get a bool return
- note: this feature relies on actual media query support for media queries, though types will work most anywhere
- examples:
- $.mobile.media('screen') // tests for screen media type
- $.mobile.media('screen and (min-width: 480px)') // tests for screen media type with window width > 480px
- $.mobile.media('@media screen and (-webkit-min-device-pixel-ratio: 2)') // tests for webkit 2x pixel ratio (iPhone 4)
-*/
-$.mobile.media = (function() {
- // TODO: use window.matchMedia once at least one UA implements it
- var cache = {},
- testDiv = $( "<div id='jquery-mediatest'>" ),
- fakeBody = $( "<body>" ).append( testDiv );
+ if ( none ) {
+ doneIn();
+ }
- return function( query ) {
- if ( !( query in cache ) ) {
- var styleBlock = document.createElement( "style" ),
- cssrule = "@media " + query + " { #jquery-mediatest { position:absolute; } }";
+ },
- //must set type for IE!
- styleBlock.type = "text/css";
+ doneIn = function() {
- if ( styleBlock.styleSheet ){
- styleBlock.styleSheet.cssText = cssrule;
- } else {
- styleBlock.appendChild( document.createTextNode(cssrule) );
- }
+ if ( !sequential ) {
- $html.prepend( fakeBody ).prepend( styleBlock );
- cache[ query ] = testDiv.css( "position" ) === "absolute";
- fakeBody.add( styleBlock ).remove();
- }
- return cache[ query ];
- };
-})();
+ if ( $from ) {
+ cleanFrom();
+ }
+ }
-})(jQuery);
+ $to
+ .removeClass( "out in reverse " + name )
+ .height( "" );
-(function( $, undefined ) {
+ toggleViewportClass();
-var fakeBody = $( "<body>" ).prependTo( "html" ),
- fbCSS = fakeBody[ 0 ].style,
- vendors = [ "Webkit", "Moz", "O" ],
- webos = "palmGetResource" in window, //only used to rule out scrollTop
- operamini = window.operamini && ({}).toString.call( window.operamini ) === "[object OperaMini]",
- bb = window.blackberry; //only used to rule out box shadow, as it's filled opaque on BB
+ // In some browsers (iOS5), 3D transitions block the ability to scroll to the desired location during transition
+ // This ensures we jump to that spot after the fact, if we aren't there already.
+ if ( $( window ).scrollTop() !== toScroll ) {
+ scrollPage();
+ }
-// thx Modernizr
-function propExists( prop ) {
- var uc_prop = prop.charAt( 0 ).toUpperCase() + prop.substr( 1 ),
- props = ( prop + " " + vendors.join( uc_prop + " " ) + uc_prop ).split( " " );
+ deferred.resolve( name, reverse, $to, $from, true );
+ };
- for ( var v in props ){
- if ( fbCSS[ props[ v ] ] !== undefined ) {
- return true;
+ toggleViewportClass();
+
+ if ( $from && !none ) {
+ startOut();
+ }
+ else {
+ doneOut();
}
- }
-}
-function validStyle( prop, value, check_vend ) {
- var div = document.createElement('div'),
- uc = function( txt ) {
- return txt.charAt( 0 ).toUpperCase() + txt.substr( 1 )
- },
- vend_pref = function( vend ) {
- return "-" + vend.charAt( 0 ).toLowerCase() + vend.substr( 1 ) + "-";
- },
- check_style = function( vend ) {
- var vend_prop = vend_pref( vend ) + prop + ": " + value + ";",
- uc_vend = uc( vend ),
- propStyle = uc_vend + uc( prop );
-
- div.setAttribute( "style", vend_prop );
-
- if( !!div.style[ propStyle ] ) {
- ret = true;
- }
- },
- check_vends = check_vend ? [ check_vend ] : vendors,
- ret;
+ return deferred.promise();
+ };
+};
- for( i = 0; i < check_vends.length; i++ ) {
- check_style( check_vends[i] );
- }
- return !!ret;
-}
+// generate the handlers from the above
+var sequentialHandler = createHandler(),
+ simultaneousHandler = createHandler( false ),
+ defaultGetMaxScrollForTransition = function() {
+ return $.mobile.getScreenHeight() * 3;
+ };
-// Thanks to Modernizr src for this test idea. `perspective` check is limited to Moz to prevent a false positive for 3D transforms on Android.
-function transform3dTest() {
- var prop = "transform-3d";
- return validStyle( 'perspective', '10px', 'moz' ) || $.mobile.media( "(-" + vendors.join( "-" + prop + "),(-" ) + "-" + prop + "),(" + prop + ")" );
-}
+// Make our transition handler the public default.
+$.mobile.defaultTransitionHandler = sequentialHandler;
-// Test for dynamic-updating base tag support ( allows us to avoid href,src attr rewriting )
-function baseTagTest() {
- var fauxBase = location.protocol + "//" + location.host + location.pathname + "ui-dir/",
- base = $( "head base" ),
- fauxEle = null,
- href = "",
- link, rebase;
+//transition handler dictionary for 3rd party transitions
+$.mobile.transitionHandlers = {
+ "default": $.mobile.defaultTransitionHandler,
+ "sequential": sequentialHandler,
+ "simultaneous": simultaneousHandler
+};
- if ( !base.length ) {
- base = fauxEle = $( "<base>", { "href": fauxBase }).appendTo( "head" );
- } else {
- href = base.attr( "href" );
- }
+$.mobile.transitionFallbacks = {};
- link = $( "<a href='testurl' />" ).prependTo( fakeBody );
- rebase = link[ 0 ].href;
- base[ 0 ].href = href || location.pathname;
+// If transition is defined, check if css 3D transforms are supported, and if not, if a fallback is specified
+$.mobile._maybeDegradeTransition = function( transition ) {
+ if ( transition && !$.support.cssTransform3d && $.mobile.transitionFallbacks[ transition ] ) {
+ transition = $.mobile.transitionFallbacks[ transition ];
+ }
- if ( fauxEle ) {
- fauxEle.remove();
- }
- return rebase.indexOf( fauxBase ) === 0;
-}
+ return transition;
+};
+// Set the getMaxScrollForTransition to default if no implementation was set by user
+$.mobile.getMaxScrollForTransition = $.mobile.getMaxScrollForTransition || defaultGetMaxScrollForTransition;
+})( jQuery, this );
-// non-UA-based IE version check by James Padolsey, modified by jdalton - from http://gist.github.com/527683
-// allows for inclusion of IE 6+, including Windows Mobile 7
-$.extend( $.mobile, { browser: {} } );
-$.mobile.browser.ie = (function() {
- var v = 3,
- div = document.createElement( "div" ),
- a = div.all || [];
+(function( $, undefined ) {
+
+ //define vars for interal use
+ var $window = $( window ),
+ $html = $( 'html' ),
+ $head = $( 'head' ),
- // added {} to silence closure compiler warnings. registering my dislike of all things
- // overly clever here for future reference
- while ( div.innerHTML = "<!--[if gt IE " + ( ++v ) + "]><br><![endif]-->", a[ 0 ] ){};
+ //url path helpers for use in relative url management
+ path = {
- return v > 4 ? v : !v;
-})();
+ // This scary looking regular expression parses an absolute URL or its relative
+ // variants (protocol, site, document, query, and hash), into the various
+ // components (protocol, host, path, query, fragment, etc that make up the
+ // URL as well as some other commonly used sub-parts. When used with RegExp.exec()
+ // or String.match, it parses the URL into a results array that looks like this:
+ //
+ // [0]: http://jblas:password@mycompany.com:8080/mail/inbox?msg=1234&type=unread#msg-content
+ // [1]: http://jblas:password@mycompany.com:8080/mail/inbox?msg=1234&type=unread
+ // [2]: http://jblas:password@mycompany.com:8080/mail/inbox
+ // [3]: http://jblas:password@mycompany.com:8080
+ // [4]: http:
+ // [5]: //
+ // [6]: jblas:password@mycompany.com:8080
+ // [7]: jblas:password
+ // [8]: jblas
+ // [9]: password
+ // [10]: mycompany.com:8080
+ // [11]: mycompany.com
+ // [12]: 8080
+ // [13]: /mail/inbox
+ // [14]: /mail/
+ // [15]: inbox
+ // [16]: ?msg=1234&type=unread
+ // [17]: #msg-content
+ //
+ urlParseRE: /^(((([^:\/#\?]+:)?(?:(\/\/)((?:(([^:@\/#\?]+)(?:\:([^:@\/#\?]+))?)@)?(([^:\/#\?\]\[]+|\[[^\/\]@#?]+\])(?:\:([0-9]+))?))?)?)?((\/?(?:[^\/\?#]+\/+)*)([^\?#]*)))?(\?[^#]+)?)(#.*)?/,
+ // Abstraction to address xss (Issue #4787) by removing the authority in
+ // browsers that auto decode it. All references to location.href should be
+ // replaced with a call to this method so that it can be dealt with properly here
+ getLocation: function( url ) {
+ var uri = url ? this.parseUrl( url ) : location,
+ hash = this.parseUrl( url || location.href ).hash;
-$.extend( $.support, {
- orientation: "orientation" in window && "onorientationchange" in window,
- touch: "ontouchend" in document,
- cssTransitions: "WebKitTransitionEvent" in window || validStyle( 'transition', 'height 100ms linear' ),
- pushState: "pushState" in history && "replaceState" in history,
- mediaquery: $.mobile.media( "only all" ),
- cssPseudoElement: !!propExists( "content" ),
- touchOverflow: !!propExists( "overflowScrolling" ),
- cssTransform3d: transform3dTest(),
- boxShadow: !!propExists( "boxShadow" ) && !bb,
- scrollTop: ( "pageXOffset" in window || "scrollTop" in document.documentElement || "scrollTop" in fakeBody[ 0 ] ) && !webos && !operamini,
- dynamicBaseTag: baseTagTest()
-});
+ // mimic the browser with an empty string when the hash is empty
+ hash = hash === "#" ? "" : hash;
-fakeBody.remove();
+ // Make sure to parse the url or the location object for the hash because using location.hash
+ // is autodecoded in firefox, the rest of the url should be from the object (location unless
+ // we're testing) to avoid the inclusion of the authority
+ return uri.protocol + "//" + uri.host + uri.pathname + uri.search + hash;
+ },
+ parseLocation: function() {
+ return this.parseUrl( this.getLocation() );
+ },
-// $.mobile.ajaxBlacklist is used to override ajaxEnabled on platforms that have known conflicts with hash history updates (BB5, Symbian)
-// or that generally work better browsing in regular http for full page refreshes (Opera Mini)
-// Note: This detection below is used as a last resort.
-// We recommend only using these detection methods when all other more reliable/forward-looking approaches are not possible
-var nokiaLTE7_3 = (function(){
+ //Parse a URL into a structure that allows easy access to
+ //all of the URL components by name.
+ parseUrl: function( url ) {
+ // If we're passed an object, we'll assume that it is
+ // a parsed url object and just return it back to the caller.
+ if ( $.type( url ) === "object" ) {
+ return url;
+ }
- var ua = window.navigator.userAgent;
+ var matches = path.urlParseRE.exec( url || "" ) || [];
- //The following is an attempt to match Nokia browsers that are running Symbian/s60, with webkit, version 7.3 or older
- return ua.indexOf( "Nokia" ) > -1 &&
- ( ua.indexOf( "Symbian/3" ) > -1 || ua.indexOf( "Series60/5" ) > -1 ) &&
- ua.indexOf( "AppleWebKit" ) > -1 &&
- ua.match( /(BrowserNG|NokiaBrowser)\/7\.[0-3]/ );
-})();
+ // Create an object that allows the caller to access the sub-matches
+ // by name. Note that IE returns an empty string instead of undefined,
+ // like all other browsers do, so we normalize everything so its consistent
+ // no matter what browser we're running on.
+ return {
+ href: matches[ 0 ] || "",
+ hrefNoHash: matches[ 1 ] || "",
+ hrefNoSearch: matches[ 2 ] || "",
+ domain: matches[ 3 ] || "",
+ protocol: matches[ 4 ] || "",
+ doubleSlash: matches[ 5 ] || "",
+ authority: matches[ 6 ] || "",
+ username: matches[ 8 ] || "",
+ password: matches[ 9 ] || "",
+ host: matches[ 10 ] || "",
+ hostname: matches[ 11 ] || "",
+ port: matches[ 12 ] || "",
+ pathname: matches[ 13 ] || "",
+ directory: matches[ 14 ] || "",
+ filename: matches[ 15 ] || "",
+ search: matches[ 16 ] || "",
+ hash: matches[ 17 ] || ""
+ };
+ },
-// Support conditions that must be met in order to proceed
-// default enhanced qualifications are media query support OR IE 7+
-$.mobile.gradeA = function(){
- return $.support.mediaquery || $.mobile.browser.ie && $.mobile.browser.ie >= 7;
-};
+ //Turn relPath into an asbolute path. absPath is
+ //an optional absolute path which describes what
+ //relPath is relative to.
+ makePathAbsolute: function( relPath, absPath ) {
+ if ( relPath && relPath.charAt( 0 ) === "/" ) {
+ return relPath;
+ }
-$.mobile.ajaxBlacklist =
- // BlackBerry browsers, pre-webkit
- window.blackberry && !window.WebKitPoint ||
- // Opera Mini
- operamini ||
- // Symbian webkits pre 7.3
- nokiaLTE7_3;
+ relPath = relPath || "";
+ absPath = absPath ? absPath.replace( /^\/|(\/[^\/]*|[^\/]+)$/g, "" ) : "";
-// Lastly, this workaround is the only way we've found so far to get pre 7.3 Symbian webkit devices
-// to render the stylesheets when they're referenced before this script, as we'd recommend doing.
-// This simply reappends the CSS in place, which for some reason makes it apply
-if ( nokiaLTE7_3 ) {
- $(function() {
- $( "head link[rel='stylesheet']" ).attr( "rel", "alternate stylesheet" ).attr( "rel", "stylesheet" );
- });
-}
+ var absStack = absPath ? absPath.split( "/" ) : [],
+ relStack = relPath.split( "/" );
+ for ( var i = 0; i < relStack.length; i++ ) {
+ var d = relStack[ i ];
+ switch ( d ) {
+ case ".":
+ break;
+ case "..":
+ if ( absStack.length ) {
+ absStack.pop();
+ }
+ break;
+ default:
+ absStack.push( d );
+ break;
+ }
+ }
+ return "/" + absStack.join( "/" );
+ },
-// For ruling out shadows via css
-if ( !$.support.boxShadow ) {
- $( "html" ).addClass( "ui-mobile-nosupport-boxshadow" );
-}
+ //Returns true if both urls have the same domain.
+ isSameDomain: function( absUrl1, absUrl2 ) {
+ return path.parseUrl( absUrl1 ).domain === path.parseUrl( absUrl2 ).domain;
+ },
-})( jQuery );
+ //Returns true for any relative variant.
+ isRelativeUrl: function( url ) {
+ // All relative Url variants have one thing in common, no protocol.
+ return path.parseUrl( url ).protocol === "";
+ },
-(function( $, window, undefined ) {
+ //Returns true for an absolute url.
+ isAbsoluteUrl: function( url ) {
+ return path.parseUrl( url ).protocol !== "";
+ },
-// add new event shortcuts
-$.each( ( "touchstart touchmove touchend orientationchange throttledresize " +
- "tap taphold swipe swipeleft swiperight scrollstart scrollstop" ).split( " " ), function( i, name ) {
+ //Turn the specified realtive URL into an absolute one. This function
+ //can handle all relative variants (protocol, site, document, query, fragment).
+ makeUrlAbsolute: function( relUrl, absUrl ) {
+ if ( !path.isRelativeUrl( relUrl ) ) {
+ return relUrl;
+ }
- $.fn[ name ] = function( fn ) {
- return fn ? this.bind( name, fn ) : this.trigger( name );
- };
+ if ( absUrl === undefined ) {
+ absUrl = documentBase;
+ }
- $.attrFn[ name ] = true;
-});
+ var relObj = path.parseUrl( relUrl ),
+ absObj = path.parseUrl( absUrl ),
+ protocol = relObj.protocol || absObj.protocol,
+ doubleSlash = relObj.protocol ? relObj.doubleSlash : ( relObj.doubleSlash || absObj.doubleSlash ),
+ authority = relObj.authority || absObj.authority,
+ hasPath = relObj.pathname !== "",
+ pathname = path.makePathAbsolute( relObj.pathname || absObj.filename, absObj.pathname ),
+ search = relObj.search || ( !hasPath && absObj.search ) || "",
+ hash = relObj.hash;
-var supportTouch = $.support.touch,
- scrollEvent = "touchmove scroll",
- touchStartEvent = supportTouch ? "touchstart" : "mousedown",
- touchStopEvent = supportTouch ? "touchend" : "mouseup",
- touchMoveEvent = supportTouch ? "touchmove" : "mousemove";
+ return protocol + doubleSlash + authority + pathname + search + hash;
+ },
-function triggerCustomEvent( obj, eventType, event ) {
- var originalType = event.type;
- event.type = eventType;
- $.event.handle.call( obj, event );
- event.type = originalType;
-}
+ //Add search (aka query) params to the specified url.
+ addSearchParams: function( url, params ) {
+ var u = path.parseUrl( url ),
+ p = ( typeof params === "object" ) ? $.param( params ) : params,
+ s = u.search || "?";
+ return u.hrefNoSearch + s + ( s.charAt( s.length - 1 ) !== "?" ? "&" : "" ) + p + ( u.hash || "" );
+ },
-// also handles scrollstop
-$.event.special.scrollstart = {
+ convertUrlToDataUrl: function( absUrl ) {
+ var u = path.parseUrl( absUrl );
+ if ( path.isEmbeddedPage( u ) ) {
+ // For embedded pages, remove the dialog hash key as in getFilePath(),
+ // otherwise the Data Url won't match the id of the embedded Page.
+ return u.hash.split( dialogHashKey )[0].replace( /^#/, "" );
+ } else if ( path.isSameDomain( u, documentBase ) ) {
+ return u.hrefNoHash.replace( documentBase.domain, "" ).split( dialogHashKey )[0];
+ }
- enabled: true,
+ return window.decodeURIComponent(absUrl);
+ },
- setup: function() {
+ //get path from current hash, or from a file path
+ get: function( newPath ) {
+ if ( newPath === undefined ) {
+ newPath = path.parseLocation().hash;
+ }
+ return path.stripHash( newPath ).replace( /[^\/]*\.[^\/*]+$/, '' );
+ },
- var thisObject = this,
- $this = $( thisObject ),
- scrolling,
- timer;
+ //return the substring of a filepath before the sub-page key, for making a server request
+ getFilePath: function( path ) {
+ var splitkey = '&' + $.mobile.subPageUrlKey;
+ return path && path.split( splitkey )[0].split( dialogHashKey )[0];
+ },
- function trigger( event, state ) {
- scrolling = state;
- triggerCustomEvent( thisObject, scrolling ? "scrollstart" : "scrollstop", event );
- }
+ //set location hash to path
+ set: function( path ) {
+ location.hash = path;
+ },
- // iPhone triggers scroll after a small delay; use touchmove instead
- $this.bind( scrollEvent, function( event ) {
+ //test if a given url (string) is a path
+ //NOTE might be exceptionally naive
+ isPath: function( url ) {
+ return ( /\// ).test( url );
+ },
- if ( !$.event.special.scrollstart.enabled ) {
- return;
- }
+ //return a url path with the window's location protocol/hostname/pathname removed
+ clean: function( url ) {
+ return url.replace( documentBase.domain, "" );
+ },
- if ( !scrolling ) {
- trigger( event, true );
- }
+ //just return the url without an initial #
+ stripHash: function( url ) {
+ return url.replace( /^#/, "" );
+ },
- clearTimeout( timer );
- timer = setTimeout(function() {
- trigger( event, false );
- }, 50 );
- });
- }
-};
+ //remove the preceding hash, any query params, and dialog notations
+ cleanHash: function( hash ) {
+ return path.stripHash( hash.replace( /\?.*$/, "" ).replace( dialogHashKey, "" ) );
+ },
-// also handles taphold
-$.event.special.tap = {
- setup: function() {
- var thisObject = this,
- $this = $( thisObject );
+ isHashValid: function( hash ) {
+ return ( /^#[^#]+$/ ).test( hash );
+ },
- $this.bind( "vmousedown", function( event ) {
+ //check whether a url is referencing the same domain, or an external domain or different protocol
+ //could be mailto, etc
+ isExternal: function( url ) {
+ var u = path.parseUrl( url );
+ return u.protocol && u.domain !== documentUrl.domain ? true : false;
+ },
- if ( event.which && event.which !== 1 ) {
- return false;
- }
+ hasProtocol: function( url ) {
+ return ( /^(:?\w+:)/ ).test( url );
+ },
- var origTarget = event.target,
- origEvent = event.originalEvent,
- timer;
+ //check if the specified url refers to the first page in the main application document.
+ isFirstPageUrl: function( url ) {
+ // We only deal with absolute paths.
+ var u = path.parseUrl( path.makeUrlAbsolute( url, documentBase ) ),
- function clearTapTimer() {
- clearTimeout( timer );
- }
+ // Does the url have the same path as the document?
+ samePath = u.hrefNoHash === documentUrl.hrefNoHash || ( documentBaseDiffers && u.hrefNoHash === documentBase.hrefNoHash ),
- function clearTapHandlers() {
- clearTapTimer();
+ // Get the first page element.
+ fp = $.mobile.firstPage,
- $this.unbind( "vclick", clickHandler )
- .unbind( "vmouseup", clearTapTimer );
- $( document ).unbind( "vmousecancel", clearTapHandlers );
- }
+ // Get the id of the first page element if it has one.
+ fpId = fp && fp[0] ? fp[0].id : undefined;
- function clickHandler(event) {
- clearTapHandlers();
+ // The url refers to the first page if the path matches the document and
+ // it either has no hash value, or the hash is exactly equal to the id of the
+ // first page element.
+ return samePath && ( !u.hash || u.hash === "#" || ( fpId && u.hash.replace( /^#/, "" ) === fpId ) );
+ },
- // ONLY trigger a 'tap' event if the start target is
- // the same as the stop target.
- if ( origTarget == event.target ) {
- triggerCustomEvent( thisObject, "tap", event );
- }
- }
+ isEmbeddedPage: function( url ) {
+ var u = path.parseUrl( url );
- $this.bind( "vmouseup", clearTapTimer )
- .bind( "vclick", clickHandler );
- $( document ).bind( "vmousecancel", clearTapHandlers );
+ //if the path is absolute, then we need to compare the url against
+ //both the documentUrl and the documentBase. The main reason for this
+ //is that links embedded within external documents will refer to the
+ //application document, whereas links embedded within the application
+ //document will be resolved against the document base.
+ if ( u.protocol !== "" ) {
+ return ( u.hash && ( u.hrefNoHash === documentUrl.hrefNoHash || ( documentBaseDiffers && u.hrefNoHash === documentBase.hrefNoHash ) ) );
+ }
+ return ( /^#/ ).test( u.href );
+ },
- timer = setTimeout(function() {
- triggerCustomEvent( thisObject, "taphold", $.Event( "taphold", { target: origTarget } ) );
- }, 750 );
- });
- }
-};
-// also handles swipeleft, swiperight
-$.event.special.swipe = {
- scrollSupressionThreshold: 10, // More than this horizontal displacement, and we will suppress scrolling.
+ // Some embedded browsers, like the web view in Phone Gap, allow cross-domain XHR
+ // requests if the document doing the request was loaded via the file:// protocol.
+ // This is usually to allow the application to "phone home" and fetch app specific
+ // data. We normally let the browser handle external/cross-domain urls, but if the
+ // allowCrossDomainPages option is true, we will allow cross-domain http/https
+ // requests to go through our page loading logic.
+ isPermittedCrossDomainRequest: function( docUrl, reqUrl ) {
+ return $.mobile.allowCrossDomainPages &&
+ docUrl.protocol === "file:" &&
+ reqUrl.search( /^https?:/ ) !== -1;
+ }
+ },
- durationThreshold: 1000, // More time than this, and it isn't a swipe.
+ //will be defined when a link is clicked and given an active class
+ $activeClickedLink = null,
- horizontalDistanceThreshold: 30, // Swipe horizontal displacement must be more than this.
+ //urlHistory is purely here to make guesses at whether the back or forward button was clicked
+ //and provide an appropriate transition
+ urlHistory = {
+ // Array of pages that are visited during a single page load.
+ // Each has a url and optional transition, title, and pageUrl (which represents the file path, in cases where URL is obscured, such as dialogs)
+ stack: [],
- verticalDistanceThreshold: 75, // Swipe vertical displacement must be less than this.
+ //maintain an index number for the active page in the stack
+ activeIndex: 0,
- setup: function() {
- var thisObject = this,
- $this = $( thisObject );
+ //get active
+ getActive: function() {
+ return urlHistory.stack[ urlHistory.activeIndex ];
+ },
- $this.bind( touchStartEvent, function( event ) {
- var data = event.originalEvent.touches ?
- event.originalEvent.touches[ 0 ] : event,
- start = {
- time: ( new Date() ).getTime(),
- coords: [ data.pageX, data.pageY ],
- origin: $( event.target )
- },
- stop;
+ getPrev: function() {
+ return urlHistory.stack[ urlHistory.activeIndex - 1 ];
+ },
- function moveHandler( event ) {
+ getNext: function() {
+ return urlHistory.stack[ urlHistory.activeIndex + 1 ];
+ },
- if ( !start ) {
- return;
+ // addNew is used whenever a new page is added
+ addNew: function( url, transition, title, pageUrl, role ) {
+ //if there's forward history, wipe it
+ if ( urlHistory.getNext() ) {
+ urlHistory.clearForward();
}
- var data = event.originalEvent.touches ?
- event.originalEvent.touches[ 0 ] : event;
+ urlHistory.stack.push( {url : url, transition: transition, title: title, pageUrl: pageUrl, role: role } );
- stop = {
- time: ( new Date() ).getTime(),
- coords: [ data.pageX, data.pageY ]
- };
+ urlHistory.activeIndex = urlHistory.stack.length - 1;
+ },
- // prevent scrolling
- if ( Math.abs( start.coords[ 0 ] - stop.coords[ 0 ] ) > $.event.special.swipe.scrollSupressionThreshold ) {
- event.preventDefault();
- }
- }
+ //wipe urls ahead of active index
+ clearForward: function() {
+ urlHistory.stack = urlHistory.stack.slice( 0, urlHistory.activeIndex + 1 );
+ },
- $this.bind( touchMoveEvent, moveHandler )
- .one( touchStopEvent, function( event ) {
- $this.unbind( touchMoveEvent, moveHandler );
+ directHashChange: function( opts ) {
+ var back , forward, newActiveIndex, prev = this.getActive();
- if ( start && stop ) {
- if ( stop.time - start.time < $.event.special.swipe.durationThreshold &&
- Math.abs( start.coords[ 0 ] - stop.coords[ 0 ] ) > $.event.special.swipe.horizontalDistanceThreshold &&
- Math.abs( start.coords[ 1 ] - stop.coords[ 1 ] ) < $.event.special.swipe.verticalDistanceThreshold ) {
+ // check if url is in history and if it's ahead or behind current page
+ $.each( urlHistory.stack, function( i, historyEntry ) {
- start.origin.trigger( "swipe" )
- .trigger( start.coords[0] > stop.coords[ 0 ] ? "swipeleft" : "swiperight" );
- }
+ //if the url is in the stack, it's a forward or a back
+ if ( decodeURIComponent( opts.currentUrl ) === decodeURIComponent( historyEntry.url ) ) {
+ //define back and forward by whether url is older or newer than current page
+ back = i < urlHistory.activeIndex;
+ forward = !back;
+ newActiveIndex = i;
}
- start = stop = undefined;
});
- });
- }
-};
-(function( $, window ) {
- // "Cowboy" Ben Alman
+ // save new page index, null check to prevent falsey 0 result
+ this.activeIndex = newActiveIndex !== undefined ? newActiveIndex : this.activeIndex;
- var win = $( window ),
- special_event,
- get_orientation,
- last_orientation,
- initial_orientation_is_landscape,
- initial_orientation_is_default,
- portrait_map = { "0": true, "180": true };
+ if ( back ) {
+ ( opts.either || opts.isBack )( true );
+ } else if ( forward ) {
+ ( opts.either || opts.isForward )( false );
+ }
+ },
- // It seems that some device/browser vendors use window.orientation values 0 and 180 to
- // denote the "default" orientation. For iOS devices, and most other smart-phones tested,
- // the default orientation is always "portrait", but in some Android and RIM based tablets,
- // the default orientation is "landscape". The following code attempts to use the window
- // dimensions to figure out what the current orientation is, and then makes adjustments
- // to the to the portrait_map if necessary, so that we can properly decode the
- // window.orientation value whenever get_orientation() is called.
- //
- // Note that we used to use a media query to figure out what the orientation the browser
- // thinks it is in:
- //
- // initial_orientation_is_landscape = $.mobile.media("all and (orientation: landscape)");
- //
- // but there was an iPhone/iPod Touch bug beginning with iOS 4.2, up through iOS 5.1,
- // where the browser *ALWAYS* applied the landscape media query. This bug does not
- // happen on iPad.
+ //disable hashchange event listener internally to ignore one change
+ //toggled internally when location.hash is updated to match the url of a successful page load
+ ignoreNextHashChange: false
+ },
- if ( $.support.orientation ) {
+ //define first selector to receive focus when a page is shown
+ focusable = "[tabindex],a,button:visible,select:visible,input",
- // Check the window width and height to figure out what the current orientation
- // of the device is at this moment. Note that we've initialized the portrait map
- // values to 0 and 180, *AND* we purposely check for landscape so that if we guess
- // wrong, , we default to the assumption that portrait is the default orientation.
- // We use a threshold check below because on some platforms like iOS, the iPhone
- // form-factor can report a larger width than height if the user turns on the
- // developer console. The actual threshold value is somewhat arbitrary, we just
- // need to make sure it is large enough to exclude the developer console case.
+ //queue to hold simultanious page transitions
+ pageTransitionQueue = [],
- var ww = window.innerWidth || $( window ).width(),
- wh = window.innerHeight || $( window ).height(),
- landscape_threshold = 50;
+ //indicates whether or not page is in process of transitioning
+ isPageTransitioning = false,
+
+ //nonsense hash change key for dialogs, so they create a history entry
+ dialogHashKey = "&ui-state=dialog",
+
+ //existing base tag?
+ $base = $head.children( "base" ),
+
+ //tuck away the original document URL minus any fragment.
+ documentUrl = path.parseLocation(),
- initial_orientation_is_landscape = ww > wh && ( ww - wh ) > landscape_threshold;
+ //if the document has an embedded base tag, documentBase is set to its
+ //initial value. If a base tag does not exist, then we default to the documentUrl.
+ documentBase = $base.length ? path.parseUrl( path.makeUrlAbsolute( $base.attr( "href" ), documentUrl.href ) ) : documentUrl,
+ //cache the comparison once.
+ documentBaseDiffers = ( documentUrl.hrefNoHash !== documentBase.hrefNoHash ),
- // Now check to see if the current window.orientation is 0 or 180.
- initial_orientation_is_default = portrait_map[ window.orientation ];
+ getScreenHeight = $.mobile.getScreenHeight;
- // If the initial orientation is landscape, but window.orientation reports 0 or 180, *OR*
- // if the initial orientation is portrait, but window.orientation reports 90 or -90, we
- // need to flip our portrait_map values because landscape is the default orientation for
- // this device/browser.
- if ( ( initial_orientation_is_landscape && initial_orientation_is_default ) || ( !initial_orientation_is_landscape && !initial_orientation_is_default ) ) {
- portrait_map = { "-90": true, "90": true };
- }
- }
+ //base element management, defined depending on dynamic base tag support
+ var base = $.support.dynamicBaseTag ? {
- $.event.special.orientationchange = special_event = {
- setup: function() {
- // If the event is supported natively, return false so that jQuery
- // will bind to the event using DOM methods.
- if ( $.support.orientation && $.mobile.orientationChangeEnabled ) {
- return false;
- }
+ //define base element, for use in routing asset urls that are referenced in Ajax-requested markup
+ element: ( $base.length ? $base : $( "<base>", { href: documentBase.hrefNoHash } ).prependTo( $head ) ),
- // Get the current orientation to avoid initial double-triggering.
- last_orientation = get_orientation();
+ //set the generated BASE element's href attribute to a new page's base path
+ set: function( href ) {
+ base.element.attr( "href", path.makeUrlAbsolute( href, documentBase ) );
+ },
- // Because the orientationchange event doesn't exist, simulate the
- // event by testing window dimensions on resize.
- win.bind( "throttledresize", handler );
- },
- teardown: function(){
- // If the event is not supported natively, return false so that
- // jQuery will unbind the event using DOM methods.
- if ( $.support.orientation && $.mobile.orientationChangeEnabled ) {
- return false;
+ //set the generated BASE element's href attribute to a new page's base path
+ reset: function() {
+ base.element.attr( "href", documentBase.hrefNoHash );
}
- // Because the orientationchange event doesn't exist, unbind the
- // resize event handler.
- win.unbind( "throttledresize", handler );
- },
- add: function( handleObj ) {
- // Save a reference to the bound event handler.
- var old_handler = handleObj.handler;
+ } : undefined;
+ /* internal utility functions */
+
+ // NOTE Issue #4950 Android phonegap doesn't navigate back properly
+ // when a full page refresh has taken place. It appears that hashchange
+ // and replacestate history alterations work fine but we need to support
+ // both forms of history traversal in our code that uses backward history
+ // movement
+ $.mobile.back = function() {
+ var nav = window.navigator;
+
+ // if the setting is on and the navigator object is
+ // available use the phonegap navigation capability
+ if( this.phonegapNavigationEnabled &&
+ nav &&
+ nav.app &&
+ nav.app.backHistory ){
+ nav.app.backHistory();
+ } else {
+ window.history.back();
+ }
+ };
- handleObj.handler = function( event ) {
- // Modify event object, adding the .orientation property.
- event.orientation = get_orientation();
+ //direct focus to the page title, or otherwise first focusable element
+ $.mobile.focusPage = function ( page ) {
+ var autofocus = page.find( "[autofocus]" ),
+ pageTitle = page.find( ".ui-title:eq(0)" );
- // Call the originally-bound event handler and return its result.
- return old_handler.apply( this, arguments );
- };
+ if ( autofocus.length ) {
+ autofocus.focus();
+ return;
}
- };
- // If the event is not supported natively, this handler will be bound to
- // the window resize event to simulate the orientationchange event.
- function handler() {
- // Get the current orientation.
- var orientation = get_orientation();
+ if ( pageTitle.length ) {
+ pageTitle.focus();
+ } else{
+ page.focus();
+ }
+ };
- if ( orientation !== last_orientation ) {
- // The orientation has changed, so trigger the orientationchange event.
- last_orientation = orientation;
- win.trigger( "orientationchange" );
+ //remove active classes after page transition or error
+ function removeActiveLinkClass( forceRemoval ) {
+ if ( !!$activeClickedLink && ( !$activeClickedLink.closest( "." + $.mobile.activePageClass ).length || forceRemoval ) ) {
+ $activeClickedLink.removeClass( $.mobile.activeBtnClass );
}
+ $activeClickedLink = null;
}
- // Get the current page orientation. This method is exposed publicly, should it
- // be needed, as jQuery.event.special.orientationchange.orientation()
- $.event.special.orientationchange.orientation = get_orientation = function() {
- var isPortrait = true, elem = document.documentElement;
-
- // prefer window orientation to the calculation based on screensize as
- // the actual screen resize takes place before or after the orientation change event
- // has been fired depending on implementation (eg android 2.3 is before, iphone after).
- // More testing is required to determine if a more reliable method of determining the new screensize
- // is possible when orientationchange is fired. (eg, use media queries + element + opacity)
- if ( $.support.orientation ) {
- // if the window orientation registers as 0 or 180 degrees report
- // portrait, otherwise landscape
- isPortrait = portrait_map[ window.orientation ];
- } else {
- isPortrait = elem && elem.clientWidth / elem.clientHeight < 1.1;
+ function releasePageTransitionLock() {
+ isPageTransitioning = false;
+ if ( pageTransitionQueue.length > 0 ) {
+ $.mobile.changePage.apply( null, pageTransitionQueue.pop() );
}
+ }
- return isPortrait ? "portrait" : "landscape";
- };
+ // Save the last scroll distance per page, before it is hidden
+ var setLastScrollEnabled = true,
+ setLastScroll, delayedSetLastScroll;
-})( jQuery, window );
+ setLastScroll = function() {
+ // this barrier prevents setting the scroll value based on the browser
+ // scrolling the window based on a hashchange
+ if ( !setLastScrollEnabled ) {
+ return;
+ }
+ var active = $.mobile.urlHistory.getActive();
-// throttled resize event
-(function() {
+ if ( active ) {
+ var lastScroll = $window.scrollTop();
- $.event.special.throttledresize = {
- setup: function() {
- $( this ).bind( "resize", handler );
- },
- teardown: function(){
- $( this ).unbind( "resize", handler );
+ // Set active page's lastScroll prop.
+ // If the location we're scrolling to is less than minScrollBack, let it go.
+ active.lastScroll = lastScroll < $.mobile.minScrollBack ? $.mobile.defaultHomeScroll : lastScroll;
}
};
- var throttle = 250,
- handler = function() {
- curr = ( new Date() ).getTime();
- diff = curr - lastCall;
+ // bind to scrollstop to gather scroll position. The delay allows for the hashchange
+ // event to fire and disable scroll recording in the case where the browser scrolls
+ // to the hash targets location (sometimes the top of the page). once pagechange fires
+ // getLastScroll is again permitted to operate
+ delayedSetLastScroll = function() {
+ setTimeout( setLastScroll, 100 );
+ };
- if ( diff >= throttle ) {
+ // disable an scroll setting when a hashchange has been fired, this only works
+ // because the recording of the scroll position is delayed for 100ms after
+ // the browser might have changed the position because of the hashchange
+ $window.bind( $.support.pushState ? "popstate" : "hashchange", function() {
+ setLastScrollEnabled = false;
+ });
- lastCall = curr;
- $( this ).trigger( "throttledresize" );
+ // handle initial hashchange from chrome :(
+ $window.one( $.support.pushState ? "popstate" : "hashchange", function() {
+ setLastScrollEnabled = true;
+ });
- } else {
+ // wait until the mobile page container has been determined to bind to pagechange
+ $window.one( "pagecontainercreate", function() {
+ // once the page has changed, re-enable the scroll recording
+ $.mobile.pageContainer.bind( "pagechange", function() {
- if ( heldCall ) {
- clearTimeout( heldCall );
- }
+ setLastScrollEnabled = true;
- // Promise a held call will still execute
- heldCall = setTimeout( handler, throttle - diff );
- }
- },
- lastCall = 0,
- heldCall,
- curr,
- diff;
-})();
+ // remove any binding that previously existed on the get scroll
+ // which may or may not be different than the scroll element determined for
+ // this page previously
+ $window.unbind( "scrollstop", delayedSetLastScroll );
+ // determine and bind to the current scoll element which may be the window
+ // or in the case of touch overflow the element with touch overflow
+ $window.bind( "scrollstop", delayedSetLastScroll );
+ });
+ });
-$.each({
- scrollstop: "scrollstart",
- taphold: "tap",
- swipeleft: "swipe",
- swiperight: "swipe"
-}, function( event, sourceEvent ) {
+ // bind to scrollstop for the first page as "pagechange" won't be fired in that case
+ $window.bind( "scrollstop", delayedSetLastScroll );
- $.event.special[ event ] = {
- setup: function() {
- $( this ).bind( sourceEvent, $.noop );
- }
+ // No-op implementation of transition degradation
+ $.mobile._maybeDegradeTransition = $.mobile._maybeDegradeTransition || function( transition ) {
+ return transition;
};
-});
-
-})( jQuery, this );
-(function( $, undefined ) {
-
-$.widget( "mobile.page", $.mobile.widget, {
- options: {
- theme: "c",
- domCache: false,
- keepNativeDefault: ":jqmData(role='none'), :jqmData(role='nojs')"
- },
+ //function for transitioning between two existing pages
+ function transitionPages( toPage, fromPage, transition, reverse ) {
- _create: function() {
-
- var self = this;
-
- // if false is returned by the callbacks do not create the page
- if( self._trigger( "beforecreate" ) === false ){
- return false;
+ if ( fromPage ) {
+ //trigger before show/hide events
+ fromPage.data( "page" )._trigger( "beforehide", null, { nextPage: toPage } );
}
- self.element
- .attr( "tabindex", "0" )
- .addClass( "ui-page ui-body-" + self.options.theme )
- .bind( "pagebeforehide", function(){
- self.removeContainerBackground();
- } )
- .bind( "pagebeforeshow", function(){
- self.setContainerBackground();
- } );
-
- },
-
- removeContainerBackground: function(){
- $.mobile.pageContainer.removeClass( "ui-overlay-" + $.mobile.getInheritedTheme( this.element.parent() ) );
- },
-
- // set the page container background to the page theme
- setContainerBackground: function( theme ){
- if( this.options.theme ){
- $.mobile.pageContainer.addClass( "ui-overlay-" + ( theme || this.options.theme ) );
- }
- },
+ toPage.data( "page" )._trigger( "beforeshow", null, { prevPage: fromPage || $( "" ) } );
- keepNativeSelector: function() {
- var options = this.options,
- keepNativeDefined = options.keepNative && $.trim(options.keepNative);
+ //clear page loader
+ $.mobile.hidePageLoadingMsg();
- if( keepNativeDefined && options.keepNative !== options.keepNativeDefault ){
- return [options.keepNative, options.keepNativeDefault].join(", ");
- }
+ transition = $.mobile._maybeDegradeTransition( transition );
- return options.keepNativeDefault;
- }
-});
-})( jQuery );
+ //find the transition handler for the specified transition. If there
+ //isn't one in our transitionHandlers dictionary, use the default one.
+ //call the handler immediately to kick-off the transition.
+ var th = $.mobile.transitionHandlers[ transition || "default" ] || $.mobile.defaultTransitionHandler,
+ promise = th( transition, reverse, toPage, fromPage );
+ promise.done(function() {
-(function( $, window, undefined ) {
+ //trigger show/hide events
+ if ( fromPage ) {
+ fromPage.data( "page" )._trigger( "hide", null, { nextPage: toPage } );
+ }
-var createHandler = function( sequential ){
-
- // Default to sequential
- if( sequential === undefined ){
- sequential = true;
- }
-
- return function( name, reverse, $to, $from ) {
+ //trigger pageshow, define prevPage as either fromPage or empty jQuery obj
+ toPage.data( "page" )._trigger( "show", null, { prevPage: fromPage || $( "" ) } );
+ });
- var deferred = new $.Deferred(),
- reverseClass = reverse ? " reverse" : "",
- active = $.mobile.urlHistory.getActive(),
- toScroll = active.lastScroll || $.mobile.defaultHomeScroll,
- screenHeight = $.mobile.getScreenHeight(),
- maxTransitionOverride = $.mobile.maxTransitionWidth !== false && $( window ).width() > $.mobile.maxTransitionWidth,
- none = !$.support.cssTransitions || maxTransitionOverride || !name || name === "none",
- toggleViewportClass = function(){
- $.mobile.pageContainer.toggleClass( "ui-mobile-viewport-transitioning viewport-" + name );
- },
- scrollPage = function(){
- // By using scrollTo instead of silentScroll, we can keep things better in order
- // Just to be precautios, disable scrollstart listening like silentScroll would
- $.event.special.scrollstart.enabled = false;
-
- window.scrollTo( 0, toScroll );
-
- // reenable scrollstart listening like silentScroll would
- setTimeout(function() {
- $.event.special.scrollstart.enabled = true;
- }, 150 );
- },
- cleanFrom = function(){
- $from
- .removeClass( $.mobile.activePageClass + " out in reverse " + name )
- .height( "" );
- },
- startOut = function(){
- // if it's not sequential, call the doneOut transition to start the TO page animating in simultaneously
- if( !sequential ){
- doneOut();
- }
- else {
- $from.animationComplete( doneOut );
- }
-
- // Set the from page's height and start it transitioning out
- // Note: setting an explicit height helps eliminate tiling in the transitions
- $from
- .height( screenHeight + $(window ).scrollTop() )
- .addClass( name + " out" + reverseClass );
- },
-
- doneOut = function() {
+ return promise;
+ }
- if ( $from && sequential ) {
- cleanFrom();
- }
-
- startIn();
- },
-
- startIn = function(){
-
- $to.addClass( $.mobile.activePageClass );
-
- // Send focus to page as it is now display: block
- $.mobile.focusPage( $to );
+ //simply set the active page's minimum height to screen height, depending on orientation
+ function resetActivePageHeight() {
+ var aPage = $( "." + $.mobile.activePageClass ),
+ aPagePadT = parseFloat( aPage.css( "padding-top" ) ),
+ aPagePadB = parseFloat( aPage.css( "padding-bottom" ) ),
+ aPageBorderT = parseFloat( aPage.css( "border-top-width" ) ),
+ aPageBorderB = parseFloat( aPage.css( "border-bottom-width" ) );
- // Set to page height
- $to.height( screenHeight + toScroll );
-
- scrollPage();
-
- if( !none ){
- $to.animationComplete( doneIn );
- }
-
- $to.addClass( name + " in" + reverseClass );
-
- if( none ){
- doneIn();
- }
-
- },
-
- doneIn = function() {
-
- if ( !sequential ) {
-
- if( $from ){
- cleanFrom();
- }
- }
-
- $to
- .removeClass( "out in reverse " + name )
- .height( "" );
-
- toggleViewportClass();
-
- // In some browsers (iOS5), 3D transitions block the ability to scroll to the desired location during transition
- // This ensures we jump to that spot after the fact, if we aren't there already.
- if( $( window ).scrollTop() !== toScroll ){
- scrollPage();
- }
+ aPage.css( "min-height", getScreenHeight() - aPagePadT - aPagePadB - aPageBorderT - aPageBorderB );
+ }
- deferred.resolve( name, reverse, $to, $from, true );
- };
+ //shared page enhancements
+ function enhancePage( $page, role ) {
+ // If a role was specified, make sure the data-role attribute
+ // on the page element is in sync.
+ if ( role ) {
+ $page.attr( "data-" + $.mobile.ns + "role", role );
+ }
- toggleViewportClass();
-
- if ( $from && !none ) {
- startOut();
+ //run page plugin
+ $page.page();
+ }
+
+ /* exposed $.mobile methods */
+
+ //animation complete callback
+ $.fn.animationComplete = function( callback ) {
+ if ( $.support.cssTransitions ) {
+ return $( this ).one( 'webkitAnimationEnd animationend', callback );
}
- else {
- doneOut();
+ else{
+ // defer execution for consistency between webkit/non webkit
+ setTimeout( callback, 0 );
+ return $( this );
}
-
- return deferred.promise();
};
-}
-// generate the handlers from the above
-var sequentialHandler = createHandler(),
- simultaneousHandler = createHandler( false );
+ //expose path object on $.mobile
+ $.mobile.path = path;
-// Make our transition handler the public default.
-$.mobile.defaultTransitionHandler = sequentialHandler;
+ //expose base object on $.mobile
+ $.mobile.base = base;
-//transition handler dictionary for 3rd party transitions
-$.mobile.transitionHandlers = {
- "default": $.mobile.defaultTransitionHandler,
- "sequential": sequentialHandler,
- "simultaneous": simultaneousHandler
-};
+ //history stack
+ $.mobile.urlHistory = urlHistory;
-$.mobile.transitionFallbacks = {};
+ $.mobile.dialogHashKey = dialogHashKey;
-})( jQuery, this );
-( function( $, undefined ) {
- //define vars for interal use
- var $window = $( window ),
- $html = $( 'html' ),
- $head = $( 'head' ),
+ //enable cross-domain page support
+ $.mobile.allowCrossDomainPages = false;
- //url path helpers for use in relative url management
- path = {
+ //return the original document url
+ $.mobile.getDocumentUrl = function( asParsedObject ) {
+ return asParsedObject ? $.extend( {}, documentUrl ) : documentUrl.href;
+ };
- // This scary looking regular expression parses an absolute URL or its relative
- // variants (protocol, site, document, query, and hash), into the various
- // components (protocol, host, path, query, fragment, etc that make up the
- // URL as well as some other commonly used sub-parts. When used with RegExp.exec()
- // or String.match, it parses the URL into a results array that looks like this:
- //
- // [0]: http://jblas:password@mycompany.com:8080/mail/inbox?msg=1234&type=unread#msg-content
- // [1]: http://jblas:password@mycompany.com:8080/mail/inbox?msg=1234&type=unread
- // [2]: http://jblas:password@mycompany.com:8080/mail/inbox
- // [3]: http://jblas:password@mycompany.com:8080
- // [4]: http:
- // [5]: //
- // [6]: jblas:password@mycompany.com:8080
- // [7]: jblas:password
- // [8]: jblas
- // [9]: password
- // [10]: mycompany.com:8080
- // [11]: mycompany.com
- // [12]: 8080
- // [13]: /mail/inbox
- // [14]: /mail/
- // [15]: inbox
- // [16]: ?msg=1234&type=unread
- // [17]: #msg-content
- //
- urlParseRE: /^(((([^:\/#\?]+:)?(?:(\/\/)((?:(([^:@\/#\?]+)(?:\:([^:@\/#\?]+))?)@)?(([^:\/#\?\]\[]+|\[[^\/\]@#?]+\])(?:\:([0-9]+))?))?)?)?((\/?(?:[^\/\?#]+\/+)*)([^\?#]*)))?(\?[^#]+)?)(#.*)?/,
+ //return the original document base url
+ $.mobile.getDocumentBase = function( asParsedObject ) {
+ return asParsedObject ? $.extend( {}, documentBase ) : documentBase.href;
+ };
- //Parse a URL into a structure that allows easy access to
- //all of the URL components by name.
- parseUrl: function( url ) {
- // If we're passed an object, we'll assume that it is
- // a parsed url object and just return it back to the caller.
- if ( $.type( url ) === "object" ) {
- return url;
- }
+ $.mobile._bindPageRemove = function() {
+ var page = $( this );
- var matches = path.urlParseRE.exec( url || "" ) || [];
+ // when dom caching is not enabled or the page is embedded bind to remove the page on hide
+ if ( !page.data( "page" ).options.domCache &&
+ page.is( ":jqmData(external-page='true')" ) ) {
- // Create an object that allows the caller to access the sub-matches
- // by name. Note that IE returns an empty string instead of undefined,
- // like all other browsers do, so we normalize everything so its consistent
- // no matter what browser we're running on.
- return {
- href: matches[ 0 ] || "",
- hrefNoHash: matches[ 1 ] || "",
- hrefNoSearch: matches[ 2 ] || "",
- domain: matches[ 3 ] || "",
- protocol: matches[ 4 ] || "",
- doubleSlash: matches[ 5 ] || "",
- authority: matches[ 6 ] || "",
- username: matches[ 8 ] || "",
- password: matches[ 9 ] || "",
- host: matches[ 10 ] || "",
- hostname: matches[ 11 ] || "",
- port: matches[ 12 ] || "",
- pathname: matches[ 13 ] || "",
- directory: matches[ 14 ] || "",
- filename: matches[ 15 ] || "",
- search: matches[ 16 ] || "",
- hash: matches[ 17 ] || ""
- };
- },
+ page.bind( 'pagehide.remove', function() {
+ var $this = $( this ),
+ prEvent = new $.Event( "pageremove" );
- //Turn relPath into an asbolute path. absPath is
- //an optional absolute path which describes what
- //relPath is relative to.
- makePathAbsolute: function( relPath, absPath ) {
- if ( relPath && relPath.charAt( 0 ) === "/" ) {
- return relPath;
+ $this.trigger( prEvent );
+
+ if ( !prEvent.isDefaultPrevented() ) {
+ $this.removeWithDependents();
}
+ });
+ }
+ };
- relPath = relPath || "";
- absPath = absPath ? absPath.replace( /^\/|(\/[^\/]*|[^\/]+)$/g, "" ) : "";
+ // Load a page into the DOM.
+ $.mobile.loadPage = function( url, options ) {
+ // This function uses deferred notifications to let callers
+ // know when the page is done loading, or if an error has occurred.
+ var deferred = $.Deferred(),
- var absStack = absPath ? absPath.split( "/" ) : [],
- relStack = relPath.split( "/" );
- for ( var i = 0; i < relStack.length; i++ ) {
- var d = relStack[ i ];
- switch ( d ) {
- case ".":
- break;
- case "..":
- if ( absStack.length ) {
- absStack.pop();
- }
- break;
- default:
- absStack.push( d );
- break;
- }
- }
- return "/" + absStack.join( "/" );
- },
+ // The default loadPage options with overrides specified by
+ // the caller.
+ settings = $.extend( {}, $.mobile.loadPage.defaults, options ),
- //Returns true if both urls have the same domain.
- isSameDomain: function( absUrl1, absUrl2 ) {
- return path.parseUrl( absUrl1 ).domain === path.parseUrl( absUrl2 ).domain;
- },
+ // The DOM element for the page after it has been loaded.
+ page = null,
- //Returns true for any relative variant.
- isRelativeUrl: function( url ) {
- // All relative Url variants have one thing in common, no protocol.
- return path.parseUrl( url ).protocol === "";
+ // If the reloadPage option is true, and the page is already
+ // in the DOM, dupCachedPage will be set to the page element
+ // so that it can be removed after the new version of the
+ // page is loaded off the network.
+ dupCachedPage = null,
+
+ // determine the current base url
+ findBaseWithDefault = function() {
+ var closestBase = ( $.mobile.activePage && getClosestBaseUrl( $.mobile.activePage ) );
+ return closestBase || documentBase.hrefNoHash;
},
- //Returns true for an absolute url.
- isAbsoluteUrl: function( url ) {
- return path.parseUrl( url ).protocol !== "";
- },
+ // The absolute version of the URL passed into the function. This
+ // version of the URL may contain dialog/subpage params in it.
+ absUrl = path.makeUrlAbsolute( url, findBaseWithDefault() );
+
+
+ // If the caller provided data, and we're using "get" request,
+ // append the data to the URL.
+ if ( settings.data && settings.type === "get" ) {
+ absUrl = path.addSearchParams( absUrl, settings.data );
+ settings.data = undefined;
+ }
+
+ // If the caller is using a "post" request, reloadPage must be true
+ if ( settings.data && settings.type === "post" ) {
+ settings.reloadPage = true;
+ }
+
+ // The absolute version of the URL minus any dialog/subpage params.
+ // In otherwords the real URL of the page to be loaded.
+ var fileUrl = path.getFilePath( absUrl ),
+
+ // The version of the Url actually stored in the data-url attribute of
+ // the page. For embedded pages, it is just the id of the page. For pages
+ // within the same domain as the document base, it is the site relative
+ // path. For cross-domain pages (Phone Gap only) the entire absolute Url
+ // used to load the page.
+ dataUrl = path.convertUrlToDataUrl( absUrl );
+
+ // Make sure we have a pageContainer to work with.
+ settings.pageContainer = settings.pageContainer || $.mobile.pageContainer;
+
+ // Check to see if the page already exists in the DOM.
+ // NOTE do _not_ use the :jqmData psuedo selector because parenthesis
+ // are a valid url char and it breaks on the first occurence
+ page = settings.pageContainer.children( "[data-" + $.mobile.ns +"url='" + dataUrl + "']" );
- //Turn the specified realtive URL into an absolute one. This function
- //can handle all relative variants (protocol, site, document, query, fragment).
- makeUrlAbsolute: function( relUrl, absUrl ) {
- if ( !path.isRelativeUrl( relUrl ) ) {
- return relUrl;
+ // If we failed to find the page, check to see if the url is a
+ // reference to an embedded page. If so, it may have been dynamically
+ // injected by a developer, in which case it would be lacking a data-url
+ // attribute and in need of enhancement.
+ if ( page.length === 0 && dataUrl && !path.isPath( dataUrl ) ) {
+ page = settings.pageContainer.children( "#" + dataUrl )
+ .attr( "data-" + $.mobile.ns + "url", dataUrl )
+ .jqmData( "url", dataUrl );
+ }
+
+ // If we failed to find a page in the DOM, check the URL to see if it
+ // refers to the first page in the application. If it isn't a reference
+ // to the first page and refers to non-existent embedded page, error out.
+ if ( page.length === 0 ) {
+ if ( $.mobile.firstPage && path.isFirstPageUrl( fileUrl ) ) {
+ // Check to make sure our cached-first-page is actually
+ // in the DOM. Some user deployed apps are pruning the first
+ // page from the DOM for various reasons, we check for this
+ // case here because we don't want a first-page with an id
+ // falling through to the non-existent embedded page error
+ // case. If the first-page is not in the DOM, then we let
+ // things fall through to the ajax loading code below so
+ // that it gets reloaded.
+ if ( $.mobile.firstPage.parent().length ) {
+ page = $( $.mobile.firstPage );
}
+ } else if ( path.isEmbeddedPage( fileUrl ) ) {
+ deferred.reject( absUrl, options );
+ return deferred.promise();
+ }
+ }
- var relObj = path.parseUrl( relUrl ),
- absObj = path.parseUrl( absUrl ),
- protocol = relObj.protocol || absObj.protocol,
- doubleSlash = relObj.protocol ? relObj.doubleSlash : ( relObj.doubleSlash || absObj.doubleSlash ),
- authority = relObj.authority || absObj.authority,
- hasPath = relObj.pathname !== "",
- pathname = path.makePathAbsolute( relObj.pathname || absObj.filename, absObj.pathname ),
- search = relObj.search || ( !hasPath && absObj.search ) || "",
- hash = relObj.hash;
+ // If the page we are interested in is already in the DOM,
+ // and the caller did not indicate that we should force a
+ // reload of the file, we are done. Otherwise, track the
+ // existing page as a duplicated.
+ if ( page.length ) {
+ if ( !settings.reloadPage ) {
+ enhancePage( page, settings.role );
+ deferred.resolve( absUrl, options, page );
+ return deferred.promise();
+ }
+ dupCachedPage = page;
+ }
- return protocol + doubleSlash + authority + pathname + search + hash;
- },
+ var mpc = settings.pageContainer,
+ pblEvent = new $.Event( "pagebeforeload" ),
+ triggerData = { url: url, absUrl: absUrl, dataUrl: dataUrl, deferred: deferred, options: settings };
- //Add search (aka query) params to the specified url.
- addSearchParams: function( url, params ) {
- var u = path.parseUrl( url ),
- p = ( typeof params === "object" ) ? $.param( params ) : params,
- s = u.search || "?";
- return u.hrefNoSearch + s + ( s.charAt( s.length - 1 ) !== "?" ? "&" : "" ) + p + ( u.hash || "" );
- },
+ // Let listeners know we're about to load a page.
+ mpc.trigger( pblEvent, triggerData );
- convertUrlToDataUrl: function( absUrl ) {
- var u = path.parseUrl( absUrl );
- if ( path.isEmbeddedPage( u ) ) {
- // For embedded pages, remove the dialog hash key as in getFilePath(),
- // otherwise the Data Url won't match the id of the embedded Page.
- return u.hash.split( dialogHashKey )[0].replace( /^#/, "" );
- } else if ( path.isSameDomain( u, documentBase ) ) {
- return u.hrefNoHash.replace( documentBase.domain, "" );
- }
- return absUrl;
- },
+ // If the default behavior is prevented, stop here!
+ if ( pblEvent.isDefaultPrevented() ) {
+ return deferred.promise();
+ }
- //get path from current hash, or from a file path
- get: function( newPath ) {
- if( newPath === undefined ) {
- newPath = location.hash;
- }
- return path.stripHash( newPath ).replace( /[^\/]*\.[^\/*]+$/, '' );
- },
+ if ( settings.showLoadMsg ) {
- //return the substring of a filepath before the sub-page key, for making a server request
- getFilePath: function( path ) {
- var splitkey = '&' + $.mobile.subPageUrlKey;
- return path && path.split( splitkey )[0].split( dialogHashKey )[0];
- },
+ // This configurable timeout allows cached pages a brief delay to load without showing a message
+ var loadMsgDelay = setTimeout(function() {
+ $.mobile.showPageLoadingMsg();
+ }, settings.loadMsgDelay ),
- //set location hash to path
- set: function( path ) {
- location.hash = path;
- },
+ // Shared logic for clearing timeout and removing message.
+ hideMsg = function() {
- //test if a given url (string) is a path
- //NOTE might be exceptionally naive
- isPath: function( url ) {
- return ( /\// ).test( url );
- },
+ // Stop message show timer
+ clearTimeout( loadMsgDelay );
- //return a url path with the window's location protocol/hostname/pathname removed
- clean: function( url ) {
- return url.replace( documentBase.domain, "" );
- },
+ // Hide loading message
+ $.mobile.hidePageLoadingMsg();
+ };
+ }
- //just return the url without an initial #
- stripHash: function( url ) {
- return url.replace( /^#/, "" );
- },
+ // Reset base to the default document base.
+ if ( base ) {
+ base.reset();
+ }
- //remove the preceding hash, any query params, and dialog notations
- cleanHash: function( hash ) {
- return path.stripHash( hash.replace( /\?.*$/, "" ).replace( dialogHashKey, "" ) );
- },
+ if ( !( $.mobile.allowCrossDomainPages || path.isSameDomain( documentUrl, absUrl ) ) ) {
+ deferred.reject( absUrl, options );
+ } else {
+ // Load the new page.
+ $.ajax({
+ url: fileUrl,
+ type: settings.type,
+ data: settings.data,
+ dataType: "html",
+ success: function( html, textStatus, xhr ) {
+ //pre-parse html to check for a data-url,
+ //use it as the new fileUrl, base path, etc
+ var all = $( "<div></div>" ),
- //check whether a url is referencing the same domain, or an external domain or different protocol
- //could be mailto, etc
- isExternal: function( url ) {
- var u = path.parseUrl( url );
- return u.protocol && u.domain !== documentUrl.domain ? true : false;
- },
+ //page title regexp
+ newPageTitle = html.match( /<title[^>]*>([^<]*)/ ) && RegExp.$1,
- hasProtocol: function( url ) {
- return ( /^(:?\w+:)/ ).test( url );
- },
+ // TODO handle dialogs again
+ pageElemRegex = new RegExp( "(<[^>]+\\bdata-" + $.mobile.ns + "role=[\"']?page[\"']?[^>]*>)" ),
+ dataUrlRegex = new RegExp( "\\bdata-" + $.mobile.ns + "url=[\"']?([^\"'>]*)[\"']?" );
- //check if the specified url refers to the first page in the main application document.
- isFirstPageUrl: function( url ) {
- // We only deal with absolute paths.
- var u = path.parseUrl( path.makeUrlAbsolute( url, documentBase ) ),
- // Does the url have the same path as the document?
- samePath = u.hrefNoHash === documentUrl.hrefNoHash || ( documentBaseDiffers && u.hrefNoHash === documentBase.hrefNoHash ),
+ // data-url must be provided for the base tag so resource requests can be directed to the
+ // correct url. loading into a temprorary element makes these requests immediately
+ if ( pageElemRegex.test( html ) &&
+ RegExp.$1 &&
+ dataUrlRegex.test( RegExp.$1 ) &&
+ RegExp.$1 ) {
+ url = fileUrl = path.getFilePath( $( "<div>" + RegExp.$1 + "</div>" ).text() );
+ }
- // Get the first page element.
- fp = $.mobile.firstPage,
+ if ( base ) {
+ base.set( fileUrl );
+ }
- // Get the id of the first page element if it has one.
- fpId = fp && fp[0] ? fp[0].id : undefined;
+ //workaround to allow scripts to execute when included in page divs
+ all.get( 0 ).innerHTML = html;
+ page = all.find( ":jqmData(role='page'), :jqmData(role='dialog')" ).first();
- // The url refers to the first page if the path matches the document and
- // it either has no hash value, or the hash is exactly equal to the id of the
- // first page element.
- return samePath && ( !u.hash || u.hash === "#" || ( fpId && u.hash.replace( /^#/, "" ) === fpId ) );
- },
+ //if page elem couldn't be found, create one and insert the body element's contents
+ if ( !page.length ) {
+ page = $( "<div data-" + $.mobile.ns + "role='page'>" + html.split( /<\/?body[^>]*>/gmi )[1] + "</div>" );
+ }
- isEmbeddedPage: function( url ) {
- var u = path.parseUrl( url );
+ if ( newPageTitle && !page.jqmData( "title" ) ) {
+ if ( ~newPageTitle.indexOf( "&" ) ) {
+ newPageTitle = $( "<div>" + newPageTitle + "</div>" ).text();
+ }
+ page.jqmData( "title", newPageTitle );
+ }
- //if the path is absolute, then we need to compare the url against
- //both the documentUrl and the documentBase. The main reason for this
- //is that links embedded within external documents will refer to the
- //application document, whereas links embedded within the application
- //document will be resolved against the document base.
- if ( u.protocol !== "" ) {
- return ( u.hash && ( u.hrefNoHash === documentUrl.hrefNoHash || ( documentBaseDiffers && u.hrefNoHash === documentBase.hrefNoHash ) ) );
- }
- return (/^#/).test( u.href );
- }
- },
+ //rewrite src and href attrs to use a base url
+ if ( !$.support.dynamicBaseTag ) {
+ var newPath = path.get( fileUrl );
+ page.find( "[src], link[href], a[rel='external'], :jqmData(ajax='false'), a[target]" ).each(function() {
+ var thisAttr = $( this ).is( '[href]' ) ? 'href' :
+ $( this ).is( '[src]' ) ? 'src' : 'action',
+ thisUrl = $( this ).attr( thisAttr );
- //will be defined when a link is clicked and given an active class
- $activeClickedLink = null,
+ // XXX_jblas: We need to fix this so that it removes the document
+ // base URL, and then prepends with the new page URL.
+ //if full path exists and is same, chop it - helps IE out
+ thisUrl = thisUrl.replace( location.protocol + '//' + location.host + location.pathname, '' );
- //urlHistory is purely here to make guesses at whether the back or forward button was clicked
- //and provide an appropriate transition
- urlHistory = {
- // Array of pages that are visited during a single page load.
- // Each has a url and optional transition, title, and pageUrl (which represents the file path, in cases where URL is obscured, such as dialogs)
- stack: [],
+ if ( !/^(\w+:|#|\/)/.test( thisUrl ) ) {
+ $( this ).attr( thisAttr, newPath + thisUrl );
+ }
+ });
+ }
- //maintain an index number for the active page in the stack
- activeIndex: 0,
+ //append to page and enhance
+ // TODO taging a page with external to make sure that embedded pages aren't removed
+ // by the various page handling code is bad. Having page handling code in many
+ // places is bad. Solutions post 1.0
+ page
+ .attr( "data-" + $.mobile.ns + "url", path.convertUrlToDataUrl( fileUrl ) )
+ .attr( "data-" + $.mobile.ns + "external-page", true )
+ .appendTo( settings.pageContainer );
- //get active
- getActive: function() {
- return urlHistory.stack[ urlHistory.activeIndex ];
- },
+ // wait for page creation to leverage options defined on widget
+ page.one( 'pagecreate', $.mobile._bindPageRemove );
- getPrev: function() {
- return urlHistory.stack[ urlHistory.activeIndex - 1 ];
- },
+ enhancePage( page, settings.role );
- getNext: function() {
- return urlHistory.stack[ urlHistory.activeIndex + 1 ];
- },
+ // Enhancing the page may result in new dialogs/sub pages being inserted
+ // into the DOM. If the original absUrl refers to a sub-page, that is the
+ // real page we are interested in.
+ if ( absUrl.indexOf( "&" + $.mobile.subPageUrlKey ) > -1 ) {
+ page = settings.pageContainer.children( "[data-" + $.mobile.ns +"url='" + dataUrl + "']" );
+ }
+
+ //bind pageHide to removePage after it's hidden, if the page options specify to do so
+
+ // Remove loading message.
+ if ( settings.showLoadMsg ) {
+ hideMsg();
+ }
- // addNew is used whenever a new page is added
- addNew: function( url, transition, title, pageUrl, role ) {
- //if there's forward history, wipe it
- if( urlHistory.getNext() ) {
- urlHistory.clearForward();
- }
+ // Add the page reference and xhr to our triggerData.
+ triggerData.xhr = xhr;
+ triggerData.textStatus = textStatus;
+ triggerData.page = page;
- urlHistory.stack.push( {url : url, transition: transition, title: title, pageUrl: pageUrl, role: role } );
+ // Let listeners know the page loaded successfully.
+ settings.pageContainer.trigger( "pageload", triggerData );
- urlHistory.activeIndex = urlHistory.stack.length - 1;
- },
+ deferred.resolve( absUrl, options, page, dupCachedPage );
+ },
+ error: function( xhr, textStatus, errorThrown ) {
+ //set base back to current path
+ if ( base ) {
+ base.set( path.get() );
+ }
- //wipe urls ahead of active index
- clearForward: function() {
- urlHistory.stack = urlHistory.stack.slice( 0, urlHistory.activeIndex + 1 );
- },
+ // Add error info to our triggerData.
+ triggerData.xhr = xhr;
+ triggerData.textStatus = textStatus;
+ triggerData.errorThrown = errorThrown;
- directHashChange: function( opts ) {
- var back , forward, newActiveIndex, prev = this.getActive();
+ var plfEvent = new $.Event( "pageloadfailed" );
- // check if url isp in history and if it's ahead or behind current page
- $.each( urlHistory.stack, function( i, historyEntry ) {
+ // Let listeners know the page load failed.
+ settings.pageContainer.trigger( plfEvent, triggerData );
- //if the url is in the stack, it's a forward or a back
- if( opts.currentUrl === historyEntry.url ) {
- //define back and forward by whether url is older or newer than current page
- back = i < urlHistory.activeIndex;
- forward = !back;
- newActiveIndex = i;
+ // If the default behavior is prevented, stop here!
+ // Note that it is the responsibility of the listener/handler
+ // that called preventDefault(), to resolve/reject the
+ // deferred object within the triggerData.
+ if ( plfEvent.isDefaultPrevented() ) {
+ return;
}
- });
- // save new page index, null check to prevent falsey 0 result
- this.activeIndex = newActiveIndex !== undefined ? newActiveIndex : this.activeIndex;
+ // Remove loading message.
+ if ( settings.showLoadMsg ) {
- if( back ) {
- ( opts.either || opts.isBack )( true );
- } else if( forward ) {
- ( opts.either || opts.isForward )( false );
- }
- },
+ // Remove loading message.
+ hideMsg();
- //disable hashchange event listener internally to ignore one change
- //toggled internally when location.hash is updated to match the url of a successful page load
- ignoreNextHashChange: false
- },
+ // show error message
+ $.mobile.showPageLoadingMsg( $.mobile.pageLoadErrorMessageTheme, $.mobile.pageLoadErrorMessage, true );
- //define first selector to receive focus when a page is shown
- focusable = "[tabindex],a,button:visible,select:visible,input",
+ // hide after delay
+ setTimeout( $.mobile.hidePageLoadingMsg, 1500 );
+ }
- //queue to hold simultanious page transitions
- pageTransitionQueue = [],
+ deferred.reject( absUrl, options );
+ }
+ });
+ }
- //indicates whether or not page is in process of transitioning
- isPageTransitioning = false,
+ return deferred.promise();
+ };
- //nonsense hash change key for dialogs, so they create a history entry
- dialogHashKey = "&ui-state=dialog",
+ $.mobile.loadPage.defaults = {
+ type: "get",
+ data: undefined,
+ reloadPage: false,
+ role: undefined, // By default we rely on the role defined by the @data-role attribute.
+ showLoadMsg: false,
+ pageContainer: undefined,
+ loadMsgDelay: 50 // This delay allows loads that pull from browser cache to occur without showing the loading message.
+ };
- //existing base tag?
- $base = $head.children( "base" ),
+ // Show a specific page in the page container.
+ $.mobile.changePage = function( toPage, options ) {
+ // If we are in the midst of a transition, queue the current request.
+ // We'll call changePage() once we're done with the current transition to
+ // service the request.
+ if ( isPageTransitioning ) {
+ pageTransitionQueue.unshift( arguments );
+ return;
+ }
- //tuck away the original document URL minus any fragment.
- documentUrl = path.parseUrl( location.href ),
+ var settings = $.extend( {}, $.mobile.changePage.defaults, options );
- //if the document has an embedded base tag, documentBase is set to its
- //initial value. If a base tag does not exist, then we default to the documentUrl.
- documentBase = $base.length ? path.parseUrl( path.makeUrlAbsolute( $base.attr( "href" ), documentUrl.href ) ) : documentUrl,
+ // Make sure we have a pageContainer to work with.
+ settings.pageContainer = settings.pageContainer || $.mobile.pageContainer;
- //cache the comparison once.
- documentBaseDiffers = ( documentUrl.hrefNoHash !== documentBase.hrefNoHash );
+ // Make sure we have a fromPage.
+ settings.fromPage = settings.fromPage || $.mobile.activePage;
- //base element management, defined depending on dynamic base tag support
- var base = $.support.dynamicBaseTag ? {
+ var mpc = settings.pageContainer,
+ pbcEvent = new $.Event( "pagebeforechange" ),
+ triggerData = { toPage: toPage, options: settings };
- //define base element, for use in routing asset urls that are referenced in Ajax-requested markup
- element: ( $base.length ? $base : $( "<base>", { href: documentBase.hrefNoHash } ).prependTo( $head ) ),
+ // Let listeners know we're about to change the current page.
+ mpc.trigger( pbcEvent, triggerData );
- //set the generated BASE element's href attribute to a new page's base path
- set: function( href ) {
- base.element.attr( "href", path.makeUrlAbsolute( href, documentBase ) );
- },
+ // If the default behavior is prevented, stop here!
+ if ( pbcEvent.isDefaultPrevented() ) {
+ return;
+ }
- //set the generated BASE element's href attribute to a new page's base path
- reset: function() {
- base.element.attr( "href", documentBase.hrefNoHash );
- }
+ // We allow "pagebeforechange" observers to modify the toPage in the trigger
+ // data to allow for redirects. Make sure our toPage is updated.
- } : undefined;
+ toPage = triggerData.toPage;
-/*
- internal utility functions
---------------------------------------*/
+ // Set the isPageTransitioning flag to prevent any requests from
+ // entering this method while we are in the midst of loading a page
+ // or transitioning.
+ isPageTransitioning = true;
- //direct focus to the page title, or otherwise first focusable element
- $.mobile.focusPage = function ( page ) {
- var autofocus = page.find("[autofocus]"),
- pageTitle = page.find( ".ui-title:eq(0)" );
+ // If the caller passed us a url, call loadPage()
+ // to make sure it is loaded into the DOM. We'll listen
+ // to the promise object it returns so we know when
+ // it is done loading or if an error ocurred.
+ if ( typeof toPage === "string" ) {
+ $.mobile.loadPage( toPage, settings )
+ .done(function( url, options, newPage, dupCachedPage ) {
+ isPageTransitioning = false;
+ options.duplicateCachedPage = dupCachedPage;
+ $.mobile.changePage( newPage, options );
+ })
+ .fail(function( url, options ) {
+ isPageTransitioning = false;
- if( autofocus.length ) {
- autofocus.focus();
+ //clear out the active button state
+ removeActiveLinkClass( true );
+
+ //release transition lock so navigation is free again
+ releasePageTransitionLock();
+ settings.pageContainer.trigger( "pagechangefailed", triggerData );
+ });
return;
}
- if( pageTitle.length ) {
- pageTitle.focus();
- }
- else{
- page.focus();
+ // If we are going to the first-page of the application, we need to make
+ // sure settings.dataUrl is set to the application document url. This allows
+ // us to avoid generating a document url with an id hash in the case where the
+ // first-page of the document has an id attribute specified.
+ if ( toPage[ 0 ] === $.mobile.firstPage[ 0 ] && !settings.dataUrl ) {
+ settings.dataUrl = documentUrl.hrefNoHash;
}
- }
- //remove active classes after page transition or error
- function removeActiveLinkClass( forceRemoval ) {
- if( !!$activeClickedLink && ( !$activeClickedLink.closest( '.ui-page-active' ).length || forceRemoval ) ) {
- $activeClickedLink.removeClass( $.mobile.activeBtnClass );
- }
- $activeClickedLink = null;
- }
+ // The caller passed us a real page DOM element. Update our
+ // internal state and then trigger a transition to the page.
+ var fromPage = settings.fromPage,
+ url = ( settings.dataUrl && path.convertUrlToDataUrl( settings.dataUrl ) ) || toPage.jqmData( "url" ),
+ // The pageUrl var is usually the same as url, except when url is obscured as a dialog url. pageUrl always contains the file path
+ pageUrl = url,
+ fileUrl = path.getFilePath( url ),
+ active = urlHistory.getActive(),
+ activeIsInitialPage = urlHistory.activeIndex === 0,
+ historyDir = 0,
+ pageTitle = document.title,
+ isDialog = settings.role === "dialog" || toPage.jqmData( "role" ) === "dialog";
- function releasePageTransitionLock() {
- isPageTransitioning = false;
- if( pageTransitionQueue.length > 0 ) {
- $.mobile.changePage.apply( null, pageTransitionQueue.pop() );
- }
- }
+ // By default, we prevent changePage requests when the fromPage and toPage
+ // are the same element, but folks that generate content manually/dynamically
+ // and reuse pages want to be able to transition to the same page. To allow
+ // this, they will need to change the default value of allowSamePageTransition
+ // to true, *OR*, pass it in as an option when they manually call changePage().
+ // It should be noted that our default transition animations assume that the
+ // formPage and toPage are different elements, so they may behave unexpectedly.
+ // It is up to the developer that turns on the allowSamePageTransitiona option
+ // to either turn off transition animations, or make sure that an appropriate
+ // animation transition is used.
+ if ( fromPage && fromPage[0] === toPage[0] && !settings.allowSamePageTransition ) {
+ isPageTransitioning = false;
+ mpc.trigger( "pagechange", triggerData );
- // Save the last scroll distance per page, before it is hidden
- var setLastScrollEnabled = true,
- setLastScroll, delayedSetLastScroll;
+ // Even if there is no page change to be done, we should keep the urlHistory in sync with the hash changes
+ if ( settings.fromHashChange ) {
+ urlHistory.directHashChange({
+ currentUrl: url,
+ isBack: function() {},
+ isForward: function() {}
+ });
+ }
- setLastScroll = function() {
- // this barrier prevents setting the scroll value based on the browser
- // scrolling the window based on a hashchange
- if( !setLastScrollEnabled ) {
return;
}
- var active = $.mobile.urlHistory.getActive();
-
- if( active ) {
- var lastScroll = $window.scrollTop();
+ // We need to make sure the page we are given has already been enhanced.
+ enhancePage( toPage, settings.role );
- // Set active page's lastScroll prop.
- // If the location we're scrolling to is less than minScrollBack, let it go.
- active.lastScroll = lastScroll < $.mobile.minScrollBack ? $.mobile.defaultHomeScroll : lastScroll;
+ // If the changePage request was sent from a hashChange event, check to see if the
+ // page is already within the urlHistory stack. If so, we'll assume the user hit
+ // the forward/back button and will try to match the transition accordingly.
+ if ( settings.fromHashChange ) {
+ urlHistory.directHashChange({
+ currentUrl: url,
+ isBack: function() { historyDir = -1; },
+ isForward: function() { historyDir = 1; }
+ });
}
- };
-
- // bind to scrollstop to gather scroll position. The delay allows for the hashchange
- // event to fire and disable scroll recording in the case where the browser scrolls
- // to the hash targets location (sometimes the top of the page). once pagechange fires
- // getLastScroll is again permitted to operate
- delayedSetLastScroll = function() {
- setTimeout( setLastScroll, 100 );
- };
-
- // disable an scroll setting when a hashchange has been fired, this only works
- // because the recording of the scroll position is delayed for 100ms after
- // the browser might have changed the position because of the hashchange
- $window.bind( $.support.pushState ? "popstate" : "hashchange", function() {
- setLastScrollEnabled = false;
- });
- // handle initial hashchange from chrome :(
- $window.one( $.support.pushState ? "popstate" : "hashchange", function() {
- setLastScrollEnabled = true;
- });
+ // Kill the keyboard.
+ // XXX_jblas: We need to stop crawling the entire document to kill focus. Instead,
+ // we should be tracking focus with a delegate() handler so we already have
+ // the element in hand at this point.
+ // Wrap this in a try/catch block since IE9 throw "Unspecified error" if document.activeElement
+ // is undefined when we are in an IFrame.
+ try {
+ if ( document.activeElement && document.activeElement.nodeName.toLowerCase() !== 'body' ) {
+ $( document.activeElement ).blur();
+ } else {
+ $( "input:focus, textarea:focus, select:focus" ).blur();
+ }
+ } catch( e ) {}
- // wait until the mobile page container has been determined to bind to pagechange
- $window.one( "pagecontainercreate", function(){
- // once the page has changed, re-enable the scroll recording
- $.mobile.pageContainer.bind( "pagechange", function() {
+ // Record whether we are at a place in history where a dialog used to be - if so, do not add a new history entry and do not change the hash either
+ var alreadyThere = false;
- setLastScrollEnabled = true;
+ // If we're displaying the page as a dialog, we don't want the url
+ // for the dialog content to be used in the hash. Instead, we want
+ // to append the dialogHashKey to the url of the current page.
+ if ( isDialog && active ) {
+ // on the initial page load active.url is undefined and in that case should
+ // be an empty string. Moving the undefined -> empty string back into
+ // urlHistory.addNew seemed imprudent given undefined better represents
+ // the url state
- // remove any binding that previously existed on the get scroll
- // which may or may not be different than the scroll element determined for
- // this page previously
- $window.unbind( "scrollstop", delayedSetLastScroll );
+ // If we are at a place in history that once belonged to a dialog, reuse
+ // this state without adding to urlHistory and without modifying the hash.
+ // However, if a dialog is already displayed at this point, and we're
+ // about to display another dialog, then we must add another hash and
+ // history entry on top so that one may navigate back to the original dialog
+ if ( active.url.indexOf( dialogHashKey ) > -1 && !$.mobile.activePage.is( ".ui-dialog" ) ) {
+ settings.changeHash = false;
+ alreadyThere = true;
+ }
- // determine and bind to the current scoll element which may be the window
- // or in the case of touch overflow the element with touch overflow
- $window.bind( "scrollstop", delayedSetLastScroll );
- });
- });
+ // Normally, we tack on a dialog hash key, but if this is the location of a stale dialog,
+ // we reuse the URL from the entry
+ url = ( active.url || "" ) + ( alreadyThere ? "" : dialogHashKey );
- // bind to scrollstop for the first page as "pagechange" won't be fired in that case
- $window.bind( "scrollstop", delayedSetLastScroll );
+ // tack on another dialogHashKey if this is the same as the initial hash
+ // this makes sure that a history entry is created for this dialog
+ if ( urlHistory.activeIndex === 0 && url === urlHistory.initialDst ) {
+ url += dialogHashKey;
+ }
+ }
- //function for transitioning between two existing pages
- function transitionPages( toPage, fromPage, transition, reverse ) {
+ // Set the location hash.
+ if ( settings.changeHash !== false && url ) {
+ //disable hash listening temporarily
+ urlHistory.ignoreNextHashChange = true;
+ //update hash and history
+ path.set( url );
+ }
- if( fromPage ) {
- //trigger before show/hide events
- fromPage.data( "page" )._trigger( "beforehide", null, { nextPage: toPage } );
+ // if title element wasn't found, try the page div data attr too
+ // If this is a deep-link or a reload ( active === undefined ) then just use pageTitle
+ var newPageTitle = ( !active )? pageTitle : toPage.jqmData( "title" ) || toPage.children( ":jqmData(role='header')" ).find( ".ui-title" ).getEncodedText();
+ if ( !!newPageTitle && pageTitle === document.title ) {
+ pageTitle = newPageTitle;
+ }
+ if ( !toPage.jqmData( "title" ) ) {
+ toPage.jqmData( "title", pageTitle );
}
- toPage.data( "page" )._trigger( "beforeshow", null, { prevPage: fromPage || $( "" ) } );
+ // Make sure we have a transition defined.
+ settings.transition = settings.transition ||
+ ( ( historyDir && !activeIsInitialPage ) ? active.transition : undefined ) ||
+ ( isDialog ? $.mobile.defaultDialogTransition : $.mobile.defaultPageTransition );
- //clear page loader
- $.mobile.hidePageLoadingMsg();
-
- // If transition is defined, check if css 3D transforms are supported, and if not, if a fallback is specified
- if( transition && !$.support.cssTransform3d && $.mobile.transitionFallbacks[ transition ] ){
- transition = $.mobile.transitionFallbacks[ transition ];
+ //add page to history stack if it's not back or forward
+ if ( !historyDir ) {
+ // Overwrite the current entry if it's a leftover from a dialog
+ if ( alreadyThere ) {
+ urlHistory.activeIndex = Math.max( 0, urlHistory.activeIndex - 1 );
+ }
+ urlHistory.addNew( url, settings.transition, pageTitle, pageUrl, settings.role );
}
-
- //find the transition handler for the specified transition. If there
- //isn't one in our transitionHandlers dictionary, use the default one.
- //call the handler immediately to kick-off the transition.
- var th = $.mobile.transitionHandlers[ transition || "default" ] || $.mobile.defaultTransitionHandler,
- promise = th( transition, reverse, toPage, fromPage );
- promise.done(function() {
+ //set page title
+ document.title = urlHistory.getActive().title;
- //trigger show/hide events
- if( fromPage ) {
- fromPage.data( "page" )._trigger( "hide", null, { nextPage: toPage } );
- }
+ //set "toPage" as activePage
+ $.mobile.activePage = toPage;
- //trigger pageshow, define prevPage as either fromPage or empty jQuery obj
- toPage.data( "page" )._trigger( "show", null, { prevPage: fromPage || $( "" ) } );
- });
+ // If we're navigating back in the URL history, set reverse accordingly.
+ settings.reverse = settings.reverse || historyDir < 0;
- return promise;
- }
+ transitionPages( toPage, fromPage, settings.transition, settings.reverse )
+ .done(function( name, reverse, $to, $from, alreadyFocused ) {
+ removeActiveLinkClass();
- //simply set the active page's minimum height to screen height, depending on orientation
- function getScreenHeight(){
- // Native innerHeight returns more accurate value for this across platforms,
- // jQuery version is here as a normalized fallback for platforms like Symbian
- return window.innerHeight || $( window ).height();
- }
+ //if there's a duplicateCachedPage, remove it from the DOM now that it's hidden
+ if ( settings.duplicateCachedPage ) {
+ settings.duplicateCachedPage.remove();
+ }
- $.mobile.getScreenHeight = getScreenHeight;
+ // Send focus to the newly shown page. Moved from promise .done binding in transitionPages
+ // itself to avoid ie bug that reports offsetWidth as > 0 (core check for visibility)
+ // despite visibility: hidden addresses issue #2965
+ // https://github.com/jquery/jquery-mobile/issues/2965
+ if ( !alreadyFocused ) {
+ $.mobile.focusPage( toPage );
+ }
- //simply set the active page's minimum height to screen height, depending on orientation
- function resetActivePageHeight(){
- var aPage = $( "." + $.mobile.activePageClass ),
- aPagePadT = parseFloat( aPage.css( "padding-top" ) ),
- aPagePadB = parseFloat( aPage.css( "padding-bottom" ) );
-
- aPage.css( "min-height", getScreenHeight() - aPagePadT - aPagePadB );
- }
+ releasePageTransitionLock();
- //shared page enhancements
- function enhancePage( $page, role ) {
- // If a role was specified, make sure the data-role attribute
- // on the page element is in sync.
- if( role ) {
- $page.attr( "data-" + $.mobile.ns + "role", role );
- }
+ // Let listeners know we're all done changing the current page.
+ mpc.trigger( "pagechange", triggerData );
+ });
+ };
- //run page plugin
- $page.page();
+ $.mobile.changePage.defaults = {
+ transition: undefined,
+ reverse: false,
+ changeHash: true,
+ fromHashChange: false,
+ role: undefined, // By default we rely on the role defined by the @data-role attribute.
+ duplicateCachedPage: undefined,
+ pageContainer: undefined,
+ showLoadMsg: true, //loading message shows by default when pages are being fetched during changePage
+ dataUrl: undefined,
+ fromPage: undefined,
+ allowSamePageTransition: false
+ };
+
+/* Event Bindings - hashchange, submit, and click */
+ function findClosestLink( ele )
+ {
+ while ( ele ) {
+ // Look for the closest element with a nodeName of "a".
+ // Note that we are checking if we have a valid nodeName
+ // before attempting to access it. This is because the
+ // node we get called with could have originated from within
+ // an embedded SVG document where some symbol instance elements
+ // don't have nodeName defined on them, or strings are of type
+ // SVGAnimatedString.
+ if ( ( typeof ele.nodeName === "string" ) && ele.nodeName.toLowerCase() === "a" ) {
+ break;
+ }
+ ele = ele.parentNode;
+ }
+ return ele;
}
-/* exposed $.mobile methods */
+ // The base URL for any given element depends on the page it resides in.
+ function getClosestBaseUrl( ele )
+ {
+ // Find the closest page and extract out its url.
+ var url = $( ele ).closest( ".ui-page" ).jqmData( "url" ),
+ base = documentBase.hrefNoHash;
- //animation complete callback
- $.fn.animationComplete = function( callback ) {
- if( $.support.cssTransitions ) {
- return $( this ).one( 'webkitAnimationEnd animationend', callback );
- }
- else{
- // defer execution for consistency between webkit/non webkit
- setTimeout( callback, 0 );
- return $( this );
+ if ( !url || !path.isPath( url ) ) {
+ url = base;
}
- };
- //expose path object on $.mobile
- $.mobile.path = path;
+ return path.makeUrlAbsolute( url, base);
+ }
- //expose base object on $.mobile
- $.mobile.base = base;
+ //The following event bindings should be bound after mobileinit has been triggered
+ //the following deferred is resolved in the init file
+ $.mobile.navreadyDeferred = $.Deferred();
+ $.mobile.navreadyDeferred.done(function() {
+ //bind to form submit events, handle with Ajax
+ $( document ).delegate( "form", "submit", function( event ) {
+ var $this = $( this );
- //history stack
- $.mobile.urlHistory = urlHistory;
+ if ( !$.mobile.ajaxEnabled ||
+ // test that the form is, itself, ajax false
+ $this.is( ":jqmData(ajax='false')" ) ||
+ // test that $.mobile.ignoreContentEnabled is set and
+ // the form or one of it's parents is ajax=false
+ !$this.jqmHijackable().length ) {
+ return;
+ }
- $.mobile.dialogHashKey = dialogHashKey;
+ var type = $this.attr( "method" ),
+ target = $this.attr( "target" ),
+ url = $this.attr( "action" );
+
+ // If no action is specified, browsers default to using the
+ // URL of the document containing the form. Since we dynamically
+ // pull in pages from external documents, the form should submit
+ // to the URL for the source document of the page containing
+ // the form.
+ if ( !url ) {
+ // Get the @data-url for the page containing the form.
+ url = getClosestBaseUrl( $this );
+ if ( url === documentBase.hrefNoHash ) {
+ // The url we got back matches the document base,
+ // which means the page must be an internal/embedded page,
+ // so default to using the actual document url as a browser
+ // would.
+ url = documentUrl.hrefNoSearch;
+ }
+ }
+ url = path.makeUrlAbsolute( url, getClosestBaseUrl( $this ) );
+ if ( ( path.isExternal( url ) && !path.isPermittedCrossDomainRequest( documentUrl, url ) ) || target ) {
+ return;
+ }
- //enable cross-domain page support
- $.mobile.allowCrossDomainPages = false;
+ $.mobile.changePage(
+ url,
+ {
+ type: type && type.length && type.toLowerCase() || "get",
+ data: $this.serialize(),
+ transition: $this.jqmData( "transition" ),
+ reverse: $this.jqmData( "direction" ) === "reverse",
+ reloadPage: true
+ }
+ );
+ event.preventDefault();
+ });
- //return the original document url
- $.mobile.getDocumentUrl = function(asParsedObject) {
- return asParsedObject ? $.extend( {}, documentUrl ) : documentUrl.href;
- };
+ //add active state on vclick
+ $( document ).bind( "vclick", function( event ) {
+ // if this isn't a left click we don't care. Its important to note
+ // that when the virtual event is generated it will create the which attr
+ if ( event.which > 1 || !$.mobile.linkBindingEnabled ) {
+ return;
+ }
- //return the original document base url
- $.mobile.getDocumentBase = function(asParsedObject) {
- return asParsedObject ? $.extend( {}, documentBase ) : documentBase.href;
- };
+ var link = findClosestLink( event.target );
- $.mobile._bindPageRemove = function() {
- var page = $(this);
+ // split from the previous return logic to avoid find closest where possible
+ // TODO teach $.mobile.hijackable to operate on raw dom elements so the link wrapping
+ // can be avoided
+ if ( !$( link ).jqmHijackable().length ) {
+ return;
+ }
- // when dom caching is not enabled or the page is embedded bind to remove the page on hide
- if( !page.data("page").options.domCache
- && page.is(":jqmData(external-page='true')") ) {
+ if ( link ) {
+ if ( path.parseUrl( link.getAttribute( "href" ) || "#" ).hash !== "#" ) {
+ removeActiveLinkClass( true );
+ $activeClickedLink = $( link ).closest( ".ui-btn" ).not( ".ui-disabled" );
+ $activeClickedLink.addClass( $.mobile.activeBtnClass );
+ }
+ }
+ });
- page.bind( 'pagehide.remove', function() {
- var $this = $( this ),
- prEvent = new $.Event( "pageremove" );
+ // click routing - direct to HTTP or Ajax, accordingly
+ $( document ).bind( "click", function( event ) {
+ if ( !$.mobile.linkBindingEnabled ) {
+ return;
+ }
- $this.trigger( prEvent );
+ var link = findClosestLink( event.target ), $link = $( link ), httpCleanup;
+
+ // If there is no link associated with the click or its not a left
+ // click we want to ignore the click
+ // TODO teach $.mobile.hijackable to operate on raw dom elements so the link wrapping
+ // can be avoided
+ if ( !link || event.which > 1 || !$link.jqmHijackable().length ) {
+ return;
+ }
- if( !prEvent.isDefaultPrevented() ){
- $this.removeWithDependents();
- }
- });
- }
- };
+ //remove active link class if external (then it won't be there if you come back)
+ httpCleanup = function() {
+ window.setTimeout(function() { removeActiveLinkClass( true ); }, 200 );
+ };
- // Load a page into the DOM.
- $.mobile.loadPage = function( url, options ) {
- // This function uses deferred notifications to let callers
- // know when the page is done loading, or if an error has occurred.
- var deferred = $.Deferred(),
+ //if there's a data-rel=back attr, go back in history
+ if ( $link.is( ":jqmData(rel='back')" ) ) {
+ $.mobile.back();
+ return false;
+ }
- // The default loadPage options with overrides specified by
- // the caller.
- settings = $.extend( {}, $.mobile.loadPage.defaults, options ),
+ var baseUrl = getClosestBaseUrl( $link ),
- // The DOM element for the page after it has been loaded.
- page = null,
+ //get href, if defined, otherwise default to empty hash
+ href = path.makeUrlAbsolute( $link.attr( "href" ) || "#", baseUrl );
- // If the reloadPage option is true, and the page is already
- // in the DOM, dupCachedPage will be set to the page element
- // so that it can be removed after the new version of the
- // page is loaded off the network.
- dupCachedPage = null,
+ //if ajax is disabled, exit early
+ if ( !$.mobile.ajaxEnabled && !path.isEmbeddedPage( href ) ) {
+ httpCleanup();
+ //use default click handling
+ return;
+ }
- // determine the current base url
- findBaseWithDefault = function(){
- var closestBase = ( $.mobile.activePage && getClosestBaseUrl( $.mobile.activePage ) );
- return closestBase || documentBase.hrefNoHash;
- },
+ // XXX_jblas: Ideally links to application pages should be specified as
+ // an url to the application document with a hash that is either
+ // the site relative path or id to the page. But some of the
+ // internal code that dynamically generates sub-pages for nested
+ // lists and select dialogs, just write a hash in the link they
+ // create. This means the actual URL path is based on whatever
+ // the current value of the base tag is at the time this code
+ // is called. For now we are just assuming that any url with a
+ // hash in it is an application page reference.
+ if ( href.search( "#" ) !== -1 ) {
+ href = href.replace( /[^#]*#/, "" );
+ if ( !href ) {
+ //link was an empty hash meant purely
+ //for interaction, so we ignore it.
+ event.preventDefault();
+ return;
+ } else if ( path.isPath( href ) ) {
+ //we have apath so make it the href we want to load.
+ href = path.makeUrlAbsolute( href, baseUrl );
+ } else {
+ //we have a simple id so use the documentUrl as its base.
+ href = path.makeUrlAbsolute( "#" + href, documentUrl.hrefNoHash );
+ }
+ }
- // The absolute version of the URL passed into the function. This
- // version of the URL may contain dialog/subpage params in it.
- absUrl = path.makeUrlAbsolute( url, findBaseWithDefault() );
+ // Should we handle this link, or let the browser deal with it?
+ var useDefaultUrlHandling = $link.is( "[rel='external']" ) || $link.is( ":jqmData(ajax='false')" ) || $link.is( "[target]" ),
+ // Some embedded browsers, like the web view in Phone Gap, allow cross-domain XHR
+ // requests if the document doing the request was loaded via the file:// protocol.
+ // This is usually to allow the application to "phone home" and fetch app specific
+ // data. We normally let the browser handle external/cross-domain urls, but if the
+ // allowCrossDomainPages option is true, we will allow cross-domain http/https
+ // requests to go through our page loading logic.
- // If the caller provided data, and we're using "get" request,
- // append the data to the URL.
- if ( settings.data && settings.type === "get" ) {
- absUrl = path.addSearchParams( absUrl, settings.data );
- settings.data = undefined;
- }
+ //check for protocol or rel and its not an embedded page
+ //TODO overlap in logic from isExternal, rel=external check should be
+ // moved into more comprehensive isExternalLink
+ isExternal = useDefaultUrlHandling || ( path.isExternal( href ) && !path.isPermittedCrossDomainRequest( documentUrl, href ) );
- // If the caller is using a "post" request, reloadPage must be true
- if( settings.data && settings.type === "post" ){
- settings.reloadPage = true;
- }
+ if ( isExternal ) {
+ httpCleanup();
+ //use default click handling
+ return;
+ }
- // The absolute version of the URL minus any dialog/subpage params.
- // In otherwords the real URL of the page to be loaded.
- var fileUrl = path.getFilePath( absUrl ),
+ //use ajax
+ var transition = $link.jqmData( "transition" ),
+ reverse = $link.jqmData( "direction" ) === "reverse" ||
+ // deprecated - remove by 1.0
+ $link.jqmData( "back" ),
- // The version of the Url actually stored in the data-url attribute of
- // the page. For embedded pages, it is just the id of the page. For pages
- // within the same domain as the document base, it is the site relative
- // path. For cross-domain pages (Phone Gap only) the entire absolute Url
- // used to load the page.
- dataUrl = path.convertUrlToDataUrl( absUrl );
+ //this may need to be more specific as we use data-rel more
+ role = $link.attr( "data-" + $.mobile.ns + "rel" ) || undefined;
- // Make sure we have a pageContainer to work with.
- settings.pageContainer = settings.pageContainer || $.mobile.pageContainer;
+ $.mobile.changePage( href, { transition: transition, reverse: reverse, role: role, link: $link } );
+ event.preventDefault();
+ });
- // Check to see if the page already exists in the DOM.
- page = settings.pageContainer.children( ":jqmData(url='" + dataUrl + "')" );
+ //prefetch pages when anchors with data-prefetch are encountered
+ $( document ).delegate( ".ui-page", "pageshow.prefetch", function() {
+ var urls = [];
+ $( this ).find( "a:jqmData(prefetch)" ).each(function() {
+ var $link = $( this ),
+ url = $link.attr( "href" );
- // If we failed to find the page, check to see if the url is a
- // reference to an embedded page. If so, it may have been dynamically
- // injected by a developer, in which case it would be lacking a data-url
- // attribute and in need of enhancement.
- if ( page.length === 0 && dataUrl && !path.isPath( dataUrl ) ) {
- page = settings.pageContainer.children( "#" + dataUrl )
- .attr( "data-" + $.mobile.ns + "url", dataUrl );
- }
+ if ( url && $.inArray( url, urls ) === -1 ) {
+ urls.push( url );
- // If we failed to find a page in the DOM, check the URL to see if it
- // refers to the first page in the application. If it isn't a reference
- // to the first page and refers to non-existent embedded page, error out.
- if ( page.length === 0 ) {
- if ( $.mobile.firstPage && path.isFirstPageUrl( fileUrl ) ) {
- // Check to make sure our cached-first-page is actually
- // in the DOM. Some user deployed apps are pruning the first
- // page from the DOM for various reasons, we check for this
- // case here because we don't want a first-page with an id
- // falling through to the non-existent embedded page error
- // case. If the first-page is not in the DOM, then we let
- // things fall through to the ajax loading code below so
- // that it gets reloaded.
- if ( $.mobile.firstPage.parent().length ) {
- page = $( $.mobile.firstPage );
+ $.mobile.loadPage( url, { role: $link.attr( "data-" + $.mobile.ns + "rel" ) } );
}
- } else if ( path.isEmbeddedPage( fileUrl ) ) {
- deferred.reject( absUrl, options );
- return deferred.promise();
- }
- }
+ });
+ });
- // Reset base to the default document base.
- if ( base ) {
- base.reset();
- }
+ $.mobile._handleHashChange = function( hash ) {
+ //find first page via hash
+ var to = path.stripHash( hash ),
+ //transition is false if it's the first page, undefined otherwise (and may be overridden by default)
+ transition = $.mobile.urlHistory.stack.length === 0 ? "none" : undefined,
- // If the page we are interested in is already in the DOM,
- // and the caller did not indicate that we should force a
- // reload of the file, we are done. Otherwise, track the
- // existing page as a duplicated.
- if ( page.length ) {
- if ( !settings.reloadPage ) {
- enhancePage( page, settings.role );
- deferred.resolve( absUrl, options, page );
- return deferred.promise();
- }
- dupCachedPage = page;
- }
+ // "navigate" event fired to allow others to take advantage of the more robust hashchange handling
+ navEvent = new $.Event( "navigate" ),
- var mpc = settings.pageContainer,
- pblEvent = new $.Event( "pagebeforeload" ),
- triggerData = { url: url, absUrl: absUrl, dataUrl: dataUrl, deferred: deferred, options: settings };
+ // default options for the changPage calls made after examining the current state
+ // of the page and the hash
+ changePageOptions = {
+ transition: transition,
+ changeHash: false,
+ fromHashChange: true
+ };
- // Let listeners know we're about to load a page.
- mpc.trigger( pblEvent, triggerData );
+ if ( 0 === urlHistory.stack.length ) {
+ urlHistory.initialDst = to;
+ }
- // If the default behavior is prevented, stop here!
- if( pblEvent.isDefaultPrevented() ){
- return deferred.promise();
- }
+ // We should probably fire the "navigate" event from those places that make calls to _handleHashChange,
+ // and have _handleHashChange hook into the "navigate" event instead of triggering it here
+ $.mobile.pageContainer.trigger( navEvent );
+ if ( navEvent.isDefaultPrevented() ) {
+ return;
+ }
- if ( settings.showLoadMsg ) {
+ //if listening is disabled (either globally or temporarily), or it's a dialog hash
+ if ( !$.mobile.hashListeningEnabled || urlHistory.ignoreNextHashChange ) {
+ urlHistory.ignoreNextHashChange = false;
+ return;
+ }
- // This configurable timeout allows cached pages a brief delay to load without showing a message
- var loadMsgDelay = setTimeout(function(){
- $.mobile.showPageLoadingMsg();
- }, settings.loadMsgDelay ),
+ // special case for dialogs
+ if ( urlHistory.stack.length > 1 && to.indexOf( dialogHashKey ) > -1 && urlHistory.initialDst !== to ) {
- // Shared logic for clearing timeout and removing message.
- hideMsg = function(){
+ // If current active page is not a dialog skip the dialog and continue
+ // in the same direction
+ if ( !$.mobile.activePage.is( ".ui-dialog" ) ) {
+ //determine if we're heading forward or backward and continue accordingly past
+ //the current dialog
+ urlHistory.directHashChange({
+ currentUrl: to,
+ isBack: function() { $.mobile.back(); },
+ isForward: function() { window.history.forward(); }
+ });
- // Stop message show timer
- clearTimeout( loadMsgDelay );
+ // prevent changePage()
+ return;
+ } else {
+ // if the current active page is a dialog and we're navigating
+ // to a dialog use the dialog objected saved in the stack
+ urlHistory.directHashChange({
+ currentUrl: to,
- // Hide loading message
- $.mobile.hidePageLoadingMsg();
- };
- }
+ // regardless of the direction of the history change
+ // do the following
+ either: function( isBack ) {
+ var active = $.mobile.urlHistory.getActive();
- if ( !( $.mobile.allowCrossDomainPages || path.isSameDomain( documentUrl, absUrl ) ) ) {
- deferred.reject( absUrl, options );
- } else {
- // Load the new page.
- $.ajax({
- url: fileUrl,
- type: settings.type,
- data: settings.data,
- dataType: "html",
- success: function( html, textStatus, xhr ) {
- //pre-parse html to check for a data-url,
- //use it as the new fileUrl, base path, etc
- var all = $( "<div></div>" ),
+ to = active.pageUrl;
- //page title regexp
- newPageTitle = html.match( /<title[^>]*>([^<]*)/ ) && RegExp.$1,
+ // make sure to set the role, transition and reversal
+ // as most of this is lost by the domCache cleaning
+ $.extend( changePageOptions, {
+ role: active.role,
+ transition: active.transition,
+ reverse: isBack
+ });
+ }
+ });
+ }
+ }
- // TODO handle dialogs again
- pageElemRegex = new RegExp( "(<[^>]+\\bdata-" + $.mobile.ns + "role=[\"']?page[\"']?[^>]*>)" ),
- dataUrlRegex = new RegExp( "\\bdata-" + $.mobile.ns + "url=[\"']?([^\"'>]*)[\"']?" );
+ //if to is defined, load it
+ if ( to ) {
+ // At this point, 'to' can be one of 3 things, a cached page element from
+ // a history stack entry, an id, or site-relative/absolute URL. If 'to' is
+ // an id, we need to resolve it against the documentBase, not the location.href,
+ // since the hashchange could've been the result of a forward/backward navigation
+ // that crosses from an external page/dialog to an internal page/dialog.
+ to = ( typeof to === "string" && !path.isPath( to ) ) ? ( path.makeUrlAbsolute( '#' + to, documentBase ) ) : to;
+ // If we're about to go to an initial URL that contains a reference to a non-existent
+ // internal page, go to the first page instead. We know that the initial hash refers to a
+ // non-existent page, because the initial hash did not end up in the initial urlHistory entry
+ if ( to === path.makeUrlAbsolute( '#' + urlHistory.initialDst, documentBase ) &&
+ urlHistory.stack.length && urlHistory.stack[0].url !== urlHistory.initialDst.replace( dialogHashKey, "" ) ) {
+ to = $.mobile.firstPage;
+ }
+ $.mobile.changePage( to, changePageOptions );
+ } else {
+ //there's no hash, go to the first page in the dom
+ $.mobile.changePage( $.mobile.firstPage, changePageOptions );
+ }
+ };
- // data-url must be provided for the base tag so resource requests can be directed to the
- // correct url. loading into a temprorary element makes these requests immediately
- if( pageElemRegex.test( html )
- && RegExp.$1
- && dataUrlRegex.test( RegExp.$1 )
- && RegExp.$1 ) {
- url = fileUrl = path.getFilePath( RegExp.$1 );
- }
+ //hashchange event handler
+ $window.bind( "hashchange", function( e, triggered ) {
+ // Firefox auto-escapes the location.hash as for v13 but
+ // leaves the href untouched
+ $.mobile._handleHashChange( path.parseLocation().hash );
+ });
- if ( base ) {
- base.set( fileUrl );
- }
+ //set page min-heights to be device specific
+ $( document ).bind( "pageshow", resetActivePageHeight );
+ $( window ).bind( "throttledresize", resetActivePageHeight );
- //workaround to allow scripts to execute when included in page divs
- all.get( 0 ).innerHTML = html;
- page = all.find( ":jqmData(role='page'), :jqmData(role='dialog')" ).first();
+ });//navreadyDeferred done callback
- //if page elem couldn't be found, create one and insert the body element's contents
- if( !page.length ){
- page = $( "<div data-" + $.mobile.ns + "role='page'>" + html.split( /<\/?body[^>]*>/gmi )[1] + "</div>" );
- }
+})( jQuery );
- if ( newPageTitle && !page.jqmData( "title" ) ) {
- if ( ~newPageTitle.indexOf( "&" ) ) {
- newPageTitle = $( "<div>" + newPageTitle + "</div>" ).text();
- }
- page.jqmData( "title", newPageTitle );
- }
+(function( $, window ) {
+ // For now, let's Monkeypatch this onto the end of $.mobile._registerInternalEvents
+ // Scope self to pushStateHandler so we can reference it sanely within the
+ // methods handed off as event handlers
+ var pushStateHandler = {},
+ self = pushStateHandler,
+ $win = $( window ),
+ url = $.mobile.path.parseLocation(),
+ mobileinitDeferred = $.Deferred(),
+ domreadyDeferred = $.Deferred();
- //rewrite src and href attrs to use a base url
- if( !$.support.dynamicBaseTag ) {
- var newPath = path.get( fileUrl );
- page.find( "[src], link[href], a[rel='external'], :jqmData(ajax='false'), a[target]" ).each(function() {
- var thisAttr = $( this ).is( '[href]' ) ? 'href' :
- $(this).is('[src]') ? 'src' : 'action',
- thisUrl = $( this ).attr( thisAttr );
+ $( document ).ready( $.proxy( domreadyDeferred, "resolve" ) );
- // XXX_jblas: We need to fix this so that it removes the document
- // base URL, and then prepends with the new page URL.
- //if full path exists and is same, chop it - helps IE out
- thisUrl = thisUrl.replace( location.protocol + '//' + location.host + location.pathname, '' );
+ $( document ).one( "mobileinit", $.proxy( mobileinitDeferred, "resolve" ) );
- if( !/^(\w+:|#|\/)/.test( thisUrl ) ) {
- $( this ).attr( thisAttr, newPath + thisUrl );
- }
- });
- }
+ $.extend( pushStateHandler, {
+ // TODO move to a path helper, this is rather common functionality
+ initialFilePath: (function() {
+ return url.pathname + url.search;
+ })(),
- //append to page and enhance
- // TODO taging a page with external to make sure that embedded pages aren't removed
- // by the various page handling code is bad. Having page handling code in many
- // places is bad. Solutions post 1.0
- page
- .attr( "data-" + $.mobile.ns + "url", path.convertUrlToDataUrl( fileUrl ) )
- .attr( "data-" + $.mobile.ns + "external-page", true )
- .appendTo( settings.pageContainer );
+ hashChangeTimeout: 200,
- // wait for page creation to leverage options defined on widget
- page.one( 'pagecreate', $.mobile._bindPageRemove );
+ hashChangeEnableTimer: undefined,
- enhancePage( page, settings.role );
+ initialHref: url.hrefNoHash,
- // Enhancing the page may result in new dialogs/sub pages being inserted
- // into the DOM. If the original absUrl refers to a sub-page, that is the
- // real page we are interested in.
- if ( absUrl.indexOf( "&" + $.mobile.subPageUrlKey ) > -1 ) {
- page = settings.pageContainer.children( ":jqmData(url='" + dataUrl + "')" );
- }
+ state: function() {
+ return {
+ // firefox auto decodes the url when using location.hash but not href
+ hash: $.mobile.path.parseLocation().hash || "#" + self.initialFilePath,
+ title: document.title,
- //bind pageHide to removePage after it's hidden, if the page options specify to do so
+ // persist across refresh
+ initialHref: self.initialHref
+ };
+ },
- // Remove loading message.
- if ( settings.showLoadMsg ) {
- hideMsg();
- }
+ resetUIKeys: function( url ) {
+ var dialog = $.mobile.dialogHashKey,
+ subkey = "&" + $.mobile.subPageUrlKey,
+ dialogIndex = url.indexOf( dialog );
- // Add the page reference and xhr to our triggerData.
- triggerData.xhr = xhr;
- triggerData.textStatus = textStatus;
- triggerData.page = page;
+ if ( dialogIndex > -1 ) {
+ url = url.slice( 0, dialogIndex ) + "#" + url.slice( dialogIndex );
+ } else if ( url.indexOf( subkey ) > -1 ) {
+ url = url.split( subkey ).join( "#" + subkey );
+ }
- // Let listeners know the page loaded successfully.
- settings.pageContainer.trigger( "pageload", triggerData );
+ return url;
+ },
- deferred.resolve( absUrl, options, page, dupCachedPage );
- },
- error: function( xhr, textStatus, errorThrown ) {
- //set base back to current path
- if( base ) {
- base.set( path.get() );
- }
+ // TODO sort out a single barrier to hashchange functionality
+ nextHashChangePrevented: function( value ) {
+ $.mobile.urlHistory.ignoreNextHashChange = value;
+ self.onHashChangeDisabled = value;
+ },
- // Add error info to our triggerData.
- triggerData.xhr = xhr;
- triggerData.textStatus = textStatus;
- triggerData.errorThrown = errorThrown;
+ // on hash change we want to clean up the url
+ // NOTE this takes place *after* the vanilla navigation hash change
+ // handling has taken place and set the state of the DOM
+ onHashChange: function( e ) {
+ // disable this hash change
+ if ( self.onHashChangeDisabled ) {
+ return;
+ }
- var plfEvent = new $.Event( "pageloadfailed" );
+ var href, state,
+ // firefox auto decodes the url when using location.hash but not href
+ hash = $.mobile.path.parseLocation().hash,
+ isPath = $.mobile.path.isPath( hash ),
+ resolutionUrl = isPath ? $.mobile.path.getLocation() : $.mobile.getDocumentUrl();
- // Let listeners know the page load failed.
- settings.pageContainer.trigger( plfEvent, triggerData );
+ hash = isPath ? hash.replace( "#", "" ) : hash;
- // If the default behavior is prevented, stop here!
- // Note that it is the responsibility of the listener/handler
- // that called preventDefault(), to resolve/reject the
- // deferred object within the triggerData.
- if( plfEvent.isDefaultPrevented() ){
- return;
- }
- // Remove loading message.
- if ( settings.showLoadMsg ) {
+ // propulate the hash when its not available
+ state = self.state();
- // Remove loading message.
- hideMsg();
+ // make the hash abolute with the current href
+ href = $.mobile.path.makeUrlAbsolute( hash, resolutionUrl );
- // show error message
- $.mobile.showPageLoadingMsg( $.mobile.pageLoadErrorMessageTheme, $.mobile.pageLoadErrorMessage, true );
+ if ( isPath ) {
+ href = self.resetUIKeys( href );
+ }
- // hide after delay
- setTimeout( $.mobile.hidePageLoadingMsg, 1500 );
- }
+ // replace the current url with the new href and store the state
+ // Note that in some cases we might be replacing an url with the
+ // same url. We do this anyways because we need to make sure that
+ // all of our history entries have a state object associated with
+ // them. This allows us to work around the case where $.mobile.back()
+ // is called to transition from an external page to an embedded page.
+ // In that particular case, a hashchange event is *NOT* generated by the browser.
+ // Ensuring each history entry has a state object means that onPopState()
+ // will always trigger our hashchange callback even when a hashchange event
+ // is not fired.
+ history.replaceState( state, document.title, href );
+ },
- deferred.reject( absUrl, options );
- }
- });
- }
+ // on popstate (ie back or forward) we need to replace the hash that was there previously
+ // cleaned up by the additional hash handling
+ onPopState: function( e ) {
+ var poppedState = e.originalEvent.state,
+ fromHash, toHash, hashChanged;
- return deferred.promise();
- };
+ // if there's no state its not a popstate we care about, eg chrome's initial popstate
+ if ( poppedState ) {
+ // if we get two pop states in under this.hashChangeTimeout
+ // make sure to clear any timer set for the previous change
+ clearTimeout( self.hashChangeEnableTimer );
- $.mobile.loadPage.defaults = {
- type: "get",
- data: undefined,
- reloadPage: false,
- role: undefined, // By default we rely on the role defined by the @data-role attribute.
- showLoadMsg: false,
- pageContainer: undefined,
- loadMsgDelay: 50 // This delay allows loads that pull from browser cache to occur without showing the loading message.
- };
+ // make sure to enable hash handling for the the _handleHashChange call
+ self.nextHashChangePrevented( false );
- // Show a specific page in the page container.
- $.mobile.changePage = function( toPage, options ) {
- // If we are in the midst of a transition, queue the current request.
- // We'll call changePage() once we're done with the current transition to
- // service the request.
- if( isPageTransitioning ) {
- pageTransitionQueue.unshift( arguments );
- return;
- }
+ // change the page based on the hash in the popped state
+ $.mobile._handleHashChange( poppedState.hash );
- var settings = $.extend( {}, $.mobile.changePage.defaults, options );
+ // prevent any hashchange in the next self.hashChangeTimeout
+ self.nextHashChangePrevented( true );
- // Make sure we have a pageContainer to work with.
- settings.pageContainer = settings.pageContainer || $.mobile.pageContainer;
+ // re-enable hash change handling after swallowing a possible hash
+ // change event that comes on all popstates courtesy of browsers like Android
+ self.hashChangeEnableTimer = setTimeout( function() {
+ self.nextHashChangePrevented( false );
+ }, self.hashChangeTimeout );
+ }
+ },
- // Make sure we have a fromPage.
- settings.fromPage = settings.fromPage || $.mobile.activePage;
+ init: function() {
+ $win.bind( "hashchange", self.onHashChange );
- var mpc = settings.pageContainer,
- pbcEvent = new $.Event( "pagebeforechange" ),
- triggerData = { toPage: toPage, options: settings };
+ // Handle popstate events the occur through history changes
+ $win.bind( "popstate", self.onPopState );
- // Let listeners know we're about to change the current page.
- mpc.trigger( pbcEvent, triggerData );
+ // if there's no hash, we need to replacestate for returning to home
+ if ( location.hash === "" ) {
+ history.replaceState( self.state(), document.title, $.mobile.path.getLocation() );
+ }
+ }
+ });
- // If the default behavior is prevented, stop here!
- if( pbcEvent.isDefaultPrevented() ){
- return;
+ // We need to init when "mobileinit", "domready", and "navready" have all happened
+ $.when( domreadyDeferred, mobileinitDeferred, $.mobile.navreadyDeferred ).done(function() {
+ if ( $.mobile.pushStateEnabled && $.support.pushState ) {
+ pushStateHandler.init();
}
+ });
+})( jQuery, this );
- // We allow "pagebeforechange" observers to modify the toPage in the trigger
- // data to allow for redirects. Make sure our toPage is updated.
+/*
+* fallback transition for flip in non-3D supporting browsers (which tend to handle complex transitions poorly in general
+*/
- toPage = triggerData.toPage;
+(function( $, window, undefined ) {
- // Set the isPageTransitioning flag to prevent any requests from
- // entering this method while we are in the midst of loading a page
- // or transitioning.
+$.mobile.transitionFallbacks.flip = "fade";
- isPageTransitioning = true;
+})( jQuery, this );
+/*
+* fallback transition for flow in non-3D supporting browsers (which tend to handle complex transitions poorly in general
+*/
- // If the caller passed us a url, call loadPage()
- // to make sure it is loaded into the DOM. We'll listen
- // to the promise object it returns so we know when
- // it is done loading or if an error ocurred.
- if ( typeof toPage == "string" ) {
- $.mobile.loadPage( toPage, settings )
- .done(function( url, options, newPage, dupCachedPage ) {
- isPageTransitioning = false;
- options.duplicateCachedPage = dupCachedPage;
- $.mobile.changePage( newPage, options );
- })
- .fail(function( url, options ) {
- isPageTransitioning = false;
+(function( $, window, undefined ) {
- //clear out the active button state
- removeActiveLinkClass( true );
+$.mobile.transitionFallbacks.flow = "fade";
- //release transition lock so navigation is free again
- releasePageTransitionLock();
- settings.pageContainer.trigger( "pagechangefailed", triggerData );
- });
- return;
- }
+})( jQuery, this );
+/*
+* fallback transition for pop in non-3D supporting browsers (which tend to handle complex transitions poorly in general
+*/
+
+(function( $, window, undefined ) {
- // If we are going to the first-page of the application, we need to make
- // sure settings.dataUrl is set to the application document url. This allows
- // us to avoid generating a document url with an id hash in the case where the
- // first-page of the document has an id attribute specified.
- if ( toPage[ 0 ] === $.mobile.firstPage[ 0 ] && !settings.dataUrl ) {
- settings.dataUrl = documentUrl.hrefNoHash;
- }
+$.mobile.transitionFallbacks.pop = "fade";
- // The caller passed us a real page DOM element. Update our
- // internal state and then trigger a transition to the page.
- var fromPage = settings.fromPage,
- url = ( settings.dataUrl && path.convertUrlToDataUrl( settings.dataUrl ) ) || toPage.jqmData( "url" ),
- // The pageUrl var is usually the same as url, except when url is obscured as a dialog url. pageUrl always contains the file path
- pageUrl = url,
- fileUrl = path.getFilePath( url ),
- active = urlHistory.getActive(),
- activeIsInitialPage = urlHistory.activeIndex === 0,
- historyDir = 0,
- pageTitle = document.title,
- isDialog = settings.role === "dialog" || toPage.jqmData( "role" ) === "dialog";
+})( jQuery, this );
+/*
+* fallback transition for slide in non-3D supporting browsers (which tend to handle complex transitions poorly in general
+*/
- // By default, we prevent changePage requests when the fromPage and toPage
- // are the same element, but folks that generate content manually/dynamically
- // and reuse pages want to be able to transition to the same page. To allow
- // this, they will need to change the default value of allowSamePageTransition
- // to true, *OR*, pass it in as an option when they manually call changePage().
- // It should be noted that our default transition animations assume that the
- // formPage and toPage are different elements, so they may behave unexpectedly.
- // It is up to the developer that turns on the allowSamePageTransitiona option
- // to either turn off transition animations, or make sure that an appropriate
- // animation transition is used.
- if( fromPage && fromPage[0] === toPage[0] && !settings.allowSamePageTransition ) {
- isPageTransitioning = false;
- mpc.trigger( "pagechange", triggerData );
- return;
- }
+(function( $, window, undefined ) {
- // We need to make sure the page we are given has already been enhanced.
- enhancePage( toPage, settings.role );
+// Use the simultaneous transitions handler for slide transitions
+$.mobile.transitionHandlers.slide = $.mobile.transitionHandlers.simultaneous;
- // If the changePage request was sent from a hashChange event, check to see if the
- // page is already within the urlHistory stack. If so, we'll assume the user hit
- // the forward/back button and will try to match the transition accordingly.
- if( settings.fromHashChange ) {
- urlHistory.directHashChange({
- currentUrl: url,
- isBack: function() { historyDir = -1; },
- isForward: function() { historyDir = 1; }
- });
- }
+// Set the slide transitions's fallback to "fade"
+$.mobile.transitionFallbacks.slide = "fade";
- // Kill the keyboard.
- // XXX_jblas: We need to stop crawling the entire document to kill focus. Instead,
- // we should be tracking focus with a delegate() handler so we already have
- // the element in hand at this point.
- // Wrap this in a try/catch block since IE9 throw "Unspecified error" if document.activeElement
- // is undefined when we are in an IFrame.
- try {
- if(document.activeElement && document.activeElement.nodeName.toLowerCase() != 'body') {
- $(document.activeElement).blur();
- } else {
- $( "input:focus, textarea:focus, select:focus" ).blur();
- }
- } catch(e) {}
+})( jQuery, this );
+/*
+* fallback transition for slidedown in non-3D supporting browsers (which tend to handle complex transitions poorly in general
+*/
- // If we're displaying the page as a dialog, we don't want the url
- // for the dialog content to be used in the hash. Instead, we want
- // to append the dialogHashKey to the url of the current page.
- if ( isDialog && active ) {
- // on the initial page load active.url is undefined and in that case should
- // be an empty string. Moving the undefined -> empty string back into
- // urlHistory.addNew seemed imprudent given undefined better represents
- // the url state
- url = ( active.url || "" ) + dialogHashKey;
- }
+(function( $, window, undefined ) {
- // Set the location hash.
- if( settings.changeHash !== false && url ) {
- //disable hash listening temporarily
- urlHistory.ignoreNextHashChange = true;
- //update hash and history
- path.set( url );
- }
+$.mobile.transitionFallbacks.slidedown = "fade";
- // if title element wasn't found, try the page div data attr too
- // If this is a deep-link or a reload ( active === undefined ) then just use pageTitle
- var newPageTitle = ( !active )? pageTitle : toPage.jqmData( "title" ) || toPage.children(":jqmData(role='header')").find(".ui-title" ).getEncodedText();
- if( !!newPageTitle && pageTitle == document.title ) {
- pageTitle = newPageTitle;
- }
- if ( !toPage.jqmData( "title" ) ) {
- toPage.jqmData( "title", pageTitle );
- }
+})( jQuery, this );
+/*
+* fallback transition for slidefade in non-3D supporting browsers (which tend to handle complex transitions poorly in general
+*/
- // Make sure we have a transition defined.
- settings.transition = settings.transition
- || ( ( historyDir && !activeIsInitialPage ) ? active.transition : undefined )
- || ( isDialog ? $.mobile.defaultDialogTransition : $.mobile.defaultPageTransition );
+(function( $, window, undefined ) {
- //add page to history stack if it's not back or forward
- if( !historyDir ) {
- urlHistory.addNew( url, settings.transition, pageTitle, pageUrl, settings.role );
- }
+// Set the slide transitions's fallback to "fade"
+$.mobile.transitionFallbacks.slidefade = "fade";
- //set page title
- document.title = urlHistory.getActive().title;
+})( jQuery, this );
+/*
+* fallback transition for slideup in non-3D supporting browsers (which tend to handle complex transitions poorly in general
+*/
- //set "toPage" as activePage
- $.mobile.activePage = toPage;
+(function( $, window, undefined ) {
- // If we're navigating back in the URL history, set reverse accordingly.
- settings.reverse = settings.reverse || historyDir < 0;
+$.mobile.transitionFallbacks.slideup = "fade";
- transitionPages( toPage, fromPage, settings.transition, settings.reverse )
- .done(function( name, reverse, $to, $from, alreadyFocused ) {
- removeActiveLinkClass();
+})( jQuery, this );
+/*
+* fallback transition for turn in non-3D supporting browsers (which tend to handle complex transitions poorly in general
+*/
- //if there's a duplicateCachedPage, remove it from the DOM now that it's hidden
- if ( settings.duplicateCachedPage ) {
- settings.duplicateCachedPage.remove();
- }
+(function( $, window, undefined ) {
- // Send focus to the newly shown page. Moved from promise .done binding in transitionPages
- // itself to avoid ie bug that reports offsetWidth as > 0 (core check for visibility)
- // despite visibility: hidden addresses issue #2965
- // https://github.com/jquery/jquery-mobile/issues/2965
- if( !alreadyFocused ){
- $.mobile.focusPage( toPage );
- }
+$.mobile.transitionFallbacks.turn = "fade";
- releasePageTransitionLock();
+})( jQuery, this );
- // Let listeners know we're all done changing the current page.
- mpc.trigger( "pagechange", triggerData );
- });
- };
+(function( $, undefined ) {
- $.mobile.changePage.defaults = {
- transition: undefined,
- reverse: false,
- changeHash: true,
- fromHashChange: false,
- role: undefined, // By default we rely on the role defined by the @data-role attribute.
- duplicateCachedPage: undefined,
- pageContainer: undefined,
- showLoadMsg: true, //loading message shows by default when pages are being fetched during changePage
- dataUrl: undefined,
- fromPage: undefined,
- allowSamePageTransition: false
- };
+$.mobile.page.prototype.options.degradeInputs = {
+ color: false,
+ date: false,
+ datetime: false,
+ "datetime-local": false,
+ email: false,
+ month: false,
+ number: false,
+ range: "number",
+ search: "text",
+ tel: false,
+ time: false,
+ url: false,
+ week: false
+};
-/* Event Bindings - hashchange, submit, and click */
- function findClosestLink( ele )
- {
- while ( ele ) {
- // Look for the closest element with a nodeName of "a".
- // Note that we are checking if we have a valid nodeName
- // before attempting to access it. This is because the
- // node we get called with could have originated from within
- // an embedded SVG document where some symbol instance elements
- // don't have nodeName defined on them, or strings are of type
- // SVGAnimatedString.
- if ( ( typeof ele.nodeName === "string" ) && ele.nodeName.toLowerCase() == "a" ) {
- break;
- }
- ele = ele.parentNode;
- }
- return ele;
- }
- // The base URL for any given element depends on the page it resides in.
- function getClosestBaseUrl( ele )
- {
- // Find the closest page and extract out its url.
- var url = $( ele ).closest( ".ui-page" ).jqmData( "url" ),
- base = documentBase.hrefNoHash;
+//auto self-init widgets
+$( document ).bind( "pagecreate create", function( e ) {
- if ( !url || !path.isPath( url ) ) {
- url = base;
- }
+ var page = $.mobile.closestPageData( $( e.target ) ), options;
- return path.makeUrlAbsolute( url, base);
+ if ( !page ) {
+ return;
}
+ options = page.options;
- //The following event bindings should be bound after mobileinit has been triggered
- //the following function is called in the init file
- $.mobile._registerInternalEvents = function(){
+ // degrade inputs to avoid poorly implemented native functionality
+ $( e.target ).find( "input" ).not( page.keepNativeSelector() ).each(function() {
+ var $this = $( this ),
+ type = this.getAttribute( "type" ),
+ optType = options.degradeInputs[ type ] || "text";
- //bind to form submit events, handle with Ajax
- $( document ).delegate( "form", "submit", function( event ) {
- var $this = $( this );
+ if ( options.degradeInputs[ type ] ) {
+ var html = $( "<div>" ).html( $this.clone() ).html(),
+ // In IE browsers, the type sometimes doesn't exist in the cloned markup, so we replace the closing tag instead
+ hasType = html.indexOf( " type=" ) > -1,
+ findstr = hasType ? /\s+type=["']?\w+['"]?/ : /\/?>/,
+ repstr = " type=\"" + optType + "\" data-" + $.mobile.ns + "type=\"" + type + "\"" + ( hasType ? "" : ">" );
- if( !$.mobile.ajaxEnabled ||
- // test that the form is, itself, ajax false
- $this.is(":jqmData(ajax='false')") ||
- // test that $.mobile.ignoreContentEnabled is set and
- // the form or one of it's parents is ajax=false
- !$this.jqmHijackable().length ) {
- return;
- }
+ $this.replaceWith( html.replace( findstr, repstr ) );
+ }
+ });
- var type = $this.attr( "method" ),
- target = $this.attr( "target" ),
- url = $this.attr( "action" );
+});
- // If no action is specified, browsers default to using the
- // URL of the document containing the form. Since we dynamically
- // pull in pages from external documents, the form should submit
- // to the URL for the source document of the page containing
- // the form.
- if ( !url ) {
- // Get the @data-url for the page containing the form.
- url = getClosestBaseUrl( $this );
- if ( url === documentBase.hrefNoHash ) {
- // The url we got back matches the document base,
- // which means the page must be an internal/embedded page,
- // so default to using the actual document url as a browser
- // would.
- url = documentUrl.hrefNoSearch;
- }
- }
+})( jQuery );
- url = path.makeUrlAbsolute( url, getClosestBaseUrl($this) );
+(function( $, window, undefined ) {
- //external submits use regular HTTP
- if( path.isExternal( url ) || target ) {
- return;
- }
+$.widget( "mobile.dialog", $.mobile.widget, {
+ options: {
+ closeBtnText: "Close",
+ overlayTheme: "a",
+ initSelector: ":jqmData(role='dialog')"
+ },
+ _create: function() {
+ var self = this,
+ $el = this.element,
+ headerCloseButton = $( "<a href='#' data-" + $.mobile.ns + "icon='delete' data-" + $.mobile.ns + "iconpos='notext'>"+ this.options.closeBtnText + "</a>" ),
+ dialogWrap = $( "<div/>", {
+ "role" : "dialog",
+ "class" : "ui-dialog-contain ui-corner-all ui-overlay-shadow"
+ });
+
+ $el.addClass( "ui-dialog ui-overlay-" + this.options.overlayTheme );
- $.mobile.changePage(
- url,
- {
- type: type && type.length && type.toLowerCase() || "get",
- data: $this.serialize(),
- transition: $this.jqmData( "transition" ),
- direction: $this.jqmData( "direction" ),
- reloadPage: true
- }
- );
- event.preventDefault();
+ // Class the markup for dialog styling
+ // Set aria role
+ $el
+ .wrapInner( dialogWrap )
+ .children()
+ .find( ":jqmData(role='header')" )
+ .prepend( headerCloseButton )
+ .end()
+ .children( ':first-child')
+ .addClass( "ui-corner-top" )
+ .end()
+ .children( ":last-child" )
+ .addClass( "ui-corner-bottom" );
+
+ // this must be an anonymous function so that select menu dialogs can replace
+ // the close method. This is a change from previously just defining data-rel=back
+ // on the button and letting nav handle it
+ //
+ // Use click rather than vclick in order to prevent the possibility of unintentionally
+ // reopening the dialog if the dialog opening item was directly under the close button.
+ headerCloseButton.bind( "click", function() {
+ self.close();
});
- //add active state on vclick
- $( document ).bind( "vclick", function( event ) {
- // if this isn't a left click we don't care. Its important to note
- // that when the virtual event is generated it will create the which attr
- if ( event.which > 1 || !$.mobile.linkBindingEnabled ) {
- return;
- }
+ /* bind events
+ - clicks and submits should use the closing transition that the dialog opened with
+ unless a data-transition is specified on the link/form
+ - if the click was on the close button, or the link has a data-rel="back" it'll go back in history naturally
+ */
+ $el.bind( "vclick submit", function( event ) {
+ var $target = $( event.target ).closest( event.type === "vclick" ? "a" : "form" ),
+ active;
- var link = findClosestLink( event.target );
+ if ( $target.length && !$target.jqmData( "transition" ) ) {
- // split from the previous return logic to avoid find closest where possible
- // TODO teach $.mobile.hijackable to operate on raw dom elements so the link wrapping
- // can be avoided
- if ( !$(link).jqmHijackable().length ) {
- return;
+ active = $.mobile.urlHistory.getActive() || {};
+
+ $target.attr( "data-" + $.mobile.ns + "transition", ( active.transition || $.mobile.defaultDialogTransition ) )
+ .attr( "data-" + $.mobile.ns + "direction", "reverse" );
+ }
+ })
+ .bind( "pagehide", function( e, ui ) {
+ $( this ).find( "." + $.mobile.activeBtnClass ).not( ".ui-slider-bg" ).removeClass( $.mobile.activeBtnClass );
+ })
+ // Override the theme set by the page plugin on pageshow
+ .bind( "pagebeforeshow", function() {
+ self._isCloseable = true;
+ if ( self.options.overlayTheme ) {
+ self.element
+ .page( "removeContainerBackground" )
+ .page( "setContainerBackground", self.options.overlayTheme );
}
+ });
+ },
- if ( link ) {
- if ( path.parseUrl( link.getAttribute( "href" ) || "#" ).hash !== "#" ) {
- removeActiveLinkClass( true );
- $activeClickedLink = $( link ).closest( ".ui-btn" ).not( ".ui-disabled" );
- $activeClickedLink.addClass( $.mobile.activeBtnClass );
- $( "." + $.mobile.activePageClass + " .ui-btn" ).not( link ).blur();
+ // Close method goes back in history
+ close: function() {
+ var dst;
- // By caching the href value to data and switching the href to a #, we can avoid address bar showing in iOS. The click handler resets the href during its initial steps if this data is present
- $( link )
- .jqmData( "href", $( link ).attr( "href" ) )
- .attr( "href", "#" );
+ if ( this._isCloseable ) {
+ this._isCloseable = false;
+ if ( $.mobile.hashListeningEnabled ) {
+ $.mobile.back();
+ } else {
+ dst = $.mobile.urlHistory.getPrev().url;
+ if ( !$.mobile.path.isPath( dst ) ) {
+ dst = $.mobile.path.makeUrlAbsolute( "#" + dst );
}
- }
- });
- // click routing - direct to HTTP or Ajax, accordingly
- $( document ).bind( "click", function( event ) {
- if( !$.mobile.linkBindingEnabled ){
- return;
+ $.mobile.changePage( dst, { changeHash: false, fromHashChange: true } );
}
+ }
+ }
+});
- var link = findClosestLink( event.target ), $link = $( link ), httpCleanup;
+//auto self-init widgets
+$( document ).delegate( $.mobile.dialog.prototype.options.initSelector, "pagecreate", function() {
+ $.mobile.dialog.prototype.enhance( this );
+});
- // If there is no link associated with the click or its not a left
- // click we want to ignore the click
- // TODO teach $.mobile.hijackable to operate on raw dom elements so the link wrapping
- // can be avoided
- if ( !link || event.which > 1 || !$link.jqmHijackable().length ) {
- return;
- }
+})( jQuery, this );
- //remove active link class if external (then it won't be there if you come back)
- httpCleanup = function(){
- window.setTimeout( function() { removeActiveLinkClass( true ); }, 200 );
- };
+(function( $, undefined ) {
- // If there's data cached for the real href value, set the link's href back to it again. This pairs with an address bar workaround from the vclick handler
- if( $link.jqmData( "href" ) ){
- $link.attr( "href", $link.jqmData( "href" ) );
- }
+$.mobile.page.prototype.options.backBtnText = "Back";
+$.mobile.page.prototype.options.addBackBtn = false;
+$.mobile.page.prototype.options.backBtnTheme = null;
+$.mobile.page.prototype.options.headerTheme = "a";
+$.mobile.page.prototype.options.footerTheme = "a";
+$.mobile.page.prototype.options.contentTheme = null;
- //if there's a data-rel=back attr, go back in history
- if( $link.is( ":jqmData(rel='back')" ) ) {
- window.history.back();
- return false;
- }
+// NOTE bind used to force this binding to run before the buttonMarkup binding
+// which expects .ui-footer top be applied in its gigantic selector
+// TODO remove the buttonMarkup giant selector and move it to the various modules
+// on which it depends
+$( document ).bind( "pagecreate", function( e ) {
+ var $page = $( e.target ),
+ o = $page.data( "page" ).options,
+ pageRole = $page.jqmData( "role" ),
+ pageTheme = o.theme;
- var baseUrl = getClosestBaseUrl( $link ),
+ $( ":jqmData(role='header'), :jqmData(role='footer'), :jqmData(role='content')", $page )
+ .jqmEnhanceable()
+ .each(function() {
- //get href, if defined, otherwise default to empty hash
- href = path.makeUrlAbsolute( $link.attr( "href" ) || "#", baseUrl );
+ var $this = $( this ),
+ role = $this.jqmData( "role" ),
+ theme = $this.jqmData( "theme" ),
+ contentTheme = theme || o.contentTheme || ( pageRole === "dialog" && pageTheme ),
+ $headeranchors,
+ leftbtn,
+ rightbtn,
+ backBtn;
- //if ajax is disabled, exit early
- if( !$.mobile.ajaxEnabled && !path.isEmbeddedPage( href ) ){
- httpCleanup();
- //use default click handling
- return;
- }
+ $this.addClass( "ui-" + role );
- // XXX_jblas: Ideally links to application pages should be specified as
- // an url to the application document with a hash that is either
- // the site relative path or id to the page. But some of the
- // internal code that dynamically generates sub-pages for nested
- // lists and select dialogs, just write a hash in the link they
- // create. This means the actual URL path is based on whatever
- // the current value of the base tag is at the time this code
- // is called. For now we are just assuming that any url with a
- // hash in it is an application page reference.
- if ( href.search( "#" ) != -1 ) {
- href = href.replace( /[^#]*#/, "" );
- if ( !href ) {
- //link was an empty hash meant purely
- //for interaction, so we ignore it.
- event.preventDefault();
- return;
- } else if ( path.isPath( href ) ) {
- //we have apath so make it the href we want to load.
- href = path.makeUrlAbsolute( href, baseUrl );
- } else {
- //we have a simple id so use the documentUrl as its base.
- href = path.makeUrlAbsolute( "#" + href, documentUrl.hrefNoHash );
- }
- }
+ //apply theming and markup modifications to page,header,content,footer
+ if ( role === "header" || role === "footer" ) {
- // Should we handle this link, or let the browser deal with it?
- var useDefaultUrlHandling = $link.is( "[rel='external']" ) || $link.is( ":jqmData(ajax='false')" ) || $link.is( "[target]" ),
+ var thisTheme = theme || ( role === "header" ? o.headerTheme : o.footerTheme ) || pageTheme;
- // Some embedded browsers, like the web view in Phone Gap, allow cross-domain XHR
- // requests if the document doing the request was loaded via the file:// protocol.
- // This is usually to allow the application to "phone home" and fetch app specific
- // data. We normally let the browser handle external/cross-domain urls, but if the
- // allowCrossDomainPages option is true, we will allow cross-domain http/https
- // requests to go through our page loading logic.
- isCrossDomainPageLoad = ( $.mobile.allowCrossDomainPages && documentUrl.protocol === "file:" && href.search( /^https?:/ ) != -1 ),
+ $this
+ //add theme class
+ .addClass( "ui-bar-" + thisTheme )
+ // Add ARIA role
+ .attr( "role", role === "header" ? "banner" : "contentinfo" );
- //check for protocol or rel and its not an embedded page
- //TODO overlap in logic from isExternal, rel=external check should be
- // moved into more comprehensive isExternalLink
- isExternal = useDefaultUrlHandling || ( path.isExternal( href ) && !isCrossDomainPageLoad );
+ if ( role === "header") {
+ // Right,left buttons
+ $headeranchors = $this.children( "a, button" );
+ leftbtn = $headeranchors.hasClass( "ui-btn-left" );
+ rightbtn = $headeranchors.hasClass( "ui-btn-right" );
- if( isExternal ) {
- httpCleanup();
- //use default click handling
- return;
- }
+ leftbtn = leftbtn || $headeranchors.eq( 0 ).not( ".ui-btn-right" ).addClass( "ui-btn-left" ).length;
- //use ajax
- var transition = $link.jqmData( "transition" ),
- direction = $link.jqmData( "direction" ),
- reverse = ( direction && direction === "reverse" ) ||
- // deprecated - remove by 1.0
- $link.jqmData( "back" ),
+ rightbtn = rightbtn || $headeranchors.eq( 1 ).addClass( "ui-btn-right" ).length;
+ }
- //this may need to be more specific as we use data-rel more
- role = $link.attr( "data-" + $.mobile.ns + "rel" ) || undefined;
+ // Auto-add back btn on pages beyond first view
+ if ( o.addBackBtn &&
+ role === "header" &&
+ $( ".ui-page" ).length > 1 &&
+ $page.jqmData( "url" ) !== $.mobile.path.stripHash( location.hash ) &&
+ !leftbtn ) {
- $.mobile.changePage( href, { transition: transition, reverse: reverse, role: role } );
- event.preventDefault();
- });
+ backBtn = $( "<a href='javascript:void(0);' class='ui-btn-left' data-"+ $.mobile.ns +"rel='back' data-"+ $.mobile.ns +"icon='arrow-l'>"+ o.backBtnText +"</a>" )
+ // If theme is provided, override default inheritance
+ .attr( "data-"+ $.mobile.ns +"theme", o.backBtnTheme || thisTheme )
+ .prependTo( $this );
+ }
- //prefetch pages when anchors with data-prefetch are encountered
- $( document ).delegate( ".ui-page", "pageshow.prefetch", function() {
- var urls = [];
- $( this ).find( "a:jqmData(prefetch)" ).each(function(){
- var $link = $(this),
- url = $link.attr( "href" );
+ // Page title
+ $this.children( "h1, h2, h3, h4, h5, h6" )
+ .addClass( "ui-title" )
+ // Regardless of h element number in src, it becomes h1 for the enhanced page
+ .attr({
+ "role": "heading",
+ "aria-level": "1"
+ });
- if ( url && $.inArray( url, urls ) === -1 ) {
- urls.push( url );
+ } else if ( role === "content" ) {
+ if ( contentTheme ) {
+ $this.addClass( "ui-body-" + ( contentTheme ) );
+ }
- $.mobile.loadPage( url, {role: $link.attr("data-" + $.mobile.ns + "rel")} );
- }
- });
- });
+ // Add ARIA role
+ $this.attr( "role", "main" );
+ }
+ });
+});
- $.mobile._handleHashChange = function( hash ) {
- //find first page via hash
- var to = path.stripHash( hash ),
- //transition is false if it's the first page, undefined otherwise (and may be overridden by default)
- transition = $.mobile.urlHistory.stack.length === 0 ? "none" : undefined,
+})( jQuery );
- // default options for the changPage calls made after examining the current state
- // of the page and the hash
- changePageOptions = {
- transition: transition,
- changeHash: false,
- fromHashChange: true
- };
+(function( $, undefined ) {
- //if listening is disabled (either globally or temporarily), or it's a dialog hash
- if( !$.mobile.hashListeningEnabled || urlHistory.ignoreNextHashChange ) {
- urlHistory.ignoreNextHashChange = false;
- return;
- }
+// filter function removes whitespace between label and form element so we can use inline-block (nodeType 3 = text)
+$.fn.fieldcontain = function( options ) {
+ return this
+ .addClass( "ui-field-contain ui-body ui-br" )
+ .contents().filter( function() {
+ return ( this.nodeType === 3 && !/\S/.test( this.nodeValue ) );
+ }).remove();
+};
- // special case for dialogs
- if( urlHistory.stack.length > 1 && to.indexOf( dialogHashKey ) > -1 ) {
+//auto self-init widgets
+$( document ).bind( "pagecreate create", function( e ) {
+ $( ":jqmData(role='fieldcontain')", e.target ).jqmEnhanceable().fieldcontain();
+});
- // If current active page is not a dialog skip the dialog and continue
- // in the same direction
- if(!$.mobile.activePage.is( ".ui-dialog" )) {
- //determine if we're heading forward or backward and continue accordingly past
- //the current dialog
- urlHistory.directHashChange({
- currentUrl: to,
- isBack: function() { window.history.back(); },
- isForward: function() { window.history.forward(); }
- });
+})( jQuery );
- // prevent changePage()
- return;
- } else {
- // if the current active page is a dialog and we're navigating
- // to a dialog use the dialog objected saved in the stack
- urlHistory.directHashChange({
- currentUrl: to,
+(function( $, undefined ) {
- // regardless of the direction of the history change
- // do the following
- either: function( isBack ) {
- var active = $.mobile.urlHistory.getActive();
+$.fn.grid = function( options ) {
+ return this.each(function() {
- to = active.pageUrl;
+ var $this = $( this ),
+ o = $.extend({
+ grid: null
+ }, options ),
+ $kids = $this.children(),
+ gridCols = { solo:1, a:2, b:3, c:4, d:5 },
+ grid = o.grid,
+ iterator;
- // make sure to set the role, transition and reversal
- // as most of this is lost by the domCache cleaning
- $.extend( changePageOptions, {
- role: active.role,
- transition: active.transition,
- reverse: isBack
- });
+ if ( !grid ) {
+ if ( $kids.length <= 5 ) {
+ for ( var letter in gridCols ) {
+ if ( gridCols[ letter ] === $kids.length ) {
+ grid = letter;
}
- });
+ }
+ } else {
+ grid = "a";
+ $this.addClass( "ui-grid-duo" );
}
}
+ iterator = gridCols[grid];
- //if to is defined, load it
- if ( to ) {
- // At this point, 'to' can be one of 3 things, a cached page element from
- // a history stack entry, an id, or site-relative/absolute URL. If 'to' is
- // an id, we need to resolve it against the documentBase, not the location.href,
- // since the hashchange could've been the result of a forward/backward navigation
- // that crosses from an external page/dialog to an internal page/dialog.
- to = ( typeof to === "string" && !path.isPath( to ) ) ? ( path.makeUrlAbsolute( '#' + to, documentBase ) ) : to;
- $.mobile.changePage( to, changePageOptions );
- } else {
- //there's no hash, go to the first page in the dom
- $.mobile.changePage( $.mobile.firstPage, changePageOptions );
- }
- };
+ $this.addClass( "ui-grid-" + grid );
- //hashchange event handler
- $window.bind( "hashchange", function( e, triggered ) {
- $.mobile._handleHashChange( location.hash );
- });
+ $kids.filter( ":nth-child(" + iterator + "n+1)" ).addClass( "ui-block-a" );
- //set page min-heights to be device specific
- $( document ).bind( "pageshow", resetActivePageHeight );
- $( window ).bind( "throttledresize", resetActivePageHeight );
+ if ( iterator > 1 ) {
+ $kids.filter( ":nth-child(" + iterator + "n+2)" ).addClass( "ui-block-b" );
+ }
+ if ( iterator > 2 ) {
+ $kids.filter( ":nth-child(" + iterator + "n+3)" ).addClass( "ui-block-c" );
+ }
+ if ( iterator > 3 ) {
+ $kids.filter( ":nth-child(" + iterator + "n+4)" ).addClass( "ui-block-d" );
+ }
+ if ( iterator > 4 ) {
+ $kids.filter( ":nth-child(" + iterator + "n+5)" ).addClass( "ui-block-e" );
+ }
+ });
+};
+})( jQuery );
+
+(function( $, undefined ) {
- };//_registerInternalEvents callback
+$( document ).bind( "pagecreate create", function( e ) {
+ $( ":jqmData(role='nojs')", e.target ).addClass( "ui-nojs" );
+
+});
})( jQuery );
-( function( $, window ) {
- // For now, let's Monkeypatch this onto the end of $.mobile._registerInternalEvents
- // Scope self to pushStateHandler so we can reference it sanely within the
- // methods handed off as event handlers
- var pushStateHandler = {},
- self = pushStateHandler,
- $win = $( window ),
- url = $.mobile.path.parseUrl( location.href );
+(function( $, undefined ) {
- $.extend( pushStateHandler, {
- // TODO move to a path helper, this is rather common functionality
- initialFilePath: (function() {
- return url.pathname + url.search;
- })(),
+$.fn.buttonMarkup = function( options ) {
+ var $workingSet = this,
+ mapToDataAttr = function( key, value ) {
+ e.setAttribute( "data-" + $.mobile.ns + key, value );
+ el.jqmData( key, value );
+ };
- initialHref: url.hrefNoHash,
+ // Enforce options to be of type string
+ options = ( options && ( $.type( options ) === "object" ) )? options : {};
+ for ( var i = 0; i < $workingSet.length; i++ ) {
+ var el = $workingSet.eq( i ),
+ e = el[ 0 ],
+ o = $.extend( {}, $.fn.buttonMarkup.defaults, {
+ icon: options.icon !== undefined ? options.icon : el.jqmData( "icon" ),
+ iconpos: options.iconpos !== undefined ? options.iconpos : el.jqmData( "iconpos" ),
+ theme: options.theme !== undefined ? options.theme : el.jqmData( "theme" ) || $.mobile.getInheritedTheme( el, "c" ),
+ inline: options.inline !== undefined ? options.inline : el.jqmData( "inline" ),
+ shadow: options.shadow !== undefined ? options.shadow : el.jqmData( "shadow" ),
+ corners: options.corners !== undefined ? options.corners : el.jqmData( "corners" ),
+ iconshadow: options.iconshadow !== undefined ? options.iconshadow : el.jqmData( "iconshadow" ),
+ mini: options.mini !== undefined ? options.mini : el.jqmData( "mini" )
+ }, options ),
- state: function() {
- return {
- hash: location.hash || "#" + self.initialFilePath,
- title: document.title,
+ // Classes Defined
+ innerClass = "ui-btn-inner",
+ textClass = "ui-btn-text",
+ buttonClass, iconClass,
+ // Button inner markup
+ buttonInner,
+ buttonText,
+ buttonIcon,
+ buttonElements;
- // persist across refresh
- initialHref: self.initialHref
- };
- },
+ $.each( o, mapToDataAttr );
- resetUIKeys: function( url ) {
- var dialog = $.mobile.dialogHashKey,
- subkey = "&" + $.mobile.subPageUrlKey,
- dialogIndex = url.indexOf( dialog );
+ if ( el.jqmData( "rel" ) === "popup" && el.attr( "href" ) ) {
+ e.setAttribute( "aria-haspopup", true );
+ e.setAttribute( "aria-owns", e.getAttribute( "href" ) );
+ }
- if( dialogIndex > -1 ) {
- url = url.slice( 0, dialogIndex ) + "#" + url.slice( dialogIndex );
- } else if( url.indexOf( subkey ) > -1 ) {
- url = url.split( subkey ).join( "#" + subkey );
- }
+ // Check if this element is already enhanced
+ buttonElements = $.data( ( ( e.tagName === "INPUT" || e.tagName === "BUTTON" ) ? e.parentNode : e ), "buttonElements" );
- return url;
- },
+ if ( buttonElements ) {
+ e = buttonElements.outer;
+ el = $( e );
+ buttonInner = buttonElements.inner;
+ buttonText = buttonElements.text;
+ // We will recreate this icon below
+ $( buttonElements.icon ).remove();
+ buttonElements.icon = null;
+ }
+ else {
+ buttonInner = document.createElement( o.wrapperEls );
+ buttonText = document.createElement( o.wrapperEls );
+ }
+ buttonIcon = o.icon ? document.createElement( "span" ) : null;
- hashValueAfterReset: function( url ) {
- var resetUrl = self.resetUIKeys( url );
- return $.mobile.path.parseUrl( resetUrl ).hash;
- },
+ if ( attachEvents && !buttonElements ) {
+ attachEvents();
+ }
- // TODO sort out a single barrier to hashchange functionality
- nextHashChangePrevented: function( value ) {
- $.mobile.urlHistory.ignoreNextHashChange = value;
- self.onHashChangeDisabled = value;
- },
+ // if not, try to find closest theme container
+ if ( !o.theme ) {
+ o.theme = $.mobile.getInheritedTheme( el, "c" );
+ }
- // on hash change we want to clean up the url
- // NOTE this takes place *after* the vanilla navigation hash change
- // handling has taken place and set the state of the DOM
- onHashChange: function( e ) {
- // disable this hash change
- if( self.onHashChangeDisabled ){
- return;
+ buttonClass = "ui-btn ui-btn-up-" + o.theme;
+ buttonClass += o.shadow ? " ui-shadow" : "";
+ buttonClass += o.corners ? " ui-btn-corner-all" : "";
+
+ if ( o.mini !== undefined ) {
+ // Used to control styling in headers/footers, where buttons default to `mini` style.
+ buttonClass += o.mini === true ? " ui-mini" : " ui-fullsize";
+ }
+
+ if ( o.inline !== undefined ) {
+ // Used to control styling in headers/footers, where buttons default to `inline` style.
+ buttonClass += o.inline === true ? " ui-btn-inline" : " ui-btn-block";
+ }
+
+ if ( o.icon ) {
+ o.icon = "ui-icon-" + o.icon;
+ o.iconpos = o.iconpos || "left";
+
+ iconClass = "ui-icon " + o.icon;
+
+ if ( o.iconshadow ) {
+ iconClass += " ui-icon-shadow";
}
+ }
- var href, state,
- hash = location.hash,
- isPath = $.mobile.path.isPath( hash ),
- resolutionUrl = isPath ? location.href : $.mobile.getDocumentUrl();
+ if ( o.iconpos ) {
+ buttonClass += " ui-btn-icon-" + o.iconpos;
- hash = isPath ? hash.replace( "#", "" ) : hash;
+ if ( o.iconpos === "notext" && !el.attr( "title" ) ) {
+ el.attr( "title", el.getEncodedText() );
+ }
+ }
+ innerClass += o.corners ? " ui-btn-corner-all" : "";
- // propulate the hash when its not available
- state = self.state();
+ if ( o.iconpos && o.iconpos === "notext" && !el.attr( "title" ) ) {
+ el.attr( "title", el.getEncodedText() );
+ }
- // make the hash abolute with the current href
- href = $.mobile.path.makeUrlAbsolute( hash, resolutionUrl );
+ if ( buttonElements ) {
+ el.removeClass( buttonElements.bcls || "" );
+ }
+ el.removeClass( "ui-link" ).addClass( buttonClass );
- if ( isPath ) {
- href = self.resetUIKeys( href );
+ buttonInner.className = innerClass;
+
+ buttonText.className = textClass;
+ if ( !buttonElements ) {
+ buttonInner.appendChild( buttonText );
+ }
+ if ( buttonIcon ) {
+ buttonIcon.className = iconClass;
+ if ( !( buttonElements && buttonElements.icon ) ) {
+ buttonIcon.innerHTML = " ";
+ buttonInner.appendChild( buttonIcon );
}
+ }
- // replace the current url with the new href and store the state
- // Note that in some cases we might be replacing an url with the
- // same url. We do this anyways because we need to make sure that
- // all of our history entries have a state object associated with
- // them. This allows us to work around the case where window.history.back()
- // is called to transition from an external page to an embedded page.
- // In that particular case, a hashchange event is *NOT* generated by the browser.
- // Ensuring each history entry has a state object means that onPopState()
- // will always trigger our hashchange callback even when a hashchange event
- // is not fired.
- history.replaceState( state, document.title, href );
- },
+ while ( e.firstChild && !buttonElements ) {
+ buttonText.appendChild( e.firstChild );
+ }
- // on popstate (ie back or forward) we need to replace the hash that was there previously
- // cleaned up by the additional hash handling
- onPopState: function( e ) {
- var poppedState = e.originalEvent.state,
- timeout, fromHash, toHash, hashChanged;
+ if ( !buttonElements ) {
+ e.appendChild( buttonInner );
+ }
+
+ // Assign a structure containing the elements of this button to the elements of this button. This
+ // will allow us to recognize this as an already-enhanced button in future calls to buttonMarkup().
+ buttonElements = {
+ bcls : buttonClass,
+ outer : e,
+ inner : buttonInner,
+ text : buttonText,
+ icon : buttonIcon
+ };
+
+ $.data( e, 'buttonElements', buttonElements );
+ $.data( buttonInner, 'buttonElements', buttonElements );
+ $.data( buttonText, 'buttonElements', buttonElements );
+ if ( buttonIcon ) {
+ $.data( buttonIcon, 'buttonElements', buttonElements );
+ }
+ }
+
+ return this;
+};
+
+$.fn.buttonMarkup.defaults = {
+ corners: true,
+ shadow: true,
+ iconshadow: true,
+ wrapperEls: "span"
+};
- // if there's no state its not a popstate we care about, eg chrome's initial popstate
- if( poppedState ) {
- // the active url in the history stack will still be from the previous state
- // so we can use it to verify if a hashchange will be fired from the popstate
- fromHash = self.hashValueAfterReset( $.mobile.urlHistory.getActive().url );
-
- // the hash stored in the state popped off the stack will be our currenturl or
- // the url to which we wish to navigate
- toHash = self.hashValueAfterReset( poppedState.hash.replace("#", "") );
-
- // if the hashes of the urls are different we must assume that the browser
- // will fire a hashchange
- hashChanged = fromHash !== toHash;
-
- // unlock hash handling once the hashchange caused be the popstate has fired
- if( hashChanged ) {
- $win.one( "hashchange.pushstate", function() {
- self.nextHashChangePrevented( false );
- });
- }
+function closestEnabledButton( element ) {
+ var cname;
- // enable hash handling for the the _handleHashChange call
- self.nextHashChangePrevented( false );
+ while ( element ) {
+ // Note that we check for typeof className below because the element we
+ // handed could be in an SVG DOM where className on SVG elements is defined to
+ // be of a different type (SVGAnimatedString). We only operate on HTML DOM
+ // elements, so we look for plain "string".
+ cname = ( typeof element.className === 'string' ) && ( element.className + ' ' );
+ if ( cname && cname.indexOf( "ui-btn " ) > -1 && cname.indexOf( "ui-disabled " ) < 0 ) {
+ break;
+ }
- // change the page based on the hash
- $.mobile._handleHashChange( poppedState.hash );
+ element = element.parentNode;
+ }
- // only prevent another hash change handling if a hash change will be fired
- // by the browser
- if( hashChanged ) {
- // disable hash handling until one of the above timers fires
- self.nextHashChangePrevented( true );
- }
- }
- },
+ return element;
+}
- init: function() {
- $win.bind( "hashchange", self.onHashChange );
+var attachEvents = function() {
+ var hoverDelay = $.mobile.buttonMarkup.hoverDelay, hov, foc;
- // Handle popstate events the occur through history changes
- $win.bind( "popstate", self.onPopState );
+ $( document ).bind( {
+ "vmousedown vmousecancel vmouseup vmouseover vmouseout focus blur scrollstart": function( event ) {
+ var theme,
+ $btn = $( closestEnabledButton( event.target ) ),
+ isTouchEvent = event.originalEvent && /^touch/.test( event.originalEvent.type ),
+ evt = event.type;
- // if there's no hash, we need to replacestate for returning to home
- if ( location.hash === "" ) {
- history.replaceState( self.state(), document.title, location.href );
- }
- }
- });
+ if ( $btn.length ) {
+ theme = $btn.attr( "data-" + $.mobile.ns + "theme" );
- $( function() {
- if( $.mobile.pushStateEnabled && $.support.pushState ){
- pushStateHandler.init();
+ if ( evt === "vmousedown" ) {
+ if ( isTouchEvent ) {
+ // Use a short delay to determine if the user is scrolling before highlighting
+ hov = setTimeout( function() {
+ $btn.removeClass( "ui-btn-up-" + theme ).addClass( "ui-btn-down-" + theme );
+ }, hoverDelay );
+ } else {
+ $btn.removeClass( "ui-btn-up-" + theme ).addClass( "ui-btn-down-" + theme );
+ }
+ } else if ( evt === "vmousecancel" || evt === "vmouseup" ) {
+ $btn.removeClass( "ui-btn-down-" + theme ).addClass( "ui-btn-up-" + theme );
+ } else if ( evt === "vmouseover" || evt === "focus" ) {
+ if ( isTouchEvent ) {
+ // Use a short delay to determine if the user is scrolling before highlighting
+ foc = setTimeout( function() {
+ $btn.removeClass( "ui-btn-up-" + theme ).addClass( "ui-btn-hover-" + theme );
+ }, hoverDelay );
+ } else {
+ $btn.removeClass( "ui-btn-up-" + theme ).addClass( "ui-btn-hover-" + theme );
+ }
+ } else if ( evt === "vmouseout" || evt === "blur" || evt === "scrollstart" ) {
+ $btn.removeClass( "ui-btn-hover-" + theme + " ui-btn-down-" + theme ).addClass( "ui-btn-up-" + theme );
+ if ( hov ) {
+ clearTimeout( hov );
+ }
+ if ( foc ) {
+ clearTimeout( foc );
+ }
+ }
+ }
+ },
+ "focusin focus": function( event ) {
+ $( closestEnabledButton( event.target ) ).addClass( $.mobile.focusClass );
+ },
+ "focusout blur": function( event ) {
+ $( closestEnabledButton( event.target ) ).removeClass( $.mobile.focusClass );
}
});
-})( jQuery, this );
-
-/*
-* fallback transition for pop in non-3D supporting browsers (which tend to handle complex transitions poorly in general
-*/
-
-(function( $, window, undefined ) {
-
-$.mobile.transitionFallbacks.pop = "fade";
-
-})( jQuery, this );
-/*
-* fallback transition for slide in non-3D supporting browsers (which tend to handle complex transitions poorly in general
-*/
+ attachEvents = null;
+};
-(function( $, window, undefined ) {
+//links in bars, or those with data-role become buttons
+//auto self-init widgets
+$( document ).bind( "pagecreate create", function( e ) {
-// Use the simultaneous transition handler for slide transitions
-$.mobile.transitionHandlers.slide = $.mobile.transitionHandlers.simultaneous;
+ $( ":jqmData(role='button'), .ui-bar > a, .ui-header > a, .ui-footer > a, .ui-bar > :jqmData(role='controlgroup') > a", e.target )
+ .jqmEnhanceable()
+ .not( "button, input, .ui-btn, :jqmData(role='none'), :jqmData(role='nojs')" )
+ .buttonMarkup();
+});
-// Set the slide transition's fallback to "fade"
-$.mobile.transitionFallbacks.slide = "fade";
+})( jQuery );
-})( jQuery, this );
-/*
-* fallback transition for slidedown in non-3D supporting browsers (which tend to handle complex transitions poorly in general
-*/
+(function( $, undefined ) {
-(function( $, window, undefined ) {
+$.widget( "mobile.collapsible", $.mobile.widget, {
+ options: {
+ expandCueText: " click to expand contents",
+ collapseCueText: " click to collapse contents",
+ collapsed: true,
+ heading: "h1,h2,h3,h4,h5,h6,legend",
+ theme: null,
+ contentTheme: null,
+ inset: true,
+ mini: false,
+ initSelector: ":jqmData(role='collapsible')"
+ },
+ _create: function() {
-$.mobile.transitionFallbacks.slidedown = "fade";
+ var $el = this.element,
+ o = this.options,
+ collapsible = $el.addClass( "ui-collapsible" ),
+ collapsibleHeading = $el.children( o.heading ).first(),
+ collapsedIcon = $el.jqmData( "collapsed-icon" ) || o.collapsedIcon,
+ expandedIcon = $el.jqmData( "expanded-icon" ) || o.expandedIcon,
+ collapsibleContent = collapsible.wrapInner( "<div class='ui-collapsible-content'></div>" ).children( ".ui-collapsible-content" ),
+ collapsibleSet = $el.closest( ":jqmData(role='collapsible-set')" ).addClass( "ui-collapsible-set" );
-})( jQuery, this );
+ // Replace collapsibleHeading if it's a legend
+ if ( collapsibleHeading.is( "legend" ) ) {
+ collapsibleHeading = $( "<div role='heading'>"+ collapsibleHeading.html() +"</div>" ).insertBefore( collapsibleHeading );
+ collapsibleHeading.next().remove();
+ }
-/*
-* fallback transition for slideup in non-3D supporting browsers (which tend to handle complex transitions poorly in general
-*/
+ // If we are in a collapsible set
+ if ( collapsibleSet.length ) {
+ // Inherit the theme from collapsible-set
+ if ( !o.theme ) {
+ o.theme = collapsibleSet.jqmData( "theme" ) || $.mobile.getInheritedTheme( collapsibleSet, "c" );
+ }
+ // Inherit the content-theme from collapsible-set
+ if ( !o.contentTheme ) {
+ o.contentTheme = collapsibleSet.jqmData( "content-theme" );
+ }
-(function( $, window, undefined ) {
+ // Get the preference for collapsed icon in the set
+ if ( !o.collapsedIcon ) {
+ o.collapsedIcon = collapsibleSet.jqmData( "collapsed-icon" );
+ }
+ // Get the preference for expanded icon in the set
+ if ( !o.expandedIcon ) {
+ o.expandedIcon = collapsibleSet.jqmData( "expanded-icon" );
+ }
+ // Gets the preference icon position in the set
+ if ( !o.iconPos ) {
+ o.iconPos = collapsibleSet.jqmData( "iconpos" );
+ }
+ // Inherit the preference for inset from collapsible-set or set the default value to ensure equalty within a set
+ if ( collapsibleSet.jqmData( "inset" ) !== undefined ) {
+ o.inset = collapsibleSet.jqmData( "inset" );
+ } else {
+ o.inset = true;
+ }
+ // Gets the preference for mini in the set
+ if ( !o.mini ) {
+ o.mini = collapsibleSet.jqmData( "mini" );
+ }
+ } else {
+ // get inherited theme if not a set and no theme has been set
+ if ( !o.theme ) {
+ o.theme = $.mobile.getInheritedTheme( $el, "c" );
+ }
+ }
+
+ if ( !!o.inset ) {
+ collapsible.addClass( "ui-collapsible-inset" );
+ }
+
+ collapsibleContent.addClass( ( o.contentTheme ) ? ( "ui-body-" + o.contentTheme ) : "");
-$.mobile.transitionFallbacks.slideup = "fade";
+ collapsedIcon = $el.jqmData( "collapsed-icon" ) || o.collapsedIcon || "plus";
+ expandedIcon = $el.jqmData( "expanded-icon" ) || o.expandedIcon || "minus";
-})( jQuery, this );
+ collapsibleHeading
+ //drop heading in before content
+ .insertBefore( collapsibleContent )
+ //modify markup & attributes
+ .addClass( "ui-collapsible-heading" )
+ .append( "<span class='ui-collapsible-heading-status'></span>" )
+ .wrapInner( "<a href='#' class='ui-collapsible-heading-toggle'></a>" )
+ .find( "a" )
+ .first()
+ .buttonMarkup({
+ shadow: false,
+ corners: false,
+ iconpos: $el.jqmData( "iconpos" ) || o.iconPos || "left",
+ icon: collapsedIcon,
+ mini: o.mini,
+ theme: o.theme
+ });
-/*
-* fallback transition for flip in non-3D supporting browsers (which tend to handle complex transitions poorly in general
-*/
+ if ( !!o.inset ) {
+ collapsibleHeading
+ .find( "a" ).first().add( ".ui-btn-inner", $el )
+ .addClass( "ui-corner-top ui-corner-bottom" );
+ }
-(function( $, window, undefined ) {
+ //events
+ collapsible
+ .bind( "expand collapse", function( event ) {
+ if ( !event.isDefaultPrevented() ) {
+ var $this = $( this ),
+ isCollapse = ( event.type === "collapse" ),
+ contentTheme = o.contentTheme;
-$.mobile.transitionFallbacks.flip = "fade";
+ event.preventDefault();
-})( jQuery, this );
+ collapsibleHeading
+ .toggleClass( "ui-collapsible-heading-collapsed", isCollapse )
+ .find( ".ui-collapsible-heading-status" )
+ .text( isCollapse ? o.expandCueText : o.collapseCueText )
+ .end()
+ .find( ".ui-icon" )
+ .toggleClass( "ui-icon-" + expandedIcon, !isCollapse )
+ // logic or cause same icon for expanded/collapsed state would remove the ui-icon-class
+ .toggleClass( "ui-icon-" + collapsedIcon, ( isCollapse || expandedIcon === collapsedIcon ) )
+ .end()
+ .find( "a" ).first().removeClass( $.mobile.activeBtnClass );
-/*
-* fallback transition for flow in non-3D supporting browsers (which tend to handle complex transitions poorly in general
-*/
+ $this.toggleClass( "ui-collapsible-collapsed", isCollapse );
+ collapsibleContent.toggleClass( "ui-collapsible-content-collapsed", isCollapse ).attr( "aria-hidden", isCollapse );
-(function( $, window, undefined ) {
+ if ( contentTheme && !!o.inset && ( !collapsibleSet.length || collapsible.jqmData( "collapsible-last" ) ) ) {
+ collapsibleHeading
+ .find( "a" ).first().add( collapsibleHeading.find( ".ui-btn-inner" ) )
+ .toggleClass( "ui-corner-bottom", isCollapse );
+ collapsibleContent.toggleClass( "ui-corner-bottom", !isCollapse );
+ }
+ collapsibleContent.trigger( "updatelayout" );
+ }
+ })
+ .trigger( o.collapsed ? "collapse" : "expand" );
-$.mobile.transitionFallbacks.flow = "fade";
+ collapsibleHeading
+ .bind( "tap", function( event ) {
+ collapsibleHeading.find( "a" ).first().addClass( $.mobile.activeBtnClass );
+ })
+ .bind( "click", function( event ) {
-})( jQuery, this );
+ var type = collapsibleHeading.is( ".ui-collapsible-heading-collapsed" ) ? "expand" : "collapse";
-/*
-* fallback transition for turn in non-3D supporting browsers (which tend to handle complex transitions poorly in general
-*/
+ collapsible.trigger( type );
-(function( $, window, undefined ) {
+ event.preventDefault();
+ event.stopPropagation();
+ });
+ }
+});
-$.mobile.transitionFallbacks.turn = "fade";
+//auto self-init widgets
+$( document ).bind( "pagecreate create", function( e ) {
+ $.mobile.collapsible.prototype.enhanceWithin( e.target );
+});
-})( jQuery, this );
+})( jQuery );
(function( $, undefined ) {
-$.mobile.page.prototype.options.degradeInputs = {
- color: false,
- date: false,
- datetime: false,
- "datetime-local": false,
- email: false,
- month: false,
- number: false,
- range: "number",
- search: "text",
- tel: false,
- time: false,
- url: false,
- week: false
-};
+$.widget( "mobile.collapsibleset", $.mobile.widget, {
+ options: {
+ initSelector: ":jqmData(role='collapsible-set')"
+ },
+ _create: function() {
+ var $el = this.element.addClass( "ui-collapsible-set" ),
+ o = this.options;
+
+ // Inherit the theme from collapsible-set
+ if ( !o.theme ) {
+ o.theme = $.mobile.getInheritedTheme( $el, "c" );
+ }
+ // Inherit the content-theme from collapsible-set
+ if ( !o.contentTheme ) {
+ o.contentTheme = $el.jqmData( "content-theme" );
+ }
+ if ( $el.jqmData( "inset" ) !== undefined ) {
+ o.inset = $el.jqmData( "inset" );
+ }
+ o.inset = o.inset !== undefined ? o.inset : true;
-//auto self-init widgets
-$( document ).bind( "pagecreate create", function( e ){
+ // Initialize the collapsible set if it's not already initialized
+ if ( !$el.jqmData( "collapsiblebound" ) ) {
+ $el
+ .jqmData( "collapsiblebound", true )
+ .bind( "expand collapse", function( event ) {
+ var isCollapse = ( event.type === "collapse" ),
+ collapsible = $( event.target ).closest( ".ui-collapsible" ),
+ widget = collapsible.data( "collapsible" );
+ if ( collapsible.jqmData( "collapsible-last" ) && !!o.inset ) {
+ collapsible.find( ".ui-collapsible-heading" ).first()
+ .find( "a" ).first()
+ .toggleClass( "ui-corner-bottom", isCollapse )
+ .find( ".ui-btn-inner" )
+ .toggleClass( "ui-corner-bottom", isCollapse );
+ collapsible.find( ".ui-collapsible-content" ).toggleClass( "ui-corner-bottom", !isCollapse );
+ }
+ })
+ .bind( "expand", function( event ) {
+ var closestCollapsible = $( event.target )
+ .closest( ".ui-collapsible" );
+ if ( closestCollapsible.parent().is( ":jqmData(role='collapsible-set')" ) ) {
+ closestCollapsible
+ .siblings( ".ui-collapsible" )
+ .trigger( "collapse" );
+ }
+ });
+ }
+ },
- var page = $.mobile.closestPageData($(e.target)), options;
+ _init: function() {
+ var $el = this.element,
+ collapsiblesInSet = $el.children( ":jqmData(role='collapsible')" ),
+ expanded = collapsiblesInSet.filter( ":jqmData(collapsed='false')" );
+ this.refresh();
- if( !page ) {
- return;
- }
+ // Because the corners are handled by the collapsible itself and the default state is collapsed
+ // That was causing https://github.com/jquery/jquery-mobile/issues/4116
+ expanded.trigger( "expand" );
+ },
- options = page.options;
+ refresh: function() {
+ var $el = this.element,
+ o = this.options,
+ collapsiblesInSet = $el.children( ":jqmData(role='collapsible')" );
- // degrade inputs to avoid poorly implemented native functionality
- $( e.target ).find( "input" ).not( page.keepNativeSelector() ).each(function() {
- var $this = $( this ),
- type = this.getAttribute( "type" ),
- optType = options.degradeInputs[ type ] || "text";
+ $.mobile.collapsible.prototype.enhance( collapsiblesInSet.not( ".ui-collapsible" ) );
- if ( options.degradeInputs[ type ] ) {
- var html = $( "<div>" ).html( $this.clone() ).html(),
- // In IE browsers, the type sometimes doesn't exist in the cloned markup, so we replace the closing tag instead
- hasType = html.indexOf( " type=" ) > -1,
- findstr = hasType ? /\s+type=["']?\w+['"]?/ : /\/?>/,
- repstr = " type=\"" + optType + "\" data-" + $.mobile.ns + "type=\"" + type + "\"" + ( hasType ? "" : ">" );
+ // clean up borders
+ if ( !!o.inset ) {
+ collapsiblesInSet.each(function() {
+ $( this ).jqmRemoveData( "collapsible-last" )
+ .find( ".ui-collapsible-heading" )
+ .find( "a" ).first()
+ .removeClass( "ui-corner-top ui-corner-bottom" )
+ .find( ".ui-btn-inner" )
+ .removeClass( "ui-corner-top ui-corner-bottom" );
+ });
- $this.replaceWith( html.replace( findstr, repstr ) );
+ collapsiblesInSet.first()
+ .find( "a" )
+ .first()
+ .addClass( "ui-corner-top" )
+ .find( ".ui-btn-inner" )
+ .addClass( "ui-corner-top" );
+
+ collapsiblesInSet.last()
+ .jqmData( "collapsible-last", true )
+ .find( "a" )
+ .first()
+ .addClass( "ui-corner-bottom" )
+ .find( ".ui-btn-inner" )
+ .addClass( "ui-corner-bottom" );
}
- });
+ }
+});
+//auto self-init widgets
+$( document ).bind( "pagecreate create", function( e ) {
+ $.mobile.collapsibleset.prototype.enhanceWithin( e.target );
});
})( jQuery );
-(function( $, window, undefined ) {
+(function( $, undefined ) {
-$.widget( "mobile.dialog", $.mobile.widget, {
+$.widget( "mobile.navbar", $.mobile.widget, {
options: {
- closeBtnText : "Close",
- overlayTheme : "a",
- initSelector : ":jqmData(role='dialog')"
+ iconpos: "top",
+ grid: null,
+ initSelector: ":jqmData(role='navbar')"
},
- _create: function() {
- var self = this,
- $el = this.element,
- headerCloseButton = $( "<a href='#' data-" + $.mobile.ns + "icon='delete' data-" + $.mobile.ns + "iconpos='notext'>"+ this.options.closeBtnText + "</a>" ),
- dialogWrap = $("<div/>", {
- "role" : "dialog",
- "class" : "ui-dialog-contain ui-corner-all ui-overlay-shadow"
- });
-
- $el.addClass( "ui-dialog ui-overlay-" + this.options.overlayTheme );
-
- // Class the markup for dialog styling
- // Set aria role
- $el
- .wrapInner( dialogWrap )
- .children()
- .find( ":jqmData(role='header')" )
- .prepend( headerCloseButton )
- .end()
- .children( ':first-child')
- .addClass( "ui-corner-top" )
- .end()
- .children( ":last-child" )
- .addClass( "ui-corner-bottom" );
- // this must be an anonymous function so that select menu dialogs can replace
- // the close method. This is a change from previously just defining data-rel=back
- // on the button and letting nav handle it
- //
- // Use click rather than vclick in order to prevent the possibility of unintentionally
- // reopening the dialog if the dialog opening item was directly under the close button.
- headerCloseButton.bind( "click", function() {
- self.close();
- });
+ _create: function() {
- /* bind events
- - clicks and submits should use the closing transition that the dialog opened with
- unless a data-transition is specified on the link/form
- - if the click was on the close button, or the link has a data-rel="back" it'll go back in history naturally
- */
- $el.bind( "vclick submit", function( event ) {
- var $target = $( event.target ).closest( event.type === "vclick" ? "a" : "form" ),
- active;
+ var $navbar = this.element,
+ $navbtns = $navbar.find( "a" ),
+ iconpos = $navbtns.filter( ":jqmData(icon)" ).length ?
+ this.options.iconpos : undefined;
- if ( $target.length && !$target.jqmData( "transition" ) ) {
+ $navbar.addClass( "ui-navbar ui-mini" )
+ .attr( "role", "navigation" )
+ .find( "ul" )
+ .jqmEnhanceable()
+ .grid({ grid: this.options.grid });
- active = $.mobile.urlHistory.getActive() || {};
+ $navbtns.buttonMarkup({
+ corners: false,
+ shadow: false,
+ inline: true,
+ iconpos: iconpos
+ });
- $target.attr( "data-" + $.mobile.ns + "transition", ( active.transition || $.mobile.defaultDialogTransition ) )
- .attr( "data-" + $.mobile.ns + "direction", "reverse" );
- }
- })
- .bind( "pagehide", function( e, ui ) {
- $( this ).find( "." + $.mobile.activeBtnClass ).removeClass( $.mobile.activeBtnClass );
- })
- // Override the theme set by the page plugin on pageshow
- .bind( "pagebeforeshow", function(){
- if( self.options.overlayTheme ){
- self.element
- .page( "removeContainerBackground" )
- .page( "setContainerBackground", self.options.overlayTheme );
+ $navbar.delegate( "a", "vclick", function( event ) {
+ if ( !$(event.target).hasClass( "ui-disabled" ) ) {
+ $navbtns.removeClass( $.mobile.activeBtnClass );
+ $( this ).addClass( $.mobile.activeBtnClass );
}
});
- },
- // Close method goes back in history
- close: function() {
- window.history.back();
+ // Buttons in the navbar with ui-state-persist class should regain their active state before page show
+ $navbar.closest( ".ui-page" ).bind( "pagebeforeshow", function() {
+ $navbtns.filter( ".ui-state-persist" ).addClass( $.mobile.activeBtnClass );
+ });
}
});
//auto self-init widgets
-$( document ).delegate( $.mobile.dialog.prototype.options.initSelector, "pagecreate", function(){
- $.mobile.dialog.prototype.enhance( this );
-});
-
-})( jQuery, this );
-
-(function( $, undefined ) {
-
-$.fn.fieldcontain = function( options ) {
- return this.addClass( "ui-field-contain ui-body ui-br" );
-};
-
-//auto self-init widgets
-$( document ).bind( "pagecreate create", function( e ){
- $( ":jqmData(role='fieldcontain')", e.target ).jqmEnhanceable().fieldcontain();
+$( document ).bind( "pagecreate create", function( e ) {
+ $.mobile.navbar.prototype.enhanceWithin( e.target );
});
})( jQuery );
(function( $, undefined ) {
-$.fn.grid = function( options ) {
- return this.each(function() {
-
- var $this = $( this ),
- o = $.extend({
- grid: null
- },options),
- $kids = $this.children(),
- gridCols = {solo:1, a:2, b:3, c:4, d:5},
- grid = o.grid,
- iterator;
-
- if ( !grid ) {
- if ( $kids.length <= 5 ) {
- for ( var letter in gridCols ) {
- if ( gridCols[ letter ] === $kids.length ) {
- grid = letter;
- }
- }
- } else {
- grid = "a";
- }
- }
- iterator = gridCols[grid];
+//Keeps track of the number of lists per page UID
+//This allows support for multiple nested list in the same page
+//https://github.com/jquery/jquery-mobile/issues/1617
+var listCountPerPage = {};
- $this.addClass( "ui-grid-" + grid );
+$.widget( "mobile.listview", $.mobile.widget, {
- $kids.filter( ":nth-child(" + iterator + "n+1)" ).addClass( "ui-block-a" );
+ options: {
+ theme: null,
+ countTheme: "c",
+ headerTheme: "b",
+ dividerTheme: "b",
+ splitIcon: "arrow-r",
+ splitTheme: "b",
+ inset: false,
+ initSelector: ":jqmData(role='listview')"
+ },
- if ( iterator > 1 ) {
- $kids.filter( ":nth-child(" + iterator + "n+2)" ).addClass( "ui-block-b" );
- }
- if ( iterator > 2 ) {
- $kids.filter( ":nth-child(3n+3)" ).addClass( "ui-block-c" );
- }
- if ( iterator > 3 ) {
- $kids.filter( ":nth-child(4n+4)" ).addClass( "ui-block-d" );
- }
- if ( iterator > 4 ) {
- $kids.filter( ":nth-child(5n+5)" ).addClass( "ui-block-e" );
- }
- });
-};
-})( jQuery );
+ _create: function() {
+ var t = this,
+ listviewClasses = "";
-(function( $, undefined ) {
+ listviewClasses += t.options.inset ? " ui-listview-inset ui-corner-all ui-shadow " : "";
-$( document ).bind( "pagecreate create", function( e ){
- $( ":jqmData(role='nojs')", e.target ).addClass( "ui-nojs" );
-
-});
+ // create listview markup
+ t.element.addClass(function( i, orig ) {
+ return orig + " ui-listview " + listviewClasses;
+ });
-})( jQuery );
+ t.refresh( true );
+ },
-( function( $, undefined ) {
+ _removeCorners: function( li, which ) {
+ var top = "ui-corner-top ui-corner-tr ui-corner-tl",
+ bot = "ui-corner-bottom ui-corner-br ui-corner-bl";
-$.fn.buttonMarkup = function( options ) {
- var $workingSet = this;
+ li = li.add( li.find( ".ui-btn-inner, .ui-li-link-alt, .ui-li-thumb" ) );
- // Enforce options to be of type string
- options = ( options && ( $.type( options ) == "object" ) )? options : {};
- for ( var i = 0; i < $workingSet.length; i++ ) {
- var el = $workingSet.eq( i ),
- e = el[ 0 ],
- o = $.extend( {}, $.fn.buttonMarkup.defaults, {
- icon: options.icon !== undefined ? options.icon : el.jqmData( "icon" ),
- iconpos: options.iconpos !== undefined ? options.iconpos : el.jqmData( "iconpos" ),
- theme: options.theme !== undefined ? options.theme : el.jqmData( "theme" ) || $.mobile.getInheritedTheme( el, "c" ),
- inline: options.inline !== undefined ? options.inline : el.jqmData( "inline" ),
- shadow: options.shadow !== undefined ? options.shadow : el.jqmData( "shadow" ),
- corners: options.corners !== undefined ? options.corners : el.jqmData( "corners" ),
- iconshadow: options.iconshadow !== undefined ? options.iconshadow : el.jqmData( "iconshadow" ),
- mini: options.mini !== undefined ? options.mini : el.jqmData( "mini" )
- }, options ),
+ if ( which === "top" ) {
+ li.removeClass( top );
+ } else if ( which === "bottom" ) {
+ li.removeClass( bot );
+ } else {
+ li.removeClass( top + " " + bot );
+ }
+ },
- // Classes Defined
- innerClass = "ui-btn-inner",
- textClass = "ui-btn-text",
- buttonClass, iconClass,
- // Button inner markup
- buttonInner,
- buttonText,
- buttonIcon,
- buttonElements;
+ _refreshCorners: function( create ) {
+ var $li,
+ $visibleli,
+ $topli,
+ $bottomli;
- $.each(o, function(key, value) {
- e.setAttribute( "data-" + $.mobile.ns + key, value );
- el.jqmData(key, value);
- });
+ $li = this.element.children( "li" );
+ // At create time and when autodividers calls refresh the li are not visible yet so we need to rely on .ui-screen-hidden
+ $visibleli = create || $li.filter( ":visible" ).length === 0 ? $li.not( ".ui-screen-hidden" ) : $li.filter( ":visible" );
- // Check if this element is already enhanced
- buttonElements = $.data(((e.tagName === "INPUT" || e.tagName === "BUTTON") ? e.parentNode : e), "buttonElements");
+ // ui-li-last is used for setting border-bottom on the last li
+ $li.filter( ".ui-li-last" ).removeClass( "ui-li-last" );
+
+ if ( this.options.inset ) {
+ this._removeCorners( $li );
- if (buttonElements) {
- e = buttonElements.outer;
- el = $(e);
- buttonInner = buttonElements.inner;
- buttonText = buttonElements.text;
- // We will recreate this icon below
- $(buttonElements.icon).remove();
- buttonElements.icon = null;
- }
- else {
- buttonInner = document.createElement( o.wrapperEls );
- buttonText = document.createElement( o.wrapperEls );
- }
- buttonIcon = o.icon ? document.createElement( "span" ) : null;
+ // Select the first visible li element
+ $topli = $visibleli.first()
+ .addClass( "ui-corner-top" );
- if ( attachEvents && !buttonElements) {
- attachEvents();
- }
-
- // if not, try to find closest theme container
- if ( !o.theme ) {
- o.theme = $.mobile.getInheritedTheme( el, "c" );
- }
+ $topli.add( $topli.find( ".ui-btn-inner" )
+ .not( ".ui-li-link-alt span:first-child" ) )
+ .addClass( "ui-corner-top" )
+ .end()
+ .find( ".ui-li-link-alt, .ui-li-link-alt span:first-child" )
+ .addClass( "ui-corner-tr" )
+ .end()
+ .find( ".ui-li-thumb" )
+ .not( ".ui-li-icon" )
+ .addClass( "ui-corner-tl" );
- buttonClass = "ui-btn ui-btn-up-" + o.theme;
- buttonClass += o.inline ? " ui-btn-inline" : "";
- buttonClass += o.shadow ? " ui-shadow" : "";
- buttonClass += o.corners ? " ui-btn-corner-all" : "";
+ // Select the last visible li element
+ $bottomli = $visibleli.last()
+ .addClass( "ui-corner-bottom ui-li-last" );
- if ( o.mini !== undefined ) {
- // Used to control styling in headers/footers, where buttons default to `mini` style.
- buttonClass += o.mini ? " ui-mini" : " ui-fullsize";
+ $bottomli.add( $bottomli.find( ".ui-btn-inner" ) )
+ .find( ".ui-li-link-alt" )
+ .addClass( "ui-corner-br" )
+ .end()
+ .find( ".ui-li-thumb" )
+ .not( ".ui-li-icon" )
+ .addClass( "ui-corner-bl" );
+ } else {
+ $visibleli.last().addClass( "ui-li-last" );
}
-
- if ( o.inline !== undefined ) {
- // Used to control styling in headers/footers, where buttons default to `mini` style.
- buttonClass += o.inline === false ? " ui-btn-block" : " ui-btn-inline";
+ if ( !create ) {
+ this.element.trigger( "updatelayout" );
}
-
-
- if ( o.icon ) {
- o.icon = "ui-icon-" + o.icon;
- o.iconpos = o.iconpos || "left";
-
- iconClass = "ui-icon " + o.icon;
+ },
- if ( o.iconshadow ) {
- iconClass += " ui-icon-shadow";
+ // This is a generic utility method for finding the first
+ // node with a given nodeName. It uses basic DOM traversal
+ // to be fast and is meant to be a substitute for simple
+ // $.fn.closest() and $.fn.children() calls on a single
+ // element. Note that callers must pass both the lowerCase
+ // and upperCase version of the nodeName they are looking for.
+ // The main reason for this is that this function will be
+ // called many times and we want to avoid having to lowercase
+ // the nodeName from the element every time to ensure we have
+ // a match. Note that this function lives here for now, but may
+ // be moved into $.mobile if other components need a similar method.
+ _findFirstElementByTagName: function( ele, nextProp, lcName, ucName ) {
+ var dict = {};
+ dict[ lcName ] = dict[ ucName ] = true;
+ while ( ele ) {
+ if ( dict[ ele.nodeName ] ) {
+ return ele;
}
+ ele = ele[ nextProp ];
}
-
- if ( o.iconpos ) {
- buttonClass += " ui-btn-icon-" + o.iconpos;
-
- if ( o.iconpos == "notext" && !el.attr( "title" ) ) {
- el.attr( "title", el.getEncodedText() );
+ return null;
+ },
+ _getChildrenByTagName: function( ele, lcName, ucName ) {
+ var results = [],
+ dict = {};
+ dict[ lcName ] = dict[ ucName ] = true;
+ ele = ele.firstChild;
+ while ( ele ) {
+ if ( dict[ ele.nodeName ] ) {
+ results.push( ele );
}
+ ele = ele.nextSibling;
}
-
- innerClass += o.corners ? " ui-btn-corner-all" : "";
+ return $( results );
+ },
- if ( o.iconpos && o.iconpos === "notext" && !el.attr( "title" ) ) {
- el.attr( "title", el.getEncodedText() );
+ _addThumbClasses: function( containers ) {
+ var i, img, len = containers.length;
+ for ( i = 0; i < len; i++ ) {
+ img = $( this._findFirstElementByTagName( containers[ i ].firstChild, "nextSibling", "img", "IMG" ) );
+ if ( img.length ) {
+ img.addClass( "ui-li-thumb" );
+ $( this._findFirstElementByTagName( img[ 0 ].parentNode, "parentNode", "li", "LI" ) ).addClass( img.is( ".ui-li-icon" ) ? "ui-li-has-icon" : "ui-li-has-thumb" );
+ }
}
+ },
- if ( buttonElements ) {
- el.removeClass( buttonElements.bcls || "" );
- }
- el.removeClass( "ui-link" ).addClass( buttonClass );
+ refresh: function( create ) {
+ this.parentPage = this.element.closest( ".ui-page" );
+ this._createSubPages();
- buttonInner.className = innerClass;
+ var o = this.options,
+ $list = this.element,
+ self = this,
+ dividertheme = $list.jqmData( "dividertheme" ) || o.dividerTheme,
+ listsplittheme = $list.jqmData( "splittheme" ),
+ listspliticon = $list.jqmData( "spliticon" ),
+ li = this._getChildrenByTagName( $list[ 0 ], "li", "LI" ),
+ ol = !!$.nodeName( $list[ 0 ], "ol" ),
+ jsCount = !$.support.cssPseudoElement,
+ start = $list.attr( "start" ),
+ itemClassDict = {},
+ item, itemClass, itemTheme,
+ a, last, splittheme, counter, startCount, newStartCount, countParent, icon, imgParents, img, linkIcon;
- buttonText.className = textClass;
- if ( !buttonElements ) {
- buttonInner.appendChild( buttonText );
- }
- if ( buttonIcon ) {
- buttonIcon.className = iconClass;
- if ( !(buttonElements && buttonElements.icon) ) {
- buttonIcon.appendChild( document.createTextNode("\u00a0") );
- buttonInner.appendChild( buttonIcon );
- }
+ if ( ol && jsCount ) {
+ $list.find( ".ui-li-dec" ).remove();
}
- while ( e.firstChild && !buttonElements) {
- buttonText.appendChild( e.firstChild );
+ if ( ol ) {
+ // Check if a start attribute has been set while taking a value of 0 into account
+ if ( start || start === 0 ) {
+ if ( !jsCount ) {
+ startCount = parseFloat( start ) - 1;
+ $list.css( "counter-reset", "listnumbering " + startCount );
+ } else {
+ counter = parseFloat( start );
+ }
+ } else if ( jsCount ) {
+ counter = 1;
+ }
}
- if ( !buttonElements ) {
- e.appendChild( buttonInner );
+ if ( !o.theme ) {
+ o.theme = $.mobile.getInheritedTheme( this.element, "c" );
}
- // Assign a structure containing the elements of this button to the elements of this button. This
- // will allow us to recognize this as an already-enhanced button in future calls to buttonMarkup().
- buttonElements = {
- bcls : buttonClass,
- outer : e,
- inner : buttonInner,
- text : buttonText,
- icon : buttonIcon
- };
-
- $.data(e, 'buttonElements', buttonElements);
- $.data(buttonInner, 'buttonElements', buttonElements);
- $.data(buttonText, 'buttonElements', buttonElements);
- if (buttonIcon) {
- $.data(buttonIcon, 'buttonElements', buttonElements);
- }
- }
+ for ( var pos = 0, numli = li.length; pos < numli; pos++ ) {
+ item = li.eq( pos );
+ itemClass = "ui-li";
- return this;
-};
+ // If we're creating the element, we update it regardless
+ if ( create || !item.hasClass( "ui-li" ) ) {
+ itemTheme = item.jqmData( "theme" ) || o.theme;
+ a = this._getChildrenByTagName( item[ 0 ], "a", "A" );
+ var isDivider = ( item.jqmData( "role" ) === "list-divider" );
-$.fn.buttonMarkup.defaults = {
- corners: true,
- shadow: true,
- iconshadow: true,
- wrapperEls: "span"
-};
+ if ( a.length && !isDivider ) {
+ icon = item.jqmData( "icon" );
-function closestEnabledButton( element ) {
- var cname;
+ item.buttonMarkup({
+ wrapperEls: "div",
+ shadow: false,
+ corners: false,
+ iconpos: "right",
+ icon: a.length > 1 || icon === false ? false : icon || "arrow-r",
+ theme: itemTheme
+ });
- while ( element ) {
- // Note that we check for typeof className below because the element we
- // handed could be in an SVG DOM where className on SVG elements is defined to
- // be of a different type (SVGAnimatedString). We only operate on HTML DOM
- // elements, so we look for plain "string".
- cname = ( typeof element.className === 'string' ) && (element.className + ' ');
- if ( cname && cname.indexOf("ui-btn ") > -1 && cname.indexOf("ui-disabled ") < 0 ) {
- break;
- }
+ if ( ( icon !== false ) && ( a.length === 1 ) ) {
+ item.addClass( "ui-li-has-arrow" );
+ }
- element = element.parentNode;
- }
+ a.first().removeClass( "ui-link" ).addClass( "ui-link-inherit" );
- return element;
-}
+ if ( a.length > 1 ) {
+ itemClass += " ui-li-has-alt";
-var attachEvents = function() {
- var hoverDelay = $.mobile.buttonMarkup.hoverDelay, hov, foc;
+ last = a.last();
+ splittheme = listsplittheme || last.jqmData( "theme" ) || o.splitTheme;
+ linkIcon = last.jqmData( "icon" );
- $( document ).bind( {
- "vmousedown vmousecancel vmouseup vmouseover vmouseout focus blur scrollstart": function( event ) {
- var theme,
- $btn = $( closestEnabledButton( event.target ) ),
- evt = event.type;
-
- if ( $btn.length ) {
- theme = $btn.attr( "data-" + $.mobile.ns + "theme" );
-
- if ( evt === "vmousedown" ) {
- if ( $.support.touch ) {
- hov = setTimeout(function() {
- $btn.removeClass( "ui-btn-up-" + theme ).addClass( "ui-btn-down-" + theme );
- }, hoverDelay );
- } else {
- $btn.removeClass( "ui-btn-up-" + theme ).addClass( "ui-btn-down-" + theme );
- }
- } else if ( evt === "vmousecancel" || evt === "vmouseup" ) {
- $btn.removeClass( "ui-btn-down-" + theme ).addClass( "ui-btn-up-" + theme );
- } else if ( evt === "vmouseover" || evt === "focus" ) {
- if ( $.support.touch ) {
- foc = setTimeout(function() {
- $btn.removeClass( "ui-btn-up-" + theme ).addClass( "ui-btn-hover-" + theme );
- }, hoverDelay );
- } else {
- $btn.removeClass( "ui-btn-up-" + theme ).addClass( "ui-btn-hover-" + theme );
- }
- } else if ( evt === "vmouseout" || evt === "blur" || evt === "scrollstart" ) {
- $btn.removeClass( "ui-btn-hover-" + theme + " ui-btn-down-" + theme ).addClass( "ui-btn-up-" + theme );
- if ( hov ) {
- clearTimeout( hov );
+ last.appendTo( item )
+ .attr( "title", last.getEncodedText() )
+ .addClass( "ui-li-link-alt" )
+ .empty()
+ .buttonMarkup({
+ shadow: false,
+ corners: false,
+ theme: itemTheme,
+ icon: false,
+ iconpos: "notext"
+ })
+ .find( ".ui-btn-inner" )
+ .append(
+ $( document.createElement( "span" ) ).buttonMarkup({
+ shadow: true,
+ corners: true,
+ theme: splittheme,
+ iconpos: "notext",
+ // link icon overrides list item icon overrides ul element overrides options
+ icon: linkIcon || icon || listspliticon || o.splitIcon
+ })
+ );
}
- if ( foc ) {
- clearTimeout( foc );
+ } else if ( isDivider ) {
+
+ itemClass += " ui-li-divider ui-bar-" + dividertheme;
+ item.attr( "role", "heading" );
+
+ if ( ol ) {
+ //reset counter when a divider heading is encountered
+ if ( start || start === 0 ) {
+ if ( !jsCount ) {
+ newStartCount = parseFloat( start ) - 1;
+ item.css( "counter-reset", "listnumbering " + newStartCount );
+ } else {
+ counter = parseFloat( start );
+ }
+ } else if ( jsCount ) {
+ counter = 1;
+ }
}
+
+ } else {
+ itemClass += " ui-li-static ui-btn-up-" + itemTheme;
}
}
- },
- "focusin focus": function( event ){
- $( closestEnabledButton( event.target ) ).addClass( $.mobile.focusClass );
- },
- "focusout blur": function( event ){
- $( closestEnabledButton( event.target ) ).removeClass( $.mobile.focusClass );
+
+ if ( ol && jsCount && itemClass.indexOf( "ui-li-divider" ) < 0 ) {
+ countParent = itemClass.indexOf( "ui-li-static" ) > 0 ? item : item.find( ".ui-link-inherit" );
+
+ countParent.addClass( "ui-li-jsnumbering" )
+ .prepend( "<span class='ui-li-dec'>" + ( counter++ ) + ". </span>" );
+ }
+
+ // Instead of setting item class directly on the list item and its
+ // btn-inner at this point in time, push the item into a dictionary
+ // that tells us what class to set on it so we can do this after this
+ // processing loop is finished.
+
+ if ( !itemClassDict[ itemClass ] ) {
+ itemClassDict[ itemClass ] = [];
+ }
+
+ itemClassDict[ itemClass ].push( item[ 0 ] );
}
- });
- attachEvents = null;
-};
+ // Set the appropriate listview item classes on each list item
+ // and their btn-inner elements. The main reason we didn't do this
+ // in the for-loop above is because we can eliminate per-item function overhead
+ // by calling addClass() and children() once or twice afterwards. This
+ // can give us a significant boost on platforms like WP7.5.
-//links in bars, or those with data-role become buttons
-//auto self-init widgets
-$( document ).bind( "pagecreate create", function( e ){
+ for ( itemClass in itemClassDict ) {
+ $( itemClassDict[ itemClass ] ).addClass( itemClass ).children( ".ui-btn-inner" ).addClass( itemClass );
+ }
- $( ":jqmData(role='button'), .ui-bar > a, .ui-header > a, .ui-footer > a, .ui-bar > :jqmData(role='controlgroup') > a", e.target )
- .not( ".ui-btn, :jqmData(role='none'), :jqmData(role='nojs')" )
- .buttonMarkup();
-});
+ $list.find( "h1, h2, h3, h4, h5, h6" ).addClass( "ui-li-heading" )
+ .end()
-})( jQuery );
+ .find( "p, dl" ).addClass( "ui-li-desc" )
+ .end()
+ .find( ".ui-li-aside" ).each(function() {
+ var $this = $( this );
+ $this.prependTo( $this.parent() ); //shift aside to front for css float
+ })
+ .end()
-(function( $, undefined ) {
+ .find( ".ui-li-count" ).each(function() {
+ $( this ).closest( "li" ).addClass( "ui-li-has-count" );
+ }).addClass( "ui-btn-up-" + ( $list.jqmData( "counttheme" ) || this.options.countTheme) + " ui-btn-corner-all" );
-$.mobile.page.prototype.options.backBtnText = "Back";
-$.mobile.page.prototype.options.addBackBtn = false;
-$.mobile.page.prototype.options.backBtnTheme = null;
-$.mobile.page.prototype.options.headerTheme = "a";
-$.mobile.page.prototype.options.footerTheme = "a";
-$.mobile.page.prototype.options.contentTheme = null;
+ // The idea here is to look at the first image in the list item
+ // itself, and any .ui-link-inherit element it may contain, so we
+ // can place the appropriate classes on the image and list item.
+ // Note that we used to use something like:
+ //
+ // li.find(">img:eq(0), .ui-link-inherit>img:eq(0)").each( ... );
+ //
+ // But executing a find() like that on Windows Phone 7.5 took a
+ // really long time. Walking things manually with the code below
+ // allows the 400 listview item page to load in about 3 seconds as
+ // opposed to 30 seconds.
-$( document ).delegate( ":jqmData(role='page'), :jqmData(role='dialog')", "pagecreate", function( e ) {
+ this._addThumbClasses( li );
+ this._addThumbClasses( $list.find( ".ui-link-inherit" ) );
- var $page = $( this ),
- o = $page.data( "page" ).options,
- pageRole = $page.jqmData( "role" ),
- pageTheme = o.theme;
+ this._refreshCorners( create );
- $( ":jqmData(role='header'), :jqmData(role='footer'), :jqmData(role='content')", this )
- .jqmEnhanceable()
- .each(function() {
+ // autodividers binds to this to redraw dividers after the listview refresh
+ this._trigger( "afterrefresh" );
+ },
- var $this = $( this ),
- role = $this.jqmData( "role" ),
- theme = $this.jqmData( "theme" ),
- contentTheme = theme || o.contentTheme || ( pageRole === "dialog" && pageTheme ),
- $headeranchors,
- leftbtn,
- rightbtn,
- backBtn;
+ //create a string for ID/subpage url creation
+ _idStringEscape: function( str ) {
+ return str.replace(/[^a-zA-Z0-9]/g, '-');
+ },
- $this.addClass( "ui-" + role );
+ _createSubPages: function() {
+ var parentList = this.element,
+ parentPage = parentList.closest( ".ui-page" ),
+ parentUrl = parentPage.jqmData( "url" ),
+ parentId = parentUrl || parentPage[ 0 ][ $.expando ],
+ parentListId = parentList.attr( "id" ),
+ o = this.options,
+ dns = "data-" + $.mobile.ns,
+ self = this,
+ persistentFooterID = parentPage.find( ":jqmData(role='footer')" ).jqmData( "id" ),
+ hasSubPages;
- //apply theming and markup modifications to page,header,content,footer
- if ( role === "header" || role === "footer" ) {
+ if ( typeof listCountPerPage[ parentId ] === "undefined" ) {
+ listCountPerPage[ parentId ] = -1;
+ }
- var thisTheme = theme || ( role === "header" ? o.headerTheme : o.footerTheme ) || pageTheme;
+ parentListId = parentListId || ++listCountPerPage[ parentId ];
- $this
- //add theme class
- .addClass( "ui-bar-" + thisTheme )
- // Add ARIA role
- .attr( "role", role === "header" ? "banner" : "contentinfo" );
+ $( parentList.find( "li>ul, li>ol" ).toArray().reverse() ).each(function( i ) {
+ var self = this,
+ list = $( this ),
+ listId = list.attr( "id" ) || parentListId + "-" + i,
+ parent = list.parent(),
+ nodeElsFull = $( list.prevAll().toArray().reverse() ),
+ nodeEls = nodeElsFull.length ? nodeElsFull : $( "<span>" + $.trim(parent.contents()[ 0 ].nodeValue) + "</span>" ),
+ title = nodeEls.first().getEncodedText(),//url limits to first 30 chars of text
+ id = ( parentUrl || "" ) + "&" + $.mobile.subPageUrlKey + "=" + listId,
+ theme = list.jqmData( "theme" ) || o.theme,
+ countTheme = list.jqmData( "counttheme" ) || parentList.jqmData( "counttheme" ) || o.countTheme,
+ newPage, anchor;
- if( role === "header") {
- // Right,left buttons
- $headeranchors = $this.children( "a" );
- leftbtn = $headeranchors.hasClass( "ui-btn-left" );
- rightbtn = $headeranchors.hasClass( "ui-btn-right" );
+ //define hasSubPages for use in later removal
+ hasSubPages = true;
- leftbtn = leftbtn || $headeranchors.eq( 0 ).not( ".ui-btn-right" ).addClass( "ui-btn-left" ).length;
+ newPage = list.detach()
+ .wrap( "<div " + dns + "role='page' " + dns + "url='" + id + "' " + dns + "theme='" + theme + "' " + dns + "count-theme='" + countTheme + "'><div " + dns + "role='content'></div></div>" )
+ .parent()
+ .before( "<div " + dns + "role='header' " + dns + "theme='" + o.headerTheme + "'><div class='ui-title'>" + title + "</div></div>" )
+ .after( persistentFooterID ? $( "<div " + dns + "role='footer' " + dns + "id='"+ persistentFooterID +"'>" ) : "" )
+ .parent()
+ .appendTo( $.mobile.pageContainer );
- rightbtn = rightbtn || $headeranchors.eq( 1 ).addClass( "ui-btn-right" ).length;
- }
+ newPage.page();
- // Auto-add back btn on pages beyond first view
- if ( o.addBackBtn &&
- role === "header" &&
- $( ".ui-page" ).length > 1 &&
- $page.jqmData( "url" ) !== $.mobile.path.stripHash( location.hash ) &&
- !leftbtn ) {
+ anchor = parent.find( 'a:first' );
- backBtn = $( "<a href='#' class='ui-btn-left' data-"+ $.mobile.ns +"rel='back' data-"+ $.mobile.ns +"icon='arrow-l'>"+ o.backBtnText +"</a>" )
- // If theme is provided, override default inheritance
- .attr( "data-"+ $.mobile.ns +"theme", o.backBtnTheme || thisTheme )
- .prependTo( $this );
+ if ( !anchor.length ) {
+ anchor = $( "<a/>" ).html( nodeEls || title ).prependTo( parent.empty() );
}
- // Page title
- $this.children( "h1, h2, h3, h4, h5, h6" )
- .addClass( "ui-title" )
- // Regardless of h element number in src, it becomes h1 for the enhanced page
- .attr({
- "role": "heading",
- "aria-level": "1"
- });
+ anchor.attr( "href", "#" + id );
- } else if ( role === "content" ) {
- if ( contentTheme ) {
- $this.addClass( "ui-body-" + ( contentTheme ) );
- }
+ }).listview();
- // Add ARIA role
- $this.attr( "role", "main" );
- }
- });
-});
+ // on pagehide, remove any nested pages along with the parent page, as long as they aren't active
+ // and aren't embedded
+ if ( hasSubPages &&
+ parentPage.is( ":jqmData(external-page='true')" ) &&
+ parentPage.data( "page" ).options.domCache === false ) {
-})( jQuery );
+ var newRemove = function( e, ui ) {
+ var nextPage = ui.nextPage, npURL,
+ prEvent = new $.Event( "pageremove" );
-(function( $, undefined ) {
+ if ( ui.nextPage ) {
+ npURL = nextPage.jqmData( "url" );
+ if ( npURL.indexOf( parentUrl + "&" + $.mobile.subPageUrlKey ) !== 0 ) {
+ self.childPages().remove();
+ parentPage.trigger( prEvent );
+ if ( !prEvent.isDefaultPrevented() ) {
+ parentPage.removeWithDependents();
+ }
+ }
+ }
+ };
-$.widget( "mobile.collapsible", $.mobile.widget, {
- options: {
- expandCueText: " click to expand contents",
- collapseCueText: " click to collapse contents",
- collapsed: true,
- heading: "h1,h2,h3,h4,h5,h6,legend",
- theme: null,
- contentTheme: null,
- iconTheme: "d",
- mini: false,
- initSelector: ":jqmData(role='collapsible')"
+ // unbind the original page remove and replace with our specialized version
+ parentPage
+ .unbind( "pagehide.remove" )
+ .bind( "pagehide.remove", newRemove);
+ }
},
- _create: function() {
- var $el = this.element,
- o = this.options,
- collapsible = $el.addClass( "ui-collapsible" ),
- collapsibleHeading = $el.children( o.heading ).first(),
- collapsibleContent = collapsible.wrapInner( "<div class='ui-collapsible-content'></div>" ).find( ".ui-collapsible-content" ),
- collapsibleSet = $el.closest( ":jqmData(role='collapsible-set')" ).addClass( "ui-collapsible-set" );
+ // TODO sort out a better way to track sub pages of the listview this is brittle
+ childPages: function() {
+ var parentUrl = this.parentPage.jqmData( "url" );
- // Replace collapsibleHeading if it's a legend
- if ( collapsibleHeading.is( "legend" ) ) {
- collapsibleHeading = $( "<div role='heading'>"+ collapsibleHeading.html() +"</div>" ).insertBefore( collapsibleHeading );
- collapsibleHeading.next().remove();
- }
+ return $( ":jqmData(url^='"+ parentUrl + "&" + $.mobile.subPageUrlKey + "')" );
+ }
+});
- // If we are in a collapsible set
- if ( collapsibleSet.length ) {
- // Inherit the theme from collapsible-set
- if ( !o.theme ) {
- o.theme = collapsibleSet.jqmData("theme") || $.mobile.getInheritedTheme( collapsibleSet, "c" );
- }
- // Inherit the content-theme from collapsible-set
- if ( !o.contentTheme ) {
- o.contentTheme = collapsibleSet.jqmData( "content-theme" );
- }
+//auto self-init widgets
+$( document ).bind( "pagecreate create", function( e ) {
+ $.mobile.listview.prototype.enhanceWithin( e.target );
+});
- // Gets the preference icon position in the set
- if ( !o.iconPos ) {
- o.iconPos = collapsibleSet.jqmData( "iconpos" );
- }
+})( jQuery );
- if( !o.mini ) {
- o.mini = collapsibleSet.jqmData( "mini" );
- }
- }
- collapsibleContent.addClass( ( o.contentTheme ) ? ( "ui-body-" + o.contentTheme ) : "");
+(function( $, undefined ) {
- collapsibleHeading
- //drop heading in before content
- .insertBefore( collapsibleContent )
- //modify markup & attributes
- .addClass( "ui-collapsible-heading" )
- .append( "<span class='ui-collapsible-heading-status'></span>" )
- .wrapInner( "<a href='#' class='ui-collapsible-heading-toggle'></a>" )
- .find( "a" )
- .first()
- .buttonMarkup({
- shadow: false,
- corners: false,
- iconpos: $el.jqmData( "iconpos" ) || o.iconPos || "left",
- icon: "plus",
- mini: o.mini,
- theme: o.theme
- })
- .add( ".ui-btn-inner", $el )
- .addClass( "ui-corner-top ui-corner-bottom" );
+$.mobile.listview.prototype.options.autodividers = false;
+$.mobile.listview.prototype.options.autodividersSelector = function( elt ) {
+ // look for the text in the given element
+ var text = elt.text() || null;
- //events
- collapsible
- .bind( "expand collapse", function( event ) {
- if ( !event.isDefaultPrevented() ) {
+ if ( !text ) {
+ return null;
+ }
- event.preventDefault();
+ // create the text for the divider (first uppercased letter)
+ text = text.slice( 0, 1 ).toUpperCase();
- var $this = $( this ),
- isCollapse = ( event.type === "collapse" ),
- contentTheme = o.contentTheme;
+ return text;
+};
+
+$( document ).delegate( "ul,ol", "listviewcreate", function() {
+
+ var list = $( this ),
+ listview = list.data( "listview" );
- collapsibleHeading
- .toggleClass( "ui-collapsible-heading-collapsed", isCollapse)
- .find( ".ui-collapsible-heading-status" )
- .text( isCollapse ? o.expandCueText : o.collapseCueText )
- .end()
- .find( ".ui-icon" )
- .toggleClass( "ui-icon-minus", !isCollapse )
- .toggleClass( "ui-icon-plus", isCollapse );
+ if ( !listview || !listview.options.autodividers ) {
+ return;
+ }
- $this.toggleClass( "ui-collapsible-collapsed", isCollapse );
- collapsibleContent.toggleClass( "ui-collapsible-content-collapsed", isCollapse ).attr( "aria-hidden", isCollapse );
+ var replaceDividers = function () {
+ list.find( "li:jqmData(role='list-divider')" ).remove();
- if ( contentTheme && ( !collapsibleSet.length || collapsible.jqmData( "collapsible-last" ) ) ) {
- collapsibleHeading
- .find( "a" ).first().add( collapsibleHeading.find( ".ui-btn-inner" ) )
- .toggleClass( "ui-corner-bottom", isCollapse );
- collapsibleContent.toggleClass( "ui-corner-bottom", !isCollapse );
- }
- collapsibleContent.trigger( "updatelayout" );
- }
- })
- .trigger( o.collapsed ? "collapse" : "expand" );
+ var lis = list.find( 'li' ),
+ lastDividerText = null, li, dividerText;
- collapsibleHeading
- .bind( "click", function( event ) {
+ for ( var i = 0; i < lis.length ; i++ ) {
+ li = lis[i];
+ dividerText = listview.options.autodividersSelector( $( li ) );
- var type = collapsibleHeading.is( ".ui-collapsible-heading-collapsed" ) ?
- "expand" : "collapse";
+ if ( dividerText && lastDividerText !== dividerText ) {
+ var divider = document.createElement( 'li' );
+ divider.appendChild( document.createTextNode( dividerText ) );
+ divider.setAttribute( 'data-' + $.mobile.ns + 'role', 'list-divider' );
+ li.parentNode.insertBefore( divider, li );
+ }
- collapsible.trigger( type );
+ lastDividerText = dividerText;
+ }
+ };
- event.preventDefault();
- });
- }
-});
+ var afterListviewRefresh = function () {
+ list.unbind( 'listviewafterrefresh', afterListviewRefresh );
+ replaceDividers();
+ listview.refresh();
+ list.bind( 'listviewafterrefresh', afterListviewRefresh );
+ };
-//auto self-init widgets
-$( document ).bind( "pagecreate create", function( e ){
- $.mobile.collapsible.prototype.enhanceWithin( e.target );
+ afterListviewRefresh();
});
})( jQuery );
+/*
+* "checkboxradio" plugin
+*/
+
(function( $, undefined ) {
-$.widget( "mobile.collapsibleset", $.mobile.widget, {
+$.widget( "mobile.checkboxradio", $.mobile.widget, {
options: {
- initSelector: ":jqmData(role='collapsible-set')"
+ theme: null,
+ initSelector: "input[type='checkbox'],input[type='radio']"
},
_create: function() {
- var $el = this.element.addClass( "ui-collapsible-set" ),
- o = this.options;
+ var self = this,
+ input = this.element,
+ inheritAttr = function( input, dataAttr ) {
+ return input.jqmData( dataAttr ) || input.closest( "form, fieldset" ).jqmData( dataAttr );
+ },
+ // NOTE: Windows Phone could not find the label through a selector
+ // filter works though.
+ parentLabel = $( input ).closest( "label" ),
+ label = parentLabel.length ? parentLabel : $( input ).closest( "form, fieldset, :jqmData(role='page'), :jqmData(role='dialog')" ).find( "label" ).filter( "[for='" + input[0].id + "']" ).first(),
+ inputtype = input[0].type,
+ mini = inheritAttr( input, "mini" ),
+ checkedState = inputtype + "-on",
+ uncheckedState = inputtype + "-off",
+ icon = input.parents( ":jqmData(type='horizontal')" ).length ? undefined : uncheckedState,
+ iconpos = inheritAttr( input, "iconpos" ),
+ activeBtn = icon ? "" : " " + $.mobile.activeBtnClass,
+ checkedClass = "ui-" + checkedState + activeBtn,
+ uncheckedClass = "ui-" + uncheckedState,
+ checkedicon = "ui-icon-" + checkedState,
+ uncheckedicon = "ui-icon-" + uncheckedState;
- // Inherit the theme from collapsible-set
- if ( !o.theme ) {
- o.theme = $.mobile.getInheritedTheme( $el, "c" );
- }
- // Inherit the content-theme from collapsible-set
- if ( !o.contentTheme ) {
- o.contentTheme = $el.jqmData( "content-theme" );
+ if ( inputtype !== "checkbox" && inputtype !== "radio" ) {
+ return;
}
- if ( !o.corners ) {
- o.corners = $el.jqmData( "corners" ) === undefined ? true : false;
- }
+ // Expose for other methods
+ $.extend( this, {
+ label: label,
+ inputtype: inputtype,
+ checkedClass: checkedClass,
+ uncheckedClass: uncheckedClass,
+ checkedicon: checkedicon,
+ uncheckedicon: uncheckedicon
+ });
- // Initialize the collapsible set if it's not already initialized
- if ( !$el.jqmData( "collapsiblebound" ) ) {
- $el
- .jqmData( "collapsiblebound", true )
- .bind( "expand collapse", function( event ) {
- var isCollapse = ( event.type === "collapse" ),
- collapsible = $( event.target ).closest( ".ui-collapsible" ),
- widget = collapsible.data( "collapsible" ),
- contentTheme = widget.options.contentTheme;
- if ( contentTheme && collapsible.jqmData( "collapsible-last" ) ) {
- collapsible.find( widget.options.heading ).first()
- .find( "a" ).first()
- .add( ".ui-btn-inner" )
- .toggleClass( "ui-corner-bottom", isCollapse );
- collapsible.find( ".ui-collapsible-content" ).toggleClass( "ui-corner-bottom", !isCollapse );
- }
- })
- .bind( "expand", function( event ) {
- $( event.target )
- .closest( ".ui-collapsible" )
- .siblings( ".ui-collapsible" )
- .trigger( "collapse" );
- });
+ // If there's no selected theme check the data attr
+ if ( !this.options.theme ) {
+ this.options.theme = $.mobile.getInheritedTheme( this.element, "c" );
}
- },
- _init: function() {
- this.refresh();
- },
+ label.buttonMarkup({
+ theme: this.options.theme,
+ icon: icon,
+ shadow: false,
+ mini: mini,
+ iconpos: iconpos
+ });
- refresh: function() {
- var $el = this.element,
- o = this.options,
- collapsiblesInSet = $el.children( ":jqmData(role='collapsible')" );
+ // Wrap the input + label in a div
+ var wrapper = document.createElement('div');
+ wrapper.className = 'ui-' + inputtype;
- $.mobile.collapsible.prototype.enhance( collapsiblesInSet.not( ".ui-collapsible" ) );
+ input.add( label ).wrapAll( wrapper );
- // clean up borders
- collapsiblesInSet.each( function() {
- $( this ).find( $.mobile.collapsible.prototype.options.heading )
- .find( "a" ).first()
- .add( ".ui-btn-inner" )
- .removeClass( "ui-corner-top ui-corner-bottom" );
+ label.bind({
+ vmouseover: function( event ) {
+ if ( $( this ).parent().is( ".ui-disabled" ) ) {
+ event.stopPropagation();
+ }
+ },
+
+ vclick: function( event ) {
+ if ( input.is( ":disabled" ) ) {
+ event.preventDefault();
+ return;
+ }
+
+ self._cacheVals();
+
+ input.prop( "checked", inputtype === "radio" && true || !input.prop( "checked" ) );
+
+ // trigger click handler's bound directly to the input as a substitute for
+ // how label clicks behave normally in the browsers
+ // TODO: it would be nice to let the browser's handle the clicks and pass them
+ // through to the associate input. we can swallow that click at the parent
+ // wrapper element level
+ input.triggerHandler( 'click' );
+
+ // Input set for common radio buttons will contain all the radio
+ // buttons, but will not for checkboxes. clearing the checked status
+ // of other radios ensures the active button state is applied properly
+ self._getInputSet().not( input ).prop( "checked", false );
+
+ self._updateAll();
+ return false;
+ }
});
- collapsiblesInSet.first()
- .find( "a" )
- .first()
- .addClass( o.corners ? "ui-corner-top" : "" )
- .find( ".ui-btn-inner" )
- .addClass( "ui-corner-top" );
+ input
+ .bind({
+ vmousedown: function() {
+ self._cacheVals();
+ },
- collapsiblesInSet.last()
- .jqmData( "collapsible-last", true )
- .find( "a" )
- .first()
- .addClass( o.corners ? "ui-corner-bottom" : "" )
- .find( ".ui-btn-inner" )
- .addClass( "ui-corner-bottom" );
- }
-});
+ vclick: function() {
+ var $this = $( this );
-//auto self-init widgets
-$( document ).bind( "pagecreate create", function( e ){
- $.mobile.collapsibleset.prototype.enhanceWithin( e.target );
-});
+ // Adds checked attribute to checked input when keyboard is used
+ if ( $this.is( ":checked" ) ) {
-})( jQuery );
+ $this.prop( "checked", true);
+ self._getInputSet().not( $this ).prop( "checked", false );
+ } else {
-(function( $, undefined ) {
+ $this.prop( "checked", false );
+ }
-$.widget( "mobile.navbar", $.mobile.widget, {
- options: {
- iconpos: "top",
- grid: null,
- initSelector: ":jqmData(role='navbar')"
- },
+ self._updateAll();
+ },
- _create: function(){
+ focus: function() {
+ label.addClass( $.mobile.focusClass );
+ },
- var $navbar = this.element,
- $navbtns = $navbar.find( "a" ),
- iconpos = $navbtns.filter( ":jqmData(icon)" ).length ?
- this.options.iconpos : undefined;
+ blur: function() {
+ label.removeClass( $.mobile.focusClass );
+ }
+ });
- $navbar.addClass( "ui-navbar" )
- .attr( "role","navigation" )
- .find( "ul" )
- .jqmEnhanceable()
- .grid({ grid: this.options.grid });
+ this.refresh();
+ },
+
+ _cacheVals: function() {
+ this._getInputSet().each(function() {
+ $( this ).jqmData( "cacheVal", this.checked );
+ });
+ },
- if ( !iconpos ) {
- $navbar.addClass( "ui-navbar-noicons" );
+ //returns either a set of radios with the same name attribute, or a single checkbox
+ _getInputSet: function() {
+ if ( this.inputtype === "checkbox" ) {
+ return this.element;
}
- $navbtns.buttonMarkup({
- corners: false,
- shadow: false,
- inline: true,
- iconpos: iconpos
- });
+ return this.element.closest( "form, fieldset, :jqmData(role='page'), :jqmData(role='dialog')" )
+ .find( "input[name='" + this.element[0].name + "'][type='" + this.inputtype + "']" );
+ },
- $navbar.delegate( "a", "vclick", function( event ) {
- if( !$(event.target).hasClass("ui-disabled") ) {
- $navbtns.removeClass( $.mobile.activeBtnClass );
- $( this ).addClass( $.mobile.activeBtnClass );
+ _updateAll: function() {
+ var self = this;
+
+ this._getInputSet().each(function() {
+ var $this = $( this );
+
+ if ( this.checked || self.inputtype === "checkbox" ) {
+ $this.trigger( "change" );
}
- });
+ })
+ .checkboxradio( "refresh" );
+ },
- // Buttons in the navbar with ui-state-persist class should regain their active state before page show
- $navbar.closest( ".ui-page" ).bind( "pagebeforeshow", function() {
- $navbtns.filter( ".ui-state-persist" ).addClass( $.mobile.activeBtnClass );
- });
+ refresh: function() {
+ var input = this.element[0],
+ label = this.label,
+ icon = label.find( ".ui-icon" );
+
+ if ( input.checked ) {
+ label.addClass( this.checkedClass ).removeClass( this.uncheckedClass );
+ icon.addClass( this.checkedicon ).removeClass( this.uncheckedicon );
+ } else {
+ label.removeClass( this.checkedClass ).addClass( this.uncheckedClass );
+ icon.removeClass( this.checkedicon ).addClass( this.uncheckedicon );
+ }
+
+ if ( input.disabled ) {
+ this.disable();
+ } else {
+ this.enable();
+ }
+ },
+
+ disable: function() {
+ this.element.prop( "disabled", true ).parent().addClass( "ui-disabled" );
+ },
+
+ enable: function() {
+ this.element.prop( "disabled", false ).parent().removeClass( "ui-disabled" );
}
});
//auto self-init widgets
-$( document ).bind( "pagecreate create", function( e ){
- $.mobile.navbar.prototype.enhanceWithin( e.target );
+$( document ).bind( "pagecreate create", function( e ) {
+ $.mobile.checkboxradio.prototype.enhanceWithin( e.target, true );
});
})( jQuery );
(function( $, undefined ) {
-//Keeps track of the number of lists per page UID
-//This allows support for multiple nested list in the same page
-//https://github.com/jquery/jquery-mobile/issues/1617
-var listCountPerPage = {};
-
-$.widget( "mobile.listview", $.mobile.widget, {
-
+$.widget( "mobile.button", $.mobile.widget, {
options: {
theme: null,
- countTheme: "c",
- headerTheme: "b",
- dividerTheme: "b",
- splitIcon: "arrow-r",
- splitTheme: "b",
- mini: false,
- inset: false,
- initSelector: ":jqmData(role='listview')"
+ icon: null,
+ iconpos: null,
+ corners: true,
+ shadow: true,
+ iconshadow: true,
+ initSelector: "button, [type='button'], [type='submit'], [type='reset']"
},
-
_create: function() {
- var t = this,
- listviewClasses = "";
-
- listviewClasses += t.options.inset ? " ui-listview-inset ui-corner-all ui-shadow " : "";
- listviewClasses += t.element.jqmData( "mini" ) || t.options.mini === true ? " ui-mini" : "";
-
- // create listview markup
- t.element.addClass(function( i, orig ) {
- return orig + " ui-listview " + listviewClasses;
+ var $el = this.element,
+ $button,
+ o = this.options,
+ type,
+ name,
+ inline = o.inline || $el.jqmData( "inline" ),
+ mini = o.mini || $el.jqmData( "mini" ),
+ classes = "",
+ $buttonPlaceholder;
+
+ // if this is a link, check if it's been enhanced and, if not, use the right function
+ if ( $el[ 0 ].tagName === "A" ) {
+ if ( !$el.hasClass( "ui-btn" ) ) {
+ $el.buttonMarkup();
+ }
+
+ return;
+ }
+
+ // get the inherited theme
+ // TODO centralize for all widgets
+ if ( !this.options.theme ) {
+ this.options.theme = $.mobile.getInheritedTheme( this.element, "c" );
+ }
+
+ // TODO: Post 1.1--once we have time to test thoroughly--any classes manually applied to the original element should be carried over to the enhanced element, with an `-enhanced` suffix. See https://github.com/jquery/jquery-mobile/issues/3577
+ /* if ( $el[0].className.length ) {
+ classes = $el[0].className;
+ } */
+ if ( !!~$el[0].className.indexOf( "ui-btn-left" ) ) {
+ classes = "ui-btn-left";
+ }
+
+ if ( !!~$el[0].className.indexOf( "ui-btn-right" ) ) {
+ classes = "ui-btn-right";
+ }
+
+ if ( $el.attr( "type" ) === "submit" || $el.attr( "type" ) === "reset" ) {
+ classes ? classes += " ui-submit" : classes = "ui-submit";
+ }
+ $( "label[for='" + $el.attr( "id" ) + "']" ).addClass( "ui-submit" );
+
+ // Add ARIA role
+ this.button = $( "<div></div>" )
+ [ $el.html() ? "html" : "text" ]( $el.html() || $el.val() )
+ .insertBefore( $el )
+ .buttonMarkup({
+ theme: o.theme,
+ icon: o.icon,
+ iconpos: o.iconpos,
+ inline: inline,
+ corners: o.corners,
+ shadow: o.shadow,
+ iconshadow: o.iconshadow,
+ mini: mini
+ })
+ .addClass( classes )
+ .append( $el.addClass( "ui-btn-hidden" ) );
+
+ $button = this.button;
+ type = $el.attr( "type" );
+ name = $el.attr( "name" );
+
+ // Add hidden input during submit if input type="submit" has a name.
+ if ( type !== "button" && type !== "reset" && name ) {
+ $el.bind( "vclick", function() {
+ // Add hidden input if it doesn't already exist.
+ if ( $buttonPlaceholder === undefined ) {
+ $buttonPlaceholder = $( "<input>", {
+ type: "hidden",
+ name: $el.attr( "name" ),
+ value: $el.attr( "value" )
+ }).insertBefore( $el );
+
+ // Bind to doc to remove after submit handling
+ $( document ).one( "submit", function() {
+ $buttonPlaceholder.remove();
+
+ // reset the local var so that the hidden input
+ // will be re-added on subsequent clicks
+ $buttonPlaceholder = undefined;
+ });
+ }
+ });
+ }
+
+ $el.bind({
+ focus: function() {
+ $button.addClass( $.mobile.focusClass );
+ },
+
+ blur: function() {
+ $button.removeClass( $.mobile.focusClass );
+ }
});
- t.refresh( true );
+ this.refresh();
},
- _removeCorners: function( li, which ) {
- var top = "ui-corner-top ui-corner-tr ui-corner-tl",
- bot = "ui-corner-bottom ui-corner-br ui-corner-bl";
+ enable: function() {
+ this.element.attr( "disabled", false );
+ this.button.removeClass( "ui-disabled" ).attr( "aria-disabled", false );
+ return this._setOption( "disabled", false );
+ },
- li = li.add( li.find( ".ui-btn-inner, .ui-li-link-alt, .ui-li-thumb" ) );
+ disable: function() {
+ this.element.attr( "disabled", true );
+ this.button.addClass( "ui-disabled" ).attr( "aria-disabled", true );
+ return this._setOption( "disabled", true );
+ },
- if ( which === "top" ) {
- li.removeClass( top );
- } else if ( which === "bottom" ) {
- li.removeClass( bot );
+ refresh: function() {
+ var $el = this.element;
+
+ if ( $el.prop("disabled") ) {
+ this.disable();
} else {
- li.removeClass( top + " " + bot );
+ this.enable();
}
- },
- _refreshCorners: function( create ) {
- var $li,
- $visibleli,
- $topli,
- $bottomli;
+ // Grab the button's text element from its implementation-independent data item
+ $( this.button.data( 'buttonElements' ).text )[ $el.html() ? "html" : "text" ]( $el.html() || $el.val() );
+ }
+});
- if ( this.options.inset ) {
- $li = this.element.children( "li" );
- // at create time the li are not visible yet so we need to rely on .ui-screen-hidden
- $visibleli = create?$li.not( ".ui-screen-hidden" ):$li.filter( ":visible" );
+//auto self-init widgets
+$( document ).bind( "pagecreate create", function( e ) {
+ $.mobile.button.prototype.enhanceWithin( e.target, true );
+});
- this._removeCorners( $li );
+})( jQuery );
- // Select the first visible li element
- $topli = $visibleli.first()
- .addClass( "ui-corner-top" );
+(function( $, undefined ) {
- $topli.add( $topli.find( ".ui-btn-inner" )
- .not( ".ui-li-link-alt span:first-child" ) )
- .addClass( "ui-corner-top" )
- .end()
- .find( ".ui-li-link-alt, .ui-li-link-alt span:first-child" )
- .addClass( "ui-corner-tr" )
- .end()
- .find( ".ui-li-thumb" )
- .not(".ui-li-icon")
- .addClass( "ui-corner-tl" );
+$.fn.controlgroup = function( options ) {
+ function flipClasses( els, flCorners ) {
+ els.removeClass( "ui-btn-corner-all ui-corner-top ui-corner-bottom ui-corner-left ui-corner-right ui-controlgroup-last ui-shadow" )
+ .eq( 0 ).addClass( flCorners[ 0 ] )
+ .end()
+ .last().addClass( flCorners[ 1 ] ).addClass( "ui-controlgroup-last" );
+ }
- // Select the last visible li element
- $bottomli = $visibleli.last()
- .addClass( "ui-corner-bottom" );
+ return this.each(function() {
+ var $el = $( this ),
+ o = $.extend({
+ direction: $el.jqmData( "type" ) || "vertical",
+ shadow: false,
+ excludeInvisible: true,
+ mini: $el.jqmData( "mini" )
+ }, options ),
+ grouplegend = $el.children( "legend" ),
+ groupheading = $el.children( ".ui-controlgroup-label" ),
+ groupcontrols = $el.children( ".ui-controlgroup-controls" ),
+ flCorners = o.direction === "horizontal" ? [ "ui-corner-left", "ui-corner-right" ] : [ "ui-corner-top", "ui-corner-bottom" ],
+ type = $el.find( "input" ).first().attr( "type" );
- $bottomli.add( $bottomli.find( ".ui-btn-inner" ) )
- .find( ".ui-li-link-alt" )
- .addClass( "ui-corner-br" )
- .end()
- .find( ".ui-li-thumb" )
- .not(".ui-li-icon")
- .addClass( "ui-corner-bl" );
- }
- if ( !create ) {
- this.element.trigger( "updatelayout" );
+ // First unwrap the controls if the controlgroup was already enhanced
+ if ( groupcontrols.length ) {
+ groupcontrols.contents().unwrap();
}
- },
+ $el.wrapInner( "<div class='ui-controlgroup-controls'></div>" );
- // This is a generic utility method for finding the first
- // node with a given nodeName. It uses basic DOM traversal
- // to be fast and is meant to be a substitute for simple
- // $.fn.closest() and $.fn.children() calls on a single
- // element. Note that callers must pass both the lowerCase
- // and upperCase version of the nodeName they are looking for.
- // The main reason for this is that this function will be
- // called many times and we want to avoid having to lowercase
- // the nodeName from the element every time to ensure we have
- // a match. Note that this function lives here for now, but may
- // be moved into $.mobile if other components need a similar method.
- _findFirstElementByTagName: function( ele, nextProp, lcName, ucName )
- {
- var dict = {};
- dict[ lcName ] = dict[ ucName ] = true;
- while ( ele ) {
- if ( dict[ ele.nodeName ] ) {
- return ele;
- }
- ele = ele[ nextProp ];
+ if ( grouplegend.length ) {
+ // Replace legend with more stylable replacement div
+ $( "<div role='heading' class='ui-controlgroup-label'>" + grouplegend.html() + "</div>" ).insertBefore( $el.children( 0 ) );
+ grouplegend.remove();
+ } else if ( groupheading.length ) {
+ // Just move the heading if the controlgroup was already enhanced
+ $el.prepend( groupheading );
}
- return null;
- },
- _getChildrenByTagName: function( ele, lcName, ucName )
- {
- var results = [],
- dict = {};
- dict[ lcName ] = dict[ ucName ] = true;
- ele = ele.firstChild;
- while ( ele ) {
- if ( dict[ ele.nodeName ] ) {
- results.push( ele );
- }
- ele = ele.nextSibling;
+
+ $el.addClass( "ui-corner-all ui-controlgroup ui-controlgroup-" + o.direction );
+
+ flipClasses( $el.find( ".ui-btn" + ( o.excludeInvisible ? ":visible" : "" ) ).not( '.ui-slider-handle' ), flCorners );
+ flipClasses( $el.find( ".ui-btn-inner" ), flCorners );
+
+ if ( o.shadow ) {
+ $el.addClass( "ui-shadow" );
}
- return $( results );
- },
- _addThumbClasses: function( containers )
- {
- var i, img, len = containers.length;
- for ( i = 0; i < len; i++ ) {
- img = $( this._findFirstElementByTagName( containers[ i ].firstChild, "nextSibling", "img", "IMG" ) );
- if ( img.length ) {
- img.addClass( "ui-li-thumb" );
- $( this._findFirstElementByTagName( img[ 0 ].parentNode, "parentNode", "li", "LI" ) ).addClass( img.is( ".ui-li-icon" ) ? "ui-li-has-icon" : "ui-li-has-thumb" );
- }
+ if ( o.mini ) {
+ $el.addClass( "ui-mini" );
}
- },
- refresh: function( create ) {
- this.parentPage = this.element.closest( ".ui-page" );
- this._createSubPages();
+ });
+};
- var o = this.options,
- $list = this.element,
- self = this,
- dividertheme = $list.jqmData( "dividertheme" ) || o.dividerTheme,
- listsplittheme = $list.jqmData( "splittheme" ),
- listspliticon = $list.jqmData( "spliticon" ),
- li = this._getChildrenByTagName( $list[ 0 ], "li", "LI" ),
- counter = $.support.cssPseudoElement || !$.nodeName( $list[ 0 ], "ol" ) ? 0 : 1,
- itemClassDict = {},
- item, itemClass, itemTheme,
- a, last, splittheme, countParent, icon, imgParents, img, linkIcon;
+// The pagecreate handler for controlgroup is in jquery.mobile.init because of the soft-dependency on the wrapped widgets
- if ( counter ) {
- $list.find( ".ui-li-dec" ).remove();
- }
+})(jQuery);
+
+(function( $, undefined ) {
+
+$( document ).bind( "pagecreate create", function( e ) {
+
+ //links within content areas, tests included with page
+ $( e.target )
+ .find( "a" )
+ .jqmEnhanceable()
+ .not( ".ui-btn, .ui-link-inherit, :jqmData(role='none'), :jqmData(role='nojs')" )
+ .addClass( "ui-link" );
- if ( !o.theme ) {
- o.theme = $.mobile.getInheritedTheme( this.element, "c" );
- }
+});
- for ( var pos = 0, numli = li.length; pos < numli; pos++ ) {
- item = li.eq( pos );
- itemClass = "ui-li";
+})( jQuery );
- // If we're creating the element, we update it regardless
- if ( create || !item.hasClass( "ui-li" ) ) {
- itemTheme = item.jqmData("theme") || o.theme;
- a = this._getChildrenByTagName( item[ 0 ], "a", "A" );
- if ( a.length ) {
- icon = item.jqmData("icon");
+(function( $, undefined ) {
- item.buttonMarkup({
- wrapperEls: "div",
- shadow: false,
- corners: false,
- iconpos: "right",
- icon: a.length > 1 || icon === false ? false : icon || "arrow-r",
- theme: itemTheme
- });
+ function fitSegmentInsideSegment( winSize, segSize, offset, desired ) {
+ var ret = desired;
- if ( ( icon != false ) && ( a.length == 1 ) ) {
- item.addClass( "ui-li-has-arrow" );
- }
+ if ( winSize < segSize ) {
+ // Center segment if it's bigger than the window
+ ret = offset + ( winSize - segSize ) / 2;
+ } else {
+ // Otherwise center it at the desired coordinate while keeping it completely inside the window
+ ret = Math.min( Math.max( offset, desired - segSize / 2 ), offset + winSize - segSize );
+ }
- a.first().removeClass( "ui-link" ).addClass( "ui-link-inherit" );
+ return ret;
+ }
- if ( a.length > 1 ) {
- itemClass += " ui-li-has-alt";
+ function windowCoords() {
+ var $win = $( window );
- last = a.last();
- splittheme = listsplittheme || last.jqmData( "theme" ) || o.splitTheme;
- linkIcon = last.jqmData("icon");
+ return {
+ x: $win.scrollLeft(),
+ y: $win.scrollTop(),
+ cx: ( window.innerWidth || $win.width() ),
+ cy: ( window.innerHeight || $win.height() )
+ };
+ }
- last.appendTo(item)
- .attr( "title", last.getEncodedText() )
- .addClass( "ui-li-link-alt" )
- .empty()
- .buttonMarkup({
- shadow: false,
- corners: false,
- theme: itemTheme,
- icon: false,
- iconpos: false
- })
- .find( ".ui-btn-inner" )
- .append(
- $( document.createElement( "span" ) ).buttonMarkup({
- shadow: true,
- corners: true,
- theme: splittheme,
- iconpos: "notext",
- // link icon overrides list item icon overrides ul element overrides options
- icon: linkIcon || icon || listspliticon || o.splitIcon
- })
- );
- }
- } else if ( item.jqmData( "role" ) === "list-divider" ) {
+ $.widget( "mobile.popup", $.mobile.widget, {
+ options: {
+ theme: null,
+ overlayTheme: null,
+ shadow: true,
+ corners: true,
+ transition: "none",
+ positionTo: "origin",
+ tolerance: null,
+ initSelector: ":jqmData(role='popup')",
+ closeLinkSelector: "a:jqmData(rel='back')",
+ closeLinkEvents: "click.popup",
+ navigateEvents: "navigate.popup",
+ closeEvents: "navigate.popup pagebeforechange.popup",
+
+ // NOTE Windows Phone 7 has a scroll position caching issue that
+ // requires us to disable popup history management by default
+ // https://github.com/jquery/jquery-mobile/issues/4784
+ //
+ // NOTE this option is modified in _create!
+ history: !$.mobile.browser.ie
+ },
- itemClass += " ui-li-divider ui-bar-" + dividertheme;
- item.attr( "role", "heading" );
+ _eatEventAndClose: function( e ) {
+ e.preventDefault();
+ e.stopImmediatePropagation();
+ this.close();
+ return false;
+ },
- //reset counter when a divider heading is encountered
- if ( counter ) {
- counter = 1;
- }
+ // Make sure the screen size is increased beyond the page height if the popup's causes the document to increase in height
+ _resizeScreen: function() {
+ var popupHeight = this._ui.container.outerHeight( true );
- } else {
- itemClass += " ui-li-static ui-body-" + itemTheme;
- }
+ this._ui.screen.removeAttr( "style" );
+ if ( popupHeight > this._ui.screen.height() ) {
+ this._ui.screen.height( popupHeight );
}
+ },
- if ( counter && itemClass.indexOf( "ui-li-divider" ) < 0 ) {
- countParent = item.is( ".ui-li-static:first" ) ? item : item.find( ".ui-link-inherit" );
-
- countParent.addClass( "ui-li-jsnumbering" )
- .prepend( "<span class='ui-li-dec'>" + (counter++) + ". </span>" );
+ _handleWindowKeyUp: function( e ) {
+ if ( this._isOpen && e.keyCode === $.mobile.keyCode.ESCAPE ) {
+ return this._eatEventAndClose( e );
}
+ },
- // Instead of setting item class directly on the list item and its
- // btn-inner at this point in time, push the item into a dictionary
- // that tells us what class to set on it so we can do this after this
- // processing loop is finished.
+ _maybeRefreshTimeout: function() {
+ var winCoords = windowCoords();
- if ( !itemClassDict[ itemClass ] ) {
- itemClassDict[ itemClass ] = [];
+ if ( this._resizeData ) {
+ if ( winCoords.x === this._resizeData.winCoords.x &&
+ winCoords.y === this._resizeData.winCoords.y &&
+ winCoords.cx === this._resizeData.winCoords.cx &&
+ winCoords.cy === this._resizeData.winCoords.cy ) {
+ // timeout not refreshed
+ return false;
+ } else {
+ // clear existing timeout - it will be refreshed below
+ clearTimeout( this._resizeData.timeoutId );
+ }
}
- itemClassDict[ itemClass ].push( item[ 0 ] );
- }
-
- // Set the appropriate listview item classes on each list item
- // and their btn-inner elements. The main reason we didn't do this
- // in the for-loop above is because we can eliminate per-item function overhead
- // by calling addClass() and children() once or twice afterwards. This
- // can give us a significant boost on platforms like WP7.5.
+ this._resizeData = {
+ timeoutId: setTimeout( $.proxy( this, "_resizeTimeout" ), 200 ),
+ winCoords: winCoords
+ };
- for ( itemClass in itemClassDict ) {
- $( itemClassDict[ itemClass ] ).addClass( itemClass ).children( ".ui-btn-inner" ).addClass( itemClass );
- }
+ return true;
+ },
- $list.find( "h1, h2, h3, h4, h5, h6" ).addClass( "ui-li-heading" )
- .end()
+ _resizeTimeout: function() {
+ if ( !this._maybeRefreshTimeout() ) {
+ // effectively rapid-open the popup while leaving the screen intact
+ this._trigger( "beforeposition" );
+ this._ui.container
+ .removeClass( "ui-selectmenu-hidden" )
+ .offset( this._placementCoords( this._desiredCoords( undefined, undefined, "window" ) ) );
+
+ this._resizeScreen();
+ this._resizeData = null;
+ this._orientationchangeInProgress = false;
+ }
+ },
- .find( "p, dl" ).addClass( "ui-li-desc" )
- .end()
+ _handleWindowResize: function( e ) {
+ if ( this._isOpen ) {
+ this._maybeRefreshTimeout();
+ }
+ },
- .find( ".ui-li-aside" ).each(function() {
- var $this = $(this);
- $this.prependTo( $this.parent() ); //shift aside to front for css float
- })
- .end()
+ _handleWindowOrientationchange: function( e ) {
- .find( ".ui-li-count" ).each( function() {
- $( this ).closest( "li" ).addClass( "ui-li-has-count" );
- }).addClass( "ui-btn-up-" + ( $list.jqmData( "counttheme" ) || this.options.countTheme) + " ui-btn-corner-all" );
+ if ( !this._orientationchangeInProgress ) {
+ // effectively rapid-close the popup while leaving the screen intact
+ this._ui.container
+ .addClass( "ui-selectmenu-hidden" )
+ .removeAttr( "style" );
- // The idea here is to look at the first image in the list item
- // itself, and any .ui-link-inherit element it may contain, so we
- // can place the appropriate classes on the image and list item.
- // Note that we used to use something like:
- //
- // li.find(">img:eq(0), .ui-link-inherit>img:eq(0)").each( ... );
- //
- // But executing a find() like that on Windows Phone 7.5 took a
- // really long time. Walking things manually with the code below
- // allows the 400 listview item page to load in about 3 seconds as
- // opposed to 30 seconds.
+ this._orientationchangeInProgress = true;
+ }
+ },
- this._addThumbClasses( li );
- this._addThumbClasses( $list.find( ".ui-link-inherit" ) );
+ _create: function() {
+ var ui = {
+ screen: $( "<div class='ui-screen-hidden ui-popup-screen'></div>" ),
+ placeholder: $( "<div style='display: none;'><!-- placeholder --></div>" ),
+ container: $( "<div class='ui-popup-container ui-selectmenu-hidden'></div>" )
+ },
+ thisPage = this.element.closest( ".ui-page" ),
+ myId = this.element.attr( "id" ),
+ self = this;
- this._refreshCorners( create );
- },
+ // We need to adjust the history option to be false if there's no AJAX nav.
+ // We can't do it in the option declarations because those are run before
+ // it is determined whether there shall be AJAX nav.
+ this.options.history = this.options.history && $.mobile.ajaxEnabled && $.mobile.hashListeningEnabled;
- //create a string for ID/subpage url creation
- _idStringEscape: function( str ) {
- return str.replace(/[^a-zA-Z0-9]/g, '-');
- },
+ if ( thisPage.length === 0 ) {
+ thisPage = $( "body" );
+ }
- _createSubPages: function() {
- var parentList = this.element,
- parentPage = parentList.closest( ".ui-page" ),
- parentUrl = parentPage.jqmData( "url" ),
- parentId = parentUrl || parentPage[ 0 ][ $.expando ],
- parentListId = parentList.attr( "id" ),
- o = this.options,
- dns = "data-" + $.mobile.ns,
- self = this,
- persistentFooterID = parentPage.find( ":jqmData(role='footer')" ).jqmData( "id" ),
- hasSubPages;
+ // define the container for navigation event bindings
+ // TODO this would be nice at the the mobile widget level
+ this.options.container = this.options.container || $.mobile.pageContainer;
+
+ // Apply the proto
+ thisPage.append( ui.screen );
+ ui.container.insertAfter( ui.screen );
+ // Leave a placeholder where the element used to be
+ ui.placeholder.insertAfter( this.element );
+ if ( myId ) {
+ ui.screen.attr( "id", myId + "-screen" );
+ ui.container.attr( "id", myId + "-popup" );
+ ui.placeholder.html( "<!-- placeholder for " + myId + " -->" );
+ }
+ ui.container.append( this.element );
+
+ // Add class to popup element
+ this.element.addClass( "ui-popup" );
+
+ // Define instance variables
+ $.extend( this, {
+ _page: thisPage,
+ _ui: ui,
+ _fallbackTransition: "",
+ _currentTransition: false,
+ _prereqs: null,
+ _isOpen: false,
+ _tolerance: null,
+ _resizeData: null,
+ _orientationchangeInProgress: false,
+ _globalHandlers: [
+ {
+ src: $( window ),
+ handler: {
+ orientationchange: $.proxy( this, "_handleWindowOrientationchange" ),
+ resize: $.proxy( this, "_handleWindowResize" ),
+ keyup: $.proxy( this, "_handleWindowKeyUp" )
+ }
+ }
+ ]
+ });
- if ( typeof listCountPerPage[ parentId ] === "undefined" ) {
- listCountPerPage[ parentId ] = -1;
- }
+ $.each( this.options, function( key, value ) {
+ // Cause initial options to be applied by their handler by temporarily setting the option to undefined
+ // - the handler then sets it to the initial value
+ self.options[ key ] = undefined;
+ self._setOption( key, value, true );
+ });
- parentListId = parentListId || ++listCountPerPage[ parentId ];
+ ui.screen.bind( "vclick", $.proxy( this, "_eatEventAndClose" ) );
- $( parentList.find( "li>ul, li>ol" ).toArray().reverse() ).each(function( i ) {
- var self = this,
- list = $( this ),
- listId = list.attr( "id" ) || parentListId + "-" + i,
- parent = list.parent(),
- nodeEls = $( list.prevAll().toArray().reverse() ),
- nodeEls = nodeEls.length ? nodeEls : $( "<span>" + $.trim(parent.contents()[ 0 ].nodeValue) + "</span>" ),
- title = nodeEls.first().getEncodedText(),//url limits to first 30 chars of text
- id = ( parentUrl || "" ) + "&" + $.mobile.subPageUrlKey + "=" + listId,
- theme = list.jqmData( "theme" ) || o.theme,
- countTheme = list.jqmData( "counttheme" ) || parentList.jqmData( "counttheme" ) || o.countTheme,
- newPage, anchor;
+ $.each( this._globalHandlers, function( idx, value ) {
+ value.src.bind( value.handler );
+ });
+ },
- //define hasSubPages for use in later removal
- hasSubPages = true;
+ _applyTheme: function( dst, theme, prefix ) {
+ var classes = ( dst.attr( "class" ) || "").split( " " ),
+ alreadyAdded = true,
+ currentTheme = null,
+ matches,
+ themeStr = String( theme );
+
+ while ( classes.length > 0 ) {
+ currentTheme = classes.pop();
+ matches = ( new RegExp( "^ui-" + prefix + "-([a-z])$" ) ).exec( currentTheme );
+ if ( matches && matches.length > 1 ) {
+ currentTheme = matches[ 1 ];
+ break;
+ } else {
+ currentTheme = null;
+ }
+ }
- newPage = list.detach()
- .wrap( "<div " + dns + "role='page' " + dns + "url='" + id + "' " + dns + "theme='" + theme + "' " + dns + "count-theme='" + countTheme + "'><div " + dns + "role='content'></div></div>" )
- .parent()
- .before( "<div " + dns + "role='header' " + dns + "theme='" + o.headerTheme + "'><div class='ui-title'>" + title + "</div></div>" )
- .after( persistentFooterID ? $( "<div " + dns + "role='footer' " + dns + "id='"+ persistentFooterID +"'>") : "" )
- .parent()
- .appendTo( $.mobile.pageContainer );
+ if ( theme !== currentTheme ) {
+ dst.removeClass( "ui-" + prefix + "-" + currentTheme );
+ if ( ! ( theme === null || theme === "none" ) ) {
+ dst.addClass( "ui-" + prefix + "-" + themeStr );
+ }
+ }
+ },
- newPage.page();
+ _setTheme: function( value ) {
+ this._applyTheme( this.element, value, "body" );
+ },
- anchor = parent.find('a:first');
+ _setOverlayTheme: function( value ) {
+ this._applyTheme( this._ui.screen, value, "overlay" );
- if ( !anchor.length ) {
- anchor = $( "<a/>" ).html( nodeEls || title ).prependTo( parent.empty() );
+ if ( this._isOpen ) {
+ this._ui.screen.addClass( "in" );
}
+ },
- anchor.attr( "href", "#" + id );
-
- }).listview();
-
- // on pagehide, remove any nested pages along with the parent page, as long as they aren't active
- // and aren't embedded
- if( hasSubPages &&
- parentPage.is( ":jqmData(external-page='true')" ) &&
- parentPage.data("page").options.domCache === false ) {
+ _setShadow: function( value ) {
+ this.element.toggleClass( "ui-overlay-shadow", value );
+ },
- var newRemove = function( e, ui ){
- var nextPage = ui.nextPage, npURL;
+ _setCorners: function( value ) {
+ this.element.toggleClass( "ui-corner-all", value );
+ },
- if( ui.nextPage ){
- npURL = nextPage.jqmData( "url" );
- if( npURL.indexOf( parentUrl + "&" + $.mobile.subPageUrlKey ) !== 0 ){
- self.childPages().remove();
- parentPage.remove();
- }
- }
- };
+ _applyTransition: function( value ) {
+ this._ui.container.removeClass( this._fallbackTransition );
+ if ( value && value !== "none" ) {
+ this._fallbackTransition = $.mobile._maybeDegradeTransition( value );
+ this._ui.container.addClass( this._fallbackTransition );
+ }
+ },
- // unbind the original page remove and replace with our specialized version
- parentPage
- .unbind( "pagehide.remove" )
- .bind( "pagehide.remove", newRemove);
- }
- },
+ _setTransition: function( value ) {
+ if ( !this._currentTransition ) {
+ this._applyTransition( value );
+ }
+ },
- // TODO sort out a better way to track sub pages of the listview this is brittle
- childPages: function(){
- var parentUrl = this.parentPage.jqmData( "url" );
+ _setTolerance: function( value ) {
+ var tol = { t: 30, r: 15, b: 30, l: 15 };
- return $( ":jqmData(url^='"+ parentUrl + "&" + $.mobile.subPageUrlKey +"')");
- }
-});
+ if ( value ) {
+ var ar = String( value ).split( "," );
-//auto self-init widgets
-$( document ).bind( "pagecreate create", function( e ){
- $.mobile.listview.prototype.enhanceWithin( e.target );
-});
+ $.each( ar, function( idx, val ) { ar[ idx ] = parseInt( val, 10 ); } );
-})( jQuery );
+ switch( ar.length ) {
+ // All values are to be the same
+ case 1:
+ if ( !isNaN( ar[ 0 ] ) ) {
+ tol.t = tol.r = tol.b = tol.l = ar[ 0 ];
+ }
+ break;
-/*
-* "checkboxradio" plugin
-*/
+ // The first value denotes top/bottom tolerance, and the second value denotes left/right tolerance
+ case 2:
+ if ( !isNaN( ar[ 0 ] ) ) {
+ tol.t = tol.b = ar[ 0 ];
+ }
+ if ( !isNaN( ar[ 1 ] ) ) {
+ tol.l = tol.r = ar[ 1 ];
+ }
+ break;
-(function( $, undefined ) {
+ // The array contains values in the order top, right, bottom, left
+ case 4:
+ if ( !isNaN( ar[ 0 ] ) ) {
+ tol.t = ar[ 0 ];
+ }
+ if ( !isNaN( ar[ 1 ] ) ) {
+ tol.r = ar[ 1 ];
+ }
+ if ( !isNaN( ar[ 2 ] ) ) {
+ tol.b = ar[ 2 ];
+ }
+ if ( !isNaN( ar[ 3 ] ) ) {
+ tol.l = ar[ 3 ];
+ }
+ break;
-$.widget( "mobile.checkboxradio", $.mobile.widget, {
- options: {
- theme: null,
- initSelector: "input[type='checkbox'],input[type='radio']"
- },
- _create: function() {
- var self = this,
- input = this.element,
- inheritAttr = function( input, dataAttr ) {
- return input.jqmData( dataAttr ) || input.closest( "form,fieldset" ).jqmData( dataAttr )
- },
- // NOTE: Windows Phone could not find the label through a selector
- // filter works though.
- parentLabel = $( input ).closest( "label" ),
- label = parentLabel.length ? parentLabel : $( input ).closest( "form,fieldset,:jqmData(role='page'),:jqmData(role='dialog')" ).find( "label" ).filter( "[for='" + input[0].id + "']" ),
- inputtype = input[0].type,
- mini = inheritAttr( input, "mini" ),
- checkedState = inputtype + "-on",
- uncheckedState = inputtype + "-off",
- icon = input.parents( ":jqmData(type='horizontal')" ).length ? undefined : uncheckedState,
- iconpos = inheritAttr( input, "iconpos" ),
- activeBtn = icon ? "" : " " + $.mobile.activeBtnClass,
- checkedClass = "ui-" + checkedState + activeBtn,
- uncheckedClass = "ui-" + uncheckedState,
- checkedicon = "ui-icon-" + checkedState,
- uncheckedicon = "ui-icon-" + uncheckedState;
+ default:
+ break;
+ }
+ }
- if ( inputtype !== "checkbox" && inputtype !== "radio" ) {
- return;
- }
+ this._tolerance = tol;
+ },
- // Expose for other methods
- $.extend( this, {
- label: label,
- inputtype: inputtype,
- checkedClass: checkedClass,
- uncheckedClass: uncheckedClass,
- checkedicon: checkedicon,
- uncheckedicon: uncheckedicon
- });
+ _setOption: function( key, value ) {
+ var exclusions, setter = "_set" + key.charAt( 0 ).toUpperCase() + key.slice( 1 );
- // If there's no selected theme check the data attr
- if( !this.options.theme ) {
- this.options.theme = $.mobile.getInheritedTheme( this.element, "c" );
- }
+ if ( this[ setter ] !== undefined ) {
+ this[ setter ]( value );
+ }
- label.buttonMarkup({
- theme: this.options.theme,
- icon: icon,
- shadow: false,
- mini: mini,
- iconpos: iconpos
- });
+ // TODO REMOVE FOR 1.2.1 by moving them out to a default options object
+ exclusions = [
+ "initSelector",
+ "closeLinkSelector",
+ "closeLinkEvents",
+ "navigateEvents",
+ "closeEvents",
+ "history",
+ "container"
+ ];
+
+ $.mobile.widget.prototype._setOption.apply( this, arguments );
+ if ( $.inArray( key, exclusions ) === -1 ) {
+ // Record the option change in the options and in the DOM data-* attributes
+ this.element.attr( "data-" + ( $.mobile.ns || "" ) + ( key.replace( /([A-Z])/, "-$1" ).toLowerCase() ), value );
+ }
+ },
- // Wrap the input + label in a div
- var wrapper = document.createElement('div');
- wrapper.className = 'ui-' + inputtype;
+ // Try and center the overlay over the given coordinates
+ _placementCoords: function( desired ) {
+ // rectangle within which the popup must fit
+ var
+ winCoords = windowCoords(),
+ rc = {
+ x: this._tolerance.l,
+ y: winCoords.y + this._tolerance.t,
+ cx: winCoords.cx - this._tolerance.l - this._tolerance.r,
+ cy: winCoords.cy - this._tolerance.t - this._tolerance.b
+ },
+ menuSize, ret;
- input.add( label ).wrapAll( wrapper );
+ // Clamp the width of the menu before grabbing its size
+ this._ui.container.css( "max-width", rc.cx );
+ menuSize = {
+ cx: this._ui.container.outerWidth( true ),
+ cy: this._ui.container.outerHeight( true )
+ };
- label.bind({
- vmouseover: function( event ) {
- if ( $( this ).parent().is( ".ui-disabled" ) ) {
- event.stopPropagation();
+ // Center the menu over the desired coordinates, while not going outside
+ // the window tolerances. This will center wrt. the window if the popup is too large.
+ ret = {
+ x: fitSegmentInsideSegment( rc.cx, menuSize.cx, rc.x, desired.x ),
+ y: fitSegmentInsideSegment( rc.cy, menuSize.cy, rc.y, desired.y )
+ };
+
+ // Make sure the top of the menu is visible
+ ret.y = Math.max( 0, ret.y );
+
+ // If the height of the menu is smaller than the height of the document
+ // align the bottom with the bottom of the document
+
+ // fix for $( document ).height() bug in core 1.7.2.
+ var docEl = document.documentElement, docBody = document.body,
+ docHeight = Math.max( docEl.clientHeight, docBody.scrollHeight, docBody.offsetHeight, docEl.scrollHeight, docEl.offsetHeight );
+
+ ret.y -= Math.min( ret.y, Math.max( 0, ret.y + menuSize.cy - docHeight ) );
+
+ return { left: ret.x, top: ret.y };
+ },
+
+ _createPrereqs: function( screenPrereq, containerPrereq, whenDone ) {
+ var self = this, prereqs;
+
+ // It is important to maintain both the local variable prereqs and self._prereqs. The local variable remains in
+ // the closure of the functions which call the callbacks passed in. The comparison between the local variable and
+ // self._prereqs is necessary, because once a function has been passed to .animationComplete() it will be called
+ // next time an animation completes, even if that's not the animation whose end the function was supposed to catch
+ // (for example, if an abort happens during the opening animation, the .animationComplete handler is not called for
+ // that animation anymore, but the handler remains attached, so it is called the next time the popup is opened
+ // - making it stale. Comparing the local variable prereqs to the widget-level variable self._prereqs ensures that
+ // callbacks triggered by a stale .animationComplete will be ignored.
+
+ prereqs = {
+ screen: $.Deferred(),
+ container: $.Deferred()
+ };
+
+ prereqs.screen.then( function() {
+ if ( prereqs === self._prereqs ) {
+ screenPrereq();
}
- },
+ });
- vclick: function( event ) {
- if ( input.is( ":disabled" ) ) {
- event.preventDefault();
- return;
+ prereqs.container.then( function() {
+ if ( prereqs === self._prereqs ) {
+ containerPrereq();
}
+ });
- self._cacheVals();
+ $.when( prereqs.screen, prereqs.container ).done( function() {
+ if ( prereqs === self._prereqs ) {
+ self._prereqs = null;
+ whenDone();
+ }
+ });
- input.prop( "checked", inputtype === "radio" && true || !input.prop( "checked" ) );
+ self._prereqs = prereqs;
+ },
- // trigger click handler's bound directly to the input as a substitute for
- // how label clicks behave normally in the browsers
- // TODO: it would be nice to let the browser's handle the clicks and pass them
- // through to the associate input. we can swallow that click at the parent
- // wrapper element level
- input.triggerHandler( 'click' );
+ _animate: function( args ) {
+ // NOTE before removing the default animation of the screen
+ // this had an animate callback that would relove the deferred
+ // now the deferred is resolved immediately
+ // TODO remove the dependency on the screen deferred
+ this._ui.screen
+ .removeClass( args.classToRemove )
+ .addClass( args.screenClassToAdd );
- // Input set for common radio buttons will contain all the radio
- // buttons, but will not for checkboxes. clearing the checked status
- // of other radios ensures the active button state is applied properly
- self._getInputSet().not( input ).prop( "checked", false );
+ args.prereqs.screen.resolve();
- self._updateAll();
- return false;
+ if ( args.transition && args.transition !== "none" ) {
+ if ( args.applyTransition ) {
+ this._applyTransition( args.transition );
+ }
+ this._ui.container
+ .animationComplete( $.proxy( args.prereqs.container, "resolve" ) )
+ .addClass( args.containerClassToAdd )
+ .removeClass( args.classToRemove );
+ } else {
+ args.prereqs.container.resolve();
}
- });
-
- input
- .bind({
- vmousedown: function() {
- self._cacheVals();
- },
+ },
- vclick: function() {
- var $this = $(this);
+ // The desired coordinates passed in will be returned untouched if no reference element can be identified via
+ // desiredPosition.positionTo. Nevertheless, this function ensures that its return value always contains valid
+ // x and y coordinates by specifying the center middle of the window if the coordinates are absent.
+ _desiredCoords: function( x, y, positionTo ) {
+ var dst = null, offset, winCoords = windowCoords();
+
+ // Establish which element will serve as the reference
+ if ( positionTo && positionTo !== "origin" ) {
+ if ( positionTo === "window" ) {
+ x = winCoords.cx / 2 + winCoords.x;
+ y = winCoords.cy / 2 + winCoords.y;
+ } else {
+ try {
+ dst = $( positionTo );
+ } catch( e ) {
+ dst = null;
+ }
+ if ( dst ) {
+ dst.filter( ":visible" );
+ if ( dst.length === 0 ) {
+ dst = null;
+ }
+ }
+ }
+ }
- // Adds checked attribute to checked input when keyboard is used
- if ( $this.is( ":checked" ) ) {
+ // If an element was found, center over it
+ if ( dst ) {
+ offset = dst.offset();
+ x = offset.left + dst.outerWidth() / 2;
+ y = offset.top + dst.outerHeight() / 2;
+ }
- $this.prop( "checked", true);
- self._getInputSet().not($this).prop( "checked", false );
- } else {
+ // Make sure x and y are valid numbers - center over the window
+ if ( $.type( x ) !== "number" || isNaN( x ) ) {
+ x = winCoords.cx / 2 + winCoords.x;
+ }
+ if ( $.type( y ) !== "number" || isNaN( y ) ) {
+ y = winCoords.cy / 2 + winCoords.y;
+ }
- $this.prop( "checked", false );
- }
+ return { x: x, y: y };
+ },
- self._updateAll();
- },
+ _openPrereqsComplete: function() {
+ var self = this;
- focus: function() {
- label.addClass( $.mobile.focusClass );
- },
+ self._ui.container.addClass( "ui-popup-active" );
+ self._isOpen = true;
+ self._resizeScreen();
- blur: function() {
- label.removeClass( $.mobile.focusClass );
- }
+ // Android appears to trigger the animation complete before the popup
+ // is visible. Allowing the stack to unwind before applying focus prevents
+ // the "blue flash" of element focus in android 4.0
+ setTimeout(function(){
+ self._ui.container.attr( "tabindex", "0" ).focus();
+ self._trigger( "afteropen" );
});
+ },
- this.refresh();
- },
+ _open: function( options ) {
+ var coords, transition,
+ androidBlacklist = ( function() {
+ var w = window,
+ ua = navigator.userAgent,
+ // Rendering engine is Webkit, and capture major version
+ wkmatch = ua.match( /AppleWebKit\/([0-9\.]+)/ ),
+ wkversion = !!wkmatch && wkmatch[ 1 ],
+ androidmatch = ua.match( /Android (\d+(?:\.\d+))/ ),
+ andversion = !!androidmatch && androidmatch[ 1 ],
+ chromematch = ua.indexOf( "Chrome" ) > -1;
+
+ // Platform is Android, WebKit version is greater than 534.13 ( Android 3.2.1 ) and not Chrome.
+ if( androidmatch !== null && andversion === "4.0" && wkversion && wkversion > 534.13 && !chromematch ) {
+ return true;
+ }
+ return false;
+ }());
- _cacheVals: function() {
- this._getInputSet().each(function() {
- $(this).jqmData( "cacheVal", this.checked );
- });
- },
+ // Make sure options is defined
+ options = ( options || {} );
- //returns either a set of radios with the same name attribute, or a single checkbox
- _getInputSet: function(){
- if(this.inputtype === "checkbox") {
- return this.element;
- }
+ // Copy out the transition, because we may be overwriting it later and we don't want to pass that change back to the caller
+ transition = options.transition || this.options.transition;
- return this.element.closest( "form,fieldset,:jqmData(role='page')" )
- .find( "input[name='"+ this.element[0].name +"'][type='"+ this.inputtype +"']" );
- },
+ // Give applications a chance to modify the contents of the container before it appears
+ this._trigger( "beforeposition" );
- _updateAll: function() {
- var self = this;
+ coords = this._placementCoords( this._desiredCoords( options.x, options.y, options.positionTo || this.options.positionTo || "origin" ) );
- this._getInputSet().each(function() {
- var $this = $(this);
+ // Count down to triggering "popupafteropen" - we have two prerequisites:
+ // 1. The popup window animation completes (container())
+ // 2. The screen opacity animation completes (screen())
+ this._createPrereqs(
+ $.noop,
+ $.noop,
+ $.proxy( this, "_openPrereqsComplete" ) );
- if ( this.checked || self.inputtype === "checkbox" ) {
- $this.trigger( "change" );
+ if ( transition ) {
+ this._currentTransition = transition;
+ this._applyTransition( transition );
+ } else {
+ transition = this.options.transition;
}
- })
- .checkboxradio( "refresh" );
- },
- refresh: function() {
- var input = this.element[0],
- label = this.label,
- icon = label.find( ".ui-icon" );
-
- if ( input.checked ) {
- label.addClass( this.checkedClass ).removeClass( this.uncheckedClass );
- icon.addClass( this.checkedicon ).removeClass( this.uncheckedicon );
- } else {
- label.removeClass( this.checkedClass ).addClass( this.uncheckedClass );
- icon.removeClass( this.checkedicon ).addClass( this.uncheckedicon );
- }
+ if ( !this.options.theme ) {
+ this._setTheme( this._page.jqmData( "theme" ) || $.mobile.getInheritedTheme( this._page, "c" ) );
+ }
- if ( input.disabled ) {
- this.disable();
- } else {
- this.enable();
- }
- },
+ this._ui.screen.removeClass( "ui-screen-hidden" );
- disable: function() {
- this.element.prop( "disabled", true ).parent().addClass( "ui-disabled" );
- },
+ this._ui.container
+ .removeClass( "ui-selectmenu-hidden" )
+ .offset( coords );
- enable: function() {
- this.element.prop( "disabled", false ).parent().removeClass( "ui-disabled" );
- }
-});
+ if ( this.options.overlayTheme && androidBlacklist ) {
+ /* TODO:
+ The native browser on Android 4.0.X ("Ice Cream Sandwich") suffers from an issue where the popup overlay appears to be z-indexed
+ above the popup itself when certain other styles exist on the same page -- namely, any element set to `position: fixed` and certain
+ types of input. These issues are reminiscent of previously uncovered bugs in older versions of Android's native browser:
+ https://github.com/scottjehl/Device-Bugs/issues/3
-//auto self-init widgets
-$( document ).bind( "pagecreate create", function( e ){
- $.mobile.checkboxradio.prototype.enhanceWithin( e.target, true );
-});
+ This fix closes the following bugs ( I use "closes" with reluctance, and stress that this issue should be revisited as soon as possible ):
-})( jQuery );
+ https://github.com/jquery/jquery-mobile/issues/4816
+ https://github.com/jquery/jquery-mobile/issues/4844
+ https://github.com/jquery/jquery-mobile/issues/4874
+ */
-(function( $, undefined ) {
+ // TODO sort out why this._page isn't working
+ this.element.closest( ".ui-page" ).addClass( "ui-popup-open" );
+ }
+ this._animate({
+ additionalCondition: true,
+ transition: transition,
+ classToRemove: "",
+ screenClassToAdd: "in",
+ containerClassToAdd: "in",
+ applyTransition: false,
+ prereqs: this._prereqs
+ });
+ },
-$.widget( "mobile.button", $.mobile.widget, {
- options: {
- theme: null,
- icon: null,
- iconpos: null,
- inline: false,
- corners: true,
- shadow: true,
- iconshadow: true,
- initSelector: "button, [type='button'], [type='submit'], [type='reset'], [type='image']",
- mini: false
- },
- _create: function() {
- var $el = this.element,
- $button,
- o = this.options,
- type,
- name,
- classes = "",
- $buttonPlaceholder;
+ _closePrereqScreen: function() {
+ this._ui.screen
+ .removeClass( "out" )
+ .addClass( "ui-screen-hidden" );
+ },
- // if this is a link, check if it's been enhanced and, if not, use the right function
- if( $el[ 0 ].tagName === "A" ) {
- !$el.hasClass( "ui-btn" ) && $el.buttonMarkup();
- return;
- }
+ _closePrereqContainer: function() {
+ this._ui.container
+ .removeClass( "reverse out" )
+ .addClass( "ui-selectmenu-hidden" )
+ .removeAttr( "style" );
+ },
- // get the inherited theme
- // TODO centralize for all widgets
- if ( !this.options.theme ) {
- this.options.theme = $.mobile.getInheritedTheme( this.element, "c" );
- }
+ _closePrereqsDone: function() {
+ var self = this, opts = self.options;
- // TODO: Post 1.1--once we have time to test thoroughly--any classes manually applied to the original element should be carried over to the enhanced element, with an `-enhanced` suffix. See https://github.com/jquery/jquery-mobile/issues/3577
- /* if( $el[0].className.length ) {
- classes = $el[0].className;
- } */
- if( !!~$el[0].className.indexOf( "ui-btn-left" ) ) {
- classes = "ui-btn-left";
- }
+ self._ui.container.removeAttr( "tabindex" );
- if( !!~$el[0].className.indexOf( "ui-btn-right" ) ) {
- classes = "ui-btn-right";
- }
+ // remove nav bindings if they are still present
+ opts.container.unbind( opts.closeEvents );
- // Add ARIA role
- this.button = $( "<div></div>" )
- .text( $el.text() || $el.val() )
- .insertBefore( $el )
- .buttonMarkup({
- theme: o.theme,
- icon: o.icon,
- iconpos: o.iconpos,
- inline: o.inline,
- corners: o.corners,
- shadow: o.shadow,
- iconshadow: o.iconshadow,
- mini: o.mini
- })
- .addClass( classes )
- .append( $el.addClass( "ui-btn-hidden" ) );
+ // unbind click handlers added when history is disabled
+ self.element.undelegate( opts.closeLinkSelector, opts.closeLinkEvents );
- $button = this.button;
- type = $el.attr( "type" );
- name = $el.attr( "name" );
+ // remove the global mutex for popups
+ $.mobile.popup.active = undefined;
- // Add hidden input during submit if input type="submit" has a name.
- if ( type !== "button" && type !== "reset" && name ) {
- $el.bind( "vclick", function() {
- // Add hidden input if it doesn’t already exist.
- if( $buttonPlaceholder === undefined ) {
- $buttonPlaceholder = $( "<input>", {
- type: "hidden",
- name: $el.attr( "name" ),
- value: $el.attr( "value" )
- }).insertBefore( $el );
+ // alert users that the popup is closed
+ self._trigger( "afterclose" );
+ },
- // Bind to doc to remove after submit handling
- $( document ).one("submit", function(){
- $buttonPlaceholder.remove();
+ _close: function() {
+ this._ui.container.removeClass( "ui-popup-active" );
+ this._page.removeClass( "ui-popup-open" );
+
+ this._isOpen = false;
+
+ // Count down to triggering "popupafterclose" - we have two prerequisites:
+ // 1. The popup window reverse animation completes (container())
+ // 2. The screen opacity animation completes (screen())
+ this._createPrereqs(
+ $.proxy( this, "_closePrereqScreen" ),
+ $.proxy( this, "_closePrereqContainer" ),
+ $.proxy( this, "_closePrereqsDone" ) );
+
+ this._animate( {
+ additionalCondition: this._ui.screen.hasClass( "in" ),
+ transition: ( this._currentTransition || this.options.transition ),
+ classToRemove: "in",
+ screenClassToAdd: "out",
+ containerClassToAdd: "reverse out",
+ applyTransition: true,
+ prereqs: this._prereqs
+ });
+ },
- // reset the local var so that the hidden input
- // will be re-added on subsequent clicks
- $buttonPlaceholder = undefined;
- });
- }
+ _destroy: function() {
+ var self = this;
+
+ // hide and remove bindings
+ self._close();
+
+ // Put the element back to where the placeholder was and remove the "ui-popup" class
+ self._setTheme( "none" );
+ self.element
+ .insertAfter( self._ui.placeholder )
+ .removeClass( "ui-popup ui-overlay-shadow ui-corner-all" );
+ self._ui.screen.remove();
+ self._ui.container.remove();
+ self._ui.placeholder.remove();
+
+ // Unbind handlers that were bound to elements outside self.element (the window, in self case)
+ $.each( self._globalHandlers, function( idx, oneSrc ) {
+ $.each( oneSrc.handler, function( eventType, handler ) {
+ oneSrc.src.unbind( eventType, handler );
});
- }
-
- $el.bind({
- focus: function() {
- $button.addClass( $.mobile.focusClass );
- },
+ });
+ },
- blur: function() {
- $button.removeClass( $.mobile.focusClass );
- }
- });
+ // any navigation event after a popup is opened should close the popup
+ // NOTE the pagebeforechange is bound to catch navigation events that don't
+ // alter the url (eg, dialogs from popups)
+ _bindContainerClose: function() {
+ var self = this;
- this.refresh();
- },
+ self.options.container
+ .one( self.options.closeEvents, $.proxy( self._close, self ));
+ },
- enable: function() {
- this.element.attr( "disabled", false );
- this.button.removeClass( "ui-disabled" ).attr( "aria-disabled", false );
- return this._setOption( "disabled", false );
- },
+ // TODO no clear deliniation of what should be here and
+ // what should be in _open. Seems to be "visual" vs "history" for now
+ open: function( options ) {
+ var self = this, opts = this.options, url, hashkey, activePage, currentIsDialog, hasHash, urlHistory;
- disable: function() {
- this.element.attr( "disabled", true );
- this.button.addClass( "ui-disabled" ).attr( "aria-disabled", true );
- return this._setOption( "disabled", true );
- },
+ // make sure open is idempotent
+ if( $.mobile.popup.active ) {
+ return;
+ }
- refresh: function() {
- var $el = this.element;
+ // set the global popup mutex
+ $.mobile.popup.active = this;
- if ( $el.prop("disabled") ) {
- this.disable();
- } else {
- this.enable();
- }
+ // if history alteration is disabled close on navigate events
+ // and leave the url as is
+ if( !( opts.history ) ) {
+ self._open( options );
+ self._bindContainerClose();
- // Grab the button's text element from its implementation-independent data item
- $( this.button.data( 'buttonElements' ).text ).text( $el.text() || $el.val() );
- }
-});
+ // When histoy is disabled we have to grab the data-rel
+ // back link clicks so we can close the popup instead of
+ // relying on history to do it for us
+ self.element
+ .delegate( opts.closeLinkSelector, opts.closeLinkEvents, function( e ) {
+ self._close();
-//auto self-init widgets
-$( document ).bind( "pagecreate create", function( e ){
- $.mobile.button.prototype.enhanceWithin( e.target, true );
-});
+ // NOTE prevent the browser and navigation handlers from
+ // working with the link's rel=back. This may cause
+ // issues for developers expecting the event to bubble
+ return false;
+ });
-})( jQuery );
+ return;
+ }
-(function( $, undefined ) {
+ // cache some values for min/readability
+ hashkey = $.mobile.dialogHashKey;
+ activePage = $.mobile.activePage;
+ currentIsDialog = activePage.is( ".ui-dialog" );
+ url = $.mobile.urlHistory.getActive().url;
+ hasHash = ( url.indexOf( hashkey ) > -1 ) && !currentIsDialog;
+ urlHistory = $.mobile.urlHistory;
+
+ if ( hasHash ) {
+ self._open( options );
+ self._bindContainerClose();
+ return;
+ }
-$.fn.controlgroup = function( options ) {
- function flipClasses( els, flCorners ) {
- els.removeClass( "ui-btn-corner-all ui-shadow" )
- .eq( 0 ).addClass( flCorners[ 0 ] )
- .end()
- .last().addClass( flCorners[ 1 ] ).addClass( "ui-controlgroup-last" );
- }
+ // if the current url has no dialog hash key proceed as normal
+ // otherwise, if the page is a dialog simply tack on the hash key
+ if ( url.indexOf( hashkey ) === -1 && !currentIsDialog ){
+ url = url + hashkey;
+ } else {
+ url = $.mobile.path.parseLocation().hash + hashkey;
+ }
- return this.each(function() {
- var $el = $( this ),
- o = $.extend({
- direction: $el.jqmData( "type" ) || "vertical",
- shadow: false,
- excludeInvisible: true,
- mini: $el.jqmData( "mini" )
- }, options ),
- groupheading = $el.children( "legend" ),
- flCorners = o.direction == "horizontal" ? [ "ui-corner-left", "ui-corner-right" ] : [ "ui-corner-top", "ui-corner-bottom" ],
- type = $el.find( "input" ).first().attr( "type" );
+ // Tack on an extra hashkey if this is the first page and we've just reconstructed the initial hash
+ if ( urlHistory.activeIndex === 0 && url === urlHistory.initialDst ) {
+ url += hashkey;
+ }
- // Replace legend with more stylable replacement div
- if ( groupheading.length ) {
- $el.wrapInner( "<div class='ui-controlgroup-controls'></div>" );
- $( "<div role='heading' class='ui-controlgroup-label'>" + groupheading.html() + "</div>" ).insertBefore( $el.children(0) );
- groupheading.remove();
- }
+ // swallow the the initial navigation event, and bind for the next
+ opts.container.one( opts.navigateEvents, function( e ) {
+ e.preventDefault();
+ self._open( options );
+ self._bindContainerClose();
+ });
- $el.addClass( "ui-corner-all ui-controlgroup ui-controlgroup-" + o.direction );
+ urlHistory.ignoreNextHashChange = currentIsDialog;
- flipClasses( $el.find( ".ui-btn" + ( o.excludeInvisible ? ":visible" : "" ) ).not('.ui-slider-handle'), flCorners );
- flipClasses( $el.find( ".ui-btn-inner" ), flCorners );
+ // Gotta love methods with 1mm args :(
+ urlHistory.addNew( url, undefined, undefined, undefined, "dialog" );
- if ( o.shadow ) {
- $el.addClass( "ui-shadow" );
- }
+ // set the new url with (or without) the new dialog hash key
+ $.mobile.path.set( url );
+ },
- if ( o.mini ) {
- $el.addClass( "ui-mini" );
- }
+ close: function() {
+ // make sure close is idempotent
+ if( !$.mobile.popup.active ){
+ return;
+ }
+ if( this.options.history ) {
+ $.mobile.back();
+ } else {
+ this._close();
+ }
+ }
});
-};
-
-// The pagecreate handler for controlgroup is in jquery.mobile.init because of the soft-dependency on the wrapped widgets
-})(jQuery);
-(function( $, undefined ) {
+ // TODO this can be moved inside the widget
+ $.mobile.popup.handleLink = function( $link ) {
+ var closestPage = $link.closest( ":jqmData(role='page')" ),
+ scope = ( ( closestPage.length === 0 ) ? $( "body" ) : closestPage ),
+ // NOTE make sure to get only the hash, ie7 (wp7) return the absolute href
+ // in this case ruining the element selection
+ popup = $( $.mobile.path.parseUrl($link.attr( "href" )).hash, scope[0] ),
+ offset;
+
+ if ( popup.data( "popup" ) ) {
+ offset = $link.offset();
+ popup.popup( "open", {
+ x: offset.left + $link.outerWidth() / 2,
+ y: offset.top + $link.outerHeight() / 2,
+ transition: $link.jqmData( "transition" ),
+ positionTo: $link.jqmData( "position-to" ),
+ link: $link
+ });
+ }
-$( document ).bind( "pagecreate create", function( e ){
+ //remove after delay
+ setTimeout( function() {
+ $link.removeClass( $.mobile.activeBtnClass );
+ }, 300 );
+ };
- //links within content areas, tests included with page
- $( e.target )
- .find( "a" )
- .jqmEnhanceable()
- .not( ".ui-btn, .ui-link-inherit, :jqmData(role='none'), :jqmData(role='nojs')" )
- .addClass( "ui-link" );
+ // TODO move inside _create
+ $( document ).bind( "pagebeforechange", function( e, data ) {
+ if ( data.options.role === "popup" ) {
+ $.mobile.popup.handleLink( data.options.link );
+ e.preventDefault();
+ }
+ });
-});
+ $( document ).bind( "pagecreate create", function( e ) {
+ $.mobile.popup.prototype.enhanceWithin( e.target, true );
+ });
})( jQuery );
-
-( function( $ ) {
+(function( $ ) {
var meta = $( "meta[name=viewport]" ),
- initialContent = meta.attr( "content" ),
- disabledZoom = initialContent + ",maximum-scale=1, user-scalable=no",
- enabledZoom = initialContent + ",maximum-scale=10, user-scalable=yes",
+ initialContent = meta.attr( "content" ),
+ disabledZoom = initialContent + ",maximum-scale=1, user-scalable=no",
+ enabledZoom = initialContent + ",maximum-scale=10, user-scalable=yes",
disabledInitially = /(user-scalable[\s]*=[\s]*no)|(maximum-scale[\s]*=[\s]*1)[$,\s]/.test( initialContent );
-
+
$.mobile.zoom = $.extend( {}, {
enabled: !disabledInitially,
locked: false,
disable: function( lock ) {
- if( !disabledInitially && !$.mobile.zoom.locked ){
- meta.attr( "content", disabledZoom );
- $.mobile.zoom.enabled = false;
+ if ( !disabledInitially && !$.mobile.zoom.locked ) {
+ meta.attr( "content", disabledZoom );
+ $.mobile.zoom.enabled = false;
$.mobile.zoom.locked = lock || false;
}
},
enable: function( unlock ) {
- if( !disabledInitially && ( !$.mobile.zoom.locked || unlock === true ) ){
- meta.attr( "content", enabledZoom );
- $.mobile.zoom.enabled = true;
+ if ( !disabledInitially && ( !$.mobile.zoom.locked || unlock === true ) ) {
+ meta.attr( "content", enabledZoom );
+ $.mobile.zoom.enabled = true;
$.mobile.zoom.locked = false;
}
},
restore: function() {
- if( !disabledInitially ){
- meta.attr( "content", initialContent );
- $.mobile.zoom.enabled = true;
+ if ( !disabledInitially ) {
+ meta.attr( "content", initialContent );
+ $.mobile.zoom.enabled = true;
}
}
});
// This option defaults to true on iOS devices.
preventFocusZoom: /iPhone|iPad|iPod/.test( navigator.platform ) && navigator.userAgent.indexOf( "AppleWebKit" ) > -1,
initSelector: "input[type='text'], input[type='search'], :jqmData(type='search'), input[type='number'], :jqmData(type='number'), input[type='password'], input[type='email'], input[type='url'], input[type='tel'], textarea, input[type='time'], input[type='date'], input[type='month'], input[type='week'], input[type='datetime'], input[type='datetime-local'], input[type='color'], input:not([type])",
- clearSearchButtonText: "clear text"
+ clearSearchButtonText: "clear text",
+ disabled: false
},
_create: function() {
- var input = this.element,
+ var self = this,
+ input = this.element,
o = this.options,
theme = o.theme || $.mobile.getInheritedTheme( this.element, "c" ),
themeclass = " ui-body-" + theme,
- mini = input.jqmData("mini") == true,
+ mini = input.jqmData( "mini" ) === true,
miniclass = mini ? " ui-mini" : "",
focusedEl, clearbtn;
+ function toggleClear() {
+ setTimeout( function() {
+ clearbtn.toggleClass( "ui-input-clear-hidden", !input.val() );
+ }, 0 );
+ }
+
$( "label[for='" + input.attr( "id" ) + "']" ).addClass( "ui-input-text" );
focusedEl = input.addClass("ui-input-text ui-body-"+ theme );
mini: mini
});
- function toggleClear() {
- setTimeout(function() {
- clearbtn.toggleClass( "ui-input-clear-hidden", !input.val() );
- }, 0);
- }
-
toggleClear();
- input.bind('paste cut keyup focus change blur', toggleClear);
+ input.bind( 'paste cut keyup focus change blur', toggleClear );
} else {
input.addClass( "ui-corner-all ui-shadow-inset" + themeclass + miniclass );
input.focus(function() {
focusedEl.addClass( $.mobile.focusClass );
})
- .blur(function(){
+ .blur(function() {
focusedEl.removeClass( $.mobile.focusClass );
})
// In many situations, iOS will zoom into the select upon tap, this prevents that from happening
.bind( "focus", function() {
- if( o.preventFocusZoom ){
+ if ( o.preventFocusZoom ) {
$.mobile.zoom.disable( true );
}
})
.bind( "blur", function() {
- if( o.preventFocusZoom ){
+ if ( o.preventFocusZoom ) {
$.mobile.zoom.enable( true );
}
});
if ( input.is( "textarea" ) ) {
var extraLineHeight = 15,
keyupTimeoutBuffer = 100,
- keyup = function() {
- var scrollHeight = input[ 0 ].scrollHeight,
- clientHeight = input[ 0 ].clientHeight;
-
- if ( clientHeight < scrollHeight ) {
- input.height(scrollHeight + extraLineHeight);
- }
- },
keyupTimeout;
+ this._keyup = function() {
+ var scrollHeight = input[ 0 ].scrollHeight,
+ clientHeight = input[ 0 ].clientHeight;
+
+ if ( clientHeight < scrollHeight ) {
+ input.height(scrollHeight + extraLineHeight);
+ }
+ };
+
input.keyup(function() {
clearTimeout( keyupTimeout );
- keyupTimeout = setTimeout( keyup, keyupTimeoutBuffer );
+ keyupTimeout = setTimeout( self._keyup, keyupTimeoutBuffer );
});
// binding to pagechange here ensures that for pages loaded via
// ajax the height is recalculated without user input
- $( document ).one( "pagechange", keyup );
+ this._on( $(document), {"pagechange": "_keyup" });
// Issue 509: the browser is not providing scrollHeight properly until the styles load
if ( $.trim( input.val() ) ) {
// bind to the window load to make sure the height is calculated based on BOTH
// the DOM and CSS
- $( window ).load( keyup );
+ this._on( $(window), {"load": "_keyup"});
}
}
+ if ( input.attr( "disabled" ) ) {
+ this.disable();
+ }
},
- disable: function(){
- ( this.element.attr( "disabled", true ).is( "[type='search'],:jqmData(type='search')" ) ?
- this.element.parent() : this.element ).addClass( "ui-disabled" );
+ disable: function() {
+ var $el;
+ if ( this.element.attr( "disabled", true ).is( "[type='search'], :jqmData(type='search')" ) ) {
+ $el = this.element.parent();
+ } else {
+ $el = this.element;
+ }
+ $el.addClass( "ui-disabled" );
+ return this._setOption( "disabled", true );
},
- enable: function(){
- ( this.element.attr( "disabled", false).is( "[type='search'],:jqmData(type='search')" ) ?
- this.element.parent() : this.element ).removeClass( "ui-disabled" );
+ enable: function() {
+ var $el;
+
+ // TODO using more than one line of code is acceptable ;)
+ if ( this.element.attr( "disabled", false ).is( "[type='search'], :jqmData(type='search')" ) ) {
+ $el = this.element.parent();
+ } else {
+ $el = this.element;
+ }
+ $el.removeClass( "ui-disabled" );
+ return this._setOption( "disabled", false );
}
});
//auto self-init widgets
-$( document ).bind( "pagecreate create", function( e ){
+$( document ).bind( "pagecreate create", function( e ) {
$.mobile.textinput.prototype.enhanceWithin( e.target, true );
});
$.mobile.listview.prototype.options.filter = false;
$.mobile.listview.prototype.options.filterPlaceholder = "Filter items...";
$.mobile.listview.prototype.options.filterTheme = "c";
-$.mobile.listview.prototype.options.filterCallback = function( text, searchValue ){
- return text.toLowerCase().indexOf( searchValue ) === -1;
-};
+// TODO rename callback/deprecate and default to the item itself as the first argument
+var defaultFilterCallback = function( text, searchValue, item ) {
+ return text.toString().toLowerCase().indexOf( searchValue ) === -1;
+ };
+
+$.mobile.listview.prototype.options.filterCallback = defaultFilterCallback;
$( document ).delegate( ":jqmData(role='listview')", "listviewcreate", function() {
.jqmData( "lastval", "" )
.bind( "keyup change", function() {
- var $this = $(this),
+ var $this = $( this ),
val = this.value.toLowerCase(),
listItems = null,
lastval = $this.jqmData( "lastval" ) + "",
childItems = false,
itemtext = "",
- item;
+ item,
+ // Check if a custom filter callback applies
+ isCustomFilterCallback = listview.options.filterCallback !== defaultFilterCallback;
+
+ listview._trigger( "beforefilter", "beforefilter", { input: this } );
// Change val as lastval for next execution
$this.jqmData( "lastval" , val );
- if ( val.length < lastval.length || val.indexOf(lastval) !== 0 ) {
+ if ( isCustomFilterCallback || val.length < lastval.length || val.indexOf( lastval ) !== 0 ) {
- // Removed chars or pasted something totally different, check all items
+ // Custom filter callback applies or removed chars or pasted something totally different, check all items
listItems = list.children();
} else {
// New bucket!
childItems = false;
- } else if ( listview.options.filterCallback( itemtext, val ) ) {
+ } else if ( listview.options.filterCallback( itemtext, val, item ) ) {
//mark to be hidden
item.toggleClass( "ui-filter-hidequeue" , true );
})( jQuery );
-( function( $, undefined ) {
+(function( $, undefined ) {
$.widget( "mobile.slider", $.mobile.widget, {
+ widgetEventPrefix: "slide",
+
options: {
theme: null,
trackTheme: null,
cType = control[ 0 ].nodeName.toLowerCase(),
- selectClass = ( cType == "select" ) ? "ui-slider-switch" : "",
+ selectClass = ( cType === "select" ) ? "ui-slider-switch" : "",
controlID = control.attr( "id" ),
- labelID = controlID + "-label",
+ $label = $( "[for='" + controlID + "']" ),
- label = $( "[for='"+ controlID +"']" ).attr( "id", labelID ),
+ labelID = $label.attr( "id" ) || controlID + "-label",
+
+ label = $label.attr( "id", labelID ),
val = function() {
- return cType == "input" ? parseFloat( control.val() ) : control[0].selectedIndex;
+ return cType === "input" ? parseFloat( control.val() ) : control[0].selectedIndex;
},
- min = cType == "input" ? parseFloat( control.attr( "min" ) ) : 0,
+ min = cType === "input" ? parseFloat( control.attr( "min" ) ) : 0,
- max = cType == "input" ? parseFloat( control.attr( "max" ) ) : control.find( "option" ).length-1,
+ max = cType === "input" ? parseFloat( control.attr( "max" ) ) : control.find( "option" ).length-1,
step = window.parseFloat( control.attr( "step" ) || 1 ),
- inlineClass = ( this.options.inline || control.jqmData("inline") == true ) ? " ui-slider-inline" : "",
+ inlineClass = ( this.options.inline || control.jqmData( "inline" ) === true ) ? " ui-slider-inline" : "",
- miniClass = ( this.options.mini || control.jqmData("mini") ) ? " ui-slider-mini" : "",
+ miniClass = ( this.options.mini || control.jqmData( "mini" ) ) ? " ui-slider-mini" : "",
- domHandle = document.createElement('a'),
+ domHandle = document.createElement( 'a' ),
handle = $( domHandle ),
- domSlider = document.createElement('div'),
+ domSlider = document.createElement( 'div' ),
slider = $( domSlider ),
- valuebg = control.jqmData("highlight") && cType != "select" ? (function() {
+ valuebg = control.jqmData( "highlight" ) && cType !== "select" ? (function() {
var bg = document.createElement('div');
- bg.className = 'ui-slider-bg ui-btn-active ui-btn-corner-all';
+ bg.className = 'ui-slider-bg ' + $.mobile.activeBtnClass + ' ui-btn-corner-all';
return $( bg ).prependTo( slider );
})() : false,
options;
- domHandle.setAttribute( 'href', "#" );
+ this._type = cType;
+
+ domHandle.setAttribute( 'href', "#" );
domSlider.setAttribute('role','application');
- domSlider.className = ['ui-slider ',selectClass," ui-btn-down-",trackTheme,' ui-btn-corner-all', inlineClass, miniClass].join("");
+ domSlider.className = ['ui-slider ',selectClass," ui-btn-down-",trackTheme,' ui-btn-corner-all', inlineClass, miniClass].join( "" );
domHandle.className = 'ui-slider-handle';
- domSlider.appendChild(domHandle);
+ domSlider.appendChild( domHandle );
handle.buttonMarkup({ corners: true, theme: theme, shadow: true })
.attr({
mouseMoved: false
});
- if ( cType == "select" ) {
+ if ( cType === "select" ) {
var wrapper = document.createElement('div');
wrapper.className = 'ui-slider-inneroffset';
- for(var j = 0,length = domSlider.childNodes.length;j < length;j++){
- wrapper.appendChild(domSlider.childNodes[j]);
+ for ( var j = 0,length = domSlider.childNodes.length;j < length;j++ ) {
+ wrapper.appendChild( domSlider.childNodes[j] );
}
- domSlider.appendChild(wrapper);
+ domSlider.appendChild( wrapper );
// slider.wrapInner( "<div class='ui-slider-inneroffset'></div>" );
options = control.find( "option" );
- for(var i = 0, optionsCount = options.length; i < optionsCount; i++){
- var side = !i ? "b":"a",
- sliderTheme = !i ? " ui-btn-down-" + trackTheme :( " " + $.mobile.activeBtnClass ),
- sliderLabel = document.createElement('div'),
- sliderImg = document.createElement('span');
+ for ( var i = 0, optionsCount = options.length; i < optionsCount; i++ ) {
+ var side = !i ? "b" : "a",
+ sliderTheme = !i ? " ui-btn-down-" + trackTheme : ( " " + $.mobile.activeBtnClass ),
+ sliderLabel = document.createElement( 'div' ),
+ sliderImg = document.createElement( 'span' );
- sliderImg.className = ['ui-slider-label ui-slider-label-',side,sliderTheme," ui-btn-corner-all"].join("");
+ sliderImg.className = ['ui-slider-label ui-slider-label-',side,sliderTheme," ui-btn-corner-all"].join( "" );
sliderImg.setAttribute('role','img');
- sliderImg.appendChild(document.createTextNode(options[i].innerHTML));
+ sliderImg.appendChild( document.createTextNode( options[i].innerHTML ) );
$(sliderImg).prependTo( slider );
}
// monitor the input for updated values
control.addClass( cType === "input" ? "ui-slider-input" : "ui-slider-switch" )
- .change( function() {
+ .change(function() {
// if the user dragged the handle, the "change" event was triggered from inside refresh(); don't call refresh() again
- if (!self.mouseMoved) {
+ if ( !self.mouseMoved ) {
self.refresh( val(), true );
}
})
- .keyup( function() { // necessary?
+ .keyup(function() { // necessary?
self.refresh( val(), true, true );
})
- .blur( function() {
+ .blur(function() {
self.refresh( val(), true );
});
- // prevent screen drag when slider activated
- $( document ).bind( "vmousemove", function( event ) {
- if ( self.dragging ) {
+ this._preventDocumentDrag = function( event ) {
+ // NOTE: we don't do this in refresh because we still want to
+ // support programmatic alteration of disabled inputs
+ if ( self.dragging && !self.options.disabled ) {
+
// self.mouseMoved must be updated before refresh() because it will be used in the control "change" event
self.mouseMoved = true;
self.userModified = self.beforeStart !== control[0].selectedIndex;
return false;
}
- });
+ }
+
+ this._on( $( document ), { "vmousemove": this._preventDocumentDrag });
+
+ // it appears the clicking the up and down buttons in chrome on
+ // range/number inputs doesn't trigger a change until the field is
+ // blurred. Here we check thif the value has changed and refresh
+ control.bind( "vmouseup", $.proxy( self._checkedRefresh, self));
slider.bind( "vmousedown", function( event ) {
+ // NOTE: we don't do this in refresh because we still want to
+ // support programmatic alteration of disabled inputs
+ if ( self.options.disabled ) {
+ return false;
+ }
+
self.dragging = true;
self.userModified = false;
self.mouseMoved = false;
}
self.refresh( event );
+ self._trigger( "start" );
return false;
})
.bind( "vclick", false );
- slider.add( document )
- .bind( "vmouseup", function() {
- if ( self.dragging ) {
-
- self.dragging = false;
-
- if ( cType === "select") {
-
- // make the handle move with a smooth transition
- handle.addClass( "ui-slider-handle-snapping" );
-
- if ( self.mouseMoved ) {
+ this._sliderMouseUp = function() {
+ if ( self.dragging ) {
+ self.dragging = false;
- // this is a drag, change the value only if user dragged enough
- if ( self.userModified ) {
- self.refresh( self.beforeStart == 0 ? 1 : 0 );
- }
- else {
- self.refresh( self.beforeStart );
- }
+ if ( cType === "select") {
+ // make the handle move with a smooth transition
+ handle.addClass( "ui-slider-handle-snapping" );
+ if ( self.mouseMoved ) {
+ // this is a drag, change the value only if user dragged enough
+ if ( self.userModified ) {
+ self.refresh( self.beforeStart === 0 ? 1 : 0 );
}
else {
- // this is just a click, change the value
- self.refresh( self.beforeStart == 0 ? 1 : 0 );
+ self.refresh( self.beforeStart );
}
-
}
-
- self.mouseMoved = false;
-
- return false;
+ else {
+ // this is just a click, change the value
+ self.refresh( self.beforeStart === 0 ? 1 : 0 );
+ }
}
- });
+ self.mouseMoved = false;
+ self._trigger( "stop" );
+ return false;
+ }
+ };
+
+ this._on( slider.add( document ), { "vmouseup": this._sliderMouseUp });
slider.insertAfter( control );
// Only add focus class to toggle switch, sliders get it automatically from ui-btn
- if( cType == 'select' ) {
+ if ( cType === 'select' ) {
this.handle.bind({
focus: function() {
slider.addClass( $.mobile.focusClass );
}
});
- this.refresh(undefined, undefined, true);
+ this.refresh( undefined, undefined, true );
+ },
+
+ _checkedRefresh: function() {
+ if( this.value != this._value() ){
+ this.refresh( this._value() );
+ }
+ },
+
+ _value: function() {
+ return this._type === "input" ?
+ parseFloat( this.element.val() ) : this.element[0].selectedIndex;
},
refresh: function( val, isfromControl, preventInputUpdate ) {
+ // NOTE: we don't return here because we want to support programmatic
+ // alteration of the input value, which should still update the slider
if ( this.options.disabled || this.element.attr('disabled')) {
this.disable();
}
+ // set the stored value for comparison later
+ this.value = this._value();
+
var control = this.element, percent,
cType = control[0].nodeName.toLowerCase(),
min = cType === "input" ? parseFloat( control.attr( "min" ) ) : 0,
max = cType === "input" ? parseFloat( control.attr( "max" ) ) : control.find( "option" ).length - 1,
- step = (cType === "input" && parseFloat( control.attr( "step" ) ) > 0) ? parseFloat(control.attr("step")) : 1;
+ step = ( cType === "input" && parseFloat( control.attr( "step" ) ) > 0 ) ? parseFloat( control.attr( "step" ) ) : 1;
if ( typeof val === "object" ) {
var data = val,
"aria-valuetext": cType === "input" ? newval : control.find( "option" ).eq( newval ).getEncodedText(),
title: cType === "input" ? newval : control.find( "option" ).eq( newval ).getEncodedText()
});
- this.valuebg && this.valuebg.css( "width", percent + "%" );
+
+ if ( this.valuebg ) {
+ this.valuebg.css( "width", percent + "%" );
+ }
// drag the label widths
if ( this._labels ) {
aPercent = percent && handlePercent + ( 100 - handlePercent ) * percent / 100,
bPercent = percent === 100 ? 0 : Math.min( handlePercent + 100 - aPercent, 100 );
- this._labels.each(function(){
- var ab = $(this).is( ".ui-slider-label-a" );
+ this._labels.each(function() {
+ var ab = $( this ).is( ".ui-slider-label-a" );
$( this ).width( ( ab ? aPercent : bPercent ) + "%" );
});
}
});
//auto self-init widgets
-$( document ).bind( "pagecreate create", function( e ){
+$( document ).bind( "pagecreate create", function( e ) {
$.mobile.slider.prototype.enhanceWithin( e.target, true );
});
nativeMenu: true,
// This option defaults to true on iOS devices.
preventFocusZoom: /iPhone|iPad|iPod/.test( navigator.platform ) && navigator.userAgent.indexOf( "AppleWebKit" ) > -1,
- initSelector: "select:not(:jqmData(role='slider'))",
+ initSelector: "select:not( :jqmData(role='slider') )",
mini: false
},
- _button: function(){
+ _button: function() {
return $( "<div/>" );
},
}, 40);
},
- _selectOptions: function() {
- return this.select.find( "option" );
- },
+ _selectOptions: function() {
+ return this.select.find( "option" );
+ },
// setup items that are generally necessary for select menu extension
- _preExtension: function(){
+ _preExtension: function() {
var classes = "";
// TODO: Post 1.1--once we have time to test thoroughly--any classes manually applied to the original element should be carried over to the enhanced element, with an `-enhanced` suffix. See https://github.com/jquery/jquery-mobile/issues/3577
- /* if( $el[0].className.length ) {
+ /* if ( $el[0].className.length ) {
classes = $el[0].className;
} */
- if( !!~this.element[0].className.indexOf( "ui-btn-left" ) ) {
+ if ( !!~this.element[0].className.indexOf( "ui-btn-left" ) ) {
classes = " ui-btn-left";
}
-
- if( !!~this.element[0].className.indexOf( "ui-btn-right" ) ) {
+
+ if ( !!~this.element[0].className.indexOf( "ui-btn-right" ) ) {
classes = " ui-btn-right";
}
-
+
this.select = this.element.wrap( "<div class='ui-select" + classes + "'>" );
this.selectID = this.select.attr( "id" );
this.label = $( "label[for='"+ this.selectID +"']" ).addClass( "ui-select" );
_create: function() {
this._preExtension();
- // Allows for extension of the native select for custom selects and other plugins
+ // Allows for extension of the native select for custom selects and other plugins
// see select.custom for example extension
// TODO explore plugin registration
this._trigger( "beforeCreate" );
options = this.options,
+ inline = options.inline || this.select.jqmData( "inline" ),
+ mini = options.mini || this.select.jqmData( "mini" ),
+ iconpos = options.icon ? ( options.iconpos || this.select.jqmData( "iconpos" ) ) : false,
+
// IE throws an exception at options.item() function when
// there is no selected item
// select first in this case
- selectedIndex = this.select[ 0 ].selectedIndex == -1 ? 0 : this.select[ 0 ].selectedIndex,
+ selectedIndex = this.select[ 0 ].selectedIndex === -1 ? 0 : this.select[ 0 ].selectedIndex,
// TODO values buttonId and menuId are undefined here
button = this.button
- .text( $( this.select[ 0 ].options.item( selectedIndex ) ).text() )
.insertBefore( this.select )
.buttonMarkup( {
theme: options.theme,
icon: options.icon,
- iconpos: options.iconpos,
- inline: options.inline,
+ iconpos: iconpos,
+ inline: inline,
corners: options.corners,
shadow: options.shadow,
iconshadow: options.iconshadow,
- mini: options.mini
+ mini: mini
});
+ this.setButtonText();
+
// Opera does not properly support opacity on select elements
// In Mini, it hides the element, but not its text
// On the desktop,it seems to do the opposite
// for these reasons, using the nativeMenu option results in a full native select in Opera
if ( options.nativeMenu && window.opera && window.opera.version ) {
- this.select.addClass( "ui-select-nativeonly" );
+ button.addClass( "ui-select-nativeonly" );
}
// Add counter for multi selects
}
// Events on native select
- this.select.change( function() {
+ this.select.change(function() {
self.refresh();
});
// Add active class to button
self.button.addClass( $.mobile.activeBtnClass );
})
- .bind( "focus", function() {
- self.button.addClass( $.mobile.focusClass );
- })
- .bind( "blur", function() {
- self.button.removeClass( $.mobile.focusClass );
- })
+ .bind( "focus", function() {
+ self.button.addClass( $.mobile.focusClass );
+ })
+ .bind( "blur", function() {
+ self.button.removeClass( $.mobile.focusClass );
+ })
.bind( "focus vmouseover", function() {
self.button.trigger( "vmouseover" );
})
// In many situations, iOS will zoom into the select upon tap, this prevents that from happening
self.button.bind( "vmousedown", function() {
- if( self.options.preventFocusZoom ){
+ if ( self.options.preventFocusZoom ) {
$.mobile.zoom.disable( true );
}
- })
- .bind( "mouseup", function() {
- if( self.options.preventFocusZoom ){
- $.mobile.zoom.enable( true );
+ }).bind( "mouseup", function() {
+ if ( self.options.preventFocusZoom ) {
+ setTimeout(function() {
+ $.mobile.zoom.enable( true );
+ }, 0);
}
});
},
selectedIndices: function() {
var self = this;
- return this.selected().map( function() {
+ return this.selected().map(function() {
return self._selectOptions().index( this );
}).get();
},
setButtonText: function() {
- var self = this, selected = this.selected();
-
- this.button.find( ".ui-btn-text" ).text( function() {
- if ( !self.isMultiple ) {
- return selected.text();
+ var self = this,
+ selected = this.selected(),
+ text = this.placeholder,
+ span = $( document.createElement( "span" ) );
+
+ this.button.find( ".ui-btn-text" ).html(function() {
+ if ( selected.length ) {
+ text = selected.map(function() {
+ return $( this ).text();
+ }).get().join( ", " );
+ } else {
+ text = self.placeholder;
}
- return selected.length ? selected.map( function() {
- return $( this ).text();
- }).get().join( ", " ) : self.placeholder;
+ // TODO possibly aggregate multiple select option classes
+ return span.text( text )
+ .addClass( self.select.attr( "class" ) )
+ .addClass( selected.attr( "class" ) );
});
},
});
//auto self-init widgets
-$( document ).bind( "pagecreate create", function( e ){
+$( document ).bind( "pagecreate create", function( e ) {
$.mobile.selectmenu.prototype.enhanceWithin( e.target, true );
});
})( jQuery );
*/
(function( $, undefined ) {
- var extendSelect = function( widget ){
+ var extendSelect = function( widget ) {
var select = widget.select,
selectID = widget.selectID,
label = widget.label,
thisPage = widget.select.closest( ".ui-page" ),
- screen = $( "<div>", {"class": "ui-selectmenu-screen ui-screen-hidden"} ).appendTo( thisPage ),
selectOptions = widget._selectOptions(),
isMultiple = widget.isMultiple = widget.select[ 0 ].multiple,
buttonId = selectID + "-button",
"<div data-" + $.mobile.ns + "role='content'></div>"+
"</div>" ),
- listbox = $("<div>", { "class": "ui-selectmenu ui-selectmenu-hidden ui-overlay-shadow ui-corner-all ui-body-" + widget.options.overlayTheme + " " + $.mobile.defaultDialogTransition } ).insertAfter(screen),
+ listbox = $( "<div>", { "class": "ui-selectmenu" } ).insertAfter( widget.select ).popup( { theme: "a" } ),
list = $( "<ul>", {
"class": "ui-selectmenu-list",
menuPageClose,
headerClose;
- if( widget.isMultiple ) {
+ if ( widget.isMultiple ) {
headerClose = $( "<a>", {
"text": widget.options.closeText,
"href": "#",
thisPage: thisPage,
menuPage: menuPage,
label: label,
- screen: screen,
selectOptions: selectOptions,
isMultiple: isMultiple,
theme: widget.options.theme,
// Button events
self.button.bind( "vclick keydown" , function( event ) {
- if ( event.type == "vclick" ||
- event.keyCode && ( event.keyCode === $.mobile.keyCode.ENTER ||
- event.keyCode === $.mobile.keyCode.SPACE ) ) {
+ if (event.type === "vclick" ||
+ event.keyCode && (event.keyCode === $.mobile.keyCode.ENTER ||
+ event.keyCode === $.mobile.keyCode.SPACE)) {
self.open();
event.preventDefault();
// Events for list items
self.list.attr( "role", "listbox" )
- .bind( "focusin", function( e ){
+ .bind( "focusin", function( e ) {
$( e.target )
.attr( "tabindex", "0" )
.trigger( "vmouseover" );
})
- .bind( "focusout", function( e ){
+ .bind( "focusout", function( e ) {
$( e.target )
.attr( "tabindex", "-1" )
.trigger( "vmouseout" );
self.select.trigger( "change" );
}
- //hide custom select for single selects only
- if ( !self.isMultiple ) {
+ // hide custom select for single selects only - otherwise focus clicked item
+ // We need to grab the clicked item the hard way, because the list may have been rebuilt
+ if ( self.isMultiple ) {
+ self.list.find( "li:not(.ui-li-divider)" ).eq( newIndex )
+ .addClass( "ui-btn-down-" + widget.options.theme ).find( "a" ).first().focus();
+ }
+ else {
self.close();
}
// switch logic based on which key was pressed
switch ( event.keyCode ) {
// up or left arrow keys
- case 38:
+ case 38:
prev = li.prev().not( ".ui-selectmenu-placeholder" );
- if( prev.is( ".ui-li-divider" ) ) {
+ if ( prev.is( ".ui-li-divider" ) ) {
prev = prev.prev();
}
}
return false;
- break;
-
// down or right arrow keys
- case 40:
+ case 40:
next = li.next();
- if( next.is( ".ui-li-divider" ) ) {
+ if ( next.is( ".ui-li-divider" ) ) {
next = next.next();
}
}
return false;
- break;
-
// If enter or space is pressed, trigger click
- case 13:
- case 32:
+ case 13:
+ case 32:
target.trigger( "click" );
return false;
- break;
}
});
$.mobile._bindPageRemove.call( self.thisPage );
});
- // Events on "screen" overlay
- self.screen.bind( "vclick", function( event ) {
+ // Events on the popup
+ self.listbox.bind( "popupafterclose", function( event ) {
self.close();
});
// Close button on small overlays
- if( self.isMultiple ){
- self.headerClose.click( function() {
- if ( self.menuType == "overlay" ) {
+ if ( self.isMultiple ) {
+ self.headerClose.click(function() {
+ if ( self.menuType === "overlay" ) {
self.close();
return false;
}
return options.text() !== list.text();
},
- refresh: function( forceRebuild , foo ){
+ selected: function() {
+ return this._selectOptions().filter( ":selected:not( :jqmData(placeholder='true') )" );
+ },
+
+ refresh: function( forceRebuild , foo ) {
var self = this,
select = this.element,
isMultiple = this.isMultiple,
- options = this._selectOptions(),
- selected = this.selected(),
- // return an array of all selected index's
- indicies = this.selectedIndices();
+ indicies;
if ( forceRebuild || this._isRebuildRequired() ) {
self._buildList();
}
+ indicies = this.selectedIndices();
+
self.setButtonText();
self.setButtonCount();
if ( self.isMultiple ) {
item.find( ".ui-icon" ).removeClass( "ui-icon-checkbox-off" ).addClass( "ui-icon-checkbox-on" );
} else {
- if( item.is( ".ui-selectmenu-placeholder" ) ) {
+ if ( item.is( ".ui-selectmenu-placeholder" ) ) {
item.next().addClass( $.mobile.activeBtnClass );
} else {
item.addClass( $.mobile.activeBtnClass );
var self = this;
- if ( self.menuType == "page" ) {
+ if ( self.menuType === "page" ) {
// doesn't solve the possible issue with calling change page
// where the objects don't define data urls which prevents dialog key
// stripping - changePage has incoming refactor
- window.history.back();
+ $.mobile.back();
} else {
- self.screen.addClass( "ui-screen-hidden" );
- self.listbox.addClass( "ui-selectmenu-hidden" ).removeAttr( "style" ).removeClass( "in" );
+ self.listbox.popup( "close" );
self.list.appendTo( self.listbox );
self._focusButton();
}
}
var self = this,
- $window = $( window ),
- selfListParent = self.list.parent(),
+ $window = $( window ),
+ selfListParent = self.list.parent(),
menuHeight = selfListParent.outerHeight(),
menuWidth = selfListParent.outerWidth(),
- activePage = $( ".ui-page-active" ),
- tScrollElem = activePage,
+ activePage = $( "." + $.mobile.activePageClass ),
scrollTop = $window.scrollTop(),
btnOffset = self.button.offset().top,
screenHeight = $window.height(),
}, 300);
function focusMenuItem() {
- self.list.find( "." + $.mobile.activeBtnClass + " a" ).focus();
+ var selector = self.list.find( "." + $.mobile.activeBtnClass + " a" );
+ if ( selector.length === 0 ) {
+ selector = self.list.find( "li.ui-btn:not( :jqmData(placeholder='true') ) a" );
+ }
+ selector.first().focus().closest( "li" ).addClass( "ui-btn-down-" + widget.options.theme );
}
if ( menuHeight > screenHeight - 80 || !$.support.scrollTop ) {
self.thisPage.unbind( "pagehide.remove" );
//for WebOS/Opera Mini (set lastscroll using button offset)
- if ( scrollTop == 0 && btnOffset > screenHeight ) {
+ if ( scrollTop === 0 && btnOffset > screenHeight ) {
self.thisPage.one( "pagehide", function() {
$( this ).jqmData( "lastScroll", btnOffset );
});
} else {
self.menuType = "overlay";
- self.screen.height( $(document).height() )
- .removeClass( "ui-screen-hidden" );
-
- // Try and center the overlay over the button
- var roomtop = btnOffset - scrollTop,
- roombot = scrollTop + screenHeight - btnOffset,
- halfheight = menuHeight / 2,
- maxwidth = parseFloat( self.list.parent().css( "max-width" ) ),
- newtop, newleft;
-
- if ( roomtop > menuHeight / 2 && roombot > menuHeight / 2 ) {
- newtop = btnOffset + ( self.button.outerHeight() / 2 ) - halfheight;
- } else {
- // 30px tolerance off the edges
- newtop = roomtop > roombot ? scrollTop + screenHeight - menuHeight - 30 : scrollTop + 30;
- }
-
- // If the menuwidth is smaller than the screen center is
- if ( menuWidth < maxwidth ) {
- newleft = ( screenWidth - menuWidth ) / 2;
- } else {
-
- //otherwise insure a >= 30px offset from the left
- newleft = self.button.offset().left + self.button.outerWidth() / 2 - menuWidth / 2;
-
- // 30px tolerance off the edges
- if ( newleft < 30 ) {
- newleft = 30;
- } else if ( (newleft + menuWidth) > screenWidth ) {
- newleft = screenWidth - menuWidth - 30;
- }
- }
-
- self.listbox.append( self.list )
- .removeClass( "ui-selectmenu-hidden" )
- .css({
- top: newtop,
- left: newleft
- })
- .addClass( "in" );
-
- focusMenuItem();
+ self.listbox
+ .one( "popupafteropen", focusMenuItem )
+ .popup( "open", {
+ x: self.button.offset().left + self.button.outerWidth() / 2,
+ y: self.button.offset().top + self.button.outerHeight() / 2
+ });
// duplicate with value set in page show for dialog sized selects
self.isOpen = true;
self.list.empty().filter( ".ui-listview" ).listview( "destroy" );
- var $options = self.select.find("option"),
+ var $options = self.select.find( "option" ),
numOptions = $options.length,
select = this.select[ 0 ],
dataPrefix = 'data-' + $.mobile.ns,
dataIndexAttr = dataPrefix + 'option-index',
dataIconAttr = dataPrefix + 'icon',
dataRoleAttr = dataPrefix + 'role',
+ dataPlaceholderAttr = dataPrefix + 'placeholder',
fragment = document.createDocumentFragment(),
+ isPlaceholderItem = false,
optGroup;
- for (var i = 0; i < numOptions;i++){
+ for (var i = 0; i < numOptions;i++, isPlaceholderItem = false) {
var option = $options[i],
- $option = $(option),
+ $option = $( option ),
parent = option.parentNode,
text = $option.text(),
- anchor = document.createElement('a'),
+ anchor = document.createElement( 'a' ),
classes = [];
- anchor.setAttribute('href','#');
- anchor.appendChild(document.createTextNode(text));
+ anchor.setAttribute( 'href', '#' );
+ anchor.appendChild( document.createTextNode( text ) );
// Are we inside an optgroup?
- if (parent !== select && parent.nodeName.toLowerCase() === "optgroup"){
- var optLabel = parent.getAttribute('label');
- if ( optLabel != optGroup) {
- var divider = document.createElement('li');
- divider.setAttribute(dataRoleAttr,'list-divider');
- divider.setAttribute('role','option');
- divider.setAttribute('tabindex','-1');
- divider.appendChild(document.createTextNode(optLabel));
- fragment.appendChild(divider);
+ if ( parent !== select && parent.nodeName.toLowerCase() === "optgroup" ) {
+ var optLabel = parent.getAttribute( 'label' );
+ if ( optLabel !== optGroup ) {
+ var divider = document.createElement( 'li' );
+ divider.setAttribute( dataRoleAttr, 'list-divider' );
+ divider.setAttribute( 'role', 'option' );
+ divider.setAttribute( 'tabindex', '-1' );
+ divider.appendChild( document.createTextNode( optLabel ) );
+ fragment.appendChild( divider );
optGroup = optLabel;
}
}
- if (needPlaceholder && (!option.getAttribute( "value" ) || text.length == 0 || $option.jqmData( "placeholder" ))) {
+ if ( needPlaceholder && ( !option.getAttribute( "value" ) || text.length === 0 || $option.jqmData( "placeholder" ) ) ) {
needPlaceholder = false;
+ isPlaceholderItem = true;
+
+ // If we have identified a placeholder, mark it retroactively in the select as well
+ option.setAttribute( dataPlaceholderAttr, true );
if ( o.hidePlaceholderMenuItems ) {
classes.push( "ui-selectmenu-placeholder" );
}
classes.push( "ui-disabled" );
item.setAttribute('aria-disabled',true);
}
- item.setAttribute(dataIndexAttr,i);
- item.setAttribute(dataIconAttr,dataIcon);
- item.className = classes.join(" ");
- item.setAttribute('role','option');
- anchor.setAttribute('tabindex','-1');
- item.appendChild(anchor);
- fragment.appendChild(item);
+ item.setAttribute( dataIndexAttr,i );
+ item.setAttribute( dataIconAttr, dataIcon );
+ if ( isPlaceholderItem ) {
+ item.setAttribute( dataPlaceholderAttr, true );
+ }
+ item.className = classes.join( " " );
+ item.setAttribute( 'role', 'option' );
+ anchor.setAttribute( 'tabindex', '-1' );
+ item.appendChild( anchor );
+ fragment.appendChild( item );
}
- self.list[0].appendChild(fragment);
+ self.list[0].appendChild( fragment );
// Hide header if it's not a multiselect and there's no placeholder
if ( !this.isMultiple && !placeholder.length ) {
self.list.listview();
},
- _button: function(){
+ _button: function() {
return $( "<a>", {
"href": "#",
"role": "button",
});
};
- // issue #3894 - core doesn't triggered events on disabled delegates
- $( document ).bind( "selectmenubeforecreate", function( event ){
+ // issue #3894 - core doesn't trigger events on disabled delegates
+ $( document ).bind( "selectmenubeforecreate", function( event ) {
var selectmenuWidget = $( event.target ).data( "selectmenu" );
- if( !selectmenuWidget.options.nativeMenu ){
+ if ( !selectmenuWidget.options.nativeMenu &&
+ selectmenuWidget.element.parents( ":jqmData(role='popup')" ).length === 0 ) {
extendSelect( selectmenuWidget );
}
});
transition: "slide", //can be none, fade, slide (slide maps to slideup or slidedown)
fullscreen: false,
tapToggle: true,
- tapToggleBlacklist: "a, input, select, textarea, .ui-header-fixed, .ui-footer-fixed",
+ tapToggleBlacklist: "a, button, input, select, textarea, .ui-header-fixed, .ui-footer-fixed, .ui-popup",
hideDuringFocus: "input, textarea, select",
updatePagePadding: true,
trackPersistentToolbars: true,
// Testing fixed positioning is also pretty obtrusive to page load, requiring injected elements and scrolling the window
// The following function serves to rule out some popular browsers with known fixed-positioning issues
// This is a plugin option like any other, so feel free to improve or overwrite it
- supportBlacklist: function(){
+ supportBlacklist: function() {
var w = window,
ua = navigator.userAgent,
platform = navigator.platform,
if(
// iOS 4.3 and older : Platform is iPhone/Pad/Touch and Webkit version is less than 534 (ios5)
- ( ( platform.indexOf( "iPhone" ) > -1 || platform.indexOf( "iPad" ) > -1 || platform.indexOf( "iPod" ) > -1 ) && wkversion && wkversion < 534 )
- ||
+ ( ( platform.indexOf( "iPhone" ) > -1 || platform.indexOf( "iPad" ) > -1 || platform.indexOf( "iPod" ) > -1 ) && wkversion && wkversion < 534 ) ||
// Opera Mini
- ( w.operamini && ({}).toString.call( w.operamini ) === "[object OperaMini]" )
- ||
- ( operammobilematch && omversion < 7458 )
- ||
+ ( w.operamini && ({}).toString.call( w.operamini ) === "[object OperaMini]" ) ||
+ ( operammobilematch && omversion < 7458 ) ||
//Android lte 2.1: Platform is Android and Webkit version is less than 533 (Android 2.2)
- ( ua.indexOf( "Android" ) > -1 && wkversion && wkversion < 533 )
- ||
+ ( ua.indexOf( "Android" ) > -1 && wkversion && wkversion < 533 ) ||
// Firefox Mobile before 6.0 -
- ( ffversion && ffversion < 6 )
- ||
+ ( ffversion && ffversion < 6 ) ||
// WebOS less than 3
- ( "palmGetResource" in window && wkversion && wkversion < 534 )
- ||
+ ( "palmGetResource" in window && wkversion && wkversion < 534 ) ||
// MeeGo
- ( ua.indexOf( "MeeGo" ) > -1 && ua.indexOf( "NokiaBrowser/8.5.0" ) > -1 )
- ){
+ ( ua.indexOf( "MeeGo" ) > -1 && ua.indexOf( "NokiaBrowser/8.5.0" ) > -1 ) ) {
return true;
}
o = self.options,
$el = self.element,
tbtype = $el.is( ":jqmData(role='header')" ) ? "header" : "footer",
- $page = $el.closest(".ui-page");
+ $page = $el.closest( ".ui-page" );
// Feature detecting support for
- if( o.supportBlacklist() ){
+ if ( o.supportBlacklist() ) {
self.destroy();
return;
}
$el.addClass( "ui-"+ tbtype +"-fixed" );
// "fullscreen" overlay positioning
- if( o.fullscreen ){
+ if ( o.fullscreen ) {
$el.addClass( "ui-"+ tbtype +"-fullscreen" );
$page.addClass( "ui-page-" + tbtype + "-fullscreen" );
}
self._bindToggleHandlers();
},
- _addTransitionClass: function(){
+ _addTransitionClass: function() {
var tclass = this.options.transition;
- if( tclass && tclass !== "none" ){
+ if ( tclass && tclass !== "none" ) {
// use appropriate slide for header or footer
- if( tclass === "slide" ){
+ if ( tclass === "slide" ) {
tclass = this.element.is( ".ui-header" ) ? "slidedown" : "slideup";
}
}
},
- _bindPageEvents: function(){
+ _bindPageEvents: function() {
var self = this,
o = self.options,
$el = self.element;
// Fixed toolbars require page zoom to be disabled, otherwise usability issues crop up
// This method is meant to disable zoom while a fixed-positioned toolbar page is visible
$el.closest( ".ui-page" )
- .bind( "pagebeforeshow", function(){
- if( o.disablePageZoom ){
+ .bind( "pagebeforeshow", function() {
+ if ( o.disablePageZoom ) {
$.mobile.zoom.disable( true );
}
- if( !o.visibleOnPageShow ){
+ if ( !o.visibleOnPageShow ) {
self.hide( true );
}
} )
- .bind( "webkitAnimationStart animationstart updatelayout", function(){
- if( o.updatePagePadding ){
- self.updatePagePadding();
+ .bind( "webkitAnimationStart animationstart updatelayout", function() {
+ var thisPage = this;
+ if ( o.updatePagePadding ) {
+ self.updatePagePadding( thisPage );
}
})
- .bind( "pageshow", function(){
- self.updatePagePadding();
- if( o.updatePagePadding ){
- $( window ).bind( "throttledresize." + self.widgetName, function(){
- self.updatePagePadding();
+ .bind( "pageshow", function() {
+ var thisPage = this;
+ self.updatePagePadding( thisPage );
+ if ( o.updatePagePadding ) {
+ $( window ).bind( "throttledresize." + self.widgetName, function() {
+ self.updatePagePadding( thisPage );
});
}
})
- .bind( "pagebeforehide", function( e, ui ){
- if( o.disablePageZoom ){
+ .bind( "pagebeforehide", function( e, ui ) {
+ if ( o.disablePageZoom ) {
$.mobile.zoom.enable( true );
}
- if( o.updatePagePadding ){
+ if ( o.updatePagePadding ) {
$( window ).unbind( "throttledresize." + self.widgetName );
}
- if( o.trackPersistentToolbars ){
+ if ( o.trackPersistentToolbars ) {
var thisFooter = $( ".ui-footer-fixed:jqmData(id)", this ),
thisHeader = $( ".ui-header-fixed:jqmData(id)", this ),
- nextFooter = thisFooter.length && ui.nextPage && $( ".ui-footer-fixed:jqmData(id='" + thisFooter.jqmData( "id" ) + "')", ui.nextPage ),
- nextHeader = thisHeader.length && ui.nextPage && $( ".ui-header-fixed:jqmData(id='" + thisHeader.jqmData( "id" ) + "')", ui.nextPage );
+ nextFooter = thisFooter.length && ui.nextPage && $( ".ui-footer-fixed:jqmData(id='" + thisFooter.jqmData( "id" ) + "')", ui.nextPage ) || $(),
+ nextHeader = thisHeader.length && ui.nextPage && $( ".ui-header-fixed:jqmData(id='" + thisHeader.jqmData( "id" ) + "')", ui.nextPage ) || $();
- nextFooter = nextFooter || $();
-
- if( nextFooter.length || nextHeader.length ){
+ if ( nextFooter.length || nextHeader.length ) {
nextFooter.add( nextHeader ).appendTo( $.mobile.pageContainer );
- ui.nextPage.one( "pageshow", function(){
+ ui.nextPage.one( "pageshow", function() {
nextFooter.add( nextHeader ).appendTo( this );
});
}
_visible: true,
// This will set the content element's top or bottom padding equal to the toolbar's height
- updatePagePadding: function() {
+ updatePagePadding: function( tbPage ) {
var $el = this.element,
header = $el.is( ".ui-header" );
// This behavior only applies to "fixed", not "fullscreen"
- if( this.options.fullscreen ){ return; }
+ if ( this.options.fullscreen ) { return; }
- $el.closest( ".ui-page" ).css( "padding-" + ( header ? "top" : "bottom" ), $el.outerHeight() );
+ tbPage = tbPage || $el.closest( ".ui-page" );
+ $( tbPage ).css( "padding-" + ( header ? "top" : "bottom" ), $el.outerHeight() );
},
-
- _useTransition: function( notransition ){
+
+ _useTransition: function( notransition ) {
var $win = $( window ),
$el = this.element,
scroll = $win.scrollTop(),
pHeight = $el.closest( ".ui-page" ).height(),
viewportHeight = $.mobile.getScreenHeight(),
tbtype = $el.is( ":jqmData(role='header')" ) ? "header" : "footer";
-
+
return !notransition &&
( this.options.transition && this.options.transition !== "none" &&
(
);
},
- show: function( notransition ){
+ show: function( notransition ) {
var hideClass = "ui-fixed-hidden",
$el = this.element;
- if( this._useTransition( notransition ) ){
+ if ( this._useTransition( notransition ) ) {
$el
.removeClass( "out " + hideClass )
.addClass( "in" );
this._visible = true;
},
- hide: function( notransition ){
+ hide: function( notransition ) {
var hideClass = "ui-fixed-hidden",
$el = this.element,
// if it's a slide transition, our new transitions need the reverse class as well to slide outward
outclass = "out" + ( this.options.transition === "slide" ? " reverse" : "" );
- if( this._useTransition( notransition ) ){
+ if( this._useTransition( notransition ) ) {
$el
.addClass( outclass )
.removeClass( "in" )
- .animationComplete( function(){
+ .animationComplete(function() {
$el.addClass( hideClass ).removeClass( outclass );
});
}
this._visible = false;
},
- toggle: function(){
+ toggle: function() {
this[ this._visible ? "hide" : "show" ]();
},
- _bindToggleHandlers: function(){
+ _bindToggleHandlers: function() {
var self = this,
o = self.options,
$el = self.element;
// tap toggle
$el.closest( ".ui-page" )
- .bind( "vclick", function( e ){
- if( o.tapToggle && !$( e.target ).closest( o.tapToggleBlacklist ).length ){
+ .bind( "vclick", function( e ) {
+ if ( o.tapToggle && !$( e.target ).closest( o.tapToggleBlacklist ).length ) {
self.toggle();
}
})
- .bind( "focusin focusout", function( e ){
- if( screen.width < 500 && $( e.target ).is( o.hideDuringFocus ) && !$( e.target ).closest( ".ui-header-fixed, .ui-footer-fixed" ).length ){
+ .bind( "focusin focusout", function( e ) {
+ if ( screen.width < 500 && $( e.target ).is( o.hideDuringFocus ) && !$( e.target ).closest( ".ui-header-fixed, .ui-footer-fixed" ).length ) {
self[ ( e.type === "focusin" && self._visible ) ? "hide" : "show" ]();
}
});
},
- destroy: function(){
+ destroy: function() {
this.element.removeClass( "ui-header-fixed ui-footer-fixed ui-header-fullscreen ui-footer-fullscreen in out fade slidedown slideup ui-fixed-hidden" );
this.element.closest( ".ui-page" ).removeClass( "ui-page-header-fixed ui-page-footer-fixed ui-page-header-fullscreen ui-page-footer-fullscreen" );
}
//auto self-init widgets
$( document )
- .bind( "pagecreate create", function( e ){
-
+ .bind( "pagecreate create", function( e ) {
+
// DEPRECATED in 1.1: support for data-fullscreen=true|false on the page element.
// This line ensures it still works, but we recommend moving the attribute to the toolbars themselves.
- if( $( e.target ).jqmData( "fullscreen" ) ){
+ if ( $( e.target ).jqmData( "fullscreen" ) ) {
$( $.mobile.fixedtoolbar.prototype.options.initSelector, e.target ).not( ":jqmData(fullscreen)" ).jqmData( "fullscreen", true );
}
-
+
$.mobile.fixedtoolbar.prototype.enhanceWithin( e.target );
});
})( jQuery );
-( function( $, window ) {
-
+(function( $, window ) {
+
// This fix addresses an iOS bug, so return early if the UA claims it's something else.
- if( !(/iPhone|iPad|iPod/.test( navigator.platform ) && navigator.userAgent.indexOf( "AppleWebKit" ) > -1 ) ){
+ if ( !(/iPhone|iPad|iPod/.test( navigator.platform ) && navigator.userAgent.indexOf( "AppleWebKit" ) > -1 ) ) {
return;
}
-
- var zoom = $.mobile.zoom,
+
+ var zoom = $.mobile.zoom,
evt, x, y, z, aig;
-
- function checkTilt( e ){
+
+ function checkTilt( e ) {
evt = e.originalEvent;
aig = evt.accelerationIncludingGravity;
-
+
x = Math.abs( aig.x );
y = Math.abs( aig.y );
z = Math.abs( aig.z );
-
+
// If portrait orientation and in one of the danger zones
- if( !window.orientation && ( x > 7 || ( ( z > 6 && y < 8 || z < 8 && y > 6 ) && x > 5 ) ) ){
- if( zoom.enabled ){
+ if ( !window.orientation && ( x > 7 || ( ( z > 6 && y < 8 || z < 8 && y > 6 ) && x > 5 ) ) ) {
+ if ( zoom.enabled ) {
zoom.disable();
- }
- }
- else if( !zoom.enabled ){
+ }
+ } else if ( !zoom.enabled ) {
zoom.enable();
- }
}
+ }
- $( window )
+ $( window )
.bind( "orientationchange.iosorientationfix", zoom.enable )
.bind( "devicemotion.iosorientationfix", checkTilt );
}( jQuery, this ));
-( function( $, window, undefined ) {
+(function( $, window, undefined ) {
var $html = $( "html" ),
$head = $( "head" ),
$window = $( window );
- // trigger mobileinit event - useful hook for configuring $.mobile settings before they're used
+ //remove initial build class (only present on first pageshow)
+ function hideRenderingClass() {
+ $html.removeClass( "ui-mobile-rendering" );
+ }
+
+ // trigger mobileinit event - useful hook for configuring $.mobile settings before they're used
$( window.document ).trigger( "mobileinit" );
// support conditions
// this ensures the rendering class is removed after 5 seconds, so content is visible and accessible
setTimeout( hideRenderingClass, 5000 );
- // loading div which appears during Ajax requests
- // will not appear if $.mobile.loadingMessage is false
- var loaderClass = "ui-loader",
- $loader = $( "<div class='" + loaderClass + "'><span class='ui-icon ui-icon-loading'></span><h1></h1></div>" );
-
- // For non-fixed supportin browsers. Position at y center (if scrollTop supported), above the activeBtn (if defined), or just 100px from top
- function fakeFixLoader(){
- var activeBtn = $( "." + $.mobile.activeBtnClass ).first();
-
- $loader
- .css({
- top: $.support.scrollTop && $window.scrollTop() + $window.height() / 2 ||
- activeBtn.length && activeBtn.offset().top || 100
- });
- }
-
- // check position of loader to see if it appears to be "fixed" to center
- // if not, use abs positioning
- function checkLoaderPosition(){
- var offset = $loader.offset(),
- scrollTop = $window.scrollTop(),
- screenHeight = $.mobile.getScreenHeight();
-
- if( offset.top < scrollTop || (offset.top - scrollTop) > screenHeight ) {
- $loader.addClass( "ui-loader-fakefix" );
- fakeFixLoader();
- $window
- .unbind( "scroll", checkLoaderPosition )
- .bind( "scroll", fakeFixLoader );
- }
- }
-
- //remove initial build class (only present on first pageshow)
- function hideRenderingClass(){
- $html.removeClass( "ui-mobile-rendering" );
- }
-
- $.extend($.mobile, {
- // turn on/off page loading message.
- showPageLoadingMsg: function( theme, msgText, textonly ) {
- $html.addClass( "ui-loading" );
-
- if ( $.mobile.loadingMessage ) {
- // text visibility from argument takes priority
- var textVisible = textonly || $.mobile.loadingMessageTextVisible;
-
- theme = theme || $.mobile.loadingMessageTheme,
-
- $loader
- .attr( "class", loaderClass + " ui-corner-all ui-body-" + ( theme || "a" ) + " ui-loader-" + ( textVisible ? "verbose" : "default" ) + ( textonly ? " ui-loader-textonly" : "" ) )
- .find( "h1" )
- .text( msgText || $.mobile.loadingMessage )
- .end()
- .appendTo( $.mobile.pageContainer );
-
- checkLoaderPosition();
- $window.bind( "scroll", checkLoaderPosition );
- }
- },
-
- hidePageLoadingMsg: function() {
- $html.removeClass( "ui-loading" );
-
- if( $.mobile.loadingMessage ){
- $loader.removeClass( "ui-loader-fakefix" );
- }
-
- $( window ).unbind( "scroll", fakeFixLoader );
- $( window ).unbind( "scroll", checkLoaderPosition );
- },
-
+ $.extend( $.mobile, {
// find and enhance the pages in the dom and transition to the first page.
initializePage: function() {
// find present pages
- var $pages = $( ":jqmData(role='page'), :jqmData(role='dialog')" );
+ var $pages = $( ":jqmData(role='page'), :jqmData(role='dialog')" ),
+ hash = $.mobile.path.parseLocation().hash.replace("#", ""),
+ hashPage = document.getElementById( hash );
// if no pages are found, create one with body's inner html
if ( !$pages.length ) {
// add dialogs, set data-url attrs
$pages.each(function() {
- var $this = $(this);
+ var $this = $( this );
// unless the data url is already set set it to the pathname
- if ( !$this.jqmData("url") ) {
+ if ( !$this.jqmData( "url" ) ) {
$this.attr( "data-" + $.mobile.ns + "url", $this.attr( "id" ) || location.pathname + location.search );
}
});
//remove initial build class (only present on first pageshow)
hideRenderingClass();
- // if hashchange listening is disabled or there's no hash deeplink, change to the first page in the DOM
- if ( !$.mobile.hashListeningEnabled || !$.mobile.path.stripHash( location.hash ) ) {
+ // if hashchange listening is disabled, there's no hash deeplink,
+ // the hash is not valid (contains more than one # or does not start with #)
+ // or there is no page with that hash, change to the first page in the DOM
+ // Remember, however, that the hash can also be a path!
+ if ( ! ( $.mobile.hashListeningEnabled &&
+ $.mobile.path.isHashValid( location.hash ) &&
+ ( $( hashPage ).is( ':jqmData(role="page")' ) ||
+ $.mobile.path.isPath( hash ) ||
+ hash === $.mobile.dialogHashKey ) ) ) {
+
+ // Store the initial destination
+ if ( $.mobile.path.isHashValid( location.hash ) ) {
+ $.mobile.urlHistory.initialDst = hash.replace( "#", "" );
+ }
$.mobile.changePage( $.mobile.firstPage, { transition: "none", reverse: true, changeHash: false, fromHashChange: true } );
}
// otherwise, trigger a hashchange to load a deeplink
});
// initialize events now, after mobileinit has occurred
- $.mobile._registerInternalEvents();
+ $.mobile.navreadyDeferred.resolve();
// check which scrollTop value should be used by scrolling to 1 immediately at domready
// then check what the scroll top is. Android will report 0... others 1
// if defaultHomeScroll hasn't been set yet, see if scrollTop is 1
// it should be 1 in most browsers, but android treats 1 as 0 (for hiding addr bar)
// so if it's 1, use 0 from now on
- $.mobile.defaultHomeScroll = ( !$.support.scrollTop || $(window).scrollTop() === 1 ) ? 0 : 1;
+ $.mobile.defaultHomeScroll = ( !$.support.scrollTop || $( window ).scrollTop() === 1 ) ? 0 : 1;
// TODO: Implement a proper registration mechanism with dependency handling in order to not have exceptions like the one below
//auto self-init widgets for those widgets that have a soft dependency on others
if ( $.fn.controlgroup ) {
- $( document ).bind( "pagecreate create", function( e ){
+ $( document ).bind( "pagecreate create", function( e ) {
$( ":jqmData(role='controlgroup')", e.target )
.jqmEnhanceable()
.controlgroup({ excludeInvisible: false });
}
//dom-ready inits
- if( $.mobile.autoInitializePage ){
+ if ( $.mobile.autoInitializePage ) {
$.mobile.initializePage();
}
// window load event
// hide iOS browser chrome on load
$window.load( $.mobile.silentScroll );
+
+ if ( !$.support.cssPointerEvents ) {
+ // IE and Opera don't support CSS pointer-events: none that we use to disable link-based buttons
+ // by adding the 'ui-disabled' class to them. Using a JavaScript workaround for those browser.
+ // https://github.com/jquery/jquery-mobile/issues/3558
+
+ $( document ).delegate( ".ui-disabled", "vclick",
+ function( e ) {
+ e.preventDefault();
+ e.stopImmediatePropagation();
+ }
+ );
+ }
});
}( jQuery, this ));
-
}));
<title>$${HtmlTitle|"Title"}</title>
- <link rel="stylesheet" href="./css/jquery.mobile-1.1.0.css"/>
- <script type="text/javascript" src="./js/jquery-1.7.1.js"></script>
- <script type="text/javascript" src="./js/jquery.mobile-1.1.0.js"></script>
+ <link rel="stylesheet" href="./css/jquery.mobile-1.2.0.css"/>
+ <script type="text/javascript" src="./js/jquery-1.8.2.js"></script>
+ <script type="text/javascript" src="./js/jquery.mobile-1.2.0.js"></script>
<script type="text/javascript" src="./js/main.js"></script>
<link rel="stylesheet" type="text/css" href="./css/style.css"/>
</head>
<title>$${HtmlTitle|"Title"}</title>
- <link rel="stylesheet" href="./css/jquery.mobile-1.1.0.css"/>
- <script type="text/javascript" src="./js/jquery-1.7.1.js"></script>
- <script type="text/javascript" src="./js/jquery.mobile-1.1.0.js"></script>
+ <link rel="stylesheet" href="./css/jquery.mobile-1.2.0.css"/>
+ <script type="text/javascript" src="./js/jquery-1.8.2.js"></script>
+ <script type="text/javascript" src="./js/jquery.mobile-1.2.0.js"></script>
<script type="text/javascript" src="./js/main.js"></script>
<link rel="stylesheet" type="text/css" href="./css/style.css"/>
</head>
<title>$${HtmlTitle|"Title"}</title>
- <link rel="stylesheet" href="./css/jquery.mobile-1.1.0.css"/>
- <script type="text/javascript" src="./js/jquery-1.7.1.js"></script>
- <script type="text/javascript" src="./js/jquery.mobile-1.1.0.js"></script>
+ <link rel="stylesheet" href="./css/jquery.mobile-1.2.0.css"/>
+ <script type="text/javascript" src="./js/jquery-1.8.2.js"></script>
+ <script type="text/javascript" src="./js/jquery.mobile-1.2.0.js"></script>
<script type="text/javascript" src="./js/main.js"></script>
<link rel="stylesheet" type="text/css" href="./css/style.css"/>
</head>
<title>$${HtmlTitle|"Title"}</title>
- <link rel="stylesheet" href="./css/jquery.mobile-1.1.0.css"/>
- <script type="text/javascript" src="./js/jquery-1.7.1.js"></script>
- <script type="text/javascript" src="./js/jquery.mobile-1.1.0.js"></script>
+ <link rel="stylesheet" href="./css/jquery.mobile-1.2.0.css"/>
+ <script type="text/javascript" src="./js/jquery-1.8.2.js"></script>
+ <script type="text/javascript" src="./js/jquery.mobile-1.2.0.js"></script>
<script type="text/javascript" src="./js/main.js"></script>
<link rel="stylesheet" type="text/css" href="./css/style.css"/>
</head>
<div data-role="content" data-theme="$${JQMTheme|'c'}">
<p>This is a single page boilerplate template that you can copy to build your first jQuery Mobile page.</p>
- <canvas width="" height="300"></canvas>
</div><!-- /content -->
<div data-role="footer" data-position="fixed" data-theme="$${JQMTheme|'a'}">
clear: both;
}
-article > section video {
- width: 480px;
- height: 200px;
-}
-
-article > section div.no-html5-video,
-article > section div#no-canvas {
- width: 480px;
- height: 40px;
- border: 1px solid #993333;
- text-align: center;
- color: #993333;
- font-size: 13px;
- font-style: italic;
- background-color: #F7E9E9;
-}
-
-article > section div#no-canvas {
- display: none;
-}
-
-article > section form {
- border: 1px solid #888;
- -moz-border-radius: 10px;
- -webkit-border-radius: 10px;
- border-radius: 10px;
- -moz-box-shadow: 10px 10px 5px #888;
- -webkit-box-shadow: 10px 10px 5px #888;
- box-shadow: 10px 10px 5px #888;
- background-color: #eee;
- padding: 10px;
- margin-bottom: 30px;
-}
-
-article > section label {
- font-weight: bold;
- font-size: 13px;
-}
-
-article > section input {
- margin-bottom: 3px;
- font-size: 13px;
-}
-
footer p {
text-align: center;
font-size: 12px;
color: #888;
margin-top: 24px;
}
-
<?xml version="1.0" encoding="UTF-8"?>
<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets" id="http://yourdomain/$${WidgetID|"WidgetID"}" version="1.0.0" viewmodes="maximized">
- <tizen:application id="$@{APPLICATIONID()}" required_version="1.0"/>
+ <tizen:application id="$@{APPID=APPLICATIONID()}.$${WidgetID|"WidgetID"}" package="$${APPID}" required_version="1.0"/>
<content src="index.html"/>
- <tizen:privilege name="http://tizen.org/privilege/tizen"/>
- <tizen:privilege name="http://tizen.org/privilege/application.kill"/>
+ <tizen:privilege name="http://tizen.org/privilege/application.launch"/>
<icon src="icon.png"/>
<name>$${WidgetID|"WidgetID"}</name>
</widget>
--- /dev/null
+{
+ "jquery.mobile.tizen.scrollview": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "jquery.mobile.tizen.scrollview.js",
+ "name": "jquery.mobile.tizen.scrollview",
+ "depends": [],
+ "label": "Scrollview",
+ "group": "Tizen:Core",
+ "description": "Implements scroll by javascript"
+ },
+ "events/throttledresize": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "events/throttledresize.js",
+ "name": "events/throttledresize",
+ "depends": [
+ "events/jquery"
+ ],
+ "label": "throttledresize",
+ "group": "Events",
+ "description": "Throttled resize event"
+ },
+ "events/touch": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "events/touch.js",
+ "name": "events/touch",
+ "depends": [
+ "events/jquery",
+ "jquery.mobile.vmouse",
+ "jquery.mobile.support.touch"
+ ],
+ "label": "touch",
+ "group": "Events",
+ "description": "Touch events: touchstart, touchmove, touchend, tap, taphold, swipe, swipeleft, swiperight, scrollstart, scrollstop"
+ },
+ "events/orientationchange": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "events/orientationchange.js",
+ "name": "events/orientationchange",
+ "depends": [
+ "events/jquery",
+ "jquery.mobile.support.orientation",
+ "events/throttledresize"
+ ],
+ "label": "orientationchange",
+ "group": "Events",
+ "description": "Orientation change event"
+ },
+ "jquery.mobile.define": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "jquery.mobile.define.js",
+ "name": "jquery.mobile.define",
+ "depends": [],
+ "label": "",
+ "group": "",
+ "description": ""
+ },
+ "jquery.mobile.docs": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "jquery.mobile.docs.js",
+ "name": "jquery.mobile.docs",
+ "depends": [
+ "depend!../docs/_assets/js/jqm-docs[jquery]"
+ ],
+ "label": "",
+ "group": "",
+ "description": ""
+ },
+ "text": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "text.js",
+ "name": "text",
+ "depends": [],
+ "label": "",
+ "group": "",
+ "description": ""
+ },
+ "depend": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "depend.js",
+ "name": "depend",
+ "depends": [],
+ "label": "",
+ "group": "",
+ "description": ""
+ },
+ "jquery.mobile.navigation": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "jquery.mobile.navigation.js",
+ "name": "jquery.mobile.navigation",
+ "depends": [
+ "jquery",
+ "jquery.mobile.core",
+ "jquery.mobile.events",
+ "jquery.mobile.support",
+ "depend!./jquery.hashchange[jquery]",
+ "widgets/page",
+ "jquery.mobile.transition"
+ ],
+ "label": "AJAX Navigation System",
+ "group": "Navigation",
+ "description": "Applies the AJAX navigation system to links and forms to enable page transitions"
+ },
+ "jquery.mobile.tizen.core": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "jquery.mobile.tizen.core.js",
+ "name": "jquery.mobile.tizen.core",
+ "depends": [
+ "jquery.mobile.core",
+ "jquery.mobile.tizen.configure",
+ "util/ensurens"
+ ],
+ "label": "Tizen core",
+ "group": "Tizen:Core",
+ "description": "Tizen core library"
+ },
+ "jquery.mobile.support.orientation": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "jquery.mobile.support.orientation.js",
+ "name": "jquery.mobile.support.orientation",
+ "depends": [
+ "jquery"
+ ],
+ "label": "Orientation support test",
+ "group": "Core",
+ "description": "Feature test for orientation"
+ },
+ "util/range": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "util/range.js",
+ "name": "util/range",
+ "depends": [],
+ "label": "Range",
+ "group": "Tizen:Utilities",
+ "description": "Makes array with given range"
+ },
+ "util/ensurens": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "util/ensurens.js",
+ "name": "util/ensurens",
+ "depends": [],
+ "label": "Ensurens",
+ "group": "Tizen:Utilities",
+ "description": "Make namespace for modules"
+ },
+ "jquery.mobile.tizen.clrlib": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "jquery.mobile.tizen.clrlib.js",
+ "name": "jquery.mobile.tizen.clrlib",
+ "depends": [],
+ "label": "Color library",
+ "group": "Tizen:Core",
+ "description": "Color code converter"
+ },
+ "jquery.mobile.links": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "jquery.mobile.links.js",
+ "name": "jquery.mobile.links",
+ "depends": [
+ "jquery"
+ ],
+ "label": "Link Classes",
+ "group": "Utilities",
+ "description": "Adds classes to links."
+ },
+ "jquery.mobile.tizen.configure": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "jquery.mobile.tizen.configure.js",
+ "name": "jquery.mobile.tizen.configure",
+ "depends": [],
+ "label": "Configuration",
+ "group": "Tizen:Core",
+ "description": "jQuery Mobile configuration for Tizen widgets"
+ },
+ "jquery.mobile.support": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "jquery.mobile.support.js",
+ "name": "jquery.mobile.support",
+ "depends": [
+ "jquery",
+ "jquery.mobile.core",
+ "jquery.mobile.media",
+ "jquery.mobile.support.touch",
+ "jquery.mobile.support.orientation"
+ ],
+ "label": "Support Tests",
+ "group": "Core",
+ "description": "Assorted tests to qualify browsers by detecting features"
+ },
+ "jquery.mobile.zoom.iosorientationfix": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "jquery.mobile.zoom.iosorientationfix.js",
+ "name": "jquery.mobile.zoom.iosorientationfix",
+ "depends": [
+ "jquery",
+ "jquery.mobile.core",
+ "jquery.mobile.zoom"
+ ],
+ "label": "iOS Orientation Change Fix",
+ "group": "Utilities",
+ "description": "Fixes the orientation change bug in iOS when switching between landspace and portrait"
+ },
+ "widgets/jquery.mobile.tizen.gallery3d": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "widgets/jquery.mobile.tizen.gallery3d.js",
+ "name": "widgets/jquery.mobile.tizen.gallery3d",
+ "depends": [
+ "widgets/components/imageloader",
+ "widgets/components/motionpath",
+ "widgets/components/webgl"
+ ],
+ "label": "//>>label: Gallery3d",
+ "group": "//>>group: Tizen:Widgets",
+ "description": "//>>description: 3D photo gallery widget."
+ },
+ "widgets/jquery.mobile.tizen.multimediaview": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "widgets/jquery.mobile.tizen.multimediaview.js",
+ "name": "widgets/jquery.mobile.tizen.multimediaview",
+ "depends": [
+ "jquery.mobile.tizen.scrollview"
+ ],
+ "label": "Multimedia view",
+ "group": "Tizen:Widgets",
+ "description": "Shows multimedia and its controls"
+ },
+ "widgets/jquery.mobile.tizen.button": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "widgets/jquery.mobile.tizen.button.js",
+ "name": "widgets/jquery.mobile.tizen.button",
+ "depends": [],
+ "label": "Button",
+ "group": "Tizen:Widgets",
+ "description": "Tizen button"
+ },
+ "widgets/loader": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "widgets/loader.js",
+ "name": "widgets/loader",
+ "depends": [
+ "widgets/jquery",
+ "jquery.mobile.core",
+ "jquery.mobile.widget"
+ ],
+ "label": "loading message",
+ "group": "Navigation",
+ "description": "packaged loading message functionality"
+ },
+ "widgets/jquery.mobile.tizen.scrollview.handler": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "widgets/jquery.mobile.tizen.scrollview.handler.js",
+ "name": "widgets/jquery.mobile.tizen.scrollview.handler",
+ "depends": [
+ "jquery.mobile.tizen.core",
+ "jquery.mobile.tizen.scrollview"
+ ],
+ "label": "Scrollview Handler",
+ "group": "Tizen:Widgets",
+ "description": "Shows a scroll-handler with a scrollview"
+ },
+ "widgets/jquery.mobile.tizen.popupwindow.ctxpopup": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "widgets/jquery.mobile.tizen.popupwindow.ctxpopup.js",
+ "name": "widgets/jquery.mobile.tizen.popupwindow.ctxpopup",
+ "depends": [
+ "jquery.mobile.tizen.core",
+ "widgets/jquery.mobile.tizen.popupwindow",
+ "widgets/jquery.mobile.tizen.triangle"
+ ],
+ "label": "Context popup",
+ "group": "Tizen:Widgets",
+ "description": "Shows popup at any place in the page content, with various styles"
+ },
+ "widgets/jquery.mobile.tizen.datetimepicker": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "widgets/jquery.mobile.tizen.datetimepicker.js",
+ "name": "widgets/jquery.mobile.tizen.datetimepicker",
+ "depends": [
+ "widgets/jquery.mobile.tizen.widgetex",
+ "widgets/jquery.mobile.tizen.popupwindow",
+ "widgets/jquery.mobile.tizen.popupwindow.ctxpopup"
+ ],
+ "label": "Datetime picker",
+ "group": "Tizen:Widgets",
+ "description": "Shows date and time, and make them able to be changed by user"
+ },
+ "widgets/jquery.mobile.tizen.slider": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "widgets/jquery.mobile.tizen.slider.js",
+ "name": "widgets/jquery.mobile.tizen.slider",
+ "depends": [
+ "jquery.mobile.tizen.core"
+ ],
+ "label": "Slider",
+ "group": "Tizen:Widgets",
+ "description": "Shows slider bar to input number by dragging"
+ },
+ "widgets/listview.filter": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "widgets/listview.filter.js",
+ "name": "widgets/listview.filter",
+ "depends": [
+ "widgets/jquery",
+ "widgets/listview",
+ "widgets/forms/textinput"
+ ],
+ "label": "Listview: Filter",
+ "group": "Widgets",
+ "description": "Extends the listview to add a search box to filter lists"
+ },
+ "widgets/jquery.mobile.tizen.swipe": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "widgets/jquery.mobile.tizen.swipe.js",
+ "name": "widgets/jquery.mobile.tizen.swipe",
+ "depends": [
+ "jquery.mobile.tizen.core"
+ ],
+ "label": "Swipe list",
+ "group": "Tizen:Widgets",
+ "description": "Shows background listitem by swiping left/right on a listitem"
+ },
+ "widgets/dialog": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "widgets/dialog.js",
+ "name": "widgets/dialog",
+ "depends": [
+ "widgets/jquery",
+ "jquery.mobile.widget"
+ ],
+ "label": "Dialogs",
+ "group": "Widgets",
+ "description": "Displays a page as a modal dialog with inset appearance and overlay background"
+ },
+ "widgets/jquery.mobile.tizen.listdivider": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "widgets/jquery.mobile.tizen.listdivider.js",
+ "name": "widgets/jquery.mobile.tizen.listdivider",
+ "depends": [],
+ "label": "List divider",
+ "group": "Tizen:Widgets",
+ "description": "Divider listitem in listview"
+ },
+ "widgets/jquery.mobile.tizen.notification": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "widgets/jquery.mobile.tizen.notification.js",
+ "name": "widgets/jquery.mobile.tizen.notification",
+ "depends": [
+ "jquery.mobile.tizen.core"
+ ],
+ "label": "Notification",
+ "group": "Tizen:Widgets",
+ "description": "Shows notification popup over header/footer"
+ },
+ "widgets/jquery.mobile.tizen.pagelayout": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "widgets/jquery.mobile.tizen.pagelayout.js",
+ "name": "widgets/jquery.mobile.tizen.pagelayout",
+ "depends": [
+ "jquery.mobile.tizen.core"
+ ],
+ "label": "Pagelayout",
+ "group": "Tizen:Widgets",
+ "description": "Set a layout of pages"
+ },
+ "widgets/collapsibleSet": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "widgets/collapsibleSet.js",
+ "name": "widgets/collapsibleSet",
+ "depends": [
+ "widgets/jquery",
+ "jquery.mobile.widget",
+ "widgets/collapsible"
+ ],
+ "label": "Collapsible Sets (Accordions)",
+ "group": "Widgets",
+ "description": "For creating grouped collapsible content areas."
+ },
+ "widgets/jquery.mobile.tizen.checkbox": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "widgets/jquery.mobile.tizen.checkbox.js",
+ "name": "widgets/jquery.mobile.tizen.checkbox",
+ "depends": [],
+ "label": "//>>label: Checkbox",
+ "group": "//>>group: Tizen:Widgets",
+ "description": "//>>description: Checkbox widget"
+ },
+ "widgets/listview": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "widgets/listview.js",
+ "name": "widgets/listview",
+ "depends": [
+ "widgets/jquery",
+ "jquery.mobile.widget",
+ "jquery.mobile.buttonMarkup",
+ "widgets/page",
+ "widgets/page.sections"
+ ],
+ "label": "Listview",
+ "group": "Widgets",
+ "description": "Applies listview styling of various types (standard, numbered, split button, etc.)"
+ },
+ "widgets/jquery.mobile.tizen.splitview": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "widgets/jquery.mobile.tizen.splitview.js",
+ "name": "widgets/jquery.mobile.tizen.splitview",
+ "depends": [
+ "jquery.mobile.tizen.scrollview"
+ ],
+ "label": "Split view",
+ "group": "Tizen:Widgets",
+ "description": "Show different HTML contents at the same time on each divided pane."
+ },
+ "widgets/listview.autodividers": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "widgets/listview.autodividers.js",
+ "name": "widgets/listview.autodividers",
+ "depends": [
+ "widgets/jquery",
+ "widgets/listview"
+ ],
+ "label": "Listview Autodividers",
+ "group": "Widgets",
+ "description": "Generates dividers for listview items"
+ },
+ "widgets/jquery.mobile.tizen.virtualgrid": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "widgets/jquery.mobile.tizen.virtualgrid.js",
+ "name": "widgets/jquery.mobile.tizen.virtualgrid",
+ "depends": [
+ "jquery.mobile.tizen.core",
+ "jquery.mobile.tizen.scrollview"
+ ],
+ "label": "Virtual grid",
+ "group": "Tizen:Widgets",
+ "description": "Shows grid swapping its contents automatically"
+ },
+ "widgets/popup": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "widgets/popup.js",
+ "name": "widgets/popup",
+ "depends": [
+ "widgets/jquery",
+ "jquery.mobile.widget",
+ "jquery.mobile.support",
+ "jquery.mobile.navigation",
+ "widgets/depend!../jquery.hashchange[jquery]"
+ ],
+ "label": "Popups",
+ "group": "Widgets",
+ "description": "Popup windows"
+ },
+ "widgets/jquery.mobile.tizen.searchbar": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "widgets/jquery.mobile.tizen.searchbar.js",
+ "name": "widgets/jquery.mobile.tizen.searchbar",
+ "depends": [
+ "jquery.mobile.tizen.core",
+ "widgets/jquery.mobile.tizen.pagelayout"
+ ],
+ "label": "Searchbar",
+ "group": "Tizen:Widgets",
+ "description": "Shows searchbar, for text search"
+ },
+ "widgets/forms/slider": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "widgets/forms/slider.js",
+ "name": "widgets/forms/slider",
+ "depends": [
+ "widgets/forms/jquery",
+ "jquery.mobile.core",
+ "jquery.mobile.widget",
+ "widgets/forms/textinput",
+ "jquery.mobile.buttonMarkup"
+ ],
+ "label": "Slider",
+ "group": "Forms",
+ "description": "Slider form widget"
+ },
+ "widgets/forms/button": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "widgets/forms/button.js",
+ "name": "widgets/forms/button",
+ "depends": [
+ "widgets/forms/jquery",
+ "jquery.mobile.widget",
+ "jquery.mobile.buttonMarkup"
+ ],
+ "label": "Buttons: Input or button-based",
+ "group": "Forms",
+ "description": "Custom-styled native input/buttons"
+ },
+ "widgets/forms/select.custom": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "widgets/forms/select.custom.js",
+ "name": "widgets/forms/select.custom",
+ "depends": [
+ "widgets/forms/jquery",
+ "jquery.mobile.buttonMarkup",
+ "jquery.mobile.core",
+ "widgets/dialog",
+ "widgets/forms/select",
+ "widgets/listview",
+ "widgets/page",
+ "widgets/popup",
+ "widgets/page.sections"
+ ],
+ "label": "Selects: Custom menus",
+ "group": "Forms",
+ "description": "Extension to select menus to support menu styling, placeholder options, and multi-select features."
+ },
+ "widgets/forms/checkboxradio": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "widgets/forms/checkboxradio.js",
+ "name": "widgets/forms/checkboxradio",
+ "depends": [
+ "widgets/forms/jquery",
+ "jquery.mobile.core",
+ "jquery.mobile.widget",
+ "jquery.mobile.buttonMarkup"
+ ],
+ "label": "Checkboxes & Radio Buttons",
+ "group": "Forms",
+ "description": "Consistent styling for checkboxes/radio buttons."
+ },
+ "widgets/forms/select": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "widgets/forms/select.js",
+ "name": "widgets/forms/select",
+ "depends": [
+ "widgets/forms/jquery",
+ "jquery.mobile.core",
+ "jquery.mobile.widget",
+ "jquery.mobile.buttonMarkup",
+ "jquery.mobile.zoom"
+ ],
+ "label": "Selects",
+ "group": "Forms",
+ "description": "Consistent styling for native select menus. Tapping opens a native select menu."
+ },
+ "widgets/forms/textinput": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "widgets/forms/textinput.js",
+ "name": "widgets/forms/textinput",
+ "depends": [
+ "widgets/forms/jquery",
+ "jquery.mobile.core",
+ "jquery.mobile.widget",
+ "jquery.mobile.degradeInputs",
+ "jquery.mobile.buttonMarkup",
+ "jquery.mobile.zoom"
+ ],
+ "label": "Text Inputs & Textareas",
+ "group": "Forms",
+ "description": "Enhances and consistently styles text inputs."
+ },
+ "widgets/jquery.mobile.tizen.gallery": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "widgets/jquery.mobile.tizen.gallery.js",
+ "name": "widgets/jquery.mobile.tizen.gallery",
+ "depends": [],
+ "label": "Gallery",
+ "group": "Tizen:Widgets",
+ "description": "Shows images one by one, and moves them by flicking"
+ },
+ "widgets/jquery.mobile.tizen.circularview": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "widgets/jquery.mobile.tizen.circularview.js",
+ "name": "widgets/jquery.mobile.tizen.circularview",
+ "depends": [
+ "jquery.mobile.tizen.scrollview"
+ ],
+ "label": "Circularview",
+ "group": "Tizen:Widgets",
+ "description": "Container widget showing children circulary"
+ },
+ "widgets/navbar": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "widgets/navbar.js",
+ "name": "widgets/navbar",
+ "depends": [
+ "widgets/jquery",
+ "jquery.mobile.widget",
+ "jquery.mobile.buttonMarkup",
+ "jquery.mobile.grid"
+ ],
+ "label": "Navbars",
+ "group": "Widgets",
+ "description": "Formats groups of links as horizontal navigation bars."
+ },
+ "widgets/components/imageloader": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "widgets/components/imageloader.js",
+ "name": "widgets/components/imageloader",
+ "depends": [],
+ "label": "//>>label: Image loader",
+ "group": "//>>group: Tizen:Widgets:Components",
+ "description": "//>>description: Tizen image loader component for gallery3d"
+ },
+ "widgets/components/motionpath": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "widgets/components/motionpath.js",
+ "name": "widgets/components/motionpath",
+ "depends": [],
+ "label": "//>>label: Motion path",
+ "group": "//>>group: Tizen:Widgets:Components",
+ "description": "//>>description: Tizen motion path component for gallery3d"
+ },
+ "widgets/components/webgl": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "widgets/components/webgl.js",
+ "name": "widgets/components/webgl",
+ "depends": [],
+ "label": "//>>label: WebGL",
+ "group": "//>>group: Tizen:Widgets:Lib",
+ "description": "//>>description: Tizen WebGL component for gallery3d"
+ },
+ "widgets/jquery.mobile.tizen.popupwindow": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "widgets/jquery.mobile.tizen.popupwindow.js",
+ "name": "widgets/jquery.mobile.tizen.popupwindow",
+ "depends": [
+ "jquery.mobile.tizen.core",
+ "widgets/jquery.mobile.tizen.widgetex"
+ ],
+ "label": "Popup",
+ "group": "Tizen:Widgets",
+ "description": "Shows popup on the page"
+ },
+ "widgets/jquery.mobile.tizen.virtuallistview": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "widgets/jquery.mobile.tizen.virtuallistview.js",
+ "name": "widgets/jquery.mobile.tizen.virtuallistview",
+ "depends": [
+ "jquery.mobile.tizen.core",
+ "jquery.mobile.tizen.scrollview"
+ ],
+ "label": "Virtual listview",
+ "group": "Tizen:Widgets",
+ "description": "Shows listview swapping its contents automatically"
+ },
+ "widgets/jquery.mobile.tizen.progress": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "widgets/jquery.mobile.tizen.progress.js",
+ "name": "widgets/jquery.mobile.tizen.progress",
+ "depends": [
+ "jquery.mobile.tizen.core"
+ ],
+ "label": "Progress",
+ "group": "Tizen:Widgets",
+ "description": "Shows progressbar or progress circle"
+ },
+ "widgets/jquery.mobile.tizen.fastscroll": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "widgets/jquery.mobile.tizen.fastscroll.js",
+ "name": "widgets/jquery.mobile.tizen.fastscroll",
+ "depends": [
+ "jquery.mobile.tizen.scrollview"
+ ],
+ "label": "Fastscroll",
+ "group": "Tizen:Widgets",
+ "description": "Shows list index and scroll to the index directly"
+ },
+ "widgets/jquery.mobile.tizen.widgetex": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "widgets/jquery.mobile.tizen.widgetex.js",
+ "name": "widgets/jquery.mobile.tizen.widgetex",
+ "depends": [
+ "jquery.mobile.tizen.core"
+ ],
+ "label": "Widget extension",
+ "group": "Tizen:Widgets",
+ "description": "Widget class extending functionality of jQueryMobile widget class"
+ },
+ "widgets/fixedToolbar": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "widgets/fixedToolbar.js",
+ "name": "widgets/fixedToolbar",
+ "depends": [
+ "widgets/jquery",
+ "jquery.mobile.widget",
+ "jquery.mobile.core",
+ "jquery.mobile.navigation",
+ "widgets/page",
+ "widgets/page.sections",
+ "jquery.mobile.zoom"
+ ],
+ "label": "Toolbars: Fixed",
+ "group": "Widgets",
+ "description": "Behavior for \"fixed\" headers and footers"
+ },
+ "widgets/jquery.mobile.tizen.tabbar": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "widgets/jquery.mobile.tizen.tabbar.js",
+ "name": "widgets/jquery.mobile.tizen.tabbar",
+ "depends": [
+ "jquery.mobile.tizen.core",
+ "widgets/jquery.mobile.tizen.pagelayout"
+ ],
+ "label": "Tabbar",
+ "group": "Tizen:Widgets",
+ "description": "Shows buttons divided automatically on the header"
+ },
+ "widgets/jquery.mobile.tizen.triangle": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "widgets/jquery.mobile.tizen.triangle.js",
+ "name": "widgets/jquery.mobile.tizen.triangle",
+ "depends": [
+ "jquery.mobile.tizen.core",
+ "widgets/jquery.mobile.tizen.widgetex"
+ ],
+ "label": "Triangle",
+ "group": "Tizen:Widgets",
+ "description": "Shows triangle, used by context popup"
+ },
+ "widgets/jquery.mobile.tizen.tokentextarea": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "widgets/jquery.mobile.tizen.tokentextarea.js",
+ "name": "widgets/jquery.mobile.tizen.tokentextarea",
+ "depends": [
+ "jquery.mobile.tizen.core"
+ ],
+ "label": "Token textarea",
+ "group": "Tizen:Widgets",
+ "description": "Make words to selectable tokens"
+ },
+ "widgets/collapsible": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "widgets/collapsible.js",
+ "name": "widgets/collapsible",
+ "depends": [
+ "widgets/jquery",
+ "jquery.mobile.widget",
+ "jquery.mobile.buttonMarkup"
+ ],
+ "label": "Collapsible",
+ "group": "Widgets",
+ "description": "Creates collapsible content blocks."
+ },
+ "widgets/page": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "widgets/page.js",
+ "name": "widgets/page",
+ "depends": [
+ "widgets/jquery",
+ "jquery.mobile.widget"
+ ],
+ "label": "Page Creation",
+ "group": "Core",
+ "description": "Basic page definition and formatting."
+ },
+ "widgets/page.sections": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "widgets/page.sections.js",
+ "name": "widgets/page.sections",
+ "depends": [
+ "widgets/jquery",
+ "widgets/page",
+ "jquery.mobile.core"
+ ],
+ "label": "Page Sections",
+ "group": "Core",
+ "description": "Theming and layout of headers, footers, and content areas"
+ },
+ "widgets/jquery.mobile.tizen.progressbar": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "widgets/jquery.mobile.tizen.progressbar.js",
+ "name": "widgets/jquery.mobile.tizen.progressbar",
+ "depends": [
+ "jquery.mobile.tizen.core"
+ ],
+ "label": "Progressbar",
+ "group": "Tizen:Widgets",
+ "description": "Shows progressbar"
+ },
+ "widgets/jquery.mobile.tizen.extendablelist": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "widgets/jquery.mobile.tizen.extendablelist.js",
+ "name": "widgets/jquery.mobile.tizen.extendablelist",
+ "depends": [
+ "jquery.mobile.tizen.scrollview"
+ ],
+ "label": "Extendable list",
+ "group": "Tizen:Widgets",
+ "description": "Listview which can be extended more and more"
+ },
+ "jquery.mobile.fieldContain": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "jquery.mobile.fieldContain.js",
+ "name": "jquery.mobile.fieldContain",
+ "depends": [
+ "jquery"
+ ],
+ "label": "Fieldcontainers",
+ "group": "Forms",
+ "description": "Styling to responsively position forms and labels based on screen width and add visual separation"
+ },
+ "jquery.mobile.controlGroup": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "jquery.mobile.controlGroup.js",
+ "name": "jquery.mobile.controlGroup",
+ "depends": [
+ "jquery",
+ "jquery.mobile.buttonMarkup"
+ ],
+ "label": "Controlgroups",
+ "group": "Forms",
+ "description": "Visually groups sets of buttons, checks, radios, etc."
+ },
+ "jquery.mobile": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "jquery.mobile.js",
+ "name": "jquery.mobile",
+ "depends": [
+ "require",
+ "widgets/loader",
+ "jquery.mobile.navigation",
+ "jquery.mobile.navigation.pushstate",
+ "jquery.mobile.transitions",
+ "jquery.mobile.degradeInputs",
+ "widgets/dialog",
+ "widgets/page.sections",
+ "widgets/collapsible",
+ "widgets/collapsibleSet",
+ "jquery.mobile.fieldContain",
+ "jquery.mobile.grid",
+ "widgets/navbar",
+ "widgets/listview",
+ "widgets/listview.filter",
+ "widgets/listview.autodividers",
+ "jquery.mobile.nojs",
+ "widgets/forms/checkboxradio",
+ "widgets/forms/button",
+ "widgets/forms/slider",
+ "widgets/forms/textinput",
+ "widgets/forms/select.custom",
+ "widgets/forms/select",
+ "jquery.mobile.buttonMarkup",
+ "jquery.mobile.controlGroup",
+ "jquery.mobile.links",
+ "widgets/fixedToolbar",
+ "widgets/popup",
+ "jquery.mobile.zoom",
+ "jquery.mobile.zoom.iosorientationfix"
+ ],
+ "label": "",
+ "group": "exclude",
+ "description": ""
+ },
+ "jquery.mobile.navigation.pushstate": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "jquery.mobile.navigation.pushstate.js",
+ "name": "jquery.mobile.navigation.pushstate",
+ "depends": [
+ "jquery",
+ "jquery.mobile.navigation",
+ "depend!./jquery.hashchange[jquery]"
+ ],
+ "label": "Pushstate Support",
+ "group": "Navigation",
+ "description": "history.pushState support, layered on top of hashchange."
+ },
+ "jquery.mobile.support.touch": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "jquery.mobile.support.touch.js",
+ "name": "jquery.mobile.support.touch",
+ "depends": [
+ "jquery"
+ ],
+ "label": "Touch support test",
+ "group": "Core",
+ "description": "Touch feature test"
+ },
+ "jquery.mobile.tizen.loadprototype": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "jquery.mobile.tizen.loadprototype.js",
+ "name": "jquery.mobile.tizen.loadprototype",
+ "depends": [],
+ "label": "Widget prototype loader",
+ "group": "Tizen:Core",
+ "description": "Loads widget's prototype"
+ },
+ "jquery.mobile.tizen.loader": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "jquery.mobile.tizen.loader.js",
+ "name": "jquery.mobile.tizen.loader",
+ "depends": [
+ "jquery.mobile.tizen.core"
+ ],
+ "label": "Loader",
+ "group": "Tizen:Core",
+ "description": "Loader doing theme loading, viewport setting, globalize loading, etc."
+ },
+ "jquery.mobile.zoom": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "jquery.mobile.zoom.js",
+ "name": "jquery.mobile.zoom",
+ "depends": [
+ "jquery",
+ "jquery.mobile.core"
+ ],
+ "label": "Zoom Handling",
+ "group": "Utilities",
+ "description": "Utility methods for enabling and disabling user scaling (pinch zoom)"
+ },
+ "jquery.mobile.init": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "jquery.mobile.init.js",
+ "name": "jquery.mobile.init",
+ "depends": [
+ "jquery",
+ "jquery.mobile.core",
+ "jquery.mobile.support",
+ "jquery.mobile.navigation",
+ "jquery.mobile.navigation.pushstate",
+ "widgets/loader",
+ "jquery.mobile.vmouse",
+ "depend!./jquery.hashchange[jquery]"
+ ],
+ "label": "Init",
+ "group": "Core",
+ "description": "Global initialization of the library."
+ },
+ "jquery.tag.inserter": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "jquery.tag.inserter.js",
+ "name": "jquery.tag.inserter",
+ "depends": [],
+ "label": "",
+ "group": "",
+ "description": ""
+ },
+ "jquery.mobile.nojs": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "jquery.mobile.nojs.js",
+ "name": "jquery.mobile.nojs",
+ "depends": [
+ "jquery"
+ ],
+ "label": "“nojs” Classes",
+ "group": "Utilities",
+ "description": "Adds class to make elements hidden to A grade browsers"
+ },
+ "jquery.mobile.widget": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "jquery.mobile.widget.js",
+ "name": "jquery.mobile.widget",
+ "depends": [
+ "jquery",
+ "depend!./jquery.ui.widget[jquery]"
+ ],
+ "label": "Widget Factory",
+ "group": "Core",
+ "description": "Widget factory extentions for mobile."
+ },
+ "jquery.mobile.buttonMarkup": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "jquery.mobile.buttonMarkup.js",
+ "name": "jquery.mobile.buttonMarkup",
+ "depends": [
+ "jquery",
+ "jquery.mobile.core",
+ "jquery.mobile.vmouse"
+ ],
+ "label": "Buttons: Link-based",
+ "group": "Forms",
+ "description": "Applies button styling to links"
+ },
+ "jquery.mobile.label": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "jquery.mobile.label.js",
+ "name": "jquery.mobile.label",
+ "depends": [],
+ "label": "Label",
+ "group": "Tizen:Core",
+ "description": "Add markup for labels"
+ },
+ "jquery.hashchange": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "jquery.hashchange.js",
+ "name": "jquery.hashchange",
+ "depends": [],
+ "label": "",
+ "group": "",
+ "description": ""
+ },
+ "jquery": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "jquery.js",
+ "name": "jquery",
+ "depends": [],
+ "label": "",
+ "group": "",
+ "description": ""
+ },
+ "jquery.mobile.grid": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "jquery.mobile.grid.js",
+ "name": "jquery.mobile.grid",
+ "depends": [
+ "jquery"
+ ],
+ "label": "Grid Layouts (Columns)",
+ "group": "Widgets",
+ "description": "Applies classes for creating grid or column styling."
+ },
+ "transitions/pop": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "transitions/pop.js",
+ "name": "transitions/pop",
+ "depends": [
+ "transitions/jquery",
+ "jquery.mobile.transition"
+ ],
+ "label": "Pop Transition",
+ "group": "Transitions",
+ "description": "Animation styles and fallback transitions definition for non-3D supporting browsers"
+ },
+ "transitions/flip": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "transitions/flip.js",
+ "name": "transitions/flip",
+ "depends": [
+ "transitions/jquery",
+ "jquery.mobile.transition"
+ ],
+ "label": "Flip Transition",
+ "group": "Transitions",
+ "description": "Animation styles and fallback transitions definition for non-3D supporting browsers"
+ },
+ "transitions/flow": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "transitions/flow.js",
+ "name": "transitions/flow",
+ "depends": [
+ "transitions/jquery",
+ "jquery.mobile.transition"
+ ],
+ "label": "Flow Transition",
+ "group": "Transitions",
+ "description": "Animation styles and fallback transitions definition for non-3D supporting browsers"
+ },
+ "transitions/slidedown": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "transitions/slidedown.js",
+ "name": "transitions/slidedown",
+ "depends": [
+ "transitions/jquery",
+ "jquery.mobile.transition"
+ ],
+ "label": "Slidedown Transition",
+ "group": "Transitions",
+ "description": "Animation styles and fallback transitions definition for non-3D supporting browsers"
+ },
+ "transitions/turn": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "transitions/turn.js",
+ "name": "transitions/turn",
+ "depends": [
+ "transitions/jquery",
+ "jquery.mobile.transition"
+ ],
+ "label": "Turn Transition",
+ "group": "Transitions",
+ "description": "Animation styles and fallback transitions definition for non-3D supporting browsers"
+ },
+ "transitions/slideup": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "transitions/slideup.js",
+ "name": "transitions/slideup",
+ "depends": [
+ "transitions/jquery",
+ "jquery.mobile.transition"
+ ],
+ "label": "Slideup Transition",
+ "group": "Transitions",
+ "description": "Animation styles and fallback transitions definition for non-3D supporting browsers"
+ },
+ "transitions/slidefade": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "transitions/slidefade.js",
+ "name": "transitions/slidefade",
+ "depends": [
+ "transitions/jquery",
+ "jquery.mobile.transition"
+ ],
+ "label": "Slidefade Transition",
+ "group": "Transitions",
+ "description": "Animation styles and fallback transitions definition for non-3D supporting browsers"
+ },
+ "transitions/slide": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "transitions/slide.js",
+ "name": "transitions/slide",
+ "depends": [
+ "transitions/jquery",
+ "jquery.mobile.transition"
+ ],
+ "label": "Slide Transition",
+ "group": "Transitions",
+ "description": "Animation styles and fallback transitions definition for non-3D supporting browsers"
+ },
+ "jquery.mobile.degradeInputs": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "jquery.mobile.degradeInputs.js",
+ "name": "jquery.mobile.degradeInputs",
+ "depends": [
+ "jquery",
+ "widgets/page"
+ ],
+ "label": "Degrade Inputs",
+ "group": "Utilities",
+ "description": "Changes input type to another after custom enhancements are made (ex. range > numberic)."
+ },
+ "jquery.mobile.media": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "jquery.mobile.media.js",
+ "name": "jquery.mobile.media",
+ "depends": [
+ "jquery",
+ "jquery.mobile.core"
+ ],
+ "label": "Match Media Polyfill",
+ "group": "Utilities",
+ "description": "A workaround for browsers without window.matchMedia"
+ },
+ "jquery.mobile.transitions": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "jquery.mobile.transitions.js",
+ "name": "jquery.mobile.transitions",
+ "depends": [
+ "transitions/flip",
+ "transitions/flow",
+ "transitions/pop",
+ "transitions/slide",
+ "transitions/slidedown",
+ "transitions/slidefade",
+ "transitions/slideup",
+ "transitions/turn"
+ ],
+ "label": "All Transitions",
+ "group": "Transitions",
+ "description": "All the stock transitions"
+ },
+ "jquery.mobile.vmouse": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "jquery.mobile.vmouse.js",
+ "name": "jquery.mobile.vmouse",
+ "depends": [
+ "jquery"
+ ],
+ "label": "Virtual Mouse (vmouse) Bindings",
+ "group": "Core",
+ "description": "Normalizes touch/mouse events."
+ },
+ "jquery.mobile.core": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "jquery.mobile.core.js",
+ "name": "jquery.mobile.core",
+ "depends": [
+ "jquery",
+ "text!../version.txt"
+ ],
+ "label": "Core",
+ "group": "Core",
+ "description": "Base file for jQuery Mobile"
+ },
+ "jquery.mobile.events": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "jquery.mobile.events.js",
+ "name": "jquery.mobile.events",
+ "depends": [
+ "jquery",
+ "events/touch",
+ "events/orientationchange"
+ ],
+ "label": "Events",
+ "group": "Events",
+ "description": "Custom events and shortcuts."
+ },
+ "jquery.mobile.transition": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "jquery.mobile.transition.js",
+ "name": "jquery.mobile.transition",
+ "depends": [
+ "jquery",
+ "jquery.mobile.core"
+ ],
+ "label": "Transition Core",
+ "group": "Transitions",
+ "description": "Animated page change core logic and sequence handlers"
+ },
+ "jquery.ui.widget": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "jquery.ui.widget.js",
+ "name": "jquery.ui.widget",
+ "depends": [],
+ "label": "",
+ "group": "",
+ "description": ""
+ },
+ "events/jquery": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "events/jquery",
+ "name": "events/jquery",
+ "depends": [],
+ "label": "",
+ "group": "",
+ "description": ""
+ },
+ "depend!../docs/_assets/js/jqm-docs[jquery]": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "depend!../docs/_assets/js/jqm-docs[jquery]",
+ "name": "depend!../docs/_assets/js/jqm-docs[jquery]",
+ "depends": [],
+ "label": "",
+ "group": "",
+ "description": ""
+ },
+ "depend!./jquery.hashchange[jquery]": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "depend!./jquery.hashchange[jquery]",
+ "name": "depend!./jquery.hashchange[jquery]",
+ "depends": [],
+ "label": "",
+ "group": "",
+ "description": ""
+ },
+ "widgets/jquery": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "widgets/jquery",
+ "name": "widgets/jquery",
+ "depends": [],
+ "label": "",
+ "group": "",
+ "description": ""
+ },
+ "widgets/depend!../jquery.hashchange[jquery]": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "widgets/depend!../jquery.hashchange[jquery]",
+ "name": "widgets/depend!../jquery.hashchange[jquery]",
+ "depends": [],
+ "label": "",
+ "group": "",
+ "description": ""
+ },
+ "widgets/forms/jquery": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "widgets/forms/jquery",
+ "name": "widgets/forms/jquery",
+ "depends": [],
+ "label": "",
+ "group": "",
+ "description": ""
+ },
+ "require": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "require",
+ "name": "require",
+ "depends": [],
+ "label": "",
+ "group": "",
+ "description": ""
+ },
+ "depend!./jquery.ui.widget[jquery]": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "depend!./jquery.ui.widget[jquery]",
+ "name": "depend!./jquery.ui.widget[jquery]",
+ "depends": [],
+ "label": "",
+ "group": "",
+ "description": ""
+ },
+ "transitions/jquery": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "transitions/jquery",
+ "name": "transitions/jquery",
+ "depends": [],
+ "label": "",
+ "group": "",
+ "description": ""
+ },
+ "text!../version.txt": {
+ "basedir": "/home/blueisle/playground/web/tizen/web-ui-fw.release/build/tizen-web-ui-fw/0.2/js/src",
+ "path": "text!../version.txt",
+ "name": "text!../version.txt",
+ "depends": [],
+ "label": "",
+ "group": "",
+ "description": ""
+ }
+}
jQuery.event.fixHooks[ name ] = jQuery.event.mouseHooks;
}
});
-/*!
- * Sizzle CSS Selector Engine
- * Copyright 2012 jQuery Foundation and other contributors
- * Released under the MIT license
- * http://sizzlejs.com/
- */
-(function( window, undefined ) {
-
-var cachedruns,
- assertGetIdNotName,
- Expr,
- getText,
- isXML,
- contains,
- compile,
- sortOrder,
- hasDuplicate,
- outermostContext,
-
- baseHasDuplicate = true,
- strundefined = "undefined",
-
- expando = ( "sizcache" + Math.random() ).replace( ".", "" ),
-
- Token = String,
- document = window.document,
- docElem = document.documentElement,
- dirruns = 0,
- done = 0,
- pop = [].pop,
- push = [].push,
- slice = [].slice,
- // Use a stripped-down indexOf if a native one is unavailable
- indexOf = [].indexOf || function( elem ) {
- var i = 0,
- len = this.length;
- for ( ; i < len; i++ ) {
- if ( this[i] === elem ) {
- return i;
- }
- }
- return -1;
- },
-
- // Augment a function for special use by Sizzle
- markFunction = function( fn, value ) {
- fn[ expando ] = value == null || value;
- return fn;
- },
-
- createCache = function() {
- var cache = {},
- keys = [];
-
- return markFunction(function( key, value ) {
- // Only keep the most recent entries
- if ( keys.push( key ) > Expr.cacheLength ) {
- delete cache[ keys.shift() ];
- }
-
- return (cache[ key ] = value);
- }, cache );
- },
-
- classCache = createCache(),
- tokenCache = createCache(),
- compilerCache = createCache(),
-
- // Regex
-
- // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace
- whitespace = "[\\x20\\t\\r\\n\\f]",
- // http://www.w3.org/TR/css3-syntax/#characters
- characterEncoding = "(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",
-
- // Loosely modeled on CSS identifier characters
- // An unquoted value should be a CSS identifier (http://www.w3.org/TR/css3-selectors/#attribute-selectors)
- // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
- identifier = characterEncoding.replace( "w", "w#" ),
-
- // Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors
- operators = "([*^$|!~]?=)",
- attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace +
- "*(?:" + operators + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]",
-
- // Prefer arguments not in parens/brackets,
- // then attribute selectors and non-pseudos (denoted by :),
- // then anything else
- // These preferences are here to reduce the number of selectors
- // needing tokenize in the PSEUDO preFilter
- pseudos = ":(" + characterEncoding + ")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:" + attributes + ")|[^:]|\\\\.)*|.*))\\)|)",
-
- // For matchExpr.POS and matchExpr.needsContext
- pos = ":(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace +
- "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)",
-
- // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
- rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
-
- rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
- rcombinators = new RegExp( "^" + whitespace + "*([\\x20\\t\\r\\n\\f>+~])" + whitespace + "*" ),
- rpseudo = new RegExp( pseudos ),
-
- // Easily-parseable/retrievable ID or TAG or CLASS selectors
- rquickExpr = /^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,
-
- rnot = /^:not/,
- rsibling = /[\x20\t\r\n\f]*[+~]/,
- rendsWithNot = /:not\($/,
-
- rheader = /h\d/i,
- rinputs = /input|select|textarea|button/i,
-
- rbackslash = /\\(?!\\)/g,
-
- matchExpr = {
- "ID": new RegExp( "^#(" + characterEncoding + ")" ),
- "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ),
- "NAME": new RegExp( "^\\[name=['\"]?(" + characterEncoding + ")['\"]?\\]" ),
- "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ),
- "ATTR": new RegExp( "^" + attributes ),
- "PSEUDO": new RegExp( "^" + pseudos ),
- "POS": new RegExp( pos, "i" ),
- "CHILD": new RegExp( "^:(only|nth|first|last)-child(?:\\(" + whitespace +
- "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
- "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
- // For use in libraries implementing .is()
- "needsContext": new RegExp( "^" + whitespace + "*[>+~]|" + pos, "i" )
- },
-
- // Support
-
- // Used for testing something on an element
- assert = function( fn ) {
- var div = document.createElement("div");
-
- try {
- return fn( div );
- } catch (e) {
- return false;
- } finally {
- // release memory in IE
- div = null;
- }
- },
-
- // Check if getElementsByTagName("*") returns only elements
- assertTagNameNoComments = assert(function( div ) {
- div.appendChild( document.createComment("") );
- return !div.getElementsByTagName("*").length;
- }),
-
- // Check if getAttribute returns normalized href attributes
- assertHrefNotNormalized = assert(function( div ) {
- div.innerHTML = "<a href='#'></a>";
- return div.firstChild && typeof div.firstChild.getAttribute !== strundefined &&
- div.firstChild.getAttribute("href") === "#";
- }),
-
- // Check if attributes should be retrieved by attribute nodes
- assertAttributes = assert(function( div ) {
- div.innerHTML = "<select></select>";
- var type = typeof div.lastChild.getAttribute("multiple");
- // IE8 returns a string for some attributes even when not present
- return type !== "boolean" && type !== "string";
- }),
-
- // Check if getElementsByClassName can be trusted
- assertUsableClassName = assert(function( div ) {
- // Opera can't find a second classname (in 9.6)
- div.innerHTML = "<div class='hidden e'></div><div class='hidden'></div>";
- if ( !div.getElementsByClassName || !div.getElementsByClassName("e").length ) {
- return false;
- }
-
- // Safari 3.2 caches class attributes and doesn't catch changes
- div.lastChild.className = "e";
- return div.getElementsByClassName("e").length === 2;
- }),
-
- // Check if getElementById returns elements by name
- // Check if getElementsByName privileges form controls or returns elements by ID
- assertUsableName = assert(function( div ) {
- // Inject content
- div.id = expando + 0;
- div.innerHTML = "<a name='" + expando + "'></a><div name='" + expando + "'></div>";
- docElem.insertBefore( div, docElem.firstChild );
-
- // Test
- var pass = document.getElementsByName &&
- // buggy browsers will return fewer than the correct 2
- document.getElementsByName( expando ).length === 2 +
- // buggy browsers will return more than the correct 0
- document.getElementsByName( expando + 0 ).length;
- assertGetIdNotName = !document.getElementById( expando );
-
- // Cleanup
- docElem.removeChild( div );
-
- return pass;
- });
-
-// If slice is not available, provide a backup
-try {
- slice.call( docElem.childNodes, 0 )[0].nodeType;
-} catch ( e ) {
- slice = function( i ) {
- var elem,
- results = [];
- for ( ; (elem = this[i]); i++ ) {
- results.push( elem );
- }
- return results;
- };
-}
-
-function Sizzle( selector, context, results, seed ) {
- results = results || [];
- context = context || document;
- var match, elem, xml, m,
- nodeType = context.nodeType;
-
- if ( !selector || typeof selector !== "string" ) {
- return results;
- }
-
- if ( nodeType !== 1 && nodeType !== 9 ) {
- return [];
- }
-
- xml = isXML( context );
-
- if ( !xml && !seed ) {
- if ( (match = rquickExpr.exec( selector )) ) {
- // Speed-up: Sizzle("#ID")
- if ( (m = match[1]) ) {
- if ( nodeType === 9 ) {
- elem = context.getElementById( m );
- // Check parentNode to catch when Blackberry 4.6 returns
- // nodes that are no longer in the document #6963
- if ( elem && elem.parentNode ) {
- // Handle the case where IE, Opera, and Webkit return items
- // by name instead of ID
- if ( elem.id === m ) {
- results.push( elem );
- return results;
- }
- } else {
- return results;
- }
- } else {
- // Context is not a document
- if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) &&
- contains( context, elem ) && elem.id === m ) {
- results.push( elem );
- return results;
- }
- }
-
- // Speed-up: Sizzle("TAG")
- } else if ( match[2] ) {
- push.apply( results, slice.call(context.getElementsByTagName( selector ), 0) );
- return results;
-
- // Speed-up: Sizzle(".CLASS")
- } else if ( (m = match[3]) && assertUsableClassName && context.getElementsByClassName ) {
- push.apply( results, slice.call(context.getElementsByClassName( m ), 0) );
- return results;
- }
- }
- }
-
- // All others
- return select( selector.replace( rtrim, "$1" ), context, results, seed, xml );
-}
-
-Sizzle.matches = function( expr, elements ) {
- return Sizzle( expr, null, null, elements );
-};
-
-Sizzle.matchesSelector = function( elem, expr ) {
- return Sizzle( expr, null, null, [ elem ] ).length > 0;
-};
-
-// Returns a function to use in pseudos for input types
-function createInputPseudo( type ) {
- return function( elem ) {
- var name = elem.nodeName.toLowerCase();
- return name === "input" && elem.type === type;
- };
-}
-
-// Returns a function to use in pseudos for buttons
-function createButtonPseudo( type ) {
- return function( elem ) {
- var name = elem.nodeName.toLowerCase();
- return (name === "input" || name === "button") && elem.type === type;
- };
-}
-
-// Returns a function to use in pseudos for positionals
-function createPositionalPseudo( fn ) {
- return markFunction(function( argument ) {
- argument = +argument;
- return markFunction(function( seed, matches ) {
- var j,
- matchIndexes = fn( [], seed.length, argument ),
- i = matchIndexes.length;
-
- // Match elements found at the specified indexes
- while ( i-- ) {
- if ( seed[ (j = matchIndexes[i]) ] ) {
- seed[j] = !(matches[j] = seed[j]);
- }
- }
- });
- });
-}
-
-/**
- * Utility function for retrieving the text value of an array of DOM nodes
- * @param {Array|Element} elem
- */
-getText = Sizzle.getText = function( elem ) {
- var node,
- ret = "",
- i = 0,
- nodeType = elem.nodeType;
-
- if ( nodeType ) {
- if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
- // Use textContent for elements
- // innerText usage removed for consistency of new lines (see #11153)
- if ( typeof elem.textContent === "string" ) {
- return elem.textContent;
- } else {
- // Traverse its children
- for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
- ret += getText( elem );
- }
- }
- } else if ( nodeType === 3 || nodeType === 4 ) {
- return elem.nodeValue;
- }
- // Do not include comment or processing instruction nodes
- } else {
-
- // If no nodeType, this is expected to be an array
- for ( ; (node = elem[i]); i++ ) {
- // Do not traverse comment nodes
- ret += getText( node );
- }
- }
- return ret;
-};
-
-isXML = Sizzle.isXML = function( elem ) {
- // documentElement is verified for cases where it doesn't yet exist
- // (such as loading iframes in IE - #4833)
- var documentElement = elem && (elem.ownerDocument || elem).documentElement;
- return documentElement ? documentElement.nodeName !== "HTML" : false;
-};
-
-// Element contains another
-contains = Sizzle.contains = docElem.contains ?
- function( a, b ) {
- var adown = a.nodeType === 9 ? a.documentElement : a,
- bup = b && b.parentNode;
- return a === bup || !!( bup && bup.nodeType === 1 && adown.contains && adown.contains(bup) );
- } :
- docElem.compareDocumentPosition ?
- function( a, b ) {
- return b && !!( a.compareDocumentPosition( b ) & 16 );
- } :
- function( a, b ) {
- while ( (b = b.parentNode) ) {
- if ( b === a ) {
- return true;
- }
- }
- return false;
- };
-
-Sizzle.attr = function( elem, name ) {
- var val,
- xml = isXML( elem );
-
- if ( !xml ) {
- name = name.toLowerCase();
- }
- if ( (val = Expr.attrHandle[ name ]) ) {
- return val( elem );
- }
- if ( xml || assertAttributes ) {
- return elem.getAttribute( name );
- }
- val = elem.getAttributeNode( name );
- return val ?
- typeof elem[ name ] === "boolean" ?
- elem[ name ] ? name : null :
- val.specified ? val.value : null :
- null;
-};
-
-Expr = Sizzle.selectors = {
-
- // Can be adjusted by the user
- cacheLength: 50,
-
- createPseudo: markFunction,
-
- match: matchExpr,
-
- // IE6/7 return a modified href
- attrHandle: assertHrefNotNormalized ?
- {} :
- {
- "href": function( elem ) {
- return elem.getAttribute( "href", 2 );
- },
- "type": function( elem ) {
- return elem.getAttribute("type");
- }
- },
-
- find: {
- "ID": assertGetIdNotName ?
- function( id, context, xml ) {
- if ( typeof context.getElementById !== strundefined && !xml ) {
- var m = context.getElementById( id );
- // Check parentNode to catch when Blackberry 4.6 returns
- // nodes that are no longer in the document #6963
- return m && m.parentNode ? [m] : [];
- }
- } :
- function( id, context, xml ) {
- if ( typeof context.getElementById !== strundefined && !xml ) {
- var m = context.getElementById( id );
-
- return m ?
- m.id === id || typeof m.getAttributeNode !== strundefined && m.getAttributeNode("id").value === id ?
- [m] :
- undefined :
- [];
- }
- },
-
- "TAG": assertTagNameNoComments ?
- function( tag, context ) {
- if ( typeof context.getElementsByTagName !== strundefined ) {
- return context.getElementsByTagName( tag );
- }
- } :
- function( tag, context ) {
- var results = context.getElementsByTagName( tag );
-
- // Filter out possible comments
- if ( tag === "*" ) {
- var elem,
- tmp = [],
- i = 0;
-
- for ( ; (elem = results[i]); i++ ) {
- if ( elem.nodeType === 1 ) {
- tmp.push( elem );
- }
- }
-
- return tmp;
- }
- return results;
- },
-
- "NAME": assertUsableName && function( tag, context ) {
- if ( typeof context.getElementsByName !== strundefined ) {
- return context.getElementsByName( name );
- }
- },
-
- "CLASS": assertUsableClassName && function( className, context, xml ) {
- if ( typeof context.getElementsByClassName !== strundefined && !xml ) {
- return context.getElementsByClassName( className );
- }
- }
- },
-
- relative: {
- ">": { dir: "parentNode", first: true },
- " ": { dir: "parentNode" },
- "+": { dir: "previousSibling", first: true },
- "~": { dir: "previousSibling" }
- },
-
- preFilter: {
- "ATTR": function( match ) {
- match[1] = match[1].replace( rbackslash, "" );
-
- // Move the given value to match[3] whether quoted or unquoted
- match[3] = ( match[4] || match[5] || "" ).replace( rbackslash, "" );
-
- if ( match[2] === "~=" ) {
- match[3] = " " + match[3] + " ";
- }
-
- return match.slice( 0, 4 );
- },
-
- "CHILD": function( match ) {
- /* matches from matchExpr["CHILD"]
- 1 type (only|nth|...)
- 2 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
- 3 xn-component of xn+y argument ([+-]?\d*n|)
- 4 sign of xn-component
- 5 x of xn-component
- 6 sign of y-component
- 7 y of y-component
- */
- match[1] = match[1].toLowerCase();
-
- if ( match[1] === "nth" ) {
- // nth-child requires argument
- if ( !match[2] ) {
- Sizzle.error( match[0] );
- }
-
- // numeric x and y parameters for Expr.filter.CHILD
- // remember that false/true cast respectively to 0/1
- match[3] = +( match[3] ? match[4] + (match[5] || 1) : 2 * ( match[2] === "even" || match[2] === "odd" ) );
- match[4] = +( ( match[6] + match[7] ) || match[2] === "odd" );
-
- // other types prohibit arguments
- } else if ( match[2] ) {
- Sizzle.error( match[0] );
- }
-
- return match;
- },
-
- "PSEUDO": function( match ) {
- var unquoted, excess;
- if ( matchExpr["CHILD"].test( match[0] ) ) {
- return null;
- }
-
- if ( match[3] ) {
- match[2] = match[3];
- } else if ( (unquoted = match[4]) ) {
- // Only check arguments that contain a pseudo
- if ( rpseudo.test(unquoted) &&
- // Get excess from tokenize (recursively)
- (excess = tokenize( unquoted, true )) &&
- // advance to the next closing parenthesis
- (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
-
- // excess is a negative index
- unquoted = unquoted.slice( 0, excess );
- match[0] = match[0].slice( 0, excess );
- }
- match[2] = unquoted;
- }
-
- // Return only captures needed by the pseudo filter method (type and argument)
- return match.slice( 0, 3 );
- }
- },
-
- filter: {
- "ID": assertGetIdNotName ?
- function( id ) {
- id = id.replace( rbackslash, "" );
- return function( elem ) {
- return elem.getAttribute("id") === id;
- };
- } :
- function( id ) {
- id = id.replace( rbackslash, "" );
- return function( elem ) {
- var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id");
- return node && node.value === id;
- };
- },
-
- "TAG": function( nodeName ) {
- if ( nodeName === "*" ) {
- return function() { return true; };
- }
- nodeName = nodeName.replace( rbackslash, "" ).toLowerCase();
-
- return function( elem ) {
- return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
- };
- },
-
- "CLASS": function( className ) {
- var pattern = classCache[ expando ][ className ];
- if ( !pattern ) {
- pattern = classCache( className, new RegExp("(^|" + whitespace + ")" + className + "(" + whitespace + "|$)") );
- }
- return function( elem ) {
- return pattern.test( elem.className || (typeof elem.getAttribute !== strundefined && elem.getAttribute("class")) || "" );
- };
- },
-
- "ATTR": function( name, operator, check ) {
- return function( elem, context ) {
- var result = Sizzle.attr( elem, name );
-
- if ( result == null ) {
- return operator === "!=";
- }
- if ( !operator ) {
- return true;
- }
-
- result += "";
-
- return operator === "=" ? result === check :
- operator === "!=" ? result !== check :
- operator === "^=" ? check && result.indexOf( check ) === 0 :
- operator === "*=" ? check && result.indexOf( check ) > -1 :
- operator === "$=" ? check && result.substr( result.length - check.length ) === check :
- operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 :
- operator === "|=" ? result === check || result.substr( 0, check.length + 1 ) === check + "-" :
- false;
- };
- },
-
- "CHILD": function( type, argument, first, last ) {
-
- if ( type === "nth" ) {
- return function( elem ) {
- var node, diff,
- parent = elem.parentNode;
-
- if ( first === 1 && last === 0 ) {
- return true;
- }
-
- if ( parent ) {
- diff = 0;
- for ( node = parent.firstChild; node; node = node.nextSibling ) {
- if ( node.nodeType === 1 ) {
- diff++;
- if ( elem === node ) {
- break;
- }
- }
- }
- }
-
- // Incorporate the offset (or cast to NaN), then check against cycle size
- diff -= last;
- return diff === first || ( diff % first === 0 && diff / first >= 0 );
- };
- }
-
- return function( elem ) {
- var node = elem;
-
- switch ( type ) {
- case "only":
- case "first":
- while ( (node = node.previousSibling) ) {
- if ( node.nodeType === 1 ) {
- return false;
- }
- }
-
- if ( type === "first" ) {
- return true;
- }
-
- node = elem;
-
- /* falls through */
- case "last":
- while ( (node = node.nextSibling) ) {
- if ( node.nodeType === 1 ) {
- return false;
- }
- }
-
- return true;
- }
- };
- },
-
- "PSEUDO": function( pseudo, argument ) {
- // pseudo-class names are case-insensitive
- // http://www.w3.org/TR/selectors/#pseudo-classes
- // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
- // Remember that setFilters inherits from pseudos
- var args,
- fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
- Sizzle.error( "unsupported pseudo: " + pseudo );
-
- // The user may use createPseudo to indicate that
- // arguments are needed to create the filter function
- // just as Sizzle does
- if ( fn[ expando ] ) {
- return fn( argument );
- }
-
- // But maintain support for old signatures
- if ( fn.length > 1 ) {
- args = [ pseudo, pseudo, "", argument ];
- return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
- markFunction(function( seed, matches ) {
- var idx,
- matched = fn( seed, argument ),
- i = matched.length;
- while ( i-- ) {
- idx = indexOf.call( seed, matched[i] );
- seed[ idx ] = !( matches[ idx ] = matched[i] );
- }
- }) :
- function( elem ) {
- return fn( elem, 0, args );
- };
- }
-
- return fn;
- }
- },
-
- pseudos: {
- "not": markFunction(function( selector ) {
- // Trim the selector passed to compile
- // to avoid treating leading and trailing
- // spaces as combinators
- var input = [],
- results = [],
- matcher = compile( selector.replace( rtrim, "$1" ) );
-
- return matcher[ expando ] ?
- markFunction(function( seed, matches, context, xml ) {
- var elem,
- unmatched = matcher( seed, null, xml, [] ),
- i = seed.length;
-
- // Match elements unmatched by `matcher`
- while ( i-- ) {
- if ( (elem = unmatched[i]) ) {
- seed[i] = !(matches[i] = elem);
- }
- }
- }) :
- function( elem, context, xml ) {
- input[0] = elem;
- matcher( input, null, xml, results );
- return !results.pop();
- };
- }),
-
- "has": markFunction(function( selector ) {
- return function( elem ) {
- return Sizzle( selector, elem ).length > 0;
- };
- }),
-
- "contains": markFunction(function( text ) {
- return function( elem ) {
- return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
- };
- }),
-
- "enabled": function( elem ) {
- return elem.disabled === false;
- },
-
- "disabled": function( elem ) {
- return elem.disabled === true;
- },
-
- "checked": function( elem ) {
- // In CSS3, :checked should return both checked and selected elements
- // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
- var nodeName = elem.nodeName.toLowerCase();
- return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
- },
-
- "selected": function( elem ) {
- // Accessing this property makes selected-by-default
- // options in Safari work properly
- if ( elem.parentNode ) {
- elem.parentNode.selectedIndex;
- }
-
- return elem.selected === true;
- },
-
- "parent": function( elem ) {
- return !Expr.pseudos["empty"]( elem );
- },
-
- "empty": function( elem ) {
- // http://www.w3.org/TR/selectors/#empty-pseudo
- // :empty is only affected by element nodes and content nodes(including text(3), cdata(4)),
- // not comment, processing instructions, or others
- // Thanks to Diego Perini for the nodeName shortcut
- // Greater than "@" means alpha characters (specifically not starting with "#" or "?")
- var nodeType;
- elem = elem.firstChild;
- while ( elem ) {
- if ( elem.nodeName > "@" || (nodeType = elem.nodeType) === 3 || nodeType === 4 ) {
- return false;
- }
- elem = elem.nextSibling;
- }
- return true;
- },
-
- "header": function( elem ) {
- return rheader.test( elem.nodeName );
- },
-
- "text": function( elem ) {
- var type, attr;
- // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc)
- // use getAttribute instead to test this case
- return elem.nodeName.toLowerCase() === "input" &&
- (type = elem.type) === "text" &&
- ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === type );
- },
-
- // Input types
- "radio": createInputPseudo("radio"),
- "checkbox": createInputPseudo("checkbox"),
- "file": createInputPseudo("file"),
- "password": createInputPseudo("password"),
- "image": createInputPseudo("image"),
-
- "submit": createButtonPseudo("submit"),
- "reset": createButtonPseudo("reset"),
-
- "button": function( elem ) {
- var name = elem.nodeName.toLowerCase();
- return name === "input" && elem.type === "button" || name === "button";
- },
-
- "input": function( elem ) {
- return rinputs.test( elem.nodeName );
- },
-
- "focus": function( elem ) {
- var doc = elem.ownerDocument;
- return elem === doc.activeElement && (!doc.hasFocus || doc.hasFocus()) && !!(elem.type || elem.href);
- },
-
- "active": function( elem ) {
- return elem === elem.ownerDocument.activeElement;
- },
-
- // Positional types
- "first": createPositionalPseudo(function( matchIndexes, length, argument ) {
- return [ 0 ];
- }),
-
- "last": createPositionalPseudo(function( matchIndexes, length, argument ) {
- return [ length - 1 ];
- }),
-
- "eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
- return [ argument < 0 ? argument + length : argument ];
- }),
-
- "even": createPositionalPseudo(function( matchIndexes, length, argument ) {
- for ( var i = 0; i < length; i += 2 ) {
- matchIndexes.push( i );
- }
- return matchIndexes;
- }),
-
- "odd": createPositionalPseudo(function( matchIndexes, length, argument ) {
- for ( var i = 1; i < length; i += 2 ) {
- matchIndexes.push( i );
- }
- return matchIndexes;
- }),
-
- "lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
- for ( var i = argument < 0 ? argument + length : argument; --i >= 0; ) {
- matchIndexes.push( i );
- }
- return matchIndexes;
- }),
-
- "gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
- for ( var i = argument < 0 ? argument + length : argument; ++i < length; ) {
- matchIndexes.push( i );
- }
- return matchIndexes;
- })
- }
-};
-
-function siblingCheck( a, b, ret ) {
- if ( a === b ) {
- return ret;
- }
-
- var cur = a.nextSibling;
-
- while ( cur ) {
- if ( cur === b ) {
- return -1;
- }
-
- cur = cur.nextSibling;
- }
-
- return 1;
-}
-
-sortOrder = docElem.compareDocumentPosition ?
- function( a, b ) {
- if ( a === b ) {
- hasDuplicate = true;
- return 0;
- }
-
- return ( !a.compareDocumentPosition || !b.compareDocumentPosition ?
- a.compareDocumentPosition :
- a.compareDocumentPosition(b) & 4
- ) ? -1 : 1;
- } :
- function( a, b ) {
- // The nodes are identical, we can exit early
- if ( a === b ) {
- hasDuplicate = true;
- return 0;
-
- // Fallback to using sourceIndex (in IE) if it's available on both nodes
- } else if ( a.sourceIndex && b.sourceIndex ) {
- return a.sourceIndex - b.sourceIndex;
- }
-
- var al, bl,
- ap = [],
- bp = [],
- aup = a.parentNode,
- bup = b.parentNode,
- cur = aup;
-
- // If the nodes are siblings (or identical) we can do a quick check
- if ( aup === bup ) {
- return siblingCheck( a, b );
-
- // If no parents were found then the nodes are disconnected
- } else if ( !aup ) {
- return -1;
-
- } else if ( !bup ) {
- return 1;
- }
-
- // Otherwise they're somewhere else in the tree so we need
- // to build up a full list of the parentNodes for comparison
- while ( cur ) {
- ap.unshift( cur );
- cur = cur.parentNode;
- }
-
- cur = bup;
-
- while ( cur ) {
- bp.unshift( cur );
- cur = cur.parentNode;
- }
-
- al = ap.length;
- bl = bp.length;
-
- // Start walking down the tree looking for a discrepancy
- for ( var i = 0; i < al && i < bl; i++ ) {
- if ( ap[i] !== bp[i] ) {
- return siblingCheck( ap[i], bp[i] );
- }
- }
-
- // We ended someplace up the tree so do a sibling check
- return i === al ?
- siblingCheck( a, bp[i], -1 ) :
- siblingCheck( ap[i], b, 1 );
- };
-
-// Always assume the presence of duplicates if sort doesn't
-// pass them to our comparison function (as in Google Chrome).
-[0, 0].sort( sortOrder );
-baseHasDuplicate = !hasDuplicate;
-
-// Document sorting and removing duplicates
-Sizzle.uniqueSort = function( results ) {
- var elem,
- i = 1;
-
- hasDuplicate = baseHasDuplicate;
- results.sort( sortOrder );
-
- if ( hasDuplicate ) {
- for ( ; (elem = results[i]); i++ ) {
- if ( elem === results[ i - 1 ] ) {
- results.splice( i--, 1 );
- }
- }
- }
-
- return results;
-};
-
-Sizzle.error = function( msg ) {
- throw new Error( "Syntax error, unrecognized expression: " + msg );
-};
-
-function tokenize( selector, parseOnly ) {
- var matched, match, tokens, type, soFar, groups, preFilters,
- cached = tokenCache[ expando ][ selector ];
-
- if ( cached ) {
- return parseOnly ? 0 : cached.slice( 0 );
- }
-
- soFar = selector;
- groups = [];
- preFilters = Expr.preFilter;
-
- while ( soFar ) {
-
- // Comma and first run
- if ( !matched || (match = rcomma.exec( soFar )) ) {
- if ( match ) {
- soFar = soFar.slice( match[0].length );
- }
- groups.push( tokens = [] );
- }
-
- matched = false;
-
- // Combinators
- if ( (match = rcombinators.exec( soFar )) ) {
- tokens.push( matched = new Token( match.shift() ) );
- soFar = soFar.slice( matched.length );
-
- // Cast descendant combinators to space
- matched.type = match[0].replace( rtrim, " " );
- }
-
- // Filters
- for ( type in Expr.filter ) {
- if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
- // The last two arguments here are (context, xml) for backCompat
- (match = preFilters[ type ]( match, document, true ))) ) {
-
- tokens.push( matched = new Token( match.shift() ) );
- soFar = soFar.slice( matched.length );
- matched.type = type;
- matched.matches = match;
- }
- }
-
- if ( !matched ) {
- break;
- }
- }
-
- // Return the length of the invalid excess
- // if we're just parsing
- // Otherwise, throw an error or return tokens
- return parseOnly ?
- soFar.length :
- soFar ?
- Sizzle.error( selector ) :
- // Cache the tokens
- tokenCache( selector, groups ).slice( 0 );
-}
-
-function addCombinator( matcher, combinator, base ) {
- var dir = combinator.dir,
- checkNonElements = base && combinator.dir === "parentNode",
- doneName = done++;
-
- return combinator.first ?
- // Check against closest ancestor/preceding element
- function( elem, context, xml ) {
- while ( (elem = elem[ dir ]) ) {
- if ( checkNonElements || elem.nodeType === 1 ) {
- return matcher( elem, context, xml );
- }
- }
- } :
-
- // Check against all ancestor/preceding elements
- function( elem, context, xml ) {
- // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching
- if ( !xml ) {
- var cache,
- dirkey = dirruns + " " + doneName + " ",
- cachedkey = dirkey + cachedruns;
- while ( (elem = elem[ dir ]) ) {
- if ( checkNonElements || elem.nodeType === 1 ) {
- if ( (cache = elem[ expando ]) === cachedkey ) {
- return elem.sizset;
- } else if ( typeof cache === "string" && cache.indexOf(dirkey) === 0 ) {
- if ( elem.sizset ) {
- return elem;
- }
- } else {
- elem[ expando ] = cachedkey;
- if ( matcher( elem, context, xml ) ) {
- elem.sizset = true;
- return elem;
- }
- elem.sizset = false;
- }
- }
- }
- } else {
- while ( (elem = elem[ dir ]) ) {
- if ( checkNonElements || elem.nodeType === 1 ) {
- if ( matcher( elem, context, xml ) ) {
- return elem;
- }
- }
- }
- }
- };
-}
-
-function elementMatcher( matchers ) {
- return matchers.length > 1 ?
- function( elem, context, xml ) {
- var i = matchers.length;
- while ( i-- ) {
- if ( !matchers[i]( elem, context, xml ) ) {
- return false;
- }
- }
- return true;
- } :
- matchers[0];
-}
-
-function condense( unmatched, map, filter, context, xml ) {
- var elem,
- newUnmatched = [],
- i = 0,
- len = unmatched.length,
- mapped = map != null;
-
- for ( ; i < len; i++ ) {
- if ( (elem = unmatched[i]) ) {
- if ( !filter || filter( elem, context, xml ) ) {
- newUnmatched.push( elem );
- if ( mapped ) {
- map.push( i );
- }
- }
- }
- }
-
- return newUnmatched;
-}
-
-function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
- if ( postFilter && !postFilter[ expando ] ) {
- postFilter = setMatcher( postFilter );
- }
- if ( postFinder && !postFinder[ expando ] ) {
- postFinder = setMatcher( postFinder, postSelector );
- }
- return markFunction(function( seed, results, context, xml ) {
- // Positional selectors apply to seed elements, so it is invalid to follow them with relative ones
- if ( seed && postFinder ) {
- return;
- }
-
- var i, elem, postFilterIn,
- preMap = [],
- postMap = [],
- preexisting = results.length,
-
- // Get initial elements from seed or context
- elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [], seed ),
-
- // Prefilter to get matcher input, preserving a map for seed-results synchronization
- matcherIn = preFilter && ( seed || !selector ) ?
- condense( elems, preMap, preFilter, context, xml ) :
- elems,
-
- matcherOut = matcher ?
- // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
- postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
-
- // ...intermediate processing is necessary
- [] :
-
- // ...otherwise use results directly
- results :
- matcherIn;
-
- // Find primary matches
- if ( matcher ) {
- matcher( matcherIn, matcherOut, context, xml );
- }
-
- // Apply postFilter
- if ( postFilter ) {
- postFilterIn = condense( matcherOut, postMap );
- postFilter( postFilterIn, [], context, xml );
-
- // Un-match failing elements by moving them back to matcherIn
- i = postFilterIn.length;
- while ( i-- ) {
- if ( (elem = postFilterIn[i]) ) {
- matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
- }
- }
- }
-
- // Keep seed and results synchronized
- if ( seed ) {
- // Ignore postFinder because it can't coexist with seed
- i = preFilter && matcherOut.length;
- while ( i-- ) {
- if ( (elem = matcherOut[i]) ) {
- seed[ preMap[i] ] = !(results[ preMap[i] ] = elem);
- }
- }
- } else {
- matcherOut = condense(
- matcherOut === results ?
- matcherOut.splice( preexisting, matcherOut.length ) :
- matcherOut
- );
- if ( postFinder ) {
- postFinder( null, results, matcherOut, xml );
- } else {
- push.apply( results, matcherOut );
- }
- }
- });
-}
-
-function matcherFromTokens( tokens ) {
- var checkContext, matcher, j,
- len = tokens.length,
- leadingRelative = Expr.relative[ tokens[0].type ],
- implicitRelative = leadingRelative || Expr.relative[" "],
- i = leadingRelative ? 1 : 0,
-
- // The foundational matcher ensures that elements are reachable from top-level context(s)
- matchContext = addCombinator( function( elem ) {
- return elem === checkContext;
- }, implicitRelative, true ),
- matchAnyContext = addCombinator( function( elem ) {
- return indexOf.call( checkContext, elem ) > -1;
- }, implicitRelative, true ),
- matchers = [ function( elem, context, xml ) {
- return ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
- (checkContext = context).nodeType ?
- matchContext( elem, context, xml ) :
- matchAnyContext( elem, context, xml ) );
- } ];
-
- for ( ; i < len; i++ ) {
- if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
- matchers = [ addCombinator( elementMatcher( matchers ), matcher ) ];
- } else {
- // The concatenated values are (context, xml) for backCompat
- matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
-
- // Return special upon seeing a positional matcher
- if ( matcher[ expando ] ) {
- // Find the next relative operator (if any) for proper handling
- j = ++i;
- for ( ; j < len; j++ ) {
- if ( Expr.relative[ tokens[j].type ] ) {
- break;
- }
- }
- return setMatcher(
- i > 1 && elementMatcher( matchers ),
- i > 1 && tokens.slice( 0, i - 1 ).join("").replace( rtrim, "$1" ),
- matcher,
- i < j && matcherFromTokens( tokens.slice( i, j ) ),
- j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
- j < len && tokens.join("")
- );
- }
- matchers.push( matcher );
- }
- }
-
- return elementMatcher( matchers );
-}
-
-function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
- var bySet = setMatchers.length > 0,
- byElement = elementMatchers.length > 0,
- superMatcher = function( seed, context, xml, results, expandContext ) {
- var elem, j, matcher,
- setMatched = [],
- matchedCount = 0,
- i = "0",
- unmatched = seed && [],
- outermost = expandContext != null,
- contextBackup = outermostContext,
- // We must always have either seed elements or context
- elems = seed || byElement && Expr.find["TAG"]( "*", expandContext && context.parentNode || context ),
- // Nested matchers should use non-integer dirruns
- dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.E);
-
- if ( outermost ) {
- outermostContext = context !== document && context;
- cachedruns = superMatcher.el;
- }
-
- // Add elements passing elementMatchers directly to results
- for ( ; (elem = elems[i]) != null; i++ ) {
- if ( byElement && elem ) {
- for ( j = 0; (matcher = elementMatchers[j]); j++ ) {
- if ( matcher( elem, context, xml ) ) {
- results.push( elem );
- break;
- }
- }
- if ( outermost ) {
- dirruns = dirrunsUnique;
- cachedruns = ++superMatcher.el;
- }
- }
-
- // Track unmatched elements for set filters
- if ( bySet ) {
- // They will have gone through all possible matchers
- if ( (elem = !matcher && elem) ) {
- matchedCount--;
- }
-
- // Lengthen the array for every element, matched or not
- if ( seed ) {
- unmatched.push( elem );
- }
- }
- }
-
- // Apply set filters to unmatched elements
- matchedCount += i;
- if ( bySet && i !== matchedCount ) {
- for ( j = 0; (matcher = setMatchers[j]); j++ ) {
- matcher( unmatched, setMatched, context, xml );
- }
-
- if ( seed ) {
- // Reintegrate element matches to eliminate the need for sorting
- if ( matchedCount > 0 ) {
- while ( i-- ) {
- if ( !(unmatched[i] || setMatched[i]) ) {
- setMatched[i] = pop.call( results );
- }
- }
- }
-
- // Discard index placeholder values to get only actual matches
- setMatched = condense( setMatched );
- }
-
- // Add matches to results
- push.apply( results, setMatched );
-
- // Seedless set matches succeeding multiple successful matchers stipulate sorting
- if ( outermost && !seed && setMatched.length > 0 &&
- ( matchedCount + setMatchers.length ) > 1 ) {
-
- Sizzle.uniqueSort( results );
- }
- }
-
- // Override manipulation of globals by nested matchers
- if ( outermost ) {
- dirruns = dirrunsUnique;
- outermostContext = contextBackup;
- }
-
- return unmatched;
- };
-
- superMatcher.el = 0;
- return bySet ?
- markFunction( superMatcher ) :
- superMatcher;
-}
-
-compile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) {
- var i,
- setMatchers = [],
- elementMatchers = [],
- cached = compilerCache[ expando ][ selector ];
-
- if ( !cached ) {
- // Generate a function of recursive functions that can be used to check each element
- if ( !group ) {
- group = tokenize( selector );
- }
- i = group.length;
- while ( i-- ) {
- cached = matcherFromTokens( group[i] );
- if ( cached[ expando ] ) {
- setMatchers.push( cached );
- } else {
- elementMatchers.push( cached );
- }
- }
-
- // Cache the compiled function
- cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
- }
- return cached;
-};
-
-function multipleContexts( selector, contexts, results, seed ) {
- var i = 0,
- len = contexts.length;
- for ( ; i < len; i++ ) {
- Sizzle( selector, contexts[i], results, seed );
- }
- return results;
-}
-
-function select( selector, context, results, seed, xml ) {
- var i, tokens, token, type, find,
- match = tokenize( selector ),
- j = match.length;
-
- if ( !seed ) {
- // Try to minimize operations if there is only one group
- if ( match.length === 1 ) {
-
- // Take a shortcut and set the context if the root selector is an ID
- tokens = match[0] = match[0].slice( 0 );
- if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
- context.nodeType === 9 && !xml &&
- Expr.relative[ tokens[1].type ] ) {
-
- context = Expr.find["ID"]( token.matches[0].replace( rbackslash, "" ), context, xml )[0];
- if ( !context ) {
- return results;
- }
-
- selector = selector.slice( tokens.shift().length );
- }
-
- // Fetch a seed set for right-to-left matching
- for ( i = matchExpr["POS"].test( selector ) ? -1 : tokens.length - 1; i >= 0; i-- ) {
- token = tokens[i];
-
- // Abort if we hit a combinator
- if ( Expr.relative[ (type = token.type) ] ) {
- break;
- }
- if ( (find = Expr.find[ type ]) ) {
- // Search, expanding context for leading sibling combinators
- if ( (seed = find(
- token.matches[0].replace( rbackslash, "" ),
- rsibling.test( tokens[0].type ) && context.parentNode || context,
- xml
- )) ) {
-
- // If seed is empty or no tokens remain, we can return early
- tokens.splice( i, 1 );
- selector = seed.length && tokens.join("");
- if ( !selector ) {
- push.apply( results, slice.call( seed, 0 ) );
- return results;
- }
-
- break;
- }
- }
- }
- }
- }
-
- // Compile and execute a filtering function
- // Provide `match` to avoid retokenization if we modified the selector above
- compile( selector, match )(
- seed,
- context,
- xml,
- results,
- rsibling.test( selector )
- );
- return results;
-}
-
-if ( document.querySelectorAll ) {
- (function() {
- var disconnectedMatch,
- oldSelect = select,
- rescape = /'|\\/g,
- rattributeQuotes = /\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,
-
- // qSa(:focus) reports false when true (Chrome 21),
- // A support test would require too much code (would include document ready)
- rbuggyQSA = [":focus"],
-
- // matchesSelector(:focus) reports false when true (Chrome 21),
- // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
- // A support test would require too much code (would include document ready)
- // just skip matchesSelector for :active
- rbuggyMatches = [ ":active", ":focus" ],
- matches = docElem.matchesSelector ||
- docElem.mozMatchesSelector ||
- docElem.webkitMatchesSelector ||
- docElem.oMatchesSelector ||
- docElem.msMatchesSelector;
-
- // Build QSA regex
- // Regex strategy adopted from Diego Perini
- assert(function( div ) {
- // Select is set to empty string on purpose
- // This is to test IE's treatment of not explictly
- // setting a boolean content attribute,
- // since its presence should be enough
- // http://bugs.jquery.com/ticket/12359
- div.innerHTML = "<select><option selected=''></option></select>";
-
- // IE8 - Some boolean attributes are not treated correctly
- if ( !div.querySelectorAll("[selected]").length ) {
- rbuggyQSA.push( "\\[" + whitespace + "*(?:checked|disabled|ismap|multiple|readonly|selected|value)" );
- }
-
- // Webkit/Opera - :checked should return selected option elements
- // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
- // IE8 throws error here (do not put tests after this one)
- if ( !div.querySelectorAll(":checked").length ) {
- rbuggyQSA.push(":checked");
- }
- });
-
- assert(function( div ) {
-
- // Opera 10-12/IE9 - ^= $= *= and empty values
- // Should not select anything
- div.innerHTML = "<p test=''></p>";
- if ( div.querySelectorAll("[test^='']").length ) {
- rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:\"\"|'')" );
- }
-
- // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
- // IE8 throws error here (do not put tests after this one)
- div.innerHTML = "<input type='hidden'/>";
- if ( !div.querySelectorAll(":enabled").length ) {
- rbuggyQSA.push(":enabled", ":disabled");
- }
- });
-
- // rbuggyQSA always contains :focus, so no need for a length check
- rbuggyQSA = /* rbuggyQSA.length && */ new RegExp( rbuggyQSA.join("|") );
-
- select = function( selector, context, results, seed, xml ) {
- // Only use querySelectorAll when not filtering,
- // when this is not xml,
- // and when no QSA bugs apply
- if ( !seed && !xml && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {
- var groups, i,
- old = true,
- nid = expando,
- newContext = context,
- newSelector = context.nodeType === 9 && selector;
-
- // qSA works strangely on Element-rooted queries
- // We can work around this by specifying an extra ID on the root
- // and working up from there (Thanks to Andrew Dupont for the technique)
- // IE 8 doesn't work on object elements
- if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
- groups = tokenize( selector );
-
- if ( (old = context.getAttribute("id")) ) {
- nid = old.replace( rescape, "\\$&" );
- } else {
- context.setAttribute( "id", nid );
- }
- nid = "[id='" + nid + "'] ";
-
- i = groups.length;
- while ( i-- ) {
- groups[i] = nid + groups[i].join("");
- }
- newContext = rsibling.test( selector ) && context.parentNode || context;
- newSelector = groups.join(",");
- }
-
- if ( newSelector ) {
- try {
- push.apply( results, slice.call( newContext.querySelectorAll(
- newSelector
- ), 0 ) );
- return results;
- } catch(qsaError) {
- } finally {
- if ( !old ) {
- context.removeAttribute("id");
- }
- }
- }
- }
-
- return oldSelect( selector, context, results, seed, xml );
- };
-
- if ( matches ) {
- assert(function( div ) {
- // Check to see if it's possible to do matchesSelector
- // on a disconnected node (IE 9)
- disconnectedMatch = matches.call( div, "div" );
-
- // This should fail with an exception
- // Gecko does not error, returns false instead
- try {
- matches.call( div, "[test!='']:sizzle" );
- rbuggyMatches.push( "!=", pseudos );
- } catch ( e ) {}
- });
-
- // rbuggyMatches always contains :active and :focus, so no need for a length check
- rbuggyMatches = /* rbuggyMatches.length && */ new RegExp( rbuggyMatches.join("|") );
-
- Sizzle.matchesSelector = function( elem, expr ) {
- // Make sure that attribute selectors are quoted
- expr = expr.replace( rattributeQuotes, "='$1']" );
-
- // rbuggyMatches always contains :active, so no need for an existence check
- if ( !isXML( elem ) && !rbuggyMatches.test( expr ) && (!rbuggyQSA || !rbuggyQSA.test( expr )) ) {
- try {
- var ret = matches.call( elem, expr );
-
- // IE 9's matchesSelector returns false on disconnected nodes
- if ( ret || disconnectedMatch ||
- // As well, disconnected nodes are said to be in a document
- // fragment in IE 9
- elem.document && elem.document.nodeType !== 11 ) {
- return ret;
- }
- } catch(e) {}
- }
-
- return Sizzle( expr, null, null, [ elem ] ).length > 0;
- };
- }
- })();
-}
-
-// Deprecated
-Expr.pseudos["nth"] = Expr.pseudos["eq"];
-
-// Back-compat
-function setFilters() {}
-Expr.filters = setFilters.prototype = Expr.pseudos;
-Expr.setFilters = new setFilters();
-
+/*!\r
+ * Sizzle CSS Selector Engine\r
+ * Copyright 2012 jQuery Foundation and other contributors\r
+ * Released under the MIT license\r
+ * http://sizzlejs.com/\r
+ */\r
+(function( window, undefined ) {\r
+\r
+var cachedruns,\r
+ assertGetIdNotName,\r
+ Expr,\r
+ getText,\r
+ isXML,\r
+ contains,\r
+ compile,\r
+ sortOrder,\r
+ hasDuplicate,\r
+ outermostContext,\r
+\r
+ baseHasDuplicate = true,\r
+ strundefined = "undefined",\r
+\r
+ expando = ( "sizcache" + Math.random() ).replace( ".", "" ),\r
+\r
+ Token = String,\r
+ document = window.document,\r
+ docElem = document.documentElement,\r
+ dirruns = 0,\r
+ done = 0,\r
+ pop = [].pop,\r
+ push = [].push,\r
+ slice = [].slice,\r
+ // Use a stripped-down indexOf if a native one is unavailable\r
+ indexOf = [].indexOf || function( elem ) {\r
+ var i = 0,\r
+ len = this.length;\r
+ for ( ; i < len; i++ ) {\r
+ if ( this[i] === elem ) {\r
+ return i;\r
+ }\r
+ }\r
+ return -1;\r
+ },\r
+\r
+ // Augment a function for special use by Sizzle\r
+ markFunction = function( fn, value ) {\r
+ fn[ expando ] = value == null || value;\r
+ return fn;\r
+ },\r
+\r
+ createCache = function() {\r
+ var cache = {},\r
+ keys = [];\r
+\r
+ return markFunction(function( key, value ) {\r
+ // Only keep the most recent entries\r
+ if ( keys.push( key ) > Expr.cacheLength ) {\r
+ delete cache[ keys.shift() ];\r
+ }\r
+\r
+ return (cache[ key ] = value);\r
+ }, cache );\r
+ },\r
+\r
+ classCache = createCache(),\r
+ tokenCache = createCache(),\r
+ compilerCache = createCache(),\r
+\r
+ // Regex\r
+\r
+ // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace\r
+ whitespace = "[\\x20\\t\\r\\n\\f]",\r
+ // http://www.w3.org/TR/css3-syntax/#characters\r
+ characterEncoding = "(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",\r
+\r
+ // Loosely modeled on CSS identifier characters\r
+ // An unquoted value should be a CSS identifier (http://www.w3.org/TR/css3-selectors/#attribute-selectors)\r
+ // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier\r
+ identifier = characterEncoding.replace( "w", "w#" ),\r
+\r
+ // Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors\r
+ operators = "([*^$|!~]?=)",\r
+ attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace +\r
+ "*(?:" + operators + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]",\r
+\r
+ // Prefer arguments not in parens/brackets,\r
+ // then attribute selectors and non-pseudos (denoted by :),\r
+ // then anything else\r
+ // These preferences are here to reduce the number of selectors\r
+ // needing tokenize in the PSEUDO preFilter\r
+ pseudos = ":(" + characterEncoding + ")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:" + attributes + ")|[^:]|\\\\.)*|.*))\\)|)",\r
+\r
+ // For matchExpr.POS and matchExpr.needsContext\r
+ pos = ":(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace +\r
+ "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)",\r
+\r
+ // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter\r
+ rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),\r
+\r
+ rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),\r
+ rcombinators = new RegExp( "^" + whitespace + "*([\\x20\\t\\r\\n\\f>+~])" + whitespace + "*" ),\r
+ rpseudo = new RegExp( pseudos ),\r
+\r
+ // Easily-parseable/retrievable ID or TAG or CLASS selectors\r
+ rquickExpr = /^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,\r
+\r
+ rnot = /^:not/,\r
+ rsibling = /[\x20\t\r\n\f]*[+~]/,\r
+ rendsWithNot = /:not\($/,\r
+\r
+ rheader = /h\d/i,\r
+ rinputs = /input|select|textarea|button/i,\r
+\r
+ rbackslash = /\\(?!\\)/g,\r
+\r
+ matchExpr = {\r
+ "ID": new RegExp( "^#(" + characterEncoding + ")" ),\r
+ "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ),\r
+ "NAME": new RegExp( "^\\[name=['\"]?(" + characterEncoding + ")['\"]?\\]" ),\r
+ "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ),\r
+ "ATTR": new RegExp( "^" + attributes ),\r
+ "PSEUDO": new RegExp( "^" + pseudos ),\r
+ "POS": new RegExp( pos, "i" ),\r
+ "CHILD": new RegExp( "^:(only|nth|first|last)-child(?:\\(" + whitespace +\r
+ "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +\r
+ "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),\r
+ // For use in libraries implementing .is()\r
+ "needsContext": new RegExp( "^" + whitespace + "*[>+~]|" + pos, "i" )\r
+ },\r
+\r
+ // Support\r
+\r
+ // Used for testing something on an element\r
+ assert = function( fn ) {\r
+ var div = document.createElement("div");\r
+\r
+ try {\r
+ return fn( div );\r
+ } catch (e) {\r
+ return false;\r
+ } finally {\r
+ // release memory in IE\r
+ div = null;\r
+ }\r
+ },\r
+\r
+ // Check if getElementsByTagName("*") returns only elements\r
+ assertTagNameNoComments = assert(function( div ) {\r
+ div.appendChild( document.createComment("") );\r
+ return !div.getElementsByTagName("*").length;\r
+ }),\r
+\r
+ // Check if getAttribute returns normalized href attributes\r
+ assertHrefNotNormalized = assert(function( div ) {\r
+ div.innerHTML = "<a href='#'></a>";\r
+ return div.firstChild && typeof div.firstChild.getAttribute !== strundefined &&\r
+ div.firstChild.getAttribute("href") === "#";\r
+ }),\r
+\r
+ // Check if attributes should be retrieved by attribute nodes\r
+ assertAttributes = assert(function( div ) {\r
+ div.innerHTML = "<select></select>";\r
+ var type = typeof div.lastChild.getAttribute("multiple");\r
+ // IE8 returns a string for some attributes even when not present\r
+ return type !== "boolean" && type !== "string";\r
+ }),\r
+\r
+ // Check if getElementsByClassName can be trusted\r
+ assertUsableClassName = assert(function( div ) {\r
+ // Opera can't find a second classname (in 9.6)\r
+ div.innerHTML = "<div class='hidden e'></div><div class='hidden'></div>";\r
+ if ( !div.getElementsByClassName || !div.getElementsByClassName("e").length ) {\r
+ return false;\r
+ }\r
+\r
+ // Safari 3.2 caches class attributes and doesn't catch changes\r
+ div.lastChild.className = "e";\r
+ return div.getElementsByClassName("e").length === 2;\r
+ }),\r
+\r
+ // Check if getElementById returns elements by name\r
+ // Check if getElementsByName privileges form controls or returns elements by ID\r
+ assertUsableName = assert(function( div ) {\r
+ // Inject content\r
+ div.id = expando + 0;\r
+ div.innerHTML = "<a name='" + expando + "'></a><div name='" + expando + "'></div>";\r
+ docElem.insertBefore( div, docElem.firstChild );\r
+\r
+ // Test\r
+ var pass = document.getElementsByName &&\r
+ // buggy browsers will return fewer than the correct 2\r
+ document.getElementsByName( expando ).length === 2 +\r
+ // buggy browsers will return more than the correct 0\r
+ document.getElementsByName( expando + 0 ).length;\r
+ assertGetIdNotName = !document.getElementById( expando );\r
+\r
+ // Cleanup\r
+ docElem.removeChild( div );\r
+\r
+ return pass;\r
+ });\r
+\r
+// If slice is not available, provide a backup\r
+try {\r
+ slice.call( docElem.childNodes, 0 )[0].nodeType;\r
+} catch ( e ) {\r
+ slice = function( i ) {\r
+ var elem,\r
+ results = [];\r
+ for ( ; (elem = this[i]); i++ ) {\r
+ results.push( elem );\r
+ }\r
+ return results;\r
+ };\r
+}\r
+\r
+function Sizzle( selector, context, results, seed ) {\r
+ results = results || [];\r
+ context = context || document;\r
+ var match, elem, xml, m,\r
+ nodeType = context.nodeType;\r
+\r
+ if ( !selector || typeof selector !== "string" ) {\r
+ return results;\r
+ }\r
+\r
+ if ( nodeType !== 1 && nodeType !== 9 ) {\r
+ return [];\r
+ }\r
+\r
+ xml = isXML( context );\r
+\r
+ if ( !xml && !seed ) {\r
+ if ( (match = rquickExpr.exec( selector )) ) {\r
+ // Speed-up: Sizzle("#ID")\r
+ if ( (m = match[1]) ) {\r
+ if ( nodeType === 9 ) {\r
+ elem = context.getElementById( m );\r
+ // Check parentNode to catch when Blackberry 4.6 returns\r
+ // nodes that are no longer in the document #6963\r
+ if ( elem && elem.parentNode ) {\r
+ // Handle the case where IE, Opera, and Webkit return items\r
+ // by name instead of ID\r
+ if ( elem.id === m ) {\r
+ results.push( elem );\r
+ return results;\r
+ }\r
+ } else {\r
+ return results;\r
+ }\r
+ } else {\r
+ // Context is not a document\r
+ if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) &&\r
+ contains( context, elem ) && elem.id === m ) {\r
+ results.push( elem );\r
+ return results;\r
+ }\r
+ }\r
+\r
+ // Speed-up: Sizzle("TAG")\r
+ } else if ( match[2] ) {\r
+ push.apply( results, slice.call(context.getElementsByTagName( selector ), 0) );\r
+ return results;\r
+\r
+ // Speed-up: Sizzle(".CLASS")\r
+ } else if ( (m = match[3]) && assertUsableClassName && context.getElementsByClassName ) {\r
+ push.apply( results, slice.call(context.getElementsByClassName( m ), 0) );\r
+ return results;\r
+ }\r
+ }\r
+ }\r
+\r
+ // All others\r
+ return select( selector.replace( rtrim, "$1" ), context, results, seed, xml );\r
+}\r
+\r
+Sizzle.matches = function( expr, elements ) {\r
+ return Sizzle( expr, null, null, elements );\r
+};\r
+\r
+Sizzle.matchesSelector = function( elem, expr ) {\r
+ return Sizzle( expr, null, null, [ elem ] ).length > 0;\r
+};\r
+\r
+// Returns a function to use in pseudos for input types\r
+function createInputPseudo( type ) {\r
+ return function( elem ) {\r
+ var name = elem.nodeName.toLowerCase();\r
+ return name === "input" && elem.type === type;\r
+ };\r
+}\r
+\r
+// Returns a function to use in pseudos for buttons\r
+function createButtonPseudo( type ) {\r
+ return function( elem ) {\r
+ var name = elem.nodeName.toLowerCase();\r
+ return (name === "input" || name === "button") && elem.type === type;\r
+ };\r
+}\r
+\r
+// Returns a function to use in pseudos for positionals\r
+function createPositionalPseudo( fn ) {\r
+ return markFunction(function( argument ) {\r
+ argument = +argument;\r
+ return markFunction(function( seed, matches ) {\r
+ var j,\r
+ matchIndexes = fn( [], seed.length, argument ),\r
+ i = matchIndexes.length;\r
+\r
+ // Match elements found at the specified indexes\r
+ while ( i-- ) {\r
+ if ( seed[ (j = matchIndexes[i]) ] ) {\r
+ seed[j] = !(matches[j] = seed[j]);\r
+ }\r
+ }\r
+ });\r
+ });\r
+}\r
+\r
+/**\r
+ * Utility function for retrieving the text value of an array of DOM nodes\r
+ * @param {Array|Element} elem\r
+ */\r
+getText = Sizzle.getText = function( elem ) {\r
+ var node,\r
+ ret = "",\r
+ i = 0,\r
+ nodeType = elem.nodeType;\r
+\r
+ if ( nodeType ) {\r
+ if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {\r
+ // Use textContent for elements\r
+ // innerText usage removed for consistency of new lines (see #11153)\r
+ if ( typeof elem.textContent === "string" ) {\r
+ return elem.textContent;\r
+ } else {\r
+ // Traverse its children\r
+ for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {\r
+ ret += getText( elem );\r
+ }\r
+ }\r
+ } else if ( nodeType === 3 || nodeType === 4 ) {\r
+ return elem.nodeValue;\r
+ }\r
+ // Do not include comment or processing instruction nodes\r
+ } else {\r
+\r
+ // If no nodeType, this is expected to be an array\r
+ for ( ; (node = elem[i]); i++ ) {\r
+ // Do not traverse comment nodes\r
+ ret += getText( node );\r
+ }\r
+ }\r
+ return ret;\r
+};\r
+\r
+isXML = Sizzle.isXML = function( elem ) {\r
+ // documentElement is verified for cases where it doesn't yet exist\r
+ // (such as loading iframes in IE - #4833)\r
+ var documentElement = elem && (elem.ownerDocument || elem).documentElement;\r
+ return documentElement ? documentElement.nodeName !== "HTML" : false;\r
+};\r
+\r
+// Element contains another\r
+contains = Sizzle.contains = docElem.contains ?\r
+ function( a, b ) {\r
+ var adown = a.nodeType === 9 ? a.documentElement : a,\r
+ bup = b && b.parentNode;\r
+ return a === bup || !!( bup && bup.nodeType === 1 && adown.contains && adown.contains(bup) );\r
+ } :\r
+ docElem.compareDocumentPosition ?\r
+ function( a, b ) {\r
+ return b && !!( a.compareDocumentPosition( b ) & 16 );\r
+ } :\r
+ function( a, b ) {\r
+ while ( (b = b.parentNode) ) {\r
+ if ( b === a ) {\r
+ return true;\r
+ }\r
+ }\r
+ return false;\r
+ };\r
+\r
+Sizzle.attr = function( elem, name ) {\r
+ var val,\r
+ xml = isXML( elem );\r
+\r
+ if ( !xml ) {\r
+ name = name.toLowerCase();\r
+ }\r
+ if ( (val = Expr.attrHandle[ name ]) ) {\r
+ return val( elem );\r
+ }\r
+ if ( xml || assertAttributes ) {\r
+ return elem.getAttribute( name );\r
+ }\r
+ val = elem.getAttributeNode( name );\r
+ return val ?\r
+ typeof elem[ name ] === "boolean" ?\r
+ elem[ name ] ? name : null :\r
+ val.specified ? val.value : null :\r
+ null;\r
+};\r
+\r
+Expr = Sizzle.selectors = {\r
+\r
+ // Can be adjusted by the user\r
+ cacheLength: 50,\r
+\r
+ createPseudo: markFunction,\r
+\r
+ match: matchExpr,\r
+\r
+ // IE6/7 return a modified href\r
+ attrHandle: assertHrefNotNormalized ?\r
+ {} :\r
+ {\r
+ "href": function( elem ) {\r
+ return elem.getAttribute( "href", 2 );\r
+ },\r
+ "type": function( elem ) {\r
+ return elem.getAttribute("type");\r
+ }\r
+ },\r
+\r
+ find: {\r
+ "ID": assertGetIdNotName ?\r
+ function( id, context, xml ) {\r
+ if ( typeof context.getElementById !== strundefined && !xml ) {\r
+ var m = context.getElementById( id );\r
+ // Check parentNode to catch when Blackberry 4.6 returns\r
+ // nodes that are no longer in the document #6963\r
+ return m && m.parentNode ? [m] : [];\r
+ }\r
+ } :\r
+ function( id, context, xml ) {\r
+ if ( typeof context.getElementById !== strundefined && !xml ) {\r
+ var m = context.getElementById( id );\r
+\r
+ return m ?\r
+ m.id === id || typeof m.getAttributeNode !== strundefined && m.getAttributeNode("id").value === id ?\r
+ [m] :\r
+ undefined :\r
+ [];\r
+ }\r
+ },\r
+\r
+ "TAG": assertTagNameNoComments ?\r
+ function( tag, context ) {\r
+ if ( typeof context.getElementsByTagName !== strundefined ) {\r
+ return context.getElementsByTagName( tag );\r
+ }\r
+ } :\r
+ function( tag, context ) {\r
+ var results = context.getElementsByTagName( tag );\r
+\r
+ // Filter out possible comments\r
+ if ( tag === "*" ) {\r
+ var elem,\r
+ tmp = [],\r
+ i = 0;\r
+\r
+ for ( ; (elem = results[i]); i++ ) {\r
+ if ( elem.nodeType === 1 ) {\r
+ tmp.push( elem );\r
+ }\r
+ }\r
+\r
+ return tmp;\r
+ }\r
+ return results;\r
+ },\r
+\r
+ "NAME": assertUsableName && function( tag, context ) {\r
+ if ( typeof context.getElementsByName !== strundefined ) {\r
+ return context.getElementsByName( name );\r
+ }\r
+ },\r
+\r
+ "CLASS": assertUsableClassName && function( className, context, xml ) {\r
+ if ( typeof context.getElementsByClassName !== strundefined && !xml ) {\r
+ return context.getElementsByClassName( className );\r
+ }\r
+ }\r
+ },\r
+\r
+ relative: {\r
+ ">": { dir: "parentNode", first: true },\r
+ " ": { dir: "parentNode" },\r
+ "+": { dir: "previousSibling", first: true },\r
+ "~": { dir: "previousSibling" }\r
+ },\r
+\r
+ preFilter: {\r
+ "ATTR": function( match ) {\r
+ match[1] = match[1].replace( rbackslash, "" );\r
+\r
+ // Move the given value to match[3] whether quoted or unquoted\r
+ match[3] = ( match[4] || match[5] || "" ).replace( rbackslash, "" );\r
+\r
+ if ( match[2] === "~=" ) {\r
+ match[3] = " " + match[3] + " ";\r
+ }\r
+\r
+ return match.slice( 0, 4 );\r
+ },\r
+\r
+ "CHILD": function( match ) {\r
+ /* matches from matchExpr["CHILD"]\r
+ 1 type (only|nth|...)\r
+ 2 argument (even|odd|\d*|\d*n([+-]\d+)?|...)\r
+ 3 xn-component of xn+y argument ([+-]?\d*n|)\r
+ 4 sign of xn-component\r
+ 5 x of xn-component\r
+ 6 sign of y-component\r
+ 7 y of y-component\r
+ */\r
+ match[1] = match[1].toLowerCase();\r
+\r
+ if ( match[1] === "nth" ) {\r
+ // nth-child requires argument\r
+ if ( !match[2] ) {\r
+ Sizzle.error( match[0] );\r
+ }\r
+\r
+ // numeric x and y parameters for Expr.filter.CHILD\r
+ // remember that false/true cast respectively to 0/1\r
+ match[3] = +( match[3] ? match[4] + (match[5] || 1) : 2 * ( match[2] === "even" || match[2] === "odd" ) );\r
+ match[4] = +( ( match[6] + match[7] ) || match[2] === "odd" );\r
+\r
+ // other types prohibit arguments\r
+ } else if ( match[2] ) {\r
+ Sizzle.error( match[0] );\r
+ }\r
+\r
+ return match;\r
+ },\r
+\r
+ "PSEUDO": function( match ) {\r
+ var unquoted, excess;\r
+ if ( matchExpr["CHILD"].test( match[0] ) ) {\r
+ return null;\r
+ }\r
+\r
+ if ( match[3] ) {\r
+ match[2] = match[3];\r
+ } else if ( (unquoted = match[4]) ) {\r
+ // Only check arguments that contain a pseudo\r
+ if ( rpseudo.test(unquoted) &&\r
+ // Get excess from tokenize (recursively)\r
+ (excess = tokenize( unquoted, true )) &&\r
+ // advance to the next closing parenthesis\r
+ (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {\r
+\r
+ // excess is a negative index\r
+ unquoted = unquoted.slice( 0, excess );\r
+ match[0] = match[0].slice( 0, excess );\r
+ }\r
+ match[2] = unquoted;\r
+ }\r
+\r
+ // Return only captures needed by the pseudo filter method (type and argument)\r
+ return match.slice( 0, 3 );\r
+ }\r
+ },\r
+\r
+ filter: {\r
+ "ID": assertGetIdNotName ?\r
+ function( id ) {\r
+ id = id.replace( rbackslash, "" );\r
+ return function( elem ) {\r
+ return elem.getAttribute("id") === id;\r
+ };\r
+ } :\r
+ function( id ) {\r
+ id = id.replace( rbackslash, "" );\r
+ return function( elem ) {\r
+ var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id");\r
+ return node && node.value === id;\r
+ };\r
+ },\r
+\r
+ "TAG": function( nodeName ) {\r
+ if ( nodeName === "*" ) {\r
+ return function() { return true; };\r
+ }\r
+ nodeName = nodeName.replace( rbackslash, "" ).toLowerCase();\r
+\r
+ return function( elem ) {\r
+ return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;\r
+ };\r
+ },\r
+\r
+ "CLASS": function( className ) {\r
+ var pattern = classCache[ expando ][ className ];\r
+ if ( !pattern ) {\r
+ pattern = classCache( className, new RegExp("(^|" + whitespace + ")" + className + "(" + whitespace + "|$)") );\r
+ }\r
+ return function( elem ) {\r
+ return pattern.test( elem.className || (typeof elem.getAttribute !== strundefined && elem.getAttribute("class")) || "" );\r
+ };\r
+ },\r
+\r
+ "ATTR": function( name, operator, check ) {\r
+ return function( elem, context ) {\r
+ var result = Sizzle.attr( elem, name );\r
+\r
+ if ( result == null ) {\r
+ return operator === "!=";\r
+ }\r
+ if ( !operator ) {\r
+ return true;\r
+ }\r
+\r
+ result += "";\r
+\r
+ return operator === "=" ? result === check :\r
+ operator === "!=" ? result !== check :\r
+ operator === "^=" ? check && result.indexOf( check ) === 0 :\r
+ operator === "*=" ? check && result.indexOf( check ) > -1 :\r
+ operator === "$=" ? check && result.substr( result.length - check.length ) === check :\r
+ operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 :\r
+ operator === "|=" ? result === check || result.substr( 0, check.length + 1 ) === check + "-" :\r
+ false;\r
+ };\r
+ },\r
+\r
+ "CHILD": function( type, argument, first, last ) {\r
+\r
+ if ( type === "nth" ) {\r
+ return function( elem ) {\r
+ var node, diff,\r
+ parent = elem.parentNode;\r
+\r
+ if ( first === 1 && last === 0 ) {\r
+ return true;\r
+ }\r
+\r
+ if ( parent ) {\r
+ diff = 0;\r
+ for ( node = parent.firstChild; node; node = node.nextSibling ) {\r
+ if ( node.nodeType === 1 ) {\r
+ diff++;\r
+ if ( elem === node ) {\r
+ break;\r
+ }\r
+ }\r
+ }\r
+ }\r
+\r
+ // Incorporate the offset (or cast to NaN), then check against cycle size\r
+ diff -= last;\r
+ return diff === first || ( diff % first === 0 && diff / first >= 0 );\r
+ };\r
+ }\r
+\r
+ return function( elem ) {\r
+ var node = elem;\r
+\r
+ switch ( type ) {\r
+ case "only":\r
+ case "first":\r
+ while ( (node = node.previousSibling) ) {\r
+ if ( node.nodeType === 1 ) {\r
+ return false;\r
+ }\r
+ }\r
+\r
+ if ( type === "first" ) {\r
+ return true;\r
+ }\r
+\r
+ node = elem;\r
+\r
+ /* falls through */\r
+ case "last":\r
+ while ( (node = node.nextSibling) ) {\r
+ if ( node.nodeType === 1 ) {\r
+ return false;\r
+ }\r
+ }\r
+\r
+ return true;\r
+ }\r
+ };\r
+ },\r
+\r
+ "PSEUDO": function( pseudo, argument ) {\r
+ // pseudo-class names are case-insensitive\r
+ // http://www.w3.org/TR/selectors/#pseudo-classes\r
+ // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters\r
+ // Remember that setFilters inherits from pseudos\r
+ var args,\r
+ fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||\r
+ Sizzle.error( "unsupported pseudo: " + pseudo );\r
+\r
+ // The user may use createPseudo to indicate that\r
+ // arguments are needed to create the filter function\r
+ // just as Sizzle does\r
+ if ( fn[ expando ] ) {\r
+ return fn( argument );\r
+ }\r
+\r
+ // But maintain support for old signatures\r
+ if ( fn.length > 1 ) {\r
+ args = [ pseudo, pseudo, "", argument ];\r
+ return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?\r
+ markFunction(function( seed, matches ) {\r
+ var idx,\r
+ matched = fn( seed, argument ),\r
+ i = matched.length;\r
+ while ( i-- ) {\r
+ idx = indexOf.call( seed, matched[i] );\r
+ seed[ idx ] = !( matches[ idx ] = matched[i] );\r
+ }\r
+ }) :\r
+ function( elem ) {\r
+ return fn( elem, 0, args );\r
+ };\r
+ }\r
+\r
+ return fn;\r
+ }\r
+ },\r
+\r
+ pseudos: {\r
+ "not": markFunction(function( selector ) {\r
+ // Trim the selector passed to compile\r
+ // to avoid treating leading and trailing\r
+ // spaces as combinators\r
+ var input = [],\r
+ results = [],\r
+ matcher = compile( selector.replace( rtrim, "$1" ) );\r
+\r
+ return matcher[ expando ] ?\r
+ markFunction(function( seed, matches, context, xml ) {\r
+ var elem,\r
+ unmatched = matcher( seed, null, xml, [] ),\r
+ i = seed.length;\r
+\r
+ // Match elements unmatched by `matcher`\r
+ while ( i-- ) {\r
+ if ( (elem = unmatched[i]) ) {\r
+ seed[i] = !(matches[i] = elem);\r
+ }\r
+ }\r
+ }) :\r
+ function( elem, context, xml ) {\r
+ input[0] = elem;\r
+ matcher( input, null, xml, results );\r
+ return !results.pop();\r
+ };\r
+ }),\r
+\r
+ "has": markFunction(function( selector ) {\r
+ return function( elem ) {\r
+ return Sizzle( selector, elem ).length > 0;\r
+ };\r
+ }),\r
+\r
+ "contains": markFunction(function( text ) {\r
+ return function( elem ) {\r
+ return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;\r
+ };\r
+ }),\r
+\r
+ "enabled": function( elem ) {\r
+ return elem.disabled === false;\r
+ },\r
+\r
+ "disabled": function( elem ) {\r
+ return elem.disabled === true;\r
+ },\r
+\r
+ "checked": function( elem ) {\r
+ // In CSS3, :checked should return both checked and selected elements\r
+ // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked\r
+ var nodeName = elem.nodeName.toLowerCase();\r
+ return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);\r
+ },\r
+\r
+ "selected": function( elem ) {\r
+ // Accessing this property makes selected-by-default\r
+ // options in Safari work properly\r
+ if ( elem.parentNode ) {\r
+ elem.parentNode.selectedIndex;\r
+ }\r
+\r
+ return elem.selected === true;\r
+ },\r
+\r
+ "parent": function( elem ) {\r
+ return !Expr.pseudos["empty"]( elem );\r
+ },\r
+\r
+ "empty": function( elem ) {\r
+ // http://www.w3.org/TR/selectors/#empty-pseudo\r
+ // :empty is only affected by element nodes and content nodes(including text(3), cdata(4)),\r
+ // not comment, processing instructions, or others\r
+ // Thanks to Diego Perini for the nodeName shortcut\r
+ // Greater than "@" means alpha characters (specifically not starting with "#" or "?")\r
+ var nodeType;\r
+ elem = elem.firstChild;\r
+ while ( elem ) {\r
+ if ( elem.nodeName > "@" || (nodeType = elem.nodeType) === 3 || nodeType === 4 ) {\r
+ return false;\r
+ }\r
+ elem = elem.nextSibling;\r
+ }\r
+ return true;\r
+ },\r
+\r
+ "header": function( elem ) {\r
+ return rheader.test( elem.nodeName );\r
+ },\r
+\r
+ "text": function( elem ) {\r
+ var type, attr;\r
+ // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc)\r
+ // use getAttribute instead to test this case\r
+ return elem.nodeName.toLowerCase() === "input" &&\r
+ (type = elem.type) === "text" &&\r
+ ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === type );\r
+ },\r
+\r
+ // Input types\r
+ "radio": createInputPseudo("radio"),\r
+ "checkbox": createInputPseudo("checkbox"),\r
+ "file": createInputPseudo("file"),\r
+ "password": createInputPseudo("password"),\r
+ "image": createInputPseudo("image"),\r
+\r
+ "submit": createButtonPseudo("submit"),\r
+ "reset": createButtonPseudo("reset"),\r
+\r
+ "button": function( elem ) {\r
+ var name = elem.nodeName.toLowerCase();\r
+ return name === "input" && elem.type === "button" || name === "button";\r
+ },\r
+\r
+ "input": function( elem ) {\r
+ return rinputs.test( elem.nodeName );\r
+ },\r
+\r
+ "focus": function( elem ) {\r
+ var doc = elem.ownerDocument;\r
+ return elem === doc.activeElement && (!doc.hasFocus || doc.hasFocus()) && !!(elem.type || elem.href);\r
+ },\r
+\r
+ "active": function( elem ) {\r
+ return elem === elem.ownerDocument.activeElement;\r
+ },\r
+\r
+ // Positional types\r
+ "first": createPositionalPseudo(function( matchIndexes, length, argument ) {\r
+ return [ 0 ];\r
+ }),\r
+\r
+ "last": createPositionalPseudo(function( matchIndexes, length, argument ) {\r
+ return [ length - 1 ];\r
+ }),\r
+\r
+ "eq": createPositionalPseudo(function( matchIndexes, length, argument ) {\r
+ return [ argument < 0 ? argument + length : argument ];\r
+ }),\r
+\r
+ "even": createPositionalPseudo(function( matchIndexes, length, argument ) {\r
+ for ( var i = 0; i < length; i += 2 ) {\r
+ matchIndexes.push( i );\r
+ }\r
+ return matchIndexes;\r
+ }),\r
+\r
+ "odd": createPositionalPseudo(function( matchIndexes, length, argument ) {\r
+ for ( var i = 1; i < length; i += 2 ) {\r
+ matchIndexes.push( i );\r
+ }\r
+ return matchIndexes;\r
+ }),\r
+\r
+ "lt": createPositionalPseudo(function( matchIndexes, length, argument ) {\r
+ for ( var i = argument < 0 ? argument + length : argument; --i >= 0; ) {\r
+ matchIndexes.push( i );\r
+ }\r
+ return matchIndexes;\r
+ }),\r
+\r
+ "gt": createPositionalPseudo(function( matchIndexes, length, argument ) {\r
+ for ( var i = argument < 0 ? argument + length : argument; ++i < length; ) {\r
+ matchIndexes.push( i );\r
+ }\r
+ return matchIndexes;\r
+ })\r
+ }\r
+};\r
+\r
+function siblingCheck( a, b, ret ) {\r
+ if ( a === b ) {\r
+ return ret;\r
+ }\r
+\r
+ var cur = a.nextSibling;\r
+\r
+ while ( cur ) {\r
+ if ( cur === b ) {\r
+ return -1;\r
+ }\r
+\r
+ cur = cur.nextSibling;\r
+ }\r
+\r
+ return 1;\r
+}\r
+\r
+sortOrder = docElem.compareDocumentPosition ?\r
+ function( a, b ) {\r
+ if ( a === b ) {\r
+ hasDuplicate = true;\r
+ return 0;\r
+ }\r
+\r
+ return ( !a.compareDocumentPosition || !b.compareDocumentPosition ?\r
+ a.compareDocumentPosition :\r
+ a.compareDocumentPosition(b) & 4\r
+ ) ? -1 : 1;\r
+ } :\r
+ function( a, b ) {\r
+ // The nodes are identical, we can exit early\r
+ if ( a === b ) {\r
+ hasDuplicate = true;\r
+ return 0;\r
+\r
+ // Fallback to using sourceIndex (in IE) if it's available on both nodes\r
+ } else if ( a.sourceIndex && b.sourceIndex ) {\r
+ return a.sourceIndex - b.sourceIndex;\r
+ }\r
+\r
+ var al, bl,\r
+ ap = [],\r
+ bp = [],\r
+ aup = a.parentNode,\r
+ bup = b.parentNode,\r
+ cur = aup;\r
+\r
+ // If the nodes are siblings (or identical) we can do a quick check\r
+ if ( aup === bup ) {\r
+ return siblingCheck( a, b );\r
+\r
+ // If no parents were found then the nodes are disconnected\r
+ } else if ( !aup ) {\r
+ return -1;\r
+\r
+ } else if ( !bup ) {\r
+ return 1;\r
+ }\r
+\r
+ // Otherwise they're somewhere else in the tree so we need\r
+ // to build up a full list of the parentNodes for comparison\r
+ while ( cur ) {\r
+ ap.unshift( cur );\r
+ cur = cur.parentNode;\r
+ }\r
+\r
+ cur = bup;\r
+\r
+ while ( cur ) {\r
+ bp.unshift( cur );\r
+ cur = cur.parentNode;\r
+ }\r
+\r
+ al = ap.length;\r
+ bl = bp.length;\r
+\r
+ // Start walking down the tree looking for a discrepancy\r
+ for ( var i = 0; i < al && i < bl; i++ ) {\r
+ if ( ap[i] !== bp[i] ) {\r
+ return siblingCheck( ap[i], bp[i] );\r
+ }\r
+ }\r
+\r
+ // We ended someplace up the tree so do a sibling check\r
+ return i === al ?\r
+ siblingCheck( a, bp[i], -1 ) :\r
+ siblingCheck( ap[i], b, 1 );\r
+ };\r
+\r
+// Always assume the presence of duplicates if sort doesn't\r
+// pass them to our comparison function (as in Google Chrome).\r
+[0, 0].sort( sortOrder );\r
+baseHasDuplicate = !hasDuplicate;\r
+\r
+// Document sorting and removing duplicates\r
+Sizzle.uniqueSort = function( results ) {\r
+ var elem,\r
+ i = 1;\r
+\r
+ hasDuplicate = baseHasDuplicate;\r
+ results.sort( sortOrder );\r
+\r
+ if ( hasDuplicate ) {\r
+ for ( ; (elem = results[i]); i++ ) {\r
+ if ( elem === results[ i - 1 ] ) {\r
+ results.splice( i--, 1 );\r
+ }\r
+ }\r
+ }\r
+\r
+ return results;\r
+};\r
+\r
+Sizzle.error = function( msg ) {\r
+ throw new Error( "Syntax error, unrecognized expression: " + msg );\r
+};\r
+\r
+function tokenize( selector, parseOnly ) {\r
+ var matched, match, tokens, type, soFar, groups, preFilters,\r
+ cached = tokenCache[ expando ][ selector ];\r
+\r
+ if ( cached ) {\r
+ return parseOnly ? 0 : cached.slice( 0 );\r
+ }\r
+\r
+ soFar = selector;\r
+ groups = [];\r
+ preFilters = Expr.preFilter;\r
+\r
+ while ( soFar ) {\r
+\r
+ // Comma and first run\r
+ if ( !matched || (match = rcomma.exec( soFar )) ) {\r
+ if ( match ) {\r
+ soFar = soFar.slice( match[0].length );\r
+ }\r
+ groups.push( tokens = [] );\r
+ }\r
+\r
+ matched = false;\r
+\r
+ // Combinators\r
+ if ( (match = rcombinators.exec( soFar )) ) {\r
+ tokens.push( matched = new Token( match.shift() ) );\r
+ soFar = soFar.slice( matched.length );\r
+\r
+ // Cast descendant combinators to space\r
+ matched.type = match[0].replace( rtrim, " " );\r
+ }\r
+\r
+ // Filters\r
+ for ( type in Expr.filter ) {\r
+ if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||\r
+ // The last two arguments here are (context, xml) for backCompat\r
+ (match = preFilters[ type ]( match, document, true ))) ) {\r
+\r
+ tokens.push( matched = new Token( match.shift() ) );\r
+ soFar = soFar.slice( matched.length );\r
+ matched.type = type;\r
+ matched.matches = match;\r
+ }\r
+ }\r
+\r
+ if ( !matched ) {\r
+ break;\r
+ }\r
+ }\r
+\r
+ // Return the length of the invalid excess\r
+ // if we're just parsing\r
+ // Otherwise, throw an error or return tokens\r
+ return parseOnly ?\r
+ soFar.length :\r
+ soFar ?\r
+ Sizzle.error( selector ) :\r
+ // Cache the tokens\r
+ tokenCache( selector, groups ).slice( 0 );\r
+}\r
+\r
+function addCombinator( matcher, combinator, base ) {\r
+ var dir = combinator.dir,\r
+ checkNonElements = base && combinator.dir === "parentNode",\r
+ doneName = done++;\r
+\r
+ return combinator.first ?\r
+ // Check against closest ancestor/preceding element\r
+ function( elem, context, xml ) {\r
+ while ( (elem = elem[ dir ]) ) {\r
+ if ( checkNonElements || elem.nodeType === 1 ) {\r
+ return matcher( elem, context, xml );\r
+ }\r
+ }\r
+ } :\r
+\r
+ // Check against all ancestor/preceding elements\r
+ function( elem, context, xml ) {\r
+ // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching\r
+ if ( !xml ) {\r
+ var cache,\r
+ dirkey = dirruns + " " + doneName + " ",\r
+ cachedkey = dirkey + cachedruns;\r
+ while ( (elem = elem[ dir ]) ) {\r
+ if ( checkNonElements || elem.nodeType === 1 ) {\r
+ if ( (cache = elem[ expando ]) === cachedkey ) {\r
+ return elem.sizset;\r
+ } else if ( typeof cache === "string" && cache.indexOf(dirkey) === 0 ) {\r
+ if ( elem.sizset ) {\r
+ return elem;\r
+ }\r
+ } else {\r
+ elem[ expando ] = cachedkey;\r
+ if ( matcher( elem, context, xml ) ) {\r
+ elem.sizset = true;\r
+ return elem;\r
+ }\r
+ elem.sizset = false;\r
+ }\r
+ }\r
+ }\r
+ } else {\r
+ while ( (elem = elem[ dir ]) ) {\r
+ if ( checkNonElements || elem.nodeType === 1 ) {\r
+ if ( matcher( elem, context, xml ) ) {\r
+ return elem;\r
+ }\r
+ }\r
+ }\r
+ }\r
+ };\r
+}\r
+\r
+function elementMatcher( matchers ) {\r
+ return matchers.length > 1 ?\r
+ function( elem, context, xml ) {\r
+ var i = matchers.length;\r
+ while ( i-- ) {\r
+ if ( !matchers[i]( elem, context, xml ) ) {\r
+ return false;\r
+ }\r
+ }\r
+ return true;\r
+ } :\r
+ matchers[0];\r
+}\r
+\r
+function condense( unmatched, map, filter, context, xml ) {\r
+ var elem,\r
+ newUnmatched = [],\r
+ i = 0,\r
+ len = unmatched.length,\r
+ mapped = map != null;\r
+\r
+ for ( ; i < len; i++ ) {\r
+ if ( (elem = unmatched[i]) ) {\r
+ if ( !filter || filter( elem, context, xml ) ) {\r
+ newUnmatched.push( elem );\r
+ if ( mapped ) {\r
+ map.push( i );\r
+ }\r
+ }\r
+ }\r
+ }\r
+\r
+ return newUnmatched;\r
+}\r
+\r
+function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {\r
+ if ( postFilter && !postFilter[ expando ] ) {\r
+ postFilter = setMatcher( postFilter );\r
+ }\r
+ if ( postFinder && !postFinder[ expando ] ) {\r
+ postFinder = setMatcher( postFinder, postSelector );\r
+ }\r
+ return markFunction(function( seed, results, context, xml ) {\r
+ // Positional selectors apply to seed elements, so it is invalid to follow them with relative ones\r
+ if ( seed && postFinder ) {\r
+ return;\r
+ }\r
+\r
+ var i, elem, postFilterIn,\r
+ preMap = [],\r
+ postMap = [],\r
+ preexisting = results.length,\r
+\r
+ // Get initial elements from seed or context\r
+ elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [], seed ),\r
+\r
+ // Prefilter to get matcher input, preserving a map for seed-results synchronization\r
+ matcherIn = preFilter && ( seed || !selector ) ?\r
+ condense( elems, preMap, preFilter, context, xml ) :\r
+ elems,\r
+\r
+ matcherOut = matcher ?\r
+ // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,\r
+ postFinder || ( seed ? preFilter : preexisting || postFilter ) ?\r
+\r
+ // ...intermediate processing is necessary\r
+ [] :\r
+\r
+ // ...otherwise use results directly\r
+ results :\r
+ matcherIn;\r
+\r
+ // Find primary matches\r
+ if ( matcher ) {\r
+ matcher( matcherIn, matcherOut, context, xml );\r
+ }\r
+\r
+ // Apply postFilter\r
+ if ( postFilter ) {\r
+ postFilterIn = condense( matcherOut, postMap );\r
+ postFilter( postFilterIn, [], context, xml );\r
+\r
+ // Un-match failing elements by moving them back to matcherIn\r
+ i = postFilterIn.length;\r
+ while ( i-- ) {\r
+ if ( (elem = postFilterIn[i]) ) {\r
+ matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);\r
+ }\r
+ }\r
+ }\r
+\r
+ // Keep seed and results synchronized\r
+ if ( seed ) {\r
+ // Ignore postFinder because it can't coexist with seed\r
+ i = preFilter && matcherOut.length;\r
+ while ( i-- ) {\r
+ if ( (elem = matcherOut[i]) ) {\r
+ seed[ preMap[i] ] = !(results[ preMap[i] ] = elem);\r
+ }\r
+ }\r
+ } else {\r
+ matcherOut = condense(\r
+ matcherOut === results ?\r
+ matcherOut.splice( preexisting, matcherOut.length ) :\r
+ matcherOut\r
+ );\r
+ if ( postFinder ) {\r
+ postFinder( null, results, matcherOut, xml );\r
+ } else {\r
+ push.apply( results, matcherOut );\r
+ }\r
+ }\r
+ });\r
+}\r
+\r
+function matcherFromTokens( tokens ) {\r
+ var checkContext, matcher, j,\r
+ len = tokens.length,\r
+ leadingRelative = Expr.relative[ tokens[0].type ],\r
+ implicitRelative = leadingRelative || Expr.relative[" "],\r
+ i = leadingRelative ? 1 : 0,\r
+\r
+ // The foundational matcher ensures that elements are reachable from top-level context(s)\r
+ matchContext = addCombinator( function( elem ) {\r
+ return elem === checkContext;\r
+ }, implicitRelative, true ),\r
+ matchAnyContext = addCombinator( function( elem ) {\r
+ return indexOf.call( checkContext, elem ) > -1;\r
+ }, implicitRelative, true ),\r
+ matchers = [ function( elem, context, xml ) {\r
+ return ( !leadingRelative && ( xml || context !== outermostContext ) ) || (\r
+ (checkContext = context).nodeType ?\r
+ matchContext( elem, context, xml ) :\r
+ matchAnyContext( elem, context, xml ) );\r
+ } ];\r
+\r
+ for ( ; i < len; i++ ) {\r
+ if ( (matcher = Expr.relative[ tokens[i].type ]) ) {\r
+ matchers = [ addCombinator( elementMatcher( matchers ), matcher ) ];\r
+ } else {\r
+ // The concatenated values are (context, xml) for backCompat\r
+ matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );\r
+\r
+ // Return special upon seeing a positional matcher\r
+ if ( matcher[ expando ] ) {\r
+ // Find the next relative operator (if any) for proper handling\r
+ j = ++i;\r
+ for ( ; j < len; j++ ) {\r
+ if ( Expr.relative[ tokens[j].type ] ) {\r
+ break;\r
+ }\r
+ }\r
+ return setMatcher(\r
+ i > 1 && elementMatcher( matchers ),\r
+ i > 1 && tokens.slice( 0, i - 1 ).join("").replace( rtrim, "$1" ),\r
+ matcher,\r
+ i < j && matcherFromTokens( tokens.slice( i, j ) ),\r
+ j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),\r
+ j < len && tokens.join("")\r
+ );\r
+ }\r
+ matchers.push( matcher );\r
+ }\r
+ }\r
+\r
+ return elementMatcher( matchers );\r
+}\r
+\r
+function matcherFromGroupMatchers( elementMatchers, setMatchers ) {\r
+ var bySet = setMatchers.length > 0,\r
+ byElement = elementMatchers.length > 0,\r
+ superMatcher = function( seed, context, xml, results, expandContext ) {\r
+ var elem, j, matcher,\r
+ setMatched = [],\r
+ matchedCount = 0,\r
+ i = "0",\r
+ unmatched = seed && [],\r
+ outermost = expandContext != null,\r
+ contextBackup = outermostContext,\r
+ // We must always have either seed elements or context\r
+ elems = seed || byElement && Expr.find["TAG"]( "*", expandContext && context.parentNode || context ),\r
+ // Nested matchers should use non-integer dirruns\r
+ dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.E);\r
+\r
+ if ( outermost ) {\r
+ outermostContext = context !== document && context;\r
+ cachedruns = superMatcher.el;\r
+ }\r
+\r
+ // Add elements passing elementMatchers directly to results\r
+ for ( ; (elem = elems[i]) != null; i++ ) {\r
+ if ( byElement && elem ) {\r
+ for ( j = 0; (matcher = elementMatchers[j]); j++ ) {\r
+ if ( matcher( elem, context, xml ) ) {\r
+ results.push( elem );\r
+ break;\r
+ }\r
+ }\r
+ if ( outermost ) {\r
+ dirruns = dirrunsUnique;\r
+ cachedruns = ++superMatcher.el;\r
+ }\r
+ }\r
+\r
+ // Track unmatched elements for set filters\r
+ if ( bySet ) {\r
+ // They will have gone through all possible matchers\r
+ if ( (elem = !matcher && elem) ) {\r
+ matchedCount--;\r
+ }\r
+\r
+ // Lengthen the array for every element, matched or not\r
+ if ( seed ) {\r
+ unmatched.push( elem );\r
+ }\r
+ }\r
+ }\r
+\r
+ // Apply set filters to unmatched elements\r
+ matchedCount += i;\r
+ if ( bySet && i !== matchedCount ) {\r
+ for ( j = 0; (matcher = setMatchers[j]); j++ ) {\r
+ matcher( unmatched, setMatched, context, xml );\r
+ }\r
+\r
+ if ( seed ) {\r
+ // Reintegrate element matches to eliminate the need for sorting\r
+ if ( matchedCount > 0 ) {\r
+ while ( i-- ) {\r
+ if ( !(unmatched[i] || setMatched[i]) ) {\r
+ setMatched[i] = pop.call( results );\r
+ }\r
+ }\r
+ }\r
+\r
+ // Discard index placeholder values to get only actual matches\r
+ setMatched = condense( setMatched );\r
+ }\r
+\r
+ // Add matches to results\r
+ push.apply( results, setMatched );\r
+\r
+ // Seedless set matches succeeding multiple successful matchers stipulate sorting\r
+ if ( outermost && !seed && setMatched.length > 0 &&\r
+ ( matchedCount + setMatchers.length ) > 1 ) {\r
+\r
+ Sizzle.uniqueSort( results );\r
+ }\r
+ }\r
+\r
+ // Override manipulation of globals by nested matchers\r
+ if ( outermost ) {\r
+ dirruns = dirrunsUnique;\r
+ outermostContext = contextBackup;\r
+ }\r
+\r
+ return unmatched;\r
+ };\r
+\r
+ superMatcher.el = 0;\r
+ return bySet ?\r
+ markFunction( superMatcher ) :\r
+ superMatcher;\r
+}\r
+\r
+compile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) {\r
+ var i,\r
+ setMatchers = [],\r
+ elementMatchers = [],\r
+ cached = compilerCache[ expando ][ selector ];\r
+\r
+ if ( !cached ) {\r
+ // Generate a function of recursive functions that can be used to check each element\r
+ if ( !group ) {\r
+ group = tokenize( selector );\r
+ }\r
+ i = group.length;\r
+ while ( i-- ) {\r
+ cached = matcherFromTokens( group[i] );\r
+ if ( cached[ expando ] ) {\r
+ setMatchers.push( cached );\r
+ } else {\r
+ elementMatchers.push( cached );\r
+ }\r
+ }\r
+\r
+ // Cache the compiled function\r
+ cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );\r
+ }\r
+ return cached;\r
+};\r
+\r
+function multipleContexts( selector, contexts, results, seed ) {\r
+ var i = 0,\r
+ len = contexts.length;\r
+ for ( ; i < len; i++ ) {\r
+ Sizzle( selector, contexts[i], results, seed );\r
+ }\r
+ return results;\r
+}\r
+\r
+function select( selector, context, results, seed, xml ) {\r
+ var i, tokens, token, type, find,\r
+ match = tokenize( selector ),\r
+ j = match.length;\r
+\r
+ if ( !seed ) {\r
+ // Try to minimize operations if there is only one group\r
+ if ( match.length === 1 ) {\r
+\r
+ // Take a shortcut and set the context if the root selector is an ID\r
+ tokens = match[0] = match[0].slice( 0 );\r
+ if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&\r
+ context.nodeType === 9 && !xml &&\r
+ Expr.relative[ tokens[1].type ] ) {\r
+\r
+ context = Expr.find["ID"]( token.matches[0].replace( rbackslash, "" ), context, xml )[0];\r
+ if ( !context ) {\r
+ return results;\r
+ }\r
+\r
+ selector = selector.slice( tokens.shift().length );\r
+ }\r
+\r
+ // Fetch a seed set for right-to-left matching\r
+ for ( i = matchExpr["POS"].test( selector ) ? -1 : tokens.length - 1; i >= 0; i-- ) {\r
+ token = tokens[i];\r
+\r
+ // Abort if we hit a combinator\r
+ if ( Expr.relative[ (type = token.type) ] ) {\r
+ break;\r
+ }\r
+ if ( (find = Expr.find[ type ]) ) {\r
+ // Search, expanding context for leading sibling combinators\r
+ if ( (seed = find(\r
+ token.matches[0].replace( rbackslash, "" ),\r
+ rsibling.test( tokens[0].type ) && context.parentNode || context,\r
+ xml\r
+ )) ) {\r
+\r
+ // If seed is empty or no tokens remain, we can return early\r
+ tokens.splice( i, 1 );\r
+ selector = seed.length && tokens.join("");\r
+ if ( !selector ) {\r
+ push.apply( results, slice.call( seed, 0 ) );\r
+ return results;\r
+ }\r
+\r
+ break;\r
+ }\r
+ }\r
+ }\r
+ }\r
+ }\r
+\r
+ // Compile and execute a filtering function\r
+ // Provide `match` to avoid retokenization if we modified the selector above\r
+ compile( selector, match )(\r
+ seed,\r
+ context,\r
+ xml,\r
+ results,\r
+ rsibling.test( selector )\r
+ );\r
+ return results;\r
+}\r
+\r
+if ( document.querySelectorAll ) {\r
+ (function() {\r
+ var disconnectedMatch,\r
+ oldSelect = select,\r
+ rescape = /'|\\/g,\r
+ rattributeQuotes = /\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,\r
+\r
+ // qSa(:focus) reports false when true (Chrome 21),\r
+ // A support test would require too much code (would include document ready)\r
+ rbuggyQSA = [":focus"],\r
+\r
+ // matchesSelector(:focus) reports false when true (Chrome 21),\r
+ // matchesSelector(:active) reports false when true (IE9/Opera 11.5)\r
+ // A support test would require too much code (would include document ready)\r
+ // just skip matchesSelector for :active\r
+ rbuggyMatches = [ ":active", ":focus" ],\r
+ matches = docElem.matchesSelector ||\r
+ docElem.mozMatchesSelector ||\r
+ docElem.webkitMatchesSelector ||\r
+ docElem.oMatchesSelector ||\r
+ docElem.msMatchesSelector;\r
+\r
+ // Build QSA regex\r
+ // Regex strategy adopted from Diego Perini\r
+ assert(function( div ) {\r
+ // Select is set to empty string on purpose\r
+ // This is to test IE's treatment of not explictly\r
+ // setting a boolean content attribute,\r
+ // since its presence should be enough\r
+ // http://bugs.jquery.com/ticket/12359\r
+ div.innerHTML = "<select><option selected=''></option></select>";\r
+\r
+ // IE8 - Some boolean attributes are not treated correctly\r
+ if ( !div.querySelectorAll("[selected]").length ) {\r
+ rbuggyQSA.push( "\\[" + whitespace + "*(?:checked|disabled|ismap|multiple|readonly|selected|value)" );\r
+ }\r
+\r
+ // Webkit/Opera - :checked should return selected option elements\r
+ // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked\r
+ // IE8 throws error here (do not put tests after this one)\r
+ if ( !div.querySelectorAll(":checked").length ) {\r
+ rbuggyQSA.push(":checked");\r
+ }\r
+ });\r
+\r
+ assert(function( div ) {\r
+\r
+ // Opera 10-12/IE9 - ^= $= *= and empty values\r
+ // Should not select anything\r
+ div.innerHTML = "<p test=''></p>";\r
+ if ( div.querySelectorAll("[test^='']").length ) {\r
+ rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:\"\"|'')" );\r
+ }\r
+\r
+ // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)\r
+ // IE8 throws error here (do not put tests after this one)\r
+ div.innerHTML = "<input type='hidden'/>";\r
+ if ( !div.querySelectorAll(":enabled").length ) {\r
+ rbuggyQSA.push(":enabled", ":disabled");\r
+ }\r
+ });\r
+\r
+ // rbuggyQSA always contains :focus, so no need for a length check\r
+ rbuggyQSA = /* rbuggyQSA.length && */ new RegExp( rbuggyQSA.join("|") );\r
+\r
+ select = function( selector, context, results, seed, xml ) {\r
+ // Only use querySelectorAll when not filtering,\r
+ // when this is not xml,\r
+ // and when no QSA bugs apply\r
+ if ( !seed && !xml && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {\r
+ var groups, i,\r
+ old = true,\r
+ nid = expando,\r
+ newContext = context,\r
+ newSelector = context.nodeType === 9 && selector;\r
+\r
+ // qSA works strangely on Element-rooted queries\r
+ // We can work around this by specifying an extra ID on the root\r
+ // and working up from there (Thanks to Andrew Dupont for the technique)\r
+ // IE 8 doesn't work on object elements\r
+ if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {\r
+ groups = tokenize( selector );\r
+\r
+ if ( (old = context.getAttribute("id")) ) {\r
+ nid = old.replace( rescape, "\\$&" );\r
+ } else {\r
+ context.setAttribute( "id", nid );\r
+ }\r
+ nid = "[id='" + nid + "'] ";\r
+\r
+ i = groups.length;\r
+ while ( i-- ) {\r
+ groups[i] = nid + groups[i].join("");\r
+ }\r
+ newContext = rsibling.test( selector ) && context.parentNode || context;\r
+ newSelector = groups.join(",");\r
+ }\r
+\r
+ if ( newSelector ) {\r
+ try {\r
+ push.apply( results, slice.call( newContext.querySelectorAll(\r
+ newSelector\r
+ ), 0 ) );\r
+ return results;\r
+ } catch(qsaError) {\r
+ } finally {\r
+ if ( !old ) {\r
+ context.removeAttribute("id");\r
+ }\r
+ }\r
+ }\r
+ }\r
+\r
+ return oldSelect( selector, context, results, seed, xml );\r
+ };\r
+\r
+ if ( matches ) {\r
+ assert(function( div ) {\r
+ // Check to see if it's possible to do matchesSelector\r
+ // on a disconnected node (IE 9)\r
+ disconnectedMatch = matches.call( div, "div" );\r
+\r
+ // This should fail with an exception\r
+ // Gecko does not error, returns false instead\r
+ try {\r
+ matches.call( div, "[test!='']:sizzle" );\r
+ rbuggyMatches.push( "!=", pseudos );\r
+ } catch ( e ) {}\r
+ });\r
+\r
+ // rbuggyMatches always contains :active and :focus, so no need for a length check\r
+ rbuggyMatches = /* rbuggyMatches.length && */ new RegExp( rbuggyMatches.join("|") );\r
+\r
+ Sizzle.matchesSelector = function( elem, expr ) {\r
+ // Make sure that attribute selectors are quoted\r
+ expr = expr.replace( rattributeQuotes, "='$1']" );\r
+\r
+ // rbuggyMatches always contains :active, so no need for an existence check\r
+ if ( !isXML( elem ) && !rbuggyMatches.test( expr ) && (!rbuggyQSA || !rbuggyQSA.test( expr )) ) {\r
+ try {\r
+ var ret = matches.call( elem, expr );\r
+\r
+ // IE 9's matchesSelector returns false on disconnected nodes\r
+ if ( ret || disconnectedMatch ||\r
+ // As well, disconnected nodes are said to be in a document\r
+ // fragment in IE 9\r
+ elem.document && elem.document.nodeType !== 11 ) {\r
+ return ret;\r
+ }\r
+ } catch(e) {}\r
+ }\r
+\r
+ return Sizzle( expr, null, null, [ elem ] ).length > 0;\r
+ };\r
+ }\r
+ })();\r
+}\r
+\r
+// Deprecated\r
+Expr.pseudos["nth"] = Expr.pseudos["eq"];\r
+\r
+// Back-compat\r
+function setFilters() {}\r
+Expr.filters = setFilters.prototype = Expr.pseudos;\r
+Expr.setFilters = new setFilters();\r
+\r
// Override sizzle attribute retrieval
Sizzle.attr = jQuery.attr;
jQuery.find = Sizzle;
jQuery.text = Sizzle.getText;
jQuery.isXMLDoc = Sizzle.isXML;
jQuery.contains = Sizzle.contains;
-
-
-})( window );
+\r
+\r
+})( window );\r
var runtil = /Until$/,
rparentsprev = /^(?:parents|prev(?:Until|All))/,
isSimple = /^.[^:#\[\.,]*$/,
-/*! jQuery v1.8.2 jquery.com | jquery.org/license */
+/*! jQuery v1.8.2 jquery.com | jquery.org/license */\r
(function(a,b){function G(a){var b=F[a]={};return p.each(a.split(s),function(a,c){b[c]=!0}),b}function J(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(I,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:+d+""===d?+d:H.test(d)?p.parseJSON(d):d}catch(f){}p.data(a,c,d)}else d=b}return d}function K(a){var b;for(b in a){if(b==="data"&&p.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function ba(){return!1}function bb(){return!0}function bh(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function bi(a,b){do a=a[b];while(a&&a.nodeType!==1);return a}function bj(a,b,c){b=b||0;if(p.isFunction(b))return p.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return p.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=p.grep(a,function(a){return a.nodeType===1});if(be.test(b))return p.filter(b,d,!c);b=p.filter(b,d)}return p.grep(a,function(a,d){return p.inArray(a,b)>=0===c})}function bk(a){var b=bl.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}function bC(a,b){return a.getElementsByTagName(b)[0]||a.appendChild(a.ownerDocument.createElement(b))}function bD(a,b){if(b.nodeType!==1||!p.hasData(a))return;var c,d,e,f=p._data(a),g=p._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;d<e;d++)p.event.add(b,c,h[c][d])}g.data&&(g.data=p.extend({},g.data))}function bE(a,b){var c;if(b.nodeType!==1)return;b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase(),c==="object"?(b.parentNode&&(b.outerHTML=a.outerHTML),p.support.html5Clone&&a.innerHTML&&!p.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):c==="input"&&bv.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):c==="option"?b.selected=a.defaultSelected:c==="input"||c==="textarea"?b.defaultValue=a.defaultValue:c==="script"&&b.text!==a.text&&(b.text=a.text),b.removeAttribute(p.expando)}function bF(a){return typeof a.getElementsByTagName!="undefined"?a.getElementsByTagName("*"):typeof a.querySelectorAll!="undefined"?a.querySelectorAll("*"):[]}function bG(a){bv.test(a.type)&&(a.defaultChecked=a.checked)}function bY(a,b){if(b in a)return b;var c=b.charAt(0).toUpperCase()+b.slice(1),d=b,e=bW.length;while(e--){b=bW[e]+c;if(b in a)return b}return d}function bZ(a,b){return a=b||a,p.css(a,"display")==="none"||!p.contains(a.ownerDocument,a)}function b$(a,b){var c,d,e=[],f=0,g=a.length;for(;f<g;f++){c=a[f];if(!c.style)continue;e[f]=p._data(c,"olddisplay"),b?(!e[f]&&c.style.display==="none"&&(c.style.display=""),c.style.display===""&&bZ(c)&&(e[f]=p._data(c,"olddisplay",cc(c.nodeName)))):(d=bH(c,"display"),!e[f]&&d!=="none"&&p._data(c,"olddisplay",d))}for(f=0;f<g;f++){c=a[f];if(!c.style)continue;if(!b||c.style.display==="none"||c.style.display==="")c.style.display=b?e[f]||"":"none"}return a}function b_(a,b,c){var d=bP.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function ca(a,b,c,d){var e=c===(d?"border":"content")?4:b==="width"?1:0,f=0;for(;e<4;e+=2)c==="margin"&&(f+=p.css(a,c+bV[e],!0)),d?(c==="content"&&(f-=parseFloat(bH(a,"padding"+bV[e]))||0),c!=="margin"&&(f-=parseFloat(bH(a,"border"+bV[e]+"Width"))||0)):(f+=parseFloat(bH(a,"padding"+bV[e]))||0,c!=="padding"&&(f+=parseFloat(bH(a,"border"+bV[e]+"Width"))||0));return f}function cb(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight,e=!0,f=p.support.boxSizing&&p.css(a,"boxSizing")==="border-box";if(d<=0||d==null){d=bH(a,b);if(d<0||d==null)d=a.style[b];if(bQ.test(d))return d;e=f&&(p.support.boxSizingReliable||d===a.style[b]),d=parseFloat(d)||0}return d+ca(a,b,c||(f?"border":"content"),e)+"px"}function cc(a){if(bS[a])return bS[a];var b=p("<"+a+">").appendTo(e.body),c=b.css("display");b.remove();if(c==="none"||c===""){bI=e.body.appendChild(bI||p.extend(e.createElement("iframe"),{frameBorder:0,width:0,height:0}));if(!bJ||!bI.createElement)bJ=(bI.contentWindow||bI.contentDocument).document,bJ.write("<!doctype html><html><body>"),bJ.close();b=bJ.body.appendChild(bJ.createElement(a)),c=bH(b,"display"),e.body.removeChild(bI)}return bS[a]=c,c}function ci(a,b,c,d){var e;if(p.isArray(b))p.each(b,function(b,e){c||ce.test(a)?d(a,e):ci(a+"["+(typeof e=="object"?b:"")+"]",e,c,d)});else if(!c&&p.type(b)==="object")for(e in b)ci(a+"["+e+"]",b[e],c,d);else d(a,b)}function cz(a){return function(b,c){typeof b!="string"&&(c=b,b="*");var d,e,f,g=b.toLowerCase().split(s),h=0,i=g.length;if(p.isFunction(c))for(;h<i;h++)d=g[h],f=/^\+/.test(d),f&&(d=d.substr(1)||"*"),e=a[d]=a[d]||[],e[f?"unshift":"push"](c)}}function cA(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h,i=a[f],j=0,k=i?i.length:0,l=a===cv;for(;j<k&&(l||!h);j++)h=i[j](c,d,e),typeof h=="string"&&(!l||g[h]?h=b:(c.dataTypes.unshift(h),h=cA(a,c,d,e,h,g)));return(l||!h)&&!g["*"]&&(h=cA(a,c,d,e,"*",g)),h}function cB(a,c){var d,e,f=p.ajaxSettings.flatOptions||{};for(d in c)c[d]!==b&&((f[d]?a:e||(e={}))[d]=c[d]);e&&p.extend(!0,a,e)}function cC(a,c,d){var e,f,g,h,i=a.contents,j=a.dataTypes,k=a.responseFields;for(f in k)f in d&&(c[k[f]]=d[f]);while(j[0]==="*")j.shift(),e===b&&(e=a.mimeType||c.getResponseHeader("content-type"));if(e)for(f in i)if(i[f]&&i[f].test(e)){j.unshift(f);break}if(j[0]in d)g=j[0];else{for(f in d){if(!j[0]||a.converters[f+" "+j[0]]){g=f;break}h||(h=f)}g=g||h}if(g)return g!==j[0]&&j.unshift(g),d[g]}function cD(a,b){var c,d,e,f,g=a.dataTypes.slice(),h=g[0],i={},j=0;a.dataFilter&&(b=a.dataFilter(b,a.dataType));if(g[1])for(c in a.converters)i[c.toLowerCase()]=a.converters[c];for(;e=g[++j];)if(e!=="*"){if(h!=="*"&&h!==e){c=i[h+" "+e]||i["* "+e];if(!c)for(d in i){f=d.split(" ");if(f[1]===e){c=i[h+" "+f[0]]||i["* "+f[0]];if(c){c===!0?c=i[d]:i[d]!==!0&&(e=f[0],g.splice(j--,0,e));break}}}if(c!==!0)if(c&&a["throws"])b=c(b);else try{b=c(b)}catch(k){return{state:"parsererror",error:c?k:"No conversion from "+h+" to "+e}}}h=e}return{state:"success",data:b}}function cL(){try{return new a.XMLHttpRequest}catch(b){}}function cM(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function cU(){return setTimeout(function(){cN=b},0),cN=p.now()}function cV(a,b){p.each(b,function(b,c){var d=(cT[b]||[]).concat(cT["*"]),e=0,f=d.length;for(;e<f;e++)if(d[e].call(a,b,c))return})}function cW(a,b,c){var d,e=0,f=0,g=cS.length,h=p.Deferred().always(function(){delete i.elem}),i=function(){var b=cN||cU(),c=Math.max(0,j.startTime+j.duration-b),d=1-(c/j.duration||0),e=0,f=j.tweens.length;for(;e<f;e++)j.tweens[e].run(d);return h.notifyWith(a,[j,d,c]),d<1&&f?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:p.extend({},b),opts:p.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:cN||cU(),duration:c.duration,tweens:[],createTween:function(b,c,d){var e=p.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(e),e},stop:function(b){var c=0,d=b?j.tweens.length:0;for(;c<d;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;cX(k,j.opts.specialEasing);for(;e<g;e++){d=cS[e].call(j,a,k,j.opts);if(d)return d}return cV(j,k),p.isFunction(j.opts.start)&&j.opts.start.call(a,j),p.fx.timer(p.extend(i,{anim:j,queue:j.opts.queue,elem:a})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}function cX(a,b){var c,d,e,f,g;for(c in a){d=p.camelCase(c),e=b[d],f=a[c],p.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=p.cssHooks[d];if(g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}}function cY(a,b,c){var d,e,f,g,h,i,j,k,l=this,m=a.style,n={},o=[],q=a.nodeType&&bZ(a);c.queue||(j=p._queueHooks(a,"fx"),j.unqueued==null&&(j.unqueued=0,k=j.empty.fire,j.empty.fire=function(){j.unqueued||k()}),j.unqueued++,l.always(function(){l.always(function(){j.unqueued--,p.queue(a,"fx").length||j.empty.fire()})})),a.nodeType===1&&("height"in b||"width"in b)&&(c.overflow=[m.overflow,m.overflowX,m.overflowY],p.css(a,"display")==="inline"&&p.css(a,"float")==="none"&&(!p.support.inlineBlockNeedsLayout||cc(a.nodeName)==="inline"?m.display="inline-block":m.zoom=1)),c.overflow&&(m.overflow="hidden",p.support.shrinkWrapBlocks||l.done(function(){m.overflow=c.overflow[0],m.overflowX=c.overflow[1],m.overflowY=c.overflow[2]}));for(d in b){f=b[d];if(cP.exec(f)){delete b[d];if(f===(q?"hide":"show"))continue;o.push(d)}}g=o.length;if(g){h=p._data(a,"fxshow")||p._data(a,"fxshow",{}),q?p(a).show():l.done(function(){p(a).hide()}),l.done(function(){var b;p.removeData(a,"fxshow",!0);for(b in n)p.style(a,b,n[b])});for(d=0;d<g;d++)e=o[d],i=l.createTween(e,q?h[e]:0),n[e]=h[e]||p.style(a,e),e in h||(h[e]=i.start,q&&(i.end=i.start,i.start=e==="width"||e==="height"?1:0))}}function cZ(a,b,c,d,e){return new cZ.prototype.init(a,b,c,d,e)}function c$(a,b){var c,d={height:a},e=0;b=b?1:0;for(;e<4;e+=2-b)c=bV[e],d["margin"+c]=d["padding"+c]=a;return b&&(d.opacity=d.width=a),d}function da(a){return p.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}var c,d,e=a.document,f=a.location,g=a.navigator,h=a.jQuery,i=a.$,j=Array.prototype.push,k=Array.prototype.slice,l=Array.prototype.indexOf,m=Object.prototype.toString,n=Object.prototype.hasOwnProperty,o=String.prototype.trim,p=function(a,b){return new p.fn.init(a,b,c)},q=/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,r=/\S/,s=/\s+/,t=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,u=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^[\],:{}\s]*$/,x=/(?:^|:|,)(?:\s*\[)+/g,y=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,z=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,A=/^-ms-/,B=/-([\da-z])/gi,C=function(a,b){return(b+"").toUpperCase()},D=function(){e.addEventListener?(e.removeEventListener("DOMContentLoaded",D,!1),p.ready()):e.readyState==="complete"&&(e.detachEvent("onreadystatechange",D),p.ready())},E={};p.fn=p.prototype={constructor:p,init:function(a,c,d){var f,g,h,i;if(!a)return this;if(a.nodeType)return this.context=this[0]=a,this.length=1,this;if(typeof a=="string"){a.charAt(0)==="<"&&a.charAt(a.length-1)===">"&&a.length>=3?f=[null,a,null]:f=u.exec(a);if(f&&(f[1]||!c)){if(f[1])return c=c instanceof p?c[0]:c,i=c&&c.nodeType?c.ownerDocument||c:e,a=p.parseHTML(f[1],i,!0),v.test(f[1])&&p.isPlainObject(c)&&this.attr.call(a,c,!0),p.merge(this,a);g=e.getElementById(f[2]);if(g&&g.parentNode){if(g.id!==f[2])return d.find(a);this.length=1,this[0]=g}return this.context=e,this.selector=a,this}return!c||c.jquery?(c||d).find(a):this.constructor(c).find(a)}return p.isFunction(a)?d.ready(a):(a.selector!==b&&(this.selector=a.selector,this.context=a.context),p.makeArray(a,this))},selector:"",jquery:"1.8.2",length:0,size:function(){return this.length},toArray:function(){return k.call(this)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=p.merge(this.constructor(),a);return d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")"),d},each:function(a,b){return p.each(this,a,b)},ready:function(a){return p.ready.promise().done(a),this},eq:function(a){return a=+a,a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(k.apply(this,arguments),"slice",k.call(arguments).join(","))},map:function(a){return this.pushStack(p.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:j,sort:[].sort,splice:[].splice},p.fn.init.prototype=p.fn,p.extend=p.fn.extend=function(){var a,c,d,e,f,g,h=arguments[0]||{},i=1,j=arguments.length,k=!1;typeof h=="boolean"&&(k=h,h=arguments[1]||{},i=2),typeof h!="object"&&!p.isFunction(h)&&(h={}),j===i&&(h=this,--i);for(;i<j;i++)if((a=arguments[i])!=null)for(c in a){d=h[c],e=a[c];if(h===e)continue;k&&e&&(p.isPlainObject(e)||(f=p.isArray(e)))?(f?(f=!1,g=d&&p.isArray(d)?d:[]):g=d&&p.isPlainObject(d)?d:{},h[c]=p.extend(k,g,e)):e!==b&&(h[c]=e)}return h},p.extend({noConflict:function(b){return a.$===p&&(a.$=i),b&&a.jQuery===p&&(a.jQuery=h),p},isReady:!1,readyWait:1,holdReady:function(a){a?p.readyWait++:p.ready(!0)},ready:function(a){if(a===!0?--p.readyWait:p.isReady)return;if(!e.body)return setTimeout(p.ready,1);p.isReady=!0;if(a!==!0&&--p.readyWait>0)return;d.resolveWith(e,[p]),p.fn.trigger&&p(e).trigger("ready").off("ready")},isFunction:function(a){return p.type(a)==="function"},isArray:Array.isArray||function(a){return p.type(a)==="array"},isWindow:function(a){return a!=null&&a==a.window},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):E[m.call(a)]||"object"},isPlainObject:function(a){if(!a||p.type(a)!=="object"||a.nodeType||p.isWindow(a))return!1;try{if(a.constructor&&!n.call(a,"constructor")&&!n.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||n.call(a,d)},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},error:function(a){throw new Error(a)},parseHTML:function(a,b,c){var d;return!a||typeof a!="string"?null:(typeof b=="boolean"&&(c=b,b=0),b=b||e,(d=v.exec(a))?[b.createElement(d[1])]:(d=p.buildFragment([a],b,c?null:[]),p.merge([],(d.cacheable?p.clone(d.fragment):d.fragment).childNodes)))},parseJSON:function(b){if(!b||typeof b!="string")return null;b=p.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(w.test(b.replace(y,"@").replace(z,"]").replace(x,"")))return(new Function("return "+b))();p.error("Invalid JSON: "+b)},parseXML:function(c){var d,e;if(!c||typeof c!="string")return null;try{a.DOMParser?(e=new DOMParser,d=e.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(f){d=b}return(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&p.error("Invalid XML: "+c),d},noop:function(){},globalEval:function(b){b&&r.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(A,"ms-").replace(B,C)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,c,d){var e,f=0,g=a.length,h=g===b||p.isFunction(a);if(d){if(h){for(e in a)if(c.apply(a[e],d)===!1)break}else for(;f<g;)if(c.apply(a[f++],d)===!1)break}else if(h){for(e in a)if(c.call(a[e],e,a[e])===!1)break}else for(;f<g;)if(c.call(a[f],f,a[f++])===!1)break;return a},trim:o&&!o.call(" ")?function(a){return a==null?"":o.call(a)}:function(a){return a==null?"":(a+"").replace(t,"")},makeArray:function(a,b){var c,d=b||[];return a!=null&&(c=p.type(a),a.length==null||c==="string"||c==="function"||c==="regexp"||p.isWindow(a)?j.call(d,a):p.merge(d,a)),d},inArray:function(a,b,c){var d;if(b){if(l)return l.call(b,a,c);d=b.length,c=c?c<0?Math.max(0,d+c):c:0;for(;c<d;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,c){var d=c.length,e=a.length,f=0;if(typeof d=="number")for(;f<d;f++)a[e++]=c[f];else while(c[f]!==b)a[e++]=c[f++];return a.length=e,a},grep:function(a,b,c){var d,e=[],f=0,g=a.length;c=!!c;for(;f<g;f++)d=!!b(a[f],f),c!==d&&e.push(a[f]);return e},map:function(a,c,d){var e,f,g=[],h=0,i=a.length,j=a instanceof p||i!==b&&typeof i=="number"&&(i>0&&a[0]&&a[i-1]||i===0||p.isArray(a));if(j)for(;h<i;h++)e=c(a[h],h,d),e!=null&&(g[g.length]=e);else for(f in a)e=c(a[f],f,d),e!=null&&(g[g.length]=e);return g.concat.apply([],g)},guid:1,proxy:function(a,c){var d,e,f;return typeof c=="string"&&(d=a[c],c=a,a=d),p.isFunction(a)?(e=k.call(arguments,2),f=function(){return a.apply(c,e.concat(k.call(arguments)))},f.guid=a.guid=a.guid||p.guid++,f):b},access:function(a,c,d,e,f,g,h){var i,j=d==null,k=0,l=a.length;if(d&&typeof d=="object"){for(k in d)p.access(a,c,k,d[k],1,g,e);f=1}else if(e!==b){i=h===b&&p.isFunction(e),j&&(i?(i=c,c=function(a,b,c){return i.call(p(a),c)}):(c.call(a,e),c=null));if(c)for(;k<l;k++)c(a[k],d,i?e.call(a[k],k,c(a[k],d)):e,h);f=1}return f?a:j?c.call(a):l?c(a[0],d):g},now:function(){return(new Date).getTime()}}),p.ready.promise=function(b){if(!d){d=p.Deferred();if(e.readyState==="complete")setTimeout(p.ready,1);else if(e.addEventListener)e.addEventListener("DOMContentLoaded",D,!1),a.addEventListener("load",p.ready,!1);else{e.attachEvent("onreadystatechange",D),a.attachEvent("onload",p.ready);var c=!1;try{c=a.frameElement==null&&e.documentElement}catch(f){}c&&c.doScroll&&function g(){if(!p.isReady){try{c.doScroll("left")}catch(a){return setTimeout(g,50)}p.ready()}}()}}return d.promise(b)},p.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){E["[object "+b+"]"]=b.toLowerCase()}),c=p(e);var F={};p.Callbacks=function(a){a=typeof a=="string"?F[a]||G(a):p.extend({},a);var c,d,e,f,g,h,i=[],j=!a.once&&[],k=function(b){c=a.memory&&b,d=!0,h=f||0,f=0,g=i.length,e=!0;for(;i&&h<g;h++)if(i[h].apply(b[0],b[1])===!1&&a.stopOnFalse){c=!1;break}e=!1,i&&(j?j.length&&k(j.shift()):c?i=[]:l.disable())},l={add:function(){if(i){var b=i.length;(function d(b){p.each(b,function(b,c){var e=p.type(c);e==="function"&&(!a.unique||!l.has(c))?i.push(c):c&&c.length&&e!=="string"&&d(c)})})(arguments),e?g=i.length:c&&(f=b,k(c))}return this},remove:function(){return i&&p.each(arguments,function(a,b){var c;while((c=p.inArray(b,i,c))>-1)i.splice(c,1),e&&(c<=g&&g--,c<=h&&h--)}),this},has:function(a){return p.inArray(a,i)>-1},empty:function(){return i=[],this},disable:function(){return i=j=c=b,this},disabled:function(){return!i},lock:function(){return j=b,c||l.disable(),this},locked:function(){return!j},fireWith:function(a,b){return b=b||[],b=[a,b.slice?b.slice():b],i&&(!d||j)&&(e?j.push(b):k(b)),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!d}};return l},p.extend({Deferred:function(a){var b=[["resolve","done",p.Callbacks("once memory"),"resolved"],["reject","fail",p.Callbacks("once memory"),"rejected"],["notify","progress",p.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return p.Deferred(function(c){p.each(b,function(b,d){var f=d[0],g=a[b];e[d[1]](p.isFunction(g)?function(){var a=g.apply(this,arguments);a&&p.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f+"With"](this===e?c:this,[a])}:c[f])}),a=null}).promise()},promise:function(a){return a!=null?p.extend(a,d):d}},e={};return d.pipe=d.then,p.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[a^1][2].disable,b[2][2].lock),e[f[0]]=g.fire,e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=k.call(arguments),d=c.length,e=d!==1||a&&p.isFunction(a.promise)?d:0,f=e===1?a:p.Deferred(),g=function(a,b,c){return function(d){b[a]=this,c[a]=arguments.length>1?k.call(arguments):d,c===h?f.notifyWith(b,c):--e||f.resolveWith(b,c)}},h,i,j;if(d>1){h=new Array(d),i=new Array(d),j=new Array(d);for(;b<d;b++)c[b]&&p.isFunction(c[b].promise)?c[b].promise().done(g(b,j,c)).fail(f.reject).progress(g(b,i,h)):--e}return e||f.resolveWith(j,c),f.promise()}}),p.support=function(){var b,c,d,f,g,h,i,j,k,l,m,n=e.createElement("div");n.setAttribute("className","t"),n.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",c=n.getElementsByTagName("*"),d=n.getElementsByTagName("a")[0],d.style.cssText="top:1px;float:left;opacity:.5";if(!c||!c.length)return{};f=e.createElement("select"),g=f.appendChild(e.createElement("option")),h=n.getElementsByTagName("input")[0],b={leadingWhitespace:n.firstChild.nodeType===3,tbody:!n.getElementsByTagName("tbody").length,htmlSerialize:!!n.getElementsByTagName("link").length,style:/top/.test(d.getAttribute("style")),hrefNormalized:d.getAttribute("href")==="/a",opacity:/^0.5/.test(d.style.opacity),cssFloat:!!d.style.cssFloat,checkOn:h.value==="on",optSelected:g.selected,getSetAttribute:n.className!=="t",enctype:!!e.createElement("form").enctype,html5Clone:e.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>",boxModel:e.compatMode==="CSS1Compat",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},h.checked=!0,b.noCloneChecked=h.cloneNode(!0).checked,f.disabled=!0,b.optDisabled=!g.disabled;try{delete n.test}catch(o){b.deleteExpando=!1}!n.addEventListener&&n.attachEvent&&n.fireEvent&&(n.attachEvent("onclick",m=function(){b.noCloneEvent=!1}),n.cloneNode(!0).fireEvent("onclick"),n.detachEvent("onclick",m)),h=e.createElement("input"),h.value="t",h.setAttribute("type","radio"),b.radioValue=h.value==="t",h.setAttribute("checked","checked"),h.setAttribute("name","t"),n.appendChild(h),i=e.createDocumentFragment(),i.appendChild(n.lastChild),b.checkClone=i.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=h.checked,i.removeChild(h),i.appendChild(n);if(n.attachEvent)for(k in{submit:!0,change:!0,focusin:!0})j="on"+k,l=j in n,l||(n.setAttribute(j,"return;"),l=typeof n[j]=="function"),b[k+"Bubbles"]=l;return p(function(){var c,d,f,g,h="padding:0;margin:0;border:0;display:block;overflow:hidden;",i=e.getElementsByTagName("body")[0];if(!i)return;c=e.createElement("div"),c.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",i.insertBefore(c,i.firstChild),d=e.createElement("div"),c.appendChild(d),d.innerHTML="<table><tr><td></td><td>t</td></tr></table>",f=d.getElementsByTagName("td"),f[0].style.cssText="padding:0;margin:0;border:0;display:none",l=f[0].offsetHeight===0,f[0].style.display="",f[1].style.display="none",b.reliableHiddenOffsets=l&&f[0].offsetHeight===0,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",b.boxSizing=d.offsetWidth===4,b.doesNotIncludeMarginInBodyOffset=i.offsetTop!==1,a.getComputedStyle&&(b.pixelPosition=(a.getComputedStyle(d,null)||{}).top!=="1%",b.boxSizingReliable=(a.getComputedStyle(d,null)||{width:"4px"}).width==="4px",g=e.createElement("div"),g.style.cssText=d.style.cssText=h,g.style.marginRight=g.style.width="0",d.style.width="1px",d.appendChild(g),b.reliableMarginRight=!parseFloat((a.getComputedStyle(g,null)||{}).marginRight)),typeof d.style.zoom!="undefined"&&(d.innerHTML="",d.style.cssText=h+"width:1px;padding:1px;display:inline;zoom:1",b.inlineBlockNeedsLayout=d.offsetWidth===3,d.style.display="block",d.style.overflow="visible",d.innerHTML="<div></div>",d.firstChild.style.width="5px",b.shrinkWrapBlocks=d.offsetWidth!==3,c.style.zoom=1),i.removeChild(c),c=d=f=g=null}),i.removeChild(n),c=d=f=g=h=i=n=null,b}();var H=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,I=/([A-Z])/g;p.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(p.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){return a=a.nodeType?p.cache[a[p.expando]]:a[p.expando],!!a&&!K(a)},data:function(a,c,d,e){if(!p.acceptData(a))return;var f,g,h=p.expando,i=typeof c=="string",j=a.nodeType,k=j?p.cache:a,l=j?a[h]:a[h]&&h;if((!l||!k[l]||!e&&!k[l].data)&&i&&d===b)return;l||(j?a[h]=l=p.deletedIds.pop()||p.guid++:l=h),k[l]||(k[l]={},j||(k[l].toJSON=p.noop));if(typeof c=="object"||typeof c=="function")e?k[l]=p.extend(k[l],c):k[l].data=p.extend(k[l].data,c);return f=k[l],e||(f.data||(f.data={}),f=f.data),d!==b&&(f[p.camelCase(c)]=d),i?(g=f[c],g==null&&(g=f[p.camelCase(c)])):g=f,g},removeData:function(a,b,c){if(!p.acceptData(a))return;var d,e,f,g=a.nodeType,h=g?p.cache:a,i=g?a[p.expando]:p.expando;if(!h[i])return;if(b){d=c?h[i]:h[i].data;if(d){p.isArray(b)||(b in d?b=[b]:(b=p.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,f=b.length;e<f;e++)delete d[b[e]];if(!(c?K:p.isEmptyObject)(d))return}}if(!c){delete h[i].data;if(!K(h[i]))return}g?p.cleanData([a],!0):p.support.deleteExpando||h!=h.window?delete h[i]:h[i]=null},_data:function(a,b,c){return p.data(a,b,c,!0)},acceptData:function(a){var b=a.nodeName&&p.noData[a.nodeName.toLowerCase()];return!b||b!==!0&&a.getAttribute("classid")===b}}),p.fn.extend({data:function(a,c){var d,e,f,g,h,i=this[0],j=0,k=null;if(a===b){if(this.length){k=p.data(i);if(i.nodeType===1&&!p._data(i,"parsedAttrs")){f=i.attributes;for(h=f.length;j<h;j++)g=f[j].name,g.indexOf("data-")||(g=p.camelCase(g.substring(5)),J(i,g,k[g]));p._data(i,"parsedAttrs",!0)}}return k}return typeof a=="object"?this.each(function(){p.data(this,a)}):(d=a.split(".",2),d[1]=d[1]?"."+d[1]:"",e=d[1]+"!",p.access(this,function(c){if(c===b)return k=this.triggerHandler("getData"+e,[d[0]]),k===b&&i&&(k=p.data(i,a),k=J(i,a,k)),k===b&&d[1]?this.data(d[0]):k;d[1]=c,this.each(function(){var b=p(this);b.triggerHandler("setData"+e,d),p.data(this,a,c),b.triggerHandler("changeData"+e,d)})},null,c,arguments.length>1,null,!1))},removeData:function(a){return this.each(function(){p.removeData(this,a)})}}),p.extend({queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=p._data(a,b),c&&(!d||p.isArray(c)?d=p._data(a,b,p.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){b=b||"fx";var c=p.queue(a,b),d=c.length,e=c.shift(),f=p._queueHooks(a,b),g=function(){p.dequeue(a,b)};e==="inprogress"&&(e=c.shift(),d--),e&&(b==="fx"&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return p._data(a,c)||p._data(a,c,{empty:p.Callbacks("once memory").add(function(){p.removeData(a,b+"queue",!0),p.removeData(a,c,!0)})})}}),p.fn.extend({queue:function(a,c){var d=2;return typeof a!="string"&&(c=a,a="fx",d--),arguments.length<d?p.queue(this[0],a):c===b?this:this.each(function(){var b=p.queue(this,a,c);p._queueHooks(this,a),a==="fx"&&b[0]!=="inprogress"&&p.dequeue(this,a)})},dequeue:function(a){return this.each(function(){p.dequeue(this,a)})},delay:function(a,b){return a=p.fx?p.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,c){var d,e=1,f=p.Deferred(),g=this,h=this.length,i=function(){--e||f.resolveWith(g,[g])};typeof a!="string"&&(c=a,a=b),a=a||"fx";while(h--)d=p._data(g[h],a+"queueHooks"),d&&d.empty&&(e++,d.empty.add(i));return i(),f.promise(c)}});var L,M,N,O=/[\t\r\n]/g,P=/\r/g,Q=/^(?:button|input)$/i,R=/^(?:button|input|object|select|textarea)$/i,S=/^a(?:rea|)$/i,T=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,U=p.support.getSetAttribute;p.fn.extend({attr:function(a,b){return p.access(this,p.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){p.removeAttr(this,a)})},prop:function(a,b){return p.access(this,p.prop,a,b,arguments.length>1)},removeProp:function(a){return a=p.propFix[a]||a,this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,f,g,h;if(p.isFunction(a))return this.each(function(b){p(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(s);for(c=0,d=this.length;c<d;c++){e=this[c];if(e.nodeType===1)if(!e.className&&b.length===1)e.className=a;else{f=" "+e.className+" ";for(g=0,h=b.length;g<h;g++)f.indexOf(" "+b[g]+" ")<0&&(f+=b[g]+" ");e.className=p.trim(f)}}}return this},removeClass:function(a){var c,d,e,f,g,h,i;if(p.isFunction(a))return this.each(function(b){p(this).removeClass(a.call(this,b,this.className))});if(a&&typeof a=="string"||a===b){c=(a||"").split(s);for(h=0,i=this.length;h<i;h++){e=this[h];if(e.nodeType===1&&e.className){d=(" "+e.className+" ").replace(O," ");for(f=0,g=c.length;f<g;f++)while(d.indexOf(" "+c[f]+" ")>=0)d=d.replace(" "+c[f]+" "," ");e.className=a?p.trim(d):""}}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";return p.isFunction(a)?this.each(function(c){p(this).toggleClass(a.call(this,c,this.className,b),b)}):this.each(function(){if(c==="string"){var e,f=0,g=p(this),h=b,i=a.split(s);while(e=i[f++])h=d?h:!g.hasClass(e),g[h?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&p._data(this,"__className__",this.className),this.className=this.className||a===!1?"":p._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ",c=0,d=this.length;for(;c<d;c++)if(this[c].nodeType===1&&(" "+this[c].className+" ").replace(O," ").indexOf(b)>=0)return!0;return!1},val:function(a){var c,d,e,f=this[0];if(!arguments.length){if(f)return c=p.valHooks[f.type]||p.valHooks[f.nodeName.toLowerCase()],c&&"get"in c&&(d=c.get(f,"value"))!==b?d:(d=f.value,typeof d=="string"?d.replace(P,""):d==null?"":d);return}return e=p.isFunction(a),this.each(function(d){var f,g=p(this);if(this.nodeType!==1)return;e?f=a.call(this,d,g.val()):f=a,f==null?f="":typeof f=="number"?f+="":p.isArray(f)&&(f=p.map(f,function(a){return a==null?"":a+""})),c=p.valHooks[this.type]||p.valHooks[this.nodeName.toLowerCase()];if(!c||!("set"in c)||c.set(this,f,"value")===b)this.value=f})}}),p.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,f=a.selectedIndex,g=[],h=a.options,i=a.type==="select-one";if(f<0)return null;c=i?f:0,d=i?f+1:h.length;for(;c<d;c++){e=h[c];if(e.selected&&(p.support.optDisabled?!e.disabled:e.getAttribute("disabled")===null)&&(!e.parentNode.disabled||!p.nodeName(e.parentNode,"optgroup"))){b=p(e).val();if(i)return b;g.push(b)}}return i&&!g.length&&h.length?p(h[f]).val():g},set:function(a,b){var c=p.makeArray(b);return p(a).find("option").each(function(){this.selected=p.inArray(p(this).val(),c)>=0}),c.length||(a.selectedIndex=-1),c}}},attrFn:{},attr:function(a,c,d,e){var f,g,h,i=a.nodeType;if(!a||i===3||i===8||i===2)return;if(e&&p.isFunction(p.fn[c]))return p(a)[c](d);if(typeof a.getAttribute=="undefined")return p.prop(a,c,d);h=i!==1||!p.isXMLDoc(a),h&&(c=c.toLowerCase(),g=p.attrHooks[c]||(T.test(c)?M:L));if(d!==b){if(d===null){p.removeAttr(a,c);return}return g&&"set"in g&&h&&(f=g.set(a,d,c))!==b?f:(a.setAttribute(c,d+""),d)}return g&&"get"in g&&h&&(f=g.get(a,c))!==null?f:(f=a.getAttribute(c),f===null?b:f)},removeAttr:function(a,b){var c,d,e,f,g=0;if(b&&a.nodeType===1){d=b.split(s);for(;g<d.length;g++)e=d[g],e&&(c=p.propFix[e]||e,f=T.test(e),f||p.attr(a,e,""),a.removeAttribute(U?e:c),f&&c in a&&(a[c]=!1))}},attrHooks:{type:{set:function(a,b){if(Q.test(a.nodeName)&&a.parentNode)p.error("type property can't be changed");else if(!p.support.radioValue&&b==="radio"&&p.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}},value:{get:function(a,b){return L&&p.nodeName(a,"button")?L.get(a,b):b in a?a.value:null},set:function(a,b,c){if(L&&p.nodeName(a,"button"))return L.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e,f,g,h=a.nodeType;if(!a||h===3||h===8||h===2)return;return g=h!==1||!p.isXMLDoc(a),g&&(c=p.propFix[c]||c,f=p.propHooks[c]),d!==b?f&&"set"in f&&(e=f.set(a,d,c))!==b?e:a[c]=d:f&&"get"in f&&(e=f.get(a,c))!==null?e:a[c]},propHooks:{tabIndex:{get:function(a){var c=a.getAttributeNode("tabindex");return c&&c.specified?parseInt(c.value,10):R.test(a.nodeName)||S.test(a.nodeName)&&a.href?0:b}}}}),M={get:function(a,c){var d,e=p.prop(a,c);return e===!0||typeof e!="boolean"&&(d=a.getAttributeNode(c))&&d.nodeValue!==!1?c.toLowerCase():b},set:function(a,b,c){var d;return b===!1?p.removeAttr(a,c):(d=p.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase())),c}},U||(N={name:!0,id:!0,coords:!0},L=p.valHooks.button={get:function(a,c){var d;return d=a.getAttributeNode(c),d&&(N[c]?d.value!=="":d.specified)?d.value:b},set:function(a,b,c){var d=a.getAttributeNode(c);return d||(d=e.createAttribute(c),a.setAttributeNode(d)),d.value=b+""}},p.each(["width","height"],function(a,b){p.attrHooks[b]=p.extend(p.attrHooks[b],{set:function(a,c){if(c==="")return a.setAttribute(b,"auto"),c}})}),p.attrHooks.contenteditable={get:L.get,set:function(a,b,c){b===""&&(b="false"),L.set(a,b,c)}}),p.support.hrefNormalized||p.each(["href","src","width","height"],function(a,c){p.attrHooks[c]=p.extend(p.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),p.support.style||(p.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=b+""}}),p.support.optSelected||(p.propHooks.selected=p.extend(p.propHooks.selected,{get:function(a){var b=a.parentNode;return b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex),null}})),p.support.enctype||(p.propFix.enctype="encoding"),p.support.checkOn||p.each(["radio","checkbox"],function(){p.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),p.each(["radio","checkbox"],function(){p.valHooks[this]=p.extend(p.valHooks[this],{set:function(a,b){if(p.isArray(b))return a.checked=p.inArray(p(a).val(),b)>=0}})});var V=/^(?:textarea|input|select)$/i,W=/^([^\.]*|)(?:\.(.+)|)$/,X=/(?:^|\s)hover(\.\S+|)\b/,Y=/^key/,Z=/^(?:mouse|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=function(a){return p.event.special.hover?a:a.replace(X,"mouseenter$1 mouseleave$1")};p.event={add:function(a,c,d,e,f){var g,h,i,j,k,l,m,n,o,q,r;if(a.nodeType===3||a.nodeType===8||!c||!d||!(g=p._data(a)))return;d.handler&&(o=d,d=o.handler,f=o.selector),d.guid||(d.guid=p.guid++),i=g.events,i||(g.events=i={}),h=g.handle,h||(g.handle=h=function(a){return typeof p!="undefined"&&(!a||p.event.triggered!==a.type)?p.event.dispatch.apply(h.elem,arguments):b},h.elem=a),c=p.trim(_(c)).split(" ");for(j=0;j<c.length;j++){k=W.exec(c[j])||[],l=k[1],m=(k[2]||"").split(".").sort(),r=p.event.special[l]||{},l=(f?r.delegateType:r.bindType)||l,r=p.event.special[l]||{},n=p.extend({type:l,origType:k[1],data:e,handler:d,guid:d.guid,selector:f,needsContext:f&&p.expr.match.needsContext.test(f),namespace:m.join(".")},o),q=i[l];if(!q){q=i[l]=[],q.delegateCount=0;if(!r.setup||r.setup.call(a,e,m,h)===!1)a.addEventListener?a.addEventListener(l,h,!1):a.attachEvent&&a.attachEvent("on"+l,h)}r.add&&(r.add.call(a,n),n.handler.guid||(n.handler.guid=d.guid)),f?q.splice(q.delegateCount++,0,n):q.push(n),p.event.global[l]=!0}a=null},global:{},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,q,r=p.hasData(a)&&p._data(a);if(!r||!(m=r.events))return;b=p.trim(_(b||"")).split(" ");for(f=0;f<b.length;f++){g=W.exec(b[f])||[],h=i=g[1],j=g[2];if(!h){for(h in m)p.event.remove(a,h+b[f],c,d,!0);continue}n=p.event.special[h]||{},h=(d?n.delegateType:n.bindType)||h,o=m[h]||[],k=o.length,j=j?new RegExp("(^|\\.)"+j.split(".").sort().join("\\.(?:.*\\.|)")+"(\\.|$)"):null;for(l=0;l<o.length;l++)q=o[l],(e||i===q.origType)&&(!c||c.guid===q.guid)&&(!j||j.test(q.namespace))&&(!d||d===q.selector||d==="**"&&q.selector)&&(o.splice(l--,1),q.selector&&o.delegateCount--,n.remove&&n.remove.call(a,q));o.length===0&&k!==o.length&&((!n.teardown||n.teardown.call(a,j,r.handle)===!1)&&p.removeEvent(a,h,r.handle),delete m[h])}p.isEmptyObject(m)&&(delete r.handle,p.removeData(a,"events",!0))},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,f,g){if(!f||f.nodeType!==3&&f.nodeType!==8){var h,i,j,k,l,m,n,o,q,r,s=c.type||c,t=[];if($.test(s+p.event.triggered))return;s.indexOf("!")>=0&&(s=s.slice(0,-1),i=!0),s.indexOf(".")>=0&&(t=s.split("."),s=t.shift(),t.sort());if((!f||p.event.customEvent[s])&&!p.event.global[s])return;c=typeof c=="object"?c[p.expando]?c:new p.Event(s,c):new p.Event(s),c.type=s,c.isTrigger=!0,c.exclusive=i,c.namespace=t.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+t.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,m=s.indexOf(":")<0?"on"+s:"";if(!f){h=p.cache;for(j in h)h[j].events&&h[j].events[s]&&p.event.trigger(c,d,h[j].handle.elem,!0);return}c.result=b,c.target||(c.target=f),d=d!=null?p.makeArray(d):[],d.unshift(c),n=p.event.special[s]||{};if(n.trigger&&n.trigger.apply(f,d)===!1)return;q=[[f,n.bindType||s]];if(!g&&!n.noBubble&&!p.isWindow(f)){r=n.delegateType||s,k=$.test(r+s)?f:f.parentNode;for(l=f;k;k=k.parentNode)q.push([k,r]),l=k;l===(f.ownerDocument||e)&&q.push([l.defaultView||l.parentWindow||a,r])}for(j=0;j<q.length&&!c.isPropagationStopped();j++)k=q[j][0],c.type=q[j][1],o=(p._data(k,"events")||{})[c.type]&&p._data(k,"handle"),o&&o.apply(k,d),o=m&&k[m],o&&p.acceptData(k)&&o.apply&&o.apply(k,d)===!1&&c.preventDefault();return c.type=s,!g&&!c.isDefaultPrevented()&&(!n._default||n._default.apply(f.ownerDocument,d)===!1)&&(s!=="click"||!p.nodeName(f,"a"))&&p.acceptData(f)&&m&&f[s]&&(s!=="focus"&&s!=="blur"||c.target.offsetWidth!==0)&&!p.isWindow(f)&&(l=f[m],l&&(f[m]=null),p.event.triggered=s,f[s](),p.event.triggered=b,l&&(f[m]=l)),c.result}return},dispatch:function(c){c=p.event.fix(c||a.event);var d,e,f,g,h,i,j,l,m,n,o=(p._data(this,"events")||{})[c.type]||[],q=o.delegateCount,r=k.call(arguments),s=!c.exclusive&&!c.namespace,t=p.event.special[c.type]||{},u=[];r[0]=c,c.delegateTarget=this;if(t.preDispatch&&t.preDispatch.call(this,c)===!1)return;if(q&&(!c.button||c.type!=="click"))for(f=c.target;f!=this;f=f.parentNode||this)if(f.disabled!==!0||c.type!=="click"){h={},j=[];for(d=0;d<q;d++)l=o[d],m=l.selector,h[m]===b&&(h[m]=l.needsContext?p(m,this).index(f)>=0:p.find(m,this,null,[f]).length),h[m]&&j.push(l);j.length&&u.push({elem:f,matches:j})}o.length>q&&u.push({elem:this,matches:o.slice(q)});for(d=0;d<u.length&&!c.isPropagationStopped();d++){i=u[d],c.currentTarget=i.elem;for(e=0;e<i.matches.length&&!c.isImmediatePropagationStopped();e++){l=i.matches[e];if(s||!c.namespace&&!l.namespace||c.namespace_re&&c.namespace_re.test(l.namespace))c.data=l.data,c.handleObj=l,g=((p.event.special[l.origType]||{}).handle||l.handler).apply(i.elem,r),g!==b&&(c.result=g,g===!1&&(c.preventDefault(),c.stopPropagation()))}}return t.postDispatch&&t.postDispatch.call(this,c),c.result},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return a.which==null&&(a.which=b.charCode!=null?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,c){var d,f,g,h=c.button,i=c.fromElement;return a.pageX==null&&c.clientX!=null&&(d=a.target.ownerDocument||e,f=d.documentElement,g=d.body,a.pageX=c.clientX+(f&&f.scrollLeft||g&&g.scrollLeft||0)-(f&&f.clientLeft||g&&g.clientLeft||0),a.pageY=c.clientY+(f&&f.scrollTop||g&&g.scrollTop||0)-(f&&f.clientTop||g&&g.clientTop||0)),!a.relatedTarget&&i&&(a.relatedTarget=i===a.target?c.toElement:i),!a.which&&h!==b&&(a.which=h&1?1:h&2?3:h&4?2:0),a}},fix:function(a){if(a[p.expando])return a;var b,c,d=a,f=p.event.fixHooks[a.type]||{},g=f.props?this.props.concat(f.props):this.props;a=p.Event(d);for(b=g.length;b;)c=g[--b],a[c]=d[c];return a.target||(a.target=d.srcElement||e),a.target.nodeType===3&&(a.target=a.target.parentNode),a.metaKey=!!a.metaKey,f.filter?f.filter(a,d):a},special:{load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(a,b,c){p.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}},simulate:function(a,b,c,d){var e=p.extend(new p.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?p.event.trigger(e,null,b):p.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},p.event.handle=p.event.dispatch,p.removeEvent=e.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){var d="on"+b;a.detachEvent&&(typeof a[d]=="undefined"&&(a[d]=null),a.detachEvent(d,c))},p.Event=function(a,b){if(this instanceof p.Event)a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?bb:ba):this.type=a,b&&p.extend(this,b),this.timeStamp=a&&a.timeStamp||p.now(),this[p.expando]=!0;else return new p.Event(a,b)},p.Event.prototype={preventDefault:function(){this.isDefaultPrevented=bb;var a=this.originalEvent;if(!a)return;a.preventDefault?a.preventDefault():a.returnValue=!1},stopPropagation:function(){this.isPropagationStopped=bb;var a=this.originalEvent;if(!a)return;a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=bb,this.stopPropagation()},isDefaultPrevented:ba,isPropagationStopped:ba,isImmediatePropagationStopped:ba},p.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){p.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj,g=f.selector;if(!e||e!==d&&!p.contains(d,e))a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b;return c}}}),p.support.submitBubbles||(p.event.special.submit={setup:function(){if(p.nodeName(this,"form"))return!1;p.event.add(this,"click._submit keypress._submit",function(a){var c=a.target,d=p.nodeName(c,"input")||p.nodeName(c,"button")?c.form:b;d&&!p._data(d,"_submit_attached")&&(p.event.add(d,"submit._submit",function(a){a._submit_bubble=!0}),p._data(d,"_submit_attached",!0))})},postDispatch:function(a){a._submit_bubble&&(delete a._submit_bubble,this.parentNode&&!a.isTrigger&&p.event.simulate("submit",this.parentNode,a,!0))},teardown:function(){if(p.nodeName(this,"form"))return!1;p.event.remove(this,"._submit")}}),p.support.changeBubbles||(p.event.special.change={setup:function(){if(V.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio")p.event.add(this,"propertychange._change",function(a){a.originalEvent.propertyName==="checked"&&(this._just_changed=!0)}),p.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1),p.event.simulate("change",this,a,!0)});return!1}p.event.add(this,"beforeactivate._change",function(a){var b=a.target;V.test(b.nodeName)&&!p._data(b,"_change_attached")&&(p.event.add(b,"change._change",function(a){this.parentNode&&!a.isSimulated&&!a.isTrigger&&p.event.simulate("change",this.parentNode,a,!0)}),p._data(b,"_change_attached",!0))})},handle:function(a){var b=a.target;if(this!==b||a.isSimulated||a.isTrigger||b.type!=="radio"&&b.type!=="checkbox")return a.handleObj.handler.apply(this,arguments)},teardown:function(){return p.event.remove(this,"._change"),!V.test(this.nodeName)}}),p.support.focusinBubbles||p.each({focus:"focusin",blur:"focusout"},function(a,b){var c=0,d=function(a){p.event.simulate(b,a.target,p.event.fix(a),!0)};p.event.special[b]={setup:function(){c++===0&&e.addEventListener(a,d,!0)},teardown:function(){--c===0&&e.removeEventListener(a,d,!0)}}}),p.fn.extend({on:function(a,c,d,e,f){var g,h;if(typeof a=="object"){typeof c!="string"&&(d=d||c,c=b);for(h in a)this.on(h,c,d,a[h],f);return this}d==null&&e==null?(e=c,d=c=b):e==null&&(typeof c=="string"?(e=d,d=b):(e=d,d=c,c=b));if(e===!1)e=ba;else if(!e)return this;return f===1&&(g=e,e=function(a){return p().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=p.guid++)),this.each(function(){p.event.add(this,a,e,d,c)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,c,d){var e,f;if(a&&a.preventDefault&&a.handleObj)return e=a.handleObj,p(a.delegateTarget).off(e.namespace?e.origType+"."+e.namespace:e.origType,e.selector,e.handler),this;if(typeof a=="object"){for(f in a)this.off(f,c,a[f]);return this}if(c===!1||typeof c=="function")d=c,c=b;return d===!1&&(d=ba),this.each(function(){p.event.remove(this,a,d,c)})},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},live:function(a,b,c){return p(this.context).on(a,this.selector,b,c),this},die:function(a,b){return p(this.context).off(a,this.selector||"**",b),this},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return arguments.length===1?this.off(a,"**"):this.off(b,a||"**",c)},trigger:function(a,b){return this.each(function(){p.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0])return p.event.trigger(a,b,this[0],!0)},toggle:function(a){var b=arguments,c=a.guid||p.guid++,d=0,e=function(c){var e=(p._data(this,"lastToggle"+a.guid)||0)%d;return p._data(this,"lastToggle"+a.guid,e+1),c.preventDefault(),b[e].apply(this,arguments)||!1};e.guid=c;while(d<b.length)b[d++].guid=c;return this.click(e)},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),p.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){p.fn[b]=function(a,c){return c==null&&(c=a,a=null),arguments.length>0?this.on(b,null,a,c):this.trigger(b)},Y.test(b)&&(p.event.fixHooks[b]=p.event.keyHooks),Z.test(b)&&(p.event.fixHooks[b]=p.event.mouseHooks)}),function(a,b){function bc(a,b,c,d){c=c||[],b=b||r;var e,f,i,j,k=b.nodeType;if(!a||typeof a!="string")return c;if(k!==1&&k!==9)return[];i=g(b);if(!i&&!d)if(e=P.exec(a))if(j=e[1]){if(k===9){f=b.getElementById(j);if(!f||!f.parentNode)return c;if(f.id===j)return c.push(f),c}else if(b.ownerDocument&&(f=b.ownerDocument.getElementById(j))&&h(b,f)&&f.id===j)return c.push(f),c}else{if(e[2])return w.apply(c,x.call(b.getElementsByTagName(a),0)),c;if((j=e[3])&&_&&b.getElementsByClassName)return w.apply(c,x.call(b.getElementsByClassName(j),0)),c}return bp(a.replace(L,"$1"),b,c,d,i)}function bd(a){return function(b){var c=b.nodeName.toLowerCase();return c==="input"&&b.type===a}}function be(a){return function(b){var c=b.nodeName.toLowerCase();return(c==="input"||c==="button")&&b.type===a}}function bf(a){return z(function(b){return b=+b,z(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function bg(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}function bh(a,b){var c,d,f,g,h,i,j,k=C[o][a];if(k)return b?0:k.slice(0);h=a,i=[],j=e.preFilter;while(h){if(!c||(d=M.exec(h)))d&&(h=h.slice(d[0].length)),i.push(f=[]);c=!1;if(d=N.exec(h))f.push(c=new q(d.shift())),h=h.slice(c.length),c.type=d[0].replace(L," ");for(g in e.filter)(d=W[g].exec(h))&&(!j[g]||(d=j[g](d,r,!0)))&&(f.push(c=new q(d.shift())),h=h.slice(c.length),c.type=g,c.matches=d);if(!c)break}return b?h.length:h?bc.error(a):C(a,i).slice(0)}function bi(a,b,d){var e=b.dir,f=d&&b.dir==="parentNode",g=u++;return b.first?function(b,c,d){while(b=b[e])if(f||b.nodeType===1)return a(b,c,d)}:function(b,d,h){if(!h){var i,j=t+" "+g+" ",k=j+c;while(b=b[e])if(f||b.nodeType===1){if((i=b[o])===k)return b.sizset;if(typeof i=="string"&&i.indexOf(j)===0){if(b.sizset)return b}else{b[o]=k;if(a(b,d,h))return b.sizset=!0,b;b.sizset=!1}}}else while(b=b[e])if(f||b.nodeType===1)if(a(b,d,h))return b}}function bj(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function bk(a,b,c,d,e){var f,g=[],h=0,i=a.length,j=b!=null;for(;h<i;h++)if(f=a[h])if(!c||c(f,d,e))g.push(f),j&&b.push(h);return g}function bl(a,b,c,d,e,f){return d&&!d[o]&&(d=bl(d)),e&&!e[o]&&(e=bl(e,f)),z(function(f,g,h,i){if(f&&e)return;var j,k,l,m=[],n=[],o=g.length,p=f||bo(b||"*",h.nodeType?[h]:h,[],f),q=a&&(f||!b)?bk(p,m,a,h,i):p,r=c?e||(f?a:o||d)?[]:g:q;c&&c(q,r,h,i);if(d){l=bk(r,n),d(l,[],h,i),j=l.length;while(j--)if(k=l[j])r[n[j]]=!(q[n[j]]=k)}if(f){j=a&&r.length;while(j--)if(k=r[j])f[m[j]]=!(g[m[j]]=k)}else r=bk(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):w.apply(g,r)})}function bm(a){var b,c,d,f=a.length,g=e.relative[a[0].type],h=g||e.relative[" "],i=g?1:0,j=bi(function(a){return a===b},h,!0),k=bi(function(a){return y.call(b,a)>-1},h,!0),m=[function(a,c,d){return!g&&(d||c!==l)||((b=c).nodeType?j(a,c,d):k(a,c,d))}];for(;i<f;i++)if(c=e.relative[a[i].type])m=[bi(bj(m),c)];else{c=e.filter[a[i].type].apply(null,a[i].matches);if(c[o]){d=++i;for(;d<f;d++)if(e.relative[a[d].type])break;return bl(i>1&&bj(m),i>1&&a.slice(0,i-1).join("").replace(L,"$1"),c,i<d&&bm(a.slice(i,d)),d<f&&bm(a=a.slice(d)),d<f&&a.join(""))}m.push(c)}return bj(m)}function bn(a,b){var d=b.length>0,f=a.length>0,g=function(h,i,j,k,m){var n,o,p,q=[],s=0,u="0",x=h&&[],y=m!=null,z=l,A=h||f&&e.find.TAG("*",m&&i.parentNode||i),B=t+=z==null?1:Math.E;y&&(l=i!==r&&i,c=g.el);for(;(n=A[u])!=null;u++){if(f&&n){for(o=0;p=a[o];o++)if(p(n,i,j)){k.push(n);break}y&&(t=B,c=++g.el)}d&&((n=!p&&n)&&s--,h&&x.push(n))}s+=u;if(d&&u!==s){for(o=0;p=b[o];o++)p(x,q,i,j);if(h){if(s>0)while(u--)!x[u]&&!q[u]&&(q[u]=v.call(k));q=bk(q)}w.apply(k,q),y&&!h&&q.length>0&&s+b.length>1&&bc.uniqueSort(k)}return y&&(t=B,l=z),x};return g.el=0,d?z(g):g}function bo(a,b,c,d){var e=0,f=b.length;for(;e<f;e++)bc(a,b[e],c,d);return c}function bp(a,b,c,d,f){var g,h,j,k,l,m=bh(a),n=m.length;if(!d&&m.length===1){h=m[0]=m[0].slice(0);if(h.length>2&&(j=h[0]).type==="ID"&&b.nodeType===9&&!f&&e.relative[h[1].type]){b=e.find.ID(j.matches[0].replace(V,""),b,f)[0];if(!b)return c;a=a.slice(h.shift().length)}for(g=W.POS.test(a)?-1:h.length-1;g>=0;g--){j=h[g];if(e.relative[k=j.type])break;if(l=e.find[k])if(d=l(j.matches[0].replace(V,""),R.test(h[0].type)&&b.parentNode||b,f)){h.splice(g,1),a=d.length&&h.join("");if(!a)return w.apply(c,x.call(d,0)),c;break}}}return i(a,m)(d,b,f,c,R.test(a)),c}function bq(){}var c,d,e,f,g,h,i,j,k,l,m=!0,n="undefined",o=("sizcache"+Math.random()).replace(".",""),q=String,r=a.document,s=r.documentElement,t=0,u=0,v=[].pop,w=[].push,x=[].slice,y=[].indexOf||function(a){var b=0,c=this.length;for(;b<c;b++)if(this[b]===a)return b;return-1},z=function(a,b){return a[o]=b==null||b,a},A=function(){var a={},b=[];return z(function(c,d){return b.push(c)>e.cacheLength&&delete a[b.shift()],a[c]=d},a)},B=A(),C=A(),D=A(),E="[\\x20\\t\\r\\n\\f]",F="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",G=F.replace("w","w#"),H="([*^$|!~]?=)",I="\\["+E+"*("+F+")"+E+"*(?:"+H+E+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+G+")|)|)"+E+"*\\]",J=":("+F+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+I+")|[^:]|\\\\.)*|.*))\\)|)",K=":(even|odd|eq|gt|lt|nth|first|last)(?:\\("+E+"*((?:-\\d)?\\d*)"+E+"*\\)|)(?=[^-]|$)",L=new RegExp("^"+E+"+|((?:^|[^\\\\])(?:\\\\.)*)"+E+"+$","g"),M=new RegExp("^"+E+"*,"+E+"*"),N=new RegExp("^"+E+"*([\\x20\\t\\r\\n\\f>+~])"+E+"*"),O=new RegExp(J),P=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,Q=/^:not/,R=/[\x20\t\r\n\f]*[+~]/,S=/:not\($/,T=/h\d/i,U=/input|select|textarea|button/i,V=/\\(?!\\)/g,W={ID:new RegExp("^#("+F+")"),CLASS:new RegExp("^\\.("+F+")"),NAME:new RegExp("^\\[name=['\"]?("+F+")['\"]?\\]"),TAG:new RegExp("^("+F.replace("w","w*")+")"),ATTR:new RegExp("^"+I),PSEUDO:new RegExp("^"+J),POS:new RegExp(K,"i"),CHILD:new RegExp("^:(only|nth|first|last)-child(?:\\("+E+"*(even|odd|(([+-]|)(\\d*)n|)"+E+"*(?:([+-]|)"+E+"*(\\d+)|))"+E+"*\\)|)","i"),needsContext:new RegExp("^"+E+"*[>+~]|"+K,"i")},X=function(a){var b=r.createElement("div");try{return a(b)}catch(c){return!1}finally{b=null}},Y=X(function(a){return a.appendChild(r.createComment("")),!a.getElementsByTagName("*").length}),Z=X(function(a){return a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!==n&&a.firstChild.getAttribute("href")==="#"}),$=X(function(a){a.innerHTML="<select></select>";var b=typeof a.lastChild.getAttribute("multiple");return b!=="boolean"&&b!=="string"}),_=X(function(a){return a.innerHTML="<div class='hidden e'></div><div class='hidden'></div>",!a.getElementsByClassName||!a.getElementsByClassName("e").length?!1:(a.lastChild.className="e",a.getElementsByClassName("e").length===2)}),ba=X(function(a){a.id=o+0,a.innerHTML="<a name='"+o+"'></a><div name='"+o+"'></div>",s.insertBefore(a,s.firstChild);var b=r.getElementsByName&&r.getElementsByName(o).length===2+r.getElementsByName(o+0).length;return d=!r.getElementById(o),s.removeChild(a),b});try{x.call(s.childNodes,0)[0].nodeType}catch(bb){x=function(a){var b,c=[];for(;b=this[a];a++)c.push(b);return c}}bc.matches=function(a,b){return bc(a,null,null,b)},bc.matchesSelector=function(a,b){return bc(b,null,null,[a]).length>0},f=bc.getText=function(a){var b,c="",d=0,e=a.nodeType;if(e){if(e===1||e===9||e===11){if(typeof a.textContent=="string")return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=f(a)}else if(e===3||e===4)return a.nodeValue}else for(;b=a[d];d++)c+=f(b);return c},g=bc.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?b.nodeName!=="HTML":!1},h=bc.contains=s.contains?function(a,b){var c=a.nodeType===9?a.documentElement:a,d=b&&b.parentNode;return a===d||!!(d&&d.nodeType===1&&c.contains&&c.contains(d))}:s.compareDocumentPosition?function(a,b){return b&&!!(a.compareDocumentPosition(b)&16)}:function(a,b){while(b=b.parentNode)if(b===a)return!0;return!1},bc.attr=function(a,b){var c,d=g(a);return d||(b=b.toLowerCase()),(c=e.attrHandle[b])?c(a):d||$?a.getAttribute(b):(c=a.getAttributeNode(b),c?typeof a[b]=="boolean"?a[b]?b:null:c.specified?c.value:null:null)},e=bc.selectors={cacheLength:50,createPseudo:z,match:W,attrHandle:Z?{}:{href:function(a){return a.getAttribute("href",2)},type:function(a){return a.getAttribute("type")}},find:{ID:d?function(a,b,c){if(typeof b.getElementById!==n&&!c){var d=b.getElementById(a);return d&&d.parentNode?[d]:[]}}:function(a,c,d){if(typeof c.getElementById!==n&&!d){var e=c.getElementById(a);return e?e.id===a||typeof e.getAttributeNode!==n&&e.getAttributeNode("id").value===a?[e]:b:[]}},TAG:Y?function(a,b){if(typeof b.getElementsByTagName!==n)return b.getElementsByTagName(a)}:function(a,b){var c=b.getElementsByTagName(a);if(a==="*"){var d,e=[],f=0;for(;d=c[f];f++)d.nodeType===1&&e.push(d);return e}return c},NAME:ba&&function(a,b){if(typeof b.getElementsByName!==n)return b.getElementsByName(name)},CLASS:_&&function(a,b,c){if(typeof b.getElementsByClassName!==n&&!c)return b.getElementsByClassName(a)}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(V,""),a[3]=(a[4]||a[5]||"").replace(V,""),a[2]==="~="&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),a[1]==="nth"?(a[2]||bc.error(a[0]),a[3]=+(a[3]?a[4]+(a[5]||1):2*(a[2]==="even"||a[2]==="odd")),a[4]=+(a[6]+a[7]||a[2]==="odd")):a[2]&&bc.error(a[0]),a},PSEUDO:function(a){var b,c;if(W.CHILD.test(a[0]))return null;if(a[3])a[2]=a[3];else if(b=a[4])O.test(b)&&(c=bh(b,!0))&&(c=b.indexOf(")",b.length-c)-b.length)&&(b=b.slice(0,c),a[0]=a[0].slice(0,c)),a[2]=b;return a.slice(0,3)}},filter:{ID:d?function(a){return a=a.replace(V,""),function(b){return b.getAttribute("id")===a}}:function(a){return a=a.replace(V,""),function(b){var c=typeof b.getAttributeNode!==n&&b.getAttributeNode("id");return c&&c.value===a}},TAG:function(a){return a==="*"?function(){return!0}:(a=a.replace(V,"").toLowerCase(),function(b){return b.nodeName&&b.nodeName.toLowerCase()===a})},CLASS:function(a){var b=B[o][a];return b||(b=B(a,new RegExp("(^|"+E+")"+a+"("+E+"|$)"))),function(a){return b.test(a.className||typeof a.getAttribute!==n&&a.getAttribute("class")||"")}},ATTR:function(a,b,c){return function(d,e){var f=bc.attr(d,a);return f==null?b==="!=":b?(f+="",b==="="?f===c:b==="!="?f!==c:b==="^="?c&&f.indexOf(c)===0:b==="*="?c&&f.indexOf(c)>-1:b==="$="?c&&f.substr(f.length-c.length)===c:b==="~="?(" "+f+" ").indexOf(c)>-1:b==="|="?f===c||f.substr(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d){return a==="nth"?function(a){var b,e,f=a.parentNode;if(c===1&&d===0)return!0;if(f){e=0;for(b=f.firstChild;b;b=b.nextSibling)if(b.nodeType===1){e++;if(a===b)break}}return e-=d,e===c||e%c===0&&e/c>=0}:function(b){var c=b;switch(a){case"only":case"first":while(c=c.previousSibling)if(c.nodeType===1)return!1;if(a==="first")return!0;c=b;case"last":while(c=c.nextSibling)if(c.nodeType===1)return!1;return!0}}},PSEUDO:function(a,b){var c,d=e.pseudos[a]||e.setFilters[a.toLowerCase()]||bc.error("unsupported pseudo: "+a);return d[o]?d(b):d.length>1?(c=[a,a,"",b],e.setFilters.hasOwnProperty(a.toLowerCase())?z(function(a,c){var e,f=d(a,b),g=f.length;while(g--)e=y.call(a,f[g]),a[e]=!(c[e]=f[g])}):function(a){return d(a,0,c)}):d}},pseudos:{not:z(function(a){var b=[],c=[],d=i(a.replace(L,"$1"));return d[o]?z(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)if(f=g[h])a[h]=!(b[h]=f)}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:z(function(a){return function(b){return bc(a,b).length>0}}),contains:z(function(a){return function(b){return(b.textContent||b.innerText||f(b)).indexOf(a)>-1}}),enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&!!a.checked||b==="option"&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},parent:function(a){return!e.pseudos.empty(a)},empty:function(a){var b;a=a.firstChild;while(a){if(a.nodeName>"@"||(b=a.nodeType)===3||b===4)return!1;a=a.nextSibling}return!0},header:function(a){return T.test(a.nodeName)},text:function(a){var b,c;return a.nodeName.toLowerCase()==="input"&&(b=a.type)==="text"&&((c=a.getAttribute("type"))==null||c.toLowerCase()===b)},radio:bd("radio"),checkbox:bd("checkbox"),file:bd("file"),password:bd("password"),image:bd("image"),submit:be("submit"),reset:be("reset"),button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&a.type==="button"||b==="button"},input:function(a){return U.test(a.nodeName)},focus:function(a){var b=a.ownerDocument;return a===b.activeElement&&(!b.hasFocus||b.hasFocus())&&(!!a.type||!!a.href)},active:function(a){return a===a.ownerDocument.activeElement},first:bf(function(a,b,c){return[0]}),last:bf(function(a,b,c){return[b-1]}),eq:bf(function(a,b,c){return[c<0?c+b:c]}),even:bf(function(a,b,c){for(var d=0;d<b;d+=2)a.push(d);return a}),odd:bf(function(a,b,c){for(var d=1;d<b;d+=2)a.push(d);return a}),lt:bf(function(a,b,c){for(var d=c<0?c+b:c;--d>=0;)a.push(d);return a}),gt:bf(function(a,b,c){for(var d=c<0?c+b:c;++d<b;)a.push(d);return a})}},j=s.compareDocumentPosition?function(a,b){return a===b?(k=!0,0):(!a.compareDocumentPosition||!b.compareDocumentPosition?a.compareDocumentPosition:a.compareDocumentPosition(b)&4)?-1:1}:function(a,b){if(a===b)return k=!0,0;if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,e=[],f=[],g=a.parentNode,h=b.parentNode,i=g;if(g===h)return bg(a,b);if(!g)return-1;if(!h)return 1;while(i)e.unshift(i),i=i.parentNode;i=h;while(i)f.unshift(i),i=i.parentNode;c=e.length,d=f.length;for(var j=0;j<c&&j<d;j++)if(e[j]!==f[j])return bg(e[j],f[j]);return j===c?bg(a,f[j],-1):bg(e[j],b,1)},[0,0].sort(j),m=!k,bc.uniqueSort=function(a){var b,c=1;k=m,a.sort(j);if(k)for(;b=a[c];c++)b===a[c-1]&&a.splice(c--,1);return a},bc.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},i=bc.compile=function(a,b){var c,d=[],e=[],f=D[o][a];if(!f){b||(b=bh(a)),c=b.length;while(c--)f=bm(b[c]),f[o]?d.push(f):e.push(f);f=D(a,bn(e,d))}return f},r.querySelectorAll&&function(){var a,b=bp,c=/'|\\/g,d=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,e=[":focus"],f=[":active",":focus"],h=s.matchesSelector||s.mozMatchesSelector||s.webkitMatchesSelector||s.oMatchesSelector||s.msMatchesSelector;X(function(a){a.innerHTML="<select><option selected=''></option></select>",a.querySelectorAll("[selected]").length||e.push("\\["+E+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),a.querySelectorAll(":checked").length||e.push(":checked")}),X(function(a){a.innerHTML="<p test=''></p>",a.querySelectorAll("[test^='']").length&&e.push("[*^$]="+E+"*(?:\"\"|'')"),a.innerHTML="<input type='hidden'/>",a.querySelectorAll(":enabled").length||e.push(":enabled",":disabled")}),e=new RegExp(e.join("|")),bp=function(a,d,f,g,h){if(!g&&!h&&(!e||!e.test(a))){var i,j,k=!0,l=o,m=d,n=d.nodeType===9&&a;if(d.nodeType===1&&d.nodeName.toLowerCase()!=="object"){i=bh(a),(k=d.getAttribute("id"))?l=k.replace(c,"\\$&"):d.setAttribute("id",l),l="[id='"+l+"'] ",j=i.length;while(j--)i[j]=l+i[j].join("");m=R.test(a)&&d.parentNode||d,n=i.join(",")}if(n)try{return w.apply(f,x.call(m.querySelectorAll(n),0)),f}catch(p){}finally{k||d.removeAttribute("id")}}return b(a,d,f,g,h)},h&&(X(function(b){a=h.call(b,"div");try{h.call(b,"[test!='']:sizzle"),f.push("!=",J)}catch(c){}}),f=new RegExp(f.join("|")),bc.matchesSelector=function(b,c){c=c.replace(d,"='$1']");if(!g(b)&&!f.test(c)&&(!e||!e.test(c)))try{var i=h.call(b,c);if(i||a||b.document&&b.document.nodeType!==11)return i}catch(j){}return bc(c,null,null,[b]).length>0})}(),e.pseudos.nth=e.pseudos.eq,e.filters=bq.prototype=e.pseudos,e.setFilters=new bq,bc.attr=p.attr,p.find=bc,p.expr=bc.selectors,p.expr[":"]=p.expr.pseudos,p.unique=bc.uniqueSort,p.text=bc.getText,p.isXMLDoc=bc.isXML,p.contains=bc.contains}(a);var bc=/Until$/,bd=/^(?:parents|prev(?:Until|All))/,be=/^.[^:#\[\.,]*$/,bf=p.expr.match.needsContext,bg={children:!0,contents:!0,next:!0,prev:!0};p.fn.extend({find:function(a){var b,c,d,e,f,g,h=this;if(typeof a!="string")return p(a).filter(function(){for(b=0,c=h.length;b<c;b++)if(p.contains(h[b],this))return!0});g=this.pushStack("","find",a);for(b=0,c=this.length;b<c;b++){d=g.length,p.find(a,this[b],g);if(b>0)for(e=d;e<g.length;e++)for(f=0;f<d;f++)if(g[f]===g[e]){g.splice(e--,1);break}}return g},has:function(a){var b,c=p(a,this),d=c.length;return this.filter(function(){for(b=0;b<d;b++)if(p.contains(this,c[b]))return!0})},not:function(a){return this.pushStack(bj(this,a,!1),"not",a)},filter:function(a){return this.pushStack(bj(this,a,!0),"filter",a)},is:function(a){return!!a&&(typeof a=="string"?bf.test(a)?p(a,this.context).index(this[0])>=0:p.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c,d=0,e=this.length,f=[],g=bf.test(a)||typeof a!="string"?p(a,b||this.context):0;for(;d<e;d++){c=this[d];while(c&&c.ownerDocument&&c!==b&&c.nodeType!==11){if(g?g.index(c)>-1:p.find.matchesSelector(c,a)){f.push(c);break}c=c.parentNode}}return f=f.length>1?p.unique(f):f,this.pushStack(f,"closest",a)},index:function(a){return a?typeof a=="string"?p.inArray(this[0],p(a)):p.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(a,b){var c=typeof a=="string"?p(a,b):p.makeArray(a&&a.nodeType?[a]:a),d=p.merge(this.get(),c);return this.pushStack(bh(c[0])||bh(d[0])?d:p.unique(d))},addBack:function(a){return this.add(a==null?this.prevObject:this.prevObject.filter(a))}}),p.fn.andSelf=p.fn.addBack,p.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return p.dir(a,"parentNode")},parentsUntil:function(a,b,c){return p.dir(a,"parentNode",c)},next:function(a){return bi(a,"nextSibling")},prev:function(a){return bi(a,"previousSibling")},nextAll:function(a){return p.dir(a,"nextSibling")},prevAll:function(a){return p.dir(a,"previousSibling")},nextUntil:function(a,b,c){return p.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return p.dir(a,"previousSibling",c)},siblings:function(a){return p.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return p.sibling(a.firstChild)},contents:function(a){return p.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:p.merge([],a.childNodes)}},function(a,b){p.fn[a]=function(c,d){var e=p.map(this,b,c);return bc.test(a)||(d=c),d&&typeof d=="string"&&(e=p.filter(d,e)),e=this.length>1&&!bg[a]?p.unique(e):e,this.length>1&&bd.test(a)&&(e=e.reverse()),this.pushStack(e,a,k.call(arguments).join(","))}}),p.extend({filter:function(a,b,c){return c&&(a=":not("+a+")"),b.length===1?p.find.matchesSelector(b[0],a)?[b[0]]:[]:p.find.matches(a,b)},dir:function(a,c,d){var e=[],f=a[c];while(f&&f.nodeType!==9&&(d===b||f.nodeType!==1||!p(f).is(d)))f.nodeType===1&&e.push(f),f=f[c];return e},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var bl="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",bm=/ jQuery\d+="(?:null|\d+)"/g,bn=/^\s+/,bo=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bp=/<([\w:]+)/,bq=/<tbody/i,br=/<|&#?\w+;/,bs=/<(?:script|style|link)/i,bt=/<(?:script|object|embed|option|style)/i,bu=new RegExp("<(?:"+bl+")[\\s/>]","i"),bv=/^(?:checkbox|radio)$/,bw=/checked\s*(?:[^=]|=\s*.checked.)/i,bx=/\/(java|ecma)script/i,by=/^\s*<!(?:\[CDATA\[|\-\-)|[\]\-]{2}>\s*$/g,bz={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},bA=bk(e),bB=bA.appendChild(e.createElement("div"));bz.optgroup=bz.option,bz.tbody=bz.tfoot=bz.colgroup=bz.caption=bz.thead,bz.th=bz.td,p.support.htmlSerialize||(bz._default=[1,"X<div>","</div>"]),p.fn.extend({text:function(a){return p.access(this,function(a){return a===b?p.text(this):this.empty().append((this[0]&&this[0].ownerDocument||e).createTextNode(a))},null,a,arguments.length)},wrapAll:function(a){if(p.isFunction(a))return this.each(function(b){p(this).wrapAll(a.call(this,b))});if(this[0]){var b=p(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return p.isFunction(a)?this.each(function(b){p(this).wrapInner(a.call(this,b))}):this.each(function(){var b=p(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=p.isFunction(a);return this.each(function(c){p(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){p.nodeName(this,"body")||p(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){(this.nodeType===1||this.nodeType===11)&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){(this.nodeType===1||this.nodeType===11)&&this.insertBefore(a,this.firstChild)})},before:function(){if(!bh(this[0]))return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=p.clean(arguments);return this.pushStack(p.merge(a,this),"before",this.selector)}},after:function(){if(!bh(this[0]))return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=p.clean(arguments);return this.pushStack(p.merge(this,a),"after",this.selector)}},remove:function(a,b){var c,d=0;for(;(c=this[d])!=null;d++)if(!a||p.filter(a,[c]).length)!b&&c.nodeType===1&&(p.cleanData(c.getElementsByTagName("*")),p.cleanData([c])),c.parentNode&&c.parentNode.removeChild(c);return this},empty:function(){var a,b=0;for(;(a=this[b])!=null;b++){a.nodeType===1&&p.cleanData(a.getElementsByTagName("*"));while(a.firstChild)a.removeChild(a.firstChild)}return this},clone:function(a,b){return a=a==null?!1:a,b=b==null?a:b,this.map(function(){return p.clone(this,a,b)})},html:function(a){return p.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return c.nodeType===1?c.innerHTML.replace(bm,""):b;if(typeof a=="string"&&!bs.test(a)&&(p.support.htmlSerialize||!bu.test(a))&&(p.support.leadingWhitespace||!bn.test(a))&&!bz[(bp.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(bo,"<$1></$2>");try{for(;d<e;d++)c=this[d]||{},c.nodeType===1&&(p.cleanData(c.getElementsByTagName("*")),c.innerHTML=a);c=0}catch(f){}}c&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(a){return bh(this[0])?this.length?this.pushStack(p(p.isFunction(a)?a():a),"replaceWith",a):this:p.isFunction(a)?this.each(function(b){var c=p(this),d=c.html();c.replaceWith(a.call(this,b,d))}):(typeof a!="string"&&(a=p(a).detach()),this.each(function(){var b=this.nextSibling,c=this.parentNode;p(this).remove(),b?p(b).before(a):p(c).append(a)}))},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){a=[].concat.apply([],a);var e,f,g,h,i=0,j=a[0],k=[],l=this.length;if(!p.support.checkClone&&l>1&&typeof j=="string"&&bw.test(j))return this.each(function(){p(this).domManip(a,c,d)});if(p.isFunction(j))return this.each(function(e){var f=p(this);a[0]=j.call(this,e,c?f.html():b),f.domManip(a,c,d)});if(this[0]){e=p.buildFragment(a,this,k),g=e.fragment,f=g.firstChild,g.childNodes.length===1&&(g=f);if(f){c=c&&p.nodeName(f,"tr");for(h=e.cacheable||l-1;i<l;i++)d.call(c&&p.nodeName(this[i],"table")?bC(this[i],"tbody"):this[i],i===h?g:p.clone(g,!0,!0))}g=f=null,k.length&&p.each(k,function(a,b){b.src?p.ajax?p.ajax({url:b.src,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0}):p.error("no ajax"):p.globalEval((b.text||b.textContent||b.innerHTML||"").replace(by,"")),b.parentNode&&b.parentNode.removeChild(b)})}return this}}),p.buildFragment=function(a,c,d){var f,g,h,i=a[0];return c=c||e,c=!c.nodeType&&c[0]||c,c=c.ownerDocument||c,a.length===1&&typeof i=="string"&&i.length<512&&c===e&&i.charAt(0)==="<"&&!bt.test(i)&&(p.support.checkClone||!bw.test(i))&&(p.support.html5Clone||!bu.test(i))&&(g=!0,f=p.fragments[i],h=f!==b),f||(f=c.createDocumentFragment(),p.clean(a,c,f,d),g&&(p.fragments[i]=h&&f)),{fragment:f,cacheable:g}},p.fragments={},p.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){p.fn[a]=function(c){var d,e=0,f=[],g=p(c),h=g.length,i=this.length===1&&this[0].parentNode;if((i==null||i&&i.nodeType===11&&i.childNodes.length===1)&&h===1)return g[b](this[0]),this;for(;e<h;e++)d=(e>0?this.clone(!0):this).get(),p(g[e])[b](d),f=f.concat(d);return this.pushStack(f,a,g.selector)}}),p.extend({clone:function(a,b,c){var d,e,f,g;p.support.html5Clone||p.isXMLDoc(a)||!bu.test("<"+a.nodeName+">")?g=a.cloneNode(!0):(bB.innerHTML=a.outerHTML,bB.removeChild(g=bB.firstChild));if((!p.support.noCloneEvent||!p.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!p.isXMLDoc(a)){bE(a,g),d=bF(a),e=bF(g);for(f=0;d[f];++f)e[f]&&bE(d[f],e[f])}if(b){bD(a,g);if(c){d=bF(a),e=bF(g);for(f=0;d[f];++f)bD(d[f],e[f])}}return d=e=null,g},clean:function(a,b,c,d){var f,g,h,i,j,k,l,m,n,o,q,r,s=b===e&&bA,t=[];if(!b||typeof b.createDocumentFragment=="undefined")b=e;for(f=0;(h=a[f])!=null;f++){typeof h=="number"&&(h+="");if(!h)continue;if(typeof h=="string")if(!br.test(h))h=b.createTextNode(h);else{s=s||bk(b),l=b.createElement("div"),s.appendChild(l),h=h.replace(bo,"<$1></$2>"),i=(bp.exec(h)||["",""])[1].toLowerCase(),j=bz[i]||bz._default,k=j[0],l.innerHTML=j[1]+h+j[2];while(k--)l=l.lastChild;if(!p.support.tbody){m=bq.test(h),n=i==="table"&&!m?l.firstChild&&l.firstChild.childNodes:j[1]==="<table>"&&!m?l.childNodes:[];for(g=n.length-1;g>=0;--g)p.nodeName(n[g],"tbody")&&!n[g].childNodes.length&&n[g].parentNode.removeChild(n[g])}!p.support.leadingWhitespace&&bn.test(h)&&l.insertBefore(b.createTextNode(bn.exec(h)[0]),l.firstChild),h=l.childNodes,l.parentNode.removeChild(l)}h.nodeType?t.push(h):p.merge(t,h)}l&&(h=l=s=null);if(!p.support.appendChecked)for(f=0;(h=t[f])!=null;f++)p.nodeName(h,"input")?bG(h):typeof h.getElementsByTagName!="undefined"&&p.grep(h.getElementsByTagName("input"),bG);if(c){q=function(a){if(!a.type||bx.test(a.type))return d?d.push(a.parentNode?a.parentNode.removeChild(a):a):c.appendChild(a)};for(f=0;(h=t[f])!=null;f++)if(!p.nodeName(h,"script")||!q(h))c.appendChild(h),typeof h.getElementsByTagName!="undefined"&&(r=p.grep(p.merge([],h.getElementsByTagName("script")),q),t.splice.apply(t,[f+1,0].concat(r)),f+=r.length)}return t},cleanData:function(a,b){var c,d,e,f,g=0,h=p.expando,i=p.cache,j=p.support.deleteExpando,k=p.event.special;for(;(e=a[g])!=null;g++)if(b||p.acceptData(e)){d=e[h],c=d&&i[d];if(c){if(c.events)for(f in c.events)k[f]?p.event.remove(e,f):p.removeEvent(e,f,c.handle);i[d]&&(delete i[d],j?delete e[h]:e.removeAttribute?e.removeAttribute(h):e[h]=null,p.deletedIds.push(d))}}}}),function(){var a,b;p.uaMatch=function(a){a=a.toLowerCase();var b=/(chrome)[ \/]([\w.]+)/.exec(a)||/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||a.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},a=p.uaMatch(g.userAgent),b={},a.browser&&(b[a.browser]=!0,b.version=a.version),b.chrome?b.webkit=!0:b.webkit&&(b.safari=!0),p.browser=b,p.sub=function(){function a(b,c){return new a.fn.init(b,c)}p.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function c(c,d){return d&&d instanceof p&&!(d instanceof a)&&(d=a(d)),p.fn.init.call(this,c,d,b)},a.fn.init.prototype=a.fn;var b=a(e);return a}}();var bH,bI,bJ,bK=/alpha\([^)]*\)/i,bL=/opacity=([^)]*)/,bM=/^(top|right|bottom|left)$/,bN=/^(none|table(?!-c[ea]).+)/,bO=/^margin/,bP=new RegExp("^("+q+")(.*)$","i"),bQ=new RegExp("^("+q+")(?!px)[a-z%]+$","i"),bR=new RegExp("^([-+])=("+q+")","i"),bS={},bT={position:"absolute",visibility:"hidden",display:"block"},bU={letterSpacing:0,fontWeight:400},bV=["Top","Right","Bottom","Left"],bW=["Webkit","O","Moz","ms"],bX=p.fn.toggle;p.fn.extend({css:function(a,c){return p.access(this,function(a,c,d){return d!==b?p.style(a,c,d):p.css(a,c)},a,c,arguments.length>1)},show:function(){return b$(this,!0)},hide:function(){return b$(this)},toggle:function(a,b){var c=typeof a=="boolean";return p.isFunction(a)&&p.isFunction(b)?bX.apply(this,arguments):this.each(function(){(c?a:bZ(this))?p(this).show():p(this).hide()})}}),p.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bH(a,"opacity");return c===""?"1":c}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":p.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!a||a.nodeType===3||a.nodeType===8||!a.style)return;var f,g,h,i=p.camelCase(c),j=a.style;c=p.cssProps[i]||(p.cssProps[i]=bY(j,i)),h=p.cssHooks[c]||p.cssHooks[i];if(d===b)return h&&"get"in h&&(f=h.get(a,!1,e))!==b?f:j[c];g=typeof d,g==="string"&&(f=bR.exec(d))&&(d=(f[1]+1)*f[2]+parseFloat(p.css(a,c)),g="number");if(d==null||g==="number"&&isNaN(d))return;g==="number"&&!p.cssNumber[i]&&(d+="px");if(!h||!("set"in h)||(d=h.set(a,d,e))!==b)try{j[c]=d}catch(k){}},css:function(a,c,d,e){var f,g,h,i=p.camelCase(c);return c=p.cssProps[i]||(p.cssProps[i]=bY(a.style,i)),h=p.cssHooks[c]||p.cssHooks[i],h&&"get"in h&&(f=h.get(a,!0,e)),f===b&&(f=bH(a,c)),f==="normal"&&c in bU&&(f=bU[c]),d||e!==b?(g=parseFloat(f),d||p.isNumeric(g)?g||0:f):f},swap:function(a,b,c){var d,e,f={};for(e in b)f[e]=a.style[e],a.style[e]=b[e];d=c.call(a);for(e in b)a.style[e]=f[e];return d}}),a.getComputedStyle?bH=function(b,c){var d,e,f,g,h=a.getComputedStyle(b,null),i=b.style;return h&&(d=h[c],d===""&&!p.contains(b.ownerDocument,b)&&(d=p.style(b,c)),bQ.test(d)&&bO.test(c)&&(e=i.width,f=i.minWidth,g=i.maxWidth,i.minWidth=i.maxWidth=i.width=d,d=h.width,i.width=e,i.minWidth=f,i.maxWidth=g)),d}:e.documentElement.currentStyle&&(bH=function(a,b){var c,d,e=a.currentStyle&&a.currentStyle[b],f=a.style;return e==null&&f&&f[b]&&(e=f[b]),bQ.test(e)&&!bM.test(b)&&(c=f.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":e,e=f.pixelLeft+"px",f.left=c,d&&(a.runtimeStyle.left=d)),e===""?"auto":e}),p.each(["height","width"],function(a,b){p.cssHooks[b]={get:function(a,c,d){if(c)return a.offsetWidth===0&&bN.test(bH(a,"display"))?p.swap(a,bT,function(){return cb(a,b,d)}):cb(a,b,d)},set:function(a,c,d){return b_(a,c,d?ca(a,b,d,p.support.boxSizing&&p.css(a,"boxSizing")==="border-box"):0)}}}),p.support.opacity||(p.cssHooks.opacity={get:function(a,b){return bL.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=p.isNumeric(b)?"alpha(opacity="+b*100+")":"",f=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&p.trim(f.replace(bK,""))===""&&c.removeAttribute){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bK.test(f)?f.replace(bK,e):f+" "+e}}),p(function(){p.support.reliableMarginRight||(p.cssHooks.marginRight={get:function(a,b){return p.swap(a,{display:"inline-block"},function(){if(b)return bH(a,"marginRight")})}}),!p.support.pixelPosition&&p.fn.position&&p.each(["top","left"],function(a,b){p.cssHooks[b]={get:function(a,c){if(c){var d=bH(a,b);return bQ.test(d)?p(a).position()[b]+"px":d}}}})}),p.expr&&p.expr.filters&&(p.expr.filters.hidden=function(a){return a.offsetWidth===0&&a.offsetHeight===0||!p.support.reliableHiddenOffsets&&(a.style&&a.style.display||bH(a,"display"))==="none"},p.expr.filters.visible=function(a){return!p.expr.filters.hidden(a)}),p.each({margin:"",padding:"",border:"Width"},function(a,b){p.cssHooks[a+b]={expand:function(c){var d,e=typeof c=="string"?c.split(" "):[c],f={};for(d=0;d<4;d++)f[a+bV[d]+b]=e[d]||e[d-2]||e[0];return f}},bO.test(a)||(p.cssHooks[a+b].set=b_)});var cd=/%20/g,ce=/\[\]$/,cf=/\r?\n/g,cg=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,ch=/^(?:select|textarea)/i;p.fn.extend({serialize:function(){return p.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?p.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||ch.test(this.nodeName)||cg.test(this.type))}).map(function(a,b){var c=p(this).val();return c==null?null:p.isArray(c)?p.map(c,function(a,c){return{name:b.name,value:a.replace(cf,"\r\n")}}):{name:b.name,value:c.replace(cf,"\r\n")}}).get()}}),p.param=function(a,c){var d,e=[],f=function(a,b){b=p.isFunction(b)?b():b==null?"":b,e[e.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=p.ajaxSettings&&p.ajaxSettings.traditional);if(p.isArray(a)||a.jquery&&!p.isPlainObject(a))p.each(a,function(){f(this.name,this.value)});else for(d in a)ci(d,a[d],c,f);return e.join("&").replace(cd,"+")};var cj,ck,cl=/#.*$/,cm=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,cn=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,co=/^(?:GET|HEAD)$/,cp=/^\/\//,cq=/\?/,cr=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,cs=/([?&])_=[^&]*/,ct=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,cu=p.fn.load,cv={},cw={},cx=["*/"]+["*"];try{ck=f.href}catch(cy){ck=e.createElement("a"),ck.href="",ck=ck.href}cj=ct.exec(ck.toLowerCase())||[],p.fn.load=function(a,c,d){if(typeof a!="string"&&cu)return cu.apply(this,arguments);if(!this.length)return this;var e,f,g,h=this,i=a.indexOf(" ");return i>=0&&(e=a.slice(i,a.length),a=a.slice(0,i)),p.isFunction(c)?(d=c,c=b):c&&typeof c=="object"&&(f="POST"),p.ajax({url:a,type:f,dataType:"html",data:c,complete:function(a,b){d&&h.each(d,g||[a.responseText,b,a])}}).done(function(a){g=arguments,h.html(e?p("<div>").append(a.replace(cr,"")).find(e):a)}),this},p.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){p.fn[b]=function(a){return this.on(b,a)}}),p.each(["get","post"],function(a,c){p[c]=function(a,d,e,f){return p.isFunction(d)&&(f=f||e,e=d,d=b),p.ajax({type:c,url:a,data:d,success:e,dataType:f})}}),p.extend({getScript:function(a,c){return p.get(a,b,c,"script")},getJSON:function(a,b,c){return p.get(a,b,c,"json")},ajaxSetup:function(a,b){return b?cB(a,p.ajaxSettings):(b=a,a=p.ajaxSettings),cB(a,b),a},ajaxSettings:{url:ck,isLocal:cn.test(cj[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":cx},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":p.parseJSON,"text xml":p.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:cz(cv),ajaxTransport:cz(cw),ajax:function(a,c){function y(a,c,f,i){var k,s,t,u,w,y=c;if(v===2)return;v=2,h&&clearTimeout(h),g=b,e=i||"",x.readyState=a>0?4:0,f&&(u=cC(l,x,f));if(a>=200&&a<300||a===304)l.ifModified&&(w=x.getResponseHeader("Last-Modified"),w&&(p.lastModified[d]=w),w=x.getResponseHeader("Etag"),w&&(p.etag[d]=w)),a===304?(y="notmodified",k=!0):(k=cD(l,u),y=k.state,s=k.data,t=k.error,k=!t);else{t=y;if(!y||a)y="error",a<0&&(a=0)}x.status=a,x.statusText=(c||y)+"",k?o.resolveWith(m,[s,y,x]):o.rejectWith(m,[x,y,t]),x.statusCode(r),r=b,j&&n.trigger("ajax"+(k?"Success":"Error"),[x,l,k?s:t]),q.fireWith(m,[x,y]),j&&(n.trigger("ajaxComplete",[x,l]),--p.active||p.event.trigger("ajaxStop"))}typeof a=="object"&&(c=a,a=b),c=c||{};var d,e,f,g,h,i,j,k,l=p.ajaxSetup({},c),m=l.context||l,n=m!==l&&(m.nodeType||m instanceof p)?p(m):p.event,o=p.Deferred(),q=p.Callbacks("once memory"),r=l.statusCode||{},t={},u={},v=0,w="canceled",x={readyState:0,setRequestHeader:function(a,b){if(!v){var c=a.toLowerCase();a=u[c]=u[c]||a,t[a]=b}return this},getAllResponseHeaders:function(){return v===2?e:null},getResponseHeader:function(a){var c;if(v===2){if(!f){f={};while(c=cm.exec(e))f[c[1].toLowerCase()]=c[2]}c=f[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){return v||(l.mimeType=a),this},abort:function(a){return a=a||w,g&&g.abort(a),y(0,a),this}};o.promise(x),x.success=x.done,x.error=x.fail,x.complete=q.add,x.statusCode=function(a){if(a){var b;if(v<2)for(b in a)r[b]=[r[b],a[b]];else b=a[x.status],x.always(b)}return this},l.url=((a||l.url)+"").replace(cl,"").replace(cp,cj[1]+"//"),l.dataTypes=p.trim(l.dataType||"*").toLowerCase().split(s),l.crossDomain==null&&(i=ct.exec(l.url.toLowerCase())||!1,l.crossDomain=i&&i.join(":")+(i[3]?"":i[1]==="http:"?80:443)!==cj.join(":")+(cj[3]?"":cj[1]==="http:"?80:443)),l.data&&l.processData&&typeof l.data!="string"&&(l.data=p.param(l.data,l.traditional)),cA(cv,l,c,x);if(v===2)return x;j=l.global,l.type=l.type.toUpperCase(),l.hasContent=!co.test(l.type),j&&p.active++===0&&p.event.trigger("ajaxStart");if(!l.hasContent){l.data&&(l.url+=(cq.test(l.url)?"&":"?")+l.data,delete l.data),d=l.url;if(l.cache===!1){var z=p.now(),A=l.url.replace(cs,"$1_="+z);l.url=A+(A===l.url?(cq.test(l.url)?"&":"?")+"_="+z:"")}}(l.data&&l.hasContent&&l.contentType!==!1||c.contentType)&&x.setRequestHeader("Content-Type",l.contentType),l.ifModified&&(d=d||l.url,p.lastModified[d]&&x.setRequestHeader("If-Modified-Since",p.lastModified[d]),p.etag[d]&&x.setRequestHeader("If-None-Match",p.etag[d])),x.setRequestHeader("Accept",l.dataTypes[0]&&l.accepts[l.dataTypes[0]]?l.accepts[l.dataTypes[0]]+(l.dataTypes[0]!=="*"?", "+cx+"; q=0.01":""):l.accepts["*"]);for(k in l.headers)x.setRequestHeader(k,l.headers[k]);if(!l.beforeSend||l.beforeSend.call(m,x,l)!==!1&&v!==2){w="abort";for(k in{success:1,error:1,complete:1})x[k](l[k]);g=cA(cw,l,c,x);if(!g)y(-1,"No Transport");else{x.readyState=1,j&&n.trigger("ajaxSend",[x,l]),l.async&&l.timeout>0&&(h=setTimeout(function(){x.abort("timeout")},l.timeout));try{v=1,g.send(t,y)}catch(B){if(v<2)y(-1,B);else throw B}}return x}return x.abort()},active:0,lastModified:{},etag:{}});var cE=[],cF=/\?/,cG=/(=)\?(?=&|$)|\?\?/,cH=p.now();p.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=cE.pop()||p.expando+"_"+cH++;return this[a]=!0,a}}),p.ajaxPrefilter("json jsonp",function(c,d,e){var f,g,h,i=c.data,j=c.url,k=c.jsonp!==!1,l=k&&cG.test(j),m=k&&!l&&typeof i=="string"&&!(c.contentType||"").indexOf("application/x-www-form-urlencoded")&&cG.test(i);if(c.dataTypes[0]==="jsonp"||l||m)return f=c.jsonpCallback=p.isFunction(c.jsonpCallback)?c.jsonpCallback():c.jsonpCallback,g=a[f],l?c.url=j.replace(cG,"$1"+f):m?c.data=i.replace(cG,"$1"+f):k&&(c.url+=(cF.test(j)?"&":"?")+c.jsonp+"="+f),c.converters["script json"]=function(){return h||p.error(f+" was not called"),h[0]},c.dataTypes[0]="json",a[f]=function(){h=arguments},e.always(function(){a[f]=g,c[f]&&(c.jsonpCallback=d.jsonpCallback,cE.push(f)),h&&p.isFunction(g)&&g(h[0]),h=g=b}),"script"}),p.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){return p.globalEval(a),a}}}),p.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),p.ajaxTransport("script",function(a){if(a.crossDomain){var c,d=e.head||e.getElementsByTagName("head")[0]||e.documentElement;return{send:function(f,g){c=e.createElement("script"),c.async="async",a.scriptCharset&&(c.charset=a.scriptCharset),c.src=a.url,c.onload=c.onreadystatechange=function(a,e){if(e||!c.readyState||/loaded|complete/.test(c.readyState))c.onload=c.onreadystatechange=null,d&&c.parentNode&&d.removeChild(c),c=b,e||g(200,"success")},d.insertBefore(c,d.firstChild)},abort:function(){c&&c.onload(0,1)}}}});var cI,cJ=a.ActiveXObject?function(){for(var a in cI)cI[a](0,1)}:!1,cK=0;p.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&cL()||cM()}:cL,function(a){p.extend(p.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(p.ajaxSettings.xhr()),p.support.ajax&&p.ajaxTransport(function(c){if(!c.crossDomain||p.support.cors){var d;return{send:function(e,f){var g,h,i=c.xhr();c.username?i.open(c.type,c.url,c.async,c.username,c.password):i.open(c.type,c.url,c.async);if(c.xhrFields)for(h in c.xhrFields)i[h]=c.xhrFields[h];c.mimeType&&i.overrideMimeType&&i.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(h in e)i.setRequestHeader(h,e[h])}catch(j){}i.send(c.hasContent&&c.data||null),d=function(a,e){var h,j,k,l,m;try{if(d&&(e||i.readyState===4)){d=b,g&&(i.onreadystatechange=p.noop,cJ&&delete cI[g]);if(e)i.readyState!==4&&i.abort();else{h=i.status,k=i.getAllResponseHeaders(),l={},m=i.responseXML,m&&m.documentElement&&(l.xml=m);try{l.text=i.responseText}catch(a){}try{j=i.statusText}catch(n){j=""}!h&&c.isLocal&&!c.crossDomain?h=l.text?200:404:h===1223&&(h=204)}}}catch(o){e||f(-1,o)}l&&f(h,j,l,k)},c.async?i.readyState===4?setTimeout(d,0):(g=++cK,cJ&&(cI||(cI={},p(a).unload(cJ)),cI[g]=d),i.onreadystatechange=d):d()},abort:function(){d&&d(0,1)}}}});var cN,cO,cP=/^(?:toggle|show|hide)$/,cQ=new RegExp("^(?:([-+])=|)("+q+")([a-z%]*)$","i"),cR=/queueHooks$/,cS=[cY],cT={"*":[function(a,b){var c,d,e=this.createTween(a,b),f=cQ.exec(b),g=e.cur(),h=+g||0,i=1,j=20;if(f){c=+f[2],d=f[3]||(p.cssNumber[a]?"":"px");if(d!=="px"&&h){h=p.css(e.elem,a,!0)||c||1;do i=i||".5",h=h/i,p.style(e.elem,a,h+d);while(i!==(i=e.cur()/g)&&i!==1&&--j)}e.unit=d,e.start=h,e.end=f[1]?h+(f[1]+1)*c:c}return e}]};p.Animation=p.extend(cW,{tweener:function(a,b){p.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");var c,d=0,e=a.length;for(;d<e;d++)c=a[d],cT[c]=cT[c]||[],cT[c].unshift(b)},prefilter:function(a,b){b?cS.unshift(a):cS.push(a)}}),p.Tween=cZ,cZ.prototype={constructor:cZ,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(p.cssNumber[c]?"":"px")},cur:function(){var a=cZ.propHooks[this.prop];return a&&a.get?a.get(this):cZ.propHooks._default.get(this)},run:function(a){var b,c=cZ.propHooks[this.prop];return this.options.duration?this.pos=b=p.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):cZ.propHooks._default.set(this),this}},cZ.prototype.init.prototype=cZ.prototype,cZ.propHooks={_default:{get:function(a){var b;return a.elem[a.prop]==null||!!a.elem.style&&a.elem.style[a.prop]!=null?(b=p.css(a.elem,a.prop,!1,""),!b||b==="auto"?0:b):a.elem[a.prop]},set:function(a){p.fx.step[a.prop]?p.fx.step[a.prop](a):a.elem.style&&(a.elem.style[p.cssProps[a.prop]]!=null||p.cssHooks[a.prop])?p.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},cZ.propHooks.scrollTop=cZ.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},p.each(["toggle","show","hide"],function(a,b){var c=p.fn[b];p.fn[b]=function(d,e,f){return d==null||typeof d=="boolean"||!a&&p.isFunction(d)&&p.isFunction(e)?c.apply(this,arguments):this.animate(c$(b,!0),d,e,f)}}),p.fn.extend({fadeTo:function(a,b,c,d){return this.filter(bZ).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=p.isEmptyObject(a),f=p.speed(b,c,d),g=function(){var b=cW(this,p.extend({},a),f);e&&b.stop(!0)};return e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,c,d){var e=function(a){var b=a.stop;delete a.stop,b(d)};return typeof a!="string"&&(d=c,c=a,a=b),c&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,c=a!=null&&a+"queueHooks",f=p.timers,g=p._data(this);if(c)g[c]&&g[c].stop&&e(g[c]);else for(c in g)g[c]&&g[c].stop&&cR.test(c)&&e(g[c]);for(c=f.length;c--;)f[c].elem===this&&(a==null||f[c].queue===a)&&(f[c].anim.stop(d),b=!1,f.splice(c,1));(b||!d)&&p.dequeue(this,a)})}}),p.each({slideDown:c$("show"),slideUp:c$("hide"),slideToggle:c$("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){p.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),p.speed=function(a,b,c){var d=a&&typeof a=="object"?p.extend({},a):{complete:c||!c&&b||p.isFunction(a)&&a,duration:a,easing:c&&b||b&&!p.isFunction(b)&&b};d.duration=p.fx.off?0:typeof d.duration=="number"?d.duration:d.duration in p.fx.speeds?p.fx.speeds[d.duration]:p.fx.speeds._default;if(d.queue==null||d.queue===!0)d.queue="fx";return d.old=d.complete,d.complete=function(){p.isFunction(d.old)&&d.old.call(this),d.queue&&p.dequeue(this,d.queue)},d},p.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},p.timers=[],p.fx=cZ.prototype.init,p.fx.tick=function(){var a,b=p.timers,c=0;for(;c<b.length;c++)a=b[c],!a()&&b[c]===a&&b.splice(c--,1);b.length||p.fx.stop()},p.fx.timer=function(a){a()&&p.timers.push(a)&&!cO&&(cO=setInterval(p.fx.tick,p.fx.interval))},p.fx.interval=13,p.fx.stop=function(){clearInterval(cO),cO=null},p.fx.speeds={slow:600,fast:200,_default:400},p.fx.step={},p.expr&&p.expr.filters&&(p.expr.filters.animated=function(a){return p.grep(p.timers,function(b){return a===b.elem}).length});var c_=/^(?:body|html)$/i;p.fn.offset=function(a){if(arguments.length)return a===b?this:this.each(function(b){p.offset.setOffset(this,a,b)});var c,d,e,f,g,h,i,j={top:0,left:0},k=this[0],l=k&&k.ownerDocument;if(!l)return;return(d=l.body)===k?p.offset.bodyOffset(k):(c=l.documentElement,p.contains(c,k)?(typeof k.getBoundingClientRect!="undefined"&&(j=k.getBoundingClientRect()),e=da(l),f=c.clientTop||d.clientTop||0,g=c.clientLeft||d.clientLeft||0,h=e.pageYOffset||c.scrollTop,i=e.pageXOffset||c.scrollLeft,{top:j.top+h-f,left:j.left+i-g}):j)},p.offset={bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;return p.support.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(p.css(a,"marginTop"))||0,c+=parseFloat(p.css(a,"marginLeft"))||0),{top:b,left:c}},setOffset:function(a,b,c){var d=p.css(a,"position");d==="static"&&(a.style.position="relative");var e=p(a),f=e.offset(),g=p.css(a,"top"),h=p.css(a,"left"),i=(d==="absolute"||d==="fixed")&&p.inArray("auto",[g,h])>-1,j={},k={},l,m;i?(k=e.position(),l=k.top,m=k.left):(l=parseFloat(g)||0,m=parseFloat(h)||0),p.isFunction(b)&&(b=b.call(a,c,f)),b.top!=null&&(j.top=b.top-f.top+l),b.left!=null&&(j.left=b.left-f.left+m),"using"in b?b.using.call(a,j):e.css(j)}},p.fn.extend({position:function(){if(!this[0])return;var a=this[0],b=this.offsetParent(),c=this.offset(),d=c_.test(b[0].nodeName)?{top:0,left:0}:b.offset();return c.top-=parseFloat(p.css(a,"marginTop"))||0,c.left-=parseFloat(p.css(a,"marginLeft"))||0,d.top+=parseFloat(p.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(p.css(b[0],"borderLeftWidth"))||0,{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||e.body;while(a&&!c_.test(a.nodeName)&&p.css(a,"position")==="static")a=a.offsetParent;return a||e.body})}}),p.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,c){var d=/Y/.test(c);p.fn[a]=function(e){return p.access(this,function(a,e,f){var g=da(a);if(f===b)return g?c in g?g[c]:g.document.documentElement[e]:a[e];g?g.scrollTo(d?p(g).scrollLeft():f,d?f:p(g).scrollTop()):a[e]=f},a,e,arguments.length,null)}}),p.each({Height:"height",Width:"width"},function(a,c){p.each({padding:"inner"+a,content:c,"":"outer"+a},function(d,e){p.fn[e]=function(e,f){var g=arguments.length&&(d||typeof e!="boolean"),h=d||(e===!0||f===!0?"margin":"border");return p.access(this,function(c,d,e){var f;return p.isWindow(c)?c.document.documentElement["client"+a]:c.nodeType===9?(f=c.documentElement,Math.max(c.body["scroll"+a],f["scroll"+a],c.body["offset"+a],f["offset"+a],f["client"+a])):e===b?p.css(c,d,e,h):p.style(c,d,e,h)},c,g?e:b,g,null)}})}),a.jQuery=a.$=p,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return p})})(window);
\ No newline at end of file
--- /dev/null
+/** @license
+ * Plugin to load JS files that have dependencies but aren't wrapped into
+ * `define` calls.
+ * Author: Miller Medeiros
+ * Version: 0.1.0 (2011/12/13)
+ * Released under the MIT license
+ */
+define(function () {
+
+ var rParts = /^(.*)\[([^\]]*)\]$/;
+
+ return {
+
+ //example: depend!bar[jquery,lib/foo]
+ load : function(name, req, onLoad, config){
+ var parts = rParts.exec(name);
+
+ req(parts[2].split(','), function(){
+ req([parts[1]], function(mod){
+ onLoad(mod);
+ });
+ });
+ }
+
+ };
+
+});
\ No newline at end of file
--- /dev/null
+
+(function( $, window ) {
+ var win = $.mobile.$window,
+ event_name = "orientationchange",
+ special_event,
+ get_orientation,
+ last_orientation,
+ initial_orientation_is_landscape,
+ initial_orientation_is_default,
+ portrait_map = { "0": true, "180": true };
+
+ // It seems that some device/browser vendors use window.orientation values 0 and 180 to
+ // denote the "default" orientation. For iOS devices, and most other smart-phones tested,
+ // the default orientation is always "portrait", but in some Android and RIM based tablets,
+ // the default orientation is "landscape". The following code attempts to use the window
+ // dimensions to figure out what the current orientation is, and then makes adjustments
+ // to the to the portrait_map if necessary, so that we can properly decode the
+ // window.orientation value whenever get_orientation() is called.
+ //
+ // Note that we used to use a media query to figure out what the orientation the browser
+ // thinks it is in:
+ //
+ // initial_orientation_is_landscape = $.mobile.media("all and (orientation: landscape)");
+ //
+ // but there was an iPhone/iPod Touch bug beginning with iOS 4.2, up through iOS 5.1,
+ // where the browser *ALWAYS* applied the landscape media query. This bug does not
+ // happen on iPad.
+
+ if ( $.support.orientation ) {
+
+ // Check the window width and height to figure out what the current orientation
+ // of the device is at this moment. Note that we've initialized the portrait map
+ // values to 0 and 180, *AND* we purposely check for landscape so that if we guess
+ // wrong, , we default to the assumption that portrait is the default orientation.
+ // We use a threshold check below because on some platforms like iOS, the iPhone
+ // form-factor can report a larger width than height if the user turns on the
+ // developer console. The actual threshold value is somewhat arbitrary, we just
+ // need to make sure it is large enough to exclude the developer console case.
+
+ var ww = window.innerWidth || $.mobile.$window.width(),
+ wh = window.innerHeight || $.mobile.$window.height(),
+ landscape_threshold = 50;
+
+ initial_orientation_is_landscape = ww > wh && ( ww - wh ) > landscape_threshold;
+
+
+ // Now check to see if the current window.orientation is 0 or 180.
+ initial_orientation_is_default = portrait_map[ window.orientation ];
+
+ // If the initial orientation is landscape, but window.orientation reports 0 or 180, *OR*
+ // if the initial orientation is portrait, but window.orientation reports 90 or -90, we
+ // need to flip our portrait_map values because landscape is the default orientation for
+ // this device/browser.
+ if ( ( initial_orientation_is_landscape && initial_orientation_is_default ) || ( !initial_orientation_is_landscape && !initial_orientation_is_default ) ) {
+ portrait_map = { "-90": true, "90": true };
+ }
+ }
+
+ $.event.special.orientationchange = $.extend( {}, $.event.special.orientationchange, {
+ setup: function() {
+ // If the event is supported natively, return false so that jQuery
+ // will bind to the event using DOM methods.
+ if ( $.support.orientation && !$.event.special.orientationchange.disabled ) {
+ return false;
+ }
+
+ // Get the current orientation to avoid initial double-triggering.
+ last_orientation = get_orientation();
+
+ // Because the orientationchange event doesn't exist, simulate the
+ // event by testing window dimensions on resize.
+ win.bind( "throttledresize", handler );
+ },
+ teardown: function() {
+ // If the event is not supported natively, return false so that
+ // jQuery will unbind the event using DOM methods.
+ if ( $.support.orientation && !$.event.special.orientationchange.disabled ) {
+ return false;
+ }
+
+ // Because the orientationchange event doesn't exist, unbind the
+ // resize event handler.
+ win.unbind( "throttledresize", handler );
+ },
+ add: function( handleObj ) {
+ // Save a reference to the bound event handler.
+ var old_handler = handleObj.handler;
+
+
+ handleObj.handler = function( event ) {
+ // Modify event object, adding the .orientation property.
+ event.orientation = get_orientation();
+
+ // Call the originally-bound event handler and return its result.
+ return old_handler.apply( this, arguments );
+ };
+ }
+ });
+
+ // If the event is not supported natively, this handler will be bound to
+ // the window resize event to simulate the orientationchange event.
+ function handler() {
+ // Get the current orientation.
+ var orientation = get_orientation();
+
+ if ( orientation !== last_orientation ) {
+ // The orientation has changed, so trigger the orientationchange event.
+ last_orientation = orientation;
+ win.trigger( event_name );
+ }
+ }
+
+ // Get the current page orientation. This method is exposed publicly, should it
+ // be needed, as jQuery.event.special.orientationchange.orientation()
+ $.event.special.orientationchange.orientation = get_orientation = function() {
+ var isPortrait = true, elem = document.documentElement;
+
+ // prefer window orientation to the calculation based on screensize as
+ // the actual screen resize takes place before or after the orientation change event
+ // has been fired depending on implementation (eg android 2.3 is before, iphone after).
+ // More testing is required to determine if a more reliable method of determining the new screensize
+ // is possible when orientationchange is fired. (eg, use media queries + element + opacity)
+ if ( $.support.orientation ) {
+ // if the window orientation registers as 0 or 180 degrees report
+ // portrait, otherwise landscape
+ isPortrait = portrait_map[ window.orientation ];
+ } else {
+ isPortrait = elem && elem.clientWidth / elem.clientHeight < 1.1;
+ }
+
+ return isPortrait ? "portrait" : "landscape";
+ };
+
+ $.fn[ event_name ] = function( fn ) {
+ return fn ? this.bind( event_name, fn ) : this.trigger( event_name );
+ };
+
+ // jQuery < 1.8
+ if ( $.attrFn ) {
+ $.attrFn[ event_name ] = true;
+ }
+
+}( jQuery, this ));
+
--- /dev/null
+
+ // throttled resize event
+ (function( $ ) {
+ $.event.special.throttledresize = {
+ setup: function() {
+ $( this ).bind( "resize", handler );
+ },
+ teardown: function() {
+ $( this ).unbind( "resize", handler );
+ }
+ };
+
+ var throttle = 250,
+ handler = function() {
+ curr = ( new Date() ).getTime();
+ diff = curr - lastCall;
+
+ if ( diff >= throttle ) {
+
+ lastCall = curr;
+ $( this ).trigger( "throttledresize" );
+
+ } else {
+
+ if ( heldCall ) {
+ clearTimeout( heldCall );
+ }
+
+ // Promise a held call will still execute
+ heldCall = setTimeout( handler, throttle - diff );
+ }
+ },
+ lastCall = 0,
+ heldCall,
+ curr,
+ diff;
+ })( jQuery );
--- /dev/null
+
+(function( $, window, undefined ) {
+ // add new event shortcuts
+ $.each( ( "touchstart touchmove touchend " +
+ "tap taphold " +
+ "swipe swipeleft swiperight " +
+ "scrollstart scrollstop" ).split( " " ), function( i, name ) {
+
+ $.fn[ name ] = function( fn ) {
+ return fn ? this.bind( name, fn ) : this.trigger( name );
+ };
+
+ // jQuery < 1.8
+ if ( $.attrFn ) {
+ $.attrFn[ name ] = true;
+ }
+ });
+
+ var supportTouch = $.mobile.support.touch,
+ scrollEvent = "touchmove scroll",
+ touchStartEvent = supportTouch ? "touchstart" : "mousedown",
+ touchStopEvent = supportTouch ? "touchend" : "mouseup",
+ touchMoveEvent = supportTouch ? "touchmove" : "mousemove";
+
+ function triggerCustomEvent( obj, eventType, event ) {
+ var originalType = event.type;
+ event.type = eventType;
+ // event.liveFired is already set by basic events, e.g. vclick, which is fired already.
+ // To fire this custom event, event.liveFired must be cleared.
+ event.liveFired = undefined;
+
+ $.event.handle.call( obj, event );
+ event.type = originalType;
+ }
+
+ // also handles scrollstop
+ $.event.special.scrollstart = {
+
+ enabled: true,
+
+ setup: function() {
+
+ var thisObject = this,
+ $this = $( thisObject ),
+ scrolling,
+ timer;
+
+ function trigger( event, state ) {
+ scrolling = state;
+ triggerCustomEvent( thisObject, scrolling ? "scrollstart" : "scrollstop", event );
+ }
+
+ // iPhone triggers scroll after a small delay; use touchmove instead
+ $this.bind( scrollEvent, function( event ) {
+
+ if ( !$.event.special.scrollstart.enabled ) {
+ return;
+ }
+
+ if ( !scrolling ) {
+ trigger( event, true );
+ }
+
+ clearTimeout( timer );
+ timer = setTimeout( function() {
+ trigger( event, false );
+ }, 50 );
+ });
+ }
+ };
+
+ // also handles taphold
+ $.event.special.tap = {
+ tapholdThreshold: 750,
+
+ setup: function() {
+ var thisObject = this,
+ $this = $( thisObject );
+
+ $this.bind( "vmousedown", function( event ) {
+
+ if ( event.which && event.which !== 1 ) {
+ return false;
+ }
+
+ var origTarget = event.target,
+ origEvent = event.originalEvent,
+ timer;
+
+ function clearTapTimer() {
+ clearTimeout( timer );
+ }
+
+ function clearTapHandlers() {
+ clearTapTimer();
+
+ $this.unbind( "vclick", clickHandler )
+ .unbind( "vmouseup", clearTapTimer );
+ $.mobile.$document.unbind( "vmousecancel", clearTapHandlers );
+ }
+
+ function clickHandler( event ) {
+ clearTapHandlers();
+
+ // ONLY trigger a 'tap' event if the start target is
+ // the same as the stop target.
+ if ( origTarget === event.target ) {
+ triggerCustomEvent( thisObject, "tap", event );
+ }
+ }
+
+ $this.bind( "vmouseup", clearTapTimer )
+ .bind( "vclick", clickHandler );
+ $.mobile.$document.bind( "vmousecancel", clearTapHandlers );
+
+ timer = setTimeout( function() {
+ triggerCustomEvent( thisObject, "taphold", $.Event( "taphold", { target: origTarget } ) );
+ }, $.event.special.tap.tapholdThreshold );
+ });
+ }
+ };
+
+ // also handles swipeleft, swiperight
+ $.event.special.swipe = {
+ scrollSupressionThreshold: 30, // More than this horizontal displacement, and we will suppress scrolling.
+
+ durationThreshold: 1000, // More time than this, and it isn't a swipe.
+
+ horizontalDistanceThreshold: 30, // Swipe horizontal displacement must be more than this.
+
+ verticalDistanceThreshold: 75, // Swipe vertical displacement must be less than this.
+
+ setup: function() {
+ var thisObject = this,
+ $this = $( thisObject );
+
+ $this.bind( touchStartEvent, function( event ) {
+ var data = event.originalEvent.touches ?
+ event.originalEvent.touches[ 0 ] : event,
+ start = {
+ time: ( new Date() ).getTime(),
+ coords: [ data.pageX, data.pageY ],
+ origin: $( event.target )
+ },
+ stop;
+
+ function moveHandler( event ) {
+
+ if ( !start ) {
+ return;
+ }
+
+ var data = event.originalEvent.touches ?
+ event.originalEvent.touches[ 0 ] : event;
+
+ stop = {
+ time: ( new Date() ).getTime(),
+ coords: [ data.pageX, data.pageY ]
+ };
+
+ // prevent scrolling
+ if ( Math.abs( start.coords[ 0 ] - stop.coords[ 0 ] ) > $.event.special.swipe.scrollSupressionThreshold ) {
+ event.preventDefault();
+ }
+ }
+
+ $this.bind( touchMoveEvent, moveHandler )
+ .one( touchStopEvent, function( event ) {
+ $this.unbind( touchMoveEvent, moveHandler );
+
+ if ( start && stop ) {
+ if ( stop.time - start.time < $.event.special.swipe.durationThreshold &&
+ Math.abs( start.coords[ 0 ] - stop.coords[ 0 ] ) > $.event.special.swipe.horizontalDistanceThreshold &&
+ Math.abs( start.coords[ 1 ] - stop.coords[ 1 ] ) < $.event.special.swipe.verticalDistanceThreshold ) {
+
+ start.origin.trigger( "swipe" )
+ .trigger( start.coords[0] > stop.coords[ 0 ] ? "swipeleft" : "swiperight" );
+ }
+ }
+ start = stop = undefined;
+ });
+ });
+ }
+ };
+ $.each({
+ scrollstop: "scrollstart",
+ taphold: "tap",
+ swipeleft: "swipe",
+ swiperight: "swipe"
+ }, function( event, sourceEvent ) {
+
+ $.event.special[ event ] = {
+ setup: function() {
+ $( this ).bind( sourceEvent, $.noop );
+ }
+ };
+ });
+
+})( jQuery, this );
--- /dev/null
+<?php
+$type = 'text/javascript';
+$files = array(
+ '../LICENSE-INFO.txt',
+ // note that define is only included here as a means
+ // to revert to the pre async include, and should not be
+ // used in other build methods
+ 'jquery.mobile.define.js',
+ 'jquery.ui.widget.js',
+ 'jquery.mobile.widget.js',
+ 'jquery.mobile.media.js',
+ 'jquery.mobile.support.touch.js',
+ 'jquery.mobile.support.orientation.js',
+ 'jquery.mobile.support.js',
+ 'jquery.mobile.vmouse.js',
+ 'events/touch.js',
+ 'events/throttledresize.js',
+ 'events/orientationchange.js',
+ 'jquery.hashchange.js',
+ 'widgets/page.js',
+ 'jquery.mobile.core.js',
+ 'widgets/loader.js',
+ 'jquery.mobile.navigation.js',
+ 'jquery.mobile.navigation.pushstate.js',
+ 'jquery.mobile.transition.js',
+ 'transitions/pop.js',
+ 'transitions/slide.js',
+ 'transitions/slidedown.js',
+ 'transitions/slideup.js',
+ 'transitions/flip.js',
+ 'transitions/flow.js',
+ 'transitions/turn.js',
+ 'jquery.mobile.degradeInputs.js',
+ 'widgets/dialog.js',
+ 'widgets/page.sections.js',
+ 'widgets/collapsible.js',
+ 'widgets/collapsibleSet.js',
+ 'jquery.mobile.fieldContain.js',
+ 'jquery.mobile.grid.js',
+ 'widgets/navbar.js',
+ 'widgets/listview.js',
+ 'widgets/listview.filter.js',
+ 'widgets/listview.autodividers.js',
+ 'jquery.mobile.nojs.js',
+ 'widgets/forms/checkboxradio.js',
+ 'widgets/forms/button.js',
+ 'widgets/forms/slider.js',
+ 'widgets/forms/textinput.js',
+ 'widgets/forms/select.custom.js',
+ 'widgets/forms/select.js',
+ 'jquery.mobile.buttonMarkup.js',
+ 'jquery.mobile.controlGroup.js',
+ 'jquery.mobile.links.js',
+ 'widgets/fixedToolbar.js',
+ 'widgets/popup.js',
+ 'jquery.mobile.zoom.js',
+ 'jquery.mobile.zoom.iosorientationfix.js',
+ 'jquery.mobile.init.js'
+);
+
+require_once('../combine.php');
--- /dev/null
+// Script: jQuery hashchange event
+//
+// *Version: 1.3, Last updated: 7/21/2010*
+//
+// Project Home - http://benalman.com/projects/jquery-hashchange-plugin/
+// GitHub - http://github.com/cowboy/jquery-hashchange/
+// Source - http://github.com/cowboy/jquery-hashchange/raw/master/jquery.ba-hashchange.js
+// (Minified) - http://github.com/cowboy/jquery-hashchange/raw/master/jquery.ba-hashchange.min.js (0.8kb gzipped)
+//
+// About: License
+//
+// Copyright (c) 2010 "Cowboy" Ben Alman,
+// Dual licensed under the MIT and GPL licenses.
+// http://benalman.com/about/license/
+//
+// About: Examples
+//
+// These working examples, complete with fully commented code, illustrate a few
+// ways in which this plugin can be used.
+//
+// hashchange event - http://benalman.com/code/projects/jquery-hashchange/examples/hashchange/
+// document.domain - http://benalman.com/code/projects/jquery-hashchange/examples/document_domain/
+//
+// About: Support and Testing
+//
+// Information about what version or versions of jQuery this plugin has been
+// tested with, what browsers it has been tested in, and where the unit tests
+// reside (so you can test it yourself).
+//
+// jQuery Versions - 1.2.6, 1.3.2, 1.4.1, 1.4.2
+// Browsers Tested - Internet Explorer 6-8, Firefox 2-4, Chrome 5-6, Safari 3.2-5,
+// Opera 9.6-10.60, iPhone 3.1, Android 1.6-2.2, BlackBerry 4.6-5.
+// Unit Tests - http://benalman.com/code/projects/jquery-hashchange/unit/
+//
+// About: Known issues
+//
+// While this jQuery hashchange event implementation is quite stable and
+// robust, there are a few unfortunate browser bugs surrounding expected
+// hashchange event-based behaviors, independent of any JavaScript
+// window.onhashchange abstraction. See the following examples for more
+// information:
+//
+// Chrome: Back Button - http://benalman.com/code/projects/jquery-hashchange/examples/bug-chrome-back-button/
+// Firefox: Remote XMLHttpRequest - http://benalman.com/code/projects/jquery-hashchange/examples/bug-firefox-remote-xhr/
+// WebKit: Back Button in an Iframe - http://benalman.com/code/projects/jquery-hashchange/examples/bug-webkit-hash-iframe/
+// Safari: Back Button from a different domain - http://benalman.com/code/projects/jquery-hashchange/examples/bug-safari-back-from-diff-domain/
+//
+// Also note that should a browser natively support the window.onhashchange
+// event, but not report that it does, the fallback polling loop will be used.
+//
+// About: Release History
+//
+// 1.3 - (7/21/2010) Reorganized IE6/7 Iframe code to make it more
+// "removable" for mobile-only development. Added IE6/7 document.title
+// support. Attempted to make Iframe as hidden as possible by using
+// techniques from http://www.paciellogroup.com/blog/?p=604. Added
+// support for the "shortcut" format $(window).hashchange( fn ) and
+// $(window).hashchange() like jQuery provides for built-in events.
+// Renamed jQuery.hashchangeDelay to <jQuery.fn.hashchange.delay> and
+// lowered its default value to 50. Added <jQuery.fn.hashchange.domain>
+// and <jQuery.fn.hashchange.src> properties plus document-domain.html
+// file to address access denied issues when setting document.domain in
+// IE6/7.
+// 1.2 - (2/11/2010) Fixed a bug where coming back to a page using this plugin
+// from a page on another domain would cause an error in Safari 4. Also,
+// IE6/7 Iframe is now inserted after the body (this actually works),
+// which prevents the page from scrolling when the event is first bound.
+// Event can also now be bound before DOM ready, but it won't be usable
+// before then in IE6/7.
+// 1.1 - (1/21/2010) Incorporated document.documentMode test to fix IE8 bug
+// where browser version is incorrectly reported as 8.0, despite
+// inclusion of the X-UA-Compatible IE=EmulateIE7 meta tag.
+// 1.0 - (1/9/2010) Initial Release. Broke out the jQuery BBQ event.special
+// window.onhashchange functionality into a separate plugin for users
+// who want just the basic event & back button support, without all the
+// extra awesomeness that BBQ provides. This plugin will be included as
+// part of jQuery BBQ, but also be available separately.
+
+(function( $, window, undefined ) {
+ // Reused string.
+ var str_hashchange = 'hashchange',
+
+ // Method / object references.
+ doc = document,
+ fake_onhashchange,
+ special = $.event.special,
+
+ // Does the browser support window.onhashchange? Note that IE8 running in
+ // IE7 compatibility mode reports true for 'onhashchange' in window, even
+ // though the event isn't supported, so also test document.documentMode.
+ doc_mode = doc.documentMode,
+ supports_onhashchange = 'on' + str_hashchange in window && ( doc_mode === undefined || doc_mode > 7 );
+
+ // Get location.hash (or what you'd expect location.hash to be) sans any
+ // leading #. Thanks for making this necessary, Firefox!
+ function get_fragment( url ) {
+ url = url || location.href;
+ return '#' + url.replace( /^[^#]*#?(.*)$/, '$1' );
+ };
+
+ // Method: jQuery.fn.hashchange
+ //
+ // Bind a handler to the window.onhashchange event or trigger all bound
+ // window.onhashchange event handlers. This behavior is consistent with
+ // jQuery's built-in event handlers.
+ //
+ // Usage:
+ //
+ // > jQuery(window).hashchange( [ handler ] );
+ //
+ // Arguments:
+ //
+ // handler - (Function) Optional handler to be bound to the hashchange
+ // event. This is a "shortcut" for the more verbose form:
+ // jQuery(window).bind( 'hashchange', handler ). If handler is omitted,
+ // all bound window.onhashchange event handlers will be triggered. This
+ // is a shortcut for the more verbose
+ // jQuery(window).trigger( 'hashchange' ). These forms are described in
+ // the <hashchange event> section.
+ //
+ // Returns:
+ //
+ // (jQuery) The initial jQuery collection of elements.
+
+ // Allow the "shortcut" format $(elem).hashchange( fn ) for binding and
+ // $(elem).hashchange() for triggering, like jQuery does for built-in events.
+ $.fn[ str_hashchange ] = function( fn ) {
+ return fn ? this.bind( str_hashchange, fn ) : this.trigger( str_hashchange );
+ };
+
+ // Property: jQuery.fn.hashchange.delay
+ //
+ // The numeric interval (in milliseconds) at which the <hashchange event>
+ // polling loop executes. Defaults to 50.
+
+ // Property: jQuery.fn.hashchange.domain
+ //
+ // If you're setting document.domain in your JavaScript, and you want hash
+ // history to work in IE6/7, not only must this property be set, but you must
+ // also set document.domain BEFORE jQuery is loaded into the page. This
+ // property is only applicable if you are supporting IE6/7 (or IE8 operating
+ // in "IE7 compatibility" mode).
+ //
+ // In addition, the <jQuery.fn.hashchange.src> property must be set to the
+ // path of the included "document-domain.html" file, which can be renamed or
+ // modified if necessary (note that the document.domain specified must be the
+ // same in both your main JavaScript as well as in this file).
+ //
+ // Usage:
+ //
+ // jQuery.fn.hashchange.domain = document.domain;
+
+ // Property: jQuery.fn.hashchange.src
+ //
+ // If, for some reason, you need to specify an Iframe src file (for example,
+ // when setting document.domain as in <jQuery.fn.hashchange.domain>), you can
+ // do so using this property. Note that when using this property, history
+ // won't be recorded in IE6/7 until the Iframe src file loads. This property
+ // is only applicable if you are supporting IE6/7 (or IE8 operating in "IE7
+ // compatibility" mode).
+ //
+ // Usage:
+ //
+ // jQuery.fn.hashchange.src = 'path/to/file.html';
+
+ $.fn[ str_hashchange ].delay = 50;
+ /*
+ $.fn[ str_hashchange ].domain = null;
+ $.fn[ str_hashchange ].src = null;
+ */
+
+ // Event: hashchange event
+ //
+ // Fired when location.hash changes. In browsers that support it, the native
+ // HTML5 window.onhashchange event is used, otherwise a polling loop is
+ // initialized, running every <jQuery.fn.hashchange.delay> milliseconds to
+ // see if the hash has changed. In IE6/7 (and IE8 operating in "IE7
+ // compatibility" mode), a hidden Iframe is created to allow the back button
+ // and hash-based history to work.
+ //
+ // Usage as described in <jQuery.fn.hashchange>:
+ //
+ // > // Bind an event handler.
+ // > jQuery(window).hashchange( function(e) {
+ // > var hash = location.hash;
+ // > ...
+ // > });
+ // >
+ // > // Manually trigger the event handler.
+ // > jQuery(window).hashchange();
+ //
+ // A more verbose usage that allows for event namespacing:
+ //
+ // > // Bind an event handler.
+ // > jQuery(window).bind( 'hashchange', function(e) {
+ // > var hash = location.hash;
+ // > ...
+ // > });
+ // >
+ // > // Manually trigger the event handler.
+ // > jQuery(window).trigger( 'hashchange' );
+ //
+ // Additional Notes:
+ //
+ // * The polling loop and Iframe are not created until at least one handler
+ // is actually bound to the 'hashchange' event.
+ // * If you need the bound handler(s) to execute immediately, in cases where
+ // a location.hash exists on page load, via bookmark or page refresh for
+ // example, use jQuery(window).hashchange() or the more verbose
+ // jQuery(window).trigger( 'hashchange' ).
+ // * The event can be bound before DOM ready, but since it won't be usable
+ // before then in IE6/7 (due to the necessary Iframe), recommended usage is
+ // to bind it inside a DOM ready handler.
+
+ // Override existing $.event.special.hashchange methods (allowing this plugin
+ // to be defined after jQuery BBQ in BBQ's source code).
+ special[ str_hashchange ] = $.extend( special[ str_hashchange ], {
+
+ // Called only when the first 'hashchange' event is bound to window.
+ setup: function() {
+ // If window.onhashchange is supported natively, there's nothing to do..
+ if ( supports_onhashchange ) { return false; }
+
+ // Otherwise, we need to create our own. And we don't want to call this
+ // until the user binds to the event, just in case they never do, since it
+ // will create a polling loop and possibly even a hidden Iframe.
+ $( fake_onhashchange.start );
+ },
+
+ // Called only when the last 'hashchange' event is unbound from window.
+ teardown: function() {
+ // If window.onhashchange is supported natively, there's nothing to do..
+ if ( supports_onhashchange ) { return false; }
+
+ // Otherwise, we need to stop ours (if possible).
+ $( fake_onhashchange.stop );
+ }
+
+ });
+
+ // fake_onhashchange does all the work of triggering the window.onhashchange
+ // event for browsers that don't natively support it, including creating a
+ // polling loop to watch for hash changes and in IE 6/7 creating a hidden
+ // Iframe to enable back and forward.
+ fake_onhashchange = (function() {
+ var self = {},
+ timeout_id,
+
+ // Remember the initial hash so it doesn't get triggered immediately.
+ last_hash = get_fragment(),
+
+ fn_retval = function( val ) { return val; },
+ history_set = fn_retval,
+ history_get = fn_retval;
+
+ // Start the polling loop.
+ self.start = function() {
+ timeout_id || poll();
+ };
+
+ // Stop the polling loop.
+ self.stop = function() {
+ timeout_id && clearTimeout( timeout_id );
+ timeout_id = undefined;
+ };
+
+ // This polling loop checks every $.fn.hashchange.delay milliseconds to see
+ // if location.hash has changed, and triggers the 'hashchange' event on
+ // window when necessary.
+ function poll() {
+ var hash = get_fragment(),
+ history_hash = history_get( last_hash );
+
+ if ( hash !== last_hash ) {
+ history_set( last_hash = hash, history_hash );
+
+ $(window).trigger( str_hashchange );
+
+ } else if ( history_hash !== last_hash ) {
+ location.href = location.href.replace( /#.*/, '' ) + history_hash;
+ }
+
+ timeout_id = setTimeout( poll, $.fn[ str_hashchange ].delay );
+ };
+
+ // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
+ // vvvvvvvvvvvvvvvvvvv REMOVE IF NOT SUPPORTING IE6/7/8 vvvvvvvvvvvvvvvvvvv
+ // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
+ $.browser.msie && !supports_onhashchange && (function() {
+ // Not only do IE6/7 need the "magical" Iframe treatment, but so does IE8
+ // when running in "IE7 compatibility" mode.
+
+ var iframe,
+ iframe_src;
+
+ // When the event is bound and polling starts in IE 6/7, create a hidden
+ // Iframe for history handling.
+ self.start = function() {
+ if ( !iframe ) {
+ iframe_src = $.fn[ str_hashchange ].src;
+ iframe_src = iframe_src && iframe_src + get_fragment();
+
+ // Create hidden Iframe. Attempt to make Iframe as hidden as possible
+ // by using techniques from http://www.paciellogroup.com/blog/?p=604.
+ iframe = $('<iframe tabindex="-1" title="empty"/>').hide()
+
+ // When Iframe has completely loaded, initialize the history and
+ // start polling.
+ .one( 'load', function() {
+ iframe_src || history_set( get_fragment() );
+ poll();
+ })
+
+ // Load Iframe src if specified, otherwise nothing.
+ .attr( 'src', iframe_src || 'javascript:0' )
+
+ // Append Iframe after the end of the body to prevent unnecessary
+ // initial page scrolling (yes, this works).
+ .insertAfter( 'body' )[0].contentWindow;
+
+ // Whenever `document.title` changes, update the Iframe's title to
+ // prettify the back/next history menu entries. Since IE sometimes
+ // errors with "Unspecified error" the very first time this is set
+ // (yes, very useful) wrap this with a try/catch block.
+ doc.onpropertychange = function() {
+ try {
+ if ( event.propertyName === 'title' ) {
+ iframe.document.title = doc.title;
+ }
+ } catch(e) {}
+ };
+
+ }
+ };
+
+ // Override the "stop" method since an IE6/7 Iframe was created. Even
+ // if there are no longer any bound event handlers, the polling loop
+ // is still necessary for back/next to work at all!
+ self.stop = fn_retval;
+
+ // Get history by looking at the hidden Iframe's location.hash.
+ history_get = function() {
+ return get_fragment( iframe.location.href );
+ };
+
+ // Set a new history item by opening and then closing the Iframe
+ // document, *then* setting its location.hash. If document.domain has
+ // been set, update that as well.
+ history_set = function( hash, history_hash ) {
+ var iframe_doc = iframe.document,
+ domain = $.fn[ str_hashchange ].domain;
+
+ if ( hash !== history_hash ) {
+ // Update Iframe with any initial `document.title` that might be set.
+ iframe_doc.title = doc.title;
+
+ // Opening the Iframe's document after it has been closed is what
+ // actually adds a history entry.
+ iframe_doc.open();
+
+ // Set document.domain for the Iframe document as well, if necessary.
+ domain && iframe_doc.write( '<script>document.domain="' + domain + '"</script>' );
+
+ iframe_doc.close();
+
+ // Update the Iframe's hash, for great justice.
+ iframe.location.hash = hash;
+ }
+ };
+
+ })();
+ // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ // ^^^^^^^^^^^^^^^^^^^ REMOVE IF NOT SUPPORTING IE6/7/8 ^^^^^^^^^^^^^^^^^^^
+ // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+ return self;
+ })();
+
+})(jQuery,this);
/*!
- * jQuery JavaScript Library v1.7.1
+ * jQuery JavaScript Library v1.8.2
* http://jquery.com/
*
- * Copyright 2011, John Resig
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
* Includes Sizzle.js
* http://sizzlejs.com/
- * Copyright 2011, The Dojo Foundation
- * Released under the MIT, BSD, and GPL Licenses.
*
- * Date: Mon Nov 21 21:11:03 2011 -0500
+ * Copyright 2012 jQuery Foundation and other contributors
+ * Released under the MIT license
+ * http://jquery.org/license
+ *
+ * Date: Thu Sep 20 2012 21:13:05 GMT-0400 (Eastern Daylight Time)
*/
(function( window, undefined ) {
+var
+ // A central reference to the root jQuery(document)
+ rootjQuery,
-// Use the correct document accordingly with window argument (sandbox)
-var document = window.document,
- navigator = window.navigator,
- location = window.location;
-var jQuery = (function() {
+ // The deferred used on DOM ready
+ readyList,
-// Define a local copy of jQuery
-var jQuery = function( selector, context ) {
- // The jQuery object is actually just the init constructor 'enhanced'
- return new jQuery.fn.init( selector, context, rootjQuery );
- },
+ // Use the correct document accordingly with window argument (sandbox)
+ document = window.document,
+ location = window.location,
+ navigator = window.navigator,
// Map over jQuery in case of overwrite
_jQuery = window.jQuery,
// Map over the $ in case of overwrite
_$ = window.$,
- // A central reference to the root jQuery(document)
- rootjQuery,
+ // Save a reference to some core methods
+ core_push = Array.prototype.push,
+ core_slice = Array.prototype.slice,
+ core_indexOf = Array.prototype.indexOf,
+ core_toString = Object.prototype.toString,
+ core_hasOwn = Object.prototype.hasOwnProperty,
+ core_trim = String.prototype.trim,
+
+ // Define a local copy of jQuery
+ jQuery = function( selector, context ) {
+ // The jQuery object is actually just the init constructor 'enhanced'
+ return new jQuery.fn.init( selector, context, rootjQuery );
+ },
- // A simple way to check for HTML strings or ID strings
- // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
- quickExpr = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,
+ // Used for matching numbers
+ core_pnum = /[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,
- // Check if a string has a non-whitespace character in it
- rnotwhite = /\S/,
+ // Used for detecting and trimming whitespace
+ core_rnotwhite = /\S/,
+ core_rspace = /\s+/,
- // Used for trimming whitespace
- trimLeft = /^\s+/,
- trimRight = /\s+$/,
+ // Make sure we trim BOM and NBSP (here's looking at you, Safari 5.0 and IE)
+ rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
+
+ // A simple way to check for HTML strings
+ // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
+ rquickExpr = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,
// Match a standalone tag
- rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/,
+ rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>|)$/,
// JSON RegExp
rvalidchars = /^[\],:{}\s]*$/,
- rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,
- rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,
-
- // Useragent RegExp
- rwebkit = /(webkit)[ \/]([\w.]+)/,
- ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/,
- rmsie = /(msie) ([\w.]+)/,
- rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/,
+ rvalidescape = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,
+ rvalidtokens = /"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,
// Matches dashed string for camelizing
- rdashAlpha = /-([a-z]|[0-9])/ig,
rmsPrefix = /^-ms-/,
+ rdashAlpha = /-([\da-z])/gi,
// Used by jQuery.camelCase as callback to replace()
fcamelCase = function( all, letter ) {
return ( letter + "" ).toUpperCase();
},
- // Keep a UserAgent string for use with jQuery.browser
- userAgent = navigator.userAgent,
-
- // For matching the engine and version of the browser
- browserMatch,
-
- // The deferred used on DOM ready
- readyList,
-
- // The ready event handler
- DOMContentLoaded,
-
- // Save a reference to some core methods
- toString = Object.prototype.toString,
- hasOwn = Object.prototype.hasOwnProperty,
- push = Array.prototype.push,
- slice = Array.prototype.slice,
- trim = String.prototype.trim,
- indexOf = Array.prototype.indexOf,
+ // The ready event handler and self cleanup method
+ DOMContentLoaded = function() {
+ if ( document.addEventListener ) {
+ document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false );
+ jQuery.ready();
+ } else if ( document.readyState === "complete" ) {
+ // we're here because readyState === "complete" in oldIE
+ // which is good enough for us to call the dom ready!
+ document.detachEvent( "onreadystatechange", DOMContentLoaded );
+ jQuery.ready();
+ }
+ },
// [[Class]] -> type pairs
class2type = {};
init: function( selector, context, rootjQuery ) {
var match, elem, ret, doc;
- // Handle $(""), $(null), or $(undefined)
+ // Handle $(""), $(null), $(undefined), $(false)
if ( !selector ) {
return this;
}
return this;
}
- // The body element only exists once, optimize finding it
- if ( selector === "body" && !context && document.body ) {
- this.context = document;
- this[0] = document.body;
- this.selector = selector;
- this.length = 1;
- return this;
- }
-
// Handle HTML strings
if ( typeof selector === "string" ) {
- // Are we dealing with HTML string or an ID?
if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) {
// Assume that strings that start and end with <> are HTML and skip the regex check
match = [ null, selector, null ];
} else {
- match = quickExpr.exec( selector );
+ match = rquickExpr.exec( selector );
}
- // Verify a match, and that no context was specified for #id
+ // Match html or make sure no context is specified for #id
if ( match && (match[1] || !context) ) {
// HANDLE: $(html) -> $(array)
if ( match[1] ) {
context = context instanceof jQuery ? context[0] : context;
- doc = ( context ? context.ownerDocument || context : document );
-
- // If a single string is passed in and it's a single tag
- // just do a createElement and skip the rest
- ret = rsingleTag.exec( selector );
-
- if ( ret ) {
- if ( jQuery.isPlainObject( context ) ) {
- selector = [ document.createElement( ret[1] ) ];
- jQuery.fn.attr.call( selector, context, true );
-
- } else {
- selector = [ doc.createElement( ret[1] ) ];
- }
+ doc = ( context && context.nodeType ? context.ownerDocument || context : document );
- } else {
- ret = jQuery.buildFragment( [ match[1] ], [ doc ] );
- selector = ( ret.cacheable ? jQuery.clone(ret.fragment) : ret.fragment ).childNodes;
+ // scripts is true for back-compat
+ selector = jQuery.parseHTML( match[1], doc, true );
+ if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) {
+ this.attr.call( selector, context, true );
}
return jQuery.merge( this, selector );
- // HANDLE: $("#id")
+ // HANDLE: $(#id)
} else {
elem = document.getElementById( match[2] );
selector: "",
// The current version of jQuery being used
- jquery: "1.7.1",
+ jquery: "1.8.2",
// The default length of a jQuery object is 0
length: 0,
},
toArray: function() {
- return slice.call( this, 0 );
+ return core_slice.call( this );
},
// Get the Nth element in the matched element set OR
// Take an array of elements and push it onto the stack
// (returning the new matched element set)
pushStack: function( elems, name, selector ) {
- // Build a new jQuery matched element set
- var ret = this.constructor();
- if ( jQuery.isArray( elems ) ) {
- push.apply( ret, elems );
-
- } else {
- jQuery.merge( ret, elems );
- }
+ // Build a new jQuery matched element set
+ var ret = jQuery.merge( this.constructor(), elems );
// Add the old object onto the stack (as a reference)
ret.prevObject = this;
},
ready: function( fn ) {
- // Attach the listeners
- jQuery.bindReady();
-
// Add the callback
- readyList.add( fn );
+ jQuery.ready.promise().done( fn );
return this;
},
},
slice: function() {
- return this.pushStack( slice.apply( this, arguments ),
- "slice", slice.call(arguments).join(",") );
+ return this.pushStack( core_slice.apply( this, arguments ),
+ "slice", core_slice.call(arguments).join(",") );
},
map: function( callback ) {
// For internal use only.
// Behaves like an Array's method, not like a jQuery method.
- push: push,
+ push: core_push,
sort: [].sort,
splice: [].splice
};
// Handle when the DOM is ready
ready: function( wait ) {
- // Either a released hold or an DOMready/load event and not yet ready
- if ( (wait === true && !--jQuery.readyWait) || (wait !== true && !jQuery.isReady) ) {
- // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
- if ( !document.body ) {
- return setTimeout( jQuery.ready, 1 );
- }
-
- // Remember that the DOM is ready
- jQuery.isReady = true;
-
- // If a normal DOM Ready event fired, decrement, and wait if need be
- if ( wait !== true && --jQuery.readyWait > 0 ) {
- return;
- }
-
- // If there are functions bound, to execute
- readyList.fireWith( document, [ jQuery ] );
-
- // Trigger any bound ready events
- if ( jQuery.fn.trigger ) {
- jQuery( document ).trigger( "ready" ).off( "ready" );
- }
- }
- },
- bindReady: function() {
- if ( readyList ) {
+ // Abort if there are pending holds or we're already ready
+ if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
return;
}
- readyList = jQuery.Callbacks( "once memory" );
-
- // Catch cases where $(document).ready() is called after the
- // browser event has already occurred.
- if ( document.readyState === "complete" ) {
- // Handle it asynchronously to allow scripts the opportunity to delay ready
+ // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
+ if ( !document.body ) {
return setTimeout( jQuery.ready, 1 );
}
- // Mozilla, Opera and webkit nightlies currently support this event
- if ( document.addEventListener ) {
- // Use the handy event callback
- document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false );
-
- // A fallback to window.onload, that will always work
- window.addEventListener( "load", jQuery.ready, false );
-
- // If IE event model is used
- } else if ( document.attachEvent ) {
- // ensure firing before onload,
- // maybe late but safe also for iframes
- document.attachEvent( "onreadystatechange", DOMContentLoaded );
-
- // A fallback to window.onload, that will always work
- window.attachEvent( "onload", jQuery.ready );
+ // Remember that the DOM is ready
+ jQuery.isReady = true;
- // If IE and not a frame
- // continually check to see if the document is ready
- var toplevel = false;
+ // If a normal DOM Ready event fired, decrement, and wait if need be
+ if ( wait !== true && --jQuery.readyWait > 0 ) {
+ return;
+ }
- try {
- toplevel = window.frameElement == null;
- } catch(e) {}
+ // If there are functions bound, to execute
+ readyList.resolveWith( document, [ jQuery ] );
- if ( document.documentElement.doScroll && toplevel ) {
- doScrollCheck();
- }
+ // Trigger any bound ready events
+ if ( jQuery.fn.trigger ) {
+ jQuery( document ).trigger("ready").off("ready");
}
},
return jQuery.type(obj) === "array";
},
- // A crude way of determining if an object is a window
isWindow: function( obj ) {
- return obj && typeof obj === "object" && "setInterval" in obj;
+ return obj != null && obj == obj.window;
},
isNumeric: function( obj ) {
type: function( obj ) {
return obj == null ?
String( obj ) :
- class2type[ toString.call(obj) ] || "object";
+ class2type[ core_toString.call(obj) ] || "object";
},
isPlainObject: function( obj ) {
try {
// Not own constructor property must be Object
if ( obj.constructor &&
- !hasOwn.call(obj, "constructor") &&
- !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
+ !core_hasOwn.call(obj, "constructor") &&
+ !core_hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
return false;
}
} catch ( e ) {
var key;
for ( key in obj ) {}
- return key === undefined || hasOwn.call( obj, key );
+ return key === undefined || core_hasOwn.call( obj, key );
},
isEmptyObject: function( obj ) {
- for ( var name in obj ) {
+ var name;
+ for ( name in obj ) {
return false;
}
return true;
throw new Error( msg );
},
+ // data: string of html
+ // context (optional): If specified, the fragment will be created in this context, defaults to document
+ // scripts (optional): If true, will include scripts passed in the html string
+ parseHTML: function( data, context, scripts ) {
+ var parsed;
+ if ( !data || typeof data !== "string" ) {
+ return null;
+ }
+ if ( typeof context === "boolean" ) {
+ scripts = context;
+ context = 0;
+ }
+ context = context || document;
+
+ // Single tag
+ if ( (parsed = rsingleTag.exec( data )) ) {
+ return [ context.createElement( parsed[1] ) ];
+ }
+
+ parsed = jQuery.buildFragment( [ data ], context, scripts ? null : [] );
+ return jQuery.merge( [],
+ (parsed.cacheable ? jQuery.clone( parsed.fragment ) : parsed.fragment).childNodes );
+ },
+
parseJSON: function( data ) {
- if ( typeof data !== "string" || !data ) {
+ if ( !data || typeof data !== "string") {
return null;
}
// Cross-browser xml parsing
parseXML: function( data ) {
var xml, tmp;
+ if ( !data || typeof data !== "string" ) {
+ return null;
+ }
try {
if ( window.DOMParser ) { // Standard
tmp = new DOMParser();
// Workarounds based on findings by Jim Driscoll
// http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context
globalEval: function( data ) {
- if ( data && rnotwhite.test( data ) ) {
+ if ( data && core_rnotwhite.test( data ) ) {
// We use execScript on Internet Explorer
// We use an anonymous function so that context is window
// rather than jQuery in Firefox
},
nodeName: function( elem, name ) {
- return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase();
+ return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
},
// args is for internal usage only
- each: function( object, callback, args ) {
- var name, i = 0,
- length = object.length,
- isObj = length === undefined || jQuery.isFunction( object );
+ each: function( obj, callback, args ) {
+ var name,
+ i = 0,
+ length = obj.length,
+ isObj = length === undefined || jQuery.isFunction( obj );
if ( args ) {
if ( isObj ) {
- for ( name in object ) {
- if ( callback.apply( object[ name ], args ) === false ) {
+ for ( name in obj ) {
+ if ( callback.apply( obj[ name ], args ) === false ) {
break;
}
}
} else {
for ( ; i < length; ) {
- if ( callback.apply( object[ i++ ], args ) === false ) {
+ if ( callback.apply( obj[ i++ ], args ) === false ) {
break;
}
}
// A special, fast, case for the most common use of each
} else {
if ( isObj ) {
- for ( name in object ) {
- if ( callback.call( object[ name ], name, object[ name ] ) === false ) {
+ for ( name in obj ) {
+ if ( callback.call( obj[ name ], name, obj[ name ] ) === false ) {
break;
}
}
} else {
for ( ; i < length; ) {
- if ( callback.call( object[ i ], i, object[ i++ ] ) === false ) {
+ if ( callback.call( obj[ i ], i, obj[ i++ ] ) === false ) {
break;
}
}
}
}
- return object;
+ return obj;
},
// Use native String.trim function wherever possible
- trim: trim ?
+ trim: core_trim && !core_trim.call("\uFEFF\xA0") ?
function( text ) {
return text == null ?
"" :
- trim.call( text );
+ core_trim.call( text );
} :
// Otherwise use our own trimming functionality
function( text ) {
return text == null ?
"" :
- text.toString().replace( trimLeft, "" ).replace( trimRight, "" );
+ ( text + "" ).replace( rtrim, "" );
},
// results is for internal usage only
- makeArray: function( array, results ) {
- var ret = results || [];
+ makeArray: function( arr, results ) {
+ var type,
+ ret = results || [];
- if ( array != null ) {
+ if ( arr != null ) {
// The window, strings (and functions) also have 'length'
// Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930
- var type = jQuery.type( array );
+ type = jQuery.type( arr );
- if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) {
- push.call( ret, array );
+ if ( arr.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( arr ) ) {
+ core_push.call( ret, arr );
} else {
- jQuery.merge( ret, array );
+ jQuery.merge( ret, arr );
}
}
return ret;
},
- inArray: function( elem, array, i ) {
+ inArray: function( elem, arr, i ) {
var len;
- if ( array ) {
- if ( indexOf ) {
- return indexOf.call( array, elem, i );
+ if ( arr ) {
+ if ( core_indexOf ) {
+ return core_indexOf.call( arr, elem, i );
}
- len = array.length;
+ len = arr.length;
i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0;
for ( ; i < len; i++ ) {
// Skip accessing in sparse arrays
- if ( i in array && array[ i ] === elem ) {
+ if ( i in arr && arr[ i ] === elem ) {
return i;
}
}
},
merge: function( first, second ) {
- var i = first.length,
+ var l = second.length,
+ i = first.length,
j = 0;
- if ( typeof second.length === "number" ) {
- for ( var l = second.length; j < l; j++ ) {
+ if ( typeof l === "number" ) {
+ for ( ; j < l; j++ ) {
first[ i++ ] = second[ j ];
}
},
grep: function( elems, callback, inv ) {
- var ret = [], retVal;
+ var retVal,
+ ret = [],
+ i = 0,
+ length = elems.length;
inv = !!inv;
// Go through the array, only saving the items
// that pass the validator function
- for ( var i = 0, length = elems.length; i < length; i++ ) {
+ for ( ; i < length; i++ ) {
retVal = !!callback( elems[ i ], i );
if ( inv !== retVal ) {
ret.push( elems[ i ] );
// arg is for internal usage only
map: function( elems, callback, arg ) {
- var value, key, ret = [],
+ var value, key,
+ ret = [],
i = 0,
length = elems.length,
// jquery objects are treated as arrays
// Bind a function to a context, optionally partially applying any
// arguments.
proxy: function( fn, context ) {
+ var tmp, args, proxy;
+
if ( typeof context === "string" ) {
- var tmp = fn[ context ];
+ tmp = fn[ context ];
context = fn;
fn = tmp;
}
}
// Simulated bind
- var args = slice.call( arguments, 2 ),
- proxy = function() {
- return fn.apply( context, args.concat( slice.call( arguments ) ) );
- };
+ args = core_slice.call( arguments, 2 );
+ proxy = function() {
+ return fn.apply( context, args.concat( core_slice.call( arguments ) ) );
+ };
// Set the guid of unique handler to the same of original handler, so it can be removed
- proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++;
+ proxy.guid = fn.guid = fn.guid || jQuery.guid++;
return proxy;
},
- // Mutifunctional method to get and set values to a collection
+ // Multifunctional method to get and set values of a collection
// The value/s can optionally be executed if it's a function
- access: function( elems, key, value, exec, fn, pass ) {
- var length = elems.length;
+ access: function( elems, fn, key, value, chainable, emptyGet, pass ) {
+ var exec,
+ bulk = key == null,
+ i = 0,
+ length = elems.length;
- // Setting many attributes
- if ( typeof key === "object" ) {
- for ( var k in key ) {
- jQuery.access( elems, k, key[k], exec, fn, value );
+ // Sets many values
+ if ( key && typeof key === "object" ) {
+ for ( i in key ) {
+ jQuery.access( elems, fn, i, key[i], 1, emptyGet, value );
}
- return elems;
- }
+ chainable = 1;
- // Setting one attribute
- if ( value !== undefined ) {
+ // Sets one value
+ } else if ( value !== undefined ) {
// Optionally, function values get executed if exec is true
- exec = !pass && exec && jQuery.isFunction(value);
+ exec = pass === undefined && jQuery.isFunction( value );
+
+ if ( bulk ) {
+ // Bulk operations only iterate when executing function values
+ if ( exec ) {
+ exec = fn;
+ fn = function( elem, key, value ) {
+ return exec.call( jQuery( elem ), value );
+ };
+
+ // Otherwise they run against the entire set
+ } else {
+ fn.call( elems, value );
+ fn = null;
+ }
+ }
- for ( var i = 0; i < length; i++ ) {
- fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass );
+ if ( fn ) {
+ for (; i < length; i++ ) {
+ fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass );
+ }
}
- return elems;
+ chainable = 1;
}
- // Getting an attribute
- return length ? fn( elems[0], key ) : undefined;
+ return chainable ?
+ elems :
+
+ // Gets
+ bulk ?
+ fn.call( elems ) :
+ length ? fn( elems[0], key ) : emptyGet;
},
now: function() {
return ( new Date() ).getTime();
- },
-
- // Use of jQuery.browser is frowned upon.
- // More details: http://docs.jquery.com/Utilities/jQuery.browser
- uaMatch: function( ua ) {
- ua = ua.toLowerCase();
+ }
+});
- var match = rwebkit.exec( ua ) ||
- ropera.exec( ua ) ||
- rmsie.exec( ua ) ||
- ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) ||
- [];
+jQuery.ready.promise = function( obj ) {
+ if ( !readyList ) {
- return { browser: match[1] || "", version: match[2] || "0" };
- },
+ readyList = jQuery.Deferred();
- sub: function() {
- function jQuerySub( selector, context ) {
- return new jQuerySub.fn.init( selector, context );
- }
- jQuery.extend( true, jQuerySub, this );
- jQuerySub.superclass = this;
- jQuerySub.fn = jQuerySub.prototype = this();
- jQuerySub.fn.constructor = jQuerySub;
- jQuerySub.sub = this.sub;
- jQuerySub.fn.init = function init( selector, context ) {
- if ( context && context instanceof jQuery && !(context instanceof jQuerySub) ) {
- context = jQuerySub( context );
- }
+ // Catch cases where $(document).ready() is called after the browser event has already occurred.
+ // we once tried to use readyState "interactive" here, but it caused issues like the one
+ // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15
+ if ( document.readyState === "complete" ) {
+ // Handle it asynchronously to allow scripts the opportunity to delay ready
+ setTimeout( jQuery.ready, 1 );
- return jQuery.fn.init.call( this, selector, context, rootjQuerySub );
- };
- jQuerySub.fn.init.prototype = jQuerySub.fn;
- var rootjQuerySub = jQuerySub(document);
- return jQuerySub;
- },
+ // Standards-based browsers support DOMContentLoaded
+ } else if ( document.addEventListener ) {
+ // Use the handy event callback
+ document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false );
- browser: {}
-});
+ // A fallback to window.onload, that will always work
+ window.addEventListener( "load", jQuery.ready, false );
-// Populate the class2type map
-jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) {
- class2type[ "[object " + name + "]" ] = name.toLowerCase();
-});
+ // If IE event model is used
+ } else {
+ // Ensure firing before onload, maybe late but safe also for iframes
+ document.attachEvent( "onreadystatechange", DOMContentLoaded );
-browserMatch = jQuery.uaMatch( userAgent );
-if ( browserMatch.browser ) {
- jQuery.browser[ browserMatch.browser ] = true;
- jQuery.browser.version = browserMatch.version;
-}
+ // A fallback to window.onload, that will always work
+ window.attachEvent( "onload", jQuery.ready );
-// Deprecated, use jQuery.browser.webkit instead
-if ( jQuery.browser.webkit ) {
- jQuery.browser.safari = true;
-}
+ // If IE and not a frame
+ // continually check to see if the document is ready
+ var top = false;
-// IE doesn't match non-breaking spaces with \s
-if ( rnotwhite.test( "\xA0" ) ) {
- trimLeft = /^[\s\xA0]+/;
- trimRight = /[\s\xA0]+$/;
-}
+ try {
+ top = window.frameElement == null && document.documentElement;
+ } catch(e) {}
-// All jQuery objects should point back to these
-rootjQuery = jQuery(document);
+ if ( top && top.doScroll ) {
+ (function doScrollCheck() {
+ if ( !jQuery.isReady ) {
-// Cleanup functions for the document ready method
-if ( document.addEventListener ) {
- DOMContentLoaded = function() {
- document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false );
- jQuery.ready();
- };
+ try {
+ // Use the trick by Diego Perini
+ // http://javascript.nwbox.com/IEContentLoaded/
+ top.doScroll("left");
+ } catch(e) {
+ return setTimeout( doScrollCheck, 50 );
+ }
-} else if ( document.attachEvent ) {
- DOMContentLoaded = function() {
- // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
- if ( document.readyState === "complete" ) {
- document.detachEvent( "onreadystatechange", DOMContentLoaded );
- jQuery.ready();
+ // and execute any waiting functions
+ jQuery.ready();
+ }
+ })();
+ }
}
- };
-}
-
-// The DOM ready check for Internet Explorer
-function doScrollCheck() {
- if ( jQuery.isReady ) {
- return;
- }
-
- try {
- // If IE is used, use the trick by Diego Perini
- // http://javascript.nwbox.com/IEContentLoaded/
- document.documentElement.doScroll("left");
- } catch(e) {
- setTimeout( doScrollCheck, 1 );
- return;
}
+ return readyList.promise( obj );
+};
- // and execute any waiting functions
- jQuery.ready();
-}
-
-return jQuery;
-
-})();
-
-
-// String to Object flags format cache
-var flagsCache = {};
+// Populate the class2type map
+jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) {
+ class2type[ "[object " + name + "]" ] = name.toLowerCase();
+});
-// Convert String-formatted flags into Object-formatted ones and store in cache
-function createFlags( flags ) {
- var object = flagsCache[ flags ] = {},
- i, length;
- flags = flags.split( /\s+/ );
- for ( i = 0, length = flags.length; i < length; i++ ) {
- object[ flags[i] ] = true;
- }
+// All jQuery objects should point back to these
+rootjQuery = jQuery(document);
+// String to Object options format cache
+var optionsCache = {};
+
+// Convert String-formatted options into Object-formatted ones and store in cache
+function createOptions( options ) {
+ var object = optionsCache[ options ] = {};
+ jQuery.each( options.split( core_rspace ), function( _, flag ) {
+ object[ flag ] = true;
+ });
return object;
}
/*
* Create a callback list using the following parameters:
*
- * flags: an optional list of space-separated flags that will change how
- * the callback list behaves
+ * options: an optional list of space-separated options that will change how
+ * the callback list behaves or a more traditional option object
*
* By default a callback list will act like an event callback list and can be
* "fired" multiple times.
*
- * Possible flags:
+ * Possible options:
*
* once: will ensure the callback list can only be fired once (like a Deferred)
*
* stopOnFalse: interrupt callings when a callback returns false
*
*/
-jQuery.Callbacks = function( flags ) {
+jQuery.Callbacks = function( options ) {
- // Convert flags from String-formatted to Object-formatted
+ // Convert options from String-formatted to Object-formatted if needed
// (we check in cache first)
- flags = flags ? ( flagsCache[ flags ] || createFlags( flags ) ) : {};
+ options = typeof options === "string" ?
+ ( optionsCache[ options ] || createOptions( options ) ) :
+ jQuery.extend( {}, options );
- var // Actual callback list
- list = [],
- // Stack of fire calls for repeatable lists
- stack = [],
- // Last fire value (for non-forgettable lists)
+ var // Last fire value (for non-forgettable lists)
memory,
+ // Flag to know if list was already fired
+ fired,
// Flag to know if list is currently firing
firing,
// First callback to fire (used internally by add and fireWith)
firingLength,
// Index of currently firing callback (modified by remove if needed)
firingIndex,
- // Add one or several callbacks to the list
- add = function( args ) {
- var i,
- length,
- elem,
- type,
- actual;
- for ( i = 0, length = args.length; i < length; i++ ) {
- elem = args[ i ];
- type = jQuery.type( elem );
- if ( type === "array" ) {
- // Inspect recursively
- add( elem );
- } else if ( type === "function" ) {
- // Add if not in unique mode and callback is not in
- if ( !flags.unique || !self.has( elem ) ) {
- list.push( elem );
- }
- }
- }
- },
+ // Actual callback list
+ list = [],
+ // Stack of fire calls for repeatable lists
+ stack = !options.once && [],
// Fire callbacks
- fire = function( context, args ) {
- args = args || [];
- memory = !flags.memory || [ context, args ];
- firing = true;
+ fire = function( data ) {
+ memory = options.memory && data;
+ fired = true;
firingIndex = firingStart || 0;
firingStart = 0;
firingLength = list.length;
+ firing = true;
for ( ; list && firingIndex < firingLength; firingIndex++ ) {
- if ( list[ firingIndex ].apply( context, args ) === false && flags.stopOnFalse ) {
- memory = true; // Mark as halted
+ if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) {
+ memory = false; // To prevent further calls using add
break;
}
}
firing = false;
if ( list ) {
- if ( !flags.once ) {
- if ( stack && stack.length ) {
- memory = stack.shift();
- self.fireWith( memory[ 0 ], memory[ 1 ] );
+ if ( stack ) {
+ if ( stack.length ) {
+ fire( stack.shift() );
}
- } else if ( memory === true ) {
- self.disable();
- } else {
+ } else if ( memory ) {
list = [];
+ } else {
+ self.disable();
}
}
},
// Add a callback or a collection of callbacks to the list
add: function() {
if ( list ) {
- var length = list.length;
- add( arguments );
+ // First, we save the current length
+ var start = list.length;
+ (function add( args ) {
+ jQuery.each( args, function( _, arg ) {
+ var type = jQuery.type( arg );
+ if ( type === "function" && ( !options.unique || !self.has( arg ) ) ) {
+ list.push( arg );
+ } else if ( arg && arg.length && type !== "string" ) {
+ // Inspect recursively
+ add( arg );
+ }
+ });
+ })( arguments );
// Do we need to add the callbacks to the
// current firing batch?
if ( firing ) {
firingLength = list.length;
// With memory, if we're not firing then
- // we should call right away, unless previous
- // firing was halted (stopOnFalse)
- } else if ( memory && memory !== true ) {
- firingStart = length;
- fire( memory[ 0 ], memory[ 1 ] );
+ // we should call right away
+ } else if ( memory ) {
+ firingStart = start;
+ fire( memory );
}
}
return this;
// Remove a callback from the list
remove: function() {
if ( list ) {
- var args = arguments,
- argIndex = 0,
- argLength = args.length;
- for ( ; argIndex < argLength ; argIndex++ ) {
- for ( var i = 0; i < list.length; i++ ) {
- if ( args[ argIndex ] === list[ i ] ) {
- // Handle firingIndex and firingLength
- if ( firing ) {
- if ( i <= firingLength ) {
- firingLength--;
- if ( i <= firingIndex ) {
- firingIndex--;
- }
- }
+ jQuery.each( arguments, function( _, arg ) {
+ var index;
+ while( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
+ list.splice( index, 1 );
+ // Handle firing indexes
+ if ( firing ) {
+ if ( index <= firingLength ) {
+ firingLength--;
}
- // Remove the element
- list.splice( i--, 1 );
- // If we have some unicity property then
- // we only need to do this once
- if ( flags.unique ) {
- break;
+ if ( index <= firingIndex ) {
+ firingIndex--;
}
}
}
- }
+ });
}
return this;
},
// Control if a given callback is in the list
has: function( fn ) {
- if ( list ) {
- var i = 0,
- length = list.length;
- for ( ; i < length; i++ ) {
- if ( fn === list[ i ] ) {
- return true;
- }
- }
- }
- return false;
+ return jQuery.inArray( fn, list ) > -1;
},
// Remove all callbacks from the list
empty: function() {
// Lock the list in its current state
lock: function() {
stack = undefined;
- if ( !memory || memory === true ) {
+ if ( !memory ) {
self.disable();
}
return this;
},
// Call all callbacks with the given context and arguments
fireWith: function( context, args ) {
- if ( stack ) {
+ args = args || [];
+ args = [ context, args.slice ? args.slice() : args ];
+ if ( list && ( !fired || stack ) ) {
if ( firing ) {
- if ( !flags.once ) {
- stack.push( [ context, args ] );
- }
- } else if ( !( flags.once && memory ) ) {
- fire( context, args );
+ stack.push( args );
+ } else {
+ fire( args );
}
}
return this;
},
// To know if the callbacks have already been called at least once
fired: function() {
- return !!memory;
+ return !!fired;
}
};
return self;
};
-
-
-
-
-var // Static reference to slice
- sliceDeferred = [].slice;
-
jQuery.extend({
Deferred: function( func ) {
- var doneList = jQuery.Callbacks( "once memory" ),
- failList = jQuery.Callbacks( "once memory" ),
- progressList = jQuery.Callbacks( "memory" ),
+ var tuples = [
+ // action, add listener, listener list, final state
+ [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ],
+ [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ],
+ [ "notify", "progress", jQuery.Callbacks("memory") ]
+ ],
state = "pending",
- lists = {
- resolve: doneList,
- reject: failList,
- notify: progressList
- },
promise = {
- done: doneList.add,
- fail: failList.add,
- progress: progressList.add,
-
state: function() {
return state;
},
-
- // Deprecated
- isResolved: doneList.fired,
- isRejected: failList.fired,
-
- then: function( doneCallbacks, failCallbacks, progressCallbacks ) {
- deferred.done( doneCallbacks ).fail( failCallbacks ).progress( progressCallbacks );
- return this;
- },
always: function() {
- deferred.done.apply( deferred, arguments ).fail.apply( deferred, arguments );
+ deferred.done( arguments ).fail( arguments );
return this;
},
- pipe: function( fnDone, fnFail, fnProgress ) {
+ then: function( /* fnDone, fnFail, fnProgress */ ) {
+ var fns = arguments;
return jQuery.Deferred(function( newDefer ) {
- jQuery.each( {
- done: [ fnDone, "resolve" ],
- fail: [ fnFail, "reject" ],
- progress: [ fnProgress, "notify" ]
- }, function( handler, data ) {
- var fn = data[ 0 ],
- action = data[ 1 ],
- returned;
- if ( jQuery.isFunction( fn ) ) {
- deferred[ handler ](function() {
- returned = fn.apply( this, arguments );
+ jQuery.each( tuples, function( i, tuple ) {
+ var action = tuple[ 0 ],
+ fn = fns[ i ];
+ // deferred[ done | fail | progress ] for forwarding actions to newDefer
+ deferred[ tuple[1] ]( jQuery.isFunction( fn ) ?
+ function() {
+ var returned = fn.apply( this, arguments );
if ( returned && jQuery.isFunction( returned.promise ) ) {
- returned.promise().then( newDefer.resolve, newDefer.reject, newDefer.notify );
+ returned.promise()
+ .done( newDefer.resolve )
+ .fail( newDefer.reject )
+ .progress( newDefer.notify );
} else {
newDefer[ action + "With" ]( this === deferred ? newDefer : this, [ returned ] );
}
- });
- } else {
- deferred[ handler ]( newDefer[ action ] );
- }
+ } :
+ newDefer[ action ]
+ );
});
+ fns = null;
}).promise();
},
// Get a promise for this deferred
// If obj is provided, the promise aspect is added to the object
promise: function( obj ) {
- if ( obj == null ) {
- obj = promise;
- } else {
- for ( var key in promise ) {
- obj[ key ] = promise[ key ];
- }
- }
- return obj;
+ return obj != null ? jQuery.extend( obj, promise ) : promise;
}
},
- deferred = promise.promise({}),
- key;
+ deferred = {};
- for ( key in lists ) {
- deferred[ key ] = lists[ key ].fire;
- deferred[ key + "With" ] = lists[ key ].fireWith;
- }
+ // Keep pipe for back-compat
+ promise.pipe = promise.then;
+
+ // Add list-specific methods
+ jQuery.each( tuples, function( i, tuple ) {
+ var list = tuple[ 2 ],
+ stateString = tuple[ 3 ];
+
+ // promise[ done | fail | progress ] = list.add
+ promise[ tuple[1] ] = list.add;
- // Handle state
- deferred.done( function() {
- state = "resolved";
- }, failList.disable, progressList.lock ).fail( function() {
- state = "rejected";
- }, doneList.disable, progressList.lock );
+ // Handle state
+ if ( stateString ) {
+ list.add(function() {
+ // state = [ resolved | rejected ]
+ state = stateString;
+
+ // [ reject_list | resolve_list ].disable; progress_list.lock
+ }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );
+ }
+
+ // deferred[ resolve | reject | notify ] = list.fire
+ deferred[ tuple[0] ] = list.fire;
+ deferred[ tuple[0] + "With" ] = list.fireWith;
+ });
+
+ // Make the deferred a promise
+ promise.promise( deferred );
// Call given func if any
if ( func ) {
},
// Deferred helper
- when: function( firstParam ) {
- var args = sliceDeferred.call( arguments, 0 ),
- i = 0,
- length = args.length,
- pValues = new Array( length ),
- count = length,
- pCount = length,
- deferred = length <= 1 && firstParam && jQuery.isFunction( firstParam.promise ) ?
- firstParam :
- jQuery.Deferred(),
- promise = deferred.promise();
- function resolveFunc( i ) {
- return function( value ) {
- args[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value;
- if ( !( --count ) ) {
- deferred.resolveWith( deferred, args );
- }
- };
- }
- function progressFunc( i ) {
- return function( value ) {
- pValues[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value;
- deferred.notifyWith( promise, pValues );
- };
- }
+ when: function( subordinate /* , ..., subordinateN */ ) {
+ var i = 0,
+ resolveValues = core_slice.call( arguments ),
+ length = resolveValues.length,
+
+ // the count of uncompleted subordinates
+ remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,
+
+ // the master Deferred. If resolveValues consist of only a single Deferred, just use that.
+ deferred = remaining === 1 ? subordinate : jQuery.Deferred(),
+
+ // Update function for both resolve and progress values
+ updateFunc = function( i, contexts, values ) {
+ return function( value ) {
+ contexts[ i ] = this;
+ values[ i ] = arguments.length > 1 ? core_slice.call( arguments ) : value;
+ if( values === progressValues ) {
+ deferred.notifyWith( contexts, values );
+ } else if ( !( --remaining ) ) {
+ deferred.resolveWith( contexts, values );
+ }
+ };
+ },
+
+ progressValues, progressContexts, resolveContexts;
+
+ // add listeners to Deferred subordinates; treat others as resolved
if ( length > 1 ) {
+ progressValues = new Array( length );
+ progressContexts = new Array( length );
+ resolveContexts = new Array( length );
for ( ; i < length; i++ ) {
- if ( args[ i ] && args[ i ].promise && jQuery.isFunction( args[ i ].promise ) ) {
- args[ i ].promise().then( resolveFunc(i), deferred.reject, progressFunc(i) );
+ if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {
+ resolveValues[ i ].promise()
+ .done( updateFunc( i, resolveContexts, resolveValues ) )
+ .fail( deferred.reject )
+ .progress( updateFunc( i, progressContexts, progressValues ) );
} else {
- --count;
+ --remaining;
}
}
- if ( !count ) {
- deferred.resolveWith( deferred, args );
- }
- } else if ( deferred !== firstParam ) {
- deferred.resolveWith( deferred, length ? [ firstParam ] : [] );
}
- return promise;
+
+ // if we're not waiting on anything, resolve the master
+ if ( !remaining ) {
+ deferred.resolveWith( resolveContexts, resolveValues );
+ }
+
+ return deferred.promise();
}
});
-
-
-
-
-jQuery.support = (function() {
+jQuery.support = (function() {
var support,
all,
select,
opt,
input,
- marginDiv,
fragment,
- tds,
- events,
eventName,
i,
isSupported,
- div = document.createElement( "div" ),
- documentElement = document.documentElement;
+ clickFn,
+ div = document.createElement("div");
// Preliminary tests
- div.setAttribute("className", "t");
- div.innerHTML = " <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
+ div.setAttribute( "className", "t" );
+ div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
- all = div.getElementsByTagName( "*" );
- a = div.getElementsByTagName( "a" )[ 0 ];
+ all = div.getElementsByTagName("*");
+ a = div.getElementsByTagName("a")[ 0 ];
+ a.style.cssText = "top:1px;float:left;opacity:.5";
// Can't get basic test support
- if ( !all || !all.length || !a ) {
+ if ( !all || !all.length ) {
return {};
}
// First batch of supports tests
- select = document.createElement( "select" );
+ select = document.createElement("select");
opt = select.appendChild( document.createElement("option") );
- input = div.getElementsByTagName( "input" )[ 0 ];
+ input = div.getElementsByTagName("input")[ 0 ];
support = {
// IE strips leading whitespace when .innerHTML is used
// Make sure that element opacity exists
// (IE uses filter instead)
// Use a regex to work around a WebKit issue. See #5145
- opacity: /^0.55/.test( a.style.opacity ),
+ opacity: /^0.5/.test( a.style.opacity ),
// Verify style float existence
// (IE uses styleFloat instead of cssFloat)
// Where outerHTML is undefined, this still works
html5Clone: document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav></:nav>",
+ // jQuery.support.boxModel DEPRECATED in 1.8 since we don't support Quirks Mode
+ boxModel: ( document.compatMode === "CSS1Compat" ),
+
// Will be defined later
submitBubbles: true,
changeBubbles: true,
noCloneEvent: true,
inlineBlockNeedsLayout: false,
shrinkWrapBlocks: false,
- reliableMarginRight: true
+ reliableMarginRight: true,
+ boxSizingReliable: true,
+ pixelPosition: false
};
// Make sure checked status is properly cloned
}
if ( !div.addEventListener && div.attachEvent && div.fireEvent ) {
- div.attachEvent( "onclick", function() {
+ div.attachEvent( "onclick", clickFn = function() {
// Cloning a node shouldn't copy over any
// bound event handlers (IE does this)
support.noCloneEvent = false;
});
- div.cloneNode( true ).fireEvent( "onclick" );
+ div.cloneNode( true ).fireEvent("onclick");
+ div.detachEvent( "onclick", clickFn );
}
// Check if a radio maintains its value
// after being appended to the DOM
input = document.createElement("input");
input.value = "t";
- input.setAttribute("type", "radio");
+ input.setAttribute( "type", "radio" );
support.radioValue = input.value === "t";
- input.setAttribute("checked", "checked");
+ input.setAttribute( "checked", "checked" );
+
+ // #11217 - WebKit loses check when the name is after the checked attribute
+ input.setAttribute( "name", "t" );
+
div.appendChild( input );
fragment = document.createDocumentFragment();
fragment.appendChild( div.lastChild );
fragment.removeChild( input );
fragment.appendChild( div );
- div.innerHTML = "";
-
- // Check if div with explicit width and no margin-right incorrectly
- // gets computed margin-right based on width of container. For more
- // info see bug #3333
- // Fails in WebKit before Feb 2011 nightlies
- // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
- if ( window.getComputedStyle ) {
- marginDiv = document.createElement( "div" );
- marginDiv.style.width = "0";
- marginDiv.style.marginRight = "0";
- div.style.width = "2px";
- div.appendChild( marginDiv );
- support.reliableMarginRight =
- ( parseInt( ( window.getComputedStyle( marginDiv, null ) || { marginRight: 0 } ).marginRight, 10 ) || 0 ) === 0;
- }
-
// Technique from Juriy Zaytsev
// http://perfectionkills.com/detecting-event-support-without-browser-sniffing/
// We only care about the case where non-standard event systems
// avoid an eval call (in setAttribute) which can cause CSP
// to go haywire. See: https://developer.mozilla.org/en/Security/CSP
if ( div.attachEvent ) {
- for( i in {
- submit: 1,
- change: 1,
- focusin: 1
+ for ( i in {
+ submit: true,
+ change: true,
+ focusin: true
}) {
eventName = "on" + i;
isSupported = ( eventName in div );
}
}
- fragment.removeChild( div );
-
- // Null elements to avoid leaks in IE
- fragment = select = opt = marginDiv = div = input = null;
-
// Run tests that need a body at doc ready
jQuery(function() {
- var container, outer, inner, table, td, offsetSupport,
- conMarginTop, ptlm, vb, style, html,
+ var container, div, tds, marginDiv,
+ divReset = "padding:0;margin:0;border:0;display:block;overflow:hidden;",
body = document.getElementsByTagName("body")[0];
if ( !body ) {
return;
}
- conMarginTop = 1;
- ptlm = "position:absolute;top:0;left:0;width:1px;height:1px;margin:0;";
- vb = "visibility:hidden;border:0;";
- style = "style='" + ptlm + "border:5px solid #000;padding:0;'";
- html = "<div " + style + "><div></div></div>" +
- "<table " + style + " cellpadding='0' cellspacing='0'>" +
- "<tr><td></td></tr></table>";
-
container = document.createElement("div");
- container.style.cssText = vb + "width:0;height:0;position:static;top:0;margin-top:" + conMarginTop + "px";
+ container.style.cssText = "visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px";
body.insertBefore( container, body.firstChild );
// Construct the test element
// display:none (it is still safe to use offsets if a parent element is
// hidden; don safety goggles and see bug #4512 for more information).
// (only IE 8 fails this test)
- div.innerHTML = "<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>";
- tds = div.getElementsByTagName( "td" );
+ div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>";
+ tds = div.getElementsByTagName("td");
+ tds[ 0 ].style.cssText = "padding:0;margin:0;border:0;display:none";
isSupported = ( tds[ 0 ].offsetHeight === 0 );
tds[ 0 ].style.display = "";
// (IE <= 8 fail this test)
support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 );
- // Figure out if the W3C box model works as expected
+ // Check box-sizing and margin behavior
div.innerHTML = "";
- div.style.width = div.style.paddingLeft = "1px";
- jQuery.boxModel = support.boxModel = div.offsetWidth === 2;
+ div.style.cssText = "box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;";
+ support.boxSizing = ( div.offsetWidth === 4 );
+ support.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== 1 );
+
+ // NOTE: To any future maintainer, we've window.getComputedStyle
+ // because jsdom on node.js will break without it.
+ if ( window.getComputedStyle ) {
+ support.pixelPosition = ( window.getComputedStyle( div, null ) || {} ).top !== "1%";
+ support.boxSizingReliable = ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px";
+
+ // Check if div with explicit width and no margin-right incorrectly
+ // gets computed margin-right based on width of container. For more
+ // info see bug #3333
+ // Fails in WebKit before Feb 2011 nightlies
+ // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
+ marginDiv = document.createElement("div");
+ marginDiv.style.cssText = div.style.cssText = divReset;
+ marginDiv.style.marginRight = marginDiv.style.width = "0";
+ div.style.width = "1px";
+ div.appendChild( marginDiv );
+ support.reliableMarginRight =
+ !parseFloat( ( window.getComputedStyle( marginDiv, null ) || {} ).marginRight );
+ }
if ( typeof div.style.zoom !== "undefined" ) {
// Check if natively block-level elements act like inline-block
// elements when setting their display to 'inline' and giving
// them layout
// (IE < 8 does this)
- div.style.display = "inline";
- div.style.zoom = 1;
- support.inlineBlockNeedsLayout = ( div.offsetWidth === 2 );
+ div.innerHTML = "";
+ div.style.cssText = divReset + "width:1px;padding:1px;display:inline;zoom:1";
+ support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 );
// Check if elements with layout shrink-wrap their children
// (IE 6 does this)
- div.style.display = "";
- div.innerHTML = "<div style='width:4px;'></div>";
- support.shrinkWrapBlocks = ( div.offsetWidth !== 2 );
- }
-
- div.style.cssText = ptlm + vb;
- div.innerHTML = html;
-
- outer = div.firstChild;
- inner = outer.firstChild;
- td = outer.nextSibling.firstChild.firstChild;
-
- offsetSupport = {
- doesNotAddBorder: ( inner.offsetTop !== 5 ),
- doesAddBorderForTableAndCells: ( td.offsetTop === 5 )
- };
-
- inner.style.position = "fixed";
- inner.style.top = "20px";
-
- // safari subtracts parent border width here which is 5px
- offsetSupport.fixedPosition = ( inner.offsetTop === 20 || inner.offsetTop === 15 );
- inner.style.position = inner.style.top = "";
+ div.style.display = "block";
+ div.style.overflow = "visible";
+ div.innerHTML = "<div></div>";
+ div.firstChild.style.width = "5px";
+ support.shrinkWrapBlocks = ( div.offsetWidth !== 3 );
- outer.style.overflow = "hidden";
- outer.style.position = "relative";
-
- offsetSupport.subtractsBorderForOverflowNotVisible = ( inner.offsetTop === -5 );
- offsetSupport.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== conMarginTop );
+ container.style.zoom = 1;
+ }
+ // Null elements to avoid leaks in IE
body.removeChild( container );
- div = container = null;
-
- jQuery.extend( support, offsetSupport );
+ container = div = tds = marginDiv = null;
});
+ // Null elements to avoid leaks in IE
+ fragment.removeChild( div );
+ all = a = select = opt = input = fragment = div = null;
+
return support;
})();
-
-
-
-
-var rbrace = /^(?:\{.*\}|\[.*\])$/,
+var rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/,
rmultiDash = /([A-Z])/g;
jQuery.extend({
cache: {},
- // Please use with caution
+ deletedIds: [],
+
+ // Remove at next major release (1.9/2.0)
uuid: 0,
// Unique for each copy of jQuery on the page
return;
}
- var privateCache, thisCache, ret,
+ var thisCache, ret,
internalKey = jQuery.expando,
getByName = typeof name === "string",
// Only defining an ID for JS objects if its cache already exists allows
// the code to shortcut on the same path as a DOM node with no cache
- id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey,
- isEvents = name === "events";
+ id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey;
// Avoid doing any more work than we need to when trying to get data on an
// object that has no data at all
- if ( (!id || !cache[id] || (!isEvents && !pvt && !cache[id].data)) && getByName && data === undefined ) {
+ if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && getByName && data === undefined ) {
return;
}
// Only DOM nodes need a new unique ID for each element since their data
// ends up in the global cache
if ( isNode ) {
- elem[ internalKey ] = id = ++jQuery.uuid;
+ elem[ internalKey ] = id = jQuery.deletedIds.pop() || jQuery.guid++;
} else {
id = internalKey;
}
}
}
- privateCache = thisCache = cache[ id ];
+ thisCache = cache[ id ];
// jQuery data() is stored in a separate object inside the object's internal data
// cache in order to avoid key collisions between internal data and user-defined
thisCache[ jQuery.camelCase( name ) ] = data;
}
- // Users should not attempt to inspect the internal events object using jQuery.data,
- // it is undocumented and subject to change. But does anyone listen? No.
- if ( isEvents && !thisCache[ name ] ) {
- return privateCache.events;
- }
-
// Check for both converted-to-camel and non-converted data property names
// If a data property was specified
if ( getByName ) {
var thisCache, i, l,
- // Reference to internal data cache key
- internalKey = jQuery.expando,
-
isNode = elem.nodeType,
// See jQuery.data for more information
cache = isNode ? jQuery.cache : elem,
-
- // See jQuery.data for more information
- id = isNode ? elem[ internalKey ] : internalKey;
+ id = isNode ? elem[ jQuery.expando ] : jQuery.expando;
// If there is already no cache entry for this object, there is no
// purpose in continuing
if ( name in thisCache ) {
name = [ name ];
} else {
- name = name.split( " " );
+ name = name.split(" ");
}
}
}
// Don't destroy the parent cache unless the internal data object
// had been the only thing left in it
- if ( !isEmptyDataObject(cache[ id ]) ) {
+ if ( !isEmptyDataObject( cache[ id ] ) ) {
return;
}
}
- // Browsers that fail expando deletion also refuse to delete expandos on
- // the window, but it will allow it on all other JS objects; other browsers
- // don't care
- // Ensure that `cache` is not a window object #10080
- if ( jQuery.support.deleteExpando || !cache.setInterval ) {
+ // Destroy the cache
+ if ( isNode ) {
+ jQuery.cleanData( [ elem ], true );
+
+ // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080)
+ } else if ( jQuery.support.deleteExpando || cache != cache.window ) {
delete cache[ id ];
+
+ // When all else fails, null
} else {
cache[ id ] = null;
}
-
- // We destroyed the cache and need to eliminate the expando on the node to avoid
- // false lookups in the cache for entries that no longer exist
- if ( isNode ) {
- // IE does not allow us to delete expando properties from nodes,
- // nor does it have a removeAttribute function on Document nodes;
- // we must handle all of these cases
- if ( jQuery.support.deleteExpando ) {
- delete elem[ internalKey ];
- } else if ( elem.removeAttribute ) {
- elem.removeAttribute( internalKey );
- } else {
- elem[ internalKey ] = null;
- }
- }
},
// For internal use only.
// A method for determining if a DOM node can handle the data expando
acceptData: function( elem ) {
- if ( elem.nodeName ) {
- var match = jQuery.noData[ elem.nodeName.toLowerCase() ];
-
- if ( match ) {
- return !(match === true || elem.getAttribute("classid") !== match);
- }
- }
+ var noData = elem.nodeName && jQuery.noData[ elem.nodeName.toLowerCase() ];
- return true;
+ // nodes accept data unless otherwise specified; rejection can be conditional
+ return !noData || noData !== true && elem.getAttribute("classid") === noData;
}
});
jQuery.fn.extend({
data: function( key, value ) {
- var parts, attr, name,
+ var parts, part, attr, name, l,
+ elem = this[0],
+ i = 0,
data = null;
- if ( typeof key === "undefined" ) {
+ // Gets all values
+ if ( key === undefined ) {
if ( this.length ) {
- data = jQuery.data( this[0] );
+ data = jQuery.data( elem );
- if ( this[0].nodeType === 1 && !jQuery._data( this[0], "parsedAttrs" ) ) {
- attr = this[0].attributes;
- for ( var i = 0, l = attr.length; i < l; i++ ) {
+ if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) {
+ attr = elem.attributes;
+ for ( l = attr.length; i < l; i++ ) {
name = attr[i].name;
- if ( name.indexOf( "data-" ) === 0 ) {
+ if ( !name.indexOf( "data-" ) ) {
name = jQuery.camelCase( name.substring(5) );
- dataAttr( this[0], name, data[ name ] );
+ dataAttr( elem, name, data[ name ] );
}
}
- jQuery._data( this[0], "parsedAttrs", true );
+ jQuery._data( elem, "parsedAttrs", true );
}
}
return data;
+ }
- } else if ( typeof key === "object" ) {
+ // Sets multiple values
+ if ( typeof key === "object" ) {
return this.each(function() {
jQuery.data( this, key );
});
}
- parts = key.split(".");
+ parts = key.split( ".", 2 );
parts[1] = parts[1] ? "." + parts[1] : "";
+ part = parts[1] + "!";
- if ( value === undefined ) {
- data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]);
+ return jQuery.access( this, function( value ) {
- // Try to fetch any internally stored data first
- if ( data === undefined && this.length ) {
- data = jQuery.data( this[0], key );
- data = dataAttr( this[0], key, data );
- }
+ if ( value === undefined ) {
+ data = this.triggerHandler( "getData" + part, [ parts[0] ] );
- return data === undefined && parts[1] ?
- this.data( parts[0] ) :
- data;
+ // Try to fetch any internally stored data first
+ if ( data === undefined && elem ) {
+ data = jQuery.data( elem, key );
+ data = dataAttr( elem, key, data );
+ }
- } else {
- return this.each(function() {
- var self = jQuery( this ),
- args = [ parts[0], value ];
+ return data === undefined && parts[1] ?
+ this.data( parts[0] ) :
+ data;
+ }
+
+ parts[1] = value;
+ this.each(function() {
+ var self = jQuery( this );
- self.triggerHandler( "setData" + parts[1] + "!", args );
+ self.triggerHandler( "setData" + part, parts );
jQuery.data( this, key, value );
- self.triggerHandler( "changeData" + parts[1] + "!", args );
+ self.triggerHandler( "changeData" + part, parts );
});
- }
+ }, null, value, arguments.length > 1, null, false );
},
removeData: function( key ) {
data = data === "true" ? true :
data === "false" ? false :
data === "null" ? null :
- jQuery.isNumeric( data ) ? parseFloat( data ) :
- rbrace.test( data ) ? jQuery.parseJSON( data ) :
+ // Only convert to a number if it doesn't change the string
+ +data + "" === data ? +data :
+ rbrace.test( data ) ? jQuery.parseJSON( data ) :
data;
} catch( e ) {}
// checks a cache object for emptiness
function isEmptyDataObject( obj ) {
- for ( var name in obj ) {
+ var name;
+ for ( name in obj ) {
// if the public data object is empty, the private is still empty
if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) {
return true;
}
-
-
-
-
-function handleQueueMarkDefer( elem, type, src ) {
- var deferDataKey = type + "defer",
- queueDataKey = type + "queue",
- markDataKey = type + "mark",
- defer = jQuery._data( elem, deferDataKey );
- if ( defer &&
- ( src === "queue" || !jQuery._data(elem, queueDataKey) ) &&
- ( src === "mark" || !jQuery._data(elem, markDataKey) ) ) {
- // Give room for hard-coded callbacks to fire first
- // and eventually mark/queue something else on the element
- setTimeout( function() {
- if ( !jQuery._data( elem, queueDataKey ) &&
- !jQuery._data( elem, markDataKey ) ) {
- jQuery.removeData( elem, deferDataKey, true );
- defer.fire();
- }
- }, 0 );
- }
-}
-
jQuery.extend({
-
- _mark: function( elem, type ) {
- if ( elem ) {
- type = ( type || "fx" ) + "mark";
- jQuery._data( elem, type, (jQuery._data( elem, type ) || 0) + 1 );
- }
- },
-
- _unmark: function( force, elem, type ) {
- if ( force !== true ) {
- type = elem;
- elem = force;
- force = false;
- }
- if ( elem ) {
- type = type || "fx";
- var key = type + "mark",
- count = force ? 0 : ( (jQuery._data( elem, key ) || 1) - 1 );
- if ( count ) {
- jQuery._data( elem, key, count );
- } else {
- jQuery.removeData( elem, key, true );
- handleQueueMarkDefer( elem, type, "mark" );
- }
- }
- },
-
queue: function( elem, type, data ) {
- var q;
+ var queue;
+
if ( elem ) {
type = ( type || "fx" ) + "queue";
- q = jQuery._data( elem, type );
+ queue = jQuery._data( elem, type );
// Speed up dequeue by getting out quickly if this is just a lookup
if ( data ) {
- if ( !q || jQuery.isArray(data) ) {
- q = jQuery._data( elem, type, jQuery.makeArray(data) );
+ if ( !queue || jQuery.isArray(data) ) {
+ queue = jQuery._data( elem, type, jQuery.makeArray(data) );
} else {
- q.push( data );
+ queue.push( data );
}
}
- return q || [];
+ return queue || [];
}
},
type = type || "fx";
var queue = jQuery.queue( elem, type ),
+ startLength = queue.length,
fn = queue.shift(),
- hooks = {};
+ hooks = jQuery._queueHooks( elem, type ),
+ next = function() {
+ jQuery.dequeue( elem, type );
+ };
// If the fx queue is dequeued, always remove the progress sentinel
if ( fn === "inprogress" ) {
fn = queue.shift();
+ startLength--;
}
if ( fn ) {
+
// Add a progress sentinel to prevent the fx queue from being
// automatically dequeued
if ( type === "fx" ) {
queue.unshift( "inprogress" );
}
- jQuery._data( elem, type + ".run", hooks );
- fn.call( elem, function() {
- jQuery.dequeue( elem, type );
- }, hooks );
+ // clear up the last queue stop function
+ delete hooks.stop;
+ fn.call( elem, next, hooks );
}
- if ( !queue.length ) {
- jQuery.removeData( elem, type + "queue " + type + ".run", true );
- handleQueueMarkDefer( elem, type, "queue" );
+ if ( !startLength && hooks ) {
+ hooks.empty.fire();
}
+ },
+
+ // not intended for public consumption - generates a queueHooks object, or returns the current one
+ _queueHooks: function( elem, type ) {
+ var key = type + "queueHooks";
+ return jQuery._data( elem, key ) || jQuery._data( elem, key, {
+ empty: jQuery.Callbacks("once memory").add(function() {
+ jQuery.removeData( elem, type + "queue", true );
+ jQuery.removeData( elem, key, true );
+ })
+ });
}
});
jQuery.fn.extend({
queue: function( type, data ) {
+ var setter = 2;
+
if ( typeof type !== "string" ) {
data = type;
type = "fx";
+ setter--;
}
- if ( data === undefined ) {
+ if ( arguments.length < setter ) {
return jQuery.queue( this[0], type );
}
- return this.each(function() {
- var queue = jQuery.queue( this, type, data );
- if ( type === "fx" && queue[0] !== "inprogress" ) {
- jQuery.dequeue( this, type );
- }
- });
+ return data === undefined ?
+ this :
+ this.each(function() {
+ var queue = jQuery.queue( this, type, data );
+
+ // ensure a hooks for this queue
+ jQuery._queueHooks( this, type );
+
+ if ( type === "fx" && queue[0] !== "inprogress" ) {
+ jQuery.dequeue( this, type );
+ }
+ });
},
dequeue: function( type ) {
return this.each(function() {
},
// Get a promise resolved when queues of a certain type
// are emptied (fx is the type by default)
- promise: function( type, object ) {
+ promise: function( type, obj ) {
+ var tmp,
+ count = 1,
+ defer = jQuery.Deferred(),
+ elements = this,
+ i = this.length,
+ resolve = function() {
+ if ( !( --count ) ) {
+ defer.resolveWith( elements, [ elements ] );
+ }
+ };
+
if ( typeof type !== "string" ) {
- object = type;
+ obj = type;
type = undefined;
}
type = type || "fx";
- var defer = jQuery.Deferred(),
- elements = this,
- i = elements.length,
- count = 1,
- deferDataKey = type + "defer",
- queueDataKey = type + "queue",
- markDataKey = type + "mark",
- tmp;
- function resolve() {
- if ( !( --count ) ) {
- defer.resolveWith( elements, [ elements ] );
- }
- }
+
while( i-- ) {
- if (( tmp = jQuery.data( elements[ i ], deferDataKey, undefined, true ) ||
- ( jQuery.data( elements[ i ], queueDataKey, undefined, true ) ||
- jQuery.data( elements[ i ], markDataKey, undefined, true ) ) &&
- jQuery.data( elements[ i ], deferDataKey, jQuery.Callbacks( "once memory" ), true ) )) {
+ tmp = jQuery._data( elements[ i ], type + "queueHooks" );
+ if ( tmp && tmp.empty ) {
count++;
- tmp.add( resolve );
+ tmp.empty.add( resolve );
}
}
resolve();
- return defer.promise();
+ return defer.promise( obj );
}
});
-
-
-
-
-var rclass = /[\n\t\r]/g,
- rspace = /\s+/,
+var nodeHook, boolHook, fixSpecified,
+ rclass = /[\t\r\n]/g,
rreturn = /\r/g,
rtype = /^(?:button|input)$/i,
rfocusable = /^(?:button|input|object|select|textarea)$/i,
- rclickable = /^a(?:rea)?$/i,
+ rclickable = /^a(?:rea|)$/i,
rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,
- getSetAttribute = jQuery.support.getSetAttribute,
- nodeHook, boolHook, fixSpecified;
+ getSetAttribute = jQuery.support.getSetAttribute;
jQuery.fn.extend({
attr: function( name, value ) {
- return jQuery.access( this, name, value, true, jQuery.attr );
+ return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 );
},
removeAttr: function( name ) {
},
prop: function( name, value ) {
- return jQuery.access( this, name, value, true, jQuery.prop );
+ return jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 );
},
removeProp: function( name ) {
}
if ( value && typeof value === "string" ) {
- classNames = value.split( rspace );
+ classNames = value.split( core_rspace );
for ( i = 0, l = this.length; i < l; i++ ) {
elem = this[ i ];
setClass = " " + elem.className + " ";
for ( c = 0, cl = classNames.length; c < cl; c++ ) {
- if ( !~setClass.indexOf( " " + classNames[ c ] + " " ) ) {
+ if ( setClass.indexOf( " " + classNames[ c ] + " " ) < 0 ) {
setClass += classNames[ c ] + " ";
}
}
},
removeClass: function( value ) {
- var classNames, i, l, elem, className, c, cl;
+ var removes, className, elem, c, cl, i, l;
if ( jQuery.isFunction( value ) ) {
return this.each(function( j ) {
jQuery( this ).removeClass( value.call(this, j, this.className) );
});
}
-
if ( (value && typeof value === "string") || value === undefined ) {
- classNames = ( value || "" ).split( rspace );
+ removes = ( value || "" ).split( core_rspace );
for ( i = 0, l = this.length; i < l; i++ ) {
elem = this[ i ];
-
if ( elem.nodeType === 1 && elem.className ) {
- if ( value ) {
- className = (" " + elem.className + " ").replace( rclass, " " );
- for ( c = 0, cl = classNames.length; c < cl; c++ ) {
- className = className.replace(" " + classNames[ c ] + " ", " ");
- }
- elem.className = jQuery.trim( className );
- } else {
- elem.className = "";
+ className = (" " + elem.className + " ").replace( rclass, " " );
+
+ // loop over each item in the removal list
+ for ( c = 0, cl = removes.length; c < cl; c++ ) {
+ // Remove until there is nothing to remove,
+ while ( className.indexOf(" " + removes[ c ] + " ") >= 0 ) {
+ className = className.replace( " " + removes[ c ] + " " , " " );
+ }
}
+ elem.className = value ? jQuery.trim( className ) : "";
}
}
}
i = 0,
self = jQuery( this ),
state = stateVal,
- classNames = value.split( rspace );
+ classNames = value.split( core_rspace );
while ( (className = classNames[ i++ ]) ) {
- // check each className given, space seperated list
+ // check each className given, space separated list
state = isBool ? state : !self.hasClass( className );
self[ state ? "addClass" : "removeClass" ]( className );
}
i = 0,
l = this.length;
for ( ; i < l; i++ ) {
- if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) {
+ if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) {
return true;
}
}
if ( !arguments.length ) {
if ( elem ) {
- hooks = jQuery.valHooks[ elem.nodeName.toLowerCase() ] || jQuery.valHooks[ elem.type ];
+ hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];
if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
return ret;
isFunction = jQuery.isFunction( value );
return this.each(function( i ) {
- var self = jQuery(this), val;
+ var val,
+ self = jQuery(this);
if ( this.nodeType !== 1 ) {
return;
});
}
- hooks = jQuery.valHooks[ this.nodeName.toLowerCase() ] || jQuery.valHooks[ this.type ];
+ hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
// If set returns undefined, fall back to normal setting
if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
}
},
- attrFn: {
- val: true,
- css: true,
- html: true,
- text: true,
- data: true,
- width: true,
- height: true,
- offset: true
- },
+ // Unused in 1.8, left in so attrFn-stabbers won't die; remove in 1.9
+ attrFn: {},
attr: function( elem, name, value, pass ) {
var ret, hooks, notxml,
return;
}
- if ( pass && name in jQuery.attrFn ) {
+ if ( pass && jQuery.isFunction( jQuery.fn[ name ] ) ) {
return jQuery( elem )[ name ]( value );
}
return ret;
} else {
- elem.setAttribute( name, "" + value );
+ elem.setAttribute( name, value + "" );
return value;
}
},
removeAttr: function( elem, value ) {
- var propName, attrNames, name, l,
+ var propName, attrNames, name, isBool,
i = 0;
if ( value && elem.nodeType === 1 ) {
- attrNames = value.toLowerCase().split( rspace );
- l = attrNames.length;
- for ( ; i < l; i++ ) {
+ attrNames = value.split( core_rspace );
+
+ for ( ; i < attrNames.length; i++ ) {
name = attrNames[ i ];
if ( name ) {
propName = jQuery.propFix[ name ] || name;
+ isBool = rboolean.test( name );
// See #9699 for explanation of this approach (setting first, then removal)
- jQuery.attr( elem, name, "" );
+ // Do not do this for boolean attributes (see #10870)
+ if ( !isBool ) {
+ jQuery.attr( elem, name, "" );
+ }
elem.removeAttribute( getSetAttribute ? name : propName );
// Set corresponding property to false for boolean attributes
- if ( rboolean.test( name ) && propName in elem ) {
+ if ( isBool && propName in elem ) {
elem[ propName ] = false;
}
}
}
});
-// Add the tabIndex propHook to attrHooks for back-compat (different case is intentional)
-jQuery.attrHooks.tabindex = jQuery.propHooks.tabIndex;
-
// Hook for boolean attributes
boolHook = {
get: function( elem, name ) {
fixSpecified = {
name: true,
- id: true
+ id: true,
+ coords: true
};
// Use this for any attribute in IE6/7
get: function( elem, name ) {
var ret;
ret = elem.getAttributeNode( name );
- return ret && ( fixSpecified[ name ] ? ret.nodeValue !== "" : ret.specified ) ?
- ret.nodeValue :
+ return ret && ( fixSpecified[ name ] ? ret.value !== "" : ret.specified ) ?
+ ret.value :
undefined;
},
set: function( elem, value, name ) {
ret = document.createAttribute( name );
elem.setAttributeNode( ret );
}
- return ( ret.nodeValue = value + "" );
+ return ( ret.value = value + "" );
}
};
- // Apply the nodeHook to tabindex
- jQuery.attrHooks.tabindex.set = nodeHook.set;
-
// Set width and height to auto instead of 0 on empty string( Bug #8150 )
// This is for removals
jQuery.each([ "width", "height" ], function( i, name ) {
return elem.style.cssText.toLowerCase() || undefined;
},
set: function( elem, value ) {
- return ( elem.style.cssText = "" + value );
+ return ( elem.style.cssText = value + "" );
}
};
}
}
});
});
-
-
-
-
var rformElems = /^(?:textarea|input|select)$/i,
- rtypenamespace = /^([^\.]*)?(?:\.(.+))?$/,
- rhoverHack = /\bhover(\.\S+)?\b/,
+ rtypenamespace = /^([^\.]*|)(?:\.(.+)|)$/,
+ rhoverHack = /(?:^|\s)hover(\.\S+|)\b/,
rkeyEvent = /^key/,
rmouseEvent = /^(?:mouse|contextmenu)|click/,
rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
- rquickIs = /^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,
- quickParse = function( selector ) {
- var quick = rquickIs.exec( selector );
- if ( quick ) {
- // 0 1 2 3
- // [ _, tag, id, class ]
- quick[1] = ( quick[1] || "" ).toLowerCase();
- quick[3] = quick[3] && new RegExp( "(?:^|\\s)" + quick[3] + "(?:\\s|$)" );
- }
- return quick;
- },
- quickIs = function( elem, m ) {
- var attrs = elem.attributes || {};
- return (
- (!m[1] || elem.nodeName.toLowerCase() === m[1]) &&
- (!m[2] || (attrs.id || {}).value === m[2]) &&
- (!m[3] || m[3].test( (attrs[ "class" ] || {}).value ))
- );
- },
hoverHack = function( events ) {
return jQuery.event.special.hover ? events : events.replace( rhoverHack, "mouseenter$1 mouseleave$1" );
};
var elemData, eventHandle, events,
t, tns, type, namespaces, handleObj,
- handleObjIn, quick, handlers, special;
+ handleObjIn, handlers, special;
// Don't attach events to noData or text/comment nodes (allow plain objects tho)
if ( elem.nodeType === 3 || elem.nodeType === 8 || !types || !handler || !(elemData = jQuery._data( elem )) ) {
if ( handler.handler ) {
handleObjIn = handler;
handler = handleObjIn.handler;
+ selector = handleObjIn.selector;
}
// Make sure that the handler has a unique ID, used to find/remove it later
handler: handler,
guid: handler.guid,
selector: selector,
- quick: quickParse( selector ),
+ needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
namespace: namespaces.join(".")
}, handleObjIn );
// Detach an event or set of events from an element
remove: function( elem, types, handler, selector, mappedTypes ) {
- var elemData = jQuery.hasData( elem ) && jQuery._data( elem ),
- t, tns, type, origType, namespaces, origCount,
- j, events, special, handle, eventType, handleObj;
+ var t, tns, type, origType, namespaces, origCount,
+ j, events, special, eventType, handleObj,
+ elemData = jQuery.hasData( elem ) && jQuery._data( elem );
if ( !elemData || !(events = elemData.events) ) {
return;
type = ( selector? special.delegateType : special.bindType ) || type;
eventType = events[ type ] || [];
origCount = eventType.length;
- namespaces = namespaces ? new RegExp("(^|\\.)" + namespaces.split(".").sort().join("\\.(?:.*\\.)?") + "(\\.|$)") : null;
+ namespaces = namespaces ? new RegExp("(^|\\.)" + namespaces.split(".").sort().join("\\.(?:.*\\.|)") + "(\\.|$)") : null;
// Remove matching events
for ( j = 0; j < eventType.length; j++ ) {
// Remove generic event handler if we removed something and no more handlers exist
// (avoids potential for endless recursion during removal of special event handlers)
if ( eventType.length === 0 && origCount !== eventType.length ) {
- if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) {
+ if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
jQuery.removeEvent( elem, type, elemData.handle );
}
// Remove the expando if it's no longer used
if ( jQuery.isEmptyObject( events ) ) {
- handle = elemData.handle;
- if ( handle ) {
- handle.elem = null;
- }
+ delete elemData.handle;
// removeData also checks for emptiness and clears the expando if empty
// so use it instead of delete
- jQuery.removeData( elem, [ "events", "handle" ], true );
+ jQuery.removeData( elem, "events", true );
}
},
}
// Event object or event type
- var type = event.type || event,
- namespaces = [],
- cache, exclusive, i, cur, old, ontype, special, handle, eventPath, bubbleType;
+ var cache, exclusive, i, cur, old, ontype, special, handle, eventPath, bubbleType,
+ type = event.type || event,
+ namespaces = [];
// focus/blur morphs to focusin/out; ensure we're not firing them right now
if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
event.isTrigger = true;
event.exclusive = exclusive;
event.namespace = namespaces.join( "." );
- event.namespace_re = event.namespace? new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.)?") + "(\\.|$)") : null;
+ event.namespace_re = event.namespace? new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)") : null;
ontype = type.indexOf( ":" ) < 0 ? "on" + type : "";
// Handle a global trigger
bubbleType = special.delegateType || type;
cur = rfocusMorph.test( bubbleType + type ) ? elem : elem.parentNode;
- old = null;
- for ( ; cur; cur = cur.parentNode ) {
+ for ( old = elem; cur; cur = cur.parentNode ) {
eventPath.push([ cur, bubbleType ]);
old = cur;
}
// Only add window if we got to document (e.g., not plain obj or detached DOM)
- if ( old && old === elem.ownerDocument ) {
+ if ( old === (elem.ownerDocument || document) ) {
eventPath.push([ old.defaultView || old.parentWindow || window, bubbleType ]);
}
}
}
// Note that this is a bare JS function and not a jQuery handler
handle = ontype && cur[ ontype ];
- if ( handle && jQuery.acceptData( cur ) && handle.apply( cur, data ) === false ) {
+ if ( handle && jQuery.acceptData( cur ) && handle.apply && handle.apply( cur, data ) === false ) {
event.preventDefault();
}
}
// Make a writable jQuery.Event from the native event object
event = jQuery.event.fix( event || window.event );
- var handlers = ( (jQuery._data( this, "events" ) || {} )[ event.type ] || []),
+ var i, j, cur, ret, selMatch, matched, matches, handleObj, sel, related,
+ handlers = ( (jQuery._data( this, "events" ) || {} )[ event.type ] || []),
delegateCount = handlers.delegateCount,
- args = [].slice.call( arguments, 0 ),
+ args = core_slice.call( arguments ),
run_all = !event.exclusive && !event.namespace,
- handlerQueue = [],
- i, j, cur, jqcur, ret, selMatch, matched, matches, handleObj, sel, related;
+ special = jQuery.event.special[ event.type ] || {},
+ handlerQueue = [];
// Use the fix-ed jQuery.Event rather than the (read-only) native event
args[0] = event;
event.delegateTarget = this;
- // Determine handlers that should run if there are delegated events
- // Avoid disabled elements in IE (#6911) and non-left-click bubbling in Firefox (#3861)
- if ( delegateCount && !event.target.disabled && !(event.button && event.type === "click") ) {
+ // Call the preDispatch hook for the mapped type, and let it bail if desired
+ if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
+ return;
+ }
- // Pregenerate a single jQuery object for reuse with .is()
- jqcur = jQuery(this);
- jqcur.context = this.ownerDocument || this;
+ // Determine handlers that should run if there are delegated events
+ // Avoid non-left-click bubbling in Firefox (#3861)
+ if ( delegateCount && !(event.button && event.type === "click") ) {
for ( cur = event.target; cur != this; cur = cur.parentNode || this ) {
- selMatch = {};
- matches = [];
- jqcur[0] = cur;
- for ( i = 0; i < delegateCount; i++ ) {
- handleObj = handlers[ i ];
- sel = handleObj.selector;
-
- if ( selMatch[ sel ] === undefined ) {
- selMatch[ sel ] = (
- handleObj.quick ? quickIs( cur, handleObj.quick ) : jqcur.is( sel )
- );
+
+ // Don't process clicks (ONLY) on disabled elements (#6911, #8165, #11382, #11764)
+ if ( cur.disabled !== true || event.type !== "click" ) {
+ selMatch = {};
+ matches = [];
+ for ( i = 0; i < delegateCount; i++ ) {
+ handleObj = handlers[ i ];
+ sel = handleObj.selector;
+
+ if ( selMatch[ sel ] === undefined ) {
+ selMatch[ sel ] = handleObj.needsContext ?
+ jQuery( sel, this ).index( cur ) >= 0 :
+ jQuery.find( sel, this, null, [ cur ] ).length;
+ }
+ if ( selMatch[ sel ] ) {
+ matches.push( handleObj );
+ }
}
- if ( selMatch[ sel ] ) {
- matches.push( handleObj );
+ if ( matches.length ) {
+ handlerQueue.push({ elem: cur, matches: matches });
}
}
- if ( matches.length ) {
- handlerQueue.push({ elem: cur, matches: matches });
- }
}
}
}
}
+ // Call the postDispatch hook for the mapped type
+ if ( special.postDispatch ) {
+ special.postDispatch.call( this, event );
+ }
+
return event.result;
},
event.target = event.target.parentNode;
}
- // For mouse/key events; add metaKey if it's not there (#3368, IE6/7/8)
- if ( event.metaKey === undefined ) {
- event.metaKey = event.ctrlKey;
- }
+ // For mouse/key events, metaKey==false if it's undefined (#3368, #11328; IE6/7/8)
+ event.metaKey = !!event.metaKey;
return fixHook.filter? fixHook.filter( event, originalEvent ) : event;
},
special: {
- ready: {
- // Make sure the ready event is setup
- setup: jQuery.bindReady
- },
-
load: {
// Prevent triggered image.load events from bubbling to window.load
noBubble: true
}
} :
function( elem, type, handle ) {
+ var name = "on" + type;
+
if ( elem.detachEvent ) {
- elem.detachEvent( "on" + type, handle );
+
+ // #8545, #7054, preventing memory leaks for custom events in IE6-8 –
+ // detachEvent needed property on element, by name of that event, to properly expose it to GC
+ if ( typeof elem[ name ] === "undefined" ) {
+ elem[ name ] = null;
+ }
+
+ elem.detachEvent( name, handle );
}
};
bindType: fix,
handle: function( event ) {
- var target = this,
+ var ret,
+ target = this,
related = event.relatedTarget,
handleObj = event.handleObj,
- selector = handleObj.selector,
- ret;
+ selector = handleObj.selector;
// For mousenter/leave call the handler if related is outside the target.
// NB: No relatedTarget if the mouse left/entered the browser window
// Node name check avoids a VML-related crash in IE (#9807)
var elem = e.target,
form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined;
- if ( form && !form._submit_attached ) {
+ if ( form && !jQuery._data( form, "_submit_attached" ) ) {
jQuery.event.add( form, "submit._submit", function( event ) {
- // If form was submitted by the user, bubble the event up the tree
- if ( this.parentNode && !event.isTrigger ) {
- jQuery.event.simulate( "submit", this.parentNode, event, true );
- }
+ event._submit_bubble = true;
});
- form._submit_attached = true;
+ jQuery._data( form, "_submit_attached", true );
}
});
// return undefined since we don't need an event listener
},
+ postDispatch: function( event ) {
+ // If form was submitted by the user, bubble the event up the tree
+ if ( event._submit_bubble ) {
+ delete event._submit_bubble;
+ if ( this.parentNode && !event.isTrigger ) {
+ jQuery.event.simulate( "submit", this.parentNode, event, true );
+ }
+ }
+ },
+
teardown: function() {
// Only need this for delegated form submit events
if ( jQuery.nodeName( this, "form" ) ) {
jQuery.event.add( this, "click._change", function( event ) {
if ( this._just_changed && !event.isTrigger ) {
this._just_changed = false;
- jQuery.event.simulate( "change", this, event, true );
}
+ // Allow triggered, simulated change events (#11500)
+ jQuery.event.simulate( "change", this, event, true );
});
}
return false;
jQuery.event.add( this, "beforeactivate._change", function( e ) {
var elem = e.target;
- if ( rformElems.test( elem.nodeName ) && !elem._change_attached ) {
+ if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "_change_attached" ) ) {
jQuery.event.add( elem, "change._change", function( event ) {
if ( this.parentNode && !event.isSimulated && !event.isTrigger ) {
jQuery.event.simulate( "change", this.parentNode, event, true );
}
});
- elem._change_attached = true;
+ jQuery._data( elem, "_change_attached", true );
}
});
},
teardown: function() {
jQuery.event.remove( this, "._change" );
- return rformElems.test( this.nodeName );
+ return !rformElems.test( this.nodeName );
}
};
}
// Types can be a map of types/handlers
if ( typeof types === "object" ) {
// ( types-Object, selector, data )
- if ( typeof selector !== "string" ) {
+ if ( typeof selector !== "string" ) { // && selector != null
// ( types-Object, data )
- data = selector;
+ data = data || selector;
selector = undefined;
}
for ( type in types ) {
});
},
one: function( types, selector, data, fn ) {
- return this.on.call( this, types, selector, data, fn, 1 );
+ return this.on( types, selector, data, fn, 1 );
},
off: function( types, selector, fn ) {
+ var handleObj, type;
if ( types && types.preventDefault && types.handleObj ) {
// ( event ) dispatched jQuery.Event
- var handleObj = types.handleObj;
+ handleObj = types.handleObj;
jQuery( types.delegateTarget ).off(
- handleObj.namespace? handleObj.type + "." + handleObj.namespace : handleObj.type,
+ handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType,
handleObj.selector,
handleObj.handler
);
}
if ( typeof types === "object" ) {
// ( types-object [, selector] )
- for ( var type in types ) {
+ for ( type in types ) {
this.off( type, selector, types[ type ] );
}
return this;
},
undelegate: function( selector, types, fn ) {
// ( namespace ) or ( selector, types [, fn] )
- return arguments.length == 1? this.off( selector, "**" ) : this.off( types, selector, fn );
+ return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn );
},
trigger: function( type, data ) {
this.trigger( name );
};
- if ( jQuery.attrFn ) {
- jQuery.attrFn[ name ] = true;
- }
-
if ( rkeyEvent.test( name ) ) {
jQuery.event.fixHooks[ name ] = jQuery.event.keyHooks;
}
jQuery.event.fixHooks[ name ] = jQuery.event.mouseHooks;
}
});
-
-
-
/*!
* Sizzle CSS Selector Engine
- * Copyright 2011, The Dojo Foundation
- * Released under the MIT, BSD, and GPL Licenses.
- * More information: http://sizzlejs.com/
+ * Copyright 2012 jQuery Foundation and other contributors
+ * Released under the MIT license
+ * http://sizzlejs.com/
*/
-(function(){
+(function( window, undefined ) {
+
+var cachedruns,
+ assertGetIdNotName,
+ Expr,
+ getText,
+ isXML,
+ contains,
+ compile,
+ sortOrder,
+ hasDuplicate,
+ outermostContext,
-var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
- expando = "sizcache" + (Math.random() + '').replace('.', ''),
- done = 0,
- toString = Object.prototype.toString,
- hasDuplicate = false,
baseHasDuplicate = true,
- rBackslash = /\\/g,
- rReturn = /\r\n/g,
- rNonWord = /\W/;
-
-// Here we check if the JavaScript engine is using some sort of
-// optimization where it does not always call our comparision
-// function. If that is the case, discard the hasDuplicate value.
-// Thus far that includes Google Chrome.
-[0, 0].sort(function() {
- baseHasDuplicate = false;
- return 0;
-});
+ strundefined = "undefined",
-var Sizzle = function( selector, context, results, seed ) {
- results = results || [];
- context = context || document;
+ expando = ( "sizcache" + Math.random() ).replace( ".", "" ),
- var origContext = context;
+ Token = String,
+ document = window.document,
+ docElem = document.documentElement,
+ dirruns = 0,
+ done = 0,
+ pop = [].pop,
+ push = [].push,
+ slice = [].slice,
+ // Use a stripped-down indexOf if a native one is unavailable
+ indexOf = [].indexOf || function( elem ) {
+ var i = 0,
+ len = this.length;
+ for ( ; i < len; i++ ) {
+ if ( this[i] === elem ) {
+ return i;
+ }
+ }
+ return -1;
+ },
- if ( context.nodeType !== 1 && context.nodeType !== 9 ) {
- return [];
- }
-
- if ( !selector || typeof selector !== "string" ) {
- return results;
- }
+ // Augment a function for special use by Sizzle
+ markFunction = function( fn, value ) {
+ fn[ expando ] = value == null || value;
+ return fn;
+ },
- var m, set, checkSet, extra, ret, cur, pop, i,
- prune = true,
- contextXML = Sizzle.isXML( context ),
- parts = [],
- soFar = selector;
-
- // Reset the position of the chunker regexp (start from head)
- do {
- chunker.exec( "" );
- m = chunker.exec( soFar );
-
- if ( m ) {
- soFar = m[3];
-
- parts.push( m[1] );
-
- if ( m[2] ) {
- extra = m[3];
- break;
+ createCache = function() {
+ var cache = {},
+ keys = [];
+
+ return markFunction(function( key, value ) {
+ // Only keep the most recent entries
+ if ( keys.push( key ) > Expr.cacheLength ) {
+ delete cache[ keys.shift() ];
}
- }
- } while ( m );
- if ( parts.length > 1 && origPOS.exec( selector ) ) {
+ return (cache[ key ] = value);
+ }, cache );
+ },
- if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {
- set = posProcess( parts[0] + parts[1], context, seed );
+ classCache = createCache(),
+ tokenCache = createCache(),
+ compilerCache = createCache(),
- } else {
- set = Expr.relative[ parts[0] ] ?
- [ context ] :
- Sizzle( parts.shift(), context );
+ // Regex
- while ( parts.length ) {
- selector = parts.shift();
+ // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace
+ whitespace = "[\\x20\\t\\r\\n\\f]",
+ // http://www.w3.org/TR/css3-syntax/#characters
+ characterEncoding = "(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",
- if ( Expr.relative[ selector ] ) {
- selector += parts.shift();
- }
-
- set = posProcess( selector, set, seed );
- }
- }
+ // Loosely modeled on CSS identifier characters
+ // An unquoted value should be a CSS identifier (http://www.w3.org/TR/css3-selectors/#attribute-selectors)
+ // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
+ identifier = characterEncoding.replace( "w", "w#" ),
- } else {
- // Take a shortcut and set the context if the root selector is an ID
- // (but not if it'll be faster if the inner selector is an ID)
- if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML &&
- Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) {
+ // Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors
+ operators = "([*^$|!~]?=)",
+ attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace +
+ "*(?:" + operators + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]",
- ret = Sizzle.find( parts.shift(), context, contextXML );
- context = ret.expr ?
- Sizzle.filter( ret.expr, ret.set )[0] :
- ret.set[0];
- }
+ // Prefer arguments not in parens/brackets,
+ // then attribute selectors and non-pseudos (denoted by :),
+ // then anything else
+ // These preferences are here to reduce the number of selectors
+ // needing tokenize in the PSEUDO preFilter
+ pseudos = ":(" + characterEncoding + ")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:" + attributes + ")|[^:]|\\\\.)*|.*))\\)|)",
- if ( context ) {
- ret = seed ?
- { expr: parts.pop(), set: makeArray(seed) } :
- Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML );
+ // For matchExpr.POS and matchExpr.needsContext
+ pos = ":(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace +
+ "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)",
- set = ret.expr ?
- Sizzle.filter( ret.expr, ret.set ) :
- ret.set;
+ // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
+ rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
- if ( parts.length > 0 ) {
- checkSet = makeArray( set );
+ rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
+ rcombinators = new RegExp( "^" + whitespace + "*([\\x20\\t\\r\\n\\f>+~])" + whitespace + "*" ),
+ rpseudo = new RegExp( pseudos ),
- } else {
- prune = false;
- }
+ // Easily-parseable/retrievable ID or TAG or CLASS selectors
+ rquickExpr = /^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,
- while ( parts.length ) {
- cur = parts.pop();
- pop = cur;
+ rnot = /^:not/,
+ rsibling = /[\x20\t\r\n\f]*[+~]/,
+ rendsWithNot = /:not\($/,
- if ( !Expr.relative[ cur ] ) {
- cur = "";
- } else {
- pop = parts.pop();
- }
+ rheader = /h\d/i,
+ rinputs = /input|select|textarea|button/i,
- if ( pop == null ) {
- pop = context;
- }
+ rbackslash = /\\(?!\\)/g,
- Expr.relative[ cur ]( checkSet, pop, contextXML );
- }
+ matchExpr = {
+ "ID": new RegExp( "^#(" + characterEncoding + ")" ),
+ "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ),
+ "NAME": new RegExp( "^\\[name=['\"]?(" + characterEncoding + ")['\"]?\\]" ),
+ "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ),
+ "ATTR": new RegExp( "^" + attributes ),
+ "PSEUDO": new RegExp( "^" + pseudos ),
+ "POS": new RegExp( pos, "i" ),
+ "CHILD": new RegExp( "^:(only|nth|first|last)-child(?:\\(" + whitespace +
+ "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
+ "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
+ // For use in libraries implementing .is()
+ "needsContext": new RegExp( "^" + whitespace + "*[>+~]|" + pos, "i" )
+ },
- } else {
- checkSet = parts = [];
+ // Support
+
+ // Used for testing something on an element
+ assert = function( fn ) {
+ var div = document.createElement("div");
+
+ try {
+ return fn( div );
+ } catch (e) {
+ return false;
+ } finally {
+ // release memory in IE
+ div = null;
+ }
+ },
+
+ // Check if getElementsByTagName("*") returns only elements
+ assertTagNameNoComments = assert(function( div ) {
+ div.appendChild( document.createComment("") );
+ return !div.getElementsByTagName("*").length;
+ }),
+
+ // Check if getAttribute returns normalized href attributes
+ assertHrefNotNormalized = assert(function( div ) {
+ div.innerHTML = "<a href='#'></a>";
+ return div.firstChild && typeof div.firstChild.getAttribute !== strundefined &&
+ div.firstChild.getAttribute("href") === "#";
+ }),
+
+ // Check if attributes should be retrieved by attribute nodes
+ assertAttributes = assert(function( div ) {
+ div.innerHTML = "<select></select>";
+ var type = typeof div.lastChild.getAttribute("multiple");
+ // IE8 returns a string for some attributes even when not present
+ return type !== "boolean" && type !== "string";
+ }),
+
+ // Check if getElementsByClassName can be trusted
+ assertUsableClassName = assert(function( div ) {
+ // Opera can't find a second classname (in 9.6)
+ div.innerHTML = "<div class='hidden e'></div><div class='hidden'></div>";
+ if ( !div.getElementsByClassName || !div.getElementsByClassName("e").length ) {
+ return false;
}
- }
- if ( !checkSet ) {
- checkSet = set;
- }
+ // Safari 3.2 caches class attributes and doesn't catch changes
+ div.lastChild.className = "e";
+ return div.getElementsByClassName("e").length === 2;
+ }),
- if ( !checkSet ) {
- Sizzle.error( cur || selector );
- }
+ // Check if getElementById returns elements by name
+ // Check if getElementsByName privileges form controls or returns elements by ID
+ assertUsableName = assert(function( div ) {
+ // Inject content
+ div.id = expando + 0;
+ div.innerHTML = "<a name='" + expando + "'></a><div name='" + expando + "'></div>";
+ docElem.insertBefore( div, docElem.firstChild );
- if ( toString.call(checkSet) === "[object Array]" ) {
- if ( !prune ) {
- results.push.apply( results, checkSet );
+ // Test
+ var pass = document.getElementsByName &&
+ // buggy browsers will return fewer than the correct 2
+ document.getElementsByName( expando ).length === 2 +
+ // buggy browsers will return more than the correct 0
+ document.getElementsByName( expando + 0 ).length;
+ assertGetIdNotName = !document.getElementById( expando );
- } else if ( context && context.nodeType === 1 ) {
- for ( i = 0; checkSet[i] != null; i++ ) {
- if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) {
- results.push( set[i] );
- }
- }
+ // Cleanup
+ docElem.removeChild( div );
- } else {
- for ( i = 0; checkSet[i] != null; i++ ) {
- if ( checkSet[i] && checkSet[i].nodeType === 1 ) {
- results.push( set[i] );
- }
- }
+ return pass;
+ });
+
+// If slice is not available, provide a backup
+try {
+ slice.call( docElem.childNodes, 0 )[0].nodeType;
+} catch ( e ) {
+ slice = function( i ) {
+ var elem,
+ results = [];
+ for ( ; (elem = this[i]); i++ ) {
+ results.push( elem );
}
+ return results;
+ };
+}
- } else {
- makeArray( checkSet, results );
- }
+function Sizzle( selector, context, results, seed ) {
+ results = results || [];
+ context = context || document;
+ var match, elem, xml, m,
+ nodeType = context.nodeType;
- if ( extra ) {
- Sizzle( extra, origContext, results, seed );
- Sizzle.uniqueSort( results );
+ if ( !selector || typeof selector !== "string" ) {
+ return results;
}
- return results;
-};
+ if ( nodeType !== 1 && nodeType !== 9 ) {
+ return [];
+ }
-Sizzle.uniqueSort = function( results ) {
- if ( sortOrder ) {
- hasDuplicate = baseHasDuplicate;
- results.sort( sortOrder );
+ xml = isXML( context );
- if ( hasDuplicate ) {
- for ( var i = 1; i < results.length; i++ ) {
- if ( results[i] === results[ i - 1 ] ) {
- results.splice( i--, 1 );
+ if ( !xml && !seed ) {
+ if ( (match = rquickExpr.exec( selector )) ) {
+ // Speed-up: Sizzle("#ID")
+ if ( (m = match[1]) ) {
+ if ( nodeType === 9 ) {
+ elem = context.getElementById( m );
+ // Check parentNode to catch when Blackberry 4.6 returns
+ // nodes that are no longer in the document #6963
+ if ( elem && elem.parentNode ) {
+ // Handle the case where IE, Opera, and Webkit return items
+ // by name instead of ID
+ if ( elem.id === m ) {
+ results.push( elem );
+ return results;
+ }
+ } else {
+ return results;
+ }
+ } else {
+ // Context is not a document
+ if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) &&
+ contains( context, elem ) && elem.id === m ) {
+ results.push( elem );
+ return results;
+ }
}
+
+ // Speed-up: Sizzle("TAG")
+ } else if ( match[2] ) {
+ push.apply( results, slice.call(context.getElementsByTagName( selector ), 0) );
+ return results;
+
+ // Speed-up: Sizzle(".CLASS")
+ } else if ( (m = match[3]) && assertUsableClassName && context.getElementsByClassName ) {
+ push.apply( results, slice.call(context.getElementsByClassName( m ), 0) );
+ return results;
}
}
}
- return results;
-};
+ // All others
+ return select( selector.replace( rtrim, "$1" ), context, results, seed, xml );
+}
-Sizzle.matches = function( expr, set ) {
- return Sizzle( expr, null, null, set );
+Sizzle.matches = function( expr, elements ) {
+ return Sizzle( expr, null, null, elements );
};
-Sizzle.matchesSelector = function( node, expr ) {
- return Sizzle( expr, null, null, [node] ).length > 0;
+Sizzle.matchesSelector = function( elem, expr ) {
+ return Sizzle( expr, null, null, [ elem ] ).length > 0;
};
-Sizzle.find = function( expr, context, isXML ) {
- var set, i, len, match, type, left;
-
- if ( !expr ) {
- return [];
- }
-
- for ( i = 0, len = Expr.order.length; i < len; i++ ) {
- type = Expr.order[i];
-
- if ( (match = Expr.leftMatch[ type ].exec( expr )) ) {
- left = match[1];
- match.splice( 1, 1 );
-
- if ( left.substr( left.length - 1 ) !== "\\" ) {
- match[1] = (match[1] || "").replace( rBackslash, "" );
- set = Expr.find[ type ]( match, context, isXML );
-
- if ( set != null ) {
- expr = expr.replace( Expr.match[ type ], "" );
- break;
- }
- }
- }
- }
-
- if ( !set ) {
- set = typeof context.getElementsByTagName !== "undefined" ?
- context.getElementsByTagName( "*" ) :
- [];
- }
-
- return { set: set, expr: expr };
-};
-
-Sizzle.filter = function( expr, set, inplace, not ) {
- var match, anyFound,
- type, found, item, filter, left,
- i, pass,
- old = expr,
- result = [],
- curLoop = set,
- isXMLFilter = set && set[0] && Sizzle.isXML( set[0] );
-
- while ( expr && set.length ) {
- for ( type in Expr.filter ) {
- if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) {
- filter = Expr.filter[ type ];
- left = match[1];
-
- anyFound = false;
-
- match.splice(1,1);
-
- if ( left.substr( left.length - 1 ) === "\\" ) {
- continue;
- }
-
- if ( curLoop === result ) {
- result = [];
- }
-
- if ( Expr.preFilter[ type ] ) {
- match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter );
-
- if ( !match ) {
- anyFound = found = true;
-
- } else if ( match === true ) {
- continue;
- }
- }
-
- if ( match ) {
- for ( i = 0; (item = curLoop[i]) != null; i++ ) {
- if ( item ) {
- found = filter( item, match, i, curLoop );
- pass = not ^ found;
-
- if ( inplace && found != null ) {
- if ( pass ) {
- anyFound = true;
-
- } else {
- curLoop[i] = false;
- }
-
- } else if ( pass ) {
- result.push( item );
- anyFound = true;
- }
- }
- }
- }
-
- if ( found !== undefined ) {
- if ( !inplace ) {
- curLoop = result;
- }
+// Returns a function to use in pseudos for input types
+function createInputPseudo( type ) {
+ return function( elem ) {
+ var name = elem.nodeName.toLowerCase();
+ return name === "input" && elem.type === type;
+ };
+}
- expr = expr.replace( Expr.match[ type ], "" );
+// Returns a function to use in pseudos for buttons
+function createButtonPseudo( type ) {
+ return function( elem ) {
+ var name = elem.nodeName.toLowerCase();
+ return (name === "input" || name === "button") && elem.type === type;
+ };
+}
- if ( !anyFound ) {
- return [];
- }
+// Returns a function to use in pseudos for positionals
+function createPositionalPseudo( fn ) {
+ return markFunction(function( argument ) {
+ argument = +argument;
+ return markFunction(function( seed, matches ) {
+ var j,
+ matchIndexes = fn( [], seed.length, argument ),
+ i = matchIndexes.length;
- break;
+ // Match elements found at the specified indexes
+ while ( i-- ) {
+ if ( seed[ (j = matchIndexes[i]) ] ) {
+ seed[j] = !(matches[j] = seed[j]);
}
}
- }
-
- // Improper expression
- if ( expr === old ) {
- if ( anyFound == null ) {
- Sizzle.error( expr );
-
- } else {
- break;
- }
- }
-
- old = expr;
- }
-
- return curLoop;
-};
-
-Sizzle.error = function( msg ) {
- throw new Error( "Syntax error, unrecognized expression: " + msg );
-};
+ });
+ });
+}
/**
- * Utility function for retreiving the text value of an array of DOM nodes
+ * Utility function for retrieving the text value of an array of DOM nodes
* @param {Array|Element} elem
*/
-var getText = Sizzle.getText = function( elem ) {
- var i, node,
- nodeType = elem.nodeType,
- ret = "";
+getText = Sizzle.getText = function( elem ) {
+ var node,
+ ret = "",
+ i = 0,
+ nodeType = elem.nodeType;
if ( nodeType ) {
- if ( nodeType === 1 || nodeType === 9 ) {
- // Use textContent || innerText for elements
- if ( typeof elem.textContent === 'string' ) {
+ if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
+ // Use textContent for elements
+ // innerText usage removed for consistency of new lines (see #11153)
+ if ( typeof elem.textContent === "string" ) {
return elem.textContent;
- } else if ( typeof elem.innerText === 'string' ) {
- // Replace IE's carriage returns
- return elem.innerText.replace( rReturn, '' );
} else {
- // Traverse it's children
- for ( elem = elem.firstChild; elem; elem = elem.nextSibling) {
+ // Traverse its children
+ for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
ret += getText( elem );
}
}
} else if ( nodeType === 3 || nodeType === 4 ) {
return elem.nodeValue;
}
+ // Do not include comment or processing instruction nodes
} else {
// If no nodeType, this is expected to be an array
- for ( i = 0; (node = elem[i]); i++ ) {
+ for ( ; (node = elem[i]); i++ ) {
// Do not traverse comment nodes
- if ( node.nodeType !== 8 ) {
- ret += getText( node );
- }
+ ret += getText( node );
}
}
return ret;
};
-var Expr = Sizzle.selectors = {
- order: [ "ID", "NAME", "TAG" ],
-
- match: {
- ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
- CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
- NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,
- ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,
- TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,
- CHILD: /:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,
- POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,
- PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/
- },
+isXML = Sizzle.isXML = function( elem ) {
+ // documentElement is verified for cases where it doesn't yet exist
+ // (such as loading iframes in IE - #4833)
+ var documentElement = elem && (elem.ownerDocument || elem).documentElement;
+ return documentElement ? documentElement.nodeName !== "HTML" : false;
+};
- leftMatch: {},
+// Element contains another
+contains = Sizzle.contains = docElem.contains ?
+ function( a, b ) {
+ var adown = a.nodeType === 9 ? a.documentElement : a,
+ bup = b && b.parentNode;
+ return a === bup || !!( bup && bup.nodeType === 1 && adown.contains && adown.contains(bup) );
+ } :
+ docElem.compareDocumentPosition ?
+ function( a, b ) {
+ return b && !!( a.compareDocumentPosition( b ) & 16 );
+ } :
+ function( a, b ) {
+ while ( (b = b.parentNode) ) {
+ if ( b === a ) {
+ return true;
+ }
+ }
+ return false;
+ };
- attrMap: {
- "class": "className",
- "for": "htmlFor"
- },
+Sizzle.attr = function( elem, name ) {
+ var val,
+ xml = isXML( elem );
- attrHandle: {
- href: function( elem ) {
- return elem.getAttribute( "href" );
- },
- type: function( elem ) {
- return elem.getAttribute( "type" );
- }
- },
+ if ( !xml ) {
+ name = name.toLowerCase();
+ }
+ if ( (val = Expr.attrHandle[ name ]) ) {
+ return val( elem );
+ }
+ if ( xml || assertAttributes ) {
+ return elem.getAttribute( name );
+ }
+ val = elem.getAttributeNode( name );
+ return val ?
+ typeof elem[ name ] === "boolean" ?
+ elem[ name ] ? name : null :
+ val.specified ? val.value : null :
+ null;
+};
- relative: {
- "+": function(checkSet, part){
- var isPartStr = typeof part === "string",
- isTag = isPartStr && !rNonWord.test( part ),
- isPartStrNotTag = isPartStr && !isTag;
+Expr = Sizzle.selectors = {
- if ( isTag ) {
- part = part.toLowerCase();
- }
+ // Can be adjusted by the user
+ cacheLength: 50,
- for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) {
- if ( (elem = checkSet[i]) ) {
- while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {}
+ createPseudo: markFunction,
- checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ?
- elem || false :
- elem === part;
- }
- }
+ match: matchExpr,
- if ( isPartStrNotTag ) {
- Sizzle.filter( part, checkSet, true );
+ // IE6/7 return a modified href
+ attrHandle: assertHrefNotNormalized ?
+ {} :
+ {
+ "href": function( elem ) {
+ return elem.getAttribute( "href", 2 );
+ },
+ "type": function( elem ) {
+ return elem.getAttribute("type");
}
},
- ">": function( checkSet, part ) {
- var elem,
- isPartStr = typeof part === "string",
- i = 0,
- l = checkSet.length;
-
- if ( isPartStr && !rNonWord.test( part ) ) {
- part = part.toLowerCase();
+ find: {
+ "ID": assertGetIdNotName ?
+ function( id, context, xml ) {
+ if ( typeof context.getElementById !== strundefined && !xml ) {
+ var m = context.getElementById( id );
+ // Check parentNode to catch when Blackberry 4.6 returns
+ // nodes that are no longer in the document #6963
+ return m && m.parentNode ? [m] : [];
+ }
+ } :
+ function( id, context, xml ) {
+ if ( typeof context.getElementById !== strundefined && !xml ) {
+ var m = context.getElementById( id );
- for ( ; i < l; i++ ) {
- elem = checkSet[i];
+ return m ?
+ m.id === id || typeof m.getAttributeNode !== strundefined && m.getAttributeNode("id").value === id ?
+ [m] :
+ undefined :
+ [];
+ }
+ },
- if ( elem ) {
- var parent = elem.parentNode;
- checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false;
- }
+ "TAG": assertTagNameNoComments ?
+ function( tag, context ) {
+ if ( typeof context.getElementsByTagName !== strundefined ) {
+ return context.getElementsByTagName( tag );
}
+ } :
+ function( tag, context ) {
+ var results = context.getElementsByTagName( tag );
- } else {
- for ( ; i < l; i++ ) {
- elem = checkSet[i];
+ // Filter out possible comments
+ if ( tag === "*" ) {
+ var elem,
+ tmp = [],
+ i = 0;
- if ( elem ) {
- checkSet[i] = isPartStr ?
- elem.parentNode :
- elem.parentNode === part;
+ for ( ; (elem = results[i]); i++ ) {
+ if ( elem.nodeType === 1 ) {
+ tmp.push( elem );
+ }
}
- }
- if ( isPartStr ) {
- Sizzle.filter( part, checkSet, true );
+ return tmp;
}
- }
- },
-
- "": function(checkSet, part, isXML){
- var nodeCheck,
- doneName = done++,
- checkFn = dirCheck;
+ return results;
+ },
- if ( typeof part === "string" && !rNonWord.test( part ) ) {
- part = part.toLowerCase();
- nodeCheck = part;
- checkFn = dirNodeCheck;
+ "NAME": assertUsableName && function( tag, context ) {
+ if ( typeof context.getElementsByName !== strundefined ) {
+ return context.getElementsByName( name );
}
-
- checkFn( "parentNode", part, doneName, checkSet, nodeCheck, isXML );
},
- "~": function( checkSet, part, isXML ) {
- var nodeCheck,
- doneName = done++,
- checkFn = dirCheck;
-
- if ( typeof part === "string" && !rNonWord.test( part ) ) {
- part = part.toLowerCase();
- nodeCheck = part;
- checkFn = dirNodeCheck;
+ "CLASS": assertUsableClassName && function( className, context, xml ) {
+ if ( typeof context.getElementsByClassName !== strundefined && !xml ) {
+ return context.getElementsByClassName( className );
}
-
- checkFn( "previousSibling", part, doneName, checkSet, nodeCheck, isXML );
}
},
- find: {
- ID: function( match, context, isXML ) {
- if ( typeof context.getElementById !== "undefined" && !isXML ) {
- var m = context.getElementById(match[1]);
- // Check parentNode to catch when Blackberry 4.6 returns
- // nodes that are no longer in the document #6963
- return m && m.parentNode ? [m] : [];
- }
- },
-
- NAME: function( match, context ) {
- if ( typeof context.getElementsByName !== "undefined" ) {
- var ret = [],
- results = context.getElementsByName( match[1] );
-
- for ( var i = 0, l = results.length; i < l; i++ ) {
- if ( results[i].getAttribute("name") === match[1] ) {
- ret.push( results[i] );
- }
- }
-
- return ret.length === 0 ? null : ret;
- }
- },
-
- TAG: function( match, context ) {
- if ( typeof context.getElementsByTagName !== "undefined" ) {
- return context.getElementsByTagName( match[1] );
- }
- }
+ relative: {
+ ">": { dir: "parentNode", first: true },
+ " ": { dir: "parentNode" },
+ "+": { dir: "previousSibling", first: true },
+ "~": { dir: "previousSibling" }
},
- preFilter: {
- CLASS: function( match, curLoop, inplace, result, not, isXML ) {
- match = " " + match[1].replace( rBackslash, "" ) + " ";
- if ( isXML ) {
- return match;
- }
+ preFilter: {
+ "ATTR": function( match ) {
+ match[1] = match[1].replace( rbackslash, "" );
- for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) {
- if ( elem ) {
- if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n\r]/g, " ").indexOf(match) >= 0) ) {
- if ( !inplace ) {
- result.push( elem );
- }
+ // Move the given value to match[3] whether quoted or unquoted
+ match[3] = ( match[4] || match[5] || "" ).replace( rbackslash, "" );
- } else if ( inplace ) {
- curLoop[i] = false;
- }
- }
+ if ( match[2] === "~=" ) {
+ match[3] = " " + match[3] + " ";
}
- return false;
- },
-
- ID: function( match ) {
- return match[1].replace( rBackslash, "" );
+ return match.slice( 0, 4 );
},
- TAG: function( match, curLoop ) {
- return match[1].replace( rBackslash, "" ).toLowerCase();
- },
+ "CHILD": function( match ) {
+ /* matches from matchExpr["CHILD"]
+ 1 type (only|nth|...)
+ 2 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
+ 3 xn-component of xn+y argument ([+-]?\d*n|)
+ 4 sign of xn-component
+ 5 x of xn-component
+ 6 sign of y-component
+ 7 y of y-component
+ */
+ match[1] = match[1].toLowerCase();
- CHILD: function( match ) {
if ( match[1] === "nth" ) {
+ // nth-child requires argument
if ( !match[2] ) {
Sizzle.error( match[0] );
}
- match[2] = match[2].replace(/^\+|\s*/g, '');
-
- // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
- var test = /(-?)(\d*)(?:n([+\-]?\d*))?/.exec(
- match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" ||
- !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);
+ // numeric x and y parameters for Expr.filter.CHILD
+ // remember that false/true cast respectively to 0/1
+ match[3] = +( match[3] ? match[4] + (match[5] || 1) : 2 * ( match[2] === "even" || match[2] === "odd" ) );
+ match[4] = +( ( match[6] + match[7] ) || match[2] === "odd" );
- // calculate the numbers (first)n+(last) including if they are negative
- match[2] = (test[1] + (test[2] || 1)) - 0;
- match[3] = test[3] - 0;
- }
- else if ( match[2] ) {
+ // other types prohibit arguments
+ } else if ( match[2] ) {
Sizzle.error( match[0] );
}
- // TODO: Move to normal caching system
- match[0] = done++;
-
return match;
},
- ATTR: function( match, curLoop, inplace, result, not, isXML ) {
- var name = match[1] = match[1].replace( rBackslash, "" );
-
- if ( !isXML && Expr.attrMap[name] ) {
- match[1] = Expr.attrMap[name];
+ "PSEUDO": function( match ) {
+ var unquoted, excess;
+ if ( matchExpr["CHILD"].test( match[0] ) ) {
+ return null;
}
- // Handle if an un-quoted value was used
- match[4] = ( match[4] || match[5] || "" ).replace( rBackslash, "" );
-
- if ( match[2] === "~=" ) {
- match[4] = " " + match[4] + " ";
- }
+ if ( match[3] ) {
+ match[2] = match[3];
+ } else if ( (unquoted = match[4]) ) {
+ // Only check arguments that contain a pseudo
+ if ( rpseudo.test(unquoted) &&
+ // Get excess from tokenize (recursively)
+ (excess = tokenize( unquoted, true )) &&
+ // advance to the next closing parenthesis
+ (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
- return match;
- },
-
- PSEUDO: function( match, curLoop, inplace, result, not ) {
- if ( match[1] === "not" ) {
- // If we're dealing with a complex expression, or a simple one
- if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) {
- match[3] = Sizzle(match[3], null, null, curLoop);
-
- } else {
- var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);
-
- if ( !inplace ) {
- result.push.apply( result, ret );
- }
-
- return false;
+ // excess is a negative index
+ unquoted = unquoted.slice( 0, excess );
+ match[0] = match[0].slice( 0, excess );
}
-
- } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) {
- return true;
+ match[2] = unquoted;
}
-
- return match;
- },
- POS: function( match ) {
- match.unshift( true );
-
- return match;
+ // Return only captures needed by the pseudo filter method (type and argument)
+ return match.slice( 0, 3 );
}
},
-
- filters: {
- enabled: function( elem ) {
- return elem.disabled === false && elem.type !== "hidden";
- },
- disabled: function( elem ) {
- return elem.disabled === true;
- },
+ filter: {
+ "ID": assertGetIdNotName ?
+ function( id ) {
+ id = id.replace( rbackslash, "" );
+ return function( elem ) {
+ return elem.getAttribute("id") === id;
+ };
+ } :
+ function( id ) {
+ id = id.replace( rbackslash, "" );
+ return function( elem ) {
+ var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id");
+ return node && node.value === id;
+ };
+ },
- checked: function( elem ) {
- return elem.checked === true;
- },
-
- selected: function( elem ) {
- // Accessing this property makes selected-by-default
- // options in Safari work properly
- if ( elem.parentNode ) {
- elem.parentNode.selectedIndex;
+ "TAG": function( nodeName ) {
+ if ( nodeName === "*" ) {
+ return function() { return true; };
}
-
- return elem.selected === true;
- },
-
- parent: function( elem ) {
- return !!elem.firstChild;
- },
+ nodeName = nodeName.replace( rbackslash, "" ).toLowerCase();
- empty: function( elem ) {
- return !elem.firstChild;
- },
-
- has: function( elem, i, match ) {
- return !!Sizzle( match[3], elem ).length;
- },
-
- header: function( elem ) {
- return (/h\d/i).test( elem.nodeName );
+ return function( elem ) {
+ return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
+ };
},
- text: function( elem ) {
- var attr = elem.getAttribute( "type" ), type = elem.type;
- // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc)
- // use getAttribute instead to test this case
- return elem.nodeName.toLowerCase() === "input" && "text" === type && ( attr === type || attr === null );
+ "CLASS": function( className ) {
+ var pattern = classCache[ expando ][ className ];
+ if ( !pattern ) {
+ pattern = classCache( className, new RegExp("(^|" + whitespace + ")" + className + "(" + whitespace + "|$)") );
+ }
+ return function( elem ) {
+ return pattern.test( elem.className || (typeof elem.getAttribute !== strundefined && elem.getAttribute("class")) || "" );
+ };
},
- radio: function( elem ) {
- return elem.nodeName.toLowerCase() === "input" && "radio" === elem.type;
- },
+ "ATTR": function( name, operator, check ) {
+ return function( elem, context ) {
+ var result = Sizzle.attr( elem, name );
- checkbox: function( elem ) {
- return elem.nodeName.toLowerCase() === "input" && "checkbox" === elem.type;
- },
+ if ( result == null ) {
+ return operator === "!=";
+ }
+ if ( !operator ) {
+ return true;
+ }
- file: function( elem ) {
- return elem.nodeName.toLowerCase() === "input" && "file" === elem.type;
- },
+ result += "";
- password: function( elem ) {
- return elem.nodeName.toLowerCase() === "input" && "password" === elem.type;
+ return operator === "=" ? result === check :
+ operator === "!=" ? result !== check :
+ operator === "^=" ? check && result.indexOf( check ) === 0 :
+ operator === "*=" ? check && result.indexOf( check ) > -1 :
+ operator === "$=" ? check && result.substr( result.length - check.length ) === check :
+ operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 :
+ operator === "|=" ? result === check || result.substr( 0, check.length + 1 ) === check + "-" :
+ false;
+ };
},
- submit: function( elem ) {
- var name = elem.nodeName.toLowerCase();
- return (name === "input" || name === "button") && "submit" === elem.type;
- },
+ "CHILD": function( type, argument, first, last ) {
- image: function( elem ) {
- return elem.nodeName.toLowerCase() === "input" && "image" === elem.type;
- },
+ if ( type === "nth" ) {
+ return function( elem ) {
+ var node, diff,
+ parent = elem.parentNode;
- reset: function( elem ) {
- var name = elem.nodeName.toLowerCase();
- return (name === "input" || name === "button") && "reset" === elem.type;
- },
+ if ( first === 1 && last === 0 ) {
+ return true;
+ }
- button: function( elem ) {
- var name = elem.nodeName.toLowerCase();
- return name === "input" && "button" === elem.type || name === "button";
- },
+ if ( parent ) {
+ diff = 0;
+ for ( node = parent.firstChild; node; node = node.nextSibling ) {
+ if ( node.nodeType === 1 ) {
+ diff++;
+ if ( elem === node ) {
+ break;
+ }
+ }
+ }
+ }
- input: function( elem ) {
- return (/input|select|textarea|button/i).test( elem.nodeName );
- },
+ // Incorporate the offset (or cast to NaN), then check against cycle size
+ diff -= last;
+ return diff === first || ( diff % first === 0 && diff / first >= 0 );
+ };
+ }
- focus: function( elem ) {
- return elem === elem.ownerDocument.activeElement;
- }
- },
- setFilters: {
- first: function( elem, i ) {
- return i === 0;
- },
+ return function( elem ) {
+ var node = elem;
- last: function( elem, i, match, array ) {
- return i === array.length - 1;
- },
+ switch ( type ) {
+ case "only":
+ case "first":
+ while ( (node = node.previousSibling) ) {
+ if ( node.nodeType === 1 ) {
+ return false;
+ }
+ }
- even: function( elem, i ) {
- return i % 2 === 0;
- },
+ if ( type === "first" ) {
+ return true;
+ }
- odd: function( elem, i ) {
- return i % 2 === 1;
- },
+ node = elem;
- lt: function( elem, i, match ) {
- return i < match[3] - 0;
- },
+ /* falls through */
+ case "last":
+ while ( (node = node.nextSibling) ) {
+ if ( node.nodeType === 1 ) {
+ return false;
+ }
+ }
- gt: function( elem, i, match ) {
- return i > match[3] - 0;
+ return true;
+ }
+ };
},
- nth: function( elem, i, match ) {
- return match[3] - 0 === i;
- },
+ "PSEUDO": function( pseudo, argument ) {
+ // pseudo-class names are case-insensitive
+ // http://www.w3.org/TR/selectors/#pseudo-classes
+ // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
+ // Remember that setFilters inherits from pseudos
+ var args,
+ fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
+ Sizzle.error( "unsupported pseudo: " + pseudo );
+
+ // The user may use createPseudo to indicate that
+ // arguments are needed to create the filter function
+ // just as Sizzle does
+ if ( fn[ expando ] ) {
+ return fn( argument );
+ }
+
+ // But maintain support for old signatures
+ if ( fn.length > 1 ) {
+ args = [ pseudo, pseudo, "", argument ];
+ return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
+ markFunction(function( seed, matches ) {
+ var idx,
+ matched = fn( seed, argument ),
+ i = matched.length;
+ while ( i-- ) {
+ idx = indexOf.call( seed, matched[i] );
+ seed[ idx ] = !( matches[ idx ] = matched[i] );
+ }
+ }) :
+ function( elem ) {
+ return fn( elem, 0, args );
+ };
+ }
- eq: function( elem, i, match ) {
- return match[3] - 0 === i;
+ return fn;
}
},
- filter: {
- PSEUDO: function( elem, match, i, array ) {
- var name = match[1],
- filter = Expr.filters[ name ];
-
- if ( filter ) {
- return filter( elem, i, match, array );
- } else if ( name === "contains" ) {
- return (elem.textContent || elem.innerText || getText([ elem ]) || "").indexOf(match[3]) >= 0;
+ pseudos: {
+ "not": markFunction(function( selector ) {
+ // Trim the selector passed to compile
+ // to avoid treating leading and trailing
+ // spaces as combinators
+ var input = [],
+ results = [],
+ matcher = compile( selector.replace( rtrim, "$1" ) );
- } else if ( name === "not" ) {
- var not = match[3];
+ return matcher[ expando ] ?
+ markFunction(function( seed, matches, context, xml ) {
+ var elem,
+ unmatched = matcher( seed, null, xml, [] ),
+ i = seed.length;
- for ( var j = 0, l = not.length; j < l; j++ ) {
- if ( not[j] === elem ) {
- return false;
+ // Match elements unmatched by `matcher`
+ while ( i-- ) {
+ if ( (elem = unmatched[i]) ) {
+ seed[i] = !(matches[i] = elem);
+ }
}
- }
+ }) :
+ function( elem, context, xml ) {
+ input[0] = elem;
+ matcher( input, null, xml, results );
+ return !results.pop();
+ };
+ }),
- return true;
+ "has": markFunction(function( selector ) {
+ return function( elem ) {
+ return Sizzle( selector, elem ).length > 0;
+ };
+ }),
- } else {
- Sizzle.error( name );
- }
+ "contains": markFunction(function( text ) {
+ return function( elem ) {
+ return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
+ };
+ }),
+
+ "enabled": function( elem ) {
+ return elem.disabled === false;
},
- CHILD: function( elem, match ) {
- var first, last,
- doneName, parent, cache,
- count, diff,
- type = match[1],
- node = elem;
-
- switch ( type ) {
- case "only":
- case "first":
- while ( (node = node.previousSibling) ) {
- if ( node.nodeType === 1 ) {
- return false;
- }
- }
+ "disabled": function( elem ) {
+ return elem.disabled === true;
+ },
- if ( type === "first" ) {
- return true;
- }
+ "checked": function( elem ) {
+ // In CSS3, :checked should return both checked and selected elements
+ // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
+ var nodeName = elem.nodeName.toLowerCase();
+ return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
+ },
+
+ "selected": function( elem ) {
+ // Accessing this property makes selected-by-default
+ // options in Safari work properly
+ if ( elem.parentNode ) {
+ elem.parentNode.selectedIndex;
+ }
- node = elem;
+ return elem.selected === true;
+ },
- case "last":
- while ( (node = node.nextSibling) ) {
- if ( node.nodeType === 1 ) {
- return false;
- }
- }
+ "parent": function( elem ) {
+ return !Expr.pseudos["empty"]( elem );
+ },
- return true;
+ "empty": function( elem ) {
+ // http://www.w3.org/TR/selectors/#empty-pseudo
+ // :empty is only affected by element nodes and content nodes(including text(3), cdata(4)),
+ // not comment, processing instructions, or others
+ // Thanks to Diego Perini for the nodeName shortcut
+ // Greater than "@" means alpha characters (specifically not starting with "#" or "?")
+ var nodeType;
+ elem = elem.firstChild;
+ while ( elem ) {
+ if ( elem.nodeName > "@" || (nodeType = elem.nodeType) === 3 || nodeType === 4 ) {
+ return false;
+ }
+ elem = elem.nextSibling;
+ }
+ return true;
+ },
- case "nth":
- first = match[2];
- last = match[3];
+ "header": function( elem ) {
+ return rheader.test( elem.nodeName );
+ },
- if ( first === 1 && last === 0 ) {
- return true;
- }
-
- doneName = match[0];
- parent = elem.parentNode;
-
- if ( parent && (parent[ expando ] !== doneName || !elem.nodeIndex) ) {
- count = 0;
-
- for ( node = parent.firstChild; node; node = node.nextSibling ) {
- if ( node.nodeType === 1 ) {
- node.nodeIndex = ++count;
- }
- }
+ "text": function( elem ) {
+ var type, attr;
+ // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc)
+ // use getAttribute instead to test this case
+ return elem.nodeName.toLowerCase() === "input" &&
+ (type = elem.type) === "text" &&
+ ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === type );
+ },
- parent[ expando ] = doneName;
- }
-
- diff = elem.nodeIndex - last;
+ // Input types
+ "radio": createInputPseudo("radio"),
+ "checkbox": createInputPseudo("checkbox"),
+ "file": createInputPseudo("file"),
+ "password": createInputPseudo("password"),
+ "image": createInputPseudo("image"),
- if ( first === 0 ) {
- return diff === 0;
+ "submit": createButtonPseudo("submit"),
+ "reset": createButtonPseudo("reset"),
- } else {
- return ( diff % first === 0 && diff / first >= 0 );
- }
- }
+ "button": function( elem ) {
+ var name = elem.nodeName.toLowerCase();
+ return name === "input" && elem.type === "button" || name === "button";
},
- ID: function( elem, match ) {
- return elem.nodeType === 1 && elem.getAttribute("id") === match;
+ "input": function( elem ) {
+ return rinputs.test( elem.nodeName );
},
- TAG: function( elem, match ) {
- return (match === "*" && elem.nodeType === 1) || !!elem.nodeName && elem.nodeName.toLowerCase() === match;
- },
-
- CLASS: function( elem, match ) {
- return (" " + (elem.className || elem.getAttribute("class")) + " ")
- .indexOf( match ) > -1;
+ "focus": function( elem ) {
+ var doc = elem.ownerDocument;
+ return elem === doc.activeElement && (!doc.hasFocus || doc.hasFocus()) && !!(elem.type || elem.href);
},
- ATTR: function( elem, match ) {
- var name = match[1],
- result = Sizzle.attr ?
- Sizzle.attr( elem, name ) :
- Expr.attrHandle[ name ] ?
- Expr.attrHandle[ name ]( elem ) :
- elem[ name ] != null ?
- elem[ name ] :
- elem.getAttribute( name ),
- value = result + "",
- type = match[2],
- check = match[4];
-
- return result == null ?
- type === "!=" :
- !type && Sizzle.attr ?
- result != null :
- type === "=" ?
- value === check :
- type === "*=" ?
- value.indexOf(check) >= 0 :
- type === "~=" ?
- (" " + value + " ").indexOf(check) >= 0 :
- !check ?
- value && result !== false :
- type === "!=" ?
- value !== check :
- type === "^=" ?
- value.indexOf(check) === 0 :
- type === "$=" ?
- value.substr(value.length - check.length) === check :
- type === "|=" ?
- value === check || value.substr(0, check.length + 1) === check + "-" :
- false;
+ "active": function( elem ) {
+ return elem === elem.ownerDocument.activeElement;
},
- POS: function( elem, match, i, array ) {
- var name = match[2],
- filter = Expr.setFilters[ name ];
+ // Positional types
+ "first": createPositionalPseudo(function( matchIndexes, length, argument ) {
+ return [ 0 ];
+ }),
- if ( filter ) {
- return filter( elem, i, match, array );
- }
- }
- }
-};
+ "last": createPositionalPseudo(function( matchIndexes, length, argument ) {
+ return [ length - 1 ];
+ }),
-var origPOS = Expr.match.POS,
- fescape = function(all, num){
- return "\\" + (num - 0 + 1);
- };
+ "eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
+ return [ argument < 0 ? argument + length : argument ];
+ }),
-for ( var type in Expr.match ) {
- Expr.match[ type ] = new RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) );
- Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape) );
-}
+ "even": createPositionalPseudo(function( matchIndexes, length, argument ) {
+ for ( var i = 0; i < length; i += 2 ) {
+ matchIndexes.push( i );
+ }
+ return matchIndexes;
+ }),
-var makeArray = function( array, results ) {
- array = Array.prototype.slice.call( array, 0 );
+ "odd": createPositionalPseudo(function( matchIndexes, length, argument ) {
+ for ( var i = 1; i < length; i += 2 ) {
+ matchIndexes.push( i );
+ }
+ return matchIndexes;
+ }),
- if ( results ) {
- results.push.apply( results, array );
- return results;
+ "lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
+ for ( var i = argument < 0 ? argument + length : argument; --i >= 0; ) {
+ matchIndexes.push( i );
+ }
+ return matchIndexes;
+ }),
+
+ "gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
+ for ( var i = argument < 0 ? argument + length : argument; ++i < length; ) {
+ matchIndexes.push( i );
+ }
+ return matchIndexes;
+ })
}
-
- return array;
};
-// Perform a simple check to determine if the browser is capable of
-// converting a NodeList to an array using builtin methods.
-// Also verifies that the returned array holds DOM nodes
-// (which is not the case in the Blackberry browser)
-try {
- Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType;
-
-// Provide a fallback method if it does not work
-} catch( e ) {
- makeArray = function( array, results ) {
- var i = 0,
- ret = results || [];
-
- if ( toString.call(array) === "[object Array]" ) {
- Array.prototype.push.apply( ret, array );
+function siblingCheck( a, b, ret ) {
+ if ( a === b ) {
+ return ret;
+ }
- } else {
- if ( typeof array.length === "number" ) {
- for ( var l = array.length; i < l; i++ ) {
- ret.push( array[i] );
- }
+ var cur = a.nextSibling;
- } else {
- for ( ; array[i]; i++ ) {
- ret.push( array[i] );
- }
- }
+ while ( cur ) {
+ if ( cur === b ) {
+ return -1;
}
- return ret;
- };
-}
+ cur = cur.nextSibling;
+ }
-var sortOrder, siblingCheck;
+ return 1;
+}
-if ( document.documentElement.compareDocumentPosition ) {
- sortOrder = function( a, b ) {
+sortOrder = docElem.compareDocumentPosition ?
+ function( a, b ) {
if ( a === b ) {
hasDuplicate = true;
return 0;
}
- if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) {
- return a.compareDocumentPosition ? -1 : 1;
- }
-
- return a.compareDocumentPosition(b) & 4 ? -1 : 1;
- };
-
-} else {
- sortOrder = function( a, b ) {
+ return ( !a.compareDocumentPosition || !b.compareDocumentPosition ?
+ a.compareDocumentPosition :
+ a.compareDocumentPosition(b) & 4
+ ) ? -1 : 1;
+ } :
+ function( a, b ) {
// The nodes are identical, we can exit early
if ( a === b ) {
hasDuplicate = true;
siblingCheck( ap[i], b, 1 );
};
- siblingCheck = function( a, b, ret ) {
- if ( a === b ) {
- return ret;
+// Always assume the presence of duplicates if sort doesn't
+// pass them to our comparison function (as in Google Chrome).
+[0, 0].sort( sortOrder );
+baseHasDuplicate = !hasDuplicate;
+
+// Document sorting and removing duplicates
+Sizzle.uniqueSort = function( results ) {
+ var elem,
+ i = 1;
+
+ hasDuplicate = baseHasDuplicate;
+ results.sort( sortOrder );
+
+ if ( hasDuplicate ) {
+ for ( ; (elem = results[i]); i++ ) {
+ if ( elem === results[ i - 1 ] ) {
+ results.splice( i--, 1 );
+ }
}
+ }
+
+ return results;
+};
- var cur = a.nextSibling;
+Sizzle.error = function( msg ) {
+ throw new Error( "Syntax error, unrecognized expression: " + msg );
+};
+
+function tokenize( selector, parseOnly ) {
+ var matched, match, tokens, type, soFar, groups, preFilters,
+ cached = tokenCache[ expando ][ selector ];
+
+ if ( cached ) {
+ return parseOnly ? 0 : cached.slice( 0 );
+ }
+
+ soFar = selector;
+ groups = [];
+ preFilters = Expr.preFilter;
+
+ while ( soFar ) {
+
+ // Comma and first run
+ if ( !matched || (match = rcomma.exec( soFar )) ) {
+ if ( match ) {
+ soFar = soFar.slice( match[0].length );
+ }
+ groups.push( tokens = [] );
+ }
+
+ matched = false;
+
+ // Combinators
+ if ( (match = rcombinators.exec( soFar )) ) {
+ tokens.push( matched = new Token( match.shift() ) );
+ soFar = soFar.slice( matched.length );
+
+ // Cast descendant combinators to space
+ matched.type = match[0].replace( rtrim, " " );
+ }
+
+ // Filters
+ for ( type in Expr.filter ) {
+ if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
+ // The last two arguments here are (context, xml) for backCompat
+ (match = preFilters[ type ]( match, document, true ))) ) {
+
+ tokens.push( matched = new Token( match.shift() ) );
+ soFar = soFar.slice( matched.length );
+ matched.type = type;
+ matched.matches = match;
+ }
+ }
+
+ if ( !matched ) {
+ break;
+ }
+ }
+
+ // Return the length of the invalid excess
+ // if we're just parsing
+ // Otherwise, throw an error or return tokens
+ return parseOnly ?
+ soFar.length :
+ soFar ?
+ Sizzle.error( selector ) :
+ // Cache the tokens
+ tokenCache( selector, groups ).slice( 0 );
+}
+
+function addCombinator( matcher, combinator, base ) {
+ var dir = combinator.dir,
+ checkNonElements = base && combinator.dir === "parentNode",
+ doneName = done++;
+
+ return combinator.first ?
+ // Check against closest ancestor/preceding element
+ function( elem, context, xml ) {
+ while ( (elem = elem[ dir ]) ) {
+ if ( checkNonElements || elem.nodeType === 1 ) {
+ return matcher( elem, context, xml );
+ }
+ }
+ } :
+
+ // Check against all ancestor/preceding elements
+ function( elem, context, xml ) {
+ // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching
+ if ( !xml ) {
+ var cache,
+ dirkey = dirruns + " " + doneName + " ",
+ cachedkey = dirkey + cachedruns;
+ while ( (elem = elem[ dir ]) ) {
+ if ( checkNonElements || elem.nodeType === 1 ) {
+ if ( (cache = elem[ expando ]) === cachedkey ) {
+ return elem.sizset;
+ } else if ( typeof cache === "string" && cache.indexOf(dirkey) === 0 ) {
+ if ( elem.sizset ) {
+ return elem;
+ }
+ } else {
+ elem[ expando ] = cachedkey;
+ if ( matcher( elem, context, xml ) ) {
+ elem.sizset = true;
+ return elem;
+ }
+ elem.sizset = false;
+ }
+ }
+ }
+ } else {
+ while ( (elem = elem[ dir ]) ) {
+ if ( checkNonElements || elem.nodeType === 1 ) {
+ if ( matcher( elem, context, xml ) ) {
+ return elem;
+ }
+ }
+ }
+ }
+ };
+}
+
+function elementMatcher( matchers ) {
+ return matchers.length > 1 ?
+ function( elem, context, xml ) {
+ var i = matchers.length;
+ while ( i-- ) {
+ if ( !matchers[i]( elem, context, xml ) ) {
+ return false;
+ }
+ }
+ return true;
+ } :
+ matchers[0];
+}
+
+function condense( unmatched, map, filter, context, xml ) {
+ var elem,
+ newUnmatched = [],
+ i = 0,
+ len = unmatched.length,
+ mapped = map != null;
- while ( cur ) {
- if ( cur === b ) {
- return -1;
+ for ( ; i < len; i++ ) {
+ if ( (elem = unmatched[i]) ) {
+ if ( !filter || filter( elem, context, xml ) ) {
+ newUnmatched.push( elem );
+ if ( mapped ) {
+ map.push( i );
+ }
}
-
- cur = cur.nextSibling;
}
+ }
- return 1;
- };
+ return newUnmatched;
}
-// Check to see if the browser returns elements by name when
-// querying by getElementById (and provide a workaround)
-(function(){
- // We're going to inject a fake input element with a specified name
- var form = document.createElement("div"),
- id = "script" + (new Date()).getTime(),
- root = document.documentElement;
-
- form.innerHTML = "<a name='" + id + "'/>";
-
- // Inject it into the root element, check its status, and remove it quickly
- root.insertBefore( form, root.firstChild );
+function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
+ if ( postFilter && !postFilter[ expando ] ) {
+ postFilter = setMatcher( postFilter );
+ }
+ if ( postFinder && !postFinder[ expando ] ) {
+ postFinder = setMatcher( postFinder, postSelector );
+ }
+ return markFunction(function( seed, results, context, xml ) {
+ // Positional selectors apply to seed elements, so it is invalid to follow them with relative ones
+ if ( seed && postFinder ) {
+ return;
+ }
- // The workaround has to do additional checks after a getElementById
- // Which slows things down for other browsers (hence the branching)
- if ( document.getElementById( id ) ) {
- Expr.find.ID = function( match, context, isXML ) {
- if ( typeof context.getElementById !== "undefined" && !isXML ) {
- var m = context.getElementById(match[1]);
+ var i, elem, postFilterIn,
+ preMap = [],
+ postMap = [],
+ preexisting = results.length,
- return m ?
- m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ?
- [m] :
- undefined :
- [];
- }
- };
+ // Get initial elements from seed or context
+ elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [], seed ),
- Expr.filter.ID = function( elem, match ) {
- var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
+ // Prefilter to get matcher input, preserving a map for seed-results synchronization
+ matcherIn = preFilter && ( seed || !selector ) ?
+ condense( elems, preMap, preFilter, context, xml ) :
+ elems,
- return elem.nodeType === 1 && node && node.nodeValue === match;
- };
- }
+ matcherOut = matcher ?
+ // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
+ postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
- root.removeChild( form );
+ // ...intermediate processing is necessary
+ [] :
- // release memory in IE
- root = form = null;
-})();
+ // ...otherwise use results directly
+ results :
+ matcherIn;
-(function(){
- // Check to see if the browser returns only elements
- // when doing getElementsByTagName("*")
+ // Find primary matches
+ if ( matcher ) {
+ matcher( matcherIn, matcherOut, context, xml );
+ }
- // Create a fake element
- var div = document.createElement("div");
- div.appendChild( document.createComment("") );
+ // Apply postFilter
+ if ( postFilter ) {
+ postFilterIn = condense( matcherOut, postMap );
+ postFilter( postFilterIn, [], context, xml );
- // Make sure no comments are found
- if ( div.getElementsByTagName("*").length > 0 ) {
- Expr.find.TAG = function( match, context ) {
- var results = context.getElementsByTagName( match[1] );
+ // Un-match failing elements by moving them back to matcherIn
+ i = postFilterIn.length;
+ while ( i-- ) {
+ if ( (elem = postFilterIn[i]) ) {
+ matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
+ }
+ }
+ }
- // Filter out possible comments
- if ( match[1] === "*" ) {
- var tmp = [];
+ // Keep seed and results synchronized
+ if ( seed ) {
+ // Ignore postFinder because it can't coexist with seed
+ i = preFilter && matcherOut.length;
+ while ( i-- ) {
+ if ( (elem = matcherOut[i]) ) {
+ seed[ preMap[i] ] = !(results[ preMap[i] ] = elem);
+ }
+ }
+ } else {
+ matcherOut = condense(
+ matcherOut === results ?
+ matcherOut.splice( preexisting, matcherOut.length ) :
+ matcherOut
+ );
+ if ( postFinder ) {
+ postFinder( null, results, matcherOut, xml );
+ } else {
+ push.apply( results, matcherOut );
+ }
+ }
+ });
+}
- for ( var i = 0; results[i]; i++ ) {
- if ( results[i].nodeType === 1 ) {
- tmp.push( results[i] );
+function matcherFromTokens( tokens ) {
+ var checkContext, matcher, j,
+ len = tokens.length,
+ leadingRelative = Expr.relative[ tokens[0].type ],
+ implicitRelative = leadingRelative || Expr.relative[" "],
+ i = leadingRelative ? 1 : 0,
+
+ // The foundational matcher ensures that elements are reachable from top-level context(s)
+ matchContext = addCombinator( function( elem ) {
+ return elem === checkContext;
+ }, implicitRelative, true ),
+ matchAnyContext = addCombinator( function( elem ) {
+ return indexOf.call( checkContext, elem ) > -1;
+ }, implicitRelative, true ),
+ matchers = [ function( elem, context, xml ) {
+ return ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
+ (checkContext = context).nodeType ?
+ matchContext( elem, context, xml ) :
+ matchAnyContext( elem, context, xml ) );
+ } ];
+
+ for ( ; i < len; i++ ) {
+ if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
+ matchers = [ addCombinator( elementMatcher( matchers ), matcher ) ];
+ } else {
+ // The concatenated values are (context, xml) for backCompat
+ matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
+
+ // Return special upon seeing a positional matcher
+ if ( matcher[ expando ] ) {
+ // Find the next relative operator (if any) for proper handling
+ j = ++i;
+ for ( ; j < len; j++ ) {
+ if ( Expr.relative[ tokens[j].type ] ) {
+ break;
}
}
-
- results = tmp;
+ return setMatcher(
+ i > 1 && elementMatcher( matchers ),
+ i > 1 && tokens.slice( 0, i - 1 ).join("").replace( rtrim, "$1" ),
+ matcher,
+ i < j && matcherFromTokens( tokens.slice( i, j ) ),
+ j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
+ j < len && tokens.join("")
+ );
}
-
- return results;
- };
- }
-
- // Check to see if an attribute returns normalized href attributes
- div.innerHTML = "<a href='#'></a>";
-
- if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" &&
- div.firstChild.getAttribute("href") !== "#" ) {
-
- Expr.attrHandle.href = function( elem ) {
- return elem.getAttribute( "href", 2 );
- };
+ matchers.push( matcher );
+ }
}
- // release memory in IE
- div = null;
-})();
-
-if ( document.querySelectorAll ) {
- (function(){
- var oldSizzle = Sizzle,
- div = document.createElement("div"),
- id = "__sizzle__";
-
- div.innerHTML = "<p class='TEST'></p>";
+ return elementMatcher( matchers );
+}
- // Safari can't handle uppercase or unicode characters when
- // in quirks mode.
- if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) {
- return;
- }
-
- Sizzle = function( query, context, extra, seed ) {
- context = context || document;
-
- // Only use querySelectorAll on non-XML documents
- // (ID selectors don't work in non-HTML documents)
- if ( !seed && !Sizzle.isXML(context) ) {
- // See if we find a selector to speed up
- var match = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec( query );
-
- if ( match && (context.nodeType === 1 || context.nodeType === 9) ) {
- // Speed-up: Sizzle("TAG")
- if ( match[1] ) {
- return makeArray( context.getElementsByTagName( query ), extra );
-
- // Speed-up: Sizzle(".CLASS")
- } else if ( match[2] && Expr.find.CLASS && context.getElementsByClassName ) {
- return makeArray( context.getElementsByClassName( match[2] ), extra );
- }
- }
-
- if ( context.nodeType === 9 ) {
- // Speed-up: Sizzle("body")
- // The body element only exists once, optimize finding it
- if ( query === "body" && context.body ) {
- return makeArray( [ context.body ], extra );
-
- // Speed-up: Sizzle("#ID")
- } else if ( match && match[3] ) {
- var elem = context.getElementById( match[3] );
-
- // Check parentNode to catch when Blackberry 4.6 returns
- // nodes that are no longer in the document #6963
- if ( elem && elem.parentNode ) {
- // Handle the case where IE and Opera return items
- // by name instead of ID
- if ( elem.id === match[3] ) {
- return makeArray( [ elem ], extra );
- }
-
- } else {
- return makeArray( [], extra );
+function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
+ var bySet = setMatchers.length > 0,
+ byElement = elementMatchers.length > 0,
+ superMatcher = function( seed, context, xml, results, expandContext ) {
+ var elem, j, matcher,
+ setMatched = [],
+ matchedCount = 0,
+ i = "0",
+ unmatched = seed && [],
+ outermost = expandContext != null,
+ contextBackup = outermostContext,
+ // We must always have either seed elements or context
+ elems = seed || byElement && Expr.find["TAG"]( "*", expandContext && context.parentNode || context ),
+ // Nested matchers should use non-integer dirruns
+ dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.E);
+
+ if ( outermost ) {
+ outermostContext = context !== document && context;
+ cachedruns = superMatcher.el;
+ }
+
+ // Add elements passing elementMatchers directly to results
+ for ( ; (elem = elems[i]) != null; i++ ) {
+ if ( byElement && elem ) {
+ for ( j = 0; (matcher = elementMatchers[j]); j++ ) {
+ if ( matcher( elem, context, xml ) ) {
+ results.push( elem );
+ break;
}
}
-
- try {
- return makeArray( context.querySelectorAll(query), extra );
- } catch(qsaError) {}
-
- // qSA works strangely on Element-rooted queries
- // We can work around this by specifying an extra ID on the root
- // and working up from there (Thanks to Andrew Dupont for the technique)
- // IE 8 doesn't work on object elements
- } else if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
- var oldContext = context,
- old = context.getAttribute( "id" ),
- nid = old || id,
- hasParent = context.parentNode,
- relativeHierarchySelector = /^\s*[+~]/.test( query );
-
- if ( !old ) {
- context.setAttribute( "id", nid );
- } else {
- nid = nid.replace( /'/g, "\\$&" );
- }
- if ( relativeHierarchySelector && hasParent ) {
- context = context.parentNode;
+ if ( outermost ) {
+ dirruns = dirrunsUnique;
+ cachedruns = ++superMatcher.el;
}
+ }
- try {
- if ( !relativeHierarchySelector || hasParent ) {
- return makeArray( context.querySelectorAll( "[id='" + nid + "'] " + query ), extra );
- }
+ // Track unmatched elements for set filters
+ if ( bySet ) {
+ // They will have gone through all possible matchers
+ if ( (elem = !matcher && elem) ) {
+ matchedCount--;
+ }
- } catch(pseudoError) {
- } finally {
- if ( !old ) {
- oldContext.removeAttribute( "id" );
- }
+ // Lengthen the array for every element, matched or not
+ if ( seed ) {
+ unmatched.push( elem );
}
}
}
-
- return oldSizzle(query, context, extra, seed);
- };
-
- for ( var prop in oldSizzle ) {
- Sizzle[ prop ] = oldSizzle[ prop ];
- }
- // release memory in IE
- div = null;
- })();
-}
+ // Apply set filters to unmatched elements
+ matchedCount += i;
+ if ( bySet && i !== matchedCount ) {
+ for ( j = 0; (matcher = setMatchers[j]); j++ ) {
+ matcher( unmatched, setMatched, context, xml );
+ }
-(function(){
- var html = document.documentElement,
- matches = html.matchesSelector || html.mozMatchesSelector || html.webkitMatchesSelector || html.msMatchesSelector;
+ if ( seed ) {
+ // Reintegrate element matches to eliminate the need for sorting
+ if ( matchedCount > 0 ) {
+ while ( i-- ) {
+ if ( !(unmatched[i] || setMatched[i]) ) {
+ setMatched[i] = pop.call( results );
+ }
+ }
+ }
- if ( matches ) {
- // Check to see if it's possible to do matchesSelector
- // on a disconnected node (IE 9 fails this)
- var disconnectedMatch = !matches.call( document.createElement( "div" ), "div" ),
- pseudoWorks = false;
+ // Discard index placeholder values to get only actual matches
+ setMatched = condense( setMatched );
+ }
- try {
- // This should fail with an exception
- // Gecko does not error, returns false instead
- matches.call( document.documentElement, "[test!='']:sizzle" );
-
- } catch( pseudoError ) {
- pseudoWorks = true;
- }
+ // Add matches to results
+ push.apply( results, setMatched );
- Sizzle.matchesSelector = function( node, expr ) {
- // Make sure that attribute selectors are quoted
- expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']");
+ // Seedless set matches succeeding multiple successful matchers stipulate sorting
+ if ( outermost && !seed && setMatched.length > 0 &&
+ ( matchedCount + setMatchers.length ) > 1 ) {
- if ( !Sizzle.isXML( node ) ) {
- try {
- if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) {
- var ret = matches.call( node, expr );
+ Sizzle.uniqueSort( results );
+ }
+ }
- // IE 9's matchesSelector returns false on disconnected nodes
- if ( ret || !disconnectedMatch ||
- // As well, disconnected nodes are said to be in a document
- // fragment in IE 9, so check for that
- node.document && node.document.nodeType !== 11 ) {
- return ret;
- }
- }
- } catch(e) {}
+ // Override manipulation of globals by nested matchers
+ if ( outermost ) {
+ dirruns = dirrunsUnique;
+ outermostContext = contextBackup;
}
- return Sizzle(expr, null, null, [node]).length > 0;
+ return unmatched;
};
- }
-})();
-(function(){
- var div = document.createElement("div");
+ superMatcher.el = 0;
+ return bySet ?
+ markFunction( superMatcher ) :
+ superMatcher;
+}
- div.innerHTML = "<div class='test e'></div><div class='test'></div>";
+compile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) {
+ var i,
+ setMatchers = [],
+ elementMatchers = [],
+ cached = compilerCache[ expando ][ selector ];
+
+ if ( !cached ) {
+ // Generate a function of recursive functions that can be used to check each element
+ if ( !group ) {
+ group = tokenize( selector );
+ }
+ i = group.length;
+ while ( i-- ) {
+ cached = matcherFromTokens( group[i] );
+ if ( cached[ expando ] ) {
+ setMatchers.push( cached );
+ } else {
+ elementMatchers.push( cached );
+ }
+ }
- // Opera can't find a second classname (in 9.6)
- // Also, make sure that getElementsByClassName actually exists
- if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) {
- return;
+ // Cache the compiled function
+ cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
}
+ return cached;
+};
- // Safari caches class attributes, doesn't catch changes (in 3.2)
- div.lastChild.className = "e";
-
- if ( div.getElementsByClassName("e").length === 1 ) {
- return;
+function multipleContexts( selector, contexts, results, seed ) {
+ var i = 0,
+ len = contexts.length;
+ for ( ; i < len; i++ ) {
+ Sizzle( selector, contexts[i], results, seed );
}
-
- Expr.order.splice(1, 0, "CLASS");
- Expr.find.CLASS = function( match, context, isXML ) {
- if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) {
- return context.getElementsByClassName(match[1]);
- }
- };
-
- // release memory in IE
- div = null;
-})();
+ return results;
+}
-function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
- for ( var i = 0, l = checkSet.length; i < l; i++ ) {
- var elem = checkSet[i];
+function select( selector, context, results, seed, xml ) {
+ var i, tokens, token, type, find,
+ match = tokenize( selector ),
+ j = match.length;
- if ( elem ) {
- var match = false;
+ if ( !seed ) {
+ // Try to minimize operations if there is only one group
+ if ( match.length === 1 ) {
- elem = elem[dir];
+ // Take a shortcut and set the context if the root selector is an ID
+ tokens = match[0] = match[0].slice( 0 );
+ if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
+ context.nodeType === 9 && !xml &&
+ Expr.relative[ tokens[1].type ] ) {
- while ( elem ) {
- if ( elem[ expando ] === doneName ) {
- match = checkSet[elem.sizset];
- break;
+ context = Expr.find["ID"]( token.matches[0].replace( rbackslash, "" ), context, xml )[0];
+ if ( !context ) {
+ return results;
}
- if ( elem.nodeType === 1 && !isXML ){
- elem[ expando ] = doneName;
- elem.sizset = i;
- }
+ selector = selector.slice( tokens.shift().length );
+ }
- if ( elem.nodeName.toLowerCase() === cur ) {
- match = elem;
+ // Fetch a seed set for right-to-left matching
+ for ( i = matchExpr["POS"].test( selector ) ? -1 : tokens.length - 1; i >= 0; i-- ) {
+ token = tokens[i];
+
+ // Abort if we hit a combinator
+ if ( Expr.relative[ (type = token.type) ] ) {
break;
}
+ if ( (find = Expr.find[ type ]) ) {
+ // Search, expanding context for leading sibling combinators
+ if ( (seed = find(
+ token.matches[0].replace( rbackslash, "" ),
+ rsibling.test( tokens[0].type ) && context.parentNode || context,
+ xml
+ )) ) {
+
+ // If seed is empty or no tokens remain, we can return early
+ tokens.splice( i, 1 );
+ selector = seed.length && tokens.join("");
+ if ( !selector ) {
+ push.apply( results, slice.call( seed, 0 ) );
+ return results;
+ }
- elem = elem[dir];
+ break;
+ }
+ }
}
-
- checkSet[i] = match;
}
}
+
+ // Compile and execute a filtering function
+ // Provide `match` to avoid retokenization if we modified the selector above
+ compile( selector, match )(
+ seed,
+ context,
+ xml,
+ results,
+ rsibling.test( selector )
+ );
+ return results;
}
-function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
- for ( var i = 0, l = checkSet.length; i < l; i++ ) {
- var elem = checkSet[i];
+if ( document.querySelectorAll ) {
+ (function() {
+ var disconnectedMatch,
+ oldSelect = select,
+ rescape = /'|\\/g,
+ rattributeQuotes = /\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,
+
+ // qSa(:focus) reports false when true (Chrome 21),
+ // A support test would require too much code (would include document ready)
+ rbuggyQSA = [":focus"],
+
+ // matchesSelector(:focus) reports false when true (Chrome 21),
+ // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
+ // A support test would require too much code (would include document ready)
+ // just skip matchesSelector for :active
+ rbuggyMatches = [ ":active", ":focus" ],
+ matches = docElem.matchesSelector ||
+ docElem.mozMatchesSelector ||
+ docElem.webkitMatchesSelector ||
+ docElem.oMatchesSelector ||
+ docElem.msMatchesSelector;
+
+ // Build QSA regex
+ // Regex strategy adopted from Diego Perini
+ assert(function( div ) {
+ // Select is set to empty string on purpose
+ // This is to test IE's treatment of not explictly
+ // setting a boolean content attribute,
+ // since its presence should be enough
+ // http://bugs.jquery.com/ticket/12359
+ div.innerHTML = "<select><option selected=''></option></select>";
+
+ // IE8 - Some boolean attributes are not treated correctly
+ if ( !div.querySelectorAll("[selected]").length ) {
+ rbuggyQSA.push( "\\[" + whitespace + "*(?:checked|disabled|ismap|multiple|readonly|selected|value)" );
+ }
+
+ // Webkit/Opera - :checked should return selected option elements
+ // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
+ // IE8 throws error here (do not put tests after this one)
+ if ( !div.querySelectorAll(":checked").length ) {
+ rbuggyQSA.push(":checked");
+ }
+ });
- if ( elem ) {
- var match = false;
-
- elem = elem[dir];
+ assert(function( div ) {
- while ( elem ) {
- if ( elem[ expando ] === doneName ) {
- match = checkSet[elem.sizset];
- break;
- }
+ // Opera 10-12/IE9 - ^= $= *= and empty values
+ // Should not select anything
+ div.innerHTML = "<p test=''></p>";
+ if ( div.querySelectorAll("[test^='']").length ) {
+ rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:\"\"|'')" );
+ }
- if ( elem.nodeType === 1 ) {
- if ( !isXML ) {
- elem[ expando ] = doneName;
- elem.sizset = i;
- }
+ // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
+ // IE8 throws error here (do not put tests after this one)
+ div.innerHTML = "<input type='hidden'/>";
+ if ( !div.querySelectorAll(":enabled").length ) {
+ rbuggyQSA.push(":enabled", ":disabled");
+ }
+ });
- if ( typeof cur !== "string" ) {
- if ( elem === cur ) {
- match = true;
- break;
- }
+ // rbuggyQSA always contains :focus, so no need for a length check
+ rbuggyQSA = /* rbuggyQSA.length && */ new RegExp( rbuggyQSA.join("|") );
- } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) {
- match = elem;
- break;
+ select = function( selector, context, results, seed, xml ) {
+ // Only use querySelectorAll when not filtering,
+ // when this is not xml,
+ // and when no QSA bugs apply
+ if ( !seed && !xml && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {
+ var groups, i,
+ old = true,
+ nid = expando,
+ newContext = context,
+ newSelector = context.nodeType === 9 && selector;
+
+ // qSA works strangely on Element-rooted queries
+ // We can work around this by specifying an extra ID on the root
+ // and working up from there (Thanks to Andrew Dupont for the technique)
+ // IE 8 doesn't work on object elements
+ if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
+ groups = tokenize( selector );
+
+ if ( (old = context.getAttribute("id")) ) {
+ nid = old.replace( rescape, "\\$&" );
+ } else {
+ context.setAttribute( "id", nid );
+ }
+ nid = "[id='" + nid + "'] ";
+
+ i = groups.length;
+ while ( i-- ) {
+ groups[i] = nid + groups[i].join("");
}
+ newContext = rsibling.test( selector ) && context.parentNode || context;
+ newSelector = groups.join(",");
}
- elem = elem[dir];
+ if ( newSelector ) {
+ try {
+ push.apply( results, slice.call( newContext.querySelectorAll(
+ newSelector
+ ), 0 ) );
+ return results;
+ } catch(qsaError) {
+ } finally {
+ if ( !old ) {
+ context.removeAttribute("id");
+ }
+ }
+ }
}
- checkSet[i] = match;
- }
- }
-}
-
-if ( document.documentElement.contains ) {
- Sizzle.contains = function( a, b ) {
- return a !== b && (a.contains ? a.contains(b) : true);
- };
+ return oldSelect( selector, context, results, seed, xml );
+ };
-} else if ( document.documentElement.compareDocumentPosition ) {
- Sizzle.contains = function( a, b ) {
- return !!(a.compareDocumentPosition(b) & 16);
- };
+ if ( matches ) {
+ assert(function( div ) {
+ // Check to see if it's possible to do matchesSelector
+ // on a disconnected node (IE 9)
+ disconnectedMatch = matches.call( div, "div" );
-} else {
- Sizzle.contains = function() {
- return false;
- };
-}
+ // This should fail with an exception
+ // Gecko does not error, returns false instead
+ try {
+ matches.call( div, "[test!='']:sizzle" );
+ rbuggyMatches.push( "!=", pseudos );
+ } catch ( e ) {}
+ });
-Sizzle.isXML = function( elem ) {
- // documentElement is verified for cases where it doesn't yet exist
- // (such as loading iframes in IE - #4833)
- var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement;
+ // rbuggyMatches always contains :active and :focus, so no need for a length check
+ rbuggyMatches = /* rbuggyMatches.length && */ new RegExp( rbuggyMatches.join("|") );
- return documentElement ? documentElement.nodeName !== "HTML" : false;
-};
+ Sizzle.matchesSelector = function( elem, expr ) {
+ // Make sure that attribute selectors are quoted
+ expr = expr.replace( rattributeQuotes, "='$1']" );
-var posProcess = function( selector, context, seed ) {
- var match,
- tmpSet = [],
- later = "",
- root = context.nodeType ? [context] : context;
+ // rbuggyMatches always contains :active, so no need for an existence check
+ if ( !isXML( elem ) && !rbuggyMatches.test( expr ) && (!rbuggyQSA || !rbuggyQSA.test( expr )) ) {
+ try {
+ var ret = matches.call( elem, expr );
- // Position selectors must be done after the filter
- // And so must :not(positional) so we move all PSEUDOs to the end
- while ( (match = Expr.match.PSEUDO.exec( selector )) ) {
- later += match[0];
- selector = selector.replace( Expr.match.PSEUDO, "" );
- }
+ // IE 9's matchesSelector returns false on disconnected nodes
+ if ( ret || disconnectedMatch ||
+ // As well, disconnected nodes are said to be in a document
+ // fragment in IE 9
+ elem.document && elem.document.nodeType !== 11 ) {
+ return ret;
+ }
+ } catch(e) {}
+ }
- selector = Expr.relative[selector] ? selector + "*" : selector;
+ return Sizzle( expr, null, null, [ elem ] ).length > 0;
+ };
+ }
+ })();
+}
- for ( var i = 0, l = root.length; i < l; i++ ) {
- Sizzle( selector, root[i], tmpSet, seed );
- }
+// Deprecated
+Expr.pseudos["nth"] = Expr.pseudos["eq"];
- return Sizzle.filter( later, tmpSet );
-};
+// Back-compat
+function setFilters() {}
+Expr.filters = setFilters.prototype = Expr.pseudos;
+Expr.setFilters = new setFilters();
-// EXPOSE
// Override sizzle attribute retrieval
Sizzle.attr = jQuery.attr;
-Sizzle.selectors.attrMap = {};
jQuery.find = Sizzle;
jQuery.expr = Sizzle.selectors;
-jQuery.expr[":"] = jQuery.expr.filters;
+jQuery.expr[":"] = jQuery.expr.pseudos;
jQuery.unique = Sizzle.uniqueSort;
jQuery.text = Sizzle.getText;
jQuery.isXMLDoc = Sizzle.isXML;
jQuery.contains = Sizzle.contains;
-})();
-
-
+})( window );
var runtil = /Until$/,
- rparentsprev = /^(?:parents|prevUntil|prevAll)/,
- // Note: This RegExp should be improved, or likely pulled from Sizzle
- rmultiselector = /,/,
+ rparentsprev = /^(?:parents|prev(?:Until|All))/,
isSimple = /^.[^:#\[\.,]*$/,
- slice = Array.prototype.slice,
- POS = jQuery.expr.match.POS,
+ rneedsContext = jQuery.expr.match.needsContext,
// methods guaranteed to produce a unique set when starting from a unique set
guaranteedUnique = {
children: true,
jQuery.fn.extend({
find: function( selector ) {
- var self = this,
- i, l;
+ var i, l, length, n, r, ret,
+ self = this;
if ( typeof selector !== "string" ) {
return jQuery( selector ).filter(function() {
});
}
- var ret = this.pushStack( "", "find", selector ),
- length, n, r;
+ ret = this.pushStack( "", "find", selector );
for ( i = 0, l = this.length; i < l; i++ ) {
length = ret.length;
},
has: function( target ) {
- var targets = jQuery( target );
+ var i,
+ targets = jQuery( target, this ),
+ len = targets.length;
+
return this.filter(function() {
- for ( var i = 0, l = targets.length; i < l; i++ ) {
+ for ( i = 0; i < len; i++ ) {
if ( jQuery.contains( this, targets[i] ) ) {
return true;
}
},
is: function( selector ) {
- return !!selector && (
+ return !!selector && (
typeof selector === "string" ?
- // If this is a positional selector, check membership in the returned set
+ // If this is a positional/relative selector, check membership in the returned set
// so $("p:first").is("p:last") won't return true for a doc with two "p".
- POS.test( selector ) ?
+ rneedsContext.test( selector ) ?
jQuery( selector, this.context ).index( this[0] ) >= 0 :
jQuery.filter( selector, this ).length > 0 :
this.filter( selector ).length > 0 );
},
closest: function( selectors, context ) {
- var ret = [], i, l, cur = this[0];
-
- // Array (deprecated as of jQuery 1.7)
- if ( jQuery.isArray( selectors ) ) {
- var level = 1;
-
- while ( cur && cur.ownerDocument && cur !== context ) {
- for ( i = 0; i < selectors.length; i++ ) {
-
- if ( jQuery( cur ).is( selectors[ i ] ) ) {
- ret.push({ selector: selectors[ i ], elem: cur, level: level });
- }
- }
-
- cur = cur.parentNode;
- level++;
- }
-
- return ret;
- }
-
- // String
- var pos = POS.test( selectors ) || typeof selectors !== "string" ?
+ var cur,
+ i = 0,
+ l = this.length,
+ ret = [],
+ pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ?
jQuery( selectors, context || this.context ) :
0;
- for ( i = 0, l = this.length; i < l; i++ ) {
+ for ( ; i < l; i++ ) {
cur = this[i];
- while ( cur ) {
+ while ( cur && cur.ownerDocument && cur !== context && cur.nodeType !== 11 ) {
if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) {
ret.push( cur );
break;
-
- } else {
- cur = cur.parentNode;
- if ( !cur || !cur.ownerDocument || cur === context || cur.nodeType === 11 ) {
- break;
- }
}
+ cur = cur.parentNode;
}
}
jQuery.unique( all ) );
},
- andSelf: function() {
- return this.add( this.prevObject );
+ addBack: function( selector ) {
+ return this.add( selector == null ?
+ this.prevObject : this.prevObject.filter(selector)
+ );
}
});
+jQuery.fn.andSelf = jQuery.fn.addBack;
+
// A painfully simple check to see if an element is disconnected
// from a document (should be improved, where feasible).
function isDisconnected( node ) {
return !node || !node.parentNode || node.parentNode.nodeType === 11;
}
+function sibling( cur, dir ) {
+ do {
+ cur = cur[ dir ];
+ } while ( cur && cur.nodeType !== 1 );
+
+ return cur;
+}
+
jQuery.each({
parent: function( elem ) {
var parent = elem.parentNode;
return jQuery.dir( elem, "parentNode", until );
},
next: function( elem ) {
- return jQuery.nth( elem, 2, "nextSibling" );
+ return sibling( elem, "nextSibling" );
},
prev: function( elem ) {
- return jQuery.nth( elem, 2, "previousSibling" );
+ return sibling( elem, "previousSibling" );
},
nextAll: function( elem ) {
return jQuery.dir( elem, "nextSibling" );
return jQuery.dir( elem, "previousSibling", until );
},
siblings: function( elem ) {
- return jQuery.sibling( elem.parentNode.firstChild, elem );
+ return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem );
},
children: function( elem ) {
return jQuery.sibling( elem.firstChild );
contents: function( elem ) {
return jQuery.nodeName( elem, "iframe" ) ?
elem.contentDocument || elem.contentWindow.document :
- jQuery.makeArray( elem.childNodes );
+ jQuery.merge( [], elem.childNodes );
}
}, function( name, fn ) {
jQuery.fn[ name ] = function( until, selector ) {
ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret;
- if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) {
+ if ( this.length > 1 && rparentsprev.test( name ) ) {
ret = ret.reverse();
}
- return this.pushStack( ret, name, slice.call( arguments ).join(",") );
+ return this.pushStack( ret, name, core_slice.call( arguments ).join(",") );
};
});
return matched;
},
- nth: function( cur, result, dir, elem ) {
- result = result || 1;
- var num = 0;
-
- for ( ; cur; cur = cur[dir] ) {
- if ( cur.nodeType === 1 && ++num === result ) {
- break;
- }
- }
-
- return cur;
- },
-
sibling: function( n, elem ) {
var r = [];
return ( jQuery.inArray( elem, qualifier ) >= 0 ) === keep;
});
}
-
-
-
-
function createSafeFragment( document ) {
var list = nodeNames.split( "|" ),
safeFrag = document.createDocumentFragment();
return safeFrag;
}
-var nodeNames = "abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|" +
+var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" +
"header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",
- rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g,
+ rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g,
rleadingWhitespace = /^\s+/,
- rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,
+ rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
rtagName = /<([\w:]+)/,
rtbody = /<tbody/i,
rhtml = /<|&#?\w+;/,
- rnoInnerhtml = /<(?:script|style)/i,
+ rnoInnerhtml = /<(?:script|style|link)/i,
rnocache = /<(?:script|object|embed|option|style)/i,
- rnoshimcache = new RegExp("<(?:" + nodeNames + ")", "i"),
+ rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"),
+ rcheckableType = /^(?:checkbox|radio)$/,
// checked="checked" or checked
rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
rscriptType = /\/(java|ecma)script/i,
- rcleanScript = /^\s*<!(?:\[CDATA\[|\-\-)/,
+ rcleanScript = /^\s*<!(?:\[CDATA\[|\-\-)|[\]\-]{2}>\s*$/g,
wrapMap = {
option: [ 1, "<select multiple='multiple'>", "</select>" ],
legend: [ 1, "<fieldset>", "</fieldset>" ],
area: [ 1, "<map>", "</map>" ],
_default: [ 0, "", "" ]
},
- safeFragment = createSafeFragment( document );
+ safeFragment = createSafeFragment( document ),
+ fragmentDiv = safeFragment.appendChild( document.createElement("div") );
wrapMap.optgroup = wrapMap.option;
wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
wrapMap.th = wrapMap.td;
-// IE can't serialize <link> and <script> tags normally
+// IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags,
+// unless wrapped in a div with non-breaking characters in front of it.
if ( !jQuery.support.htmlSerialize ) {
- wrapMap._default = [ 1, "div<div>", "</div>" ];
+ wrapMap._default = [ 1, "X<div>", "</div>" ];
}
jQuery.fn.extend({
- text: function( text ) {
- if ( jQuery.isFunction(text) ) {
- return this.each(function(i) {
- var self = jQuery( this );
-
- self.text( text.call(this, i, self.text()) );
- });
- }
-
- if ( typeof text !== "object" && text !== undefined ) {
- return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) );
- }
-
- return jQuery.text( this );
+ text: function( value ) {
+ return jQuery.access( this, function( value ) {
+ return value === undefined ?
+ jQuery.text( this ) :
+ this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) );
+ }, null, value, arguments.length );
},
wrapAll: function( html ) {
append: function() {
return this.domManip(arguments, true, function( elem ) {
- if ( this.nodeType === 1 ) {
+ if ( this.nodeType === 1 || this.nodeType === 11 ) {
this.appendChild( elem );
}
});
prepend: function() {
return this.domManip(arguments, true, function( elem ) {
- if ( this.nodeType === 1 ) {
+ if ( this.nodeType === 1 || this.nodeType === 11 ) {
this.insertBefore( elem, this.firstChild );
}
});
},
before: function() {
- if ( this[0] && this[0].parentNode ) {
+ if ( !isDisconnected( this[0] ) ) {
return this.domManip(arguments, false, function( elem ) {
this.parentNode.insertBefore( elem, this );
});
- } else if ( arguments.length ) {
+ }
+
+ if ( arguments.length ) {
var set = jQuery.clean( arguments );
- set.push.apply( set, this.toArray() );
- return this.pushStack( set, "before", arguments );
+ return this.pushStack( jQuery.merge( set, this ), "before", this.selector );
}
},
after: function() {
- if ( this[0] && this[0].parentNode ) {
+ if ( !isDisconnected( this[0] ) ) {
return this.domManip(arguments, false, function( elem ) {
this.parentNode.insertBefore( elem, this.nextSibling );
});
- } else if ( arguments.length ) {
- var set = this.pushStack( this, "after", arguments );
- set.push.apply( set, jQuery.clean(arguments) );
- return set;
+ }
+
+ if ( arguments.length ) {
+ var set = jQuery.clean( arguments );
+ return this.pushStack( jQuery.merge( this, set ), "after", this.selector );
}
},
// keepData is for internal use only--do not document
remove: function( selector, keepData ) {
- for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
+ var elem,
+ i = 0;
+
+ for ( ; (elem = this[i]) != null; i++ ) {
if ( !selector || jQuery.filter( selector, [ elem ] ).length ) {
if ( !keepData && elem.nodeType === 1 ) {
jQuery.cleanData( elem.getElementsByTagName("*") );
},
empty: function() {
- for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
+ var elem,
+ i = 0;
+
+ for ( ; (elem = this[i]) != null; i++ ) {
// Remove element nodes and prevent memory leaks
if ( elem.nodeType === 1 ) {
jQuery.cleanData( elem.getElementsByTagName("*") );
},
html: function( value ) {
- if ( value === undefined ) {
- return this[0] && this[0].nodeType === 1 ?
- this[0].innerHTML.replace(rinlinejQuery, "") :
- null;
-
- // See if we can take a shortcut and just use innerHTML
- } else if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
- (jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value )) &&
- !wrapMap[ (rtagName.exec( value ) || ["", ""])[1].toLowerCase() ] ) {
+ return jQuery.access( this, function( value ) {
+ var elem = this[0] || {},
+ i = 0,
+ l = this.length;
- value = value.replace(rxhtmlTag, "<$1></$2>");
+ if ( value === undefined ) {
+ return elem.nodeType === 1 ?
+ elem.innerHTML.replace( rinlinejQuery, "" ) :
+ undefined;
+ }
- try {
- for ( var i = 0, l = this.length; i < l; i++ ) {
- // Remove element nodes and prevent memory leaks
- if ( this[i].nodeType === 1 ) {
- jQuery.cleanData( this[i].getElementsByTagName("*") );
- this[i].innerHTML = value;
- }
- }
+ // See if we can take a shortcut and just use innerHTML
+ if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
+ ( jQuery.support.htmlSerialize || !rnoshimcache.test( value ) ) &&
+ ( jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value ) ) &&
+ !wrapMap[ ( rtagName.exec( value ) || ["", ""] )[1].toLowerCase() ] ) {
- // If using innerHTML throws an exception, use the fallback method
- } catch(e) {
- this.empty().append( value );
- }
+ value = value.replace( rxhtmlTag, "<$1></$2>" );
- } else if ( jQuery.isFunction( value ) ) {
- this.each(function(i){
- var self = jQuery( this );
+ try {
+ for (; i < l; i++ ) {
+ // Remove element nodes and prevent memory leaks
+ elem = this[i] || {};
+ if ( elem.nodeType === 1 ) {
+ jQuery.cleanData( elem.getElementsByTagName( "*" ) );
+ elem.innerHTML = value;
+ }
+ }
- self.html( value.call(this, i, self.html()) );
- });
+ elem = 0;
- } else {
- this.empty().append( value );
- }
+ // If using innerHTML throws an exception, use the fallback method
+ } catch(e) {}
+ }
- return this;
+ if ( elem ) {
+ this.empty().append( value );
+ }
+ }, null, value, arguments.length );
},
replaceWith: function( value ) {
- if ( this[0] && this[0].parentNode ) {
+ if ( !isDisconnected( this[0] ) ) {
// Make sure that the elements are removed from the DOM before they are inserted
// this can help fix replacing a parent with child elements
if ( jQuery.isFunction( value ) ) {
jQuery(parent).append( value );
}
});
- } else {
- return this.length ?
- this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value ) :
- this;
}
+
+ return this.length ?
+ this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value ) :
+ this;
},
detach: function( selector ) {
},
domManip: function( args, table, callback ) {
- var results, first, fragment, parent,
+
+ // Flatten any nested arrays
+ args = [].concat.apply( [], args );
+
+ var results, first, fragment, iNoClone,
+ i = 0,
value = args[0],
- scripts = [];
+ scripts = [],
+ l = this.length;
// We can't cloneNode fragments that contain checked, in WebKit
- if ( !jQuery.support.checkClone && arguments.length === 3 && typeof value === "string" && rchecked.test( value ) ) {
+ if ( !jQuery.support.checkClone && l > 1 && typeof value === "string" && rchecked.test( value ) ) {
return this.each(function() {
- jQuery(this).domManip( args, table, callback, true );
+ jQuery(this).domManip( args, table, callback );
});
}
if ( jQuery.isFunction(value) ) {
return this.each(function(i) {
var self = jQuery(this);
- args[0] = value.call(this, i, table ? self.html() : undefined);
+ args[0] = value.call( this, i, table ? self.html() : undefined );
self.domManip( args, table, callback );
});
}
if ( this[0] ) {
- parent = value && value.parentNode;
-
- // If we're in a fragment, just use that instead of building a new one
- if ( jQuery.support.parentNode && parent && parent.nodeType === 11 && parent.childNodes.length === this.length ) {
- results = { fragment: parent };
-
- } else {
- results = jQuery.buildFragment( args, this, scripts );
- }
-
+ results = jQuery.buildFragment( args, this, scripts );
fragment = results.fragment;
+ first = fragment.firstChild;
if ( fragment.childNodes.length === 1 ) {
- first = fragment = fragment.firstChild;
- } else {
- first = fragment.firstChild;
+ fragment = first;
}
if ( first ) {
table = table && jQuery.nodeName( first, "tr" );
- for ( var i = 0, l = this.length, lastIndex = l - 1; i < l; i++ ) {
+ // Use the original fragment for the last item instead of the first because it can end up
+ // being emptied incorrectly in certain situations (#8070).
+ // Fragments from the fragment cache must always be cloned and never used in place.
+ for ( iNoClone = results.cacheable || l - 1; i < l; i++ ) {
callback.call(
- table ?
- root(this[i], first) :
+ table && jQuery.nodeName( this[i], "table" ) ?
+ findOrAppend( this[i], "tbody" ) :
this[i],
- // Make sure that we do not leak memory by inadvertently discarding
- // the original fragment (which might have attached data) instead of
- // using it; in addition, use the original fragment object for the last
- // item instead of first because it can end up being emptied incorrectly
- // in certain situations (Bug #8070).
- // Fragments from the fragment cache must always be cloned and never used
- // in place.
- results.cacheable || ( l > 1 && i < lastIndex ) ?
- jQuery.clone( fragment, true, true ) :
- fragment
+ i === iNoClone ?
+ fragment :
+ jQuery.clone( fragment, true, true )
);
}
}
+ // Fix #11809: Avoid leaking memory
+ fragment = first = null;
+
if ( scripts.length ) {
- jQuery.each( scripts, evalScript );
+ jQuery.each( scripts, function( i, elem ) {
+ if ( elem.src ) {
+ if ( jQuery.ajax ) {
+ jQuery.ajax({
+ url: elem.src,
+ type: "GET",
+ dataType: "script",
+ async: false,
+ global: false,
+ "throws": true
+ });
+ } else {
+ jQuery.error("no ajax");
+ }
+ } else {
+ jQuery.globalEval( ( elem.text || elem.textContent || elem.innerHTML || "" ).replace( rcleanScript, "" ) );
+ }
+
+ if ( elem.parentNode ) {
+ elem.parentNode.removeChild( elem );
+ }
+ });
}
}
}
});
-function root( elem, cur ) {
- return jQuery.nodeName(elem, "table") ?
- (elem.getElementsByTagName("tbody")[0] ||
- elem.appendChild(elem.ownerDocument.createElement("tbody"))) :
- elem;
+function findOrAppend( elem, tag ) {
+ return elem.getElementsByTagName( tag )[0] || elem.appendChild( elem.ownerDocument.createElement( tag ) );
}
function cloneCopyEvent( src, dest ) {
for ( type in events ) {
for ( i = 0, l = events[ type ].length; i < l; i++ ) {
- jQuery.event.add( dest, type + ( events[ type ][ i ].namespace ? "." : "" ) + events[ type ][ i ].namespace, events[ type ][ i ], events[ type ][ i ].data );
+ jQuery.event.add( dest, type, events[ type ][ i ] );
}
}
}
nodeName = dest.nodeName.toLowerCase();
- // IE6-8 fail to clone children inside object elements that use
- // the proprietary classid attribute value (rather than the type
- // attribute) to identify the type of content to display
if ( nodeName === "object" ) {
- dest.outerHTML = src.outerHTML;
+ // IE6-10 improperly clones children of object elements using classid.
+ // IE10 throws NoModificationAllowedError if parent is null, #12132.
+ if ( dest.parentNode ) {
+ dest.outerHTML = src.outerHTML;
+ }
+
+ // This path appears unavoidable for IE9. When cloning an object
+ // element in IE9, the outerHTML strategy above is not sufficient.
+ // If the src has innerHTML and the destination does not,
+ // copy the src.innerHTML into the dest.innerHTML. #10324
+ if ( jQuery.support.html5Clone && (src.innerHTML && !jQuery.trim(dest.innerHTML)) ) {
+ dest.innerHTML = src.innerHTML;
+ }
- } else if ( nodeName === "input" && (src.type === "checkbox" || src.type === "radio") ) {
+ } else if ( nodeName === "input" && rcheckableType.test( src.type ) ) {
// IE6-8 fails to persist the checked state of a cloned checkbox
// or radio button. Worse, IE6-7 fail to give the cloned element
// a checked appearance if the defaultChecked value isn't also set
- if ( src.checked ) {
- dest.defaultChecked = dest.checked = src.checked;
- }
+
+ dest.defaultChecked = dest.checked = src.checked;
// IE6-7 get confused and end up setting the value of a cloned
// checkbox/radio button to an empty string instead of "on"
// cloning other types of input fields
} else if ( nodeName === "input" || nodeName === "textarea" ) {
dest.defaultValue = src.defaultValue;
+
+ // IE blanks contents when cloning scripts
+ } else if ( nodeName === "script" && dest.text !== src.text ) {
+ dest.text = src.text;
}
// Event data gets referenced instead of copied if the expando
dest.removeAttribute( jQuery.expando );
}
-jQuery.buildFragment = function( args, nodes, scripts ) {
- var fragment, cacheable, cacheresults, doc,
- first = args[ 0 ];
+jQuery.buildFragment = function( args, context, scripts ) {
+ var fragment, cacheable, cachehit,
+ first = args[ 0 ];
- // nodes may contain either an explicit document object,
- // a jQuery collection or context object.
- // If nodes[0] contains a valid object to assign to doc
- if ( nodes && nodes[0] ) {
- doc = nodes[0].ownerDocument || nodes[0];
- }
-
- // Ensure that an attr object doesn't incorrectly stand in as a document object
- // Chrome and Firefox seem to allow this to occur and will throw exception
- // Fixes #8950
- if ( !doc.createDocumentFragment ) {
- doc = document;
- }
+ // Set context from what may come in as undefined or a jQuery collection or a node
+ // Updated to fix #12266 where accessing context[0] could throw an exception in IE9/10 &
+ // also doubles as fix for #8950 where plain objects caused createDocumentFragment exception
+ context = context || document;
+ context = !context.nodeType && context[0] || context;
+ context = context.ownerDocument || context;
// Only cache "small" (1/2 KB) HTML strings that are associated with the main document
// Cloning options loses the selected state, so don't cache them
// IE 6 doesn't like it when you put <object> or <embed> elements in a fragment
// Also, WebKit does not clone 'checked' attributes on cloneNode, so don't cache
// Lastly, IE6,7,8 will not correctly reuse cached fragments that were created from unknown elems #10501
- if ( args.length === 1 && typeof first === "string" && first.length < 512 && doc === document &&
+ if ( args.length === 1 && typeof first === "string" && first.length < 512 && context === document &&
first.charAt(0) === "<" && !rnocache.test( first ) &&
(jQuery.support.checkClone || !rchecked.test( first )) &&
(jQuery.support.html5Clone || !rnoshimcache.test( first )) ) {
+ // Mark cacheable and look for a hit
cacheable = true;
-
- cacheresults = jQuery.fragments[ first ];
- if ( cacheresults && cacheresults !== 1 ) {
- fragment = cacheresults;
- }
+ fragment = jQuery.fragments[ first ];
+ cachehit = fragment !== undefined;
}
if ( !fragment ) {
- fragment = doc.createDocumentFragment();
- jQuery.clean( args, doc, fragment, scripts );
- }
+ fragment = context.createDocumentFragment();
+ jQuery.clean( args, context, fragment, scripts );
- if ( cacheable ) {
- jQuery.fragments[ first ] = cacheresults ? fragment : 1;
+ // Update the cache, but only store false
+ // unless this is a second parsing of the same content
+ if ( cacheable ) {
+ jQuery.fragments[ first ] = cachehit && fragment;
+ }
}
return { fragment: fragment, cacheable: cacheable };
replaceAll: "replaceWith"
}, function( name, original ) {
jQuery.fn[ name ] = function( selector ) {
- var ret = [],
+ var elems,
+ i = 0,
+ ret = [],
insert = jQuery( selector ),
+ l = insert.length,
parent = this.length === 1 && this[0].parentNode;
- if ( parent && parent.nodeType === 11 && parent.childNodes.length === 1 && insert.length === 1 ) {
+ if ( (parent == null || parent && parent.nodeType === 11 && parent.childNodes.length === 1) && l === 1 ) {
insert[ original ]( this[0] );
return this;
-
} else {
- for ( var i = 0, l = insert.length; i < l; i++ ) {
- var elems = ( i > 0 ? this.clone(true) : this ).get();
+ for ( ; i < l; i++ ) {
+ elems = ( i > 0 ? this.clone(true) : this ).get();
jQuery( insert[i] )[ original ]( elems );
ret = ret.concat( elems );
}
// Used in clean, fixes the defaultChecked property
function fixDefaultChecked( elem ) {
- if ( elem.type === "checkbox" || elem.type === "radio" ) {
+ if ( rcheckableType.test( elem.type ) ) {
elem.defaultChecked = elem.checked;
}
}
-// Finds all inputs and passes them to fixDefaultChecked
-function findInputs( elem ) {
- var nodeName = ( elem.nodeName || "" ).toLowerCase();
- if ( nodeName === "input" ) {
- fixDefaultChecked( elem );
- // Skip scripts, get other children
- } else if ( nodeName !== "script" && typeof elem.getElementsByTagName !== "undefined" ) {
- jQuery.grep( elem.getElementsByTagName("input"), fixDefaultChecked );
- }
-}
-
-// Derived From: http://www.iecss.com/shimprove/javascript/shimprove.1-0-1.js
-function shimCloneNode( elem ) {
- var div = document.createElement( "div" );
- safeFragment.appendChild( div );
-
- div.innerHTML = elem.outerHTML;
- return div.firstChild;
-}
jQuery.extend({
clone: function( elem, dataAndEvents, deepDataAndEvents ) {
var srcElements,
destElements,
i,
- // IE<=8 does not properly clone detached, unknown element nodes
- clone = jQuery.support.html5Clone || !rnoshimcache.test( "<" + elem.nodeName ) ?
- elem.cloneNode( true ) :
- shimCloneNode( elem );
+ clone;
+
+ if ( jQuery.support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) {
+ clone = elem.cloneNode( true );
+
+ // IE<=8 does not properly clone detached, unknown element nodes
+ } else {
+ fragmentDiv.innerHTML = elem.outerHTML;
+ fragmentDiv.removeChild( clone = fragmentDiv.firstChild );
+ }
if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) &&
(elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) {
},
clean: function( elems, context, fragment, scripts ) {
- var checkScriptType;
+ var i, j, elem, tag, wrap, depth, div, hasBody, tbody, len, handleScript, jsTags,
+ safe = context === document && safeFragment,
+ ret = [];
- context = context || document;
-
- // !context.createElement fails in IE with an error but returns typeof 'object'
- if ( typeof context.createElement === "undefined" ) {
- context = context.ownerDocument || context[0] && context[0].ownerDocument || document;
+ // Ensure that context is a document
+ if ( !context || typeof context.createDocumentFragment === "undefined" ) {
+ context = document;
}
- var ret = [], j;
-
- for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
+ // Use the already-created safe fragment if context permits
+ for ( i = 0; (elem = elems[i]) != null; i++ ) {
if ( typeof elem === "number" ) {
elem += "";
}
if ( !rhtml.test( elem ) ) {
elem = context.createTextNode( elem );
} else {
+ // Ensure a safe container in which to render the html
+ safe = safe || createSafeFragment( context );
+ div = context.createElement("div");
+ safe.appendChild( div );
+
// Fix "XHTML"-style tags in all browsers
elem = elem.replace(rxhtmlTag, "<$1></$2>");
- // Trim whitespace, otherwise indexOf won't work as expected
- var tag = ( rtagName.exec( elem ) || ["", ""] )[1].toLowerCase(),
- wrap = wrapMap[ tag ] || wrapMap._default,
- depth = wrap[0],
- div = context.createElement("div");
-
- // Append wrapper element to unknown element safe doc fragment
- if ( context === document ) {
- // Use the fragment we've already created for this document
- safeFragment.appendChild( div );
- } else {
- // Use a fragment created with the owner document
- createSafeFragment( context ).appendChild( div );
- }
-
// Go to html and back, then peel off extra wrappers
+ tag = ( rtagName.exec( elem ) || ["", ""] )[1].toLowerCase();
+ wrap = wrapMap[ tag ] || wrapMap._default;
+ depth = wrap[0];
div.innerHTML = wrap[1] + elem + wrap[2];
// Move to the right depth
if ( !jQuery.support.tbody ) {
// String was a <table>, *may* have spurious <tbody>
- var hasBody = rtbody.test(elem),
+ hasBody = rtbody.test(elem);
tbody = tag === "table" && !hasBody ?
div.firstChild && div.firstChild.childNodes :
}
elem = div.childNodes;
- }
- }
- // Resets defaultChecked for any radios and checkboxes
- // about to be appended to the DOM in IE 6/7 (#8060)
- var len;
- if ( !jQuery.support.appendChecked ) {
- if ( elem[0] && typeof (len = elem.length) === "number" ) {
- for ( j = 0; j < len; j++ ) {
- findInputs( elem[j] );
- }
- } else {
- findInputs( elem );
+ // Take out of fragment container (we need a fresh div each time)
+ div.parentNode.removeChild( div );
}
}
if ( elem.nodeType ) {
ret.push( elem );
} else {
- ret = jQuery.merge( ret, elem );
+ jQuery.merge( ret, elem );
+ }
+ }
+
+ // Fix #11356: Clear elements from safeFragment
+ if ( div ) {
+ elem = div = safe = null;
+ }
+
+ // Reset defaultChecked for any radios and checkboxes
+ // about to be appended to the DOM in IE 6/7 (#8060)
+ if ( !jQuery.support.appendChecked ) {
+ for ( i = 0; (elem = ret[i]) != null; i++ ) {
+ if ( jQuery.nodeName( elem, "input" ) ) {
+ fixDefaultChecked( elem );
+ } else if ( typeof elem.getElementsByTagName !== "undefined" ) {
+ jQuery.grep( elem.getElementsByTagName("input"), fixDefaultChecked );
+ }
}
}
+ // Append elements to a provided document fragment
if ( fragment ) {
- checkScriptType = function( elem ) {
- return !elem.type || rscriptType.test( elem.type );
+ // Special handling of each script element
+ handleScript = function( elem ) {
+ // Check if we consider it executable
+ if ( !elem.type || rscriptType.test( elem.type ) ) {
+ // Detach the script and store it in the scripts array (if provided) or the fragment
+ // Return truthy to indicate that it has been handled
+ return scripts ?
+ scripts.push( elem.parentNode ? elem.parentNode.removeChild( elem ) : elem ) :
+ fragment.appendChild( elem );
+ }
};
- for ( i = 0; ret[i]; i++ ) {
- if ( scripts && jQuery.nodeName( ret[i], "script" ) && (!ret[i].type || ret[i].type.toLowerCase() === "text/javascript") ) {
- scripts.push( ret[i].parentNode ? ret[i].parentNode.removeChild( ret[i] ) : ret[i] );
- } else {
- if ( ret[i].nodeType === 1 ) {
- var jsTags = jQuery.grep( ret[i].getElementsByTagName( "script" ), checkScriptType );
+ for ( i = 0; (elem = ret[i]) != null; i++ ) {
+ // Check if we're done after handling an executable script
+ if ( !( jQuery.nodeName( elem, "script" ) && handleScript( elem ) ) ) {
+ // Append to fragment and handle embedded scripts
+ fragment.appendChild( elem );
+ if ( typeof elem.getElementsByTagName !== "undefined" ) {
+ // handleScript alters the DOM, so use jQuery.merge to ensure snapshot iteration
+ jsTags = jQuery.grep( jQuery.merge( [], elem.getElementsByTagName("script") ), handleScript );
+ // Splice the scripts into ret after their former ancestor and advance our index beyond them
ret.splice.apply( ret, [i + 1, 0].concat( jsTags ) );
+ i += jsTags.length;
}
- fragment.appendChild( ret[i] );
}
}
}
return ret;
},
- cleanData: function( elems ) {
- var data, id,
+ cleanData: function( elems, /* internal */ acceptData ) {
+ var data, id, elem, type,
+ i = 0,
+ internalKey = jQuery.expando,
cache = jQuery.cache,
- special = jQuery.event.special,
- deleteExpando = jQuery.support.deleteExpando;
+ deleteExpando = jQuery.support.deleteExpando,
+ special = jQuery.event.special;
- for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
- if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) {
- continue;
- }
+ for ( ; (elem = elems[i]) != null; i++ ) {
- id = elem[ jQuery.expando ];
+ if ( acceptData || jQuery.acceptData( elem ) ) {
- if ( id ) {
- data = cache[ id ];
+ id = elem[ internalKey ];
+ data = id && cache[ id ];
- if ( data && data.events ) {
- for ( var type in data.events ) {
- if ( special[ type ] ) {
- jQuery.event.remove( elem, type );
+ if ( data ) {
+ if ( data.events ) {
+ for ( type in data.events ) {
+ if ( special[ type ] ) {
+ jQuery.event.remove( elem, type );
- // This is a shortcut to avoid jQuery.event.remove's overhead
- } else {
- jQuery.removeEvent( elem, type, data.handle );
+ // This is a shortcut to avoid jQuery.event.remove's overhead
+ } else {
+ jQuery.removeEvent( elem, type, data.handle );
+ }
}
}
- // Null the DOM reference to avoid IE6/7/8 leak (#7054)
- if ( data.handle ) {
- data.handle.elem = null;
- }
- }
+ // Remove cache only if it was not already removed by jQuery.event.remove
+ if ( cache[ id ] ) {
- if ( deleteExpando ) {
- delete elem[ jQuery.expando ];
+ delete cache[ id ];
- } else if ( elem.removeAttribute ) {
- elem.removeAttribute( jQuery.expando );
- }
+ // IE does not allow us to delete expando properties from nodes,
+ // nor does it have a removeAttribute function on Document nodes;
+ // we must handle all of these cases
+ if ( deleteExpando ) {
+ delete elem[ internalKey ];
+
+ } else if ( elem.removeAttribute ) {
+ elem.removeAttribute( internalKey );
+
+ } else {
+ elem[ internalKey ] = null;
+ }
- delete cache[ id ];
+ jQuery.deletedIds.push( id );
+ }
+ }
}
}
}
});
+// Limit scope pollution from any deprecated API
+(function() {
+
+var matched, browser;
+
+// Use of jQuery.browser is frowned upon.
+// More details: http://api.jquery.com/jQuery.browser
+// jQuery.uaMatch maintained for back-compat
+jQuery.uaMatch = function( ua ) {
+ ua = ua.toLowerCase();
+
+ var match = /(chrome)[ \/]([\w.]+)/.exec( ua ) ||
+ /(webkit)[ \/]([\w.]+)/.exec( ua ) ||
+ /(opera)(?:.*version|)[ \/]([\w.]+)/.exec( ua ) ||
+ /(msie) ([\w.]+)/.exec( ua ) ||
+ ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec( ua ) ||
+ [];
+
+ return {
+ browser: match[ 1 ] || "",
+ version: match[ 2 ] || "0"
+ };
+};
-function evalScript( i, elem ) {
- if ( elem.src ) {
- jQuery.ajax({
- url: elem.src,
- async: false,
- dataType: "script"
- });
- } else {
- jQuery.globalEval( ( elem.text || elem.textContent || elem.innerHTML || "" ).replace( rcleanScript, "/*$0*/" ) );
- }
+matched = jQuery.uaMatch( navigator.userAgent );
+browser = {};
- if ( elem.parentNode ) {
- elem.parentNode.removeChild( elem );
- }
+if ( matched.browser ) {
+ browser[ matched.browser ] = true;
+ browser.version = matched.version;
+}
+
+// Chrome is Webkit, but Webkit is also Safari.
+if ( browser.chrome ) {
+ browser.webkit = true;
+} else if ( browser.webkit ) {
+ browser.safari = true;
}
+jQuery.browser = browser;
+jQuery.sub = function() {
+ function jQuerySub( selector, context ) {
+ return new jQuerySub.fn.init( selector, context );
+ }
+ jQuery.extend( true, jQuerySub, this );
+ jQuerySub.superclass = this;
+ jQuerySub.fn = jQuerySub.prototype = this();
+ jQuerySub.fn.constructor = jQuerySub;
+ jQuerySub.sub = this.sub;
+ jQuerySub.fn.init = function init( selector, context ) {
+ if ( context && context instanceof jQuery && !(context instanceof jQuerySub) ) {
+ context = jQuerySub( context );
+ }
+ return jQuery.fn.init.call( this, selector, context, rootjQuerySub );
+ };
+ jQuerySub.fn.init.prototype = jQuerySub.fn;
+ var rootjQuerySub = jQuerySub(document);
+ return jQuerySub;
+};
-var ralpha = /alpha\([^)]*\)/i,
+})();
+var curCSS, iframe, iframeDoc,
+ ralpha = /alpha\([^)]*\)/i,
ropacity = /opacity=([^)]*)/,
- // fixed for IE9, see #8346
- rupper = /([A-Z]|^ms)/g,
- rnumpx = /^-?\d+(?:px)?$/i,
- rnum = /^-?\d/,
- rrelNum = /^([\-+])=([\-+.\de]+)/,
+ rposition = /^(top|right|bottom|left)$/,
+ // swappable if display is none or starts with table except "table", "table-cell", or "table-caption"
+ // see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
+ rdisplayswap = /^(none|table(?!-c[ea]).+)/,
+ rmargin = /^margin/,
+ rnumsplit = new RegExp( "^(" + core_pnum + ")(.*)$", "i" ),
+ rnumnonpx = new RegExp( "^(" + core_pnum + ")(?!px)[a-z%]+$", "i" ),
+ rrelNum = new RegExp( "^([-+])=(" + core_pnum + ")", "i" ),
+ elemdisplay = {},
cssShow = { position: "absolute", visibility: "hidden", display: "block" },
- cssWidth = [ "Left", "Right" ],
- cssHeight = [ "Top", "Bottom" ],
- curCSS,
+ cssNormalTransform = {
+ letterSpacing: 0,
+ fontWeight: 400
+ },
- getComputedStyle,
- currentStyle;
+ cssExpand = [ "Top", "Right", "Bottom", "Left" ],
+ cssPrefixes = [ "Webkit", "O", "Moz", "ms" ],
-jQuery.fn.css = function( name, value ) {
- // Setting 'undefined' is a no-op
- if ( arguments.length === 2 && value === undefined ) {
- return this;
+ eventsToggle = jQuery.fn.toggle;
+
+// return a css property mapped to a potentially vendor prefixed property
+function vendorPropName( style, name ) {
+
+ // shortcut for names that are not vendor prefixed
+ if ( name in style ) {
+ return name;
}
- return jQuery.access( this, name, value, true, function( elem, name, value ) {
- return value !== undefined ?
- jQuery.style( elem, name, value ) :
- jQuery.css( elem, name );
- });
-};
+ // check for vendor prefixed names
+ var capName = name.charAt(0).toUpperCase() + name.slice(1),
+ origName = name,
+ i = cssPrefixes.length;
+
+ while ( i-- ) {
+ name = cssPrefixes[ i ] + capName;
+ if ( name in style ) {
+ return name;
+ }
+ }
+
+ return origName;
+}
+
+function isHidden( elem, el ) {
+ elem = el || elem;
+ return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem );
+}
+
+function showHide( elements, show ) {
+ var elem, display,
+ values = [],
+ index = 0,
+ length = elements.length;
+
+ for ( ; index < length; index++ ) {
+ elem = elements[ index ];
+ if ( !elem.style ) {
+ continue;
+ }
+ values[ index ] = jQuery._data( elem, "olddisplay" );
+ if ( show ) {
+ // Reset the inline display of this element to learn if it is
+ // being hidden by cascaded rules or not
+ if ( !values[ index ] && elem.style.display === "none" ) {
+ elem.style.display = "";
+ }
+
+ // Set elements which have been overridden with display: none
+ // in a stylesheet to whatever the default browser style is
+ // for such an element
+ if ( elem.style.display === "" && isHidden( elem ) ) {
+ values[ index ] = jQuery._data( elem, "olddisplay", css_defaultDisplay(elem.nodeName) );
+ }
+ } else {
+ display = curCSS( elem, "display" );
+
+ if ( !values[ index ] && display !== "none" ) {
+ jQuery._data( elem, "olddisplay", display );
+ }
+ }
+ }
+
+ // Set the display of most of the elements in a second loop
+ // to avoid the constant reflow
+ for ( index = 0; index < length; index++ ) {
+ elem = elements[ index ];
+ if ( !elem.style ) {
+ continue;
+ }
+ if ( !show || elem.style.display === "none" || elem.style.display === "" ) {
+ elem.style.display = show ? values[ index ] || "" : "none";
+ }
+ }
+
+ return elements;
+}
+
+jQuery.fn.extend({
+ css: function( name, value ) {
+ return jQuery.access( this, function( elem, name, value ) {
+ return value !== undefined ?
+ jQuery.style( elem, name, value ) :
+ jQuery.css( elem, name );
+ }, name, value, arguments.length > 1 );
+ },
+ show: function() {
+ return showHide( this, true );
+ },
+ hide: function() {
+ return showHide( this );
+ },
+ toggle: function( state, fn2 ) {
+ var bool = typeof state === "boolean";
+
+ if ( jQuery.isFunction( state ) && jQuery.isFunction( fn2 ) ) {
+ return eventsToggle.apply( this, arguments );
+ }
+
+ return this.each(function() {
+ if ( bool ? state : isHidden( this ) ) {
+ jQuery( this ).show();
+ } else {
+ jQuery( this ).hide();
+ }
+ });
+ }
+});
jQuery.extend({
// Add in style property hooks for overriding the default
get: function( elem, computed ) {
if ( computed ) {
// We should always get a number back from opacity
- var ret = curCSS( elem, "opacity", "opacity" );
+ var ret = curCSS( elem, "opacity" );
return ret === "" ? "1" : ret;
- } else {
- return elem.style.opacity;
}
}
}
}
// Make sure that we're working with the right name
- var ret, type, origName = jQuery.camelCase( name ),
- style = elem.style, hooks = jQuery.cssHooks[ origName ];
+ var ret, type, hooks,
+ origName = jQuery.camelCase( name ),
+ style = elem.style;
- name = jQuery.cssProps[ origName ] || origName;
+ name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) );
+
+ // gets hook for the prefixed version
+ // followed by the unprefixed version
+ hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
// Check if we're setting a value
if ( value !== undefined ) {
// convert relative number strings (+= or -=) to relative numbers. #7345
if ( type === "string" && (ret = rrelNum.exec( value )) ) {
- value = ( +( ret[1] + 1) * +ret[2] ) + parseFloat( jQuery.css( elem, name ) );
+ value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) );
// Fixes bug #9237
type = "number";
}
}
// If a hook was provided, use that value, otherwise just set the specified value
- if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value )) !== undefined ) {
+ if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) {
// Wrapped to prevent IE from throwing errors when 'invalid' values are provided
// Fixes bug #5509
try {
}
},
- css: function( elem, name, extra ) {
- var ret, hooks;
+ css: function( elem, name, numeric, extra ) {
+ var val, num, hooks,
+ origName = jQuery.camelCase( name );
// Make sure that we're working with the right name
- name = jQuery.camelCase( name );
- hooks = jQuery.cssHooks[ name ];
- name = jQuery.cssProps[ name ] || name;
+ name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) );
+
+ // gets hook for the prefixed version
+ // followed by the unprefixed version
+ hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
+
+ // If a hook was provided get the computed value from there
+ if ( hooks && "get" in hooks ) {
+ val = hooks.get( elem, true, extra );
+ }
+
+ // Otherwise, if a way to get the computed value exists, use that
+ if ( val === undefined ) {
+ val = curCSS( elem, name );
+ }
+
+ //convert "normal" to computed value
+ if ( val === "normal" && name in cssNormalTransform ) {
+ val = cssNormalTransform[ name ];
+ }
+
+ // Return, converting to number if forced or a qualifier was provided and val looks numeric
+ if ( numeric || extra !== undefined ) {
+ num = parseFloat( val );
+ return numeric || jQuery.isNumeric( num ) ? num || 0 : val;
+ }
+ return val;
+ },
+
+ // A method for quickly swapping in/out CSS properties to get correct calculations
+ swap: function( elem, options, callback ) {
+ var ret, name,
+ old = {};
+
+ // Remember the old values, and insert the new ones
+ for ( name in options ) {
+ old[ name ] = elem.style[ name ];
+ elem.style[ name ] = options[ name ];
+ }
+
+ ret = callback.call( elem );
+
+ // Revert the old values
+ for ( name in options ) {
+ elem.style[ name ] = old[ name ];
+ }
+
+ return ret;
+ }
+});
+
+// NOTE: To any future maintainer, we've window.getComputedStyle
+// because jsdom on node.js will break without it.
+if ( window.getComputedStyle ) {
+ curCSS = function( elem, name ) {
+ var ret, width, minWidth, maxWidth,
+ computed = window.getComputedStyle( elem, null ),
+ style = elem.style;
+
+ if ( computed ) {
+
+ ret = computed[ name ];
+ if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {
+ ret = jQuery.style( elem, name );
+ }
+
+ // A tribute to the "awesome hack by Dean Edwards"
+ // Chrome < 17 and Safari 5.0 uses "computed value" instead of "used value" for margin-right
+ // Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels
+ // this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values
+ if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) {
+ width = style.width;
+ minWidth = style.minWidth;
+ maxWidth = style.maxWidth;
+
+ style.minWidth = style.maxWidth = style.width = ret;
+ ret = computed.width;
+
+ style.width = width;
+ style.minWidth = minWidth;
+ style.maxWidth = maxWidth;
+ }
+ }
+
+ return ret;
+ };
+} else if ( document.documentElement.currentStyle ) {
+ curCSS = function( elem, name ) {
+ var left, rsLeft,
+ ret = elem.currentStyle && elem.currentStyle[ name ],
+ style = elem.style;
+
+ // Avoid setting ret to empty string here
+ // so we don't default to auto
+ if ( ret == null && style && style[ name ] ) {
+ ret = style[ name ];
+ }
+
+ // From the awesome hack by Dean Edwards
+ // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
+
+ // If we're not dealing with a regular pixel number
+ // but a number that has a weird ending, we need to convert it to pixels
+ // but not position css attributes, as those are proportional to the parent element instead
+ // and we can't measure the parent instead because it might trigger a "stacking dolls" problem
+ if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) {
+
+ // Remember the original values
+ left = style.left;
+ rsLeft = elem.runtimeStyle && elem.runtimeStyle.left;
+
+ // Put in the new values to get a computed value out
+ if ( rsLeft ) {
+ elem.runtimeStyle.left = elem.currentStyle.left;
+ }
+ style.left = name === "fontSize" ? "1em" : ret;
+ ret = style.pixelLeft + "px";
+
+ // Revert the changed values
+ style.left = left;
+ if ( rsLeft ) {
+ elem.runtimeStyle.left = rsLeft;
+ }
+ }
+
+ return ret === "" ? "auto" : ret;
+ };
+}
+
+function setPositiveNumber( elem, value, subtract ) {
+ var matches = rnumsplit.exec( value );
+ return matches ?
+ Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) :
+ value;
+}
+
+function augmentWidthOrHeight( elem, name, extra, isBorderBox ) {
+ var i = extra === ( isBorderBox ? "border" : "content" ) ?
+ // If we already have the right measurement, avoid augmentation
+ 4 :
+ // Otherwise initialize for horizontal or vertical properties
+ name === "width" ? 1 : 0,
+
+ val = 0;
+
+ for ( ; i < 4; i += 2 ) {
+ // both box models exclude margin, so add it if we want it
+ if ( extra === "margin" ) {
+ // we use jQuery.css instead of curCSS here
+ // because of the reliableMarginRight CSS hook!
+ val += jQuery.css( elem, extra + cssExpand[ i ], true );
+ }
+
+ // From this point on we use curCSS for maximum performance (relevant in animations)
+ if ( isBorderBox ) {
+ // border-box includes padding, so remove it if we want content
+ if ( extra === "content" ) {
+ val -= parseFloat( curCSS( elem, "padding" + cssExpand[ i ] ) ) || 0;
+ }
+
+ // at this point, extra isn't border nor margin, so remove border
+ if ( extra !== "margin" ) {
+ val -= parseFloat( curCSS( elem, "border" + cssExpand[ i ] + "Width" ) ) || 0;
+ }
+ } else {
+ // at this point, extra isn't content, so add padding
+ val += parseFloat( curCSS( elem, "padding" + cssExpand[ i ] ) ) || 0;
+
+ // at this point, extra isn't content nor padding, so add border
+ if ( extra !== "padding" ) {
+ val += parseFloat( curCSS( elem, "border" + cssExpand[ i ] + "Width" ) ) || 0;
+ }
+ }
+ }
+
+ return val;
+}
+
+function getWidthOrHeight( elem, name, extra ) {
+
+ // Start with offset property, which is equivalent to the border-box value
+ var val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
+ valueIsBorderBox = true,
+ isBorderBox = jQuery.support.boxSizing && jQuery.css( elem, "boxSizing" ) === "border-box";
+
+ // some non-html elements return undefined for offsetWidth, so check for null/undefined
+ // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
+ // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668
+ if ( val <= 0 || val == null ) {
+ // Fall back to computed then uncomputed css if necessary
+ val = curCSS( elem, name );
+ if ( val < 0 || val == null ) {
+ val = elem.style[ name ];
+ }
+
+ // Computed unit is not pixels. Stop here and return.
+ if ( rnumnonpx.test(val) ) {
+ return val;
+ }
+
+ // we need the check for style in case a browser which returns unreliable values
+ // for getComputedStyle silently falls back to the reliable elem.style
+ valueIsBorderBox = isBorderBox && ( jQuery.support.boxSizingReliable || val === elem.style[ name ] );
+
+ // Normalize "", auto, and prepare for extra
+ val = parseFloat( val ) || 0;
+ }
- // cssFloat needs a special treatment
- if ( name === "cssFloat" ) {
- name = "float";
- }
+ // use the active box-sizing model to add/subtract irrelevant styles
+ return ( val +
+ augmentWidthOrHeight(
+ elem,
+ name,
+ extra || ( isBorderBox ? "border" : "content" ),
+ valueIsBorderBox
+ )
+ ) + "px";
+}
- // If a hook was provided get the computed value from there
- if ( hooks && "get" in hooks && (ret = hooks.get( elem, true, extra )) !== undefined ) {
- return ret;
- // Otherwise, if a way to get the computed value exists, use that
- } else if ( curCSS ) {
- return curCSS( elem, name );
- }
- },
+// Try to determine the default display value of an element
+function css_defaultDisplay( nodeName ) {
+ if ( elemdisplay[ nodeName ] ) {
+ return elemdisplay[ nodeName ];
+ }
- // A method for quickly swapping in/out CSS properties to get correct calculations
- swap: function( elem, options, callback ) {
- var old = {};
+ var elem = jQuery( "<" + nodeName + ">" ).appendTo( document.body ),
+ display = elem.css("display");
+ elem.remove();
+
+ // If the simple way fails,
+ // get element's real default display by attaching it to a temp iframe
+ if ( display === "none" || display === "" ) {
+ // Use the already-created iframe if possible
+ iframe = document.body.appendChild(
+ iframe || jQuery.extend( document.createElement("iframe"), {
+ frameBorder: 0,
+ width: 0,
+ height: 0
+ })
+ );
- // Remember the old values, and insert the new ones
- for ( var name in options ) {
- old[ name ] = elem.style[ name ];
- elem.style[ name ] = options[ name ];
+ // Create a cacheable copy of the iframe document on first call.
+ // IE and Opera will allow us to reuse the iframeDoc without re-writing the fake HTML
+ // document to it; WebKit & Firefox won't allow reusing the iframe document.
+ if ( !iframeDoc || !iframe.createElement ) {
+ iframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document;
+ iframeDoc.write("<!doctype html><html><body>");
+ iframeDoc.close();
}
- callback.call( elem );
+ elem = iframeDoc.body.appendChild( iframeDoc.createElement(nodeName) );
- // Revert the old values
- for ( name in options ) {
- elem.style[ name ] = old[ name ];
- }
+ display = curCSS( elem, "display" );
+ document.body.removeChild( iframe );
}
-});
-// DEPRECATED, Use jQuery.css() instead
-jQuery.curCSS = jQuery.css;
+ // Store the correct default display
+ elemdisplay[ nodeName ] = display;
-jQuery.each(["height", "width"], function( i, name ) {
+ return display;
+}
+
+jQuery.each([ "height", "width" ], function( i, name ) {
jQuery.cssHooks[ name ] = {
get: function( elem, computed, extra ) {
- var val;
-
if ( computed ) {
- if ( elem.offsetWidth !== 0 ) {
- return getWH( elem, name, extra );
- } else {
- jQuery.swap( elem, cssShow, function() {
- val = getWH( elem, name, extra );
+ // certain elements can have dimension info if we invisibly show them
+ // however, it must have a current display style that would benefit from this
+ if ( elem.offsetWidth === 0 && rdisplayswap.test( curCSS( elem, "display" ) ) ) {
+ return jQuery.swap( elem, cssShow, function() {
+ return getWidthOrHeight( elem, name, extra );
});
+ } else {
+ return getWidthOrHeight( elem, name, extra );
}
-
- return val;
}
},
- set: function( elem, value ) {
- if ( rnumpx.test( value ) ) {
- // ignore negative width and height values #1599
- value = parseFloat( value );
-
- if ( value >= 0 ) {
- return value + "px";
- }
-
- } else {
- return value;
- }
+ set: function( elem, value, extra ) {
+ return setPositiveNumber( elem, value, extra ?
+ augmentWidthOrHeight(
+ elem,
+ name,
+ extra,
+ jQuery.support.boxSizing && jQuery.css( elem, "boxSizing" ) === "border-box"
+ ) : 0
+ );
}
};
});
get: function( elem, computed ) {
// IE uses filters for opacity
return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ?
- ( parseFloat( RegExp.$1 ) / 100 ) + "" :
+ ( 0.01 * parseFloat( RegExp.$1 ) ) + "" :
computed ? "1" : "";
},
style.zoom = 1;
// if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652
- if ( value >= 1 && jQuery.trim( filter.replace( ralpha, "" ) ) === "" ) {
+ if ( value >= 1 && jQuery.trim( filter.replace( ralpha, "" ) ) === "" &&
+ style.removeAttribute ) {
// Setting style.filter to null, "" & " " still leave "filter:" in the cssText
// if "filter:" is present at all, clearType is disabled, we want to avoid this
};
}
+// These hooks cannot be added until DOM ready because the support test
+// for it is not run until after DOM ready
jQuery(function() {
- // This hook cannot be added until DOM ready because the support test
- // for it is not run until after DOM ready
if ( !jQuery.support.reliableMarginRight ) {
jQuery.cssHooks.marginRight = {
get: function( elem, computed ) {
// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
// Work around by temporarily setting element display to inline-block
- var ret;
- jQuery.swap( elem, { "display": "inline-block" }, function() {
+ return jQuery.swap( elem, { "display": "inline-block" }, function() {
if ( computed ) {
- ret = curCSS( elem, "margin-right", "marginRight" );
- } else {
- ret = elem.style.marginRight;
+ return curCSS( elem, "marginRight" );
}
});
- return ret;
}
};
}
-});
-if ( document.defaultView && document.defaultView.getComputedStyle ) {
- getComputedStyle = function( elem, name ) {
- var ret, defaultView, computedStyle;
+ // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
+ // getComputedStyle returns percent when specified for top/left/bottom/right
+ // rather than make the css module depend on the offset module, we just check for it here
+ if ( !jQuery.support.pixelPosition && jQuery.fn.position ) {
+ jQuery.each( [ "top", "left" ], function( i, prop ) {
+ jQuery.cssHooks[ prop ] = {
+ get: function( elem, computed ) {
+ if ( computed ) {
+ var ret = curCSS( elem, prop );
+ // if curCSS returns percentage, fallback to offset
+ return rnumnonpx.test( ret ) ? jQuery( elem ).position()[ prop ] + "px" : ret;
+ }
+ }
+ };
+ });
+ }
- name = name.replace( rupper, "-$1" ).toLowerCase();
+});
- if ( (defaultView = elem.ownerDocument.defaultView) &&
- (computedStyle = defaultView.getComputedStyle( elem, null )) ) {
- ret = computedStyle.getPropertyValue( name );
- if ( ret === "" && !jQuery.contains( elem.ownerDocument.documentElement, elem ) ) {
- ret = jQuery.style( elem, name );
- }
- }
+if ( jQuery.expr && jQuery.expr.filters ) {
+ jQuery.expr.filters.hidden = function( elem ) {
+ return ( elem.offsetWidth === 0 && elem.offsetHeight === 0 ) || (!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display) || curCSS( elem, "display" )) === "none");
+ };
- return ret;
+ jQuery.expr.filters.visible = function( elem ) {
+ return !jQuery.expr.filters.hidden( elem );
};
}
-if ( document.documentElement.currentStyle ) {
- currentStyle = function( elem, name ) {
- var left, rsLeft, uncomputed,
- ret = elem.currentStyle && elem.currentStyle[ name ],
- style = elem.style;
-
- // Avoid setting ret to empty string here
- // so we don't default to auto
- if ( ret === null && style && (uncomputed = style[ name ]) ) {
- ret = uncomputed;
- }
-
- // From the awesome hack by Dean Edwards
- // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
-
- // If we're not dealing with a regular pixel number
- // but a number that has a weird ending, we need to convert it to pixels
- if ( !rnumpx.test( ret ) && rnum.test( ret ) ) {
+// These hooks are used by animate to expand properties
+jQuery.each({
+ margin: "",
+ padding: "",
+ border: "Width"
+}, function( prefix, suffix ) {
+ jQuery.cssHooks[ prefix + suffix ] = {
+ expand: function( value ) {
+ var i,
- // Remember the original values
- left = style.left;
- rsLeft = elem.runtimeStyle && elem.runtimeStyle.left;
+ // assumes a single number if not a string
+ parts = typeof value === "string" ? value.split(" ") : [ value ],
+ expanded = {};
- // Put in the new values to get a computed value out
- if ( rsLeft ) {
- elem.runtimeStyle.left = elem.currentStyle.left;
+ for ( i = 0; i < 4; i++ ) {
+ expanded[ prefix + cssExpand[ i ] + suffix ] =
+ parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
}
- style.left = name === "fontSize" ? "1em" : ( ret || 0 );
- ret = style.pixelLeft + "px";
- // Revert the changed values
- style.left = left;
- if ( rsLeft ) {
- elem.runtimeStyle.left = rsLeft;
- }
+ return expanded;
}
-
- return ret === "" ? "auto" : ret;
};
-}
-curCSS = getComputedStyle || currentStyle;
+ if ( !rmargin.test( prefix ) ) {
+ jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
+ }
+});
+var r20 = /%20/g,
+ rbracket = /\[\]$/,
+ rCRLF = /\r?\n/g,
+ rinput = /^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,
+ rselectTextarea = /^(?:select|textarea)/i;
-function getWH( elem, name, extra ) {
+jQuery.fn.extend({
+ serialize: function() {
+ return jQuery.param( this.serializeArray() );
+ },
+ serializeArray: function() {
+ return this.map(function(){
+ return this.elements ? jQuery.makeArray( this.elements ) : this;
+ })
+ .filter(function(){
+ return this.name && !this.disabled &&
+ ( this.checked || rselectTextarea.test( this.nodeName ) ||
+ rinput.test( this.type ) );
+ })
+ .map(function( i, elem ){
+ var val = jQuery( this ).val();
- // Start with offset property
- var val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
- which = name === "width" ? cssWidth : cssHeight,
- i = 0,
- len = which.length;
+ return val == null ?
+ null :
+ jQuery.isArray( val ) ?
+ jQuery.map( val, function( val, i ){
+ return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
+ }) :
+ { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
+ }).get();
+ }
+});
- if ( val > 0 ) {
- if ( extra !== "border" ) {
- for ( ; i < len; i++ ) {
- if ( !extra ) {
- val -= parseFloat( jQuery.css( elem, "padding" + which[ i ] ) ) || 0;
- }
- if ( extra === "margin" ) {
- val += parseFloat( jQuery.css( elem, extra + which[ i ] ) ) || 0;
- } else {
- val -= parseFloat( jQuery.css( elem, "border" + which[ i ] + "Width" ) ) || 0;
- }
- }
- }
+//Serialize an array of form elements or a set of
+//key/values into a query string
+jQuery.param = function( a, traditional ) {
+ var prefix,
+ s = [],
+ add = function( key, value ) {
+ // If value is a function, invoke it and return its value
+ value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value );
+ s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
+ };
- return val + "px";
+ // Set traditional to true for jQuery <= 1.3.2 behavior.
+ if ( traditional === undefined ) {
+ traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional;
}
- // Fall back to computed then uncomputed css if necessary
- val = curCSS( elem, name, name );
- if ( val < 0 || val == null ) {
- val = elem.style[ name ] || 0;
- }
- // Normalize "", auto, and prepare for extra
- val = parseFloat( val ) || 0;
+ // If an array was passed in, assume that it is an array of form elements.
+ if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
+ // Serialize the form elements
+ jQuery.each( a, function() {
+ add( this.name, this.value );
+ });
- // Add padding, border, margin
- if ( extra ) {
- for ( ; i < len; i++ ) {
- val += parseFloat( jQuery.css( elem, "padding" + which[ i ] ) ) || 0;
- if ( extra !== "padding" ) {
- val += parseFloat( jQuery.css( elem, "border" + which[ i ] + "Width" ) ) || 0;
- }
- if ( extra === "margin" ) {
- val += parseFloat( jQuery.css( elem, extra + which[ i ] ) ) || 0;
- }
+ } else {
+ // If traditional, encode the "old" way (the way 1.3.2 or older
+ // did it), otherwise encode params recursively.
+ for ( prefix in a ) {
+ buildParams( prefix, a[ prefix ], traditional, add );
}
}
- return val + "px";
-}
-
-if ( jQuery.expr && jQuery.expr.filters ) {
- jQuery.expr.filters.hidden = function( elem ) {
- var width = elem.offsetWidth,
- height = elem.offsetHeight;
+ // Return the resulting serialization
+ return s.join( "&" ).replace( r20, "+" );
+};
- return ( width === 0 && height === 0 ) || (!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none");
- };
+function buildParams( prefix, obj, traditional, add ) {
+ var name;
- jQuery.expr.filters.visible = function( elem ) {
- return !jQuery.expr.filters.hidden( elem );
- };
-}
+ if ( jQuery.isArray( obj ) ) {
+ // Serialize array item.
+ jQuery.each( obj, function( i, v ) {
+ if ( traditional || rbracket.test( prefix ) ) {
+ // Treat each array item as a scalar.
+ add( prefix, v );
+ } else {
+ // If array item is non-scalar (array or object), encode its
+ // numeric index to resolve deserialization ambiguity issues.
+ // Note that rack (as of 1.0.0) can't currently deserialize
+ // nested arrays properly, and attempting to do so may cause
+ // a server error. Possible fixes are to modify rack's
+ // deserialization algorithm or to provide an option or flag
+ // to force array serialization to be shallow.
+ buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add );
+ }
+ });
+ } else if ( !traditional && jQuery.type( obj ) === "object" ) {
+ // Serialize object item.
+ for ( name in obj ) {
+ buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
+ }
+ } else {
+ // Serialize scalar item.
+ add( prefix, obj );
+ }
+}
+var
+ // Document location
+ ajaxLocParts,
+ ajaxLocation,
-var r20 = /%20/g,
- rbracket = /\[\]$/,
- rCRLF = /\r?\n/g,
rhash = /#.*$/,
rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL
- rinput = /^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,
// #7653, #8125, #8152: local protocol detection
rlocalProtocol = /^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,
rnoContent = /^(?:GET|HEAD)$/,
rprotocol = /^\/\//,
rquery = /\?/,
rscript = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
- rselectTextarea = /^(?:select|textarea)/i,
- rspacesAjax = /\s+/,
rts = /([?&])_=[^&]*/,
- rurl = /^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,
+ rurl = /^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,
// Keep a copy of the old load method
_load = jQuery.fn.load,
*/
transports = {},
- // Document location
- ajaxLocation,
-
- // Document location segments
- ajaxLocParts,
-
// Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
allTypes = ["*/"] + ["*"];
dataTypeExpression = "*";
}
- if ( jQuery.isFunction( func ) ) {
- var dataTypes = dataTypeExpression.toLowerCase().split( rspacesAjax ),
- i = 0,
- length = dataTypes.length,
- dataType,
- list,
- placeBefore;
+ var dataType, list, placeBefore,
+ dataTypes = dataTypeExpression.toLowerCase().split( core_rspace ),
+ i = 0,
+ length = dataTypes.length;
+ if ( jQuery.isFunction( func ) ) {
// For each dataType in the dataTypeExpression
for ( ; i < length; i++ ) {
dataType = dataTypes[ i ];
inspected[ dataType ] = true;
- var list = structure[ dataType ],
+ var selection,
+ list = structure[ dataType ],
i = 0,
length = list ? list.length : 0,
- executeOnly = ( structure === prefilters ),
- selection;
+ executeOnly = ( structure === prefilters );
for ( ; i < length && ( executeOnly || !selection ); i++ ) {
selection = list[ i ]( options, originalOptions, jqXHR );
}
}
-jQuery.fn.extend({
- load: function( url, params, callback ) {
- if ( typeof url !== "string" && _load ) {
- return _load.apply( this, arguments );
+jQuery.fn.load = function( url, params, callback ) {
+ if ( typeof url !== "string" && _load ) {
+ return _load.apply( this, arguments );
+ }
- // Don't do a request if no elements are being requested
- } else if ( !this.length ) {
- return this;
- }
+ // Don't do a request if no elements are being requested
+ if ( !this.length ) {
+ return this;
+ }
- var off = url.indexOf( " " );
- if ( off >= 0 ) {
- var selector = url.slice( off, url.length );
- url = url.slice( 0, off );
- }
+ var selector, type, response,
+ self = this,
+ off = url.indexOf(" ");
+
+ if ( off >= 0 ) {
+ selector = url.slice( off, url.length );
+ url = url.slice( 0, off );
+ }
+
+ // If it's a function
+ if ( jQuery.isFunction( params ) ) {
- // Default to a GET request
- var type = "GET";
+ // We assume that it's the callback
+ callback = params;
+ params = undefined;
+
+ // Otherwise, build a param string
+ } else if ( params && typeof params === "object" ) {
+ type = "POST";
+ }
- // If the second parameter was provided
- if ( params ) {
- // If it's a function
- if ( jQuery.isFunction( params ) ) {
- // We assume that it's the callback
- callback = params;
- params = undefined;
+ // Request the remote document
+ jQuery.ajax({
+ url: url,
- // Otherwise, build a param string
- } else if ( typeof params === "object" ) {
- params = jQuery.param( params, jQuery.ajaxSettings.traditional );
- type = "POST";
+ // if "type" variable is undefined, then "GET" method will be used
+ type: type,
+ dataType: "html",
+ data: params,
+ complete: function( jqXHR, status ) {
+ if ( callback ) {
+ self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] );
}
}
+ }).done(function( responseText ) {
- var self = this;
+ // Save response for use in complete callback
+ response = arguments;
- // Request the remote document
- jQuery.ajax({
- url: url,
- type: type,
- dataType: "html",
- data: params,
- // Complete callback (responseText is used internally)
- complete: function( jqXHR, status, responseText ) {
- // Store the response as specified by the jqXHR object
- responseText = jqXHR.responseText;
- // If successful, inject the HTML into all the matched elements
- if ( jqXHR.isResolved() ) {
- // #4825: Get the actual response in case
- // a dataFilter is present in ajaxSettings
- jqXHR.done(function( r ) {
- responseText = r;
- });
- // See if a selector was specified
- self.html( selector ?
- // Create a dummy div to hold the results
- jQuery("<div>")
- // inject the contents of the document in, removing the scripts
- // to avoid any 'Permission Denied' errors in IE
- .append(responseText.replace(rscript, ""))
+ // See if a selector was specified
+ self.html( selector ?
- // Locate the specified elements
- .find(selector) :
-
- // If not, just inject the full result
- responseText );
- }
+ // Create a dummy div to hold the results
+ jQuery("<div>")
- if ( callback ) {
- self.each( callback, [ responseText, status, jqXHR ] );
- }
- }
- });
+ // inject the contents of the document in, removing the scripts
+ // to avoid any 'Permission Denied' errors in IE
+ .append( responseText.replace( rscript, "" ) )
- return this;
- },
+ // Locate the specified elements
+ .find( selector ) :
- serialize: function() {
- return jQuery.param( this.serializeArray() );
- },
+ // If not, just inject the full result
+ responseText );
- serializeArray: function() {
- return this.map(function(){
- return this.elements ? jQuery.makeArray( this.elements ) : this;
- })
- .filter(function(){
- return this.name && !this.disabled &&
- ( this.checked || rselectTextarea.test( this.nodeName ) ||
- rinput.test( this.type ) );
- })
- .map(function( i, elem ){
- var val = jQuery( this ).val();
+ });
- return val == null ?
- null :
- jQuery.isArray( val ) ?
- jQuery.map( val, function( val, i ){
- return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
- }) :
- { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
- }).get();
- }
-});
+ return this;
+};
// Attach a bunch of functions for handling common AJAX events
jQuery.each( "ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split( " " ), function( i, o ){
isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
global: true,
type: "GET",
- contentType: "application/x-www-form-urlencoded",
+ contentType: "application/x-www-form-urlencoded; charset=UTF-8",
processData: true,
async: true,
/*
username: null,
password: null,
cache: null,
+ throws: false,
traditional: false,
headers: {},
*/
// Force options to be an object
options = options || {};
- var // Create the final options object
+ var // ifModified key
+ ifModifiedKey,
+ // Response headers
+ responseHeadersString,
+ responseHeaders,
+ // transport
+ transport,
+ // timeout handle
+ timeoutTimer,
+ // Cross-domain detection vars
+ parts,
+ // To know if global events are to be dispatched
+ fireGlobals,
+ // Loop variable
+ i,
+ // Create the final options object
s = jQuery.ajaxSetup( {}, options ),
// Callbacks context
callbackContext = s.context || s,
completeDeferred = jQuery.Callbacks( "once memory" ),
// Status-dependent callbacks
statusCode = s.statusCode || {},
- // ifModified key
- ifModifiedKey,
// Headers (they are sent all at once)
requestHeaders = {},
requestHeadersNames = {},
- // Response headers
- responseHeadersString,
- responseHeaders,
- // transport
- transport,
- // timeout handle
- timeoutTimer,
- // Cross-domain detection vars
- parts,
// The jqXHR state
- state = 0,
- // To know if global events are to be dispatched
- fireGlobals,
- // Loop variable
- i,
+ state = 0,
+ // Default abort message
+ strAbort = "canceled",
// Fake xhr
jqXHR = {
// Cancel the request
abort: function( statusText ) {
- statusText = statusText || "abort";
+ statusText = statusText || strAbort;
if ( transport ) {
transport.abort( statusText );
}
// It is defined here because jslint complains if it is declared
// at the end of the function (which would be more logical and readable)
function done( status, nativeStatusText, responses, headers ) {
+ var isSuccess, success, error, response, modified,
+ statusText = nativeStatusText;
// Called once
if ( state === 2 ) {
// Set readyState
jqXHR.readyState = status > 0 ? 4 : 0;
- var isSuccess,
- success,
- error,
- statusText = nativeStatusText,
- response = responses ? ajaxHandleResponses( s, jqXHR, responses ) : undefined,
- lastModified,
- etag;
+ // Get response data
+ if ( responses ) {
+ response = ajaxHandleResponses( s, jqXHR, responses );
+ }
// If successful, handle type chaining
if ( status >= 200 && status < 300 || status === 304 ) {
// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
if ( s.ifModified ) {
- if ( ( lastModified = jqXHR.getResponseHeader( "Last-Modified" ) ) ) {
- jQuery.lastModified[ ifModifiedKey ] = lastModified;
+ modified = jqXHR.getResponseHeader("Last-Modified");
+ if ( modified ) {
+ jQuery.lastModified[ ifModifiedKey ] = modified;
}
- if ( ( etag = jqXHR.getResponseHeader( "Etag" ) ) ) {
- jQuery.etag[ ifModifiedKey ] = etag;
+ modified = jqXHR.getResponseHeader("Etag");
+ if ( modified ) {
+ jQuery.etag[ ifModifiedKey ] = modified;
}
}
// If we have data
} else {
- try {
- success = ajaxConvert( s, response );
- statusText = "success";
- isSuccess = true;
- } catch(e) {
- // We have a parsererror
- statusText = "parsererror";
- error = e;
- }
+ isSuccess = ajaxConvert( s, response );
+ statusText = isSuccess.state;
+ success = isSuccess.data;
+ error = isSuccess.error;
+ isSuccess = !error;
}
} else {
// We extract error from statusText
// Set data for the fake xhr object
jqXHR.status = status;
- jqXHR.statusText = "" + ( nativeStatusText || statusText );
+ jqXHR.statusText = ( nativeStatusText || statusText ) + "";
// Success/Error
if ( isSuccess ) {
}
} else {
tmp = map[ jqXHR.status ];
- jqXHR.then( tmp, tmp );
+ jqXHR.always( tmp );
}
}
return this;
s.url = ( ( url || s.url ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
// Extract dataTypes list
- s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().split( rspacesAjax );
+ s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().split( core_rspace );
- // Determine if a cross-domain request is in order
+ // A cross-domain request is in order when we have a protocol:host:port mismatch
if ( s.crossDomain == null ) {
- parts = rurl.exec( s.url.toLowerCase() );
- s.crossDomain = !!( parts &&
- ( parts[ 1 ] != ajaxLocParts[ 1 ] || parts[ 2 ] != ajaxLocParts[ 2 ] ||
- ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? 80 : 443 ) ) !=
- ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? 80 : 443 ) ) )
- );
+ parts = rurl.exec( s.url.toLowerCase() ) || false;
+ s.crossDomain = parts && ( parts.join(":") + ( parts[ 3 ] ? "" : parts[ 1 ] === "http:" ? 80 : 443 ) ) !==
+ ( ajaxLocParts.join(":") + ( ajaxLocParts[ 3 ] ? "" : ajaxLocParts[ 1 ] === "http:" ? 80 : 443 ) );
}
// Convert data if not already a string
// Apply prefilters
inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
- // If request was aborted inside a prefiler, stop there
+ // If request was aborted inside a prefilter, stop there
if ( state === 2 ) {
- return false;
+ return jqXHR;
}
// We can fire global events as of now if asked to
// Allow custom headers/mimetypes and early abort
if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
- // Abort if not done already
- jqXHR.abort();
- return false;
+ // Abort if not done already and return
+ return jqXHR.abort();
}
+ // aborting is no longer a cancellation
+ strAbort = "abort";
+
// Install callbacks on deferreds
for ( i in { success: 1, error: 1, complete: 1 } ) {
jqXHR[ i ]( s[ i ] );
return jqXHR;
},
- // Serialize an array of form elements or a set of
- // key/values into a query string
- param: function( a, traditional ) {
- var s = [],
- add = function( key, value ) {
- // If value is a function, invoke it and return its value
- value = jQuery.isFunction( value ) ? value() : value;
- s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
- };
-
- // Set traditional to true for jQuery <= 1.3.2 behavior.
- if ( traditional === undefined ) {
- traditional = jQuery.ajaxSettings.traditional;
- }
-
- // If an array was passed in, assume that it is an array of form elements.
- if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
- // Serialize the form elements
- jQuery.each( a, function() {
- add( this.name, this.value );
- });
-
- } else {
- // If traditional, encode the "old" way (the way 1.3.2 or older
- // did it), otherwise encode params recursively.
- for ( var prefix in a ) {
- buildParams( prefix, a[ prefix ], traditional, add );
- }
- }
-
- // Return the resulting serialization
- return s.join( "&" ).replace( r20, "+" );
- }
-});
-
-function buildParams( prefix, obj, traditional, add ) {
- if ( jQuery.isArray( obj ) ) {
- // Serialize array item.
- jQuery.each( obj, function( i, v ) {
- if ( traditional || rbracket.test( prefix ) ) {
- // Treat each array item as a scalar.
- add( prefix, v );
-
- } else {
- // If array item is non-scalar (array or object), encode its
- // numeric index to resolve deserialization ambiguity issues.
- // Note that rack (as of 1.0.0) can't currently deserialize
- // nested arrays properly, and attempting to do so may cause
- // a server error. Possible fixes are to modify rack's
- // deserialization algorithm or to provide an option or flag
- // to force array serialization to be shallow.
- buildParams( prefix + "[" + ( typeof v === "object" || jQuery.isArray(v) ? i : "" ) + "]", v, traditional, add );
- }
- });
-
- } else if ( !traditional && obj != null && typeof obj === "object" ) {
- // Serialize object item.
- for ( var name in obj ) {
- buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
- }
-
- } else {
- // Serialize scalar item.
- add( prefix, obj );
- }
-}
-
-// This is still on the jQuery object... for now
-// Want to move this to jQuery.ajax some day
-jQuery.extend({
-
// Counter for holding the number of active queries
active: 0,
*/
function ajaxHandleResponses( s, jqXHR, responses ) {
- var contents = s.contents,
+ var ct, type, finalDataType, firstDataType,
+ contents = s.contents,
dataTypes = s.dataTypes,
- responseFields = s.responseFields,
- ct,
- type,
- finalDataType,
- firstDataType;
+ responseFields = s.responseFields;
// Fill responseXXX fields
for ( type in responseFields ) {
// Chain conversions given the request and the original response
function ajaxConvert( s, response ) {
+ var conv, conv2, current, tmp,
+ // Work with a copy of dataTypes in case we need to modify it for conversion
+ dataTypes = s.dataTypes.slice(),
+ prev = dataTypes[ 0 ],
+ converters = {},
+ i = 0;
+
// Apply the dataFilter if provided
if ( s.dataFilter ) {
response = s.dataFilter( response, s.dataType );
}
- var dataTypes = s.dataTypes,
- converters = {},
- i,
- key,
- length = dataTypes.length,
- tmp,
- // Current and previous dataTypes
- current = dataTypes[ 0 ],
- prev,
- // Conversion expression
- conversion,
- // Conversion function
- conv,
- // Conversion functions (transitive conversion)
- conv1,
- conv2;
-
- // For each dataType in the chain
- for ( i = 1; i < length; i++ ) {
-
- // Create converters map
- // with lowercased keys
- if ( i === 1 ) {
- for ( key in s.converters ) {
- if ( typeof key === "string" ) {
- converters[ key.toLowerCase() ] = s.converters[ key ];
- }
- }
- }
-
- // Get the dataTypes
- prev = current;
- current = dataTypes[ i ];
-
- // If current is auto dataType, update it to prev
- if ( current === "*" ) {
- current = prev;
- // If no auto and dataTypes are actually different
- } else if ( prev !== "*" && prev !== current ) {
-
- // Get the converter
- conversion = prev + " " + current;
- conv = converters[ conversion ] || converters[ "* " + current ];
-
- // If there is no direct converter, search transitively
- if ( !conv ) {
- conv2 = undefined;
- for ( conv1 in converters ) {
- tmp = conv1.split( " " );
- if ( tmp[ 0 ] === prev || tmp[ 0 ] === "*" ) {
- conv2 = converters[ tmp[1] + " " + current ];
- if ( conv2 ) {
- conv1 = converters[ conv1 ];
- if ( conv1 === true ) {
- conv = conv2;
- } else if ( conv2 === true ) {
- conv = conv1;
+ // Create converters map with lowercased keys
+ if ( dataTypes[ 1 ] ) {
+ for ( conv in s.converters ) {
+ converters[ conv.toLowerCase() ] = s.converters[ conv ];
+ }
+ }
+
+ // Convert to each sequential dataType, tolerating list modification
+ for ( ; (current = dataTypes[++i]); ) {
+
+ // There's only work to do if current dataType is non-auto
+ if ( current !== "*" ) {
+
+ // Convert response if prev dataType is non-auto and differs from current
+ if ( prev !== "*" && prev !== current ) {
+
+ // Seek a direct converter
+ conv = converters[ prev + " " + current ] || converters[ "* " + current ];
+
+ // If none found, seek a pair
+ if ( !conv ) {
+ for ( conv2 in converters ) {
+
+ // If conv2 outputs current
+ tmp = conv2.split(" ");
+ if ( tmp[ 1 ] === current ) {
+
+ // If prev can be converted to accepted input
+ conv = converters[ prev + " " + tmp[ 0 ] ] ||
+ converters[ "* " + tmp[ 0 ] ];
+ if ( conv ) {
+ // Condense equivalence converters
+ if ( conv === true ) {
+ conv = converters[ conv2 ];
+
+ // Otherwise, insert the intermediate dataType
+ } else if ( converters[ conv2 ] !== true ) {
+ current = tmp[ 0 ];
+ dataTypes.splice( i--, 0, current );
+ }
+
+ break;
}
- break;
}
}
}
- }
- // If we found no converter, dispatch an error
- if ( !( conv || conv2 ) ) {
- jQuery.error( "No conversion from " + conversion.replace(" "," to ") );
- }
- // If found converter is not an equivalence
- if ( conv !== true ) {
- // Convert with 1 or 2 converters accordingly
- response = conv ? conv( response ) : conv2( conv1(response) );
- }
- }
- }
- return response;
-}
+ // Apply converter (if not an equivalence)
+ if ( conv !== true ) {
+ // Unless errors are allowed to bubble, catch and return them
+ if ( conv && s["throws"] ) {
+ response = conv( response );
+ } else {
+ try {
+ response = conv( response );
+ } catch ( e ) {
+ return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current };
+ }
+ }
+ }
+ }
+ // Update prev for next iteration
+ prev = current;
+ }
+ }
-var jsc = jQuery.now(),
- jsre = /(\=)\?(&|$)|\?\?/i;
+ return { state: "success", data: response };
+}
+var oldCallbacks = [],
+ rquestion = /\?/,
+ rjsonp = /(=)\?(?=&|$)|\?\?/,
+ nonce = jQuery.now();
// Default jsonp settings
jQuery.ajaxSetup({
jsonp: "callback",
jsonpCallback: function() {
- return jQuery.expando + "_" + ( jsc++ );
+ var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) );
+ this[ callback ] = true;
+ return callback;
}
});
// Detect, normalize options and install callbacks for jsonp requests
jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
- var inspectData = s.contentType === "application/x-www-form-urlencoded" &&
- ( typeof s.data === "string" );
-
- if ( s.dataTypes[ 0 ] === "jsonp" ||
- s.jsonp !== false && ( jsre.test( s.url ) ||
- inspectData && jsre.test( s.data ) ) ) {
-
- var responseContainer,
- jsonpCallback = s.jsonpCallback =
- jQuery.isFunction( s.jsonpCallback ) ? s.jsonpCallback() : s.jsonpCallback,
- previous = window[ jsonpCallback ],
- url = s.url,
- data = s.data,
- replace = "$1" + jsonpCallback + "$2";
+ var callbackName, overwritten, responseContainer,
+ data = s.data,
+ url = s.url,
+ hasCallback = s.jsonp !== false,
+ replaceInUrl = hasCallback && rjsonp.test( url ),
+ replaceInData = hasCallback && !replaceInUrl && typeof data === "string" &&
+ !( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") &&
+ rjsonp.test( data );
+
+ // Handle iff the expected data type is "jsonp" or we have a parameter to set
+ if ( s.dataTypes[ 0 ] === "jsonp" || replaceInUrl || replaceInData ) {
+
+ // Get callback name, remembering preexisting value associated with it
+ callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ?
+ s.jsonpCallback() :
+ s.jsonpCallback;
+ overwritten = window[ callbackName ];
+
+ // Insert callback into url or form data
+ if ( replaceInUrl ) {
+ s.url = url.replace( rjsonp, "$1" + callbackName );
+ } else if ( replaceInData ) {
+ s.data = data.replace( rjsonp, "$1" + callbackName );
+ } else if ( hasCallback ) {
+ s.url += ( rquestion.test( url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
+ }
- if ( s.jsonp !== false ) {
- url = url.replace( jsre, replace );
- if ( s.url === url ) {
- if ( inspectData ) {
- data = data.replace( jsre, replace );
- }
- if ( s.data === data ) {
- // Add callback manually
- url += (/\?/.test( url ) ? "&" : "?") + s.jsonp + "=" + jsonpCallback;
- }
+ // Use data converter to retrieve json after script execution
+ s.converters["script json"] = function() {
+ if ( !responseContainer ) {
+ jQuery.error( callbackName + " was not called" );
}
- }
+ return responseContainer[ 0 ];
+ };
- s.url = url;
- s.data = data;
+ // force json dataType
+ s.dataTypes[ 0 ] = "json";
// Install callback
- window[ jsonpCallback ] = function( response ) {
- responseContainer = [ response ];
+ window[ callbackName ] = function() {
+ responseContainer = arguments;
};
- // Clean-up function
+ // Clean-up function (fires after converters)
jqXHR.always(function() {
- // Set callback back to previous value
- window[ jsonpCallback ] = previous;
- // Call if it was a function and we have a response
- if ( responseContainer && jQuery.isFunction( previous ) ) {
- window[ jsonpCallback ]( responseContainer[ 0 ] );
+ // Restore preexisting value
+ window[ callbackName ] = overwritten;
+
+ // Save back as free
+ if ( s[ callbackName ] ) {
+ // make sure that re-using the options doesn't screw things around
+ s.jsonpCallback = originalSettings.jsonpCallback;
+
+ // save the callback name for future use
+ oldCallbacks.push( callbackName );
}
- });
- // Use data converter to retrieve json after script execution
- s.converters["script json"] = function() {
- if ( !responseContainer ) {
- jQuery.error( jsonpCallback + " was not called" );
+ // Call if it was a function and we have a response
+ if ( responseContainer && jQuery.isFunction( overwritten ) ) {
+ overwritten( responseContainer[ 0 ] );
}
- return responseContainer[ 0 ];
- };
- // force json dataType
- s.dataTypes[ 0 ] = "json";
+ responseContainer = overwritten = undefined;
+ });
// Delegate to script
return "script";
}
});
-
-
-
-
// Install script dataType
jQuery.ajaxSetup({
accepts: {
};
}
});
-
-
-
-
-var // #5280: Internet Explorer will keep connections alive if we don't abort on unload
+var xhrCallbacks,
+ // #5280: Internet Explorer will keep connections alive if we don't abort on unload
xhrOnUnloadAbort = window.ActiveXObject ? function() {
// Abort all pending requests
for ( var key in xhrCallbacks ) {
xhrCallbacks[ key ]( 0, 1 );
}
} : false,
- xhrId = 0,
- xhrCallbacks;
+ xhrId = 0;
// Functions to create xhrs
function createStandardXHR() {
send: function( headers, complete ) {
// Get a new xhr
- var xhr = s.xhr(),
- handle,
- i;
+ var handle, i,
+ xhr = s.xhr();
// Open the socket
// Passing null username, generates a login popup on Opera (#2865)
xml;
// Firefox throws exceptions when accessing properties
- // of an xhr when a network error occured
+ // of an xhr when a network error occurred
// http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE)
try {
if ( xml && xml.documentElement /* #4958 */ ) {
responses.xml = xml;
}
- responses.text = xhr.responseText;
+
+ // When requesting binary data, IE6-9 will throw an exception
+ // on any attempt to access responseText (#11426)
+ try {
+ responses.text = xhr.responseText;
+ } catch( _ ) {
+ }
// Firefox throws an exception when accessing
// statusText for faulty cross-domain requests
}
};
- // if we're in sync mode or it's in cache
- // and has been retrieved directly (IE6 & IE7)
- // we need to manually fire the callback
- if ( !s.async || xhr.readyState === 4 ) {
+ if ( !s.async ) {
+ // if we're in sync mode we fire the callback
callback();
+ } else if ( xhr.readyState === 4 ) {
+ // (IE6 & IE7) if it's in cache and has been
+ // retrieved directly we need to fire the callback
+ setTimeout( callback, 0 );
} else {
handle = ++xhrId;
if ( xhrOnUnloadAbort ) {
}
});
}
-
-
-
-
-var elemdisplay = {},
- iframe, iframeDoc,
+var fxNow, timerId,
rfxtypes = /^(?:toggle|show|hide)$/,
- rfxnum = /^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,
- timerId,
- fxAttrs = [
- // height animations
- [ "height", "marginTop", "marginBottom", "paddingTop", "paddingBottom" ],
- // width animations
- [ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ],
- // opacity animations
- [ "opacity" ]
- ],
- fxNow;
-
-jQuery.fn.extend({
- show: function( speed, easing, callback ) {
- var elem, display;
-
- if ( speed || speed === 0 ) {
- return this.animate( genFx("show", 3), speed, easing, callback );
-
- } else {
- for ( var i = 0, j = this.length; i < j; i++ ) {
- elem = this[ i ];
+ rfxnum = new RegExp( "^(?:([-+])=|)(" + core_pnum + ")([a-z%]*)$", "i" ),
+ rrun = /queueHooks$/,
+ animationPrefilters = [ defaultPrefilter ],
+ tweeners = {
+ "*": [function( prop, value ) {
+ var end, unit,
+ tween = this.createTween( prop, value ),
+ parts = rfxnum.exec( value ),
+ target = tween.cur(),
+ start = +target || 0,
+ scale = 1,
+ maxIterations = 20;
+
+ if ( parts ) {
+ end = +parts[2];
+ unit = parts[3] || ( jQuery.cssNumber[ prop ] ? "" : "px" );
+
+ // We need to compute starting value
+ if ( unit !== "px" && start ) {
+ // Iteratively approximate from a nonzero starting point
+ // Prefer the current property, because this process will be trivial if it uses the same units
+ // Fallback to end or a simple constant
+ start = jQuery.css( tween.elem, prop, true ) || end || 1;
+
+ do {
+ // If previous iteration zeroed out, double until we get *something*
+ // Use a string for doubling factor so we don't accidentally see scale as unchanged below
+ scale = scale || ".5";
+
+ // Adjust and apply
+ start = start / scale;
+ jQuery.style( tween.elem, prop, start + unit );
+
+ // Update scale, tolerating zero or NaN from tween.cur()
+ // And breaking the loop if scale is unchanged or perfect, or if we've just had enough
+ } while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations );
+ }
+
+ tween.unit = unit;
+ tween.start = start;
+ // If a +=/-= token was provided, we're doing a relative animation
+ tween.end = parts[1] ? start + ( parts[1] + 1 ) * end : end;
+ }
+ return tween;
+ }]
+ };
- if ( elem.style ) {
- display = elem.style.display;
+// Animations created synchronously will run synchronously
+function createFxNow() {
+ setTimeout(function() {
+ fxNow = undefined;
+ }, 0 );
+ return ( fxNow = jQuery.now() );
+}
- // Reset the inline display of this element to learn if it is
- // being hidden by cascaded rules or not
- if ( !jQuery._data(elem, "olddisplay") && display === "none" ) {
- display = elem.style.display = "";
- }
+function createTweens( animation, props ) {
+ jQuery.each( props, function( prop, value ) {
+ var collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ),
+ index = 0,
+ length = collection.length;
+ for ( ; index < length; index++ ) {
+ if ( collection[ index ].call( animation, prop, value ) ) {
- // Set elements which have been overridden with display: none
- // in a stylesheet to whatever the default browser style is
- // for such an element
- if ( display === "" && jQuery.css(elem, "display") === "none" ) {
- jQuery._data( elem, "olddisplay", defaultDisplay(elem.nodeName) );
- }
- }
+ // we're done with this property
+ return;
}
+ }
+ });
+}
- // Set the display of most of the elements in a second loop
- // to avoid the constant reflow
- for ( i = 0; i < j; i++ ) {
- elem = this[ i ];
+function Animation( elem, properties, options ) {
+ var result,
+ index = 0,
+ tweenerIndex = 0,
+ length = animationPrefilters.length,
+ deferred = jQuery.Deferred().always( function() {
+ // don't match elem in the :animated selector
+ delete tick.elem;
+ }),
+ tick = function() {
+ var currentTime = fxNow || createFxNow(),
+ remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
+ percent = 1 - ( remaining / animation.duration || 0 ),
+ index = 0,
+ length = animation.tweens.length;
+
+ for ( ; index < length ; index++ ) {
+ animation.tweens[ index ].run( percent );
+ }
+
+ deferred.notifyWith( elem, [ animation, percent, remaining ]);
+
+ if ( percent < 1 && length ) {
+ return remaining;
+ } else {
+ deferred.resolveWith( elem, [ animation ] );
+ return false;
+ }
+ },
+ animation = deferred.promise({
+ elem: elem,
+ props: jQuery.extend( {}, properties ),
+ opts: jQuery.extend( true, { specialEasing: {} }, options ),
+ originalProperties: properties,
+ originalOptions: options,
+ startTime: fxNow || createFxNow(),
+ duration: options.duration,
+ tweens: [],
+ createTween: function( prop, end, easing ) {
+ var tween = jQuery.Tween( elem, animation.opts, prop, end,
+ animation.opts.specialEasing[ prop ] || animation.opts.easing );
+ animation.tweens.push( tween );
+ return tween;
+ },
+ stop: function( gotoEnd ) {
+ var index = 0,
+ // if we are going to the end, we want to run all the tweens
+ // otherwise we skip this part
+ length = gotoEnd ? animation.tweens.length : 0;
- if ( elem.style ) {
- display = elem.style.display;
+ for ( ; index < length ; index++ ) {
+ animation.tweens[ index ].run( 1 );
+ }
- if ( display === "" || display === "none" ) {
- elem.style.display = jQuery._data( elem, "olddisplay" ) || "";
- }
+ // resolve when we played the last frame
+ // otherwise, reject
+ if ( gotoEnd ) {
+ deferred.resolveWith( elem, [ animation, gotoEnd ] );
+ } else {
+ deferred.rejectWith( elem, [ animation, gotoEnd ] );
}
+ return this;
}
+ }),
+ props = animation.props;
- return this;
+ propFilter( props, animation.opts.specialEasing );
+
+ for ( ; index < length ; index++ ) {
+ result = animationPrefilters[ index ].call( animation, elem, props, animation.opts );
+ if ( result ) {
+ return result;
}
- },
+ }
- hide: function( speed, easing, callback ) {
- if ( speed || speed === 0 ) {
- return this.animate( genFx("hide", 3), speed, easing, callback);
+ createTweens( animation, props );
- } else {
- var elem, display,
- i = 0,
- j = this.length;
+ if ( jQuery.isFunction( animation.opts.start ) ) {
+ animation.opts.start.call( elem, animation );
+ }
- for ( ; i < j; i++ ) {
- elem = this[i];
- if ( elem.style ) {
- display = jQuery.css( elem, "display" );
+ jQuery.fx.timer(
+ jQuery.extend( tick, {
+ anim: animation,
+ queue: animation.opts.queue,
+ elem: elem
+ })
+ );
- if ( display !== "none" && !jQuery._data( elem, "olddisplay" ) ) {
- jQuery._data( elem, "olddisplay", display );
- }
- }
- }
+ // attach callbacks from options
+ return animation.progress( animation.opts.progress )
+ .done( animation.opts.done, animation.opts.complete )
+ .fail( animation.opts.fail )
+ .always( animation.opts.always );
+}
- // Set the display of the elements in a second loop
- // to avoid the constant reflow
- for ( i = 0; i < j; i++ ) {
- if ( this[i].style ) {
- this[i].style.display = "none";
- }
- }
+function propFilter( props, specialEasing ) {
+ var index, name, easing, value, hooks;
- return this;
+ // camelCase, specialEasing and expand cssHook pass
+ for ( index in props ) {
+ name = jQuery.camelCase( index );
+ easing = specialEasing[ name ];
+ value = props[ index ];
+ if ( jQuery.isArray( value ) ) {
+ easing = value[ 1 ];
+ value = props[ index ] = value[ 0 ];
}
- },
- // Save the old toggle function
- _toggle: jQuery.fn.toggle,
+ if ( index !== name ) {
+ props[ name ] = value;
+ delete props[ index ];
+ }
- toggle: function( fn, fn2, callback ) {
- var bool = typeof fn === "boolean";
+ hooks = jQuery.cssHooks[ name ];
+ if ( hooks && "expand" in hooks ) {
+ value = hooks.expand( value );
+ delete props[ name ];
- if ( jQuery.isFunction(fn) && jQuery.isFunction(fn2) ) {
- this._toggle.apply( this, arguments );
+ // not quite $.extend, this wont overwrite keys already present.
+ // also - reusing 'index' from above because we have the correct "name"
+ for ( index in value ) {
+ if ( !( index in props ) ) {
+ props[ index ] = value[ index ];
+ specialEasing[ index ] = easing;
+ }
+ }
+ } else {
+ specialEasing[ name ] = easing;
+ }
+ }
+}
- } else if ( fn == null || bool ) {
- this.each(function() {
- var state = bool ? fn : jQuery(this).is(":hidden");
- jQuery(this)[ state ? "show" : "hide" ]();
- });
+jQuery.Animation = jQuery.extend( Animation, {
+ tweener: function( props, callback ) {
+ if ( jQuery.isFunction( props ) ) {
+ callback = props;
+ props = [ "*" ];
} else {
- this.animate(genFx("toggle", 3), fn, fn2, callback);
+ props = props.split(" ");
}
- return this;
- },
+ var prop,
+ index = 0,
+ length = props.length;
- fadeTo: function( speed, to, easing, callback ) {
- return this.filter(":hidden").css("opacity", 0).show().end()
- .animate({opacity: to}, speed, easing, callback);
+ for ( ; index < length ; index++ ) {
+ prop = props[ index ];
+ tweeners[ prop ] = tweeners[ prop ] || [];
+ tweeners[ prop ].unshift( callback );
+ }
},
- animate: function( prop, speed, easing, callback ) {
- var optall = jQuery.speed( speed, easing, callback );
+ prefilter: function( callback, prepend ) {
+ if ( prepend ) {
+ animationPrefilters.unshift( callback );
+ } else {
+ animationPrefilters.push( callback );
+ }
+ }
+});
- if ( jQuery.isEmptyObject( prop ) ) {
- return this.each( optall.complete, [ false ] );
+function defaultPrefilter( elem, props, opts ) {
+ var index, prop, value, length, dataShow, tween, hooks, oldfire,
+ anim = this,
+ style = elem.style,
+ orig = {},
+ handled = [],
+ hidden = elem.nodeType && isHidden( elem );
+
+ // handle queue: false promises
+ if ( !opts.queue ) {
+ hooks = jQuery._queueHooks( elem, "fx" );
+ if ( hooks.unqueued == null ) {
+ hooks.unqueued = 0;
+ oldfire = hooks.empty.fire;
+ hooks.empty.fire = function() {
+ if ( !hooks.unqueued ) {
+ oldfire();
+ }
+ };
}
+ hooks.unqueued++;
+
+ anim.always(function() {
+ // doing this makes sure that the complete handler will be called
+ // before this completes
+ anim.always(function() {
+ hooks.unqueued--;
+ if ( !jQuery.queue( elem, "fx" ).length ) {
+ hooks.empty.fire();
+ }
+ });
+ });
+ }
+
+ // height/width overflow pass
+ if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) {
+ // Make sure that nothing sneaks out
+ // Record all 3 overflow attributes because IE does not
+ // change the overflow attribute when overflowX and
+ // overflowY are set to the same value
+ opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
- // Do not change referenced properties as per-property easing will be lost
- prop = jQuery.extend( {}, prop );
+ // Set display property to inline-block for height/width
+ // animations on inline elements that are having width/height animated
+ if ( jQuery.css( elem, "display" ) === "inline" &&
+ jQuery.css( elem, "float" ) === "none" ) {
- function doAnimation() {
- // XXX 'this' does not always have a nodeName when running the
- // test suite
+ // inline-level elements accept inline-block;
+ // block-level elements need to be inline with layout
+ if ( !jQuery.support.inlineBlockNeedsLayout || css_defaultDisplay( elem.nodeName ) === "inline" ) {
+ style.display = "inline-block";
- if ( optall.queue === false ) {
- jQuery._mark( this );
+ } else {
+ style.zoom = 1;
}
+ }
+ }
+
+ if ( opts.overflow ) {
+ style.overflow = "hidden";
+ if ( !jQuery.support.shrinkWrapBlocks ) {
+ anim.done(function() {
+ style.overflow = opts.overflow[ 0 ];
+ style.overflowX = opts.overflow[ 1 ];
+ style.overflowY = opts.overflow[ 2 ];
+ });
+ }
+ }
- var opt = jQuery.extend( {}, optall ),
- isElement = this.nodeType === 1,
- hidden = isElement && jQuery(this).is(":hidden"),
- name, val, p, e,
- parts, start, end, unit,
- method;
- // will store per property easing and be used to determine when an animation is complete
- opt.animatedProperties = {};
+ // show/hide pass
+ for ( index in props ) {
+ value = props[ index ];
+ if ( rfxtypes.exec( value ) ) {
+ delete props[ index ];
+ if ( value === ( hidden ? "hide" : "show" ) ) {
+ continue;
+ }
+ handled.push( index );
+ }
+ }
- for ( p in prop ) {
+ length = handled.length;
+ if ( length ) {
+ dataShow = jQuery._data( elem, "fxshow" ) || jQuery._data( elem, "fxshow", {} );
+ if ( hidden ) {
+ jQuery( elem ).show();
+ } else {
+ anim.done(function() {
+ jQuery( elem ).hide();
+ });
+ }
+ anim.done(function() {
+ var prop;
+ jQuery.removeData( elem, "fxshow", true );
+ for ( prop in orig ) {
+ jQuery.style( elem, prop, orig[ prop ] );
+ }
+ });
+ for ( index = 0 ; index < length ; index++ ) {
+ prop = handled[ index ];
+ tween = anim.createTween( prop, hidden ? dataShow[ prop ] : 0 );
+ orig[ prop ] = dataShow[ prop ] || jQuery.style( elem, prop );
- // property name normalization
- name = jQuery.camelCase( p );
- if ( p !== name ) {
- prop[ name ] = prop[ p ];
- delete prop[ p ];
+ if ( !( prop in dataShow ) ) {
+ dataShow[ prop ] = tween.start;
+ if ( hidden ) {
+ tween.end = tween.start;
+ tween.start = prop === "width" || prop === "height" ? 1 : 0;
}
+ }
+ }
+ }
+}
- val = prop[ name ];
+function Tween( elem, options, prop, end, easing ) {
+ return new Tween.prototype.init( elem, options, prop, end, easing );
+}
+jQuery.Tween = Tween;
- // easing resolution: per property > opt.specialEasing > opt.easing > 'swing' (default)
- if ( jQuery.isArray( val ) ) {
- opt.animatedProperties[ name ] = val[ 1 ];
- val = prop[ name ] = val[ 0 ];
- } else {
- opt.animatedProperties[ name ] = opt.specialEasing && opt.specialEasing[ name ] || opt.easing || 'swing';
- }
+Tween.prototype = {
+ constructor: Tween,
+ init: function( elem, options, prop, end, easing, unit ) {
+ this.elem = elem;
+ this.prop = prop;
+ this.easing = easing || "swing";
+ this.options = options;
+ this.start = this.now = this.cur();
+ this.end = end;
+ this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );
+ },
+ cur: function() {
+ var hooks = Tween.propHooks[ this.prop ];
- if ( val === "hide" && hidden || val === "show" && !hidden ) {
- return opt.complete.call( this );
- }
+ return hooks && hooks.get ?
+ hooks.get( this ) :
+ Tween.propHooks._default.get( this );
+ },
+ run: function( percent ) {
+ var eased,
+ hooks = Tween.propHooks[ this.prop ];
- if ( isElement && ( name === "height" || name === "width" ) ) {
- // Make sure that nothing sneaks out
- // Record all 3 overflow attributes because IE does not
- // change the overflow attribute when overflowX and
- // overflowY are set to the same value
- opt.overflow = [ this.style.overflow, this.style.overflowX, this.style.overflowY ];
+ if ( this.options.duration ) {
+ this.pos = eased = jQuery.easing[ this.easing ](
+ percent, this.options.duration * percent, 0, 1, this.options.duration
+ );
+ } else {
+ this.pos = eased = percent;
+ }
+ this.now = ( this.end - this.start ) * eased + this.start;
- // Set display property to inline-block for height/width
- // animations on inline elements that are having width/height animated
- if ( jQuery.css( this, "display" ) === "inline" &&
- jQuery.css( this, "float" ) === "none" ) {
+ if ( this.options.step ) {
+ this.options.step.call( this.elem, this.now, this );
+ }
- // inline-level elements accept inline-block;
- // block-level elements need to be inline with layout
- if ( !jQuery.support.inlineBlockNeedsLayout || defaultDisplay( this.nodeName ) === "inline" ) {
- this.style.display = "inline-block";
+ if ( hooks && hooks.set ) {
+ hooks.set( this );
+ } else {
+ Tween.propHooks._default.set( this );
+ }
+ return this;
+ }
+};
- } else {
- this.style.zoom = 1;
- }
- }
- }
+Tween.prototype.init.prototype = Tween.prototype;
+
+Tween.propHooks = {
+ _default: {
+ get: function( tween ) {
+ var result;
+
+ if ( tween.elem[ tween.prop ] != null &&
+ (!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) {
+ return tween.elem[ tween.prop ];
}
- if ( opt.overflow != null ) {
- this.style.overflow = "hidden";
+ // passing any value as a 4th parameter to .css will automatically
+ // attempt a parseFloat and fallback to a string if the parse fails
+ // so, simple values such as "10px" are parsed to Float.
+ // complex values such as "rotate(1rad)" are returned as is.
+ result = jQuery.css( tween.elem, tween.prop, false, "" );
+ // Empty strings, null, undefined and "auto" are converted to 0.
+ return !result || result === "auto" ? 0 : result;
+ },
+ set: function( tween ) {
+ // use step hook for back compat - use cssHook if its there - use .style if its
+ // available and use plain properties where available
+ if ( jQuery.fx.step[ tween.prop ] ) {
+ jQuery.fx.step[ tween.prop ]( tween );
+ } else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) {
+ jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
+ } else {
+ tween.elem[ tween.prop ] = tween.now;
}
+ }
+ }
+};
- for ( p in prop ) {
- e = new jQuery.fx( this, opt, p );
- val = prop[ p ];
+// Remove in 2.0 - this supports IE8's panic based approach
+// to setting things on disconnected nodes
- if ( rfxtypes.test( val ) ) {
+Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
+ set: function( tween ) {
+ if ( tween.elem.nodeType && tween.elem.parentNode ) {
+ tween.elem[ tween.prop ] = tween.now;
+ }
+ }
+};
- // Tracks whether to show or hide based on private
- // data attached to the element
- method = jQuery._data( this, "toggle" + p ) || ( val === "toggle" ? hidden ? "show" : "hide" : 0 );
- if ( method ) {
- jQuery._data( this, "toggle" + p, method === "show" ? "hide" : "show" );
- e[ method ]();
- } else {
- e[ val ]();
- }
+jQuery.each([ "toggle", "show", "hide" ], function( i, name ) {
+ var cssFn = jQuery.fn[ name ];
+ jQuery.fn[ name ] = function( speed, easing, callback ) {
+ return speed == null || typeof speed === "boolean" ||
+ // special check for .toggle( handler, handler, ... )
+ ( !i && jQuery.isFunction( speed ) && jQuery.isFunction( easing ) ) ?
+ cssFn.apply( this, arguments ) :
+ this.animate( genFx( name, true ), speed, easing, callback );
+ };
+});
- } else {
- parts = rfxnum.exec( val );
- start = e.cur();
-
- if ( parts ) {
- end = parseFloat( parts[2] );
- unit = parts[3] || ( jQuery.cssNumber[ p ] ? "" : "px" );
-
- // We need to compute starting value
- if ( unit !== "px" ) {
- jQuery.style( this, p, (end || 1) + unit);
- start = ( (end || 1) / e.cur() ) * start;
- jQuery.style( this, p, start + unit);
- }
+jQuery.fn.extend({
+ fadeTo: function( speed, to, easing, callback ) {
- // If a +=/-= token was provided, we're doing a relative animation
- if ( parts[1] ) {
- end = ( (parts[ 1 ] === "-=" ? -1 : 1) * end ) + start;
- }
+ // show any hidden elements after setting opacity to 0
+ return this.filter( isHidden ).css( "opacity", 0 ).show()
- e.custom( start, end, unit );
+ // animate to the value specified
+ .end().animate({ opacity: to }, speed, easing, callback );
+ },
+ animate: function( prop, speed, easing, callback ) {
+ var empty = jQuery.isEmptyObject( prop ),
+ optall = jQuery.speed( speed, easing, callback ),
+ doAnimation = function() {
+ // Operate on a copy of prop so per-property easing won't be lost
+ var anim = Animation( this, jQuery.extend( {}, prop ), optall );
- } else {
- e.custom( start, val, "" );
- }
+ // Empty animations resolve immediately
+ if ( empty ) {
+ anim.stop( true );
}
- }
-
- // For JS strict compliance
- return true;
- }
+ };
- return optall.queue === false ?
+ return empty || optall.queue === false ?
this.each( doAnimation ) :
this.queue( optall.queue, doAnimation );
},
-
stop: function( type, clearQueue, gotoEnd ) {
+ var stopQueue = function( hooks ) {
+ var stop = hooks.stop;
+ delete hooks.stop;
+ stop( gotoEnd );
+ };
+
if ( typeof type !== "string" ) {
gotoEnd = clearQueue;
clearQueue = type;
}
return this.each(function() {
- var index,
- hadTimers = false,
+ var dequeue = true,
+ index = type != null && type + "queueHooks",
timers = jQuery.timers,
data = jQuery._data( this );
- // clear marker counters if we know they won't be
- if ( !gotoEnd ) {
- jQuery._unmark( true, this );
- }
-
- function stopQueue( elem, data, index ) {
- var hooks = data[ index ];
- jQuery.removeData( elem, index, true );
- hooks.stop( gotoEnd );
- }
-
- if ( type == null ) {
+ if ( index ) {
+ if ( data[ index ] && data[ index ].stop ) {
+ stopQueue( data[ index ] );
+ }
+ } else {
for ( index in data ) {
- if ( data[ index ] && data[ index ].stop && index.indexOf(".run") === index.length - 4 ) {
- stopQueue( this, data, index );
+ if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
+ stopQueue( data[ index ] );
}
}
- } else if ( data[ index = type + ".run" ] && data[ index ].stop ){
- stopQueue( this, data, index );
}
for ( index = timers.length; index--; ) {
if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) {
- if ( gotoEnd ) {
-
- // force the next step to be the last
- timers[ index ]( true );
- } else {
- timers[ index ].saveState();
- }
- hadTimers = true;
+ timers[ index ].anim.stop( gotoEnd );
+ dequeue = false;
timers.splice( index, 1 );
}
}
// start the next in the queue if the last step wasn't forced
// timers currently will call their complete callbacks, which will dequeue
// but only if they were gotoEnd
- if ( !( gotoEnd && hadTimers ) ) {
+ if ( dequeue || !gotoEnd ) {
jQuery.dequeue( this, type );
}
});
}
-
});
-// Animations created synchronously will run synchronously
-function createFxNow() {
- setTimeout( clearFxNow, 0 );
- return ( fxNow = jQuery.now() );
-}
-
-function clearFxNow() {
- fxNow = undefined;
-}
-
// Generate parameters to create a standard animation
-function genFx( type, num ) {
- var obj = {};
+function genFx( type, includeWidth ) {
+ var which,
+ attrs = { height: type },
+ i = 0;
+
+ // if we include width, step value is 1 to do all cssExpand values,
+ // if we don't include width, step value is 2 to skip over Left and Right
+ includeWidth = includeWidth? 1 : 0;
+ for( ; i < 4 ; i += 2 - includeWidth ) {
+ which = cssExpand[ i ];
+ attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
+ }
- jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice( 0, num )), function() {
- obj[ this ] = type;
- });
+ if ( includeWidth ) {
+ attrs.opacity = attrs.width = type;
+ }
- return obj;
+ return attrs;
}
// Generate shortcuts for custom animations
jQuery.each({
- slideDown: genFx( "show", 1 ),
- slideUp: genFx( "hide", 1 ),
- slideToggle: genFx( "toggle", 1 ),
+ slideDown: genFx("show"),
+ slideUp: genFx("hide"),
+ slideToggle: genFx("toggle"),
fadeIn: { opacity: "show" },
fadeOut: { opacity: "hide" },
fadeToggle: { opacity: "toggle" }
};
});
-jQuery.extend({
- speed: function( speed, easing, fn ) {
- var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
- complete: fn || !fn && easing ||
- jQuery.isFunction( speed ) && speed,
- duration: speed,
- easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
- };
-
- opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
- opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;
-
- // normalize opt.queue - true/undefined/null -> "fx"
- if ( opt.queue == null || opt.queue === true ) {
- opt.queue = "fx";
- }
-
- // Queueing
- opt.old = opt.complete;
-
- opt.complete = function( noUnmark ) {
- if ( jQuery.isFunction( opt.old ) ) {
- opt.old.call( this );
- }
-
- if ( opt.queue ) {
- jQuery.dequeue( this, opt.queue );
- } else if ( noUnmark !== false ) {
- jQuery._unmark( this );
- }
- };
-
- return opt;
- },
-
- easing: {
- linear: function( p, n, firstNum, diff ) {
- return firstNum + diff * p;
- },
- swing: function( p, n, firstNum, diff ) {
- return ( ( -Math.cos( p*Math.PI ) / 2 ) + 0.5 ) * diff + firstNum;
- }
- },
-
- timers: [],
+jQuery.speed = function( speed, easing, fn ) {
+ var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
+ complete: fn || !fn && easing ||
+ jQuery.isFunction( speed ) && speed,
+ duration: speed,
+ easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
+ };
- fx: function( elem, options, prop ) {
- this.options = options;
- this.elem = elem;
- this.prop = prop;
+ opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
+ opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;
- options.orig = options.orig || {};
+ // normalize opt.queue - true/undefined/null -> "fx"
+ if ( opt.queue == null || opt.queue === true ) {
+ opt.queue = "fx";
}
-});
-
-jQuery.fx.prototype = {
- // Simple function for setting a style value
- update: function() {
- if ( this.options.step ) {
- this.options.step.call( this.elem, this.now, this );
- }
-
- ( jQuery.fx.step[ this.prop ] || jQuery.fx.step._default )( this );
- },
-
- // Get the current size
- cur: function() {
- if ( this.elem[ this.prop ] != null && (!this.elem.style || this.elem.style[ this.prop ] == null) ) {
- return this.elem[ this.prop ];
- }
-
- var parsed,
- r = jQuery.css( this.elem, this.prop );
- // Empty strings, null, undefined and "auto" are converted to 0,
- // complex values such as "rotate(1rad)" are returned as is,
- // simple values such as "10px" are parsed to Float.
- return isNaN( parsed = parseFloat( r ) ) ? !r || r === "auto" ? 0 : r : parsed;
- },
-
- // Start an animation from one number to another
- custom: function( from, to, unit ) {
- var self = this,
- fx = jQuery.fx;
+ // Queueing
+ opt.old = opt.complete;
- this.startTime = fxNow || createFxNow();
- this.end = to;
- this.now = this.start = from;
- this.pos = this.state = 0;
- this.unit = unit || this.unit || ( jQuery.cssNumber[ this.prop ] ? "" : "px" );
-
- function t( gotoEnd ) {
- return self.step( gotoEnd );
- }
-
- t.queue = this.options.queue;
- t.elem = this.elem;
- t.saveState = function() {
- if ( self.options.hide && jQuery._data( self.elem, "fxshow" + self.prop ) === undefined ) {
- jQuery._data( self.elem, "fxshow" + self.prop, self.start );
- }
- };
-
- if ( t() && jQuery.timers.push(t) && !timerId ) {
- timerId = setInterval( fx.tick, fx.interval );
+ opt.complete = function() {
+ if ( jQuery.isFunction( opt.old ) ) {
+ opt.old.call( this );
}
- },
-
- // Simple 'show' function
- show: function() {
- var dataShow = jQuery._data( this.elem, "fxshow" + this.prop );
-
- // Remember where we started, so that we can go back to it later
- this.options.orig[ this.prop ] = dataShow || jQuery.style( this.elem, this.prop );
- this.options.show = true;
- // Begin the animation
- // Make sure that we start at a small width/height to avoid any flash of content
- if ( dataShow !== undefined ) {
- // This show is picking up where a previous hide or show left off
- this.custom( this.cur(), dataShow );
- } else {
- this.custom( this.prop === "width" || this.prop === "height" ? 1 : 0, this.cur() );
+ if ( opt.queue ) {
+ jQuery.dequeue( this, opt.queue );
}
+ };
- // Start by showing the element
- jQuery( this.elem ).show();
- },
-
- // Simple 'hide' function
- hide: function() {
- // Remember where we started, so that we can go back to it later
- this.options.orig[ this.prop ] = jQuery._data( this.elem, "fxshow" + this.prop ) || jQuery.style( this.elem, this.prop );
- this.options.hide = true;
+ return opt;
+};
- // Begin the animation
- this.custom( this.cur(), 0 );
+jQuery.easing = {
+ linear: function( p ) {
+ return p;
},
-
- // Each step of an animation
- step: function( gotoEnd ) {
- var p, n, complete,
- t = fxNow || createFxNow(),
- done = true,
- elem = this.elem,
- options = this.options;
-
- if ( gotoEnd || t >= options.duration + this.startTime ) {
- this.now = this.end;
- this.pos = this.state = 1;
- this.update();
-
- options.animatedProperties[ this.prop ] = true;
-
- for ( p in options.animatedProperties ) {
- if ( options.animatedProperties[ p ] !== true ) {
- done = false;
- }
- }
-
- if ( done ) {
- // Reset the overflow
- if ( options.overflow != null && !jQuery.support.shrinkWrapBlocks ) {
-
- jQuery.each( [ "", "X", "Y" ], function( index, value ) {
- elem.style[ "overflow" + value ] = options.overflow[ index ];
- });
- }
-
- // Hide the element if the "hide" operation was done
- if ( options.hide ) {
- jQuery( elem ).hide();
- }
-
- // Reset the properties, if the item has been hidden or shown
- if ( options.hide || options.show ) {
- for ( p in options.animatedProperties ) {
- jQuery.style( elem, p, options.orig[ p ] );
- jQuery.removeData( elem, "fxshow" + p, true );
- // Toggle data is no longer needed
- jQuery.removeData( elem, "toggle" + p, true );
- }
- }
-
- // Execute the complete function
- // in the event that the complete function throws an exception
- // we must ensure it won't be called twice. #5684
-
- complete = options.complete;
- if ( complete ) {
-
- options.complete = false;
- complete.call( elem );
- }
- }
-
- return false;
-
- } else {
- // classical easing cannot be used with an Infinity duration
- if ( options.duration == Infinity ) {
- this.now = t;
- } else {
- n = t - this.startTime;
- this.state = n / options.duration;
-
- // Perform the easing function, defaults to swing
- this.pos = jQuery.easing[ options.animatedProperties[this.prop] ]( this.state, n, 0, 1, options.duration );
- this.now = this.start + ( (this.end - this.start) * this.pos );
- }
- // Perform the next step of the animation
- this.update();
- }
-
- return true;
+ swing: function( p ) {
+ return 0.5 - Math.cos( p*Math.PI ) / 2;
}
};
-jQuery.extend( jQuery.fx, {
- tick: function() {
- var timer,
- timers = jQuery.timers,
- i = 0;
-
- for ( ; i < timers.length; i++ ) {
- timer = timers[ i ];
- // Checks the timer has not already been removed
- if ( !timer() && timers[ i ] === timer ) {
- timers.splice( i--, 1 );
- }
- }
+jQuery.timers = [];
+jQuery.fx = Tween.prototype.init;
+jQuery.fx.tick = function() {
+ var timer,
+ timers = jQuery.timers,
+ i = 0;
- if ( !timers.length ) {
- jQuery.fx.stop();
+ for ( ; i < timers.length; i++ ) {
+ timer = timers[ i ];
+ // Checks the timer has not already been removed
+ if ( !timer() && timers[ i ] === timer ) {
+ timers.splice( i--, 1 );
}
- },
+ }
- interval: 13,
+ if ( !timers.length ) {
+ jQuery.fx.stop();
+ }
+};
- stop: function() {
- clearInterval( timerId );
- timerId = null;
- },
+jQuery.fx.timer = function( timer ) {
+ if ( timer() && jQuery.timers.push( timer ) && !timerId ) {
+ timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval );
+ }
+};
- speeds: {
- slow: 600,
- fast: 200,
- // Default speed
- _default: 400
- },
+jQuery.fx.interval = 13;
- step: {
- opacity: function( fx ) {
- jQuery.style( fx.elem, "opacity", fx.now );
- },
+jQuery.fx.stop = function() {
+ clearInterval( timerId );
+ timerId = null;
+};
- _default: function( fx ) {
- if ( fx.elem.style && fx.elem.style[ fx.prop ] != null ) {
- fx.elem.style[ fx.prop ] = fx.now + fx.unit;
- } else {
- fx.elem[ fx.prop ] = fx.now;
- }
- }
- }
-});
+jQuery.fx.speeds = {
+ slow: 600,
+ fast: 200,
+ // Default speed
+ _default: 400
+};
-// Adds width/height step functions
-// Do not set anything below 0
-jQuery.each([ "width", "height" ], function( i, prop ) {
- jQuery.fx.step[ prop ] = function( fx ) {
- jQuery.style( fx.elem, prop, Math.max(0, fx.now) + fx.unit );
- };
-});
+// Back Compat <1.8 extension point
+jQuery.fx.step = {};
if ( jQuery.expr && jQuery.expr.filters ) {
jQuery.expr.filters.animated = function( elem ) {
}).length;
};
}
+var rroot = /^(?:body|html)$/i;
-// Try to restore the default display value of an element
-function defaultDisplay( nodeName ) {
-
- if ( !elemdisplay[ nodeName ] ) {
-
- var body = document.body,
- elem = jQuery( "<" + nodeName + ">" ).appendTo( body ),
- display = elem.css( "display" );
- elem.remove();
-
- // If the simple way fails,
- // get element's real default display by attaching it to a temp iframe
- if ( display === "none" || display === "" ) {
- // No iframe to use yet, so create it
- if ( !iframe ) {
- iframe = document.createElement( "iframe" );
- iframe.frameBorder = iframe.width = iframe.height = 0;
- }
-
- body.appendChild( iframe );
-
- // Create a cacheable copy of the iframe document on first call.
- // IE and Opera will allow us to reuse the iframeDoc without re-writing the fake HTML
- // document to it; WebKit & Firefox won't allow reusing the iframe document.
- if ( !iframeDoc || !iframe.createElement ) {
- iframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document;
- iframeDoc.write( ( document.compatMode === "CSS1Compat" ? "<!doctype html>" : "" ) + "<html><body>" );
- iframeDoc.close();
- }
-
- elem = iframeDoc.createElement( nodeName );
-
- iframeDoc.body.appendChild( elem );
-
- display = jQuery.css( elem, "display" );
- body.removeChild( iframe );
- }
-
- // Store the correct default display
- elemdisplay[ nodeName ] = display;
- }
-
- return elemdisplay[ nodeName ];
-}
-
-
-
-
-var rtable = /^t(?:able|d|h)$/i,
- rroot = /^(?:body|html)$/i;
-
-if ( "getBoundingClientRect" in document.documentElement ) {
- jQuery.fn.offset = function( options ) {
- var elem = this[0], box;
-
- if ( options ) {
- return this.each(function( i ) {
- jQuery.offset.setOffset( this, options, i );
- });
- }
-
- if ( !elem || !elem.ownerDocument ) {
- return null;
- }
-
- if ( elem === elem.ownerDocument.body ) {
- return jQuery.offset.bodyOffset( elem );
- }
-
- try {
- box = elem.getBoundingClientRect();
- } catch(e) {}
-
- var doc = elem.ownerDocument,
- docElem = doc.documentElement;
-
- // Make sure we're not dealing with a disconnected DOM node
- if ( !box || !jQuery.contains( docElem, elem ) ) {
- return box ? { top: box.top, left: box.left } : { top: 0, left: 0 };
- }
-
- var body = doc.body,
- win = getWindow(doc),
- clientTop = docElem.clientTop || body.clientTop || 0,
- clientLeft = docElem.clientLeft || body.clientLeft || 0,
- scrollTop = win.pageYOffset || jQuery.support.boxModel && docElem.scrollTop || body.scrollTop,
- scrollLeft = win.pageXOffset || jQuery.support.boxModel && docElem.scrollLeft || body.scrollLeft,
- top = box.top + scrollTop - clientTop,
- left = box.left + scrollLeft - clientLeft;
-
- return { top: top, left: left };
- };
-
-} else {
- jQuery.fn.offset = function( options ) {
- var elem = this[0];
-
- if ( options ) {
- return this.each(function( i ) {
+jQuery.fn.offset = function( options ) {
+ if ( arguments.length ) {
+ return options === undefined ?
+ this :
+ this.each(function( i ) {
jQuery.offset.setOffset( this, options, i );
});
- }
-
- if ( !elem || !elem.ownerDocument ) {
- return null;
- }
-
- if ( elem === elem.ownerDocument.body ) {
- return jQuery.offset.bodyOffset( elem );
- }
-
- var computedStyle,
- offsetParent = elem.offsetParent,
- prevOffsetParent = elem,
- doc = elem.ownerDocument,
- docElem = doc.documentElement,
- body = doc.body,
- defaultView = doc.defaultView,
- prevComputedStyle = defaultView ? defaultView.getComputedStyle( elem, null ) : elem.currentStyle,
- top = elem.offsetTop,
- left = elem.offsetLeft;
-
- while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) {
- if ( jQuery.support.fixedPosition && prevComputedStyle.position === "fixed" ) {
- break;
- }
-
- computedStyle = defaultView ? defaultView.getComputedStyle(elem, null) : elem.currentStyle;
- top -= elem.scrollTop;
- left -= elem.scrollLeft;
-
- if ( elem === offsetParent ) {
- top += elem.offsetTop;
- left += elem.offsetLeft;
-
- if ( jQuery.support.doesNotAddBorder && !(jQuery.support.doesAddBorderForTableAndCells && rtable.test(elem.nodeName)) ) {
- top += parseFloat( computedStyle.borderTopWidth ) || 0;
- left += parseFloat( computedStyle.borderLeftWidth ) || 0;
- }
+ }
- prevOffsetParent = offsetParent;
- offsetParent = elem.offsetParent;
- }
+ var docElem, body, win, clientTop, clientLeft, scrollTop, scrollLeft,
+ box = { top: 0, left: 0 },
+ elem = this[ 0 ],
+ doc = elem && elem.ownerDocument;
- if ( jQuery.support.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible" ) {
- top += parseFloat( computedStyle.borderTopWidth ) || 0;
- left += parseFloat( computedStyle.borderLeftWidth ) || 0;
- }
+ if ( !doc ) {
+ return;
+ }
- prevComputedStyle = computedStyle;
- }
+ if ( (body = doc.body) === elem ) {
+ return jQuery.offset.bodyOffset( elem );
+ }
- if ( prevComputedStyle.position === "relative" || prevComputedStyle.position === "static" ) {
- top += body.offsetTop;
- left += body.offsetLeft;
- }
+ docElem = doc.documentElement;
- if ( jQuery.support.fixedPosition && prevComputedStyle.position === "fixed" ) {
- top += Math.max( docElem.scrollTop, body.scrollTop );
- left += Math.max( docElem.scrollLeft, body.scrollLeft );
- }
+ // Make sure it's not a disconnected DOM node
+ if ( !jQuery.contains( docElem, elem ) ) {
+ return box;
+ }
- return { top: top, left: left };
+ // If we don't have gBCR, just use 0,0 rather than error
+ // BlackBerry 5, iOS 3 (original iPhone)
+ if ( typeof elem.getBoundingClientRect !== "undefined" ) {
+ box = elem.getBoundingClientRect();
+ }
+ win = getWindow( doc );
+ clientTop = docElem.clientTop || body.clientTop || 0;
+ clientLeft = docElem.clientLeft || body.clientLeft || 0;
+ scrollTop = win.pageYOffset || docElem.scrollTop;
+ scrollLeft = win.pageXOffset || docElem.scrollLeft;
+ return {
+ top: box.top + scrollTop - clientTop,
+ left: box.left + scrollLeft - clientLeft
};
-}
+};
jQuery.offset = {
position: function() {
if ( !this[0] ) {
- return null;
+ return;
}
var elem = this[0],
while ( offsetParent && (!rroot.test(offsetParent.nodeName) && jQuery.css(offsetParent, "position") === "static") ) {
offsetParent = offsetParent.offsetParent;
}
- return offsetParent;
+ return offsetParent || document.body;
});
}
});
// Create scrollLeft and scrollTop methods
-jQuery.each( ["Left", "Top"], function( i, name ) {
- var method = "scroll" + name;
+jQuery.each( {scrollLeft: "pageXOffset", scrollTop: "pageYOffset"}, function( method, prop ) {
+ var top = /Y/.test( prop );
jQuery.fn[ method ] = function( val ) {
- var elem, win;
+ return jQuery.access( this, function( elem, method, val ) {
+ var win = getWindow( elem );
- if ( val === undefined ) {
- elem = this[ 0 ];
-
- if ( !elem ) {
- return null;
+ if ( val === undefined ) {
+ return win ? (prop in win) ? win[ prop ] :
+ win.document.documentElement[ method ] :
+ elem[ method ];
}
- win = getWindow( elem );
-
- // Return the scroll offset
- return win ? ("pageXOffset" in win) ? win[ i ? "pageYOffset" : "pageXOffset" ] :
- jQuery.support.boxModel && win.document.documentElement[ method ] ||
- win.document.body[ method ] :
- elem[ method ];
- }
-
- // Set the scroll offset
- return this.each(function() {
- win = getWindow( this );
-
if ( win ) {
win.scrollTo(
- !i ? val : jQuery( win ).scrollLeft(),
- i ? val : jQuery( win ).scrollTop()
+ !top ? val : jQuery( win ).scrollLeft(),
+ top ? val : jQuery( win ).scrollTop()
);
} else {
- this[ method ] = val;
+ elem[ method ] = val;
}
- });
+ }, method, val, arguments.length, null );
};
});
elem.defaultView || elem.parentWindow :
false;
}
+// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
+jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
+ jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) {
+ // margin is only for outerHeight, outerWidth
+ jQuery.fn[ funcName ] = function( margin, value ) {
+ var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
+ extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
+
+ return jQuery.access( this, function( elem, type, value ) {
+ var doc;
+
+ if ( jQuery.isWindow( elem ) ) {
+ // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there
+ // isn't a whole lot we can do. See pull request at this URL for discussion:
+ // https://github.com/jquery/jquery/pull/764
+ return elem.document.documentElement[ "client" + name ];
+ }
+
+ // Get document width or height
+ if ( elem.nodeType === 9 ) {
+ doc = elem.documentElement;
+
+ // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], whichever is greatest
+ // unfortunately, this causes bug #3838 in IE6/8 only, but there is currently no good, small way to fix it.
+ return Math.max(
+ elem.body[ "scroll" + name ], doc[ "scroll" + name ],
+ elem.body[ "offset" + name ], doc[ "offset" + name ],
+ doc[ "client" + name ]
+ );
+ }
+ return value === undefined ?
+ // Get width or height on the element, requesting but not forcing parseFloat
+ jQuery.css( elem, type, value, extra ) :
-
-
-// Create width, height, innerHeight, innerWidth, outerHeight and outerWidth methods
-jQuery.each([ "Height", "Width" ], function( i, name ) {
-
- var type = name.toLowerCase();
-
- // innerHeight and innerWidth
- jQuery.fn[ "inner" + name ] = function() {
- var elem = this[0];
- return elem ?
- elem.style ?
- parseFloat( jQuery.css( elem, type, "padding" ) ) :
- this[ type ]() :
- null;
- };
-
- // outerHeight and outerWidth
- jQuery.fn[ "outer" + name ] = function( margin ) {
- var elem = this[0];
- return elem ?
- elem.style ?
- parseFloat( jQuery.css( elem, type, margin ? "margin" : "border" ) ) :
- this[ type ]() :
- null;
- };
-
- jQuery.fn[ type ] = function( size ) {
- // Get window width or height
- var elem = this[0];
- if ( !elem ) {
- return size == null ? null : this;
- }
-
- if ( jQuery.isFunction( size ) ) {
- return this.each(function( i ) {
- var self = jQuery( this );
- self[ type ]( size.call( this, i, self[ type ]() ) );
- });
- }
-
- if ( jQuery.isWindow( elem ) ) {
- // Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode
- // 3rd condition allows Nokia support, as it supports the docElem prop but not CSS1Compat
- var docElemProp = elem.document.documentElement[ "client" + name ],
- body = elem.document.body;
- return elem.document.compatMode === "CSS1Compat" && docElemProp ||
- body && body[ "client" + name ] || docElemProp;
-
- // Get document width or height
- } else if ( elem.nodeType === 9 ) {
- // Either scroll[Width/Height] or offset[Width/Height], whichever is greater
- return Math.max(
- elem.documentElement["client" + name],
- elem.body["scroll" + name], elem.documentElement["scroll" + name],
- elem.body["offset" + name], elem.documentElement["offset" + name]
- );
-
- // Get or set width or height on the element
- } else if ( size === undefined ) {
- var orig = jQuery.css( elem, type ),
- ret = parseFloat( orig );
-
- return jQuery.isNumeric( ret ) ? ret : orig;
-
- // Set the width or height on the element (default to pixels if value is unitless)
- } else {
- return this.css( type, typeof size === "string" ? size : size + "px" );
- }
- };
-
+ // Set width or height on the element
+ jQuery.style( elem, type, value, extra );
+ }, type, chainable ? margin : undefined, chainable, null );
+ };
+ });
});
-
-
-
-
// Expose jQuery to the global object
window.jQuery = window.$ = jQuery;
define( "jquery", [], function () { return jQuery; } );
}
-
-
})( window );
--- /dev/null
+(function( $, undefined ) {
+
+$.fn.buttonMarkup = function( options ) {
+ var $workingSet = this,
+ prefix = "data-" + $.mobile.ns,
+ mapToDataAttr = function( key, value ) {
+ e.setAttribute( "data-" + $.mobile.ns + key, value );
+ el.jqmData( key, value );
+ };
+
+ // Enforce options to be of type string
+ options = ( options && ( $.type( options ) === "object" ) )? options : {};
+ for ( var i = 0; i < $workingSet.length; i++ ) {
+ var el = $workingSet.eq( i ),
+ e = el[ 0 ],
+ o = $.extend( {}, $.fn.buttonMarkup.defaults, {
+ icon: options.icon !== undefined ? options.icon : $.mobile.getAttrFixed( e, prefix + "icon" ),
+ iconpos: options.iconpos !== undefined ? options.iconpos : $.mobile.getAttrFixed( e, prefix + "iconpos" ),
+ theme: options.theme !== undefined ? options.theme : $.mobile.getAttrFixed( e, prefix + "theme" ) || $.mobile.getInheritedTheme( el, $.fn.buttonMarkup.defaults["theme"] ),
+ inline: options.inline !== undefined ? options.inline : $.mobile.getAttrFixed( e, prefix + "inline" ),
+ shadow: options.shadow !== undefined ? options.shadow : $.mobile.getAttrFixed( e, prefix + "shadow" ),
+ corners: options.corners !== undefined ? options.corners : $.mobile.getAttrFixed( e, prefix + "corners" ),
+ iconshadow: options.iconshadow !== undefined ? options.iconshadow : $.mobile.getAttrFixed( e, prefix + "iconshadow" ),
+ mini: options.mini !== undefined ? options.mini : $.mobile.getAttrFixed( e, prefix + "mini" )
+ }, options ),
+
+ // Classes Defined
+ innerClass = "ui-btn-inner",
+ textClass = "ui-btn-text",
+ buttonClass, iconClass,
+ // Button inner markup
+ buttonInner,
+ buttonText,
+ buttonIcon,
+ buttonElements;
+
+ for ( key in o ) {
+ e.setAttribute ( prefix + key, o[ key ])
+ }
+
+ if ( $.mobile.getAttrFixed( e, prefix + "rel" ) === "popup" && el.attr( "href" ) ) {
+ e.setAttribute( "aria-haspopup", true );
+ e.setAttribute( "aria-owns", e.getAttribute( "href" ) );
+ }
+
+ if ( e.tagName !== "LI" && e.tagName !== "LABEL" ) {
+ e.setAttribute( "role", "button" );
+ e.setAttribute( "tabindex", "0" );
+ }
+
+ // Check if this element is already enhanced
+ buttonElements = $.data( ( ( e.tagName === "INPUT" || e.tagName === "BUTTON" ) ? e.parentNode : e ), "buttonElements" );
+
+ if ( buttonElements ) {
+ e = buttonElements.outer;
+ el = $( e );
+ buttonInner = buttonElements.inner;
+ buttonText = buttonElements.text;
+ // We will recreate this icon below
+ $( buttonElements.icon ).remove();
+ buttonElements.icon = null;
+ }
+ else {
+ buttonInner = document.createElement( o.wrapperEls );
+ buttonText = document.createElement( o.wrapperEls );
+ }
+ buttonIcon = o.icon ? document.createElement( "span" ) : null;
+
+ if ( attachEvents && !buttonElements ) {
+ attachEvents();
+ }
+
+ // if not, try to find closest theme container
+ if ( !o.theme ) {
+ o.theme = $.mobile.getInheritedTheme( el, "c" );
+ }
+
+ buttonClass = "ui-btn ui-btn-up-" + o.theme;
+ buttonClass += o.shadow ? " ui-shadow" : "";
+ buttonClass += o.corners ? " ui-btn-corner-all" : "";
+
+ // To distinguish real buttons
+ if( $.mobile.getAttrFixed( e, prefix + "role" ) == "button" || e.tagName == "BUTTON" || e.tagName == "DIV" ){
+ buttonClass += " ui-btn-box-" + o.theme;
+ }
+
+ /* TIZEN style markup */
+ buttonStyle = $.mobile.getAttrFixed( e, prefix + "style" );
+
+ if ( buttonStyle == "circle" && !($(el).text().length > 0) ) {
+ /* style : no text, Icon only */
+ buttonClass += " ui-btn-corner-circle";
+ buttonClass += " ui-btn-icon_only";
+ } else if ( buttonStyle == "nobg" ) {
+ /* style : no text, Icon only, no bg */
+ buttonClass += " ui-btn-icon-nobg";
+ buttonClass += " ui-btn-icon_only";
+ } else if ( buttonStyle == "edit" ) {
+ buttonClass += " ui-btn-edit";
+ } else if ( buttonStyle == "round" || ( buttonStyle == "circle" && $(el).text().length > 0 ) ) {
+ buttonClass += " ui-btn-round";
+ }
+ if ( o.icon ) {
+ if ( $(el).text().length > 0 ) {
+
+ switch ( o.iconpos ) {
+ case "right" :
+ case "left" :
+ case "top" :
+ case "bottom" :
+ textClass += " ui-btn-text-padding-" + o.iconpos;
+ break;
+ default:
+ textClass += " ui-btn-text-padding-left";
+ break;
+ }
+
+ innerClass += " ui-btn-hastxt";
+ } else {
+ if ( buttonStyle == "circle" ) {
+ /* style : no text, Icon only */
+ innerClass += " ui-btn-corner-circle";
+ } else if ( buttonStyle == "nobg" ) {
+ /* style : no text, Icon only, no bg */
+ innerClass += " ui-btn-icon-nobg";
+ }
+
+ buttonClass += " ui-btn-icon_only";
+ innerClass += " ui-btn-icon-only";
+
+ if ( e.tagName !== "LABEL" ) {
+ $( el ).text( o.icon.replace( "naviframe-", "" ) );
+ }
+ }
+ } else {
+ if ( $(el).text().length > 0 ) {
+ innerClass += " ui-btn-hastxt";
+ } else if ( buttonStyle == "circle" ){
+ buttonClass += " ui-btn-round";
+ }
+ }
+ if ( o.mini !== undefined ) {
+ // Used to control styling in headers/footers, where buttons default to `mini` style.
+ buttonClass += o.mini === true ? " ui-mini" : " ui-fullsize";
+ }
+
+ if ( o.inline !== undefined ) {
+ // Used to control styling in headers/footers, where buttons default to `inline` style.
+ buttonClass += o.inline === true ? " ui-btn-inline" : " ui-btn-block";
+ }
+
+ if ( o.icon ) {
+ o.icon = "ui-icon-" + o.icon;
+ o.iconpos = o.iconpos || "left";
+
+ iconClass = "ui-icon " + o.icon;
+
+ if ( o.iconshadow ) {
+ iconClass += " ui-icon-shadow";
+ }
+ }
+
+ if ( o.iconpos ) {
+ buttonClass += " ui-btn-icon-" + o.iconpos;
+
+ if ( o.iconpos === "notext" && !el.attr( "title" ) ) {
+ el.attr( "title", el.getEncodedText() );
+ }
+ }
+
+ innerClass += o.corners ? " ui-btn-corner-all" : "";
+
+ if ( o.iconpos && o.iconpos === "notext" && !el.attr( "title" ) ) {
+ el.attr( "title", el.getEncodedText() );
+ }
+
+ if ( buttonElements ) {
+ el.removeClass( buttonElements.bcls || "" );
+ }
+ el.removeClass( "ui-link" ).addClass( buttonClass );
+
+ buttonInner.className = innerClass;
+
+ buttonText.className = textClass;
+ if ( !buttonElements ) {
+ buttonInner.appendChild( buttonText );
+ }
+ if ( buttonIcon ) {
+ buttonIcon.className = iconClass;
+ if ( !( buttonElements && buttonElements.icon ) ) {
+ buttonIcon.innerHTML = " ";
+ buttonInner.appendChild( buttonIcon );
+ }
+ }
+
+ while ( e.firstChild && !buttonElements ) {
+ buttonText.appendChild( e.firstChild );
+ }
+
+ if ( !buttonElements ) {
+ e.appendChild( buttonInner );
+ }
+
+ // Assign a structure containing the elements of this button to the elements of this button. This
+ // will allow us to recognize this as an already-enhanced button in future calls to buttonMarkup().
+ buttonElements = {
+ bcls : buttonClass,
+ outer : e,
+ inner : buttonInner,
+ text : buttonText,
+ icon : buttonIcon
+ };
+
+ $.data( e, 'buttonElements', buttonElements );
+ $.data( buttonInner, 'buttonElements', buttonElements );
+ $.data( buttonText, 'buttonElements', buttonElements );
+ if ( buttonIcon ) {
+ $.data( buttonIcon, 'buttonElements', buttonElements );
+ }
+ }
+
+ return this;
+};
+
+$.fn.buttonMarkup.defaults = {
+ theme: "c",
+ corners: true,
+ shadow: true,
+ iconshadow: true,
+ wrapperEls: "span"
+};
+
+function closestEnabledButton( element ) {
+ var cname;
+
+ while ( element ) {
+ // Note that we check for typeof className below because the element we
+ // handed could be in an SVG DOM where className on SVG elements is defined to
+ // be of a different type (SVGAnimatedString). We only operate on HTML DOM
+ // elements, so we look for plain "string".
+ cname = ( typeof element.className === 'string' ) && ( element.className + ' ' );
+ if ( cname && cname.indexOf( "ui-btn " ) > -1 && cname.indexOf( "ui-disabled " ) < 0 ) {
+ break;
+ }
+
+ element = element.parentNode;
+ }
+
+ return element;
+}
+
+var attachEvents = function() {
+ var hoverDelay = $.mobile.buttonMarkup.hoverDelay, hov, foc;
+
+ $.mobile.$document.bind( {
+ "vmousedown vmousecancel vmouseup vmouseover vmouseout focus blur scrollstart touchend touchcancel": function( event ) {
+ var theme,
+ $btn = $( closestEnabledButton( event.target ) ),
+ isTouchEvent = event.originalEvent && /^touch/.test( event.originalEvent.type ),
+ evt = event.type;
+
+ if ( $btn.length ) {
+ theme = $btn.attr( "data-" + $.mobile.ns + "theme" );
+
+ if ( evt === "vmousedown" ) {
+ if ( isTouchEvent ) {
+ // Use a short delay to determine if the user is scrolling before highlighting
+ hov = setTimeout( function() {
+ $btn.removeClass( "ui-btn-up-" + theme ).addClass( "ui-btn-down-" + theme );
+ }, hoverDelay );
+ } else {
+ $btn.removeClass( "ui-btn-up-" + theme ).addClass( "ui-btn-down-" + theme );
+ }
+ } else if ( evt === "vmousecancel" || evt === "vmouseup" || evt === "touchend" || evt === "touchcancel" ) {
+ $btn.removeClass( "ui-btn-down-" + theme ).addClass( "ui-btn-up-" + theme );
+ } else if ( evt === "vmouseover" || evt === "focus" ) {
+ if ( isTouchEvent ) {
+ // Use a short delay to determine if the user is scrolling before highlighting
+ foc = setTimeout( function() {
+ $btn.removeClass( "ui-btn-up-" + theme ).addClass( "ui-btn-hover-" + theme );
+ }, hoverDelay );
+ } else {
+ $btn.removeClass( "ui-btn-up-" + theme ).addClass( "ui-btn-hover-" + theme );
+ }
+ } else if ( evt === "vmouseout" || evt === "blur" || evt === "scrollstart" ) {
+ $btn.removeClass( "ui-btn-hover-" + theme + " ui-btn-down-" + theme ).addClass( "ui-btn-up-" + theme );
+ if ( hov ) {
+ clearTimeout( hov );
+ }
+ if ( foc ) {
+ clearTimeout( foc );
+ }
+ }
+ }
+ },
+ "focusin focus": function( event ) {
+ $( closestEnabledButton( event.target ) ).addClass( $.mobile.focusClass );
+ },
+ "focusout blur": function( event ) {
+ $( closestEnabledButton( event.target ) ).removeClass( $.mobile.focusClass );
+ }
+ });
+
+ attachEvents = null;
+};
+
+//links in bars, or those with data-role become buttons
+//auto self-init widgets
+$.mobile.$document.bind( "pagecreate create", function( e ) {
+
+ $( ":jqmData(role='button'), .ui-bar > a, .ui-header > a, .ui-footer > a, .ui-bar > :jqmData(role='controlgroup') > a", e.target )
+ .jqmEnhanceable()
+ .not( "button, input, .ui-btn, :jqmData(role='none'), :jqmData(role='nojs')" )
+ .buttonMarkup();
+});
+
+})( jQuery );
+
--- /dev/null
+(function( $, undefined ) {
+
+$.fn.controlgroup = function( options ) {
+ function flipClasses( els, flCorners ) {
+ els.removeClass( "ui-btn-corner-all ui-corner-top ui-corner-bottom ui-corner-left ui-corner-right ui-controlgroup-last ui-shadow" )
+ .eq( 0 ).addClass( flCorners[ 0 ] )
+ .end()
+ .last().addClass( flCorners[ 1 ] ).addClass( "ui-controlgroup-last" );
+ }
+
+ return this.each(function() {
+ var $el = $( this ),
+ o = $.extend({
+ direction: $.mobile.getAttrFixed( $el[0], "data-"+ $.mobile.ns + "type" ) || "vertical",
+ shadow: false,
+ excludeInvisible: true,
+ mini: $.mobile.getAttrFixed( $el[0], "data-"+ $.mobile.ns + "mini" )
+ }, options ),
+ grouplegend = $el.children( "legend" ),
+ groupheading = $el.children( ".ui-controlgroup-label" ),
+ groupcontrols = $el.children( ".ui-controlgroup-controls" ),
+ flCorners = o.direction === "horizontal" ? [ "ui-corner-left", "ui-corner-right" ] : [ "ui-corner-top", "ui-corner-bottom" ],
+ type = $el.find( "input" ).first().attr( "type" );
+
+ // First unwrap the controls if the controlgroup was already enhanced
+ if ( groupcontrols.length ) {
+ groupcontrols.contents().unwrap();
+ }
+ $el.wrapInner( "<div class='ui-controlgroup-controls'></div>" );
+
+ if ( grouplegend.length ) {
+ // Replace legend with more stylable replacement div
+ $( "<div role='heading' class='ui-controlgroup-label'>" + grouplegend.html() + "</div>" ).insertBefore( $el.children( 0 ) );
+ grouplegend.remove();
+ } else if ( groupheading.length ) {
+ // Just move the heading if the controlgroup was already enhanced
+ $el.prepend( groupheading );
+ }
+
+ $el.addClass( "ui-corner-all ui-controlgroup ui-controlgroup-" + o.direction );
+
+ flipClasses( $el.find( ".ui-btn" + ( o.excludeInvisible ? ":visible" : "" ) ).not( '.ui-slider-handle' ), flCorners );
+ flipClasses( $el.find( ".ui-btn-inner" ), flCorners );
+
+ if ( o.shadow ) {
+ $el.addClass( "ui-shadow" );
+ }
+
+ if ( o.mini ) {
+ $el.addClass( "ui-mini" );
+ }
+
+ });
+};
+
+// The pagecreate handler for controlgroup is in jquery.mobile.init because of the soft-dependency on the wrapped widgets
+
+})(jQuery);
--- /dev/null
+(function( $, window, undefined ) {
+
+ var nsNormalizeDict = {};
+
+ // jQuery.mobile configurable options
+ $.mobile = $.extend( {}, {
+
+ // Version of the jQuery Mobile Framework
+ version: __version__,
+
+ // Namespace used framework-wide for data-attrs. Default is no namespace
+ ns: "",
+
+ // Define the url parameter used for referencing widget-generated sub-pages.
+ // Translates to to example.html&ui-page=subpageIdentifier
+ // hash segment before &ui-page= is used to make Ajax request
+ subPageUrlKey: "ui-page",
+
+ // Class assigned to page currently in view, and during transitions
+ activePageClass: "ui-page-active",
+
+ // Class used for "active" button state, from CSS framework
+ activeBtnClass: "ui-btn-active",
+
+ // Class used for "focus" form element state, from CSS framework
+ focusClass: "ui-focus",
+
+ // Automatically handle clicks and form submissions through Ajax, when same-domain
+ ajaxEnabled: true,
+
+ // Automatically load and show pages based on location.hash
+ hashListeningEnabled: true,
+
+ // disable to prevent jquery from bothering with links
+ linkBindingEnabled: true,
+
+ // Set default page transition - 'none' for no transitions
+ defaultPageTransition: "fade",
+
+ // Set maximum window width for transitions to apply - 'false' for no limit
+ maxTransitionWidth: false,
+
+ // Minimum scroll distance that will be remembered when returning to a page
+ minScrollBack: 250,
+
+ // DEPRECATED: the following property is no longer in use, but defined until 2.0 to prevent conflicts
+ touchOverflowEnabled: false,
+
+ // Set default dialog transition - 'none' for no transitions
+ defaultDialogTransition: "pop",
+
+ // Error response message - appears when an Ajax page request fails
+ pageLoadErrorMessage: "Error Loading Page",
+
+ // For error messages, which theme does the box uses?
+ pageLoadErrorMessageTheme: "e",
+
+ // replace calls to window.history.back with phonegaps navigation helper
+ // where it is provided on the window object
+ phonegapNavigationEnabled: false,
+
+ //automatically initialize the DOM when it's ready
+ autoInitializePage: true,
+
+ pushStateEnabled: true,
+
+ // allows users to opt in to ignoring content by marking a parent element as
+ // data-ignored
+ ignoreContentEnabled: false,
+
+ // turn of binding to the native orientationchange due to android orientation behavior
+ orientationChangeEnabled: true,
+
+ buttonMarkup: {
+ hoverDelay: 200
+ },
+
+ // define the window and the document objects
+ $window: $( window ),
+ $document: $( document ),
+
+ getAttrFixed : function( e, key ) {
+ var value = e.getAttribute( key );
+
+ return value === "true" ? true :
+ value === "false" ? false :
+ value === null ? undefined : value;
+ },
+
+ // TODO might be useful upstream in jquery itself ?
+ keyCode: {
+ ALT: 18,
+ BACKSPACE: 8,
+ CAPS_LOCK: 20,
+ COMMA: 188,
+ COMMAND: 91,
+ COMMAND_LEFT: 91, // COMMAND
+ COMMAND_RIGHT: 93,
+ CONTROL: 17,
+ DELETE: 46,
+ DOWN: 40,
+ END: 35,
+ ENTER: 13,
+ ESCAPE: 27,
+ HOME: 36,
+ INSERT: 45,
+ LEFT: 37,
+ MENU: 93, // COMMAND_RIGHT
+ NUMPAD_ADD: 107,
+ NUMPAD_DECIMAL: 110,
+ NUMPAD_DIVIDE: 111,
+ NUMPAD_ENTER: 108,
+ NUMPAD_MULTIPLY: 106,
+ NUMPAD_SUBTRACT: 109,
+ PAGE_DOWN: 34,
+ PAGE_UP: 33,
+ PERIOD: 190,
+ RIGHT: 39,
+ SHIFT: 16,
+ SPACE: 32,
+ TAB: 9,
+ UP: 38,
+ WINDOWS: 91 // COMMAND
+ },
+
+ // Scroll page vertically: scroll to 0 to hide iOS address bar, or pass a Y value
+ silentScroll: function( ypos ) {
+ if ( $.type( ypos ) !== "number" ) {
+ ypos = $.mobile.defaultHomeScroll;
+ }
+
+ // prevent scrollstart and scrollstop events
+ $.event.special.scrollstart.enabled = false;
+
+ setTimeout( function() {
+ window.scrollTo( 0, ypos );
+ $.mobile.$document.trigger( "silentscroll", { x: 0, y: ypos });
+ }, 20 );
+
+ setTimeout( function() {
+ $.event.special.scrollstart.enabled = true;
+ }, 150 );
+ },
+
+ // Expose our cache for testing purposes.
+ nsNormalizeDict: nsNormalizeDict,
+
+ // Take a data attribute property, prepend the namespace
+ // and then camel case the attribute string. Add the result
+ // to our nsNormalizeDict so we don't have to do this again.
+ nsNormalize: function( prop ) {
+ if ( !prop ) {
+ return;
+ }
+
+ return nsNormalizeDict[ prop ] || ( nsNormalizeDict[ prop ] = $.camelCase( $.mobile.ns + prop ) );
+ },
+
+ // Find the closest parent with a theme class on it. Note that
+ // we are not using $.fn.closest() on purpose here because this
+ // method gets called quite a bit and we need it to be as fast
+ // as possible.
+ getInheritedTheme: function( el, defaultTheme ) {
+ var e = el[ 0 ],
+ ltr = "",
+ re = /ui-(bar|body|overlay)-([a-z])\b/,
+ c, m;
+
+ while ( e ) {
+ c = e.className || "";
+ if ( c && ( m = re.exec( c ) ) && ( ltr = m[ 2 ] ) ) {
+ // We found a parent with a theme class
+ // on it so bail from this loop.
+ break;
+ }
+
+ e = e.parentNode;
+ }
+
+ // Return the theme letter we found, if none, return the
+ // specified default.
+
+ return ltr || defaultTheme || "a";
+ },
+
+ // TODO the following $ and $.fn extensions can/probably should be moved into jquery.mobile.core.helpers
+ //
+ // Find the closest javascript page element to gather settings data jsperf test
+ // http://jsperf.com/single-complex-selector-vs-many-complex-selectors/edit
+ // possibly naive, but it shows that the parsing overhead for *just* the page selector vs
+ // the page and dialog selector is negligable. This could probably be speed up by
+ // doing a similar parent node traversal to the one found in the inherited theme code above
+ closestPageData: function( $target ) {
+ return $target
+ .closest( ':jqmData(role="page"), :jqmData(role="dialog")' )
+ .data( "page" );
+ },
+
+ enhanceable: function( $set ) {
+ return this.haveParents( $set, "enhance" );
+ },
+
+ hijackable: function( $set ) {
+ return this.haveParents( $set, "ajax" );
+ },
+
+ haveParents: function( $set, attr ) {
+ if ( !$.mobile.ignoreContentEnabled ) {
+ return $set;
+ }
+
+ var count = $set.length,
+ $newSet = $(),
+ e, $element, excluded;
+
+ for ( var i = 0; i < count; i++ ) {
+ $element = $set.eq( i );
+ excluded = false;
+ e = $set[ i ];
+
+ while ( e ) {
+ var c = e.getAttribute ? e.getAttribute( "data-" + $.mobile.ns + attr ) : "";
+
+ if ( c === "false" ) {
+ excluded = true;
+ break;
+ }
+
+ e = e.parentNode;
+ }
+
+ if ( !excluded ) {
+ $newSet = $newSet.add( $element );
+ }
+ }
+
+ return $newSet;
+ },
+
+ getScreenHeight: function() {
+ // Native innerHeight returns more accurate value for this across platforms,
+ // jQuery version is here as a normalized fallback for platforms like Symbian
+ return window.innerHeight || $.mobile.$window.height();
+ }
+ }, $.mobile );
+
+ // Mobile version of data and removeData and hasData methods
+ // ensures all data is set and retrieved using jQuery Mobile's data namespace
+ $.fn.jqmData = function( prop, value ) {
+ var result;
+ if ( typeof prop !== "undefined" ) {
+ if ( prop ) {
+ prop = $.mobile.nsNormalize( prop );
+ }
+
+ // undefined is permitted as an explicit input for the second param
+ // in this case it returns the value and does not set it to undefined
+ if( arguments.length < 2 || value === undefined ){
+ result = this.data( prop );
+ } else {
+ result = this.data( prop, value );
+ }
+ }
+ return result;
+ };
+
+ $.jqmData = function( elem, prop, value ) {
+ var result;
+ if ( typeof prop !== "undefined" ) {
+ result = $.data( elem, prop ? $.mobile.nsNormalize( prop ) : prop, value );
+ }
+ return result;
+ };
+
+ $.fn.jqmRemoveData = function( prop ) {
+ return this.removeData( $.mobile.nsNormalize( prop ) );
+ };
+
+ $.jqmRemoveData = function( elem, prop ) {
+ return $.removeData( elem, $.mobile.nsNormalize( prop ) );
+ };
+
+ $.fn.removeWithDependents = function() {
+ $.removeWithDependents( this );
+ };
+
+ $.removeWithDependents = function( elem ) {
+ var $elem = $( elem );
+
+ ( $elem.jqmData( 'dependents' ) || $() ).remove();
+ $elem.remove();
+ };
+
+ $.fn.addDependents = function( newDependents ) {
+ $.addDependents( $( this ), newDependents );
+ };
+
+ $.addDependents = function( elem, newDependents ) {
+ var dependents = $( elem ).jqmData( 'dependents' ) || $();
+
+ $( elem ).jqmData( 'dependents', $.merge( dependents, newDependents ) );
+ };
+
+ // note that this helper doesn't attempt to handle the callback
+ // or setting of an html elements text, its only purpose is
+ // to return the html encoded version of the text in all cases. (thus the name)
+ $.fn.getEncodedText = function() {
+ return $( "<div/>" ).text( $( this ).text() ).html();
+ };
+
+ // fluent helper function for the mobile namespaced equivalent
+ $.fn.jqmEnhanceable = function() {
+ return $.mobile.enhanceable( this );
+ };
+
+ $.fn.jqmHijackable = function() {
+ return $.mobile.hijackable( this );
+ };
+
+ // Monkey-patching Sizzle to filter the :jqmData selector
+ var oldFind = $.find,
+ jqmDataRE = /:jqmData\(([^)]*)\)/g;
+
+ $.find = function( selector, context, ret, extra ) {
+ selector = selector.replace( jqmDataRE, "[data-" + ( $.mobile.ns || "" ) + "$1]" );
+
+ return oldFind.call( this, selector, context, ret, extra );
+ };
+
+ $.extend( $.find, oldFind );
+
+ $.find.matches = function( expr, set ) {
+ return $.find( expr, null, null, set );
+ };
+
+ $.find.matchesSelector = function( node, expr ) {
+ return $.find( expr, null, null, [ node ] ).length > 0;
+ };
+
+ $.extend({
+ creatorDict: {},
+
+ delegateSelfInitWithSingleSelector: function( target, useKeepNative ) {
+ if ( typeof target !== 'function' ) {
+ return false;
+ }
+ var selector = target.prototype.options.initSelector;
+ var selectorRE = /:jqmData\(role='[A-z\-]+'\)$/;
+ if ( selectorRE.test(selector) ) {
+ var firstIdx = selector.indexOf( "'" ) + 1;
+ var lastIdx = selector.lastIndexOf( "'" );
+ var key = selector.substring( firstIdx, lastIdx );
+ if ( !$.creatorDict.hasOwnProperty( key ) ) {
+ $.creatorDict[key] = {};
+ $.creatorDict[key].target = target;
+ if ( useKeepNative === true ) {
+ $.creatorDict[key].useKeepNative = useKeepNative;
+ }
+ return true;
+ }
+ }
+ return false;
+ }
+ });
+
+ //auto self-init widgets
+ $( document ).bind( "pagecreate create", function( e ) {
+ var selector = "*[data-" + $.mobile.ns + "role]";
+ $( selector, e.target ).each( function () {
+ dataRoleValue = this.getAttribute( "data-role" );
+ matchedObj = $.creatorDict[dataRoleValue];
+ if ( matchedObj ) {
+ matchedObj.target.prototype.enhance( this, matchedObj.useKeepNative );
+ }
+ });
+ });
+})( jQuery, this );
+
--- /dev/null
+// creates the define method on window, only used where async loading
+// is not desired in the docs and experiments
+window.define = function() {
+ Array.prototype.slice.call( arguments ).pop()( window.jQuery );
+};
--- /dev/null
+(function( $, undefined ) {
+
+$.mobile.page.prototype.options.degradeInputs = {
+ color: false,
+ date: false,
+ datetime: false,
+ "datetime-local": false,
+ email: false,
+ month: false,
+ number: false,
+ range: "number",
+ search: "text",
+ tel: false,
+ time: false,
+ url: false,
+ week: false
+};
+
+
+//auto self-init widgets
+$.mobile.$document.bind( "pagecreate create", function( e ) {
+
+ var page = $.mobile.closestPageData( $( e.target ) ), options;
+
+ if ( !page ) {
+ return;
+ }
+
+ options = page.options;
+
+ // degrade inputs to avoid poorly implemented native functionality
+ $( e.target ).find( "input" ).not( page.keepNativeSelector() ).each(function() {
+ var $this = $( this ),
+ type = this.getAttribute( "type" ),
+ optType = options.degradeInputs[ type ] || "text";
+
+ if ( options.degradeInputs[ type ] ) {
+ var html = $( "<div>" ).html( $this.clone() ).html(),
+ // In IE browsers, the type sometimes doesn't exist in the cloned markup, so we replace the closing tag instead
+ hasType = html.indexOf( " type=" ) > -1,
+ findstr = hasType ? /\s+type=["']?\w+['"]?/ : /\/?>/,
+ repstr = " type=\"" + optType + "\" data-" + $.mobile.ns + "type=\"" + type + "\"" + ( hasType ? "" : ">" );
+
+ $this.replaceWith( html.replace( findstr, repstr ) );
+ }
+ });
+
+});
+
+})( jQuery );
--- /dev/null
+(function( $, undefined ) {
+
+// filter function removes whitespace between label and form element so we can use inline-block (nodeType 3 = text)
+$.fn.fieldcontain = function( options ) {
+ return this
+ .addClass( "ui-field-contain ui-body ui-br" )
+ .contents().filter( function() {
+ return ( this.nodeType === 3 && !/\S/.test( this.nodeValue ) );
+ }).remove();
+};
+
+//auto self-init widgets
+$.mobile.$document.bind( "pagecreate create", function( e ) {
+ $( ":jqmData(role='fieldcontain')", e.target ).jqmEnhanceable().fieldcontain();
+});
+
+})( jQuery );
--- /dev/null
+(function( $, undefined ) {
+
+$.fn.grid = function( options ) {
+ return this.each(function() {
+
+ var $this = $( this ),
+ o = $.extend({
+ grid: null
+ }, options ),
+ $kids = $this.children(),
+ gridCols = { solo:1, a:2, b:3, c:4, d:5 },
+ grid = o.grid,
+ iterator;
+
+ if ( !grid ) {
+ if ( $kids.length <= 5 ) {
+ for ( var letter in gridCols ) {
+ if ( gridCols[ letter ] === $kids.length ) {
+ grid = letter;
+ }
+ }
+ } else {
+ grid = "a";
+ $this.addClass( "ui-grid-duo" );
+ }
+ }
+ iterator = gridCols[grid];
+
+ $this.addClass( "ui-grid-" + grid );
+
+ $kids.filter( ":nth-child(" + iterator + "n+1)" ).addClass( "ui-block-a" );
+
+ if ( iterator > 1 ) {
+ $kids.filter( ":nth-child(" + iterator + "n+2)" ).addClass( "ui-block-b" );
+ }
+ if ( iterator > 2 ) {
+ $kids.filter( ":nth-child(" + iterator + "n+3)" ).addClass( "ui-block-c" );
+ }
+ if ( iterator > 3 ) {
+ $kids.filter( ":nth-child(" + iterator + "n+4)" ).addClass( "ui-block-d" );
+ }
+ if ( iterator > 4 ) {
+ $kids.filter( ":nth-child(" + iterator + "n+5)" ).addClass( "ui-block-e" );
+ }
+ });
+};
+})( jQuery );
--- /dev/null
+(function( $, window, undefined ) {
+ var $html = $( "html" ),
+ $head = $( "head" ),
+ $window = $.mobile.$window;
+
+ //remove initial build class (only present on first pageshow)
+ function hideRenderingClass() {
+ $html.removeClass( "ui-mobile-rendering" );
+ }
+
+ // trigger mobileinit event - useful hook for configuring $.mobile settings before they're used
+ $( window.document ).trigger( "mobileinit" );
+
+ // support conditions
+ // if device support condition(s) aren't met, leave things as they are -> a basic, usable experience,
+ // otherwise, proceed with the enhancements
+ if ( !$.mobile.gradeA() ) {
+ return;
+ }
+
+ // override ajaxEnabled on platforms that have known conflicts with hash history updates
+ // or generally work better browsing in regular http for full page refreshes (BB5, Opera Mini)
+ if ( $.mobile.ajaxBlacklist ) {
+ $.mobile.ajaxEnabled = false;
+ }
+
+ // Add mobile, initial load "rendering" classes to docEl
+ $html.addClass( "ui-mobile ui-mobile-rendering" );
+
+ // This is a fallback. If anything goes wrong (JS errors, etc), or events don't fire,
+ // this ensures the rendering class is removed after 5 seconds, so content is visible and accessible
+ setTimeout( hideRenderingClass, 5000 );
+
+ $.extend( $.mobile, {
+ addEventBlocker: function () {
+ $html.addClass( "ui-blocker" );
+ $html.bind( "touchstart touchend vclick mousedown mouseup click", function () {
+ return false;
+ } );
+ },
+
+ removeEventBlocker: function () {
+ $html.removeClass( "ui-blocker" );
+ $html.unbind( "touchstart touchend vclick mousedown mouseup click" );
+ },
+
+ // find and enhance the pages in the dom and transition to the first page.
+ initializePage: function() {
+ // find present pages
+ var $pages = $( ":jqmData(role='page'), :jqmData(role='dialog')" ),
+ hash = $.mobile.path.parseLocation().hash.replace("#", ""),
+ hashPage = document.getElementById( hash );
+
+ // if no pages are found, create one with body's inner html
+ if ( !$pages.length ) {
+ $pages = $( "body" ).wrapInner( "<div data-" + $.mobile.ns + "role='page'></div>" ).children( 0 );
+ }
+
+ // add dialogs, set data-url attrs
+ $pages.each(function() {
+ var $this = $( this );
+
+ // unless the data url is already set set it to the pathname
+ if ( !$this[0].getAttribute( "data-" + $.mobile.ns + "url" ) ) {
+ $this.attr( "data-" + $.mobile.ns + "url", $this.attr( "id" ) || location.pathname + location.search );
+ }
+ });
+
+ // define first page in dom case one backs out to the directory root (not always the first page visited, but defined as fallback)
+ $.mobile.firstPage = $pages.first();
+
+ // define page container
+ $.mobile.pageContainer = $.mobile.firstPage.parent().addClass( "ui-mobile-viewport" );
+
+ // alert listeners that the pagecontainer has been determined for binding
+ // to events triggered on it
+ $window.trigger( "pagecontainercreate" );
+
+ // cue page loading message
+ $.mobile.showPageLoadingMsg();
+ $.mobile.addEventBlocker();
+
+ //remove initial build class (only present on first pageshow)
+ hideRenderingClass();
+
+ // if hashchange listening is disabled, there's no hash deeplink,
+ // the hash is not valid (contains more than one # or does not start with #)
+ // or there is no page with that hash, change to the first page in the DOM
+ // Remember, however, that the hash can also be a path!
+ if ( ! ( $.mobile.hashListeningEnabled &&
+ $.mobile.path.isHashValid( location.hash ) &&
+ ( $( hashPage ).is( ':jqmData(role="page")' ) ||
+ $.mobile.path.isPath( hash ) ||
+ hash === $.mobile.dialogHashKey ) ) ) {
+
+ // Store the initial destination
+ if ( $.mobile.path.isHashValid( location.hash ) ) {
+ $.mobile.urlHistory.initialDst = hash.replace( "#", "" );
+ }
+ $.mobile.changePage( $.mobile.firstPage, { transition: "none", reverse: true, changeHash: false, fromHashChange: true } );
+ }
+ // otherwise, trigger a hashchange to load a deeplink
+ else {
+ $window.trigger( "hashchange", [ true ] );
+ }
+ }
+ });
+
+ // initialize events now, after mobileinit has occurred
+ $.mobile.navreadyDeferred.resolve();
+
+ // check which scrollTop value should be used by scrolling to 1 immediately at domready
+ // then check what the scroll top is. Android will report 0... others 1
+ // note that this initial scroll won't hide the address bar. It's just for the check.
+ $(function() {
+ window.scrollTo( 0, 1 );
+
+ // if defaultHomeScroll hasn't been set yet, see if scrollTop is 1
+ // it should be 1 in most browsers, but android treats 1 as 0 (for hiding addr bar)
+ // so if it's 1, use 0 from now on
+ $.mobile.defaultHomeScroll = ( !$.support.scrollTop || $.mobile.$window.scrollTop() === 1 ) ? 0 : 1;
+
+
+ // TODO: Implement a proper registration mechanism with dependency handling in order to not have exceptions like the one below
+ //auto self-init widgets for those widgets that have a soft dependency on others
+ if ( $.fn.controlgroup ) {
+ $.mobile.$document.bind( "pagecreate create", function( e ) {
+ $( ":jqmData(role='controlgroup')", e.target )
+ .jqmEnhanceable()
+ .controlgroup({ excludeInvisible: false });
+ });
+ }
+
+ //dom-ready inits
+ if ( $.mobile.autoInitializePage ) {
+ $.mobile.initializePage();
+ }
+
+ // window load event
+ // hide iOS browser chrome on load
+ $window.load( $.mobile.silentScroll );
+
+ if ( !$.support.cssPointerEvents ) {
+ // IE and Opera don't support CSS pointer-events: none that we use to disable link-based buttons
+ // by adding the 'ui-disabled' class to them. Using a JavaScript workaround for those browser.
+ // https://github.com/jquery/jquery-mobile/issues/3558
+
+ $.mobile.$document.delegate( ".ui-disabled", "vclick",
+ function( e ) {
+ e.preventDefault();
+ e.stopImmediatePropagation();
+ }
+ );
+ }
+ });
+}( jQuery, this ));
--- /dev/null
+
+/*
+ *
+ * This software is licensed under the MIT licence (as defined by the OSI at
+ * http://www.opensource.org/licenses/mit-license.php)
+ *
+ * ***************************************************************************
+ * Copyright (C) 2011 by Intel Corporation Ltd.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * ***************************************************************************
+ */
+
+// Add markup for labels
+
+
+(function($, undefined) {
+
+$(document).bind("pagecreate create", function(e) {
+ $(":jqmData(role='label')", e.target).not(":jqmData(role='none'), :jqmData(role='nojs')").each(function() {
+ $(this).addClass("jquery-mobile-ui-label")
+ .html($("<span>", {"class": "jquery-mobile-ui-label-text"}).text($(this).text()));
+ });
+});
+
+})(jQuery);
+
+
--- /dev/null
+(function( $, undefined ) {
+
+$.mobile.$document.bind( "pagecreate create", function( e ) {
+
+ //links within content areas, tests included with page
+ $( e.target )
+ .find( "a" )
+ .jqmEnhanceable()
+ .not( ".ui-btn, .ui-link-inherit, :jqmData(role='none'), :jqmData(role='nojs')" )
+ .addClass( "ui-link" );
+
+});
+
+})( jQuery );
+
--- /dev/null
+(function( $, undefined ) {
+
+var $window = $.mobile.$window,
+ $html = $( "html" );
+
+/* $.mobile.media method: pass a CSS media type or query and get a bool return
+ note: this feature relies on actual media query support for media queries, though types will work most anywhere
+ examples:
+ $.mobile.media('screen') // tests for screen media type
+ $.mobile.media('screen and (min-width: 480px)') // tests for screen media type with window width > 480px
+ $.mobile.media('@media screen and (-webkit-min-device-pixel-ratio: 2)') // tests for webkit 2x pixel ratio (iPhone 4)
+*/
+$.mobile.media = (function() {
+ // TODO: use window.matchMedia once at least one UA implements it
+ var cache = {},
+ testDiv = $( "<div id='jquery-mediatest'></div>" ),
+ fakeBody = $( "<body>" ).append( testDiv );
+
+ return function( query ) {
+ if ( !( query in cache ) ) {
+ var styleBlock = document.createElement( "style" ),
+ cssrule = "@media " + query + " { #jquery-mediatest { position:absolute; } }";
+
+ //must set type for IE!
+ styleBlock.type = "text/css";
+
+ if ( styleBlock.styleSheet ) {
+ styleBlock.styleSheet.cssText = cssrule;
+ } else {
+ styleBlock.appendChild( document.createTextNode(cssrule) );
+ }
+
+ $html.prepend( fakeBody ).prepend( styleBlock );
+ cache[ query ] = testDiv.css( "position" ) === "absolute";
+ fakeBody.add( styleBlock ).remove();
+ }
+ return cache[ query ];
+ };
+})();
+
+})(jQuery);
--- /dev/null
+(function( $, undefined ) {
+
+ //define vars for interal use
+ var $window = $.mobile.$window,
+ $html = $( 'html' ),
+ $head = $( 'head' ),
+
+ //url path helpers for use in relative url management
+ path = {
+
+ // This scary looking regular expression parses an absolute URL or its relative
+ // variants (protocol, site, document, query, and hash), into the various
+ // components (protocol, host, path, query, fragment, etc that make up the
+ // URL as well as some other commonly used sub-parts. When used with RegExp.exec()
+ // or String.match, it parses the URL into a results array that looks like this:
+ //
+ // [0]: http://jblas:password@mycompany.com:8080/mail/inbox?msg=1234&type=unread#msg-content
+ // [1]: http://jblas:password@mycompany.com:8080/mail/inbox?msg=1234&type=unread
+ // [2]: http://jblas:password@mycompany.com:8080/mail/inbox
+ // [3]: http://jblas:password@mycompany.com:8080
+ // [4]: http:
+ // [5]: //
+ // [6]: jblas:password@mycompany.com:8080
+ // [7]: jblas:password
+ // [8]: jblas
+ // [9]: password
+ // [10]: mycompany.com:8080
+ // [11]: mycompany.com
+ // [12]: 8080
+ // [13]: /mail/inbox
+ // [14]: /mail/
+ // [15]: inbox
+ // [16]: ?msg=1234&type=unread
+ // [17]: #msg-content
+ //
+ urlParseRE: /^(((([^:\/#\?]+:)?(?:(\/\/)((?:(([^:@\/#\?]+)(?:\:([^:@\/#\?]+))?)@)?(([^:\/#\?\]\[]+|\[[^\/\]@#?]+\])(?:\:([0-9]+))?))?)?)?((\/?(?:[^\/\?#]+\/+)*)([^\?#]*)))?(\?[^#]+)?)(#.*)?/,
+
+ // Abstraction to address xss (Issue #4787) by removing the authority in
+ // browsers that auto decode it. All references to location.href should be
+ // replaced with a call to this method so that it can be dealt with properly here
+ getLocation: function( url ) {
+ var uri = url ? this.parseUrl( url ) : location,
+ hash = this.parseUrl( url || location.href ).hash;
+
+ // mimic the browser with an empty string when the hash is empty
+ hash = hash === "#" ? "" : hash;
+
+ // Make sure to parse the url or the location object for the hash because using location.hash
+ // is autodecoded in firefox, the rest of the url should be from the object (location unless
+ // we're testing) to avoid the inclusion of the authority
+ return uri.protocol + "//" + uri.host + uri.pathname + uri.search + hash;
+ },
+
+ parseLocation: function() {
+ return this.parseUrl( this.getLocation() );
+ },
+
+ //Parse a URL into a structure that allows easy access to
+ //all of the URL components by name.
+ parseUrl: function( url ) {
+ // If we're passed an object, we'll assume that it is
+ // a parsed url object and just return it back to the caller.
+ if ( $.type( url ) === "object" ) {
+ return url;
+ }
+
+ var matches = path.urlParseRE.exec( url || "" ) || [];
+
+ // Create an object that allows the caller to access the sub-matches
+ // by name. Note that IE returns an empty string instead of undefined,
+ // like all other browsers do, so we normalize everything so its consistent
+ // no matter what browser we're running on.
+ return {
+ href: matches[ 0 ] || "",
+ hrefNoHash: matches[ 1 ] || "",
+ hrefNoSearch: matches[ 2 ] || "",
+ domain: matches[ 3 ] || "",
+ protocol: matches[ 4 ] || "",
+ doubleSlash: matches[ 5 ] || "",
+ authority: matches[ 6 ] || "",
+ username: matches[ 8 ] || "",
+ password: matches[ 9 ] || "",
+ host: matches[ 10 ] || "",
+ hostname: matches[ 11 ] || "",
+ port: matches[ 12 ] || "",
+ pathname: matches[ 13 ] || "",
+ directory: matches[ 14 ] || "",
+ filename: matches[ 15 ] || "",
+ search: matches[ 16 ] || "",
+ hash: matches[ 17 ] || ""
+ };
+ },
+
+ //Turn relPath into an asbolute path. absPath is
+ //an optional absolute path which describes what
+ //relPath is relative to.
+ makePathAbsolute: function( relPath, absPath ) {
+ if ( relPath && relPath.charAt( 0 ) === "/" ) {
+ return relPath;
+ }
+
+ relPath = relPath || "";
+ absPath = absPath ? absPath.replace( /^\/|(\/[^\/]*|[^\/]+)$/g, "" ) : "";
+
+ var absStack = absPath ? absPath.split( "/" ) : [],
+ relStack = relPath.split( "/" );
+ for ( var i = 0; i < relStack.length; i++ ) {
+ var d = relStack[ i ];
+ switch ( d ) {
+ case ".":
+ break;
+ case "..":
+ if ( absStack.length ) {
+ absStack.pop();
+ }
+ break;
+ default:
+ absStack.push( d );
+ break;
+ }
+ }
+ return "/" + absStack.join( "/" );
+ },
+
+ //Returns true if both urls have the same domain.
+ isSameDomain: function( absUrl1, absUrl2 ) {
+ return path.parseUrl( absUrl1 ).domain === path.parseUrl( absUrl2 ).domain;
+ },
+
+ //Returns true for any relative variant.
+ isRelativeUrl: function( url ) {
+ // All relative Url variants have one thing in common, no protocol.
+ return path.parseUrl( url ).protocol === "";
+ },
+
+ //Returns true for an absolute url.
+ isAbsoluteUrl: function( url ) {
+ return path.parseUrl( url ).protocol !== "";
+ },
+
+ //Turn the specified realtive URL into an absolute one. This function
+ //can handle all relative variants (protocol, site, document, query, fragment).
+ makeUrlAbsolute: function( relUrl, absUrl ) {
+ if ( !path.isRelativeUrl( relUrl ) ) {
+ return relUrl;
+ }
+
+ if ( absUrl === undefined ) {
+ absUrl = documentBase;
+ }
+
+ var relObj = path.parseUrl( relUrl ),
+ absObj = path.parseUrl( absUrl ),
+ protocol = relObj.protocol || absObj.protocol,
+ doubleSlash = relObj.protocol ? relObj.doubleSlash : ( relObj.doubleSlash || absObj.doubleSlash ),
+ authority = relObj.authority || absObj.authority,
+ hasPath = relObj.pathname !== "",
+ pathname = path.makePathAbsolute( relObj.pathname || absObj.filename, absObj.pathname ),
+ search = relObj.search || ( !hasPath && absObj.search ) || "",
+ hash = relObj.hash;
+
+ return protocol + doubleSlash + authority + pathname + search + hash;
+ },
+
+ //Add search (aka query) params to the specified url.
+ addSearchParams: function( url, params ) {
+ var u = path.parseUrl( url ),
+ p = ( typeof params === "object" ) ? $.param( params ) : params,
+ s = u.search || "?";
+ return u.hrefNoSearch + s + ( s.charAt( s.length - 1 ) !== "?" ? "&" : "" ) + p + ( u.hash || "" );
+ },
+
+ convertUrlToDataUrl: function( absUrl ) {
+ var u = path.parseUrl( absUrl );
+ if ( path.isEmbeddedPage( u ) ) {
+ // For embedded pages, remove the dialog hash key as in getFilePath(),
+ // otherwise the Data Url won't match the id of the embedded Page.
+ return u.hash.split( dialogHashKey )[0].replace( /^#/, "" );
+ } else if ( path.isSameDomain( u, documentBase ) ) {
+ return u.hrefNoHash.replace( documentBase.domain, "" ).split( dialogHashKey )[0];
+ }
+
+ return window.decodeURIComponent(absUrl);
+ },
+
+ //get path from current hash, or from a file path
+ get: function( newPath ) {
+ if ( newPath === undefined ) {
+ newPath = path.parseLocation().hash;
+ }
+ return path.stripHash( newPath ).replace( /[^\/]*\.[^\/*]+$/, '' );
+ },
+
+ //return the substring of a filepath before the sub-page key, for making a server request
+ getFilePath: function( path ) {
+ var splitkey = '&' + $.mobile.subPageUrlKey;
+ return path && path.split( splitkey )[0].split( dialogHashKey )[0];
+ },
+
+ //set location hash to path
+ set: function( path ) {
+ location.hash = path;
+ },
+
+ //test if a given url (string) is a path
+ //NOTE might be exceptionally naive
+ isPath: function( url ) {
+ return ( /\// ).test( url );
+ },
+
+ //return a url path with the window's location protocol/hostname/pathname removed
+ clean: function( url ) {
+ return url.replace( documentBase.domain, "" );
+ },
+
+ //just return the url without an initial #
+ stripHash: function( url ) {
+ return url.replace( /^#/, "" );
+ },
+
+ //remove the preceding hash, any query params, and dialog notations
+ cleanHash: function( hash ) {
+ return path.stripHash( hash.replace( /\?.*$/, "" ).replace( dialogHashKey, "" ) );
+ },
+
+ isHashValid: function( hash ) {
+ return ( /^#[^#]+$/ ).test( hash );
+ },
+
+ //check whether a url is referencing the same domain, or an external domain or different protocol
+ //could be mailto, etc
+ isExternal: function( url ) {
+ var u = path.parseUrl( url );
+ return u.protocol && u.domain !== documentUrl.domain ? true : false;
+ },
+
+ hasProtocol: function( url ) {
+ return ( /^(:?\w+:)/ ).test( url );
+ },
+
+ //check if the specified url refers to the first page in the main application document.
+ isFirstPageUrl: function( url ) {
+ // We only deal with absolute paths.
+ var u = path.parseUrl( path.makeUrlAbsolute( url, documentBase ) ),
+
+ // Does the url have the same path as the document?
+ samePath = u.hrefNoHash === documentUrl.hrefNoHash || ( documentBaseDiffers && u.hrefNoHash === documentBase.hrefNoHash ),
+
+ // Get the first page element.
+ fp = $.mobile.firstPage,
+
+ // Get the id of the first page element if it has one.
+ fpId = fp && fp[0] ? fp[0].id : undefined;
+
+ // The url refers to the first page if the path matches the document and
+ // it either has no hash value, or the hash is exactly equal to the id of the
+ // first page element.
+ return samePath && ( !u.hash || u.hash === "#" || ( fpId && u.hash.replace( /^#/, "" ) === fpId ) );
+ },
+
+ isEmbeddedPage: function( url ) {
+ var u = path.parseUrl( url );
+
+ //if the path is absolute, then we need to compare the url against
+ //both the documentUrl and the documentBase. The main reason for this
+ //is that links embedded within external documents will refer to the
+ //application document, whereas links embedded within the application
+ //document will be resolved against the document base.
+ if ( u.protocol !== "" ) {
+ return ( u.hash && ( u.hrefNoHash === documentUrl.hrefNoHash || ( documentBaseDiffers && u.hrefNoHash === documentBase.hrefNoHash ) ) );
+ }
+ return ( /^#/ ).test( u.href );
+ },
+
+
+ // Some embedded browsers, like the web view in Phone Gap, allow cross-domain XHR
+ // requests if the document doing the request was loaded via the file:// protocol.
+ // This is usually to allow the application to "phone home" and fetch app specific
+ // data. We normally let the browser handle external/cross-domain urls, but if the
+ // allowCrossDomainPages option is true, we will allow cross-domain http/https
+ // requests to go through our page loading logic.
+ isPermittedCrossDomainRequest: function( docUrl, reqUrl ) {
+ return $.mobile.allowCrossDomainPages &&
+ docUrl.protocol === "file:" &&
+ reqUrl.search( /^https?:/ ) !== -1;
+ }
+ },
+
+ //will be defined when a link is clicked and given an active class
+ $activeClickedLink = null,
+
+ //urlHistory is purely here to make guesses at whether the back or forward button was clicked
+ //and provide an appropriate transition
+ urlHistory = {
+ // Array of pages that are visited during a single page load.
+ // Each has a url and optional transition, title, and pageUrl (which represents the file path, in cases where URL is obscured, such as dialogs)
+ stack: [],
+
+ //maintain an index number for the active page in the stack
+ activeIndex: 0,
+
+ //get active
+ getActive: function() {
+ return urlHistory.stack[ urlHistory.activeIndex ];
+ },
+
+ getPrev: function() {
+ return urlHistory.stack[ urlHistory.activeIndex - 1 ];
+ },
+
+ getNext: function() {
+ return urlHistory.stack[ urlHistory.activeIndex + 1 ];
+ },
+
+ // addNew is used whenever a new page is added
+ addNew: function( url, transition, title, pageUrl, role ) {
+ //if there's forward history, wipe it
+ if ( urlHistory.getNext() ) {
+ urlHistory.clearForward();
+ }
+
+ urlHistory.stack.push( {url : url, transition: transition, title: title, pageUrl: pageUrl, role: role } );
+
+ urlHistory.activeIndex = urlHistory.stack.length - 1;
+ },
+
+ //wipe urls ahead of active index
+ clearForward: function() {
+ urlHistory.stack = urlHistory.stack.slice( 0, urlHistory.activeIndex + 1 );
+ },
+
+ directHashChange: function( opts ) {
+ var back , forward, newActiveIndex, prev = this.getActive();
+
+ // check if url is in history and if it's ahead or behind current page
+ $.each( urlHistory.stack, function( i, historyEntry ) {
+
+ //if the url is in the stack, it's a forward or a back
+ if ( decodeURIComponent( opts.currentUrl ) === decodeURIComponent( historyEntry.url ) ) {
+ //define back and forward by whether url is older or newer than current page
+ back = i < urlHistory.activeIndex;
+ forward = !back;
+ newActiveIndex = i;
+ }
+ });
+
+ // save new page index, null check to prevent falsey 0 result
+ this.activeIndex = newActiveIndex !== undefined ? newActiveIndex : this.activeIndex;
+
+ if ( back ) {
+ ( opts.either || opts.isBack )( true );
+ } else if ( forward ) {
+ ( opts.either || opts.isForward )( false );
+ }
+ },
+
+ //disable hashchange event listener internally to ignore one change
+ //toggled internally when location.hash is updated to match the url of a successful page load
+ ignoreNextHashChange: false
+ },
+
+ //define first selector to receive focus when a page is shown
+ focusable = "[tabindex],a,button:visible,select:visible,input",
+
+ //queue to hold simultanious page transitions
+ pageTransitionQueue = [],
+
+ //indicates whether or not page is in process of transitioning
+ isPageTransitioning = false,
+
+ //nonsense hash change key for dialogs, so they create a history entry
+ dialogHashKey = "&ui-state=dialog",
+
+ //existing base tag?
+ $base = $head.children( "base" ),
+
+ //tuck away the original document URL minus any fragment.
+ documentUrl = path.parseLocation(),
+
+ //if the document has an embedded base tag, documentBase is set to its
+ //initial value. If a base tag does not exist, then we default to the documentUrl.
+ documentBase = $base.length ? path.parseUrl( path.makeUrlAbsolute( $base.attr( "href" ), documentUrl.href ) ) : documentUrl,
+
+ //cache the comparison once.
+ documentBaseDiffers = ( documentUrl.hrefNoHash !== documentBase.hrefNoHash ),
+
+ getScreenHeight = $.mobile.getScreenHeight;
+
+ //base element management, defined depending on dynamic base tag support
+ var base = $.support.dynamicBaseTag ? {
+
+ //define base element, for use in routing asset urls that are referenced in Ajax-requested markup
+ element: ( $base.length ? $base : $( "<base>", { href: documentBase.hrefNoHash } ).prependTo( $head ) ),
+
+ //set the generated BASE element's href attribute to a new page's base path
+ set: function( href ) {
+ base.element.attr( "href", path.makeUrlAbsolute( href, documentBase ) );
+ },
+
+ //set the generated BASE element's href attribute to a new page's base path
+ reset: function() {
+ base.element.attr( "href", documentBase.hrefNoHash );
+ }
+
+ } : undefined;
+
+ /* internal utility functions */
+
+ // NOTE Issue #4950 Android phonegap doesn't navigate back properly
+ // when a full page refresh has taken place. It appears that hashchange
+ // and replacestate history alterations work fine but we need to support
+ // both forms of history traversal in our code that uses backward history
+ // movement
+ $.mobile.back = function() {
+ var nav = window.navigator;
+
+ // if the setting is on and the navigator object is
+ // available use the phonegap navigation capability
+ if( this.phonegapNavigationEnabled &&
+ nav &&
+ nav.app &&
+ nav.app.backHistory ){
+ nav.app.backHistory();
+ } else {
+ window.history.back();
+ }
+ };
+
+ //direct focus to the page title, or otherwise first focusable element
+ $.mobile.focusPage = function ( page ) {
+ var autofocus = page.find( "[autofocus]" ),
+ pageTitle = page.find( ".ui-title:eq(0)" );
+
+ if ( autofocus.length ) {
+ autofocus.focus();
+ return;
+ }
+
+ if ( pageTitle.length ) {
+ pageTitle.focus();
+ } else{
+ page.focus();
+ }
+ };
+
+ //remove active classes after page transition or error
+ function removeActiveLinkClass( forceRemoval ) {
+ if ( !!$activeClickedLink && ( !$activeClickedLink.closest( "." + $.mobile.activePageClass ).length || forceRemoval ) ) {
+ $activeClickedLink.removeClass( $.mobile.activeBtnClass );
+ }
+ $activeClickedLink = null;
+ }
+
+ function releasePageTransitionLock() {
+ isPageTransitioning = false;
+ if ( pageTransitionQueue.length > 0 ) {
+ $.mobile.changePage.apply( null, pageTransitionQueue.pop() );
+ }
+ }
+
+ // Save the last scroll distance per page, before it is hidden
+ var setLastScrollEnabled = true,
+ setLastScroll, delayedSetLastScroll;
+
+ setLastScroll = function() {
+ // this barrier prevents setting the scroll value based on the browser
+ // scrolling the window based on a hashchange
+ if ( !setLastScrollEnabled ) {
+ return;
+ }
+
+ var active = $.mobile.urlHistory.getActive();
+
+ if ( active ) {
+ var lastScroll = $window.scrollTop();
+
+ // Set active page's lastScroll prop.
+ // If the location we're scrolling to is less than minScrollBack, let it go.
+ active.lastScroll = lastScroll < $.mobile.minScrollBack ? $.mobile.defaultHomeScroll : lastScroll;
+ }
+ };
+
+ // bind to scrollstop to gather scroll position. The delay allows for the hashchange
+ // event to fire and disable scroll recording in the case where the browser scrolls
+ // to the hash targets location (sometimes the top of the page). once pagechange fires
+ // getLastScroll is again permitted to operate
+ delayedSetLastScroll = function() {
+ setTimeout( setLastScroll, 100 );
+ };
+
+ // disable an scroll setting when a hashchange has been fired, this only works
+ // because the recording of the scroll position is delayed for 100ms after
+ // the browser might have changed the position because of the hashchange
+ $window.bind( $.support.pushState ? "popstate" : "hashchange", function() {
+ setLastScrollEnabled = false;
+ });
+
+ // handle initial hashchange from chrome :(
+ $window.one( $.support.pushState ? "popstate" : "hashchange", function() {
+ setLastScrollEnabled = true;
+ });
+
+ // wait until the mobile page container has been determined to bind to pagechange
+ $window.one( "pagecontainercreate", function() {
+ // once the page has changed, re-enable the scroll recording
+ $.mobile.pageContainer.bind( "pagechange", function() {
+
+ setLastScrollEnabled = true;
+
+ // remove any binding that previously existed on the get scroll
+ // which may or may not be different than the scroll element determined for
+ // this page previously
+ $window.unbind( "scrollstop", delayedSetLastScroll );
+
+ // determine and bind to the current scoll element which may be the window
+ // or in the case of touch overflow the element with touch overflow
+ $window.bind( "scrollstop", delayedSetLastScroll );
+ });
+ });
+
+ // bind to scrollstop for the first page as "pagechange" won't be fired in that case
+ $window.bind( "scrollstop", delayedSetLastScroll );
+
+ // No-op implementation of transition degradation
+ $.mobile._maybeDegradeTransition = $.mobile._maybeDegradeTransition || function( transition ) {
+ return transition;
+ };
+
+ //function for transitioning between two existing pages
+ function transitionPages( toPage, fromPage, transition, reverse ) {
+
+ if ( fromPage ) {
+ //trigger before show/hide events
+ fromPage.data( "page" )._trigger( "beforehide", null, { nextPage: toPage } );
+ }
+
+ toPage.data( "page" )._trigger( "beforeshow", null, { prevPage: fromPage || $( "" ) } );
+
+ //clear page loader
+ $.mobile.hidePageLoadingMsg();
+
+ transition = $.mobile._maybeDegradeTransition( transition );
+
+ //find the transition handler for the specified transition. If there
+ //isn't one in our transitionHandlers dictionary, use the default one.
+ //call the handler immediately to kick-off the transition.
+ var th = $.mobile.transitionHandlers[ transition || "default" ] || $.mobile.defaultTransitionHandler,
+ promise = th( transition, reverse, toPage, fromPage );
+
+ promise.done(function() {
+
+ //trigger show/hide events
+ if ( fromPage ) {
+ fromPage.data( "page" )._trigger( "hide", null, { nextPage: toPage } );
+ }
+
+ //trigger pageshow, define prevPage as either fromPage or empty jQuery obj
+ toPage.data( "page" )._trigger( "show", null, { prevPage: fromPage || $( "" ) } );
+
+ setTimeout( function () {
+ $.mobile.removeEventBlocker();
+ }, 0 );
+ });
+
+ return promise;
+ }
+
+ //shared page enhancements
+ function enhancePage( $page, role ) {
+ // If a role was specified, make sure the data-role attribute
+ // on the page element is in sync.
+ if ( role ) {
+ $page.attr( "data-" + $.mobile.ns + "role", role );
+ }
+
+ //run page plugin
+ $page.page();
+ }
+
+ /* exposed $.mobile methods */
+
+ //animation complete callback
+ $.fn.animationComplete = function( callback ) {
+ if ( $.support.cssTransitions ) {
+ return $( this ).one( 'webkitAnimationEnd animationend', callback );
+ }
+ else{
+ // defer execution for consistency between webkit/non webkit
+ setTimeout( callback, 0 );
+ return $( this );
+ }
+ };
+
+ //expose path object on $.mobile
+ $.mobile.path = path;
+
+ //expose base object on $.mobile
+ $.mobile.base = base;
+
+ //history stack
+ $.mobile.urlHistory = urlHistory;
+
+ $.mobile.dialogHashKey = dialogHashKey;
+
+
+
+ //enable cross-domain page support
+ $.mobile.allowCrossDomainPages = false;
+
+ //return the original document url
+ $.mobile.getDocumentUrl = function( asParsedObject ) {
+ return asParsedObject ? $.extend( {}, documentUrl ) : documentUrl.href;
+ };
+
+ //return the original document base url
+ $.mobile.getDocumentBase = function( asParsedObject ) {
+ return asParsedObject ? $.extend( {}, documentBase ) : documentBase.href;
+ };
+
+ $.mobile._bindPageRemove = function() {
+ var page = $( this );
+
+ // when dom caching is not enabled or the page is embedded bind to remove the page on hide
+ if ( !page.data( "page" ).options.domCache &&
+ page.is( ":jqmData(external-page='true')" ) ) {
+
+ page.bind( 'pagehide.remove', function() {
+ var $this = $( this ),
+ prEvent = new $.Event( "pageremove" );
+
+ $this.trigger( prEvent );
+
+ if ( !prEvent.isDefaultPrevented() ) {
+ $this.removeWithDependents();
+ }
+ });
+ }
+ };
+
+ // Load a page into the DOM.
+ $.mobile.loadPage = function( url, options ) {
+ // This function uses deferred notifications to let callers
+ // know when the page is done loading, or if an error has occurred.
+ var deferred = $.Deferred(),
+
+ // The default loadPage options with overrides specified by
+ // the caller.
+ settings = $.extend( {}, $.mobile.loadPage.defaults, options ),
+
+ // The DOM element for the page after it has been loaded.
+ page = null,
+
+ // If the reloadPage option is true, and the page is already
+ // in the DOM, dupCachedPage will be set to the page element
+ // so that it can be removed after the new version of the
+ // page is loaded off the network.
+ dupCachedPage = null,
+
+ // determine the current base url
+ findBaseWithDefault = function() {
+ var closestBase = ( $.mobile.activePage && getClosestBaseUrl( $.mobile.activePage ) );
+ return closestBase || documentBase.hrefNoHash;
+ },
+
+ // The absolute version of the URL passed into the function. This
+ // version of the URL may contain dialog/subpage params in it.
+ absUrl = path.makeUrlAbsolute( url, findBaseWithDefault() );
+
+
+ // If the caller provided data, and we're using "get" request,
+ // append the data to the URL.
+ if ( settings.data && settings.type === "get" ) {
+ absUrl = path.addSearchParams( absUrl, settings.data );
+ settings.data = undefined;
+ }
+
+ // If the caller is using a "post" request, reloadPage must be true
+ if ( settings.data && settings.type === "post" ) {
+ settings.reloadPage = true;
+ }
+
+ // The absolute version of the URL minus any dialog/subpage params.
+ // In otherwords the real URL of the page to be loaded.
+ var fileUrl = path.getFilePath( absUrl ),
+
+ // The version of the Url actually stored in the data-url attribute of
+ // the page. For embedded pages, it is just the id of the page. For pages
+ // within the same domain as the document base, it is the site relative
+ // path. For cross-domain pages (Phone Gap only) the entire absolute Url
+ // used to load the page.
+ dataUrl = path.convertUrlToDataUrl( absUrl );
+
+ // Make sure we have a pageContainer to work with.
+ settings.pageContainer = settings.pageContainer || $.mobile.pageContainer;
+
+ // Check to see if the page already exists in the DOM.
+ // NOTE do _not_ use the :jqmData psuedo selector because parenthesis
+ // are a valid url char and it breaks on the first occurence
+ page = settings.pageContainer.children( "[data-" + $.mobile.ns +"url='" + dataUrl + "']" );
+
+ // If we failed to find the page, check to see if the url is a
+ // reference to an embedded page. If so, it may have been dynamically
+ // injected by a developer, in which case it would be lacking a data-url
+ // attribute and in need of enhancement.
+ if ( page.length === 0 && dataUrl && !path.isPath( dataUrl ) ) {
+ page = settings.pageContainer.children( "#" + dataUrl )
+ .attr( "data-" + $.mobile.ns + "url", dataUrl )
+ .jqmData( "url", dataUrl );
+ }
+
+ // If we failed to find a page in the DOM, check the URL to see if it
+ // refers to the first page in the application. If it isn't a reference
+ // to the first page and refers to non-existent embedded page, error out.
+ if ( page.length === 0 ) {
+ if ( $.mobile.firstPage && path.isFirstPageUrl( fileUrl ) ) {
+ // Check to make sure our cached-first-page is actually
+ // in the DOM. Some user deployed apps are pruning the first
+ // page from the DOM for various reasons, we check for this
+ // case here because we don't want a first-page with an id
+ // falling through to the non-existent embedded page error
+ // case. If the first-page is not in the DOM, then we let
+ // things fall through to the ajax loading code below so
+ // that it gets reloaded.
+ if ( $.mobile.firstPage.parent().length ) {
+ page = $( $.mobile.firstPage );
+ }
+ } else if ( path.isEmbeddedPage( fileUrl ) ) {
+ deferred.reject( absUrl, options );
+ return deferred.promise();
+ }
+ }
+
+ // If the page we are interested in is already in the DOM,
+ // and the caller did not indicate that we should force a
+ // reload of the file, we are done. Otherwise, track the
+ // existing page as a duplicated.
+ if ( page.length ) {
+ if ( !settings.reloadPage ) {
+ enhancePage( page, settings.role );
+ deferred.resolve( absUrl, options, page );
+ return deferred.promise();
+ }
+ dupCachedPage = page;
+ }
+
+ var mpc = settings.pageContainer,
+ pblEvent = new $.Event( "pagebeforeload" ),
+ triggerData = { url: url, absUrl: absUrl, dataUrl: dataUrl, deferred: deferred, options: settings };
+
+ // Let listeners know we're about to load a page.
+ mpc.trigger( pblEvent, triggerData );
+
+ // If the default behavior is prevented, stop here!
+ if ( pblEvent.isDefaultPrevented() ) {
+ return deferred.promise();
+ }
+
+ if ( settings.showLoadMsg ) {
+
+ // This configurable timeout allows cached pages a brief delay to load without showing a message
+ var loadMsgDelay = setTimeout(function() {
+ $.mobile.showPageLoadingMsg();
+ }, settings.loadMsgDelay ),
+
+ // Shared logic for clearing timeout and removing message.
+ hideMsg = function() {
+
+ // Stop message show timer
+ clearTimeout( loadMsgDelay );
+
+ // Hide loading message
+ $.mobile.hidePageLoadingMsg();
+ };
+ }
+
+ // Reset base to the default document base.
+ if ( base ) {
+ base.reset();
+ }
+
+ if ( !( $.mobile.allowCrossDomainPages || path.isSameDomain( documentUrl, absUrl ) ) ) {
+ deferred.reject( absUrl, options );
+ } else {
+ // Load the new page.
+ $.ajax({
+ url: fileUrl,
+ type: settings.type,
+ data: settings.data,
+ dataType: "html",
+ success: function( html, textStatus, xhr ) {
+ //pre-parse html to check for a data-url,
+ //use it as the new fileUrl, base path, etc
+ var all = $( "<div></div>" ),
+
+ //page title regexp
+ newPageTitle = html.match( /<title[^>]*>([^<]*)/ ) && RegExp.$1,
+
+ // TODO handle dialogs again
+ pageElemRegex = new RegExp( "(<[^>]+\\bdata-" + $.mobile.ns + "role=[\"']?page[\"']?[^>]*>)" ),
+ dataUrlRegex = new RegExp( "\\bdata-" + $.mobile.ns + "url=[\"']?([^\"'>]*)[\"']?" );
+
+
+ // data-url must be provided for the base tag so resource requests can be directed to the
+ // correct url. loading into a temprorary element makes these requests immediately
+ if ( pageElemRegex.test( html ) &&
+ RegExp.$1 &&
+ dataUrlRegex.test( RegExp.$1 ) &&
+ RegExp.$1 ) {
+ url = fileUrl = path.getFilePath( $( "<div>" + RegExp.$1 + "</div>" ).text() );
+ }
+
+ if ( base ) {
+ base.set( fileUrl );
+ }
+
+ //workaround to allow scripts to execute when included in page divs
+ all.get( 0 ).innerHTML = html;
+ page = all.find( ":jqmData(role='page'), :jqmData(role='dialog')" ).first();
+
+ //if page elem couldn't be found, create one and insert the body element's contents
+ if ( !page.length ) {
+ page = $( "<div data-" + $.mobile.ns + "role='page'>" + html.split( /<\/?body[^>]*>/gmi )[1] + "</div>" );
+ }
+
+ if ( newPageTitle && !page.jqmData( "title" ) ) {
+ if ( ~newPageTitle.indexOf( "&" ) ) {
+ newPageTitle = $( "<div>" + newPageTitle + "</div>" ).text();
+ }
+ page.jqmData( "title", newPageTitle );
+ }
+
+ //rewrite src and href attrs to use a base url
+ if ( !$.support.dynamicBaseTag ) {
+ var newPath = path.get( fileUrl );
+ page.find( "[src], link[href], a[rel='external'], :jqmData(ajax='false'), a[target]" ).each(function() {
+ var thisAttr = $( this ).is( '[href]' ) ? 'href' :
+ $( this ).is( '[src]' ) ? 'src' : 'action',
+ thisUrl = $( this ).attr( thisAttr );
+
+ // XXX_jblas: We need to fix this so that it removes the document
+ // base URL, and then prepends with the new page URL.
+ //if full path exists and is same, chop it - helps IE out
+ thisUrl = thisUrl.replace( location.protocol + '//' + location.host + location.pathname, '' );
+
+ if ( !/^(\w+:|#|\/)/.test( thisUrl ) ) {
+ $( this ).attr( thisAttr, newPath + thisUrl );
+ }
+ });
+ }
+
+ //append to page and enhance
+ // TODO taging a page with external to make sure that embedded pages aren't removed
+ // by the various page handling code is bad. Having page handling code in many
+ // places is bad. Solutions post 1.0
+ page
+ .attr( "data-" + $.mobile.ns + "url", path.convertUrlToDataUrl( fileUrl ) )
+ .attr( "data-" + $.mobile.ns + "external-page", true )
+ .appendTo( settings.pageContainer );
+
+ // wait for page creation to leverage options defined on widget
+ page.one( 'pagecreate', $.mobile._bindPageRemove );
+
+ enhancePage( page, settings.role );
+
+ // Enhancing the page may result in new dialogs/sub pages being inserted
+ // into the DOM. If the original absUrl refers to a sub-page, that is the
+ // real page we are interested in.
+ if ( absUrl.indexOf( "&" + $.mobile.subPageUrlKey ) > -1 ) {
+ page = settings.pageContainer.children( "[data-" + $.mobile.ns +"url='" + dataUrl + "']" );
+ }
+
+ //bind pageHide to removePage after it's hidden, if the page options specify to do so
+
+ // Remove loading message.
+ if ( settings.showLoadMsg ) {
+ hideMsg();
+ }
+
+ // Add the page reference and xhr to our triggerData.
+ triggerData.xhr = xhr;
+ triggerData.textStatus = textStatus;
+ triggerData.page = page;
+
+ // Let listeners know the page loaded successfully.
+ settings.pageContainer.trigger( "pageload", triggerData );
+
+ deferred.resolve( absUrl, options, page, dupCachedPage );
+ },
+ error: function( xhr, textStatus, errorThrown ) {
+ //set base back to current path
+ if ( base ) {
+ base.set( path.get() );
+ }
+
+ // Add error info to our triggerData.
+ triggerData.xhr = xhr;
+ triggerData.textStatus = textStatus;
+ triggerData.errorThrown = errorThrown;
+
+ var plfEvent = new $.Event( "pageloadfailed" );
+
+ // Let listeners know the page load failed.
+ settings.pageContainer.trigger( plfEvent, triggerData );
+
+ // If the default behavior is prevented, stop here!
+ // Note that it is the responsibility of the listener/handler
+ // that called preventDefault(), to resolve/reject the
+ // deferred object within the triggerData.
+ if ( plfEvent.isDefaultPrevented() ) {
+ return;
+ }
+
+ // Remove loading message.
+ if ( settings.showLoadMsg ) {
+
+ // Remove loading message.
+ hideMsg();
+
+ // show error message
+ $.mobile.showPageLoadingMsg( $.mobile.pageLoadErrorMessageTheme, $.mobile.pageLoadErrorMessage, true );
+
+ // hide after delay
+ setTimeout( $.mobile.hidePageLoadingMsg, 1500 );
+ }
+
+ deferred.reject( absUrl, options );
+ }
+ });
+ }
+
+ return deferred.promise();
+ };
+
+ $.mobile.loadPage.defaults = {
+ type: "get",
+ data: undefined,
+ reloadPage: false,
+ role: undefined, // By default we rely on the role defined by the @data-role attribute.
+ showLoadMsg: false,
+ pageContainer: undefined,
+ loadMsgDelay: 50 // This delay allows loads that pull from browser cache to occur without showing the loading message.
+ };
+
+ // Show a specific page in the page container.
+ $.mobile.changePage = function( toPage, options ) {
+ // If we are in the midst of a transition, queue the current request.
+ // We'll call changePage() once we're done with the current transition to
+ // service the request.
+ if ( isPageTransitioning ) {
+ pageTransitionQueue.unshift( arguments );
+ return;
+ }
+
+ var settings = $.extend( {}, $.mobile.changePage.defaults, options );
+
+ // Make sure we have a pageContainer to work with.
+ settings.pageContainer = settings.pageContainer || $.mobile.pageContainer;
+
+ // Make sure we have a fromPage.
+ settings.fromPage = settings.fromPage || $.mobile.activePage;
+
+ var mpc = settings.pageContainer,
+ pbcEvent = new $.Event( "pagebeforechange" ),
+ triggerData = { toPage: toPage, options: settings };
+
+ // Let listeners know we're about to change the current page.
+ mpc.trigger( pbcEvent, triggerData );
+
+ // If the default behavior is prevented, stop here!
+ if ( pbcEvent.isDefaultPrevented() ) {
+ return;
+ }
+
+ // We allow "pagebeforechange" observers to modify the toPage in the trigger
+ // data to allow for redirects. Make sure our toPage is updated.
+
+ toPage = triggerData.toPage;
+
+ // Set the isPageTransitioning flag to prevent any requests from
+ // entering this method while we are in the midst of loading a page
+ // or transitioning.
+
+ isPageTransitioning = true;
+
+ // If the caller passed us a url, call loadPage()
+ // to make sure it is loaded into the DOM. We'll listen
+ // to the promise object it returns so we know when
+ // it is done loading or if an error ocurred.
+ if ( typeof toPage === "string" ) {
+ $.mobile.loadPage( toPage, settings )
+ .done(function( url, options, newPage, dupCachedPage ) {
+ isPageTransitioning = false;
+ options.duplicateCachedPage = dupCachedPage;
+ $.mobile.changePage( newPage, options );
+ })
+ .fail(function( url, options ) {
+ isPageTransitioning = false;
+
+ //clear out the active button state
+ removeActiveLinkClass( true );
+
+ //release transition lock so navigation is free again
+ releasePageTransitionLock();
+ settings.pageContainer.trigger( "pagechangefailed", triggerData );
+ });
+ return;
+ }
+
+ // If we are going to the first-page of the application, we need to make
+ // sure settings.dataUrl is set to the application document url. This allows
+ // us to avoid generating a document url with an id hash in the case where the
+ // first-page of the document has an id attribute specified.
+ if ( toPage[ 0 ] === $.mobile.firstPage[ 0 ] && !settings.dataUrl ) {
+ settings.dataUrl = documentUrl.hrefNoHash;
+ }
+
+ // The caller passed us a real page DOM element. Update our
+ // internal state and then trigger a transition to the page.
+ var fromPage = settings.fromPage,
+ url = ( settings.dataUrl && path.convertUrlToDataUrl( settings.dataUrl ) ) || toPage.jqmData( "url" ),
+ // The pageUrl var is usually the same as url, except when url is obscured as a dialog url. pageUrl always contains the file path
+ pageUrl = url,
+ fileUrl = path.getFilePath( url ),
+ active = urlHistory.getActive(),
+ activeIsInitialPage = urlHistory.activeIndex === 0,
+ historyDir = 0,
+ pageTitle = document.title,
+ isDialog = settings.role === "dialog" || $.mobile.getAttrFixed( toPage [0], "data-" + $.mobile.ns + "role" ) === "dialog";
+
+ // By default, we prevent changePage requests when the fromPage and toPage
+ // are the same element, but folks that generate content manually/dynamically
+ // and reuse pages want to be able to transition to the same page. To allow
+ // this, they will need to change the default value of allowSamePageTransition
+ // to true, *OR*, pass it in as an option when they manually call changePage().
+ // It should be noted that our default transition animations assume that the
+ // formPage and toPage are different elements, so they may behave unexpectedly.
+ // It is up to the developer that turns on the allowSamePageTransitiona option
+ // to either turn off transition animations, or make sure that an appropriate
+ // animation transition is used.
+ if ( fromPage && fromPage[0] === toPage[0] && !settings.allowSamePageTransition ) {
+ isPageTransitioning = false;
+ mpc.trigger( "pagechange", triggerData );
+
+ // Even if there is no page change to be done, we should keep the urlHistory in sync with the hash changes
+ if ( settings.fromHashChange ) {
+ urlHistory.directHashChange({
+ currentUrl: url,
+ isBack: function() {},
+ isForward: function() {}
+ });
+ }
+
+ return;
+ }
+
+ // We need to make sure the page we are given has already been enhanced.
+ enhancePage( toPage, settings.role );
+
+ // If the changePage request was sent from a hashChange event, check to see if the
+ // page is already within the urlHistory stack. If so, we'll assume the user hit
+ // the forward/back button and will try to match the transition accordingly.
+ if ( settings.fromHashChange ) {
+ urlHistory.directHashChange({
+ currentUrl: url,
+ isBack: function() { historyDir = -1; },
+ isForward: function() { historyDir = 1; }
+ });
+ }
+
+ // Kill the keyboard.
+ // XXX_jblas: We need to stop crawling the entire document to kill focus. Instead,
+ // we should be tracking focus with a delegate() handler so we already have
+ // the element in hand at this point.
+ // Wrap this in a try/catch block since IE9 throw "Unspecified error" if document.activeElement
+ // is undefined when we are in an IFrame.
+ try {
+ if ( document.activeElement && document.activeElement.nodeName.toLowerCase() !== 'body' ) {
+ $( document.activeElement ).blur();
+ } else {
+ $( "input:focus, textarea:focus, select:focus" ).blur();
+ }
+ } catch( e ) {}
+
+ // Record whether we are at a place in history where a dialog used to be - if so, do not add a new history entry and do not change the hash either
+ var alreadyThere = false;
+
+ // If we're displaying the page as a dialog, we don't want the url
+ // for the dialog content to be used in the hash. Instead, we want
+ // to append the dialogHashKey to the url of the current page.
+ if ( isDialog && active ) {
+ // on the initial page load active.url is undefined and in that case should
+ // be an empty string. Moving the undefined -> empty string back into
+ // urlHistory.addNew seemed imprudent given undefined better represents
+ // the url state
+
+ // If we are at a place in history that once belonged to a dialog, reuse
+ // this state without adding to urlHistory and without modifying the hash.
+ // However, if a dialog is already displayed at this point, and we're
+ // about to display another dialog, then we must add another hash and
+ // history entry on top so that one may navigate back to the original dialog
+ if ( active.url.indexOf( dialogHashKey ) > -1 && !$.mobile.activePage.is( ".ui-dialog" ) ) {
+ settings.changeHash = false;
+ alreadyThere = true;
+ }
+
+ // Normally, we tack on a dialog hash key, but if this is the location of a stale dialog,
+ // we reuse the URL from the entry
+ url = ( active.url || "" ) + ( alreadyThere ? "" : dialogHashKey );
+
+ // tack on another dialogHashKey if this is the same as the initial hash
+ // this makes sure that a history entry is created for this dialog
+ if ( urlHistory.activeIndex === 0 && url === urlHistory.initialDst ) {
+ url += dialogHashKey;
+ }
+ }
+
+ // Set the location hash.
+ if ( settings.changeHash !== false && url ) {
+ //disable hash listening temporarily
+ urlHistory.ignoreNextHashChange = true;
+ //update hash and history
+ path.set( url );
+ }
+
+ // if title element wasn't found, try the page div data attr too
+ // If this is a deep-link or a reload ( active === undefined ) then just use pageTitle
+ var newPageTitle = ( !active )? pageTitle : toPage.jqmData( "title" ) || toPage.children( ":jqmData(role='header')" ).find( ".ui-title" ).getEncodedText();
+ if ( !!newPageTitle && pageTitle === document.title ) {
+ pageTitle = newPageTitle;
+ }
+ if ( !toPage.jqmData( "title" ) ) {
+ toPage.jqmData( "title", pageTitle );
+ }
+
+ // Make sure we have a transition defined.
+ settings.transition = settings.transition ||
+ ( ( historyDir && !activeIsInitialPage ) ? active.transition : undefined ) ||
+ ( isDialog ? $.mobile.defaultDialogTransition : $.mobile.defaultPageTransition );
+
+ //add page to history stack if it's not back or forward
+ if ( !historyDir ) {
+ // Overwrite the current entry if it's a leftover from a dialog
+ if ( alreadyThere ) {
+ urlHistory.activeIndex = Math.max( 0, urlHistory.activeIndex - 1 );
+ }
+ urlHistory.addNew( url, settings.transition, pageTitle, pageUrl, settings.role );
+ }
+
+ //set page title
+ document.title = urlHistory.getActive().title;
+
+ //set "toPage" as activePage
+ $.mobile.activePage = toPage;
+
+ // If we're navigating back in the URL history, set reverse accordingly.
+ settings.reverse = settings.reverse || historyDir < 0;
+
+ transitionPages( toPage, fromPage, settings.transition, settings.reverse )
+ .done(function( name, reverse, $to, $from, alreadyFocused ) {
+ removeActiveLinkClass();
+
+ //if there's a duplicateCachedPage, remove it from the DOM now that it's hidden
+ if ( settings.duplicateCachedPage ) {
+ settings.duplicateCachedPage.remove();
+ }
+
+ // Send focus to the newly shown page. Moved from promise .done binding in transitionPages
+ // itself to avoid ie bug that reports offsetWidth as > 0 (core check for visibility)
+ // despite visibility: hidden addresses issue #2965
+ // https://github.com/jquery/jquery-mobile/issues/2965
+ if ( !alreadyFocused ) {
+ $.mobile.focusPage( toPage );
+ }
+
+ releasePageTransitionLock();
+
+ // Let listeners know we're all done changing the current page.
+ mpc.trigger( "pagechange", triggerData );
+ });
+ };
+
+ $.mobile.changePage.defaults = {
+ transition: undefined,
+ reverse: false,
+ changeHash: true,
+ fromHashChange: false,
+ role: undefined, // By default we rely on the role defined by the @data-role attribute.
+ duplicateCachedPage: undefined,
+ pageContainer: undefined,
+ showLoadMsg: true, //loading message shows by default when pages are being fetched during changePage
+ dataUrl: undefined,
+ fromPage: undefined,
+ allowSamePageTransition: false
+ };
+
+/* Event Bindings - hashchange, submit, and click */
+ function findClosestLink( ele )
+ {
+ while ( ele ) {
+ // Look for the closest element with a nodeName of "a".
+ // Note that we are checking if we have a valid nodeName
+ // before attempting to access it. This is because the
+ // node we get called with could have originated from within
+ // an embedded SVG document where some symbol instance elements
+ // don't have nodeName defined on them, or strings are of type
+ // SVGAnimatedString.
+ if ( ( typeof ele.nodeName === "string" ) && ele.nodeName.toLowerCase() === "a" ) {
+ break;
+ }
+ ele = ele.parentNode;
+ }
+ return ele;
+ }
+
+ // The base URL for any given element depends on the page it resides in.
+ function getClosestBaseUrl( ele )
+ {
+ // Find the closest page and extract out its url.
+ var url = $( ele ).closest( ".ui-page" ).jqmData( "url" ),
+ base = documentBase.hrefNoHash;
+
+ if ( !url || !path.isPath( url ) ) {
+ url = base;
+ }
+
+ return path.makeUrlAbsolute( url, base);
+ }
+
+ //The following event bindings should be bound after mobileinit has been triggered
+ //the following deferred is resolved in the init file
+ $.mobile.navreadyDeferred = $.Deferred();
+ $.mobile.navreadyDeferred.done(function() {
+ //bind to form submit events, handle with Ajax
+ $.mobile.$document.delegate( "form", "submit", function( event ) {
+ var $this = $( this );
+
+ if ( !$.mobile.ajaxEnabled ||
+ // test that the form is, itself, ajax false
+ $this.is( ":jqmData(ajax='false')" ) ||
+ // test that $.mobile.ignoreContentEnabled is set and
+ // the form or one of it's parents is ajax=false
+ !$this.jqmHijackable().length ) {
+ return;
+ }
+
+ var type = $this.attr( "method" ),
+ target = $this.attr( "target" ),
+ url = $this.attr( "action" );
+
+ // If no action is specified, browsers default to using the
+ // URL of the document containing the form. Since we dynamically
+ // pull in pages from external documents, the form should submit
+ // to the URL for the source document of the page containing
+ // the form.
+ if ( !url ) {
+ // Get the @data-url for the page containing the form.
+ url = getClosestBaseUrl( $this );
+ if ( url === documentBase.hrefNoHash ) {
+ // The url we got back matches the document base,
+ // which means the page must be an internal/embedded page,
+ // so default to using the actual document url as a browser
+ // would.
+ url = documentUrl.hrefNoSearch;
+ }
+ }
+
+ url = path.makeUrlAbsolute( url, getClosestBaseUrl( $this ) );
+
+ if ( ( path.isExternal( url ) && !path.isPermittedCrossDomainRequest( documentUrl, url ) ) || target ) {
+ return;
+ }
+
+ $.mobile.changePage(
+ url,
+ {
+ type: type && type.length && type.toLowerCase() || "get",
+ data: $this.serialize(),
+ transition: $.mobile.getAttrFixed( $this [0], "data-" + $.mobile.ns + "transition" ),
+ reverse: $.mobile.getAttrFixed( $this [0], "data-" + $.mobile.ns + "direction" ) === "reverse",
+ reloadPage: true
+ }
+ );
+ event.preventDefault();
+ });
+
+ //add active state on vclick
+ $.mobile.$document.bind( "vclick", function( event ) {
+ // if this isn't a left click we don't care. Its important to note
+ // that when the virtual event is generated it will create the which attr
+ if ( event.which > 1 || !$.mobile.linkBindingEnabled ) {
+ return;
+ }
+
+ var link = findClosestLink( event.target );
+
+ // split from the previous return logic to avoid find closest where possible
+ // TODO teach $.mobile.hijackable to operate on raw dom elements so the link wrapping
+ // can be avoided
+ if ( !$( link ).jqmHijackable().length ) {
+ return;
+ }
+
+ if ( link ) {
+ if ( path.parseUrl( link.getAttribute( "href" ) || "#" ).hash !== "#" ) {
+ removeActiveLinkClass( true );
+ $activeClickedLink = $( link ).closest( ".ui-btn" ).not( ".ui-disabled" );
+ $activeClickedLink.addClass( $.mobile.activeBtnClass );
+ }
+ }
+ });
+
+ // click routing - direct to HTTP or Ajax, accordingly
+ $.mobile.$document.bind( "click", function( event ) {
+ if ( !$.mobile.linkBindingEnabled ) {
+ return;
+ }
+
+ var link = findClosestLink( event.target ), $link = $( link ), httpCleanup;
+
+ // If there is no link associated with the click or its not a left
+ // click we want to ignore the click
+ // TODO teach $.mobile.hijackable to operate on raw dom elements so the link wrapping
+ // can be avoided
+ if ( !link || event.which > 1 || !$link.jqmHijackable().length ) {
+ return;
+ }
+
+ //remove active link class if external (then it won't be there if you come back)
+ httpCleanup = function() {
+ window.setTimeout(function() { removeActiveLinkClass( true ); }, 200 );
+ };
+
+ //if there's a data-rel=back attr, go back in history
+ if ( $link.is( ":jqmData(rel='back')" ) ) {
+ $.mobile.back();
+ return false;
+ }
+
+ var baseUrl = getClosestBaseUrl( $link ),
+
+ //get href, if defined, otherwise default to empty hash
+ href = path.makeUrlAbsolute( $link.attr( "href" ) || "#", baseUrl );
+
+ //if ajax is disabled, exit early
+ if ( !$.mobile.ajaxEnabled && !path.isEmbeddedPage( href ) ) {
+ httpCleanup();
+ //use default click handling
+ return;
+ }
+
+ // XXX_jblas: Ideally links to application pages should be specified as
+ // an url to the application document with a hash that is either
+ // the site relative path or id to the page. But some of the
+ // internal code that dynamically generates sub-pages for nested
+ // lists and select dialogs, just write a hash in the link they
+ // create. This means the actual URL path is based on whatever
+ // the current value of the base tag is at the time this code
+ // is called. For now we are just assuming that any url with a
+ // hash in it is an application page reference.
+ if ( href.search( "#" ) !== -1 ) {
+ href = href.replace( /[^#]*#/, "" );
+ if ( !href ) {
+ //link was an empty hash meant purely
+ //for interaction, so we ignore it.
+ event.preventDefault();
+ return;
+ } else if ( path.isPath( href ) ) {
+ //we have apath so make it the href we want to load.
+ href = path.makeUrlAbsolute( href, baseUrl );
+ } else {
+ //we have a simple id so use the documentUrl as its base.
+ href = path.makeUrlAbsolute( "#" + href, documentUrl.hrefNoHash );
+ }
+ }
+
+ // Should we handle this link, or let the browser deal with it?
+ var useDefaultUrlHandling = $link.is( "[rel='external']" ) || $link.is( ":jqmData(ajax='false')" ) || $link.is( "[target]" ),
+
+ // Some embedded browsers, like the web view in Phone Gap, allow cross-domain XHR
+ // requests if the document doing the request was loaded via the file:// protocol.
+ // This is usually to allow the application to "phone home" and fetch app specific
+ // data. We normally let the browser handle external/cross-domain urls, but if the
+ // allowCrossDomainPages option is true, we will allow cross-domain http/https
+ // requests to go through our page loading logic.
+
+ //check for protocol or rel and its not an embedded page
+ //TODO overlap in logic from isExternal, rel=external check should be
+ // moved into more comprehensive isExternalLink
+ isExternal = useDefaultUrlHandling || ( path.isExternal( href ) && !path.isPermittedCrossDomainRequest( documentUrl, href ) );
+
+ if ( isExternal ) {
+ httpCleanup();
+ //use default click handling
+ return;
+ }
+
+ //use ajax
+ var transition = $.mobile.getAttrFixed( $link [0], "data-" + $.mobile.ns + "transition" ),
+ reverse = $.mobile.getAttrFixed( $link [0], "data-" + $.mobile.ns + "direction" ) === "reverse" ||
+ // deprecated - remove by 1.0
+ $.mobile.getAttrFixed( $link [0], "data-" + $.mobile.ns + "back" ),
+
+ //this may need to be more specific as we use data-rel more
+ role = $link.attr( "data-" + $.mobile.ns + "rel" ) || undefined;
+
+ $.mobile.changePage( href, { transition: transition, reverse: reverse, role: role, link: $link } );
+ event.preventDefault();
+ });
+
+ //prefetch pages when anchors with data-prefetch are encountered
+ $.mobile.$document.delegate( ".ui-page", "pageshow.prefetch", function() {
+ var urls = [];
+ $( this ).find( "a:jqmData(prefetch)" ).each(function() {
+ var $link = $( this ),
+ url = $link.attr( "href" );
+
+ if ( url && $.inArray( url, urls ) === -1 ) {
+ urls.push( url );
+
+ $.mobile.loadPage( url, { role: $link.attr( "data-" + $.mobile.ns + "rel" ) } );
+ }
+ });
+ });
+
+ $.mobile._handleHashChange = function( hash ) {
+ //find first page via hash
+ var to = path.stripHash( hash ),
+ //transition is false if it's the first page, undefined otherwise (and may be overridden by default)
+ transition = $.mobile.urlHistory.stack.length === 0 ? "none" : undefined,
+
+ // "navigate" event fired to allow others to take advantage of the more robust hashchange handling
+ navEvent = new $.Event( "navigate" ),
+
+ // default options for the changPage calls made after examining the current state
+ // of the page and the hash
+ changePageOptions = {
+ transition: transition,
+ changeHash: false,
+ fromHashChange: true
+ };
+
+ if ( 0 === urlHistory.stack.length ) {
+ urlHistory.initialDst = to;
+ }
+
+ // We should probably fire the "navigate" event from those places that make calls to _handleHashChange,
+ // and have _handleHashChange hook into the "navigate" event instead of triggering it here
+ $.mobile.pageContainer.trigger( navEvent );
+ if ( navEvent.isDefaultPrevented() ) {
+ return;
+ }
+
+ //if listening is disabled (either globally or temporarily), or it's a dialog hash
+ if ( !$.mobile.hashListeningEnabled || urlHistory.ignoreNextHashChange ) {
+ urlHistory.ignoreNextHashChange = false;
+ return;
+ }
+
+ // special case for dialogs
+ if ( urlHistory.stack.length > 1 && to.indexOf( dialogHashKey ) > -1 && urlHistory.initialDst !== to ) {
+
+ // If current active page is not a dialog skip the dialog and continue
+ // in the same direction
+ if ( !$.mobile.activePage.is( ".ui-dialog" ) ) {
+ //determine if we're heading forward or backward and continue accordingly past
+ //the current dialog
+ urlHistory.directHashChange({
+ currentUrl: to,
+ isBack: function() { $.mobile.back(); },
+ isForward: function() { window.history.forward(); }
+ });
+
+ // prevent changePage()
+ return;
+ } else {
+ // if the current active page is a dialog and we're navigating
+ // to a dialog use the dialog objected saved in the stack
+ urlHistory.directHashChange({
+ currentUrl: to,
+
+ // regardless of the direction of the history change
+ // do the following
+ either: function( isBack ) {
+ var active = $.mobile.urlHistory.getActive();
+
+ to = active.pageUrl;
+
+ // make sure to set the role, transition and reversal
+ // as most of this is lost by the domCache cleaning
+ $.extend( changePageOptions, {
+ role: active.role,
+ transition: active.transition,
+ reverse: isBack
+ });
+ }
+ });
+ }
+ }
+
+ //if to is defined, load it
+ if ( to ) {
+ // At this point, 'to' can be one of 3 things, a cached page element from
+ // a history stack entry, an id, or site-relative/absolute URL. If 'to' is
+ // an id, we need to resolve it against the documentBase, not the location.href,
+ // since the hashchange could've been the result of a forward/backward navigation
+ // that crosses from an external page/dialog to an internal page/dialog.
+ to = ( typeof to === "string" && !path.isPath( to ) ) ? ( path.makeUrlAbsolute( '#' + to, documentBase ) ) : to;
+
+ // If we're about to go to an initial URL that contains a reference to a non-existent
+ // internal page, go to the first page instead. We know that the initial hash refers to a
+ // non-existent page, because the initial hash did not end up in the initial urlHistory entry
+ if ( to === path.makeUrlAbsolute( '#' + urlHistory.initialDst, documentBase ) &&
+ urlHistory.stack.length && urlHistory.stack[0].url !== urlHistory.initialDst.replace( dialogHashKey, "" ) ) {
+ to = $.mobile.firstPage;
+ }
+ $.mobile.changePage( to, changePageOptions );
+ } else {
+ //there's no hash, go to the first page in the dom
+ $.mobile.changePage( $.mobile.firstPage, changePageOptions );
+ }
+ };
+
+ //hashchange event handler
+ $window.bind( "hashchange", function( e, triggered ) {
+ // Firefox auto-escapes the location.hash as for v13 but
+ // leaves the href untouched
+ $.mobile._handleHashChange( path.parseLocation().hash );
+ });
+
+ });//navreadyDeferred done callback
+
+})( jQuery );
--- /dev/null
+(function( $, window ) {
+ // For now, let's Monkeypatch this onto the end of $.mobile._registerInternalEvents
+ // Scope self to pushStateHandler so we can reference it sanely within the
+ // methods handed off as event handlers
+ var pushStateHandler = {},
+ self = pushStateHandler,
+ $win = $.mobile.$window,
+ url = $.mobile.path.parseLocation(),
+ mobileinitDeferred = $.Deferred(),
+ domreadyDeferred = $.Deferred();
+
+ $.mobile.$document.ready( $.proxy( domreadyDeferred, "resolve" ) );
+
+ $.mobile.$document.one( "mobileinit", $.proxy( mobileinitDeferred, "resolve" ) );
+
+ $.extend( pushStateHandler, {
+ // TODO move to a path helper, this is rather common functionality
+ initialFilePath: (function() {
+ return url.pathname + url.search;
+ })(),
+
+ hashChangeTimeout: 200,
+
+ hashChangeEnableTimer: undefined,
+
+ initialHref: url.hrefNoHash,
+
+ state: function() {
+ return {
+ // firefox auto decodes the url when using location.hash but not href
+ hash: $.mobile.path.parseLocation().hash || "#" + self.initialFilePath,
+ title: document.title,
+
+ // persist across refresh
+ initialHref: self.initialHref
+ };
+ },
+
+ resetUIKeys: function( url ) {
+ var dialog = $.mobile.dialogHashKey,
+ subkey = "&" + $.mobile.subPageUrlKey,
+ dialogIndex = url.indexOf( dialog );
+
+ if ( dialogIndex > -1 ) {
+ url = url.slice( 0, dialogIndex ) + "#" + url.slice( dialogIndex );
+ } else if ( url.indexOf( subkey ) > -1 ) {
+ url = url.split( subkey ).join( "#" + subkey );
+ }
+
+ return url;
+ },
+
+ // TODO sort out a single barrier to hashchange functionality
+ nextHashChangePrevented: function( value ) {
+ $.mobile.urlHistory.ignoreNextHashChange = value;
+ self.onHashChangeDisabled = value;
+ },
+
+ // on hash change we want to clean up the url
+ // NOTE this takes place *after* the vanilla navigation hash change
+ // handling has taken place and set the state of the DOM
+ onHashChange: function( e ) {
+ // disable this hash change
+ if ( self.onHashChangeDisabled ) {
+ return;
+ }
+
+ var href, state,
+ // firefox auto decodes the url when using location.hash but not href
+ hash = $.mobile.path.parseLocation().hash,
+ isPath = $.mobile.path.isPath( hash ),
+ resolutionUrl = isPath ? $.mobile.path.getLocation() : $.mobile.getDocumentUrl();
+
+ hash = isPath ? hash.replace( "#", "" ) : hash;
+
+
+ // propulate the hash when its not available
+ state = self.state();
+
+ // make the hash abolute with the current href
+ href = $.mobile.path.makeUrlAbsolute( hash, resolutionUrl );
+
+ if ( isPath ) {
+ href = self.resetUIKeys( href );
+ }
+
+ // replace the current url with the new href and store the state
+ // Note that in some cases we might be replacing an url with the
+ // same url. We do this anyways because we need to make sure that
+ // all of our history entries have a state object associated with
+ // them. This allows us to work around the case where $.mobile.back()
+ // is called to transition from an external page to an embedded page.
+ // In that particular case, a hashchange event is *NOT* generated by the browser.
+ // Ensuring each history entry has a state object means that onPopState()
+ // will always trigger our hashchange callback even when a hashchange event
+ // is not fired.
+ history.replaceState( state, document.title, href );
+ },
+
+ // on popstate (ie back or forward) we need to replace the hash that was there previously
+ // cleaned up by the additional hash handling
+ onPopState: function( e ) {
+ var poppedState = e.originalEvent.state,
+ fromHash, toHash, hashChanged;
+
+ // if there's no state its not a popstate we care about, eg chrome's initial popstate
+ if ( poppedState ) {
+ // if we get two pop states in under this.hashChangeTimeout
+ // make sure to clear any timer set for the previous change
+ clearTimeout( self.hashChangeEnableTimer );
+
+ // make sure to enable hash handling for the the _handleHashChange call
+ self.nextHashChangePrevented( false );
+
+ // change the page based on the hash in the popped state
+ $.mobile._handleHashChange( poppedState.hash );
+
+ // prevent any hashchange in the next self.hashChangeTimeout
+ self.nextHashChangePrevented( true );
+
+ // re-enable hash change handling after swallowing a possible hash
+ // change event that comes on all popstates courtesy of browsers like Android
+ self.hashChangeEnableTimer = setTimeout( function() {
+ self.nextHashChangePrevented( false );
+ }, self.hashChangeTimeout );
+ }
+ },
+
+ init: function() {
+ $win.bind( "hashchange", self.onHashChange );
+
+ // Handle popstate events the occur through history changes
+ $win.bind( "popstate", self.onPopState );
+
+ // if there's no hash, we need to replacestate for returning to home
+ if ( location.hash === "" ) {
+ history.replaceState( self.state(), document.title, $.mobile.path.getLocation() );
+ }
+ }
+ });
+
+ // We need to init when "mobileinit", "domready", and "navready" have all happened
+ $.when( domreadyDeferred, mobileinitDeferred, $.mobile.navreadyDeferred ).done(function() {
+ if ( $.mobile.pushStateEnabled && $.support.pushState ) {
+ pushStateHandler.init();
+ }
+ });
+})( jQuery, this );
--- /dev/null
+(function( $, undefined ) {
+
+$.mobile.$document.bind( "pagecreate create", function( e ) {
+ $( ":jqmData(role='nojs')", e.target ).addClass( "ui-nojs" );
+
+});
+
+})( jQuery );
--- /dev/null
+(function( $, undefined ) {
+
+// thx Modernizr
+function propExists( prop ) {
+ var uc_prop = prop.charAt( 0 ).toUpperCase() + prop.substr( 1 ),
+ props = ( prop + " " + vendors.join( uc_prop + " " ) + uc_prop ).split( " " );
+
+ for ( var v in props ) {
+ if ( fbCSS[ props[ v ] ] !== undefined ) {
+ return true;
+ }
+ }
+}
+
+var fakeBody = $( "<body>" ).prependTo( "html" ),
+ fbCSS = fakeBody[ 0 ].style,
+ vendors = [ "Webkit", "Moz", "O" ],
+ webos = "palmGetResource" in window, //only used to rule out scrollTop
+ opera = window.opera,
+ operamini = window.operamini && ({}).toString.call( window.operamini ) === "[object OperaMini]",
+ bb = window.blackberry && !propExists( "-webkit-transform" ); //only used to rule out box shadow, as it's filled opaque on BB 5 and lower
+
+
+function validStyle( prop, value, check_vend ) {
+ var div = document.createElement( 'div' ),
+ uc = function( txt ) {
+ return txt.charAt( 0 ).toUpperCase() + txt.substr( 1 );
+ },
+ vend_pref = function( vend ) {
+ return "-" + vend.charAt( 0 ).toLowerCase() + vend.substr( 1 ) + "-";
+ },
+ check_style = function( vend ) {
+ var vend_prop = vend_pref( vend ) + prop + ": " + value + ";",
+ uc_vend = uc( vend ),
+ propStyle = uc_vend + uc( prop );
+
+ div.setAttribute( "style", vend_prop );
+
+ if ( !!div.style[ propStyle ] ) {
+ ret = true;
+ }
+ },
+ check_vends = check_vend ? [ check_vend ] : vendors,
+ ret;
+
+ for( var i = 0; i < check_vends.length; i++ ) {
+ check_style( check_vends[i] );
+ }
+ return !!ret;
+}
+
+// Thanks to Modernizr src for this test idea. `perspective` check is limited to Moz to prevent a false positive for 3D transforms on Android.
+function transform3dTest() {
+ var prop = "transform-3d";
+ return validStyle( 'perspective', '10px', 'moz' ) || $.mobile.media( "(-" + vendors.join( "-" + prop + "),(-" ) + "-" + prop + "),(" + prop + ")" );
+}
+
+// Test for dynamic-updating base tag support ( allows us to avoid href,src attr rewriting )
+function baseTagTest() {
+ var fauxBase = location.protocol + "//" + location.host + location.pathname + "ui-dir/",
+ base = $( "head base" ),
+ fauxEle = null,
+ href = "",
+ link, rebase;
+
+ if ( !base.length ) {
+ base = fauxEle = $( "<base>", { "href": fauxBase }).appendTo( "head" );
+ } else {
+ href = base.attr( "href" );
+ }
+
+ link = $( "<a href='testurl' />" ).prependTo( fakeBody );
+ rebase = link[ 0 ].href;
+ base[ 0 ].href = href || location.pathname;
+
+ if ( fauxEle ) {
+ fauxEle.remove();
+ }
+ return rebase.indexOf( fauxBase ) === 0;
+}
+
+// Thanks Modernizr
+function cssPointerEventsTest() {
+ var element = document.createElement( 'x' ),
+ documentElement = document.documentElement,
+ getComputedStyle = window.getComputedStyle,
+ supports;
+
+ if ( !( 'pointerEvents' in element.style ) ) {
+ return false;
+ }
+
+ element.style.pointerEvents = 'auto';
+ element.style.pointerEvents = 'x';
+ documentElement.appendChild( element );
+ supports = getComputedStyle &&
+ getComputedStyle( element, '' ).pointerEvents === 'auto';
+ documentElement.removeChild( element );
+ return !!supports;
+}
+
+function boundingRect() {
+ var div = document.createElement( "div" );
+ return typeof div.getBoundingClientRect !== "undefined";
+}
+
+// non-UA-based IE version check by James Padolsey, modified by jdalton - from http://gist.github.com/527683
+// allows for inclusion of IE 6+, including Windows Mobile 7
+$.extend( $.mobile, { browser: {} } );
+$.mobile.browser.ie = (function() {
+ var v = 3,
+ div = document.createElement( "div" ),
+ a = div.all || [];
+
+ do {
+ div.innerHTML = "<!--[if gt IE " + ( ++v ) + "]><br><![endif]-->";
+ } while( a[0] );
+
+ return v > 4 ? v : !v;
+})();
+
+
+$.extend( $.support, {
+ cssTransitions: "WebKitTransitionEvent" in window || validStyle( 'transition', 'height 100ms linear' ) && !opera,
+ pushState: "pushState" in history && "replaceState" in history,
+ mediaquery: $.mobile.media( "only all" ),
+ cssPseudoElement: !!propExists( "content" ),
+ touchOverflow: !!propExists( "overflowScrolling" ),
+ cssTransform3d: transform3dTest(),
+ boxShadow: !!propExists( "boxShadow" ) && !bb,
+ scrollTop: ( "pageXOffset" in window || "scrollTop" in document.documentElement || "scrollTop" in fakeBody[ 0 ] ) && !webos && !operamini,
+ dynamicBaseTag: baseTagTest(),
+ cssPointerEvents: cssPointerEventsTest(),
+ boundingRect: boundingRect()
+});
+
+fakeBody.remove();
+
+
+// $.mobile.ajaxBlacklist is used to override ajaxEnabled on platforms that have known conflicts with hash history updates (BB5, Symbian)
+// or that generally work better browsing in regular http for full page refreshes (Opera Mini)
+// Note: This detection below is used as a last resort.
+// We recommend only using these detection methods when all other more reliable/forward-looking approaches are not possible
+var nokiaLTE7_3 = (function() {
+
+ var ua = window.navigator.userAgent;
+
+ //The following is an attempt to match Nokia browsers that are running Symbian/s60, with webkit, version 7.3 or older
+ return ua.indexOf( "Nokia" ) > -1 &&
+ ( ua.indexOf( "Symbian/3" ) > -1 || ua.indexOf( "Series60/5" ) > -1 ) &&
+ ua.indexOf( "AppleWebKit" ) > -1 &&
+ ua.match( /(BrowserNG|NokiaBrowser)\/7\.[0-3]/ );
+})();
+
+// Support conditions that must be met in order to proceed
+// default enhanced qualifications are media query support OR IE 7+
+
+$.mobile.gradeA = function() {
+ return ( $.support.mediaquery || $.mobile.browser.ie && $.mobile.browser.ie >= 7 ) && ( $.support.boundingRect || $.fn.jquery.match(/1\.[0-7+]\.[0-9+]?/) !== null );
+};
+
+$.mobile.ajaxBlacklist =
+ // BlackBerry browsers, pre-webkit
+ window.blackberry && !window.WebKitPoint ||
+ // Opera Mini
+ operamini ||
+ // Symbian webkits pre 7.3
+ nokiaLTE7_3;
+
+// Lastly, this workaround is the only way we've found so far to get pre 7.3 Symbian webkit devices
+// to render the stylesheets when they're referenced before this script, as we'd recommend doing.
+// This simply reappends the CSS in place, which for some reason makes it apply
+if ( nokiaLTE7_3 ) {
+ $(function() {
+ $( "head link[rel='stylesheet']" ).attr( "rel", "alternate stylesheet" ).attr( "rel", "stylesheet" );
+ });
+}
+
+// For ruling out shadows via css
+if ( !$.support.boxShadow ) {
+ $( "html" ).addClass( "ui-mobile-nosupport-boxshadow" );
+}
+
+})( jQuery );
--- /dev/null
+ (function( $, undefined ) {
+ $.extend( $.support, {
+ orientation: "orientation" in window && "onorientationchange" in window
+ });
+ }( jQuery ));
--- /dev/null
+ (function( $, undefined ) {
+ var support = {
+ touch: "ontouchend" in document
+ };
+
+ $.mobile = $.mobile || {};
+ $.mobile.support = $.mobile.support || {};
+ $.extend( $.support, support );
+ $.extend( $.mobile.support, support );
+ }( jQuery ));
--- /dev/null
+
+ensureNS("jQuery.mobile.tizen.clrlib");
+
+jQuery.extend( jQuery.mobile.tizen.clrlib,
+{
+ nearestInt: function(val) {
+ var theFloor = Math.floor(val);
+
+ return (((val - theFloor) > 0.5) ? (theFloor + 1) : theFloor);
+ },
+
+ /*
+ * Converts html color string to rgb array.
+ *
+ * Input: string clr_str, where
+ * clr_str is of the form "#aabbcc"
+ *
+ * Returns: [ r, g, b ], where
+ * r is in [0, 1]
+ * g is in [0, 1]
+ * b is in [0, 1]
+ */
+ HTMLToRGB: function(clr_str) {
+ clr_str = (('#' == clr_str.charAt(0)) ? clr_str.substring(1) : clr_str);
+
+ return ([
+ clr_str.substring(0, 2),
+ clr_str.substring(2, 4),
+ clr_str.substring(4, 6)
+ ].map(function(val) {
+ return parseInt(val, 16) / 255.0;
+ }));
+ },
+
+ /*
+ * Converts rgb array to html color string.
+ *
+ * Input: [ r, g, b ], where
+ * r is in [0, 1]
+ * g is in [0, 1]
+ * b is in [0, 1]
+ *
+ * Returns: string of the form "#aabbcc"
+ */
+ RGBToHTML: function(rgb) {
+ return ("#" +
+ rgb.map(function(val) {
+ var ret = val * 255,
+ theFloor = Math.floor(ret);
+
+ ret = ((ret - theFloor > 0.5) ? (theFloor + 1) : theFloor);
+ ret = (((ret < 16) ? "0" : "") + (ret & 0xff).toString(16));
+ return ret;
+ })
+ .join(""));
+ },
+
+ /*
+ * Converts hsl to rgb.
+ *
+ * From http://130.113.54.154/~monger/hsl-rgb.html
+ *
+ * Input: [ h, s, l ], where
+ * h is in [0, 360]
+ * s is in [0, 1]
+ * l is in [0, 1]
+ *
+ * Returns: [ r, g, b ], where
+ * r is in [0, 1]
+ * g is in [0, 1]
+ * b is in [0, 1]
+ */
+ HSLToRGB: function(hsl) {
+ var h = hsl[0] / 360.0, s = hsl[1], l = hsl[2];
+
+ if (0 === s)
+ return [ l, l, l ];
+
+ var temp2 = ((l < 0.5)
+ ? l * (1.0 + s)
+ : l + s - l * s),
+ temp1 = 2.0 * l - temp2,
+ temp3 = {
+ r: h + 1.0 / 3.0,
+ g: h,
+ b: h - 1.0 / 3.0
+ };
+
+ temp3.r = ((temp3.r < 0) ? (temp3.r + 1.0) : ((temp3.r > 1) ? (temp3.r - 1.0) : temp3.r));
+ temp3.g = ((temp3.g < 0) ? (temp3.g + 1.0) : ((temp3.g > 1) ? (temp3.g - 1.0) : temp3.g));
+ temp3.b = ((temp3.b < 0) ? (temp3.b + 1.0) : ((temp3.b > 1) ? (temp3.b - 1.0) : temp3.b));
+
+ ret = [
+ (((6.0 * temp3.r) < 1) ? (temp1 + (temp2 - temp1) * 6.0 * temp3.r) :
+ (((2.0 * temp3.r) < 1) ? temp2 :
+ (((3.0 * temp3.r) < 2) ? (temp1 + (temp2 - temp1) * ((2.0 / 3.0) - temp3.r) * 6.0) :
+ temp1))),
+ (((6.0 * temp3.g) < 1) ? (temp1 + (temp2 - temp1) * 6.0 * temp3.g) :
+ (((2.0 * temp3.g) < 1) ? temp2 :
+ (((3.0 * temp3.g) < 2) ? (temp1 + (temp2 - temp1) * ((2.0 / 3.0) - temp3.g) * 6.0) :
+ temp1))),
+ (((6.0 * temp3.b) < 1) ? (temp1 + (temp2 - temp1) * 6.0 * temp3.b) :
+ (((2.0 * temp3.b) < 1) ? temp2 :
+ (((3.0 * temp3.b) < 2) ? (temp1 + (temp2 - temp1) * ((2.0 / 3.0) - temp3.b) * 6.0) :
+ temp1)))];
+
+ return ret;
+ },
+
+ /*
+ * Converts hsv to rgb.
+ *
+ * Input: [ h, s, v ], where
+ * h is in [0, 360]
+ * s is in [0, 1]
+ * v is in [0, 1]
+ *
+ * Returns: [ r, g, b ], where
+ * r is in [0, 1]
+ * g is in [0, 1]
+ * b is in [0, 1]
+ */
+ HSVToRGB: function(hsv) {
+ return $.mobile.tizen.clrlib.HSLToRGB($.mobile.tizen.clrlib.HSVToHSL(hsv));
+ },
+
+ /*
+ * Converts rgb to hsv.
+ *
+ * from http://coecsl.ece.illinois.edu/ge423/spring05/group8/FinalProject/HSV_writeup.pdf
+ *
+ * Input: [ r, g, b ], where
+ * r is in [0, 1]
+ * g is in [0, 1]
+ * b is in [0, 1]
+ *
+ * Returns: [ h, s, v ], where
+ * h is in [0, 360]
+ * s is in [0, 1]
+ * v is in [0, 1]
+ */
+ RGBToHSV: function(rgb) {
+ var min, max, delta, h, s, v, r = rgb[0], g = rgb[1], b = rgb[2];
+
+ min = Math.min(r, Math.min(g, b));
+ max = Math.max(r, Math.max(g, b));
+ delta = max - min;
+
+ h = 0;
+ s = 0;
+ v = max;
+
+ if (delta > 0.00001) {
+ s = delta / max;
+
+ if (r === max)
+ h = (g - b) / delta ;
+ else
+ if (g === max)
+ h = 2 + (b - r) / delta ;
+ else
+ h = 4 + (r - g) / delta ;
+
+ h *= 60 ;
+
+ if (h < 0)
+ h += 360 ;
+ }
+
+ return [h, s, v];
+ },
+
+ /*
+ * Converts hsv to hsl.
+ *
+ * Input: [ h, s, v ], where
+ * h is in [0, 360]
+ * s is in [0, 1]
+ * v is in [0, 1]
+ *
+ * Returns: [ h, s, l ], where
+ * h is in [0, 360]
+ * s is in [0, 1]
+ * l is in [0, 1]
+ */
+ HSVToHSL: function(hsv) {
+ var max = hsv[2],
+ delta = hsv[1] * max,
+ min = max - delta,
+ sum = max + min,
+ half_sum = sum / 2,
+ s_divisor = ((half_sum < 0.5) ? sum : (2 - max - min));
+
+ return [ hsv[0], ((0 == s_divisor) ? 0 : (delta / s_divisor)), half_sum ];
+ },
+
+ /*
+ * Converts rgb to hsl
+ *
+ * Input: [ r, g, b ], where
+ * r is in [0, 1]
+ * g is in [0, 1]
+ * b is in [0, 1]
+ *
+ * Returns: [ h, s, l ], where
+ * h is in [0, 360]
+ * s is in [0, 1]
+ * l is in [0, 1]
+ */
+ RGBToHSL: function(rgb) {
+ return $.mobile.tizen.clrlib.HSVToHSL($.mobile.tizen.clrlib.RGBToHSV(rgb));
+ }
+});
+
--- /dev/null
+
+/*
+ * set TIZEN specific configures
+ */
+
+( function( $, window, undefined ) {
+
+ /* set default transition */
+ $.mobile.defaultPageTransition = "none";
+
+ /* depth transition */
+ $.mobile.transitionHandlers.depth = $.mobile.transitionHandlers.simultaneous;
+ $.mobile.transitionFallbacks.depth = "fade";
+
+ /* Button data-corners default value */
+ $.fn.buttonMarkup.defaults.corners = false;
+
+ /* button hover delay */
+ $.mobile.buttonMarkup.hoverDelay = 0;
+
+})( jQuery, this );
+
+
--- /dev/null
+
+/*
+ * jQuery Mobile Widget @VERSION
+ *
+ * TODO: remove unnecessary codes....
+ *
+ * This software is licensed under the MIT licence (as defined by the OSI at
+ * http://www.opensource.org/licenses/mit-license.php)
+ *
+ * ***************************************************************************
+ * Copyright (C) 2011 by Intel Corporation Ltd.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * ***************************************************************************
+ *
+ * Authors: Kalyan Kondapally <kalyan.kondapally@intel.com>
+ */
+
+ensureNS("jQuery.mobile.tizen");
+
+(function () {
+jQuery.extend(jQuery.mobile.tizen, {
+ disableSelection: function (element) {
+ var self = this;
+ $(element).find('*').each( function() {
+ if( ( $(this).get(0).tagName !== 'INPUT' &&
+ $(this).attr("type") !== 'text' ) &&
+ $(this).get(0).tagName !== 'TEXTAREA' ) {
+ self.enableSelection( this, 'none' );
+ }
+ } );
+ return true;
+ },
+
+ enableSelection: function (element, value) {
+ return $(element).each( function () {
+ switch( value ) {
+ case 'text' :
+ case 'auto' :
+ case 'none' :
+ val = value;
+ break;
+
+ default :
+ val = 'auto';
+ break;
+ }
+ $(this).css( {
+ 'user-select': val,
+ '-moz-user-select': val,
+ '-webkit-user-select': val,
+ '-o-user-select': val,
+ '-ms-transform': val
+ } );
+ } );
+ },
+
+ disableContextMenu: function(element) {
+ var self = this;
+ $(element).find('*').each( function() {
+ if( ( $(this).get(0).tagName !== 'INPUT' &&
+ $(this).attr("type") !== 'text' ) &&
+ $(this).get(0).tagName !== 'TEXTAREA' ) {
+ self._disableContextMenu( this );
+ }
+ } );
+ },
+
+ _disableContextMenu: function(element) {
+
+ $(element).each( function() {
+ $(this).bind("contextmenu", function( event ) {
+ return false;
+ } );
+ } );
+ },
+
+ enableContextMenu: function(element) {
+ $(element).each( function() {
+ $(this).unbind( "contextmenu" );
+ } );
+ },
+
+ // Get document-relative mouse coordinates from a given event
+ // From: http://www.quirksmode.org/js/events_properties.html#position
+ documentRelativeCoordsFromEvent: function(ev) {
+ var e = ev ? ev : window.event,
+ client = { x: e.clientX, y: e.clientY },
+ page = { x: e.pageX, y: e.pageY },
+ posx = 0,
+ posy = 0;
+
+ // Grab useful coordinates from touch events
+ if (e.type.match(/^touch/)) {
+ page = {
+ x: e.originalEvent.targetTouches[0].pageX,
+ y: e.originalEvent.targetTouches[0].pageY
+ };
+ client = {
+ x: e.originalEvent.targetTouches[0].clientX,
+ y: e.originalEvent.targetTouches[0].clientY
+ };
+ }
+
+ if (page.x || page.y) {
+ posx = page.x;
+ posy = page.y;
+ }
+ else
+ if (client.x || client.y) {
+ posx = client.x + document.body.scrollLeft + document.documentElement.scrollLeft;
+ posy = client.y + document.body.scrollTop + document.documentElement.scrollTop;
+ }
+
+ return { x: posx, y: posy };
+ },
+
+ // TODO : offsetX, offsetY. touch events don't have offsetX and offsetY. support for touch devices.
+ // check algorithm...
+ targetRelativeCoordsFromEvent: function(e) {
+ var coords = { x: e.offsetX, y: e.offsetY };
+
+ if (coords.x === undefined || isNaN(coords.x) ||
+ coords.y === undefined || isNaN(coords.y)) {
+ var offset = $(e.target).offset();
+ //coords = documentRelativeCoordsFromEvent(e); // Old code. Must be checked again.
+ coords = $.mobile.tizen.documentRelativeCoordsFromEvent(e);
+ coords.x -= offset.left;
+ coords.y -= offset.top;
+ }
+
+ return coords;
+ }
+});
+
+})();
+
--- /dev/null
+
+/**
+ * @class core
+ * loader.js
+ *
+ * Youmin Ha <youmin.ha@samsung.com>
+ *
+ *
+ */
+/*
+ Web UI scaling concept in Tizen Web UI
+
+Generally, web applications must be designed to be showed acceptable on various size and resolution of screens, and web winsets have to be scaled well. Tizen Web UI Framework supports various viewport settings, and Tizen Web UI widgets are designed to be scalable on various screen sizes. In order to make web applications scalable on many devices which have different screen size, it is necessary to understand how mobile web browsers deal with screen resolution, and how Tizen Web UI Framework supports scaling for web applications.
+
+
+* Viewport on mobile web browser
+
+Viewport is an area showing web content on the browser. Unlike desktop browsers, mobile browsers support logical viewport seting, which means that application can set viewport width/height and zoom level by itself.
+The very important thing that to be remembered is that the viewport resolution in pixel is 'Logical', not physical. For example, if the viewport width is set to 480 on a mobile device having 720px screen width, the viewport width is considered to 480px logically. All elements put on right side from 480px horizontal position will not be shown on the viewport.
+Most mobile browsers set viewport with given content attribute with <meta name="viewport" content="..."> tag in <head> section in the application source html, whereas desktop browsers ignore the tag.
+Detailed usage of viewport meta tag is found in here: http://www.w3.org/TR/mwabp/#bp-viewport
+
+
+* Viewport setting by application developers
+
+When developers write <meta name="viewport" content="..."> in the <head> section of the web application HTML file, Tizen Web UI Framework does not add another viewport meta tag, nor modify developer-defined viewport.
+
+
+* Automatic viewport setting by Tizen Web UI Framework
+
+If developers do not give a viewport meta tag, Tizen Web UI Framework automatically add a viewport meta tag with default viewport setting.
+
+
+* Portrait/landscape mode
+
+
+* Tizen Web UI widgets scaling
+
+
+ */
+( function ($, Globalize, window, undefined) {
+
+ var tizen = {
+ libFileName : "tizen-web-ui-fw(.min)?.js",
+
+ frameworkData : {
+ rootDir: '/usr/lib/tizen-web-ui-fw',
+ version: '0.1',
+ theme: "tizen-white",
+ viewportWidth: "device-width",
+ viewportScale: false,
+
+ defaultFontSize: 22,
+ minified: false,
+
+ debug: false
+ },
+
+ log : {
+ debug : function ( msg ) {
+ if ( tizen.frameworkData.debug ) {
+ console.log( msg );
+ }
+ },
+ warn : function ( msg ) {
+ console.warn( msg );
+ },
+ error : function ( msg ) {
+ console.error( msg );
+ },
+ alert : function ( msg ) {
+ window.alert( msg );
+ }
+ },
+
+ util : {
+
+ loadScriptSync : function ( scriptPath, successCB, errorCB ) {
+ $.ajax( {
+ url: scriptPath,
+ dataType: 'script',
+ async: false,
+ crossDomain: false,
+ success: successCB,
+ error: function ( jqXHR, textStatus, errorThrown ) {
+ if ( errorCB ) {
+ errorCB( jqXHR, textStatus, errorThrown );
+ } else {
+ var ignoreStatusList = [ 404 ], // 404: not found
+ errmsg = ( 'Error while loading ' + scriptPath + '\n' + jqXHR.status + ':' + jqXHR.statusText );
+ if ( -1 == $.inArray( jqXHR.status, ignoreStatusList ) ) {
+ tizen.log.alert( errmsg );
+ } else {
+ tizen.log.warn( errmsg );
+ }
+ }
+ }
+ } );
+ },
+ isMobileBrowser: function ( ) {
+ var mobileIdx = window.navigator.appVersion.indexOf("Mobile"),
+ isMobile = -1 < mobileIdx;
+ return isMobile;
+ }
+ },
+
+ css : {
+ cacheBust: ( document.location.href.match( /debug=true/ ) ) ?
+ '?cacheBust=' + ( new Date( ) ).getTime( ) :
+ '',
+ addElementToHead : function ( elem ) {
+ var head = document.getElementsByTagName( 'head' )[0];
+ if ( head ) {
+ $( head ).prepend( elem );
+ }
+ },
+ makeLink : function ( href ) {
+ var cssLink = document.createElement( 'link' );
+ cssLink.setAttribute( 'rel', 'stylesheet' );
+ cssLink.setAttribute( 'href', href );
+ cssLink.setAttribute( 'name', 'tizen-theme' );
+ return cssLink;
+ },
+ load: function ( path ) {
+ var head = document.getElementsByTagName( 'head' )[0],
+ cssLinks = head.getElementsByTagName( 'link' ),
+ idx,
+ l = null;
+ // Find css link element
+ for ( idx = 0; idx < cssLinks.length; idx++ ) {
+ if ( cssLinks[idx].getAttribute( 'rel' ) != "stylesheet" ) {
+ continue;
+ }
+ if ( cssLinks[idx].getAttribute( 'name' ) == "tizen-theme"
+ || cssLinks[idx].getAttribute( 'href' ) == path ) {
+ l = cssLinks[idx];
+ break;
+ }
+ }
+ if ( l ) { // Found the link element!
+ if ( l.getAttribute( 'href' ) == path ) {
+ tizen.log.warn( "Theme is already loaded. Skip theme loading in the framework." );
+ } else {
+ l.setAttribute( 'href', path );
+ }
+ } else {
+ this.addElementToHead( this.makeLink( path ) );
+ }
+ }
+ },
+
+ getParams: function ( ) {
+ /* Get data-* params from <script> tag, and set tizen.frameworkData.* values
+ * Returns true if proper <script> tag is found, or false if not.
+ */
+ // Find current <script> tag element
+ var scriptElems = document.getElementsByTagName( 'script' ),
+ val = null,
+ foundScriptTag = false,
+ idx,
+ elem,
+ src,
+ tokens,
+ version_idx;
+
+ function getTizenTheme( ) {
+ var t = navigator.theme ? navigator.theme.split( ':' )[0] : null;
+ if ( t ) {
+ t = t.replace('-hd', '');
+ if ( ! t.match( /^tizen-/ ) ) {
+ t = 'tizen-' + t;
+ }
+ }
+ return t;
+ }
+
+ for ( idx in scriptElems ) {
+ elem = scriptElems[idx];
+ src = elem.src ? elem.getAttribute( 'src' ) : undefined;
+ if (src && src.match( this.libFileName )) {
+ // Set framework data, only when they are given.
+ tokens = src.split(/[\/\\]/);
+ version_idx = -3;
+ this.frameworkData.rootDir = ( elem.getAttribute( 'data-framework-root' )
+ || tokens.slice( 0, tokens.length + version_idx ).join( '/' )
+ || this.frameworkData.rootDir ).replace( /^file:(\/\/)?/, '' );
+ this.frameworkData.version = elem.getAttribute( 'data-framework-version' )
+ || tokens[ tokens.length + version_idx ]
+ || this.frameworkData.version;
+ this.frameworkData.theme = elem.getAttribute( 'data-framework-theme' )
+ || getTizenTheme( )
+ || this.frameworkData.theme;
+ this.frameworkData.viewportWidth = elem.getAttribute( 'data-framework-viewport-width' )
+ || this.frameworkData.viewportWidth;
+ this.frameworkData.viewportScale =
+ "true" === elem.getAttribute( 'data-framework-viewport-scale' ) ? true
+ : this.frameworkData.viewportScale;
+ this.frameworkData.minified = src.search(/\.min\.js$/) > -1 ? true : false;
+ this.frameworkData.debug = "true" === elem.getAttribute( 'data-framework-debug' ) ? true
+ : this.frameworkData.debug;
+ foundScriptTag = true;
+ break;
+ }
+ }
+ return foundScriptTag;
+ },
+
+ loadTheme: function ( theme ) {
+ var themePath,
+ cssPath,
+ jsPath;
+
+ if ( ! theme ) {
+ theme = tizen.frameworkData.theme;
+ }
+ themePath = [
+ tizen.frameworkData.rootDir,
+ tizen.frameworkData.version,
+ 'themes',
+ theme
+ ].join( '/' );
+
+ jsPath = [ themePath, 'theme.js' ].join( '/' );
+
+ if ( tizen.frameworkData.minified ) {
+ cssPath = [themePath, 'tizen-web-ui-fw-theme.min.css'].join( '/' );
+ } else {
+ cssPath = [themePath, 'tizen-web-ui-fw-theme.css'].join( '/' );
+ }
+ tizen.css.load( cssPath );
+ tizen.util.loadScriptSync( jsPath );
+ },
+
+ /** Load Globalize culture file, and set default culture.
+ * @param[in] language (optional) Language code. ex) en-US, en, ko-KR, ko
+ * If language is not given, read language from html 'lang' attribute,
+ * or from system setting.
+ * @param[in] cultureDic (optional) Dictionary having language code->
+ */
+ loadGlobalizeCulture: function ( language, cultureDic ) {
+ var self = this,
+ cFPath,
+ lang,
+ mockJSXHR;
+
+ function getLang ( language ) {
+ var lang = language
+ || $( 'html' ).attr( 'lang' )
+ || window.navigator.language.split( '.' )[0] // Webkit, Safari + workaround for Tizen
+ || window.navigator.userLanguage // IE
+ || 'en',
+ countryCode = null,
+ countryCodeIdx = lang.lastIndexOf('-'),
+ ignoreCodes = ['Cyrl', 'Latn', 'Mong']; // Not country code!
+ if ( countryCodeIdx != -1 ) { // Found country code!
+ countryCode = lang.substr( countryCodeIdx + 1 );
+ if ( ignoreCodes.join( '-' ).indexOf( countryCode ) < 0 ) {
+ // countryCode is not found from ignoreCodes.
+ // Make countryCode to uppercase.
+ lang = [ lang.substr( 0, countryCodeIdx ), countryCode.toUpperCase( ) ].join( '-' );
+ }
+ }
+ // NOTE: 'en' to 'en-US', because globalize has no 'en' culture file.
+ lang = lang == 'en' ? 'en-US' : lang;
+ return lang;
+ }
+
+ function getNeutralLang ( lang ) {
+ var neutralLangIdx = lang.lastIndexOf( '-' ),
+ neutralLang;
+ if ( neutralLangIdx != -1 ) {
+ neutralLang = lang.substr( 0, neutralLangIdx );
+ }
+ return neutralLang;
+ }
+
+ function getCultureFilePath ( lang, cFDic ) {
+ var cFPath = null; // error value
+
+ if ( "string" != typeof lang ) {
+ return null;
+ }
+ if ( cFDic && cFDic[lang] ) {
+ cFPath = cFDic[lang];
+ } else {
+ // Default Globalize culture file path
+ cFPath = [
+ self.frameworkData.rootDir,
+ self.frameworkData.version,
+ 'js',
+ 'cultures',
+ ['globalize.culture.', lang, '.js'].join( '' ),
+ ].join( '/' );
+ }
+ return cFPath;
+ }
+
+ function printLoadError( cFPath, jqXHR ) {
+ tizen.log.error( "Error " + jqXHR.status + ": " + jqXHR.statusText
+ + "::Culture file (" + cFPath + ") is failed to load.");
+ }
+
+ function loadCultureFile ( cFPath, errCB ) {
+ function _successCB ( ) {
+ tizen.log.debug( "Culture file (" + cFPath + ") is loaded successfully." );
+ }
+ function _errCB ( jqXHR, textStatus, err ) {
+ if ( errCB ) {
+ errCB( jqXHR, textStatus, err );
+ } else {
+ printLoadError( cFPath, jqXHR );
+ }
+ }
+
+ if ( ! cFPath ) { // Invalid cFPath -> Regard it as '404 Not Found' error.
+ mockJSXHR = {
+ status: 404,
+ statusText: "Not Found"
+ };
+ _errCB( mockJSXHR, null, null );
+ } else {
+ $.ajax( {
+ url: cFPath,
+ dataType: 'script',
+ cache: true,
+ async: false,
+ success: _successCB,
+ error: _errCB
+ } );
+ }
+ }
+
+ lang = getLang( language );
+ cFPath = getCultureFilePath( lang, cultureDic );
+ loadCultureFile( cFPath,
+ function ( jqXHR, textStatus, err ) {
+ if ( jqXHR.status == 404 ) {
+ // If culture file is not found, try once more with neutral lang.
+ var nLang = getNeutralLang( lang ),
+ ncFPath = getCultureFilePath( nLang, cultureDic );
+ loadCultureFile( ncFPath, null );
+ } else {
+ printLoadError( cFPath, jqXHR );
+ }
+ } );
+
+ return lang;
+ },
+ setGlobalize: function ( ) {
+ var lang = this.loadGlobalizeCulture( );
+
+ // Set culture
+ // NOTE: It is not needed to set with neutral lang.
+ // Globalize automatically deals with it.
+ Globalize.culture( lang );
+ },
+ /**
+ * Load custom globalize culture file
+ * Find current system language, and load appropriate culture file from given colture file list.
+ *
+ * @param[in] cultureDic collection of 'language':'culture file path' key-val pair.
+ * @example
+ * var myCultures = {
+ * "en" : "culture/en.js",
+ * "fr" : "culture/fr.js",
+ * "ko-KR" : "culture/ko-KR.js"
+ * };
+ * loadCultomGlobalizeCulture( myCultures );
+ *
+ * ex) culture/fr.js
+ * -------------------------------
+ * Globalize.addCultureInfo( "fr", {
+ * messages: {
+ * "hello" : "bonjour",
+ * "translate" : "traduire"
+ * }
+ * } );
+ * -------------------------------
+ */
+ loadCustomGlobalizeCulture: function ( cultureDic ) {
+ tizen.loadGlobalizeCulture( null, cultureDic );
+ },
+
+ /** Set viewport meta tag for mobile devices.
+ *
+ * @param[in] viewportWidth viewport width. "device-width" is OK.
+ */
+ setViewport: function ( viewportWidth ) {
+ var meta = null,
+ head,
+ content;
+
+ // Do nothing if viewport setting code is already in the code.
+ $( "meta[name=viewport]" ).each( function ( ) {
+ meta = this;
+ return;
+ });
+ if ( meta ) { // Found custom viewport!
+ content = $( meta ).prop( "content" );
+ viewportWidth = content.replace( /.*width=(device-width|\d+)\s*,?.*$/gi, "$1" );
+ tizen.log.warn( "Viewport is set to '" + viewportWidth + "' in a meta tag. Framework skips viewport setting." );
+ } else {
+ // Create a meta tag
+ meta = document.createElement( "meta" );
+ if ( meta ) {
+ meta.name = "viewport";
+ content = [ "width=", viewportWidth, ", user-scalable=no" ].join( "" );
+ if ( ! isNaN( viewportWidth ) ) {
+ // Fix scale to 1.0, if viewport width is set to fixed value.
+ // NOTE: Works wrong in Tizen browser!
+ //content = [ content, ", initial-scale=1.0, maximum-scale=1.0" ].join( "" );
+ }
+ meta.content = content;
+ tizen.log.debug( content );
+ head = document.getElementsByTagName( 'head' ).item( 0 );
+ head.insertBefore( meta, head.firstChild );
+ }
+ }
+ return viewportWidth;
+ },
+
+ /** Read body's font-size, scale it, and reset it.
+ * param[in] desired font-size / base font-size.
+ */
+ scaleBaseFontSize: function ( themeDefaultFontSize, ratio ) {
+ tizen.log.debug( "themedefaultfont size: " + themeDefaultFontSize + ", ratio: " + ratio );
+ var scaledFontSize = Math.max( Math.floor( themeDefaultFontSize * ratio ), 4 );
+
+ $( 'html.ui-mobile' ).css( { 'font-size': scaledFontSize + "px" } );
+ tizen.log.debug( 'html:font size is set to ' + scaledFontSize );
+ $( document ).ready( function ( ) {
+ $( '.ui-mobile' ).children( 'body' ).css( { 'font-size': scaledFontSize + "px" } );
+ } );
+ },
+
+ setScaling: function ( ) {
+ var viewportWidth = this.frameworkData.viewportWidth,
+ themeDefaultFontSize = this.frameworkData.defaultFontSize, // comes from theme.js
+ ratio = 1;
+
+ // Keep original font size
+ $( 'body' ).attr( 'data-tizen-theme-default-font-size', themeDefaultFontSize );
+
+ if ( !tizen.util.isMobileBrowser() ) {
+ return;
+ }
+
+ // Legacy support: tizen.frameworkData.viewportScale
+ if ( this.frameworkData.viewportScale == true ) {
+ viewportWidth = "screen-width";
+ }
+
+ if ( "screen-width" == viewportWidth ) {
+ viewportWidth = document.documentElement.clientWidth;
+ }
+
+ viewportWidth = this.setViewport( viewportWidth ); // If custom viewport setting exists, get viewport width
+
+ if ( isNaN( viewportWidth ) ) { // device-width
+ // By default, when the viewport is set to device-width, default font-size is not changed.
+ // However, if current document width is less than defaultViewportWidth(determined by theme),
+ // default font-size is scaled to scale widgets smaller.
+ if( document.documentElement.clientWidth < this.frameworkData.defaultViewportWidth ) {
+ ratio = parseFloat( document.documentElement.clientWidth / this.frameworkData.defaultViewportWidth );
+ }
+ } else { // fixed width!
+ ratio = parseFloat( viewportWidth / this.frameworkData.defaultViewportWidth );
+ }
+ this.scaleBaseFontSize( themeDefaultFontSize, ratio );
+ },
+ };
+
+ function export2TizenNS ( $, tizen ) {
+ if ( !$.tizen ) {
+ $.tizen = { };
+ }
+
+ $.tizen.frameworkData = tizen.frameworkData;
+ $.tizen.loadCustomGlobalizeCulture = tizen.loadCustomGlobalizeCulture;
+ $.tizen.loadTheme = tizen.loadTheme;
+
+ $.tizen.__tizen__ = tizen; // for unit-test
+ }
+
+ export2TizenNS( $, tizen );
+
+ tizen.getParams( );
+ tizen.loadTheme( );
+ tizen.setScaling( ); // Run after loadTheme(), for the default font size.
+ tizen.setGlobalize( );
+ // Turn off JQM's auto initialization option.
+ // NOTE: This job must be done before domready.
+ $.mobile.autoInitializePage = false;
+
+ $(document).ready( function ( ) {
+ $.mobile.initializePage( );
+ });
+
+} ( jQuery, window.Globalize, window ) );
+
--- /dev/null
+
+(function($, undefined) {
+
+ensureNS("jQuery.mobile.tizen");
+
+jQuery.extend( jQuery.mobile.tizen,
+{
+ _widgetPrototypes: {},
+
+ /*
+ * load the prototype for a widget.
+ *
+ * If @widget is a string, the function looks for @widget.prototype.html in the proto-html/ subdirectory of the
+ * framework's current theme and loads the file via AJAX into a string. Note that the file will only be loaded via
+ * AJAX once. If two widget instances based on the same @widget value are to be constructed, the second will be
+ * constructed from the cached copy of the prototype of the first instance.
+ *
+ * If @widget is not a string, it is assumed to be a hash containing at least one key, "proto", the value of which is
+ * the string to be used for the widget prototype. if another key named "key" is also provided, it will serve as the
+ * key under which to cache the prototype, so it need not be rendered again in the future.
+ *
+ * Given the string for the widget prototype, the following patterns occurring in the string are replaced:
+ *
+ * "${FRAMEWORK_ROOT}" - replaced with the path to the root of the framework
+ *
+ * The function then creates a jQuery $("<div>") object containing the prototype from the string.
+ *
+ * If @ui is not provided, the jQuery object containing the prototype is returned.
+ *
+ * If @ui is provided, it is assumed to be a (possibly multi-level) hash containing CSS selectors. For every level of
+ * the hash and for each string-valued key at that level, the CSS selector specified as the value is sought in the
+ * prototype jQuery object and, if found, the value of the key is replaced with the jQuery object resulting from the
+ * search. Additionally, if the CSS selector is of the form "#widgetid", the "id" attribute will be removed from the
+ * elements contained within the resulting jQuery object. The resulting hash is returned.
+ *
+ * Examples:
+ *
+ * 1.
+ * $.mobile.tizen.loadPrototype("mywidget") => Returns a <div> containing the structure from the file
+ * mywidget.prototype.html located in the current theme folder of the current framework.
+ *
+ * 2. $.mobile.tizen.loadPrototype("mywidget", ui):
+ * where ui is a hash that looks like this:
+ * ui = {
+ * element1: "<css selector 1>",
+ * element2: "<css selector 2>",
+ * group1: {
+ * group1element1: "<css selector 3>",
+ * group1element1: "<css selector 4>"
+ * }
+ * ...
+ * }
+ *
+ * In this case, after loading the prototype as in Example 1, loadPrototype will traverse @ui and replace the CSS
+ * selector strings with the result of the search for the selector string upon the prototype. If any of the CSS
+ * selectors are of the form "#elementid" then the "id" attribute will be stripped from the elements selected. This
+ * means that they will no longer be accessible via the selector used initially. @ui is then returned thus modified.
+ */
+
+ loadPrototype: function(widget, ui) {
+ var ret = undefined,
+ theScriptTag = $("script[data-framework-version][data-framework-root][data-framework-theme]"),
+ frameworkRootPath = theScriptTag.attr("data-framework-root") + "/" +
+ theScriptTag.attr("data-framework-version") + "/";
+
+ function replaceVariables(s) {
+ return s.replace(/\$\{FRAMEWORK_ROOT\}/g, frameworkRootPath);
+ }
+
+ function fillObj(obj, uiProto) {
+ var selector;
+
+ for (var key in obj) {
+ if (typeof obj[key] === "string") {
+ selector = obj[key];
+ obj[key] = uiProto.find(obj[key]);
+ if (selector.substring(0, 1) === "#")
+ obj[key].removeAttr("id");
+ }
+ else
+ if (typeof obj[key] === "object")
+ obj[key] = fillObj(obj[key], uiProto);
+ }
+ return obj;
+ }
+
+ /* If @widget is a string ... */
+ if (typeof widget === "string") {
+ /* ... try to use it as a key into the cached prototype hash ... */
+ ret = $.mobile.tizen._widgetPrototypes[widget];
+ if (ret === undefined) {
+ /* ... and if the proto was not found, try to load its definition ... */
+ var protoPath = frameworkRootPath + "proto-html" + "/" +
+ theScriptTag.attr("data-framework-theme");
+ $.ajax({
+ url: protoPath + "/" + widget + ".prototype.html",
+ async: false,
+ dataType: "html"
+ })
+ .success(function(data, textStatus, jqXHR) {
+ /* ... and if loading succeeds, cache it and use a copy of it ... */
+ $.mobile.tizen._widgetPrototypes[widget] = $("<div>").html(replaceVariables(data));
+ ret = $.mobile.tizen._widgetPrototypes[widget].clone();
+ });
+ }
+ }
+ /* Otherwise ... */
+ else {
+ /* ... if a key was provided ... */
+ if (widget.key !== undefined)
+ /* ... try to use it as a key into the cached prototype hash ... */
+ ret = $.mobile.tizen._widgetPrototypes[widget.key];
+
+ /* ... and if the proto was not found in the cache ... */
+ if (ret === undefined) {
+ /* ... and a proto definition string was provided ... */
+ if (widget.proto !== undefined) {
+ /* ... create a new proto from the definition ... */
+ ret = $("<div>").html(replaceVariables(widget.proto));
+ /* ... and if a key was provided ... */
+ if (widget.key !== undefined)
+ /* ... cache a copy of the proto under that key */
+ $.mobile.tizen._widgetPrototypes[widget.key] = ret.clone();
+ }
+ }
+ else
+ /* otherwise, if the proto /was/ found in the cache, return a copy of it */
+ ret = ret.clone();
+ }
+
+ /* If the prototype was found/created successfully ... */
+ if (ret != undefined)
+ /* ... and @ui was provided */
+ if (ui != undefined)
+ /* ... return @ui, but replace the CSS selectors it contains with the elements they select */
+ ret = fillObj(ui, ret);
+
+ return ret;
+ }
+});
+})(jQuery);
+
--- /dev/null
+
+/*
+* jQuery Mobile Framework : scrollview plugin
+* Copyright (c) 2010 Adobe Systems Incorporated - Kin Blas (jblas@adobe.com)
+* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses.
+* Note: Code is in draft form and is subject to change
+* Modified by Koeun Choi <koeun.choi@samsung.com>
+* Modified by Minkyu Kang <mk7.kang@samsung.com>
+*/
+
+(function ( $, window, document, undefined ) {
+
+ function resizePageContentHeight( page ) {
+ var $page = $( page ),
+ $content = $page.children(".ui-content"),
+ hh = $page.children(".ui-header").outerHeight() || 0,
+ fh = $page.children(".ui-footer").outerHeight() || 0,
+ pt = parseFloat( $content.css("padding-top") ),
+ pb = parseFloat( $content.css("padding-bottom") ),
+ wh = $( window ).height();
+
+ $content.height( wh - (hh + fh) - (pt + pb) );
+ }
+
+ function MomentumTracker( options ) {
+ this.options = $.extend( {}, options );
+ this.easing = "easeOutQuad";
+ this.reset();
+ }
+
+ var tstates = {
+ scrolling: 0,
+ overshot: 1,
+ snapback: 2,
+ done: 3
+ };
+
+ function getCurrentTime() {
+ return Date.now();
+ }
+
+ jQuery.widget( "tizen.scrollview", jQuery.mobile.widget, {
+ options: {
+ direction: null, // "x", "y", or null for both.
+
+ timerInterval: 10,
+ scrollDuration: 1000, // Duration of the scrolling animation in msecs.
+ overshootDuration: 250, // Duration of the overshoot animation in msecs.
+ snapbackDuration: 500, // Duration of the snapback animation in msecs.
+
+ moveThreshold: 30, // User must move this many pixels in any direction to trigger a scroll.
+ moveIntervalThreshold: 150, // Time between mousemoves must not exceed this threshold.
+
+ scrollMethod: "translate", // "translate", "position"
+ startEventName: "scrollstart",
+ updateEventName: "scrollupdate",
+ stopEventName: "scrollstop",
+
+ eventType: $.support.touch ? "touch" : "mouse",
+
+ showScrollBars: true,
+ overshootEnable: false,
+ outerScrollEnable: false,
+ overflowEnable: true,
+ scrollJump: false,
+ },
+
+ _getViewHeight: function () {
+ return this._$view.height();
+ },
+
+ _getViewWidth: function () {
+ return this._$view.width();
+ },
+
+ _makePositioned: function ( $ele ) {
+ if ( $ele.css("position") === "static" ) {
+ $ele.css( "position", "relative" );
+ }
+ },
+
+ _create: function () {
+ var direction,
+ self = this;
+
+ this._$clip = $( this.element ).addClass("ui-scrollview-clip");
+
+ if ( this._$clip.children(".ui-scrollview-view").length ) {
+ this._$view = this._$clip.children(".ui-scrollview-view");
+ } else {
+ this._$view = this._$clip.wrapInner("<div></div>").children()
+ .addClass("ui-scrollview-view");
+ }
+
+ if ( this.options.scrollMethod === "translate" ) {
+ if ( this._$view.css("transform") === undefined ) {
+ this.options.scrollMethod = "position";
+ }
+ }
+
+ this._$clip.css( "overflow", "hidden" );
+ this._makePositioned( this._$clip );
+
+ this._makePositioned( this._$view );
+ this._$view.css( { left: 0, top: 0 } );
+
+ this._view_height = this._getViewHeight();
+
+ this._sx = 0;
+ this._sy = 0;
+
+ direction = this.options.direction;
+
+ this._hTracker = ( direction !== "y" ) ?
+ new MomentumTracker( this.options ) : null;
+ this._vTracker = ( direction !== "x" ) ?
+ new MomentumTracker( this.options ) : null;
+
+ this._timerInterval = this.options.timerInterval;
+ this._timerID = 0;
+
+ this._timerCB = function () {
+ self._handleMomentumScroll();
+ };
+
+ this._add_event();
+ this._add_scrollbar();
+ this._add_scroll_jump();
+ this._add_overflow_indicator();
+ },
+
+ _startMScroll: function ( speedX, speedY ) {
+ var keepGoing = false,
+ duration = this.options.scrollDuration,
+ ht = this._hTracker,
+ vt = this._vTracker,
+ c,
+ v;
+
+ this._$clip.trigger( this.options.startEventName );
+
+ if ( ht ) {
+ c = this._$clip.width();
+ v = this._getViewWidth();
+
+ if ( (( this._sx === 0 && speedX > 0 ) ||
+ ( this._sx === -(v - c) && speedX < 0 )) &&
+ v > c ) {
+ return;
+ }
+
+ ht.start( this._sx, speedX,
+ duration, (v > c) ? -(v - c) : 0, 0 );
+ keepGoing = !ht.done();
+ }
+
+ if ( vt ) {
+ c = this._$clip.height();
+ v = this._getViewHeight();
+
+ if ( (( this._sy === 0 && speedY > 0 ) ||
+ ( this._sy === -(v - c) && speedY < 0 )) &&
+ v > c ) {
+ return;
+ }
+
+ vt.start( this._sy, speedY,
+ duration, (v > c) ? -(v - c) : 0, 0 );
+ keepGoing = keepGoing || !vt.done();
+ }
+
+ if ( keepGoing ) {
+ this._timerID = setTimeout( this._timerCB, this._timerInterval );
+ } else {
+ this._stopMScroll();
+ }
+ },
+
+ _stopMScroll: function () {
+ if ( this._timerID ) {
+ this._$clip.trigger( this.options.stopEventName );
+ clearTimeout( this._timerID );
+ }
+ this._timerID = 0;
+
+ if ( this._vTracker ) {
+ this._vTracker.reset();
+ }
+
+ if ( this._hTracker ) {
+ this._hTracker.reset();
+ }
+
+ this._hideScrollBars();
+ this._hideOverflowIndicator();
+ },
+
+ _handleMomentumScroll: function () {
+ var keepGoing = false,
+ x = 0,
+ y = 0,
+ scroll_height = 0,
+ self = this,
+ end_effect = function ( dir ) {
+ setTimeout( function () {
+ self._effect_dir = dir;
+ self._setEndEffect( "in" );
+ }, 100 );
+
+ setTimeout( function () {
+ self._setEndEffect( "out" );
+ }, 350 );
+ },
+ vt = this._vTracker,
+ ht = this._hTracker;
+
+ if ( this._outerScrolling ) {
+ return;
+ }
+
+ if ( vt ) {
+ vt.update( this.options.overshootEnable );
+ y = vt.getPosition();
+ keepGoing = !vt.done();
+
+ if ( vt.getRemained() > this.options.overshootDuration ) {
+ scroll_height = this._getViewHeight() - this._$clip.height();
+
+ if ( !vt.isAvail() ) {
+ if ( this._speedY > 0 ) {
+ this._outerScroll( vt.getRemained() / 3, scroll_height );
+ } else {
+ this._outerScroll( y - vt.getRemained() / 3, scroll_height );
+ }
+ } else if ( vt.isMin() ) {
+ this._outerScroll( y - vt.getRemained() / 3, scroll_height );
+
+ if ( scroll_height > 0 ) {
+ end_effect( 1 );
+ }
+ } else if ( vt.isMax() ) {
+ this._outerScroll( vt.getRemained() / 3, scroll_height );
+
+ if ( scroll_height > 0 ) {
+ end_effect( 0 );
+ }
+ }
+ }
+ }
+
+ if ( ht ) {
+ ht.update( this.options.overshootEnable );
+ x = ht.getPosition();
+ keepGoing = keepGoing || !ht.done();
+ }
+
+ this._setScrollPosition( x, y );
+ this._$clip.trigger( this.options.updateEventName,
+ [ { x: x, y: y } ] );
+
+ if ( keepGoing ) {
+ this._timerID = setTimeout( this._timerCB, this._timerInterval );
+ } else {
+ this._stopMScroll();
+ }
+ },
+
+ _setElementTransform: function ( $ele, x, y, duration ) {
+ var translate,
+ transition;
+
+ if ( !duration || duration === undefined ) {
+ transition = "none";
+ } else {
+ transition = "-webkit-transform " + duration / 1000 + "s ease-out";
+ }
+
+ if ( $.support.cssTransform3d ) {
+ translate = "translate3d(" + x + "," + y + ", 0px)";
+ } else {
+ translate = "translate(" + x + "," + y + ")";
+ }
+
+ $ele.css({
+ "-moz-transform": translate,
+ "-webkit-transform": translate,
+ "-ms-transform": translate,
+ "-o-transform": translate,
+ "transform": translate,
+ "-webkit-transition": transition
+ });
+ },
+
+ _setEndEffect: function ( dir ) {
+ var scroll_height = this._getViewHeight() - this._$clip.height();
+
+ if ( this._softkeyboard ) {
+ if ( this._effect_dir ) {
+ this._outerScroll( -scroll_height - this._softkeyboardHeight,
+ scroll_height );
+ } else {
+ this._outerScroll( this._softkeyboardHeight, scroll_height );
+ }
+ return;
+ }
+
+ if ( dir === "in" ) {
+ if ( this._endEffect ) {
+ return;
+ }
+
+ this._endEffect = true;
+ this._setOverflowIndicator( this._effect_dir );
+ this._showOverflowIndicator();
+ } else if ( dir === "out" ) {
+ if ( !this._endEffect ) {
+ return;
+ }
+
+ this._endEffect = false;
+ } else {
+ this._endEffect = false;
+ this._setOverflowIndicator();
+ this._showOverflowIndicator();
+ }
+ },
+
+ _setCalibration: function ( x, y ) {
+ if ( this.options.overshootEnable ) {
+ this._sx = x;
+ this._sy = y;
+ return;
+ }
+
+ var $v = this._$view,
+ $c = this._$clip,
+ dirLock = this._directionLock,
+ scroll_height = 0,
+ scroll_width = 0;
+
+ if ( dirLock !== "y" && this._hTracker ) {
+ scroll_width = $v.width() - $c.width();
+
+ if ( x >= 0 ) {
+ this._sx = 0;
+ } else if ( x < -scroll_width ) {
+ this._sx = -scroll_width;
+ } else {
+ this._sx = x;
+ }
+
+ if ( scroll_width < 0 ) {
+ this._sx = 0;
+ }
+ }
+
+ if ( dirLock !== "x" && this._vTracker ) {
+ scroll_height = this._getViewHeight() - $c.height();
+
+ if ( y > 0 ) {
+ this._sy = 0;
+
+ if ( this._didDrag && scroll_height > 0 ) {
+ this._effect_dir = 0;
+ this._setEndEffect( "in" );
+ }
+ } else if ( y < -scroll_height ) {
+ this._sy = -scroll_height;
+
+ if ( this._didDrag && scroll_height > 0 ) {
+ this._effect_dir = 1;
+ this._setEndEffect( "in" );
+ }
+ } else {
+ if ( this._endEffect && this._sy !== y ) {
+ this._setEndEffect();
+ }
+
+ this._sy = y;
+ }
+
+ if ( scroll_height < 0 ) {
+ this._sy = 0;
+ }
+ }
+ },
+
+ _setScrollPosition: function ( x, y, duration ) {
+ var $v = this._$view,
+ sm = this.options.scrollMethod,
+ $vsb = this._$vScrollBar,
+ $hsb = this._$hScrollBar,
+ $sbt;
+
+ this._setCalibration( x, y );
+
+ x = this._sx;
+ y = this._sy;
+
+ if ( sm === "translate" ) {
+ this._setElementTransform( $v, x + "px", y + "px", duration );
+ } else {
+ $v.css( {left: x + "px", top: y + "px"} );
+ }
+
+ if ( $vsb ) {
+ $sbt = $vsb.find(".ui-scrollbar-thumb");
+
+ if ( sm === "translate" ) {
+ this._setElementTransform( $sbt, "0px",
+ -y / this._getViewHeight() * $sbt.parent().height() + "px",
+ duration );
+ } else {
+ $sbt.css( "top", -y / this._getViewHeight() * 100 + "%" );
+ }
+ }
+
+ if ( $hsb ) {
+ $sbt = $hsb.find(".ui-scrollbar-thumb");
+
+ if ( sm === "translate" ) {
+ this._setElementTransform( $sbt,
+ -x / $v.width() * $sbt.parent().width() + "px", "0px",
+ duration);
+ } else {
+ $sbt.css("left", -x / $v.width() * 100 + "%");
+ }
+ }
+ },
+
+ _outerScroll: function ( y, scroll_height ) {
+ var self = this,
+ top = $( window ).scrollTop() - window.screenTop,
+ sy = 0,
+ duration = this.options.snapbackDuration,
+ start = getCurrentTime(),
+ tfunc;
+
+ if ( !this.options.outerScrollEnable ) {
+ return;
+ }
+
+ if ( this._$clip.jqmData("scroll") !== "y" ) {
+ return;
+ }
+
+ if ( this._outerScrolling ) {
+ return;
+ }
+
+ if ( y > 0 ) {
+ sy = ( window.screenTop ? window.screenTop : -y );
+ } else if ( y < -scroll_height ) {
+ sy = -y - scroll_height;
+ } else {
+ return;
+ }
+
+ tfunc = function () {
+ var elapsed = getCurrentTime() - start;
+
+ if ( elapsed >= duration ) {
+ window.scrollTo( 0, top + sy );
+ self._outerScrolling = undefined;
+
+ self._stopMScroll();
+ } else {
+ ec = $.easing.easeOutQuad( elapsed / duration,
+ elapsed, 0, 1, duration );
+
+ window.scrollTo( 0, top + ( sy * ec ) );
+ self._outerScrolling = setTimeout( tfunc, self._timerInterval );
+ }
+ };
+ this._outerScrolling = setTimeout( tfunc, self._timerInterval );
+ },
+
+ _scrollTo: function ( x, y, duration ) {
+ var self = this,
+ start = getCurrentTime(),
+ efunc = $.easing.easeOutQuad,
+ sx = this._sx,
+ sy = this._sy,
+ dx = x - sx,
+ dy = y - sy,
+ tfunc;
+
+ x = -x;
+ y = -y;
+
+ tfunc = function () {
+ var elapsed = getCurrentTime() - start,
+ ec;
+
+ if ( elapsed >= duration ) {
+ self._timerID = 0;
+ self._setScrollPosition( x, y );
+ } else {
+ ec = efunc( elapsed / duration, elapsed, 0, 1, duration );
+
+ self._setScrollPosition( sx + ( dx * ec ), sy + ( dy * ec ) );
+ self._timerID = setTimeout( tfunc, self._timerInterval );
+ }
+ };
+
+ this._timerID = setTimeout( tfunc, this._timerInterval );
+ },
+
+ scrollTo: function ( x, y, duration ) {
+ this._stopMScroll();
+ this._didDrag = false;
+
+ if ( !duration || this.options.scrollMethod === "translate" ) {
+ this._setScrollPosition( x, y, duration );
+ } else {
+ this._scrollTo( x, y, duration );
+ }
+ },
+
+ getScrollPosition: function () {
+ return { x: -this._sx, y: -this._sy };
+ },
+
+ skipDragging: function ( value ) {
+ this._skip_dragging = value;
+ },
+
+ _getScrollHierarchy: function () {
+ var svh = [],
+ d;
+
+ this._$clip.parents( ".ui-scrollview-clip").each( function () {
+ d = $( this ).jqmData("scrollview");
+ if ( d ) {
+ svh.unshift( d );
+ }
+ } );
+ return svh;
+ },
+
+ _getAncestorByDirection: function ( dir ) {
+ var svh = this._getScrollHierarchy(),
+ n = svh.length,
+ sv,
+ svdir;
+
+ while ( 0 < n-- ) {
+ sv = svh[n];
+ svdir = sv.options.direction;
+
+ if (!svdir || svdir === dir) {
+ return sv;
+ }
+ }
+ return null;
+ },
+
+ _handleDragStart: function ( e, ex, ey ) {
+ this._stopMScroll();
+
+ this._didDrag = false;
+ this._skip_dragging = false;
+
+ var target = $( e.target ),
+ self = this,
+ $c = this._$clip,
+ svdir = this.options.direction;
+
+ /* should prevent the default behavior when click the button */
+ this._is_button = target.is( '.ui-btn' ) ||
+ target.is( '.ui-btn-text' ) ||
+ target.is( '.ui-btn-inner' ) ||
+ target.is( '.ui-btn-inner .ui-icon' );
+
+ /* should prevent the default behavior when click the slider */
+ if ( target.parents('.ui-slider').length || target.is('.ui-slider') ) {
+ this._skip_dragging = true;
+ return;
+ }
+
+ if ( target.is('textarea') ) {
+ target.bind( "scroll", function () {
+ self._skip_dragging = true;
+ target.unbind("scroll");
+ });
+ }
+
+ /*
+ * We need to prevent the default behavior to
+ * suppress accidental selection of text, etc.
+ */
+ this._is_inputbox = target.is(':input') ||
+ target.parents(':input').length > 0;
+
+ if ( this._is_inputbox ) {
+ target.one( "resize.scrollview", function () {
+ if ( ey > $c.height() ) {
+ self.scrollTo( -ex, self._sy - ey + $c.height(),
+ self.options.snapbackDuration );
+ }
+ });
+ }
+
+ if ( this.options.eventType === "mouse" && !this._is_inputbox && !this._is_button ) {
+ e.preventDefault();
+ }
+
+ this._lastX = ex;
+ this._lastY = ey;
+ this._startY = ey;
+ this._doSnapBackX = false;
+ this._doSnapBackY = false;
+ this._speedX = 0;
+ this._speedY = 0;
+ this._directionLock = "";
+
+ this._lastMove = 0;
+ this._enableTracking();
+
+ this._set_scrollbar_size();
+ },
+
+ _propagateDragMove: function ( sv, e, ex, ey, dir ) {
+ this._hideScrollBars();
+ this._hideOverflowIndicator();
+ this._disableTracking();
+ sv._handleDragStart( e, ex, ey );
+ sv._directionLock = dir;
+ sv._didDrag = this._didDrag;
+ },
+
+ _handleDragMove: function ( e, ex, ey ) {
+ if ( this._skip_dragging ) {
+ return;
+ }
+
+ if ( !this._dragging ) {
+ return;
+ }
+
+ if ( !this._is_inputbox && !this._is_button ) {
+ e.preventDefault();
+ }
+
+ var mt = this.options.moveThreshold,
+ dx = ex - this._lastX,
+ dy = ey - this._lastY,
+ svdir = this.options.direction,
+ dir = null,
+ x,
+ y,
+ sv,
+ scope,
+ newX,
+ newY,
+ dirLock;
+
+ this._lastMove = getCurrentTime();
+
+ if ( !this._directionLock ) {
+ x = Math.abs( dx );
+ y = Math.abs( dy );
+
+ if ( x < mt && y < mt ) {
+ return false;
+ }
+
+ if ( x < y && (x / y) < 0.5 ) {
+ dir = "y";
+ } else if ( x > y && (y / x) < 0.5 ) {
+ dir = "x";
+ }
+
+ if ( svdir && dir && svdir !== dir ) {
+ /*
+ * This scrollview can't handle the direction the user
+ * is attempting to scroll. Find an ancestor scrollview
+ * that can handle the request.
+ */
+
+ sv = this._getAncestorByDirection( dir );
+ if ( sv ) {
+ this._propagateDragMove( sv, e, ex, ey, dir );
+ return false;
+ }
+ }
+
+ this._directionLock = svdir || (dir || "none");
+ }
+
+ newX = this._sx;
+ newY = this._sy;
+ dirLock = this._directionLock;
+
+ if ( dirLock !== "y" && this._hTracker ) {
+ x = this._sx;
+ this._speedX = dx;
+ newX = x + dx;
+
+ this._doSnapBackX = false;
+
+ scope = ( newX > 0 || newX < this._maxX );
+
+ if ( scope && dirLock === "x" ) {
+ sv = this._getAncestorByDirection("x");
+ if ( sv ) {
+ this._setScrollPosition( newX > 0 ?
+ 0 : this._maxX, newY );
+ this._propagateDragMove( sv, e, ex, ey, dir );
+ return false;
+ }
+
+ newX = x + ( dx / 2 );
+ this._doSnapBackX = true;
+ }
+ }
+
+ if ( dirLock !== "x" && this._vTracker ) {
+ if ( Math.abs( this._startY - ey ) < mt && dirLock !== "xy" ) {
+ return;
+ }
+
+ y = this._sy;
+ this._speedY = dy;
+ newY = y + dy;
+
+ this._doSnapBackY = false;
+
+ scope = ( newY > 0 || newY < this._maxY );
+
+ if ( scope && dirLock === "y" ) {
+ sv = this._getAncestorByDirection("y");
+ if ( sv ) {
+ this._setScrollPosition( newX,
+ newY > 0 ? 0 : this._maxY );
+ this._propagateDragMove( sv, e, ex, ey, dir );
+ return false;
+ }
+
+ newY = y + ( dy / 2 );
+ this._doSnapBackY = true;
+ }
+ }
+
+ if ( this.options.overshootEnable === false ) {
+ this._doSnapBackX = false;
+ this._doSnapBackY = false;
+ }
+
+ this._lastX = ex;
+ this._lastY = ey;
+
+ this._setScrollPosition( newX, newY );
+
+ if ( this._didDrag === false ) {
+ this._didDrag = true;
+ this._showScrollBars();
+ this._showOverflowIndicator();
+
+ this._$clip.parents(".ui-scrollview-clip").each( function () {
+ $( this ).scrollview( "skipDragging", true );
+ } );
+ }
+ },
+
+ _handleDragStop: function ( e ) {
+ var self = this;
+
+ if ( this._skip_dragging ) {
+ return;
+ }
+
+ var l = this._lastMove,
+ t = getCurrentTime(),
+ doScroll = (l && (t - l) <= this.options.moveIntervalThreshold),
+ sx = ( this._hTracker && this._speedX && doScroll ) ?
+ this._speedX : ( this._doSnapBackX ? 1 : 0 ),
+ sy = ( this._vTracker && this._speedY && doScroll ) ?
+ this._speedY : ( this._doSnapBackY ? 1 : 0 ),
+ svdir = this.options.direction,
+ x,
+ y;
+
+ if ( sx || sy ) {
+ if ( !this._setGestureScroll( sx, sy ) ) {
+ this._startMScroll( sx, sy );
+ }
+ } else {
+ this._hideScrollBars();
+ this._hideOverflowIndicator();
+ }
+
+ this._disableTracking();
+
+ if ( this._endEffect ) {
+ setTimeout( function () {
+ self._setEndEffect( "out" );
+ self._hideScrollBars();
+ self._hideOverflowIndicator();
+ }, 300 );
+ }
+
+ return !this._didDrag;
+ },
+
+ _setGestureScroll: function ( sx, sy ) {
+ var self = this,
+ reset = function () {
+ clearTimeout( self._gesture_timer );
+ self._gesture_dir = 0;
+ self._gesture_timer = undefined;
+ },
+ direction = {
+ top: 0,
+ bottom: 1,
+ left: 2,
+ right: 3
+ };
+
+ if ( !sy && !sx ) {
+ return false;
+ }
+
+ if ( Math.abs( sx ) > Math.abs( sy ) ) {
+ dir = sx > 0 ? direction.left : direction.right;
+ } else {
+ dir = sy > 0 ? direction.top : direction.bottom;
+ }
+
+ if ( !this._gesture_timer ) {
+ this._gesture_dir = dir;
+
+ this._gesture_timer = setTimeout( function () {
+ reset();
+ }, 1000 );
+
+ return false;
+ }
+
+ if ( this._gesture_dir !== dir ) {
+ reset();
+ return false;
+ }
+
+ return false;
+ },
+
+ _enableTracking: function () {
+ this._dragging = true;
+ },
+
+ _disableTracking: function () {
+ this._dragging = false;
+ },
+
+ _showScrollBars: function ( interval ) {
+ var vclass = "ui-scrollbar-visible",
+ self = this;
+
+ if ( !this.options.showScrollBars ) {
+ return;
+ }
+ if ( this._scrollbar_showed ) {
+ return;
+ }
+
+ if ( this._$vScrollBar ) {
+ this._$vScrollBar.addClass( vclass );
+ }
+ if ( this._$hScrollBar ) {
+ this._$hScrollBar.addClass( vclass );
+ }
+
+ this._scrollbar_showed = true;
+
+ if ( interval ) {
+ setTimeout( function () {
+ self._hideScrollBars();
+ }, interval );
+ }
+ },
+
+ _hideScrollBars: function () {
+ var vclass = "ui-scrollbar-visible";
+
+ if ( !this.options.showScrollBars ) {
+ return;
+ }
+ if ( !this._scrollbar_showed ) {
+ return;
+ }
+
+ if ( this._$vScrollBar ) {
+ this._$vScrollBar.removeClass( vclass );
+ }
+ if ( this._$hScrollBar ) {
+ this._$hScrollBar.removeClass( vclass );
+ }
+
+ this._scrollbar_showed = false;
+ },
+
+ _setOverflowIndicator: function ( dir ) {
+ if ( dir === 1 ) {
+ this._opacity_top = "0";
+ this._opacity_bottom = "0.8";
+ } else if ( dir === 0 ) {
+ this._opacity_top = "0.8";
+ this._opacity_bottom = "0";
+ } else {
+ this._opacity_top = "0.5";
+ this._opacity_bottom = "0.5";
+ }
+ },
+
+ _showOverflowIndicator: function () {
+ if ( !this.options.overflowEnable || !this._overflowAvail || this._softkeyboard ) {
+ return;
+ }
+
+ this._overflow_top.animate( { opacity: this._opacity_top }, 300 );
+ this._overflow_bottom.animate( { opacity: this._opacity_bottom }, 300 );
+
+ this._overflow_showed = true;
+ },
+
+ _hideOverflowIndicator: function () {
+ if ( !this.options.overflowEnable || !this._overflowAvail || this._softkeyboard ) {
+ return;
+ }
+
+ if ( this._overflow_showed === false ) {
+ return;
+ }
+
+ this._overflow_top.animate( { opacity: 0 }, 300 );
+ this._overflow_bottom.animate( { opacity: 0 }, 300 );
+
+ this._overflow_showed = false;
+ this._setOverflowIndicator();
+ },
+
+ _add_event: function () {
+ var self = this,
+ $c = this._$clip,
+ $v = this._$view;
+
+ if ( this.options.eventType === "mouse" ) {
+ this._dragEvt = "mousedown mousemove mouseup click mousewheel";
+
+ this._dragCB = function ( e ) {
+ switch ( e.type ) {
+ case "mousedown":
+ return self._handleDragStart( e,
+ e.clientX, e.clientY );
+
+ case "mousemove":
+ return self._handleDragMove( e,
+ e.clientX, e.clientY );
+
+ case "mouseup":
+ return self._handleDragStop( e );
+
+ case "click":
+ return !self._didDrag;
+
+ case "mousewheel":
+ var old = self.getScrollPosition();
+ self.scrollTo( -old.x,
+ -(old.y - e.originalEvent.wheelDelta) );
+ break;
+ }
+ };
+ } else {
+ this._dragEvt = "touchstart touchmove touchend click";
+
+ this._dragCB = function ( e ) {
+ var touches = e.originalEvent.touches;
+
+ switch ( e.type ) {
+ case "touchstart":
+ if ( touches.length != 1) {
+ return;
+ }
+
+ return self._handleDragStart( e,
+ touches[0].pageX, touches[0].pageY );
+
+ case "touchmove":
+ if ( touches.length != 1) {
+ return;
+ }
+
+ return self._handleDragMove( e,
+ touches[0].pageX, touches[0].pageY );
+
+ case "touchend":
+ if ( touches.length != 0) {
+ return;
+ }
+
+ return self._handleDragStop( e );
+
+ case "click":
+ return !self._didDrag;
+ }
+ };
+ }
+
+ $v.bind( this._dragEvt, this._dragCB );
+
+ $v.bind( "keydown", function ( e ) {
+ var elem,
+ elem_top,
+ scroll_top = $( window ).scrollTop() - window.screenTop,
+ screen_h;
+
+ if ( e.keyCode == 9 ) {
+ return false;
+ }
+
+ elem = $c.find(".ui-focus");
+
+ if ( elem === undefined ) {
+ return;
+ }
+
+ elem_top = elem.offset().top - scroll_top;
+ screen_h = $c.offset().top + $c.height() - elem.height();
+
+ if ( self._softkeyboard ) {
+ screen_h -= self._softkeyboardHeight;
+ }
+
+ if ( ( elem_top < $c.offset().top ) || ( elem_top > screen_h ) ) {
+ self.scrollTo( 0, self._sy -
+ ( elem_top - $c.offset().top - elem.height() ) );
+ }
+
+ return;
+ });
+
+ $v.bind( "keyup", function ( e ) {
+ var input,
+ elem,
+ elem_top,
+ scroll_top = $( window ).scrollTop() - window.screenTop,
+ screen_h;
+
+ if ( e.keyCode != 9 ) {
+ return;
+ }
+
+ /* Tab Key */
+
+ input = $( this ).find(":input");
+
+ for ( i = 0; i < input.length; i++ ) {
+ if ( !$( input[i] ).hasClass("ui-focus") ) {
+ continue;
+ }
+
+ if ( i + 1 == input.length ) {
+ elem = $( input[0] );
+ } else {
+ elem = $( input[i + 1] );
+ }
+
+ elem_top = elem.offset().top - scroll_top;
+ screen_h = $c.offset().top + $c.height() - elem.height();
+
+ if ( self._softkeyboard ) {
+ screen_h -= self._softkeyboardHeight;
+ }
+
+ if ( ( elem_top < 0 ) || ( elem_top > screen_h ) ) {
+ self.scrollTo( 0, self._sy - elem_top +
+ elem.height() + $c.offset().top, 0);
+ }
+
+ elem.focus();
+
+ break;
+ }
+
+ return false;
+ });
+
+ $c.bind( "updatelayout", function ( e ) {
+ var sy,
+ vh,
+ view_h = self._getViewHeight();
+
+ if ( !$c.height() || !view_h ) {
+ self.scrollTo( 0, 0, 0 );
+ return;
+ }
+
+ sy = $c.height() - view_h;
+ vh = view_h - self._view_height;
+
+ self._view_height = view_h;
+
+ if ( vh == 0 || vh > $c.height() / 2 ) {
+ return;
+ }
+
+ if ( sy > 0 ) {
+ self.scrollTo( 0, 0, 0 );
+ } else if ( self._sy - sy <= -vh ) {
+ self.scrollTo( 0, self._sy,
+ self.options.snapbackDuration );
+ } else if ( self._sy - sy <= vh + self.options.moveThreshold ) {
+ self.scrollTo( 0, sy,
+ self.options.snapbackDuration );
+ }
+ });
+
+ $( window ).bind( "resize", function ( e ) {
+ var focused,
+ view_h = self._getViewHeight();
+
+ if ( $(".ui-page-active").get(0) !== $c.closest(".ui-page").get(0) ) {
+ return;
+ }
+
+ if ( !$c.height() || !view_h ) {
+ return;
+ }
+
+ focused = $c.find(".ui-focus");
+
+ if ( focused ) {
+ focused.trigger("resize.scrollview");
+ }
+
+ /* calibration - after triggered throttledresize */
+ setTimeout( function () {
+ if ( self._sy < $c.height() - self._getViewHeight() ) {
+ self.scrollTo( 0, $c.height() - self._getViewHeight(),
+ self.options.overshootDuration );
+ }
+ }, 260 );
+
+ self._view_height = view_h;
+ });
+
+ $( window ).bind( "vmouseout", function ( e ) {
+ var drag_stop = false;
+
+ if ( $(".ui-page-active").get(0) !== $c.closest(".ui-page").get(0) ) {
+ return;
+ }
+
+ if ( !self._dragging ) {
+ return;
+ }
+
+ if ( e.pageX < 0 || e.pageX > $( window ).width() ) {
+ drag_stop = true;
+ }
+
+ if ( e.pageY < 0 || e.pageY > $( window ).height() ) {
+ drag_stop = true;
+ }
+
+ if ( drag_stop ) {
+ self._hideScrollBars();
+ self._hideOverflowIndicator();
+ self._disableTracking();
+ }
+ });
+
+ this._softkeyboard = false;
+ this._softkeyboardHeight = 0;
+
+ window.addEventListener( "softkeyboardchange", function ( e ) {
+ if ( $(".ui-page-active").get(0) !== $c.closest(".ui-page").get(0) ) {
+ return;
+ }
+
+ self._softkeyboard = ( e.state === "on" ? true : false );
+ self._softkeyboardHeight = parseInt( e.height ) *
+ ( $( window ).width() / window.screen.availWidth );
+ });
+
+ $c.closest(".ui-page")
+ .bind( "pageshow", function ( e ) {
+ /* should be called after pagelayout */
+ setTimeout( function () {
+ self._view_height = self._getViewHeight();
+ self._set_scrollbar_size();
+ self._setScrollPosition( self._sx, self._sy );
+ self._showScrollBars( 2000 );
+ }, 0 );
+ });
+ },
+
+ _add_scrollbar: function () {
+ var $c = this._$clip,
+ prefix = "<div class=\"ui-scrollbar ui-scrollbar-",
+ suffix = "\"><div class=\"ui-scrollbar-track\"><div class=\"ui-scrollbar-thumb\"></div></div></div>";
+
+ if ( !this.options.showScrollBars ) {
+ return;
+ }
+
+ if ( this._vTracker ) {
+ $c.append( prefix + "y" + suffix );
+ this._$vScrollBar = $c.children(".ui-scrollbar-y");
+ }
+ if ( this._hTracker ) {
+ $c.append( prefix + "x" + suffix );
+ this._$hScrollBar = $c.children(".ui-scrollbar-x");
+ }
+
+ this._scrollbar_showed = false;
+ },
+
+ _add_scroll_jump: function () {
+ var $c = this._$clip,
+ self = this,
+ top_btn,
+ left_btn;
+
+ if ( !this.options.scrollJump ) {
+ return;
+ }
+
+ if ( this._vTracker ) {
+ top_btn = $( '<div class="ui-scroll-jump-top-bg">' +
+ '<div data-role="button" data-inline="true" data-icon="scrolltop" data-style="box"></div></div>' );
+ $c.append( top_btn ).trigger("create");
+
+ top_btn.bind( "vclick", function () {
+ self.scrollTo( 0, 0, self.options.overshootDuration );
+ } );
+ }
+
+ if ( this._hTracker ) {
+ left_btn = $( '<div class="ui-scroll-jump-left-bg">' +
+ '<div data-role="button" data-inline="true" data-icon="scrollleft" data-style="box"></div></div>' );
+ $c.append( left_btn ).trigger("create");
+
+ left_btn.bind( "vclick", function () {
+ self.scrollTo( 0, 0, self.options.overshootDuration );
+ } );
+ }
+ },
+
+ _add_overflow_indicator: function () {
+ if ( !this.options.overflowEnable ) {
+ return;
+ }
+
+ this._overflow_top = $( '<div class="ui-overflow-indicator-top"></div>' );
+ this._overflow_bottom = $( '<div class="ui-overflow-indicator-bottom"></div>' );
+
+ this._$clip.append( this._overflow_top );
+ this._$clip.append( this._overflow_bottom );
+
+ this._opacity_top = "0.5";
+ this._opacity_bottom = "0.5";
+ this._overflow_showed = false;
+ },
+
+ _set_scrollbar_size: function () {
+ var $c = this._$clip,
+ $v = this._$view,
+ cw = 0,
+ vw = 0,
+ ch = 0,
+ vh = 0,
+ thumb;
+
+ if ( !this.options.showScrollBars ) {
+ return;
+ }
+
+ if ( this._hTracker ) {
+ cw = $c.width();
+ vw = $v.width();
+ this._maxX = cw - vw;
+
+ if ( this._maxX > 0 ) {
+ this._maxX = 0;
+ }
+ if ( this._$hScrollBar && vw ) {
+ thumb = this._$hScrollBar.find(".ui-scrollbar-thumb");
+ thumb.css( "width", (cw >= vw ? "0" :
+ (Math.floor(cw / vw * 100) || 1) + "%") );
+ }
+ }
+
+ if ( this._vTracker ) {
+ ch = $c.height();
+ vh = this._getViewHeight();
+ this._maxY = ch - vh;
+
+ if ( this._maxY > 0 || vh === 0 ) {
+ this._maxY = 0;
+ }
+ if ( ( this._$vScrollBar && vh ) || vh === 0 ) {
+ thumb = this._$vScrollBar.find(".ui-scrollbar-thumb");
+ thumb.css( "height", (ch >= vh ? "0" :
+ (Math.floor(ch / vh * 100) || 1) + "%") );
+
+ this._overflowAvail = !!thumb.height();
+ }
+ }
+ }
+ });
+
+ $.extend( MomentumTracker.prototype, {
+ start: function ( pos, speed, duration, minPos, maxPos ) {
+ var tstate = ( pos < minPos || pos > maxPos ) ?
+ tstates.snapback : tstates.scrolling,
+ pos_temp;
+
+ this.state = ( speed !== 0 ) ? tstate : tstates.done;
+ this.pos = pos;
+ this.speed = speed;
+ this.duration = ( this.state === tstates.snapback ) ?
+ this.options.snapbackDuration : duration;
+ this.minPos = minPos;
+ this.maxPos = maxPos;
+
+ this.fromPos = ( this.state === tstates.snapback ) ? this.pos : 0;
+ pos_temp = ( this.pos < this.minPos ) ? this.minPos : this.maxPos;
+ this.toPos = ( this.state === tstates.snapback ) ? pos_temp : 0;
+
+ this.startTime = getCurrentTime();
+ },
+
+ reset: function () {
+ this.state = tstates.done;
+ this.pos = 0;
+ this.speed = 0;
+ this.minPos = 0;
+ this.maxPos = 0;
+ this.duration = 0;
+ this.remained = 0;
+ },
+
+ update: function ( overshootEnable ) {
+ var state = this.state,
+ cur_time = getCurrentTime(),
+ duration = this.duration,
+ elapsed = cur_time - this.startTime,
+ dx,
+ x,
+ didOverShoot;
+
+ if ( state === tstates.done ) {
+ return this.pos;
+ }
+
+ elapsed = elapsed > duration ? duration : elapsed;
+
+ this.remained = duration - elapsed;
+
+ if ( state === tstates.scrolling || state === tstates.overshot ) {
+ dx = this.speed *
+ ( 1 - $.easing[this.easing]( elapsed / duration,
+ elapsed, 0, 1, duration ) );
+
+ x = this.pos + dx;
+
+ didOverShoot = ( state === tstates.scrolling ) &&
+ ( x < this.minPos || x > this.maxPos );
+
+ if ( didOverShoot ) {
+ x = ( x < this.minPos ) ? this.minPos : this.maxPos;
+ }
+
+ this.pos = x;
+
+ if ( state === tstates.overshot ) {
+ if ( !overshootEnable ) {
+ this.state = tstates.done;
+ }
+ if ( elapsed >= duration ) {
+ this.state = tstates.snapback;
+ this.fromPos = this.pos;
+ this.toPos = ( x < this.minPos ) ?
+ this.minPos : this.maxPos;
+ this.duration = this.options.snapbackDuration;
+ this.startTime = cur_time;
+ elapsed = 0;
+ }
+ } else if ( state === tstates.scrolling ) {
+ if ( didOverShoot && overshootEnable ) {
+ this.state = tstates.overshot;
+ this.speed = dx / 2;
+ this.duration = this.options.overshootDuration;
+ this.startTime = cur_time;
+ } else if ( elapsed >= duration ) {
+ this.state = tstates.done;
+ }
+ }
+ } else if ( state === tstates.snapback ) {
+ if ( elapsed >= duration ) {
+ this.pos = this.toPos;
+ this.state = tstates.done;
+ } else {
+ this.pos = this.fromPos + (( this.toPos - this.fromPos ) *
+ $.easing[this.easing]( elapsed / duration,
+ elapsed, 0, 1, duration ));
+ }
+ }
+
+ return this.pos;
+ },
+
+ done: function () {
+ return this.state === tstates.done;
+ },
+
+ isMin: function () {
+ return this.pos === this.minPos;
+ },
+
+ isMax: function () {
+ return this.pos === this.maxPos;
+ },
+
+ isAvail: function () {
+ return !( this.minPos === this.maxPos );
+ },
+
+ getRemained: function () {
+ return this.remained;
+ },
+
+ getPosition: function () {
+ return this.pos;
+ }
+ });
+
+ $( document ).bind( 'pagecreate create', function ( e ) {
+ var $page = $( e.target ),
+ content_scroll = $page.find(".ui-content").jqmData("scroll");
+
+ /* content scroll */
+ if ( $.support.scrollview === undefined ) {
+ $.support.scrollview = true;
+ }
+
+ if ( $.support.scrollview === true && content_scroll === undefined ) {
+ content_scroll = "y";
+ }
+
+ if ( content_scroll !== "y" ) {
+ content_scroll = "none";
+ }
+
+ $page.find(".ui-content").attr( "data-scroll", content_scroll );
+
+ $page.find(":jqmData(scroll)").not(".ui-scrollview-clip").each( function () {
+ if ( $( this ).hasClass("ui-scrolllistview") ) {
+ $( this ).scrolllistview();
+ } else {
+ var st = $( this ).jqmData("scroll"),
+ dir = st && ( st.search(/^[xy]/) !== -1 ) ? st : null,
+ content = $(this).hasClass("ui-content"),
+ opts;
+
+ if ( st === "none" ) {
+ return;
+ }
+
+ opts = {
+ direction: dir || undefined,
+ overflowEnable: content,
+ scrollMethod: $( this ).jqmData("scroll-method") || undefined,
+ scrollJump: $( this ).jqmData("scroll-jump") || undefined
+ };
+
+ $( this ).scrollview( opts );
+ }
+ });
+ });
+
+ $( document ).bind( 'pageshow', function ( e ) {
+ var $page = $( e.target ),
+ scroll = $page.find(".ui-content").jqmData("scroll");
+
+ if ( scroll === "y" ) {
+ resizePageContentHeight( e.target );
+ }
+ });
+
+}( jQuery, window, document ) );
+
--- /dev/null
+
+(function( $, window, undefined ) {
+
+var createHandler = function( sequential ) {
+
+ // Default to sequential
+ if ( sequential === undefined ) {
+ sequential = true;
+ }
+
+ return function( name, reverse, $to, $from ) {
+
+ var deferred = new $.Deferred(),
+ reverseClass = reverse ? " reverse" : "",
+ active = $.mobile.urlHistory.getActive(),
+ toScroll = active.lastScroll || $.mobile.defaultHomeScroll,
+ screenHeight = $.mobile.getScreenHeight(),
+ maxTransitionOverride = $.mobile.maxTransitionWidth !== false && $.mobile.$window.width() > $.mobile.maxTransitionWidth,
+ none = !$.support.cssTransitions || maxTransitionOverride || !name || name === "none" || Math.max( $.mobile.$window.scrollTop(), toScroll ) > $.mobile.getMaxScrollForTransition(),
+ toPreClass = " ui-page-pre-in",
+ toggleViewportClass = function() {
+ $.mobile.pageContainer.toggleClass( "ui-mobile-viewport-transitioning viewport-" + name );
+ },
+ scrollPage = function() {
+ // Prevent blinking on page scrolling in Tizen/Android devices.
+ // Don't scoll window, when current scroll top(scrollTop()) is already at toScroll,
+ // or when current scroll top is 0 and toScroll is same to defaultHomeScroll
+ // (which means the top position of page). In these case, page scrolling is not needed.
+ var st = $.mobile.$window.scrollTop();
+ if( st === toScroll || ( $.mobile.defaultHomeScroll === toScroll && st == 0 ) ) {
+ return;
+ }
+
+ // By using scrollTo instead of silentScroll, we can keep things better in order
+ // Just to be precautios, disable scrollstart listening like silentScroll would
+ $.event.special.scrollstart.enabled = false;
+
+ window.scrollTo( 0, toScroll );
+
+ // reenable scrollstart listening like silentScroll would
+ setTimeout( function() {
+ $.event.special.scrollstart.enabled = true;
+ }, 150 );
+ },
+ cleanFrom = function() {
+ $from
+ .removeClass( $.mobile.activePageClass + " out in reverse " + name )
+ .height( "" );
+ },
+ startOut = function() {
+ // if it's not sequential, call the doneOut transition to start the TO page animating in simultaneously
+ if ( !sequential ) {
+ doneOut();
+ }
+ else {
+ $from.animationComplete( doneOut );
+ }
+
+ // Set the from page's height and start it transitioning out
+ // Note: setting an explicit height helps eliminate tiling in the transitions
+ $from
+ .height( screenHeight + $.mobile.$window.scrollTop() )
+ .addClass( name + " out" + reverseClass );
+ },
+
+ doneOut = function() {
+
+ if ( $from && sequential ) {
+ cleanFrom();
+ }
+
+ startIn();
+ },
+
+ startIn = function() {
+
+ // Prevent flickering in phonegap container: see comments at #4024 regarding iOS
+ $to.css( "z-index", -10 );
+
+ $to.addClass( $.mobile.activePageClass + toPreClass );
+
+ // Send focus to page as it is now display: block
+ $.mobile.focusPage( $to );
+
+ // Set to page height
+ $to.height( screenHeight + toScroll );
+
+ scrollPage();
+
+ // Restores visibility of the new page: added together with $to.css( "z-index", -10 );
+ $to.css( "z-index", "" );
+
+ if ( !none ) {
+ $to.animationComplete( doneIn );
+ }
+
+ $to
+ .removeClass( toPreClass )
+ .addClass( name + " in" + reverseClass );
+
+ if ( none ) {
+ setTimeout( doneIn, 0 );
+ }
+
+ },
+
+ doneIn = function() {
+
+ if ( !sequential ) {
+
+ if ( $from ) {
+ cleanFrom();
+ }
+ }
+
+ $to
+ .removeClass( "out in reverse " + name )
+ .height( "" );
+
+ toggleViewportClass();
+
+ // In some browsers (iOS5), 3D transitions block the ability to scroll to the desired location during transition
+ // This ensures we jump to that spot after the fact, if we aren't there already.
+ if ( $.mobile.$window.scrollTop() !== toScroll ) {
+ scrollPage();
+ }
+
+ deferred.resolve( name, reverse, $to, $from, true );
+ };
+
+ toggleViewportClass();
+
+ if ( $from && !none ) {
+ startOut();
+ }
+ else {
+ doneOut();
+ }
+
+ return deferred.promise();
+ };
+};
+
+// generate the handlers from the above
+var sequentialHandler = createHandler(),
+ simultaneousHandler = createHandler( false ),
+ defaultGetMaxScrollForTransition = function() {
+ return $.mobile.getScreenHeight() * 3;
+ };
+
+// Make our transition handler the public default.
+$.mobile.defaultTransitionHandler = sequentialHandler;
+
+//transition handler dictionary for 3rd party transitions
+$.mobile.transitionHandlers = {
+ "default": $.mobile.defaultTransitionHandler,
+ "sequential": sequentialHandler,
+ "simultaneous": simultaneousHandler
+};
+
+$.mobile.transitionFallbacks = {};
+
+// If transition is defined, check if css 3D transforms are supported, and if not, if a fallback is specified
+$.mobile._maybeDegradeTransition = function( transition ) {
+ if ( transition && !$.support.cssTransform3d && $.mobile.transitionFallbacks[ transition ] ) {
+ transition = $.mobile.transitionFallbacks[ transition ];
+ }
+
+ return transition;
+};
+
+// Set the getMaxScrollForTransition to default if no implementation was set by user
+$.mobile.getMaxScrollForTransition = $.mobile.getMaxScrollForTransition || defaultGetMaxScrollForTransition;
+})( jQuery, this );
--- /dev/null
+
+// This plugin is an experiment for abstracting away the touch and mouse
+// events so that developers don't have to worry about which method of input
+// the device their document is loaded on supports.
+//
+// The idea here is to allow the developer to register listeners for the
+// basic mouse events, such as mousedown, mousemove, mouseup, and click,
+// and the plugin will take care of registering the correct listeners
+// behind the scenes to invoke the listener at the fastest possible time
+// for that device, while still retaining the order of event firing in
+// the traditional mouse environment, should multiple handlers be registered
+// on the same element for different events.
+//
+// The current version exposes the following virtual events to jQuery bind methods:
+// "vmouseover vmousedown vmousemove vmouseup vclick vmouseout vmousecancel"
+
+(function( $, window, document, undefined ) {
+
+var dataPropertyName = "virtualMouseBindings",
+ touchTargetPropertyName = "virtualTouchID",
+ virtualEventNames = "vmouseover vmousedown vmousemove vmouseup vclick vmouseout vmousecancel".split( " " ),
+ touchEventProps = "clientX clientY pageX pageY screenX screenY".split( " " ),
+ mouseHookProps = $.event.mouseHooks ? $.event.mouseHooks.props : [],
+ mouseEventProps = $.event.props.concat( mouseHookProps ),
+ activeDocHandlers = {},
+ resetTimerID = 0,
+ startX = 0,
+ startY = 0,
+ didScroll = false,
+ clickBlockList = [],
+ blockMouseTriggers = false,
+ blockTouchTriggers = false,
+ eventCaptureSupported = "addEventListener" in document,
+ $document = $.mobile.$document,
+ nextTouchID = 1,
+ lastTouchID = 0, threshold;
+
+$.vmouse = {
+ moveDistanceThreshold: 10,
+ clickDistanceThreshold: 10,
+ resetTimerDuration: 1500
+};
+
+function getNativeEvent( event ) {
+
+ while ( event && typeof event.originalEvent !== "undefined" ) {
+ event = event.originalEvent;
+ }
+ return event;
+}
+
+function createVirtualEvent( event, eventType ) {
+
+ var t = event.type,
+ oe, props, ne, prop, ct, touch, i, j, len;
+
+ event = $.Event( event );
+ event.type = eventType;
+
+ oe = event.originalEvent;
+ props = $.event.props;
+
+ // addresses separation of $.event.props in to $.event.mouseHook.props and Issue 3280
+ // https://github.com/jquery/jquery-mobile/issues/3280
+ if ( t.search( /^(mouse|click)/ ) > -1 ) {
+ props = mouseEventProps;
+ }
+
+ // copy original event properties over to the new event
+ // this would happen if we could call $.event.fix instead of $.Event
+ // but we don't have a way to force an event to be fixed multiple times
+ if ( oe ) {
+ for ( i = props.length, prop; i; ) {
+ prop = props[ --i ];
+ event[ prop ] = oe[ prop ];
+ }
+ }
+
+ // make sure that if the mouse and click virtual events are generated
+ // without a .which one is defined
+ if ( t.search(/mouse(down|up)|click/) > -1 && !event.which ) {
+ event.which = 1;
+ }
+
+ if ( t.search(/^touch/) !== -1 ) {
+ ne = getNativeEvent( oe );
+ t = ne.touches;
+ ct = ne.changedTouches;
+ touch = ( t && t.length ) ? t[0] : ( ( ct && ct.length ) ? ct[ 0 ] : undefined );
+
+ if ( touch ) {
+ for ( j = 0, len = touchEventProps.length; j < len; j++) {
+ prop = touchEventProps[ j ];
+ event[ prop ] = touch[ prop ];
+ }
+ }
+ }
+
+ return event;
+}
+
+function getVirtualBindingFlags( element ) {
+
+ var flags = {},
+ b, k;
+
+ while ( element ) {
+
+ b = $.data( element, dataPropertyName );
+
+ for ( k in b ) {
+ if ( b[ k ] ) {
+ flags[ k ] = flags.hasVirtualBinding = true;
+ }
+ }
+ element = element.parentNode;
+ }
+ return flags;
+}
+
+function getClosestElementWithVirtualBinding( element, eventType ) {
+ var b;
+ while ( element ) {
+
+ b = $.data( element, dataPropertyName );
+
+ if ( b && ( !eventType || b[ eventType ] ) ) {
+ return element;
+ }
+ element = element.parentNode;
+ }
+ return null;
+}
+
+function enableTouchBindings() {
+ blockTouchTriggers = false;
+}
+
+function disableTouchBindings() {
+ blockTouchTriggers = true;
+}
+
+function enableMouseBindings() {
+ lastTouchID = 0;
+ clickBlockList.length = 0;
+ blockMouseTriggers = false;
+
+ // When mouse bindings are enabled, our
+ // touch bindings are disabled.
+ disableTouchBindings();
+}
+
+function disableMouseBindings() {
+ // When mouse bindings are disabled, our
+ // touch bindings are enabled.
+ enableTouchBindings();
+}
+
+function startResetTimer() {
+ clearResetTimer();
+ resetTimerID = setTimeout( function() {
+ resetTimerID = 0;
+ enableMouseBindings();
+ }, $.vmouse.resetTimerDuration );
+}
+
+function clearResetTimer() {
+ if ( resetTimerID ) {
+ clearTimeout( resetTimerID );
+ resetTimerID = 0;
+ }
+}
+
+function triggerVirtualEvent( eventType, event, flags ) {
+ var ve;
+
+ if ( ( flags && flags[ eventType ] ) ||
+ ( !flags && getClosestElementWithVirtualBinding( event.target, eventType ) ) ) {
+
+ ve = createVirtualEvent( event, eventType );
+
+ $( event.target).trigger( ve );
+ }
+
+ return ve;
+}
+
+function mouseEventCallback( event ) {
+ var touchID = $.data( event.target, touchTargetPropertyName );
+
+ if ( ( $.support.touch === true ) && ( touchID === undefined ) ) {
+ return;
+ }
+
+ if ( !blockMouseTriggers && ( !lastTouchID || lastTouchID !== touchID ) ) {
+ var ve = triggerVirtualEvent( "v" + event.type, event );
+ if ( ve ) {
+ if ( ve.isDefaultPrevented() ) {
+ event.preventDefault();
+ }
+ if ( ve.isPropagationStopped() ) {
+ event.stopPropagation();
+ }
+ if ( ve.isImmediatePropagationStopped() ) {
+ event.stopImmediatePropagation();
+ }
+ }
+ }
+}
+
+function handleTouchStart( event ) {
+
+ var touches = getNativeEvent( event ).touches,
+ target, flags;
+
+ if ( touches && touches.length === 1 ) {
+
+ target = event.target;
+ flags = getVirtualBindingFlags( target );
+
+ if ( flags.hasVirtualBinding ) {
+
+ lastTouchID = nextTouchID++;
+ $.data( target, touchTargetPropertyName, lastTouchID );
+
+ clearResetTimer();
+
+ disableMouseBindings();
+ didScroll = false;
+
+ var t = getNativeEvent( event ).touches[ 0 ];
+ startX = t.pageX;
+ startY = t.pageY;
+
+ triggerVirtualEvent( "vmouseover", event, flags );
+ triggerVirtualEvent( "vmousedown", event, flags );
+ }
+ }
+}
+
+function handleScroll( event ) {
+ if ( blockTouchTriggers ) {
+ return;
+ }
+
+ if ( !didScroll ) {
+ triggerVirtualEvent( "vmousecancel", event, getVirtualBindingFlags( event.target ) );
+ }
+
+ didScroll = true;
+ startResetTimer();
+}
+
+function handleTouchMove( event ) {
+ if ( blockTouchTriggers ) {
+ return;
+ }
+
+ var t = getNativeEvent( event ).touches[ 0 ],
+ didCancel = didScroll,
+ moveThreshold = $.vmouse.moveDistanceThreshold,
+ flags = getVirtualBindingFlags( event.target );
+
+ didScroll = didScroll ||
+ ( Math.abs( t.pageX - startX ) > moveThreshold ||
+ Math.abs( t.pageY - startY ) > moveThreshold );
+
+
+ if ( didScroll && !didCancel ) {
+ triggerVirtualEvent( "vmousecancel", event, flags );
+ }
+
+ triggerVirtualEvent( "vmousemove", event, flags );
+ startResetTimer();
+}
+
+function handleTouchEnd( event ) {
+ if ( blockTouchTriggers ) {
+ return;
+ }
+
+ disableTouchBindings();
+
+ var flags = getVirtualBindingFlags( event.target ),
+ t;
+ triggerVirtualEvent( "vmouseup", event, flags );
+
+ if ( !didScroll ) {
+ var ve = triggerVirtualEvent( "vclick", event, flags );
+ if ( ve && ve.isDefaultPrevented() ) {
+ // The target of the mouse events that follow the touchend
+ // event don't necessarily match the target used during the
+ // touch. This means we need to rely on coordinates for blocking
+ // any click that is generated.
+ t = getNativeEvent( event ).changedTouches[ 0 ];
+ clickBlockList.push({
+ touchID: lastTouchID,
+ target: event.target,
+ x: t.clientX,
+ y: t.clientY
+ });
+
+ // Prevent any mouse events that follow from triggering
+ // virtual event notifications.
+ blockMouseTriggers = true;
+ }
+ }
+ triggerVirtualEvent( "vmouseout", event, flags);
+ didScroll = false;
+
+ startResetTimer();
+}
+
+function hasVirtualBindings( ele ) {
+ var bindings = $.data( ele, dataPropertyName ),
+ k;
+
+ if ( bindings ) {
+ for ( k in bindings ) {
+ if ( bindings[ k ] ) {
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
+function dummyMouseHandler() {}
+
+function getSpecialEventObject( eventType ) {
+ var realType = eventType.substr( 1 );
+
+ return {
+ setup: function( data, namespace ) {
+ // If this is the first virtual mouse binding for this element,
+ // add a bindings object to its data.
+
+ if ( !hasVirtualBindings( this ) ) {
+ $.data( this, dataPropertyName, {} );
+ }
+
+ // If setup is called, we know it is the first binding for this
+ // eventType, so initialize the count for the eventType to zero.
+ var bindings = $.data( this, dataPropertyName );
+ bindings[ eventType ] = true;
+
+ // If this is the first virtual mouse event for this type,
+ // register a global handler on the document.
+
+ activeDocHandlers[ eventType ] = ( activeDocHandlers[ eventType ] || 0 ) + 1;
+
+ if ( activeDocHandlers[ eventType ] === 1 ) {
+ $document.bind( realType, mouseEventCallback );
+ }
+
+ // Some browsers, like Opera Mini, won't dispatch mouse/click events
+ // for elements unless they actually have handlers registered on them.
+ // To get around this, we register dummy handlers on the elements.
+
+ $( this ).bind( realType, dummyMouseHandler );
+
+ // For now, if event capture is not supported, we rely on mouse handlers.
+ if ( eventCaptureSupported ) {
+ // If this is the first virtual mouse binding for the document,
+ // register our touchstart handler on the document.
+
+ activeDocHandlers[ "touchstart" ] = ( activeDocHandlers[ "touchstart" ] || 0) + 1;
+
+ if ( activeDocHandlers[ "touchstart" ] === 1 ) {
+ $document.bind( "touchstart", handleTouchStart )
+ .bind( "touchend", handleTouchEnd )
+
+ // On touch platforms, touching the screen and then dragging your finger
+ // causes the window content to scroll after some distance threshold is
+ // exceeded. On these platforms, a scroll prevents a click event from being
+ // dispatched, and on some platforms, even the touchend is suppressed. To
+ // mimic the suppression of the click event, we need to watch for a scroll
+ // event. Unfortunately, some platforms like iOS don't dispatch scroll
+ // events until *AFTER* the user lifts their finger (touchend). This means
+ // we need to watch both scroll and touchmove events to figure out whether
+ // or not a scroll happenens before the touchend event is fired.
+
+ .bind( "touchmove", handleTouchMove )
+ .bind( "scroll", handleScroll );
+ }
+ }
+ },
+
+ teardown: function( data, namespace ) {
+ // If this is the last virtual binding for this eventType,
+ // remove its global handler from the document.
+
+ --activeDocHandlers[ eventType ];
+
+ if ( !activeDocHandlers[ eventType ] ) {
+ $document.unbind( realType, mouseEventCallback );
+ }
+
+ if ( eventCaptureSupported ) {
+ // If this is the last virtual mouse binding in existence,
+ // remove our document touchstart listener.
+
+ --activeDocHandlers[ "touchstart" ];
+
+ if ( !activeDocHandlers[ "touchstart" ] ) {
+ $document.unbind( "touchstart", handleTouchStart )
+ .unbind( "touchmove", handleTouchMove )
+ .unbind( "touchend", handleTouchEnd )
+ .unbind( "scroll", handleScroll );
+ }
+ }
+
+ var $this = $( this ),
+ bindings = $.data( this, dataPropertyName );
+
+ // teardown may be called when an element was
+ // removed from the DOM. If this is the case,
+ // jQuery core may have already stripped the element
+ // of any data bindings so we need to check it before
+ // using it.
+ if ( bindings ) {
+ bindings[ eventType ] = false;
+ }
+
+ // Unregister the dummy event handler.
+
+ $this.unbind( realType, dummyMouseHandler );
+
+ // If this is the last virtual mouse binding on the
+ // element, remove the binding data from the element.
+
+ if ( !hasVirtualBindings( this ) ) {
+ $this.removeData( dataPropertyName );
+ }
+ }
+ };
+}
+
+// Expose our custom events to the jQuery bind/unbind mechanism.
+
+for ( var i = 0; i < virtualEventNames.length; i++ ) {
+ $.event.special[ virtualEventNames[ i ] ] = getSpecialEventObject( virtualEventNames[ i ] );
+}
+
+// Add a capture click handler to block clicks.
+// Note that we require event capture support for this so if the device
+// doesn't support it, we punt for now and rely solely on mouse events.
+if ( eventCaptureSupported ) {
+ document.addEventListener( "click", function( e ) {
+ var cnt = clickBlockList.length,
+ target = e.target,
+ x, y, ele, i, o, touchID;
+
+ if ( cnt ) {
+ x = e.clientX;
+ y = e.clientY;
+ threshold = $.vmouse.clickDistanceThreshold;
+
+ // The idea here is to run through the clickBlockList to see if
+ // the current click event is in the proximity of one of our
+ // vclick events that had preventDefault() called on it. If we find
+ // one, then we block the click.
+ //
+ // Why do we have to rely on proximity?
+ //
+ // Because the target of the touch event that triggered the vclick
+ // can be different from the target of the click event synthesized
+ // by the browser. The target of a mouse/click event that is syntehsized
+ // from a touch event seems to be implementation specific. For example,
+ // some browsers will fire mouse/click events for a link that is near
+ // a touch event, even though the target of the touchstart/touchend event
+ // says the user touched outside the link. Also, it seems that with most
+ // browsers, the target of the mouse/click event is not calculated until the
+ // time it is dispatched, so if you replace an element that you touched
+ // with another element, the target of the mouse/click will be the new
+ // element underneath that point.
+ //
+ // Aside from proximity, we also check to see if the target and any
+ // of its ancestors were the ones that blocked a click. This is necessary
+ // because of the strange mouse/click target calculation done in the
+ // Android 2.1 browser, where if you click on an element, and there is a
+ // mouse/click handler on one of its ancestors, the target will be the
+ // innermost child of the touched element, even if that child is no where
+ // near the point of touch.
+
+ ele = target;
+
+ while ( ele ) {
+ for ( i = 0; i < cnt; i++ ) {
+ o = clickBlockList[ i ];
+ touchID = 0;
+
+ if ( ( ele === target && target === o.target && Math.abs( o.x - x ) < threshold && Math.abs( o.y - y ) < threshold ) ||
+ $.data( ele, touchTargetPropertyName ) === o.touchID ) {
+ // XXX: We may want to consider removing matches from the block list
+ // instead of waiting for the reset timer to fire.
+ e.preventDefault();
+ e.stopPropagation();
+ return;
+ }
+ }
+ ele = ele.parentNode;
+ }
+ }
+ }, true);
+}
+})( jQuery, window, document );
--- /dev/null
+(function( $, undefined ) {
+
+$.widget( "mobile.widget", {
+ // decorate the parent _createWidget to trigger `widgetinit` for users
+ // who wish to do post post `widgetcreate` alterations/additions
+ //
+ // TODO create a pull request for jquery ui to trigger this event
+ // in the original _createWidget
+ _createWidget: function() {
+ $.Widget.prototype._createWidget.apply( this, arguments );
+ this._trigger( 'init' );
+ },
+
+ _getCreateOptions: function() {
+
+ var elem = this.element,
+ options = {};
+
+ $.each( this.options, function( option ) {
+
+ var value = elem.jqmData( option.replace( /[A-Z]/g, function( c ) {
+ return "-" + c.toLowerCase();
+ })
+ );
+
+ if ( value !== undefined ) {
+ options[ option ] = value;
+ }
+ });
+
+ return options;
+ },
+
+ enhanceWithin: function( target, useKeepNative ) {
+ this.enhance( $( this.options.initSelector, $( target )), useKeepNative );
+ },
+
+ enhance: function( targets, useKeepNative ) {
+ var page, keepNative, $widgetElements = $( targets ), self = this;
+
+ // if ignoreContentEnabled is set to true the framework should
+ // only enhance the selected elements when they do NOT have a
+ // parent with the data-namespace-ignore attribute
+ $widgetElements = $.mobile.enhanceable( $widgetElements );
+
+ if ( useKeepNative && $widgetElements.length ) {
+ // TODO remove dependency on the page widget for the keepNative.
+ // Currently the keepNative value is defined on the page prototype so
+ // the method is as well
+ page = $.mobile.closestPageData( $widgetElements );
+ keepNative = ( page && page.keepNativeSelector()) || "";
+
+ $widgetElements = $widgetElements.not( keepNative );
+ }
+
+ $widgetElements[ this.widgetName ]();
+ },
+
+ raise: function( msg ) {
+ throw "Widget [" + this.widgetName + "]: " + msg;
+ }
+});
+
+})( jQuery );
--- /dev/null
+(function( $, window ) {
+
+ // This fix addresses an iOS bug, so return early if the UA claims it's something else.
+ if ( !(/iPhone|iPad|iPod/.test( navigator.platform ) && navigator.userAgent.indexOf( "AppleWebKit" ) > -1 ) ) {
+ return;
+ }
+
+ var zoom = $.mobile.zoom,
+ evt, x, y, z, aig;
+
+ function checkTilt( e ) {
+ evt = e.originalEvent;
+ aig = evt.accelerationIncludingGravity;
+
+ x = Math.abs( aig.x );
+ y = Math.abs( aig.y );
+ z = Math.abs( aig.z );
+
+ // If portrait orientation and in one of the danger zones
+ if ( !window.orientation && ( x > 7 || ( ( z > 6 && y < 8 || z < 8 && y > 6 ) && x > 5 ) ) ) {
+ if ( zoom.enabled ) {
+ zoom.disable();
+ }
+ } else if ( !zoom.enabled ) {
+ zoom.enable();
+ }
+ }
+
+ $.mobile.$window
+ .bind( "orientationchange.iosorientationfix", zoom.enable )
+ .bind( "devicemotion.iosorientationfix", checkTilt );
+
+}( jQuery, this ));
--- /dev/null
+(function( $ ) {
+ var meta = $( "meta[name=viewport]" ),
+ initialContent = meta.attr( "content" ),
+ disabledZoom = initialContent + ",maximum-scale=1, user-scalable=no",
+ enabledZoom = initialContent + ",maximum-scale=10, user-scalable=yes",
+ disabledInitially = /(user-scalable[\s]*=[\s]*no)|(maximum-scale[\s]*=[\s]*1)[$,\s]/.test( initialContent );
+
+ $.mobile.zoom = $.extend( {}, {
+ enabled: !disabledInitially,
+ locked: false,
+ disable: function( lock ) {
+ if ( !disabledInitially && !$.mobile.zoom.locked ) {
+ meta.attr( "content", disabledZoom );
+ $.mobile.zoom.enabled = false;
+ $.mobile.zoom.locked = lock || false;
+ }
+ },
+ enable: function( unlock ) {
+ if ( !disabledInitially && ( !$.mobile.zoom.locked || unlock === true ) ) {
+ meta.attr( "content", enabledZoom );
+ $.mobile.zoom.enabled = true;
+ $.mobile.zoom.locked = false;
+ }
+ },
+ restore: function() {
+ if ( !disabledInitially ) {
+ meta.attr( "content", initialContent );
+ $.mobile.zoom.enabled = true;
+ }
+ }
+ });
+
+}( jQuery ));
--- /dev/null
+(function() {
+ // Insert a script tag pointing at the desired version of jQuery
+
+ // Get the version from the url
+ var jqueryRE = /[\\?&]jquery=([^&#]*)/,
+ results = jqueryRE.exec( location.search ),
+ version = "",
+ myScriptTag = document.getElementsByTagName( "script" )[document.getElementsByTagName( "script" ).length - 1],
+ baseUrl = myScriptTag.src.replace( /(.*)\/.*$/, "$1/" ),
+ url = baseUrl + "jquery.js";
+
+ if ( results ) {
+ version = decodeURIComponent(results[results.length - 1].replace(/\+/g, " "));
+ url = "http://code.jquery.com/jquery-"+version+".js";
+ }
+
+ document.write( "<script src='" + url + "'></script>" );
+
+ document.write(
+ '<script>' +
+ 'if ( parseInt( jQuery.fn.jquery.replace( /\\./g, "" ), 10 ) < 170 && window.define && window.define.amd ) {' +
+ 'define( "jquery", [], function () { return jQuery; } );'+
+ '}'+
+ '</script>'
+ );
+}());
\ No newline at end of file
--- /dev/null
+/*!
+ * jQuery UI Widget v1.9.0-beta.1
+ *
+ * Copyright 2012, https://github.com/jquery/jquery-ui/blob/1.9.0-beta.1/AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Widget
+ */
+(function( $, undefined ) {
+
+var uuid = 0,
+ slice = Array.prototype.slice,
+ _cleanData = $.cleanData;
+$.cleanData = function( elems ) {
+ for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
+ try {
+ $( elem ).triggerHandler( "remove" );
+ // http://bugs.jquery.com/ticket/8235
+ } catch( e ) {}
+ }
+ _cleanData( elems );
+};
+
+$.widget = function( name, base, prototype ) {
+ var fullName, existingConstructor, constructor, basePrototype,
+ namespace = name.split( "." )[ 0 ];
+
+ name = name.split( "." )[ 1 ];
+ fullName = namespace + "-" + name;
+
+ if ( !prototype ) {
+ prototype = base;
+ base = $.Widget;
+ }
+
+ // create selector for plugin
+ $.expr[ ":" ][ fullName ] = function( elem ) {
+ return !!$.data( elem, fullName );
+ };
+
+ $[ namespace ] = $[ namespace ] || {};
+ existingConstructor = $[ namespace ][ name ];
+ constructor = $[ namespace ][ name ] = function( options, element ) {
+ // allow instantiation without "new" keyword
+ if ( !this._createWidget ) {
+ return new constructor( options, element );
+ }
+
+ // allow instantiation without initializing for simple inheritance
+ // must use "new" keyword (the code above always passes args)
+ if ( arguments.length ) {
+ this._createWidget( options, element );
+ }
+ };
+ // extend with the existing constructor to carry over any static properties
+ $.extend( constructor, existingConstructor, {
+ version: prototype.version,
+ // copy the object used to create the prototype in case we need to
+ // redefine the widget later
+ _proto: $.extend( {}, prototype ),
+ // track widgets that inherit from this widget in case this widget is
+ // redefined after a widget inherits from it
+ _childConstructors: []
+ });
+
+ basePrototype = new base();
+ // we need to make the options hash a property directly on the new instance
+ // otherwise we'll modify the options hash on the prototype that we're
+ // inheriting from
+ basePrototype.options = $.widget.extend( {}, basePrototype.options );
+ $.each( prototype, function( prop, value ) {
+ if ( $.isFunction( value ) ) {
+ prototype[ prop ] = (function() {
+ var _super = function() {
+ return base.prototype[ prop ].apply( this, arguments );
+ },
+ _superApply = function( args ) {
+ return base.prototype[ prop ].apply( this, args );
+ };
+ return function() {
+ var __super = this._super,
+ __superApply = this._superApply,
+ returnValue;
+
+ this._super = _super;
+ this._superApply = _superApply;
+
+ returnValue = value.apply( this, arguments );
+
+ this._super = __super;
+ this._superApply = __superApply;
+
+ return returnValue;
+ };
+ })();
+ }
+ });
+ constructor.prototype = $.widget.extend( basePrototype, {
+ // TODO: remove support for widgetEventPrefix
+ // always use the name + a colon as the prefix, e.g., draggable:start
+ // don't prefix for widgets that aren't DOM-based
+ widgetEventPrefix: name
+ }, prototype, {
+ constructor: constructor,
+ namespace: namespace,
+ widgetName: name,
+ // TODO remove widgetBaseClass, see #8155
+ widgetBaseClass: fullName,
+ widgetFullName: fullName
+ });
+
+ // If this widget is being redefined then we need to find all widgets that
+ // are inheriting from it and redefine all of them so that they inherit from
+ // the new version of this widget. We're essentially trying to replace one
+ // level in the prototype chain.
+ if ( existingConstructor ) {
+ $.each( existingConstructor._childConstructors, function( i, child ) {
+ var childPrototype = child.prototype;
+
+ // redefine the child widget using the same prototype that was
+ // originally used, but inherit from the new version of the base
+ $.widget( childPrototype.namespace + "." + childPrototype.widgetName, constructor, child._proto );
+ });
+ // remove the list of existing child constructors from the old constructor
+ // so the old child constructors can be garbage collected
+ delete existingConstructor._childConstructors;
+ } else {
+ base._childConstructors.push( constructor );
+ }
+
+ $.widget.bridge( name, constructor );
+};
+
+$.widget.extend = function( target ) {
+ var input = slice.call( arguments, 1 ),
+ inputIndex = 0,
+ inputLength = input.length,
+ key,
+ value;
+ for ( ; inputIndex < inputLength; inputIndex++ ) {
+ for ( key in input[ inputIndex ] ) {
+ value = input[ inputIndex ][ key ];
+ if (input[ inputIndex ].hasOwnProperty( key ) && value !== undefined ) {
+ target[ key ] = $.isPlainObject( value ) ? $.widget.extend( {}, target[ key ], value ) : value;
+ }
+ }
+ }
+ return target;
+};
+
+$.widget.bridge = function( name, object ) {
+ var fullName = object.prototype.widgetFullName;
+ $.fn[ name ] = function( options ) {
+ var isMethodCall = typeof options === "string",
+ args = slice.call( arguments, 1 ),
+ returnValue = this;
+
+ // allow multiple hashes to be passed on init
+ options = !isMethodCall && args.length ?
+ $.widget.extend.apply( null, [ options ].concat(args) ) :
+ options;
+
+ if ( isMethodCall ) {
+ this.each(function() {
+ var methodValue,
+ instance = $.data( this, fullName );
+ if ( !instance ) {
+ return $.error( "cannot call methods on " + name + " prior to initialization; " +
+ "attempted to call method '" + options + "'" );
+ }
+ if ( !$.isFunction( instance[options] ) || options.charAt( 0 ) === "_" ) {
+ return $.error( "no such method '" + options + "' for " + name + " widget instance" );
+ }
+ methodValue = instance[ options ].apply( instance, args );
+ if ( methodValue !== instance && methodValue !== undefined ) {
+ returnValue = methodValue && methodValue.jquery ?
+ returnValue.pushStack( methodValue.get() ) :
+ methodValue;
+ return false;
+ }
+ });
+ } else {
+ this.each(function() {
+ var instance = $.data( this, fullName );
+ if ( instance ) {
+ instance.option( options || {} )._init();
+ } else {
+ new object( options, this );
+ }
+ });
+ }
+
+ return returnValue;
+ };
+};
+
+$.Widget = function( options, element ) {};
+$.Widget._childConstructors = [];
+
+$.Widget.prototype = {
+ widgetName: "widget",
+ widgetEventPrefix: "",
+ defaultElement: "<div>",
+ options: {
+ disabled: false,
+
+ // callbacks
+ create: null
+ },
+ _createWidget: function( options, element ) {
+ element = $( element || this.defaultElement || this )[ 0 ];
+ this.element = $( element );
+ this.uuid = uuid++;
+ this.eventNamespace = "." + this.widgetName + this.uuid;
+ this.options = $.widget.extend( {},
+ this.options,
+ this._getCreateOptions(),
+ options );
+
+ this.bindings = $();
+ this.hoverable = $();
+ this.focusable = $();
+
+ if ( element !== this ) {
+ // 1.9 BC for #7810
+ // TODO remove dual storage
+ $.data( element, this.widgetName, this );
+ $.data( element, this.widgetFullName, this );
+ this._on({ remove: "destroy" });
+ this.document = $( element.style ?
+ // element within the document
+ element.ownerDocument :
+ // element is window or document
+ element.document || element );
+ this.window = $( this.document[0].defaultView || this.document[0].parentWindow );
+ }
+
+ this._create();
+ this._trigger( "create", null, this._getCreateEventData() );
+ this._init();
+ },
+ _getCreateOptions: $.noop,
+ _getCreateEventData: $.noop,
+ _create: $.noop,
+ _init: $.noop,
+
+ destroy: function() {
+ this._destroy();
+ // we can probably remove the unbind calls in 2.0
+ // all event bindings should go through this._on()
+ this.element
+ .unbind( this.eventNamespace )
+ // 1.9 BC for #7810
+ // TODO remove dual storage
+ .removeData( this.widgetName )
+ .removeData( this.widgetFullName )
+ // support: jquery <1.6.3
+ // http://bugs.jquery.com/ticket/9413
+ .removeData( $.camelCase( this.widgetFullName ) );
+ this.widget()
+ .unbind( this.eventNamespace )
+ .removeAttr( "aria-disabled" )
+ .removeClass(
+ this.widgetFullName + "-disabled " +
+ "ui-state-disabled" );
+
+ // clean up events and states
+ this.bindings.unbind( this.eventNamespace );
+ this.hoverable.removeClass( "ui-state-hover" );
+ this.focusable.removeClass( "ui-state-focus" );
+ },
+ _destroy: $.noop,
+
+ widget: function() {
+ return this.element;
+ },
+
+ option: function( key, value ) {
+ var options = key,
+ parts,
+ curOption,
+ i;
+
+ if ( arguments.length === 0 ) {
+ // don't return a reference to the internal hash
+ return $.widget.extend( {}, this.options );
+ }
+
+ if ( typeof key === "string" ) {
+ // handle nested keys, e.g., "foo.bar" => { foo: { bar: ___ } }
+ options = {};
+ parts = key.split( "." );
+ key = parts.shift();
+ if ( parts.length ) {
+ curOption = options[ key ] = $.widget.extend( {}, this.options[ key ] );
+ for ( i = 0; i < parts.length - 1; i++ ) {
+ curOption[ parts[ i ] ] = curOption[ parts[ i ] ] || {};
+ curOption = curOption[ parts[ i ] ];
+ }
+ key = parts.pop();
+ if ( value === undefined ) {
+ return curOption[ key ] === undefined ? null : curOption[ key ];
+ }
+ curOption[ key ] = value;
+ } else {
+ if ( value === undefined ) {
+ return this.options[ key ] === undefined ? null : this.options[ key ];
+ }
+ options[ key ] = value;
+ }
+ }
+
+ this._setOptions( options );
+
+ return this;
+ },
+ _setOptions: function( options ) {
+ var key;
+
+ for ( key in options ) {
+ this._setOption( key, options[ key ] );
+ }
+
+ return this;
+ },
+ _setOption: function( key, value ) {
+ this.options[ key ] = value;
+
+ if ( key === "disabled" ) {
+ this.widget()
+ .toggleClass( this.widgetFullName + "-disabled ui-state-disabled", !!value )
+ .attr( "aria-disabled", value );
+ this.hoverable.removeClass( "ui-state-hover" );
+ this.focusable.removeClass( "ui-state-focus" );
+ }
+
+ return this;
+ },
+
+ enable: function() {
+ return this._setOption( "disabled", false );
+ },
+ disable: function() {
+ return this._setOption( "disabled", true );
+ },
+
+ _on: function( element, handlers ) {
+ // no element argument, shuffle and use this.element
+ if ( !handlers ) {
+ handlers = element;
+ element = this.element;
+ } else {
+ // accept selectors, DOM elements
+ element = $( element );
+ this.bindings = this.bindings.add( element );
+ }
+
+ var instance = this;
+ $.each( handlers, function( event, handler ) {
+ function handlerProxy() {
+ // allow widgets to customize the disabled handling
+ // - disabled as an array instead of boolean
+ // - disabled class as method for disabling individual parts
+ if ( instance.options.disabled === true ||
+ $( this ).hasClass( "ui-state-disabled" ) ) {
+ return;
+ }
+ return ( typeof handler === "string" ? instance[ handler ] : handler )
+ .apply( instance, arguments );
+ }
+
+ // copy the guid so direct unbinding works
+ if ( typeof handler !== "string" ) {
+ handlerProxy.guid = handler.guid =
+ handler.guid || handlerProxy.guid || $.guid++;
+ }
+
+ var match = event.match( /^(\w+)\s*(.*)$/ ),
+ eventName = match[1] + instance.eventNamespace,
+ selector = match[2];
+ if ( selector ) {
+ instance.widget().delegate( selector, eventName, handlerProxy );
+ } else {
+ element.bind( eventName, handlerProxy );
+ }
+ });
+ },
+
+ _off: function( element, eventName ) {
+ eventName = (eventName || "").split( " " ).join( this.eventNamespace + " " ) + this.eventNamespace;
+ element.unbind( eventName ).undelegate( eventName );
+ },
+
+ _delay: function( handler, delay ) {
+ function handlerProxy() {
+ return ( typeof handler === "string" ? instance[ handler ] : handler )
+ .apply( instance, arguments );
+ }
+ var instance = this;
+ return setTimeout( handlerProxy, delay || 0 );
+ },
+
+ _hoverable: function( element ) {
+ this.hoverable = this.hoverable.add( element );
+ this._on( element, {
+ mouseenter: function( event ) {
+ $( event.currentTarget ).addClass( "ui-state-hover" );
+ },
+ mouseleave: function( event ) {
+ $( event.currentTarget ).removeClass( "ui-state-hover" );
+ }
+ });
+ },
+
+ _focusable: function( element ) {
+ this.focusable = this.focusable.add( element );
+ this._on( element, {
+ focusin: function( event ) {
+ $( event.currentTarget ).addClass( "ui-state-focus" );
+ },
+ focusout: function( event ) {
+ $( event.currentTarget ).removeClass( "ui-state-focus" );
+ }
+ });
+ },
+
+ _trigger: function( type, event, data ) {
+ var prop, orig,
+ callback = this.options[ type ];
+
+ data = data || {};
+ event = $.Event( event );
+ event.type = ( type === this.widgetEventPrefix ?
+ type :
+ this.widgetEventPrefix + type ).toLowerCase();
+ // the original event may come from any element
+ // so we need to reset the target on the new event
+ event.target = this.element[ 0 ];
+
+ // copy original event properties over to the new event
+ orig = event.originalEvent;
+ if ( orig ) {
+ for ( prop in orig ) {
+ if ( !( prop in event ) ) {
+ event[ prop ] = orig[ prop ];
+ }
+ }
+ }
+
+ this.element.trigger( event, data );
+ return !( $.isFunction( callback ) &&
+ callback.apply( this.element[0], [ event ].concat( data ) ) === false ||
+ event.isDefaultPrevented() );
+ }
+};
+
+$.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) {
+ $.Widget.prototype[ "_" + method ] = function( element, options, callback ) {
+ if ( typeof options === "string" ) {
+ options = { effect: options };
+ }
+ var hasOptions,
+ effectName = !options ?
+ method :
+ options === true || typeof options === "number" ?
+ defaultEffect :
+ options.effect || defaultEffect;
+ options = options || {};
+ if ( typeof options === "number" ) {
+ options = { duration: options };
+ }
+ hasOptions = !$.isEmptyObject( options );
+ options.complete = callback;
+ if ( options.delay ) {
+ element.delay( options.delay );
+ }
+ if ( hasOptions && $.effects && ( $.effects.effect[ effectName ] || $.uiBackCompat !== false && $.effects[ effectName ] ) ) {
+ element[ method ]( options );
+ } else if ( effectName !== method && element[ effectName ] ) {
+ element[ effectName ]( options.duration, options.easing, callback );
+ } else {
+ element.queue(function( next ) {
+ $( this )[ method ]();
+ if ( callback ) {
+ callback.call( element[ 0 ] );
+ }
+ next();
+ });
+ }
+ };
+});
+
+// DEPRECATED
+if ( $.uiBackCompat !== false ) {
+ $.Widget.prototype._getCreateOptions = function() {
+ return $.metadata && $.metadata.get( this.element[0] )[ this.widgetName ];
+ };
+}
+
+})( jQuery );
--- /dev/null
+/**
+ * @license RequireJS text 1.0.2 Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved.
+ * Available via the MIT or new BSD license.
+ * see: http://github.com/jrburke/requirejs for details
+ */
+/*jslint regexp: false, nomen: false, plusplus: false, strict: false */
+/*global require: false, XMLHttpRequest: false, ActiveXObject: false,
+ define: false, window: false, process: false, Packages: false,
+ java: false, location: false */
+
+(function () {
+ var progIds = ['Msxml2.XMLHTTP', 'Microsoft.XMLHTTP', 'Msxml2.XMLHTTP.4.0'],
+ xmlRegExp = /^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,
+ bodyRegExp = /<body[^>]*>\s*([\s\S]+)\s*<\/body>/im,
+ hasLocation = typeof location !== 'undefined' && location.href,
+ defaultProtocol = hasLocation && location.protocol && location.protocol.replace(/\:/, ''),
+ defaultHostName = hasLocation && location.hostname,
+ defaultPort = hasLocation && (location.port || undefined),
+ buildMap = [];
+
+ define(function () {
+ var text, get, fs;
+
+ if (typeof window !== "undefined" && window.navigator && window.document) {
+ get = function (url, callback) {
+ var xhr = text.createXhr();
+ xhr.open('GET', url, true);
+ xhr.onreadystatechange = function (evt) {
+ //Do not explicitly handle errors, those should be
+ //visible via console output in the browser.
+ if (xhr.readyState === 4) {
+ callback(xhr.responseText);
+ }
+ };
+ xhr.send(null);
+ };
+ } else if (typeof process !== "undefined" &&
+ process.versions &&
+ !!process.versions.node) {
+ //Using special require.nodeRequire, something added by r.js.
+ fs = require.nodeRequire('fs');
+
+ get = function (url, callback) {
+ callback(fs.readFileSync(url, 'utf8'));
+ };
+ } else if (typeof Packages !== 'undefined') {
+ //Why Java, why is this so awkward?
+ get = function (url, callback) {
+ var encoding = "utf-8",
+ file = new java.io.File(url),
+ lineSeparator = java.lang.System.getProperty("line.separator"),
+ input = new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(file), encoding)),
+ stringBuffer, line,
+ content = '';
+ try {
+ stringBuffer = new java.lang.StringBuffer();
+ line = input.readLine();
+
+ // Byte Order Mark (BOM) - The Unicode Standard, version 3.0, page 324
+ // http://www.unicode.org/faq/utf_bom.html
+
+ // Note that when we use utf-8, the BOM should appear as "EF BB BF", but it doesn't due to this bug in the JDK:
+ // http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4508058
+ if (line && line.length() && line.charAt(0) === 0xfeff) {
+ // Eat the BOM, since we've already found the encoding on this file,
+ // and we plan to concatenating this buffer with others; the BOM should
+ // only appear at the top of a file.
+ line = line.substring(1);
+ }
+
+ stringBuffer.append(line);
+
+ while ((line = input.readLine()) !== null) {
+ stringBuffer.append(lineSeparator);
+ stringBuffer.append(line);
+ }
+ //Make sure we return a JavaScript string and not a Java string.
+ content = String(stringBuffer.toString()); //String
+ } finally {
+ input.close();
+ }
+ callback(content);
+ };
+ }
+
+ text = {
+ version: '1.0.2',
+
+ strip: function (content) {
+ //Strips <?xml ...?> declarations so that external SVG and XML
+ //documents can be added to a document without worry. Also, if the string
+ //is an HTML document, only the part inside the body tag is returned.
+ if (content) {
+ content = content.replace(xmlRegExp, "");
+ var matches = content.match(bodyRegExp);
+ if (matches) {
+ content = matches[1];
+ }
+ } else {
+ content = "";
+ }
+ return content;
+ },
+
+ jsEscape: function (content) {
+ return content.replace(/(['\\])/g, '\\$1')
+ .replace(/[\f]/g, "\\f")
+ .replace(/[\b]/g, "\\b")
+ .replace(/[\n]/g, "\\n")
+ .replace(/[\t]/g, "\\t")
+ .replace(/[\r]/g, "\\r");
+ },
+
+ createXhr: function () {
+ //Would love to dump the ActiveX crap in here. Need IE 6 to die first.
+ var xhr, i, progId;
+ if (typeof XMLHttpRequest !== "undefined") {
+ return new XMLHttpRequest();
+ } else {
+ for (i = 0; i < 3; i++) {
+ progId = progIds[i];
+ try {
+ xhr = new ActiveXObject(progId);
+ } catch (e) {}
+
+ if (xhr) {
+ progIds = [progId]; // so faster next time
+ break;
+ }
+ }
+ }
+
+ if (!xhr) {
+ throw new Error("createXhr(): XMLHttpRequest not available");
+ }
+
+ return xhr;
+ },
+
+ get: get,
+
+ /**
+ * Parses a resource name into its component parts. Resource names
+ * look like: module/name.ext!strip, where the !strip part is
+ * optional.
+ * @param {String} name the resource name
+ * @returns {Object} with properties "moduleName", "ext" and "strip"
+ * where strip is a boolean.
+ */
+ parseName: function (name) {
+ var strip = false, index = name.indexOf("."),
+ modName = name.substring(0, index),
+ ext = name.substring(index + 1, name.length);
+
+ index = ext.indexOf("!");
+ if (index !== -1) {
+ //Pull off the strip arg.
+ strip = ext.substring(index + 1, ext.length);
+ strip = strip === "strip";
+ ext = ext.substring(0, index);
+ }
+
+ return {
+ moduleName: modName,
+ ext: ext,
+ strip: strip
+ };
+ },
+
+ xdRegExp: /^((\w+)\:)?\/\/([^\/\\]+)/,
+
+ /**
+ * Is an URL on another domain. Only works for browser use, returns
+ * false in non-browser environments. Only used to know if an
+ * optimized .js version of a text resource should be loaded
+ * instead.
+ * @param {String} url
+ * @returns Boolean
+ */
+ useXhr: function (url, protocol, hostname, port) {
+ var match = text.xdRegExp.exec(url),
+ uProtocol, uHostName, uPort;
+ if (!match) {
+ return true;
+ }
+ uProtocol = match[2];
+ uHostName = match[3];
+
+ uHostName = uHostName.split(':');
+ uPort = uHostName[1];
+ uHostName = uHostName[0];
+
+ return (!uProtocol || uProtocol === protocol) &&
+ (!uHostName || uHostName === hostname) &&
+ ((!uPort && !uHostName) || uPort === port);
+ },
+
+ finishLoad: function (name, strip, content, onLoad, config) {
+ content = strip ? text.strip(content) : content;
+ if (config.isBuild) {
+ buildMap[name] = content;
+ }
+ onLoad(content);
+ },
+
+ load: function (name, req, onLoad, config) {
+ //Name has format: some.module.filext!strip
+ //The strip part is optional.
+ //if strip is present, then that means only get the string contents
+ //inside a body tag in an HTML string. For XML/SVG content it means
+ //removing the <?xml ...?> declarations so the content can be inserted
+ //into the current doc without problems.
+
+ // Do not bother with the work if a build and text will
+ // not be inlined.
+ if (config.isBuild && !config.inlineText) {
+ onLoad();
+ return;
+ }
+
+ var parsed = text.parseName(name),
+ nonStripName = parsed.moduleName + '.' + parsed.ext,
+ url = req.toUrl(nonStripName),
+ useXhr = (config && config.text && config.text.useXhr) ||
+ text.useXhr;
+
+ //Load the text. Use XHR if possible and in a browser.
+ if (!hasLocation || useXhr(url, defaultProtocol, defaultHostName, defaultPort)) {
+ text.get(url, function (content) {
+ text.finishLoad(name, parsed.strip, content, onLoad, config);
+ });
+ } else {
+ //Need to fetch the resource across domains. Assume
+ //the resource has been optimized into a JS module. Fetch
+ //by the module name + extension, but do not include the
+ //!strip part to avoid file system issues.
+ req([nonStripName], function (content) {
+ text.finishLoad(parsed.moduleName + '.' + parsed.ext,
+ parsed.strip, content, onLoad, config);
+ });
+ }
+ },
+
+ write: function (pluginName, moduleName, write, config) {
+ if (moduleName in buildMap) {
+ var content = text.jsEscape(buildMap[moduleName]);
+ write.asModule(pluginName + "!" + moduleName,
+ "define(function () { return '" +
+ content +
+ "';});\n");
+ }
+ },
+
+ writeFile: function (pluginName, moduleName, req, write, config) {
+ var parsed = text.parseName(moduleName),
+ nonStripName = parsed.moduleName + '.' + parsed.ext,
+ //Use a '.js' file name so that it indicates it is a
+ //script that can be loaded across domains.
+ fileName = req.toUrl(parsed.moduleName + '.' +
+ parsed.ext) + '.js';
+
+ //Leverage own load() method to load plugin value, but only
+ //write out values that do not have the strip argument,
+ //to avoid any potential issues with ! in file names.
+ text.load(nonStripName, req, function (value) {
+ //Use own write() method to construct full module value.
+ //But need to create shell that translates writeFile's
+ //write() to the right interface.
+ var textWrite = function (contents) {
+ return write(fileName, contents);
+ };
+ textWrite.asModule = function (moduleName, contents) {
+ return write.asModule(moduleName, fileName, contents);
+ };
+
+ text.write(pluginName, nonStripName, textWrite, config);
+ }, config);
+ }
+ };
+
+ return text;
+ });
+}());
--- /dev/null
+/*
+* fallback transition for flip in non-3D supporting browsers (which tend to handle complex transitions poorly in general
+*/
+
+(function( $, window, undefined ) {
+
+$.mobile.transitionFallbacks.flip = "fade";
+
+})( jQuery, this );
--- /dev/null
+/*
+* fallback transition for flow in non-3D supporting browsers (which tend to handle complex transitions poorly in general
+*/
+
+(function( $, window, undefined ) {
+
+$.mobile.transitionFallbacks.flow = "fade";
+
+})( jQuery, this );
--- /dev/null
+/*
+* fallback transition for pop in non-3D supporting browsers (which tend to handle complex transitions poorly in general
+*/
+
+(function( $, window, undefined ) {
+
+$.mobile.transitionFallbacks.pop = "fade";
+
+})( jQuery, this );
--- /dev/null
+/*
+* fallback transition for slide in non-3D supporting browsers (which tend to handle complex transitions poorly in general
+*/
+
+(function( $, window, undefined ) {
+
+// Use the simultaneous transitions handler for slide transitions
+$.mobile.transitionHandlers.slide = $.mobile.transitionHandlers.simultaneous;
+
+// Set the slide transitions's fallback to "fade"
+$.mobile.transitionFallbacks.slide = "fade";
+
+})( jQuery, this );
--- /dev/null
+/*
+* fallback transition for slidedown in non-3D supporting browsers (which tend to handle complex transitions poorly in general
+*/
+
+(function( $, window, undefined ) {
+
+$.mobile.transitionFallbacks.slidedown = "fade";
+
+})( jQuery, this );
--- /dev/null
+/*
+* fallback transition for slidefade in non-3D supporting browsers (which tend to handle complex transitions poorly in general
+*/
+
+(function( $, window, undefined ) {
+
+// Set the slide transitions's fallback to "fade"
+$.mobile.transitionFallbacks.slidefade = "fade";
+
+})( jQuery, this );
--- /dev/null
+/*
+* fallback transition for slideup in non-3D supporting browsers (which tend to handle complex transitions poorly in general
+*/
+
+(function( $, window, undefined ) {
+
+$.mobile.transitionFallbacks.slideup = "fade";
+
+})( jQuery, this );
--- /dev/null
+/*
+* fallback transition for turn in non-3D supporting browsers (which tend to handle complex transitions poorly in general
+*/
+
+(function( $, window, undefined ) {
+
+$.mobile.transitionFallbacks.turn = "fade";
+
+})( jQuery, this );
--- /dev/null
+
+/*
+ *
+ * This software is licensed under the MIT licence (as defined by the OSI at
+ * http://www.opensource.org/licenses/mit-license.php)
+ *
+ * ***************************************************************************
+ * Copyright (C) 2011 by Intel Corporation Ltd.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * ***************************************************************************
+ */
+
+// Ensure that the given namespace is defined. If not, define it to be an empty object.
+// This is kinda like the mkdir -p command.
+
+function ensureNS(ns) {
+ var nsAr = ns.split("."),
+ nsSoFar = "";
+
+ for (var Nix in nsAr) {
+ nsSoFar = nsSoFar + (Nix > 0 ? "." : "") + nsAr[Nix];
+ eval (nsSoFar + " = " + nsSoFar + " || {};");
+ }
+}
+
--- /dev/null
+
+/*
+ * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL licenses
+ * http://phpjs.org/functions/range
+ * original by: Waldo Malqui Silva
+ * version: 1107.2516
+ */
+function range( low, high, step ) {
+ // Create an array containing the range of integers or characters
+ // from low to high (inclusive)
+ //
+ // version: 1107.2516
+ // discuss at: http://phpjs.org/functions/range
+ // + original by: Waldo Malqui Silva
+ // * example 1: range ( 0, 12 );
+ // * returns 1: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
+ // * example 2: range( 0, 100, 10 );
+ // * returns 2: [0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100]
+ // * example 3: range( 'a', 'i' );
+ // * returns 3: ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i']
+ // * example 4: range( 'c', 'a' );
+ // * returns 4: ['c', 'b', 'a']
+ var matrix = [],
+ inival,
+ endval,
+ plus,
+ walker = step || 1,
+ chars = false;
+
+ if (!isNaN(low) && !isNaN(high)) {
+ inival = low;
+ endval = high;
+ } else if (isNaN(low) && isNaN(high)) {
+ chars = true;
+ inival = low.charCodeAt(0);
+ endval = high.charCodeAt(0);
+ } else {
+ inival = (isNaN(low) ? 0 : low);
+ endval = (isNaN(high) ? 0 : high);
+ }
+
+ plus = ((inival > endval) ? false : true);
+ if (plus) {
+ while (inival <= endval) {
+ matrix.push(((chars) ? String.fromCharCode(inival) : inival));
+ inival += walker;
+ }
+ } else {
+ while (inival >= endval) {
+ matrix.push(((chars) ? String.fromCharCode(inival) : inival));
+ inival -= walker;
+ }
+ }
+
+ return matrix;
+}
+
--- /dev/null
+(function( $, undefined ) {
+
+$.widget( "mobile.collapsible", $.mobile.widget, {
+ options: {
+ expandCueText: " Expandable list, tap to open list",
+ collapseCueText: " Expandable list, tap to close list",
+ collapsed: true,
+ heading: "h1,h2,h3,h4,h5,h6,legend",
+ theme: null,
+ contentTheme: null,
+ inset: true,
+ mini: false,
+ initSelector: ":jqmData(role='collapsible')"
+ },
+ _create: function() {
+
+ var $el = this.element,
+ o = this.options,
+ collapsible = $el.addClass( "ui-collapsible" ),
+ collapsibleHeading = $el.children( o.heading ).first(),
+ collapsedIcon = $.mobile.getAttrFixed( $el[0], "data-" + $.mobile.ns + "collapsed-icon" ) || o.collapsedIcon,
+ expandedIcon = $.mobile.getAttrFixed( $el[0], "data-" + $.mobile.ns + "expanded-icon" ) || o.expandedIcon,
+ collapsibleContent = collapsible.wrapInner( "<div class='ui-collapsible-content'></div>" ).children( ".ui-collapsible-content" ),
+ collapsibleSet = $el.closest( ":jqmData(role='collapsible-set')" ).addClass( "ui-collapsible-set" );
+
+ // Replace collapsibleHeading if it's a legend
+ if ( collapsibleHeading.is( "legend" ) ) {
+ collapsibleHeading = $( "<div role='heading'>"+ collapsibleHeading.html() +"</div>" ).insertBefore( collapsibleHeading );
+ collapsibleHeading.next().remove();
+ }
+
+ // If we are in a collapsible set
+ if ( collapsibleSet.length ) {
+ // Inherit the theme from collapsible-set
+ if ( !o.theme ) {
+ o.theme = $.mobile.getAttrFixed( collapsibleSet[0], "data-" + $.mobile.ns + "theme" ) || $.mobile.getInheritedTheme( collapsibleSet, "c" );
+ }
+ // Inherit the content-theme from collapsible-set
+ if ( !o.contentTheme ) {
+ o.contentTheme = $.mobile.getAttrFixed( collapsibleSet[0], "data-" + $.mobile.ns + "content-theme" );
+ }
+
+ // Get the preference for collapsed icon in the set
+ if ( !o.collapsedIcon ) {
+ o.collapsedIcon = $.mobile.getAttrFixed( collapsibleSet[0], "data-" + $.mobile.ns + "collapsed-icon" );
+ }
+ // Get the preference for expanded icon in the set
+ if ( !o.expandedIcon ) {
+ o.expandedIcon = $.mobile.getAttrFixed( collapsibleSet[0], "data-" + $.mobile.ns + "expanded-icon" );
+ }
+ // Gets the preference icon position in the set
+ if ( !o.iconPos ) {
+ o.iconPos = $.mobile.getAttrFixed( collapsibleSet[0], "data-" + $.mobile.ns + "iconpos" );
+ }
+ // Inherit the preference for inset from collapsible-set or set the default value to ensure equalty within a set
+ if ( $.mobile.getAttrFixed( collapsibleSet[0], "data-" + $.mobile.ns + "inset" ) !== undefined ) {
+ o.inset = $.mobile.getAttrFixed( collapsibleSet[0], "data-" + $.mobile.ns + "inset" );
+ } else {
+ o.inset = true;
+ }
+ // Gets the preference for mini in the set
+ if ( !o.mini ) {
+ o.mini = $.mobile.getAttrFixed( collapsibleSet[0], "data-" + $.mobile.ns + "mini" );
+ }
+ } else {
+ // get inherited theme if not a set and no theme has been set
+ if ( !o.theme ) {
+ o.theme = $.mobile.getInheritedTheme( $el, "c" );
+ }
+ }
+
+ if ( !!o.inset ) {
+ collapsible.addClass( "ui-collapsible-inset" );
+ }
+
+ collapsibleContent.addClass( ( o.contentTheme ) ? ( "ui-body-" + o.contentTheme ) : "");
+
+ collapsedIcon = $.mobile.getAttrFixed( $el[0], "data-" + $.mobile.ns + "collapsed-icon" ) || o.collapsedIcon || "plus";
+ expandedIcon = $.mobile.getAttrFixed( $el[0], "data-" + $.mobile.ns + "expanded-icon" ) || o.expandedIcon || "minus";
+
+ collapsibleHeading
+ //drop heading in before content
+ .insertBefore( collapsibleContent )
+ //modify markup & attributes
+ .addClass( "ui-collapsible-heading" )
+ .append( "<span class='ui-collapsible-heading-status'></span>" )
+ .wrapInner( "<a href='#' class='ui-collapsible-heading-toggle'></a>" )
+ .find( "a" )
+ .first()
+ .buttonMarkup({
+ shadow: false,
+ corners: false,
+ iconpos: $.mobile.getAttrFixed( $el[0], "data-" + $.mobile.ns + "iconpos" ) || o.iconPos || "left",
+ icon: collapsedIcon,
+ mini: o.mini,
+ theme: o.theme
+ })
+ .attr( "role", "");
+
+ if ( !!o.inset ) {
+ collapsibleHeading
+ .find( "a" ).first().add( ".ui-btn-inner", $el )
+ .addClass( "ui-corner-top ui-corner-bottom" );
+ }
+
+ //events
+ collapsible
+ .bind( "expand collapse", function( event ) {
+ if ( !event.isDefaultPrevented() ) {
+ var $this = $( this ),
+ isCollapse = ( event.type === "collapse" ),
+ contentTheme = o.contentTheme;
+
+ event.preventDefault();
+
+ // Custom event callback
+ if ( o.customEventHandler ) { o.customEventHandler.call( this, isCollapse ) };
+
+ collapsibleHeading
+ .toggleClass( "ui-collapsible-heading-collapsed", isCollapse )
+ .find( ".ui-collapsible-heading-status" )
+ .text( isCollapse ? o.expandCueText : o.collapseCueText )
+ .end()
+ .find( ".ui-icon" )
+ .toggleClass( "ui-icon-" + expandedIcon, !isCollapse )
+ // logic or cause same icon for expanded/collapsed state would remove the ui-icon-class
+ .toggleClass( "ui-icon-" + collapsedIcon, ( isCollapse || expandedIcon === collapsedIcon ) )
+ .end()
+ .find( "a" ).first().removeClass( $.mobile.activeBtnClass );
+
+ $this.toggleClass( "ui-collapsible-collapsed", isCollapse );
+ collapsibleContent.toggleClass( "ui-collapsible-content-collapsed", isCollapse ).attr( "aria-hidden", isCollapse );
+ collapsibleContent.children( "li" ).not( "ui-collapsible-content" ).attr( "tabindex", isCollapse ? "" : "0" );
+
+ if ( contentTheme && !!o.inset && ( !collapsibleSet.length || collapsible.jqmData( "collapsible-last" ) ) ) {
+ collapsibleHeading
+ .find( "a" ).first().add( collapsibleHeading.find( ".ui-btn-inner" ) )
+ .toggleClass( "ui-corner-bottom", isCollapse );
+ collapsibleContent.toggleClass( "ui-corner-bottom", !isCollapse );
+ }
+ collapsibleContent.trigger( "updatelayout" );
+ }
+ })
+ .trigger( o.collapsed ? "collapse" : "expand" );
+
+ collapsibleHeading
+ .bind( "tap", function( event ) {
+ collapsibleHeading.find( "a" ).first().addClass( $.mobile.activeBtnClass );
+ })
+ .bind( "click", function( event ) {
+
+ var type = collapsibleHeading.is( ".ui-collapsible-heading-collapsed" ) ? "expand" : "collapse";
+
+ collapsible.trigger( type );
+
+ event.preventDefault();
+ event.stopPropagation();
+ });
+ }
+});
+
+//delegate auto self-init widgets
+$.delegateSelfInitWithSingleSelector( $.mobile.collapsible );
+
+})( jQuery );
--- /dev/null
+(function( $, undefined ) {
+
+$.widget( "mobile.collapsibleset", $.mobile.widget, {
+ options: {
+ initSelector: ":jqmData(role='collapsible-set')"
+ },
+ _create: function() {
+ var $el = this.element.addClass( "ui-collapsible-set" ),
+ o = this.options;
+
+ // Inherit the theme from collapsible-set
+ if ( !o.theme ) {
+ o.theme = $.mobile.getInheritedTheme( $el, "c" );
+ }
+ // Inherit the content-theme from collapsible-set
+ if ( !o.contentTheme ) {
+ o.contentTheme = $.mobile.getAttrFixed( $el[0], "data-" + $.mobile.ns + "content-theme" );
+ }
+
+ if ( $.mobile.getAttrFixed( $el[0], "data-" + $.mobile.ns + "inset" ) !== undefined ) {
+ o.inset = $.mobile.getAttrFixed( $el[0], "data-" + $.mobile.ns + "inset" );
+ }
+ o.inset = o.inset !== undefined ? o.inset : true;
+
+ // Initialize the collapsible set if it's not already initialized
+ if ( !$el.jqmData( "collapsiblebound" ) ) {
+ $el
+ .jqmData( "collapsiblebound", true )
+ .bind( "expand collapse", function( event ) {
+ var isCollapse = ( event.type === "collapse" ),
+ collapsible = $( event.target ).closest( ".ui-collapsible" ),
+ widget = collapsible.data( "collapsible" );
+ if ( collapsible.jqmData( "collapsible-last" ) && !!o.inset ) {
+ collapsible.find( ".ui-collapsible-heading" ).first()
+ .find( "a" ).first()
+ .toggleClass( "ui-corner-bottom", isCollapse )
+ .find( ".ui-btn-inner" )
+ .toggleClass( "ui-corner-bottom", isCollapse );
+ collapsible.find( ".ui-collapsible-content" ).toggleClass( "ui-corner-bottom", !isCollapse );
+ }
+ })
+ .bind( "expand", function( event ) {
+ var closestCollapsible = $( event.target )
+ .closest( ".ui-collapsible" );
+ if ( closestCollapsible.parent().is( ":jqmData(role='collapsible-set')" ) ) {
+ closestCollapsible
+ .siblings( ".ui-collapsible" )
+ .trigger( "collapse" );
+ }
+ });
+ }
+ },
+
+ _init: function() {
+ var $el = this.element,
+ collapsiblesInSet = $el.children( ":jqmData(role='collapsible')" ),
+ expanded = collapsiblesInSet.filter( ":jqmData(collapsed='false')" );
+ this.refresh();
+
+ // Because the corners are handled by the collapsible itself and the default state is collapsed
+ // That was causing https://github.com/jquery/jquery-mobile/issues/4116
+ expanded.trigger( "expand" );
+ },
+
+ refresh: function() {
+ var $el = this.element,
+ o = this.options,
+ collapsiblesInSet = $el.children( ":jqmData(role='collapsible')" );
+
+ $.mobile.collapsible.prototype.enhance( collapsiblesInSet.not( ".ui-collapsible" ) );
+
+ // clean up borders
+ if ( !!o.inset ) {
+ collapsiblesInSet.each(function() {
+ $( this ).jqmRemoveData( "collapsible-last" )
+ .find( ".ui-collapsible-heading" )
+ .find( "a" ).first()
+ .removeClass( "ui-corner-top ui-corner-bottom" )
+ .find( ".ui-btn-inner" )
+ .removeClass( "ui-corner-top ui-corner-bottom" );
+ });
+
+ collapsiblesInSet.first()
+ .find( "a" )
+ .first()
+ .addClass( "ui-corner-top" )
+ .find( ".ui-btn-inner" )
+ .addClass( "ui-corner-top" );
+
+ collapsiblesInSet.last()
+ .jqmData( "collapsible-last", true )
+ .find( "a" )
+ .first()
+ .addClass( "ui-corner-bottom" )
+ .find( ".ui-btn-inner" )
+ .addClass( "ui-corner-bottom" );
+ }
+ }
+});
+
+//delegate auto self-init widgets
+$.delegateSelfInitWithSingleSelector( $.mobile.collapsibleset );
+
+})( jQuery );
--- /dev/null
+\r
+/* ***************************************************************************\r
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.\r
+ *\r
+ * Permission is hereby granted, free of charge, to any person obtaining a\r
+ * copy of this software and associated documentation files (the "Software"),\r
+ * to deal in the Software without restriction, including without limitation\r
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,\r
+ * and/or sell copies of the Software, and to permit persons to whom the\r
+ * Software is furnished to do so, subject to the following conditions:\r
+ *\r
+ * The above copyright notice and this permission notice shall be included in\r
+ * all copies or substantial portions of the Software.\r
+ *\r
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\r
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\r
+ * DEALINGS IN THE SOFTWARE.\r
+ * ***************************************************************************\r
+ *\r
+ * Authors: Hyunsook Park <hyunsook.park@samsung.com>\r
+ * Wonseop Kim <wonseop.kim@samsung.com>\r
+*/\r
+\r
+( function ( $, window, document, undefined ) {\r
+ var _canvas = document.createElement( 'canvas' ),\r
+ _context = _canvas.getContext( '2d' );\r
+\r
+ function fileSystemErrorMessage( e ) {\r
+ var FileError = window.FileError,\r
+ msg = '';\r
+ switch ( e.code ) {\r
+ case FileError.QUOTA_EXCEEDED_ERR:\r
+ msg = 'QUOTA_EXCEEDED_ERR';\r
+ break;\r
+ case FileError.NOT_FOUND_ERR:\r
+ msg = 'NOT_FOUND_ERR';\r
+ break;\r
+ case FileError.SECURITY_ERR:\r
+ msg = 'SECURITY_ERR';\r
+ break;\r
+ case FileError.INVALID_MODIFICATION_ERR:\r
+ msg = 'INVALID_MODIFICATION_ERR';\r
+ break;\r
+ case FileError.INVALID_STATE_ERR:\r
+ msg = 'INVALID_STATE_ERR';\r
+ break;\r
+ default:\r
+ msg = 'Unknown Error';\r
+ break;\r
+ }\r
+ return msg;\r
+ }\r
+\r
+ function getInternalURLFromURL( url ) {\r
+ var internalURL = url.replace( /\//gi, "_" );\r
+ return internalURL;\r
+ }\r
+\r
+ function resize( imagewidth, imageheight, thumbwidth, thumbheight, fit ) {\r
+ var w = 0, h = 0, x = 0, y = 0,\r
+ widthratio = imagewidth / thumbwidth,\r
+ heightratio = imageheight / thumbheight,\r
+ maxratio = Math.max( widthratio, heightratio );\r
+\r
+ if ( fit ) {\r
+ w = thumbwidth;\r
+ h = thumbheight;\r
+ } else {\r
+ if ( maxratio > 1 ) {\r
+ w = imagewidth / maxratio;\r
+ h = imageheight / maxratio;\r
+ } else {\r
+ w = imagewidth;\r
+ h = imageheight;\r
+ }\r
+ x = ( thumbwidth - w ) / 2;\r
+ y = ( thumbheight - h ) / 2;\r
+ }\r
+\r
+ return { w: w, h: h, x: x, y: y };\r
+ }\r
+\r
+ function getThumbnail( img, thumbwidth, thumbheight, fit ) {\r
+ var dimensions, url;\r
+ _canvas.width = thumbwidth;\r
+ _canvas.height = thumbheight;\r
+ dimensions = resize( img.width, img.height, thumbwidth, thumbheight, fit );\r
+ _context.fillStyle = "#000000";\r
+ _context.fillRect ( 0, 0, thumbwidth, thumbheight );\r
+ _context.drawImage( img, dimensions.x, dimensions.y, dimensions.w, dimensions.h );\r
+ url = _canvas.toDataURL();\r
+ return url;\r
+ }\r
+\r
+ $.imageloader = {\r
+ _grantedBytes: 1024 * 1024,\r
+ getThumbnail: function ( url, _callback ) {\r
+ var internalURL, canvasDataURI;\r
+ function errorHandler( e ) {\r
+ var msg = fileSystemErrorMessage( e );\r
+ if ( _callback ) {\r
+ _callback( ( msg === "NOT_FOUND_ERR" ) ? msg : null );\r
+ }\r
+ }\r
+\r
+ internalURL = getInternalURLFromURL( url );\r
+ try {\r
+ canvasDataURI = localStorage.getItem( internalURL );\r
+ if ( _callback ) {\r
+ _callback( ( canvasDataURI === null ) ? "NOT_FOUND_ERR" : canvasDataURI );\r
+ }\r
+ } catch ( e ) {\r
+ if ( _callback ) {\r
+ _callback( ( e.type === "non_object_property_load" ) ? "NOT_FOUND_ERR" : null );\r
+ }\r
+ }\r
+ },\r
+\r
+ setThumbnail: function ( url, _callback, thumbWidth, thumbHeight, fit ) {\r
+ var image, internalURL, canvasDataURI;\r
+ function errorHandler( e ) {\r
+ var msg = fileSystemErrorMessage( e );\r
+ if ( _callback ) {\r
+ _callback( ( msg === "NOT_FOUND_ERR" ) ? msg : null );\r
+ }\r
+ }\r
+\r
+ thumbWidth = thumbWidth || 128;\r
+ thumbHeight = thumbHeight || 128;\r
+ fit = fit || true;\r
+ image = new Image();\r
+ image.onload = function () {\r
+ internalURL = getInternalURLFromURL( url );\r
+ canvasDataURI = getThumbnail( this, thumbWidth, thumbHeight, fit );\r
+ try {\r
+ localStorage.setItem( internalURL, canvasDataURI );\r
+ if ( _callback ) {\r
+ _callback( canvasDataURI );\r
+ }\r
+ } catch ( e ) {\r
+ if ( _callback ) {\r
+ _callback( ( e.type === "non_object_property_load" ) ? "NOT_FOUND_ERR" : null );\r
+ }\r
+ }\r
+ };\r
+ image.src = url;\r
+ },\r
+\r
+ removeThumbnail: function ( url ) {\r
+ var internalURL;\r
+ function errorHandler( e ) {\r
+ fileSystemErrorMessage( e );\r
+ }\r
+\r
+ internalURL = getInternalURLFromURL( url );\r
+ try {\r
+ localStorage.removeItem( internalURL );\r
+ } catch ( e ) {\r
+ throw e;\r
+ }\r
+ }\r
+ };\r
+\r
+} ( jQuery, window, document ) );\r
+\r
--- /dev/null
+\r
+/* ***************************************************************************\r
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.\r
+ *\r
+ * Permission is hereby granted, free of charge, to any person obtaining a\r
+ * copy of this software and associated documentation files (the "Software"),\r
+ * to deal in the Software without restriction, including without limitation\r
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,\r
+ * and/or sell copies of the Software, and to permit persons to whom the\r
+ * Software is furnished to do so, subject to the following conditions:\r
+ *\r
+ * The above copyright notice and this permission notice shall be included in\r
+ * all copies or substantial portions of the Software.\r
+ *\r
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\r
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\r
+ * DEALINGS IN THE SOFTWARE.\r
+ * ***************************************************************************\r
+ *\r
+ * Authors: Hyunsook Park <hyunsook.park@samsung.com>\r
+ * Wonseop Kim <wonseop.kim@samsung.com>\r
+*/\r
+\r
+( function ( $, window, undefined ) {\r
+ var HALF_PI = Math.PI / 2,\r
+ DEFAULT_STEP = 0.001,\r
+ MotionPath = {},\r
+ vec3 = window.vec3,\r
+ arcLength2d = function ( p0, p1 ) {\r
+ var d = [ p1[0] - p0[0], p1[1] - p0[1] ],\r
+ value = Math.sqrt( d[0] * d[0] + d[1] * d[1] );\r
+ return value;\r
+ },\r
+ arcLength3d = function ( p0, p1 ) {\r
+ var d = [ p1[0] - p0[0], p1[1] - p0[1], p1[2] - p0[2] ],\r
+ value = Math.sqrt( d[0] * d[0] + d[1] * d[1] + d[2] * d[2] );\r
+ return value;\r
+ };\r
+\r
+ MotionPath.base = function () {};\r
+ MotionPath.base.prototype = {\r
+ points: [],\r
+ step: DEFAULT_STEP,\r
+ length: 0,\r
+ levels: [],\r
+ init: function ( data ) {},\r
+ calculateLevel: function ( maxLevel ) {},\r
+ calculateTotalLength: function () {},\r
+ getPosition: function ( percent ) {},\r
+ getPercent: function ( start, interval ) {},\r
+ getAngle: function ( percent ) {}\r
+ };\r
+\r
+ MotionPath.bezier2d = function () {};\r
+ MotionPath.bezier2d.prototype = $.extend( true, {}, MotionPath.base.prototype, {\r
+ init: function ( data ) {\r
+ this.points = data.points;\r
+ this.step = data.step || DEFAULT_STEP;\r
+ this.length = this.calculateTotalLength();\r
+ this.levels = this.calculateLevel( data.maxLevel ) || [];\r
+ },\r
+\r
+ calculateLevel: function ( maxLevel ) {\r
+ var totalLength = this.length,\r
+ interval = totalLength / maxLevel,\r
+ levels = [],\r
+ i;\r
+\r
+ if ( !maxLevel ) {\r
+ return null;\r
+ }\r
+\r
+ for ( i = 0; i < maxLevel; i += 1 ) {\r
+ levels[maxLevel - i] = this.getPercent( 0, interval * i );\r
+ }\r
+\r
+ return levels;\r
+ },\r
+\r
+ calculateTotalLength: function () {\r
+ var step = this.step,\r
+ current = this.getPosition( 0 ),\r
+ last = current,\r
+ length = 0,\r
+ percent;\r
+ for ( percent = step; percent <= 1; percent += step ) {\r
+ current = this.getPosition( percent );\r
+ length += arcLength2d( last, current );\r
+ last = current;\r
+ }\r
+ return length;\r
+ },\r
+\r
+ getPosition: function ( percent ) {\r
+ var points = this.points,\r
+ getValue = function ( p1, c1, c2, p2, t ) {\r
+ return Math.pow(1 - t, 3) * p1 +\r
+ 3 * t * Math.pow( 1 - t, 2 ) * c1 +\r
+ 3 * Math.pow( t, 2 ) * ( 1 - t ) * c2 +\r
+ Math.pow( t, 3 ) * p2;\r
+ },\r
+ result = [\r
+ getValue( points[0][0], points[1][0], points[2][0], points[3][0], percent ),\r
+ getValue( points[0][1], points[1][1], points[2][1], points[3][1], percent )\r
+ ];\r
+ return result;\r
+ },\r
+\r
+ getPercent: function ( start, interval ) {\r
+ var step = this.step,\r
+ current = this.getPosition( start = start || 0 ),\r
+ last = current,\r
+ targetLength = start + interval,\r
+ length = 0,\r
+ percent;\r
+\r
+ for ( percent = start + step; percent <= 1; percent += step ) {\r
+ current = this.getPosition( percent );\r
+ length += arcLength2d( last, current );\r
+ if ( length >= targetLength ) {\r
+ return percent;\r
+ }\r
+ last = current;\r
+ }\r
+ return 1;\r
+ },\r
+\r
+ getAngle: function ( percent ) {\r
+ var points = this.points,\r
+ getTangent = function ( p1, c1, c2, p2, t ) {\r
+ return 3 * t * t * ( -p1 + 3 * c1 - 3 * c2 + p2 ) + 6 * t * ( p1 - 2 * c1 + c2 ) + 3 * ( -p1 + c1 );\r
+ },\r
+ tx = getTangent( points[0][0], points[1][0], points[2][0], points[3][0], percent ),\r
+ ty = getTangent( points[0][1], points[1][1], points[2][1], points[3][1], percent );\r
+ return Math.atan2( tx, ty ) - HALF_PI;\r
+ }\r
+\r
+ } );\r
+\r
+ // clamped cubic B-spline curve\r
+ // http://web.mit.edu/hyperbook/Patrikalakis-Maekawa-Cho/node17.html\r
+ // http://www.cs.mtu.edu/~shene/COURSES/cs3621/NOTES/spline/B-spline/bspline-curve-coef.html\r
+ MotionPath.bspline = function () {};\r
+ MotionPath.bspline.prototype = $.extend( true, {}, MotionPath.base.prototype, {\r
+ _degree: 3,\r
+ _numberOfControls : 0,\r
+ _knotVectors: [],\r
+ _numberOfKnots: 0,\r
+\r
+ init: function ( data ) {\r
+ this.points = data.points;\r
+ this.step = data.step || DEFAULT_STEP;\r
+ this._numberOfPoints = this.points.length - 1;\r
+ this._numberOfKnots = this._numberOfPoints + this._degree + 1;\r
+\r
+ var deltaKnot = 1 / ( this._numberOfKnots - ( 2 * this._degree ) ),\r
+ v = deltaKnot,\r
+ i = 0;\r
+\r
+ while ( i <= this._numberOfKnots ) {\r
+ if ( i <= this._degree ) {\r
+ this._knotVectors.push( 0 );\r
+ } else if ( i < this._numberOfKnots - this._degree + 1 ) {\r
+ this._knotVectors.push( v );\r
+ v += deltaKnot;\r
+ } else {\r
+ this._knotVectors.push( 1 );\r
+ }\r
+ i += 1;\r
+ }\r
+\r
+ this.length = this.calculateTotalLength();\r
+ this.levels = this.calculateLevel( data.maxLevel ) || [];\r
+ },\r
+\r
+ _Np: function ( percent, i, degree ) {\r
+ var knots = this._knotVectors,\r
+ A = 0,\r
+ B = 0,\r
+ denominator = 0,\r
+ N0 = function ( percent, i ) {\r
+ return ( ( knots[i] <= percent && percent < knots[i + 1] ) ? 1 : 0 );\r
+ };\r
+\r
+ if ( degree === 1 ) {\r
+ A = N0( percent, i );\r
+ B = N0( percent, i + 1 );\r
+ } else {\r
+ A = this._Np( percent, i, degree - 1 );\r
+ B = this._Np( percent, i + 1, degree - 1 );\r
+ }\r
+\r
+ denominator = knots[i + degree] - knots[i];\r
+ A *= ( denominator !== 0 ) ? ( ( percent - knots[i] ) / denominator ) : 0;\r
+ denominator = knots[i + degree + 1] - knots[i + 1];\r
+ B *= ( denominator !== 0 ) ? ( ( knots[i + degree + 1] - percent ) / denominator ) : 0;\r
+\r
+ return A + B;\r
+ },\r
+\r
+ calculateLevel: function ( maxLevel ) {\r
+ var totalLength = this.length,\r
+ interval = totalLength / maxLevel,\r
+ levels = [],\r
+ i;\r
+\r
+ if ( !maxLevel ) {\r
+ return null;\r
+ }\r
+\r
+ for ( i = 0; i < maxLevel; i += 1 ) {\r
+ levels[maxLevel - i] = this.getPercent( 0, interval * i );\r
+ }\r
+ return levels;\r
+ },\r
+\r
+ calculateTotalLength: function () {\r
+ var step = this.step,\r
+ current = this.getPosition( 0 ),\r
+ last = current,\r
+ length = 0,\r
+ percent;\r
+ for ( percent = step; percent <= 1; percent += step ) {\r
+ current = this.getPosition( percent );\r
+ length += arcLength3d( last, current );\r
+ last = current;\r
+ }\r
+ return length;\r
+ },\r
+\r
+ getPosition: function ( percent ) {\r
+ var result = [], i, j, sum;\r
+ percent = percent.toFixed( 4 );\r
+ for ( j = 0; j < 3; j += 1 ) {\r
+ sum = 0;\r
+ for ( i = 0; i <= this._numberOfPoints; i += 1 ) {\r
+ sum += this.points[i][j] * this._Np( percent, i, this._degree );\r
+ }\r
+ result[j] = sum;\r
+ }\r
+\r
+ return result;\r
+ },\r
+\r
+ getPercent: function ( start, interval ) {\r
+ var step = this.step,\r
+ current = this.getPosition( start = start || 0 ),\r
+ last = current,\r
+ targetLength = start + interval,\r
+ length = 0,\r
+ percent;\r
+\r
+ for ( percent = start + step; percent <= 1; percent += step ) {\r
+ current = this.getPosition( percent );\r
+ length += arcLength3d( last, current );\r
+ if ( length >= targetLength ) {\r
+ return percent;\r
+ }\r
+ last = current;\r
+ }\r
+ return 1;\r
+ },\r
+\r
+ getAngle: function ( percent ) {\r
+ var prev = this.getPosition( percent ),\r
+ next = this.getPosition( percent + 0.001 ),\r
+ dir = vec3.normalize( vec3.direction( prev, next ) ),\r
+ cosValue = vec3.dot( dir, [1, 0, 0] );\r
+\r
+ return Math.acos( cosValue ) + Math.PI;\r
+ }\r
+ } );\r
+\r
+ $.motionpath = function ( type, data ) {\r
+ var object = new MotionPath[type]();\r
+ object.init( data );\r
+ return object;\r
+ };\r
+} ( jQuery, window ) );\r
+\r
--- /dev/null
+\r
+/* ***************************************************************************\r
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.\r
+ *\r
+ * Permission is hereby granted, free of charge, to any person obtaining a\r
+ * copy of this software and associated documentation files (the "Software"),\r
+ * to deal in the Software without restriction, including without limitation\r
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,\r
+ * and/or sell copies of the Software, and to permit persons to whom the\r
+ * Software is furnished to do so, subject to the following conditions:\r
+ *\r
+ * The above copyright notice and this permission notice shall be included in\r
+ * all copies or substantial portions of the Software.\r
+ *\r
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\r
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\r
+ * DEALINGS IN THE SOFTWARE.\r
+ * ***************************************************************************\r
+ *\r
+ * Authors: Hyunsook Park <hyunsook.park@samsung.com>\r
+ * Wonseop Kim <wonseop.kim@samsung.com>\r
+*/\r
+\r
+( function ( $, undefined ) {\r
+ $.webgl = {};\r
+\r
+ $.webgl.shader = {\r
+ _vertexShader: null,\r
+ _fragmentShader: null,\r
+\r
+ deleteShaders: function ( gl ) {\r
+ gl.deleteShader( this._vertexShader );\r
+ gl.deleteShader( this._fragmentShader );\r
+ },\r
+\r
+ addShaderProgram : function ( gl, vs, fs, isFile ) {\r
+ var shaderProgram,\r
+ vertexShaderSource = {},\r
+ fragmentShaderSource = {};\r
+\r
+ if ( isFile ) {\r
+ vertexShaderSource = this.loadShaderFile( vs );\r
+ fragmentShaderSource = this.loadShaderFile( fs );\r
+ } else {\r
+ vertexShaderSource.source = vs;\r
+ fragmentShaderSource.source = fs;\r
+ }\r
+\r
+ this._vertexShader = this.getShader( gl, gl.VERTEX_SHADER, vertexShaderSource );\r
+ this._fragmentShader = this.getShader( gl, gl.FRAGMENT_SHADER, fragmentShaderSource );\r
+\r
+ shaderProgram = gl.createProgram();\r
+ gl.attachShader( shaderProgram, this._vertexShader);\r
+ gl.attachShader( shaderProgram, this._fragmentShader);\r
+ gl.linkProgram( shaderProgram );\r
+\r
+ if ( !gl.getProgramParameter( shaderProgram, gl.LINK_STATUS ) ) {\r
+ window.alert( "Could not initialize Shaders!" );\r
+ }\r
+ return shaderProgram;\r
+ },\r
+\r
+ loadShaderFile : function ( path ) {\r
+ var cache = null;\r
+ $.ajax({\r
+ async : false,\r
+ url : path,\r
+ success : function ( result ) {\r
+ cache = {\r
+ source: result\r
+ };\r
+ }\r
+ });\r
+ return cache;\r
+ },\r
+\r
+ getShader: function ( gl, type, script ) {\r
+ var shader;\r
+\r
+ if ( !gl || !type || !script ) {\r
+ return null;\r
+ }\r
+\r
+ shader = gl.createShader( type );\r
+\r
+ gl.shaderSource( shader, script.source );\r
+ gl.compileShader( shader );\r
+\r
+ if ( !gl.getShaderParameter( shader, gl.COMPILE_STATUS ) ) {\r
+ window.alert( gl.getShaderInfoLog( shader ) );\r
+ gl.deleteShader( shader );\r
+ return null;\r
+ }\r
+ return shader;\r
+ }\r
+ };\r
+\r
+ $.webgl.buffer = {\r
+ attribBufferData: function ( gl, attribArray ) {\r
+ var attribBuffer = gl.createBuffer();\r
+\r
+ gl.bindBuffer( gl.ARRAY_BUFFER, attribBuffer );\r
+ gl.bufferData( gl.ARRAY_BUFFER, attribArray, gl.STATIC_DRAW );\r
+ gl.bindBuffer( gl.ARRAY_BUFFER, null );\r
+\r
+ return attribBuffer;\r
+ }\r
+ };\r
+\r
+} ( jQuery ) );\r
+\r
--- /dev/null
+(function( $, window, undefined ) {
+
+$.widget( "mobile.dialog", $.mobile.widget, {
+ options: {
+ closeBtnText: "Close",
+ overlayTheme: "a",
+ initSelector: ":jqmData(role='dialog')"
+ },
+ _create: function() {
+ var self = this,
+ $el = this.element,
+ headerCloseButton = $( "<a href='#' data-" + $.mobile.ns + "icon='delete' data-" + $.mobile.ns + "iconpos='notext'>"+ this.options.closeBtnText + "</a>" ),
+ dialogWrap = $( "<div/>", {
+ "role" : "dialog",
+ "class" : "ui-dialog-contain ui-corner-all ui-overlay-shadow"
+ });
+
+ $el.addClass( "ui-dialog ui-overlay-" + this.options.overlayTheme );
+
+ // Class the markup for dialog styling
+ // Set aria role
+ $el
+ .wrapInner( dialogWrap )
+ .children()
+ .find( ":jqmData(role='header')" )
+ .prepend( headerCloseButton )
+ .end()
+ .children( ':first-child')
+ .addClass( "ui-corner-top" )
+ .end()
+ .children( ":last-child" )
+ .addClass( "ui-corner-bottom" );
+
+ // this must be an anonymous function so that select menu dialogs can replace
+ // the close method. This is a change from previously just defining data-rel=back
+ // on the button and letting nav handle it
+ //
+ // Use click rather than vclick in order to prevent the possibility of unintentionally
+ // reopening the dialog if the dialog opening item was directly under the close button.
+ headerCloseButton.bind( "click", function() {
+ self.close();
+ });
+
+ /* bind events
+ - clicks and submits should use the closing transition that the dialog opened with
+ unless a data-transition is specified on the link/form
+ - if the click was on the close button, or the link has a data-rel="back" it'll go back in history naturally
+ */
+ $el.bind( "vclick submit", function( event ) {
+ var $target = $( event.target ).closest( event.type === "vclick" ? "a" : "form" ),
+ active;
+
+ if ( $target.length && !$.mobile.getAttrFixed( $target[0], "data-" + $.mobile.ns + "transition" ) ) {
+
+ active = $.mobile.urlHistory.getActive() || {};
+
+ $target.attr( "data-" + $.mobile.ns + "transition", ( active.transition || $.mobile.defaultDialogTransition ) )
+ .attr( "data-" + $.mobile.ns + "direction", "reverse" );
+ }
+ })
+ .bind( "pagehide", function( e, ui ) {
+ $( this ).find( "." + $.mobile.activeBtnClass ).not( ".ui-slider-bg" ).removeClass( $.mobile.activeBtnClass );
+ })
+ // Override the theme set by the page plugin on pageshow
+ .bind( "pagebeforeshow", function() {
+ self._isCloseable = true;
+ if ( self.options.overlayTheme ) {
+ self.element
+ .page( "removeContainerBackground" )
+ .page( "setContainerBackground", self.options.overlayTheme );
+ }
+ });
+ },
+
+ // Close method goes back in history
+ close: function() {
+ var dst;
+
+ if ( this._isCloseable ) {
+ this._isCloseable = false;
+ if ( $.mobile.hashListeningEnabled ) {
+ $.mobile.back();
+ } else {
+ dst = $.mobile.urlHistory.getPrev().url;
+ if ( !$.mobile.path.isPath( dst ) ) {
+ dst = $.mobile.path.makeUrlAbsolute( "#" + dst );
+ }
+
+ $.mobile.changePage( dst, { changeHash: false, fromHashChange: true } );
+ }
+ }
+ }
+});
+
+//auto self-init widgets
+$.mobile.$document.delegate( $.mobile.dialog.prototype.options.initSelector, "pagecreate", function() {
+ $.mobile.dialog.prototype.enhance( this );
+});
+
+})( jQuery, this );
--- /dev/null
+(function( $, undefined ) {
+
+
+ $.widget( "mobile.fixedtoolbar", $.mobile.widget, {
+ options: {
+ visibleOnPageShow: true,
+ disablePageZoom: true,
+ transition: "slide", //can be none, fade, slide (slide maps to slideup or slidedown)
+ fullscreen: false,
+ tapToggle: true,
+ tapToggleBlacklist: "a, button, input, select, textarea, .ui-header-fixed, .ui-footer-fixed, .ui-popup",
+ hideDuringFocus: "input, textarea, select",
+ updatePagePadding: true,
+ trackPersistentToolbars: true,
+
+ // Browser detection! Weeee, here we go...
+ // Unfortunately, position:fixed is costly, not to mention probably impossible, to feature-detect accurately.
+ // Some tests exist, but they currently return false results in critical devices and browsers, which could lead to a broken experience.
+ // Testing fixed positioning is also pretty obtrusive to page load, requiring injected elements and scrolling the window
+ // The following function serves to rule out some popular browsers with known fixed-positioning issues
+ // This is a plugin option like any other, so feel free to improve or overwrite it
+ supportBlacklist: function() {
+ var w = window,
+ ua = navigator.userAgent,
+ platform = navigator.platform,
+ // Rendering engine is Webkit, and capture major version
+ wkmatch = ua.match( /AppleWebKit\/([0-9]+)/ ),
+ wkversion = !!wkmatch && wkmatch[ 1 ],
+ ffmatch = ua.match( /Fennec\/([0-9]+)/ ),
+ ffversion = !!ffmatch && ffmatch[ 1 ],
+ operammobilematch = ua.match( /Opera Mobi\/([0-9]+)/ ),
+ omversion = !!operammobilematch && operammobilematch[ 1 ];
+
+ if(
+ // iOS 4.3 and older : Platform is iPhone/Pad/Touch and Webkit version is less than 534 (ios5)
+ ( ( platform.indexOf( "iPhone" ) > -1 || platform.indexOf( "iPad" ) > -1 || platform.indexOf( "iPod" ) > -1 ) && wkversion && wkversion < 534 ) ||
+ // Opera Mini
+ ( w.operamini && ({}).toString.call( w.operamini ) === "[object OperaMini]" ) ||
+ ( operammobilematch && omversion < 7458 ) ||
+ //Android lte 2.1: Platform is Android and Webkit version is less than 533 (Android 2.2)
+ ( ua.indexOf( "Android" ) > -1 && wkversion && wkversion < 533 ) ||
+ // Firefox Mobile before 6.0 -
+ ( ffversion && ffversion < 6 ) ||
+ // WebOS less than 3
+ ( "palmGetResource" in window && wkversion && wkversion < 534 ) ||
+ // MeeGo
+ ( ua.indexOf( "MeeGo" ) > -1 && ua.indexOf( "NokiaBrowser/8.5.0" ) > -1 ) ) {
+ return true;
+ }
+
+ return false;
+ },
+ initSelector: ":jqmData(position='dummy')"
+ },
+
+ _create: function() {
+
+ var self = this,
+ o = self.options,
+ $el = self.element,
+ tbtype = $el.is( ":jqmData(role='header')" ) ? "header" : "footer",
+ $page = $el.closest( ".ui-page" );
+
+ // Feature detecting support for
+ if ( o.supportBlacklist() ) {
+ self.destroy();
+ return;
+ }
+
+ $el.addClass( "ui-"+ tbtype +"-fixed" );
+
+ // "fullscreen" overlay positioning
+ if ( o.fullscreen ) {
+ $el.addClass( "ui-"+ tbtype +"-fullscreen" );
+ $page.addClass( "ui-page-" + tbtype + "-fullscreen" );
+ }
+ // If not fullscreen, add class to page to set top or bottom padding
+ else{
+ $page.addClass( "ui-page-" + tbtype + "-fixed" );
+ }
+
+ self._addTransitionClass();
+ self._bindPageEvents();
+ self._bindToggleHandlers();
+ },
+
+ _addTransitionClass: function() {
+ var tclass = this.options.transition;
+
+ if ( tclass && tclass !== "none" ) {
+ // use appropriate slide for header or footer
+ if ( tclass === "slide" ) {
+ tclass = this.element.is( ".ui-header" ) ? "slidedown" : "slideup";
+ }
+
+ this.element.addClass( tclass );
+ }
+ },
+
+ _bindPageEvents: function() {
+ var self = this,
+ o = self.options,
+ $el = self.element;
+
+ //page event bindings
+ // Fixed toolbars require page zoom to be disabled, otherwise usability issues crop up
+ // This method is meant to disable zoom while a fixed-positioned toolbar page is visible
+ $el.closest( ".ui-page" )
+ .bind( "pagebeforeshow", function() {
+ if ( o.disablePageZoom ) {
+ $.mobile.zoom.disable( true );
+ }
+ if ( !o.visibleOnPageShow ) {
+ self.hide( true );
+ }
+ } )
+ .bind( "webkitAnimationStart animationstart updatelayout", function() {
+ var thisPage = this;
+ if ( o.updatePagePadding ) {
+ self.updatePagePadding( thisPage );
+ }
+ })
+ .bind( "pageshow", function() {
+ var thisPage = this;
+ self.updatePagePadding( thisPage );
+ if ( o.updatePagePadding ) {
+ $.mobile.$window.bind( "throttledresize." + self.widgetName, function() {
+ self.updatePagePadding( thisPage );
+ });
+ }
+ })
+ .bind( "pagebeforehide", function( e, ui ) {
+ if ( o.disablePageZoom ) {
+ $.mobile.zoom.enable( true );
+ }
+ if ( o.updatePagePadding ) {
+ $.mobile.$window.unbind( "throttledresize." + self.widgetName );
+ }
+
+ if ( o.trackPersistentToolbars ) {
+ var thisFooter = $( ".ui-footer-fixed:jqmData(id)", this ),
+ thisHeader = $( ".ui-header-fixed:jqmData(id)", this ),
+ nextFooter = thisFooter.length && ui.nextPage && $( ".ui-footer-fixed:jqmData(id='" + thisFooter.jqmData( "id" ) + "')", ui.nextPage ) || $(),
+ nextHeader = thisHeader.length && ui.nextPage && $( ".ui-header-fixed:jqmData(id='" + thisHeader.jqmData( "id" ) + "')", ui.nextPage ) || $();
+
+ if ( nextFooter.length || nextHeader.length ) {
+
+ nextFooter.add( nextHeader ).appendTo( $.mobile.pageContainer );
+
+ ui.nextPage.one( "pageshow", function() {
+ nextFooter.add( nextHeader ).appendTo( this );
+ });
+ }
+ }
+ });
+ },
+
+ _visible: true,
+
+ // This will set the content element's top or bottom padding equal to the toolbar's height
+ updatePagePadding: function( tbPage ) {
+ var $el = this.element,
+ header = $el.is( ".ui-header" );
+
+ // This behavior only applies to "fixed", not "fullscreen"
+ if ( this.options.fullscreen ) { return; }
+
+ tbPage = tbPage || $el.closest( ".ui-page" );
+ $( tbPage ).css( "padding-" + ( header ? "top" : "bottom" ), $el.outerHeight() );
+ },
+
+ _useTransition: function( notransition ) {
+ var $win = $.mobile.$window,
+ $el = this.element,
+ scroll = $win.scrollTop(),
+ elHeight = $el.height(),
+ pHeight = $el.closest( ".ui-page" ).height(),
+ viewportHeight = $.mobile.getScreenHeight(),
+ tbtype = $el.is( ":jqmData(role='header')" ) ? "header" : "footer";
+
+ return !notransition &&
+ ( this.options.transition && this.options.transition !== "none" &&
+ (
+ ( tbtype === "header" && !this.options.fullscreen && scroll > elHeight ) ||
+ ( tbtype === "footer" && !this.options.fullscreen && scroll + viewportHeight < pHeight - elHeight )
+ ) || this.options.fullscreen
+ );
+ },
+
+ show: function( notransition ) {
+ var hideClass = "ui-fixed-hidden",
+ $el = this.element;
+
+ if ( this._useTransition( notransition ) ) {
+ $el
+ .removeClass( "out " + hideClass )
+ .addClass( "in" );
+ }
+ else {
+ $el.removeClass( hideClass );
+ }
+ this._visible = true;
+ },
+
+ hide: function( notransition ) {
+ var hideClass = "ui-fixed-hidden",
+ $el = this.element,
+ // if it's a slide transition, our new transitions need the reverse class as well to slide outward
+ outclass = "out" + ( this.options.transition === "slide" ? " reverse" : "" );
+
+ if( this._useTransition( notransition ) ) {
+ $el
+ .addClass( outclass )
+ .removeClass( "in" )
+ .animationComplete(function() {
+ $el.addClass( hideClass ).removeClass( outclass );
+ });
+ }
+ else {
+ $el.addClass( hideClass ).removeClass( outclass );
+ }
+ this._visible = false;
+ },
+
+ toggle: function() {
+ this[ this._visible ? "hide" : "show" ]();
+ },
+
+ _bindToggleHandlers: function() {
+ var self = this,
+ o = self.options,
+ $el = self.element;
+
+ // tap toggle
+ $el.closest( ".ui-page" )
+ .bind( "vclick", function( e ) {
+ if ( o.tapToggle && !$( e.target ).closest( o.tapToggleBlacklist ).length ) {
+ self.toggle();
+ }
+ })
+ .bind( "focusin focusout", function( e ) {
+ if ( screen.width < 500 && $( e.target ).is( o.hideDuringFocus ) && !$( e.target ).closest( ".ui-header-fixed, .ui-footer-fixed" ).length ) {
+ self[ ( e.type === "focusin" && self._visible ) ? "hide" : "show" ]();
+ }
+ });
+ },
+
+ destroy: function() {
+ this.element.removeClass( "ui-header-fixed ui-footer-fixed ui-header-fullscreen ui-footer-fullscreen in out fade slidedown slideup ui-fixed-hidden" );
+ this.element.closest( ".ui-page" ).removeClass( "ui-page-header-fixed ui-page-footer-fixed ui-page-header-fullscreen ui-page-footer-fullscreen" );
+ }
+
+ });
+
+ //auto self-init widgets
+ $.mobile.$document
+ .bind( "pagecreate create", function( e ) {
+
+ // DEPRECATED in 1.1: support for data-fullscreen=true|false on the page element.
+ // This line ensures it still works, but we recommend moving the attribute to the toolbars themselves.
+ if ( $( e.target ).jqmData( "fullscreen" ) ) {
+ $( $.mobile.fixedtoolbar.prototype.options.initSelector, e.target ).not( ":jqmData(fullscreen)" ).jqmData( "fullscreen", true );
+ }
+
+ $.mobile.fixedtoolbar.prototype.enhanceWithin( e.target );
+ });
+
+})( jQuery );
--- /dev/null
+(function( $, undefined ) {
+
+$.widget( "mobile.button", $.mobile.widget, {
+ options: {
+ theme: null,
+ icon: null,
+ iconpos: null,
+ corners: true,
+ shadow: true,
+ iconshadow: true,
+ initSelector: "button, [type='button'], [type='submit'], [type='reset']"
+ },
+ _create: function() {
+ var $el = this.element,
+ $button,
+ o = this.options,
+ type,
+ name,
+ inline = o.inline || $.mobile.getAttrFixed( $el[0], "data-" + $.mobile.ns + "inline" ),
+ mini = o.mini || $.mobile.getAttrFixed( $el[0], "data-" + $.mobile.ns + "mini" ),
+ classes = "",
+ $buttonPlaceholder;
+
+ // if this is a link, check if it's been enhanced and, if not, use the right function
+ if ( $el[ 0 ].tagName === "A" ) {
+ if ( !$el.hasClass( "ui-btn" ) ) {
+ $el.buttonMarkup();
+ }
+
+ return;
+ }
+
+ // get the inherited theme
+ // TODO centralize for all widgets
+ if ( !this.options.theme ) {
+ this.options.theme = $.mobile.getInheritedTheme( this.element, "c" );
+ }
+
+ // TODO: Post 1.1--once we have time to test thoroughly--any classes manually applied to the original element should be carried over to the enhanced element, with an `-enhanced` suffix. See https://github.com/jquery/jquery-mobile/issues/3577
+ /* if ( $el[0].className.length ) {
+ classes = $el[0].className;
+ } */
+ if ( !!~$el[0].className.indexOf( "ui-btn-left" ) ) {
+ classes = "ui-btn-left";
+ }
+
+ if ( !!~$el[0].className.indexOf( "ui-btn-right" ) ) {
+ classes = "ui-btn-right";
+ }
+
+ if ( $el.attr( "type" ) === "submit" || $el.attr( "type" ) === "reset" ) {
+ classes ? classes += " ui-submit" : classes = "ui-submit";
+ }
+ $( "label[for='" + $el.attr( "id" ) + "']" ).addClass( "ui-submit" );
+
+ // Add ARIA role
+ this.button = $( "<div></div>" )
+ [ $el.html() ? "html" : "text" ]( $el.html() || $el.val() )
+ .insertBefore( $el )
+ .buttonMarkup({
+ theme: o.theme,
+ icon: o.icon,
+ iconpos: o.iconpos,
+ inline: inline,
+ corners: o.corners,
+ shadow: o.shadow,
+ iconshadow: o.iconshadow,
+ mini: mini
+ })
+ .addClass( classes )
+ .append( $el.addClass( "ui-btn-hidden" ) );
+
+ $button = this.button;
+ type = $el.attr( "type" );
+ name = $el.attr( "name" );
+
+ // Add hidden input during submit if input type="submit" has a name.
+ if ( type !== "button" && type !== "reset" && name ) {
+ $el.bind( "vclick", function() {
+ // Add hidden input if it doesn't already exist.
+ if ( $buttonPlaceholder === undefined ) {
+ $buttonPlaceholder = $( "<input>", {
+ type: "hidden",
+ name: $el.attr( "name" ),
+ value: $el.attr( "value" )
+ }).insertBefore( $el );
+
+ // Bind to doc to remove after submit handling
+ $.mobile.$document.one( "submit", function() {
+ $buttonPlaceholder.remove();
+
+ // reset the local var so that the hidden input
+ // will be re-added on subsequent clicks
+ $buttonPlaceholder = undefined;
+ });
+ }
+ });
+ }
+
+ $el.bind({
+ focus: function() {
+ $button.addClass( $.mobile.focusClass );
+ },
+
+ blur: function() {
+ $button.removeClass( $.mobile.focusClass );
+ }
+ });
+
+ this.refresh();
+ },
+
+ enable: function() {
+ this.element.attr( "disabled", false );
+ this.button.removeClass( "ui-disabled" ).attr( "aria-disabled", false );
+ return this._setOption( "disabled", false );
+ },
+
+ disable: function() {
+ this.element.attr( "disabled", true );
+ this.button.addClass( "ui-disabled" ).attr( "aria-disabled", true );
+ return this._setOption( "disabled", true );
+ },
+
+ refresh: function() {
+ var $el = this.element;
+
+ if ( $el.prop("disabled") ) {
+ this.disable();
+ } else {
+ this.enable();
+ }
+
+ // Grab the button's text element from its implementation-independent data item
+ $( this.button.data( 'buttonElements' ).text )[ $el.html() ? "html" : "text" ]( $el.html() || $el.val() );
+ }
+});
+
+//auto self-init widgets
+$.mobile.$document.bind( "pagecreate create", function( e ) {
+ $.mobile.button.prototype.enhanceWithin( e.target, true );
+});
+
+})( jQuery );
--- /dev/null
+/*
+* "checkboxradio" plugin
+*/
+
+(function( $, undefined ) {
+
+$.widget( "mobile.checkboxradio", $.mobile.widget, {
+ options: {
+ theme: null,
+ initSelector: "input[type='checkbox'],input[type='radio']"
+ },
+ _create: function() {
+ var self = this,
+ input = this.element,
+ inheritAttr = function( input, dataAttr ) {
+ return input.jqmData( dataAttr ) || input.closest( "form, fieldset" ).jqmData( dataAttr );
+ },
+ // NOTE: Windows Phone could not find the label through a selector
+ // filter works though.
+ parentLabel = $( input ).closest( "label" ),
+ label = parentLabel.length ? parentLabel : ( input[0].id ? $( input ).closest( "form, fieldset, :jqmData(role='page'), :jqmData(role='dialog')" ).find( "label" ).filter( "[for='" + input[0].id + "']" ) : [ ] ),
+ inputtype = input[0].type,
+ mini = inheritAttr( input, "mini" ),
+ checkedState = inputtype + "-on",
+ uncheckedState = inputtype + "-off",
+ icon = input.parents( ":jqmData(type='horizontal')" ).length ? undefined : uncheckedState,
+ iconpos = inheritAttr( input, "iconpos" ),
+ activeBtn = icon ? "" : " " + $.mobile.activeBtnClass,
+ checkedClass = "ui-" + checkedState + activeBtn,
+ uncheckedClass = "ui-" + uncheckedState,
+ checkedicon = "ui-icon-" + checkedState,
+ uncheckedicon = "ui-icon-" + uncheckedState,
+ ariaCheckedAttr = "";
+
+ if ( inputtype !== "checkbox" && inputtype !== "radio" ) {
+ return;
+ }
+
+ ariaCheckedAttr = ( inputtype === "checkbox" ) ? "aria-checked" : "aria-selected";
+
+ // Support fake label
+ if ( label.length == 0 ) {
+ label = $( "<label for='" + input[ 0 ].id +
+ "'></label>" );
+ }
+
+ // Expose for other methods
+ $.extend( this, {
+ label: label,
+ inputtype: inputtype,
+ checkedClass: checkedClass,
+ uncheckedClass: uncheckedClass,
+ checkedicon: checkedicon,
+ uncheckedicon: uncheckedicon,
+ ariaCheckedAttr : ariaCheckedAttr
+ });
+
+ // If there's no selected theme check the data attr
+ if ( !this.options.theme ) {
+ this.options.theme = $.mobile.getInheritedTheme( this.element, "c" );
+ }
+
+ label.buttonMarkup({
+ theme: this.options.theme,
+ icon: icon,
+ shadow: false,
+ mini: mini,
+ iconpos: iconpos
+ });
+
+ // Wrap the input + label in a div
+ var wrapper = document.createElement('div');
+ wrapper.className = 'ui-' + inputtype;
+ wrapper.setAttribute( "role", inputtype );
+
+ if ( input.hasClass( "favorite" ) ) {
+ wrapper.className += ' favorite';
+ }
+
+ input.add( label ).wrapAll( wrapper );
+
+ label.bind({
+ vmouseover: function( event ) {
+ if ( $( this ).parent().is( ".ui-disabled" ) ) {
+ event.stopPropagation();
+ }
+ },
+
+ vclick: function( event ) {
+ if ( input.is( ":disabled" ) ) {
+ event.preventDefault();
+ return;
+ }
+
+ self._cacheVals();
+
+ input.prop( "checked", inputtype === "radio" && true || !input.prop( "checked" ) );
+
+ // trigger click handler's bound directly to the input as a substitute for
+ // how label clicks behave normally in the browsers
+ // TODO: it would be nice to let the browser's handle the clicks and pass them
+ // through to the associate input. we can swallow that click at the parent
+ // wrapper element level
+ input.triggerHandler( 'click' );
+
+ // Input set for common radio buttons will contain all the radio
+ // buttons, but will not for checkboxes. clearing the checked status
+ // of other radios ensures the active button state is applied properly
+ self._getInputSet().not( input ).prop( "checked", false );
+
+ self._updateAll();
+ return false;
+ }
+ });
+
+ input
+ .bind({
+ vmousedown: function() {
+ self._cacheVals();
+ },
+
+ vclick: function() {
+ var $this = $( this );
+
+ // Adds checked attribute to checked input when keyboard is used
+ if ( $this.is( ":checked" ) ) {
+
+ $this.prop( "checked", true);
+ self._getInputSet().not( $this ).prop( "checked", false );
+ } else {
+
+ $this.prop( "checked", false );
+ }
+
+ self._updateAll();
+ },
+
+ focus: function() {
+ label.addClass( $.mobile.focusClass );
+ },
+
+ blur: function() {
+ label.removeClass( $.mobile.focusClass );
+ }
+ });
+
+ this.refresh();
+ },
+
+ _cacheVals: function() {
+ this._getInputSet().each(function() {
+ $( this ).jqmData( "cacheVal", this.checked );
+ });
+ },
+
+ //returns either a set of radios with the same name attribute, or a single checkbox
+ _getInputSet: function() {
+ if ( this.inputtype === "checkbox" ) {
+ return this.element;
+ }
+
+ return this.element.closest( "form, fieldset, :jqmData(role='page'), :jqmData(role='dialog')" )
+ .find( "input[name='" + this.element[0].name + "'][type='" + this.inputtype + "']" );
+ },
+
+ _updateAll: function() {
+ var self = this;
+
+ this._getInputSet().each(function() {
+ var $this = $( this );
+
+ if ( this.checked || self.inputtype === "checkbox" ) {
+ $this.trigger( "change" );
+ }
+ $this.focus();
+ })
+ .checkboxradio( "refresh" );
+ },
+
+ refresh: function() {
+ var input = this.element[0],
+ label = this.label,
+ wrapper = input.parentNode,
+ icon = label.find( ".ui-icon" );
+
+ if ( input.checked ) {
+ label.addClass( this.checkedClass ).removeClass( this.uncheckedClass );
+ icon.addClass( this.checkedicon ).removeClass( this.uncheckedicon );
+ wrapper.setAttribute( this.ariaCheckedAttr, true );
+ } else {
+ label.removeClass( this.checkedClass ).addClass( this.uncheckedClass );
+ icon.removeClass( this.checkedicon ).addClass( this.uncheckedicon );
+ wrapper.setAttribute( this.ariaCheckedAttr, false );
+ }
+
+ if ( input.disabled ) {
+ this.disable();
+ } else {
+ this.enable();
+ }
+ },
+
+ disable: function() {
+ this.element.prop( "disabled", true ).parent().addClass( "ui-disabled" );
+ },
+
+ enable: function() {
+ this.element.prop( "disabled", false ).parent().removeClass( "ui-disabled" );
+ }
+});
+
+//auto self-init widgets
+$.mobile.$document.bind( "pagecreate create", function( e ) {
+ $.mobile.checkboxradio.prototype.enhanceWithin( e.target, true );
+});
+
+})( jQuery );
--- /dev/null
+/*
+* custom "selectmenu" plugin
+*/
+
+(function( $, undefined ) {
+ var extendSelect = function( widget ) {
+
+ var select = widget.select,
+ selectID = widget.selectID,
+ label = widget.label,
+ thisPage = widget.select.closest( ".ui-page" ),
+ selectOptions = widget._selectOptions(),
+ isMultiple = widget.isMultiple = widget.select[ 0 ].multiple,
+ buttonId = selectID + "-button",
+ menuId = selectID + "-menu",
+ menuPage = $( "<div data-" + $.mobile.ns + "role='dialog' data-" +$.mobile.ns + "theme='"+ widget.options.theme +"' data-" +$.mobile.ns + "overlay-theme='"+ widget.options.overlayTheme +"'>" +
+ "<div data-" + $.mobile.ns + "role='header'>" +
+ "<div class='ui-title'>" + label.getEncodedText() + "</div>"+
+ "</div>"+
+ "<div data-" + $.mobile.ns + "role='content'></div>"+
+ "</div>" ),
+
+ listbox = $( "<div>", { "class": "ui-selectmenu" } ).insertAfter( widget.select ).popup( { theme: "a" } ),
+
+ list = $( "<ul>", {
+ "class": "ui-selectmenu-list",
+ "id": menuId,
+ "role": "listbox",
+ "aria-labelledby": buttonId
+ }).attr( "data-" + $.mobile.ns + "theme", widget.options.theme ).appendTo( listbox ),
+
+ header = $( "<div>", {
+ "class": "ui-header ui-bar-" + widget.options.theme
+ }).prependTo( listbox ),
+
+ headerTitle = $( "<h1>", {
+ "class": "ui-title"
+ }).appendTo( header ),
+
+ menuPageContent,
+ menuPageClose,
+ headerClose;
+
+ if ( widget.isMultiple ) {
+ headerClose = $( "<a>", {
+ "text": widget.options.closeText,
+ "href": "#",
+ "class": "ui-btn-left"
+ }).attr( "data-" + $.mobile.ns + "iconpos", "notext" ).attr( "data-" + $.mobile.ns + "icon", "delete" ).appendTo( header ).buttonMarkup();
+ }
+
+ $.extend( widget, {
+ select: widget.select,
+ selectID: selectID,
+ buttonId: buttonId,
+ menuId: menuId,
+ thisPage: thisPage,
+ menuPage: menuPage,
+ label: label,
+ selectOptions: selectOptions,
+ isMultiple: isMultiple,
+ theme: widget.options.theme,
+ listbox: listbox,
+ list: list,
+ header: header,
+ headerTitle: headerTitle,
+ headerClose: headerClose,
+ menuPageContent: menuPageContent,
+ menuPageClose: menuPageClose,
+ placeholder: "",
+
+ build: function() {
+ var self = this;
+
+ // Create list from select, update state
+ self.refresh();
+
+ self.select.attr( "tabindex", "-1" ).focus(function() {
+ $( this ).blur();
+ self.button.focus();
+ });
+
+ // Button events
+ self.button.bind( "vclick keydown" , function( event ) {
+ if (event.type === "vclick" ||
+ event.keyCode && (event.keyCode === $.mobile.keyCode.ENTER ||
+ event.keyCode === $.mobile.keyCode.SPACE)) {
+
+ self.open();
+ event.preventDefault();
+ }
+ });
+
+ // Events for list items
+ self.list.attr( "role", "listbox" )
+ .bind( "focusin", function( e ) {
+ $( e.target )
+ .attr( "tabindex", "0" )
+ .trigger( "vmouseover" );
+
+ })
+ .bind( "focusout", function( e ) {
+ $( e.target )
+ .attr( "tabindex", "-1" )
+ .trigger( "vmouseout" );
+ })
+ .delegate( "li:not(.ui-disabled, .ui-li-divider)", "click", function( event ) {
+
+ // index of option tag to be selected
+ var oldIndex = self.select[ 0 ].selectedIndex,
+ newIndex = self.list.find( "li:not(.ui-li-divider)" ).index( this ),
+ option = self._selectOptions().eq( newIndex )[ 0 ];
+
+ // toggle selected status on the tag for multi selects
+ option.selected = self.isMultiple ? !option.selected : true;
+
+ // toggle checkbox class for multiple selects
+ if ( self.isMultiple ) {
+ $( this ).find( ".ui-icon" )
+ .toggleClass( "ui-icon-checkbox-on", option.selected )
+ .toggleClass( "ui-icon-checkbox-off", !option.selected );
+ }
+
+ // trigger change if value changed
+ if ( self.isMultiple || oldIndex !== newIndex ) {
+ self.select.trigger( "change" );
+ }
+
+ // hide custom select for single selects only - otherwise focus clicked item
+ // We need to grab the clicked item the hard way, because the list may have been rebuilt
+ if ( self.isMultiple ) {
+ self.list.find( "li:not(.ui-li-divider)" ).eq( newIndex )
+ .addClass( "ui-btn-down-" + widget.options.theme ).find( "a" ).first().focus();
+ }
+ else {
+ self.close();
+ }
+
+ event.preventDefault();
+ })
+ .keydown(function( event ) { //keyboard events for menu items
+ var target = $( event.target ),
+ li = target.closest( "li" ),
+ prev, next;
+
+ // switch logic based on which key was pressed
+ switch ( event.keyCode ) {
+ // up or left arrow keys
+ case 38:
+ prev = li.prev().not( ".ui-selectmenu-placeholder" );
+
+ if ( prev.is( ".ui-li-divider" ) ) {
+ prev = prev.prev();
+ }
+
+ // if there's a previous option, focus it
+ if ( prev.length ) {
+ target
+ .blur()
+ .attr( "tabindex", "-1" );
+
+ prev.addClass( "ui-btn-down-" + widget.options.theme ).find( "a" ).first().focus();
+ }
+
+ return false;
+ // down or right arrow keys
+ case 40:
+ next = li.next();
+
+ if ( next.is( ".ui-li-divider" ) ) {
+ next = next.next();
+ }
+
+ // if there's a next option, focus it
+ if ( next.length ) {
+ target
+ .blur()
+ .attr( "tabindex", "-1" );
+
+ next.addClass( "ui-btn-down-" + widget.options.theme ).find( "a" ).first().focus();
+ }
+
+ return false;
+ // If enter or space is pressed, trigger click
+ case 13:
+ case 32:
+ target.trigger( "click" );
+
+ return false;
+ }
+ });
+
+ // button refocus ensures proper height calculation
+ // by removing the inline style and ensuring page inclusion
+ self.menuPage.bind( "pagehide", function() {
+ self.list.appendTo( self.listbox );
+ self._focusButton();
+
+ // TODO centralize page removal binding / handling in the page plugin.
+ // Suggestion from @jblas to do refcounting
+ //
+ // TODO extremely confusing dependency on the open method where the pagehide.remove
+ // bindings are stripped to prevent the parent page from disappearing. The way
+ // we're keeping pages in the DOM right now sucks
+ //
+ // rebind the page remove that was unbound in the open function
+ // to allow for the parent page removal from actions other than the use
+ // of a dialog sized custom select
+ //
+ // doing this here provides for the back button on the custom select dialog
+ $.mobile._bindPageRemove.call( self.thisPage );
+ });
+
+ // Events on the popup
+ self.listbox.bind( "popupafterclose", function( event ) {
+ self.close();
+ });
+
+ // Close button on small overlays
+ if ( self.isMultiple ) {
+ self.headerClose.click(function() {
+ if ( self.menuType === "overlay" ) {
+ self.close();
+ return false;
+ }
+ });
+ }
+
+ // track this dependency so that when the parent page
+ // is removed on pagehide it will also remove the menupage
+ self.thisPage.addDependents( this.menuPage );
+ },
+
+ _isRebuildRequired: function() {
+ var list = this.list.find( "li" ),
+ options = this._selectOptions();
+
+ // TODO exceedingly naive method to determine difference
+ // ignores value changes etc in favor of a forcedRebuild
+ // from the user in the refresh method
+ return options.text() !== list.text();
+ },
+
+ selected: function() {
+ return this._selectOptions().filter( ":selected:not( :jqmData(placeholder='true') )" );
+ },
+
+ refresh: function( forceRebuild , foo ) {
+ var self = this,
+ select = this.element,
+ isMultiple = this.isMultiple,
+ indicies;
+
+ if ( forceRebuild || this._isRebuildRequired() ) {
+ self._buildList();
+ }
+
+ indicies = this.selectedIndices();
+
+ self.setButtonText();
+ self.setButtonCount();
+
+ self.list.find( "li:not(.ui-li-divider)" )
+ .removeClass( $.mobile.activeBtnClass )
+ .attr( "aria-selected", false )
+ .each(function( i ) {
+
+ if ( $.inArray( i, indicies ) > -1 ) {
+ var item = $( this );
+
+ // Aria selected attr
+ item.attr( "aria-selected", true );
+
+ // Multiple selects: add the "on" checkbox state to the icon
+ if ( self.isMultiple ) {
+ item.find( ".ui-icon" ).removeClass( "ui-icon-checkbox-off" ).addClass( "ui-icon-checkbox-on" );
+ } else {
+ if ( item.is( ".ui-selectmenu-placeholder" ) ) {
+ item.next().addClass( $.mobile.activeBtnClass );
+ } else {
+ item.addClass( $.mobile.activeBtnClass );
+ }
+ }
+ }
+ });
+ },
+
+ close: function() {
+ if ( this.options.disabled || !this.isOpen ) {
+ return;
+ }
+
+ var self = this;
+
+ if ( self.menuType === "page" ) {
+ // doesn't solve the possible issue with calling change page
+ // where the objects don't define data urls which prevents dialog key
+ // stripping - changePage has incoming refactor
+ $.mobile.back();
+ } else {
+ self.listbox.popup( "close" );
+ self.list.appendTo( self.listbox );
+ self._focusButton();
+ }
+
+ // allow the dialog to be closed again
+ self.isOpen = false;
+ },
+
+ open: function() {
+ if ( this.options.disabled ) {
+ return;
+ }
+
+ var self = this,
+ $window = $.mobile.$window,
+ selfListParent = self.list.parent(),
+ menuHeight = selfListParent.outerHeight(),
+ menuWidth = selfListParent.outerWidth(),
+ activePage = $( "." + $.mobile.activePageClass ),
+ scrollTop = $window.scrollTop(),
+ btnOffset = self.button.offset().top,
+ screenHeight = $window.height(),
+ screenWidth = $window.width();
+
+ //add active class to button
+ self.button.addClass( $.mobile.activeBtnClass );
+
+ //remove after delay
+ setTimeout( function() {
+ self.button.removeClass( $.mobile.activeBtnClass );
+ }, 300);
+
+ function focusMenuItem() {
+ var selector = self.list.find( "." + $.mobile.activeBtnClass + " a" );
+ if ( selector.length === 0 ) {
+ selector = self.list.find( "li.ui-btn:not( :jqmData(placeholder='true') ) a" );
+ }
+ selector.first().focus().closest( "li" ).addClass( "ui-btn-down-" + widget.options.theme );
+ }
+
+ if ( menuHeight > screenHeight - 80 || !$.support.scrollTop ) {
+
+ self.menuPage.appendTo( $.mobile.pageContainer ).page();
+ self.menuPageContent = menuPage.find( ".ui-content" );
+ self.menuPageClose = menuPage.find( ".ui-header a" );
+
+ // prevent the parent page from being removed from the DOM,
+ // otherwise the results of selecting a list item in the dialog
+ // fall into a black hole
+ self.thisPage.unbind( "pagehide.remove" );
+
+ //for WebOS/Opera Mini (set lastscroll using button offset)
+ if ( scrollTop === 0 && btnOffset > screenHeight ) {
+ self.thisPage.one( "pagehide", function() {
+ $( this ).jqmData( "lastScroll", btnOffset );
+ });
+ }
+
+ self.menuPage.one( "pageshow", function() {
+ focusMenuItem();
+ self.isOpen = true;
+ });
+
+ self.menuType = "page";
+ self.menuPageContent.append( self.list );
+ self.menuPage.find("div .ui-title").text(self.label.text());
+ $.mobile.changePage( self.menuPage, {
+ transition: $.mobile.defaultDialogTransition
+ });
+ } else {
+ self.menuType = "overlay";
+
+ self.listbox
+ .one( "popupafteropen", focusMenuItem )
+ .popup( "open", {
+ x: self.button.offset().left + self.button.outerWidth() / 2,
+ y: self.button.offset().top + self.button.outerHeight() / 2
+ });
+
+ // duplicate with value set in page show for dialog sized selects
+ self.isOpen = true;
+ }
+ },
+
+ _buildList: function() {
+ var self = this,
+ o = this.options,
+ placeholder = this.placeholder,
+ needPlaceholder = true,
+ optgroups = [],
+ lis = [],
+ dataIcon = self.isMultiple ? "checkbox-off" : "false";
+
+ self.list.empty().filter( ".ui-listview" ).listview( "destroy" );
+
+ var $options = self.select.find( "option" ),
+ numOptions = $options.length,
+ select = this.select[ 0 ],
+ dataPrefix = 'data-' + $.mobile.ns,
+ dataIndexAttr = dataPrefix + 'option-index',
+ dataIconAttr = dataPrefix + 'icon',
+ dataRoleAttr = dataPrefix + 'role',
+ dataPlaceholderAttr = dataPrefix + 'placeholder',
+ fragment = document.createDocumentFragment(),
+ isPlaceholderItem = false,
+ optGroup;
+
+ for (var i = 0; i < numOptions;i++, isPlaceholderItem = false) {
+ var option = $options[i],
+ $option = $( option ),
+ parent = option.parentNode,
+ text = $option.text(),
+ anchor = document.createElement( 'a' ),
+ classes = [];
+
+ anchor.setAttribute( 'href', '#' );
+ anchor.appendChild( document.createTextNode( text ) );
+
+ // Are we inside an optgroup?
+ if ( parent !== select && parent.nodeName.toLowerCase() === "optgroup" ) {
+ var optLabel = parent.getAttribute( 'label' );
+ if ( optLabel !== optGroup ) {
+ var divider = document.createElement( 'li' );
+ divider.setAttribute( dataRoleAttr, 'list-divider' );
+ divider.setAttribute( 'role', 'option' );
+ divider.setAttribute( 'tabindex', '-1' );
+ divider.appendChild( document.createTextNode( optLabel ) );
+ fragment.appendChild( divider );
+ optGroup = optLabel;
+ }
+ }
+
+ if ( needPlaceholder && ( !option.getAttribute( "value" ) || text.length === 0 || $option.jqmData( "placeholder" ) ) ) {
+ needPlaceholder = false;
+ isPlaceholderItem = true;
+
+ // If we have identified a placeholder, mark it retroactively in the select as well
+ option.setAttribute( dataPlaceholderAttr, true );
+ if ( o.hidePlaceholderMenuItems ) {
+ classes.push( "ui-selectmenu-placeholder" );
+ }
+ if (!placeholder) {
+ placeholder = self.placeholder = text;
+ }
+ }
+
+ var item = document.createElement('li');
+ if ( option.disabled ) {
+ classes.push( "ui-disabled" );
+ item.setAttribute('aria-disabled',true);
+ }
+ item.setAttribute( dataIndexAttr,i );
+ item.setAttribute( dataIconAttr, dataIcon );
+ if ( isPlaceholderItem ) {
+ item.setAttribute( dataPlaceholderAttr, true );
+ }
+ item.className = classes.join( " " );
+ item.setAttribute( 'role', 'option' );
+ anchor.setAttribute( 'tabindex', '-1' );
+ item.appendChild( anchor );
+ fragment.appendChild( item );
+ }
+
+ self.list[0].appendChild( fragment );
+
+ // Hide header if it's not a multiselect and there's no placeholder
+ if ( !this.isMultiple && !placeholder.length ) {
+ this.header.hide();
+ } else {
+ this.headerTitle.text( this.placeholder );
+ }
+
+ // Now populated, create listview
+ self.list.listview();
+ },
+
+ _button: function() {
+ return $( "<a>", {
+ "href": "#",
+ "role": "button",
+ // TODO value is undefined at creation
+ "id": this.buttonId,
+ "aria-haspopup": "true",
+
+ // TODO value is undefined at creation
+ "aria-owns": this.menuId
+ });
+ }
+ });
+ };
+
+ // issue #3894 - core doesn't trigger events on disabled delegates
+ $.mobile.$document.bind( "selectmenubeforecreate", function( event ) {
+ var selectmenuWidget = $( event.target ).data( "selectmenu" );
+
+ if ( !selectmenuWidget.options.nativeMenu &&
+ selectmenuWidget.element.parents( ":jqmData(role='popup')" ).length === 0 ) {
+ extendSelect( selectmenuWidget );
+ }
+ });
+})( jQuery );
--- /dev/null
+(function( $, undefined ) {
+
+$.widget( "mobile.selectmenu", $.mobile.widget, {
+ options: {
+ theme: null,
+ disabled: false,
+ icon: "arrow-d",
+ iconpos: "right",
+ inline: false,
+ corners: true,
+ shadow: true,
+ iconshadow: true,
+ overlayTheme: "a",
+ hidePlaceholderMenuItems: true,
+ closeText: "Close",
+ nativeMenu: true,
+ // This option defaults to true on iOS devices.
+ preventFocusZoom: /iPhone|iPad|iPod/.test( navigator.platform ) && navigator.userAgent.indexOf( "AppleWebKit" ) > -1,
+ initSelector: "select:not( :jqmData(role='slider') )",
+ mini: false
+ },
+
+ _button: function() {
+ return $( "<div/>" );
+ },
+
+ _setDisabled: function( value ) {
+ this.element.attr( "disabled", value );
+ this.button.attr( "aria-disabled", value );
+ return this._setOption( "disabled", value );
+ },
+
+ _focusButton : function() {
+ var self = this;
+
+ setTimeout( function() {
+ self.button.focus();
+ }, 40);
+ },
+
+ _selectOptions: function() {
+ return this.select.find( "option" );
+ },
+
+ // setup items that are generally necessary for select menu extension
+ _preExtension: function() {
+ var classes = "";
+ // TODO: Post 1.1--once we have time to test thoroughly--any classes manually applied to the original element should be carried over to the enhanced element, with an `-enhanced` suffix. See https://github.com/jquery/jquery-mobile/issues/3577
+ /* if ( $el[0].className.length ) {
+ classes = $el[0].className;
+ } */
+ if ( !!~this.element[0].className.indexOf( "ui-btn-left" ) ) {
+ classes = " ui-btn-left";
+ }
+
+ if ( !!~this.element[0].className.indexOf( "ui-btn-right" ) ) {
+ classes = " ui-btn-right";
+ }
+
+ this.select = this.element.wrap( "<div class='ui-select" + classes + "'>" );
+ this.selectID = this.select.attr( "id" );
+ this.label = $( "label[for='"+ this.selectID +"']" ).addClass( "ui-select" );
+ this.isMultiple = this.select[ 0 ].multiple;
+ if ( !this.options.theme ) {
+ this.options.theme = $.mobile.getInheritedTheme( this.select, "c" );
+ }
+ },
+
+ _create: function() {
+ this._preExtension();
+
+ // Allows for extension of the native select for custom selects and other plugins
+ // see select.custom for example extension
+ // TODO explore plugin registration
+ this._trigger( "beforeCreate" );
+
+ this.button = this._button();
+
+ var self = this,
+
+ options = this.options,
+
+ inline = options.inline || $.mobile.getAttrFixed( this.select[0], "data-" + $.mobile.ns + "inline" ),
+ mini = options.mini || $.mobile.getAttrFixed( this.select[0], "data-" + $.mobile.ns + "mini" ),
+ iconpos = options.icon ? ( options.iconpos || $.mobile.getAttrFixed( this.select[0], "data-" + $.mobile.ns + "iconpos" ) ) : false,
+
+ // IE throws an exception at options.item() function when
+ // there is no selected item
+ // select first in this case
+ selectedIndex = this.select[ 0 ].selectedIndex === -1 ? 0 : this.select[ 0 ].selectedIndex,
+
+ // TODO values buttonId and menuId are undefined here
+ button = this.button
+ .insertBefore( this.select )
+ .buttonMarkup( {
+ theme: options.theme,
+ icon: options.icon,
+ iconpos: iconpos,
+ inline: inline,
+ corners: options.corners,
+ shadow: options.shadow,
+ iconshadow: options.iconshadow,
+ mini: mini
+ });
+
+ this.setButtonText();
+
+ // Opera does not properly support opacity on select elements
+ // In Mini, it hides the element, but not its text
+ // On the desktop,it seems to do the opposite
+ // for these reasons, using the nativeMenu option results in a full native select in Opera
+ if ( options.nativeMenu && window.opera && window.opera.version ) {
+ button.addClass( "ui-select-nativeonly" );
+ }
+
+ // Add counter for multi selects
+ if ( this.isMultiple ) {
+ this.buttonCount = $( "<span>" )
+ .addClass( "ui-li-count ui-btn-up-c ui-btn-corner-all" )
+ .hide()
+ .appendTo( button.addClass('ui-li-has-count') );
+ }
+
+ // Disable if specified
+ if ( options.disabled || this.element.attr('disabled')) {
+ this.disable();
+ }
+
+ // Events on native select
+ this.select.change(function() {
+ self.refresh();
+ });
+
+ this.build();
+ },
+
+ build: function() {
+ var self = this;
+
+ this.select
+ .appendTo( self.button )
+ .bind( "vmousedown", function() {
+ // Add active class to button
+ self.button.addClass( $.mobile.activeBtnClass );
+ })
+ .bind( "focus", function() {
+ self.button.addClass( $.mobile.focusClass );
+ })
+ .bind( "blur", function() {
+ self.button.removeClass( $.mobile.focusClass );
+ })
+ .bind( "focus vmouseover", function() {
+ self.button.trigger( "vmouseover" );
+ })
+ .bind( "vmousemove", function() {
+ // Remove active class on scroll/touchmove
+ self.button.removeClass( $.mobile.activeBtnClass );
+ })
+ .bind( "change blur vmouseout", function() {
+ self.button.trigger( "vmouseout" )
+ .removeClass( $.mobile.activeBtnClass );
+ })
+ .bind( "change blur", function() {
+ self.button.removeClass( "ui-btn-down-" + self.options.theme );
+ });
+
+ // In many situations, iOS will zoom into the select upon tap, this prevents that from happening
+ self.button.bind( "vmousedown", function() {
+ if ( self.options.preventFocusZoom ) {
+ $.mobile.zoom.disable( true );
+ }
+ }).bind( "mouseup", function() {
+ if ( self.options.preventFocusZoom ) {
+ setTimeout(function() {
+ $.mobile.zoom.enable( true );
+ }, 0);
+ }
+ });
+ },
+
+ selected: function() {
+ return this._selectOptions().filter( ":selected" );
+ },
+
+ selectedIndices: function() {
+ var self = this;
+
+ return this.selected().map(function() {
+ return self._selectOptions().index( this );
+ }).get();
+ },
+
+ setButtonText: function() {
+ var self = this,
+ selected = this.selected(),
+ text = this.placeholder,
+ span = $( document.createElement( "span" ) );
+
+ this.button.find( ".ui-btn-text" ).html(function() {
+ if ( selected.length ) {
+ text = selected.map(function() {
+ return $( this ).text();
+ }).get().join( ", " );
+ } else {
+ text = self.placeholder;
+ }
+
+ // TODO possibly aggregate multiple select option classes
+ return span.text( text )
+ .addClass( self.select.attr( "class" ) )
+ .addClass( selected.attr( "class" ) );
+ });
+ },
+
+ setButtonCount: function() {
+ var selected = this.selected();
+
+ // multiple count inside button
+ if ( this.isMultiple ) {
+ this.buttonCount[ selected.length > 1 ? "show" : "hide" ]().text( selected.length );
+ }
+ },
+
+ refresh: function() {
+ this.setButtonText();
+ this.setButtonCount();
+ },
+
+ // open and close preserved in native selects
+ // to simplify users code when looping over selects
+ open: $.noop,
+ close: $.noop,
+
+ disable: function() {
+ this._setDisabled( true );
+ this.button.addClass( "ui-disabled" );
+ },
+
+ enable: function() {
+ this._setDisabled( false );
+ this.button.removeClass( "ui-disabled" );
+ }
+});
+
+//auto self-init widgets
+$.mobile.$document.bind( "pagecreate create", function( e ) {
+ $.mobile.selectmenu.prototype.enhanceWithin( e.target, true );
+});
+})( jQuery );
--- /dev/null
+(function( $, undefined ) {
+
+$.widget( "mobile.slider", $.mobile.widget, {
+ widgetEventPrefix: "slide",
+
+ options: {
+ theme: null,
+ trackTheme: null,
+ disabled: false,
+ initSelector: "input[type='range'], :jqmData(type='range'), :jqmData(role='slider')",
+ mini: false
+ },
+
+ _create: function() {
+
+ // TODO: Each of these should have comments explain what they're for
+ var self = this,
+
+ control = this.element,
+
+ parentTheme = $.mobile.getInheritedTheme( control, "c" ),
+
+ theme = this.options.theme || parentTheme,
+
+ trackTheme = this.options.trackTheme || parentTheme,
+
+ cType = control[ 0 ].nodeName.toLowerCase(),
+
+ selectClass = ( cType === "select" ) ? "ui-slider-switch" : "",
+
+ controlID = control.attr( "id" ),
+
+ $label = $( "[for='" + controlID + "']" ),
+
+ labelID = $label.attr( "id" ) || controlID + "-label",
+
+ label = $label.attr( "id", labelID ),
+
+ val = function() {
+ return cType === "input" ? parseFloat( control.val() ) : control[0].selectedIndex;
+ },
+
+ min = cType === "input" ? parseFloat( control.attr( "min" ) ) : 0,
+
+ max = cType === "input" ? parseFloat( control.attr( "max" ) ) : control.find( "option" ).length-1,
+
+ step = window.parseFloat( control.attr( "step" ) || 1 ),
+
+ inlineClass = ( this.options.inline || $.mobile.getAttrFixed( control[0], "data-" + $.mobile.ns + "inline" ) === true ) ? " ui-slider-inline" : "",
+
+ miniClass = ( this.options.mini || $.mobile.getAttrFixed( control[0], "data-" + $.mobile.ns + "min" ) ) ? " ui-slider-mini" : "",
+
+
+ domHandle = document.createElement( 'a' ),
+ handle = $( domHandle ),
+ domSlider = document.createElement( 'div' ),
+ slider = $( domSlider ),
+
+ valuebg = $.mobile.getAttrFixed( control[0], "data-" + $.mobile.ns + "highlight" ) !== false && cType !== "select" ? (function() {
+ var bg = document.createElement('div');
+ bg.className = 'ui-slider-bg ' + $.mobile.activeBtnClass + ' ui-btn-corner-all';
+ return $( bg ).prependTo( slider );
+ })() : false,
+
+ options;
+
+ this._type = cType;
+
+ domHandle.setAttribute( 'href', "#" );
+ domSlider.setAttribute('role','application');
+ domSlider.className = ['ui-slider ',selectClass," ui-btn-down-",trackTheme,' ui-btn-corner-all', inlineClass, miniClass].join( "" );
+ domHandle.className = 'ui-slider-handle';
+ domSlider.appendChild( domHandle );
+
+ if ( $( control ).find( "option" ).length && $( control ).find( "option" ).text() === "" ) {
+ $( domSlider ).addClass( "ui-toggle-switch" );
+ }
+
+ handle.buttonMarkup({ corners: true, theme: theme, shadow: true })
+ .attr({
+ "role": "slider",
+ "aria-valuemin": min,
+ "aria-valuemax": max,
+ "aria-valuenow": val(),
+ "aria-valuetext": val(),
+ "title": val(),
+ "aria-labelledby": labelID
+ });
+
+ $.extend( this, {
+ slider: slider,
+ handle: handle,
+ valuebg: valuebg,
+ dragging: false,
+ beforeStart: null,
+ userModified: false,
+ mouseMoved: false
+ });
+
+ if ( cType === "select" ) {
+ var wrapper = document.createElement('div');
+ wrapper.className = 'ui-slider-inneroffset';
+
+ for ( var j = 0,length = domSlider.childNodes.length;j < length;j++ ) {
+ wrapper.appendChild( domSlider.childNodes[j] );
+ }
+
+ domSlider.appendChild( wrapper );
+
+ // slider.wrapInner( "<div class='ui-slider-inneroffset'></div>" );
+
+ // make the handle move with a smooth transition
+ handle.addClass( "ui-slider-handle-snapping" );
+
+ options = control.find( "option" );
+
+ for ( var i = 0, optionsCount = options.length; i < optionsCount; i++ ) {
+ var side = !i ? "b" : "a",
+ sliderTheme = !i ? " ui-btn-down-" + trackTheme : ( " " + $.mobile.activeBtnClass ),
+ sliderLabel = document.createElement( 'div' ),
+ sliderImg = document.createElement( 'span' );
+
+ sliderImg.className = ['ui-slider-label ui-slider-label-',side,sliderTheme," ui-btn-corner-all"].join( "" );
+ sliderImg.setAttribute('role','img');
+ sliderImg.appendChild( document.createTextNode( options[i].innerHTML ) );
+ $( sliderImg ).html() ? $( sliderImg ).html( $( sliderImg ).text() ) : $( sliderImg ).html();
+ $(sliderImg).prependTo( slider );
+ }
+
+ self._labels = $( ".ui-slider-label", slider );
+
+ }
+
+ label.addClass( "ui-slider" );
+
+ // monitor the input for updated values
+ control.addClass( cType === "input" ? "ui-slider-input" : "ui-slider-switch" )
+ .change(function() {
+ // if the user dragged the handle, the "change" event was triggered from inside refresh(); don't call refresh() again
+ if ( !self.mouseMoved ) {
+ self.refresh( val(), true );
+ }
+ })
+ .keyup(function() { // necessary?
+ self.refresh( val(), true, true );
+ })
+ .blur(function() {
+ self.refresh( val(), true );
+ });
+
+ this._preventDocumentDrag = function( event ) {
+ // NOTE: we don't do this in refresh because we still want to
+ // support programmatic alteration of disabled inputs
+ if ( self.dragging && !self.options.disabled ) {
+
+ // self.mouseMoved must be updated before refresh() because it will be used in the control "change" event
+ self.mouseMoved = true;
+
+ if ( cType === "select" ) {
+ // make the handle move in sync with the mouse
+ handle.removeClass( "ui-slider-handle-snapping" );
+ }
+
+ self.refresh( event );
+
+ // only after refresh() you can calculate self.userModified
+ self.userModified = self.beforeStart !== control[0].selectedIndex;
+ return false;
+ }
+ }
+
+ this._on( $.mobile.$document, { "vmousemove": this._preventDocumentDrag });
+
+ // it appears the clicking the up and down buttons in chrome on
+ // range/number inputs doesn't trigger a change until the field is
+ // blurred. Here we check thif the value has changed and refresh
+ control.bind( "vmouseup", $.proxy( self._checkedRefresh, self));
+
+ slider.bind( "vmousedown", function( event ) {
+ // NOTE: we don't do this in refresh because we still want to
+ // support programmatic alteration of disabled inputs
+ if ( self.options.disabled ) {
+ return false;
+ }
+
+ self.dragging = true;
+ self.userModified = false;
+ self.mouseMoved = false;
+
+ if ( cType === "select" ) {
+ self.beforeStart = control[0].selectedIndex;
+ }
+
+ self.refresh( event );
+ self._trigger( "start" );
+ return false;
+ })
+ .bind( "vclick", false );
+
+ this._sliderMouseUp = function() {
+ if ( self.dragging ) {
+ self.dragging = false;
+
+ if ( cType === "select") {
+ // make the handle move with a smooth transition
+ handle.addClass( "ui-slider-handle-snapping" );
+
+ if ( self.mouseMoved ) {
+ // this is a drag, change the value only if user dragged enough
+ if ( self.userModified ) {
+ self.refresh( self.beforeStart === 0 ? 1 : 0 );
+ }
+ else {
+ self.refresh( self.beforeStart );
+ }
+ }
+ else {
+ // this is just a click, change the value
+ self.refresh( self.beforeStart === 0 ? 1 : 0 );
+ }
+ }
+
+ self.mouseMoved = false;
+ self._trigger( "stop" );
+ return false;
+ }
+ };
+
+ this._on( slider.add( document ), { "vmouseup": this._sliderMouseUp });
+ slider.insertAfter( control );
+
+ // Only add focus class to toggle switch, sliders get it automatically from ui-btn
+ if ( cType === 'select' ) {
+ this.handle.bind({
+ focus: function() {
+ slider.addClass( $.mobile.focusClass );
+ },
+
+ blur: function() {
+ slider.removeClass( $.mobile.focusClass );
+ }
+ });
+ }
+
+ this.handle.bind({
+ // NOTE force focus on handle
+ vmousedown: function() {
+ $( this ).focus();
+ },
+
+ vclick: false,
+
+ keydown: function( event ) {
+ var index = val();
+
+ if ( self.options.disabled ) {
+ return;
+ }
+
+ // In all cases prevent the default and mark the handle as active
+ switch ( event.keyCode ) {
+ case $.mobile.keyCode.HOME:
+ case $.mobile.keyCode.END:
+ case $.mobile.keyCode.PAGE_UP:
+ case $.mobile.keyCode.PAGE_DOWN:
+ case $.mobile.keyCode.UP:
+ case $.mobile.keyCode.RIGHT:
+ case $.mobile.keyCode.DOWN:
+ case $.mobile.keyCode.LEFT:
+ event.preventDefault();
+
+ if ( !self._keySliding ) {
+ self._keySliding = true;
+ $( this ).addClass( "ui-state-active" );
+ }
+ break;
+ }
+
+ // move the slider according to the keypress
+ switch ( event.keyCode ) {
+ case $.mobile.keyCode.HOME:
+ self.refresh( min );
+ break;
+ case $.mobile.keyCode.END:
+ self.refresh( max );
+ break;
+ case $.mobile.keyCode.PAGE_UP:
+ case $.mobile.keyCode.UP:
+ case $.mobile.keyCode.RIGHT:
+ self.refresh( index + step );
+ break;
+ case $.mobile.keyCode.PAGE_DOWN:
+ case $.mobile.keyCode.DOWN:
+ case $.mobile.keyCode.LEFT:
+ self.refresh( index - step );
+ break;
+ }
+ }, // remove active mark
+
+ keyup: function( event ) {
+ if ( self._keySliding ) {
+ self._keySliding = false;
+ $( this ).removeClass( "ui-state-active" );
+ }
+ }
+ });
+
+ this.refresh( undefined, undefined, true );
+ },
+
+ _checkedRefresh: function() {
+ if( this.value != this._value() ){
+ this.refresh( this._value() );
+ }
+ },
+
+ _value: function() {
+ return this._type === "input" ?
+ parseFloat( this.element.val() ) : this.element[0].selectedIndex;
+ },
+
+ refresh: function( val, isfromControl, preventInputUpdate ) {
+ var imgToggle = false,
+ appHandle;
+
+ if ( $( this.handle ).parents().is( ".ui-toggle-switch" ) ) {
+ imgToggle = true;
+ }
+ // NOTE: we don't return here because we want to support programmatic
+ // alteration of the input value, which should still update the slider
+ if ( this.options.disabled || this.element.attr('disabled')) {
+ this.disable();
+ }
+
+ // set the stored value for comparison later
+ this.value = this._value();
+
+ var control = this.element, percent,
+ cType = control[0].nodeName.toLowerCase(),
+ min = cType === "input" ? parseFloat( control.attr( "min" ) ) : 0,
+ max = cType === "input" ? parseFloat( control.attr( "max" ) ) : control.find( "option" ).length - 1,
+ step = ( cType === "input" && parseFloat( control.attr( "step" ) ) > 0 ) ? parseFloat( control.attr( "step" ) ) : 1;
+
+ if ( typeof val === "object" ) {
+ var data = val,
+ // a slight tolerance helped get to the ends of the slider
+ tol = 8;
+ if ( !this.dragging ||
+ data.pageX < this.slider.offset().left - tol ||
+ data.pageX > this.slider.offset().left + this.slider.width() + tol ) {
+ return;
+ }
+ percent = Math.round( ( ( data.pageX - this.slider.offset().left ) / this.slider.width() ) * 100 );
+ } else {
+ if ( val == null ) {
+ val = cType === "input" ? parseFloat( control.val() || 0 ) : control[0].selectedIndex;
+ }
+ percent = ( parseFloat( val ) - min ) / ( max - min ) * 100;
+ }
+
+ if ( isNaN( percent ) ) {
+ return;
+ }
+
+ if ( percent < 0 ) {
+ percent = 0;
+ }
+
+ if ( percent > 100 ) {
+ percent = 100;
+ }
+
+ var newval = ( percent / 100 ) * ( max - min ) + min;
+
+ //from jQuery UI slider, the following source will round to the nearest step
+ var valModStep = ( newval - min ) % step;
+ var alignValue = newval - valModStep;
+
+ if ( Math.abs( valModStep ) * 2 >= step ) {
+ alignValue += ( valModStep > 0 ) ? step : ( -step );
+ }
+ // Since JavaScript has problems with large floats, round
+ // the final value to 5 digits after the decimal point (see jQueryUI: #4124)
+ newval = parseFloat( alignValue.toFixed(5) );
+
+ if ( newval < min ) {
+ newval = min;
+ }
+
+ if ( newval > max ) {
+ newval = max;
+ }
+
+ this.handle.css( "left", percent + "%" );
+ this.handle.attr( {
+ "aria-valuenow": cType === "input" ? newval : control.find( "option" ).eq( newval ).attr( "value" ),
+ "aria-valuetext": cType === "input" ? newval : control.find( "option" ).eq( newval ).getEncodedText(),
+ title: cType === "input" ? newval : control.find( "option" ).eq( newval ).getEncodedText()
+ });
+
+ if ( !imgToggle ) {
+ if ( this.valuebg ) {
+ this.valuebg.css( "width", percent + "%" );
+ }
+ }
+
+ // drag the label widths
+ if ( imgToggle ) {
+ appHandle = $( this.handle ).parents( ".ui-slider" );
+ if ( $( this.handle ).attr("aria-valuenow") === "on" ) {
+ appHandle.children( "span.ui-slider-label-a" ).show();
+ appHandle.children( "span.ui-slider-label-b" ).hide();
+ } else {
+ appHandle.children( "span.ui-slider-label-b" ).show();
+ appHandle.children( "span.ui-slider-label-a" ).hide();
+ }
+ } else {
+ if ( this._labels ) {
+ var handlePercent = this.handle.width() / this.slider.width() * 100,
+ aPercent = percent && handlePercent + ( 100 - handlePercent ) * percent / 100,
+ bPercent = percent === 100 ? 0 : Math.min( handlePercent + 100 - aPercent, 100 );
+
+ this._labels.each(function() {
+ var ab = $( this ).is( ".ui-slider-label-a" );
+ $( this ).width( ( ab ? aPercent : bPercent ) + "%" );
+ });
+ }
+ }
+
+ if ( !preventInputUpdate ) {
+ var valueChanged = false;
+
+ // update control"s value
+ if ( cType === "input" ) {
+ valueChanged = control.val() !== newval;
+ control.val( newval );
+ } else {
+ valueChanged = control[ 0 ].selectedIndex !== newval;
+ control[ 0 ].selectedIndex = newval;
+ }
+ if ( !isfromControl && valueChanged ) {
+ control.trigger( "change" );
+ }
+ }
+ },
+
+ enable: function() {
+ this.element.attr( "disabled", false );
+ this.slider.removeClass( "ui-disabled" ).attr( "aria-disabled", false );
+ return this._setOption( "disabled", false );
+ },
+
+ disable: function() {
+ this.element.attr( "disabled", true );
+ this.slider.addClass( "ui-disabled" ).attr( "aria-disabled", true );
+ return this._setOption( "disabled", true );
+ }
+
+});
+
+//auto self-init widgets
+$.mobile.$document.bind( "pagecreate create", function( e ) {
+ $.mobile.slider.prototype.enhanceWithin( e.target, true );
+});
+
+})( jQuery );
--- /dev/null
+(function( $, undefined ) {
+
+$.widget( "mobile.textinput", $.mobile.widget, {
+ options: {
+ theme: null,
+ // This option defaults to true on iOS devices.
+ preventFocusZoom: /iPhone|iPad|iPod/.test( navigator.platform ) && navigator.userAgent.indexOf( "AppleWebKit" ) > -1,
+ initSelector: "input[type='text'], input[type='number'], :jqmData(type='number'), input[type='password'], input[type='email'], input[type='url'], input[type='tel'], textarea, input[type='time'], input[type='date'], input[type='month'], input[type='week'], input[type='datetime'], input[type='datetime-local'], input[type='color'], input:not([type])",
+ disabled: false
+ },
+
+ _create: function() {
+
+ var self = this,
+ input = this.element,
+ o = this.options,
+ theme = o.theme || $.mobile.getInheritedTheme( this.element, "c" ),
+ themeclass = " ui-body-" + theme,
+ mini = $.mobile.getAttrFixed( input[0], "data-" + $.mobile.ns + "mini" ) === true,
+ miniclass = mini ? " ui-mini" : "",
+ focusedEl, clearbtn;
+
+ function toggleClear() {
+ setTimeout( function() {
+ clearbtn.toggleClass( "ui-input-clear-hidden", !input.val() );
+ }, 0 );
+ }
+
+ $( "label[for='" + input.attr( "id" ) + "']" ).addClass( "ui-input-text" );
+
+ focusedEl = input.addClass("ui-input-text ui-body-"+ theme );
+
+ switch ( input.attr( "type" ) ) {
+ case "text":
+ case "password":
+ case "number":
+ case "email":
+ case "url":
+ case "tel":
+ input.attr( { "role" : "textbox", "aria-label" : "Keyboard opened" } );
+ break;
+ default:
+ if ( input.prop( "tagName" ).toLowerCase() === "textarea" ) {
+ input.attr( { "role" : "textbox", "aria-label" : "Keyboard opened" } );
+ }
+ }
+
+ // XXX: Temporary workaround for issue 785 (Apple bug 8910589).
+ // Turn off autocorrect and autocomplete on non-iOS 5 devices
+ // since the popup they use can't be dismissed by the user. Note
+ // that we test for the presence of the feature by looking for
+ // the autocorrect property on the input element. We currently
+ // have no test for iOS 5 or newer so we're temporarily using
+ // the touchOverflow support flag for jQM 1.0. Yes, I feel dirty. - jblas
+ if ( typeof input[0].autocorrect !== "undefined" && !$.support.touchOverflow ) {
+ // Set the attribute instead of the property just in case there
+ // is code that attempts to make modifications via HTML.
+ input[0].setAttribute( "autocorrect", "off" );
+ input[0].setAttribute( "autocomplete", "off" );
+ }
+
+ input.focus(function() {
+ focusedEl.addClass( $.mobile.focusClass );
+ })
+ .blur(function() {
+ focusedEl.removeClass( $.mobile.focusClass );
+ })
+ // In many situations, iOS will zoom into the select upon tap, this prevents that from happening
+ .bind( "focus", function() {
+ if ( o.preventFocusZoom ) {
+ $.mobile.zoom.disable( true );
+ }
+ })
+ .bind( "blur", function() {
+ if ( o.preventFocusZoom ) {
+ $.mobile.zoom.enable( true );
+ }
+ });
+
+ // Autogrow
+ if ( input.is( "textarea" ) ) {
+ var extraLineHeight = 15,
+ keyupTimeoutBuffer = 100,
+ keyupTimeout;
+
+ this._keyup = function() {
+ var scrollHeight = input[ 0 ].scrollHeight,
+ clientHeight = input[ 0 ].clientHeight;
+
+ if ( clientHeight < scrollHeight && window.innerHeight / 2 > scrollHeight ) {
+ input.height(scrollHeight + extraLineHeight);
+ }
+ };
+
+ input.keyup(function() {
+ clearTimeout( keyupTimeout );
+ keyupTimeout = setTimeout( self._keyup, keyupTimeoutBuffer );
+ });
+
+ // binding to pagechange here ensures that for pages loaded via
+ // ajax the height is recalculated without user input
+ this._on( $.mobile.$document, {"pagechange": "_keyup" });
+
+ // Issue 509: the browser is not providing scrollHeight properly until the styles load
+ if ( $.trim( input.val() ) ) {
+ // bind to the window load to make sure the height is calculated based on BOTH
+ // the DOM and CSS
+ this._on( $.mobile.$window, {"load": "_keyup"});
+ }
+ }
+ if ( input.attr( "disabled" ) ) {
+ this.disable();
+ }
+ },
+
+ disable: function() {
+ var $el;
+ if ( this.element.attr( "disabled", true ) ) {
+ $el = this.element;
+ } else {
+ return;
+ }
+ $el.addClass( "ui-disabled" );
+ return this._setOption( "disabled", true );
+ },
+
+ enable: function() {
+ var $el;
+
+ // TODO using more than one line of code is acceptable ;)
+ if ( this.element.attr( "disabled", false ) ) {
+ $el = this.element;
+ } else {
+ return;
+ }
+ $el.removeClass( "ui-disabled" );
+ return this._setOption( "disabled", false );
+ }
+});
+
+//auto self-init widgets
+$.mobile.$document.bind( "pagecreate create", function( e ) {
+ $.mobile.textinput.prototype.enhanceWithin( e.target, true );
+});
+
+})( jQuery );
--- /dev/null
+
+/**
+ @class Button
+ The button widget shows a control on the screen that you can use to generate an action event when it is pressed and released. This widget is coded with standard HTML anchor and input elements and then enhanced by jQueryMobile to make it more attractive and usable on a mobile device. Buttons can be used in Tizen as described in the jQueryMobile documentation for buttons.
+
+ To add a button widget to the application, use the following code
+
+ <div data-role="button" data-inline="true">Text Button Test</div>
+ <div data-role="button" data-inline="true" data-icon="plus" data-style="circle"></div>
+ <div data-role="button" data-inline="true" data-icon="plus" data-style="nobg"></div>
+
+ The button can define callbacks for events as described in the jQueryMobile documentation for button events.<br/>
+ You can use methods with the button as described in the jQueryMobile documentation for button methods.
+*/
+
+/**
+ @property {String} data-style
+ Defines the button style. <br/> The default value is box. If the value is set to circle, a circle-shaped button is created. If the value is set to nobg, a button is created without a background.
+
+*/
+/**
+ @property {String} data-icon
+ Defines an icon for a button. Tizen supports 12 icon styles: reveal, closed, opened, info, rename, call, warning, plus, minus, cancel, send, and favorite.
+
+*/
+
--- /dev/null
+\r
+/**\r
+ @class Checkbox\r
+ The check box widget shows a list of options on the screen where one or more can be selected. Check boxes can be used in Tizen as described in the jQueryMobile documentation for check boxes.<br/> To add a check box widget to the application, use the following code:\r
+\r
+ <input type="checkbox" name="mycheck" id="check-test" class="favorite" />\r
+ <label for="check-test">Favorite</label>\r
+ <input type="checkbox" name="check-favorite" id="check-test2" checked="checked" disabled="disabled" class="favorite" />\r
+ <label for="check-test2">Favorite Checked, Disabled</label>\r
+\r
+ The check box can define callbacks for events as described in the jQueryMobile documentation for check box events.\r
+ You can use methods with the check box as described in the jQueryMobile documentation for check box methods.\r
+\r
+*/\r
+/**\r
+ @property {String} class\r
+ Defines the check box style. <br/> The default value is check. If the value is set to favorite, a star-shaped check box is created.\r
+*/\r
+\r
--- /dev/null
+
+/* ***************************************************************************
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software" ),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * ***************************************************************************
+ */
+
+// most of following codes are derived from jquery.mobile.scrollview.js
+(function ( $, window, document, undefined ) {
+
+ function circularNum( num, total ) {
+ var n = num % total;
+ if ( n < 0 ) {
+ n = total + n;
+ }
+ return n;
+ }
+
+ function setElementTransform( $ele, x, y ) {
+ var v = "translate3d( " + x + "," + y + ", 0px)";
+ $ele.css({
+ "-ms-transform": v,
+ "-o-transform": v,
+ "-moz-transform": v,
+ "-webkit-transform": v,
+ "transform": v
+ } );
+ }
+
+ function MomentumTracker( options ) {
+ this.options = $.extend( {}, options );
+ this.easing = "easeOutQuad";
+ this.reset();
+ }
+
+ var tstates = {
+ scrolling : 0,
+ done : 1
+ };
+
+ function getCurrentTime() {
+ return Date.now();
+ }
+
+ $.extend( MomentumTracker.prototype, {
+ start: function ( pos, speed, duration ) {
+ this.state = ( speed != 0 ) ? tstates.scrolling : tstates.done;
+ this.pos = pos;
+ this.speed = speed;
+ this.duration = duration;
+
+ this.fromPos = 0;
+ this.toPos = 0;
+
+ this.startTime = getCurrentTime();
+ },
+
+ reset: function () {
+ this.state = tstates.done;
+ this.pos = 0;
+ this.speed = 0;
+ this.duration = 0;
+ },
+
+ update: function () {
+ var state = this.state,
+ duration,
+ elapsed,
+ dx,
+ x;
+
+ if ( state == tstates.done ) {
+ return this.pos;
+ }
+
+ duration = this.duration;
+ elapsed = getCurrentTime() - this.startTime;
+ elapsed = elapsed > duration ? duration : elapsed;
+
+ dx = this.speed * ( 1 - $.easing[this.easing](elapsed / duration, elapsed, 0, 1, duration ) );
+
+ x = this.pos + dx;
+ this.pos = x;
+
+ if ( elapsed >= duration ) {
+ this.state = tstates.done;
+ }
+
+ return this.pos;
+ },
+
+ done: function () {
+ return this.state == tstates.done;
+ },
+
+ getPosition: function () {
+ return this.pos;
+ }
+ } );
+
+ jQuery.widget( "mobile.circularview", jQuery.mobile.widget, {
+ options: {
+ fps: 60,
+
+ scrollDuration: 2000,
+
+ moveThreshold: 10,
+ moveIntervalThreshold: 150,
+
+ startEventName: "scrollstart",
+ updateEventName: "scrollupdate",
+ stopEventName: "scrollstop",
+
+ eventType: $.support.touch ? "touch" : "mouse",
+
+ delayedClickSelector: "a, .ui-btn",
+ delayedClickEnabled: false
+ },
+
+ _makePositioned: function ( $ele ) {
+ if ( $ele.css( 'position' ) == 'static' ) {
+ $ele.css( 'position', 'relative' );
+ }
+ },
+
+ _create: function () {
+ var self = this;
+
+ this._items = $( this.element ).jqmData('list');
+ this._$clip = $( this.element ).addClass( "ui-scrollview-clip" );
+ this._$clip.wrapInner( '<div class="ui-scrollview-view"></div>' );
+ this._$view = $('.ui-scrollview-view', this._$clip );
+ this._$list = $( 'ul', this._$clip );
+
+ this._$clip.css( "overflow", "hidden" );
+ this._makePositioned( this._$clip );
+
+ this._$view.css( "overflow", "hidden" );
+ this._tracker = new MomentumTracker( this.options );
+
+ this._timerInterval = 1000 / this.options.fps;
+ this._timerID = 0;
+
+ this._timerCB = function () { self._handleMomentumScroll(); };
+
+ this.refresh();
+
+ this._addBehaviors();
+ },
+
+ reflow: function () {
+ var xy = this.getScrollPosition();
+ this.refresh();
+ this.scrollTo( xy.x, xy.y );
+ },
+
+ refresh: function () {
+ var itemsPerView;
+
+ this._$clip.width( $(window).width() );
+ this._clipWidth = this._$clip.width();
+ this._$list.empty();
+ this._$list.append(this._items[0]);
+ this._itemWidth = $(this._items[0]).outerWidth();
+ $(this._items[0]).detach();
+
+ itemsPerView = this._clipWidth / this._itemWidth;
+ itemsPerView = Math.ceil( itemsPerView * 10 ) / 10;
+ this._itemsPerView = parseInt( itemsPerView, 10 );
+ while ( this._itemsPerView + 1 > this._items.length ) {
+ $.merge( this._items, $(this._items).clone() );
+ }
+ this._rx = -this._itemWidth;
+ this._sx = -this._itemWidth;
+ this._setItems();
+ },
+
+ _startMScroll: function ( speedX, speedY ) {
+ this._stopMScroll();
+
+ var keepGoing = false,
+ duration = this.options.scrollDuration,
+ t = this._tracker,
+ c = this._clipWidth,
+ v = this._viewWidth;
+
+ this._$clip.trigger( this.options.startEventName);
+
+ t.start( this._rx, speedX, duration, (v > c ) ? -(v - c) : 0, 0 );
+ keepGoing = !t.done();
+
+ if ( keepGoing ) {
+ this._timerID = setTimeout( this._timerCB, this._timerInterval );
+ } else {
+ this._stopMScroll();
+ }
+ //console.log( "startmscroll" + this._rx + "," + this._sx );
+ },
+
+ _stopMScroll: function () {
+ if ( this._timerID ) {
+ this._$clip.trigger( this.options.stopEventName );
+ clearTimeout( this._timerID );
+ }
+
+ this._timerID = 0;
+
+ if ( this._tracker ) {
+ this._tracker.reset();
+ }
+ //console.log( "stopmscroll" + this._rx + "," + this._sx );
+ },
+
+ _handleMomentumScroll: function () {
+ var keepGoing = false,
+ v = this._$view,
+ x = 0,
+ y = 0,
+ t = this._tracker;
+
+ if ( t ) {
+ t.update();
+ x = t.getPosition();
+
+ keepGoing = !t.done();
+
+ }
+
+ this._setScrollPosition( x, y );
+ this._rx = x;
+
+ this._$clip.trigger( this.options.updateEventName, [ { x: x, y: y } ] );
+
+ if ( keepGoing ) {
+ this._timerID = setTimeout( this._timerCB, this._timerInterval );
+ } else {
+ this._stopMScroll();
+ }
+ },
+
+ _setItems: function () {
+ var i,
+ $item;
+
+ for ( i = -1; i < this._itemsPerView + 1; i++ ) {
+ $item = this._items[ circularNum( i, this._items.length ) ];
+ this._$list.append( $item );
+ }
+ setElementTransform( this._$view, this._sx + "px", 0 );
+ this._$view.width( this._itemWidth * ( this._itemsPerView + 2 ) );
+ this._viewWidth = this._$view.width();
+ },
+
+ _setScrollPosition: function ( x, y ) {
+ var sx = this._sx,
+ dx = x - sx,
+ di = parseInt( dx / this._itemWidth, 10 ),
+ i,
+ idx,
+ $item;
+
+ if ( di > 0 ) {
+ for ( i = 0; i < di; i++ ) {
+ this._$list.children().last().detach();
+ idx = -parseInt( ( sx / this._itemWidth ) + i + 3, 10 );
+ $item = this._items[ circularNum( idx, this._items.length ) ];
+ this._$list.prepend( $item );
+ //console.log( "di > 0 : " + idx );
+ }
+ } else if ( di < 0 ) {
+ for ( i = 0; i > di; i-- ) {
+ this._$list.children().first().detach();
+ idx = this._itemsPerView - parseInt( ( sx / this._itemWidth ) + i, 10 );
+ $item = this._items[ circularNum( idx, this._items.length ) ];
+ this._$list.append( $item );
+ //console.log( "di < 0 : " + idx );
+ }
+ }
+
+ this._sx += di * this._itemWidth;
+
+ setElementTransform( this._$view, ( x - this._sx - this._itemWidth ) + "px", 0 );
+
+ //console.log( "rx " + this._rx + "sx " + this._sx );
+ },
+
+ _enableTracking: function () {
+ $(document).bind( this._dragMoveEvt, this._dragMoveCB );
+ $(document).bind( this._dragStopEvt, this._dragStopCB );
+ },
+
+ _disableTracking: function () {
+ $(document).unbind( this._dragMoveEvt, this._dragMoveCB );
+ $(document).unbind( this._dragStopEvt, this._dragStopCB );
+ },
+
+ _getScrollHierarchy: function () {
+ var svh = [],
+ d;
+ this._$clip.parents( '.ui-scrollview-clip' ).each( function () {
+ d = $( this ).jqmData( 'circulaview' );
+ if ( d ) {
+ svh.unshift( d );
+ }
+ } );
+ return svh;
+ },
+
+ centerTo: function ( selector, duration ) {
+ var i,
+ newX;
+
+ for ( i = 0; i < this._items.length; i++ ) {
+ if ( $( this._items[i]).is( selector ) ) {
+ newX = -( i * this._itemWidth - this._clipWidth / 2 + this._itemWidth * 1.5 );
+ this.scrollTo( newX + this._itemWidth, 0 );
+ this.scrollTo( newX, 0, duration );
+ return;
+ }
+ }
+ },
+
+ scrollTo: function ( x, y, duration ) {
+ this._stopMScroll();
+ if ( !duration ) {
+ this._setScrollPosition( x, y );
+ this._rx = x;
+ return;
+ }
+
+ var self = this,
+ start = getCurrentTime(),
+ efunc = $.easing.easeOutQuad,
+ sx = this._rx,
+ sy = 0,
+ dx = x - sx,
+ dy = 0,
+ tfunc,
+ elapsed,
+ ec;
+
+ this._rx = x;
+
+ tfunc = function () {
+ elapsed = getCurrentTime() - start;
+ if ( elapsed >= duration ) {
+ self._timerID = 0;
+ self._setScrollPosition( x, y );
+ self._$clip.trigger("scrollend");
+ } else {
+ ec = efunc( elapsed / duration, elapsed, 0, 1, duration );
+ self._setScrollPosition( sx + ( dx * ec ), sy + ( dy * ec ) );
+ self._timerID = setTimeout( tfunc, self._timerInterval );
+ }
+ };
+
+ this._timerID = setTimeout( tfunc, this._timerInterval );
+ },
+
+ getScrollPosition: function () {
+ return { x: -this._rx, y: 0 };
+ },
+
+ _handleDragStart: function ( e, ex, ey ) {
+ $.each( this._getScrollHierarchy(), function ( i, sv ) {
+ sv._stopMScroll();
+ } );
+
+ this._stopMScroll();
+
+ if ( this.options.delayedClickEnabled ) {
+ this._$clickEle = $( e.target ).closest( this.options.delayedClickSelector );
+ }
+ this._lastX = ex;
+ this._lastY = ey;
+ this._speedX = 0;
+ this._speedY = 0;
+ this._didDrag = false;
+
+ this._lastMove = 0;
+ this._enableTracking();
+
+ this._ox = ex;
+ this._nx = this._rx;
+
+ if ( this.options.eventType == "mouse" || this.options.delayedClickEnabled ) {
+ e.preventDefault();
+ }
+ //console.log( "scrollstart" + this._rx + "," + this._sx );
+ e.stopPropagation();
+ },
+
+ _handleDragMove: function ( e, ex, ey ) {
+ this._lastMove = getCurrentTime();
+
+ var dx = ex - this._lastX,
+ dy = ey - this._lastY;
+
+ this._speedX = dx;
+ this._speedY = 0;
+
+ this._didDrag = true;
+
+ this._lastX = ex;
+ this._lastY = ey;
+
+ this._mx = ex - this._ox;
+
+ this._setScrollPosition( this._nx + this._mx, 0 );
+
+ //console.log( "scrollmove" + this._rx + "," + this._sx );
+ return false;
+ },
+
+ _handleDragStop: function ( e ) {
+ var l = this._lastMove,
+ t = getCurrentTime(),
+ doScroll = l && ( t - l ) <= this.options.moveIntervalThreshold,
+ sx = ( this._tracker && this._speedX && doScroll ) ? this._speedX : 0,
+ sy = 0;
+
+ this._rx = this._mx ? this._nx + this._mx : this._rx;
+
+ if ( sx ) {
+ this._startMScroll( sx, sy );
+ }
+
+ //console.log( "scrollstop" + this._rx + "," + this._sx );
+
+ this._disableTracking();
+
+ if ( !this._didDrag && this.options.delayedClickEnabled && this._$clickEle.length ) {
+ this._$clickEle
+ .trigger( "mousedown" )
+ .trigger( "mouseup" )
+ .trigger( "click" );
+ }
+
+ if ( this._didDrag ) {
+ e.preventDefault();
+ e.stopPropagation();
+ }
+
+ return this._didDrag ? false : undefined;
+ },
+
+ _addBehaviors: function () {
+ var self = this;
+
+ if ( this.options.eventType === "mouse" ) {
+ this._dragStartEvt = "mousedown";
+ this._dragStartCB = function ( e ) {
+ return self._handleDragStart( e, e.clientX, e.clientY );
+ };
+
+ this._dragMoveEvt = "mousemove";
+ this._dragMoveCB = function ( e ) {
+ return self._handleDragMove( e, e.clientX, e.clientY );
+ };
+
+ this._dragStopEvt = "mouseup";
+ this._dragStopCB = function ( e ) {
+ return self._handleDragStop( e );
+ };
+
+ this._$view.bind( "vclick", function (e) {
+ return !self._didDrag;
+ } );
+
+ } else { //touch
+ this._dragStartEvt = "touchstart";
+ this._dragStartCB = function ( e ) {
+ var t = e.originalEvent.targetTouches[0];
+ return self._handleDragStart(e, t.pageX, t.pageY );
+ };
+
+ this._dragMoveEvt = "touchmove";
+ this._dragMoveCB = function ( e ) {
+ var t = e.originalEvent.targetTouches[0];
+ return self._handleDragMove(e, t.pageX, t.pageY );
+ };
+
+ this._dragStopEvt = "touchend";
+ this._dragStopCB = function ( e ) {
+ return self._handleDragStop( e );
+ };
+ }
+ this._$view.bind( this._dragStartEvt, this._dragStartCB );
+ }
+ } );
+
+ $( document ).bind( "pagecreate create", function ( e ) {
+ $( $.mobile.circularview.prototype.options.initSelector, e.target ).circularview();
+ } );
+
+}( jQuery, window, document ) ); // End Component
+
--- /dev/null
+
+/*global Globalize:false, range:false, regexp:false*/
+/*
+ * jQuery Mobile Widget @VERSION
+ *
+ * This software is licensed under the MIT licence (as defined by the OSI at
+ * http://www.opensource.org/licenses/mit-license.php)
+ *
+ * ***************************************************************************
+ * Copyright (C) 2011 by Intel Corporation Ltd.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * ***************************************************************************
+ *
+ * Authors: Salvatore Iovene <salvatore.iovene@intel.com>
+ * Daehyon Jung <darrenh.jung@samsung.com>
+ */
+
+/**
+ * datetimepicker is a widget that lets the user select a date and/or a
+ * time. If you'd prefer use as auto-initialization of form elements,
+ * use input elements with type=date/time/datetime within form tag
+ * as same as other form elements.
+ *
+ * HTML Attributes:
+ *
+ * data-role: 'datetimepicker'
+ * data-format: date format string. e.g) "MMM dd yyyy, HH:mm"
+ * type: 'date', 'datetime', 'time'
+ * value: pre-set value. only accepts ISO date string. e.g) "2012-05-04", "2012-05-04T01:02:03+09:00"
+ * data-date: any date/time string "new Date()" accepts.
+ *
+ * Options:
+ * type: 'date', 'datetime', 'time'
+ * format: see data-format in HTML Attributes.
+ * value: see value in HTML Attributes.
+ * date: preset value as JavaScript Date Object representation.
+ *
+ * APIs:
+ * value( datestring )
+ * : Set date/time to 'datestring'.
+ * value()
+ * : Get current selected date/time as W3C DTF style string.
+ * getValue() - replaced with 'value()'
+ * : same as value()
+ * setValue( datestring ) - replaced with 'value(datestring)'
+ * : same as value( datestring )
+ * changeTypeFormat( type, format ) - deprecated
+ * : Change Type and Format options. use datetimepicker( "option", "format" ) instead
+ *
+ * Events:
+ * date-changed: Raised when date/time was changed.
+ *
+ * Examples:
+ * <ul data-role="listview">
+ * <li class="ui-li-3-2-2">
+ * <span class="ui-li-text-main">
+ * <input type="datetime" name="demo-date" id="demo-date"
+ * data-format="MMM dd yyyy hh:mm tt"/>
+ * </span>
+ * <span class="ui-li-text-sub">
+ * Date/Time Picker - <span id="selected-date1"><em>(select a date first)</em></span>
+ * </span>
+ * </li>
+ * <li class="ui-li-3-2-2">
+ * <span class="ui-li-text-main">
+ * <input type="date" name="demo-date2" id="demo-date2"/>
+ * </span>
+ * <span class="ui-li-text-sub">
+ * Date Picker - <span id="selected-date2"><em>(select a date first)</em></span>
+ * </span>
+ * </li>
+ * <li class="ui-li-3-2-2">
+ * <span class="ui-li-text-main">
+ * <input type="time" name="demo-date3" id="demo-date3"/>
+ * </span>
+ * <span class="ui-li-text-sub">
+ * Time Picker - <span id="selected-date3"><em>(select a date first)</em></span>
+ * </span>
+ * </li>
+ * </ul>
+ * How to get a return value:
+ * ==========================
+ * Bind to the 'date-changed' event, e.g.:
+ * $("#myDatetimepicker").bind("date-changed", function(e, date) {
+ * alert("New date: " + date.toString());
+ * });
+ */
+
+/**
+ @class DateTimePicker
+ The picker widgets show a control that you can use to enter date and time values. <br/> To add a date time picker widget to the application, use the following code:
+
+ <li class="ui-li-dialogue ui-datetime">
+ <div class="ui-datetime-text-main">
+ <input type="datetime" data-format="MMM dd yyyy hh:mm:ss" name="demo-date" id="demo-date" />
+ </div>
+ <div class="ui-li-text-sub">Date/Time Picker
+ <span id="selected-date1"><em>(select a date first)</em></span>
+ </div>
+ </li>
+*/
+
+
+( function ( $, window, undefined ) {
+ $.widget( "tizen.datetimepicker", $.tizen.widgetex, {
+
+ options: {
+ type: null, // date, time, datetime applicable
+ format: null,
+ date: null,
+ initSelector: "input[type='date'], input[type='datetime'], input[type='time'], :jqmData(role='datetimepicker')"
+ },
+
+ _calendar: function () {
+ return window.Globalize.culture().calendars.standard;
+ },
+
+ _value: {
+ attr: "data-" + ( $.mobile.ns || "" ) + "date",
+ signal: "date-changed"
+ },
+
+ _daysInMonth: [ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ],
+
+ _isLeapYear: function ( year ) {
+ return year % 4 ? 0 : ( year % 100 ? 1 : ( year % 400 ? 0 : 1 ) );
+ },
+
+ _makeTwoDigits: function ( val ) {
+ var ret = val.toString(10);
+ if ( val < 10 ) {
+ ret = "0" + ret;
+ }
+ return ret;
+ },
+
+ _setType: function ( type ) {
+ //datetime, date, time
+ switch (type) {
+ case 'datetime':
+ case 'date':
+ case 'time':
+ this.options.type = type;
+ break;
+ default:
+ this.options.type = 'datetime';
+ break;
+ }
+
+ this.element.attr( "data-" + ( $.mobile.ns ? $.mobile.ns + "-" : "" ) + "type", this.options.type );
+ return this.options.type;
+ },
+
+ _setFormat: function ( format ) {
+ if ( this.options.format != format ) {
+ this.options.format = format;
+ } else {
+ return;
+ }
+
+ this.ui.children().remove();
+
+ var token = this._parsePattern( format ),
+ div = document.createElement('div'),
+ pat,
+ tpl,
+ period,
+ btn,
+ obj = this;
+
+ while ( token.length > 0 ) {
+ pat = token.shift();
+ tpl = '<span class="ui-datefield-%1" data-pat="' + pat + '">%2</span>';
+ switch ( pat ) {
+ case 'H': //0 1 2 3 ... 21 22 23
+ case 'HH': //00 01 02 ... 21 22 23
+ case 'h': //0 1 2 3 ... 11 12
+ case 'hh': //00 01 02 ... 11 12
+ $(div).append( tpl.replace('%1', 'hour') );
+ break;
+ case 'mm': //00 01 ... 59
+ case 'm': //0 1 2 ... 59
+ if ( this.options.type == 'date' ) {
+ $(div).append( tpl.replace('%1', 'month') );
+ } else {
+ $(div).append( tpl.replace('%1', 'min') );
+ }
+ break;
+ case 'ss':
+ case 's':
+ $(div).append( tpl.replace('%1', 'sec') );
+ break;
+ case 'd': // day of month 5
+ case 'dd': // day of month(leading zero) 05
+ $(div).append( tpl.replace('%1', 'day') );
+ break;
+ case 'M': // Month of year 9
+ case 'MM': // Month of year(leading zero) 09
+ case 'MMM':
+ case 'MMMM':
+ $(div).append( tpl.replace('%1', 'month') );
+ break;
+ case 'yy': // year two digit
+ case 'yyyy': // year four digit
+ $(div).append( tpl.replace('%1', 'year') );
+ break;
+ case 't': //AM / PM indicator(first letter) A, P
+ // add button
+ case 'tt': //AM / PM indicator AM/PM
+ // add button
+ btn = '<a href="#" class="ui-datefield-period"' +
+ ' data-role="button" data-inline="true">period</a>';
+ $(div).append( btn );
+ break;
+ case 'g':
+ case 'gg':
+ $(div).append( tpl.replace('%1', 'era').replace('%2', this._calendar().eras.name) );
+ break;
+ case '\t':
+ $(div).append( tpl.replace('%1', 'tab').replace('%2', pat) );
+ break;
+ default : // string or any non-clickable object
+ $(div).append( tpl.replace('%1', 'seperator').replace('%2', pat) );
+ break;
+ }
+ }
+
+ this.ui.append( div );
+ if ( this.options.date ) {
+ this._setDate( this.options.date );
+ }
+
+ this.ui.find('.ui-datefield-period').buttonMarkup().bind( 'vclick', function ( e ) {
+ obj._switchAmPm( obj );
+ });
+
+ this.element.attr( "data-" + ( $.mobile.ns ? $.mobile.ns + "-" : "" ) + "format", this.options.format );
+ return this.options.format;
+ },
+
+ _setDate: function ( newdate ) {
+ if ( typeof ( newdate ) == "string" ) {
+ newdate = new Date( newdate );
+ }
+
+ var fields = $('span,a', this.ui),
+ type,
+ fn,
+ $field,
+ btn,
+ i;
+
+ function getMonth() {
+ return newdate.getMonth() + 1;
+ }
+
+ for ( i = 0; i < fields.length; i++ ) {
+ $field = $(fields[i]);
+ type = $field.attr("class").match(/ui-datefield-([\w]*)/);
+ if ( !type ) {
+ type = "";
+ }
+ switch ( type[1] ) {
+ case 'hour':
+ fn = newdate.getHours;
+ break;
+ case 'min':
+ fn = newdate.getMinutes;
+ break;
+ case 'sec':
+ fn = newdate.getSeconds;
+ break;
+ case 'year':
+ fn = newdate.getFullYear;
+ break;
+ case 'month':
+ fn = getMonth;
+ break;
+ case 'day':
+ fn = newdate.getDate;
+ break;
+ case 'period':
+ fn = newdate.getHours() < 12 ? this._calendar().AM[0] : this._calendar().PM[0];
+ btn = $field.find( '.ui-btn-text' );
+ if ( btn.length == 0 ) {
+ $field.text(fn);
+ } else if ( btn.text() != fn ) {
+ btn.text( fn );
+ }
+ fn = null;
+ break;
+ default:
+ fn = null;
+ break;
+ }
+ if ( fn ) {
+ this._updateField( $field, fn.call( newdate ) );
+ }
+ }
+
+ this.options.date = newdate;
+
+ this._setValue( newdate );
+
+ this.element.attr( "data-" + ( $.mobile.ns ? $.mobile.ns + "-" : "" ) + "date", this.options.date );
+ return this.options.date;
+ },
+
+ destroy: function () {
+ if ( this.ui ) {
+ this.ui.remove();
+ }
+
+ if ( this.element ) {
+ this.element.show();
+ }
+ },
+
+ value: function ( val ) {
+ function timeStr( t, obj ) {
+ return obj._makeTwoDigits( t.getHours() ) + ':' +
+ obj._makeTwoDigits( t.getMinutes() ) + ':' +
+ obj._makeTwoDigits( t.getSeconds() );
+ }
+
+ function dateStr( d, obj ) {
+ return ( ( d.getFullYear() % 10000 ) + 10000 ).toString().substr(1) + '-' +
+ obj._makeTwoDigits( d.getMonth() + 1 ) + '-' +
+ obj._makeTwoDigits( d.getDate() );
+ }
+
+ var rvalue = null;
+ if ( val ) {
+ rvalue = this._setDate( val );
+ } else {
+ switch ( this.options.type ) {
+ case 'time':
+ rvalue = timeStr( this.options.date, this );
+ break;
+ case 'date':
+ rvalue = dateStr( this.options.date, this );
+ break;
+ default:
+ rvalue = dateStr( this.options.date, this ) + 'T' + timeStr( this.options.date, this );
+ break;
+ }
+ }
+ return rvalue;
+ },
+
+ setValue: function ( newdate ) {
+ console.warn( "setValue was deprecated. use datetimepicker('option', 'date', value) instead." );
+ return this.value( newdate );
+ },
+
+ /**
+ * return W3C DTF string
+ */
+ getValue: function () {
+ console.warn("getValue() was deprecated. use datetimepicker('value') instead.");
+ return this.value();
+ },
+
+ _updateField: function ( target, value ) {
+ if ( !target || target.length == 0 ) {
+ return;
+ }
+
+ if ( value == 0 ) {
+ value = "0";
+ }
+
+ var pat = target.jqmData( 'pat' ),
+ hour,
+ text,
+ self = this;
+
+ switch ( pat ) {
+ case 'H':
+ case 'HH':
+ case 'h':
+ case 'hh':
+ hour = value;
+ if ( pat.charAt(0) == 'h' ) {
+ if ( hour > 12 ) {
+ hour -= 12;
+ } else if ( hour == 0 ) {
+ hour = 12;
+ }
+ }
+ hour = this._makeTwoDigits( hour );
+ text = hour;
+ break;
+ case 'm':
+ case 'M':
+ case 'd':
+ case 's':
+ text = value;
+ break;
+ case 'mm':
+ case 'dd':
+ case 'MM':
+ case 'ss':
+ text = this._makeTwoDigits( value );
+ break;
+ case 'MMM':
+ text = this._calendar().months.namesAbbr[ value - 1];
+ break;
+ case 'MMMM':
+ text = this._calendar().months.names[ value - 1 ];
+ break;
+ case 'yy':
+ text = this._makeTwoDigits( value % 100 );
+ break;
+ case 'yyyy':
+ if ( value < 10 ) {
+ value = '000' + value;
+ } else if ( value < 100 ) {
+ value = '00' + value;
+ } else if ( value < 1000 ) {
+ value = '0' + value;
+ }
+ text = value;
+ break;
+ }
+
+ // to avoid reflow where its value isn't out-dated
+ if ( target.text() != text ) {
+ if ( target.hasClass("ui-datefield-selected") ) {
+ target.addClass("out");
+ this._new_value = text;
+
+ target.animationComplete( function () {
+ target.text( self._new_value);
+ target.addClass("in")
+ .removeClass("out");
+
+ target.animationComplete( function () {
+ target.removeClass("in").
+ removeClass("ui-datefield-selected");
+ });
+ });
+ } else {
+ target.text( text );
+ }
+ }
+ },
+
+ _switchAmPm: function ( obj ) {
+ if ( this._calendar().AM != null ) {
+ var date = new Date( this.options.date ),
+ text,
+ change = 1000 * 60 * 60 * 12;
+ if ( date.getHours() > 11 ) {
+ change = -change;
+ }
+ date.setTime( date.getTime() + change );
+ this._setDate( date );
+ }
+ },
+
+ _parsePattern: function ( pattern ) {
+ var regex = /\/|\s|dd|d|MMMM|MMM|MM|M|yyyy|yy|y|hh|h|HH|H|mm|m|ss|s|tt|t|f|gg|g|\'[\w\W]*\'$|[\w\W]/g,
+ matches,
+ i;
+
+ matches = pattern.match( regex );
+
+ for ( i = 0; i < matches.length; i++ ) {
+ if ( matches[i].charAt(0) == "'" ) {
+ matches[i] = matches[i].substr( 1, matches[i].length - 2 );
+ }
+ }
+
+ return matches;
+ },
+
+ changeTypeFormat: function ( type, format ) {
+ console.warn('changeTypeFormat() was deprecated. use datetimepicker("option", "type"|"format", value) instead');
+ if ( type ) {
+ this._setType( type );
+ }
+
+ if ( format ) {
+ this._setFormat( format );
+ }
+ },
+
+ _create: function () {
+ var obj = this;
+
+ if ( this.element.is( "input" ) ) {
+ ( function ( obj ) {
+ var type, value, format;
+
+ type = obj.element.get(0).getAttribute( "type" );
+ obj.options.type = type;
+
+ value = obj.element.get(0).getAttribute( "value" );
+ if ( value ) {
+ obj.options.date = new Date( value );
+ }
+ }( this ) );
+ }
+
+ if ( !this.options.format ) {
+ switch ( this.options.type ) {
+ case 'datetime':
+ this.options.format = this._calendar().patterns.d + "\t" + this._calendar().patterns.t;
+ break;
+ case 'date':
+ this.options.format = this._calendar().patterns.d;
+ break;
+ case 'time':
+ this.options.format = this._calendar().patterns.t;
+ break;
+ }
+ }
+
+ if ( !this.options.date ) {
+ this.options.date = new Date();
+ }
+
+ this.element.hide();
+ this.ui = $('<div class="ui-datefield"></div>');
+ $(this.element).after( this.ui );
+
+ this._popup_open = false;
+ this.ui.bind('vclick', function ( e ) {
+ obj._showDataSelector( obj, this, e.target );
+ });
+ },
+
+ _populateDataSelector: function ( field, pat ) {
+ var values,
+ numItems,
+ current,
+ data,
+ range = window.range,
+ local,
+ yearlb,
+ yearhb,
+ day;
+
+ switch ( field ) {
+ case 'hour':
+ if ( pat == 'H' || pat == 'HH' ) {
+ // twentyfour
+ values = range( 0, 23 );
+ data = range( 0, 23 );
+ current = this.options.date.getHours();
+ } else {
+ values = range( 1, 12 );
+ current = this.options.date.getHours() - 1;//11
+ if ( current >= 11 ) {
+ current = current - 12;
+ data = range( 13, 23 );
+ data.push( 12 ); // consider 12:00 am as 00:00
+ } else {
+ data = range( 1, 11 );
+ data.push( 0 );
+ }
+ if ( current < 0 ) {
+ current = 11; // 12:00 or 00:00
+ }
+ }
+ if ( pat.length == 2 ) {
+ // two digit
+ values = values.map( this._makeTwoDigits );
+ }
+ numItems = values.length;
+ break;
+ case 'min':
+ case 'sec':
+ values = range( 0, 59 );
+ if ( pat.length == 2 ) {
+ values = values.map( this._makeTwoDigits );
+ }
+ data = range( 0, 59 );
+ current = ( field == 'min' ? this.options.date.getMinutes() : this.options.date.getSeconds() );
+ numItems = values.length;
+ break;
+ case 'year':
+ yearlb = 1900;
+ yearhb = 2100;
+ data = range( yearlb, yearhb );
+ current = this.options.date.getFullYear() - yearlb;
+ values = range( yearlb, yearhb );
+ numItems = values.length;
+ break;
+ case 'month':
+ switch ( pat.length ) {
+ case 1:
+ values = range( 1, 12 );
+ break;
+ case 2:
+ values = range( 1, 12 ).map( this._makeTwoDigits );
+ break;
+ case 3:
+ values = this._calendar().months.namesAbbr.slice();
+ break;
+ case 4:
+ values = this._calendar().months.names.slice();
+ break;
+ }
+ if ( values.length == 13 ) { // @TODO Lunar calendar support
+ if ( values[12] == "" ) { // to remove lunar calendar reserved space
+ values.pop();
+ }
+ }
+ data = range( 1, values.length );
+ current = this.options.date.getMonth();
+ numItems = values.length;
+ break;
+ case 'day':
+ day = this._daysInMonth[ this.options.date.getMonth() ];
+ if ( day == 28 ) {
+ day += this._isLeapYear( this.options.date.getFullYear() );
+ }
+ values = range( 1, day );
+ if ( pat.length == 2 ) {
+ values = values.map( this._makeTwoDigits );
+ }
+ data = range( 1, day );
+ current = this.options.date.getDate() - 1;
+ numItems = day;
+ break;
+ }
+
+ return {
+ values: values,
+ data: data,
+ numItems: numItems,
+ current: current
+ };
+
+ },
+
+ _showDataSelector: function ( obj, ui, target ) {
+ target = $(target);
+
+ var attr = target.attr("class"),
+ field = attr ? attr.match(/ui-datefield-([\w]*)/) : undefined,
+ pat,
+ data,
+ values,
+ numItems,
+ current,
+ valuesData,
+ html,
+ datans,
+ $ul,
+ $div,
+ $ctx,
+ $li,
+ i,
+ newLeft = 10,
+ self = this;
+
+ if ( !attr ) {
+ return;
+ }
+ if ( !field ) {
+ return;
+ }
+ if ( this._popup_open ) {
+ return;
+ }
+
+ target.not('.ui-datefield-seperator').addClass('ui-datefield-selected');
+
+ pat = target.jqmData('pat');
+ data = obj._populateDataSelector.call( obj, field[1], pat );
+
+ values = data.values;
+ numItems = data.numItems;
+ current = data.current;
+ valuesData = data.data;
+
+ if ( values ) {
+ datans = "data-" + ($.mobile.ns ? ($.mobile.ns + '-') : "") + 'val="';
+ for ( i = 0; i < values.length; i++ ) {
+ html += '<li><a class="ui-link" ' + datans + valuesData[i] + '">' + values[i] + '</a></li>';
+ }
+
+ $ul = $("<ul></ul>");
+ $div = $('<div class="ui-datetimepicker-selector" data-transition="fade" data-fade="false"></div>');
+ $div.append( $ul ).appendTo( ui );
+ $ctx = $div.ctxpopup();
+ $ctx.parents('.ui-popupwindow').addClass('ui-datetimepicker');
+ $li = $(html);
+ $( $li[current] ).addClass("current");
+ $div.jqmData( "list", $li );
+ $div.circularview();
+ // cause ctxpopup forced to subtract 10
+ if ( $( window ).width() / 2 < target.offset().left ) {
+ newLeft = -10;
+ }
+ $ctx.popupwindow( 'open',
+ target.offset().left + ( target.width() / 2 ) + newLeft - window.pageXOffset ,
+ target.offset().top + target.height() - window.pageYOffset );
+
+ this._popup_open = true;
+
+ $div.bind('popupafterclose', function ( e ) {
+ if ( obj._reflow ) {
+ $(window).unbind("resize", obj._reflow);
+ obj._reflow = null;
+ }
+
+ if ( !( target.hasClass("in") || target.hasClass("out") ) ) {
+ target.removeClass("ui-datefield-selected");
+ }
+
+ $div.unbind( 'popupafterclose' );
+ $ul.unbind( 'vclick' );
+ $(obj).unbind( 'update' );
+ $ctx.popupwindow( 'destroy' );
+ $div.remove();
+
+ self._popup_open = false;
+ });
+
+ $(obj).bind( 'update', function ( e, val ) {
+ var date = new Date( this.options.date ),
+ month,
+ date_calibration = function () {
+ date.setDate( 1 );
+ date.setDate( date.getDate() - 1 );
+ };
+
+ switch ( field[1] ) {
+ case 'min':
+ date.setMinutes( val );
+ break;
+ case 'hour':
+ date.setHours( val );
+ break;
+ case 'sec':
+ date.setSeconds( val );
+ break;
+ case 'year':
+ month = date.getMonth();
+ date.setFullYear( val );
+
+ if ( date.getMonth() != month ) {
+ date_calibration();
+ }
+ break;
+ case 'month':
+ date.setMonth( val - 1 );
+
+ if ( date.getMonth() == val ) {
+ date_calibration();
+ }
+ break;
+ case 'day':
+ date.setDate( val );
+ break;
+ }
+
+ obj._setDate( date );
+
+ $ctx.popupwindow( 'close' );
+ });
+
+ $ul.bind( 'click', function ( e ) {
+ if ( $(e.target).is('a') ) {
+ $ul.find(".current").removeClass("current");
+ $(e.target).parent().addClass('current');
+ var val = $(e.target).jqmData("val");
+ $(obj).trigger( 'update', val ); // close popup, unselect field
+ }
+ });
+
+ $div.circularview( 'centerTo', '.current', 500 );
+ $div.bind( 'scrollend' , function ( e ) {
+ if ( !obj._reflow ) {
+ obj._reflow = function () {
+ $div.circularview("reflow");
+ };
+ $(window).bind("resize", obj._reflow);
+ }
+ });
+ }
+ return ui;
+ }
+
+ });
+
+ $(document).bind("pagecreate create", function ( e ) {
+ $($.tizen.datetimepicker.prototype.options.initSelector, e.target)
+ .not(":jqmData(role='none'), :jqmData(role='nojs')")
+ .datetimepicker();
+ });
+
+} ( jQuery, this ) );
+
--- /dev/null
+
+/****************************************************************************
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * ***************************************************************************
+ *
+ * Author: Wongi Lee <wongi11.lee@samsung.com>
+*/
+
+/**
+ * Extendable List Widget for unlimited data.
+ * To support more then 1,000 items, special list widget developed.
+ * Fast initialize and append some element into the DOM tree repeatedly.
+ * DB connection and works like DB cursor.
+ *
+ * HTML Attributes:
+ *
+ * data-role: extendablelist
+ * data-template : jQuery.template ID that populate into extendable list. A button : a <DIV> element with "data-role : button" should be included on data-template.
+ * data-dbtable : DB Table name. It used as window[DB NAME]. Loaded data should be converted as window object.
+ * data-extenditems : Number of elements to extend at once.
+ *
+ * ID : <UL> element that has "data-role=extendablelist" must have ID attribute.
+ * Class : <UL> element that has "data-role=extendablelist" should have "vlLoadSuccess" class to guaranty DB loading is completed.
+ * tmp_load_more : Template ID for "load more" message and button.
+ *
+ *
+ *APIs:
+ * create ( {
+ * itemData: function ( idx ) { return json_obj; },
+ * numItemData: number or function () { return number; },
+ * cacheItemData: function ( minIdx, maxIdx ) {}
+ * } )
+ * : Create a extendable list widget. At this moment, _create method is called.
+ * args : A collection of options
+ * itemData: A function that returns JSON object for given index. Mandatory.
+ * numItemData: Total number of itemData. Mandatory.
+ * cacheItemData: Extendable list will ask itemData between minIdx and maxIdx.
+ * Developers can implement this function for preparing data.
+ * Optional.
+ *
+ *Examples:
+ *
+ * <script id="tmp-3-1-1" type="text/x-jquery-tmpl">
+ * <li class="ui-li-3-1-1"><span class="ui-li-text-main">${NAME}</span></li>
+ * </script>
+ *
+ * <script id="tmp_load_more" type="text/x-jquery-tmpl">
+ * <li class="ui-li-3-1-1" style="text-align:center; margin:0 auto">
+ * <div data-role="button">Load ${NUM_MORE_ITEMS} more items</div>
+ * </li>
+ * </script>
+ *
+ * <ul id = "extendable_list_main" data-role="extendablelist" data-extenditems="50" data-template="tmp-3-1-1">
+ * </ul>
+ *
+ */
+
+/**
+ @class Extendablelist
+ In the Web environment, it is challenging to display a large amount of data in a list, such as displaying a contact list of over 1000 list items. It takes time to display the entire list in HTML and the DOM manipulation is complex.
+ The extendable list widget is used to display a list of unlimited data elements on the screen for better performance. The list is extended if you click the button at the bottom of the list to load more data elements. Extendable lists are based on the jQuery.template plugin as described in the jQuery documentation for jQuery.template plugin.<br/>
+ To add a extendable list widget to the application, use the following code:
+
+ <script id="tmp-3-1-1" type="text/x-jquery-tmpl">
+ <li class="ui-li-3-1-1"><span class="ui-li-text-main">${NAME}</span></li>
+ </script>
+ <script id="tmp_load_more" type="text/x-jquery-tmpl">
+ <li class="ui-li-3-1-1" style="text-align:center; margin:0 auto">
+ <div data-role="button">Load ${NUM_MORE_ITEMS} more items</div>
+ </li>
+ </script>
+ <ul id="extendable_list_main" data-role="extendablelist" data-extenditems="50" data-template="tmp-3-1-1">
+ </ul>
+*/
+/**
+ @property {String} data-role
+ Creates the extendable list view. The value must be set to extendablelist. Only the <ul> element, which a id attribute defined, supports this option. Also, the elLoadSuccess class attribute must be defined in the <ul> element to ensure that loading data from the database is complete.
+*/
+/**
+ @property {String} data-template
+ Specifies the jQuery.template element ID. The jQuery.template must be defined. The template style can use rem units to support scalability. For using the button at the bottom of the list to load more data elements, there must be list view template with the button. The attribute ID must be tmp_load_more.
+*/
+/**
+ @property {Integer} data-extenditems
+ Defines the number of data elements to be extended at a time.
+*/
+( function ( $, undefined ) {
+
+ //Keeps track of the number of lists per page UID
+ //This allows support for multiple nested list in the same page
+ //https://github.com/jquery/jquery-mobile/issues/1617
+ var listCountPerPage = {};
+
+ $.widget( "tizen.extendablelist", $.mobile.widget, {
+ options: {
+ theme: "s",
+ countTheme: "c",
+ headerTheme: "b",
+ dividerTheme: "b",
+ splitIcon: "arrow-r",
+ splitTheme: "b",
+ inset: false,
+ id: "", /* Extendable list UL elemet's ID */
+ extenditems: 50, /* Number of append items */
+ childSelector: " li", /* To support swipe list */
+ dbtable: "",
+ template : "", /* Template for each list item */
+ loadmore : "tmp_load_more", /* Template for "Load more" message */
+ scrollview: false,
+ initSelector: ":jqmData(role='extendablelist')"
+ },
+
+ _stylerMouseUp: function () {
+ $( this ).addClass( "ui-btn-up-s" );
+ $( this ).removeClass( "ui-btn-down-s" );
+ },
+
+ _stylerMouseDown: function () {
+ $( this ).addClass( "ui-btn-down-s" );
+ $( this ).removeClass( "ui-btn-up-s" );
+ },
+
+ _stylerMouseOver: function () {
+ $( this ).toggleClass( "ui-btn-hover-s" );
+ },
+
+ _stylerMouseOut: function () {
+ $( this ).toggleClass( "ui-btn-hover-s" );
+ $( this ).addClass( "ui-btn-up-s" );
+ $( this ).removeClass( "ui-btn-down-s" );
+ },
+
+ _pushData: function ( template ) {
+ var o = this.options,
+ t = this,
+ i = 0,
+ myTemplate = $( "#" + template ),
+ loadMoreItems = ( o.extenditems > t._numItemData - t._lastIndex ? t._numItemData - t.lastIndex : o.extenditems ),
+ htmlData;
+
+ for (i = 0; i < loadMoreItems; i++ ) {
+ htmlData = myTemplate.tmpl( t._itemData( i ) );
+ $( o.id ).append( $( htmlData ).attr( 'id', 'li_' + i ) );
+
+ /* Add style */
+ $( o.id + ">" + o.childSelector )
+ .addClass( "ui-btn-up-s" )
+ .bind( "mouseup", t._stylerMouseUp )
+ .bind( "mousedown", t._stylerMouseDown )
+ .bind( "mouseover", t._stylerMouseOver )
+ .bind( "mouseout", t._stylerMouseOut );
+
+ t._lastIndex += 1;
+ }
+
+ /* After push data, re-style extendable list widget */
+ $( o.id ).trigger( "create" );
+ },
+
+ _loadmore: function ( event ) {
+ var t = event.data, // <li> element
+ o = t.options,
+ i = 0,
+ myTemplate = $( "#" + o.template ),
+ loadMoreItems = ( o.extenditems > t._numItemData - t._lastIndex ? t._numItemData - t._lastIndex : o.extenditems ),
+ htmlData,
+ more_items_to_load,
+ num_next_load_items;
+
+ /* Remove load more message */
+ $( "#load_more_message" ).remove();
+
+ /* Append More Items */
+ for ( i = 0; i < loadMoreItems; i++ ) {
+ htmlData = myTemplate.tmpl( t._itemData( t._lastIndex ) );
+ $( o.id ).append( $( htmlData ).attr( 'id', 'li_' + t._lastIndex ) );
+ t._lastIndex += 1;
+ }
+
+ /* Append "Load more" message on the last of list */
+ if ( t._numItemData > t._lastIndex ) {
+ myTemplate = $( "#" + o.loadmore );
+ more_items_to_load = t._numItemData - t._lastIndex;
+ num_next_load_items = ( o.extenditems <= more_items_to_load ) ? o.extenditems : more_items_to_load;
+ htmlData = myTemplate.tmpl( { NUM_MORE_ITEMS : num_next_load_items } );
+ // Button minimum height(37px)
+ $( o.id ).append( $( htmlData ).attr( 'id', "load_more_message" ).css( 'min-height' , "37px") );
+ }
+
+ $( o.id ).trigger( "create" );
+ $( o.id ).extendablelist( "refresh" );
+ },
+
+ recreate: function ( newArray ) {
+ this._create( {
+ itemData: function ( idx ) { return newArray[ idx ]; },
+ numItemData: newArray.length
+ } );
+ },
+
+ _initList: function (args ) {
+ var t = this,
+ o = this.options,
+ myTemplate,
+ more_items_to_load,
+ num_next_load_items,
+ htmlData;
+
+ /* Make Gen list by template */
+ if ( t._lastIndex <= 0 ) {
+ t._pushData( o.template );
+
+ /* Append "Load more" message on the last of list */
+ if ( t._numItemData > t._lastIndex ) {
+ myTemplate = $( "#" + o.loadmore );
+ more_items_to_load = t._numItemData - t._lastIndex;
+ num_next_load_items = ( o.extenditems <= more_items_to_load) ? o.extenditems : more_items_to_load;
+ htmlData = myTemplate.tmpl( { NUM_MORE_ITEMS : num_next_load_items } );
+ // Button minimum height(37px)
+ $( o.id ).append( $( htmlData ).attr( 'id', "load_more_message" ).css( 'min-height' , "37px") );
+
+ $( "#load_more_message" ).live( "click", t, t._loadmore );
+ } else {
+ /* No more items to load */
+ $( "#load_more_message" ).die();
+ $( "#load_more_message" ).remove();
+ }
+ }
+
+ if ( o.childSelector == " ul" ) {
+ $( o.id + " ul" ).swipelist();
+ }
+
+ $( o.id ).trigger( "create" );
+
+ t.refresh( true );
+ },
+
+ create: function () {
+ var o = this.options;
+
+ /* external API for AJAX callback */
+ this._create.apply( this, arguments );
+ },
+
+ _create: function ( args ) {
+ var t = this,
+ o = this.options,
+ $el = this.element,
+ dbtable_name;
+
+
+ t.destroy();
+
+ $.extend(this, {
+ _itemData: function ( idx ) { return null; },
+ _numItemData: 0,
+ _cacheItemData: function ( minIdx, maxIdx ) { },
+ _lastIndex: 0
+ });
+
+
+ // create listview markup
+ t.element.addClass( function ( i, orig ) {
+ return orig + " ui-listview ui-extendable-list-container" + ( t.options.inset ? " ui-listview-inset ui-corner-all ui-shadow " : "" );
+ });
+
+ o.id = "#" + $el.attr( "id" );
+
+ if ( $el.data( "extenditems" ) ) {
+ o.extenditems = parseInt( $el.data( "extenditems" ), 10 );
+ }
+
+ $( o.id ).bind( "pagehide", function (e) {
+ $( o.id ).empty();
+ });
+
+ /* Scroll view */
+ if ( $( ".ui-scrollview-clip" ).size() > 0) {
+ o.scrollview = true;
+ } else {
+ o.scrollview = false;
+ }
+
+ if ( args ) {
+ if ( !t._loadData( args ) ) {
+ return;
+ }
+ } else {
+ // Legacy support: dbtable
+ console.warn("WARNING: The data interface of extendable list is changed. \nOld data interface(data-dbtable) is still supported, but will be removed in next version. \nPlease fix your code soon!");
+
+ if ( $( o.id ).hasClass( "elLoadSuccess" ) ) {
+ dbtable_name = $el.jqmData('dbtable');
+ o.dbtable = window[ dbtable_name ];
+ if ( !(o.dbtable) ) {
+ o.dbtable = { };
+ }
+ t._itemData = function ( idx ) {
+ return o.dbtable[ idx ];
+ };
+ t._numItemData = o.dbtable.length;
+
+ } else {
+ console.warn("No elLoadSuccess class");
+ return;
+ }
+ }
+
+ if ( $el.data( "template" ) ) {
+ o.template = $el.data( "template" );
+
+ /* to support swipe list, <li> or <ul> can be main node of extendable list. */
+ if ( $el.data( "swipelist" ) == true ) {
+ o.childSelector = " ul";
+ } else {
+ o.shildSelector = " li";
+ }
+ }
+ t._initList( args );
+ },
+
+ _loadData : function ( args ) {
+ var self = this;
+
+ if ( args.itemData && typeof args.itemData == 'function' ) {
+ self._itemData = args.itemData;
+ } else {
+ return false;
+ }
+ if ( args.numItemData ) {
+ if ( typeof args.numItemData == 'function' ) {
+ self._numItemData = args.numItemData( );
+ } else if ( typeof args.numItemData == 'number' ) {
+ self._numItemData = args.numItemData;
+ } else {
+ return false;
+ }
+ } else {
+ return false;
+ }
+ return true;
+ },
+
+
+ destroy : function () {
+ var o = this.options,
+ eOTAL_ITEMS = 0,
+ last_index = 0;
+
+ $( o.id ).empty();
+
+ $( "#load_more_message" ).die();
+ },
+
+ _itemApply: function ( $list, item ) {
+ var $countli = item.find( ".ui-li-count" );
+
+ if ( $countli.length ) {
+ item.addClass( "ui-li-has-count" );
+ }
+
+ $countli.addClass( "ui-btn-up-" + ( $list.jqmData( "counttheme" ) || this.options.countTheme ) + " ui-btn-corner-all" );
+
+ // TODO class has to be defined in markup
+ item.find( "h1, h2, h3, h4, h5, h6" ).addClass( "ui-li-heading" ).end()
+ .find( "p, dl" ).addClass( "ui-li-desc" ).end()
+ .find( ">img:eq(0), .ui-link-inherit>img:eq(0)" ).addClass( "ui-li-thumb" ).each(function () {
+ item.addClass( $( this ).is( ".ui-li-icon" ) ? "ui-li-has-icon" : "ui-li-has-thumb" );
+ }).end()
+ .find( ".ui-li-aside" ).each(function () {
+ var $this = $( this );
+ $this.prependTo( $this.parent() ); //shift aside to front for css float
+ });
+ },
+
+ _removeCorners: function ( li, which ) {
+ var top = "ui-corner-top ui-corner-tr ui-corner-tl",
+ bot = "ui-corner-bottom ui-corner-br ui-corner-bl";
+
+ li = li.add( li.find( ".ui-btn-inner, .ui-li-link-alt, .ui-li-thumb" ) );
+
+ if ( which === "top" ) {
+ li.removeClass( top );
+ } else if ( which === "bottom" ) {
+ li.removeClass( bot );
+ } else {
+ li.removeClass( top + " " + bot );
+ }
+ },
+
+ _refreshCorners: function ( create ) {
+ var $li,
+ $visibleli,
+ $topli,
+ $bottomli;
+
+ if ( this.options.inset ) {
+ $li = this.element.children( "li" );
+ // at create time the li are not visible yet so we need to rely on .ui-screen-hidden
+ $visibleli = create ? $li.not( ".ui-screen-hidden" ) : $li.filter( ":visible" );
+
+ this._removeCorners( $li );
+
+ // Select the first visible li element
+ $topli = $visibleli.first()
+ .addClass( "ui-corner-top" );
+
+ $topli.add( $topli.find( ".ui-btn-inner" ) )
+ .find( ".ui-li-link-alt" )
+ .addClass( "ui-corner-tr" )
+ .end()
+ .find( ".ui-li-thumb" )
+ .not( ".ui-li-icon" )
+ .addClass( "ui-corner-tl" );
+
+ // Select the last visible li element
+ $bottomli = $visibleli.last()
+ .addClass( "ui-corner-bottom" );
+
+ $bottomli.add( $bottomli.find( ".ui-btn-inner" ) )
+ .find( ".ui-li-link-alt" )
+ .addClass( "ui-corner-br" )
+ .end()
+ .find( ".ui-li-thumb" )
+ .not( ".ui-li-icon" )
+ .addClass( "ui-corner-bl" );
+ }
+ },
+
+ refresh: function ( create ) {
+ this.parentPage = this.element.closest( ".ui-page" );
+ this._createSubPages();
+
+ var o = this.options,
+ $list = this.element,
+ self = this,
+ dividertheme = $list.jqmData( "dividertheme" ) || o.dividerTheme,
+ listsplittheme = $list.jqmData( "splittheme" ),
+ listspliticon = $list.jqmData( "spliticon" ),
+ li = $list.children( "li" ),
+ counter = $.support.cssPseudoElement || !$.nodeName( $list[ 0 ], "ol" ) ? 0 : 1,
+ item,
+ itemClass,
+ itemTheme,
+ a,
+ last,
+ splittheme,
+ countParent,
+ icon,
+ pos,
+ numli;
+
+ if ( counter ) {
+ $list.find( ".ui-li-dec" ).remove();
+ }
+
+ for ( pos = 0, numli = li.length; pos < numli; pos++ ) {
+ item = li.eq( pos );
+ itemClass = "ui-li";
+
+ // If we're creating the element, we update it regardless
+ if ( create || !item.hasClass( "ui-li" ) ) {
+ itemTheme = item.jqmData( "theme" ) || o.theme;
+ a = item.children( "a" );
+
+ if ( a.length ) {
+ icon = item.jqmData( "icon" );
+
+ item.buttonMarkup({
+ wrapperEls: "div",
+ shadow: false,
+ corners: false,
+ iconpos: "right",
+ /* icon: a.length > 1 || icon === false ? false : icon || "arrow-r",*/
+ icon: false, /* Remove unnecessary arrow icon */
+ theme: itemTheme
+ });
+
+ if ( ( icon != false ) && ( a.length == 1 ) ) {
+ item.addClass( "ui-li-has-arrow" );
+ }
+
+ a.first().addClass( "ui-link-inherit" );
+
+ if ( a.length > 1 ) {
+ itemClass += " ui-li-has-alt";
+
+ last = a.last();
+ splittheme = listsplittheme || last.jqmData( "theme" ) || o.splitTheme;
+
+ last.appendTo(item)
+ .attr( "title", last.getEncodedText() )
+ .addClass( "ui-li-link-alt" )
+ .empty()
+ .buttonMarkup({
+ shadow: false,
+ corners: false,
+ theme: itemTheme,
+ icon: false,
+ iconpos: false
+ })
+ .find( ".ui-btn-inner" )
+ .append(
+ $( "<span />" ).buttonMarkup( {
+ shadow : true,
+ corners : true,
+ theme : splittheme,
+ iconpos : "notext",
+ icon : listspliticon || last.jqmData( "icon" ) || o.splitIcon
+ })
+ );
+ }
+ } else if ( item.jqmData( "role" ) === "list-divider" ) {
+
+ itemClass += " ui-li-divider ui-btn ui-bar-" + dividertheme;
+ item.attr( "role", "heading" );
+
+ //reset counter when a divider heading is encountered
+ if ( counter ) {
+ counter = 1;
+ }
+
+ } else {
+ itemClass += " ui-li-static ui-body-" + itemTheme;
+ }
+ }
+
+ if ( counter && itemClass.indexOf( "ui-li-divider" ) < 0 ) {
+ countParent = item.is( ".ui-li-static:first" ) ? item : item.find( ".ui-link-inherit" );
+
+ countParent.addClass( "ui-li-jsnumbering" )
+ .prepend( "<span class='ui-li-dec'>" + (counter++) + ". </span>" );
+ }
+
+ item.add( item.children( ".ui-btn-inner" ) ).addClass( itemClass );
+
+ self._itemApply( $list, item );
+ }
+
+ this._refreshCorners( create );
+ },
+
+ //create a string for ID/subpage url creation
+ _idStringEscape: function ( str ) {
+ return str.replace(/\W/g , "-");
+
+ },
+
+ _createSubPages: function () {
+ var parentList = this.element,
+ parentPage = parentList.closest( ".ui-page" ),
+ parentUrl = parentPage.jqmData( "url" ),
+ parentId = parentUrl || parentPage[ 0 ][ $.expando ],
+ parentListId = parentList.attr( "id" ),
+ o = this.options,
+ dns = "data-" + $.mobile.ns,
+ self = this,
+ persistentFooterID = parentPage.find( ":jqmData(role='footer')" ).jqmData( "id" ),
+ hasSubPages,
+ newRemove;
+
+ if ( typeof listCountPerPage[ parentId ] === "undefined" ) {
+ listCountPerPage[ parentId ] = -1;
+ }
+
+ parentListId = parentListId || ++listCountPerPage[ parentId ];
+
+ $( parentList.find( "li>ul, li>ol" ).toArray().reverse() ).each(function ( i ) {
+ var self = this,
+ list = $( this ),
+ listId = list.attr( "id" ) || parentListId + "-" + i,
+ parent = list.parent(),
+ nodeEls,
+ title = nodeEls.first().getEncodedText(),//url limits to first 30 chars of text
+ id = ( parentUrl || "" ) + "&" + $.mobile.subPageUrlKey + "=" + listId,
+ theme = list.jqmData( "theme" ) || o.theme,
+ countTheme = list.jqmData( "counttheme" ) || parentList.jqmData( "counttheme" ) || o.countTheme,
+ newPage,
+ anchor;
+
+ nodeEls = $( list.prevAll().toArray().reverse() );
+ nodeEls = nodeEls.length ? nodeEls : $( "<span>" + $.trim(parent.contents()[ 0 ].nodeValue) + "</span>" );
+
+ //define hasSubPages for use in later removal
+ hasSubPages = true;
+
+ newPage = list.detach()
+ .wrap( "<div " + dns + "role='page' " + dns + "url='" + id + "' " + dns + "theme='" + theme + "' " + dns + "count-theme='" + countTheme + "'><div " + dns + "role='content'></div></div>" )
+ .parent()
+ .before( "<div " + dns + "role='header' " + dns + "theme='" + o.headerTheme + "'><div class='ui-title'>" + title + "</div></div>" )
+ .after( persistentFooterID ? $( "<div " + dns + "role='footer' " + dns + "id='" + persistentFooterID + "'>" ) : "" )
+ .parent()
+ .appendTo( $.mobile.pageContainer );
+
+ newPage.page();
+
+ anchor = parent.find('a:first');
+
+ if ( !anchor.length ) {
+ anchor = $( "<a/>" ).html( nodeEls || title ).prependTo( parent.empty() );
+ }
+
+ anchor.attr( "href", "#" + id );
+
+ }).extendablelist();
+
+ // on pagehide, remove any nested pages along with the parent page, as long as they aren't active
+ // and aren't embedded
+ if ( hasSubPages &&
+ parentPage.is( ":jqmData(external-page='true')" ) &&
+ parentPage.data( "page" ).options.domCache === false ) {
+
+ newRemove = function ( e, ui ) {
+ var nextPage = ui.nextPage, npURL;
+
+ if ( ui.nextPage ) {
+ npURL = nextPage.jqmData( "url" );
+ if ( npURL.indexOf( parentUrl + "&" + $.mobile.subPageUrlKey ) !== 0 ) {
+ self.childPages().remove();
+ parentPage.remove();
+ }
+ }
+ };
+
+ // unbind the original page remove and replace with our specialized version
+ parentPage
+ .unbind( "pagehide.remove" )
+ .bind( "pagehide.remove", newRemove);
+ }
+ },
+
+ // TODO sort out a better way to track sub pages of the extendable listview this is brittle
+ childPages: function () {
+ var parentUrl = this.parentPage.jqmData( "url" );
+
+ return $( ":jqmData(url^='" + parentUrl + "&" + $.mobile.subPageUrlKey + "')" );
+ }
+ });
+
+ //auto self-init widgets
+ $( document ).bind( "pagecreate create", function ( e ) {
+ $( $.tizen.extendablelist.prototype.options.initSelector, e.target ).extendablelist();
+ });
+
+}( jQuery ));
+
--- /dev/null
+
+/*
+ * jQuery Mobile Widget @VERSION
+ *
+ * This software is licensed under the MIT licence (as defined by the OSI at
+ * http://www.opensource.org/licenses/mit-license.php)
+ *
+ * ***************************************************************************
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2011 by Intel Corporation Ltd.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * ***************************************************************************
+ *
+ * Authors: Elliot Smith <elliot.smith@intel.com>
+ * Yonghwi Park <yonghwi0324.park@samsung.com>
+ */
+
+// fastscroll is a scrollview controller, which binds
+// a scrollview to a a list of short cuts; the shortcuts are built
+// from the text on dividers in the list. Clicking on a shortcut
+// instantaneously jumps the scrollview to the selected list divider;
+// mouse movements on the shortcut column move the scrollview to the
+// list divider matching the text currently under the touch; a popup
+// with the text currently under the touch is also displayed.
+//
+// To apply, add the attribute data-fastscroll="true" to a listview
+// (a <ul> or <ol> element inside a page). Alternatively, call
+// fastscroll() on an element.
+//
+// The closest element with class ui-scrollview-clip is used as the
+// scrollview to be controlled.
+//
+// If a listview has no dividers or a single divider, the widget won't
+// display.
+
+/**
+ @class fastscroll
+ The shortcut scroll widget shows a shortcut list that is bound to its parent scroll bar and respective list view. This widget is displayed as a text pop-up representing shortcuts to different list dividers in the list view. If you select a shortcut text from the shortcut scroll, the parent list view is moved to the location representing the selected shortcut.
+
+ To add a shortcut scroll widget to the application, use the following code:
+
+ <div class="content" data-role="content" data-scroll="y">
+ <ul id="contacts" data-role="listview" data-fastscroll="true">
+ <li>Anton</li>
+ </ul>
+ </div>
+
+ For the shortcut scroll widget to be visible, the parent list view must have multiple list dividers.
+*/
+
+/**
+ @property {Boolean} data-fastscroll
+ When set to true, creates a shortcut scroll using the HTML unordered list (<ul>) element.
+*/
+/**
+ @method fastscroll
+ The shortcut scroll is created for the closest list view with the ui-scrollview-clip class.
+*/
+/**
+ @method indexString
+ The indexString method is used to get (if no value is defined) or set the string to present the index.
+
+ <div class="content" data-role="content" data-scroll="y">
+ ul id="contacts" data-role="listview" data-fastscroll="true">
+ <li data-role="list-divider">A</li>
+ <li>Anton</li>
+ </ul>
+ </div>
+
+ $(".selector").fastscroll( "indexString" [, indexAlphabet] );
+*/
+(function ( $, undefined ) {
+
+ $.widget( "tizen.fastscroll", $.mobile.widget, {
+ options: {
+ initSelector: ":jqmData(fastscroll)",
+ },
+
+ _primaryLanguage: null,
+ _secondLanguage: null,
+
+ _create: function () {
+ var $el = this.element,
+ self = this,
+ $popup,
+ page = $el.closest( ':jqmData(role="page")' ),
+ jumpToDivider;
+
+ this.scrollview = $el.closest( '.ui-scrollview-clip' );
+ this.shortcutsContainer = $( '<div class="ui-fastscroll" aria-label="Fast scroll bar, double tap to fast scroll mode" tabindex="0"/>' );
+ this.shortcutsList = $( '<ul aria-hidden="true"></ul>' );
+
+ // popup for the hovering character
+ this.scrollview.append($( '<div class="ui-fastscroll-popup"></div>' ) );
+ $popup = this.scrollview.find( '.ui-fastscroll-popup' );
+
+ this.shortcutsContainer.append( this.shortcutsList );
+ this.scrollview.append( this.shortcutsContainer );
+
+ // find the bottom of the last item in the listview
+ this.lastListItem = $el.children().last();
+
+ // remove scrollbars from scrollview
+ this.scrollview.find( '.ui-scrollbar' ).hide();
+
+ this.jumpToDivider = function ( divider ) {
+ // get the vertical position of the divider (so we can scroll to it)
+ var dividerY = $( divider ).position().top,
+ // find the bottom of the last list item
+ bottomOffset = self.lastListItem.outerHeight( true ) + self.lastListItem.position().top,
+ scrollviewHeight = self.scrollview.height(),
+
+ // check that after the candidate scroll, the bottom of the
+ // last item will still be at the bottom of the scroll view
+ // and not some way up the page
+ maxScroll = bottomOffset - scrollviewHeight,
+ dstOffset;
+
+ dividerY = ( dividerY > maxScroll ? maxScroll : dividerY );
+
+ // don't apply a negative scroll, as this means the
+ // divider should already be visible
+ dividerY = Math.max( dividerY, 0 );
+
+ // apply the scroll
+ self.scrollview.scrollview( 'scrollTo', 0, -dividerY );
+
+ dstOffset = self.scrollview.offset();
+ };
+
+ this.shortcutsList
+ // bind mouse over so it moves the scroller to the divider
+ .bind( 'touchstart mousedown vmousedown touchmove vmousemove vmouseover', function ( e ) {
+ // Get coords relative to the element
+ var coords = $.mobile.tizen.targetRelativeCoordsFromEvent( e ),
+ shortcutsListOffset = self.shortcutsList.offset();
+
+ // If the element is a list item, get coordinates relative to the shortcuts list
+ if ( e.target.tagName.toLowerCase() === "li" ) {
+ coords.x += $( e.target ).offset().left - shortcutsListOffset.left;
+ coords.y += $( e.target ).offset().top - shortcutsListOffset.top;
+ }
+
+ if ( e.target.tagName.toLowerCase() === "span" ) {
+ coords.x += $( e.target ).parent().offset().left - shortcutsListOffset.left;
+ coords.y += $( e.target ).parent().offset().top - shortcutsListOffset.top;
+ }
+
+ self.shortcutsList.find( 'li' ).each( function () {
+ var listItem = $( this );
+ $( listItem )
+ .removeClass( "ui-fastscroll-hover" )
+ .removeClass( "ui-fastscroll-hover-up" )
+ .removeClass( "ui-fastscroll-hover-down" );
+ });
+ // Hit test each list item
+ self.shortcutsList.find( 'li' ).each( function () {
+ var listItem = $( this ),
+ l = listItem.offset().left - shortcutsListOffset.left,
+ t = listItem.offset().top - shortcutsListOffset.top,
+ r = l + Math.abs(listItem.outerWidth( true ) ),
+ b = t + Math.abs(listItem.outerHeight( true ) );
+
+ if ( coords.x >= l && coords.x <= r && coords.y >= t && coords.y <= b ) {
+ self._hitItem( listItem );
+ return false;
+ }
+ return true;
+ } );
+
+ e.preventDefault();
+ e.stopPropagation();
+ } )
+ // bind mouseout of the fastscroll container to remove popup
+ .bind( 'touchend mouseup vmouseup vmouseout', function () {
+ $popup.hide();
+ $( ".ui-fastscroll-hover" ).removeClass( "ui-fastscroll-hover" );
+ $( ".ui-fastscroll-hover-first-item" ).removeClass( "ui-fastscroll-hover-first-item" );
+ $( ".ui-fastscroll-hover-up" ).removeClass( "ui-fastscroll-hover-up" );
+ $( ".ui-fastscroll-hover-down" ).removeClass( "ui-fastscroll-hover-down" );
+ } );
+
+ if ( page && !( page.is( ':visible' ) ) ) {
+ page.bind( 'pageshow', function () { self.refresh(); } );
+ } else {
+ self.refresh();
+ }
+
+ // refresh the list when dividers are filtered out
+ $el.bind( 'updatelayout', function () {
+ self.refresh();
+ } );
+
+ $( window ).unbind( ".fastscroll" ).bind( "resize.fastscroll", function ( e ) {
+ self.refresh();
+ } );
+ },
+
+ _hitItem: function ( listItem ) {
+ var self = this,
+ $popup = self.scrollview.find( '.ui-fastscroll-popup' );
+
+ if ( typeof listItem.data( 'divider' ) !== "undefined" ) {
+ self.jumpToDivider( $( listItem.data( 'divider' ) ) );
+ }
+
+ if ( listItem.text() !== "." ) {
+ $popup.text( listItem.text() )
+ .css( { marginLeft: -( $popup.width() / 2 ),
+ marginTop: -( $popup.height() / 2 ),
+ padding: $popup.css( "paddingTop" ) } )
+ .width( $popup.height() )
+ .show();
+ } else {
+ $popup.hide();
+ }
+
+ $( listItem ).addClass( "ui-fastscroll-hover" );
+ if ( listItem.index() === 0 ) {
+ $( listItem ).addClass( "ui-fastscroll-hover-first-item" );
+ }
+ if ( listItem.index() > 0 ) {
+ $( listItem ).siblings().eq( listItem.index() - 1 ).addClass( "ui-fastscroll-hover-up" );
+ }
+ $( listItem ).siblings().eq( listItem.index() ).addClass( "ui-fastscroll-hover-down" );
+ },
+
+ _focusItem: function ( listItem ) {
+ var self = this,
+ $popup = self.scrollview.find( '.ui-fastscroll-popup' );
+
+ listItem.focusin( function ( e ) {
+ self._hitItem( listItem );
+ }).focusout( function ( e ) {
+ $popup.hide();
+ $( ".ui-fastscroll-hover" ).removeClass( "ui-fastscroll-hover" );
+ $( ".ui-fastscroll-hover-first-item" ).removeClass( "ui-fastscroll-hover-first-item" );
+ $( ".ui-fastscroll-hover-up" ).removeClass( "ui-fastscroll-hover-up" );
+ $( ".ui-fastscroll-hover-down" ).removeClass( "ui-fastscroll-hover-down" );
+ });
+ },
+
+ _contentHeight: function () {
+ var self = this,
+ $content = $( '.ui-scrollview-clip' ),
+ header = null,
+ footer = null,
+ paddingValue = 0,
+ clipSize = $( window ).height();
+
+ if ( $content.hasClass( "ui-content" ) ) {
+ paddingValue = parseInt( $content.css( "padding-top" ), 10 );
+ clipSize = clipSize - ( paddingValue || 0 );
+ paddingValue = parseInt( $content.css( "padding-bottom" ), 10 );
+ clipSize = clipSize - ( paddingValue || 0 );
+ header = $content.siblings( ".ui-header:visible" );
+ footer = $content.siblings( ".ui-footer:visible" );
+
+ if ( header ) {
+ if ( header.outerHeight( true ) === null ) {
+ clipSize = clipSize - ( $( ".ui-header" ).outerHeight() || 0 );
+ } else {
+ clipSize = clipSize - header.outerHeight( true );
+ }
+ }
+ if ( footer ) {
+ clipSize = clipSize - footer.outerHeight( true );
+ }
+ } else {
+ clipSize = $content.height();
+ }
+ return clipSize;
+ },
+
+ _omit: function ( numOfItems, maxNumOfItems ) {
+ var maxGroupNum = parseInt( ( maxNumOfItems - 1 ) / 2, 10 ),
+ numOfExtraItems = numOfItems - maxNumOfItems,
+ groupPos = [],
+ omitInfo = [],
+ groupPosLength,
+ group,
+ size,
+ i;
+
+ if ( ( maxNumOfItems < 3 ) || ( numOfItems <= maxNumOfItems ) ) {
+ return;
+ }
+
+ if ( numOfExtraItems >= maxGroupNum ) {
+ size = 2;
+ group = 1;
+ groupPosLength = maxGroupNum;
+ } else {
+ size = maxNumOfItems / ( numOfExtraItems + 1 );
+ group = size;
+ groupPosLength = numOfExtraItems;
+ }
+
+ for ( i = 0; i < groupPosLength; i++ ) {
+ groupPos.push( parseInt( group, 10 ) );
+ group += size;
+ }
+
+ for ( i = 0; i < maxNumOfItems; i++ ) {
+ omitInfo.push( 1 );
+ }
+
+ for ( i = 0; i < numOfExtraItems; i++ ) {
+ omitInfo[ groupPos[ i % maxGroupNum ] ]++;
+ }
+
+ return omitInfo;
+ },
+
+ indexString: function ( indexAlphabet ) {
+ var self = this,
+ characterSet = [];
+
+ if ( typeof indexAlphabet === " undefined" ) {
+ return self._primaryLanguage + ":" + self._secondLanguage;
+ }
+
+ characterSet = indexAlphabet.split( ":" );
+ self._primaryLanguage = characterSet[ 0 ];
+ if ( characterSet.length === 2 ) {
+ self._secondLanguage = characterSet[ 1 ];
+ }
+ },
+
+ refresh: function () {
+ var self = this,
+ primaryCharacterSet = self._primaryLanguage ? self._primaryLanguage.replace( /,/g, "" ) : null,
+ secondCharacterSet = self._secondLanguage ? self._secondLanguage.replace( /,/g, "" ) : null,
+ contentHeight = self._contentHeight(),
+ shapItem = $( '<li tabindex="0" aria-label="double to move Number list"><span aria-hidden="true">#</span><span aria-label="Number"/></li>' ),
+ omitIndex = 0,
+ matchToDivider,
+ containerHeight,
+ shortcutsItems,
+ shortcutItem,
+ shortcutsTop,
+ minClipHeight,
+ maxNumOfItems,
+ numOfItems,
+ minHeight,
+ padding,
+ omitInfo,
+ dividers,
+ listItems,
+ emptySize,
+ correction,
+ indexChar,
+ lastIndex,
+ seconds,
+ height,
+ size,
+ i;
+
+ matchToDivider = function ( index, divider ) {
+ if ( $( divider ).text() === indexChar ) {
+ shortcutItem.data( 'divider', divider )
+ .bind( 'vclick', function ( e ) {
+ $( divider ).next().focus();
+ } );
+ }
+ };
+
+ self.shortcutsList.find( 'li' ).remove();
+
+ // get all the dividers from the list and turn them into shortcuts
+ dividers = self.element.find( '.ui-li-divider' );
+
+ // get all the list items
+ listItems = self.element.find('li').not('.ui-li-divider');
+
+ // only use visible dividers
+ dividers = dividers.filter( ':visible' );
+ listItems = listItems.filter( ':visible' );
+
+ if ( dividers.length < 2 ) {
+ self.shortcutsList.hide();
+ return;
+ }
+
+ self.shortcutsList.show();
+ self.lastListItem = listItems.last();
+ self.shortcutsList.append( shapItem );
+ self._focusItem( shapItem );
+
+ if ( primaryCharacterSet !== null ) {
+ padding = parseInt( shapItem.css( "padding" ), 10 );
+ minHeight = shapItem.height() + ( padding * 2 );
+ maxNumOfItems = parseInt( ( contentHeight / minHeight ) - 1, 10 );
+ numOfItems = primaryCharacterSet.length;
+
+ maxNumOfItems = secondCharacterSet ? maxNumOfItems - 2 : maxNumOfItems;
+
+ if ( maxNumOfItems < 3 ) {
+ shapItem.remove();
+ return;
+ }
+
+ omitInfo = self._omit( numOfItems, maxNumOfItems );
+
+ for ( i = 0; i < primaryCharacterSet.length; i++ ) {
+ indexChar = primaryCharacterSet.charAt( i );
+ shortcutItem = $( '<li tabindex="0" aria-label="double to move ' + indexChar + ' list">' + indexChar + '</li>' );
+
+ self._focusItem( shortcutItem );
+ dividers.each( matchToDivider );
+
+ if ( typeof omitInfo !== "undefined" && omitInfo[ omitIndex ] > 1 ) {
+ shortcutItem = $( '<li>.</li>' );
+ i += omitInfo[ omitIndex ] - 1;
+ }
+
+ shapItem.before( shortcutItem );
+ omitIndex++;
+ }
+
+ if ( secondCharacterSet !== null ) {
+ lastIndex = secondCharacterSet.length - 1;
+ seconds = [];
+
+ seconds.push( secondCharacterSet.charAt( 0 ) );
+ seconds.push( secondCharacterSet.charAt( lastIndex ) );
+
+ for ( i = 0; i < seconds.length; i++ ) {
+ indexChar = seconds[ i ];
+ shortcutItem = $( '<li tabindex="0" aria-label="double to move ' + indexChar + ' list">' + indexChar + '</li>' );
+
+ self._focusItem( shortcutItem );
+ dividers.each( matchToDivider );
+
+ shapItem.before( shortcutItem );
+ }
+ }
+ } else {
+ dividers.each( function ( index, divider ) {
+ indexChar = $( divider ).text();
+ shortcutItem = $( '<li tabindex="0" aria-label="double to move ' + indexChar + ' list">' + indexChar + '</li>' );
+
+ shortcutItem.data( 'divider', divider );
+ self._focusItem( shortcutItem );
+ shapItem.before( shortcutItem );
+ } );
+ }
+
+ containerHeight = self.shortcutsContainer.outerHeight();
+ emptySize = contentHeight - containerHeight;
+ shortcutsItems = self.shortcutsList.children();
+ size = parseInt( emptySize / shortcutsItems.length, 10 );
+ correction = emptySize - ( shortcutsItems.length * size );
+
+ if ( emptySize > 0 ) {
+ shortcutsItems.each( function ( index, item ) {
+ height = $( item ).height() + size;
+ if ( correction !== 0 ) {
+ height += 1;
+ correction -= 1;
+ }
+ $( item ).css( {
+ height: height,
+ lineHeight: height + "px"
+ } );
+ } );
+ }
+
+ // position the shortcut flush with the top of the first list divider
+ shortcutsTop = dividers.first().position().top;
+ self.shortcutsContainer.css( 'top', shortcutsTop );
+
+ // make the scrollview clip tall enough to show the whole of the shortcutslist
+ minClipHeight = shortcutsTop + self.shortcutsContainer.outerHeight() + 'px';
+ self.scrollview.css( 'min-height', minClipHeight );
+ }
+ } );
+
+ $( document ).bind( "pagecreate create", function ( e ) {
+ $( $.tizen.fastscroll.prototype.options.initSelector, e.target )
+ .not( ":jqmData(role='none'), :jqmData(role='nojs')" )
+ .fastscroll();
+ } );
+
+} ( jQuery ) );
+
--- /dev/null
+
+/* ***************************************************************************
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * ***************************************************************************
+ *
+ * Author: Minkyu Kang <mk7.kang@samsung.com>
+ */
+
+/*
+ * Gallery widget
+ *
+ * HTML Attributes
+ *
+ * data-role: set to 'gallery'
+ * data-index: start index
+ * data-vertical-align: set to top or middle or bottom.
+ *
+ * APIs
+ *
+ * add(file): add the image (parameter: url of iamge)
+ * remove(index): remove the image (parameter: index of image)
+ * refresh(index): refresh the widget, should be called after add or remove. (parameter: start index)
+ * empty: remove all of images from the gallery
+ * length: get length of images
+ * value(index): get or set current index of gallery (parameter: index of image)
+ *
+ * Events
+ *
+ * N/A
+ *
+ * Example
+ *
+ * <div data-role="gallery" id="gallery" data-index="3" data-vertical-align="middle">
+ * <img src="01.jpg">
+ * <img src="02.jpg">
+ * <img src="03.jpg">
+ * <img src="04.jpg">
+ * <img src="05.jpg">
+ * </div>
+ *
+ *
+ * $('#gallery-add').bind('vmouseup', function ( e ) {
+ * $('#gallery').gallery('add', '9.jpg');
+ * $('#gallery').gallery('add', '10.jpg');
+ * $('#gallery').gallery('refresh');
+ * });
+ *
+ * $('#gallery-del').bind('vmouseup', function ( e ) {
+ * $('#gallery').gallery('remove');
+ * });
+ *
+ */
+
+ /**
+ @class Gallery
+ The gallery widget shows images in a gallery on the screen. <br/><br/> To add an gallery widget to the application, use the following code:
+
+ <div data-role="gallery" id="gallery" data-vertical-align="middle" data-index="3">
+ <img src="01.jpg">
+ <img src="02.jpg">
+ <img src="03.jpg">
+ <img src="04.jpg">
+ <img src="05.jpg">
+ </div>
+*/
+/**
+ @property {Integer} data-index
+ Defines the index number of the first image in the gallery.
+ <br/>The default value is 0.
+*/
+/**
+ @property {String} data-vertical-align
+ Defines the image alignment. The alignment options are top, middle, and bottom.
+ <br/>The default value is top.
+*/
+/**
+ @method add
+ The add method is used to add an image to the gallery. The image_file attribute defines the image file URL.
+
+ <div id="gallery" data-role="gallery" data-vertical-align="middle"></div>
+ $("#gallery").gallery('add', [image_file]);
+*/
+/**
+ @method remove
+ The remove method is used to delete an image from the gallery. The image_index attribute defines the index of the image to be deleted. If not set removes current image.
+
+ <div id="gallery" data-role="gallery" data-vertical-align="middle"></div>
+ $("#gallery").gallery('remove', [image_index]);
+*/
+/**
+ @method refresh
+ The refresh method is used to refresh the gallery. This method must be called after adding images to the gallery.
+
+ <div id="gallery" data-role="gallery" data-vertical-align="middle"></div>
+ $("#gallery").gallery('refresh');
+*/
+/**
+ @method empty
+ The empty method is used to remove all of images from the gallery.
+
+ <div id="gallery" data-role="gallery" data-vertical-align="middle"></div>
+ $("#gallery").gallery('empty');
+*/
+/**
+ @method length
+ The length method is used to get length of images.
+
+ <div id="gallery" data-role="gallery" data-vertical-align="middle"></div>
+ length = $("#gallery").gallery('length');
+*/
+/**
+ @method value
+ The value method is used to get or set current index of gallery. The image_index attribute defines the index of the image to be set. If not get current index.
+
+ <div id="gallery" data-role="gallery" data-vertical-align="middle"></div>
+ value = $("#gallery").gallery('value');
+ $("#gallery").gallery('value', [image_index]);
+*/
+(function ( $, window, undefined ) {
+ $.widget( "tizen.gallery", $.mobile.widget, {
+ options: {
+ flicking: false,
+ duration: 500
+ },
+
+ dragging: false,
+ moving: false,
+ max_width: 0,
+ max_height: 0,
+ org_x: 0,
+ org_time: null,
+ cur_img: null,
+ prev_img: null,
+ next_img: null,
+ images: [],
+ images_hold: [],
+ index: 0,
+ align_type: null,
+ direction: 1,
+ container: null,
+
+ _resize: function ( index ) {
+ var img = this.images[index],
+ width = this.images[index].width(),
+ height = this.images[index].height(),
+ margin = 0,
+ ratio,
+ img_max_width = this.max_width - margin,
+ img_max_height = this.max_height - margin;
+
+ ratio = height / width;
+
+ if ( width > img_max_width ) {
+ img.width( img_max_width );
+ img.height( img_max_width * ratio );
+ }
+
+ height = img.height();
+
+ if ( height > img_max_height ) {
+ img.height( img_max_height );
+ img.width( img_max_height / ratio );
+ }
+ },
+
+ _align: function ( index, obj ) {
+ var img = this.images[index],
+ img_top = 0;
+
+ if ( !obj ) {
+ return;
+ }
+ if ( !obj.length ) {
+ return;
+ }
+
+ if ( this.align_type == "middle" ) {
+ img_top = ( this.max_height - img.height() ) / 2;
+ } else if ( this.align_type == "bottom" ) {
+ img_top = this.max_height - img.height();
+ } else {
+ img_top = 0;
+ }
+
+ obj.css( 'top', img_top + 'px' );
+ },
+
+ _attach: function ( index, obj ) {
+ var self = this,
+ processing = function () {
+ self._resize( index );
+ self._align( index, obj );
+ },
+ loading = function () {
+ if ( self.images[index] === undefined ) {
+ return;
+ }
+
+ if ( !self.images[index].height() ) {
+ setTimeout( loading, 10 );
+ return;
+ }
+
+ processing();
+ };
+
+ if ( !obj ) {
+ return;
+ }
+ if ( !obj.length ) {
+ return;
+ }
+ if ( index < 0 ) {
+ return;
+ }
+ if ( !this.images.length ) {
+ return;
+ }
+ if ( index >= this.images.length ) {
+ return;
+ }
+
+ obj.css( "display", "block" );
+ obj.append( this.images[index] );
+
+ loading();
+ },
+
+ _detach: function ( index, obj ) {
+ if ( !obj ) {
+ return;
+ }
+ if ( !obj.length ) {
+ return;
+ }
+ if ( index < 0 ) {
+ return;
+ }
+ if ( index >= this.images.length ) {
+ return;
+ }
+
+ obj.css( "display", "none" );
+ this.images[index].removeAttr("style");
+ this.images[index].detach();
+ },
+
+ _detach_all: function () {
+ var i;
+
+ for ( i = 0; i < this.images.length; i++ ) {
+ this.images[i].detach();
+ }
+ },
+
+ _drag: function ( _x ) {
+ var delta,
+ coord_x;
+
+ if ( !this.dragging ) {
+ return;
+ }
+
+ if ( this.options.flicking === false ) {
+ delta = this.org_x - _x;
+
+ // first image
+ if ( delta < 0 && !this.prev_img.length ) {
+ return;
+ }
+ // last image
+ if ( delta > 0 && !this.next_img.length ) {
+ return;
+ }
+ }
+
+ coord_x = _x - this.org_x;
+
+ this._moveLeft( this.cur_img , coord_x + 'px');
+ if ( this.next_img.length ) {
+ this._moveLeft( this.next_img , coord_x + this.window_width + 'px' );
+ }
+ if ( this.prev_img.length ) {
+ this._moveLeft( this.prev_img , coord_x - this.window_width + 'px' );
+ }
+ },
+
+ _move: function ( _x ) {
+ var delta = this.org_x - _x,
+ flip = 0,
+ drag_time,
+ sec,
+ self;
+
+ if ( delta == 0 ) {
+ return;
+ }
+
+ if ( delta > 0 ) {
+ flip = delta < ( this.max_width * 0.45 ) ? 0 : 1;
+ } else {
+ flip = -delta < ( this.max_width * 0.45 ) ? 0 : 1;
+ }
+
+ if ( !flip ) {
+ drag_time = Date.now() - this.org_time;
+
+ if ( Math.abs( delta ) / drag_time > 1 ) {
+ flip = 1;
+ }
+ }
+
+ if ( flip ) {
+ if ( delta > 0 && this.next_img.length ) {
+ /* next */
+ this._detach( this.index - 1, this.prev_img );
+
+ this.prev_img = this.cur_img;
+ this.cur_img = this.next_img;
+ this.next_img = this.next_img.next();
+
+ this.index++;
+
+ if ( this.next_img.length ) {
+ this._moveLeft( this.next_img , this.window_width + 'px' );
+ this._attach( this.index + 1, this.next_img );
+ }
+
+ this.direction = 1;
+
+ } else if ( delta < 0 && this.prev_img.length ) {
+ /* prev */
+ this._detach( this.index + 1, this.next_img );
+
+ this.next_img = this.cur_img;
+ this.cur_img = this.prev_img;
+ this.prev_img = this.prev_img.prev();
+
+ this.index--;
+
+ if ( this.prev_img.length ) {
+ this._moveLeft( this.prev_img , -this.window_width + 'px' );
+ this._attach( this.index - 1, this.prev_img );
+ }
+
+ this.direction = -1;
+ }
+ }
+
+ sec = this.options.duration;
+ self = this;
+
+ this.moving = true;
+
+ setTimeout( function () {
+ self.moving = false;
+ }, sec - 25 );
+
+ this._moveLeft( this.cur_img, 0 + 'px', sec );
+ if ( this.next_img.length ) {
+ this._moveLeft( this.next_img, this.window_width + 'px', sec );
+ }
+ if ( this.prev_img.length ) {
+ this._moveLeft( this.prev_img, -this.window_width + 'px', sec );
+ }
+ },
+
+ _add_event: function () {
+ var self = this,
+ date;
+
+ this.container.bind( 'vmousemove', function ( e ) {
+ e.preventDefault();
+
+ if ( self.moving ) {
+ return;
+ }
+ if ( !self.dragging ) {
+ return;
+ }
+
+ self._drag( e.pageX );
+ } );
+
+ this.container.bind( 'vmousedown', function ( e ) {
+ e.preventDefault();
+
+ if ( self.moving ) {
+ return;
+ }
+
+ self.dragging = true;
+
+ self.org_x = e.pageX;
+
+ self.org_time = Date.now();
+ } );
+
+ this.container.bind( 'vmouseup', function ( e ) {
+ if ( self.moving ) {
+ return;
+ }
+
+ self.dragging = false;
+
+ self._move( e.pageX );
+ } );
+
+ this.container.bind( 'vmouseout', function ( e ) {
+ if ( self.moving ) {
+ return;
+ }
+ if ( !self.dragging ) {
+ return;
+ }
+
+ if ( ( e.pageX < 20 ) ||
+ ( e.pageX > ( self.max_width - 20 ) ) ) {
+ self._move( e.pageX );
+ self.dragging = false;
+ }
+ } );
+ },
+
+ _del_event: function () {
+ this.container.unbind( 'vmousemove' );
+ this.container.unbind( 'vmousedown' );
+ this.container.unbind( 'vmouseup' );
+ this.container.unbind( 'vmouseout' );
+ },
+ _moveLeft : function ( $ele , value , duration) {
+ var translate,
+ transition = "",
+ cssArray = null;
+
+ if ( $.support.cssTransform3d ) {
+ translate = "translate3d(" + value + ", 0px, 0px)";
+ } else {
+ translate = "translate(" + value + ", 0px)";
+ }
+ if( !duration || duration !== undefined ) {
+ transition = "-webkit-transform " + (duration / 1000)+ "s ease";
+ }
+ cssArray = {"-moz-transform": translate,
+ "-webkit-transform": translate,
+ "-ms-transform": translate,
+ "-o-transform": translate,
+ "transform": translate};
+ if( transition !== "" ) {
+ cssArray["-webkit-transition"] = transition ;
+ }
+
+ $ele.css(cssArray);
+ return $ele;
+ },
+ _show: function () {
+ /* resizing */
+ this.window_width = $( window ).width();
+ this.max_width = this._get_width();
+ this.max_height = this._get_height();
+ this.container.css( 'height', this.max_height );
+
+ this.cur_img = $( 'div' ).find( '.ui-gallery-bg:eq(' + this.index + ')' );
+ this.prev_img = this.cur_img.prev();
+ this.next_img = this.cur_img.next();
+
+ this._attach( this.index - 1, this.prev_img );
+ this._attach( this.index, this.cur_img );
+ this._attach( this.index + 1, this.next_img );
+
+ if ( this.prev_img.length ) {
+ this._moveLeft( this.prev_img, -this.window_width + 'px');
+ }
+
+ this._moveLeft( this.cur_img, '0px');
+ if ( this.next_img.length ) {
+ this._moveLeft( this.next_img, this.window_width + 'px' );
+ }
+ },
+
+ show: function () {
+ if ( !this.images.length ) {
+ return;
+ }
+
+ this._show();
+ this._add_event();
+ },
+
+ _hide: function () {
+ this._detach( this.index - 1, this.prev_img );
+ this._detach( this.index, this.cur_img );
+ this._detach( this.index + 1, this.next_img );
+ },
+
+ hide: function () {
+ this._hide();
+ this._del_event();
+ },
+
+ _get_width: function () {
+ return $( this.element ).width();
+ },
+
+ _get_height: function () {
+ var $page = $( this.element ).parentsUntil( 'ui-page' ),
+ $content = $page.children( '.ui-content' ),
+ header_h = $page.children( '.ui-header' ).outerHeight() || 0,
+ footer_h = $page.children( '.ui-footer' ).outerHeight() || 0,
+ padding = parseFloat( $content.css( 'padding-top' ) )
+ + parseFloat( $content.css( 'padding-bottom' ) ),
+ content_h = $( window ).height() - header_h - footer_h - padding;
+
+ return content_h;
+ },
+
+ _create: function () {
+ var temp_img,
+ self = this,
+ index,
+ i = 0;
+
+ $( this.element ).wrapInner( '<div class="ui-gallery"></div>' );
+ $( this.element ).find( 'img' ).wrap( '<div class="ui-gallery-bg"></div>' );
+
+ this.container = $( this.element ).find('.ui-gallery');
+
+ temp_img = $( 'div' ).find( '.ui-gallery-bg:first' );
+
+ while ( temp_img.length ) {
+ this.images[i] = temp_img.find( 'img' );
+ temp_img = temp_img.next();
+ i++;
+ }
+
+ this._detach_all();
+
+ index = parseInt( $( this.element ).jqmData( 'index' ), 10 );
+ if ( !index ) {
+ index = 0;
+ }
+ if ( index < 0 ) {
+ index = 0;
+ }
+ if ( index >= this.images.length ) {
+ index = this.images.length - 1;
+ }
+
+ this.index = index;
+
+ this.align_type = $( this.element ).jqmData( 'vertical-align' );
+
+ $( window ).bind( 'resize', function () {
+ self.refresh();
+ });
+ },
+
+ _update: function () {
+ var image_file,
+ bg_html,
+ temp_img;
+
+ while ( this.images_hold.length ) {
+ image_file = this.images_hold.shift();
+
+ bg_html = $( '<div class="ui-gallery-bg"></div>' );
+ temp_img = $( '<img src="' + image_file + '"></div>' );
+
+ bg_html.append( temp_img );
+ this.container.append( bg_html );
+ this.images.push( temp_img );
+ }
+
+ this._detach_all();
+ },
+
+ refresh: function ( start_index ) {
+ this._update();
+
+ this._hide();
+
+ if ( start_index === undefined ) {
+ start_index = this.index;
+ }
+ if ( start_index < 0 ) {
+ start_index = 0;
+ }
+ if ( start_index >= this.images.length ) {
+ start_index = this.images.length - 1;
+ }
+
+ this.index = start_index;
+
+ this._show();
+
+ return this.index;
+ },
+
+ add: function ( file ) {
+ this.images_hold.push( file );
+ },
+
+ remove: function ( index ) {
+ var temp_img;
+
+ if ( index === undefined ) {
+ index = this.index;
+ }
+
+ if ( index < 0 || index >= this.images.length ) {
+ return;
+ }
+
+ if ( index == this.index ) {
+ temp_img = this.cur_img;
+
+ if ( this.index == 0 ) {
+ this.direction = 1;
+ } else if ( this.index == this.images.length - 1 ) {
+ this.direction = -1;
+ }
+
+ if ( this.direction < 0 ) {
+ this.cur_img = this.prev_img;
+ this.prev_img = this.prev_img.prev();
+ if ( this.prev_img.length ) {
+ this._moveLeft( this.prev_img, -this.window_width);
+ this._attach( index - 2, this.prev_img );
+ }
+ this.index--;
+ } else {
+ this.cur_img = this.next_img;
+ this.next_img = this.next_img.next();
+ if ( this.next_img.length ) {
+ this._moveLeft( this.next_img, this.window_width);
+ this._attach( index + 2, this.next_img );
+ }
+ }
+ this._moveLeft( this.cur_img, '0px', this.options.duration );
+
+ } else if ( index == this.index - 1 ) {
+ temp_img = this.prev_img;
+ this.prev_img = this.prev_img.prev();
+ if ( this.prev_img.length ) {
+ this._moveLeft( this.prev_img, -this.window_width);
+ this._attach( index - 1, this.prev_img );
+ }
+ this.index--;
+
+ } else if ( index == this.index + 1 ) {
+ temp_img = this.next_img;
+ this.next_img = this.next_img.next();
+ if ( this.next_img.length ) {
+ this._moveLeft( this.next_img, this.window_width);
+ this._attach( index + 1, this.next_img );
+ }
+
+ } else {
+ temp_img = $( 'div' ).find( '.ui-gallery-bg:eq(' + index + ')' );
+ }
+
+ this.images.splice( index, 1 );
+ temp_img.detach();
+ },
+
+ empty: function () {
+ this.images.splice( 0, this.images.length );
+ this.container.find('.ui-gallery-bg').detach();
+ },
+
+ length: function () {
+ return this.images.length;
+ },
+
+ value: function ( index ) {
+ if ( index === undefined ) {
+ return this.index;
+ }
+
+ this.refresh( index );
+ }
+ }); /* End of widget */
+
+ // auto self-init widgets
+ $( document ).bind( "pagecreate create", function ( e ) {
+ $( e.target ).find( ":jqmData(role='gallery')" ).gallery();
+ });
+
+ $( document ).bind( "pageshow", function ( e ) {
+ $( e.target ).find( ":jqmData(role='gallery')" ).gallery( 'show' );
+ });
+
+ $( document ).bind( "pagebeforehide", function ( e ) {
+ $( e.target ).find( ":jqmData(role='gallery')" ).gallery( 'hide' );
+ } );
+
+}( jQuery, this ) );
+
--- /dev/null
+\r
+\r
+/* ***************************************************************************\r
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.\r
+ *\r
+ * Permission is hereby granted, free of charge, to any person obtaining a\r
+ * copy of this software and associated documentation files (the "Software"),\r
+ * to deal in the Software without restriction, including without limitation\r
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,\r
+ * and/or sell copies of the Software, and to permit persons to whom the\r
+ * Software is furnished to do so, subject to the following conditions:\r
+ *\r
+ * The above copyright notice and this permission notice shall be included in\r
+ * all copies or substantial portions of the Software.\r
+ *\r
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\r
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\r
+ * DEALINGS IN THE SOFTWARE.\r
+ * ***************************************************************************\r
+ *\r
+ * Authors: Hyunsook Park <hyunsook.park@samsung.com>\r
+ * Wonseop Kim <wonseop.kim@samsung.com>\r
+ */\r
+\r
+/**\r
+ * 'Gallery3D' is a 3D photo gallery widget.\r
+ * Images are arranged with a S-shaped curve on a 3-dimensional coordinate system.\r
+ * A user can rotate images by swiping the widget area.\r
+ * To improve performance, the size of image(s) displayed on the screen should be a square(under\r
+ * 128X128 pixel) as possible. But if a user can't resize the images, this widget supports an image\r
+ * resizing feature and he/she can use it with "data-thumbnail-cache" option. ("data-thumbnail-cache"\r
+ * option resizes the gallery images under 128x128 pixels and stores the images on a local storage.\r
+ * So when a gallery3D widget is re-launched, the widget reuse the storage and a user can improve\r
+ * launching time. A browser or web runtime engine should support "Web Storage" feature to use that\r
+ * option.)\r
+ *\r
+ * HTML Attributes:\r
+ *\r
+ * data-thumbnail-cache : Determines whether to cache and resize images.\r
+ *\r
+ * APIs:\r
+ *\r
+ * next ( void )\r
+ * : This method moves each image forward one by one.\r
+ * prev ( void )\r
+ * : This method moves each image backward one by one.\r
+ * select ( [number] )\r
+ * : When the "select" method is called with an argument, the method selects the image of given index.\r
+ * If the method is called with no argument, it will return the Javascript object having "src"\r
+ * attribute having the selected image’s URL.\r
+ * add ( object or string [, number] )\r
+ * This method adds an image to Gallery3D widget.\r
+ * If the second argument isn't inputted, the image is added at the 0th position.\r
+ * remove ( [number] )\r
+ * : This method deletes an image from Gallery3d widget.\r
+ * The argument defines the index of the image to be deleted.\r
+ * If an argument isn't inputted, it removes current image.\r
+ * clearThumbnailCache ( void )\r
+ * : This method clears the cache data of all images when thumbnailCache option is set as 'true'.\r
+ * refresh ( void )\r
+ * : This method updates and redraws current widget.\r
+ * empty ( void )\r
+ * : This method removes all of images from Gallery3D widget.\r
+ * length ( void )\r
+ * : This method gets the number of images.\r
+ *\r
+ * Events:\r
+ *\r
+ * select : Triggered when an image is selected.\r
+ *\r
+ * Examples:\r
+ *\r
+ * <script>\r
+ * $( "#gallery3d" ).on( "gallery3dcreate", function () {\r
+ * $( "#gallery3d" ).gallery3d( "add", "01.jpg" );\r
+ * });\r
+ * </script>\r
+ * <div id="gallery3d" data-role="gallery3d"></div>\r
+ */\r
+\r
+/**\r
+ @class Gallery3D\r
+ The gallery3d widget is a 3D photo gallery widget.\r
+ Images are arranged with a S-shaped curve on a 3-dimensional coordinate system.\r
+ A user can rotate images by swiping the widget area.\r
+ <br/><br/>To add an gallery3d widget to the application, use the following code:\r
+\r
+ <script>\r
+ $( "#gallery3d" ).on( "gallery3dcreate", function () {\r
+ $( "#gallery3d" ).gallery3d( "add", "01.jpg" );\r
+ });\r
+ </script>\r
+ <div id="gallery3d" data-role="gallery3d"></div>\r
+*/\r
+/**\r
+ @property {Boolean} data-thumbnail-cache\r
+ Determines whether to cache and resize images.\r
+ To improve performance, the size of image(s) displayed on the screen should be a square (under 128X128 pixels).\r
+ "data-thumbnail-cache" option resizes the gallery images under 128x128 pixels and stores the images on a local storage.\r
+ So when a gallery3D widget is re-launched, the widget reuses the storage and the launching time can be improved.\r
+ A browser or web runtime engine must support "Web Storage" feature to use this option.\r
+*/\r
+/**\r
+ @event select\r
+ Triggered when an image is selected.\r
+\r
+ <script>\r
+ $( "#gallery3d" ).on( "gallery3dcreate", function () {\r
+ $( "#gallery3d" ).gallery3d( "add", { src: "1.jpg" } )\r
+ .gallery3d( "add", { src: "2.jpg" } )\r
+ .gallery3d( "add", { src: "3.jpg" } );\r
+ }).on( "select", function ( event, data, index ) {\r
+ // Handle the select event\r
+ var urlOfImage = data.src, indexOfImage = index;\r
+ });\r
+ </script>\r
+ <div id="gallery3d" data-role="gallery3d"></div>\r
+*/\r
+/**\r
+ @method next\r
+ This method moves each image forward one by one.\r
+\r
+ <script>\r
+ $( "#gallery3d" ).on( "gallery3dcreate", function () {\r
+ $( "#gallery3d" ).gallery3d( "add", { src: "1.jpg" } )\r
+ .gallery3d( "add", { src: "2.jpg" } )\r
+ .gallery3d( "add", { src: "3.jpg" } )\r
+ .gallery3d( "next" );\r
+ });\r
+ </script>\r
+ <div id="gallery3d" data-role="gallery3d"></div>\r
+*/\r
+/**\r
+ @method prev\r
+ This method moves each image backward one by one.\r
+\r
+ <script>\r
+ $( "#gallery3d" ).on( "gallery3dcreate", function () {\r
+ $( "#gallery3d" ).gallery3d( "add", { src: "1.jpg" } )\r
+ .gallery3d( "add", { src: "2.jpg" } )\r
+ .gallery3d( "add", { src: "3.jpg" } )\r
+ .gallery3d( "prev" );\r
+ });\r
+ </script>\r
+ <div id="gallery3d" data-role="gallery3d"></div>\r
+*/\r
+/**\r
+ @method select\r
+ When the "select" method is called with an argument, the method selects the image of given index.\r
+ If the method is called with no argument, it will return the Javascript object having "src" attribute having the selected image’s URL.\r
+\r
+ <script>\r
+ $( "#gallery3d" ).on( "gallery3dcreate", function () {\r
+ $( "#gallery3d" ).gallery3d( "add", { src: "1.jpg" } )\r
+ .gallery3d( "add", { src: "2.jpg" } )\r
+ .gallery3d( "add", { src: "3.jpg" } );\r
+ var selectedImage = $("#gallery3d"). gallery3d( "select" );\r
+ // selectedImage = { src: "3.jpg" };\r
+ });\r
+ </script>\r
+ <div id="gallery3d" data-role="gallery3d"></div>\r
+*/\r
+/**\r
+ @method add\r
+ This method adds an image to Gallery3D widget.\r
+ The first argument is a Javascript object having a "src" attribute or a string of image's path.\r
+ The second argument is an index of images.\r
+ If second argument isn't inputted, the image is added at the 0th position.\r
+\r
+ <script>\r
+ $( "#gallery3d" ).on( "gallery3dcreate", function () {\r
+ $( "#gallery3d" ).gallery3d( "add", { src: "1.jpg" } )\r
+ .gallery3d( "add", "2.jpg", 1 );\r
+ });\r
+ </script>\r
+ <div id="gallery3d" data-role="gallery3d"></div>\r
+*/\r
+/**\r
+ @method remove\r
+ This method deletes an image from Gallery3d widget.\r
+ The argument defines the index of the image to be deleted.\r
+ If an argument isn't inputted, it removes current image.\r
+\r
+ <script>\r
+ $( "#gallery3d" ).on( "gallery3dcreate", function () {\r
+ $( "#gallery3d" ).gallery3d( "add", { src: "1.jpg" } )\r
+ .gallery3d( "add", { src: "2.jpg" } )\r
+ .gallery3d( "add", { src: "3.jpg" } );\r
+\r
+ $( "#gallery3d" ).gallery3d( "remove" );\r
+ $( "#gallery3d" ).gallery3d( "remove", 1 );\r
+ });\r
+ </script>\r
+ <div id="gallery3d" data-role="gallery3d"></div>\r
+*/\r
+/**\r
+ @method clearThumbnailCache\r
+ This method clears the cache data of all images when thumbnailCache option is set as 'true'\r
+\r
+ <script>\r
+ $( "#gallery3d" ).on( "gallery3dcreate", function () {\r
+ $( "#gallery3d" ).gallery3d( "add", { src: "1.jpg" } )\r
+ .gallery3d( "add", { src: "2.jpg" } )\r
+ .gallery3d( "add", { src: "3.jpg" } );\r
+\r
+ $( "#gallery3d" ).gallery3d( "clearThumbnailCache" );\r
+ });\r
+ </script>\r
+ <div id="gallery3d" data-role="gallery3d" data-thumbnail-cache="true"></div>\r
+*/\r
+/**\r
+ @method refresh\r
+ This method updates and redraws current widget.\r
+\r
+ <script>\r
+ $( "#gallery3d" ).on( "gallery3dcreate", function () {\r
+ $( "#gallery3d" ).gallery3d( "add", { src: "1.jpg" } )\r
+ .gallery3d( "add", { src: "2.jpg" } )\r
+ .gallery3d( "add", { src: "3.jpg" } );\r
+\r
+ $( "#gallery3d" ).gallery3d( "refresh" );\r
+ });\r
+ </script>\r
+ <div id="gallery3d" data-role="gallery3d"></div>\r
+*/\r
+/**\r
+ @method empty\r
+ This method removes all of images from Gallery3D widget.\r
+\r
+ <script>\r
+ $( "#gallery3d" ).on( "gallery3dcreate", function () {\r
+ $( "#gallery3d" ).gallery3d( "add", { src: "1.jpg" } )\r
+ .gallery3d( "add", { src: "2.jpg" } )\r
+ .gallery3d( "add", { src: "3.jpg" } );\r
+\r
+ $( "#gallery3d" ).gallery3d( "empty" );\r
+ });\r
+ </script>\r
+ <div id="gallery3d" data-role="gallery3d"></div>\r
+*/\r
+/**\r
+ @method length\r
+ This method gets the number of images.\r
+\r
+ <script>\r
+ $( "#gallery3d" ).on( "gallery3dcreate", function () {\r
+ $( "#gallery3d" ).gallery3d( "add", { src: "1.jpg" } )\r
+ .gallery3d( "add", { src: "2.jpg" } )\r
+ .gallery3d( "add", { src: "3.jpg" } );\r
+\r
+ var imagesLength = $( "#gallery3d" ).gallery3d( "length" );\r
+ // imagesLength = 3;\r
+ });\r
+ </script>\r
+ <div id="gallery3d" data-role="gallery3d"></div>\r
+*/\r
+\r
+( function ( $, document, window, undefined ) {\r
+ window.requestAnimationFrame = ( function () {\r
+ return function ( callback ) {\r
+ var id = window.setTimeout( callback, 1000 / 60 );\r
+ return id;\r
+ };\r
+ } () );\r
+\r
+ window.cancelAnimationFrame = ( function () {\r
+ return function ( id ) {\r
+ window.clearTimeout( id );\r
+ };\r
+ } () );\r
+\r
+ var vec3 = window.vec3,\r
+ mat3 = window.mat3,\r
+ mat4 = window.mat4,\r
+ GlArray32 = ( typeof window.Float32Array !== "undefined" ? window.Float32Array : ( typeof window.WebGLFloatArray !== "undefined" ? window.WebGLFloatArray : Array ) ),\r
+ GlArray16 = ( typeof window.Uint16Array !== "undefined" ? window.Uint16Array : Array ),\r
+ getContext3D = function ( canvas ) {\r
+ var gl, i,\r
+ contextNames = [ "experimental-webgl", "webkit-3d", "webgl", "moz-webgl" ];\r
+\r
+ for ( i = 0; i < contextNames.length; i += 1 ) {\r
+ try {\r
+ gl = canvas.getContext( contextNames[i] );\r
+ if ( gl ) {\r
+ break;\r
+ }\r
+ } catch ( e ) {\r
+ window.alert( "Unfortunately, there's a WebGL compatibility problem. </br> You may want to check your system settings." );\r
+ return;\r
+ }\r
+ }\r
+ return gl;\r
+ },\r
+ VERTEX_SHADER = [\r
+ "attribute vec3 aVertexPosition;",\r
+ "attribute vec2 aTextureCoord;",\r
+ "attribute vec3 aVertexNormal;",\r
+ "uniform mat4 uMoveMatrix;",\r
+ "uniform mat4 uPerspectiveMatrix;",\r
+ "uniform mat3 nNormalMatrix;",\r
+ "uniform vec3 uAmbientColor;",\r
+ "uniform vec3 uLightDirection;",\r
+ "uniform vec3 uDirectionColor;",\r
+ "uniform vec3 uLightDirection_first;",\r
+ "uniform vec3 uLightDirection_second;",\r
+ "varying vec2 vTextureCoord;",\r
+ "varying vec3 vLightWeight;",\r
+ "varying vec4 vFogWeight;",\r
+\r
+ "void main(void) {",\r
+ " vec4 v_Position = uMoveMatrix * vec4(aVertexPosition, 1.0);",\r
+ " gl_Position = uPerspectiveMatrix * v_Position;",\r
+ " vTextureCoord = aTextureCoord;",\r
+ " float fog = 1.0 - ((gl_Position.z + 1.5) / 60.0);",\r
+ " vFogWeight = clamp( vec4( fog, fog, fog, 1.0), 0.0, 1.0);",\r
+ " vec3 transNormalVector = nNormalMatrix * aVertexNormal;",\r
+\r
+ " float vLightWeightFirst = 0.0;",\r
+ " float vLightWeightSecond = max( dot(transNormalVector, uLightDirection_second), 0.0 );",\r
+\r
+ " vLightWeight = uAmbientColor + uDirectionColor * vLightWeightSecond;",\r
+ "}"\r
+ ].join( "\n" ),\r
+ FRAGMENT_SHADER = [\r
+ "precision mediump float;",\r
+ "varying vec2 vTextureCoord;",\r
+ "varying vec3 vLightWeight;",\r
+ "uniform sampler2D uSampler;",\r
+ "varying vec4 vFogWeight;",\r
+\r
+ "void main(void) {",\r
+ " vec4 TextureColor = (texture2D(uSampler, vec2(vTextureCoord.s, vTextureCoord.t))) * vFogWeight;",\r
+ " gl_FragColor = vec4(TextureColor.rgb * vLightWeight, TextureColor.a);",\r
+ "}"\r
+ ].join( "\n" );\r
+\r
+ function Node() {\r
+ this.vertices = [\r
+ -1.0, -1.0, 0.0,\r
+ 1.0, -1.0, 0.0,\r
+ 1.0, 1.0, 0.0,\r
+ -1.0, 1.0, 0.0\r
+ ];\r
+ this.textureCoords = [\r
+ 1.0, 0.0,\r
+ 0.0, 0.0,\r
+ 0.0, 1.0,\r
+ 1.0, 1.0\r
+ ];\r
+ this.normalVectors = [\r
+ 0.0, 0.0, 1.0,\r
+ 0.0, 0.0, 1.0,\r
+ 0.0, 0.0, 1.0,\r
+ 0.0, 0.0, 1.0\r
+ ];\r
+ this.texture = null;\r
+ this.textureBuffer = null;\r
+ this.textureBufferItemSize = 0;\r
+ this.mashOrder = [];\r
+ this.mvMatrix = null;\r
+ this.level = -1;\r
+ this.targetLevel = 0;\r
+ this.drawable = false;\r
+ this.image = null;\r
+ this.imageID = 0;\r
+ }\r
+\r
+ $.widget( "tizen.gallery3d", $.mobile.widget, {\r
+ options: {\r
+ thumbnailCache: false\r
+ },\r
+\r
+ _MAX_ITEM_COUNT: 28,\r
+ _ANIMATION_END: 999,\r
+ _DURATION_DEFAULT: 300,\r
+ _DURATION_FIRST: 1600,\r
+ _VIEWPORT_WIDTH: 1024,\r
+ _VIEWPORT_HEIGHT: 456,\r
+ _DIRECTION_LEFT: -1,\r
+ _DIRECTION_RIGHT: +1,\r
+\r
+ _gl: null,\r
+ _shaderProgram : null,\r
+ _positionBuffer : null,\r
+ _textureCoordBuffer : null,\r
+ _normalVectorBuffer : null,\r
+ _nodes: null,\r
+ _pMatrix : null,\r
+ _animationID: 0,\r
+ _dragInterval : 0,\r
+ _startTime : 0,\r
+ _sumTime : 0,\r
+ _lightsPositionStack : [\r
+ [0.0, 0.0, -1.0], // back\r
+ [-0.2, 0.0, 0.7] // front\r
+ ],\r
+ _path: null,\r
+ _swipeThresholdOfBasetimeGap: ( $.support.touch ? 30 : 70 ),\r
+ _swipeThresholdOfSensitivity: ( $.support.touch ? 2.0 : 10.0 ),\r
+ _canvas: null,\r
+ _imageList: [],\r
+ _maxDrawLength: 0,\r
+ _firstImageNumber: 0,\r
+ _lastImageNumber: 0,\r
+\r
+ _create: function () {\r
+ var self = this,\r
+ view = self.element,\r
+ option = self.options;\r
+\r
+ self._canvas = $( "<canvas class='ui-gallery3d-canvas'></canvas>" );\r
+\r
+ view.addClass( "ui-gallery3d" ).append( self._canvas );\r
+ self._addBehavier();\r
+\r
+ self._dragInterval = 1000 / 30; // 30fps\r
+\r
+ $.each( self.options, function ( key, value ) {\r
+ self.options[ key ] = undefined;\r
+ self._setOption( key, value );\r
+ });\r
+\r
+ },\r
+\r
+ _setOption: function ( key, value ) {\r
+ switch ( key ) {\r
+ case "thumbnailCache" :\r
+ if ( typeof value === "string" ) {\r
+ value = ( value === "true" ) ? true : false;\r
+ } else {\r
+ value = !!value;\r
+ }\r
+ this._reset();\r
+ break;\r
+ }\r
+\r
+ $.mobile.widget.prototype._setOption.call( this, key, value );\r
+ },\r
+\r
+ _init: function ( canvas ) {\r
+ var self = this,\r
+ pathPoints = [\r
+ [40, 0, -48],\r
+ [-12, 0, -40], // contorl Point of Point1\r
+ [24, 0, -9], // contorl Point of Point2\r
+ [-5, 0, -5]\r
+ ],\r
+ i;\r
+\r
+ canvas = canvas || self._canvas;\r
+\r
+ if ( !canvas ) {\r
+ return;\r
+ }\r
+\r
+ self._gl = self._gl || self._initGL( canvas[0] );\r
+ if ( !self._gl ) {\r
+ return;\r
+ }\r
+\r
+ if ( !self._imageList ) {\r
+ return;\r
+ }\r
+\r
+ self._shaderProgram = self._shaderProgram || self._initShader( self._gl );\r
+ if ( !self._shaderProgram ) {\r
+ return;\r
+ }\r
+\r
+ if ( self._imageList.length > self._MAX_ITEM_COUNT ) {\r
+ self._firstImageNumber = self._imageList.length - 1;\r
+ self._lastImageNumber = self._MAX_ITEM_COUNT - 1;\r
+ }\r
+\r
+ self._nodes = self._initBuffers( self._gl, self._shaderProgram );\r
+ self._initTextures( self._gl, self._nodes );\r
+ self._path = $.motionpath( "bspline", {\r
+ points: pathPoints,\r
+ maxLevel: self._MAX_ITEM_COUNT\r
+ } );\r
+ for ( i = 0; i < self._nodes.length; i += 1 ) {\r
+ self._path.levels[i] = self._path.levels[i + 1] || 0;\r
+ self._nodes[i].level = i;\r
+ }\r
+ },\r
+\r
+ _final: function ( canvas ) {\r
+ var self = this,\r
+ gl = self._gl;\r
+\r
+ if ( !gl ) {\r
+ return;\r
+ }\r
+\r
+ canvas = canvas || self._canvas;\r
+\r
+ $( self._nodes ).each( function ( i ) {\r
+ var node = self._nodes[i];\r
+ gl.deleteTexture( node.texture );\r
+ node.texture = null;\r
+ });\r
+ self._nodes = null;\r
+\r
+ gl.deleteBuffer( self._positionBuffer );\r
+ self._positionBuffer = null;\r
+ gl.deleteBuffer( self._textureCoordBuffer );\r
+ self._textureCoordBuffer = null;\r
+ gl.deleteBuffer( self._normalVectorBuffer );\r
+ self._normalVectorBuffer = null;\r
+\r
+ $.webgl.shader.deleteShaders( gl );\r
+ gl.deleteProgram( self._shaderProgram );\r
+ self._shaderProgram = null;\r
+\r
+ self._gl = gl = null;\r
+ },\r
+\r
+ _addBehavier : function () {\r
+ var self = this,\r
+ view = self.element,\r
+ canvas = self._canvas,\r
+ touchStartEvt = ( $.support.touch ? "touchstart" : "mousedown" ),\r
+ touchMoveEvt = ( $.support.touch ? "touchmove" : "mousemove" ) + ".gallery3d",\r
+ touchEndEvt = ( $.support.touch ? "touchend" : "mouseup" ) + ".gallery3d",\r
+ touchLeaveEvt = ( $.support.touch ? "touchleave" : "mouseout" ) + ".gallery3d";\r
+\r
+ $( document ).unbind( ".gallery3d" ).bind( "pagechange.gallery3d", function ( e ) {\r
+ $( e.target ).find( ".ui-gallery3d" ).gallery3d( "refresh" );\r
+ }).bind( "pageremove.gallery3d", function ( e ) {\r
+ $( e.target ).find( ".ui-gallery3d" ).trigger( "_destory" );\r
+ });\r
+\r
+ $( window ).unbind( ".gallery3d" ).bind( "resize.gallery3d orientationchange.gallery3d", function ( e ) {\r
+ $( ".ui-page-active" ).find( ".ui-gallery3d" ).gallery3d( "refresh" );\r
+ }).bind( "unload.gallery3d", function ( e ) {\r
+ $( e.target ).find( ".ui-gallery3d" ).trigger( "_destory" );\r
+ });\r
+\r
+ view.bind( "_destory", function ( e ) {\r
+ self._final();\r
+ });\r
+\r
+ canvas.bind( "webglcontextlost", function ( e ) {\r
+ e.preventDefault();\r
+ }).bind( "webglcontextrestored", function ( e ) {\r
+ self._init();\r
+ }).bind( touchStartEvt, function ( e ) {\r
+ var i = 0,\r
+ startX = 0,\r
+ deltaMaxSteps = 20,\r
+ deltas = [ deltaMaxSteps ],\r
+ deltaTimes = [ deltaMaxSteps ],\r
+ deltaIndex = 0,\r
+ dragValue = 0,\r
+ dragDirection = false,\r
+ prevTime = 0;\r
+\r
+ e.preventDefault();\r
+ e.stopPropagation();\r
+\r
+ if ( self._imageList.length <= 1 ) {\r
+ return;\r
+ }\r
+\r
+ self._stop();\r
+\r
+ startX = $.support.touch ? e.originalEvent.changedTouches[0].pageX : e.pageX;\r
+ prevTime = $.now();\r
+\r
+ for ( i = 0; i < deltaMaxSteps; i += 1 ) {\r
+ deltas[i] = startX;\r
+ deltaTimes[i] = $.now();\r
+ }\r
+\r
+ deltaIndex += 1;\r
+\r
+ view.bind( touchMoveEvt, function ( e ) {\r
+ var x, dx, interval;\r
+\r
+ e.preventDefault();\r
+ e.stopPropagation();\r
+\r
+ x = $.support.touch ? e.originalEvent.changedTouches[0].pageX : e.pageX;\r
+ dx = startX - x;\r
+\r
+ deltas[deltaIndex] = x;\r
+ deltaTimes[deltaIndex] = $.now();\r
+ interval = deltaTimes[deltaIndex] - prevTime;\r
+\r
+ deltaIndex = ( deltaIndex + 1 ) % deltaMaxSteps;\r
+\r
+ // Validation of drag\r
+ if ( Math.abs( dx ) >= 10 && interval >= self._dragInterval ) {\r
+ if ( dragDirection !== ( ( dx < 0 ) ? self._DIRECTION_RIGHT : self._DIRECTION_LEFT ) ) {\r
+ dragValue = 0;\r
+ dragDirection = ( dx < 0 ) ? self._DIRECTION_RIGHT : self._DIRECTION_LEFT;\r
+ }\r
+\r
+ dragValue += Math.abs( dx ) / 100;\r
+ if ( dragValue >= 1 ) {\r
+ self._setPosition( self._ANIMATION_END, dragDirection );\r
+ dragValue = 0;\r
+ } else {\r
+ self._setPosition( dragValue, dragDirection );\r
+ }\r
+ self._drawScene();\r
+ startX = x;\r
+ prevTime = $.now();\r
+ }\r
+ }).bind( touchEndEvt, function ( e ) {\r
+ var baseTime = 0,\r
+ recent = -1,\r
+ index = 0,\r
+ previous = 0,\r
+ baseTimeRatio = 0,\r
+ fx = 0,\r
+ lastX = 0,\r
+ velocityX = 0,\r
+ dx = 0,\r
+ isSwipe = true,\r
+ direction;\r
+\r
+ e.preventDefault();\r
+ e.stopPropagation();\r
+\r
+ // Validation of swipe\r
+ baseTime = $.now() - self._swipeThresholdOfBasetimeGap;\r
+ lastX = $.support.touch ? e.originalEvent.changedTouches[0].pageX : e.pageX;\r
+ dx = startX - lastX;\r
+ startX = 0;\r
+ for ( i = 0; i < deltaMaxSteps; i += 1 ) {\r
+ index = ( deltaIndex + i ) % deltaMaxSteps;\r
+ if ( deltaTimes[index] > baseTime ) {\r
+ recent = index;\r
+ break;\r
+ }\r
+ }\r
+ if ( recent < 0 ) {\r
+ isSwipe = false;\r
+ }\r
+\r
+ if ( isSwipe ) {\r
+ previous = recent;\r
+ for ( i = 0; i < deltaMaxSteps; i += 1 ) {\r
+ previous = ( previous - 1 + deltaMaxSteps ) % deltaMaxSteps;\r
+ if ( deltaTimes[previous] < deltaTimes[recent] ) {\r
+ break;\r
+ }\r
+ }\r
+ // too slow or too fast\r
+ if ( i === deltaMaxSteps || baseTime < deltaTimes[previous] ) {\r
+ isSwipe = false;\r
+ }\r
+ }\r
+\r
+ if ( isSwipe ) {\r
+ baseTimeRatio = ( baseTime - deltaTimes[previous] ) / ( deltaTimes[recent] - deltaTimes[previous] );\r
+ fx = ( 1.0 - baseTimeRatio ) * deltas[previous] + baseTimeRatio * deltas[recent];\r
+ if ( Math.abs( fx - lastX ) < self._swipeThresholdOfSensitivity ) {\r
+ fx = lastX;\r
+ }\r
+ velocityX = parseInt( ( lastX - fx ) / ( $.now() - baseTime ), 10 );\r
+ }\r
+\r
+ if ( isSwipe && velocityX ) {\r
+ direction = ( velocityX < 0 ) ? self._DIRECTION_LEFT : self._DIRECTION_RIGHT;\r
+ self._run( direction, Math.abs( velocityX ), dragValue );\r
+ } else if ( dragDirection !== 0 && dragValue ) {\r
+ self._animate( null, self._DURATION_DEFAULT * ( 1 - dragValue ), dragDirection, 0, dragValue );\r
+ }\r
+\r
+ view.unbind( ".gallery3d" );\r
+ }).bind( touchLeaveEvt, function ( e ) {\r
+ view.trigger( touchEndEvt );\r
+ });\r
+ });\r
+ },\r
+\r
+ // ----------------------------------------------------------\r
+ // Data parsing\r
+ // ----------------------------------------------------------\r
+ _loadData: function ( jsonUrl, key ) {\r
+ var self = this;\r
+\r
+ $.ajax({\r
+ async : false,\r
+ url : jsonUrl,\r
+ dataType: "json",\r
+ success : function ( data ) {\r
+ self._imageList = $.extend( [], data[ key ] );\r
+ }\r
+ });\r
+ },\r
+\r
+ // ----------------------------------------------------------\r
+ // WebGL\r
+ // ----------------------------------------------------------\r
+ _initGL: function ( canvas ) {\r
+ var self = this,\r
+ gl;\r
+\r
+ gl = getContext3D( canvas );\r
+ if ( !gl ) {\r
+ window.alert( "There's no WebGL context available!!!" );\r
+ return null;\r
+ }\r
+\r
+ gl.enable( gl.BLEND );\r
+ gl.blendFunc( gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA );\r
+\r
+ gl.enable( gl.DEPTH_TEST );\r
+ gl.depthFunc( gl.LEQUAL );\r
+\r
+ canvas.width = self._VIEWPORT_WIDTH;\r
+ canvas.height = self._VIEWPORT_HEIGHT;\r
+ gl.viewportWidth = canvas.width;\r
+ gl.viewportHeight = canvas.height;\r
+ gl.viewport( 0, 0, gl.viewportWidth, gl.viewportHeight );\r
+ self._pMatrix = mat4.create();\r
+ mat4.perspective( 40, gl.viewportWidth / gl.viewportHeight, 0.1, 10000.0, self._pMatrix );\r
+\r
+ gl.clearColor( 0.0, 0.0, 0.0, 1.0 );\r
+ gl.clear( gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT );\r
+\r
+ return gl;\r
+ },\r
+\r
+ _initShader : function ( gl ) {\r
+ var self = this,\r
+ shaderProgram;\r
+\r
+ shaderProgram = $.webgl.shader.addShaderProgram( self._gl, VERTEX_SHADER, FRAGMENT_SHADER );\r
+ gl.useProgram( shaderProgram );\r
+\r
+ shaderProgram.vertexPositionAttr = gl.getAttribLocation( shaderProgram, "aVertexPosition" );\r
+ gl.enableVertexAttribArray( shaderProgram.vertexPositionAttr );\r
+\r
+ shaderProgram.textureCoordAttr = gl.getAttribLocation( shaderProgram, "aTextureCoord" );\r
+ gl.enableVertexAttribArray( shaderProgram.textureCoordAttr );\r
+\r
+ // Set light normal vectors for lighting~\r
+ shaderProgram.vertexNormalAttr = gl.getAttribLocation( shaderProgram, "aVertexNormal" );\r
+ gl.enableVertexAttribArray( shaderProgram.vertexNormalAttr );\r
+\r
+ shaderProgram.perspectiveMU = gl.getUniformLocation( shaderProgram, "uPerspectiveMatrix");\r
+ shaderProgram.transformMU = gl.getUniformLocation( shaderProgram, "uMoveMatrix");\r
+ shaderProgram.sampleUniform = gl.getUniformLocation( shaderProgram, "uSampler");\r
+\r
+ // Set light variables~\r
+ shaderProgram.normalMU = gl.getUniformLocation( shaderProgram, "nNormalMatrix");\r
+ shaderProgram.ambientColorU = gl.getUniformLocation( shaderProgram, "uAmbientColor");\r
+ shaderProgram.lightDirU_first = gl.getUniformLocation( shaderProgram, "uLightDirection_first");\r
+ shaderProgram.lightDirU_second = gl.getUniformLocation( shaderProgram, "uLightDirection_second");\r
+ shaderProgram.directionColorU = gl.getUniformLocation( shaderProgram, "uDirectionColor");\r
+\r
+ return shaderProgram;\r
+ },\r
+\r
+ _initBuffers: function ( gl, shaderProgram ) {\r
+ var self = this,\r
+ i = 0,\r
+ mashBase = 0,\r
+ vertices = [],\r
+ textureCoords = [],\r
+ normalVectors = [],\r
+ nodes = [],\r
+ maxDrawLength = self._MAX_ITEM_COUNT;\r
+\r
+ for ( i = 0; i < self._imageList.length + 1; i += 1 ) {\r
+ nodes[i] = new Node();\r
+ $.merge( vertices, nodes[i].vertices );\r
+ $.merge( textureCoords, nodes[i].textureCoords );\r
+ $.merge( normalVectors, nodes[i].normalVectors );\r
+\r
+ nodes[i].textureBuffer = gl.createBuffer();\r
+ gl.bindBuffer( gl.ELEMENT_ARRAY_BUFFER, nodes[i].textureBuffer );\r
+ mashBase = i * 4;\r
+ nodes[i].meshOrder = [\r
+ mashBase, mashBase + 1, mashBase + 2,\r
+ mashBase + 2, mashBase + 3, mashBase\r
+ ];\r
+ gl.bufferData( gl.ELEMENT_ARRAY_BUFFER, new GlArray16( nodes[i].meshOrder ), gl.STATIC_DRAW );\r
+ gl.bindBuffer( gl.ELEMENT_ARRAY_BUFFER, null ); // release buffer memory\r
+ nodes[i].textureBufferItemSize = 6;\r
+ }\r
+\r
+ self._positionBuffer = $.webgl.buffer.attribBufferData( gl, new GlArray32( vertices ) );\r
+ self._positionBuffer.itemSize = 3;\r
+\r
+ self._textureCoordBuffer = $.webgl.buffer.attribBufferData( gl, new GlArray32( textureCoords ) );\r
+ self._textureCoordBuffer.itemSize = 2;\r
+\r
+ self._normalVectorBuffer = $.webgl.buffer.attribBufferData( gl, new GlArray32( normalVectors ) ); // Vertex's normal vector for Direction light\r
+ self._normalVectorBuffer.itemSize = 3;\r
+\r
+ // Ambient light\r
+ gl.uniform3f( shaderProgram.ambientColorU, 0.1, 0.1, 0.1 );\r
+ // Direcntion light\r
+ gl.uniform3f( shaderProgram.directionColorU, 1.0, 1.0, 1.0 );\r
+\r
+ return nodes;\r
+ },\r
+\r
+ // ----------------------------------------------------------\r
+ // Texture\r
+ // ----------------------------------------------------------\r
+ _initTextures: function ( gl, nodes ) {\r
+ var self = this;\r
+\r
+ $( nodes ).each( function ( i ) {\r
+ var node = nodes[i],\r
+ url;\r
+\r
+ if ( !self._imageList[i] ) {\r
+ return false;\r
+ }\r
+\r
+ url = self._imageList[i].src;\r
+ node.texture = gl.createTexture();\r
+ self._loadImage( url, i, i, gl, nodes );\r
+ });\r
+ },\r
+\r
+ _loadImage: function ( url, i, imageID, gl, nodes ) {\r
+ var self = this,\r
+ isMipmap = false,\r
+ image,\r
+ node;\r
+\r
+ gl = gl || self._gl;\r
+ nodes = nodes || self._nodes;\r
+ isMipmap = isMipmap || false;\r
+ node = nodes[i];\r
+ node.image = node.image || new Image();\r
+\r
+ $( node.image ).one( "load", function ( e ) {\r
+ self._bindTexture( gl, node, this, isMipmap );\r
+ node.imageID = imageID;\r
+\r
+ if ( !self._animationID ) {\r
+ self._setPosition( 0, 0 );\r
+ }\r
+ });\r
+\r
+ if ( self.options.thumbnailCache ) {\r
+ $.imageloader.getThumbnail( url, function ( result ) {\r
+ if ( result === "NOT_FOUND_ERR" ) {\r
+ $.imageloader.setThumbnail( url, function ( result ) {\r
+ if ( result && result.length > 30 ) {\r
+ node.image.src = result;\r
+ isMipmap = true;\r
+ } else {\r
+ node.image.src = url;\r
+ }\r
+ });\r
+ } else if ( result && result.length > 30 ) {\r
+ node.image.src = result;\r
+ isMipmap = true;\r
+ } else {\r
+ node.image.src = url;\r
+ }\r
+ });\r
+ } else {\r
+ node.image.src = url;\r
+ }\r
+ },\r
+\r
+ _bindTexture: function ( gl, node, image, isMipmap ) {\r
+ if ( !node || !node.texture ) {\r
+ return;\r
+ }\r
+\r
+ gl.pixelStorei( gl.UNPACK_FLIP_Y_WEBGL, true );\r
+\r
+ gl.bindTexture( gl.TEXTURE_2D, node.texture );\r
+ gl.texImage2D( gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, image );\r
+\r
+ if ( isMipmap ) {\r
+ gl.texParameteri( gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR );\r
+ gl.texParameteri( gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR_MIPMAP_NEAREST );\r
+ gl.generateMipmap( gl.TEXTURE_2D );\r
+ } else {\r
+ gl.texParameteri( gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR );\r
+ gl.texParameteri( gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR );\r
+ }\r
+\r
+ gl.texParameteri( gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE );\r
+ gl.texParameteri( gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE );\r
+\r
+ node.texture.loaded = true;\r
+\r
+ // release texture memory\r
+ gl.bindTexture( gl.TEXTURE_2D, null );\r
+ },\r
+\r
+ // ----------------------------------------------------------\r
+ // rendering\r
+ // ----------------------------------------------------------\r
+ _setPosition: function ( progress, direction ) {\r
+ var self = this,\r
+ nodes = self._nodes,\r
+ imageList = self._imageList,\r
+ imageListLength = imageList.length,\r
+ itemCount = self._MAX_ITEM_COUNT,\r
+ displayLength = ( imageListLength > itemCount ) ? itemCount : imageListLength,\r
+ nextLevelLenth = 0,\r
+ i = 0,\r
+ t = 0,\r
+ position = 0,\r
+ angle = 0,\r
+ current = 0,\r
+ next = 0,\r
+ nextLevel = 0,\r
+ path = self._path,\r
+ nextImageID = 0;\r
+\r
+ nextLevelLenth = ( direction >= 0 ) ? displayLength + 1 : displayLength;\r
+\r
+ if ( !nodes[i].level ) {\r
+ nodes[i].level = displayLength;\r
+ }\r
+\r
+ for ( i = 0; i < displayLength; i += 1 ) {\r
+ if ( !nodes[i].mvMatrix ) {\r
+ nodes[i].mvMatrix = mat4.create();\r
+ }\r
+\r
+ if ( direction > 0 && nodes[i].level >= displayLength ) {\r
+ nodes[i].level = 0;\r
+ }\r
+\r
+ current = path.levels[nodes[i].level];\r
+ nextLevel = ( nodes[i].level + nextLevelLenth + direction ) % nextLevelLenth;\r
+ next = path.levels[nextLevel];\r
+\r
+ if ( imageListLength > itemCount ) {\r
+ if ( direction > 0 && nextLevel === 1\r
+ && self._firstImageNumber !== nodes[i].imageID ) {\r
+ self._loadImage( imageList[self._firstImageNumber].src, i, self._firstImageNumber );\r
+ } else if ( direction < 0 && nextLevel === nextLevelLenth - 1\r
+ && self._lastImageNumber !== nodes[i].imageID ) {\r
+ self._loadImage( imageList[self._lastImageNumber].src, i, self._lastImageNumber );\r
+ }\r
+ }\r
+\r
+ mat4.identity( nodes[i].mvMatrix );\r
+ mat4.translate( nodes[i].mvMatrix, [-2.0, -2.0, 1.0] );\r
+ mat4.rotate( nodes[i].mvMatrix, self._degreeToRadian( 19 ), [1, 0, 0] );\r
+\r
+ t = ( current + ( next - current ) * ( ( progress > 1 ) ? 1 : progress ) );\r
+\r
+ if ( progress >= self._ANIMATION_END ) {\r
+ nodes[i].level = nextLevel || displayLength;\r
+ t = path.levels[nodes[i].level];\r
+ }\r
+\r
+ if ( ( progress < self._ANIMATION_END )\r
+ && ( direction <= 0 && nodes[i].level < 1 ) ) {\r
+ nodes[i].drawable = false;\r
+ } else {\r
+ nodes[i].drawable = true;\r
+ }\r
+\r
+ if ( progress === self._ANIMATION_END && nodes[i].level === 1 ) {\r
+ self.element.trigger( "select", imageList[ nodes[i].imageID ], nodes[i].imageID );\r
+ }\r
+\r
+ position = path.getPosition( t );\r
+ angle = path.getAngle( t );\r
+\r
+ mat4.translate( nodes[i].mvMatrix, position );\r
+ mat4.rotate( nodes[i].mvMatrix, angle, [0, 1, 0] );\r
+ }\r
+\r
+ if ( imageListLength > itemCount && progress >= self._ANIMATION_END ) {\r
+ self._firstImageNumber = ( self._firstImageNumber - direction ) % imageListLength;\r
+ if ( self._firstImageNumber < 0 ) {\r
+ self._firstImageNumber = imageListLength - 1;\r
+ }\r
+\r
+ self._lastImageNumber = ( self._lastImageNumber - direction ) % imageListLength;\r
+ if ( self._lastImageNumber < 0 ) {\r
+ self._lastImageNumber = imageListLength - 1;\r
+ }\r
+ }\r
+ self._drawScene();\r
+ },\r
+\r
+ _drawScene: function () {\r
+ if ( !this._gl || !this._shaderProgram ) {\r
+ return;\r
+ }\r
+\r
+ var self = this,\r
+ gl = self._gl,\r
+ shaderProgram = self._shaderProgram,\r
+ nodes = self._nodes,\r
+ nodesLength = nodes.length,\r
+ i;\r
+\r
+ gl.clear( gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT );\r
+\r
+ gl.bindBuffer( gl.ARRAY_BUFFER, self._positionBuffer );\r
+ gl.vertexAttribPointer( shaderProgram.vertexPositionAttr, self._positionBuffer.itemSize, gl.FLOAT, false, 0, 0 );\r
+\r
+ gl.bindBuffer( gl.ARRAY_BUFFER, self._textureCoordBuffer );\r
+ gl.vertexAttribPointer( shaderProgram.textureCoordAttr, self._textureCoordBuffer.itemSize, gl.FLOAT, false, 0, 0 );\r
+\r
+ gl.bindBuffer( gl.ARRAY_BUFFER, self._normalVectorBuffer );\r
+ gl.vertexAttribPointer( shaderProgram.vertexNormalAttr, self._normalVectorBuffer.itemSize, gl.FLOAT, false, 0, 0 );\r
+\r
+ for ( i = 0; i < nodesLength; i += 1 ) {\r
+ if ( nodes[i].drawable ) {\r
+ self._drawElement( self._pMatrix, nodes[i] );\r
+ }\r
+ }\r
+ },\r
+\r
+ _drawElement: function ( perspectiveMatrix, targetNode ) {\r
+ var self = this,\r
+ gl = self._gl,\r
+ shaderProgram = self._shaderProgram,\r
+ moveMatrix = targetNode.mvMatrix,\r
+ texture = targetNode.texture,\r
+ meshIndexBuffer = targetNode.textureBuffer,\r
+ meshIndexBufferItemSize = targetNode.textureBufferItemSize,\r
+ lightPositions = self._lightsPositionStack,\r
+ LightDir,\r
+ normalMatrix;\r
+\r
+ if ( !moveMatrix ) {\r
+ return;\r
+ }\r
+\r
+ gl.activeTexture( gl.TEXTURE0 );\r
+ if ( texture && texture.loaded ) {\r
+ gl.bindTexture( gl.TEXTURE_2D, texture );\r
+ }\r
+ gl.uniform1i( shaderProgram.sampleUniform, 0 );\r
+\r
+ LightDir = vec3.create();\r
+ vec3.normalize( lightPositions[0], LightDir );\r
+ vec3.scale( LightDir, -8 );\r
+ gl.uniform3fv( shaderProgram.lightDirU_first, LightDir );\r
+\r
+ vec3.normalize( lightPositions[1], LightDir );\r
+ vec3.scale( LightDir, -1 );\r
+ gl.uniform3fv( shaderProgram.lightDirU_second, LightDir );\r
+ gl.bindBuffer( gl.ELEMENT_ARRAY_BUFFER, meshIndexBuffer );\r
+\r
+ gl.uniformMatrix4fv( shaderProgram.perspectiveMU, false, perspectiveMatrix );\r
+ gl.uniformMatrix4fv( shaderProgram.transformMU, false, moveMatrix );\r
+\r
+ normalMatrix = mat3.create();\r
+ mat4.toInverseMat3( moveMatrix, normalMatrix );\r
+ mat3.transpose( normalMatrix );\r
+ gl.uniformMatrix3fv( shaderProgram.normalMU, false, normalMatrix );\r
+\r
+ gl.drawElements( gl.TRIANGLES, meshIndexBufferItemSize, gl.UNSIGNED_SHORT, 0 );\r
+\r
+ // release buffer memory\r
+ gl.bindBuffer( gl.ARRAY_BUFFER, null );\r
+ gl.bindBuffer( gl.ELEMENT_ARRAY_BUFFER, null );\r
+\r
+ // release texture memory\r
+ gl.bindTexture( gl.TEXTURE_2D, null );\r
+ },\r
+\r
+ // ----------------------------------------------------------\r
+ // Animation\r
+ // ----------------------------------------------------------\r
+ _animate: function ( easingType, duration, direction, repeatCount, startValue, _removeCount ) {\r
+ var self = this,\r
+ timeNow = $.now(),\r
+ progress,\r
+ removeCount = 0;\r
+\r
+ easingType = easingType || "linear";\r
+ startValue = startValue || 0;\r
+ _removeCount = _removeCount || 0;\r
+\r
+ if ( self._sumTime >= duration ) {\r
+ self._setPosition( self._ANIMATION_END, direction );\r
+ self._stop();\r
+ return;\r
+ }\r
+\r
+ if ( self._startTime === 0 ) {\r
+ self._startTime = timeNow;\r
+ } else {\r
+ self._sumTime = timeNow - self._startTime;\r
+ progress = $.easing[ easingType ]( self._sumTime / duration, self._sumTime, startValue, repeatCount + 1, duration );\r
+ removeCount = parseInt( Math.abs( progress ), 10 );\r
+\r
+ if ( _removeCount !== removeCount ) {\r
+ self._setPosition( self._ANIMATION_END, direction );\r
+ _removeCount = removeCount;\r
+\r
+ if ( ( repeatCount - _removeCount ) >= 0 ) {\r
+ self._animate( easingType, duration, direction, repeatCount, startValue, _removeCount );\r
+ } else {\r
+ self._stop();\r
+ }\r
+ return;\r
+ }\r
+\r
+ self._setPosition( progress - _removeCount, direction );\r
+ }\r
+\r
+ self._animationID = window.requestAnimationFrame( function () {\r
+ self._animate( easingType, duration, direction, repeatCount, startValue, _removeCount );\r
+ });\r
+ },\r
+\r
+ _run: function ( direction, repeatCount, startValue ) {\r
+ var self = this,\r
+ repeat = repeatCount || 0,\r
+ duration = self._DURATION_DEFAULT * ( repeat + 1 );\r
+\r
+ if ( self._imageList.length <= 1 ) {\r
+ return;\r
+ }\r
+\r
+ startValue = startValue || 0;\r
+ duration = ( duration >= 0 ) ? duration : 0;\r
+\r
+ if ( self._animationID ) {\r
+ self._setPosition( self._ANIMATION_END, direction );\r
+ self._stop();\r
+ }\r
+\r
+ self._animate( "easeOutExpo", duration, direction, repeat, startValue );\r
+ },\r
+\r
+ _reset: function () {\r
+ if ( !this._canvas || !this._gl ) {\r
+ return;\r
+ }\r
+\r
+ this._final();\r
+ this._init();\r
+ this.refresh();\r
+ },\r
+\r
+ _stop: function () {\r
+ if ( this._animationID ) {\r
+ window.cancelAnimationFrame( this._animationID );\r
+ }\r
+ this._animationID = 0;\r
+\r
+ this._startTime = 0;\r
+ this._sumTime = 0;\r
+ },\r
+\r
+ _degreeToRadian: function ( degree ) {\r
+ return degree * Math.PI / 180;\r
+ },\r
+\r
+ next: function () {\r
+ this._run( this._DIRECTION_LEFT , 0 );\r
+ },\r
+\r
+ prev: function () {\r
+ this._run( this._DIRECTION_RIGHT, 0 );\r
+ },\r
+\r
+ refresh: function () {\r
+ var view = this.element,\r
+ canvas = view.find( "canvas.ui-gallery3d-canvas" );\r
+\r
+ if ( canvas.width() !== view.width() ) {\r
+ canvas.width( view.width() );\r
+ }\r
+\r
+ if ( !this._animationID ) {\r
+ this._setPosition( 0, 0 );\r
+ }\r
+ },\r
+\r
+ select: function ( index ) {\r
+ var nodes = this._nodes,\r
+ repeat,\r
+ i,\r
+ imageID,\r
+ object = null,\r
+ target = 0,\r
+ direction = 0;\r
+\r
+ if ( index && this._animationID ) {\r
+ this._stop();\r
+ }\r
+\r
+ for ( i in nodes ) {\r
+ if ( nodes[i].level === 1 ) {\r
+ object = this._imageList[ nodes[i].imageID ];\r
+ imageID = nodes[i].imageID;\r
+ break;\r
+ }\r
+ }\r
+\r
+ if ( !index ) {\r
+ return object;\r
+ }\r
+\r
+ if ( index < 0 && index >= this._imageList.length ) {\r
+ return;\r
+ }\r
+\r
+ target = index - imageID;\r
+ direction = ( target > 0 ) ? this._DIRECTION_LEFT\r
+ : ( ( target < 0 ) ? this._DIRECTION_RIGHT : 0 );\r
+ if ( direction ) {\r
+ this._run( direction, Math.abs( target ) - 1 );\r
+ }\r
+ },\r
+\r
+ add: function ( item, index ) {\r
+ if ( !item ) {\r
+ return;\r
+ }\r
+\r
+ if ( typeof item === "string" ) {\r
+ item = { "src" : item };\r
+ }\r
+\r
+ index = index || 0;\r
+ if ( typeof index !== "number" && index < 0\r
+ && index >= this._imageList.length ) {\r
+ return;\r
+ }\r
+\r
+ this._imageList.splice( index, 0, item );\r
+ if ( this._gl ) {\r
+ this._reset();\r
+ }\r
+ },\r
+\r
+ remove: function ( index ) {\r
+ index = index || 0;\r
+ if ( typeof index !== "number" && index < 0\r
+ && index >= this._imageList.length ) {\r
+ return;\r
+ }\r
+\r
+ this._imageList.splice( index, 1 );\r
+ if ( this._gl ) {\r
+ this._reset();\r
+ }\r
+ },\r
+\r
+ clearThumbnailCache: function () {\r
+ if ( !this._nodes || ( this._nodes.length <= 0 ) ) {\r
+ return;\r
+ }\r
+\r
+ var i, url;\r
+ for ( i = 0; i < this._imageList.length; i += 1 ) {\r
+ url = this._imageList[i].src;\r
+ $.imageloader.removeThumbnail( url );\r
+ }\r
+ },\r
+\r
+ empty: function () {\r
+ this._imageList = [];\r
+ this._reset();\r
+ },\r
+\r
+ length: function () {\r
+ return this._imageList.length;\r
+ }\r
+ });\r
+\r
+ $( document ).bind( "pagecreate create", function ( e ) {\r
+ $( ":jqmData(role='gallery3d')" ).gallery3d();\r
+ });\r
+\r
+} ( jQuery, document, window ) );\r
+\r
--- /dev/null
+
+/* ***************************************************************************
+* style : normal, check
+* option :
+* - folded : decide to show divider press effect or not
+* - line : decide to draw divider line or not
+*/
+/**
+ @class ListDivider
+ The list divider widget is used as a list separator for grouping lists. List dividers can be used in Tizen as described in the jQueryMobile documentation for list dividers.<br/>
+ To add a list divider widget to the application, use the following code:
+
+ <li data-role="list-divider" data-style="check">
+ <form><input type="checkbox" name="c2line-check1" /></form></li>
+
+ The list divider can define callbacks for events as described in the jQueryMobile documentation for list events. <br/> You can use methods with the list divider as described in the jQueryMobile documentation for list methods.
+
+ @since tizen2.0
+*/
+/**
+ @property {String} data-style
+ Sets the style of the list divider. The style options are dialogue, check, expandable, and checkexpandable.
+*/
+
+(function ( $, undefined ) {
+ $.widget( "tizen.listdivider", $.mobile.widget, {
+ options: {
+ initSelector: ":jqmData(role='list-divider')",
+ folded : false,
+ listDividerLine : true,
+ },
+
+ _create: function () {
+
+ var $listdivider = this.element,
+ openStatus = true,
+ expandSrc,
+ listDividerLine = true,
+ style = $listdivider.attr( "data-style" );
+
+ if ( $listdivider.data("line") === false ) {
+ this.options.listDividerLine = false;
+ }
+
+ if ( $listdivider.data("folded") === true ) {
+ this.options.folded = true;
+ }
+
+ if ( style == undefined || style === "normal" || style === "check" ) {
+ if ( this.options.folded ) {
+ $listdivider.buttonMarkup();
+ } else {
+ $listdivider.wrapInner("<span class='ui-btn-text'></span>");
+ }
+
+ if ( this.options.listDividerLine ) {
+ expandSrc = "<span class='ui-divider-normal-line'></span>";
+ if ( this.options.folded ) {
+ $( expandSrc ).appendTo( $listdivider.children( ".ui-btn-inner" ) );
+ } else {
+ $( expandSrc ).appendTo( $listdivider);
+ }
+ }
+ }
+
+ $listdivider.bind( "vclick", function ( event, ui ) {
+ /* need to implement expand/collapse divider */
+ });
+ },
+ });
+
+ //auto self-init widgets
+ $( document ).bind( "pagecreate create", function ( e ) {
+ $( $.tizen.listdivider.prototype.options.initSelector, e.target ).listdivider();
+ });
+}( jQuery ) );
+
--- /dev/null
+
+/* ***************************************************************************
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * ***************************************************************************
+ *
+ * Authors: Yonghwi Park <yonghwi0324.park@samsung.com>
+ * Wonseop Kim <wonseop.kim@samsung.com>
+*/
+
+/**
+ *
+ * MultiMediaView is a widget that lets the user view and handle multimedia contents.
+ * Video and audio elements are coded as standard HTML elements and enhanced by the
+ * MultiMediaview to make them attractive and usable on a mobile device.
+ *
+ * HTML Attributes:
+ * data-theme : Set a theme of widget.
+ * If this value is not defined, widget will use parent`s theme. (optional)
+ * data-controls : If this value is 'true', widget will use belonging controller.
+ * If this value is 'false', widget will use browser`s controller.
+ * Default value is 'true'.
+ * data-full-screen : Set a status that full-screen when inital start.
+ * Default value is 'false'.
+ *
+ * APIs:
+ * width( [number] )
+ * : Get or set the width of widget.
+ * The first argument is the width of widget.
+ * If no first argument is specified, will act as a getter.
+ * height( [number] )
+ * : Get or set the height of widget.
+ * The first argument is the height of widget.
+ * If no first argument is specified, will act as a getter.
+ * fullScreen( [boolean] )
+ * : Get or Set the status of full-screen.
+ * If no first argument is specified, will act as a getter.
+ *
+ * Events:
+ *
+ * create : triggered when a multimediaview is created.
+ *
+ * Examples:
+ *
+ * VIDEO :
+ * <video data-controls="true" style="width:100%;">
+ * <source src="media/oceans-clip.mp4" type="video/mp4" />
+ * Your browser does not support the video tag.
+ * </video>
+ *
+ * AUDIO :
+ * <audio data-controls="true" style="width:100%;">
+ * <source src="media/Over the horizon.mp3" type="audio/mp3" />
+ * Your browser does not support the audio tag.
+ * </audio>
+ *
+ */
+/**
+ @class MutimediaView
+ The multimedia view widget shows a player control that you can use to view and handle multimedia content. This widget uses the standard HTML video and audio elements, which have been enhanced for use on a mobile device.
+
+ To add a multimedia view widget to the application, use the following code:
+
+ // Video player control
+ <video data-controls="true" style="width:100%;">
+ <source src="<VIDEO_FILE_URL>" type="video/mp4" /> Your browser does not support the video tag. </video>
+ // Audio player control
+ <audio data-controls="true" style="width:100%;"> <source src="<AUDIO_FILE_URL>" type="audio/mp3" /> Your browser does not support the audio tag.
+ </audio>
+
+ The multimedia view can define a callback for the create event, which is fired when the widget is created.
+ $('.selector').multimediaview({
+ create:function(event, u){...}
+ });
+ $(".selector").bind("create", function(event, ui)
+ {
+ // Respond to the multimedia view widget creation
+ });
+*/
+/**
+ @property {Boolean} data-control
+ Sets the controls for the widget.
+ The default value is true. If the value is set to true, the widget uses its own player controls. If the value is set to false, the widget uses the browser's player controls.
+*/
+/**
+ @property {Boolean} data-full-screen
+ Defines whether the widget opens in the fullscreen view mode.
+ The default value is false.
+*/
+/**
+ @property {String} data-theme
+ Sets the widget theme.
+ If the value is not set, the parent control's theme is used
+*/
+/**
+ @method width
+ The width method is used to get (if no value is defined) or set the multimedia view widget width:
+ <video>
+ <source src="test.mp4" type="video/mp4" />
+ </video>
+ $(".selector").multimediaview("width", [value]);
+*/
+/**
+ @method height
+ The height method is used to get (if no value is defined) or set the multimedia view widget height:
+ <video>
+ <source src="test.mp4" type="video/mp4" />
+ </video>
+ $(".selector").multimediaview("height", [value]);
+*/
+/**
+ @method fullScreen
+ The fullScreen method is used to get (if no value is defined) or set the full-screen mode of the multimedia view widget. If the value is true, the full-screen mode is used; otherwise the multimedia view widget runs in the normal mode.
+
+ <video>
+ <source src="test.mp4" type="video/mp4" />
+ </video>
+ $(".selector").multimediaview("fullScreen", [value]);
+*/
+( function ( $, document, window, undefined ) {
+ $.widget( "tizen.multimediaview", $.mobile.widget, {
+ options: {
+ theme: null,
+ controls: true,
+ fullScreen: false,
+ initSelector: "video, audio"
+ },
+
+ _create: function () {
+ var self = this,
+ view = self.element,
+ viewElement = view[0],
+ isVideo = ( viewElement.nodeName === "VIDEO" ),
+ option = self.options,
+ parentTheme = $.mobile.getInheritedTheme( view, "s" ),
+ theme = option.theme || parentTheme,
+ width = viewElement.style.getPropertyValue( "width" ) || "",
+ wrap = $( "<div class='ui-multimediaview-wrap ui-multimediaview-" + theme + "'>" ),
+ control = null;
+
+ $.extend( this, {
+ role: null,
+ controlTimer: null,
+ isVolumeHide: true,
+ backupView: null,
+ _reserveVolume: -1,
+ _isVideo: isVideo
+ });
+
+ view.addClass( "ui-multimediaview" );
+ control = self._createControl();
+ control.hide();
+
+ control.find( ".ui-button" ).each( function ( index ) {
+ $( this ).buttonMarkup( { corners: true, theme: theme, shadow: true } );
+ });
+
+ view.wrap( wrap ).after( control );
+
+ if ( isVideo ) {
+ control.addClass( "ui-multimediaview-video" );
+ } else {
+ self.width( width );
+ self.options.fullScreen = false;
+ }
+
+ if ( option.controls && view.attr( "controls" ) ) {
+ view.removeAttr( "controls" );
+ }
+
+ self._addEvent();
+ },
+
+ _resize: function () {
+ this._resizeFullscreen( this.options.fullScreen );
+ this._resizeControl();
+ this._updateSeekBar();
+ this._updateVolumeState();
+ },
+
+ _resizeControl: function () {
+ var self = this,
+ view = self.element,
+ viewElement = view[0],
+ isVideo = self._isVideo,
+ wrap = view.parent( ".ui-multimediaview-wrap" ),
+ control = wrap.find( ".ui-multimediaview-control" ),
+ buttons = control.find( ".ui-button" ),
+ playpauseButton = control.find( ".ui-playpausebutton" ),
+ seekBar = control.find( ".ui-seekbar" ),
+ durationLabel = control.find( ".ui-durationlabel" ),
+ timestampLabel = control.find( ".ui-timestamplabel" ),
+ volumeControl = control.find( ".ui-volumecontrol" ),
+ volumeBar = volumeControl.find( ".ui-volumebar" ),
+ width = ( isVideo ? view.width() : wrap.width() ),
+ height = ( isVideo ? view.height() : control.height() ),
+ offset = view.offset(),
+ controlHeight = control.height(),
+ availableWidth = 0,
+ controlOffset = null;
+
+ if ( control ) {
+ if ( isVideo ) {
+ controlOffset = control.offset();
+ controlOffset.left = offset.left;
+ controlOffset.top = offset.top + height - controlHeight;
+ control.offset( controlOffset );
+ }
+ control.width( width );
+ }
+
+ if ( seekBar ) {
+ availableWidth = control.width() - ( buttons.outerWidth( true ) * buttons.length );
+ availableWidth -= ( parseInt( buttons.eq( 0 ).css( "margin-left" ), 10 ) + parseInt( buttons.eq( 0 ).css( "margin-right" ), 10 ) ) * buttons.length;
+ if ( !self.isVolumeHide ) {
+ availableWidth -= volumeControl.outerWidth( true );
+ }
+ seekBar.width( availableWidth );
+ }
+
+ if ( durationLabel && !isNaN( viewElement.duration ) ) {
+ durationLabel.find( "p" ).text( self._convertTimeFormat( viewElement.duration ) );
+ }
+
+ if ( viewElement.autoplay && viewElement.paused === false ) {
+ playpauseButton.removeClass( "ui-play-icon" ).addClass( "ui-pause-icon" );
+ }
+
+ if ( seekBar.width() < ( volumeBar.width() + timestampLabel.width() + durationLabel.width() ) ) {
+ durationLabel.hide();
+ } else {
+ durationLabel.show();
+ }
+ },
+
+ _resizeFullscreen: function ( isFullscreen ) {
+ if ( !this._isVideo ) {
+ return;
+ }
+
+ var self = this,
+ view = self.element,
+ viewElement = view[0],
+ wrap = view.parent( ".ui-multimediaview-wrap" ),
+ control = wrap.find( ".ui-multimediaview-control" ),
+ fullscreenButton = control.find( ".ui-fullscreenbutton" ),
+ currentPage = $( ".ui-page-active" ),
+ playpauseButton = control.find( ".ui-playpausebutton" ),
+ timestampLabel = control.find( ".ui-timestamplabel" ),
+ seekBar = control.find( ".ui-seekbar" ),
+ durationBar = seekBar.find( ".ui-duration" ),
+ currenttimeBar = seekBar.find( ".ui-currenttime" ),
+ body = $( "body" )[0],
+ header = currentPage.children( ".ui-header" ),
+ footer = currentPage.children( ".ui-footer" ),
+ docWidth = 0,
+ docHeight = 0;
+
+ if ( isFullscreen ) {
+ if ( !self.backupView ) {
+ self.backupView = {
+ width: viewElement.style.getPropertyValue( "width" ) || "",
+ height: viewElement.style.getPropertyValue( "height" ) || "",
+ position: view.css( "position" ),
+ zindex: view.css( "z-index" ),
+ wrapHeight: wrap[0].style.getPropertyValue( "height" ) || ""
+ };
+ }
+ docWidth = body.clientWidth;
+ docHeight = body.clientHeight;
+
+ header.hide();
+ footer.hide();
+ view.parents().each( function ( e ) {
+ var element = $( this );
+ element.addClass( "ui-fullscreen-parents" )
+ .siblings()
+ .addClass( "ui-multimediaview-siblings-off" );
+ });
+ this._fitContentArea( currentPage );
+ fullscreenButton.removeClass( "ui-fullscreen-on" ).addClass( "ui-fullscreen-off" );
+
+ view.width( docWidth ).height( docHeight - 1 );
+ wrap.height( docHeight - 1 );
+ view.offset( {
+ top: 0,
+ left: 0
+ }).addClass( "ui-multimediaview-fullscreen" );
+ } else {
+ if ( !self.backupView ) {
+ return;
+ }
+
+ header.show();
+ footer.show();
+ view.parents().each( function ( e ) {
+ var element = $( this );
+ element.removeClass( "ui-fullscreen-parents" )
+ .siblings()
+ .removeClass( "ui-multimediaview-siblings-off" );
+ });
+ this._fitContentArea( currentPage );
+ fullscreenButton.removeClass( "ui-fullscreen-off" ).addClass( "ui-fullscreen-on" );
+
+ wrap.css( "height", self.backupView.wrapHeight );
+ view.css( {
+ "width": self.backupView.width,
+ "height": self.backupView.height,
+ "position": self.backupView.position,
+ "z-index": self.backupView.zindex
+ }).removeClass( "ui-multimediaview-fullscreen" );
+ self.backupView = null;
+ }
+ },
+
+ _addEvent: function () {
+ var self = this,
+ view = self.element,
+ option = self.options,
+ viewElement = view[0],
+ isVideo = self._isVideo,
+ control = view.parent( ".ui-multimediaview-wrap" ).find( ".ui-multimediaview-control" ),
+ playpauseButton = control.find( ".ui-playpausebutton" ),
+ timestampLabel = control.find( ".ui-timestamplabel" ),
+ durationLabel = control.find( ".ui-durationlabel" ),
+ volumeButton = control.find( ".ui-volumebutton" ),
+ volumeControl = control.find( ".ui-volumecontrol" ),
+ volumeBar = volumeControl.find( ".ui-volumebar" ),
+ volumeGuide = volumeControl.find( ".ui-guide" ),
+ volumeHandle = volumeControl.find( ".ui-handle" ),
+ fullscreenButton = control.find( ".ui-fullscreenbutton" ),
+ seekBar = control.find( ".ui-seekbar" ),
+ durationBar = seekBar.find( ".ui-duration" ),
+ currenttimeBar = seekBar.find( ".ui-currenttime" ),
+ $document = $( document );
+
+ $document.unbind( ".multimediaview" ).bind( "pagechange.multimediaview", function ( e ) {
+ var $page = $( e.target );
+ if ( $page.find( view ).length > 0 && viewElement.autoplay ) {
+ viewElement.play();
+ }
+
+ if ( option.controls ) {
+ self._resize();
+ }
+ }).bind( "pagebeforechange.multimediaview", function ( e ) {
+ if ( option.fullScreen ) {
+ self.fullScreen( !option.fullScreen );
+ }
+
+ if ( viewElement.played.length !== 0 ) {
+ viewElement.pause();
+ }
+ });
+
+ $( window ).unbind( ".multimediaview" ).bind( "resize.multimediaview orientationchange.multimediaview", function ( e ) {
+ if ( !option.controls ) {
+ return;
+ }
+ var $page = $( e.target ),
+ $scrollview = view.parents( ".ui-scrollview-clip" );
+
+ $scrollview.each( function ( i ) {
+ if ( $.data( this, "scrollview" ) ) {
+ $( this ).scrollview( "scrollTo", 0, 0 );
+ }
+ });
+
+ // for maintaining page layout
+ if ( !option.fullScreen ) {
+ $( ".ui-footer:visible" ).show();
+ } else {
+ $( ".ui-footer" ).hide();
+ self._fitContentArea( $page );
+ }
+
+ if ( control.css( "display" ) !== "none" ) {
+ self._resize();
+ }
+ });
+
+ view.bind( "loadedmetadata.multimediaview", function ( e ) {
+ if ( !isNaN( viewElement.duration ) ) {
+ durationLabel.find( "p" ).text( self._convertTimeFormat( viewElement.duration ) );
+ }
+ self._resize();
+ }).bind( "timeupdate.multimediaview", function ( e ) {
+ self._updateSeekBar();
+ }).bind( "play.multimediaview", function ( e ) {
+ playpauseButton.removeClass( "ui-play-icon" ).addClass( "ui-pause-icon" );
+ }).bind( "pause.multimediaview", function ( e ) {
+ playpauseButton.removeClass( "ui-pause-icon" ).addClass( "ui-play-icon" );
+ }).bind( "ended.multimediaview", function ( e ) {
+ if ( typeof viewElement.loop == "undefined" || viewElement.loop === "" ) {
+ self.stop();
+ }
+ }).bind( "volumechange.multimediaview", function ( e ) {
+ if ( viewElement.muted && viewElement.volume > 0.1 ) {
+ volumeButton.removeClass( "ui-volume-icon" ).addClass( "ui-mute-icon" );
+ self._reserveVolume = viewElement.volume;
+ viewElement.volume = 0;
+ } else if ( self._reserveVolume !== -1 && !viewElement.muted ) {
+ volumeButton.removeClass( "ui-mute-icon" ).addClass( "ui-volume-icon" );
+ viewElement.volume = self._reserveVolume;
+ self._reserveVolume = -1;
+ } else if ( viewElement.volume < 0.1 ) {
+ volumeButton.removeClass( "ui-volume-icon" ).addClass( "ui-mute-icon" );
+ } else {
+ volumeButton.removeClass( "ui-mute-icon" ).addClass( "ui-volume-icon" );
+ }
+
+ if ( !self.isVolumeHide ) {
+ self._updateVolumeState();
+ }
+ }).bind( "durationchange.multimediaview", function ( e ) {
+ if ( !isNaN( viewElement.duration ) ) {
+ durationLabel.find( "p" ).text( self._convertTimeFormat( viewElement.duration ) );
+ }
+ self._resize();
+ }).bind( "click.multimediaview", function ( e ) {
+ if ( !self.options.controls ) {
+ return;
+ }
+
+ control.fadeToggle( "fast" );
+ self._resize();
+ }).bind( "multimediaviewinit", function ( e ) {
+ if ( option.controls ) {
+ control.show();
+ }
+ self._resize();
+ });
+
+ playpauseButton.bind( "click.multimediaview", function () {
+ self._endTimer();
+
+ if ( viewElement.paused ) {
+ viewElement.play();
+ } else {
+ viewElement.pause();
+ }
+
+ if ( isVideo ) {
+ self._startTimer();
+ }
+ });
+
+ fullscreenButton.bind( "click.multimediaview", function ( e ) {
+ e.preventDefault();
+ self.fullScreen( !self.options.fullScreen );
+ control.fadeIn( "fast", function () {
+ self._resize();
+ });
+ self._endTimer();
+ e.stopPropagation();
+ });
+
+ seekBar.bind( "vmousedown.multimediaview", function ( e ) {
+ var x = e.clientX,
+ duration = viewElement.duration,
+ durationOffset = durationBar.offset(),
+ durationWidth = durationBar.width(),
+ timerate = ( x - durationOffset.left ) / durationWidth,
+ time = duration * timerate;
+
+ if ( !viewElement.played.length ) {
+ return;
+ }
+
+ viewElement.currentTime = time;
+
+ self._endTimer();
+
+ e.preventDefault();
+
+ $document.bind( "vmousemove.multimediaview", function ( e ) {
+ var x = e.clientX,
+ timerate = ( x - durationOffset.left ) / durationWidth;
+
+ viewElement.currentTime = duration * timerate;
+
+ e.preventDefault();
+ }).bind( "vmouseup.multimediaview", function () {
+ $document.unbind( "vmousemove.multimediaview vmouseup.multimediaview" );
+ if ( viewElement.paused ) {
+ viewElement.pause();
+ } else {
+ viewElement.play();
+ }
+ });
+ });
+
+ volumeButton.bind( "click.multimediaview", function () {
+ if ( self.isVolumeHide ) {
+ var view = self.element,
+ volume = viewElement.volume;
+
+ self.isVolumeHide = false;
+ volumeControl.fadeIn( "fast", function () {
+ self._updateVolumeState();
+ self._updateSeekBar();
+ });
+ self._resize();
+ } else {
+ self.isVolumeHide = true;
+ volumeControl.fadeOut( "fast", function () {
+ self._resize();
+ });
+ }
+ });
+
+ volumeBar.bind( "vmousedown.multimediaview", function ( e ) {
+ var baseX = e.clientX,
+ volumeGuideLeft = volumeGuide.offset().left,
+ volumeGuideWidth = volumeGuide.width(),
+ volumeBase = volumeGuideLeft + volumeGuideWidth,
+ handlerOffset = volumeHandle.offset(),
+ volumerate = ( baseX - volumeGuideLeft ) / volumeGuideWidth,
+ currentVolume = ( baseX - volumeGuideLeft ) / volumeGuideWidth;
+
+ self._endTimer();
+ self._setVolume( currentVolume.toFixed( 2 ) );
+
+ e.preventDefault();
+
+ $document.bind( "vmousemove.multimediaview", function ( e ) {
+ var currentX = e.clientX,
+ currentVolume = ( currentX - volumeGuideLeft ) / volumeGuideWidth;
+
+ self._setVolume( currentVolume.toFixed( 2 ) );
+
+ e.preventDefault();
+ }).bind( "vmouseup.multimediaview", function () {
+ $document.unbind( "vmousemove.multimediaview vmouseup.multimediaview" );
+ });
+ });
+ },
+
+ _removeEvent: function () {
+ var view = this.element,
+ control = view.parent( ".ui-multimediaview-wrap" ).find( ".ui-multimediaview-control" ),
+ playpauseButton = control.find( ".ui-playpausebutton" ),
+ fullscreenButton = control.find( ".ui-fullscreenbutton" ),
+ seekBar = control.find( ".ui-seekbar" ),
+ volumeControl = control.find( ".ui-volumecontrol" ),
+ volumeBar = volumeControl.find( ".ui-volumebar" ),
+ volumeHandle = volumeControl.find( ".ui-handle" );
+
+ view.unbind( ".multimediaview" );
+ playpauseButton.unbind( ".multimediaview" );
+ fullscreenButton.unbind( ".multimediaview" );
+ seekBar.unbind( ".multimediaview" );
+ volumeBar.unbind( ".multimediaview" );
+ volumeHandle.unbind( ".multimediaview" );
+ },
+
+ _createControl: function () {
+ var view = this.element,
+ viewElement = view[0],
+ control = $( "<span></span>" ).addClass( "ui-multimediaview-control" ),
+ playpauseButton = $( "<span></span>" ).addClass( "ui-playpausebutton ui-button" ),
+ seekBar = $( "<span></span>" ).addClass( "ui-seekbar ui-multimediaview-bar" ),
+ timestampLabel = $( "<span><p>00:00:00</p></span>" ).addClass( "ui-timestamplabel" ),
+ durationLabel = $( "<span><p>00:00:00</p></span>" ).addClass( "ui-durationlabel" ),
+ volumeButton = $( "<span></span>" ).addClass( "ui-volumebutton ui-button" ),
+ volumeControl = $( "<span></span>" ).addClass( "ui-volumecontrol" ),
+ volumeBar = $( "<div></div>" ).addClass( "ui-volumebar ui-multimediaview-bar" ),
+ volumeGuide = $( "<span></span>" ).addClass( "ui-guide ui-multimediaview-bar-bg" ),
+ volumeValue = $( "<span></span>" ).addClass( "ui-value ui-multimediaview-bar-highlight" ),
+ volumeHandle = $( "<span></span>" ).addClass( "ui-handle" ),
+ fullscreenButton = $( "<span></span>" ).addClass( "ui-fullscreenbutton ui-button" ),
+ durationBar = $( "<span></span>" ).addClass( "ui-duration ui-multimediaview-bar-bg" ),
+ currenttimeBar = $( "<span></span>" ).addClass( "ui-currenttime ui-multimediaview-bar-highlight" );
+
+ seekBar.append( durationBar ).append( currenttimeBar ).append( durationLabel ).append( timestampLabel );
+
+ playpauseButton.addClass( "ui-play-icon" );
+ volumeButton.addClass( viewElement.muted ? "ui-mute-icon" : "ui-volume-icon" );
+ volumeBar.append( volumeGuide ).append( volumeValue ).append( volumeHandle );
+ volumeControl.append( volumeBar );
+
+ control.append( playpauseButton ).append( seekBar ).append( volumeControl ).append( volumeButton );
+
+ if ( this._isVideo ) {
+ $( fullscreenButton ).addClass( "ui-fullscreen-on" );
+ control.append( fullscreenButton );
+ }
+ volumeControl.hide();
+
+ return control;
+ },
+
+ _startTimer: function ( duration ) {
+ this._endTimer();
+
+ if ( !duration ) {
+ duration = 3000;
+ }
+
+ var self = this,
+ view = self.element,
+ control = view.parent( ".ui-multimediaview-wrap" ).find( ".ui-multimediaview-control" ),
+ volumeControl = control.find( ".ui-volumecontrol" );
+
+ self.controlTimer = setTimeout( function () {
+ self.isVolumeHide = true;
+ self.controlTimer = null;
+ volumeControl.hide();
+ control.fadeOut( "fast" );
+ }, duration );
+ },
+
+ _endTimer: function () {
+ if ( this.controlTimer ) {
+ clearTimeout( this.controlTimer );
+ this.controlTimer = null;
+ }
+ },
+
+ _convertTimeFormat: function ( systime ) {
+ if ( !$.isNumeric( systime ) ) {
+ return "Playback Error";
+ }
+
+ var ss = parseInt( systime % 60, 10 ).toString(),
+ mm = parseInt( ( systime / 60 ) % 60, 10 ).toString(),
+ hh = parseInt( systime / 3600, 10 ).toString(),
+ time = ( ( hh.length < 2 ) ? "0" + hh : hh ) + ":" +
+ ( ( mm.length < 2 ) ? "0" + mm : mm ) + ":" +
+ ( ( ss.length < 2 ) ? "0" + ss : ss );
+
+ return time;
+ },
+
+ _updateSeekBar: function ( currenttime ) {
+ var view = this.element,
+ viewElement = view[0],
+ duration = viewElement.duration,
+ control = view.parent( ".ui-multimediaview-wrap" ).find( ".ui-multimediaview-control" ),
+ seekBar = control.find( ".ui-seekbar" ),
+ durationBar = seekBar.find( ".ui-duration" ),
+ currenttimeBar = seekBar.find( ".ui-currenttime" ),
+ timestampLabel = control.find( ".ui-timestamplabel" ),
+ durationOffset = durationBar.offset(),
+ durationWidth = durationBar.width(),
+ durationHeight = durationBar.height(),
+ timebarWidth = 0;
+
+ if ( typeof currenttime === "undefined" ) {
+ currenttime = viewElement.currentTime;
+ }
+ timebarWidth = parseInt( currenttime / duration * durationWidth, 10 );
+ durationBar.offset( durationOffset );
+ currenttimeBar.offset( durationOffset ).width( timebarWidth );
+ timestampLabel.find( "p" ).text( this._convertTimeFormat( currenttime ) );
+ },
+
+ _updateVolumeState: function () {
+ var view = this.element,
+ control = view.parent( ".ui-multimediaview-wrap" ).find( ".ui-multimediaview-control" ),
+ volumeControl = control.find( ".ui-volumecontrol" ),
+ volumeButton = control.find( ".ui-volumebutton" ),
+ volumeBar = volumeControl.find( ".ui-volumebar" ),
+ volumeGuide = volumeControl.find( ".ui-guide" ),
+ volumeValue = volumeControl.find( ".ui-value" ),
+ volumeHandle = volumeControl.find( ".ui-handle" ),
+ handlerWidth = volumeHandle.width(),
+ handlerHeight = volumeHandle.height(),
+ volumeGuideHeight = volumeGuide.height(),
+ volumeGuideWidth = volumeGuide.width(),
+ volumeGuideTop = 0,
+ volumeGuideLeft = 0,
+ volumeBase = 0,
+ handlerOffset = null,
+ volume = view[0].volume;
+
+ volumeGuideTop = parseInt( volumeGuide.offset().top, 10 );
+ volumeGuideLeft = parseInt( volumeGuide.offset().left, 10 );
+ volumeBase = volumeGuideLeft;
+ handlerOffset = volumeHandle.offset();
+ handlerOffset.top = volumeGuideTop - parseInt( ( handlerHeight - volumeGuideHeight ) / 2, 10 );
+ handlerOffset.left = volumeBase + parseInt( volumeGuideWidth * volume, 10 ) - parseInt( handlerWidth / 2, 10 );
+ volumeHandle.offset( handlerOffset );
+ volumeValue.offset( volumeGuide.offset() ).width( parseInt( volumeGuideWidth * ( volume ), 10 ) );
+ },
+
+ _setVolume: function ( value ) {
+ var viewElement = this.element[0];
+
+ if ( value < 0.0 || value > 1.0 ) {
+ return;
+ }
+
+ viewElement.volume = value;
+ },
+
+ _fitContentArea: function ( page, parent ) {
+ if ( typeof parent === "undefined" ) {
+ parent = window;
+ }
+
+ var $page = $( page ),
+ $content = $( ".ui-content:visible:first" ),
+ hh = $( ".ui-header:visible" ).outerHeight() || 0,
+ fh = $( ".ui-footer:visible" ).outerHeight() || 0,
+ pt = parseFloat( $content.css( "padding-top" ) ),
+ pb = parseFloat( $content.css( "padding-bottom" ) ),
+ wh = ( ( parent === window ) ? window.innerHeight : $( parent ).height() ),
+ height = wh - ( hh + fh ) - ( pt + pb );
+
+ $content.offset( {
+ top: ( hh + pt )
+ }).height( height );
+ },
+
+ width: function ( value ) {
+ if ( this.options.fullScreen ) {
+ return;
+ }
+
+ var view = this.element,
+ wrap = view.parent( ".ui-multimediaview-wrap" );
+
+ if ( arguments.length === 0 ) {
+ return view.width();
+ }
+
+ if ( !this._isVideo ) {
+ wrap.width( value );
+ }
+
+ view.width( value );
+ this._resize();
+ },
+
+ height: function ( value ) {
+ if ( !this._isVideo || this.options.fullScreen ) {
+ return;
+ }
+
+ var view = this.element;
+
+ if ( arguments.length === 0 ) {
+ return view.height();
+ }
+
+ view.height( value );
+ this._resize();
+ },
+
+ fullScreen: function ( value ) {
+ if ( !this._isVideo ) {
+ return;
+ }
+
+ var view = this.element,
+ option = this.options;
+
+ if ( arguments.length === 0 ) {
+ return option.fullScreen;
+ }
+
+ view.parents( ".ui-scrollview-clip" ).scrollview( "scrollTo", 0, 0 );
+
+ this.options.fullScreen = value;
+
+ this._resize();
+ },
+
+ refresh: function () {
+ this._resize();
+ }
+ });
+
+ $( document ).bind( "pagecreate create", function ( e ) {
+ $.tizen.multimediaview.prototype.enhanceWithin( e.target );
+ });
+} ( jQuery, document, window ) );
+
--- /dev/null
+
+/* ***************************************************************************
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * ***************************************************************************
+ *
+ * Author: Minkyu Kang <mk7.kang@samsung.com>
+ */
+
+/*
+ * Notification widget
+ *
+ * HTML Attributes
+ *
+ * data-role: set to 'notification'.
+ * data-type: 'ticker' or 'popup'.
+ * data-interval: time to showing. If don't set, will show infinitely.
+ *
+ * APIs
+ *
+ * open(): open the notification.
+ * close(): close the notification.
+ * text(text0, text1): set texts or get texts
+ * icon(src): set the icon (tickernoti only)
+ *
+ * Events
+ *
+ * N/A
+ *
+ * Examples
+ *
+ * // tickernoti
+ * <div data-role="notification" id="notification" data-type="ticker" data-interval="3000">
+ * <img src="icon01.png">
+ * <p>Hello World</p>
+ * <p>Denis</p>
+ * </div>
+ *
+ * // smallpopup
+ * <div data-role="notification" id="notification" data-type="popup" data-interval="3000">
+ * <p>Hello World</p>
+ * </div>
+ *
+ */
+
+/**
+ @class Notification
+ The notification widget shows a pop-up window on the screen to provide notifications.
+ To add a notification widget to the application, use the following code:
+
+ <div data-role="page">
+ <div data-role="notification" data-type="smallpopup">
+ <p>text1</p>
+ </div>
+ <div data-role="header"></div>
+ <div data-role="content"></div>
+ <div data-role="footer"></div>
+ </div>
+*/
+/**
+ @property {String} data-type
+ Defines the notification type. The type options are tickernoti and smallpopup. <br/>The default value is smallpopup.
+
+*/
+/**
+ @property {Integer} data-interval
+ Defines the time to showing a notification widget. <br/>The default is infinitely.
+
+*/
+/**
+ @method open
+ The open method is used to open the notification widget:
+
+ <div data-role="notification" data-type="smallpopup" data-interval="3000"></div>
+ $('#notification').notification('open');
+*/
+/**
+ @method close
+ The close method is used to close the notification widget:
+
+ <div data-role="notification" data-type="smallpopup" data-interval="3000"></div>
+ $('#notification').notification('close');
+*/
+/**
+ @method text
+ The text method is used to set or get the notification text:
+
+ <div data-role="notification" data-type="smallpopup" data-interval="3000"></div>
+ // Set notification text
+ $('#notification').notification('text', 'setThisText');
+ // Get notification text
+ texts = $('#notification').notification('text');
+ @since Tizen2.0
+*/
+/**
+ @method icon
+ The setIcon method is used to set the ticker notification icon. The icon can be set only if the notification type is set to tickernoti.
+
+ <div data-role="notification" data-type="ticker" data-interval="3000"></div>
+ $('#notification').notification('icon', './test.png');
+*/
+(function ( $, window ) {
+ $.widget( "tizen.notification", $.mobile.widget, {
+ btn: null,
+ text_bg: [],
+ icon_img: [],
+ interval: null,
+ seconds: null,
+ running: false,
+
+ _get_text: function () {
+ var text = new Array( 2 );
+
+ if ( this.type === 'ticker' ) {
+ text[0] = $( this.text_bg[0] ).text();
+ text[1] = $( this.text_bg[1] ).text();
+ } else {
+ text[0] = $( this.text_bg[0] ).text();
+ }
+
+ return text;
+ },
+
+ _set_text: function ( text0, text1 ) {
+ var _set = function ( elem, text ) {
+ if ( !text ) {
+ return;
+ }
+ elem.text( text );
+ };
+
+ if ( this.type === 'ticker' ) {
+ _set( $( this.text_bg[0] ), text0 );
+ _set( $( this.text_bg[1] ), text1 );
+ } else {
+ _set( $( this.text_bg[0] ), text0 );
+ }
+ },
+
+ text: function ( text0, text1 ) {
+ if ( text0 === undefined && text1 === undefined ) {
+ return this._get_text();
+ }
+
+ this._set_text( text0, text1 );
+ },
+
+ icon: function ( src ) {
+ if ( src === undefined ) {
+ return;
+ }
+
+ this.icon_img.detach();
+ this.icon_img = $( "<img src='" + src + "' class='ui-ticker-icon'>" );
+ $( this.element ).find(".ui-ticker").append( this.icon_img );
+ },
+
+ _refresh: function () {
+ var container = this._get_container();
+
+ $( container ).addClass("fix")
+ .removeClass("show")
+ .removeClass("hide");
+
+ this._set_interval();
+ },
+
+ open: function () {
+ var container = this._get_container();
+
+ if ( this.running ) {
+ this._refresh();
+ return;
+ }
+
+ $( container ).addClass("show")
+ .removeClass("hide")
+ .removeClass("fix");
+
+ this.running = true;
+
+ if ( this.type === 'popup' ) {
+ this._set_position();
+ }
+
+ this._set_interval();
+ },
+
+ close: function () {
+ var container = this._get_container();
+
+ if ( !this.running ) {
+ return;
+ }
+
+ $( container ).addClass("hide")
+ .removeClass("show")
+ .removeClass("fix");
+
+ this.running = false;
+ clearInterval( this.interval );
+ },
+
+ destroy: function () {
+ var container = this._get_container();
+
+ $( container ).removeClass("show")
+ .removeClass("hide")
+ .removeClass("fix");
+
+ this._del_event();
+
+ this.running = false;
+ },
+
+ _get_container: function () {
+ if ( this.type === 'ticker' ) {
+ return $( this.element ).find(".ui-ticker");
+ }
+
+ return $( this.element ).find(".ui-smallpopup");
+ },
+
+ _set_interval: function () {
+ var self = this;
+
+ clearInterval( this.interval );
+
+ if ( this.seconds !== undefined && this.second !== 0 ) {
+ this.interval = setInterval( function () {
+ self.close();
+ }, this.seconds );
+ }
+ },
+
+ _add_event: function () {
+ var self = this,
+ container = this._get_container();
+
+ if ( this.type === 'ticker' ) {
+ container.find(".ui-ticker-btn").append( this.btn ).trigger("create");
+
+ this.btn.bind( "vmouseup", function () {
+ self.close();
+ });
+ }
+
+ container.bind( 'vmouseup', function () {
+ self.close();
+ });
+ },
+
+ _del_event: function () {
+ var container = this._get_container();
+
+ if ( this.type === 'ticker' ) {
+ this.btn.unbind("vmouseup");
+ }
+ container.unbind('vmouseup');
+ clearInterval( this.interval );
+ },
+
+ _set_position: function () {
+ var container = this._get_container(),
+ $footer = $('.ui-page-active').children('.ui-footer'),
+ footer_h = $footer.outerHeight() || 0;
+
+ container.css( 'bottom', footer_h);
+ },
+
+ _create: function () {
+ var self = this,
+ elem = $( this.element ),
+ i;
+
+ this.btn = $('<div data-role="button" data-inline="true">Close</div>');
+
+ this.seconds = elem.jqmData('interval');
+ this.type = elem.jqmData('type') || 'popup';
+
+ if ( this.type === 'ticker' ) {
+ elem.wrapInner("<div class='ui-ticker'></div>");
+ elem.find(".ui-ticker").append("<div class='ui-ticker-body'></div>" +
+ "<div class='ui-ticker-btn'></div>");
+ this.text_bg = elem.find("p");
+
+ if ( this.text_bg.length < 2 ) {
+ elem.find(".ui-ticker").append("<p></p><p></p>");
+ this.text_bg = elem.find("p");
+ } else if ( this.text_bg.length > 2 ) {
+ for ( i = 2; i < this.text_bg.length; i++ ) {
+ $( this.text_bg[i] ).css( "display", "none" );
+ }
+ }
+
+ $( this.text_bg[0] ).addClass("ui-ticker-text1-bg");
+ $( this.text_bg[1] ).addClass("ui-ticker-text2-bg");
+
+ this.icon_img = elem.find("img");
+
+ if ( this.icon_img.length ) {
+ $( this.icon_img ).addClass("ui-ticker-icon");
+
+ for ( i = 1; i < this.icon_img.length; i++ ) {
+ $( this.icon_img[i] ).css( "display", "none" );
+ }
+ }
+ } else {
+ elem.wrapInner("<div class='ui-smallpopup'></div>");
+ this.text_bg = elem.find("p").addClass("ui-smallpopup-text-bg");
+
+ if ( this.text_bg.length < 1 ) {
+ elem.find(".ui-smallpopup")
+ .append("<p class='ui-smallpopup-text-bg'></p>");
+ this.text_bg = elem.find("p");
+ } else if ( this.text_bg.length > 1 ) {
+ for ( i = 1; i < this.text_bg.length; i++ ) {
+ $( this.text_bg[i] ).css( "display", "none" );
+ }
+ }
+
+ this._set_position();
+ }
+
+ this._add_event();
+
+ $( window ).bind( "resize", function () {
+ if ( !self.running ) {
+ return;
+ }
+
+ self._refresh();
+
+ if ( self.type === 'popup' ) {
+ self._set_position();
+ }
+ });
+ }
+ }); // End of widget
+
+ // auto self-init widgets
+ $( document ).bind( "pagecreate create", function ( e ) {
+ $( e.target ).find(":jqmData(role='notification')").notification();
+ });
+
+ $( document ).bind( "pagebeforehide", function ( e ) {
+ $( e.target ).find(":jqmData(role='notification')").notification('destroy');
+ });
+}( jQuery, this ));
+
--- /dev/null
+
+/* ***************************************************************************
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * ***************************************************************************
+ *
+ * Author: Jinhyuk Jun <jinhyuk.jun@samsung.com>
+ */
+
+(function ( $, undefined ) {
+
+ $.widget( "mobile.pagelayout", $.mobile.widget, {
+ options: {
+ visibleOnPageShow: true,
+ disablePageZoom: true,
+ transition: "slide", //can be none, fade, slide (slide maps to slideup or slidedown)
+ fullscreen: false,
+ tapToggle: true,
+ tapToggleBlacklist: "a, input, select, textarea, .ui-header-fixed, .ui-footer-fixed",
+ hideDuringFocus: "input, textarea, select",
+ updatePagePadding: true,
+ // Browser detection! Weeee, here we go...
+ // Unfortunately, position:fixed is costly, not to mention probably impossible, to feature-detect accurately.
+ // Some tests exist, but they currently return false results in critical devices and browsers, which could lead to a broken experience.
+ // Testing fixed positioning is also pretty obtrusive to page load, requiring injected elements and scrolling the window
+ // The following function serves to rule out some popular browsers with known fixed-positioning issues
+ // This is a plugin option like any other, so feel free to improve or overwrite it
+ supportBlacklist: function () {
+ var w = window,
+ ua = navigator.userAgent,
+ platform = navigator.platform,
+ // Rendering engine is Webkit, and capture major version
+ wkmatch = ua.match( /AppleWebKit\/([0-9]+)/ ),
+ wkversion = !!wkmatch && wkmatch[ 1 ],
+ ffmatch = ua.match( /Fennec\/([0-9]+)/ ),
+ ffversion = !!ffmatch && ffmatch[ 1 ],
+ operammobilematch = ua.match( /Opera Mobi\/([0-9]+)/ ),
+ omversion = !!operammobilematch && operammobilematch[ 1 ];
+
+ if (
+ // iOS 4.3 and older : Platform is iPhone/Pad/Touch and Webkit version is less than 534 (ios5)
+ ( ( platform.indexOf( "iPhone" ) > -1 || platform.indexOf( "iPad" ) > -1 || platform.indexOf( "iPod" ) > -1 ) && wkversion && wkversion < 534 ) ||
+ // Opera Mini
+ ( w.operamini && ({}).toString.call( w.operamini ) === "[object OperaMini]" ) ||
+ ( operammobilematch && omversion < 7458 ) ||
+ //Android lte 2.1: Platform is Android and Webkit version is less than 533 (Android 2.2)
+ ( ua.indexOf( "Android" ) > -1 && wkversion && wkversion < 533 ) ||
+ // Firefox Mobile before 6.0 -
+ ( ffversion && ffversion < 6 ) ||
+ // WebOS less than 3
+ ( window.palmGetResource !== undefined && wkversion && wkversion < 534 ) ||
+ // MeeGo
+ ( ua.indexOf( "MeeGo" ) > -1 && ua.indexOf( "NokiaBrowser/8.5.0" ) > -1 )
+ ) {
+ return true;
+ }
+
+ return false;
+ },
+ initSelector: ":jqmData(role='content')"
+ },
+
+ _create: function () {
+
+ var self = this,
+ o = self.options,
+ $el = self.element;
+
+ // Feature detecting support for
+ if ( o.supportBlacklist() ) {
+ self.destroy();
+ return;
+ }
+
+ self._addFixedClass();
+ self._addTransitionClass();
+ self._bindPageEvents();
+
+ // only content
+ self._bindContentControlEvents();
+ },
+
+ /* add minimum fixed css style to bar(header/footer) and content
+ * it need to update when core source modified(jquery.mobile.page.section.js)
+ * modified from core source cuz initSelector different */
+ _addFixedClass: function () {
+ var self = this,
+ o = self.options,
+ $el = self.element,
+ $elHeader = $el.siblings( ":jqmData(role='header')" ),
+ $elFooter = $el.siblings( ":jqmData(role='footer')" ),
+ $elPage = $el.closest(".ui-page");
+
+ $elHeader.addClass( "ui-header-fixed" );
+ $elFooter.addClass( "ui-footer-fixed" );
+
+ // "fullscreen" overlay positioning
+ if ( o.fullscreen ) {
+ $elHeader.addClass( "ui-header-fullscreen" );
+ $elFooter.addClass( "ui-footer-fullscreen" );
+ $elPage
+ .addClass( "ui-page-header-fullscreen" )
+ .addClass( "ui-page-footer-fullscreen" );
+ } else {
+ // If not fullscreen, add class to page to set top or bottom padding
+ $elPage.addClass( "ui-page-header-fixed" )
+ .addClass( "ui-page-footer-fixed" );
+ }
+ },
+
+ /* original core source(jquery.mobile.fixedToolbar.js)
+ * never changed */
+ _addTransitionClass: function () {
+ var tclass = this.options.transition;
+
+ if ( tclass && tclass !== "none" ) {
+ // use appropriate slide for header or footer
+ if ( tclass === "slide" ) {
+ tclass = this.element.is( ".ui-header" ) ? "slidedown" : "slideup";
+ }
+
+ this.element.addClass( tclass );
+ }
+ },
+
+
+ /* Set default page positon
+ * 1. add title style to header
+ * 2. Set default header/footer position */
+ setHeaderFooter: function ( thisPage ) {
+ var $elPage = $( thisPage ),
+ $elHeader = $elPage.find( ":jqmData(role='header')" ).length ? $elPage.find( ":jqmData(role='header')") : $elPage.siblings( ":jqmData(role='header')"),
+ $elContent = $elPage.find( ".ui-content" ),
+ $elFooter = $elPage.find( ":jqmData(role='footer')" ),
+ $elFooterGroup = $elFooter.find( ":jqmData(role='fieldcontain')" ),
+ $elFooterControlGroup = $elFooter.find( ".ui-controlgroup" );
+
+ // divide content mode scrollview and non-scrollview
+ if ( !$elPage.is( ".ui-dialog" ) ) {
+ if ( $elHeader.jqmData("position") == "fixed" || ( $.support.scrollview && $.tizen.frameworkData.theme.match(/tizen/) ) ) {
+ $elHeader
+ .css( "position", "fixed" )
+ .css( "top", "0px" );
+ } else if ( !$.support.scrollview && $elHeader.jqmData("position") != "fixed" ) {
+ $elHeader.css( "position", "relative" );
+ }
+ }
+
+ /* set Title style */
+ if ( $elHeader.find("span.ui-title-text-sub").length ) {
+ $elHeader.addClass( "ui-title-multiline");
+ }
+
+ if ( $elFooterGroup.find( "div" ).is( ".ui-controlgroup-label" ) ) {
+ $elFooterGroup.find( "div.ui-controlgroup-label" ).remove();
+ }
+
+ if ( $elFooterControlGroup.length ) {
+ var anchorPer = 100 / $elFooterControlGroup.find( "a" ).length;
+ $elFooterControlGroup.find( "a" ).each( function ( i ) {
+ $elFooterControlGroup.find( "a" ).eq( i ).width( anchorPer + "%" );
+ });
+ }
+ },
+
+ _bindPageEvents: function () {
+ var self = this,
+ o = self.options,
+ $el = self.element,
+ $elCurrentFooter;
+
+ //page event bindings
+ // Fixed toolbars require page zoom to be disabled, otherwise usability issues crop up
+ // This method is meant to disable zoom while a fixed-positioned toolbar page is visible
+ $el.closest( ".ui-page" )
+ .bind( "pagebeforeshow", function ( event ) {
+ var thisPage = this;
+ if ( o.disablePageZoom ) {
+ $.mobile.zoom.disable( true );
+ }
+ if ( !o.visibleOnPageShow ) {
+ self.hide( true );
+ }
+ self.setHeaderFooter( thisPage );
+ self._setContentMinHeight( thisPage );
+ } )
+ .bind( "webkitAnimationStart animationstart updatelayout", function ( e, data ) {
+ var thisPage = this;
+ if ( o.updatePagePadding ) {
+ self.updatePagePadding(thisPage);
+ self.updatePageLayout( thisPage, data);
+ }
+ })
+
+ .bind( "pageshow", function ( event ) {
+ var thisPage = this;
+ self._setContentMinHeight( thisPage );
+ self.updatePagePadding( thisPage );
+ self._updateHeaderArea( thisPage );
+ if ( o.updatePagePadding ) {
+ $( window ).bind( "throttledresize." + self.widgetName, function () {
+ self.updatePagePadding(thisPage);
+
+ self.updatePageLayout( thisPage, false);
+ self._updateHeaderArea( thisPage );
+ self._setContentMinHeight( thisPage );
+ });
+ }
+ })
+
+ .bind( "pagebeforehide", function ( e, ui ) {
+ if ( o.disablePageZoom ) {
+ $.mobile.zoom.enable( true );
+ }
+ if ( o.updatePagePadding ) {
+ $( window ).unbind( "throttledresize." + self.widgetName );
+ }
+ });
+
+ window.addEventListener( "softkeyboardchange", function ( e ) {
+ var $elDownBtn = $( "<div class='ui-btn-footer-down'></div>" ),
+ $elPage = $( ".ui-page-active" ),
+ backBtnPosition = "footer";
+
+ if ( $elPage.data( "addBackBtn" ) ) {
+ $elPage.data( "addBackBtn" ) == "header" ? backBtnPosition = "header" : backBtnPosition = "footer";
+
+ if ( e.state == "on" ) {
+ if ( !$elPage.find( ".ui-" + backBtnPosition + " .ui-btn-footer-down" ).length ) {
+ $elDownBtn.buttonMarkup( { icon: "down" } ).appendTo( $elPage.find( ".ui-" + backBtnPosition ) );
+ $( ".ui-btn-footer-down" ).bind( "vclick", function ( ) {
+ $elPage.find( "input" ).blur();
+ });
+ }
+ $( ".ui-page-active .ui-btn-back" ).remove();
+ } else if ( e.state == "off" ) {
+ $elPage.page( "addBackBtn", backBtnPosition );
+ $( ".ui-btn-footer-down" ).remove();
+ }
+ }
+
+ });
+ },
+
+ _bindContentControlEvents: function () {
+ var self = this,
+ o = self.options,
+ $el = self.element;
+
+ $el.closest( ".ui-page" )
+ .bind( "pagebeforeshow", function ( event ) {
+
+ });
+ },
+
+ _setContentMinHeight : function ( thisPage ) {
+ var $elPage = $( thisPage ),
+ $elHeader = $elPage.find( ":jqmData(role='header')" ),
+ $elFooter = $elPage.find( ":jqmData(role='footer')" ),
+ $elContent = $elPage.find( ":jqmData(role='content')" ),
+ resultMinHeight;
+
+ resultMinHeight = window.innerHeight - $elHeader.height() - $elFooter.height();
+
+ $elContent.css( "min-height", resultMinHeight - parseFloat( $elContent.css("padding-top") ) - parseFloat( $elContent.css("padding-bottom") ) + "px" );
+ },
+
+ _updateHeaderArea : function ( thisPage ) {
+ var $elPage = $( thisPage ),
+ $elHeader = $elPage.find( ":jqmData(role='header')" ).length ? $elPage.find( ":jqmData(role='header')") : $elPage.siblings( ":jqmData(role='header')"),
+ headerBtnNum = $elHeader.children("a").length,
+ headerSrcNum = $elHeader.children("img").length;
+
+ if ( !$elPage.is( ".ui-dialog" ) ) {
+ $elHeader.find( "h1" ).css( "width", window.innerWidth - parseInt( $elHeader.find( "h1" ).css( "margin-left" ), 10 ) * 2 - $elHeader.children( "a" ).width() * headerBtnNum - $elHeader.children( "a" ).width() / 4 - $elHeader.children( "img" ).width() * headerSrcNum * 4 );
+ }
+ /* add half width for default space between text and button, and img tag area is too narrow, so multiply three for img width*/
+ },
+
+ _visible: true,
+
+ // This will set the content element's top or bottom padding equal to the toolbar's height
+ updatePagePadding: function ( tbPage ) {
+ var $el = this.element,
+ header = $el.siblings( ".ui-header" ).length,
+ footer = $el.siblings( ".ui-footer" ).length;
+
+ // This behavior only applies to "fixed", not "fullscreen"
+ if ( this.options.fullscreen ) {
+ return;
+ }
+
+ tbPage = tbPage || $el.closest( ".ui-page" );
+
+ if ( $el.siblings( ".ui-header" ).jqmData("position") == "fixed" || $.support.scrollview ) {
+ $( tbPage ).css( "padding-top", ( header ? $el.siblings( ".ui-header" ).outerHeight() : 0 ) );
+ }
+ $( tbPage ).css( "padding-bottom", ( footer ? $el.siblings( ".ui-footer" ).outerHeight() : 0 ) );
+ },
+
+ /* 1. Calculate and update content height */
+ updatePageLayout: function ( thisPage, receiveType ) {
+ var $elFooter,
+ $elPage = $( thisPage ),
+ $elHeader = $elPage.find( ":jqmData(role='header')" ),
+ $elContent = $elPage.find( ":jqmData(role='content')" ),
+ resultContentHeight = 0,
+ resultFooterHeight = 0,
+ resultHeaderHeight = 0;
+
+ if ( $elPage.length ) {
+ $elFooter = $elPage.find( ":jqmData(role='footer')" );
+ } else {
+ $elFooter = $( document ).find( ":jqmData(role='footer')" ).eq( 0 );
+ }
+
+ // calculate footer height
+ resultFooterHeight = ( $elFooter.css( "display" ) == "none" || $elFooter.length == 0 ) ? 0 : $elFooter.height();
+ resultHeaderHeight = ( $elHeader.css( "display" ) == "none" || $elHeader.length == 0 ) ? 0 : $elHeader.height();
+
+ if (resultFooterHeight != 0 ) {
+ $elFooter.css( "bottom", 0 );
+ }
+
+ resultContentHeight = window.innerHeight - resultFooterHeight - resultHeaderHeight;
+
+ if ( $.support.scrollview ) {
+ $elContent.height( resultContentHeight -
+ parseFloat( $elContent.css("padding-top") ) -
+ parseFloat( $elContent.css("padding-bottom") ) );
+ }
+
+ // External call page( "refresh") - in case title changed
+ if ( receiveType ) {
+ $elPage
+ .css( "min-height", resultContentHeight )
+ .css( "padding-top", resultHeaderHeight )
+ .css( "padding-bottom", resultFooterHeight );
+ }
+ },
+
+ show: function ( notransition ) {
+ /* blank function: deprecated */
+ },
+
+ hide: function ( notransition ) {
+ /* blank function: deprecated */
+ },
+
+ toggle: function () {
+ this[ this._visible ? "hide" : "show" ]();
+ },
+
+ destroy: function () {
+ this.element.removeClass( "ui-header-fixed ui-footer-fixed ui-header-fullscreen ui-footer-fullscreen in out fade slidedown slideup ui-fixed-hidden" );
+ this.element.closest( ".ui-page" ).removeClass( "ui-page-header-fixed ui-page-footer-fixed ui-page-header-fullscreen ui-page-footer-fullscreen" );
+ },
+
+ refresh: function () {
+ var $elPage = $( ".ui-page-active" );
+ this.setHeaderFooter( $elPage );
+ this._updateHeaderArea( $elPage );
+ }
+ });
+
+ //auto self-init widgets
+ $( document )
+ .bind( "pagecreate create", function ( e ) {
+ // DEPRECATED in 1.1: support for data-fullscreen=true|false on the page element.
+ // This line ensures it still works, but we recommend moving the attribute to the toolbars themselves.
+ if ( $( e.target ).jqmData( "fullscreen" ) ) {
+ $( $.mobile.pagelayout.prototype.options.initSelector, e.target ).not( ":jqmData(fullscreen)" ).jqmData( "fullscreen", true );
+ }
+ $.mobile.pagelayout.prototype.enhanceWithin( e.target );
+ });
+
+}( jQuery ));
+
--- /dev/null
+
+/*
+ * jQuery Mobile Widget @VERSION
+ *
+ * This software is licensed under the MIT licence (as defined by the OSI at
+ * http://www.opensource.org/licenses/mit-license.php)
+ *
+ * ***************************************************************************
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2011 by Intel Corporation Ltd.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * ***************************************************************************
+ *
+ * Authors: Gabriel Schulhof <gabriel.schulhof@intel.com>
+ * Hyunjung Kim <hjnim.kim@samsung.com>
+ */
+
+/*
+ * % ContextPopup widget do not use anymore(will be deprecated, internal use only)
+ */
+// This widget is implemented in an extremely ugly way. It should derive from $.tizen.popupwindow, but it doesn't
+// because there's a bug in jquery.ui.widget.js which was fixed in jquery-ui commit
+// b9153258b0f0edbff49496ed16d2aa93bec07d95. Once a version of jquery-ui containing that commit is released
+// (probably >= 1.9m5), and jQuery Mobile picks up the widget from there, this widget needs to be rewritten properly.
+// The problem is that, when a widget inherits from a superclass and declares an object in its prototype identical in key
+// to one in the superclass, upon calling $.widget the object is overwritten in both the prototype of the superclass and
+// the prototype of the subclass. The prototype of the superclass should remain unchanged.
+
+/**
+ class ContextPopup
+ The context pop-up widget shows a list of options and automatically optimizes its size within the screen. This widget is intended for a small list of options for a larger list, use the List widget. <br/>The context pop-up widget requires a target button, which must be clicked to open the context pop-up. In the default application theme, an arrow pointer is displayed at the top-left corner of the context pop-up widget when it is opened.<br/><br/> To add a context pop-up widget to the application, use the following code:
+
+ // Target button
+ <a href="#pop_3_icons" id="btn_3_icons" data-role="button" data-inline="true" data-rel="popupwindow">3 Icons</a>
+ // Context pop-up
+ <div class="horizontal" id="pop_3_icons" data-role="popupwindow" data-show-arrow="true">
+ <ul>
+ <li class="icon">
+ <a href="#" data-role="button" data-icon="call"></a>
+ </li>
+ <li class="icon">
+ <a href="#" data-role="button" data-icon="favorite"></a>
+ </li>
+ <li class="text">
+ <a href="#">Function</a>
+ </li>
+ </ul>
+ </div>
+ The context pop-up can define callbacks for events as described in the [jQueryMobile documentation for pop-up events.][1]
+ You can use methods with the context pop-up as described in the [jQueryMobile documentation for pop-up methods.][2]
+ [1]: http://jquerymobile.com/demos/1.2.0-alpha.1/docs/pages/popup/events.html
+ [2]: http://jquerymobile.com/demos/1.2.0-alpha.1/docs/pages/popup/methods.html
+
+ @deprecated 2.0 verisons
+*/
+
+(function ( $, undefined ) {
+ $.widget( "tizen.ctxpopup", $.tizen.widgetex, {
+ options: $.extend( {}, $.tizen.popupwindow.prototype.options, {
+ initSelector: ":jqmData(show-arrow)"
+ } ),
+
+ _htmlProto: {
+ ui: {
+ outer : "#outer",
+ container : "#container", // the key has to have the name "container"
+ arrow : {
+ all : ":jqmData(role='triangle')",
+ l : "#left",
+ t : "#top",
+ r : "#right",
+ b : "#bottom"
+ }
+ }
+ },
+
+ _create: function () {
+ console.warn("ctxpopup() was deprecated. use popup() instead.");
+ if ( !this.element.data( "popupwindow" ) ) {
+ this.element.popupwindow();
+ }
+
+ this.element.data( "popupwindow" )
+ ._ui.container
+ .removeClass( "ui-popupwindow-padding" )
+ .append( this._ui.outer );
+ this._ui.outer.trigger( "create" ); // Creates the triangle widgets
+ this._ui.container
+ .addClass( "ui-popupwindow-padding" )
+ .append( this.element );
+ },
+
+ _setOption: function ( key, value ) {
+ $.tizen.popupwindow.prototype._setOption.apply( this.element.data( "popupwindow" ), arguments );
+ this.options[key] = value;
+ }
+ } );
+
+ var origOpen = $.tizen.popupwindow.prototype.open,
+ orig_setOption = $.tizen.popupwindow.prototype._setOption,
+ orig_placementCoords = $.tizen.popupwindow.prototype._placementCoords;
+
+ $.tizen.popupwindow.prototype._setOption = function ( key, value ) {
+ var ctxpopup = this.element.data( "ctxpopup" ),
+ needsApplying = true,
+ origContainer;
+ if ( ctxpopup ) {
+ if ( "shadow" === key || "overlayTheme" === key || "corners" === key ) {
+ origContainer = this._ui.container;
+
+ this._ui.container = ctxpopup._ui.container;
+ orig_setOption.apply( this, arguments );
+ this._ui.container = origContainer;
+ needsApplying = false;
+ }
+ ctxpopup.options[key] = value;
+ }
+
+ if ( needsApplying ) {
+ orig_setOption.apply(this, arguments);
+ }
+ };
+
+ $.tizen.popupwindow.prototype._placementCoords = function ( x, y, cx, cy ) {
+ var ctxpopup = this.element.data( "ctxpopup" ),
+ self = this,
+ coords = {},
+ minDiff,
+ minDiffIdx;
+
+ function getCoords( arrow, x_factor, y_factor ) {
+ // Unhide the arrow we want to test to take it into account
+ ctxpopup._ui.arrow.all.hide();
+ ctxpopup._ui.arrow[arrow].show();
+
+ var isHorizontal = ( "b" === arrow || "t" === arrow ),
+ // Names of keys used in calculations depend on whether things are horizontal or not
+ coord = ( isHorizontal
+ ? { point: "x", size: "cx", beg: "left", outerSize: "outerWidth", niceSize: "width", triangleSize : "height" }
+ : { point: "y", size: "cy", beg: "top", outerSize: "outerHeight", niceSize: "height", triangleSize : "width" } ),
+ size = {
+ cx : self._ui.container.width(),
+ cy : self._ui.container.height()
+ },
+ halfSize = {
+ cx : size.cx / 2,
+ cy : size.cy / 2
+ },
+ desired = {
+ "x" : x + halfSize.cx * x_factor,
+ "y" : y + halfSize.cy * y_factor
+ },
+ orig = orig_placementCoords.call( self, desired.x, desired.y, size.cx, size.cy ),
+
+ // The triangleOffset must be clamped to the range described below:
+ //
+ // +-------...
+ // | /\
+ // | / \
+ // ----+--+-,-----...
+ //lowerDiff -->____| |/ <-- possible rounded corner
+ //triangle size --> | /|
+ // ____|/ |
+ // ^ |\ | <-- lowest possible offset for triangle
+ // actual range of | | \|
+ // arrow offset | | |
+ // values due to | . . Payload table cell looks like
+ // possible rounded | . . a popup window, and it may have
+ // corners and arrow | . . arbitrary things like borders,
+ // triangle size - | | | shadows, and rounded corners.
+ // our clamp range | | /|
+ // _v__|/ |
+ //triangle size --> |\ | <-- highest possible offset for triangle
+ // ____| \|
+ //upperDiff --> | |\ <-- possible rounded corner
+ // ----+--+-'-----...
+ // | \ /
+ // | \/
+ // +-------...
+ //
+ // We calculate lowerDiff and upperDiff by considering the offset and width of the payload (this.element)
+ // versus the offset and width of the element enclosing the triangle, because the payload is inside
+ // whatever decorations (such as borders, shadow, rounded corners) and thus can give a reliable indication
+ // of the thickness of the combined decorations
+
+ arrowBeg = ctxpopup._ui.arrow[arrow].offset()[coord.beg],
+ arrowSize = ctxpopup._ui.arrow[arrow][coord.outerSize]( true ),
+ payloadBeg = self.element.offset()[coord.beg],
+ payloadSize = self.element[coord.outerSize]( true ),
+ triangleSize = ctxpopup._ui.arrow[arrow][coord.triangleSize](),
+ triangleOffset =
+ Math.max(
+ triangleSize // triangle size
+ + Math.max( 0, payloadBeg - arrowBeg ), // lowerDiff
+ Math.min(
+ arrowSize // bottom
+ - triangleSize // triangle size
+ - Math.max( 0, arrowBeg + arrowSize - ( payloadBeg + payloadSize ) ), // upperDiff
+ arrowSize / 2 // arrow unrestricted offset
+ + desired[coord.point]
+ - orig[coord.point]
+ - halfSize[coord.size]
+ )
+ ),
+ // Triangle points here
+ final = {
+ "x": orig.x + ( isHorizontal ? triangleOffset : 0) + ("r" === arrow ? size.cx : 0),
+ "y": orig.y + (!isHorizontal ? triangleOffset : 0) + ("b" === arrow ? size.cy : 0)
+ },
+ ret = {
+ actual : orig,
+ triangleOffset : triangleOffset,
+ absDiff : Math.abs( x - final.x ) + Math.abs( y - final.y )
+ };
+
+ // Hide it back
+ ctxpopup._ui.arrow[arrow].hide();
+
+ return ret;
+ }
+
+ if ( ctxpopup ) {
+ // Returns:
+ // {
+ // absDiff: int
+ // triangleOffset: int
+ // actual: { x: int, y: int }
+ // }
+
+ coords = {
+ l : getCoords( "l", 1, 0 ),
+ r : getCoords( "r", -1, 0 ),
+ t : getCoords( "t", 0, 1 ),
+ b : getCoords( "b", 0, -1 )
+ };
+
+ $.each( coords, function ( key, value ) {
+ if ( minDiff === undefined || value.absDiff < minDiff ) {
+ minDiff = value.absDiff;
+ minDiffIdx = key;
+ }
+ } );
+
+ // Side-effect: show the appropriate arrow and move it to the right offset
+ ctxpopup._ui.arrow[minDiffIdx]
+ .show()
+ .triangle( "option", "offset", coords[minDiffIdx].triangleOffset );
+ return coords[minDiffIdx].actual;
+ }
+
+ return orig_placementCoords.call( this, x, y, cx, cy );
+ };
+
+ $.tizen.popupwindow.prototype.open = function ( x, y ) {
+ var ctxpopup = this.element.data( "ctxpopup" );
+
+ if ( ctxpopup ) {
+ this._setFade( false );
+ this._setShadow( false );
+ this._setCorners( false );
+ this._setOverlayTheme( null );
+ this._setOption( "overlayTheme", ctxpopup.options.overlayTheme );
+ ctxpopup._ui.arrow.all.triangle( "option", "color", ctxpopup._ui.container.css( "background-color" ) );
+
+ // temporary
+ $( '.ui-popupwindow' ).css( 'background', 'none' );
+ }
+
+ origOpen.call( this, x, y, true );
+ };
+
+ //auto self-init widgets
+ $( document ).bind( "pagecreate create", function ( e ) {
+ var ctxpopups = $( $.tizen.ctxpopup.prototype.options.initSelector, e.target );
+ $.tizen.ctxpopup.prototype.enhanceWithin( e.target );
+ } );
+}( jQuery ) );
+
--- /dev/null
+
+/*
+ * jQuery Mobile Widget @VERSION
+ *
+ * This software is licensed under the MIT licence (as defined by the OSI at
+ * http://www.opensource.org/licenses/mit-license.php)
+ *
+ * ***************************************************************************
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2011 by Intel Corporation Ltd.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * ***************************************************************************
+ *
+ * Authors: Gabriel Schulhof <gabriel.schulhof@intel.com>,
+ * Elliot Smith <elliot.smith@intel.com>
+ * Hyunjung Kim <hjnim.kim@samsung.com>
+ */
+
+/*
+ * % Popupwindow widget do not use anymore(will be deprecated, internal use only)
+ *
+ *
+ * Shows other elements inside a popup window.
+ *
+ * To apply, add the attribute data-role="popupwindow" to a <div> element inside
+ * a page. Alternatively, call popupwindow()
+ * on an element, eg :
+ *
+ * $("#mypopupwindowContent").popupwindow();
+ * where the html might be :
+ * <div id="mypopupwindowContent"></div>
+ *
+ * To trigger the popupwindow to appear, it is necessary to make a call to its
+ * 'open()' method. This is typically done by binding a function to an event
+ * emitted by an input element, such as a the clicked event emitted by a button
+ * element. The open() method takes two arguments, specifying the x and y
+ * screen coordinates of the center of the popup window.
+
+ * You can associate a button with a popup window like this:
+ * <div id="mypopupContent" style="display: table;" data-role="popupwindow">
+ * <table>
+ * <tr> <td>Eenie</td> <td>Meenie</td> <td>Mynie</td> <td>Mo</td> </tr>
+ * <tr> <td>Catch-a</td> <td>Tiger</td> <td>By-the</td> <td>Toe</td> </tr>
+ * <tr> <td>If-he</td> <td>Hollers</td> <td>Let-him</td> <td>Go</td> </tr>
+ * <tr> <td>Eenie</td> <td>Meenie</td> <td>Mynie</td> <td>Mo</td> </tr>
+ * </table>
+ * </div>
+ * <a href="#myPopupContent" data-rel="popupwindow" data-role="button">Show popup</a>
+ *
+ * Options:
+ *
+ * theme: String; the theme for the popupwindow contents
+ * Default: null
+ *
+ * overlayTheme: String; the theme for the popupwindow
+ * Default: null
+ *
+ * shadow: Boolean; display a shadow around the popupwindow
+ * Default: true
+ *
+ * corners: Boolean; display a shadow around the popupwindow
+ * Default: true
+ *
+ * fade: Boolean; fades the opening and closing of the popupwindow
+ *
+ * transition: String; the transition to use when opening or closing
+ * a popupwindow
+ * Default: $.mobile.defaultDialogTransition
+ *
+ * Events:
+ * popupbeforeposition: triggered after a popup has completed preparations for opening, but has not yet opened
+ * popupafteropen: triggered after a popup has completely opened
+ * popupafterclose triggered when a popup has completely closed
+*/
+
+/**
+ class Popupwindow
+ The pop-up widget shows a list of items in a pop-up window in the middle of the screen. It automatically optimizes the pop-up window size within the screen.
+ To add a pop-up widget to the application, use the following code:
+
+ // Basic pop-up
+ <div id="center_info" data-role="popup" data-style="center_info">
+ <div data-role="text">
+ <p>
+ Pop-up dialog box, a child window that blocks user interaction in the parent window
+ </p>
+ </div>
+ </div>
+ // Pop-up with a title and button
+ <div id="center_title_1btn" data-role="popup" data-style="center_title_1btn">
+ <p data-role="title">
+ Pop-up title
+ </p>
+ <p data-role="text">
+ Pop-up dialog box
+ </p>
+ <div data-role="button-bg">
+ <input type="button" value="Text Button" />
+ </div>
+ </div>
+
+ The pop-up can define callbacks for events as described in the jQueryMobile documentation for pop-up events. <br/>You can use methods with the pop-up as described in the jQueryMobile documentation for pop-up methods.
+
+ @deprecated 2.0 verisons
+*/
+
+/**
+ @property {String} data-style
+ Defines the pop-up window style.
+ The following styles are available:
+
+ center_info: basic pop-up message
+ center_title: pop-up message with a title
+ center_basic_1btn: pop-up message with 1 button
+ center_basic_2btn: pop-up message with 2 horizontal buttons
+ center_title_1btn: pop-up message with a title and 1 button
+ center_title_2btn: pop-up message with a title and 2 horizontal buttons
+ center_title_3btn: pop-up message with a title and 3 horizontal buttons
+ center_button_vertical: pop-up message with vertical buttons
+ center_checkbox: pop-up message with a check box
+ center_liststyle_1btn>: pop-up message with a list and 1 button
+ center_liststyle_2btn: pop-up message with a list and 2 horizontal buttons
+ center_liststyle_3btn: pop-up message with a list and 3 horizontal buttons
+*/
+
+(function ( $, undefined ) {
+ $.widget( "tizen.popupwindow", $.tizen.widgetex, {
+ options: {
+ theme: null,
+ overlayTheme: "s",
+ style: "custom",
+ disabled: false,
+ shadow: true,
+ corners: true,
+ fade: false,
+ opacity: 0.7,
+ widthRatio: 0.8612,
+ transition: $.mobile.defaultDialogTransition,
+ initSelector: ":jqmData(role='popupwindow')"
+ },
+
+ _htmlProto: {
+ ui: {
+ screen: "#popupwindow-screen",
+ container: "#popupwindow-container"
+ }
+ },
+
+ _setStyle: function () {
+ var popup = this.element,
+ style = popup.attr( 'data-style' );
+
+ if ( style ) {
+ this.options.style = style;
+ }
+
+ popup.addClass( this.options.style );
+ popup.find( ":jqmData(role='title')" )
+ .wrapAll( "<div class='popup-title'></div>" );
+ popup.find( ":jqmData(role='text')" )
+ .wrapAll( "<div class='popup-text'></div>" );
+ popup.find( ":jqmData(role='button-bg')" )
+ .wrapAll( "<div class='popup-button-bg'></div>" );
+ popup.find( ":jqmData(role='check-bg')" )
+ .wrapAll( "<div class='popup-check-bg'></div>" );
+ popup.find( ":jqmData(role='scroller-bg')" )
+ .addClass( "popup-scroller-bg" );
+ popup.find( ":jqmData(role='text-bottom-bg')" )
+ .wrapAll( "<div class='popup-text-bottom-bg'></div>" );
+ popup.find( ":jqmData(role='text-left')" )
+ .wrapAll( "<div class='popup-text-left'></div>" );
+ popup.find( ":jqmData(role='text-right')" )
+ .wrapAll( "<div class='popup-text-right'></div>" );
+ popup.find( ":jqmData(role='progress-bg')" )
+ .wrapAll( "<div class='popup-progress-bg'></div>" );
+ },
+
+ _create: function () {
+ console.warn("popupwindow() was deprecated. use popup() instead.");
+ var thisPage = this.element.closest(":jqmData(role='page')"),
+ self = this;
+
+ if ( thisPage.length === 0 ) {
+ thisPage = $("body");
+ }
+
+ this._ui.placeholder =
+ $( "<div><!-- placeholder for " + this.element.attr("id") + " --></div>" )
+ .css("display", "none")
+ .insertBefore( this.element );
+
+ thisPage.append( this._ui.screen );
+ this._ui.container.insertAfter( this._ui.screen );
+ this._ui.container.append( this.element );
+
+ this._setStyle();
+
+ this._isOpen = false;
+
+ this._ui.screen.bind( "vclick", function ( e ) {
+ self.close();
+ return false;
+ } );
+
+ this.element.bind( "vclick", function ( e ) {
+ if ( $( e.target ).is("ui-btn-ctxpopup-close") ) {
+ self.close();
+ }
+ } );
+ },
+
+ destroy: function () {
+ this.element.insertBefore( this._ui.placeholder );
+
+ this._ui.placeholder.remove();
+ this._ui.container.remove();
+ this._ui.screen.remove();
+ this.element.triggerHandler("destroyed");
+ $.Widget.prototype.destroy.call( this );
+ },
+
+ _placementCoords: function ( x, y, cw, ch ) {
+ var screenHeight = $( window ).height(),
+ screenWidth = $( window ).width(),
+ halfheight = ch / 2,
+ maxwidth = parseFloat( this._ui.container.css( "max-width" ) ),
+ roomtop = y,
+ roombot = screenHeight - y,
+ newtop,
+ newleft;
+
+ if ( roomtop > ch / 2 && roombot > ch / 2 ) {
+ newtop = y - halfheight;
+ } else {
+ newtop = roomtop > roombot ? screenHeight - ch - 30 : 30;
+ }
+
+ if ( cw < maxwidth ) {
+ newleft = ( screenWidth - cw ) / 2;
+ } else {
+ newleft = x - cw / 2;
+
+ if ( newleft < 10 ) {
+ newleft = 10;
+ } else if ( ( newleft + cw ) > screenWidth ) {
+ newleft = screenWidth - cw - 10;
+ }
+ }
+
+ return { x : newleft, y : newtop };
+ },
+
+ _setPosition: function ( x_where, y_where ) {
+ var x = ( undefined === x_where ? $( window ).width() / 2 : x_where ),
+ y = ( undefined === y_where ? $( window ).height() / 2 : y_where ),
+ coords,
+ ctxpopup = this.element.data("ctxpopup"),
+ popupWidth,
+ menuHeight,
+ menuWidth,
+ screenHeight,
+ screenWidth,
+ roomtop,
+ roombot,
+ halfheight,
+ maxwidth,
+ newtop,
+ newleft;
+
+ if ( !ctxpopup ) {
+ popupWidth = $( window ).width() * this.options.widthRatio;
+ this._ui.container.css( "width", popupWidth );
+
+ if ( this._ui.container.outerWidth() > $( window ).width() ) {
+ this._ui.container.css( {"max-width" : $( window ).width() - 30} );
+ }
+ }
+
+ coords = this._placementCoords( x, y,
+ this._ui.container.outerWidth(),
+ this._ui.container.outerHeight() );
+
+ menuHeight = this._ui.container.innerHeight();
+ menuWidth = this._ui.container.innerWidth();
+ screenHeight = $( window ).height();
+ screenWidth = $( window ).width();
+ roomtop = y;
+ roombot = screenHeight - y;
+ halfheight = menuHeight / 2;
+ maxwidth = parseFloat( this._ui.container.css( "max-width" ) );
+ newtop = ( screenHeight - menuHeight ) / 2;
+
+ if ( !maxwidth || menuWidth < maxwidth ) {
+ newleft = ( screenWidth - menuWidth ) / 2;
+ } else {
+ newleft = x - menuWidth / 2;
+
+ if ( newleft < 30 ) {
+ newleft = 30;
+ } else if ( ( newleft + menuWidth ) > screenWidth ) {
+ newleft = screenWidth - menuWidth - 30;
+ }
+ }
+
+ if ( ctxpopup ) {
+ newtop = coords.y;
+ newleft = coords.x;
+ }
+
+ this._ui.container.css({
+ top: newtop,
+ left: newleft
+ });
+
+ this._ui.screen.css( "height", screenHeight );
+ },
+ open: function ( x_where, y_where, backgroundclose ) {
+ var self = this,
+ zIndexMax = 0;
+
+ if ( this._isOpen || this.options.disabled ) {
+ return;
+ }
+
+ $( document ).find("*").each( function () {
+ var el = $( this ),
+ zIndex = parseInt( el.css("z-index"), 10 );
+
+ if ( !( el.is( self._ui.container ) ||
+ el.is( self._ui.screen ) ||
+ isNaN( zIndex ))) {
+ zIndexMax = Math.max( zIndexMax, zIndex );
+ }
+ } );
+
+ this._ui.screen.css( "height", $( window ).height() );
+
+ if ( backgroundclose ) {
+ this._ui.screen.css( "opacity", 0 )
+ .removeClass("ui-screen-hidden");
+ } else {
+ this._ui.removeClass("ui-screen-hidden");
+
+ if ( this.options.fade ) {
+ this._ui.screen.animate( {opacity: this.options.opacity}, "fast" );
+ } else {
+ this._ui.screen.css( {opacity: this.options.opacity} );
+ }
+ }
+
+ this._setPosition( x_where, y_where );
+
+ this.element.trigger("popupbeforeposition");
+
+ this._ui.container
+ .removeClass("ui-selectmenu-hidden")
+ .addClass("in")
+ .animationComplete( function () {
+ self.element.trigger("popupafteropen");
+ } );
+
+ this._isOpen = true;
+
+ if ( !this._reflow ) {
+ this._reflow = function () {
+ if ( !self._isOpen ) {
+ return;
+ }
+
+ self._setPosition( x_where, y_where );
+ };
+
+ $( window ).bind( "resize", this._reflow );
+ }
+ },
+
+ close: function () {
+ if ( !this._isOpen ) {
+ return;
+ }
+
+ if ( this._reflow ) {
+ $( window ).unbind( "resize", this._reflow );
+ this._reflow = null;
+ }
+
+ var self = this,
+ hideScreen = function () {
+ self._ui.screen.addClass("ui-screen-hidden");
+ self._isOpen = false;
+ };
+
+ this._ui.container.removeClass("in").addClass("reverse out");
+
+ if ( this.options.transition === "none" ) {
+ this._ui.container
+ .addClass("ui-selectmenu-hidden")
+ .removeAttr("style");
+ this.element.trigger("popupafterclose");
+ } else {
+ this._ui.container.animationComplete( function () {
+ self._ui.container
+ .removeClass("reverse out")
+ .addClass("ui-selectmenu-hidden")
+ .removeAttr("style");
+ self.element.trigger("popupafterclose");
+ } );
+ }
+
+ if ( this.options.fade ) {
+ this._ui.screen.animate( {opacity: 0}, "fast", hideScreen );
+ } else {
+ hideScreen();
+ }
+ },
+
+ _realSetTheme: function ( dst, theme ) {
+ var classes = ( dst.attr("class") || "" ).split(" "),
+ alreadyAdded = true,
+ currentTheme = null,
+ matches;
+
+ while ( classes.length > 0 ) {
+ currentTheme = classes.pop();
+ matches = currentTheme.match(/^ui-body-([a-z])$/);
+
+ if ( matches && matches.length > 1 ) {
+ currentTheme = matches[1];
+ break;
+ } else {
+ currentTheme = null;
+ }
+ }
+
+ dst.removeClass( "ui-body-" + currentTheme );
+ if ( ( theme || "" ).match(/[a-z]/) ) {
+ dst.addClass( "ui-body-" + theme );
+ }
+ },
+
+ _setTheme: function ( value ) {
+ this._realSetTheme( this.element, value );
+ this.options.theme = value;
+ this.element.attr( "data-" + ( $.mobile.ns || "" ) + "theme", value );
+ },
+
+ _setOverlayTheme: function ( value ) {
+ this._realSetTheme( this._ui.container, value );
+ this.options.overlayTheme = value;
+ this.element.attr( "data-" + ( $.mobile.ns || "" ) + "overlay-theme", value );
+ },
+
+ _setShadow: function ( value ) {
+ this.options.shadow = value;
+ this.element.attr( "data-" + ( $.mobile.ns || "" ) + "shadow", value );
+ this._ui.container[value ? "addClass" : "removeClass"]("ui-overlay-shadow");
+ },
+
+ _setCorners: function ( value ) {
+ this.options.corners = value;
+ this.element.attr( "data-" + ( $.mobile.ns || "" ) + "corners", value );
+ this._ui.container[value ? "addClass" : "removeClass"]("ui-corner-all");
+ },
+
+ _setFade: function ( value ) {
+ this.options.fade = value;
+ this.element.attr( "data-" + ( $.mobile.ns || "" ) + "fade", value );
+ },
+
+ _setTransition: function ( value ) {
+ this._ui.container
+ .removeClass( this.options.transition || "" )
+ .addClass( value );
+ this.options.transition = value;
+ this.element.attr( "data-" + ( $.mobile.ns || "" ) + "transition", value );
+ },
+
+ _setDisabled: function ( value ) {
+ $.Widget.prototype._setOption.call( this, "disabled", value );
+ if ( value ) {
+ this.close();
+ }
+ }
+ });
+
+ $.tizen.popupwindow.bindPopupToButton = function ( btn, popup ) {
+ if ( btn.length === 0 || popup.length === 0 ) {
+ return;
+ }
+
+ var btnVClickHandler = function ( e ) {
+ if ( !popup.jqmData("overlay-theme-set") ) {
+ popup.popupwindow( "option", "overlayTheme", btn.jqmData("theme") );
+ }
+
+ popup.popupwindow( "open",
+ btn.offset().left + btn.outerWidth() / 2,
+ btn.offset().top + btn.outerHeight() / 2 );
+
+ return false;
+ };
+
+ if ( ( popup.popupwindow("option", "overlayTheme") || "" ).match(/[a-z]/) ) {
+ popup.jqmData( "overlay-theme-set", true );
+ }
+
+ btn
+ .attr({
+ "aria-haspopup": true,
+ "aria-owns": btn.attr("href")
+ })
+ .removeAttr("href")
+ .bind( "vclick", btnVClickHandler );
+
+ popup.bind( "destroyed", function () {
+ btn.unbind( "vclick", btnVClickHandler );
+ } );
+ };
+
+ $( document ).bind( "pagecreate create", function ( e ) {
+ $( $.tizen.popupwindow.prototype.options.initSelector, e.target )
+ .not(":jqmData(role='none'), :jqmData(role='nojs')")
+ .popupwindow();
+
+ $( "a[href^='#']:jqmData(rel='popupwindow')", e.target ).each( function () {
+ $.tizen.popupwindow.bindPopupToButton( $( this ), $( $( this ).attr("href") ) );
+ });
+ });
+}( jQuery ));
+
--- /dev/null
+
+/* ***************************************************************************
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software" ),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * ***************************************************************************
+ *
+ * Author: Minkyu Kang <mk7.kang@samsung.com>
+ * Author: Koeun Choi <koeun.choi@samsung.com>
+ */
+
+/*
+ * Progress widget
+ *
+ * HTML Attributes
+ *
+ * data-role: set to 'progress'.
+ * data-style: 'circle' or 'pending'.
+ *
+ * APIs
+ *
+ * show(): show the progress.
+ * hide(): hide the progress.
+ * running(boolean): start or stop the running.
+ *
+ * Events
+ *
+ * N/A
+ *
+ * Examples
+ *
+ * <li data-role="list-divider">Progress Pending</li>
+ * <li>
+ * <div data-role="progress" data-style="pending" id="pending"></div>
+ * </li>
+ * <li data-role="list-divider">Progress ~ing</li>
+ * <li>
+ * <div data-role="progress" data-style="circle" id="progress"></div>Loading..
+ * </li>
+ *
+ * $("#pending").progress( "running", true );
+ * $("#progress").progress( "running", true );
+ *
+ */
+
+/**
+ @class Progress
+ The progress widget shows that an operation is in progress. <br/>To add a progress widget to the application, use the following code:
+
+ <div data-role="progress" data-style="circle"></div>
+*/
+/**
+ @property {String} data-style
+ Sets the style of the progress widget. The style options are pending (pending progress style) and circle (circular progress status style).
+*/
+/**
+ @method running
+ The running method is used to set the current running state of the pending or circular progress widget:
+
+ <div id="foo" data-role="progress" data-style="pending"></div>
+ $("#foo").progress("running", true);
+*/
+/**
+ @method show
+ The show method is used to show the pending or circular progress widget:
+
+ <div id="foo" data-role="progress" data-style="pending"></div>
+ $("#foo").progress("show");
+*/
+/**
+ @method hide
+ The show method is used to hide the pending or circular progress widget:
+
+ <div id="foo" data-role="progress" data-style="pending"></div>
+ $("#foo").progress("hide");
+*/
+
+(function ( $, window, undefined ) {
+ $.widget( "tizen.progress", $.mobile.widget, {
+ options: {
+ style: "circle",
+ running: false
+ },
+
+ show: function () {
+ $( this.element ).show();
+ },
+
+ hide: function () {
+ $( this.element ).hide();
+ },
+
+ _start: function () {
+ if ( !this.init ) {
+ $( this.element ).append( this.html );
+ this.init = true;
+ }
+
+ this.show();
+
+ $( this.element )
+ .find( ".ui-progress-" + this.options.style )
+ .addClass( this.runningClass );
+ },
+
+ _stop: function () {
+ $( this.element )
+ .find( ".ui-progress-" + this.options.style )
+ .removeClass( this.runningClass );
+ },
+
+ running: function ( running ) {
+ if ( running === undefined ) {
+ return this.options.running;
+ }
+
+ this._setOption( "running", running );
+ },
+
+ _setOption: function ( key, value ) {
+ if ( key === "running" ) {
+ if ( typeof value !== "boolean" ) {
+ window.alert( "running value MUST be boolean type!" );
+ return;
+ }
+
+ this.options.running = value;
+ this._refresh();
+ }
+ },
+
+ _refresh: function () {
+ if ( this.options.running ) {
+ this._start();
+ } else {
+ this._stop();
+ }
+ },
+
+ _create: function () {
+ var self = this,
+ element = this.element,
+ style = element.jqmData( "style" ),
+ _html,
+ runningClass;
+
+ if ( style ) {
+ this.options.style = style;
+ } else {
+ style = this.options.style;
+ }
+
+ if ( style == "circle" ) {
+ $( this.element ).addClass("ui-progress-container-circle");
+
+ _html = '<div class="ui-progress-circle"></div>';
+ } else if ( style === "pending" ) {
+ $( this.element ).addClass("ui-progressbar");
+
+ _html = '<div class="ui-progressbar-bg">' +
+ '<div class="ui-progress-pending"></div>' +
+ '</div>';
+ }
+
+ this.html = $( _html );
+
+ runningClass = "ui-progress-" + style + "-running";
+
+ $.extend( this, {
+ init: false,
+ runningClass: runningClass
+ } );
+
+ if ( style === "pending" ) {
+ $( this.element ).append( this.html );
+ this.init = true;
+ }
+
+ this._refresh();
+ }
+ } ); /* End of widget */
+
+ $( document ).bind( "pagecreate create", function ( e ) {
+ $( e.target ).find( ":jqmData(role='progress')" ).progress();
+ } );
+}( jQuery, this ));
+
--- /dev/null
+
+/*
+ * jQuery UI Progressbar @VERSION
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Progressbar
+ *
+ * Depends:
+ * jquery.ui.core.js
+ * jquery.ui.widget.js
+ * Original file:
+ * jquery.ui.progressbar.js
+ */
+/* This is from jquery ui plugin - progressbar 11/16/2011 */
+
+
+/**
+ @class ProgressBar
+ The progress bar widget shows a control that indicates the progress percentage of an on-going operation. This widget can be scaled to fit inside a parent container.
+
+ To add a progress bar widget to the application, use the following code:
+
+ <div id="foo" data-role="progressbar"</div>
+*/
+/**
+ @event change
+ The progress bar can define a callback for the change event, which is fired when the progress value is changed:
+ <div id="foo" data-role="progressbar"></div>
+ $("#foo").bind("change", function (ev, val) {
+ Console.log("Value is changed to " + val);
+ });
+*/
+/**
+ @method value
+ You can use the value method with the pickers to set or get the current default progress bar value:
+
+ <div id="foo" data-role="progressbar"></div>
+ var oldVal = $("#foo").progressbar("value");
+ $("#foo").progressbar("value", 50);
+*/
+
+(function ( $, window, undefined ) {
+
+ $.widget( "tizen.progressbar", $.mobile.widget, {
+ options: {
+ value: 0,
+ max: 100
+ },
+
+ min: 0,
+
+ _create: function () {
+ this.element
+ .addClass( "ui-progressbar" )
+ .attr( {
+ role: "progressbar",
+ "aria-valuemin": this.min,
+ "aria-valuemax": this.options.max,
+ "aria-valuenow": this._value()
+ } );
+
+ this.valueDiv = $( "<div class='ui-progressbar-value'></div>" )
+ .appendTo( this.element );
+
+ this.valueDiv.wrap("<div class='ui-progressbar-bg'></div>");
+
+ this.oldValue = this._value();
+ this._refreshValue();
+ },
+
+ _destroy: function () {
+ this.element
+ .removeClass( "ui-progressbar" )
+ .removeAttr( "role" )
+ .removeAttr( "aria-valuemin" )
+ .removeAttr( "aria-valuemax" )
+ .removeAttr( "aria-valuenow" );
+
+ this.valueDiv.remove();
+ },
+
+ value: function ( newValue ) {
+ if ( newValue === undefined ) {
+ return this._value();
+ }
+
+ this._setOption( "value", newValue );
+ return this;
+ },
+
+ _setOption: function ( key, value ) {
+ if ( key === "value" ) {
+ this.options.value = value;
+ this._refreshValue();
+ if ( this._value() === this.options.max ) {
+ this.element.trigger( "complete" );
+ }
+ }
+ // jquery.ui.widget.js MUST be updated to new version!
+ //this._super( "_setOption", key, value );
+ },
+
+ _value: function () {
+ var val = this.options.value;
+ // normalize invalid value
+ if ( typeof val !== "number" ) {
+ val = 0;
+ }
+ return Math.min( this.options.max, Math.max( this.min, val ) );
+ },
+
+ _percentage: function () {
+ return 100 * this._value() / this.options.max;
+ },
+
+ _refreshValue: function () {
+ var value = this.value(),
+ percentage = this._percentage();
+
+ if ( this.oldValue !== value ) {
+ this.oldValue = value;
+ this.element.trigger( "change" );
+ }
+
+ this.valueDiv
+ .toggle( value > this.min )
+ .width( percentage.toFixed(0) + "%" );
+ this.element.attr( "aria-valuenow", value );
+ }
+ } );
+
+ // auto self-init widgets
+ $( document ).bind( "pagecreate", function ( e ) {
+ $( e.target ).find( ":jqmData(role='progressbar')" ).progressbar();
+ } );
+
+}( jQuery, this ) );
+
--- /dev/null
+
+/* ***************************************************************************
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * ***************************************************************************
+ *
+ * Authors: Wonseop Kim ( wonseop.kim@samsung.com )
+*/
+
+/**
+ * "Handler" is a widget helping a user to scroll a window or panel.
+ * It is different from the scrollview feature in that the handler has a fixed size
+ * and disappears when a scroll size is smaller than a parent window's size.
+ * If the handler widget is activated, a scroll bar on the screen will be deactivated.
+ * The handler widget supports scrolling up and down and indicates the position of the scrolled window.
+ *
+ * HTML Attributes:
+ *
+ * data-handler : This attribute is indicating that whether enable.
+ * If you want to use, you will set 'true'.
+ * data-handler-theme : Set the widget theme ( optional )
+ *
+ * APIs:
+ *
+ * enableHandler ( boolean )
+ * : Get or set the use of handler widget.
+ * If the value is "true", it will be run handler widget.
+ * If the value is "false", it will be not run handler widget.
+ * If no value is specified, will act as a getter.
+ *
+ * Events:
+ *
+ * Examples:
+ *
+ * <div data-role="content" data-scroll="y" data-handler="true">
+ * <ul data-role="listview">
+ * <li data-role="list-divider">A</li>
+ * <li><a href="#">Adam Kinkaid</a></li>
+ * ...
+ * </ul>
+ * </div>
+ */
+
+/**
+ @class handler
+ The handler widget enables the user to vertically scroll through a page or panel using a fixed-size handle. The widget indicates the position of the scrolled window, and only appears on the screen if the parent page or panel's scroll size is larger than the screen size. <br/> To add a handler widget to the application, use the following code:
+
+ <div data-role="content" data-scroll="y" data-handler="true">
+ <ul data-role="listview">
+ <li data-role="list-divider">A</li>
+ <li><a href="#">Adam Kinkaid</a></li>
+ ...
+ </ul>
+ </div>
+
+ You can use the enableHandler method with the handler widget to get (if no value is defined) or set the handler usage status. If the [enable] value is true, the handler is enabled; otherwise the handler is not used.
+
+ $("#.selector").scrollview("enableHandler", [enable]);
+*/
+/**
+ @property {Boolean} data-handler
+ Enables the handler widget. The value must be set to true.
+*/
+/**
+ @property {String} data-handler-theme
+ Sets the handler widget theme.
+*/
+( function ( $, document, undefined ) {
+ // The options of handler in scrollview
+ $.tizen.scrollview.prototype.options.handler = false;
+ $.tizen.scrollview.prototype.options.handlerTheme = "s";
+
+ var originSetOption = $.tizen.scrollview.prototype._setOption,
+ createHandler = function ( target ) {
+ var $view = target,
+ prefix = "<div class=\"ui-handler ui-handler-direction-",
+ suffix = "\"><div class=\"ui-handler-track\"><div class=\"ui-handler-thumb\"></div></div></div>",
+ scrollview = $view.data( "scrollview" ),
+ options = scrollview.options,
+ direction = options.direction,
+ parentTheme = $.mobile.getInheritedTheme( scrollview, "s" ),
+ theme = options.theme || parentTheme,
+ isHorizontal = ( scrollview.options.direction === "x" ),
+ _$view = scrollview._$view,
+ _$clip = scrollview._$clip,
+ scrollbar = $view.find( ".ui-scrollbar" ),
+ handler = null,
+ handlerThumb = null,
+ viewLength = 0,
+ clipLength = 0,
+ handlerHeight = 0,
+ handlerMargin = 0,
+ trackLength = 0,
+ moveTimer,
+ isTouchable = $.support.touch,
+ dragStartEvt = ( isTouchable ? "touchstart" : "mousedown" ) + ".handler",
+ dragMoveEvt = ( isTouchable ? "touchmove" : "mousemove" ) + ".handler",
+ dragStopEvt = ( isTouchable ? "touchend" : "mouseup" ) + ".handler",
+ dragLeaveEvt = ( isTouchable ? " touchleave" : " mouseleave" ) + ".handler",
+ calculateLength = function () {
+ clipLength = ( isHorizontal ? _$clip.width() : _$clip.height() );
+ viewLength = ( isHorizontal ? _$view.width() : _$view.height() ) - clipLength;
+ trackLength = clipLength - handlerHeight - handlerMargin * 2;
+ },
+ setHanderPostion = function ( scrollPos ) {
+ var handlerPos = Math.round( ( isHorizontal ? scrollPos.x : scrollPos.y ) / viewLength * trackLength );
+ handlerThumb[0].style[ ( isHorizontal ? "left" : "top" ) ] = handlerPos + "px";
+ },
+ stopHandlerScroll = function () {
+ $( document ).unbind( ".handler" );
+ $view.moveData = null;
+ _$view.trigger( "scrollstop" );
+ };
+
+ if ( $view.find( ".ui-handler-thumb" ).length !== 0 || typeof direction !== "string" ) {
+ return;
+ }
+
+ handler = $( [ prefix, direction, suffix ].join( "" ) ).appendTo( $view.addClass( " ui-handler-" + theme ) );
+ handlerThumb = $view.find( ".ui-handler-thumb" ).attr( {
+ "tabindex" : "0",
+ "aria-label" : ( isHorizontal ? "Horizontal handler, double tap and move to scroll" : "Verticalhandler, double tap and move to scroll" )
+ }).hide();
+ handlerHeight = ( isHorizontal ? handlerThumb.width() : handlerThumb.height() );
+ handlerMargin = ( isHorizontal ? parseInt( handler.css( "right" ), 10 ) : parseInt( handler.css( "bottom" ), 10 ) );
+
+ $.extend( $view, {
+ moveData : null
+ });
+
+ // handler drag
+ handlerThumb.bind( dragStartEvt, {
+ e : handlerThumb[0]
+ }, function ( event ) {
+ scrollview._stopMScroll();
+
+ var target = event.data.e,
+ t = ( isTouchable ? event.originalEvent.targetTouches[0] : event );
+
+ target.style.opacity = 1.0;
+
+ $view.moveData = {
+ target : target,
+ X : parseInt( target.style.left, 10 ) || 0,
+ Y : parseInt( target.style.top, 10 ) || 0,
+ pX : t.pageX,
+ pY : t.pageY
+ };
+ calculateLength();
+
+ _$view.trigger( "scrollstart" );
+
+ if ( !isTouchable ) {
+ event.preventDefault();
+ }
+
+ $( document ).bind( dragMoveEvt, function ( event ) {
+ var moveData = $view.moveData,
+ target = moveData.target,
+ handlePos = 0,
+ scrollPos = 0,
+ t = ( isTouchable ? event.originalEvent.targetTouches[0] : event );
+
+ handlePos = ( isHorizontal ? moveData.X + t.pageX - moveData.pX : moveData.Y + t.pageY - moveData.pY );
+
+ if ( handlePos < 0 ) {
+ handlePos = 0;
+ }
+
+ if ( handlePos > trackLength ) {
+ handlePos = trackLength;
+ }
+ scrollPos = - Math.round( handlePos / trackLength * viewLength );
+
+ if ( isHorizontal ) {
+ scrollview._setScrollPosition( scrollPos, 0 );
+ target.style.left = handlePos + "px";
+ } else {
+ scrollview._setScrollPosition( 0, scrollPos );
+ target.style.top = handlePos + "px";
+ }
+
+ event.preventDefault();
+ }).bind( dragStopEvt + dragLeaveEvt, function ( event ) {
+ stopHandlerScroll();
+ });
+ });
+
+ _$view.bind( dragStopEvt, function ( event ) {
+ stopHandlerScroll();
+ });
+
+ $view.bind( "scrollstart", function ( event ) {
+ if ( !scrollview.enableHandler() ) {
+ return;
+ }
+
+ calculateLength();
+
+ if ( viewLength < 0 || clipLength < handlerHeight ) {
+ if ( scrollbar.is( ":hidden" ) ) {
+ scrollbar.show();
+ }
+ return;
+ }
+
+ if ( scrollbar.is( ":visible" ) ) {
+ scrollbar.hide();
+ }
+
+ if ( moveTimer ) {
+ clearInterval( moveTimer );
+ moveTimer = undefined;
+ }
+
+ handler.addClass( "ui-handler-visible" );
+ handlerThumb.stop( true, true )
+ .fadeIn();
+ }).bind( "scrollupdate", function ( event, data ) {
+ if ( !scrollview.enableHandler() || viewLength < 0 || clipLength < handlerHeight ) {
+ return;
+ }
+
+ setHanderPostion( scrollview.getScrollPosition() );
+ }).bind( "scrollstop", function ( event ) {
+ if ( !scrollview.enableHandler() || viewLength < 0 || clipLength < handlerHeight ) {
+ return;
+ }
+
+ moveTimer = setInterval( function () {
+ setHanderPostion( scrollview.getScrollPosition() );
+ if ( !scrollview._gesture_timer ) {
+ clearInterval( moveTimer );
+ moveTimer = undefined;
+ }
+ }, 10 );
+
+ if ( scrollview._handlerTimer ) {
+ clearTimeout( scrollview._handlerTimer );
+ scrollview._handlerTimer = 0;
+ }
+ scrollview._handlerTimer = setTimeout( function () {
+ if ( scrollview._timerID === 0 && $view.moveData === null ) {
+ handlerThumb.stop( true, true )
+ .css( "opacity", 1.0 )
+ .fadeOut( function () {
+ handler.removeClass( "ui-handler-visible" );
+ });
+ scrollview._handlerTimer = 0;
+ }
+ }, 1000 );
+ }).bind( "mousewheel", function ( event ) {
+ handler.removeClass( "ui-handler-visible" );
+ setHanderPostion( scrollview.getScrollPosition() );
+ });
+ };
+
+ $.extend( $.tizen.scrollview.prototype, {
+ enableHandler: function ( enabled ) {
+ if ( typeof enabled === 'undefined' ) {
+ return this.options.handler;
+ }
+
+ this.options.handler = !!enabled;
+
+ var $view = this.element;
+ if ( this.options.handler ) {
+ if ( $view.find( ".ui-handler" ).length === 0 ) {
+ createHandler( $view );
+ }
+
+ $view.find( ".ui-scrollbar" ).hide();
+ $view.find( ".ui-handler" ).show();
+ } else {
+ $view.find( ".ui-handler" ).removeClass( "ui-handler-visible" ).hide();
+ $view.find( ".ui-scrollbar" ).show();
+ }
+ },
+
+ _setHandlerTheme: function ( handlerTheme ) {
+ if ( !handlerTheme ) {
+ return;
+ }
+
+ var oldClass = "ui-handler-" + this.options.handlerTheme,
+ newClass = "ui-handler-" + handlerTheme;
+
+ this.element.removeClass( oldClass ).addClass( newClass );
+ this.options.handlerTheme = handlerTheme;
+ },
+
+ _setOption: function ( key, value ) {
+ switch ( key ) {
+ case "handler":
+ this.enableHandler( value );
+ break;
+ case "handlerTheme":
+ this._setHandlerTheme( value );
+ break;
+ default:
+ originSetOption.call( this, key, value );
+ }
+ },
+
+ _handlerTimer : 0
+ });
+
+ $( document ).delegate( ":jqmData(scroll)", "scrollviewcreate", function () {
+ var widget = $( this );
+ if ( widget.attr( "data-" + $.mobile.ns + "scroll" ) === "none"
+ || widget.attr( "data-" + $.mobile.ns + "handler" ) !== "true" ) {
+ return;
+ }
+ widget.scrollview( "enableHandler", "true" );
+ });
+} ( jQuery, document ) );
+
--- /dev/null
+
+/* ***************************************************************************
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * ***************************************************************************
+ */
+/*
+* jQuery Mobile Framework : "textinput" plugin for text inputs, textareas
+* Copyright (c) jQuery Project
+* Dual licensed under the MIT or GPL Version 2 licenses.
+* http://jquery.org/license
+* Authors: Jinhyuk Jun <jinhyuk.jun@samsung.com>
+* Wongi Lee <wongi11.lee@samsung.com>
+*/
+
+/**
+ * Searchbar can be created using <input> element with type=search
+ * <input type="search" name="search" id="search1" value="" />
+ *
+ * Searchbar can be inserted 3 cases
+ * content : seachbar behave same as content element
+ * header : searchbar placed below title(header), It doesn't move when scrolling page
+ * inside optionheader : Searchbar placed inside optionheader, searchbar can be seen only expand optionheader
+ *
+ * Examples:
+ *
+ * HTML markup for creating Searchbar
+ * <input type="search"/>
+ *
+ * How to make searchbar in content
+ * <input type="search" name="" id="" value="" />
+ *
+ * How to make cancel button in searchbar
+ * <div data-role="header" data-position ="fixed" >
+ * <h1>Searchbar</h1>
+ * <input type="search" data-cancel-btn=true name="" id="" value="" />
+ * </div>
+ *
+ * How to make icon in front of searchbar
+ * <div data-role="header" data-position ="fixed" >
+ * <h1>Searchbar</h1>
+ * <input type="search" data-icon="call" name="" id="" value="" />
+ * </div>
+*/
+
+/**
+ @class SearchBar
+ The search bar widget is used to search for page content. This widget can be placed in the header, option header, or page content.
+
+ To add a search bar widget to the application, use the following code:
+
+ <label for="search-basic">Search Input:</label>
+ <input type="search" name="search" id="searc-basic" value="" data-mini="true" />
+
+ Tizen supports many search bar options as described in the jQueryMobile documentation for search bar options.
+ The search bar can define callbacks for events as described in the jQueryMobile documentation for search bar events.
+ You can use methods with the search bar as described in the jQueryMobile documentation for search bar methods.
+*/
+
+(function ( $, undefined ) {
+
+ $.widget( "tizen.searchbar", $.mobile.widget, {
+ options: {
+ theme: null,
+ initSelector: "input[type='search'],:jqmData(type='search'), input[type='tizen-search'],:jqmData(type='tizen-search')"
+ },
+
+ _create: function () {
+ var input = this.element,
+ o = this.options,
+ theme = o.theme || $.mobile.getInheritedTheme( this.element, "c" ),
+ themeclass = " ui-body-" + theme,
+ focusedEl,
+ clearbtn,
+ cancelbtn,
+ defaultText,
+ defaultTextClass,
+ trimedText,
+ newClassName,
+ newStyle,
+ newDiv,
+ searchimage,
+ inputedText,
+ useCancelBtn = false,
+ frontIcon = false;
+
+ $( "label[for='" + input.attr( "id" ) + "']" ).addClass( "ui-input-text" );
+
+ if ( typeof input[0].autocorrect !== "undefined" && !$.support.touchOverflow ) {
+ // Set the attribute instead of the property just in case there
+ // is code that attempts to make modifications via HTML.
+ input[0].setAttribute( "autocorrect", "off" );
+ input[0].setAttribute( "autocomplete", "off" );
+ }
+
+ focusedEl = input.wrap( "<div class='ui-input-search ui-shadow-inset ui-corner-all ui-btn-shadow" + themeclass + "'></div>" ).parent();
+
+ if ( $( this.element ).data( "cancel-btn" ) === true ) {
+ useCancelBtn = true;
+ focusedEl.addClass( "ui-input-search-default" );
+ }
+ if ( $( this.element ).data( "icon" ) != undefined ) {
+ frontIcon = true;
+ focusedEl.addClass( "ui-search-bar-icon" );
+ }
+
+ clearbtn = $( "<a href='#' class='ui-input-clear' title='clear text'>clear text</a>" )
+ .bind('click', function ( event ) {
+ if ( input.attr( "disabled" ) == "disabled" ) {
+ return false;
+ }
+ input
+ .val( "" )
+ .focus()
+ .trigger( "change" );
+ clearbtn.addClass( "ui-input-clear-hidden" );
+ event.preventDefault();
+ })
+ .appendTo( focusedEl )
+ .buttonMarkup({
+ icon: "deleteSearch",
+ iconpos: "notext",
+ corners: true,
+ shadow: true
+ });
+
+ function toggleClear() {
+ setTimeout(function () {
+ clearbtn.toggleClass( "ui-input-clear-hidden", !input.val() );
+ }, 0);
+ }
+
+ function showCancel() {
+ focusedEl
+ .addClass( "ui-input-search-default" )
+ .removeClass( "ui-input-search-wide" );
+ cancelbtn
+ .addClass( "ui-btn-cancel-show" )
+ .removeClass( "ui-btn-cancel-hide" );
+ }
+
+ function hideCancel() {
+ focusedEl
+ .addClass( "ui-input-search-wide" )
+ .removeClass( "ui-input-search-default" );
+ cancelbtn
+ .addClass( "ui-btn-cancel-hide" )
+ .removeClass( "ui-btn-cancel-show" );
+ toggleClear();
+ }
+
+ function makeFrontIcon() {
+ var IconStyle = $( input ).jqmData( "icon" ),
+ frontIcon = $( "<div data-role='button' data-style='circle'></div>" );
+
+ frontIcon
+ .appendTo( focusedEl.parent() )
+ .buttonMarkup( {
+ icon: IconStyle,
+ corners: true,
+ shadow: true
+ } );
+ frontIcon.addClass( "ui-btn-search-front-icon" );
+ }
+
+ toggleClear();
+
+ input.bind( 'paste cut keyup focus change blur', toggleClear );
+
+ //SLP --start search bar with cancel button
+ focusedEl.wrapAll( "<div class='input-search-bar'></div>" );
+ searchimage = $("<div class='ui-image-search'></div>").appendTo( focusedEl );
+
+ if ( frontIcon ) {
+ makeFrontIcon();
+ }
+
+ if ( useCancelBtn ) {
+ cancelbtn = $( "<div data-role='button' class='ui-input-cancel' title='clear text'>Cancel</div>" )
+ .bind('click', function ( event ) {
+ if ( input.attr( "disabled" ) == "disabled" ) {
+ return false;
+ }
+ event.preventDefault();
+ event.stopPropagation();
+
+ input
+ .val( "" )
+ .blur()
+ .trigger( "change" );
+
+ if ( useCancelBtn ) {
+ hideCancel();
+ }
+ } )
+ .appendTo( focusedEl.parent() )
+ .buttonMarkup( {
+ iconpos: "cancel",
+ corners: true,
+ shadow: true
+ } );
+ }
+
+ // Input Focused
+ input
+ .focus( function () {
+ if ( input.attr( "disabled" ) == "disabled" ) {
+ return false;
+ }
+ if ( useCancelBtn ) {
+ showCancel();
+ }
+ focusedEl.addClass( $.mobile.focusClass );
+ })
+ .blur(function () {
+ focusedEl.removeClass( $.mobile.focusClass );
+ });
+
+ // Default Text
+ defaultText = input.jqmData( "default-text" );
+
+ if ( ( defaultText != undefined ) && ( defaultText.length > 0 ) ) {
+ defaultTextClass = "ui-input-default-text";
+ trimedText = defaultText.replace(/\s/g, "");
+
+ /* Make new class for default text string */
+ newClassName = defaultTextClass + "-" + trimedText;
+ newStyle = $( "<style>" + '.' + newClassName + ":after" + "{content:" + "'" + defaultText + "'" + "}" + "</style>" );
+ $( 'html > head' ).append( newStyle );
+
+ /* Make new empty <DIV> for default text */
+ newDiv = $( "<div></div>" );
+
+ /* Add class and append new div */
+ newDiv.addClass( defaultTextClass );
+ newDiv.addClass( newClassName );
+ newDiv.tap( function ( event ) {
+ input.blur();
+ input.focus();
+ } );
+
+ input.parent().append( newDiv );
+
+ /* When focus, default text will be hide. */
+ input
+ .focus( function () {
+ input.parent().find( "div.ui-input-default-text" ).addClass( "ui-input-default-hidden" );
+ } )
+ .blur( function () {
+ var inputedText = input.val();
+ if ( inputedText.length > 0 ) {
+ input.parent().find( "div.ui-input-default-text" ).addClass( "ui-input-default-hidden" );
+ } else {
+ input.parent().find( "div.ui-input-default-text" ).removeClass( "ui-input-default-hidden" );
+ }
+ } );
+ }
+
+ if ( !input.attr("placeholder") ) {
+ input.attr( "placeholder", "Search" );
+ }
+ },
+
+ disable: function () {
+ this.element.attr( "disabled", true );
+ this.element.parent().addClass( "ui-disabled" );
+ $( this.element ).blur();
+ this.element.parent().parent().find(".ui-input-cancel").addClass( "ui-disabled" );
+ },
+
+ enable: function () {
+ this.element.attr( "disabled", false );
+ this.element.parent().removeClass( "ui-disabled" );
+ this.element.parent().parent().find(".ui-input-cancel").removeClass( "ui-disabled" );
+ $( this.element ).focus();
+ }
+ } );
+
+ //auto self-init widgets
+ $( document ).bind( "pagecreate create", function ( e ) {
+ $.tizen.searchbar.prototype.enhanceWithin( e.target );
+ } );
+
+}( jQuery ) );
+
--- /dev/null
+
+/*
+ * jQuery Mobile Widget @VERSION
+ *
+ * This software is licensed under the MIT licence (as defined by the OSI at
+ * http://www.opensource.org/licenses/mit-license.php)
+ *
+ * ***************************************************************************
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2011 by Intel Corporation Ltd.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * ***************************************************************************
+ *
+ * Authors: Max Waterman <max.waterman@intel.com>
+ * Authors: Minkyu Kang <mk7.kang@samsung.com>
+ */
+
+/**
+ * tizenslider modifies the JQuery Mobile slider and is created in the same way.
+ *
+ * See the JQuery Mobile slider widget for more information :
+ * http://jquerymobile.com/demos/1.0a4.1/docs/forms/forms-slider.html
+ *
+ * The JQuery Mobile slider option:
+ * theme: specify the theme using the 'data-theme' attribute
+ *
+ * Options:
+ * theme: string; the theme to use if none is specified using the 'data-theme' attribute
+ * default: 'c'
+ * popup: boolean; controls whether the popup is displayed or not
+ * specify if the popup is enabled using the 'data-popup' attribute
+ * set from javascript using .tizenslider('option','popup',newValue)
+ *
+ * Events:
+ * changed: triggers when the value is changed (rather than when the handle is moved)
+ *
+ * Examples:
+ *
+ * <a href="#" id="popupEnabler" data-role="button" data-inline="true">Enable popup</a>
+ * <a href="#" id="popupDisabler" data-role="button" data-inline="true">Disable popup</a>
+ * <div data-role="fieldcontain">
+ * <input id="mySlider" data-theme='a' data-popup='false' type="range" name="slider" value="7" min="0" max="9" />
+ * </div>
+ * <div data-role="fieldcontain">
+ * <input id="mySlider2" type="range" name="slider" value="77" min="0" max="777" />
+ * </div>
+ *
+ * // disable popup from javascript
+ * $('#mySlider').tizenslider('option','popup',false);
+ *
+ * // from buttons
+ * $('#popupEnabler').bind('vclick', function() {
+ * $('#mySlider').tizenslider('option','popup',true);
+ * });
+ * $('#popupDisabler').bind('vclick', function() {
+ * $('#mySlider').tizenslider('option','popup',false);
+ * });
+ */
+
+/**
+ @class Slider
+ The slider widget shows a control on the screen that you can use to change values by dragging a handle on a horizontal scale. Sliders can be used in Tizen as described in the jQueryMobile documentation for sliders.
+
+ To add a slider widget to the application, use the following code:
+
+ <input data-popup='false' type="range" name="slider" value="5" min="0" max="10" data-icon="text" data-text-left="Min" data-text-right="Max" />
+
+ The slider can define callbacks for events as described in the jQueryMobile documentation for slider events.
+ You can use methods with the slider as described in the jQueryMobile documentation for slider methods.
+*/
+/**
+ @property {String} data-icon
+ Defines the icon style for the slider ends. The icon options are bright, volume, and text.
+ The default value is text.
+*/
+/**
+ @property {Boolean} data-popup
+ Enables or disables a pop-up showing the current value while the handle is dragged.
+ The default value is true.
+*/
+/**
+ @property {String} data-text-left
+ Defines the text displayed on the left side of the slider.
+ The data-icon option must be set to text.
+*/
+/**
+ @property {String} data-text-right
+ Defines the text displayed on the right side of the slider.
+ The data-icon option must be set to text.
+*/
+
+(function ($, window, undefined) {
+ $.widget("tizen.tizenslider", $.mobile.widget, {
+ options: {
+ popup: true
+ },
+
+ popup: null,
+ handle: null,
+ handleText: null,
+
+ _create: function () {
+ this.currentValue = null;
+ this.popupVisible = false;
+
+ var self = this,
+ inputElement = $( this.element ),
+ slider,
+ handle_press,
+ popupEnabledAttr,
+ icon,
+ text_right,
+ text_left,
+ text_length,
+ elem_left,
+ elem_right,
+ margin_left,
+ margin_right;
+
+ // apply jqm slider
+ inputElement.slider();
+
+ // hide the slider input element proper
+ inputElement.hide();
+
+ self.popup = $('<div class="ui-slider-popup"></div>');
+
+ // set the popup according to the html attribute
+ popupEnabledAttr = inputElement.jqmData('popup');
+ if ( popupEnabledAttr !== undefined ) {
+ self.options.popup = ( popupEnabledAttr == true );
+ }
+
+ // get the actual slider added by jqm
+ slider = inputElement.next('.ui-slider');
+
+ icon = inputElement.attr('data-icon');
+
+ // wrap the background
+ slider.wrap('<div class="ui-slider-container"></div>');
+
+ // get the handle
+ self.handle = slider.find('.ui-slider-handle');
+
+ // remove the rounded corners from the slider and its children
+ slider.removeClass('ui-btn-corner-all');
+ slider.find('*').removeClass('ui-btn-corner-all');
+
+ // add icon
+ switch ( icon ) {
+ case 'bright':
+ case 'volume':
+ elem_left = $('<div class="ui-slider-left-' + icon + '"></div>');
+ elem_right = $('<div class="ui-slider-right-' + icon + '"></div>');
+
+ slider.before( elem_left );
+ slider.after( elem_right );
+
+ margin_left = elem_left.width() + 16;
+ margin_right = elem_right.width() + 16;
+ break;
+
+ case 'text':
+ text_left = ( inputElement.attr('data-text-left') === undefined ) ? '' :
+ inputElement.attr('data-text-left').substring( 0, 3 );
+ text_right = ( inputElement.attr('data-text-right') === undefined ) ? '' :
+ inputElement.attr('data-text-right').substring( 0, 3 );
+
+ text_length = Math.max( text_left.length, text_right.length ) + 1;
+
+ margin_left = text_length + "rem";
+ margin_right = text_length + "rem";
+
+ elem_left = $('<div class="ui-slider-left-text" style="left:' +
+ -( text_length ) + 'rem; width:' + text_length + 'rem;">' +
+ '<span style="position:relative;top:0.4em;">' +
+ text_left +
+ '</span></div>');
+ elem_right = $('<div class="ui-slider-right-text" style="right:' +
+ -( text_length ) + 'rem; width:' + text_length + 'rem;">' +
+ '<span style="position:relative;top:0.4em;">' +
+ text_right +
+ '</span></div>');
+
+ slider.before( elem_left );
+ slider.after( elem_right );
+ break;
+ }
+
+ if ( icon ) {
+ slider.parent('.ui-slider-container').css({
+ "margin-left": margin_left,
+ "margin-right": margin_right
+ });
+ }
+
+ // handle press
+ slider.append($('<div class="ui-slider-handle-press"></div>'));
+ self.handle_press = slider.find('.ui-slider-handle-press');
+ self.handle_press.css('display', 'none');
+
+ // add a popup element (hidden initially)
+ slider.parents(".ui-page").append( self.popup );
+ self.popup.hide();
+
+ // get the element where value can be displayed
+ self.handleText = slider.find('.ui-btn-text');
+
+ // set initial value
+ self.updateSlider();
+
+ // bind to changes in the slider's value to update handle text
+ this.element.bind('change', function () {
+ self.updateSlider();
+ });
+
+ // bind clicks on the handle to show the popup
+ self.handle.bind('vmousedown', function () {
+ self.showPopup();
+ });
+
+ // watch events on the document to turn off the slider popup
+ slider.add( document ).bind('vmouseup', function () {
+ self.hidePopup();
+ });
+ },
+
+ _handle_press_show: function () {
+ this.handle_press.css('display', '');
+ },
+
+ _handle_press_hide: function () {
+ this.handle_press.css('display', 'none');
+ },
+
+ // position the popup
+ positionPopup: function () {
+ var dstOffset = this.handle.offset();
+
+ this.popup.offset({
+ left: dstOffset.left + ( this.handle.width() - this.popup.width() ) / 2,
+ top: dstOffset.top - this.popup.height()
+ });
+
+ this.handle_press.offset({
+ left: dstOffset.left,
+ top: dstOffset.top
+ });
+ },
+
+ // show value on the handle and in popup
+ updateSlider: function () {
+ var font_size,
+ font_length,
+ font_top,
+ padding_size,
+ newValue,
+ get_value_length = function ( v ) {
+ var val = Math.abs( v ),
+ len;
+
+ if ( val > 999 ) {
+ len = 4;
+ } else if ( val > 99 ) {
+ len = 3;
+ } else if ( val > 9 ) {
+ len = 2;
+ } else {
+ len = 1;
+ }
+
+ if ( v < 0 ) {
+ len++;
+ }
+
+ return len;
+ };
+
+ // remove the title attribute from the handle (which is
+ // responsible for the annoying tooltip); NB we have
+ // to do it here as the jqm slider sets it every time
+ // the slider's value changes :(
+ this.handle.removeAttr('title');
+
+ newValue = this.element.val();
+
+ font_length = get_value_length( newValue );
+
+ if ( this.popupVisible ) {
+ this.positionPopup();
+
+ switch ( font_length ) {
+ case 1:
+ case 2:
+ font_size = '1.5rem';
+ padding_size = '0.15rem';
+ break;
+ case 3:
+ font_size = '1rem';
+ padding_size = '0.5rem';
+ break;
+ default:
+ font_size = '0.8rem';
+ padding_size = '0.5rem';
+ break;
+ }
+
+ this.popup.css({
+ "font-size": font_size,
+ "padding-top": padding_size
+ });
+ }
+
+ if ( newValue === this.currentValue ) {
+ return;
+ }
+
+ switch ( font_length ) {
+ case 1:
+ font_size = '0.95rem';
+ font_top = '0';
+ break;
+ case 2:
+ font_size = '0.85rem';
+ font_top = '-0.01rem';
+ break;
+ case 3:
+ font_size = '0.65rem';
+ font_top = '-0.05rem';
+ break;
+ default:
+ font_size = '0.45rem';
+ font_top = '-0.15rem';
+ break;
+ }
+
+ if ( font_size != this.handleText.css('font-size') ) {
+ this.handleText.css({
+ 'font-size': font_size,
+ 'top': font_top
+ });
+ }
+
+ this.currentValue = newValue;
+ this.handleText.text( newValue );
+ this.popup.html( newValue );
+
+ this.element.trigger( 'update', newValue );
+ },
+
+ // show the popup
+ showPopup: function () {
+ if ( !this.options.popup || this.popupVisible ) {
+ return;
+ }
+
+ this.popup.show();
+ this.popupVisible = true;
+ this._handle_press_show();
+ },
+
+ // hide the popup
+ hidePopup: function () {
+ if ( !this.options.popup || !this.popupVisible ) {
+ return;
+ }
+
+ this.popup.hide();
+ this.popupVisible = false;
+ this._handle_press_hide();
+ },
+
+ _setOption: function (key, value) {
+ var needToChange = ( value !== this.options[key] );
+
+ if ( !needToChange ) {
+ return;
+ }
+
+ switch ( key ) {
+ case 'popup':
+ this.options.popup = value;
+
+ if ( this.options.popup) {
+ this.updateSlider();
+ } else {
+ this.hidePopup();
+ }
+
+ break;
+ }
+ }
+ });
+
+ // stop jqm from initialising sliders
+ $( document ).bind( "pagebeforecreate", function ( e ) {
+ if ( $.data( window, "jqmSliderInitSelector" ) === undefined ) {
+ $.data( window, "jqmSliderInitSelector",
+ $.mobile.slider.prototype.options.initSelector );
+ $.mobile.slider.prototype.options.initSelector = null;
+ }
+ });
+
+ // initialise sliders with our own slider
+ $( document ).bind( "pagecreate create", function ( e ) {
+ var jqmSliderInitSelector = $.data( window, "jqmSliderInitSelector" );
+ $( e.target ).find(jqmSliderInitSelector).not('select').tizenslider();
+ $( e.target ).find(jqmSliderInitSelector).filter('select').slider();
+ });
+
+}( jQuery, this ));
+
--- /dev/null
+
+/* ***************************************************************************
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * ***************************************************************************
+ *
+ * Author: Sanghee Lee <sang-hee.lee@samsung.com>
+*/
+
+/**
+ * Splitview is a widget which can show different HTML contents at the same time on each divided pane.
+ * A user can place Splitview controls on JQuery Mobile's Content area and arrange two panes on the widget.
+ * And HTML fragments or another Splitview also can be placed on the pane.
+ * The number of panes inside of Splitview is restricted as two.
+ * If a user define only one pane in Splitview, a empty pane will be added automatically,
+ * on the other hand, if 3 or more panes are defined in Splitview, the panes after two will be ignored and removed from the DOM tree.
+ * The HTML fragments of a pane should be composed of elements describing a part of Web page (e.g. <div>…</div>).
+ * Also widgets can be included in the HTML fragments.
+ *
+ * HTML Attributes:
+ *
+ * data-fixed : The resizing mode of panes - fixed and flexible mode.
+ * If the value is true, the panes' sizes will be fixed, or if not, it will be flexible. (Default : false)
+ * data-divider-vertical : The direction of dividers.
+ * If the value is true, the panes will be placed in horizontal direction,
+ * or if not, it will be placed in vertical direction. (Default : "true")
+ * data-ratio : The ratio of two panes' widths or heights. (Default : [ 1/2, 1/2 ]
+ *
+ * APIs:
+ *
+ * pane ( id [ , element ] )
+ * : This method replaces child contents of a pane indicated by id attribute with contents of inputted element.
+ * If second argument is not specified, it will act as a getter method.
+ * The string of id has to be started with "#" which means "id" of CSS selectors.
+ * maximize ( id )
+ * : This method maximizes a pane's size indicated by id.
+ * The string of id has to be started with "#" which means "id" of CSS selectors.
+ * restore ()
+ * : This method restores all panes' sizes to the ratio prior to maximization.
+ *
+ * Examples:
+ *
+ * <div data-role="splitview" data-fixed="false" data-divider-vertical="true" data-ratio="0.5, 0.5">
+ * <div class="ui-pane">pane0</div>
+ * <div class="ui-pane">pane1</div>
+ * </div>
+ *
+ */
+
+
+/**
+ @class Splitview
+ Splitview widget enables a user to place and arrange several panes. Each divided pane can show repective HTML contents.
+
+ To add a Splitview widget to the application, use the following code:
+
+ <div data-role="splitview" data-fixed="false" data-divider-vertical="true" data-ratio="0.5, 0.5">
+ <div class="ui-pane">pane0</div>
+ <div class="ui-pane">pane1</div>
+ </div>
+*/
+
+/**
+ @property {Boolean} data-fixed
+ The resizing mode of panes - fixed and flexible mode.
+*/
+
+/**
+ @property {Boolean} data-divider-vertical
+ The direction of dividers - horizontal or vertical.
+ */
+
+/**
+ @property {Array} data-ratio
+ The ratio of two panes' widths or heights.
+*/
+
+/**
+ @method pane
+ This method replaces child contents of a pane indicated by id attribute with contents of inputted element.
+ If second argument is not specified, it will act as a getter method.
+
+ <div data-role="splitview">
+ <div class="ui-pane" id="pane0">pane0</div>
+ <div class="ui-pane" id="pane1">pane1</div>
+ </div>
+ $(".selector").splitview("pane", id, element);
+*/
+
+/**
+ @method maximize
+ This method maximizes a pane's size indicated by id.
+
+ <div data-role="splitview">
+ <div class="ui-pane" id="pane0">pane0</div>
+ <div class="ui-pane" id="pane1">pane1</div>
+ </div>
+ $(".selector").splitview("maximize", id);
+*/
+
+/**
+ @method restore
+ This method restores all panes' sizes to the ratio prior to maximization.
+
+ <div data-role="splitview">
+ <div class="ui-pane" id="pane0">pane0</div>
+ <div class="ui-pane" id="pane1">pane1</div>
+ </div>
+ $(".selector").splitview("restore");
+*/
+
+( function ( $, window, document, undefined ) {
+ $.widget( "tizen.splitview", $.mobile.widget, {
+ options : {
+ fixed : false,
+ dividerVertical : true,
+ ratio : [],
+ initSelector : ":jqmData(role='splitview')"
+ },
+
+ _create : function () {
+ var self = this,
+ $el = self.element,
+ opt = self.options,
+ $panes = $el.children( ".ui-pane" ),
+ panesLength = $panes.length,
+ spliters = [],
+ spliterBars = [],
+ ratioAttr = this.element.attr( "data-ratio" ),
+ containerSize = [ 0, 0 ],
+ resizeTimer = null,
+ i = 0;
+
+ if ( panesLength !== 2 ) {
+ if ( panesLength < 2 ) {
+ for ( i = panesLength ; i < 2 ; ++i ) {
+ self._addEmptyPanes();
+ }
+ } else {
+ $panes.slice( 2 ).remove();
+ }
+
+ $panes = $el.children( ".ui-pane" );
+ panesLength = $panes.length;
+ }
+
+ spliters[ 0 ] = $( "<a href='#' class='ui-spliter' aria-label='Drag scroll, double tap and move to adjust split area'></a>" ).insertAfter( $panes[ 0 ] );
+ spliterBars[ 0 ] = $( "<div class='ui-spliter-bar'></div>" ).appendTo( spliters[ 0 ] );
+ $( "<div class='ui-spliter-handle'></div>" ).appendTo( spliterBars[ 0 ] );
+
+ $.extend( this, {
+ moveTarget : null,
+ moveData : {},
+ spliters : spliters,
+ spliterBars : spliterBars,
+ panes : $panes,
+ containerSize : containerSize,
+ touchStatus : false,
+ minPaneWidth : 50,
+ savedRatio : []
+ });
+
+ self._bindTouchEvents();
+ self._convertRatio( ratioAttr, $panes.length );
+
+ $el.addClass( "ui-splitview ui-direction-" + self._direction( opt.dividerVertical ) );
+
+ if ( $el.parent().closest( ".ui-splitview" ).length ) {
+ if ( self._getContainerSize( $el[ 0 ].style.width, $el[ 0 ].style.height ) ) {
+ self._layout();
+ }
+ }
+
+ $( window ).bind( "pagechange", function ( e ) {
+ if ( !$el.parent().closest( ".ui-splitview" ).length ) {
+ if ( self._getContainerSize( $el[ 0 ].style.width, $el[ 0 ].style.height ) ) {
+ self._layout();
+ }
+ }
+ }).resize( function () {
+ if ( resizeTimer ) {
+ clearTimeout( resizeTimer );
+ }
+
+ resizeTimer = setTimeout( function () {
+ if ( !$el.parent().closest( ".ui-splitview" ).length ) {
+ if ( self._getContainerSize( $el[ 0 ].style.width, $el[ 0 ].style.height ) ) {
+ self._layout();
+ }
+ }
+ }, 250);
+ });
+ },
+
+ _addEmptyPanes : function () {
+ var self = this,
+ $el = self.element,
+ opt = self.options,
+ $panes = $el.children( ".ui-pane" ),
+ scrollAttribute = ( $.support.scrollview ) ? "data-scroll='y'" : "",
+ pane = $( "<div class='ui-pane' " + scrollAttribute + "></div>" );
+
+ if ( scrollAttribute.length ) {
+ pane.scrollview( { direction: "y" } );
+ }
+
+ if ( !$panes.length ) {
+ $el.append( pane );
+ } else {
+ $panes.last().after( pane );
+ }
+ },
+
+ _direction : function ( isHorizontal ) {
+ return isHorizontal ? "horizontal" : "vertical";
+ },
+
+ _isStyleSpecified : function ( cssString ) {
+ return ( typeof cssString !== "undefined" && cssString.length );
+ },
+
+ _getContainerSize : function ( widthString, heightString ) {
+ var self = this,
+ $el = self.element,
+ widthSpecified = self._isStyleSpecified( widthString ),
+ heightSpecified = self._isStyleSpecified( heightString );
+
+ self.containerSize[ 0 ] = ( widthSpecified ) ? $el.outerWidth( true ) : self._parentWidth();
+ self.containerSize[ 1 ] = ( heightSpecified ) ? $el.outerHeight( true ) : self._parentHeight();
+
+ if ( !self.containerSize[ 0 ] || !self.containerSize[ 1 ] ) {
+ return false;
+ }
+
+ return true;
+ },
+
+ _parentWidth : function () {
+ var $parent = this.element.parent();
+
+ if ( !$parent && typeof $parent === "undefined" && !$parent.length ) {
+ return $( window ).width();
+ }
+
+ return $parent.width();
+ },
+
+ _parentHeight : function () {
+ var $parent = this.element.parent(),
+ heightString = "",
+ heightSpecified = false,
+ parentHeight = 0;
+
+ while ( $parent && typeof $parent !== "undefined" && $parent.length ) {
+ if ( typeof $parent[ 0 ].style !== "undefined" ) {
+ heightString = $parent[ 0 ].style.height;
+ heightSpecified = ( typeof heightString !== "undefined" && heightString.length );
+ if ( heightSpecified ) {
+ parentHeight = $parent.height();
+ break;
+ }
+ }
+
+ $parent = $parent.parent();
+ }
+
+ if ( !heightSpecified ) {
+ parentHeight = $(window).height();
+ }
+
+ return parentHeight;
+ },
+
+ _convertRatio : function ( ratioParam, panesLength ) {
+ var self = this,
+ ratio = [],
+ loop = 0,
+ type = typeof ratioParam,
+ ratioArray = null,
+ i;
+
+ for ( i = 0; i < panesLength; ++i ) {
+ ratio.push( 0 );
+ }
+
+ switch ( type ) {
+ case "number":
+ if ( panesLength ) {
+ ratio[ 0 ] = ratioParam;
+ }
+ break;
+
+ case "string":
+ ratioArray = ratioParam.split( "," );
+ loop = Math.min( ratioArray.length, panesLength );
+ for ( i = 0; i < loop; ++i ) {
+ ratio[ i ] = parseFloat( ratioArray[ i ] );
+ }
+ break;
+
+ case "object":
+ if ( !$.isArray( ratioParam ) ) {
+ break;
+ }
+
+ loop = Math.min( ratioParam.length, panesLength );
+ for ( i = 0; i < loop; ++i ) {
+ type = typeof ratioParam[ i ];
+ ratio[ i ] = ( type === "string" ) ? parseFloat( ratioParam[ i ] ) :
+ ( type === "number" ) ? ratioParam[ i ] : 0;
+ }
+ break;
+ }
+
+ self.options.ratio = ratio;
+ self._adjustRatio( panesLength );
+ },
+
+ _adjustRatio : function ( panesLength ) {
+ var self = this,
+ ratio = self.options.ratio,
+ sum = 0,
+ remain = 0,
+ value = 0,
+ subValue = 0,
+ subRemain = 0,
+ i;
+
+ if ( !panesLength ) {
+ self.options.ratio = [];
+ return;
+ }
+
+ for ( i in ratio ) {
+ sum += ratio[ i ];
+ }
+
+ if ( sum !== 1 ) {
+ remain = 1 - sum;
+ value = remain / panesLength;
+
+ for ( i in ratio ) {
+ if ( value >= 0 ) {
+ ratio[ i ] += value;
+ remain = Math.max( 0, remain - value );
+ } else {
+ subRemain += value;
+ subValue = Math.max( subRemain, ratio[ i ] * -1 );
+ ratio[ i ] = Math.max( 0, ratio[ i ] + subValue );
+ remain = Math.min( 0, remain - subValue );
+ subRemain -= subValue;
+ }
+ }
+
+ if ( remain ) {
+ if ( remain > 0 ) {
+ ratio[ ratio.length - 1 ] += remain;
+ } else {
+ for ( i = ratio.length - 1; i >= 0; --i ) {
+ subValue = Math.max( remain, ratio[ i ] * -1 );
+ ratio[ i ] = Math.max( 0, ratio[ i ] + subValue );
+ remain = Math.min( 0, remain - subValue );
+ if ( !remain ) {
+ break;
+ }
+ }
+ }
+ }
+
+ self.options.ratio = ratio;
+ }
+ },
+
+ _setOption : function ( key, value ) {
+ var self = this,
+ orgValue = self.options[ key ];
+
+ if ( orgValue === value ) {
+ return;
+ }
+
+ $.Widget.prototype._setOption.apply( this, arguments );
+
+ switch ( key ) {
+ case "fixed":
+ self._fixed( value );
+ break;
+
+ case "dividerVertical":
+ self._dividerVertical( value );
+ break;
+
+ case "ratio":
+ self._ratio( value );
+ break;
+ }
+ },
+
+ _subtractDiffWidth : function ( width, diff ) {
+ var self = this;
+
+ if ( width <= self.minPaneWidth ) {
+ return {
+ width: width,
+ diff: diff
+ };
+ }
+
+ width += diff;
+ if ( width >= self.minPaneWidth ) {
+ return {
+ width: width,
+ diff: 0
+ };
+ }
+
+ return {
+ width: self.minPaneWidth,
+ diff: width - self.minPaneWidth
+ };
+ },
+
+ _initRatio : function ( fromFirstPane, panes, isHorizontal, availableWidth ) {
+ var self = this,
+ sum = 0,
+ widths = [],
+ diff = 0,
+ panesLength = panes.length,
+ ret,
+ i;
+
+ panes.each( function ( i ) {
+ var pane = $( this );
+ widths.push( isHorizontal ? pane.width() : pane.height() );
+ sum += widths[ i ];
+ });
+
+ diff = availableWidth - sum;
+ if ( !diff ) {
+ return widths;
+ }
+
+ if ( diff > 0 ) {
+ widths[ fromFirstPane ? 0 : panesLength - 1 ] += diff;
+ } else {
+ if ( fromFirstPane ) {
+ for ( i = 0; i < panesLength; ++i ) {
+ ret = self._subtractDiffWidth( widths[ i ], diff );
+ widths[ i ] = ret.width;
+ diff = ret.diff;
+ if ( !diff ) {
+ break;
+ }
+ }
+ } else {
+ for ( i = panesLength - 1; i >= 0; --i ) {
+ diff = self._subtractDiffWidth( widths[ i ], diff );
+ widths[ i ] = ret.width;
+ diff = ret.diff;
+ if ( !diff ) {
+ break;
+ }
+ }
+ }
+ }
+
+ sum = 0;
+ for ( i in widths ) {
+ sum += widths[ i ];
+ }
+
+ for ( i in self.options.ratio ) {
+ self.options.ratio[ i ] = widths[ i ] / sum;
+ }
+
+ return widths;
+ },
+
+ _horizontalBoundary : function () {
+ var self = this,
+ $el = self.element;
+
+ return $el.outerWidth( true ) - $el.width();
+ },
+
+ _verticalBoundary : function () {
+ var self = this,
+ $el = self.element;
+
+ return $el.outerHeight( true ) - $el.height();
+ },
+
+ _boundary : function ( type ) {
+ var self = this,
+ $el = self.element,
+ computedStyle = window.getComputedStyle( $el[ 0 ], null ),
+ margin = parseFloat( computedStyle[ "margin" + type ] ),
+ border = parseFloat( computedStyle[ "border" + type + "Width" ] ),
+ padding = parseFloat( computedStyle[ "padding" + type ] );
+
+ return {
+ margin: margin,
+ border: border,
+ padding: padding
+ };
+ },
+
+ _layout : function ( initRatio, fromFirstPane ) {
+ var self = this,
+ $el = self.element,
+ opt = self.options,
+ isHorizontal = opt.dividerVertical,
+ $panes = self.panes,
+ spliters = self.spliters,
+ spliterBars = self.spliterBars,
+ spliterBar = self.spliterBars.length ? $( spliterBars[ 0 ] ) : null,
+ spliterWidth = !spliterBar ? 0 :
+ isHorizontal ? spliterBar.outerWidth() :
+ spliterBar.outerHeight(),
+ spliterBarMargin = !spliterBar ? 0 :
+ isHorizontal ?
+ spliterBar.outerWidth( true ) - spliterBar.outerWidth() :
+ spliterBar.outerHeight( true ) - spliterBar.outerHeight(),
+ panesLength = $panes.length,
+ currentAvailable = 0,
+ spliterSize = spliterWidth * ( panesLength - 1 ),
+ parentWidth = self.containerSize[ 0 ],
+ parentHeight = self.containerSize[ 1 ],
+ width = parentWidth - self._horizontalBoundary(),
+ height = parentHeight - self._verticalBoundary(),
+ innerSize = isHorizontal ? height : width,
+ availableWidth = isHorizontal ? width - spliterSize :
+ height - spliterSize,
+ initializedWidth = [],
+ widthSum = 0,
+ childSplitview = null;
+
+ if ( typeof initRatio === "undefined" ) {
+ initRatio = false;
+ }
+
+ if ( initRatio && typeof fromFirstPane === "undefined" ) {
+ fromFirstPane = false;
+ }
+
+ $el.css( {
+ "min-width" : width,
+ "min-height" : height
+ });
+
+ if ( initRatio ) {
+ initializedWidth = self._initRatio( fromFirstPane, $panes, isHorizontal, availableWidth );
+ }
+
+ currentAvailable = availableWidth;
+ $panes.each( function ( i ) {
+ var $pane = $( this ),
+ paneWidth = initRatio ? initializedWidth[ i ] :
+ Math.floor( availableWidth * self.options.ratio[i] ),
+ prevPane = ( ( i ) ? $panes.eq( i - 1 ) : null ),
+ posValue = 0,
+ widthValue = 0,
+ heightValue = 0,
+ boundary = 0;
+
+ currentAvailable -= paneWidth;
+ if ( i === ( panesLength - 1 ) ) {
+ paneWidth = Math.max( Math.min( paneWidth, self.minPaneWidth ), paneWidth + currentAvailable );
+ }
+
+ widthSum += paneWidth;
+
+ if ( !prevPane ) {
+ boundary = self._boundary( isHorizontal ? "Left" : "Top" );
+ posValue = boundary.padding;
+ } else {
+ posValue = parseInt( prevPane.css( isHorizontal ? "left" : "top" ), 10 );
+ posValue += isHorizontal ? prevPane.width() : prevPane.height();
+ posValue += spliterWidth;
+ }
+
+ widthValue = isHorizontal ? paneWidth : innerSize;
+ heightValue = isHorizontal ? innerSize : paneWidth;
+
+ $pane.css( {
+ "width" : widthValue ,
+ "height" : heightValue
+ } );
+
+ $pane.css( ( isHorizontal ? "left" : "top" ), posValue );
+ });
+
+ $panes.each( function ( i ) {
+ var $pane = $( this ),
+ paneWidth = isHorizontal ? $pane.width() : $pane.height();
+
+ self.options.ratio[ i ] = paneWidth / widthSum;
+ });
+
+ $.each( spliters, function ( i ) {
+ var spliter = $( this ),
+ prevPane = $panes.eq( i ),
+ bar = spliter.children( ".ui-spliter-bar" ),
+ handle = bar.children( ".ui-spliter-handle" ),
+ posValue = 0;
+
+ if ( isHorizontal ) {
+ posValue = parseInt( prevPane.css( "left" ), 10 ) + prevPane.width() - spliterBarMargin;
+ spliter.outerHeight( innerSize ).css( "left", posValue );
+ } else {
+ posValue = parseInt( prevPane.css( "top" ), 10 ) + prevPane.height() - spliterBarMargin;
+ spliter.outerWidth( innerSize ).css( "top", posValue );
+ }
+
+ if ( typeof bar !== "undefined" && bar ) {
+ if ( isHorizontal ) {
+ bar.outerHeight( innerSize );
+ } else {
+ bar.outerWidth( innerSize );
+ }
+ }
+ if ( typeof handle !== "undefined" && handle ) {
+ if ( isHorizontal ) {
+ handle.css( "top", ( innerSize - spliterWidth ) / 2 );
+ } else {
+ handle.css( "left", ( innerSize - spliterWidth ) / 2 );
+ }
+ }
+ });
+
+ childSplitview = $el.find( ":jqmData(role='splitview'):first" );
+ if ( !childSplitview.length ) {
+ return;
+ }
+
+ childSplitview = childSplitview.data( "splitview" );
+ if ( childSplitview ) {
+ childSplitview._refresh();
+ }
+ },
+
+ _bindTouchEvents : function () {
+ var self = this,
+ $el = self.element,
+ $panes = self.panes,
+ spliters = self.spliters;
+
+ $.each( spliters, function ( i ) {
+ var spliter = $( this );
+ self._bindSpliterTouchEvents( spliter );
+ });
+
+ $el.mouseleave( function () {
+ if ( self.touchStatus ) {
+ $el.children( ".ui-spliter" ).trigger( "vmouseup" );
+ }
+ });
+
+ $panes.bind( "vmousedown", function () {
+ $el.find( ".ui-spliter" ).trigger( "vmouseup" );
+ });
+ },
+
+ _bindSpliterTouchEvents : function ( spliter ) {
+ var self = this,
+ $el = self.element,
+ opt = self.options;
+
+ spliter.bind( "vmousedown", { e : spliter }, function ( event ) {
+ if ( self.options.fixed ) {
+ return;
+ }
+
+ var targetSpliter = event.data.e,
+ prevPane = targetSpliter.prev(),
+ nextPane = targetSpliter.next(),
+ splitviewInPrev = prevPane.find( ":jqmData(role='splitview'):first" ),
+ splitviewInNext = nextPane.find( ":jqmData(role='splitview'):first" ),
+ isHorizontal = opt.dividerVertical,
+ spliterWidth = isHorizontal ?
+ $( self.spliterBars[0] ).outerWidth() :
+ $( self.spliterBars[0] ).outerHeight();
+
+ $el.closest( ".ui-page" ).find( ".ui-spliter" ).trigger( "vmouseup" );
+
+ self.moveTarget = targetSpliter;
+ self.moveData = {
+ spliterWidth : spliterWidth || 0,
+ prevPane : prevPane,
+ nextPane : nextPane,
+ splitviewInPrev : splitviewInPrev,
+ splitviewInNext : splitviewInNext,
+ prevPanePos : parseInt( prevPane.css( isHorizontal ? "left" : "top" ), 10 ) || 0,
+ prevPaneWidth : parseInt( prevPane.css( isHorizontal ? "width" : "height" ), 10 ) || 0,
+ nextPanePos : parseInt( nextPane.css( isHorizontal ? "left" : "top" ), 10 ) || 0,
+ nextPaneWidth : parseInt( nextPane.css( isHorizontal ? "width" : "height" ), 10 ) || 0,
+ targetPos : parseInt( targetSpliter.css( isHorizontal ? "left" : "top" ), 10 ) || 0,
+ pagePos : isHorizontal ? event.pageX : event.pageY
+ };
+
+ targetSpliter.addClass( "ui-spliter-active" );
+
+ $( document ).bind( "vmousemove.splitview", function ( event ) {
+ if ( !self.touchStatus ) {
+ return;
+ }
+
+ self._drag( event );
+
+ event.preventDefault();
+ event.stopPropagation();
+ }).bind( "vmouseup.splitview", function ( event ) {
+ if ( !self.touchStatus ) {
+ return;
+ }
+
+ self._stop( event );
+
+ event.preventDefault();
+ event.stopPropagation();
+
+ self.touchStatus = false;
+ });
+
+ event.preventDefault();
+ event.stopPropagation();
+
+ self.touchStatus = true;
+ });
+ },
+
+ _drag : function ( e ) {
+ if ( !this.moveData || typeof this.moveData === "undefined" ) {
+ return;
+ }
+
+ var self = this,
+ $el = self.element,
+ opt = self.options,
+ isHorizontal = opt.dividerVertical,
+ moveData = self.moveData,
+ moveTarget = self.moveTarget,
+ prevPane = moveData.prevPane,
+ nextPane = moveData.nextPane,
+ splitviewInPrev = moveData.splitviewInPrev,
+ splitviewInNext = moveData.splitviewInNext,
+ spliterWidth = moveData.spliterWidth,
+ movement = null,
+ targetPos = null,
+ nextPanePos = null,
+ prevPaneWidth = null,
+ nextPaneWidth = null,
+ pagePos = isHorizontal ? e.pageX : e.pageY,
+ splitview = null;
+
+ movement = pagePos - moveData.pagePos;
+ if ( movement > 0 ) {
+ movement = Math.min( Math.max( moveData.nextPaneWidth - self.minPaneWidth, 0 ), movement );
+ } else {
+ movement = Math.max( Math.max( moveData.prevPaneWidth - self.minPaneWidth, 0 ) * -1, movement );
+ }
+
+ nextPanePos = moveData.nextPanePos + movement;
+ prevPaneWidth = Math.max( moveData.prevPaneWidth + movement, 0 );
+ nextPaneWidth = Math.max( moveData.nextPaneWidth - movement, 0 );
+ targetPos = moveData.targetPos + movement;
+
+ moveTarget.css( isHorizontal ? { left : targetPos } : { top : targetPos } );
+ prevPane.css( isHorizontal ? { width : prevPaneWidth } : { height : prevPaneWidth } );
+ nextPane.css( isHorizontal ? { width : nextPaneWidth, left : nextPanePos } :
+ { height : nextPaneWidth, top : nextPanePos } );
+
+ if ( splitviewInPrev.length ) {
+ splitview = splitviewInPrev.data( "splitview" );
+ splitview._refresh( true, false );
+ }
+
+ if ( splitviewInNext.length ) {
+ splitview = splitviewInNext.data( "splitview" );
+ splitview._refresh( true, true );
+ }
+ },
+
+ _stop : function ( e ) {
+ if ( !this.moveData || typeof this.moveData === "undefined" ) {
+ return;
+ }
+
+ var self = this,
+ $el = self.element,
+ opt = self.options,
+ $panes = self.panes,
+ panesLength = $panes.length,
+ isHorizontal = opt.dividerVertical,
+ moveData = self.moveData,
+ moveTarget = self.moveTarget,
+ prevPane = moveData.prevPane,
+ nextPane = moveData.nextPane,
+ splitviewInPrev = moveData.splitviewInPrev,
+ splitviewInNext = moveData.splitviewInNext,
+ spliterWidth = moveData.spliterWidth,
+ spliterSize = spliterWidth * ( panesLength - 1 ),
+ movement = null,
+ targetPos = null,
+ nextPanePos = null,
+ prevPaneWidth = null,
+ nextPaneWidth = null,
+ displayStyle = $el.css( "display" ),
+ parentWidth = self.containerSize[ 0 ],
+ parentHeight = self.containerSize[ 1 ],
+ width = parentWidth - self._horizontalBoundary(),
+ height = parentHeight - self._verticalBoundary(),
+ availableWidth = isHorizontal ?
+ ( width - spliterSize ) :
+ ( height - spliterSize ),
+ sum = 0;
+
+ $( document ).unbind( "vmousemove.splitview vmouseup.splitview" );
+ moveTarget.removeClass( "ui-spliter-active" );
+
+ // ratio calculation
+ $panes.each( function ( i ) {
+ var $pane = $( this ),
+ paneWidth = isHorizontal ? $pane.width() : $pane.height();
+
+ sum += paneWidth;
+ });
+
+ $panes.each( function ( i ) {
+ var $pane = $( this ),
+ paneWidth = isHorizontal ? $pane.width() : $pane.height();
+
+ self.options.ratio[ i ] = paneWidth / sum;
+ });
+
+ self.moveData = null;
+ },
+
+ _fixed : function ( isFix ) {
+ var self = this,
+ spliters = self.spliters;
+
+ $.each( spliters, function ( i ) {
+ var $spliter = $( this );
+
+ if ( isFix ) {
+ $spliter.addClass( "ui-fixed" );
+ } else {
+ $spliter.removeClass( "ui-fixed" );
+ }
+ });
+
+ self._layout();
+ },
+
+ _dividerVertical : function ( isDividerVertical ) {
+ var self = this,
+ $el = self.element,
+ isHorizontal = isDividerVertical,
+ $panes = null,
+ $spliters = null,
+ $bar = null,
+ $handle = null;
+
+ $panes = $el.children( ".ui-pane" );
+ $spliters = $el.children( ".ui-spliter" );
+ $bar = $spliters.children( ".ui-spliter-bar" );
+ $handle = $bar.children( ".ui-spliter-handle" );
+
+ $el.removeClass( "ui-direction-vertical" );
+ $el.removeClass( "ui-direction-horizontal" );
+ $el.addClass( "ui-splitview ui-direction-" + self._direction( isHorizontal ) );
+
+ $panes.css( {
+ "left" : "",
+ "top" : "",
+ "width" : "",
+ "height" : ""
+ });
+
+ $spliters.css( {
+ "left" : "",
+ "top" : "",
+ "width" : "",
+ "height" : ""
+ });
+
+ $bar.css( {
+ "width" : "",
+ "height" : ""
+ });
+
+ $handle.css( {
+ "left" : "",
+ "top" : ""
+ });
+
+ if ( self._getContainerSize( $el[ 0 ].style.width, $el[ 0 ].style.height ) ) {
+ self._layout();
+ }
+ },
+
+ _ratio : function ( ratioParam ) {
+ var self = this,
+ $el = self.element,
+ $panes = $el.children( ".ui-pane" ),
+ panesLength = $panes.length;
+
+ self._convertRatio( ratioParam, panesLength );
+ self._layout();
+ },
+
+ _refresh : function ( initRatio, fromFirstPane ) {
+ var self = this,
+ $el = self.element;
+
+ if ( typeof initRatio === "undefined" ) {
+ initRatio = false;
+ }
+
+ if ( initRatio && typeof fromFirstPane === "undefined" ) {
+ fromFirstPane = false;
+ }
+
+ if ( self._getContainerSize( $el[ 0 ].style.width, $el[ 0 ].style.height ) ) {
+ self._layout( initRatio, fromFirstPane );
+ }
+ },
+
+ pane : function ( id, element ) {
+ if ( typeof id !== "string" ) {
+ return null;
+ }
+
+ var self = this,
+ $el = self.element,
+ $targetPane = $el.children( id ),
+ $targetView = null,
+ elementParent = null;
+
+ if ( !$targetPane.hasClass( "ui-pane" ) ) {
+ return null;
+ }
+
+ // getter
+ if ( typeof element === "undefined" || !element ) {
+ return $targetPane.contents();
+ }
+
+ // setter
+ if ( $targetPane.hasClass( "ui-scrollview-clip" ) ) {
+ $targetPane.scrollview( "scrollTo", 0, 0, 0 );
+
+ $targetView = $targetPane.children( ".ui-scrollview-view" );
+ if ( !$targetView.length ) {
+ return null;
+ }
+ } else {
+ $targetView = $targetPane;
+ }
+
+ elementParent = element.parent();
+ if ( elementParent.length && elementParent[ 0 ] === $targetView[ 0 ] ) {
+ return;
+ }
+
+ $targetView.empty().append( element ).trigger( "create" );
+ $targetView.fadeIn( 'fast' );
+ },
+
+ maximize : function ( id ) {
+ if ( typeof id !== "string" ) {
+ return;
+ }
+
+ var self = this,
+ $el = self.element,
+ $panes = self.panes,
+ $targetPane = $el.children( id );
+
+ if ( !$targetPane.hasClass( "ui-pane" ) ) {
+ return;
+ }
+
+ self.savedRatio = self.options.ratio.slice();
+
+ self.options.ratio = [];
+ $panes.each( function ( i ) {
+ self.options.ratio.push( ( this === $targetPane[ 0 ] ) ? 1 : 0 );
+ });
+
+ self._layout();
+ },
+
+ restore : function () {
+ var self = this;
+
+ if ( self.savedRatio.length === 0 ) {
+ return;
+ }
+
+ self.options.ratio = self.savedRatio.slice();
+ self._adjustRatio( self.panes.length );
+
+ self._layout();
+ }
+ });
+
+ $( document ).bind( "pagecreate create", function ( e ) {
+ $.tizen.splitview.prototype.enhanceWithin( e.target );
+ });
+} ( jQuery, window, document ) );
+
--- /dev/null
+
+/*
+ * jQuery Mobile Widget @VERSION
+ *
+ * This software is licensed under the MIT licence (as defined by the OSI at
+ * http://www.opensource.org/licenses/mit-license.php)
+ *
+ * ***************************************************************************
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2011 by Intel Corporation Ltd.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * ***************************************************************************
+ *
+ * Authors: Kalyan Kondapally <kalyan.kondapally@intel.com>,
+ * Elliot Smith <elliot.smith@intel.com>
+ * Hyunjung Kim <hjnim.kim@samsung.com>
+ */
+
+// Widget which turns a html element into a "swipe":
+// i.e. each list item has a sliding "cover" which can be swiped
+// to the right (to reveal buttons underneath) or left (to
+// cover the buttons again). Clicking on a button under a swipe
+// also moves the cover back to the left.
+//
+// In this case, the cover is over a grid of buttons;
+// but it is should also be possible to use other types of markup under the
+// list items.
+//
+// WARNING: This doesn't work well inside a scrollview widget, as
+// the touch events currently interfere with each other badly (e.g.
+// a swipe will work but cause a scroll as well).
+//
+// Theme: default is to use the theme on the target element,
+// theme passed in options, parent theme, or 'c' if none of the above.
+// If list items are themed individually, the cover will pick up the
+// theme of the list item which is its parent.
+//
+
+/**
+ @class Swipe
+ The swipe widget shows a view on the screen where the items can be swiped vertically to show a menu.
+ To add a swipe widget to the application, use the following code:
+
+ <ul data-role="listview">
+ <li data-role="swipe">
+ <div data-role="swipe-cover">
+ <div data-role="button" data-inline="true">OK</div>
+ <div data-role="button" data-inline="true">Cancel</div>
+ </div>
+ <div data-role="swipe-item-cover">
+ <p>This is a swipe item cover.<br>
+ This will be swiped out when swipe event comes.</p>
+ </div>
+ </li>
+ </ul>
+
+ You can use methods with the swipe as described in the jQueryMobile documentation for view methods.
+*/
+/**
+ @property {String} data-role
+ Creates a swipe using the HTML unordered view (>ul<) element.
+ The default value is swipe.
+
+ Creates a swipe item cover using an HTML $gt;div$lt; element. This cover can be swiped to show the content beneath it.
+ The default value is swipe-item-cover.
+*/
+/**
+ @method open
+ uncover swipe item
+*/
+/**
+ @method close
+ cover swipe item
+*/
+/**
+ @method opened
+ return coveritem status( coverd or uncovred )
+*/
+/**
+ @event animationstart
+ The swipe can define a callback for the animationstart event, which is fired after a item is swipe and the swipe animation is start:
+*/
+/**
+ @event animationend
+ The swipe can define a callback for the animationend event, which is fired after a item is swiped and the swipe animation is complete:
+
+ <ul data-role="listview">
+ <li data-role="swipe">
+ <div data-role="swipe-cover">
+ <div data-role="button" data-inline="true">OK</div>
+ <div data-role="button" data-inline="true">Cancel</div>
+ </div>
+ <div data-role="swipe-item-cover" id="foo">
+ <p>This is a swipe item cover.<br>
+ This will be swiped out when swipe event comes.</p>
+ </div>
+ </li>
+ </ul>
+ $("#foo").bind("animationend", function (ev)
+ {
+ Console.log("Swipe cover's animation is complete.");
+ });
+*/
+(function ($) {
+
+ $.widget("tizen.swipe", $.mobile.widget, {
+ options: {
+ theme: null
+ },
+
+ _create: function () {
+ // use the theme set on the element, set in options,
+ // the parent theme, or 'c' (in that order of preference)
+ var theme = this.element.jqmData('theme') ||
+ this.options.theme ||
+ this.element.parent().jqmData('theme') ||
+ 's';
+
+ this.options.theme = theme;
+ this._isopen = false;
+ this.refresh();
+ },
+
+ refresh: function () {
+ this._cleanupDom();
+
+ var self = this,
+ defaultCoverTheme,
+ covers,
+ coverTheme,
+ item,
+ itemHasThemeClass;
+
+ defaultCoverTheme = 'ui-body-' + this.options.theme;
+
+ if ( !this.element.parent().hasClass('ui-listview') ) {
+ this.element.parent().listview();
+ }
+ this.element.addClass('ui-swipe');
+
+ // get the item covers
+ covers = this.element.find(':jqmData(role="swipe-item-cover")');
+ item = this.element.find(':jqmData(role="swipe-item")');
+
+ this._covers = covers;
+ this._item = item;
+ item.addClass('ui-swipe-item');
+ coverTheme = defaultCoverTheme;
+ itemHasThemeClass = item.parent().attr('class')
+ .match(/ui\-body\-[a-z]|ui\-bar\-[a-z]/);
+
+ covers.each( function () {
+ var cover = $( this );
+
+ if ( itemHasThemeClass ) {
+ coverTheme = itemHasThemeClass[0];
+ }
+
+ cover.addClass('ui-swipe-item-cover');
+ cover.addClass( coverTheme );
+
+ if ( cover.has('.ui-swipe-item-cover-inner').length === 0 ) {
+ cover.wrapInner( $('<span/>').addClass('ui-swipe-item-cover-inner') );
+ }
+
+ if ( !( cover.data('animateRight') && cover.data('animateLeft') ) ) {
+ cover.data('animateRight', function () {
+ self._animateCover( cover, 110, item );
+ });
+
+ cover.data('animateLeft', function () {
+ self._animateCover( cover, 0, item );
+ });
+ }
+
+ // bind to synthetic events
+ item.bind( 'swipeleft', cover.data('animateLeft') );
+ cover.bind( 'swiperight', cover.data('animateRight') );
+ item.find( '.ui-btn' ).bind( 'vclick', cover.data('animateLeft') );
+ } );
+
+ },
+
+ _cleanupDom: function () {
+ var self = this,
+ defaultCoverTheme,
+ cover,
+ coverTheme = defaultCoverTheme,
+ item,
+ itemClass,
+ itemHasThemeClass,
+ text,
+ wrapper;
+
+ defaultCoverTheme = 'ui-body-' + this.options.theme;
+
+ this.element.removeClass('ui-swipe');
+
+ // get the item covers
+ cover = this.element.find(':jqmData(role="swipe-item-cover")');
+ item = this.element.find(':jqmData(role="swipe-item")');
+
+ item.removeClass('ui-swipe-item');
+ cover.removeClass('ui-swipe-item-cover');
+
+ itemClass = item.attr('class');
+ itemHasThemeClass = itemClass &&
+ itemClass.match(/ui\-body\-[a-z]|ui\-bar\-[a-z]/);
+
+ if ( itemHasThemeClass ) {
+ coverTheme = itemHasThemeClass[0];
+ }
+
+ cover.removeClass(coverTheme);
+
+ // remove wrapper HTML
+ wrapper = cover.find('.ui-swipe-item-cover-inner');
+ wrapper.children().unwrap();
+ text = wrapper.text();
+
+ if ( text ) {
+ cover.append( text );
+ wrapper.remove();
+ }
+
+ // unbind swipe events
+ if ( cover.data('animateRight') && cover.data('animateLeft') ) {
+ cover.unbind( 'swiperight', cover.data('animateRight') );
+ item.unbind( 'swipeleft', cover.data('animateLeft') );
+
+ // unbind clicks on buttons inside the item
+ item.find('.ui-btn').unbind( 'vclick', cover.data('animateLeft') );
+
+ cover.data( 'animateRight', null );
+ cover.data( 'animateLeft', null );
+ }
+ },
+
+ // NB I tried to use CSS animations for this, but the performance
+ // and appearance was terrible on Android 2.2 browser;
+ // so I reverted to jQuery animations
+ //
+ // once the cover animation is done, the cover emits an
+ // animationComplete event
+ _animateCover: function ( cover, leftPercentage, item ) {
+ var self = this,
+ animationOptions = {
+ easing: 'linear',
+ duration: 'normal',
+ queue: true,
+ complete: function () {
+ cover.trigger('animationend');
+ }
+ };
+
+ $( this.element.parent() )
+ .find(":jqmData(role='swipe')")
+ .each(
+ function () {
+ if ( this !== self.element.get(0) &&
+ $( this ).swipe("opened") ) {
+ $( this ).swipe("close");
+ }
+ }
+ );
+
+ if ( leftPercentage == 110 ) {
+ this._isopen = true;
+ } else {
+ this._isopen = false;
+ }
+
+ cover.stop();
+ cover.clearQueue();
+ cover.trigger('animationstart');
+ cover.animate( { left: leftPercentage + '%' }, animationOptions );
+ if ( leftPercentage == 0 ) {
+ item.animate({ opacity: 0 }, "slow");
+ } else {
+ item.animate({ opacity: 1 }, "slow");
+ }
+
+ },
+
+ destroy: function () {
+ this._cleanupDom();
+ },
+
+ open: function () {
+ var self = this;
+
+ $( self._covers ).each( function () {
+ var cover = $( this );
+ self._animateCover( cover, 110, self._item);
+ } );
+ },
+
+ opened: function () {
+ return this._isopen;
+ },
+
+ close: function () {
+ var self = this;
+
+ $( self._covers ).each( function () {
+ var cover = $( this );
+ self._animateCover( cover, 0, self._item);
+ } );
+ }
+
+ });
+
+ $( document ).bind("pagecreate", function ( e ) {
+ $( e.target ).find(":jqmData(role='swipe')").swipe();
+ });
+
+}( jQuery ));
+
--- /dev/null
+
+/* ***************************************************************************
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * ***************************************************************************
+ *
+ * jQuery Mobile Framework : "tabbar" plugin
+ * Copyright (c) jQuery Project
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ * Authors: Jinhyuk Jun <jinhyuk.jun@samsung.com>
+*/
+
+/**
+ * Tabbar can be created using data-role = "tabbar" inside footer
+ * Framework determine which tabbar will display with tabbar attribute
+ *
+ * Examples:
+ *
+ * HTML markup for creating tabbar: ( 2 ~ 5 li item available )
+ * icon can be changed data-icon attribute (customized icon need)
+ * <div data-role="footer" data-position ="fixed">
+ * <div data-role="tabbar">
+ * <ul>
+ * <li><a href="#" class="ui-btn-active">Menu</a></li>
+ * <li><a href="#">Save</a></li>
+ * <li><a href="#">Share</a></li>
+ * </ul>
+ * </div>
+ * </div>
+*/
+
+(function ( $, undefined ) {
+
+ $.widget( "tizen.tabbar", $.mobile.widget, {
+ options: {
+ iconpos: "top",
+ grid: null,
+ defaultList : 4,
+ initSelector: ":jqmData(role='tabbar')"
+ },
+
+ _create: function () {
+
+ var $tabbar = this.element,
+ $tabbtns,
+ textpos,
+ iconpos,
+ theme = $.mobile.listview.prototype.options.theme, /* Get current theme */
+ ww = window.innerWidth || $( window ).width(),
+ wh = window.innerHeight || $( window ).height(),
+ tabbarDividerLeft = "<div class='ui-tabbar-divider ui-tabbar-divider-left'></div>",
+ tabbarDividerRight = "<div class='ui-tabbar-divider ui-tabbar-divider-right'></div>",
+ isLandscape;
+
+ isLandscape = ww > wh && ( ww - wh );
+
+ if ( isLandscape ) {
+ $tabbar.removeClass( "ui-portrait-tabbar" ).addClass( "ui-landscape-tabbar" );
+ } else {
+ $tabbar.removeClass( "ui-landscape-tabbar" ).addClass( "ui-portrait-tabbar" );
+ }
+
+ if ( $tabbar.find( "a" ).length ) {
+ $tabbtns = $tabbar.find( "a" );
+ iconpos = $tabbtns.filter( ":jqmData(icon)" ).length ? this.options.iconpos : undefined;
+ textpos = $tabbtns.html().length ? true : false;
+ }
+
+ if ( $tabbar.parents( ".ui-header" ).length && $tabbar.parents( ".ui-scrollview-view" ).length ) {
+ $tabbar.find( "li" ).addClass( "tabbar-scroll-li" );
+ $tabbar.find( "ul" ).addClass( "tabbar-scroll-ul" );
+
+ /* add shadow divider */
+ $( tabbarDividerLeft ).appendTo( $tabbar.parents( ".ui-scrollview-clip" ) );
+ $( tabbarDividerRight ).appendTo( $tabbar.parents( ".ui-scrollview-clip" ) );
+
+ $( ".ui-tabbar-divider-left" ).hide();
+ $( ".ui-tabbar-divider-right" ).hide();
+
+ /* add width calculation*/
+ if ( $tabbar.parents( ".ui-scrollview-view" ).data("default-list") ) {
+ this.options.defaultList = $tabbar.parents( ".ui-scrollview-view" ).data( "default-list" );
+ }
+ $tabbar.find( "li" ).css( "width", window.innerWidth / this.options.defaultList + "px" );
+ } else {
+ if ( $tabbar.find( "ul" ).children().length ) {
+ $tabbar.addClass( "ui-navbar" )
+ .find( "ul" )
+ .grid( { grid: this.options.grid } );
+ }
+ }
+
+ if ( $tabbar.parents( ".ui-footer" ).length ) {
+ $tabbar.find( "li" ).addClass( "ui-tab-btn-style" );
+ }
+
+ /* title tabbar */
+ if ( $tabbar.siblings( ".ui-title" ).length ) {
+ $tabbar.parents( ".ui-header" ).addClass( "ui-title-tabbar" );
+ }
+
+ if ( !iconpos ) {
+ $tabbar.addClass( "ui-tabbar-noicons" );
+ }
+ if ( !textpos ) {
+ $tabbar.addClass( "ui-tabbar-notext" );
+ }
+ if ( textpos && iconpos ) {
+ $tabbar.parents( ".ui-header" ).addClass( "ui-title-tabbar-multiline" );
+ }
+
+ if ( $tabbar.find( "a" ).length ) {
+ $tabbtns.buttonMarkup({
+ corners: false,
+ shadow: false,
+ iconpos: iconpos
+ });
+ }
+
+ if ( $tabbar.find( ".ui-state-persist" ).length ) {
+ $tabbar.addClass( "ui-tabbar-persist" );
+ }
+
+ $tabbar.delegate( "a", "vclick", function ( event ) {
+ $tabbtns.not( ".ui-state-persist" ).removeClass( $.mobile.activeBtnClass );
+ $( this ).addClass( $.mobile.activeBtnClass );
+ });
+
+ $tabbar.addClass( "ui-tabbar");
+
+ $( document ).bind( "pagebeforeshow", function ( event, ui ) {
+ var footer_filter = $( event.target ).find( ":jqmData(role='footer')" ),
+ tabbar_filter = footer_filter.find( ":jqmData(role='tabbar')" ),
+ $elFooterMore = tabbar_filter.siblings( ":jqmData(icon='naviframe-more')" ),
+ $elFooterBack = tabbar_filter.siblings( ".ui-btn-back" );
+
+ footer_filter
+ .css( "position", "fixed" )
+ .css( "bottom", 0 )
+ .css( "height", tabbar_filter.height() );
+ if ( $elFooterMore.length ) {
+ tabbar_filter.addClass( "ui-tabbar-margin-more" );
+ }
+ if ( $elFooterBack.length ) {
+ tabbar_filter.addClass( "ui-tabbar-margin-back" );
+ }
+ });
+
+ $tabbar.bind( "touchstart vmousedown", function ( e ) {
+ var $tabbarScroll = $( e.target ).parents( ".ui-scrollview-view" );
+ if ( $tabbarScroll.offset() ) {
+ if ( $tabbarScroll.offset().left < 0 ) {
+ $( ".ui-tabbar-divider-left" ).show();
+ } else {
+ $( ".ui-tabbar-divider-left" ).hide();
+ }
+ if ( ( $tabbarScroll.width() - $tabbarScroll.parents( ".ui-scrollview-clip" ).width() ) == Math.abs( $tabbarScroll.offset().left ) ) {
+ $( ".ui-tabbar-divider-right" ).hide();
+ } else {
+ $( ".ui-tabbar-divider-right" ).show();
+ }
+ }
+ });
+
+ this._bindTabbarEvents();
+ this._initTabbarAnimation();
+ },
+
+ _initTabbarAnimation: function () {
+ var isScrollingStart = false,
+ isScrollingEnd = false;
+ $( document ).bind( "scrollstart.tabbar", function ( e ) {
+ if ( $( e.target ).find( ".ui-tabbar" ).length ) {
+ isScrollingStart = true;
+ isScrollingEnd = false;
+ }
+ });
+
+ $( document ).bind( "scrollstop.tabbar", function ( e ) {
+ var $tabbarScrollview = $( e.target ),
+ $elTabbar = $( e.target ).find( ".ui-tabbar" ),
+ $elTabbarLI = $( e.target ).find( ".ui-tabbar li" ),
+ $minElement = $elTabbarLI.eq( 0 ),
+ minElementIndexVal,
+ minElementIndex = -1;
+
+ isScrollingEnd = true;
+ if ( $elTabbar.length && isScrollingStart == true ) {
+ minElementIndexVal = Math.abs( $elTabbarLI.eq( 0 ).offset().left );
+ $elTabbarLI.each( function ( i ) {
+ var offset = $elTabbarLI.eq( i ).offset();
+
+ if ( Math.abs( offset.left ) < minElementIndexVal ) {
+ minElementIndexVal = Math.abs( offset.left );
+ minElementIndex = i;
+ $minElement = $elTabbarLI.eq( i );
+ }
+ });
+
+ if ( $tabbarScrollview.length && isScrollingStart == isScrollingEnd && minElementIndex != -1) {
+ isScrollingStart = false;
+ $tabbarScrollview.scrollview( "scrollTo", -( window.innerWidth / $elTabbar.data( "defaultList" ) * minElementIndex ) , 0, 357);
+ }
+ }
+
+ $( ".ui-tabbar-divider-left" ).hide();
+ $( ".ui-tabbar-divider-right" ).hide();
+ });
+ },
+
+ _bindTabbarEvents: function () {
+ var $tabbar = this.element;
+
+ $( window ).bind( "orientationchange", function ( e, ui ) {
+ var ww = window.innerWidth || $( window ).width(),
+ wh = window.innerHeight || $( window ).height(),
+ isLandscape = ww > wh && ( ww - wh );
+
+ if ( isLandscape ) {
+ $tabbar.removeClass( "ui-portrait-tabbar" ).addClass( "ui-landscape-tabbar" );
+ } else {
+ $tabbar.removeClass( "ui-landscape-tabbar" ).addClass( "ui-portrait-tabbar" );
+ }
+ });
+ },
+
+ _setDisabled: function ( value, cnt ) {
+ this.element.find( "li" ).eq( cnt ).attr( "disabled", value );
+ this.element.find( "li" ).eq( cnt ).attr( "aria-disabled", value );
+ },
+
+ disable: function ( cnt ) {
+ this._setDisabled( true, cnt );
+ this.element.find( "li" ).eq( cnt ).addClass( "ui-disabled" );
+ },
+
+ enable: function ( cnt ) {
+ this._setDisabled( false, cnt );
+ this.element.find( "li" ).eq( cnt ).removeClass( "ui-disabled" );
+ }
+ });
+
+ //auto self-init widgets
+ $( document ).bind( "pagecreate create", function ( e ) {
+ $( $.tizen.tabbar.prototype.options.initSelector, e.target ).tabbar();
+ });
+}( jQuery ) );
+
--- /dev/null
+
+/* ***************************************************************************
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * ***************************************************************************
+ *
+ * Author: Kangsik Kim <kangsik81.kim@samsung.com>
+ * Minkyeong Kim <minkyeong.kim@samsung.com>
+*/
+
+/**
+ * The TokenTextArea widget changes a text item to a button. It can be comprised of a number of button widgets.
+ * When a user types text and the text gets a specific event to change from a text to a button,
+ * the input text is changed to a TokenTextArea widget.
+ * A user can add the TokenTextArea widget to a contact list, email list, or another list.
+ * The typical use of this widget is composing a number of contacts or phone numbers in a specific area of the screen.
+ *
+ * HTML Attributes:
+ *
+ * data-link : Represents the page id.
+ * The page contains data for the user, for example, an address book.
+ * If the value is null, anchor button doesn't work. (Default : null)
+ * data-label: Provide a label for a user-guide. (Default : 'To : ')
+ * data-description : This attribute is managing message format.
+ * This message is displayed when widget status was changed to 'focusout'. (Default : '+ {0}')
+ *
+ * APIs:
+ *
+ * inputtext ( [string] )
+ * : If argument is not exist, will get a string from inputbox.
+ * If argument is exist, will set a string to inputbox.
+ * select ( [number] )
+ * : If no argument exists, gets a string of the selected block.
+ * If any button isn't selected on a token text area widget, this method returns "null" value.
+ * When a user call this method with an argument which is a number type,
+ * this method selects the button which is matched with the argument.
+ * add ( text, [number] )
+ * : If second argument does not exist, will insert to a new button at last position.
+ * Insert a new button at indexed position. The position is decided by the second argument.
+ * "index of position" means that the position of inserting a new button is decided by the second argument on "add" method.
+ * For example, if a user call the method like this "add("Tizen", 2)",
+ * new button labed "Tizen" will be inserted on the third position.
+ * remove ( [number] )
+ * : If no argument exists, all buttons are removed.
+ * Remove a button at indexed position.
+ * The position is decided by the second argument. (index: index of button)
+ * length ( void )
+ * : Get a number of buttons.
+ * foucsIn ( void )
+ * : This method change a status to 'focusin'.
+ * This status is able to manage a widget.
+ * focusOut ( void )
+ * : Changes the focus status to 'focus out'.
+ * The status is not able to manage a widget.
+ * All buttons that contained in the widget are removed and
+ * summarized message is displayed.
+ * destroy ( void )
+ * : Remove all of the new DOM elements for the current widget that you created.
+ *
+ * Events:
+ *
+ * create : Occur when create TokenTextArea widget.
+ * select : Occur when a button is selected.
+ * add : Occur when new button is inserted. (@since Tizen 2.1 deprecated, You can still use this event. But not recommended.)
+ * remove : Occur when a button is removed. (@since Tizen 2.1 deprecated, You can still use this event. But not recommended.)
+ *
+ * Examples:
+ *
+ * <div data-role="tokentextarea" data-label="To : " data-link:"#addressbook" data-description="+ {0}">
+ * </div>
+ *
+ */
+
+
+/**
+ @class TokenTextArea
+ The TokenTextArea widget enables the user to enter text and convert it to a button. Each button that is created from entered text as a result of a change event forms a token text area widget. This widget is useful in composing an e-mail or SMS message to a group of addresses, each of which is a clickable item for more actions, such as copying, editing, or removing the address.
+
+ To add a token text area widget to the application, use the following code:
+
+ <div data-role="tokentextarea" data-label="To : " data-link="pageId">
+ </div>
+*/
+
+/**
+ @property {String} data-label
+ Sets a label as a guide for the user.
+ For example, while composing an e-mail message, the 'To : ' label is a guide for the user to enter e-mail addresses.
+*/
+
+/**
+ @property {String} data-decription
+ Manages the message format.
+ The message is displayed when the widget status changes to focus out
+ */
+/**
+ @property {String} data-link
+ Sets the ID of the page to which the button links.
+*/
+/**
+ @event create
+ The create event is fired when the token text area widget is created:
+
+ <div data-role="tokentextarea">
+ </div>
+ $(".selector").tokentextarea
+ ({
+ create: function(event, ui)
+ {
+ // Handle the create event
+ }
+ });
+**/
+/**
+ @event select
+ The select event is fired when a token text area widget button is selected:
+
+ <div data-role="tokentextarea">
+ </div>
+ $(".selector").bind("select", function(event, ui)
+ {
+ // Handle the select event
+ });
+*/
+/**
+ @event add (@since Tizen 2.1 deprecated, You can still use this event. But not recommended.)
+ The add event is fired when a token text area widget button is created:
+
+ <div data-role="tokentextarea">
+ </div>
+ $(".selector").bind("add", function(event, ui)
+ {
+ // Handle the add event
+ });
+*/
+/**
+ @event remove (@since Tizen 2.1 deprecated, You can still use this event. But not recommended.)
+ The remove event is fired when a token text area widget button is removed:
+ Restriction : "remove" event works under only "bind" event handling.
+
+ <div data-role="tokentextarea">
+ </div>
+ $(".selector").bind("remove", function(event, ui)
+ {
+ // Handle the remove event
+ });
+*/
+/**
+ @method destroy
+ The destroy method is used to remove in the current widget all the new DOM elements that you have created.
+
+ <div data-role="tokentextarea">
+ </div>
+ $(".selector").tokentextarea("destroy");
+
+ @since Tizen2.0
+*/
+/**
+ @method inputText
+ The inputText method is used to manage the widget input box text. If no parameter is set, the method gets the input box text. If a parameter is set, the parameter text is set in the input box.
+
+ <div data-role="tokentextarea">
+ </div>
+ $(".selector").tokentextarea("inputText", [text]);
+*/
+/**
+ @method select
+ The select method is used to select a token text area widget button based on its index value. If no index value is defined, the method returns the string of the selected block. If there are no buttons present in the widget, the method returns null.
+
+ <div data-role="tokentextarea">
+ </div>
+ $(".selector").tokentextarea("select", [index]);
+*/
+/**
+ @method add
+ The add method is used to add a new token text area widget button with the specified label text at the specified index position. If the index parameter is not defined, the widget button is added at the bottom of the list. For example, the $(".selector").tokentextarea("add", "Tizen", 2) method call creates a new widget button labeled 'Tizen' at the third position in the widget.
+
+ <div data-role="tokentextarea">
+ </div>
+ $(".selector").tokentextarea("add", [text], [index]);
+*/
+/**
+ @method remove
+ The remove method is used to remove a token text area widget button at the specified index position. If the parameter is not defined, all the widget buttons are removed.
+
+ <div data-role="tokentextarea">
+ </div>
+ $(".selector").tokentextarea("remove", [index]);
+*/
+/**
+ @method length
+ The length method is used to retrieve the number of buttons in the token text area widget:
+ <div data-role="tokentextarea">
+ </div>
+ $(".selector").tokentextarea("length");
+*/
+/**
+ @method focusIn
+ The focusIn method is used to set the focus status to "focus in". This focus state enables the user to add or remove buttons in the token text area widget.
+
+ <div data-role="tokentextarea">
+ </div>
+ $(".selector").tokentextarea("focusIn");
+*/
+/**
+ @method focusOut
+ The focusOut method is used to set the focus status to "focus out". In this focus state, the user cannot manage the buttons in the widget, all the buttons are removed, and a message is displayed.
+
+ <div data-role="tokentextarea">
+ </div>
+ $(".selector").tokentextarea("focusOut");
+*/
+( function ( $, window, document, undefined ) {
+ $.widget( "tizen.tokentextarea", $.mobile.widget, {
+ _focusStatus : null,
+ _items : null,
+ _viewWidth : 0,
+ _reservedWidth : 0,
+ _currentWidth : 0,
+ _fontSize : 0,
+ _anchorWidth : 0,
+ _labelWidth : 0,
+ _marginWidth : 0,
+ options : {
+ label : "To : ",
+ link : null,
+ description : "+ {0}"
+ },
+
+ _create : function () {
+ var self = this,
+ $view = this.element,
+ role = $view.jqmData( "role" ),
+ option = this.options,
+ className = "ui-tokentextarea-link",
+ inputbox = $( document.createElement( "input" ) ),
+ labeltag = $( document.createElement( "span" ) ),
+ moreBlock = $( document.createElement( "a" ) );
+
+ $view.hide().empty().addClass( "ui-" + role );
+
+ // create a label tag.
+ $( labeltag ).text( option.label ).addClass( "ui-tokentextarea-label" ).attr( "tabindex", 0 );
+ $view.append( labeltag );
+
+ // create a input tag
+ $( inputbox ).addClass( "ui-tokentextarea-input ui-tokentextarea-input-visible ui-input-text ui-body-s" ).attr( "role", "textbox" );
+ $view.append( inputbox );
+
+ // create a anchor tag.
+ if ( option.link === null || $.trim( option.link ).length < 1 || $( option.link ).length === 0 ) {
+ className += "-dim";
+ }
+ $( moreBlock ).attr( "data-role", "button" )
+ .buttonMarkup( {
+ inline: true,
+ icon: "plus",
+ style: "circle"
+ })
+ .attr( { "href" : $.trim( option.link ), "tabindex" : 0 } )
+ .addClass( "ui-tokentextarea-link-base" )
+ .addClass( className )
+ .find( "span.ui-btn-text" )
+ .text( "Add recipient" );
+
+ // append default htmlelements to main widget.
+ $view.append( moreBlock );
+
+ // bind a event
+ this._bindEvents();
+ self._focusStatus = "init";
+ // display widget
+ $view.show();
+
+ // assign global variables
+ self._viewWidth = $view.innerWidth();
+ self._reservedWidth += self._calcBlockWidth( moreBlock );
+ self._reservedWidth += self._calcBlockWidth( labeltag );
+ self._fontSize = parseInt( $( moreBlock ).css( "font-size" ), 10 );
+ self._currentWidth = self._reservedWidth;
+ self._modifyInputBoxWidth();
+ },
+
+ // bind events
+ _bindEvents : function () {
+ var self = this,
+ $view = self.element,
+ option = self.options,
+ inputbox = $view.find( ".ui-tokentextarea-input" ),
+ moreBlock = $view.find( ".ui-tokentextarea-link-base" ),
+ isSeparator = false;
+
+ // delegate a event to HTMLDivElement(each block).
+ $view.delegate( "div", "click", function ( event ) {
+ if ( $( this ).hasClass( "ui-tokentextarea-sblock" ) ) {
+ // If block is selected, it will be removed.
+ self._removeTextBlock();
+ }
+
+ var lockBlock = $view.find( "div.ui-tokentextarea-sblock" );
+ if ( typeof lockBlock !== "undefined" ) {
+ lockBlock.removeClass( "ui-tokentextarea-sblock" ).addClass( "ui-tokentextarea-block" );
+ }
+ $( this ).removeClass( "ui-tokentextarea-block" ).addClass( "ui-tokentextarea-sblock" );
+ $view.trigger( "select" );
+ });
+
+ inputbox.bind( "keyup", function ( event ) {
+ // 8 : backspace
+ // 13 : Enter
+ // 186 : semi-colon
+ // 188 : comma
+ var keyValue = event.keyCode,
+ valueString = $( inputbox ).val(),
+ valueStrings = [],
+ index;
+
+ if ( keyValue === 8 ) {
+ if ( valueString.length === 0 ) {
+ self._validateTargetBlock();
+ }
+ } else if ( keyValue === 13 || keyValue === 186 || keyValue === 188 ) {
+ if ( valueString.length !== 0 ) {
+ // split content by separators(',', ';')
+ valueStrings = valueString.split ( /[,;]/ );
+ for ( index = 0; index < valueStrings.length; index++ ) {
+ if ( valueStrings[index].length !== 0 && valueStrings[index].replace( /\s/g, "" ).length !== 0 ) {
+ self._addTextBlock( valueStrings[index] );
+ }
+ }
+ }
+ inputbox.val( "" );
+ isSeparator = true;
+ } else {
+ self._unlockTextBlock();
+ }
+
+ return !isSeparator;
+ });
+
+ moreBlock.click( function () {
+ if ( $( moreBlock ).hasClass( "ui-tokentextarea-link-dim" ) ) {
+ return;
+ }
+
+ $( inputbox ).removeClass( "ui-tokentextarea-input-visible" ).addClass( "ui-tokentextarea-input-invisible" );
+
+ $.mobile.changePage( option.link, {
+ transition: "slide",
+ reverse: false,
+ changeHash: false
+ });
+ });
+
+ $( document ).bind( "pagechange.mbe", function ( event ) {
+ if ( $view.innerWidth() === 0 ) {
+ return ;
+ }
+ self._modifyInputBoxWidth();
+ $( inputbox ).removeClass( "ui-tokentextarea-input-invisible" ).addClass( "ui-tokentextarea-input-visible" );
+ });
+
+ $view.bind( "click", function ( event ) {
+ if ( self._focusStatus === "focusOut" ) {
+ self.focusIn();
+ }
+ });
+ },
+
+ // create a textbutton and append this button to parent layer.
+ // @param arg1 : string
+ // @param arg2 : index
+ _addTextBlock : function ( messages, blockIndex ) {
+ if ( arguments.length === 0 ) {
+ return;
+ }
+
+ if ( !messages ) {
+ return ;
+ }
+
+ var self = this,
+ $view = self.element,
+ content = messages,
+ index = blockIndex,
+ blocks = null,
+ textBlock = null;
+
+ if ( self._viewWidth === 0 ) {
+ self._viewWidth = $view.innerWidth();
+ }
+
+ // Create a new text HTMLDivElement.
+ textBlock = $( document.createElement( 'div' ) );
+
+ textBlock.text( content ).addClass( "ui-tokentextarea-block" ).attr( { "aria-label" : "double tap to edit", "tabindex" : 0 } );
+ textBlock.css( {'visibility': 'hidden'} );
+
+ blocks = $view.find( "div" );
+ if ( index !== null && index <= blocks.length ) {
+ $( blocks[index] ).before( textBlock );
+ } else {
+ $view.find( ".ui-tokentextarea-input" ).before( textBlock );
+ }
+
+ textBlock = self._ellipsisTextBlock( textBlock );
+ textBlock.css( {'visibility': 'visible'} );
+
+ self._modifyInputBoxWidth();
+
+ textBlock.hide();
+ textBlock.fadeIn( "fast", function () {
+ self._currentWidth += self._calcBlockWidth( textBlock );
+ $view.trigger( "add" );
+ });
+ },
+
+ _removeTextBlock : function () {
+ var self = this,
+ $view = this.element,
+ lockBlock = $view.find( "div.ui-tokentextarea-sblock" ),
+ _temp = null,
+ _dummy = function () {};
+
+ if ( lockBlock !== null && lockBlock.length > 0 ) {
+ self._currentWidth -= self._calcBlockWidth( lockBlock );
+
+ lockBlock.fadeOut( "fast", function () {
+ lockBlock.remove();
+ self._modifyInputBoxWidth();
+ });
+
+ this._eventRemoveCall = true;
+ if ( $view[0].remove ) {
+ _temp = $view[0].remove;
+ $view[0].remove = _dummy;
+ }
+ $view.triggerHandler( "remove" );
+ if ( _temp) {
+ $view[0].remove = _temp;
+ }
+ this._eventRemoveCall = false;
+ } else {
+ $view.find( "div:last" ).removeClass( "ui-tokentextarea-block" ).addClass( "ui-tokentextarea-sblock" );
+ }
+ },
+
+ _calcBlockWidth : function ( block ) {
+ return $( block ).outerWidth( true );
+ },
+
+ _unlockTextBlock : function () {
+ var $view = this.element,
+ lockBlock = $view.find( "div.ui-tokentextarea-sblock" );
+ if ( lockBlock ) {
+ lockBlock.removeClass( "ui-tokentextarea-sblock" ).addClass( "ui-tokentextarea-block" );
+ }
+ },
+
+ // call when remove text block by backspace key.
+ _validateTargetBlock : function () {
+ var self = this,
+ $view = self.element,
+ lastBlock = $view.find( "div:last" ),
+ tmpBlock = null;
+
+ if ( lastBlock.hasClass( "ui-tokentextarea-sblock" ) ) {
+ self._removeTextBlock();
+ } else {
+ tmpBlock = $view.find( "div.ui-tokentextarea-sblock" );
+ tmpBlock.removeClass( "ui-tokentextarea-sblock" ).addClass( "ui-tokentextarea-block" );
+ lastBlock.removeClass( "ui-tokentextarea-block" ).addClass( "ui-tokentextarea-sblock" );
+ }
+ },
+
+ _ellipsisTextBlock : function ( textBlock ) {
+ var self = this,
+ $view = self.element,
+ maxWidth = self._viewWidth / 2;
+
+ if ( self._calcBlockWidth( textBlock ) > maxWidth ) {
+ $( textBlock ).width( maxWidth - self._marginWidth );
+ }
+
+ return textBlock;
+ },
+
+ _modifyInputBoxWidth : function () {
+ var self = this,
+ $view = self.element,
+ margin = 0,
+ labelWidth = 0,
+ anchorWidth = 0,
+ inputBoxWidth = 0,
+ blocks = $view.find( "div" ),
+ blockWidth = 0,
+ index = 0,
+ inputBoxMargin = 10,
+ inputBox = $view.find( ".ui-tokentextarea-input" );
+
+ if ( $view.width() === 0 ) {
+ return;
+ }
+
+ if ( self._labelWidth === 0 ) {
+ self._labelWidth = $view.find( ".ui-tokentextarea-label" ).outerWidth( true );
+ self._anchorWidth = $view.find( ".ui-tokentextarea-link-base" ).outerWidth( true );
+ self._marginWidth = parseInt( ( $( inputBox ).css( "margin-left" ) ), 10 );
+ self._marginWidth += parseInt( ( $( inputBox ).css( "margin-right" ) ), 10 );
+ self._viewWidth = $view.innerWidth();
+ }
+
+ margin = self._marginWidth;
+ labelWidth = self._labelWidth;
+ anchorWidth = self._anchorWidth;
+ inputBoxWidth = self._viewWidth - labelWidth;
+
+ for ( index = 0; index < blocks.length; index += 1 ) {
+ blockWidth = self._calcBlockWidth( blocks[index] );
+
+ if ( blockWidth >= inputBoxWidth + anchorWidth ) {
+ if ( blockWidth >= inputBoxWidth ) {
+ inputBoxWidth = self._viewWidth - blockWidth;
+ } else {
+ inputBoxWidth = self._viewWidth;
+ }
+ } else {
+ if ( blockWidth > inputBoxWidth ) {
+ inputBoxWidth = self._viewWidth - blockWidth;
+ } else {
+ inputBoxWidth -= blockWidth;
+ }
+ }
+ }
+
+ inputBoxWidth -= margin;
+ if ( inputBoxWidth < anchorWidth * 2 ) {
+ inputBoxWidth = self._viewWidth - margin;
+ }
+ $( inputBox ).width( inputBoxWidth - anchorWidth - inputBoxMargin );
+ },
+
+ _stringFormat : function ( expression ) {
+ var pattern = null,
+ message = expression,
+ i = 0;
+ for ( i = 1; i < arguments.length; i += 1 ) {
+ pattern = "{" + ( i - 1 ) + "}";
+ message = message.replace( pattern, arguments[i] );
+ }
+ return message;
+ },
+
+ _resizeBlocks : function () {
+ var self = this,
+ $view = self.element,
+ blocks = $view.find( "div" ),
+ index = 0;
+
+ for ( index = 0 ; index < blocks.length ; index += 1 ) {
+ $( blocks[index] ).css( "width", "auto" );
+ blocks[index] = self._ellipsisTextBlock( blocks[index] );
+ }
+ },
+
+ //---------------------------------------------------- //
+ // Public Method //
+ //----------------------------------------------------//
+ //
+ // Focus In Event
+ //
+ focusIn : function () {
+ if ( this._focusStatus === "focusIn" ) {
+ return;
+ }
+
+ var $view = this.element;
+
+ $view.find( ".ui-tokentextarea-label" ).attr( "tabindex", 0 ).show();
+ $view.find( ".ui-tokentextarea-desclabel" ).remove();
+ $view.find( "div.ui-tokentextarea-sblock" ).removeClass( "ui-tokentextarea-sblock" ).addClass( "ui-tokentextarea-block" );
+ $view.find( "div" ).attr( { "aria-label" : "double tap to edit", "tabindex" : 0 } ).show();
+ $view.find( ".ui-tokentextarea-input" ).removeClass( "ui-tokentextarea-input-invisible" ).addClass( "ui-tokentextarea-input-visible" ).attr( "tabindex", 0 );
+ $view.find( "a" ).attr( "tabindex", 0 ).show();
+
+ // change focus state.
+ this._modifyInputBoxWidth();
+ this._focusStatus = "focusIn";
+ $view.removeClass( "ui-tokentextarea-focusout" ).addClass( "ui-tokentextarea-focusin" ).removeAttr( "tabindex" );
+ $view.find( ".ui-tokentextarea-input" ).focus();
+ },
+
+ focusOut : function () {
+ if ( this._focusStatus === "focusOut" ) {
+ return;
+ }
+
+ var self = this,
+ $view = self.element,
+ tempBlock = null,
+ stateBlock = null,
+ numBlock = null,
+ statement = "",
+ index = 0,
+ lastIndex = 10,
+ label = $view.find( ".ui-tokentextarea-label" ),
+ more = $view.find( "span" ),
+ blocks = $view.find( "div" ),
+ currentWidth = $view.outerWidth( true ) - more.outerWidth( true ) - label.outerWidth( true ),
+ blockWidth = 0;
+
+ label.removeAttr( "tabindex" );
+ $view.find( ".ui-tokentextarea-input" ).removeClass( "ui-tokentextarea-input-visible" ).addClass( "ui-tokentextarea-input-invisible" ).removeAttr( "tabindex" );
+ $view.find( "a" ).removeAttr( "tabindex" ).hide();
+ blocks.removeAttr( "aria-label" ).removeAttr( "tabindex" ).hide();
+
+ currentWidth = currentWidth - self._reservedWidth;
+
+ for ( index = 0; index < blocks.length; index++ ) {
+ blockWidth = $( blocks[index] ).outerWidth( true );
+ if ( currentWidth - blockWidth <= 0 ) {
+ lastIndex = index - 1;
+ break;
+ }
+
+ $( blocks[index] ).show();
+ currentWidth -= blockWidth;
+ }
+
+ if ( lastIndex !== blocks.length ) {
+ statement = self._stringFormat( self.options.description, blocks.length - lastIndex - 1 );
+ tempBlock = $( document.createElement( 'span' ) );
+ tempBlock.addClass( "ui-tokentextarea-desclabel" ).attr( { "aria-label" : "more, double tap to edit", "tabindex" : "-1" } );
+ stateBlock = $( document.createElement( 'span' ) ).text( statement ).attr( "aria-hidden", "true" );
+ numBlock = $( document.createElement( 'span' ) ).text( blocks.length - lastIndex - 1 ).attr( "aria-label", "and" ).css( "visibility", "hidden" );
+ tempBlock.append( stateBlock );
+ tempBlock.append( numBlock );
+ $( blocks[lastIndex] ).after( tempBlock );
+ }
+
+ // update focus state
+ this._focusStatus = "focusOut";
+ $view.removeClass( "ui-tokentextarea-focusin" ).addClass( "ui-tokentextarea-focusout" ).attr( "tabindex", 0 );
+ },
+
+ inputText : function ( message ) {
+ var $view = this.element;
+
+ if ( arguments.length === 0 ) {
+ return $view.find( ".ui-tokentextarea-input" ).val();
+ }
+ $view.find( ".ui-tokentextarea-input" ).val( message );
+ return message;
+ },
+
+ select : function ( index ) {
+ var $view = this.element,
+ lockBlock = null,
+ blocks = null;
+
+ if ( this._focusStatus === "focusOut" ) {
+ return;
+ }
+
+ if ( arguments.length === 0 ) {
+ // return a selected block.
+ lockBlock = $view.find( "div.ui-tokentextarea-sblock" );
+ if ( lockBlock ) {
+ return lockBlock.text();
+ }
+ return null;
+ }
+ // 1. unlock all blocks.
+ this._unlockTextBlock();
+ // 2. select pointed block.
+ blocks = $view.find( "div" );
+ if ( blocks.length > index ) {
+ $( blocks[index] ).removeClass( "ui-tokentextarea-block" ).addClass( "ui-tokentextarea-sblock" );
+ $view.trigger( "select" );
+ }
+ return null;
+ },
+
+ add : function ( message, position ) {
+ if ( this._focusStatus === "focusOut" ) {
+ return;
+ }
+
+ this._addTextBlock( message, position );
+ },
+
+ remove : function ( position ) {
+ var self = this,
+ $view = this.element,
+ blocks = $view.find( "div" ),
+ index = 0,
+ _temp = null,
+ _dummy = function () {};
+
+ if ( this._focusStatus === "focusOut" ) {
+ return;
+ }
+
+ if ( arguments.length === 0 ) {
+ blocks.fadeOut( "fast", function () {
+ blocks.remove();
+ self._modifyInputBoxWidth();
+ self._trigger( "clear" );
+ });
+ } else if ( !isNaN( position ) ) {
+ // remove selected button
+ index = ( ( position < blocks.length ) ? position : ( blocks.length - 1 ) );
+
+ $( blocks[index] ).fadeOut( "fast", function () {
+ $( blocks[index] ).remove();
+ self._modifyInputBoxWidth();
+ });
+
+ this._eventRemoveCall = true;
+ if ( $view[0].remove ) {
+ _temp = $view[0].remove;
+ $view[0].remove = _dummy;
+ }
+ $view.triggerHandler( "remove" );
+ if ( _temp) {
+ $view[0].remove = _temp;
+ }
+ this._eventRemoveCall = false;
+ }
+ },
+
+ length : function () {
+ return this.element.find( "div" ).length;
+ },
+
+ refresh : function () {
+ var self = this,
+ $view = this.element;
+
+ self._viewWidth = $view.innerWidth();
+ self._resizeBlocks();
+ self._modifyInputBoxWidth();
+ },
+
+ destroy : function () {
+ var $view = this.element,
+ _temp = null,
+ _dummy = function () {};
+
+ if ( this._eventRemoveCall ) {
+ return;
+ }
+
+ $view.find( ".ui-tokentextarea-label" ).remove();
+ $view.find( "div" ).undelegate( "click" ).remove();
+ $view.find( "a" ).remove();
+ $view.find( ".ui-tokentextarea-input" ).unbind( "keyup" ).remove();
+
+ this._eventRemoveCall = true;
+ if ( $view[0].remove ) {
+ _temp = $view[0].remove;
+ $view[0].remove = _dummy;
+ }
+ $view.remove();
+ if ( _temp) {
+ $view[0].remove = _temp;
+ }
+ this._eventRemoveCall = false;
+
+ this._trigger( "destroy" );
+ }
+ });
+
+ $( document ).bind( "pagecreate create", function () {
+ $( ":jqmData(role='tokentextarea')" ).tokentextarea();
+ });
+
+ $( window ).bind( "resize", function () {
+ $( ":jqmData(role='tokentextarea')" ).tokentextarea( "refresh" );
+ });
+} ( jQuery, window, document ) );
+
--- /dev/null
+
+/*
+ * This software is licensed under the MIT licence (as defined by the OSI at
+ * http://www.opensource.org/licenses/mit-license.php)
+ *
+ * ***************************************************************************
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2011 by Intel Corporation Ltd.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * ***************************************************************************
+ */
+
+( function ($, undefined) {
+
+ $.widget( "tizen.triangle", $.tizen.widgetex, {
+ options: {
+ extraClass: "",
+ offset: null,
+ color: null,
+ location: "top",
+ initSelector: ":jqmData(role='triangle')"
+ },
+
+ _create: function () {
+ var triangle = $( "<div></div>", {"class" : "ui-triangle"} );
+
+ $.extend(this, {
+ _triangle: triangle
+ });
+
+ this.element.addClass( "ui-triangle-container" ).append( triangle );
+ },
+
+ _doCSS: function () {
+ var location = ( this.options.location || "top" ),
+ offsetCoord = ( ($.inArray(location, ["top", "bottom"]) === -1) ? "top" : "left"),
+ cssArg = {
+ "border-bottom-color" : "top" === location ? this.options.color : "transparent",
+ "border-top-color" : "bottom" === location ? this.options.color : "transparent",
+ "border-left-color" : "right" === location ? this.options.color : "transparent",
+ "border-right-color" : "left" === location ? this.options.color : "transparent"
+ };
+
+ cssArg[offsetCoord] = this.options.offset;
+
+ this._triangle.removeAttr( "style" ).css( cssArg );
+ },
+
+ _setOffset: function ( value ) {
+ this.options.offset = value;
+ this.element.attr( "data-" + ($.mobile.ns || "") + "offset", value );
+ this._doCSS();
+ },
+
+ _setExtraClass: function ( value ) {
+ this._triangle.addClass( value );
+ this.options.extraClass = value;
+ this.element.attr( "data-" + ($.mobile.ns || "") + "extra-class", value );
+ },
+
+ _setColor: function ( value ) {
+ this.options.color = value;
+ this.element.attr( "data-" + ($.mobile.ns || "") + "color", value );
+ this._doCSS();
+ },
+
+ _setLocation: function ( value ) {
+ this.element
+ .removeClass( "ui-triangle-container-" + this.options.location )
+ .addClass( "ui-triangle-container-" + value );
+ this._triangle
+ .removeClass( "ui-triangle-" + this.options.location )
+ .addClass( "ui-triangle-" + value );
+
+ this.options.location = value;
+ this.element.attr( "data-" + ($.mobile.ns || "") + "location", value );
+
+ this._doCSS();
+ }
+ });
+
+ $( document ).bind( "pagecreate create", function ( e ) {
+ $($.tizen.triangle.prototype.options.initSelector, e.target)
+ .not(":jqmData(role='none'), :jqmData(role='nojs')")
+ .triangle();
+ });
+
+}(jQuery) );
+
--- /dev/null
+
+/* ***************************************************************************
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * ***************************************************************************
+ *
+ * Author: Kangsik Kim <kangsik81.kim@samsung.com>
+ * Youmin Ha <youmin.ha@samsung.com>
+*/
+
+/**
+ * In the web environment, it is challenging to display a large amount of data in a grid.
+ * When an application needs to show, for example, image gallery with over 1,000 images,
+ * the same enormous data must be inserted into a HTML document.
+ * It takes a long time to display the data and manipulating DOM is complex.
+ * The virtual grid widget supports storing unlimited data without performance issues
+ * by reusing a limited number of grid elements.
+ * The virtual grid widget is based on the jQuery.template plug-in
+ * For more information, see jQuery.template.
+ *
+ * HTML Attributes:
+ *
+ * data-role: virtualgrid
+ * data-template : Has the ID of the jQuery.template element.
+ * jQuery.template for a virtual grid must be defined.
+ * Style for template would use rem unit to support scalability.
+ * data-direction : This option define the direction of the scroll.
+ * You must choose one of the 'x' and 'y' (Default : y)
+ * data-rotation : This option defines whether or not the circulation of the data.
+ * If option is 'true' and scroll is reached the last data,
+ * Widget will present the first data on the screen.
+ * If option is ‘false’, Widget will operate like a scrollview.
+ *
+ * ID : <DIV> element that has "data-role=virtualgrid" must have ID attribute.
+ *
+ * APIs:
+ *
+ * create ( {
+ * itemData: function ( idx ) { return json_obj; },
+ * numItemData: number or function () { return number; },
+ * cacheItemData: function ( minIdx, maxIdx ) {}
+ * } )
+ * : Create VirtualGrid widget. At this moment, _create method is called.
+ * args : A collection of options
+ * itemData: A function that returns JSON object for given index. Mandatory.
+ * numItemData: Total number of itemData. Mandatory.
+ * cacheItemData: Virtuallist will ask itemData between minIdx and maxIdx.
+ * Developers can implement this function for preparing data.
+ * Optional.
+ *
+ * centerTo ( String )
+ * : Find a DOM Element with the given class name.
+ * This element will be centered on the screen.
+ * Serveral elements were found, the first element is displayed.
+ *
+ * Events:
+ * scrollstart : : This event triggers when a user begin to move the scroll on VirtualGrid.
+ * scrollupdate : : This event triggers while a user moves the scroll on VirtualGrid.
+ * scrollstop : This event triggers when a user stop the scroll on VirtualGrid.
+ * select : This event triggers when a cell is selected.
+ *
+ * Examples:
+ *
+ * <script id="tizen-demo-namecard" type="text/x-jquery-tmpl">
+ * <div class="ui-demo-namecard">
+ * <div class="ui-demo-namecard-pic">
+ * <img class="ui-demo-namecard-pic-img" src="${TEAM_LOGO}" />
+ * </div>
+ * <div class="ui-demo-namecard-contents">
+ * <span class="name ui-li-text-main">${NAME}</span>
+ * <span class="active ui-li-text-sub">${ACTIVE}</span>
+ * <span class="from ui-li-text-sub">${FROM}</span>
+ * </div>
+ * </div>
+ * </script>
+ * <div id="virtualgrid-demo" data-role="virtualgrid" data-template="tizen-demo-namecard" >
+ * </div>
+ *
+ */
+
+// most of following codes are derived from jquery.mobile.scrollview.js
+
+/**
+ @class VirtualGrid
+ In the Web environment, it is challenging to display large amount of data in a list, such as displaying a contact list of over 1000 list items. It takes time to display the entire list in HTML and the DOM manipulation is complex.
+
+ The virtual grid widget is used to display a list of unlimited data elements on the screen for better performance. This widget displays the data in the grid format by reusing the existing grid control space. Virtual grids are based on the jQuery.template plugin as described in the jQuery documentation for jQuery.template plugin.
+
+ To add a virtual grid widget to the application, use the following code:
+
+ <script id="tizen-demo-namecard" type="text/x-jquery-tmpl">
+ <div class="ui-demo-namecard">
+ <div class="ui-demo-namecard-pic">
+ <img class="ui-demo-namecard-pic-img" src="${TEAM_LOGO}" />
+ </div>
+ <div class="ui-demo-namecard-contents">
+ <span class="name ui-li-text-main">${NAME}</span>
+ </div>
+ </div>
+ </script>
+ <div id="virtualgrid-demo" data-role="virtualgrid" data-template="tizen-demo-namecard">
+ </div>
+*/
+/**
+ @property {String} data-template
+ Specifies the jQuery.template element ID.
+ The jQuery.template must be defined. The template style can use rem units to support scalability.
+*/
+/**
+ @property {String} data-direction
+ Defines the scroll direction. The direction options are x (horizontal) and y (vertical).
+ The default value is y.
+*/
+/**
+ @property {Boolean} data-rotation
+ Defines whether the data elements are displayed from the beginning of the list again once the end of file is reached.
+ The default value is false.
+*/
+/**
+ @event scrollstart
+ The scrollstart event is fired when the user starts scrolling through the grid:
+
+ <div data-role="virtualgrid" data-scroll="y" data-template="tizen-demo-namecard"></div>
+ // Option 01
+ $(".selector").virtualgrid
+ ({
+ scrollstart: function(event, ui)
+ {
+ // Handle the scrollstart event
+ }
+ });
+ // Option 02
+ $(".selector").bind("scrollstart", function(event, ui)
+ {
+ // Handle the scrollstart event
+ });
+*/
+/**
+ @event scrollupdate
+ The scrollupdate event is fired when the user moves the scroll bar in the grid:
+
+ <div data-role="virtualgrid" data-scroll="y" data-template="tizen-demo-namecard"></div>
+ // Option 01
+ $(".selector").virtualgrid
+ ({
+ scrollupdate: function(event, ui)
+ {
+ // Handle the scrollupdate event
+ }
+ });
+ // Option 02
+ $(".selector").bind("scrollupdate", function(event, ui)
+ {
+ // Handle the scrollupdate event
+ });
+*/
+/**
+ @event scrollstop
+ The scrollstop event is fired when the user stops scrolling:
+
+ <div data-role="virtualgrid" data-scroll="y" data-template="tizen-demo-namecard"></div>
+ // Option 01
+ $(".selector").virtualgrid
+ ({
+ scrollstop: function(event, ui)
+ {
+ // Handle the scrollstop event
+ }
+ });
+ // Option 02
+ $(".selector").bind("scrollstop", function(event, ui)
+ {
+ // Handle the scrollstop event
+ });
+*/
+/**
+ @event select
+ The select event is fired when a virtual grid cell is selected:
+
+ <div data-role="virtualgrid" data-scroll="y" data-template="tizen-demo-namecard"></div>
+ // Option 01
+ $(".selector").virtualgrid
+ ({
+ select: function(event, ui)
+ {
+ // Handle the select event
+ }
+ });
+ // Option 02
+ $(".selector").bind("select", function(event, ui)
+ {
+ // Handle the select event
+ });
+*/
+/**
+ @method create
+ @param {function} itemData(index)
+ @param {Number} numItemData
+ @param {function} cacheItemData(minIndex, maxIndex)
+ The create method is used to call the jQuery _create method. In the method parameters:
+
+ function itemData(index) returns the JSON object matched with the given index. The index value is between 0 and numItemData-1.<br/>
+ number numItemData or function numItemData() defines or returns a static number of items.<br/>
+ function cacheItemData(minIndex, maxIndex) prepares the JSON data. This method is called before calling the itemData() method with index values between minIndex and maxIndex.<br/>
+
+ <div data-role="virtualgrid" data-scroll="y" data-template="tizen-demo-namecard"></div>
+ function itemData(idx)
+ {
+ return DATA[idx];
+ }
+ function cacheItemData(minIdx, maxIdx)
+ {
+ // Prepare JSON data between minIdx and maxIdx
+ }
+ var numItemData = DATA.length;
+ $(".selector").virtualgrid("create",
+ {
+ itemData, numItemData, cacheItemData
+ });
+*/
+/**
+ @method centerTo
+ The centerTo method is used to search for the DOM element with a specified class name. The retrieved element is placed at the center of the virtual grid. If multiple elements are retrieved, the first element from the result list is placed at the center of the virtual grid.
+
+ <div data-role="virtualgrid" data-scroll="y" data-template="tizen-demo-namecard"></div>
+ $(".selector").virtualgrid("centerTo", "selector");
+*/
+/**
+ @method resize
+ The resize method is used to rearrange the DOM elements to fit a new screen size when the screen is resized:
+
+ <div data-role="virtualgrid" data-scroll="y" data-template="tizen-demo-namecard"></div>
+ ".selector").virtualgrid("resize");
+
+ @since Tizen2.0
+*/
+
+( function ( $, window, document, undefined ) {
+
+ function circularNum ( num, total ) {
+ var n = num % total;
+ if ( n < 0 ) {
+ n = total + n;
+ }
+ return n;
+ }
+
+ function MomentumTracker ( options ) {
+ this.options = $.extend( {}, options );
+ this.easing = "easeOutQuad";
+ this.reset();
+ }
+
+ var tstates = {
+ scrolling : 0,
+ done : 1
+ },
+ _OVERFLOW_DIR_NONE = 0, /* ENUM */
+ _OVERFLOW_DIR_UP = 1, /* ENUM */
+ _OVERFLOW_DIR_DOWN = -1, /* ENUM */
+ imgTagSrcAttrRE = /src\s*=\s*[\"\'][\w\/.]+.[A-z]+[\"\']/;
+
+ function getCurrentTime () {
+ return Date.now();
+ }
+
+ $.extend( MomentumTracker.prototype, {
+ start : function ( pos, speed, duration ) {
+ this.state = ( speed !== 0 ) ? tstates.scrolling : tstates.done;
+ this.pos = pos;
+ this.speed = speed;
+ this.duration = duration;
+
+ this.fromPos = 0;
+ this.toPos = 0;
+
+ this.startTime = getCurrentTime();
+ },
+
+ reset : function () {
+ this.state = tstates.done;
+ this.pos = 0;
+ this.speed = 0;
+ this.duration = 0;
+ },
+
+ update : function () {
+ var state = this.state, duration, elapsed, dx, x;
+
+ if ( state == tstates.done ) {
+ return this.pos;
+ }
+ duration = this.duration;
+ elapsed = getCurrentTime () - this.startTime;
+ elapsed = elapsed > duration ? duration : elapsed;
+ dx = this.speed * ( 1 - $.easing[this.easing]( elapsed / duration, elapsed, 0, 1, duration ) );
+ x = this.pos + ( dx / 2 );
+ this.pos = x;
+
+ if ( elapsed >= duration ) {
+ this.state = tstates.done;
+ }
+ return this.pos;
+ },
+
+ done : function () {
+ return this.state == tstates.done;
+ },
+
+ getPosition : function () {
+ return this.pos;
+ }
+ });
+
+ jQuery.widget ( "mobile.virtualgrid", jQuery.mobile.widget, {
+ options : {
+ // virtualgrid option
+ template : "",
+ direction : "y",
+ rotation : false
+ },
+
+ create : function () {
+ this._create.apply( this, arguments );
+ },
+
+ _create : function ( args ) {
+ $.extend( this, {
+ // view
+ _$view : null,
+ _$clip : null,
+ _$rows : null,
+ _tracker : null,
+ _viewSize : 0,
+ _clipSize : 0,
+ _cellSize : undefined,
+ _currentItemCount : 0,
+ _itemCount : 1,
+ _inheritedSize : null,
+
+ // timer
+ _timerInterval : 0,
+ _timerID : 0,
+ _timerCB : null,
+ _lastMove : null,
+
+ // Data
+ _itemData : function ( idx ) { return null; },
+ _numItemData : 0,
+ _cacheItemData : function ( minIdx, maxIdx ) { },
+ _totalRowCnt : 0,
+ _templateText : null,
+ _maxViewSize : 0,
+ _modifyViewPos : 0,
+ _maxSizeExceptClip : 0,
+ _maxSize : 0,
+
+ // axis - ( true : x , false : y )
+ _direction : false,
+ _didDrag : true,
+ _reservedPos : 0,
+ _scalableSize : 0,
+ _eventPos : 0,
+ _nextPos : 0,
+ _movePos : 0,
+ _lastY : 0,
+ _speedY : 0,
+ _lastX : 0,
+ _speedX : 0,
+ _rowsPerView : 0,
+ _fragment : null,
+
+ _filterRatio : 0.9,
+
+ _overflowStartPos : 0,
+ _overflowDir : 0,
+ _overflowMaxDragDist : 100
+ });
+
+ var self = this,
+ $dom = $( self.element ),
+ opts = self.options,
+ $item = null;
+
+ // itemData
+ // If mandatory options are not given, Do nothing.
+ if ( !args ) {
+ return ;
+ }
+
+ if ( !self._loadData( args ) ) {
+ return;
+ }
+
+ // make a fragment.
+ self._fragment = document.createDocumentFragment();
+
+ // read defined properties(width and height) from dom element.
+ self._inheritedSize = self._getinheritedSize( self.element );
+
+ // set a scroll direction.
+ self._direction = opts.direction === 'x' ? true : false;
+
+ // make view layer
+ self._$clip = $dom.addClass( "ui-scrollview-clip" ).addClass( "ui-virtualgrid-view" );
+ $item = $( document.createElement( "div" ) ).addClass( "ui-scrollview-view" );
+ self._clipSize = self._calculateClipSize();
+ self._$clip.append( $item );
+ self._$view = $item;
+ self._$clip.css( "overflow", "hidden" );
+ self._$view.css( "overflow", "hidden" );
+
+ // inherit from scrollview widget.
+ self._scrollView = $.tizen.scrollview.prototype;
+ self._initScrollView();
+
+ // create tracker.
+ self._createTracker();
+ self._makePositioned( self._$clip );
+ self._timerInterval = 1000 / self.options.fps;
+
+ self._timerID = 0;
+ self._timerCB = function () {
+ self._handleMomentumScroll();
+ };
+ $dom.closest( ".ui-content" ).addClass( "ui-virtualgrid-content" ).css( "overflow", "hidden" );
+
+ // add event handler.
+ self._addBehaviors();
+
+ self._currentItemCount = 0;
+ self._createOverflowArea();
+ self._createScrollBar();
+ self.refresh();
+ },
+
+ // The argument is checked for compliance with the specified format.
+ // @param args : Object
+ // @return boolean
+ _loadData : function ( args ) {
+ var self = this;
+
+ if ( args.itemData && typeof args.itemData == 'function' ) {
+ self._itemData = args.itemData;
+ } else {
+ return false;
+ }
+ if ( args.numItemData ) {
+ if ( typeof args.numItemData == 'function' ) {
+ self._numItemData = args.numItemData( );
+ } else if ( typeof args.numItemData == 'number' ) {
+ self._numItemData = args.numItemData;
+ } else {
+ return false;
+ }
+ } else {
+ return false;
+ }
+ self._getObjectNames( self._itemData( 0 ) );
+ return true;
+ },
+
+ // Make up the first screen.
+ _initLayout: function () {
+ var self = this,
+ opts = self.options,
+ i,
+ $row;
+
+ for ( i = -1; i < self._rowsPerView + 1; i += 1 ) {
+ $row = self._$rows[ circularNum( i, self._$rows.length ) ];
+ self._$view.append( $row );
+ }
+ self._setElementTransform( -self._cellSize );
+
+ self._replaceRow( self._$view[0].firstChild, self._totalRowCnt - 1 );
+ if ( opts.rotation && self._rowsPerView >= self._totalRowCnt ) {
+ self._replaceRow( self._$view[0].lastChild, 0 );
+ }
+ self._setViewSize();
+ },
+
+ _setViewSize : function () {
+ var self = this,
+ height = 0,
+ width = 0;
+
+ if ( self._direction ) {
+ width = self._cellSize * ( self._rowsPerView + 2 );
+ width = parseInt( width, 10 ) + 1;
+ self._$view.width( width );
+ self._viewSize = self._$view.width();
+ } else {
+ self._$view.height( self._cellSize * ( self._rowsPerView + 2 ) );
+ self._$clip.height( self._clipSize );
+ self._viewSize = self._$view.height();
+ }
+ },
+
+ _getViewWidth : function () {
+ var self = this;
+ return self._maxSize;
+ },
+
+ _getViewHeight : function () {
+ var self = this;
+ return self._maxSize;
+ },
+
+ refresh : function () {
+ var self = this,
+ opts = self.options,
+ width = 0,
+ height = 0,
+ $template = null;
+
+ $template = $( "#" + opts.template );
+ if ( !$template ) {
+ return ;
+ }
+ self._templateText = self._insertAriaAttrToTmpl( $template.text() );
+
+ width = self._calculateClipWidth();
+ height = self._calculateClipHeight();
+ self._$view.width( width ).height( height );
+ self._$clip.width( width ).height( height );
+
+ self._clipSize = self._calculateClipSize();
+ self._calculateColumnSize();
+ self._initPageProperty();
+ self._setScrollBarSize();
+ },
+
+ _initPageProperty : function () {
+ var self = this,
+ rowsPerView = 0,
+ $child,
+ columnCount = 0,
+ totalRowCnt = 0,
+ attributeName = self._direction ? "width" : "height";
+
+ columnCount = self._calculateColumnCount();
+
+ totalRowCnt = parseInt( self._numItemData / columnCount, 10 );
+ self._totalRowCnt = self._numItemData % columnCount === 0 ? totalRowCnt : totalRowCnt + 1;
+ self._itemCount = columnCount;
+
+ if ( self._cellSize <= 0 ) {
+ return ;
+ }
+
+ rowsPerView = self._clipSize / self._cellSize;
+ rowsPerView = Math.ceil( rowsPerView );
+ self._rowsPerView = parseInt( rowsPerView, 10 );
+
+ $child = $( self._makeRows( rowsPerView + 2 ) );
+ self._$view.append( $child.children() );
+ self._$view.children().css( attributeName, self._cellSize + "px" );
+ self._$rows = self._$view.children().detach();
+
+ self._reservedPos = -self._cellSize;
+ self._scalableSize = -self._cellSize;
+
+ self._initLayout();
+
+ self._blockScroll = self._rowsPerView > self._totalRowCnt;
+ self._maxSizeExceptClip = ( self._totalRowCnt - self._rowsPerView ) * self._cellSize;
+ self._maxSize = self._totalRowCnt * self._cellSize;
+ self._maxViewSize = ( self._rowsPerView ) * self._cellSize;
+ self._modifyViewPos = -self._cellSize;
+ if ( self._clipSize < self._maxViewSize ) {
+ self._modifyViewPos = ( -self._cellSize ) + ( self._clipSize - self._maxViewSize );
+ }
+ },
+
+ _getinheritedSize : function ( elem ) {
+ var $target = $( elem ),
+ height,
+ width,
+ NODETYPE = { ELEMENT_NODE : 1, TEXT_NODE : 3 },
+ ret = {
+ isDefinedWidth : false,
+ isDefinedHeight : false,
+ width : 0,
+ height : 0
+ };
+
+ while ( $target[0].nodeType === NODETYPE.ELEMENT_NODE && ( ret.isDefinedWidth === false || ret.isHeightDefined === false ) ) {
+ height = $target[0].style.height;
+ width = $target[0].style.width;
+
+ if ( ret.isDefinedHeight === false && height !== "" ) {
+ // Size was defined
+ ret.isDefinedHeight = true;
+ ret.height = parseInt( height, 10 );
+ }
+
+ if ( ret.isDefinedWidth === false && width !== "" ) {
+ // Size was defined
+ ret.isDefinedWidth = true;
+ ret.width = parseInt( width, 10 );
+ }
+ $target = $target.parent();
+ if ( $target.hasClass( "ui-content" ) ) {
+ break;
+ }
+ }
+ return ret;
+ },
+
+ resize : function () {
+ var self = this,
+ ret = null,
+ rowsPerView = 0,
+ itemCount = 0,
+ totalRowCnt = 0,
+ diffRowCnt = 0,
+ clipSize = 0,
+ prevcnt = 0,
+ clipPosition = 0;
+
+ itemCount = self._calculateColumnCount();
+ if ( itemCount != self._itemCount ) {
+ totalRowCnt = parseInt( self._numItemData / itemCount, 10 );
+ self._totalRowCnt = self._numItemData % itemCount === 0 ? totalRowCnt : totalRowCnt + 1;
+ prevcnt = self._itemCount;
+ self._itemCount = itemCount;
+ clipPosition = self._getClipPosition();
+ self._$view.hide();
+
+ diffRowCnt = self._replaceRows( itemCount, prevcnt, self._totalRowCnt, clipPosition );
+ self._maxSizeExceptClip = ( self._totalRowCnt - self._rowsPerView ) * self._cellSize;
+ self._maxSize = self._totalRowCnt * self._cellSize;
+ self._scalableSize += ( -diffRowCnt ) * self._cellSize;
+ self._reservedPos += ( -diffRowCnt ) * self._cellSize;
+ self._setScrollBarSize();
+ self._setScrollBarPosition( diffRowCnt );
+
+ self._$view.show();
+ }
+
+ clipSize = self._calculateClipSize();
+ if ( clipSize !== self._clipSize ) {
+ rowsPerView = clipSize / self._cellSize;
+ rowsPerView = parseInt( Math.ceil( rowsPerView ), 10 );
+
+ if ( rowsPerView > self._rowsPerView ) {
+ // increase row.
+ self._increaseRow( rowsPerView - self._rowsPerView );
+ } else if ( rowsPerView < self._rowsPerView ) {
+ // decrease row.
+ self._decreaseRow( self._rowsPerView - rowsPerView );
+ }
+ self._rowsPerView = rowsPerView;
+ self._clipSize = clipSize;
+ self._blockScroll = self._rowsPerView > self._totalRowCnt;
+ self._maxSizeExceptClip = ( self._totalRowCnt - self._rowsPerView ) * self._cellSize;
+ self._maxSize = self._totalRowCnt * self._cellSize;
+ self._maxViewSize = ( self._rowsPerView ) * self._cellSize;
+ if ( self._clipSize < self._maxViewSize ) {
+ self._modifyViewPos = ( -self._cellSize ) + ( self._clipSize - self._maxViewSize );
+ }
+ if ( self._direction ) {
+ self._$clip.width( self._clipSize );
+ } else {
+ self._$clip.height( self._clipSize );
+ }
+ self._setScrollBarSize();
+ self._setScrollBarPosition( 0 );
+ self._setViewSize();
+ }
+ },
+
+ _initScrollView : function () {
+ var self = this;
+ $.extend( self.options, self._scrollView.options );
+ self.options.moveThreshold = 10;
+ self.options.showScrollBars = false;
+ self._getScrollHierarchy = self._scrollView._getScrollHierarchy;
+ self._makePositioned = self._scrollView._makePositioned;
+ self._set_scrollbar_size = self._scrollView._set_scrollbar_size;
+ self._setStyleTransform = self._scrollView._setElementTransform;
+ self._hideOverflowIndicator = self._scrollView._hideOverflowIndicator;
+ self._showOverflowIndicator = self._scrollView._showOverflowIndicator;
+ self._setGestureScroll = self._scrollView._setGestureScroll;
+ },
+
+ _createTracker : function () {
+ var self = this;
+
+ self._tracker = new MomentumTracker( self.options );
+ if ( self._direction ) {
+ self._hTracker = self._tracker;
+ self._$clip.width( self._clipSize );
+ } else {
+ self._vTracker = self._tracker;
+ self._$clip.height( self._clipSize );
+ }
+ },
+
+ //----------------------------------------------------//
+ // Overflow effect
+ //----------------------------------------------------//
+ _createOverflowArea : function () {
+ var self = this,
+ prefix = "<div class=\"ui-virtualgrid-overflow-indicator-",
+ suffixTop = "-top\"></div>",
+ suffixBottom = "-bottom\"></div>";
+
+ if ( self.options.rotation ) {
+ return;
+ }
+
+ if ( self._direction ) {
+ self._overflowTop = $( prefix + "x" + suffixTop );
+ self._overflowBottom = $( prefix + "x" + suffixBottom );
+ } else {
+ self._overflowTop = $( prefix + "y" + suffixTop );
+ self._overflowBottom = $( prefix + "y" + suffixBottom );
+ }
+
+ self._$clip.append( self._overflowTop );
+ self._$clip.append( self._overflowBottom );
+ self._overflowDisplayed = false;
+ },
+
+ _hideVGOverflowIndicator : function () {
+ if ( this._overflowDisplayed === false ) {
+ return;
+ }
+
+ this._overflowTop.animate( { opacity: 0 }, 300 );
+ this._overflowBottom.animate( { opacity: 0 }, 300 );
+ this._overflowDisplayed = false;
+ },
+
+ //----------------------------------------------------//
+ // Scrollbar //
+ //----------------------------------------------------//
+ _createScrollBar : function () {
+ var self = this,
+ prefix = "<div class=\"ui-scrollbar ui-scrollbar-",
+ suffix = "\"><div class=\"ui-scrollbar-track\"><div class=\"ui-scrollbar-thumb\"></div></div></div>";
+
+ if ( self.options.rotation ) {
+ return ;
+ }
+
+ if ( self._direction ) {
+ self._$clip.append( prefix + "x" + suffix );
+ self._hScrollBar = self._$clip.children( ".ui-scrollbar-x" );
+ self._hScrollBar.find( ".ui-scrollbar-thumb" ).addClass( "ui-scrollbar-thumb-x" );
+ } else {
+ self._$clip.append( prefix + "y" + suffix );
+ self._vScrollBar = self._$clip.children( ".ui-scrollbar-y" );
+ self._vScrollBar.find( ".ui-scrollbar-thumb" ).addClass( "ui-scrollbar-thumb-y" );
+ }
+ },
+
+ _setScrollBarSize: function () {
+ var self = this,
+ scrollBarSize = 0,
+ currentSize = 0,
+ $scrollBar,
+ attrName,
+ className;
+
+ if ( self.options.rotation ) {
+ return ;
+ }
+
+ scrollBarSize = parseInt( self._maxViewSize / self._clipSize, 10 );
+ if ( self._direction ) {
+ $scrollBar = self._hScrollBar.find( ".ui-scrollbar-thumb" );
+ attrName = "width";
+ currentSize = $scrollBar.width();
+ className = "ui-scrollbar-thumb-x";
+ self._hScrollBar.css( "width", self._clipSize );
+ } else {
+ $scrollBar = self._vScrollBar.find( ".ui-scrollbar-thumb" );
+ attrName = "height";
+ className = "ui-scrollbar-thumb-y";
+ currentSize = $scrollBar.height();
+ self._vScrollBar.css( "height", self._clipSize );
+ }
+
+ if ( scrollBarSize > currentSize ) {
+ $scrollBar.removeClass( className );
+ $scrollBar.css( attrName, scrollBarSize );
+ } else {
+ scrollBarSize = currentSize;
+ }
+
+ self._itemScrollSize = parseFloat( ( self._clipSize - scrollBarSize ) / ( self._totalRowCnt - self._rowsPerView ) );
+ self._itemScrollSize = Math.round( self._itemScrollSize * 100 ) / 100;
+ },
+
+ _setScrollBarPosition : function ( di, duration ) {
+ var self = this,
+ $sbt = null,
+ x = "0px",
+ y = "0px",
+ translate;
+
+ if ( self.options.rotation ) {
+ return ;
+ }
+
+ self._currentItemCount = self._currentItemCount + di;
+ if ( self._vScrollBar ) {
+ $sbt = self._vScrollBar.find( ".ui-scrollbar-thumb" );
+ y = ( self._currentItemCount * self._itemScrollSize ) + "px";
+ } else {
+ $sbt = self._hScrollBar.find( ".ui-scrollbar-thumb" );
+ x = ( self._currentItemCount * self._itemScrollSize ) + "px";
+ }
+ self._setStyleTransform( $sbt, x, y, duration );
+ },
+
+ _hideScrollBars : function () {
+ var self = this,
+ vclass = "ui-scrollbar-visible";
+
+ if ( self.options.rotation ) {
+ return ;
+ }
+
+ if ( self._vScrollBar ) {
+ self._vScrollBar.removeClass( vclass );
+ } else {
+ self._hScrollBar.removeClass( vclass );
+ }
+ },
+
+ _showScrollBars : function () {
+ var self = this,
+ vclass = "ui-scrollbar-visible";
+
+ if ( self.options.rotation ) {
+ return ;
+ }
+
+ if ( self._vScrollBar ) {
+ self._vScrollBar.addClass( vclass );
+ } else {
+ self._hScrollBar.addClass( vclass );
+ }
+ },
+
+ //----------------------------------------------------//
+ // scroll process //
+ //----------------------------------------------------//
+ centerTo: function ( selector ) {
+ var self = this,
+ i,
+ newX = 0,
+ newY = 0;
+
+ if ( !self.options.rotation ) {
+ return;
+ }
+
+ for ( i = 0; i < self._$rows.length; i++ ) {
+ if ( $( self._$rows[i] ).hasClass( selector ) ) {
+ if ( self._direction ) {
+ newX = -( i * self._cellSize - self._clipSize / 2 + self._cellSize * 2 );
+ } else {
+ newY = -( i * self._cellSize - self._clipSize / 2 + self._cellSize * 2 );
+ }
+ self.scrollTo( newX, newY );
+ return;
+ }
+ }
+ },
+
+ scrollTo: function ( x, y, duration ) {
+ var self = this;
+ if ( self._direction ) {
+ x -= self._cellSize;
+ self._sx = self._reservedPos;
+ self._reservedPos = x;
+ } else {
+ y -= self._cellSize;
+ self._sy = self._reservedPos;
+ self._reservedPos = y;
+ }
+ self._scrollView.scrollTo.apply( this, [ x, y, duration ] );
+ },
+
+ getScrollPosition: function () {
+ if ( this.direction ) {
+ return { x: -this._ry, y: 0 };
+ }
+ return { x: 0, y: -this._ry };
+ },
+
+ _setScrollPosition: function ( x, y ) {
+ var self = this,
+ sy = self._scalableSize,
+ distance = self._direction ? x : y,
+ dy = distance - sy,
+ di = parseInt( dy / self._cellSize, 10 ),
+ i = 0,
+ idx = 0,
+ replaceStartIdx = 0,
+ realRowCount = self._rowsPerView + 2,
+ rawView = self._$view[0];
+
+ if ( self._blockScroll ) {
+ if ( dy > 0 && distance >= -self._cellSize && self._scalableSize >= -self._cellSize ) {
+ self._overflowDir = _OVERFLOW_DIR_UP;
+ }
+ if ( dy < 0 && self._scalableSize <= -( self._maxSizeExceptClip + self._cellSize ) ) {
+ self._overflowDir = _OVERFLOW_DIR_DOWN;
+ }
+ return;
+ }
+
+ if ( ! self.options.rotation ) {
+ if ( dy > 0 && distance >= -self._cellSize && self._scalableSize >= -self._cellSize ) {
+ // top
+ self._stopMScroll();
+ self._scalableSize = -self._cellSize;
+ self._setElementTransform( -self._cellSize );
+ if ( self._overflowDir === _OVERFLOW_DIR_NONE ) {
+ self._overflowDir = _OVERFLOW_DIR_UP;
+ }
+ return;
+ }
+ if ( dy < 0 && self._scalableSize <= -( self._maxSizeExceptClip + self._cellSize ) ) {
+ // bottom
+ self._stopMScroll();
+ self._scalableSize = -( self._maxSizeExceptClip + self._cellSize );
+ self._setElementTransform( self._modifyViewPos );
+ if ( self._overflowDir === _OVERFLOW_DIR_NONE ) {
+ self._overflowDir = _OVERFLOW_DIR_DOWN;
+ }
+ return;
+ }
+ }
+
+ replaceStartIdx = ( Math.abs( di ) < realRowCount ) ? 0 : ( di > 0 ) ? di - realRowCount : di + realRowCount;
+ if ( di > 0 ) { // scroll up
+ for ( i = replaceStartIdx; i < di; i++ ) {
+ idx = -parseInt( ( sy / self._cellSize ) + i + 3, 10 );
+ self._replaceRow( rawView.lastChild, circularNum( idx, self._totalRowCnt ) );
+ rawView.insertBefore( rawView.lastChild, rawView.firstChild );
+ }
+ } else if ( di < 0 ) { // scroll down
+ for ( i = replaceStartIdx; i > di; i-- ) {
+ idx = self._rowsPerView - parseInt( ( sy / self._cellSize ) + i, 10 );
+ self._replaceRow( rawView.firstChild, circularNum( idx, self._totalRowCnt ) );
+ rawView.insertBefore( rawView.firstChild, rawView.lastChild.nextSibling );
+ }
+ }
+ self._setScrollBarPosition( -di );
+ self._scalableSize += di * self._cellSize;
+ self._setElementTransform( distance - self._scalableSize - self._cellSize );
+ },
+
+ _setElementTransform : function ( value ) {
+ var self = this,
+ x = 0,
+ y = 0;
+
+ if ( self._direction ) {
+ x = value + "px";
+ } else {
+ y = value + "px";
+ }
+ self._setStyleTransform( self._$view, x, y );
+ },
+
+ //----------------------------------------------------//
+ // Event handler //
+ //----------------------------------------------------//
+ _handleMomentumScroll: function () {
+ var self = this,
+ opts = self.options,
+ keepGoing = false,
+ v = this._$view,
+ x = 0,
+ y = 0,
+ t = self._tracker;
+
+ if ( t ) {
+ t.update();
+ if ( self._direction ) {
+ x = t.getPosition();
+ } else {
+ y = t.getPosition();
+ }
+ keepGoing = !t.done();
+ }
+
+ self._setScrollPosition( x, y );
+ if ( !opts.rotation ) {
+ keepGoing = !t.done();
+ self._reservedPos = self._direction ? x : y;
+ // bottom
+ self._reservedPos = self._reservedPos <= (-(self._maxSizeExceptClip - self._modifyViewPos)) ? ( - ( self._maxSizeExceptClip + self._cellSize) ) : self._reservedPos;
+ // top
+ self._reservedPos = self._reservedPos > -self._cellSize ? -self._cellSize : self._reservedPos;
+ } else {
+ self._reservedPos = self._direction ? x : y;
+ }
+ self._$clip.trigger( self.options.updateEventName, [ { x: x, y: y } ] );
+
+ if ( keepGoing ) {
+ self._timerID = setTimeout( self._timerCB, self._timerInterval );
+ } else {
+ self._stopMScroll();
+ }
+ },
+
+ _startMScroll: function ( speedX, speedY ) {
+ var self = this;
+ if ( self._direction ) {
+ self._sx = self._reservedPos;
+ } else {
+ self._sy = self._reservedPos;
+ }
+ self._scrollView._startMScroll.apply( self, [ speedX, speedY ] );
+ },
+
+ _stopMScroll: function () {
+ this._scrollView._stopMScroll.apply( this );
+ },
+
+ _enableTracking: function () {
+ var self = this;
+ self._$view.bind( self._dragMoveEvt, self._dragMoveCB );
+ self._$view.bind( self._dragStopEvt, self._dragStopCB );
+ self._scrollView._enableTracking.apply( self );
+ },
+
+ _disableTracking: function () {
+ var self = this;
+ self._$view.unbind( self._dragMoveEvt, self._dragMoveCB );
+ self._$view.unbind( self._dragStopEvt, self._dragStopCB );
+ self._scrollView._disableTracking.apply( self );
+ },
+
+ _handleDragStart: function ( e, ex, ey ) {
+ var self = this;
+ self._scrollView._handleDragStart.apply( this, [ e, ex, ey ] );
+ self._eventPos = self._direction ? ex : ey;
+ self._nextPos = self._reservedPos;
+ },
+
+ _handleDragMove: function ( e, ex, ey ) {
+ var self = this,
+ dx = ex - self._lastX,
+ dy = ey - self._lastY,
+ x = 0,
+ y = 0,
+ diffFromStartPos = 0,
+ diffFromLastPos = 0,
+ opacity = 0,
+ overflowPos = 0,
+ overFlowTarget = null;
+
+ self._lastMove = getCurrentTime();
+ self._speedX = dx;
+ self._speedY = dy;
+
+ self._didDrag = true;
+
+ self._lastX = ex;
+ self._lastY = ey;
+
+ if ( self._direction ) {
+ self._movePos = ex - self._eventPos;
+ x = self._nextPos + self._movePos;
+ overflowPos = ex;
+ } else {
+ self._movePos = ey - self._eventPos;
+ y = self._nextPos + self._movePos;
+ overflowPos = ey;
+ }
+ self._showScrollBars();
+ self._setScrollPosition( x, y );
+ if ( self._overflowDir !== _OVERFLOW_DIR_NONE ) {
+ overFlowTarget = ( self._overflowDir === _OVERFLOW_DIR_UP ) ? self._overflowTop : self._overflowBottom;
+ if ( !self._overflowDisplayed ) {
+ self._overflowDisplayed = true;
+ self._overflowStartPos = overflowPos;
+ }
+ diffFromStartPos = ( overflowPos - self._overflowStartPos ) * self._overflowDir;
+ opacity = ( diffFromStartPos < 0 ) ?
+ 0 : ( diffFromStartPos > self._overflowMaxDragDist ) ?
+ 1 : ( diffFromStartPos / self._overflowMaxDragDist );
+ overFlowTarget.css( "opacity", opacity );
+ }
+
+ return false;
+ },
+
+ _handleDragStop: function ( e ) {
+ var self = this;
+
+ self._reservedPos = self._movePos ? self._nextPos + self._movePos : self._reservedPos;
+ self._scrollView._handleDragStop.apply( this, [ e ] );
+ if ( self._overflowDir !== _OVERFLOW_DIR_NONE ) {
+ self._overflowDir = _OVERFLOW_DIR_NONE;
+ self._hideVGOverflowIndicator();
+ }
+ return self._didDrag ? false : undefined;
+ },
+
+ _addBehaviors: function () {
+ var self = this;
+
+ // scroll event handler.
+ if ( self.options.eventType === "mouse" ) {
+ self._dragStartEvt = "mousedown";
+ self._dragStartCB = function ( e ) {
+ return self._handleDragStart( e, e.clientX, e.clientY );
+ };
+
+ self._dragMoveEvt = "mousemove";
+ self._dragMoveCB = function ( e ) {
+ return self._handleDragMove( e, e.clientX, e.clientY );
+ };
+
+ self._dragStopEvt = "mouseup";
+ self._dragStopCB = function ( e ) {
+ return self._handleDragStop( e, e.clientX, e.clientY );
+ };
+
+ self._$view.bind( "vclick", function ( e ) {
+ return !self._didDrag;
+ } );
+ } else { //touch
+ self._dragStartEvt = "touchstart";
+ self._dragStartCB = function ( e ) {
+ var t = e.originalEvent.targetTouches[0];
+ return self._handleDragStart( e, t.pageX, t.pageY );
+ };
+
+ self._dragMoveEvt = "touchmove";
+ self._dragMoveCB = function ( e ) {
+ var t = e.originalEvent.targetTouches[0];
+ return self._handleDragMove( e, t.pageX, t.pageY );
+ };
+
+ self._dragStopEvt = "touchend";
+ self._dragStopCB = function ( e ) {
+ return self._handleDragStop( e );
+ };
+ }
+ self._$view.bind( self._dragStartEvt, self._dragStartCB );
+
+ // other events.
+ self._$view.delegate( ".virtualgrid-item", "click", function ( event ) {
+ var $selectedItem = $( this );
+ $selectedItem.trigger( "select", this );
+ } );
+
+ $( window ).bind( "resize", function ( e ) {
+ var height = 0,
+ $virtualgrid = $( ".ui-virtualgrid-view" );
+ if ( $virtualgrid.length !== 0 ) {
+ if ( self._direction ) {
+ height = self._calculateClipHeight();
+ self._$view.height( height );
+ self._$clip.height( height );
+ } else {
+ height = self._calculateClipWidth();
+ self._$view.width( height );
+ self._$clip.width( height );
+ }
+ self.resize();
+ }
+ } );
+
+ $( document ).one( "pageshow", function ( event ) {
+ var $page = $( self.element ).parents( ".ui-page" ),
+ $header = $page.find( ":jqmData(role='header')" ),
+ $footer = $page.find( ":jqmData(role='footer')" ),
+ $content = $page.find( ":jqmData(role='content')" ),
+ footerHeight = $footer ? $footer.height() : 0,
+ headerHeight = $header ? $header.height() : 0;
+
+ if ( $page && $content ) {
+ $content.height( window.innerHeight - headerHeight - footerHeight ).css( "overflow", "hidden" );
+ $content.addClass( "ui-virtualgrid-content" );
+ }
+ } );
+ },
+
+ //----------------------------------------------------//
+ // Calculate size about dom element. //
+ //----------------------------------------------------//
+ _calculateClipSize : function () {
+ var self = this,
+ clipSize = 0;
+
+ if ( self._direction ) {
+ clipSize = self._calculateClipWidth();
+ } else {
+ clipSize = self._calculateClipHeight();
+ }
+ return clipSize;
+ },
+
+ _calculateClipWidth : function () {
+ var self = this,
+ $parent = self._$clip.parent(),
+ paddingValue = 0,
+ clipSize = $( window ).width();
+
+ if ( self._inheritedSize.isDefinedWidth ) {
+ return self._inheritedSize.width;
+ }
+
+ if ( $parent.hasClass( "ui-content" ) ) {
+ paddingValue = parseInt( $parent.css( "padding-left" ), 10 );
+ clipSize = clipSize - ( paddingValue || 0 );
+ paddingValue = parseInt( $parent.css( "padding-right" ), 10 );
+ clipSize = clipSize - ( paddingValue || 0 );
+ } else {
+ clipSize = self._$clip.width();
+ }
+ return clipSize;
+ },
+
+ _calculateClipHeight : function () {
+ var self = this,
+ $parent = self._$clip.parent(),
+ header = null,
+ footer = null,
+ paddingValue = 0,
+ clipSize = $( window ).height();
+
+ if ( self._inheritedSize.isDefinedHeight ) {
+ return self._inheritedSize.height;
+ }
+
+ if ( $parent.hasClass( "ui-content" ) ) {
+ paddingValue = parseInt( $parent.css( "padding-top" ), 10 );
+ clipSize = clipSize - ( paddingValue || 0 );
+ paddingValue = parseInt( $parent.css( "padding-bottom" ), 10 );
+ clipSize = clipSize - ( paddingValue || 0 );
+ header = $parent.siblings( ".ui-header" );
+ footer = $parent.siblings( ".ui-footer" );
+
+ if ( header ) {
+ if ( header.outerHeight( true ) === null ) {
+ clipSize = clipSize - ( $( ".ui-header" ).outerHeight() || 0 );
+ } else {
+ clipSize = clipSize - header.outerHeight( true );
+ }
+ }
+ if ( footer ) {
+ clipSize = clipSize - footer.outerHeight( true );
+ }
+ } else {
+ clipSize = self._$clip.height();
+ }
+ return clipSize;
+ },
+
+ _calculateColumnSize : function () {
+ var self = this,
+ $tempBlock,
+ $cell;
+
+ $tempBlock = $( self._makeRows( 1 ) );
+ self._$view.append( $tempBlock.children().first() );
+ if ( self._direction ) {
+ // x-axis
+ self._viewSize = self._$view.width();
+ $cell = self._$view.children().first().children().first();
+ self._cellSize = $cell.outerWidth( true );
+ self._cellOtherSize = $cell.outerHeight( true );
+ } else {
+ // y-axis
+ self._viewSize = self._$view.height();
+ $cell = self._$view.children().first().children().first();
+ self._cellSize = $cell.outerHeight( true );
+ self._cellOtherSize = $cell.outerWidth( true );
+ }
+ $tempBlock.remove();
+ self._$view.children().remove();
+ },
+
+ _calculateColumnCount : function ( ) {
+ var self = this,
+ $view = self._$clip,
+ viewSize = self._direction ? $view.innerHeight() : $view.innerWidth(),
+ itemCount = 0 ;
+
+ if ( self._direction ) {
+ viewSize = viewSize - ( parseInt( $view.css( "padding-top" ), 10 ) + parseInt( $view.css( "padding-bottom" ), 10 ) );
+ } else {
+ viewSize = viewSize - ( parseInt( $view.css( "padding-left" ), 10 ) + parseInt( $view.css( "padding-right" ), 10 ) );
+ }
+
+ itemCount = parseInt( ( viewSize / self._cellOtherSize ), 10 );
+ return itemCount > 0 ? itemCount : 1 ;
+ },
+
+ // Read the position of clip form property ('webkit-transform').
+ // @return : number - position of clip.
+ _getClipPosition : function () {
+ var self = this,
+ matrix = null,
+ contents = null,
+ result = -self._cellSize,
+ $scrollview = self._$view.closest( ".ui-scrollview-view" );
+
+ if ( $scrollview ) {
+ matrix = $scrollview.css( "-webkit-transform" );
+ contents = matrix.substr( 7 );
+ contents = contents.substr( 0, contents.length - 1 );
+ contents = contents.split( ', ' );
+ result = Math.abs( contents [5] );
+ }
+ return result;
+ },
+
+ //----------------------------------------------------//
+ // DOM Element handle //
+ //----------------------------------------------------//
+ _makeRows : function ( count ) {
+ var self = this,
+ index = 0,
+ row = null,
+ wrapper = null;
+
+ wrapper = self._createElement( "div" );
+ wrapper.setAttribute( "class", "ui-scrollview-view" );
+ for ( index = 0; index < count ; index += 1 ) {
+ row = self._makeRow( index );
+ if ( self._direction ) {
+ row.style.top = 0;
+ row.style.left = index * self._cellSize;
+ }
+ wrapper.appendChild( row );
+ }
+ return wrapper;
+ },
+
+ // make a single row block
+ _makeRow : function ( rowIndex ) {
+ var self = this,
+ index = rowIndex * self._itemCount,
+ colIndex = 0,
+ blockClassName = self._direction ? "ui-virtualgrid-wrapblock-x" : "ui-virtualgrid-wrapblock-y",
+ wrapBlock = self._createElement( "div" ),
+ strWrapInner = "",
+ attrName = self._direction ? "top" : "left";
+
+ for ( colIndex = 0; colIndex < self._itemCount; colIndex++ ) {
+ strWrapInner += self._makeHtmlData( index, colIndex, attrName );
+ index += 1;
+ }
+ wrapBlock.innerHTML = strWrapInner;
+ wrapBlock.setAttribute( "class", blockClassName );
+ wrapBlock.setAttribute( "row-index", String( rowIndex ) );
+ self._fragment.appendChild( wrapBlock );
+ return wrapBlock;
+ },
+
+ _makeHtmlData : function ( dataIndex, colIndex, attrName ) {
+ var self = this,
+ htmlStr = "",
+ itemData = null;
+
+ itemData = self._itemData( dataIndex );
+ if ( itemData ) {
+ htmlStr = self._getConvertedTmplStr( itemData );
+ htmlStr = self._insertPosToTmplStr( htmlStr, attrName, ( colIndex * self._cellOtherSize ) );
+ }
+ return htmlStr;
+ },
+
+ _insertPosToTmplStr : function ( tmplStr, attrName, posVal ) {
+ var tagCloseIdx = tmplStr.indexOf( '>' ),
+ classIdx = -1,
+ firstPart,
+ lastPart,
+ result,
+ found = false,
+ targetIdx = 0,
+ firstPartLen,
+ i = 0;
+
+ if ( tagCloseIdx === -1 ) {
+ return;
+ }
+
+ firstPart = tmplStr.slice( 0, tagCloseIdx );
+ lastPart = tmplStr.slice( tagCloseIdx, tmplStr.length );
+
+ classIdx = firstPart.indexOf( 'class' );
+
+ if ( classIdx !== -1 ) {
+ firstPartLen = firstPart.length;
+ for ( i = classIdx + 6; i < firstPartLen; i++ ) {
+ if ( firstPart.charAt( i ) === "\"" || firstPart.charAt( i ) === "\'" ) {
+ if ( found === false ) {
+ found = true;
+ } else {
+ targetIdx = i;
+ break;
+ }
+ }
+ }
+ result = firstPart.slice( 0, targetIdx ) + " virtualgrid-item" + firstPart.slice( targetIdx, firstPartLen ) + lastPart;
+ } else {
+ result = firstPart + " class=\"virtualgrid-item\"" + lastPart;
+ }
+
+ if ( !isNaN( posVal ) ) {
+ result = result.replace( '>', " style=\"" + attrName + ": " + String( posVal ) + "px\">");
+ }
+
+ return result;
+ },
+
+ _increaseRow : function ( num ) {
+ var self = this,
+ rotation = self.options.rotation,
+ $row = null,
+ headItemIndex = 0,
+ tailItemIndex = 0,
+ itemIndex = 0,
+ size = self._scalableSize,
+ idx = 0;
+
+ headItemIndex = parseInt( $( self._$view.children().first() ).attr( "row-index" ), 10 ) - 1;
+ tailItemIndex = parseInt( $( self._$view.children()[self._rowsPerView] ).attr( "row-index" ), 10 ) + 1;
+
+ for ( idx = 1 ; idx <= num ; idx++ ) {
+ if ( tailItemIndex + idx >= self._totalRowCnt ) {
+ $row = $( self._makeRow( headItemIndex ) );
+ self._$view.prepend( $row );
+ headItemIndex -= 1;
+ } else {
+ $row = $( self._makeRow( tailItemIndex + idx ) );
+ self._$view.append( $row );
+ }
+ if ( self._direction ) {
+ $row.width( self._cellSize );
+ } else {
+ $row.height( self._cellSize );
+ }
+ }
+ },
+
+ _decreaseRow : function ( num ) {
+ var self = this,
+ idx = 0;
+
+ for ( idx = 0 ; idx < num ; idx++ ) {
+ self._$view.children().last().remove();
+ }
+ },
+
+ _replaceRows : function ( curCnt, prevCnt, maxCnt, clipPosition ) {
+ var self = this,
+ $rows = self._$view.children(),
+ prevRowIndex = 0,
+ rowIndex = 0,
+ diffRowCnt = 0,
+ targetCnt = 1,
+ filterCondition = ( self._filterRatio * self._cellSize ) + self._cellSize,
+ idx = 0;
+
+ if ( filterCondition < clipPosition ) {
+ targetCnt += 1;
+ }
+
+ prevRowIndex = parseInt( $( $rows[targetCnt] ).attr( "row-index" ), 10 );
+ if ( prevRowIndex === 0 ) {
+ // only top.
+ rowIndex = maxCnt - targetCnt;
+ } else {
+ rowIndex = Math.round( ( prevRowIndex * prevCnt ) / curCnt );
+ if ( rowIndex + self._rowsPerView >= maxCnt ) {
+ // only bottom.
+ rowIndex = maxCnt - self._rowsPerView;
+ }
+ diffRowCnt = prevRowIndex - rowIndex;
+ rowIndex -= targetCnt;
+ }
+
+ for ( idx = 0 ; idx < $rows.length ; idx += 1 ) {
+ self._replaceRow( $rows[idx], circularNum( rowIndex, self._totalRowCnt ) );
+ rowIndex++;
+ }
+ return -diffRowCnt;
+ },
+
+ _replaceRow : function ( block, index ) {
+ var self = this,
+ tempBlocks = null;
+
+ while ( block.hasChildNodes() ) {
+ block.removeChild( block.lastChild );
+ }
+
+ tempBlocks = self._makeRow( index );
+ while ( tempBlocks.children.length ) {
+ block.appendChild( tempBlocks.children[0] );
+ }
+ tempBlocks.parentNode.removeChild( tempBlocks );
+ },
+
+ _createElement : function ( tag ) {
+ var element = document.createElement( tag );
+
+ this._fragment.appendChild( element );
+ return element;
+ },
+
+ _getObjectNames : function ( obj ) {
+ var properties = [],
+ name = "";
+
+ for ( name in obj ) {
+ properties.push( name );
+ }
+ this._properties = properties;
+ },
+
+ _getConvertedTmplStr : function ( data ) {
+ var self = this,
+ dataProperties = self._properties,
+ i = 0,
+ plainMsg,
+ ret = "";
+
+ if ( !data ) {
+ return ;
+ }
+
+ plainMsg = self._templateText;
+ for ( i = 0; i < dataProperties.length; i++ ) {
+ plainMsg = self._strReplace( plainMsg, "${" + dataProperties[ i ] + "}" , data[ dataProperties[ i ] ] );
+ }
+ plainMsg = self._changeImgSrcAriaAttrFromTmpl( plainMsg );
+
+ return plainMsg;
+ },
+
+ _changeImgSrcAriaAttrFromTmpl : function ( plainMsg ) {
+ var self = this,
+ ret = "",
+ targetTagIdx,
+ beforeTargetTag = "",
+ afterTargetTag = "",
+ imgFileName,
+ imgSrcSlashIdx,
+ temp,
+ srcRegExpResult;
+
+ temp = plainMsg;
+ targetTagIdx = temp.indexOf( "$ARIA-IMG-SRC-ALT$" );
+ while ( targetTagIdx !== -1 ) {
+ imgFileName = "";
+ beforeTargetTag = beforeTargetTag + temp.slice( 0, targetTagIdx + 19 );
+ afterTargetTag = temp.slice( targetTagIdx + 19, temp.length );
+ srcRegExpResult = afterTargetTag.match( imgTagSrcAttrRE );
+ if ( srcRegExpResult ) {
+ imgSrcSlashIdx = srcRegExpResult[0].lastIndexOf( "/" );
+ if ( imgSrcSlashIdx !== -1 ) {
+ imgFileName = srcRegExpResult[0].slice( imgSrcSlashIdx + 1, -1 );
+ }
+ }
+ beforeTargetTag = beforeTargetTag.replace( "$ARIA-IMG-SRC-ALT$", imgFileName );
+ temp = afterTargetTag;
+ targetTagIdx = temp.indexOf( "$ARIA-IMG-SRC-ALT$" );
+ ret = beforeTargetTag + afterTargetTag;
+ }
+
+ if ( ret === "" ) {
+ ret = plainMsg;
+ }
+
+ return ret;
+ },
+
+ _insertAriaAttrToTmpl : function ( plainMsg ) {
+ var ret = "",
+ targetTagIdx,
+ beforeTargetTag = "",
+ afterTargetTag = "",
+ temp;
+
+ temp = plainMsg.replace( "<div", "<div tabindex=\"0\" aria-selected=\"true\"" );
+ targetTagIdx = temp.indexOf( "<img" );
+ if ( targetTagIdx !== -1 ) {
+ while ( targetTagIdx !== -1 ) {
+ beforeTargetTag = beforeTargetTag + temp.slice( 0, targetTagIdx + 4 );
+ afterTargetTag = temp.slice( targetTagIdx + 4, temp.length );
+ beforeTargetTag = beforeTargetTag + " role=\"img\" alt=\"$ARIA-IMG-SRC-ALT$\"";
+ temp = afterTargetTag;
+ targetTagIdx = temp.indexOf( "<img" );
+ ret = beforeTargetTag + afterTargetTag;
+ }
+ temp = ret;
+ targetTagIdx = temp.indexOf( "<span" );
+ beforeTargetTag = "";
+ while ( targetTagIdx !== -1 ) {
+ beforeTargetTag = beforeTargetTag + temp.slice( 0, targetTagIdx + 5 );
+ afterTargetTag = temp.slice( targetTagIdx + 5, temp.length );
+ beforeTargetTag = beforeTargetTag + " aria-hidden=\"true\" tabindex=\"-1\"";
+ temp = afterTargetTag;
+ targetTagIdx = temp.indexOf( "<span" );
+ ret = beforeTargetTag + afterTargetTag;
+ }
+ }
+
+ if ( ret === "" ) {
+ ret = plainMsg;
+ }
+
+ return ret;
+ },
+
+ _strReplace : function ( plainMsg, stringToFind, stringToReplace ) {
+ var temp = plainMsg,
+ index = plainMsg.indexOf( stringToFind );
+ while ( index !== -1 ) {
+ temp = temp.replace( stringToFind, stringToReplace );
+ index = temp.indexOf( stringToFind );
+ }
+ return temp;
+ }
+
+ } );
+
+ $( document ).bind( "pagecreate create", function ( e ) {
+ $( ":jqmData(role='virtualgrid')" ).virtualgrid();
+ } );
+} ( jQuery, window, document ) );
+
--- /dev/null
+
+/* ***************************************************************************
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * ***************************************************************************
+ *
+ * Author: Wongi Lee <wongi11.lee@samsung.com>
+ * Youmin Ha <youmin.ha@samsung.com>
+ */
+
+/**
+ * Virtual List Widget for unlimited data.
+ * To support more then 1,000 items, special list widget developed.
+ * Fast initialize and light DOM tree.
+ * DB connection and works like DB cursor.
+ *
+ * HTML Attributes:
+ *
+ * data-role: virtuallistview
+ * data-template : jQuery.template ID that populate into virtual list
+ * data-row : Optional. Set number of <li> elements that are used for data handling.
+ *
+ * ID : <UL> element that has "data-role=virtuallist" must have ID attribute.
+ *
+ * * APIs:
+ *
+ * create ( {
+ * itemData: function ( idx ) { return json_obj; },
+ * numItemData: number or function () { return number; },
+ * cacheItemData: function ( minIdx, maxIdx ) {}
+ * } )
+ * : Create a virtuallist widget. At this moment, _create method is called.
+ * args : A collection of options
+ * itemData: A function that returns JSON object for given index. Mandatory.
+ * numItemData: Total number of itemData. Mandatory.
+ * cacheItemData: Virtuallist will ask itemData between minIdx and maxIdx.
+ * Developers can implement this function for preparing data.
+ * Optional.
+ *
+ * Events:
+ *
+ * touchstart : Temporary preventDefault applied on touchstart event to avoid broken screen.
+ *
+ * Examples:
+ *
+ * <script id="tmp-3-2-7" type="text/x-jquery-tmpl">
+ * <li class="ui-li-3-2-7">
+ * <span class="ui-li-text-main">${NAME}</span>
+ * <img src="00_winset_icon_favorite_on.png" class="ui-li-icon-sub">
+ * <span class="ui-li-text-sub">${ACTIVE}</span>
+ * <span class="ui-li-text-sub2">${FROM}</span>
+ * </li>
+ * </script>
+ *
+ * <ul id="virtuallist-normal_3_2_7_ul" data-role="virtuallistview" data-template="tmp-3-2-7" data-dbtable="JSON_DATA" data-row="100">
+ * </ul>
+ *
+ */
+
+/**
+ @class VirtualList
+ In the Web environment, it is challenging to display a large amount of data in a list, such as displaying a contact list of over 1000 list items. It takes time to display the entire list in HTML and the DOM manipulation is complex.
+
+ The virtual list widget is used to display a list of unlimited data elements on the screen for better performance. This widget provides easy access to databases to retrieve and display data. Virtual lists are based on the jQuery.template plugin as described in the jQuery documentation for jQuery.template plugin.
+
+ To add a virtual list widget to the application, use the following code:
+
+ <script id="tmp-3-2-7" type="text/x-jquery-tmpl">
+ <li class="ui-li-3-2-7">
+ <span class="ui-li-text-main">${NAME}</span>
+ <img src="00_winset_icon_favorite_on.png" class="ui-li-icon-sub"/>
+ <span class="ui-li-text-sub">${ACTIVE}</span>
+ <span class="ui-li-text-sub2">${FROM}</span>
+ </li>
+ </script>
+ <ul id="vlist" data-role="virtuallistview" data-template="tmp-3-2-7" data-dbtable="JSON_DATA" data-row="100"></ul>
+*/
+/**
+ @property {String} data-role
+ Creates the virtual list view. The value must be set to virtuallistview.
+ Only the >ul< element, which a id attribute defined, supports this option. Also, the vlLoadSuccess class attribute must be defined in the >ul< element to ensure that loading data from the database is complete.
+*/
+/**
+ @property {String} data-template
+ Defines the jQuery.template element ID.
+ The jQuery.template must be defined. The template style can use rem units to support scalability.
+*/
+/**
+ @property {Number} data-row
+ Defines the number of virtual list child elements.
+ The minimum value is 20 and the default value is 100. As the value gets higher, the loading time increases while the system performance improves. So you need to pick a value that provides the best performance without excessive loading time.
+*/
+/**
+ @method create
+ @param {function} itemData(index)
+ : function itemData(index) returns the JSON object matched with the given index. The index value is between 0 and numItemData-1.
+ @param {Number} numItemData
+ : number numItemData or function numItemData() defines or returns a static number of items.
+ @param {function} cacheItemData(minIndex, maxIndex)
+ : function cacheItemData(minIndex, maxIndex) prepares the JSON data. This method is called before calling the itemData() method with index values between minIndex and maxIndex.
+*/
+
+(function ( $, undefined ) {
+
+ /* Code for Virtual List Demo */
+ var listCountPerPage = {}, /* Keeps track of the number of lists per page UID. This allows support for multiple nested list in the same page. https://github.com/jquery/jquery-mobile/issues/1617 */
+ _NO_SCROLL = 0, /* ENUM */
+ _SCROLL_DOWN = 1, /* ENUM */
+ _SCROLL_UP = -1; /* ENUM */
+
+ $.widget( "tizen.virtuallistview", $.mobile.widget, {
+ options: {
+ theme: "s",
+ countTheme: "s",
+ headerTheme: "s",
+ dividerTheme: "s",
+ splitIcon: "arrow-r",
+ splitTheme: "s",
+ inset: false,
+ id: "", /* Virtual list UL elemet's ID */
+ childSelector: " li", /* To support swipe list */
+ dbtable: "",
+ template : "",
+ dbkey: false, /* Data's unique Key */
+ scrollview: false,
+ row: 100,
+ page_buf: 30,
+ initSelector: ":jqmData(role='virtuallistview')"
+ },
+
+ _stylerMouseUp: function () {
+ $( this ).addClass( "ui-btn-up-s" );
+ $( this ).removeClass( "ui-btn-down-s" );
+ },
+
+ _stylerMouseDown: function () {
+ $( this ).addClass( "ui-btn-down-s" );
+ $( this ).removeClass( "ui-btn-up-s" );
+ },
+
+ _stylerMouseOver: function () {
+ $( this ).toggleClass( "ui-btn-hover-s" );
+ },
+
+ _stylerMouseOut: function () {
+ $( this ).toggleClass( "ui-btn-hover-s" );
+ $( this ).addClass( "ui-btn-up-s" );
+ $( this ).removeClass( "ui-btn-down-s" );
+ },
+
+ // ?
+ // this virtuallistview object
+ // @param[in] template template name(string)
+ _pushData: function ( template ) {
+ var o = this.options,
+ i,
+ myTemplate = $( "#" + template ), // Get template object
+ // NOTE: o.row = # of rows handled at once. Default value is 100.
+ lastIndex = ( o.row > this._numItemData ? this._numItemData : o.row ), // last index of handled data
+ htmlData;
+
+ for ( i = 0; i < lastIndex; i++ ) {
+ htmlData = myTemplate.tmpl( this._itemData( i ) ); // Make rows with template,
+ $( o.id ).append( $( htmlData ).attr( 'id', o.itemIDPrefix + i ) ); // and append it to the vlist object
+ }
+
+ // After pushing data re-style virtuallist widget
+ $( o.id ).trigger( "create" );
+ },
+
+ // Set children <li> elements' position
+ //
+ // this: virtuallist element
+ // event: virtuallistview.options
+ // TODO: Why this arg name is 'event'? Not resonable.
+ // (this function is not called with event element as args!)
+ _reposition: function ( event ) {
+ var o,
+ t = this,
+ padding,
+ margin;
+
+ if ( event.data ) {
+ o = event.data;
+ } else {
+ o = event;
+ }
+ if ( $( o.id + o.childSelector ).size() > 0 ) { // $("#vlistid li")
+ // first child's top position
+ // NOTE: the first element may not be '0'!!!
+ t._title_h = $( o.id + o.childSelector + ':first' ).position().top;
+ // first child's outer height (TODO: reuse selected items)
+ t._line_h = $( o.id + o.childSelector + ':first' ).outerHeight();
+
+ // container(vlist element)'s innerwidth
+ t._container_w = $( o.id ).innerWidth();
+
+ // get sum of container's left/right padding
+ padding = parseInt( $( o.id + o.childSelector ).css( "padding-left" ), 10 )
+ + parseInt( $( o.id + o.childSelector ).css( "padding-right" ), 10 );
+
+ // Add CSS to all <li> elements
+ // * absolute position
+ // * btn-up
+ // * mouse up/down/over/out styles
+ $( o.id + ">" + o.childSelector )
+ .addClass( "position_absolute" )
+ .addClass( "ui-btn-up-s" )
+ .bind( "mouseup", t._stylerMouseUp )
+ .bind( "mousedown", t._stylerMouseDown )
+ .bind( "mouseover", t._stylerMouseOver )
+ .bind( "mouseout", t._stylerMouseOut );
+ }
+
+ // Set absolute top/left position of each <li>
+ $( o.id + ">" + o.childSelector ).each( function ( index ) {
+ margin = parseInt( $( this ).css( "margin-left" ), 10 )
+ + parseInt( $( this ).css( "margin-right" ), 10 );
+
+ $( this ).css( "top", t._title_h + t._line_h * index + 'px' )
+ .css( "width", t._container_w - padding - margin );
+ } );
+
+ // Set Max Listview Height
+ $( o.id ).height( t._numItemData * t._line_h );
+ },
+
+ _resize: function ( event ) {
+ var o,
+ t = this,
+ padding,
+ margin;
+
+ if ( event.data ) {
+ o = event.data;
+ } else {
+ o = event;
+ }
+
+ t._container_w = $( o.id ).innerWidth();
+
+ padding = parseInt( $( o.id + o.childSelector ).css( "padding-left" ), 10 )
+ + parseInt( $( o.id + o.childSelector ).css( "padding-right" ), 10 );
+
+ $( o.id + o.childSelector ).each( function (index) {
+ margin = parseInt( $( this ).css( "margin-left" ), 10 )
+ + parseInt( $( this ).css( "margin-right" ), 10 );
+ $( this ).css( "width", t._container_w - padding - margin );
+ } );
+ },
+
+ // New scrollmove function supporting scrollTo
+ _scrollmove: function ( ev ) {
+ var t = ev.data, // vlist (JQM object)
+ o = t.options, // options
+ prevTopBufLen = t._num_top_items, // Previous(remembered) top buf length
+ timerInterval = 100,
+ i,
+ _scrollView,
+ _normalScroll;
+
+ _scrollView = {
+ viewTop: function ( ) {
+ var sv = $( o.id ).parentsUntil( ".ui-page" ).find( ".ui-scrollview-view" ),
+ svTrans = sv.css( "-webkit-transform" ),
+ svTransVal = "0,0,0,0,0,0";
+ if ( svTrans ) {
+ svTransVal = svTrans.replace( /matrix\s*\((.*)\)/, "$1" ); // matrix(a,c,b,d,tx,ty)
+ }
+ return - parseInt( svTransVal.split(',')[5], 10 );
+ }
+ };
+ _normalScroll = {
+ viewTop: function ( ) {
+ return $( window ).scrollTop( ); // TODO: - _line_h?
+ }
+ };
+ // Get current view top position
+ function viewTop ( ) {
+ return o.scrollview ? _scrollView.viewTop() : _normalScroll.viewTop();
+ }
+ // log function for debug
+ function log ( msg ) {
+ var debug = false;
+ if ( debug ) {
+ console.log( ">>virtualllist: " + msg );
+ }
+ }
+
+ // Timer interval function
+ // @param[in] vl virtuallist object (JQM object)
+ function timerMove ( vl, undefined ) {
+ var cy, // current y position
+ cti, // current top idx
+ cbi, // current bottom idx
+ oti = vl._first_index, // old top idx
+ obi = vl._last_index, // old botton idx
+ dti, // delta of top idx
+ fromIdx,
+ toIdx, // index range to be moved
+ delta, // moveItem delta
+ rowLen = vl.options.row, // max. # of items handled at once
+ bufSize, // top/bottom buffer size. unit: # of items
+ i;
+
+ // subroutine: Move itemContents in i2 into i1
+ function moveItemContents( vl, i1, i2 ) {
+ // TODO: Find a efficient way to replace data!
+ // Assumption: i1 and i2 has same children.
+ var NODETYPE = { ELEMENT_NODE: 1, TEXT_NODE: 3 },
+ c1, // child item 1 (old)
+ c2, // child item 2 (new)
+ newText,
+ newImg,
+ i;
+
+ $( i1 ).find( ".ui-li-text-main", ".ui-li-text-sub", ".ui-li-text-sub2", "ui-btn-text" ).each( function ( index ) {
+ c1 = $( this );
+ newText = $( i2 ).find( ".ui-li-text-main", ".ui-li-text-sub", "ui-btn-text" ).eq( index ).text();
+
+ $( c1 ).contents().filter( function () {
+ return ( this.nodeType == NODETYPE.TEXT_NODE );
+ } ).get( 0 ).data = newText;
+ } );
+
+ $( i1 ).find( "img" ).each( function ( imgIdx ) {
+ var c1 = $( this );
+ newImg = $( i2 ).find( "img" ).eq( imgIdx ).attr( "src" );
+
+ $( c1 ).attr( "src", newImg );
+ } );
+
+ $( i1 ).removeData( ); // Clear old data
+ }
+
+ // subroutine: Move item
+ function moveItem( vl, fromIdx, toIdx ) {
+ var itemData, // data from itemData()
+ item, // item element
+ newItem, // new item element
+ tmpl; // template
+
+ log( ">> move item: " + fromIdx + " --> " + toIdx );
+
+ // Find current item
+ item = $( '#' + vl.options.itemIDPrefix + fromIdx ); // TODO: refactor ID generation!
+ if ( ! item || ! item.length ) {
+ return false;
+ }
+
+ // Get new item
+ tmpl = $( "#" + vl.options.template );
+ if ( tmpl ) {
+ newItem = tmpl.tmpl( vl._itemData( toIdx ) );
+
+ // TODO: Consider touch block while moving?
+
+ // Move item contents
+ moveItemContents( vl, item, newItem );
+
+ // clean up temporary item
+ newItem.remove();
+ }
+
+ // Move position, and set id
+ item.css( 'top', toIdx * vl._line_h )
+ .attr( 'id' , vl.options.itemIDPrefix + toIdx ); // TODO: refactor ID generation!
+
+ // TODO: Apply jqmdata? check following old code;
+ // $( oldItem ).removeData( ); // Clear old data
+ // if (key) { $( oldItem ).data( key, $( newItem ).data( key ) ); }
+
+ return true;
+ }
+
+
+ // Get current view position
+ cy = viewTop();
+
+ // Calculate bufSize: rowLen / 3
+ // NOTE: Assumption: total row length = visible items * 3 (upper+visible+lower)
+ bufSize = Math.ceil( rowLen / 3 );
+
+ // Calculate current top/bottom index (to be applied)
+ // top index = current position / line height
+ cti = Math.floor( cy / vl._line_h ) - bufSize; // TODO: consider buffer!
+ cbi = cti + rowLen - 1;
+
+ if ( cti < 0 ) { // Top boundary check
+ cbi += ( - cti );
+ cti = 0;
+ } else if ( cbi > ( vl._numItemData - 1 ) ) { // Bottom boundary check
+ cti -= ( cbi - ( vl._numItemData - 1 ) );
+ cbi = ( vl._numItemData - 1 );
+ }
+
+ // Calculate dti
+ dti = cti - oti;
+ log( "cy=" + cy + ", oti=" + oti + ", obi=" + obi + ", cti=" + cti + ", cbi=" + cbi + ", dti=" + dti );
+
+ // switch: dti = 0 --> timer stop condition: delta=0 or scrollstop event comes. END.
+ if ( 0 == dti ) {
+ // Check timer runtime
+ vl.timerStillCount += 1;
+ if ( vl.timerStillCount < 12 ) { // check count ( TODO: test and adjust )
+ log("dti=0 " + vl.timerStillCount + " times");
+ vl.timerMoveID = setTimeout( timerMove, timerInterval, vl ); // run once more
+ return;
+ }
+
+ log("dti=0 " + vl.timerStillCount + " times. End timer.");
+ vl.timerStillCount = 0;
+ // Stop timer
+ if ( vl.timerMoveID ) {
+ clearTimeout( vl.timerMoveID );
+ vl.timerMoveID = null;
+ }
+ } else {
+ // switch: dti >= # of max elements --> total replace.
+ vl.timerStillCount = 0; // Reset still counter
+
+ if ( Math.abs( dti ) >= rowLen ) {
+ fromIdx = oti;
+ toIdx = obi;
+ delta = dti;
+ log( ">>> WHOLE CHANGE! delta=" + delta );
+ } else {
+ // switch: dti < # of max elements --> move t2b or b2t until new top/bottom idx is covered
+ if ( dti > 0 ) {
+ fromIdx = oti;
+ toIdx = oti + dti - 1;
+ delta = rowLen;
+ } else {
+ fromIdx = obi + dti + 1; // dti < 0
+ toIdx = obi;
+ delta = -rowLen;
+ }
+ log( ">>> partial change. delta=" + delta );
+ }
+
+ // Move items
+ for ( i = fromIdx; i <= toIdx; i++ ) {
+ moveItem( vl, i, i + delta ); // Change data and position
+ }
+
+ // Store current top/bottom idx into vl
+ vl._first_index = cti;
+ vl._last_index = cbi;
+
+ // Register timer to check again
+ vl.timerMoveID = setTimeout( timerMove, timerInterval, vl );
+ }
+ return; // End of function
+ }
+
+ // ==== function start ====
+
+ t.timerStillCount = 0; // Count do-nothing time. For behavior tuning.
+
+ // If a timer function is alive, clear it
+ if ( t.timerMoveID ) {
+ clearTimeout( t.timerMoveID );
+ t.timerMoveID = null;
+ }
+ // run TimerMove()
+ timerMove( t );
+ },
+
+ _recreate: function ( newArray ) {
+ var t = this,
+ o = this.options;
+
+ $( o.id ).empty();
+
+ t._numItemData = newArray.length;
+ t._direction = _NO_SCROLL;
+ t._first_index = 0;
+ t._last_index = o.row - 1;
+
+ t._pushData( o.template );
+
+ if (o.childSelector == " ul" ) {
+ $( o.id + " ul" ).swipelist();
+ }
+
+ $( o.id ).virtuallistview();
+
+ t.refresh( true );
+
+ t._reposition( o );
+ },
+
+ // Init virtuallistview
+ // this virtuallistview object
+ _initList: function () {
+ var t = this,
+ o = this.options;
+
+ /* After AJAX loading success */
+
+ // Put initial <li> elements
+ t._pushData( o.template );
+
+ // find a parent page, and run _reposition() at 'pageshow' event
+ // TODO: Consider replace parentsUntil().parent() to parent('.ui-page') ???
+ $( o.id ).parentsUntil( ".ui-page" ).parent().one( "pageshow", function () {
+ setTimeout( function () {
+ t._reposition( o );
+ }, 0);
+ });
+
+ // Bind _scrollmove() at 'scrollstart.virtuallist' event
+ $( document ).bind( "scrollstart.virtuallist scrollstop.vrituallist", t, t._scrollmove );
+
+ // Bind _resize() at 'resize.virtuallist'
+ $( window ).bind( "resize.virtuallist", t._resize );
+
+ // when ul is a childselector, assume that this is also a swipelist,
+ // and run swipelist constructor
+ if ( o.childSelector == " ul" ) {
+ $( o.id + " ul" ).swipelist();
+ }
+
+ t.refresh( true );
+ },
+
+ create: function () {
+ var o = this.options;
+
+ /* external API for AJAX callback */
+ this._create.apply( this, arguments );
+
+ // TODO: remove this line? _initList() calls reposition...
+ this._reposition( o );
+ },
+
+ _create: function ( args ) {
+ // Extend instance variables
+ $.extend( this, {
+ _itemData : function ( idx ) { return null; },
+ _numItemData : 0,
+ _cacheItemData : function ( minIdx, maxIdx ) { },
+ _title_h : 0,
+ _container_w : 0,
+ _minimum_row : 100,
+ _direction : _NO_SCROLL,
+ _first_index : 0,
+ _last_index : 0,
+ _num_top_items : 0 // By scroll move, number of hidden elements.
+ } );
+
+ // local variables
+ var t = this,
+ o = this.options,
+ $el = this.element,
+ shortcutsContainer = $('<div class="ui-virtuallist"/>'),
+ shortcutsList = $('<ul></ul>'),
+ dividers = $el.find(':jqmData(role="virtuallistview" )'),
+ lastListItem = null,
+ shortcutscroll = this,
+ dbtable_name,
+ dbtable;
+
+
+ // Add CSS classes to $el (=virtuallistview)
+ $el.addClass( function ( i, orig ) {
+ return orig + " ui-listview ui-virtual-list-container" + ( t.options.inset ? " ui-listview-inset ui-corner-all ui-shadow " : "" );
+ });
+
+ // keep the vlist's ID
+ o.itemIDPrefix = $el.attr( "id" ) + '_';
+ o.id = "#" + $el.attr( "id" );
+
+ // when page hides, empty all child elements
+ $( o.id ).bind( "pagehide", function ( e ) {
+ $( o.id ).empty();
+ });
+
+ // Find if scrollview is used
+ if ( $( ".ui-scrollview-clip" ).size() > 0 ) {
+ o.scrollview = true;
+ } else {
+ o.scrollview = false;
+ }
+
+ // Calculate page buffer size
+ if ( $el.data( "row" ) ) {
+ o.row = $el.data( "row" );
+
+ if ( o.row < t._minimum_row ) {
+ o.row = t._minimum_row;
+ }
+
+ o.page_buf = parseInt( ( o.row / 2 ), 10 );
+ }
+
+ // Get arguments
+ if ( args ) {
+ if ( args.itemData && typeof args.itemData == 'function' ) {
+ t._itemData = args.itemData;
+ } else {
+ return;
+ }
+ if ( args.numItemData ) {
+ if ( typeof args.numItemData == 'function' ) {
+ t._numItemData = args.numItemData( );
+ } else if ( typeof args.numItemData == 'number' ) {
+ t._numItemData = args.numItemData;
+ } else {
+ return;
+ }
+ } else {
+ return;
+ }
+ } else { // No option is given
+ // Legacy support: dbtable
+ console.warn( "WARNING: The data interface of virtuallist is changed. \nOld data interface(data-dbtable) is still supported, but will be removed in next version. \nPlease fix your code soon!" );
+
+ /* After DB Load complete, Init Vritual list */
+ if ( $( o.id ).hasClass( "vlLoadSuccess" ) ) {
+ dbtable_name = $el.jqmData('dbtable');
+ dbtable = window[ dbtable_name ];
+
+ $( o.id ).empty();
+
+ if ( !dbtable ) {
+ dbtable = { };
+ }
+
+ t._itemData = function ( idx ) {
+ return dbtable[ idx ];
+ };
+ t._numItemData = dbtable.length;
+ } else {
+ return; // Do nothing
+ }
+ }
+
+ // Get template data
+ if ( $el.data( "template" ) ) {
+ o.template = $el.data( "template" );
+
+ /* to support swipe list, <li> or <ul> can be main node of virtual list. */
+ if ( $el.data( "swipelist" ) == true ) {
+ o.childSelector = " ul";
+ } else {
+ o.childSelector = " li";
+ }
+ }
+
+ // Set data's unique key
+ // NOTE: Unnecessary?
+ if ( $el.data( "dbkey" ) ) {
+ o.dbkey = $el.data( "dbkey" );
+ }
+
+ t._first_index = 0; // initial top idx of <li> element.
+ t._last_index = o.row - 1; // initial bottom idx of <li> element.
+ t._initList(); // NOTE: Called at here only!
+ },
+
+ destroy : function () {
+ var o = this.options;
+
+ $( document ).unbind( "scrollstop" );
+
+ $( window ).unbind( "resize.virtuallist" );
+
+ $( o.id ).empty();
+
+ if ( this.timerMoveID ) {
+ clearTimeout( this.timerMoveID );
+ this.timerMoveID = null;
+ }
+ },
+
+ _itemApply: function ( $list, item ) {
+ var $countli = item.find( ".ui-li-count" );
+
+ if ( $countli.length ) {
+ item.addClass( "ui-li-has-count" );
+ }
+
+ $countli.addClass( "ui-btn-up-" + ( $list.jqmData( "counttheme" ) || this.options.countTheme ) + " ui-btn-corner-all" );
+
+ // TODO class has to be defined in markup
+ item.find( "h1, h2, h3, h4, h5, h6" ).addClass( "ui-li-heading" ).end()
+ .find( "p, dl" ).addClass( "ui-li-desc" ).end()
+ .find( ">img:eq(0), .ui-link-inherit>img:eq(0)" ).addClass( "ui-li-thumb" ).each( function () {
+ item.addClass( $( this ).is( ".ui-li-icon" ) ? "ui-li-has-icon" : "ui-li-has-thumb" );
+ }).end()
+ .find( ".ui-li-aside" ).each(function () {
+ var $this = $( this );
+ $this.prependTo( $this.parent() ); //shift aside to front for css float
+ } );
+ },
+
+ _removeCorners: function ( li, which ) {
+ var top = "ui-corner-top ui-corner-tr ui-corner-tl",
+ bot = "ui-corner-bottom ui-corner-br ui-corner-bl";
+
+ li = li.add( li.find( ".ui-btn-inner, .ui-li-link-alt, .ui-li-thumb" ) );
+
+ if ( which === "top" ) {
+ li.removeClass( top );
+ } else if ( which === "bottom" ) {
+ li.removeClass( bot );
+ } else {
+ li.removeClass( top + " " + bot );
+ }
+ },
+
+ _refreshCorners: function ( create ) {
+ var $li,
+ $visibleli,
+ $topli,
+ $bottomli;
+
+ if ( this.options.inset ) {
+ $li = this.element.children( "li" );
+ // at create time the li are not visible yet so we need to rely on .ui-screen-hidden
+ $visibleli = create ? $li.not( ".ui-screen-hidden" ) : $li.filter( ":visible" );
+
+ this._removeCorners( $li );
+
+ // Select the first visible li element
+ $topli = $visibleli.first()
+ .addClass( "ui-corner-top" );
+
+ $topli.add( $topli.find( ".ui-btn-inner" ) )
+ .find( ".ui-li-link-alt" )
+ .addClass( "ui-corner-tr" )
+ .end()
+ .find( ".ui-li-thumb" )
+ .not( ".ui-li-icon" )
+ .addClass( "ui-corner-tl" );
+
+ // Select the last visible li element
+ $bottomli = $visibleli.last()
+ .addClass( "ui-corner-bottom" );
+
+ $bottomli.add( $bottomli.find( ".ui-btn-inner" ) )
+ .find( ".ui-li-link-alt" )
+ .addClass( "ui-corner-br" )
+ .end()
+ .find( ".ui-li-thumb" )
+ .not( ".ui-li-icon" )
+ .addClass( "ui-corner-bl" );
+ }
+ },
+
+ // this virtuallistview object
+ refresh: function ( create ) {
+ this.parentPage = this.element.closest( ".ui-page" );
+ // Make sub page, and move the virtuallist into it...
+ // NOTE: check this subroutine.
+ this._createSubPages();
+
+ var o = this.options,
+ $list = this.element,
+ self = this,
+ dividertheme = $list.jqmData( "dividertheme" ) || o.dividerTheme,
+ listsplittheme = $list.jqmData( "splittheme" ),
+ listspliticon = $list.jqmData( "spliticon" ),
+ li = $list.children( "li" ),
+ counter = $.support.cssPseudoElement || !$.nodeName( $list[ 0 ], "ol" ) ? 0 : 1,
+ item,
+ itemClass,
+ temTheme,
+ a,
+ last,
+ splittheme,
+ countParent,
+ icon,
+ pos,
+ numli,
+ itemTheme;
+
+ // TODO: ?
+ if ( counter ) {
+ $list.find( ".ui-li-dec" ).remove();
+ }
+
+ for ( pos = 0, numli = li.length; pos < numli; pos++ ) {
+ item = li.eq( pos );
+ itemClass = "ui-li";
+
+ // If we're creating the element, we update it regardless
+ if ( create || !item.hasClass( "ui-li" ) ) {
+ itemTheme = item.jqmData( "theme" ) || o.theme;
+ a = item.children( "a" );
+
+ if ( a.length ) {
+ icon = item.jqmData( "icon" );
+
+ item.buttonMarkup({
+ wrapperEls: "div",
+ shadow: false,
+ corners: false,
+ iconpos: "right",
+ /* icon: a.length > 1 || icon === false ? false : icon || "arrow-r",*/
+ icon: false, /* Remove unnecessary arrow icon */
+ theme: itemTheme
+ });
+
+ if ( ( icon != false ) && ( a.length == 1 ) ) {
+ item.addClass( "ui-li-has-arrow" );
+ }
+
+ a.first().addClass( "ui-link-inherit" );
+
+ if ( a.length > 1 ) {
+ itemClass += " ui-li-has-alt";
+
+ last = a.last();
+ splittheme = listsplittheme || last.jqmData( "theme" ) || o.splitTheme;
+
+ last.appendTo(item)
+ .attr( "title", last.getEncodedText() )
+ .addClass( "ui-li-link-alt" )
+ .empty()
+ .buttonMarkup({
+ shadow: false,
+ corners: false,
+ theme: itemTheme,
+ icon: false,
+ iconpos: false
+ })
+ .find( ".ui-btn-inner" )
+ .append(
+ $( "<span />" ).buttonMarkup({
+ shadow: true,
+ corners: true,
+ theme: splittheme,
+ iconpos: "notext",
+ icon: listspliticon || last.jqmData( "icon" ) || o.splitIcon
+ })
+ );
+ }
+ } else if ( item.jqmData( "role" ) === "list-divider" ) {
+
+ itemClass += " ui-li-divider ui-btn ui-bar-" + dividertheme;
+ item.attr( "role", "heading" );
+
+ //reset counter when a divider heading is encountered
+ if ( counter ) {
+ counter = 1;
+ }
+
+ } else {
+ itemClass += " ui-li-static ui-body-" + itemTheme;
+ }
+ }
+
+ if ( counter && itemClass.indexOf( "ui-li-divider" ) < 0 ) {
+ countParent = item.is( ".ui-li-static:first" ) ? item : item.find( ".ui-link-inherit" );
+
+ countParent.addClass( "ui-li-jsnumbering" )
+ .prepend( "<span class='ui-li-dec'>" + (counter++) + ". </span>" );
+ }
+
+ item.add( item.children( ".ui-btn-inner" ) ).addClass( itemClass );
+
+ self._itemApply( $list, item );
+ }
+
+ this._refreshCorners( create );
+ },
+
+ //create a string for ID/subpage url creation
+ _idStringEscape: function ( str ) {
+ return str.replace(/\W/g , "-");
+ },
+
+ // ?
+ // this virtuallistview object
+ _createSubPages: function () {
+ var parentList = this.element,
+ parentPage = parentList.closest( ".ui-page" ),
+ parentUrl = parentPage.jqmData( "url" ),
+ parentId = parentUrl || parentPage[ 0 ][ $.expando ],
+ parentListId = parentList.attr( "id" ),
+ o = this.options,
+ dns = "data-" + $.mobile.ns,
+ self = this,
+ persistentFooterID = parentPage.find( ":jqmData(role='footer')" ).jqmData( "id" ),
+ hasSubPages,
+ newRemove;
+
+ if ( typeof listCountPerPage[ parentId ] === "undefined" ) {
+ listCountPerPage[ parentId ] = -1;
+ }
+
+ parentListId = parentListId || ++listCountPerPage[ parentId ];
+
+ $( parentList.find( "li>ul, li>ol" ).toArray().reverse() ).each(function ( i ) {
+ var self = this,
+ list = $( this ),
+ listId = list.attr( "id" ) || parentListId + "-" + i,
+ parent = list.parent(),
+ nodeEls,
+ title = nodeEls.first().getEncodedText(),//url limits to first 30 chars of text
+ id = ( parentUrl || "" ) + "&" + $.mobile.subPageUrlKey + "=" + listId,
+ theme = list.jqmData( "theme" ) || o.theme,
+ countTheme = list.jqmData( "counttheme" ) || parentList.jqmData( "counttheme" ) || o.countTheme,
+ newPage,
+ anchor;
+
+ nodeEls = $( list.prevAll().toArray().reverse() );
+ nodeEls = nodeEls.length ? nodeEls : $( "<span>" + $.trim( parent.contents()[ 0 ].nodeValue ) + "</span>" );
+
+ //define hasSubPages for use in later removal
+ hasSubPages = true;
+
+ newPage = list.detach()
+ .wrap( "<div " + dns + "role='page' " + dns + "url='" + id + "' " + dns + "theme='" + theme + "' " + dns + "count-theme='" + countTheme + "'><div " + dns + "role='content'></div></div>" )
+ .parent()
+ .before( "<div " + dns + "role='header' " + dns + "theme='" + o.headerTheme + "'><div class='ui-title'>" + title + "</div></div>" )
+ .after( persistentFooterID ? $( "<div " + dns + "role='footer' " + dns + "id='" + persistentFooterID + "'>" ) : "" )
+ .parent()
+ .appendTo( $.mobile.pageContainer );
+
+ newPage.page();
+
+ anchor = parent.find('a:first');
+
+ if ( !anchor.length ) {
+ anchor = $( "<a/>" ).html( nodeEls || title ).prependTo( parent.empty() );
+ }
+
+ anchor.attr( "href", "#" + id );
+
+ }).virtuallistview();
+
+ // on pagehide, remove any nested pages along with the parent page, as long as they aren't active
+ // and aren't embedded
+ if ( hasSubPages &&
+ parentPage.is( ":jqmData(external-page='true')" ) &&
+ parentPage.data( "page" ).options.domCache === false ) {
+
+ newRemove = function ( e, ui ) {
+ var nextPage = ui.nextPage, npURL;
+
+ if ( ui.nextPage ) {
+ npURL = nextPage.jqmData( "url" );
+ if ( npURL.indexOf( parentUrl + "&" + $.mobile.subPageUrlKey ) !== 0 ) {
+ self.childPages().remove();
+ parentPage.remove();
+ }
+ }
+ };
+
+ // unbind the original page remove and replace with our specialized version
+ parentPage
+ .unbind( "pagehide.remove" )
+ .bind( "pagehide.remove", newRemove );
+ }
+ },
+
+ // TODO sort out a better way to track sub pages of the virtuallistview this is brittle
+ childPages: function () {
+ var parentUrl = this.parentPage.jqmData( "url" );
+
+ return $( ":jqmData(url^='" + parentUrl + "&" + $.mobile.subPageUrlKey + "')" );
+ }
+ });
+
+ //auto self-init widgets
+ $( document ).bind( "pagecreate create", function ( e ) {
+ $( $.tizen.virtuallistview.prototype.options.initSelector, e.target ).virtuallistview();
+ });
+
+} ( jQuery ) );
+
--- /dev/null
+
+/*
+ *
+ * This software is licensed under the MIT licence (as defined by the OSI at
+ * http://www.opensource.org/licenses/mit-license.php)
+ *
+ * ***************************************************************************
+ * Copyright (C) 2011 by Intel Corporation Ltd.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software" ),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * ***************************************************************************
+ */
+
+// Base class for widgets that need the following features:
+//
+// I. HTML prototype loading
+//
+// This class provides HTML prototype loading for widgets. That is, the widget implementation specifies its HTML portions
+// in one continuous HTML snippet, and it optionally provides an object containing selectors into the various parts of the
+// HTML snippet. This widget loads the HTML snippet into a jQuery object, and optionally assigns jQuery objects to each of
+// the selectors in the optionally provided object.
+//
+// To use this functionality you can either derive from this class, or you can call its prototype's gtype method.
+//
+// 1. Widgets deriving from this class should define _htmlProto as part of their prototype declaration. _htmlProto looks like
+// this:
+//
+// _htmlProto: {
+// source: string|jQuery object (optional) default: string - The name of the widget
+// ui: {
+// uiElement1: "#ui-element-1-selector",
+// uiElement2: "#ui-element-2-selector",
+// ...
+// subElement: {
+// subElement1: "#sub-element-1-selector",
+// subElement2: "#sub-element-2-selector",
+// ...
+// }
+// ...
+// }
+// }
+//
+// If neither 'source' nor 'ui' are defined, you must still include an empty _htmlProto key (_htmlProto: {}) to indicate
+// that you wish to make use of this feature. This will cause a prototype HTML file named after your widget to be loaded.
+// The loaded prototype will be placed into your widget's prototype's _protoHtml.source key.
+//
+// If 'source' is defined as a string, it is the name of the widget (including namespace). This is the default. If your
+// widget's HTML prototype is loaded via AJAX and the name of the AJAX file is different from the name of your widget
+// (that is, it is not "<widgetName>.prototype.html", then you should explicitly define 'source' as:
+//
+// If you wish to load HTML prototypes via AJAX, modify the getProtoPath() function defined below to reflect the directory
+// structure holding your widget HTML prototypes.
+//
+// source: "alternateWidgetName"
+//
+// If AJAX loading fails, source is set to a jQuery object containing a div with an error message. You can check whether
+// loading failed via the jQuery object's jqmData( "tizen.widgetex.ajax.fail" ) data item. If false, then the jQuery object
+// is the actual prototype loaded via AJAX or present inline. Otherwise, the jQuery object is the error message div.
+//
+// If 'source' is defined as a jQuery object, it is considered already loaded.
+//
+// if 'ui' is defined inside _htmlProto, It is assumed to be an object such that every one of its keys is either a string,
+// or another object with the same properties as itself.
+//
+// When a widget is instantiated, the HTML prototype is loaded if not already present in the prototype. If 'ui' is present
+// inside _htmlProto, the prototype is cloned. Then, a new structure is created based on 'ui' with each selector replaced
+// by a jQuery object containing the results of performing .find() on the prototype's clone with the filter set to the
+// value of the string. In the special case where the selector starts with a '#', the ID is removed from the element after
+// it is assigned into the structure being created. This structure is then made accessible from the widget instance via
+// the '_ui' key (i.e., this._ui).
+//
+// 2. Use the loadPrototype method when your widget does not derive from $.tizen.widgetex:
+// Add _htmlProto to your widget's prototype as described above. Then, in your widget's _create() method, call
+// loadPrototype in the following manner:
+//
+// $.tizen.widgetex.loadPrototype.call(this, "namespace.widgetName" );
+//
+// Thereafter, you may use the HTML prototype from your widget's prototype or, if you have specified a 'ui' key in your
+// _htmlProto key, you may use this._ui from your widget instance.
+//
+// II. realize method
+//
+// When a widget is created, some of its properties cannot be set immediately, because they depend on the widths/heights
+// of its constituent elements. They can only be calculated when the page containing the widget is made visible via the
+// "pageshow" event, because widths/heights always evaluate to 0 when retrieved from a widget that is not visible. When
+// you inherit from widgetex, you can add a "_realize" function to your prototype. This function will be called once right
+// after _create() if the element that anchors your widget is on a visible page. Otherwise, it will be called when the
+// page to which the widget belongs emits the "pageshow" event.
+//
+// NB: If your widget is inside a container which is itself not visible, such as an expandable or a collapsible, your
+// widget will remain hidden even though "pageshow" is fired and therefore _realize is called. In this case, widths and
+// heights will be unreliable even during _realize.
+//
+// III. systematic option handling
+//
+// If a widget has lots of options, the _setOption function can become a long switch for setting each recognized option.
+// It is also tempting to allow options to determine the way a widget is created, by basing decisions on various options
+// during _create(). Often, the actions based on option values in _create() are the same as those in _setOption. To avoid
+// such code duplication, this class calls _setOption once for each option after _create() has completed.
+//
+// Furthermore, to avoid writing long switches in a widget's _setOption method, this class implements _setOption in such
+// a way that, for any given option (e.g. "myOption" ), _setOption looks for a method _setMyOption in the widget's
+// implementation, and if found, calls the method with the value of the option.
+//
+// If your widget does not inherit from widgetex, you can still use widgetex' systematic option handling:
+// 1. define the _setOption method for your widget as follows:
+// _setOption: $.tizen.widgetex.prototype._setOption
+// 2. Call this._setOptions(this.options) from your widget's _create() function.
+// 3. As with widgetex-derived widgets, implement a corresponding _setMyOptionName function for each option myOptionName
+// you wish to handle.
+//
+// IV. systematic value handling for input elements
+//
+// If your widget happens to be constructed from an <input> element, you have to handle the "value" attribute specially,
+// and you have to emit the "change" signal whenever it changes, in addition to your widget's normal signals and option
+// changes. With widgetex, you can assign one of your widget's "data-*" properties to be synchronized to the "value"
+// property whenever your widget is constructed onto an <input> element. To do this, define, in your prototype:
+//
+// _value: {
+// attr: "data-my-attribute",
+// signal: "signal-to-emit"
+// }
+//
+// Then, call this._setValue(newValue) whenever you wish to set the value for your widget. This will set the data-*
+// attribute, emit the custom signal (if set) with the new value as its parameter, and, if the widget is based on an
+// <input> element, it will also set the "value" attribute and emit the "change" signal.
+//
+// "attr" is required if you choose to define "_value", and identifies the data-attribute to set in addition to "value",
+// if your widget's element is an input.
+// "signal" is optional, and will be emitted when setting the data-attribute via this._setValue(newValue).
+//
+// If your widget does not derive from widgetex, you can still define "_value" as described above and call
+// $.tizen.widgetex.setValue(widget, newValue).
+//
+// V. Systematic enabled/disabled handling for input elements
+//
+// widgetex implements _setDisabled which will disable the input associated with this widget, if any. Thus, if you derive
+// from widgetex and you plan on implementing the disabled state, you should chain up to
+// $.tizen.widgetex.prototype._setDisabled(value), rather than $.Widget.prototype._setOption( "disabled", value).
+
+(function ($, undefined) {
+
+// Framework-specific HTML prototype path for AJAX loads
+ function getProtoPath() {
+ var theScriptTag = $( "script[data-framework-version][data-framework-root][data-framework-theme]" );
+
+ return (theScriptTag.attr( "data-framework-root" ) + "/" +
+ theScriptTag.attr( "data-framework-version" ) + "/themes/" +
+ theScriptTag.attr( "data-framework-theme" ) + "/proto-html" );
+ }
+
+ $.widget( "tizen.widgetex", $.mobile.widget, {
+ _createWidget: function () {
+ $.tizen.widgetex.loadPrototype.call( this, this.namespace + "." + this.widgetName );
+ $.mobile.widget.prototype._createWidget.apply( this, arguments );
+ },
+
+ _init: function () {
+ // TODO THIS IS TEMPORARY PATCH TO AVOID CTXPOPUP PAGE CRASH
+ if ( this.element === undefined ) {
+ return;
+ }
+
+ var page = this.element.closest( ".ui-page" ),
+ self = this,
+ myOptions = {};
+
+ if ( page.is( ":visible" ) ) {
+ this._realize();
+ } else {
+ page.bind( "pageshow", function () { self._realize(); } );
+ }
+
+ $.extend( myOptions, this.options );
+
+ this.options = {};
+
+ this._setOptions( myOptions );
+ },
+
+ _getCreateOptions: function () {
+ // if we're dealing with an <input> element, value takes precedence over corresponding data-* attribute, if a
+ // mapping has been established via this._value. So, assign the value to the data-* attribute, so that it may
+ // then be assigned to this.options in the superclass' _getCreateOptions
+
+ if (this.element.is( "input" ) && this._value !== undefined) {
+ var theValue =
+ ( ( this.element.attr( "type" ) === "checkbox" || this.element.attr( "type" ) === "radio" )
+ ? this.element.is( ":checked" )
+ : this.element.is( "[value]" )
+ ? this.element.attr( "value" )
+ : undefined);
+
+ if ( theValue != undefined ) {
+ this.element.attr( this._value.attr, theValue );
+ }
+ }
+
+ return $.mobile.widget.prototype._getCreateOptions.apply( this, arguments );
+ },
+
+ _setOption: function ( key, value ) {
+ var setter = "_set" + key.replace(/^[a-z]/, function (c) { return c.toUpperCase(); } );
+
+ if ( this[setter] !== undefined ) {
+ this[setter]( value );
+ } else {
+ $.mobile.widget.prototype._setOption.apply( this, arguments );
+ }
+ },
+
+ _setDisabled: function ( value ) {
+ $.Widget.prototype._setOption.call( this, "disabled", value );
+ if ( this.element.is( "input" ) ) {
+ this.element.attr( "disabled", value );
+ }
+ },
+
+ _setValue: function ( newValue ) {
+ $.tizen.widgetex.setValue( this, newValue );
+ },
+
+ _realize: function () {}
+ } );
+
+ $.tizen.widgetex.setValue = function ( widget, newValue ) {
+ if ( widget._value !== undefined ) {
+ var valueString = ( widget._value.makeString ? widget._value.makeString(newValue) : newValue ),
+ inputType;
+
+ widget.element.attr( widget._value.attr, valueString );
+ if ( widget._value.signal !== undefined ) {
+ widget.element.triggerHandler( widget._value.signal, newValue );
+ }
+
+ if ( widget.element.is( "input" ) ) {
+ inputType = widget.element.attr( "type" );
+
+ // Special handling for checkboxes and radio buttons, where the presence of the "checked" attribute is really
+ // the value
+ if ( inputType === "checkbox" || inputType === "radio" ) {
+ if ( newValue ) {
+ widget.element.attr( "checked", true );
+ } else {
+ widget.element.removeAttr( "checked" );
+ }
+ } else {
+ widget.element.attr( "value", valueString );
+ }
+
+ widget.element.trigger( "change" );
+ }
+ }
+ };
+
+ $.tizen.widgetex.assignElements = function (proto, obj) {
+ var ret = {},
+ key;
+
+ for ( key in obj ) {
+ if ( ( typeof obj[key] ) === "string" ) {
+ ret[key] = proto.find( obj[key] );
+ if ( obj[key].match(/^#/) ) {
+ ret[key].removeAttr( "id" );
+ }
+ } else {
+ if ( (typeof obj[key]) === "object" ) {
+ ret[key] = $.tizen.widgetex.assignElements( proto, obj[key] );
+ }
+ }
+ }
+
+ return ret;
+ };
+
+ $.tizen.widgetex.loadPrototype = function ( widget, ui ) {
+ var ar = widget.split( "." ),
+ namespace,
+ widgetName,
+ source,
+ noSource = false,
+ htmlProto,
+ protoPath;
+
+ if ( ar.length == 2 ) {
+ namespace = ar[0];
+ widgetName = ar[1];
+
+ // If htmlProto is defined
+ if ( $[namespace][widgetName].prototype._htmlProto !== undefined ) {
+ // If no source is defined, use the widget name
+ source = $[namespace][widgetName].prototype._htmlProto.source;
+ if ( source === undefined ) {
+ source = widgetName;
+ noSource = true;
+ }
+
+ // Load the HTML prototype via AJAX if not defined inline
+ if ( typeof source === "string" ) {
+ if ( noSource ) { // use external htmlproto file
+ // Establish the path for the proto file
+ widget = source;
+ protoPath = getProtoPath();
+
+ // Make the AJAX call
+ $.ajax( {
+ url: protoPath + "/" + widget + ".prototype.html",
+ async: false,
+ dataType: "html"
+ }).success( function (data, textStatus, jqXHR ) {
+ source = $( "<div></div>" ).html(data).jqmData( "tizen.widgetex.ajax.fail", false );
+ } );
+
+ // Assign the HTML proto to the widget prototype
+ source = $( "<div></div>" )
+ .text( "Failed to load proto for widget " + namespace + "." + widgetName + "!" )
+ .css( {background: "red", color: "blue", border: "1px solid black"} )
+ .jqmData( "tizen.widgetex.ajax.fail", true );
+
+ } else {
+ // inline definition (string)
+ source = $( source ).jqmData( "tizen.widgetex.ajax.fail", false );
+ }
+
+ } else {
+ // inline definition (object)
+ // AJAX loading has trivially succeeded, since there was no AJAX loading at all
+ source.jqmData( "tizen.widgetex.ajax.fail", false );
+ }
+ htmlProto = source;
+ $[namespace][widgetName].prototype._htmlProto.source = source;
+
+ // If there's a "ui" portion in the HTML proto, copy it over to this instance, and
+ // replace the selectors with the selected elements from a copy of the HTML prototype
+ if ( $[namespace][widgetName].prototype._htmlProto.ui !== undefined ) {
+ // Assign the relevant parts of the proto
+ $.extend( this, {
+ _ui: $.tizen.widgetex.assignElements( htmlProto.clone(), $[namespace][widgetName].prototype._htmlProto.ui )
+ });
+ }
+ }
+ }
+ };
+
+}( jQuery ) );
+
--- /dev/null
+.ui-ctxpopup {
+ display: table;
+
+ .ui-ctxpopup-row {
+ display: table-row;
+
+ .ui-ctxpopup-cell {
+ display: table-cell;
+ }
+ }
+}
+/*
+ * The settings in this file are part of the theme. They are not part of the structure of ctxpopup.
+ * In the default theme, ui-body-* has a border width of 1px. So, to make the triangles cross this border, we set them in
+ * by 1px.
+ */
+.ui-ctxpopup-row {
+ .ui-triangle-top { top: 1px; }
+ .ui-triangle-left { left: 1px; }
+ .ui-triangle-right { right: 1px; }
+ .ui-triangle-bottom { bottom: 1px; }
--- /dev/null
+.ui-popupwindow-padding {
+ padding: 6px;
+}
+
+.ui-popupwindow {
+ display: inline-block;
+ position: absolute;
+ padding: 0;
+ z-index: 100 !important;
+}
+
+.ui-popupwindow-screen {
+ background: #000000;
+ opacity: 0;
+ box-sizing: border-box;
+ -moz-box-sizing: border-box;
+}
--- /dev/null
+@triangle-size: 10px;
+
+.ui-triangle-container {
+ position: relative;
+
+ .ui-triangle {
+ position: absolute;
+ border-style: solid;
+ border-color: transparent;
+ border-width: @triangle-size;
+ }
+
+ .ui-triangle-top {
+ top: 0px;
+ border-top-width: 0px;
+ border-left-color: transparent;
+ border-right-color: transparent;
+ margin-left: -@triangle-size;
+ }
+
+ .ui-triangle-bottom {
+ bottom: 0px;
+ border-bottom-width: 0px;
+ border-left-color: transparent;
+ border-right-color: transparent;
+ margin-left: -@triangle-size;
+ }
+
+ .ui-triangle-left {
+ left: 0px;
+ margin-top: -@triangle-size;
+ border-left-width: 0px;
+ border-left-color: transparent;
+ border-right-color: transparent;
+ }
+
+ .ui-triangle-right {
+ right: 0px;
+ margin-top: -@triangle-size;
+ border-right-width: 0px;
+ border-left-color: transparent;
+ border-right-color: transparent;
+ }
+}
+
+.ui-triangle-container-top {
+ height: @triangle-size;
+ top: 0px;
+ margin-top: -@triangle-size;
+}
+
+.ui-triangle-container-bottom {
+ height: @triangle-size;
+ bottom: 0px;
+ margin-bottom: -@triangle-size;
+}
+
+.ui-triangle-container-left {
+ width: @triangle-size;
+}
+
+.ui-triangle-container-right {
+ width: @triangle-size;
+}
--- /dev/null
+(function( $, undefined ) {
+
+$.mobile.listview.prototype.options.autodividers = false;
+$.mobile.listview.prototype.options.autodividersSelector = function( elt ) {
+ // look for the text in the given element
+ var text = elt.text() || null;
+
+ if ( !text ) {
+ return null;
+ }
+
+ // create the text for the divider (first uppercased letter)
+ text = text.trim().slice( 0, 1 ).toUpperCase();
+
+ return text;
+};
+
+$.mobile.$document.delegate( "ul,ol", "listviewcreate", function() {
+
+ var list = $( this ),
+ listview = list.data( "listview" );
+
+ if ( !listview || !listview.options.autodividers ) {
+ return;
+ }
+
+ var replaceDividers = function () {
+ list.find( "li:jqmData(role='list-divider')" ).remove();
+
+ var lis = list.find( 'li' ),
+ lastDividerText = null, li, dividerText;
+
+ for ( var i = 0; i < lis.length ; i++ ) {
+ li = lis[i];
+ dividerText = listview.options.autodividersSelector( $( li ) );
+
+ if ( dividerText && lastDividerText !== dividerText ) {
+ var divider = document.createElement( 'li' );
+ divider.appendChild( document.createTextNode( dividerText ) );
+ divider.setAttribute( 'data-' + $.mobile.ns + 'role', 'list-divider' );
+ li.parentNode.insertBefore( divider, li );
+ }
+
+ lastDividerText = dividerText;
+ }
+ };
+
+ var afterListviewRefresh = function () {
+ list.unbind( 'listviewafterrefresh', afterListviewRefresh );
+ replaceDividers();
+ listview.refresh();
+ list.bind( 'listviewafterrefresh', afterListviewRefresh );
+ };
+
+ afterListviewRefresh();
+});
+
+})( jQuery );
--- /dev/null
+(function( $, undefined ) {
+
+$.mobile.listview.prototype.options.filter = false;
+$.mobile.listview.prototype.options.filterPlaceholder = "";
+$.mobile.listview.prototype.options.filterTheme = "c";
+// TODO rename callback/deprecate and default to the item itself as the first argument
+var defaultFilterCallback = function( text, searchValue, item ) {
+ return text.toString().toLowerCase().indexOf( searchValue ) === -1;
+ };
+
+$.mobile.listview.prototype.options.filterCallback = defaultFilterCallback;
+
+$.mobile.$document.delegate( ":jqmData(role='listview')", "listviewcreate", function() {
+
+ var list = $( this ),
+ listview = list.data( "listview" );
+
+ if ( !listview.options.filter ) {
+ return;
+ }
+
+ var wrapper = $( "<form>", {
+ "class": "ui-listview-filter ui-bar-" + listview.options.filterTheme,
+ "role": "search"
+ }),
+ search = $( "<input>", {
+ placeholder: listview.options.filterPlaceholder
+ })
+ .attr( "data-" + $.mobile.ns + "type", "search" )
+ .jqmData( "lastval", "" )
+ .bind( "keyup change", function() {
+
+ var $this = $( this ),
+ val = this.value.toLowerCase(),
+ listItems = null,
+ lastval = $this.jqmData( "lastval" ) + "",
+ childItems = false,
+ itemtext = "",
+ item,
+ // Check if a custom filter callback applies
+ isCustomFilterCallback = listview.options.filterCallback !== defaultFilterCallback;
+
+ listview._trigger( "beforefilter", "beforefilter", { input: this } );
+
+ // Change val as lastval for next execution
+ $this.jqmData( "lastval" , val );
+ if ( isCustomFilterCallback || val.length < lastval.length || val.indexOf( lastval ) !== 0 ) {
+
+ // Custom filter callback applies or removed chars or pasted something totally different, check all items
+ listItems = list.children();
+ } else {
+
+ // Only chars added, not removed, only use visible subset
+ listItems = list.children( ":not(.ui-screen-hidden)" );
+ }
+
+ if ( val ) {
+
+ // This handles hiding regular rows without the text we search for
+ // and any list dividers without regular rows shown under it
+
+ for ( var i = listItems.length - 1; i >= 0; i-- ) {
+ item = $( listItems[ i ] );
+ itemtext = $.mobile.getAttrFixed( item[0], "data-" + $.mobile.ns + "filtertext" ) || item.text();
+
+ if ( item.is( "li:jqmData(role=list-divider)" ) ) {
+
+ item.toggleClass( "ui-filter-hidequeue" , !childItems );
+
+ // New bucket!
+ childItems = false;
+
+ } else if ( listview.options.filterCallback( itemtext, val, item ) ) {
+
+ //mark to be hidden
+ item.toggleClass( "ui-filter-hidequeue" , true );
+ } else {
+
+ // There's a shown item in the bucket
+ childItems = true;
+ }
+ }
+
+ // Show items, not marked to be hidden
+ listItems
+ .filter( ":not(.ui-filter-hidequeue)" )
+ .toggleClass( "ui-screen-hidden", false );
+
+ // Hide items, marked to be hidden
+ listItems
+ .filter( ".ui-filter-hidequeue" )
+ .toggleClass( "ui-screen-hidden", true )
+ .toggleClass( "ui-filter-hidequeue", false );
+
+ } else {
+
+ //filtervalue is empty => show all
+ listItems.toggleClass( "ui-screen-hidden", false );
+ }
+ listview._refreshCorners();
+ })
+ .appendTo( wrapper )
+ .textinput();
+
+ if ( listview.options.inset ) {
+ wrapper.addClass( "ui-listview-filter-inset" );
+ }
+
+ wrapper.bind( "submit", function() {
+ return false;
+ })
+ .insertBefore( list );
+});
+
+})( jQuery );
--- /dev/null
+(function( $, undefined ) {
+
+//Keeps track of the number of lists per page UID
+//This allows support for multiple nested list in the same page
+//https://github.com/jquery/jquery-mobile/issues/1617
+var listCountPerPage = {};
+
+$.widget( "mobile.listview", $.mobile.widget, {
+
+ options: {
+ theme: null,
+ countTheme: "c",
+ headerTheme: "b",
+ dividerTheme: "b",
+ splitIcon: "arrow-r",
+ splitTheme: "b",
+ inset: false,
+ initSelector: ":jqmData(role='listview')"
+ },
+
+ _create: function() {
+ var t = this,
+ listviewClasses = "";
+
+ listviewClasses += t.options.inset ? " ui-listview-inset ui-corner-all ui-shadow " : "";
+
+ // create listview markup
+ t.element.addClass(function( i, orig ) {
+ return orig + " ui-listview " + listviewClasses;
+ });
+
+ t.refresh( true );
+ },
+
+ _removeCorners: function( li, which ) {
+ var top = "ui-corner-top ui-corner-tr ui-corner-tl",
+ bot = "ui-corner-bottom ui-corner-br ui-corner-bl";
+
+ li = li.add( li.find( ".ui-btn-inner, .ui-li-link-alt, .ui-li-thumb" ) );
+
+ if ( which === "top" ) {
+ li.removeClass( top );
+ } else if ( which === "bottom" ) {
+ li.removeClass( bot );
+ } else {
+ li.removeClass( top + " " + bot );
+ }
+ },
+
+ _refreshCorners: function( create ) {
+ var $li,
+ $visibleli,
+ $topli,
+ $bottomli;
+
+ $li = this.element.children( "li" );
+ // At create time and when autodividers calls refresh the li are not visible yet so we need to rely on .ui-screen-hidden
+ $visibleli = create || $li.filter( ":visible" ).length === 0 ? $li.not( ".ui-screen-hidden" ) : $li.filter( ":visible" );
+
+ // ui-li-last is used for setting border-bottom on the last li
+ $li.filter( ".ui-li-last" ).removeClass( "ui-li-last" );
+
+ if ( this.options.inset ) {
+ this._removeCorners( $li );
+
+ // Select the first visible li element
+ $topli = $visibleli.first()
+ .addClass( "ui-corner-top" );
+
+ $topli.add( $topli.find( ".ui-btn-inner" )
+ .not( ".ui-li-link-alt span:first-child" ) )
+ .addClass( "ui-corner-top" )
+ .end()
+ .find( ".ui-li-link-alt, .ui-li-link-alt span:first-child" )
+ .addClass( "ui-corner-tr" )
+ .end()
+ .find( ".ui-li-thumb" )
+ .not( ".ui-li-icon" )
+ .addClass( "ui-corner-tl" );
+
+ // Select the last visible li element
+ $bottomli = $visibleli.last()
+ .addClass( "ui-corner-bottom ui-li-last" );
+
+ $bottomli.add( $bottomli.find( ".ui-btn-inner" ) )
+ .find( ".ui-li-link-alt" )
+ .addClass( "ui-corner-br" )
+ .end()
+ .find( ".ui-li-thumb" )
+ .not( ".ui-li-icon" )
+ .addClass( "ui-corner-bl" );
+ } else {
+ $visibleli.last().addClass( "ui-li-last" );
+ }
+ if ( !create ) {
+ this.element.trigger( "updatelayout" );
+ }
+ },
+
+ // This is a generic utility method for finding the first
+ // node with a given nodeName. It uses basic DOM traversal
+ // to be fast and is meant to be a substitute for simple
+ // $.fn.closest() and $.fn.children() calls on a single
+ // element. Note that callers must pass both the lowerCase
+ // and upperCase version of the nodeName they are looking for.
+ // The main reason for this is that this function will be
+ // called many times and we want to avoid having to lowercase
+ // the nodeName from the element every time to ensure we have
+ // a match. Note that this function lives here for now, but may
+ // be moved into $.mobile if other components need a similar method.
+ _findFirstElementByTagName: function( ele, nextProp, lcName, ucName ) {
+ var dict = {};
+ dict[ lcName ] = dict[ ucName ] = true;
+ while ( ele ) {
+ if ( dict[ ele.nodeName ] ) {
+ return ele;
+ }
+ ele = ele[ nextProp ];
+ }
+ return null;
+ },
+ _getChildrenByTagName: function( ele, lcName, ucName ) {
+ var results = [],
+ dict = {};
+ dict[ lcName ] = dict[ ucName ] = true;
+ ele = ele.firstChild;
+ while ( ele ) {
+ if ( dict[ ele.nodeName ] ) {
+ results.push( ele );
+ }
+ ele = ele.nextSibling;
+ }
+ return $( results );
+ },
+
+ _addThumbClasses: function( containers ) {
+ var i, img, len = containers.length;
+ for ( i = 0; i < len; i++ ) {
+ img = $( this._findFirstElementByTagName( containers[ i ].firstChild, "nextSibling", "img", "IMG" ) );
+ if ( img.length ) {
+ img.addClass( "ui-li-thumb" ).attr( {
+ "role" : "",
+ "aria-label" : "icon"
+ });
+ $( this._findFirstElementByTagName( img[ 0 ].parentNode, "parentNode", "li", "LI" ) ).addClass( img.is( ".ui-li-icon" ) ? "ui-li-has-icon" : "ui-li-has-thumb" );
+ }
+ }
+ },
+
+ _addCheckboxRadioClasses: function( containers )
+ {
+ var i, inputAttr, len = containers.length;
+ for ( i = 0; i < len; i++ ) {
+ inputAttr = $( containers[ i ] ).find( "input" );
+ if ( inputAttr.attr( "type" ) == "checkbox" ) {
+ $( containers[ i ] ).addClass( "ui-li-has-checkbox" );
+ } else if ( inputAttr.attr( "type" ) == "radio" ) {
+ $( containers[ i ] ).addClass( "ui-li-has-radio" );
+ }
+ }
+ },
+
+ _addRightBtnClasses: function( containers )
+ {
+ var i, btnAttr, len = containers.length;
+ for ( i = 0; i < len; i++ ) {
+ btnAttr = $( containers[ i ] ).find( ":jqmData(role='button'),input[type='button'],select:jqmData(role='slider')" );
+ if ( btnAttr.length ) {
+ if ( btnAttr.jqmData( "style" ) == "circle" ) {
+ $( containers[ i ] ).addClass( "ui-li-has-right-circle-btn" );
+ } else {
+ $( containers[ i ] ).addClass( "ui-li-has-right-btn" );
+ }
+ }
+ }
+ },
+
+ refresh: function( create ) {
+ this.parentPage = this.element.closest( ".ui-page" );
+ this._createSubPages();
+
+ var o = this.options,
+ $list = this.element,
+ self = this,
+ dividertheme = $.mobile.getAttrFixed( $list[0], "data-" + $.mobile.ns + "dividertheme" ) || o.dividerTheme,
+ listsplittheme = $.mobile.getAttrFixed( $list[0], "data-" + $.mobile.ns + "splittheme" ),
+ listspliticon = $.mobile.getAttrFixed( $list[0], "data-" + $.mobile.ns + "spliticon" ),
+ li = this._getChildrenByTagName( $list[ 0 ], "li", "LI" ),
+ ol = !!$.nodeName( $list[ 0 ], "ol" ),
+ jsCount = !$.support.cssPseudoElement,
+ start = $list.attr( "start" ),
+ itemClassDict = {},
+ item, itemClass, itemTheme,
+ a, last, splittheme, counter, startCount, newStartCount, countParent, icon, imgParents, img, linkIcon;
+
+ if ( ol && jsCount ) {
+ $list.find( ".ui-li-dec" ).remove();
+ }
+
+ if ( ol ) {
+ // Check if a start attribute has been set while taking a value of 0 into account
+ if ( start || start === 0 ) {
+ if ( !jsCount ) {
+ startCount = parseFloat( start ) - 1;
+ $list.css( "counter-reset", "listnumbering " + startCount );
+ } else {
+ counter = parseFloat( start );
+ }
+ } else if ( jsCount ) {
+ counter = 1;
+ }
+ }
+
+ if ( !o.theme ) {
+ o.theme = $.mobile.getInheritedTheme( this.element, "c" );
+ }
+
+ for ( var pos = 0, numli = li.length; pos < numli; pos++ ) {
+ item = li.eq( pos );
+ itemClass = "ui-li";
+
+ // If we're creating the element, we update it regardless
+ if ( create || !item.hasClass( "ui-li" ) ) {
+ itemTheme = $.mobile.getAttrFixed( item[0], "data-" + $.mobile.ns + "theme" ) || o.theme;
+ a = this._getChildrenByTagName( item[ 0 ], "a", "A" ).attr( {
+ "role": "",
+ "tabindex": "0"
+ });
+ var isDivider = ( $.mobile.getAttrFixed( item[0], "data-" + $.mobile.ns + "role" ) === "list-divider" );
+
+ if ( item.hasClass( "ui-li-has-checkbox" ) || item.hasClass( "ui-li-has-radio" ) ) {
+ item.on( "vclick", function ( e ) {
+ var targetItem = $( e.target );
+ var checkboxradio = targetItem.find( ".ui-checkbox" );
+ if ( !checkboxradio.length ) {
+ checkboxradio = targetItem.find( ".ui-radio" );
+ }
+
+ if ( checkboxradio.length ) {
+ checkboxradio.children( "label" ).trigger( "vclick" );
+ }
+ });
+ }
+
+ if ( a.length && !isDivider ) {
+ icon = $.mobile.getAttrFixed( item[0], "data-" + $.mobile.ns + "icon" );
+
+ /* Remove auto populated right-arrow button. */
+ if ( icon === undefined ) {
+ icon = false;
+ }
+
+ item.buttonMarkup({
+ wrapperEls: "div",
+ shadow: false,
+ corners: false,
+ iconpos: "right",
+ icon: a.length > 1 || icon === false ? false : icon || "arrow-r",
+ theme: itemTheme
+ });
+
+ if ( ( icon !== false ) && ( a.length === 1 ) ) {
+ item.addClass( "ui-li-has-arrow" );
+ }
+
+ a.first().removeClass( "ui-link" ).addClass( "ui-link-inherit" );
+
+ if ( a.length > 1 ) {
+ itemClass += " ui-li-has-alt";
+
+ last = a.last();
+ splittheme = listsplittheme || $.mobile.getAttrFixed( last[0], "data-" + $.mobile.ns + "theme" ) || o.splitTheme;
+ linkIcon = $.mobile.getAttrFixed( last[0], "data-" + $.mobile.ns + "icon" );
+
+ last.appendTo( item )
+ .attr( "title", last.getEncodedText() )
+ .addClass( "ui-li-link-alt" )
+ .empty()
+ .buttonMarkup({
+ shadow: false,
+ corners: false,
+ theme: itemTheme,
+ icon: false,
+ iconpos: "notext"
+ })
+ .find( ".ui-btn-inner" )
+ .append(
+ $( document.createElement( "span" ) ).buttonMarkup({
+ shadow: true,
+ corners: true,
+ theme: splittheme,
+ iconpos: "notext",
+ // link icon overrides list item icon overrides ul element overrides options
+ icon: linkIcon || icon || listspliticon || o.splitIcon
+ })
+ );
+ }
+ } else if ( isDivider ) {
+
+ itemClass += " ui-li-divider ui-bar-" + dividertheme;
+ item.attr( { "role": "heading", "tabindex": "0" } );
+
+ if ( ol ) {
+ //reset counter when a divider heading is encountered
+ if ( start || start === 0 ) {
+ if ( !jsCount ) {
+ newStartCount = parseFloat( start ) - 1;
+ item.css( "counter-reset", "listnumbering " + newStartCount );
+ } else {
+ counter = parseFloat( start );
+ }
+ } else if ( jsCount ) {
+ counter = 1;
+ }
+ }
+
+ } else {
+ itemClass += " ui-li-static ui-btn-up-" + itemTheme;
+ item.attr( "tabindex", "0" );
+ }
+ }
+
+ if ( ol && jsCount && itemClass.indexOf( "ui-li-divider" ) < 0 ) {
+ countParent = itemClass.indexOf( "ui-li-static" ) > 0 ? item : item.find( ".ui-link-inherit" );
+
+ countParent.addClass( "ui-li-jsnumbering" )
+ .prepend( "<span class='ui-li-dec'>" + ( counter++ ) + ". </span>" );
+ }
+
+ // Instead of setting item class directly on the list item and its
+ // btn-inner at this point in time, push the item into a dictionary
+ // that tells us what class to set on it so we can do this after this
+ // processing loop is finished.
+
+ if ( !itemClassDict[ itemClass ] ) {
+ itemClassDict[ itemClass ] = [];
+ }
+
+ itemClassDict[ itemClass ].push( item[ 0 ] );
+ }
+
+ // Set the appropriate listview item classes on each list item
+ // and their btn-inner elements. The main reason we didn't do this
+ // in the for-loop above is because we can eliminate per-item function overhead
+ // by calling addClass() and children() once or twice afterwards. This
+ // can give us a significant boost on platforms like WP7.5.
+
+ for ( itemClass in itemClassDict ) {
+ $( itemClassDict[ itemClass ] ).addClass( itemClass ).children( ".ui-btn-inner" ).addClass( itemClass );
+ }
+
+ $list.find( "h1, h2, h3, h4, h5, h6" ).addClass( "ui-li-heading" )
+ .end()
+
+ .find( "p, dl" ).addClass( "ui-li-desc" )
+ .end()
+
+ .find( ".ui-li-aside" ).each(function() {
+ var $this = $( this );
+ $this.prependTo( $this.parent() ); //shift aside to front for css float
+ })
+ .end()
+
+ .find( ".ui-li-count" ).each(function() {
+ $( this ).closest( "li" ).addClass( "ui-li-has-count" );
+ }).addClass( "ui-btn-up-" + ( $.mobile.getAttrFixed( $list[0], "data-" + $.mobile.ns + "counttheme" ) || this.options.countTheme) + " ui-btn-corner-all" );
+
+ // The idea here is to look at the first image in the list item
+ // itself, and any .ui-link-inherit element it may contain, so we
+ // can place the appropriate classes on the image and list item.
+ // Note that we used to use something like:
+ //
+ // li.find(">img:eq(0), .ui-link-inherit>img:eq(0)").each( ... );
+ //
+ // But executing a find() like that on Windows Phone 7.5 took a
+ // really long time. Walking things manually with the code below
+ // allows the 400 listview item page to load in about 3 seconds as
+ // opposed to 30 seconds.
+
+ this._addThumbClasses( li );
+ this._addThumbClasses( $list.find( ".ui-link-inherit" ) );
+
+ this._addCheckboxRadioClasses( li );
+ this._addCheckboxRadioClasses( $list.find( ".ui-link-inherit" ) );
+
+ this._addRightBtnClasses( li );
+ this._addRightBtnClasses( $list.find( ".ui-link-inherit" ) );
+
+ this._refreshCorners( create );
+
+ // autodividers binds to this to redraw dividers after the listview refresh
+ this._trigger( "afterrefresh" );
+ },
+
+ //create a string for ID/subpage url creation
+ _idStringEscape: function( str ) {
+ return str.replace(/[^a-zA-Z0-9]/g, '-');
+ },
+
+ _createSubPages: function() {
+ var parentList = this.element,
+ parentPage = parentList.closest( ".ui-page" ),
+ parentUrl = parentPage.jqmData( "url" ),
+ parentId = parentUrl || parentPage[ 0 ][ $.expando ],
+ parentListId = parentList.attr( "id" ),
+ o = this.options,
+ dns = "data-" + $.mobile.ns,
+ self = this,
+ persistentFooterID = parentPage.find( ":jqmData(role='footer')" ).jqmData( "id" ),
+ hasSubPages;
+
+ if ( typeof listCountPerPage[ parentId ] === "undefined" ) {
+ listCountPerPage[ parentId ] = -1;
+ }
+
+ parentListId = parentListId || ++listCountPerPage[ parentId ];
+
+ $( parentList.find( "li>ul, li>ol" ).toArray().reverse() ).each(function( i ) {
+ var self = this,
+ list = $( this ),
+ listId = list.attr( "id" ) || parentListId + "-" + i,
+ parent = list.parent(),
+ nodeElsFull = $( list.prevAll().toArray().reverse() ),
+ nodeEls = nodeElsFull.length ? nodeElsFull : $( "<span>" + $.trim(parent.contents()[ 0 ].nodeValue) + "</span>" ),
+ title = nodeEls.first().getEncodedText(),//url limits to first 30 chars of text
+ id = ( parentUrl || "" ) + "&" + $.mobile.subPageUrlKey + "=" + listId,
+ theme = $.mobile.getAttrFixed( list[0], "data-" + $.mobile.ns + "theme" ) || o.theme,
+ countTheme = $.mobile.getAttrFixed( list[0], "data-" + $.mobile.ns + "counttheme" ) || $.mobile.getAttrFixed( parentList[0], "data-" + $.mobile.ns + "counttheme" ) || o.countTheme,
+ newPage, anchor;
+
+ //define hasSubPages for use in later removal
+ hasSubPages = true;
+
+ newPage = list.detach()
+ .wrap( "<div " + dns + "role='page' " + dns + "url='" + id + "' " + dns + "theme='" + theme + "' " + dns + "count-theme='" + countTheme + "'><div " + dns + "role='content'></div></div>" )
+ .parent()
+ .before( "<div " + dns + "role='header' " + dns + "theme='" + o.headerTheme + "'><div class='ui-title'>" + title + "</div></div>" )
+ .after( persistentFooterID ? $( "<div " + dns + "role='footer' " + dns + "id='"+ persistentFooterID +"'>" ) : "" )
+ .parent()
+ .appendTo( $.mobile.pageContainer );
+
+ newPage.page();
+
+ anchor = parent.find( 'a:first' );
+
+ if ( !anchor.length ) {
+ anchor = $( "<a/>" ).html( nodeEls || title ).prependTo( parent.empty() );
+ }
+
+ anchor.attr( "href", "#" + id );
+
+ }).listview();
+
+ // on pagehide, remove any nested pages along with the parent page, as long as they aren't active
+ // and aren't embedded
+ if ( hasSubPages &&
+ parentPage.is( ":jqmData(external-page='true')" ) &&
+ parentPage.data( "page" ).options.domCache === false ) {
+
+ var newRemove = function( e, ui ) {
+ var nextPage = ui.nextPage, npURL,
+ prEvent = new $.Event( "pageremove" );
+
+ if ( ui.nextPage ) {
+ npURL = nextPage.jqmData( "url" );
+ if ( npURL.indexOf( parentUrl + "&" + $.mobile.subPageUrlKey ) !== 0 ) {
+ self.childPages().remove();
+ parentPage.trigger( prEvent );
+ if ( !prEvent.isDefaultPrevented() ) {
+ parentPage.removeWithDependents();
+ }
+ }
+ }
+ };
+
+ // unbind the original page remove and replace with our specialized version
+ parentPage
+ .unbind( "pagehide.remove" )
+ .bind( "pagehide.remove", newRemove);
+ }
+ },
+
+ addItem : function( listitem , idx ) {
+ var $item = $(listitem),
+ $li,
+ _self = this;
+
+ $li = _self.element.children( 'li' );
+ $item.css( { 'opacity' : 0,
+ 'display' : 'none' } );
+ if( $li.length == 0
+ || $li.length <= idx)
+ {
+ $( _self.element ).append( $item );
+ } else {
+ $( $li.get( idx ) ).before( $item );
+ }
+ $(_self.element).trigger("create")
+ .listview( 'refresh' );
+
+ $item.css( 'min-height' , '0px' );
+
+ $item.slideDown( 'fast' , function( ){
+ $item.addClass("addli");
+ $item.css( { 'opacity' : 1 } );
+ } );
+ },
+
+ removeItem : function( idx ) {
+ var $item,
+ $li,
+ _self = this;
+
+ $li = _self.element.children( 'li' );
+ if( $li.length <= 0 ||
+ $li.length < idx ) {
+ return ;
+ }
+ $item = $( $li.get( idx ) );
+ $item.addClass("removeli");
+ $item.slideUp('normal',
+ function( ) {
+ $(this).remove();
+ });
+ },
+
+ // TODO sort out a better way to track sub pages of the listview this is brittle
+ childPages: function() {
+ var parentUrl = this.parentPage.jqmData( "url" );
+
+ return $( ":jqmData(url^='"+ parentUrl + "&" + $.mobile.subPageUrlKey + "')" );
+ }
+});
+
+//delegate auto self-init widgets
+$.delegateSelfInitWithSingleSelector( $.mobile.listview );
+
+})( jQuery );
--- /dev/null
+
+(function( $, window ) {
+ // DEPRECATED
+ // NOTE global mobile object settings
+ $.extend( $.mobile, {
+ // DEPRECATED Should the text be visble in the loading message?
+ loadingMessageTextVisible: undefined,
+
+ // DEPRECATED When the text is visible, what theme does the loading box use?
+ loadingMessageTheme: undefined,
+
+ // DEPRECATED default message setting
+ loadingMessage: undefined,
+
+ // DEPRECATED
+ // Turn on/off page loading message. Theme doubles as an object argument
+ // with the following shape: { theme: '', text: '', html: '', textVisible: '' }
+ // NOTE that the $.mobile.loading* settings and params past the first are deprecated
+ showPageLoadingMsg: function( theme, msgText, textonly ) {
+ $.mobile.loading( 'show', theme, msgText, textonly );
+ },
+
+ // DEPRECATED
+ hidePageLoadingMsg: function() {
+ $.mobile.loading( 'hide' );
+ },
+
+ loading: function() {
+ this.loaderWidget.loader.apply( this.loaderWidget, arguments );
+ }
+ });
+
+ // TODO move loader class down into the widget settings
+ var loaderClass = "ui-loader", $html = $( "html" ), $window = $.mobile.$window;
+
+ $.widget( "mobile.loader", {
+ // NOTE if the global config settings are defined they will override these
+ // options
+ options: {
+ // the theme for the loading message
+ theme: "a",
+
+ // whether the text in the loading message is shown
+ textVisible: false,
+
+ // custom html for the inner content of the loading message
+ html: "",
+
+ // the text to be displayed when the popup is shown
+ text: "loading"
+ },
+
+ defaultHtml: "<div class='" + loaderClass + "'>" +
+ "<span class='ui-icon ui-icon-loading'></span>" +
+ "<h1></h1>" +
+ "</div>",
+
+ // For non-fixed supportin browsers. Position at y center (if scrollTop supported), above the activeBtn (if defined), or just 100px from top
+ fakeFixLoader: function() {
+ var activeBtn = $( "." + $.mobile.activeBtnClass ).first();
+
+ this.element
+ .css({
+ top: $.support.scrollTop && $window.scrollTop() + $window.height() / 2 ||
+ activeBtn.length && activeBtn.offset().top || 100
+ });
+ },
+
+ // check position of loader to see if it appears to be "fixed" to center
+ // if not, use abs positioning
+ checkLoaderPosition: function() {
+ var offset = this.element.offset(),
+ scrollTop = $window.scrollTop(),
+ screenHeight = $.mobile.getScreenHeight();
+
+ if ( offset.top < scrollTop || ( offset.top - scrollTop ) > screenHeight ) {
+ this.element.addClass( "ui-loader-fakefix" );
+ this.fakeFixLoader();
+ $window
+ .unbind( "scroll", this.checkLoaderPosition )
+ .bind( "scroll", this.fakeFixLoader );
+ }
+ },
+
+ resetHtml: function() {
+ this.element.html( $( this.defaultHtml ).html() );
+ },
+
+ // Turn on/off page loading message. Theme doubles as an object argument
+ // with the following shape: { theme: '', text: '', html: '', textVisible: '' }
+ // NOTE that the $.mobile.loading* settings and params past the first are deprecated
+ // TODO sweet jesus we need to break some of this out
+ show: function( theme, msgText, textonly ) {
+ var textVisible, message, $header, loadSettings;
+
+ this.resetHtml();
+
+ // use the prototype options so that people can set them globally at
+ // mobile init. Consistency, it's what's for dinner
+ if ( $.type(theme) === "object" ) {
+ loadSettings = $.extend( {}, this.options, theme );
+
+ // prefer object property from the param then the old theme setting
+ theme = loadSettings.theme || $.mobile.loadingMessageTheme;
+ } else {
+ loadSettings = this.options;
+
+ // here we prefer the them value passed as a string argument, then
+ // we prefer the global option because we can't use undefined default
+ // prototype options, then the prototype option
+ theme = theme || $.mobile.loadingMessageTheme || loadSettings.theme;
+ }
+
+ // set the message text, prefer the param, then the settings object
+ // then loading message
+ message = msgText || $.mobile.loadingMessage || loadSettings.text;
+
+ // prepare the dom
+ $html.addClass( "ui-loading" );
+
+ if ( $.mobile.loadingMessage !== false || loadSettings.html ) {
+ // boolean values require a bit more work :P, supports object properties
+ // and old settings
+ if ( $.mobile.loadingMessageTextVisible !== undefined ) {
+ textVisible = $.mobile.loadingMessageTextVisible;
+ } else {
+ textVisible = loadSettings.textVisible;
+ }
+
+ // add the proper css given the options (theme, text, etc)
+ // Force text visibility if the second argument was supplied, or
+ // if the text was explicitly set in the object args
+ this.element.attr("class", loaderClass +
+ " ui-corner-all ui-body-" + theme +
+ " ui-loader-" + ( textVisible || msgText || theme.text ? "verbose" : "default" ) +
+ ( loadSettings.textonly || textonly ? " ui-loader-textonly" : "" ) );
+
+ // TODO verify that jquery.fn.html is ok to use in both cases here
+ // this might be overly defensive in preventing unknowing xss
+ // if the html attribute is defined on the loading settings, use that
+ // otherwise use the fallbacks from above
+ if ( loadSettings.html ) {
+ this.element.html( loadSettings.html );
+ } else {
+ this.element.find( "h1" ).text( message );
+ }
+
+ // attach the loader to the DOM
+ this.element.appendTo( $.mobile.pageContainer );
+
+ // check that the loader is visible
+ this.checkLoaderPosition();
+
+ // on scroll check the loader position
+ $window.bind( "scroll", $.proxy( this.checkLoaderPosition, this ) );
+ }
+ },
+
+ hide: function() {
+ $html.removeClass( "ui-loading" );
+
+ if ( $.mobile.loadingMessage ) {
+ this.element.removeClass( "ui-loader-fakefix" );
+ }
+
+ $.mobile.$window.unbind( "scroll", $.proxy( this.fakeFixLoader, this) );
+ $.mobile.$window.unbind( "scroll", $.proxy( this.checkLoaderPosition, this ) );
+ }
+ });
+
+ $window.bind( 'pagecontainercreate', function() {
+ $.mobile.loaderWidget = $.mobile.loaderWidget || $( $.mobile.loader.prototype.defaultHtml ).loader();
+ });
+})(jQuery, this);
+
--- /dev/null
+(function( $, undefined ) {
+
+$.widget( "mobile.navbar", $.mobile.widget, {
+ options: {
+ iconpos: "top",
+ grid: null,
+ initSelector: ":jqmData(role='navbar')"
+ },
+
+ _create: function() {
+
+ var $navbar = this.element,
+ $navbtns = $navbar.find( "a" ),
+ iconpos = $navbtns.filter( ":jqmData(icon)" ).length ?
+ this.options.iconpos : undefined;
+
+ $navbar.addClass( "ui-navbar ui-mini" )
+ .attr( "role", "navigation" )
+ .find( "ul" )
+ .jqmEnhanceable()
+ .grid({ grid: this.options.grid });
+
+ $navbtns.buttonMarkup({
+ corners: false,
+ shadow: false,
+ inline: true,
+ iconpos: iconpos
+ });
+
+ $navbar.delegate( "a", "vclick", function( event ) {
+ if ( !$(event.target).hasClass( "ui-disabled" ) ) {
+ $navbtns.removeClass( $.mobile.activeBtnClass );
+ $( this ).addClass( $.mobile.activeBtnClass );
+ }
+ });
+
+ // Buttons in the navbar with ui-state-persist class should regain their active state before page show
+ $navbar.closest( ".ui-page" ).bind( "pagebeforeshow", function() {
+ $navbtns.filter( ".ui-state-persist" ).addClass( $.mobile.activeBtnClass );
+ });
+ }
+});
+
+//delegate auto self-init widgets
+$.delegateSelfInitWithSingleSelector( $.mobile.navbar );
+
+})( jQuery );
--- /dev/null
+(function( $, undefined ) {
+
+$.widget( "mobile.page", $.mobile.widget, {
+ options: {
+ theme: "c",
+ domCache: false,
+ keepNativeDefault: ":jqmData(role='none'), :jqmData(role='nojs')"
+ },
+
+ _create: function() {
+
+ var self = this;
+
+ // if false is returned by the callbacks do not create the page
+ if ( self._trigger( "beforecreate" ) === false ) {
+ return false;
+ }
+
+ self.element
+ .addClass( "ui-page ui-body-" + self.options.theme )
+ .bind( "pagebeforehide", function() {
+ self.removeContainerBackground();
+ } )
+ .bind( "pagebeforeshow", function() {
+ self.setContainerBackground();
+ } );
+
+ },
+
+ refresh: function() {
+ $( this.element ).children( ".ui-content" ).trigger("updatelayout", ["external"]);
+ },
+
+ /* GUI Builder only : redesign page when user drag&drop header, footer */
+ setToolbar: function () {
+ $( this.element ).trigger( "pagebeforeshow" );
+ },
+
+ removeContainerBackground: function() {
+ $.mobile.pageContainer.removeClass( "ui-overlay-" + $.mobile.getInheritedTheme( this.element.parent() ) );
+ },
+
+ // set the page container background to the page theme
+ setContainerBackground: function( theme ) {
+ if ( this.options.theme ) {
+ $.mobile.pageContainer.addClass( "ui-overlay-" + ( theme || this.options.theme ) );
+ }
+ },
+
+ addBackBtn : function ( target ) {
+ var $dest = $( ".ui-page-active .ui-footer" );
+
+ if ( target == "header" ) {
+ $dest = $( ".ui-page-active .ui-header" );
+ }
+ backBtn = $( "<a href='#' class='ui-btn-back' data-" + $.mobile.ns + "rel='back'></a>" )
+ .buttonMarkup( {icon: "header-back-btn", theme : "s"} );
+ if ( !$dest.find( ".ui-btn-back").length ) {
+ backBtn.prependTo( $dest );
+ }
+ },
+
+ keepNativeSelector: function() {
+ var options = this.options,
+ keepNativeDefined = options.keepNative && $.trim( options.keepNative );
+
+ if ( keepNativeDefined && options.keepNative !== options.keepNativeDefault ) {
+ return [options.keepNative, options.keepNativeDefault].join( ", " );
+ }
+
+ return options.keepNativeDefault;
+ }
+});
+})( jQuery );
--- /dev/null
+(function( $, undefined ) {
+
+$.mobile.page.prototype.options.backBtnText = "Back";
+$.mobile.page.prototype.options.addBackBtn = false;
+$.mobile.page.prototype.options.backBtnTheme = null;
+$.mobile.page.prototype.options.headerTheme = "a";
+$.mobile.page.prototype.options.footerTheme = "a";
+$.mobile.page.prototype.options.contentTheme = null;
+
+// NOTE bind used to force this binding to run before the buttonMarkup binding
+// which expects .ui-footer top be applied in its gigantic selector
+// TODO remove the buttonMarkup giant selector and move it to the various modules
+// on which it depends
+$.mobile.$document.bind( "pagecreate", function( e ) {
+ var $page = $( e.target ),
+ o = $page.data( "page" ).options,
+ prefix = "data-"+$.mobile.ns,
+ pageRole = $page[0].getAttribute( prefix + "role" ) || undefined,
+ pageTheme = o.theme;
+
+ $( ":jqmData(role='header'), :jqmData(role='footer'), :jqmData(role='content')", $page )
+ .jqmEnhanceable()
+ .each(function() {
+
+ var $this = $( this ),
+ role = $this[0].getAttribute( prefix + "role" ) || undefined,
+ theme = $this[0].getAttribute( prefix + "theme" ) || undefined,
+ contentTheme = theme || o.contentTheme || ( pageRole === "dialog" && pageTheme ),
+ $headeranchors,
+ leftbtn,
+ rightbtn,
+ $dest = $page.find( ".ui-footer" ),
+ backBtn;
+
+ $this.addClass( "ui-" + role );
+
+ //apply theming and markup modifications to page,header,content,footer
+ if ( role === "header" || role === "footer" ) {
+
+ var thisTheme = theme || ( role === "header" ? o.headerTheme : o.footerTheme ) || pageTheme;
+
+ $this
+ //add theme class
+ .addClass( "ui-bar-" + thisTheme )
+ // Add ARIA role
+ .attr( "role", role === "header" ? "banner" : "contentinfo" );
+
+ if ( role === "header") {
+ // Right,left buttons
+ $headeranchors = $this.children( "a, button" );
+ leftbtn = $headeranchors.hasClass( "ui-btn-left" );
+ rightbtn = $headeranchors.hasClass( "ui-btn-right" );
+
+ leftbtn = leftbtn || $headeranchors.eq( 0 ).not( ".ui-btn-right" ).addClass( "ui-btn-left" ).length;
+
+ rightbtn = rightbtn || $headeranchors.eq( 1 ).addClass( "ui-btn-right" ).length;
+
+ $( $headeranchors.get().reverse() ).each( function ( i ) {
+ $( this ).addClass( "ui-btn-right-" + i );
+ });
+ }
+
+ // Auto-add back btn on pages beyond first view
+ if ( o.addBackBtn &&
+ ( role === "footer" || role === "header" ) &&
+ $page[0].getAttribute( prefix + "url" ) !== $.mobile.path.stripHash( location.hash ) &&
+ !leftbtn ) {
+
+ if ( o.addBackBtn == "header" ) {
+ $dest = $page.find( ".ui-header" );
+ } else {
+ $dest = $page.find( ".ui-footer" );
+ }
+
+ if ( !$dest.find( ".ui-btn-back" ).length ) {
+ backBtn = $( "<a href='javascript:void(0);' class='ui-btn-back' data-" + $.mobile.ns + "rel='back'></a>" )
+ // // If theme is provided, override default inheritance
+ .buttonMarkup( { icon: "header-back-btn", theme: o.backBtnTheme || thisTheme } );
+
+ backBtn.find( ".ui-btn-text" ).text( o.backBtnText );
+ backBtn.appendTo( $dest );
+ }
+ }
+
+ // Page title
+ $this.children( "h1, h2, h3, h4, h5, h6" )
+ .addClass( "ui-title" )
+ // Regardless of h element number in src, it becomes h1 for the enhanced page
+ .attr({
+ "role": "heading",
+ "aria-level": "1",
+ "aria-label": "title",
+ "tabindex": "0"
+ });
+
+ $( ".ui-title-text-sub" ).attr( { "tabindex": "0", "aria-label": "subtitle" } );
+
+ } else if ( role === "content" ) {
+ if ( contentTheme ) {
+ $this.addClass( "ui-body-" + ( contentTheme ) );
+ }
+
+ // Add ARIA role
+ $this.attr( "role", "main" );
+ }
+ });
+});
+
+})( jQuery );
--- /dev/null
+(function( $, undefined ) {
+
+ function fitSegmentInsideSegment( winSize, segSize, offset, desired ) {
+ var ret = desired;
+
+ if ( winSize < segSize ) {
+ // Center segment if it's bigger than the window
+ ret = offset + ( winSize - segSize ) / 2;
+ } else {
+ // Otherwise center it at the desired coordinate while keeping it completely inside the window
+ ret = Math.min( Math.max( offset, desired - segSize / 2 ), offset + winSize - segSize );
+ }
+
+ return ret;
+ }
+
+ function windowCoords() {
+ var $win = $.mobile.$window;
+
+ return {
+ x: $win.scrollLeft(),
+ y: $win.scrollTop(),
+ cx: ( window.innerWidth || $win.width() ),
+ cy: ( window.innerHeight || $win.height() )
+ };
+ }
+
+ $.widget( "mobile.popup", $.mobile.widget, {
+ options: {
+ theme: null,
+ overlayTheme: null,
+ shadow: true,
+ corners: true,
+ transition: "pop",
+ positionTo: "origin",
+ tolerance: null,
+ initSelector: ":jqmData(role='popup')",
+ closeLinkSelector: "a:jqmData(rel='back')",
+ closeLinkEvents: "click.popup",
+ navigateEvents: "navigate.popup",
+ closeEvents: "navigate.popup pagebeforechange.popup",
+
+ // NOTE Windows Phone 7 has a scroll position caching issue that
+ // requires us to disable popup history management by default
+ // https://github.com/jquery/jquery-mobile/issues/4784
+ //
+ // NOTE this option is modified in _create!
+ history: false
+ },
+
+ _eatEventAndClose: function( e ) {
+ e.preventDefault();
+ e.stopImmediatePropagation();
+ this.close();
+ return false;
+ },
+
+ // Make sure the screen size is increased beyond the page height if the popup's causes the document to increase in height
+ _resizeScreen: function() {
+ var popupHeight = this._ui.container.outerHeight( true );
+
+ this._ui.screen.removeAttr( "style" );
+ if ( popupHeight > this._ui.screen.height() ) {
+ this._ui.screen.height( popupHeight );
+ }
+ },
+
+ _handleWindowKeyUp: function( e ) {
+ if ( this._isOpen && e.keyCode === $.mobile.keyCode.ESCAPE ) {
+ return this._eatEventAndClose( e );
+ }
+ },
+
+ _maybeRefreshTimeout: function() {
+ var winCoords = windowCoords();
+
+ if ( this._resizeData ) {
+ if ( winCoords.x === this._resizeData.winCoords.x &&
+ winCoords.y === this._resizeData.winCoords.y &&
+ winCoords.cx === this._resizeData.winCoords.cx &&
+ winCoords.cy === this._resizeData.winCoords.cy ) {
+ // timeout not refreshed
+ return false;
+ } else {
+ // clear existing timeout - it will be refreshed below
+ clearTimeout( this._resizeData.timeoutId );
+ }
+ }
+
+ this._resizeData = {
+ timeoutId: setTimeout( $.proxy( this, "_resizeTimeout" ), 200 ),
+ winCoords: winCoords
+ };
+
+ return true;
+ },
+
+ _resizeTimeout: function() {
+ if ( !this._maybeRefreshTimeout() && this.positionTo === "window" ) {
+ // effectively rapid-open the popup while leaving the screen intact
+ this._trigger( "beforeposition" );
+ this._ui.container
+ .removeClass( "ui-selectmenu-hidden" )
+ .offset( this._placementCoords( this._desiredCoords( undefined, undefined, "window" ) ) );
+
+ this._resizeScreen();
+ this._resizeData = null;
+ this._orientationchangeInProgress = false;
+ }
+ },
+
+ _handleWindowResize: function( e ) {
+ if ( this._isOpen ) {
+ this._maybeRefreshTimeout();
+ }
+ },
+
+ _handleWindowOrientationchange: function( e ) {
+
+ if ( !this._orientationchangeInProgress ) {
+ // effectively rapid-close the popup while leaving the screen intact
+ this._ui.container
+ .addClass( "ui-selectmenu-hidden" )
+ .removeAttr( "style" );
+
+ this._orientationchangeInProgress = true;
+ }
+ },
+
+ _create: function() {
+ var ui = {
+ screen: $( "<div class='ui-screen-hidden ui-popup-screen'></div>" ),
+ placeholder: $( "<div style='display: none;'><!-- placeholder --></div>" ),
+ container: $( "<div class='ui-popup-container ui-selectmenu-hidden'></div>" ),
+ arrow : $("<div class='ui-arrow'></div>")
+ },
+ thisPage = this.element.closest( ".ui-page" ),
+ myId = this.element.attr( "id" ),
+ self = this;
+
+ // We need to adjust the history option to be false if there's no AJAX nav.
+ // We can't do it in the option declarations because those are run before
+ // it is determined whether there shall be AJAX nav.
+ this.options.history = this.options.history && $.mobile.ajaxEnabled && $.mobile.hashListeningEnabled;
+
+ if ( thisPage.length === 0 ) {
+ thisPage = $( "body" );
+ }
+
+ // define the container for navigation event bindings
+ // TODO this would be nice at the the mobile widget level
+ this.options.container = this.options.container || $.mobile.pageContainer;
+
+ // Apply the proto
+ thisPage.append( ui.screen );
+ ui.container.insertAfter( ui.screen );
+ // Leave a placeholder where the element used to be
+ ui.placeholder.insertAfter( this.element );
+ if ( myId ) {
+ ui.screen.attr( "id", myId + "-screen" );
+ ui.container.attr( "id", myId + "-popup" );
+ ui.placeholder.html( "<!-- placeholder for " + myId + " -->" );
+ }
+ ui.container.append( this.element );
+ ui.container.append( ui.arrow );
+ // Add class to popup element
+ this.element.addClass( "ui-popup" );
+
+ // Define instance variables
+ $.extend( this, {
+ _page: thisPage,
+ _ui: ui,
+ _fallbackTransition: "",
+ _currentTransition: false,
+ _prereqs: null,
+ _isOpen: false,
+ _tolerance: null,
+ _resizeData: null,
+ _orientationchangeInProgress: false,
+ _globalHandlers: [
+ {
+ src: $.mobile.$window,
+ handler: {
+ orientationchange: $.proxy( this, "_handleWindowOrientationchange" ),
+ resize: $.proxy( this, "_handleWindowResize" ),
+ keyup: $.proxy( this, "_handleWindowKeyUp" )
+ }
+ }
+ ]
+ });
+
+ $.each( this.options, function( key, value ) {
+ // Cause initial options to be applied by their handler by temporarily setting the option to undefined
+ // - the handler then sets it to the initial value
+ self.options[ key ] = undefined;
+ self._setOption( key, value, true );
+ });
+
+ ui.screen.bind( "vclick", $.proxy( this, "_eatEventAndClose" ) );
+
+ $.each( this._globalHandlers, function( idx, value ) {
+ value.src.bind( value.handler );
+ });
+ },
+
+ _applyTheme: function( dst, theme, prefix ) {
+ var classes = ( dst.attr( "class" ) || "").split( " " ),
+ alreadyAdded = true,
+ currentTheme = null,
+ matches,
+ themeStr = String( theme );
+
+ while ( classes.length > 0 ) {
+ currentTheme = classes.pop();
+ matches = ( new RegExp( "^ui-" + prefix + "-([a-z])$" ) ).exec( currentTheme );
+ if ( matches && matches.length > 1 ) {
+ currentTheme = matches[ 1 ];
+ break;
+ } else {
+ currentTheme = null;
+ }
+ }
+
+ if ( theme !== currentTheme ) {
+ dst.removeClass( "ui-" + prefix + "-" + currentTheme );
+ if ( ! ( theme === null || theme === "none" ) ) {
+ dst.addClass( "ui-" + prefix + "-" + themeStr );
+ }
+ }
+ },
+
+ _setTheme: function( value ) {
+ this._applyTheme( this.element, value, "body" );
+ },
+
+ _setOverlayTheme: function( value ) {
+ this._applyTheme( this._ui.screen, value, "overlay" );
+
+ if ( this._isOpen ) {
+ this._ui.screen.addClass( "in" );
+ }
+ },
+
+ _setShadow: function( value ) {
+ this.element.toggleClass( "ui-overlay-shadow", value );
+ },
+
+ _setCorners: function( value ) {
+ this.element.toggleClass( "ui-corner-all", value );
+ },
+
+ _applyTransition: function( value ) {
+ this._ui.container.removeClass( this._fallbackTransition );
+ if ( value && value !== "none" ) {
+ this._fallbackTransition = $.mobile._maybeDegradeTransition( value );
+ this._ui.container.addClass( this._fallbackTransition );
+ }
+ },
+
+ _setTransition: function( value ) {
+ if ( !this._currentTransition ) {
+ this._applyTransition( value );
+ }
+ },
+
+ _setTolerance: function( value ) {
+ var tol = { t: 5, r: 5, b: 5, l: 5 };
+
+ if ( value ) {
+ var ar = String( value ).split( "," );
+
+ $.each( ar, function( idx, val ) { ar[ idx ] = parseInt( val, 10 ); } );
+
+ switch( ar.length ) {
+ // All values are to be the same
+ case 1:
+ if ( !isNaN( ar[ 0 ] ) ) {
+ tol.t = tol.r = tol.b = tol.l = ar[ 0 ];
+ }
+ break;
+
+ // The first value denotes top/bottom tolerance, and the second value denotes left/right tolerance
+ case 2:
+ if ( !isNaN( ar[ 0 ] ) ) {
+ tol.t = tol.b = ar[ 0 ];
+ }
+ if ( !isNaN( ar[ 1 ] ) ) {
+ tol.l = tol.r = ar[ 1 ];
+ }
+ break;
+
+ // The array contains values in the order top, right, bottom, left
+ case 4:
+ if ( !isNaN( ar[ 0 ] ) ) {
+ tol.t = ar[ 0 ];
+ }
+ if ( !isNaN( ar[ 1 ] ) ) {
+ tol.r = ar[ 1 ];
+ }
+ if ( !isNaN( ar[ 2 ] ) ) {
+ tol.b = ar[ 2 ];
+ }
+ if ( !isNaN( ar[ 3 ] ) ) {
+ tol.l = ar[ 3 ];
+ }
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ this._tolerance = tol;
+ },
+
+ _setOption: function( key, value ) {
+ var exclusions, setter = "_set" + key.charAt( 0 ).toUpperCase() + key.slice( 1 );
+
+ if ( this[ setter ] !== undefined ) {
+ this[ setter ]( value );
+ }
+
+ // TODO REMOVE FOR 1.2.1 by moving them out to a default options object
+ exclusions = [
+ "initSelector",
+ "closeLinkSelector",
+ "closeLinkEvents",
+ "navigateEvents",
+ "closeEvents",
+ "history",
+ "container"
+ ];
+
+ $.mobile.widget.prototype._setOption.apply( this, arguments );
+ if ( $.inArray( key, exclusions ) === -1 ) {
+ // Record the option change in the options and in the DOM data-* attributes
+ this.element.attr( "data-" + ( $.mobile.ns || "" ) + ( key.replace( /([A-Z])/, "-$1" ).toLowerCase() ), value );
+ }
+ },
+
+ // Try and center the overlay over the given coordinates
+ _placementCoords: function( desired ) {
+ // rectangle within which the popup must fit
+ var
+ winCoords = windowCoords(),
+ rc = {
+ x: this._tolerance.l,
+ y: winCoords.y + this._tolerance.t,
+ cx: winCoords.cx - this._tolerance.l - this._tolerance.r,
+ cy: winCoords.cy - this._tolerance.t - this._tolerance.b
+ },
+ menuSize, ret,
+ linkOffset = $(this.link).offset(),
+ positionOffsets = [],
+ correctionValue = [0,0],
+ arrayIdx;
+
+ // Clamp the width of the menu before grabbing its size
+ this._ui.container.css( "max-width", rc.cx );
+ menuSize = {
+ cx: this._ui.container.outerWidth( true ),
+ cy: this._ui.container.outerHeight( true )
+ };
+
+ // Center the menu over the desired coordinates, while not going outside
+ // the window tolerances. This will center wrt. the window if the popup is too large.
+ ret = {
+ x: fitSegmentInsideSegment( rc.cx, menuSize.cx, rc.x, desired.x ),
+ y: fitSegmentInsideSegment( rc.cy, menuSize.cy, rc.y, desired.y )
+ };
+
+ // Make sure the top of the menu is visible
+ ret.y = Math.max( 0, ret.y );
+
+ // If the height of the menu is smaller than the height of the document
+ // align the bottom with the bottom of the document
+
+ // fix for $( document ).height() bug in core 1.7.2.
+ var docEl = document.documentElement, docBody = document.body,
+ docHeight = Math.max( docEl.clientHeight, docBody.scrollHeight, docBody.offsetHeight, docEl.scrollHeight, docEl.offsetHeight );
+
+ ret.y -= Math.min( ret.y, Math.max( 0, ret.y + menuSize.cy - docHeight ) );
+
+ if ( this.positionTo !== "origin" )
+ {
+ return { left: ret.x, top: ret.y , arrowleft: 0 , arrowtop: 0};
+ }
+
+ positionOffsets = [ linkOffset.left,
+ linkOffset.top,
+ docEl.clientHeight - ( linkOffset.top + $(this.link).height() ),
+ docEl.clientWidth - ( linkOffset.left + $(this.link).width() )];
+ arrayIdx = positionOffsets.indexOf(Math.max.apply(window,positionOffsets));
+
+ switch( arrayIdx )
+ {
+ case 0:
+ correctionValue = [ -$(this.link).width() , 0];
+ arrowtop = ( linkOffset.top - ret.y ) + ( $(this.link).height() / 2 ) - parseInt( $(this._ui.arrow).css("border-width") ) ;
+ arrowleft = menuSize.cx;
+ $(this._ui.arrow).attr( "class", "" )
+ .addClass( "ui-arrow left" )
+ break;
+ case 1:
+ correctionValue = [ 0 , -(ret.y + menuSize.cy - linkOffset.top)];
+ arrowtop = menuSize.cy - 2;
+ arrowleft = (linkOffset.left - ret.x + correctionValue[0]) + ( $(this.link).width() / 2 ) - parseInt( $(this._ui.arrow).css("border-width") ) / 2;
+ $(this._ui.arrow).attr( "class", "" )
+ .addClass( "ui-arrow bottom" );
+ break;
+ case 2:
+ correctionValue = [ 0 , ( linkOffset.top + $(this.link).height() - ret.y ) ];
+ arrowtop = - parseInt( $(this._ui.arrow).css("border-width") ) * 2 + 1;
+ arrowleft = (linkOffset.left - ret.x + correctionValue[0]) + ( $(this.link).width() / 2 ) - parseInt( $(this._ui.arrow).css("border-width") ) / 2;
+ $(this._ui.arrow).attr( "class", "" )
+ .addClass("ui-arrow top");
+ break;
+ case 3:
+ correctionValue = [ ( menuSize.cx < $(this.link).width() ) ? ( $(this.link).width() / 2 ) + ( menuSize.cx / 2) : $(this.link).width() , 0];
+ arrowtop = ( linkOffset.top - ret.y ) + ( $(this.link).height() / 2 ) - parseInt( $(this._ui.arrow).css("border-width") ) ;
+ arrowleft = - parseInt( $(this._ui.arrow).css("border-width") ) * 2;
+ $(this._ui.arrow).attr( "class", "" )
+ .addClass("ui-arrow right");
+ break;
+ }
+
+ return { left: ret.x + correctionValue[0], top: ret.y + correctionValue[1] , arrowleft: arrowleft , arrowtop: arrowtop };
+ },
+
+ _createPrereqs: function( screenPrereq, containerPrereq, whenDone ) {
+ var self = this, prereqs;
+
+ // It is important to maintain both the local variable prereqs and self._prereqs. The local variable remains in
+ // the closure of the functions which call the callbacks passed in. The comparison between the local variable and
+ // self._prereqs is necessary, because once a function has been passed to .animationComplete() it will be called
+ // next time an animation completes, even if that's not the animation whose end the function was supposed to catch
+ // (for example, if an abort happens during the opening animation, the .animationComplete handler is not called for
+ // that animation anymore, but the handler remains attached, so it is called the next time the popup is opened
+ // - making it stale. Comparing the local variable prereqs to the widget-level variable self._prereqs ensures that
+ // callbacks triggered by a stale .animationComplete will be ignored.
+
+ prereqs = {
+ screen: $.Deferred(),
+ container: $.Deferred()
+ };
+
+ prereqs.screen.then( function() {
+ if ( prereqs === self._prereqs ) {
+ screenPrereq();
+ }
+ });
+
+ prereqs.container.then( function() {
+ if ( prereqs === self._prereqs ) {
+ containerPrereq();
+ }
+ });
+
+ $.when( prereqs.screen, prereqs.container ).done( function() {
+ if ( prereqs === self._prereqs ) {
+ self._prereqs = null;
+ whenDone();
+ }
+ });
+
+ self._prereqs = prereqs;
+ },
+
+ _animate: function( args ) {
+ // NOTE before removing the default animation of the screen
+ // this had an animate callback that would relove the deferred
+ // now the deferred is resolved immediately
+ // TODO remove the dependency on the screen deferred
+ this._ui.screen
+ .removeClass( args.classToRemove )
+ .addClass( args.screenClassToAdd );
+
+ args.prereqs.screen.resolve();
+
+ if ( args.transition && args.transition !== "none" ) {
+ if ( args.applyTransition ) {
+ this._applyTransition( args.transition );
+ }
+ this._ui.container
+ .animationComplete( $.proxy( args.prereqs.container, "resolve" ) )
+ .addClass( args.containerClassToAdd )
+ .removeClass( args.classToRemove );
+ } else {
+ args.prereqs.container.resolve();
+ }
+ },
+
+ // The desired coordinates passed in will be returned untouched if no reference element can be identified via
+ // desiredPosition.positionTo. Nevertheless, this function ensures that its return value always contains valid
+ // x and y coordinates by specifying the center middle of the window if the coordinates are absent.
+ _desiredCoords: function( x, y, positionTo ) {
+ var dst = null, offset, winCoords = windowCoords();
+
+ // Establish which element will serve as the reference
+ if ( positionTo && positionTo !== "origin" ) {
+ if ( positionTo === "window" ) {
+ x = winCoords.cx / 2 + winCoords.x;
+ y = winCoords.cy / 2 + winCoords.y;
+ } else {
+ try {
+ dst = $( positionTo );
+ } catch( e ) {
+ dst = null;
+ }
+ if ( dst ) {
+ dst.filter( ":visible" );
+ if ( dst.length === 0 ) {
+ dst = null;
+ }
+ }
+ }
+ }
+
+ // If an element was found, center over it
+ if ( dst ) {
+ offset = dst.offset();
+ x = offset.left + dst.outerWidth() / 2;
+ y = offset.top + dst.outerHeight() / 2;
+ }
+
+ // Make sure x and y are valid numbers - center over the window
+ if ( $.type( x ) !== "number" || isNaN( x ) ) {
+ x = winCoords.cx / 2 + winCoords.x;
+ }
+ if ( $.type( y ) !== "number" || isNaN( y ) ) {
+ y = winCoords.cy / 2 + winCoords.y;
+ }
+
+ return { x: x, y: y };
+ },
+
+ _openPrereqsComplete: function() {
+ var self = this;
+
+ self._ui.container.addClass( "ui-popup-active" );
+ self._isOpen = true;
+ self._resizeScreen();
+
+ // Android appears to trigger the animation complete before the popup
+ // is visible. Allowing the stack to unwind before applying focus prevents
+ // the "blue flash" of element focus in android 4.0
+ setTimeout(function(){
+ self._ui.container.attr( "tabindex", "0" ).focus();
+ self._trigger( "afteropen" );
+ });
+ },
+
+ _open: function( options ) {
+ var coords, transition,
+ androidBlacklist = ( function() {
+ var w = window,
+ ua = navigator.userAgent,
+ // Rendering engine is Webkit, and capture major version
+ wkmatch = ua.match( /AppleWebKit\/([0-9\.]+)/ ),
+ wkversion = !!wkmatch && wkmatch[ 1 ],
+ androidmatch = ua.match( /Android (\d+(?:\.\d+))/ ),
+ andversion = !!androidmatch && androidmatch[ 1 ],
+ chromematch = ua.indexOf( "Chrome" ) > -1;
+
+ // Platform is Android, WebKit version is greater than 534.13 ( Android 3.2.1 ) and not Chrome.
+ if( androidmatch !== null && andversion === "4.0" && wkversion && wkversion > 534.13 && !chromematch ) {
+ return true;
+ }
+ return false;
+ }());
+
+ // Make sure options is defined
+ options = ( options || {} );
+
+ // Copy out the transition, because we may be overwriting it later and we don't want to pass that change back to the caller
+ transition = options.transition || this.options.transition;
+
+ // Give applications a chance to modify the contents of the container before it appears
+ this._trigger( "beforeposition" );
+
+ coords = this._placementCoords( this._desiredCoords( options.x, options.y, options.positionTo || this.options.positionTo || "origin" ) );
+
+ // Count down to triggering "popupafteropen" - we have two prerequisites:
+ // 1. The popup window animation completes (container())
+ // 2. The screen opacity animation completes (screen())
+ this._createPrereqs(
+ $.noop,
+ $.noop,
+ $.proxy( this, "_openPrereqsComplete" ) );
+
+ if ( transition ) {
+ this._currentTransition = transition;
+ this._applyTransition( transition );
+ } else {
+ transition = this.options.transition;
+ }
+
+ if ( !this.options.theme ) {
+ this._setTheme( this._page.jqmData( "theme" ) || $.mobile.getInheritedTheme( this._page, "c" ) );
+ }
+
+ this._ui.screen.removeClass( "ui-screen-hidden" );
+
+ this._ui.container
+ .removeClass( "ui-selectmenu-hidden" )
+ .offset( coords );
+ this._ui.arrow.css( { top : coords.arrowtop, left : coords.arrowleft } );
+ if ( this.options.overlayTheme && androidBlacklist ) {
+ /* TODO:
+ The native browser on Android 4.0.X ("Ice Cream Sandwich") suffers from an issue where the popup overlay appears to be z-indexed
+ above the popup itself when certain other styles exist on the same page -- namely, any element set to `position: fixed` and certain
+ types of input. These issues are reminiscent of previously uncovered bugs in older versions of Android's native browser:
+ https://github.com/scottjehl/Device-Bugs/issues/3
+
+ This fix closes the following bugs ( I use "closes" with reluctance, and stress that this issue should be revisited as soon as possible ):
+
+ https://github.com/jquery/jquery-mobile/issues/4816
+ https://github.com/jquery/jquery-mobile/issues/4844
+ https://github.com/jquery/jquery-mobile/issues/4874
+ */
+
+ // TODO sort out why this._page isn't working
+ this.element.closest( ".ui-page" ).addClass( "ui-popup-open" );
+ }
+ this._animate({
+ additionalCondition: true,
+ transition: transition,
+ classToRemove: "",
+ screenClassToAdd: "in",
+ containerClassToAdd: "in",
+ applyTransition: false,
+ prereqs: this._prereqs
+ });
+ },
+
+ _closePrereqScreen: function() {
+ this._ui.screen
+ .removeClass( "out" )
+ .addClass( "ui-screen-hidden" );
+ },
+
+ _closePrereqContainer: function() {
+ this._ui.container
+ .removeClass( "reverse out" )
+ .addClass( "ui-selectmenu-hidden" )
+ .removeAttr( "style" );
+ },
+
+ _closePrereqsDone: function() {
+ var self = this, opts = self.options;
+
+ self._ui.container.removeAttr( "tabindex" );
+
+ // remove nav bindings if they are still present
+ opts.container.unbind( opts.closeEvents );
+
+ // unbind click handlers added when history is disabled
+ self.element.undelegate( opts.closeLinkSelector, opts.closeLinkEvents );
+
+ // remove the global mutex for popups
+ $.mobile.popup.active = undefined;
+
+ // alert users that the popup is closed
+ self._trigger( "afterclose" );
+ },
+
+ _close: function() {
+ this._ui.container.removeClass( "ui-popup-active" );
+ this._page.removeClass( "ui-popup-open" );
+
+ this._isOpen = false;
+
+ // IME hide when popup is closed
+ this.element.find("input").blur();
+
+ // Count down to triggering "popupafterclose" - we have two prerequisites:
+ // 1. The popup window reverse animation completes (container())
+ // 2. The screen opacity animation completes (screen())
+ this._createPrereqs(
+ $.proxy( this, "_closePrereqScreen" ),
+ $.proxy( this, "_closePrereqContainer" ),
+ $.proxy( this, "_closePrereqsDone" ) );
+
+ this._animate( {
+ additionalCondition: this._ui.screen.hasClass( "in" ),
+ transition: ( this._currentTransition || this.options.transition ),
+ classToRemove: "in",
+ screenClassToAdd: "out",
+ containerClassToAdd: "reverse out",
+ applyTransition: true,
+ prereqs: this._prereqs
+ });
+ },
+
+ _destroy: function() {
+ var self = this;
+
+ // hide and remove bindings
+ self._close();
+
+ // Put the element back to where the placeholder was and remove the "ui-popup" class
+ self._setTheme( "none" );
+ self.element
+ .insertAfter( self._ui.placeholder )
+ .removeClass( "ui-popup ui-overlay-shadow ui-corner-all" );
+ self._ui.screen.remove();
+ self._ui.container.remove();
+ self._ui.placeholder.remove();
+
+ // Unbind handlers that were bound to elements outside self.element (the window, in self case)
+ $.each( self._globalHandlers, function( idx, oneSrc ) {
+ $.each( oneSrc.handler, function( eventType, handler ) {
+ oneSrc.src.unbind( eventType, handler );
+ });
+ });
+ },
+
+ // any navigation event after a popup is opened should close the popup
+ // NOTE the pagebeforechange is bound to catch navigation events that don't
+ // alter the url (eg, dialogs from popups)
+ _bindContainerClose: function() {
+ var self = this;
+
+ self.options.container
+ .one( self.options.closeEvents, $.proxy( self._close, self ));
+ },
+
+ // TODO no clear deliniation of what should be here and
+ // what should be in _open. Seems to be "visual" vs "history" for now
+ open: function( options ) {
+ var self = this, opts = this.options, url, hashkey, activePage, currentIsDialog, hasHash, urlHistory;
+ // self.link = ( $(event.target).attr('data-role') === 'button') ? event.target : $(event.target).closest('[data-role="button"]')[0];
+ // make sure open is idempotent
+ if( $.mobile.popup.active ) {
+ return;
+ }
+ // set the global popup mutex
+ $.mobile.popup.active = this;
+ if( !options ) {
+ options = [];
+ }
+
+ if ( !options.link ) {
+ if ( !event ) {
+ self.positionTo = "window";
+ } else {
+ self.link = ( $(event.target).closest('a')[0] || $(event.target).closest('div')[0] );
+ }
+ } else {
+ self.link = options.link;
+ }
+ if ( event ) {
+ self.positionTo = ( options != null && options.positionTo != null ) ? options.positionTo : "origin";
+ }
+
+ if ( $(self.link).jqmData("position-to") !== "window"
+ && self.positionTo !== "window" ) {
+
+ $(self.element).addClass("ui-ctxpopup");
+ $(self._ui.container).removeClass("ui-popup-container")
+ .addClass("ui-ctxpopup-container");
+
+ if( self.positionTo !== "origin" ) {
+ $(self._ui.arrow).hide();
+ } else {
+ $(self._ui.arrow).show();
+ }
+ } else {
+ $(self._ui.arrow).hide();
+ // apply opacity back screen
+ this._setOverlayTheme( "dim" );
+ }
+ if( !options.x
+ && self.positionTo === "origin" ) {
+ options.x = $(self.link).offset().left + $(self.link).outerWidth() / 2;
+ }
+ if( !options.y
+ && self.positionTo === "origin" ) {
+ options.y = $(self.link).offset().top + $(self.link).outerHeight() / 2;
+ }
+ // if history alteration is disabled close on navigate events
+ // and leave the url as is
+ if( !( opts.history ) ) {
+ self._open( options );
+ self._bindContainerClose();
+
+ // When histoy is disabled we have to grab the data-rel
+ // back link clicks so we can close the popup instead of
+ // relying on history to do it for us
+ self.element
+ .delegate( opts.closeLinkSelector, opts.closeLinkEvents, function( e ) {
+ self._close();
+
+ // NOTE prevent the browser and navigation handlers from
+ // working with the link's rel=back. This may cause
+ // issues for developers expecting the event to bubble
+ return false;
+ });
+
+ return;
+ }
+
+ // cache some values for min/readability
+ hashkey = $.mobile.dialogHashKey;
+ activePage = $.mobile.activePage;
+ currentIsDialog = activePage.is( ".ui-dialog" );
+ url = $.mobile.urlHistory.getActive().url;
+ hasHash = ( url.indexOf( hashkey ) > -1 ) && !currentIsDialog;
+ urlHistory = $.mobile.urlHistory;
+
+ if ( hasHash ) {
+ self._open( options );
+ self._bindContainerClose();
+ return;
+ }
+
+ // if the current url has no dialog hash key proceed as normal
+ // otherwise, if the page is a dialog simply tack on the hash key
+ if ( url.indexOf( hashkey ) === -1 && !currentIsDialog ){
+ url = url + hashkey;
+ } else {
+ url = $.mobile.path.parseLocation().hash + hashkey;
+ }
+
+ // Tack on an extra hashkey if this is the first page and we've just reconstructed the initial hash
+ if ( urlHistory.activeIndex === 0 && url === urlHistory.initialDst ) {
+ url += hashkey;
+ }
+
+ // swallow the the initial navigation event, and bind for the next
+ opts.container.one( opts.navigateEvents, function( e ) {
+ e.preventDefault();
+ self._open( options );
+ self._bindContainerClose();
+ });
+
+ urlHistory.ignoreNextHashChange = currentIsDialog;
+
+ // Gotta love methods with 1mm args :(
+ urlHistory.addNew( url, undefined, undefined, undefined, "dialog" );
+
+ // set the new url with (or without) the new dialog hash key
+ $.mobile.path.set( url );
+ },
+
+ close: function() {
+ // make sure close is idempotent
+ if( !$.mobile.popup.active ){
+ return;
+ }
+
+ if( this.options.history ) {
+ $.mobile.back();
+ } else {
+ this._close();
+ }
+ }
+ });
+
+
+ // TODO this can be moved inside the widget
+ $.mobile.popup.handleLink = function( $link ) {
+ var closestPage = $link.closest( ":jqmData(role='page')" ),
+ scope = ( ( closestPage.length === 0 ) ? $( "body" ) : closestPage ),
+ // NOTE make sure to get only the hash, ie7 (wp7) return the absolute href
+ // in this case ruining the element selection
+ popup = $( $.mobile.path.parseUrl($link.attr( "href" )).hash, scope[0] ),
+ offset;
+
+ if ( popup.data( "popup" ) ) {
+ offset = $link.offset();
+ popup.popup( "open", {
+ x: offset.left + $link.outerWidth() / 2,
+ y: offset.top + $link.outerHeight() / 2,
+ transition: $.mobile.getAttrFixed( $link[0], "data-" + $.mobile.ns + "transition" ),
+ positionTo: $.mobile.getAttrFixed( $link[0], "data-" + $.mobile.ns + "position-to" ),
+ link: $link
+ });
+ }
+
+ //remove after delay
+ setTimeout( function() {
+ $link.removeClass( $.mobile.activeBtnClass );
+ }, 300 );
+ };
+
+ // TODO move inside _create
+ $.mobile.$document.bind( "pagebeforechange", function( e, data ) {
+ if ( data.options.role === "popup" ) {
+ $.mobile.popup.handleLink( data.options.link );
+ e.preventDefault();
+ }
+ });
+
+ $.mobile.$document.bind( "pagecreate create", function( e ) {
+ $.mobile.popup.prototype.enhanceWithin( e.target, true );
+ });
+
+})( jQuery );
--- /dev/null
+//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
+//>>description: Popup windows
+//>>label: Popups
+//>>group: Widgets
+//>>css.theme: ../css/themes/default/jquery.mobile.theme.css
+//>>css.structure: ../css/structure/jquery.mobile.popup.css,../css/structure/jquery.mobile.transition.css,../css/structure/jquery.mobile.transition.fade.css
+
+define( [ "jquery",
+ "../jquery.mobile.widget",
+ "../jquery.mobile.support",
+ "../jquery.mobile.navigation",
+ "depend!../jquery.hashchange[jquery]" ], function( $ ) {
+//>>excludeEnd("jqmBuildExclude");
+(function( $, undefined ) {
+
+ function fitSegmentInsideSegment( winSize, segSize, offset, desired ) {
+ var ret = desired;
+
+ if ( winSize < segSize ) {
+ // Center segment if it's bigger than the window
+ ret = offset + ( winSize - segSize ) / 2;
+ } else {
+ // Otherwise center it at the desired coordinate while keeping it completely inside the window
+ ret = Math.min( Math.max( offset, desired - segSize / 2 ), offset + winSize - segSize );
+ }
+
+ return ret;
+ }
+
+ function windowCoords() {
+ var $win = $.mobile.$window;
+
+ return {
+ x: $win.scrollLeft(),
+ y: $win.scrollTop(),
+ cx: ( window.innerWidth || $win.width() ),
+ cy: ( window.innerHeight || $win.height() )
+ };
+ }
+
+ $.widget( "mobile.popup", $.mobile.widget, {
+ options: {
+ theme: null,
+ overlayTheme: null,
+ shadow: true,
+ corners: true,
+ transition: "pop",
+ positionTo: "origin",
+ tolerance: null,
+ initSelector: ":jqmData(role='popup')",
+ closeLinkSelector: "a:jqmData(rel='back')",
+ closeLinkEvents: "click.popup",
+ navigateEvents: "navigate.popup",
+ closeEvents: "navigate.popup pagebeforechange.popup",
+
+ // NOTE Windows Phone 7 has a scroll position caching issue that
+ // requires us to disable popup history management by default
+ // https://github.com/jquery/jquery-mobile/issues/4784
+ //
+ // NOTE this option is modified in _create!
+ history: false
+ },
+
+ _eatEventAndClose: function( e ) {
+ e.preventDefault();
+ e.stopImmediatePropagation();
+ this.close();
+ return false;
+ },
+
+ // Make sure the screen size is increased beyond the page height if the popup's causes the document to increase in height
+ _resizeScreen: function() {
+ var popupHeight = this._ui.container.outerHeight( true );
+
+ this._ui.screen.removeAttr( "style" );
+ if ( popupHeight > this._ui.screen.height() ) {
+ this._ui.screen.height( popupHeight );
+ }
+ },
+
+ _handleWindowKeyUp: function( e ) {
+ if ( this._isOpen && e.keyCode === $.mobile.keyCode.ESCAPE ) {
+ return this._eatEventAndClose( e );
+ }
+ },
+
+ _maybeRefreshTimeout: function() {
+ var winCoords = windowCoords();
+
+ if ( this._resizeData ) {
+ if ( winCoords.x === this._resizeData.winCoords.x &&
+ winCoords.y === this._resizeData.winCoords.y &&
+ winCoords.cx === this._resizeData.winCoords.cx &&
+ winCoords.cy === this._resizeData.winCoords.cy ) {
+ // timeout not refreshed
+ return false;
+ } else {
+ // clear existing timeout - it will be refreshed below
+ clearTimeout( this._resizeData.timeoutId );
+ }
+ }
+
+ this._resizeData = {
+ timeoutId: setTimeout( $.proxy( this, "_resizeTimeout" ), 200 ),
+ winCoords: winCoords
+ };
+
+ return true;
+ },
+
+ _resizeTimeout: function() {
+ if ( !this._maybeRefreshTimeout() && this.positionTo === "window" ) {
+ // effectively rapid-open the popup while leaving the screen intact
+ this._trigger( "beforeposition" );
+ this._ui.container
+ .removeClass( "ui-selectmenu-hidden" )
+ .offset( this._placementCoords( this._desiredCoords( undefined, undefined, "window" ) ) );
+
+ this._resizeScreen();
+ this._resizeData = null;
+ this._orientationchangeInProgress = false;
+ }
+ },
+
+ _handleWindowResize: function( e ) {
+ if ( this._isOpen ) {
+ this._maybeRefreshTimeout();
+ }
+ },
+
+ _handleWindowOrientationchange: function( e ) {
+
+ if ( !this._orientationchangeInProgress ) {
+ // effectively rapid-close the popup while leaving the screen intact
+ this._ui.container
+ .addClass( "ui-selectmenu-hidden" )
+ .removeAttr( "style" );
+
+ this._orientationchangeInProgress = true;
+ }
+ },
+
+ _create: function() {
+ var ui = {
+ screen: $( "<div class='ui-screen-hidden ui-popup-screen'></div>" ),
+ placeholder: $( "<div style='display: none;'><!-- placeholder --></div>" ),
+ container: $( "<div class='ui-popup-container ui-selectmenu-hidden'></div>" ),
+ arrow : $("<div class='ui-arrow'></div>")
+ },
+ thisPage = this.element.closest( ".ui-page" ),
+ myId = this.element.attr( "id" ),
+ self = this;
+
+ // We need to adjust the history option to be false if there's no AJAX nav.
+ // We can't do it in the option declarations because those are run before
+ // it is determined whether there shall be AJAX nav.
+ this.options.history = this.options.history && $.mobile.ajaxEnabled && $.mobile.hashListeningEnabled;
+
+ if ( thisPage.length === 0 ) {
+ thisPage = $( "body" );
+ }
+
+ // define the container for navigation event bindings
+ // TODO this would be nice at the the mobile widget level
+ this.options.container = this.options.container || $.mobile.pageContainer;
+
+ // Apply the proto
+ thisPage.append( ui.screen );
+ ui.container.insertAfter( ui.screen );
+ // Leave a placeholder where the element used to be
+ ui.placeholder.insertAfter( this.element );
+ if ( myId ) {
+ ui.screen.attr( "id", myId + "-screen" );
+ ui.container.attr( "id", myId + "-popup" );
+ ui.placeholder.html( "<!-- placeholder for " + myId + " -->" );
+ }
+ ui.container.append( this.element );
+ ui.container.append( ui.arrow );
+ // Add class to popup element
+ this.element.addClass( "ui-popup" );
+
+ // Define instance variables
+ $.extend( this, {
+ _page: thisPage,
+ _ui: ui,
+ _fallbackTransition: "",
+ _currentTransition: false,
+ _prereqs: null,
+ _isOpen: false,
+ _tolerance: null,
+ _resizeData: null,
+ _orientationchangeInProgress: false,
+ _globalHandlers: [
+ {
+ src: $.mobile.$window,
+ handler: {
+ orientationchange: $.proxy( this, "_handleWindowOrientationchange" ),
+ resize: $.proxy( this, "_handleWindowResize" ),
+ keyup: $.proxy( this, "_handleWindowKeyUp" )
+ }
+ }
+ ]
+ });
+
+ $.each( this.options, function( key, value ) {
+ // Cause initial options to be applied by their handler by temporarily setting the option to undefined
+ // - the handler then sets it to the initial value
+ self.options[ key ] = undefined;
+ self._setOption( key, value, true );
+ });
+
+ ui.screen.bind( "vclick", $.proxy( this, "_eatEventAndClose" ) );
+
+ $.each( this._globalHandlers, function( idx, value ) {
+ value.src.bind( value.handler );
+ });
+ },
+
+ _applyTheme: function( dst, theme, prefix ) {
+ var classes = ( dst.attr( "class" ) || "").split( " " ),
+ alreadyAdded = true,
+ currentTheme = null,
+ matches,
+ themeStr = String( theme );
+
+ while ( classes.length > 0 ) {
+ currentTheme = classes.pop();
+ matches = ( new RegExp( "^ui-" + prefix + "-([a-z])$" ) ).exec( currentTheme );
+ if ( matches && matches.length > 1 ) {
+ currentTheme = matches[ 1 ];
+ break;
+ } else {
+ currentTheme = null;
+ }
+ }
+
+ if ( theme !== currentTheme ) {
+ dst.removeClass( "ui-" + prefix + "-" + currentTheme );
+ if ( ! ( theme === null || theme === "none" ) ) {
+ dst.addClass( "ui-" + prefix + "-" + themeStr );
+ }
+ }
+ },
+
+ _setTheme: function( value ) {
+ this._applyTheme( this.element, value, "body" );
+ },
+
+ _setOverlayTheme: function( value ) {
+ this._applyTheme( this._ui.screen, value, "overlay" );
+
+ if ( this._isOpen ) {
+ this._ui.screen.addClass( "in" );
+ }
+ },
+
+ _setShadow: function( value ) {
+ this.element.toggleClass( "ui-overlay-shadow", value );
+ },
+
+ _setCorners: function( value ) {
+ this.element.toggleClass( "ui-corner-all", value );
+ },
+
+ _applyTransition: function( value ) {
+ this._ui.container.removeClass( this._fallbackTransition );
+ if ( value && value !== "none" ) {
+ this._fallbackTransition = $.mobile._maybeDegradeTransition( value );
+ this._ui.container.addClass( this._fallbackTransition );
+ }
+ },
+
+ _setTransition: function( value ) {
+ if ( !this._currentTransition ) {
+ this._applyTransition( value );
+ }
+ },
+
+ _setTolerance: function( value ) {
+ var tol = { t: 5, r: 5, b: 5, l: 5 };
+
+ if ( value ) {
+ var ar = String( value ).split( "," );
+
+ $.each( ar, function( idx, val ) { ar[ idx ] = parseInt( val, 10 ); } );
+
+ switch( ar.length ) {
+ // All values are to be the same
+ case 1:
+ if ( !isNaN( ar[ 0 ] ) ) {
+ tol.t = tol.r = tol.b = tol.l = ar[ 0 ];
+ }
+ break;
+
+ // The first value denotes top/bottom tolerance, and the second value denotes left/right tolerance
+ case 2:
+ if ( !isNaN( ar[ 0 ] ) ) {
+ tol.t = tol.b = ar[ 0 ];
+ }
+ if ( !isNaN( ar[ 1 ] ) ) {
+ tol.l = tol.r = ar[ 1 ];
+ }
+ break;
+
+ // The array contains values in the order top, right, bottom, left
+ case 4:
+ if ( !isNaN( ar[ 0 ] ) ) {
+ tol.t = ar[ 0 ];
+ }
+ if ( !isNaN( ar[ 1 ] ) ) {
+ tol.r = ar[ 1 ];
+ }
+ if ( !isNaN( ar[ 2 ] ) ) {
+ tol.b = ar[ 2 ];
+ }
+ if ( !isNaN( ar[ 3 ] ) ) {
+ tol.l = ar[ 3 ];
+ }
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ this._tolerance = tol;
+ },
+
+ _setOption: function( key, value ) {
+ var exclusions, setter = "_set" + key.charAt( 0 ).toUpperCase() + key.slice( 1 );
+
+ if ( this[ setter ] !== undefined ) {
+ this[ setter ]( value );
+ }
+
+ // TODO REMOVE FOR 1.2.1 by moving them out to a default options object
+ exclusions = [
+ "initSelector",
+ "closeLinkSelector",
+ "closeLinkEvents",
+ "navigateEvents",
+ "closeEvents",
+ "history",
+ "container"
+ ];
+
+ $.mobile.widget.prototype._setOption.apply( this, arguments );
+ if ( $.inArray( key, exclusions ) === -1 ) {
+ // Record the option change in the options and in the DOM data-* attributes
+ this.element.attr( "data-" + ( $.mobile.ns || "" ) + ( key.replace( /([A-Z])/, "-$1" ).toLowerCase() ), value );
+ }
+ },
+
+ // Try and center the overlay over the given coordinates
+ _placementCoords: function( desired ) {
+ // rectangle within which the popup must fit
+ var
+ winCoords = windowCoords(),
+ rc = {
+ x: this._tolerance.l,
+ y: winCoords.y + this._tolerance.t,
+ cx: winCoords.cx - this._tolerance.l - this._tolerance.r,
+ cy: winCoords.cy - this._tolerance.t - this._tolerance.b
+ },
+ menuSize, ret,
+ linkOffset = $(this.link).offset(),
+ positionOffsets = [],
+ correctionValue = [0,0],
+ arrayIdx;
+
+ // Clamp the width of the menu before grabbing its size
+ this._ui.container.css( "max-width", rc.cx );
+ menuSize = {
+ cx: this._ui.container.outerWidth( true ),
+ cy: this._ui.container.outerHeight( true )
+ };
+
+ // Center the menu over the desired coordinates, while not going outside
+ // the window tolerances. This will center wrt. the window if the popup is too large.
+ ret = {
+ x: fitSegmentInsideSegment( rc.cx, menuSize.cx, rc.x, desired.x ),
+ y: fitSegmentInsideSegment( rc.cy, menuSize.cy, rc.y, desired.y )
+ };
+
+ // Make sure the top of the menu is visible
+ ret.y = Math.max( 0, ret.y );
+
+ // If the height of the menu is smaller than the height of the document
+ // align the bottom with the bottom of the document
+
+ // fix for $( document ).height() bug in core 1.7.2.
+ var docEl = document.documentElement, docBody = document.body,
+ docHeight = Math.max( docEl.clientHeight, docBody.scrollHeight, docBody.offsetHeight, docEl.scrollHeight, docEl.offsetHeight );
+
+ ret.y -= Math.min( ret.y, Math.max( 0, ret.y + menuSize.cy - docHeight ) );
+
+ if ( this.positionTo !== "origin" )
+ {
+ return { left: ret.x, top: ret.y , arrowleft: 0 , arrowtop: 0};
+ }
+
+ positionOffsets = [ linkOffset.left,
+ linkOffset.top,
+ docEl.clientHeight - ( linkOffset.top + $(this.link).height() ),
+ docEl.clientWidth - ( linkOffset.left + $(this.link).width() )];
+ arrayIdx = positionOffsets.indexOf(Math.max.apply(window,positionOffsets));
+
+ switch( arrayIdx )
+ {
+ case 0:
+ correctionValue = [ -$(this.link).width() , 0];
+ arrowtop = ( linkOffset.top - ret.y ) + ( $(this.link).height() / 2 ) - parseInt( $(this._ui.arrow).css("border-width") ) ;
+ arrowleft = menuSize.cx;
+ $(this._ui.arrow).attr( "class", "" )
+ .addClass( "ui-arrow left" )
+ break;
+ case 1:
+ correctionValue = [ 0 , -(ret.y + menuSize.cy - linkOffset.top)];
+ arrowtop = menuSize.cy - 2;
+ arrowleft = (linkOffset.left - ret.x + correctionValue[0]) + ( $(this.link).width() / 2 ) - parseInt( $(this._ui.arrow).css("border-width") ) / 2;
+ $(this._ui.arrow).attr( "class", "" )
+ .addClass( "ui-arrow bottom" );
+ break;
+ case 2:
+ correctionValue = [ 0 , ( linkOffset.top + $(this.link).height() - ret.y ) ];
+ arrowtop = - parseInt( $(this._ui.arrow).css("border-width") ) * 2 + 1;
+ arrowleft = (linkOffset.left - ret.x + correctionValue[0]) + ( $(this.link).width() / 2 ) - parseInt( $(this._ui.arrow).css("border-width") ) / 2;
+ $(this._ui.arrow).attr( "class", "" )
+ .addClass("ui-arrow top");
+ break;
+ case 3:
+ correctionValue = [ ( menuSize.cx < $(this.link).width() ) ? ( $(this.link).width() / 2 ) + ( menuSize.cx / 2) : $(this.link).width() , 0];
+ arrowtop = ( linkOffset.top - ret.y ) + ( $(this.link).height() / 2 ) - parseInt( $(this._ui.arrow).css("border-width") ) ;
+ arrowleft = - parseInt( $(this._ui.arrow).css("border-width") ) * 2;
+ $(this._ui.arrow).attr( "class", "" )
+ .addClass("ui-arrow right");
+ break;
+ }
+
+ return { left: ret.x + correctionValue[0], top: ret.y + correctionValue[1] , arrowleft: arrowleft , arrowtop: arrowtop };
+ },
+
+ _createPrereqs: function( screenPrereq, containerPrereq, whenDone ) {
+ var self = this, prereqs;
+
+ // It is important to maintain both the local variable prereqs and self._prereqs. The local variable remains in
+ // the closure of the functions which call the callbacks passed in. The comparison between the local variable and
+ // self._prereqs is necessary, because once a function has been passed to .animationComplete() it will be called
+ // next time an animation completes, even if that's not the animation whose end the function was supposed to catch
+ // (for example, if an abort happens during the opening animation, the .animationComplete handler is not called for
+ // that animation anymore, but the handler remains attached, so it is called the next time the popup is opened
+ // - making it stale. Comparing the local variable prereqs to the widget-level variable self._prereqs ensures that
+ // callbacks triggered by a stale .animationComplete will be ignored.
+
+ prereqs = {
+ screen: $.Deferred(),
+ container: $.Deferred()
+ };
+
+ prereqs.screen.then( function() {
+ if ( prereqs === self._prereqs ) {
+ screenPrereq();
+ }
+ });
+
+ prereqs.container.then( function() {
+ if ( prereqs === self._prereqs ) {
+ containerPrereq();
+ }
+ });
+
+ $.when( prereqs.screen, prereqs.container ).done( function() {
+ if ( prereqs === self._prereqs ) {
+ self._prereqs = null;
+ whenDone();
+ }
+ });
+
+ self._prereqs = prereqs;
+ },
+
+ _animate: function( args ) {
+ // NOTE before removing the default animation of the screen
+ // this had an animate callback that would relove the deferred
+ // now the deferred is resolved immediately
+ // TODO remove the dependency on the screen deferred
+ this._ui.screen
+ .removeClass( args.classToRemove )
+ .addClass( args.screenClassToAdd );
+
+ args.prereqs.screen.resolve();
+
+ if ( args.transition && args.transition !== "none" ) {
+ if ( args.applyTransition ) {
+ this._applyTransition( args.transition );
+ }
+ this._ui.container
+ .animationComplete( $.proxy( args.prereqs.container, "resolve" ) )
+ .addClass( args.containerClassToAdd )
+ .removeClass( args.classToRemove );
+ } else {
+ args.prereqs.container.resolve();
+ }
+ },
+
+ // The desired coordinates passed in will be returned untouched if no reference element can be identified via
+ // desiredPosition.positionTo. Nevertheless, this function ensures that its return value always contains valid
+ // x and y coordinates by specifying the center middle of the window if the coordinates are absent.
+ _desiredCoords: function( x, y, positionTo ) {
+ var dst = null, offset, winCoords = windowCoords();
+
+ // Establish which element will serve as the reference
+ if ( positionTo && positionTo !== "origin" ) {
+ if ( positionTo === "window" ) {
+ x = winCoords.cx / 2 + winCoords.x;
+ y = winCoords.cy / 2 + winCoords.y;
+ } else {
+ try {
+ dst = $( positionTo );
+ } catch( e ) {
+ dst = null;
+ }
+ if ( dst ) {
+ dst.filter( ":visible" );
+ if ( dst.length === 0 ) {
+ dst = null;
+ }
+ }
+ }
+ }
+
+ // If an element was found, center over it
+ if ( dst ) {
+ offset = dst.offset();
+ x = offset.left + dst.outerWidth() / 2;
+ y = offset.top + dst.outerHeight() / 2;
+ }
+
+ // Make sure x and y are valid numbers - center over the window
+ if ( $.type( x ) !== "number" || isNaN( x ) ) {
+ x = winCoords.cx / 2 + winCoords.x;
+ }
+ if ( $.type( y ) !== "number" || isNaN( y ) ) {
+ y = winCoords.cy / 2 + winCoords.y;
+ }
+
+ return { x: x, y: y };
+ },
+
+ _openPrereqsComplete: function() {
+ var self = this;
+
+ self._ui.container.addClass( "ui-popup-active" );
+ self._isOpen = true;
+ self._resizeScreen();
+
+ // Android appears to trigger the animation complete before the popup
+ // is visible. Allowing the stack to unwind before applying focus prevents
+ // the "blue flash" of element focus in android 4.0
+ setTimeout(function(){
+ self._ui.container.attr( "tabindex", "0" ).focus();
+ self._trigger( "afteropen" );
+ });
+ },
+
+ _open: function( options ) {
+ var coords, transition,
+ androidBlacklist = ( function() {
+ var w = window,
+ ua = navigator.userAgent,
+ // Rendering engine is Webkit, and capture major version
+ wkmatch = ua.match( /AppleWebKit\/([0-9\.]+)/ ),
+ wkversion = !!wkmatch && wkmatch[ 1 ],
+ androidmatch = ua.match( /Android (\d+(?:\.\d+))/ ),
+ andversion = !!androidmatch && androidmatch[ 1 ],
+ chromematch = ua.indexOf( "Chrome" ) > -1;
+
+ // Platform is Android, WebKit version is greater than 534.13 ( Android 3.2.1 ) and not Chrome.
+ if( androidmatch !== null && andversion === "4.0" && wkversion && wkversion > 534.13 && !chromematch ) {
+ return true;
+ }
+ return false;
+ }());
+
+ // Make sure options is defined
+ options = ( options || {} );
+
+ // Copy out the transition, because we may be overwriting it later and we don't want to pass that change back to the caller
+ transition = options.transition || this.options.transition;
+
+ // Give applications a chance to modify the contents of the container before it appears
+ this._trigger( "beforeposition" );
+
+ coords = this._placementCoords( this._desiredCoords( options.x, options.y, options.positionTo || this.options.positionTo || "origin" ) );
+
+ // Count down to triggering "popupafteropen" - we have two prerequisites:
+ // 1. The popup window animation completes (container())
+ // 2. The screen opacity animation completes (screen())
+ this._createPrereqs(
+ $.noop,
+ $.noop,
+ $.proxy( this, "_openPrereqsComplete" ) );
+
+ if ( transition ) {
+ this._currentTransition = transition;
+ this._applyTransition( transition );
+ } else {
+ transition = this.options.transition;
+ }
+
+ if ( !this.options.theme ) {
+ this._setTheme( this._page.jqmData( "theme" ) || $.mobile.getInheritedTheme( this._page, "c" ) );
+ }
+
+ this._ui.screen.removeClass( "ui-screen-hidden" );
+
+ this._ui.container
+ .removeClass( "ui-selectmenu-hidden" )
+ .offset( coords );
+ this._ui.arrow.css( { top : coords.arrowtop, left : coords.arrowleft } );
+ if ( this.options.overlayTheme && androidBlacklist ) {
+ /* TODO:
+ The native browser on Android 4.0.X ("Ice Cream Sandwich") suffers from an issue where the popup overlay appears to be z-indexed
+ above the popup itself when certain other styles exist on the same page -- namely, any element set to `position: fixed` and certain
+ types of input. These issues are reminiscent of previously uncovered bugs in older versions of Android's native browser:
+ https://github.com/scottjehl/Device-Bugs/issues/3
+
+ This fix closes the following bugs ( I use "closes" with reluctance, and stress that this issue should be revisited as soon as possible ):
+
+ https://github.com/jquery/jquery-mobile/issues/4816
+ https://github.com/jquery/jquery-mobile/issues/4844
+ https://github.com/jquery/jquery-mobile/issues/4874
+ */
+
+ // TODO sort out why this._page isn't working
+ this.element.closest( ".ui-page" ).addClass( "ui-popup-open" );
+ }
+ this._animate({
+ additionalCondition: true,
+ transition: transition,
+ classToRemove: "",
+ screenClassToAdd: "in",
+ containerClassToAdd: "in",
+ applyTransition: false,
+ prereqs: this._prereqs
+ });
+ },
+
+ _closePrereqScreen: function() {
+ this._ui.screen
+ .removeClass( "out" )
+ .addClass( "ui-screen-hidden" );
+ },
+
+ _closePrereqContainer: function() {
+ this._ui.container
+ .removeClass( "reverse out" )
+ .addClass( "ui-selectmenu-hidden" )
+ .removeAttr( "style" );
+ },
+
+ _closePrereqsDone: function() {
+ var self = this, opts = self.options;
+
+ self._ui.container.removeAttr( "tabindex" );
+
+ // remove nav bindings if they are still present
+ opts.container.unbind( opts.closeEvents );
+
+ // unbind click handlers added when history is disabled
+ self.element.undelegate( opts.closeLinkSelector, opts.closeLinkEvents );
+
+ // remove the global mutex for popups
+ $.mobile.popup.active = undefined;
+
+ // alert users that the popup is closed
+ self._trigger( "afterclose" );
+ },
+
+ _close: function() {
+ this._ui.container.removeClass( "ui-popup-active" );
+ this._page.removeClass( "ui-popup-open" );
+
+ this._isOpen = false;
+
+ // IME hide when popup is closed
+ this.element.find("input").blur();
+
+ // Count down to triggering "popupafterclose" - we have two prerequisites:
+ // 1. The popup window reverse animation completes (container())
+ // 2. The screen opacity animation completes (screen())
+ this._createPrereqs(
+ $.proxy( this, "_closePrereqScreen" ),
+ $.proxy( this, "_closePrereqContainer" ),
+ $.proxy( this, "_closePrereqsDone" ) );
+
+ this._animate( {
+ additionalCondition: this._ui.screen.hasClass( "in" ),
+ transition: ( this._currentTransition || this.options.transition ),
+ classToRemove: "in",
+ screenClassToAdd: "out",
+ containerClassToAdd: "reverse out",
+ applyTransition: true,
+ prereqs: this._prereqs
+ });
+ },
+
+ _destroy: function() {
+ var self = this;
+
+ // hide and remove bindings
+ self._close();
+
+ // Put the element back to where the placeholder was and remove the "ui-popup" class
+ self._setTheme( "none" );
+ self.element
+ .insertAfter( self._ui.placeholder )
+ .removeClass( "ui-popup ui-overlay-shadow ui-corner-all" );
+ self._ui.screen.remove();
+ self._ui.container.remove();
+ self._ui.placeholder.remove();
+
+ // Unbind handlers that were bound to elements outside self.element (the window, in self case)
+ $.each( self._globalHandlers, function( idx, oneSrc ) {
+ $.each( oneSrc.handler, function( eventType, handler ) {
+ oneSrc.src.unbind( eventType, handler );
+ });
+ });
+ },
+
+ // any navigation event after a popup is opened should close the popup
+ // NOTE the pagebeforechange is bound to catch navigation events that don't
+ // alter the url (eg, dialogs from popups)
+ _bindContainerClose: function() {
+ var self = this;
+
+ self.options.container
+ .one( self.options.closeEvents, $.proxy( self._close, self ));
+ },
+
+ // TODO no clear deliniation of what should be here and
+ // what should be in _open. Seems to be "visual" vs "history" for now
+ open: function( options ) {
+ var self = this, opts = this.options, url, hashkey, activePage, currentIsDialog, hasHash, urlHistory;
+ // self.link = ( $(event.target).attr('data-role') === 'button') ? event.target : $(event.target).closest('[data-role="button"]')[0];
+ // make sure open is idempotent
+ if( $.mobile.popup.active ) {
+ return;
+ }
+ // set the global popup mutex
+ $.mobile.popup.active = this;
+ if( !options ) {
+ options = [];
+ }
+
+ if ( !options.link ) {
+ if ( !event ) {
+ self.positionTo = "window";
+ } else {
+ self.link = ( $(event.target).closest('a')[0] || $(event.target).closest('div')[0] );
+ }
+ } else {
+ self.link = options.link;
+ }
+ if ( event ) {
+ self.positionTo = ( options != null && options.positionTo != null ) ? options.positionTo : "origin";
+ }
+
+ if ( $(self.link).jqmData("position-to") !== "window"
+ && self.positionTo !== "window" ) {
+
+ $(self.element).addClass("ui-ctxpopup");
+ $(self._ui.container).removeClass("ui-popup-container")
+ .addClass("ui-ctxpopup-container");
+
+ if( self.positionTo !== "origin" ) {
+ $(self._ui.arrow).hide();
+ } else {
+ $(self._ui.arrow).show();
+ }
+ } else {
+ $(self._ui.arrow).hide();
+ // apply opacity back screen
+ this._setOverlayTheme( "dim" );
+ }
+ if( !options.x
+ && self.positionTo === "origin" ) {
+ options.x = $(self.link).offset().left + $(self.link).outerWidth() / 2;
+ }
+ if( !options.y
+ && self.positionTo === "origin" ) {
+ options.y = $(self.link).offset().top + $(self.link).outerHeight() / 2;
+ }
+ // if history alteration is disabled close on navigate events
+ // and leave the url as is
+ if( !( opts.history ) ) {
+ self._open( options );
+ self._bindContainerClose();
+
+ // When histoy is disabled we have to grab the data-rel
+ // back link clicks so we can close the popup instead of
+ // relying on history to do it for us
+ self.element
+ .delegate( opts.closeLinkSelector, opts.closeLinkEvents, function( e ) {
+ self._close();
+
+ // NOTE prevent the browser and navigation handlers from
+ // working with the link's rel=back. This may cause
+ // issues for developers expecting the event to bubble
+ return false;
+ });
+
+ return;
+ }
+
+ // cache some values for min/readability
+ hashkey = $.mobile.dialogHashKey;
+ activePage = $.mobile.activePage;
+ currentIsDialog = activePage.is( ".ui-dialog" );
+ url = $.mobile.urlHistory.getActive().url;
+ hasHash = ( url.indexOf( hashkey ) > -1 ) && !currentIsDialog;
+ urlHistory = $.mobile.urlHistory;
+
+ if ( hasHash ) {
+ self._open( options );
+ self._bindContainerClose();
+ return;
+ }
+
+ // if the current url has no dialog hash key proceed as normal
+ // otherwise, if the page is a dialog simply tack on the hash key
+ if ( url.indexOf( hashkey ) === -1 && !currentIsDialog ){
+ url = url + hashkey;
+ } else {
+ url = $.mobile.path.parseLocation().hash + hashkey;
+ }
+
+ // Tack on an extra hashkey if this is the first page and we've just reconstructed the initial hash
+ if ( urlHistory.activeIndex === 0 && url === urlHistory.initialDst ) {
+ url += hashkey;
+ }
+
+ // swallow the the initial navigation event, and bind for the next
+ opts.container.one( opts.navigateEvents, function( e ) {
+ e.preventDefault();
+ self._open( options );
+ self._bindContainerClose();
+ });
+
+ urlHistory.ignoreNextHashChange = currentIsDialog;
+
+ // Gotta love methods with 1mm args :(
+ urlHistory.addNew( url, undefined, undefined, undefined, "dialog" );
+
+ // set the new url with (or without) the new dialog hash key
+ $.mobile.path.set( url );
+ },
+
+ close: function() {
+ // make sure close is idempotent
+ if( !$.mobile.popup.active ){
+ return;
+ }
+
+ if( this.options.history ) {
+ $.mobile.back();
+ } else {
+ this._close();
+ }
+ }
+ });
+
+
+ // TODO this can be moved inside the widget
+ $.mobile.popup.handleLink = function( $link ) {
+ var closestPage = $link.closest( ":jqmData(role='page')" ),
+ scope = ( ( closestPage.length === 0 ) ? $( "body" ) : closestPage ),
+ // NOTE make sure to get only the hash, ie7 (wp7) return the absolute href
+ // in this case ruining the element selection
+ popup = $( $.mobile.path.parseUrl($link.attr( "href" )).hash, scope[0] ),
+ offset;
+
+ if ( popup.data( "popup" ) ) {
+ offset = $link.offset();
+ popup.popup( "open", {
+ x: offset.left + $link.outerWidth() / 2,
+ y: offset.top + $link.outerHeight() / 2,
+ transition: $link.jqmData( "transition" ),
+ positionTo: $link.jqmData( "position-to" ),
+ link: $link
+ });
+ }
+
+ //remove after delay
+ setTimeout( function() {
+ $link.removeClass( $.mobile.activeBtnClass );
+ }, 300 );
+ };
+
+ // TODO move inside _create
+ $.mobile.$document.bind( "pagebeforechange", function( e, data ) {
+ if ( data.options.role === "popup" ) {
+ $.mobile.popup.handleLink( data.options.link );
+ e.preventDefault();
+ }
+ });
+
+ $.mobile.$document.bind( "pagecreate create", function( e ) {
+ $.mobile.popup.prototype.enhanceWithin( e.target, true );
+ });
+
+})( jQuery );
+//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
+});
+//>>excludeEnd("jqmBuildExclude");
--- /dev/null
+<div id="outer" class="ui-ctxpopup">
+ <div id="top" class="ui-ctxpopup-row" data-role="triangle" data-location="top"></div>
+ <div class="ui-ctxpopup-row">
+ <div id="left" class="ui-ctxpopup-cell" data-role="triangle" data-location="left"></div>
+ <div id="container" class="ui-ctxpopup-cell"></div>
+ <div id="right" class="ui-ctxpopup-cell" data-role="triangle" data-location="right"></div>
+ </div>
+ <div id="bottom" class="ui-ctxpopup-row" data-role="triangle" data-location="bottom"></div>
+</div>
--- /dev/null
+<div>
+ <div id="popupwindow-screen" class="ui-selectmenu-screen ui-screen-hidden ui-popupwindow-screen"></div>
+ <div id="popupwindow-container" class="ui-popupwindow ui-popupwindow-padding ui-selectmenu-hidden ui-overlay-shadow ui-corner-all"></div>
+</div>
}
})( jQuery );
/*
-* jQuery Mobile Framework Git Build: SHA1: 8f3c14b8b7b116570e29760a99cbdb8ca27a0307 <> Date: Mon Jan 28 22:00:34 2013 +0900
+* jQuery Mobile Framework Git Build: SHA1: e8f95df072513dc95469b346e4085d7eaa9dabf3 <> Date: Fri Mar 29 19:38:09 2013 +0900
* http://jquerymobile.com
*
* Copyright 2012 jQuery Foundation and other contributors
hoverDelay: 200
},
+ // define the window and the document objects
+ $window: $( window ),
+ $document: $( document ),
+
+ getAttrFixed : function( e, key ) {
+ var value = e.getAttribute( key );
+
+ return value === "true" ? true :
+ value === "false" ? false :
+ value === null ? undefined : value;
+ },
+
// TODO might be useful upstream in jquery itself ?
keyCode: {
ALT: 18,
setTimeout( function() {
window.scrollTo( 0, ypos );
- $( document ).trigger( "silentscroll", { x: 0, y: ypos });
+ $.mobile.$document.trigger( "silentscroll", { x: 0, y: ypos });
}, 20 );
setTimeout( function() {
getScreenHeight: function() {
// Native innerHeight returns more accurate value for this across platforms,
// jQuery version is here as a normalized fallback for platforms like Symbian
- return window.innerHeight || $( window ).height();
+ return window.innerHeight || $.mobile.$window.height();
}
}, $.mobile );
$.find.matchesSelector = function( node, expr ) {
return $.find( expr, null, null, [ node ] ).length > 0;
};
+
+ $.extend({
+ creatorDict: {},
+
+ delegateSelfInitWithSingleSelector: function( target, useKeepNative ) {
+ if ( typeof target !== 'function' ) {
+ return false;
+ }
+ var selector = target.prototype.options.initSelector;
+ var selectorRE = /:jqmData\(role='[A-z\-]+'\)$/;
+ if ( selectorRE.test(selector) ) {
+ var firstIdx = selector.indexOf( "'" ) + 1;
+ var lastIdx = selector.lastIndexOf( "'" );
+ var key = selector.substring( firstIdx, lastIdx );
+ if ( !$.creatorDict.hasOwnProperty( key ) ) {
+ $.creatorDict[key] = {};
+ $.creatorDict[key].target = target;
+ if ( useKeepNative === true ) {
+ $.creatorDict[key].useKeepNative = useKeepNative;
+ }
+ return true;
+ }
+ }
+ return false;
+ }
+ });
+
+ //auto self-init widgets
+ $( document ).bind( "pagecreate create", function( e ) {
+ var selector = "*[data-" + $.mobile.ns + "role]";
+ $( selector, e.target ).each( function () {
+ dataRoleValue = this.getAttribute( "data-role" );
+ matchedObj = $.creatorDict[dataRoleValue];
+ if ( matchedObj ) {
+ matchedObj.target.prototype.enhance( this, matchedObj.useKeepNative );
+ }
+ });
+ });
})( jQuery, this );
});
// TODO move loader class down into the widget settings
- var loaderClass = "ui-loader", $html = $( "html" ), $window = $( window );
+ var loaderClass = "ui-loader", $html = $( "html" ), $window = $.mobile.$window;
$.widget( "mobile.loader", {
// NOTE if the global config settings are defined they will override these
this.element.removeClass( "ui-loader-fakefix" );
}
- $( window ).unbind( "scroll", $.proxy( this.fakeFixLoader, this) );
- $( window ).unbind( "scroll", $.proxy( this.checkLoaderPosition, this ) );
+ $.mobile.$window.unbind( "scroll", $.proxy( this.fakeFixLoader, this) );
+ $.mobile.$window.unbind( "scroll", $.proxy( this.checkLoaderPosition, this ) );
}
});
blockMouseTriggers = false,
blockTouchTriggers = false,
eventCaptureSupported = "addEventListener" in document,
- $document = $( document ),
+ $document = $.mobile.$document,
nextTouchID = 1,
lastTouchID = 0, threshold;
$this.unbind( "vclick", clickHandler )
.unbind( "vmouseup", clearTapTimer );
- $( document ).unbind( "vmousecancel", clearTapHandlers );
+ $.mobile.$document.unbind( "vmousecancel", clearTapHandlers );
}
function clickHandler( event ) {
$this.bind( "vmouseup", clearTapTimer )
.bind( "vclick", clickHandler );
- $( document ).bind( "vmousecancel", clearTapHandlers );
+ $.mobile.$document.bind( "vmousecancel", clearTapHandlers );
timer = setTimeout( function() {
triggerCustomEvent( thisObject, "taphold", $.Event( "taphold", { target: origTarget } ) );
})( jQuery );
(function( $, window ) {
- var win = $( window ),
+ var win = $.mobile.$window,
event_name = "orientationchange",
special_event,
get_orientation,
// developer console. The actual threshold value is somewhat arbitrary, we just
// need to make sure it is large enough to exclude the developer console case.
- var ww = window.innerWidth || $( window ).width(),
- wh = window.innerHeight || $( window ).height(),
+ var ww = window.innerWidth || $.mobile.$window.width(),
+ wh = window.innerHeight || $.mobile.$window.height(),
landscape_threshold = 50;
initial_orientation_is_landscape = ww > wh && ( ww - wh ) > landscape_threshold;
}( jQuery, this ));
+
(function( $, undefined ) {
-var $window = $( window ),
+var $window = $.mobile.$window,
$html = $( "html" );
/* $.mobile.media method: pass a CSS media type or query and get a bool return
}
self.element
- .attr( "tabindex", "0" )
.addClass( "ui-page ui-body-" + self.options.theme )
.bind( "pagebeforehide", function() {
self.removeContainerBackground();
active = $.mobile.urlHistory.getActive(),
toScroll = active.lastScroll || $.mobile.defaultHomeScroll,
screenHeight = $.mobile.getScreenHeight(),
- maxTransitionOverride = $.mobile.maxTransitionWidth !== false && $( window ).width() > $.mobile.maxTransitionWidth,
- none = !$.support.cssTransitions || maxTransitionOverride || !name || name === "none" || Math.max( $( window ).scrollTop(), toScroll ) > $.mobile.getMaxScrollForTransition(),
+ maxTransitionOverride = $.mobile.maxTransitionWidth !== false && $.mobile.$window.width() > $.mobile.maxTransitionWidth,
+ none = !$.support.cssTransitions || maxTransitionOverride || !name || name === "none" || Math.max( $.mobile.$window.scrollTop(), toScroll ) > $.mobile.getMaxScrollForTransition(),
toPreClass = " ui-page-pre-in",
toggleViewportClass = function() {
$.mobile.pageContainer.toggleClass( "ui-mobile-viewport-transitioning viewport-" + name );
// Don't scoll window, when current scroll top(scrollTop()) is already at toScroll,
// or when current scroll top is 0 and toScroll is same to defaultHomeScroll
// (which means the top position of page). In these case, page scrolling is not needed.
- var st = $( window ).scrollTop();
+ var st = $.mobile.$window.scrollTop();
if( st === toScroll || ( $.mobile.defaultHomeScroll === toScroll && st == 0 ) ) {
return;
}
// Set the from page's height and start it transitioning out
// Note: setting an explicit height helps eliminate tiling in the transitions
$from
- .height( screenHeight + $( window ).scrollTop() )
+ .height( screenHeight + $.mobile.$window.scrollTop() )
.addClass( name + " out" + reverseClass );
},
// In some browsers (iOS5), 3D transitions block the ability to scroll to the desired location during transition
// This ensures we jump to that spot after the fact, if we aren't there already.
- if ( $( window ).scrollTop() !== toScroll ) {
+ if ( $.mobile.$window.scrollTop() !== toScroll ) {
scrollPage();
}
(function( $, undefined ) {
//define vars for interal use
- var $window = $( window ),
+ var $window = $.mobile.$window,
$html = $( 'html' ),
$head = $( 'head' ),
return promise;
}
- //simply set the active page's minimum height to screen height, depending on orientation
- function resetActivePageHeight() {
- var aPage = $( "." + $.mobile.activePageClass ),
- aPagePadT = parseFloat( aPage.css( "padding-top" ) ),
- aPagePadB = parseFloat( aPage.css( "padding-bottom" ) ),
- aPageBorderT = parseFloat( aPage.css( "border-top-width" ) ),
- aPageBorderB = parseFloat( aPage.css( "border-bottom-width" ) );
-
- aPage.css( "min-height", getScreenHeight() - aPagePadT - aPagePadB - aPageBorderT - aPageBorderB );
- }
-
//shared page enhancements
function enhancePage( $page, role ) {
// If a role was specified, make sure the data-role attribute
activeIsInitialPage = urlHistory.activeIndex === 0,
historyDir = 0,
pageTitle = document.title,
- isDialog = settings.role === "dialog" || toPage.jqmData( "role" ) === "dialog";
+ isDialog = settings.role === "dialog" || $.mobile.getAttrFixed( toPage [0], "data-" + $.mobile.ns + "role" ) === "dialog";
// By default, we prevent changePage requests when the fromPage and toPage
// are the same element, but folks that generate content manually/dynamically
$.mobile.navreadyDeferred = $.Deferred();
$.mobile.navreadyDeferred.done(function() {
//bind to form submit events, handle with Ajax
- $( document ).delegate( "form", "submit", function( event ) {
+ $.mobile.$document.delegate( "form", "submit", function( event ) {
var $this = $( this );
if ( !$.mobile.ajaxEnabled ||
{
type: type && type.length && type.toLowerCase() || "get",
data: $this.serialize(),
- transition: $this.jqmData( "transition" ),
- reverse: $this.jqmData( "direction" ) === "reverse",
+ transition: $.mobile.getAttrFixed( $this [0], "data-" + $.mobile.ns + "transition" ),
+ reverse: $.mobile.getAttrFixed( $this [0], "data-" + $.mobile.ns + "direction" ) === "reverse",
reloadPage: true
}
);
});
//add active state on vclick
- $( document ).bind( "vclick", function( event ) {
+ $.mobile.$document.bind( "vclick", function( event ) {
// if this isn't a left click we don't care. Its important to note
// that when the virtual event is generated it will create the which attr
if ( event.which > 1 || !$.mobile.linkBindingEnabled ) {
});
// click routing - direct to HTTP or Ajax, accordingly
- $( document ).bind( "click", function( event ) {
+ $.mobile.$document.bind( "click", function( event ) {
if ( !$.mobile.linkBindingEnabled ) {
return;
}
}
//use ajax
- var transition = $link.jqmData( "transition" ),
- reverse = $link.jqmData( "direction" ) === "reverse" ||
+ var transition = $.mobile.getAttrFixed( $link [0], "data-" + $.mobile.ns + "transition" ),
+ reverse = $.mobile.getAttrFixed( $link [0], "data-" + $.mobile.ns + "direction" ) === "reverse" ||
// deprecated - remove by 1.0
- $link.jqmData( "back" ),
+ $.mobile.getAttrFixed( $link [0], "data-" + $.mobile.ns + "back" ),
//this may need to be more specific as we use data-rel more
role = $link.attr( "data-" + $.mobile.ns + "rel" ) || undefined;
});
//prefetch pages when anchors with data-prefetch are encountered
- $( document ).delegate( ".ui-page", "pageshow.prefetch", function() {
+ $.mobile.$document.delegate( ".ui-page", "pageshow.prefetch", function() {
var urls = [];
$( this ).find( "a:jqmData(prefetch)" ).each(function() {
var $link = $( this ),
$.mobile._handleHashChange( path.parseLocation().hash );
});
- //set page min-heights to be device specific
- $( document ).bind( "pageshow", resetActivePageHeight );
- $( window ).bind( "throttledresize", resetActivePageHeight );
-
});//navreadyDeferred done callback
})( jQuery );
// methods handed off as event handlers
var pushStateHandler = {},
self = pushStateHandler,
- $win = $( window ),
+ $win = $.mobile.$window,
url = $.mobile.path.parseLocation(),
mobileinitDeferred = $.Deferred(),
domreadyDeferred = $.Deferred();
- $( document ).ready( $.proxy( domreadyDeferred, "resolve" ) );
+ $.mobile.$document.ready( $.proxy( domreadyDeferred, "resolve" ) );
- $( document ).one( "mobileinit", $.proxy( mobileinitDeferred, "resolve" ) );
+ $.mobile.$document.one( "mobileinit", $.proxy( mobileinitDeferred, "resolve" ) );
$.extend( pushStateHandler, {
// TODO move to a path helper, this is rather common functionality
//auto self-init widgets
-$( document ).bind( "pagecreate create", function( e ) {
+$.mobile.$document.bind( "pagecreate create", function( e ) {
var page = $.mobile.closestPageData( $( e.target ) ), options;
var $target = $( event.target ).closest( event.type === "vclick" ? "a" : "form" ),
active;
- if ( $target.length && !$target.jqmData( "transition" ) ) {
+ if ( $target.length && !$.mobile.getAttrFixed( $target[0], "data-" + $.mobile.ns + "transition" ) ) {
active = $.mobile.urlHistory.getActive() || {};
});
//auto self-init widgets
-$( document ).delegate( $.mobile.dialog.prototype.options.initSelector, "pagecreate", function() {
+$.mobile.$document.delegate( $.mobile.dialog.prototype.options.initSelector, "pagecreate", function() {
$.mobile.dialog.prototype.enhance( this );
});
// which expects .ui-footer top be applied in its gigantic selector
// TODO remove the buttonMarkup giant selector and move it to the various modules
// on which it depends
-$( document ).bind( "pagecreate", function( e ) {
+$.mobile.$document.bind( "pagecreate", function( e ) {
var $page = $( e.target ),
o = $page.data( "page" ).options,
- pageRole = $page.jqmData( "role" ),
+ prefix = "data-"+$.mobile.ns,
+ pageRole = $page[0].getAttribute( prefix + "role" ) || undefined,
pageTheme = o.theme;
$( ":jqmData(role='header'), :jqmData(role='footer'), :jqmData(role='content')", $page )
.each(function() {
var $this = $( this ),
- role = $this.jqmData( "role" ),
- theme = $this.jqmData( "theme" ),
+ role = $this[0].getAttribute( prefix + "role" ) || undefined,
+ theme = $this[0].getAttribute( prefix + "theme" ) || undefined,
contentTheme = theme || o.contentTheme || ( pageRole === "dialog" && pageTheme ),
$headeranchors,
leftbtn,
leftbtn = leftbtn || $headeranchors.eq( 0 ).not( ".ui-btn-right" ).addClass( "ui-btn-left" ).length;
rightbtn = rightbtn || $headeranchors.eq( 1 ).addClass( "ui-btn-right" ).length;
+
+ $( $headeranchors.get().reverse() ).each( function ( i ) {
+ $( this ).addClass( "ui-btn-right-" + i );
+ });
}
// Auto-add back btn on pages beyond first view
if ( o.addBackBtn &&
( role === "footer" || role === "header" ) &&
- $page.jqmData( "url" ) !== $.mobile.path.stripHash( location.hash ) &&
+ $page[0].getAttribute( prefix + "url" ) !== $.mobile.path.stripHash( location.hash ) &&
!leftbtn ) {
if ( o.addBackBtn == "header" ) {
$dest = $page.find( ".ui-footer" );
}
- backBtn = $( "<a href='javascript:void(0);' class='ui-btn-back' data-"+ $.mobile.ns +"rel='back' data-"+ $.mobile.ns +"icon='header-back-btn'></a>" )
- // If theme is provided, override default inheritance
- .attr( "data-"+ $.mobile.ns +"theme", o.backBtnTheme || thisTheme );
-
if ( !$dest.find( ".ui-btn-back" ).length ) {
- backBtn.prependTo( $dest );
+ backBtn = $( "<a href='javascript:void(0);' class='ui-btn-back' data-" + $.mobile.ns + "rel='back'></a>" )
+ // // If theme is provided, override default inheritance
+ .buttonMarkup( { icon: "header-back-btn", theme: o.backBtnTheme || thisTheme } );
+
+ backBtn.find( ".ui-btn-text" ).text( o.backBtnText );
+ backBtn.appendTo( $dest );
}
}
// Regardless of h element number in src, it becomes h1 for the enhanced page
.attr({
"role": "heading",
- "aria-level": "1"
+ "aria-level": "1",
+ "aria-label": "title",
+ "tabindex": "0"
});
+ $( ".ui-title-text-sub" ).attr( { "tabindex": "0", "aria-label": "subtitle" } );
+
} else if ( role === "content" ) {
if ( contentTheme ) {
$this.addClass( "ui-body-" + ( contentTheme ) );
};
//auto self-init widgets
-$( document ).bind( "pagecreate create", function( e ) {
+$.mobile.$document.bind( "pagecreate create", function( e ) {
$( ":jqmData(role='fieldcontain')", e.target ).jqmEnhanceable().fieldcontain();
});
(function( $, undefined ) {
-$( document ).bind( "pagecreate create", function( e ) {
+$.mobile.$document.bind( "pagecreate create", function( e ) {
$( ":jqmData(role='nojs')", e.target ).addClass( "ui-nojs" );
});
$.fn.buttonMarkup = function( options ) {
var $workingSet = this,
+ prefix = "data-" + $.mobile.ns,
mapToDataAttr = function( key, value ) {
e.setAttribute( "data-" + $.mobile.ns + key, value );
el.jqmData( key, value );
var el = $workingSet.eq( i ),
e = el[ 0 ],
o = $.extend( {}, $.fn.buttonMarkup.defaults, {
- icon: options.icon !== undefined ? options.icon : el.jqmData( "icon" ),
- iconpos: options.iconpos !== undefined ? options.iconpos : el.jqmData( "iconpos" ),
- theme: options.theme !== undefined ? options.theme : el.jqmData( "theme" ) || $.mobile.getInheritedTheme( el, $.fn.buttonMarkup.defaults["theme"] ),
- inline: options.inline !== undefined ? options.inline : el.jqmData( "inline" ),
- shadow: options.shadow !== undefined ? options.shadow : el.jqmData( "shadow" ),
- corners: options.corners !== undefined ? options.corners : el.jqmData( "corners" ),
- iconshadow: options.iconshadow !== undefined ? options.iconshadow : el.jqmData( "iconshadow" ),
- mini: options.mini !== undefined ? options.mini : el.jqmData( "mini" )
+ icon: options.icon !== undefined ? options.icon : $.mobile.getAttrFixed( e, prefix + "icon" ),
+ iconpos: options.iconpos !== undefined ? options.iconpos : $.mobile.getAttrFixed( e, prefix + "iconpos" ),
+ theme: options.theme !== undefined ? options.theme : $.mobile.getAttrFixed( e, prefix + "theme" ) || $.mobile.getInheritedTheme( el, $.fn.buttonMarkup.defaults["theme"] ),
+ inline: options.inline !== undefined ? options.inline : $.mobile.getAttrFixed( e, prefix + "inline" ),
+ shadow: options.shadow !== undefined ? options.shadow : $.mobile.getAttrFixed( e, prefix + "shadow" ),
+ corners: options.corners !== undefined ? options.corners : $.mobile.getAttrFixed( e, prefix + "corners" ),
+ iconshadow: options.iconshadow !== undefined ? options.iconshadow : $.mobile.getAttrFixed( e, prefix + "iconshadow" ),
+ mini: options.mini !== undefined ? options.mini : $.mobile.getAttrFixed( e, prefix + "mini" )
}, options ),
// Classes Defined
buttonIcon,
buttonElements;
- $.each( o, mapToDataAttr );
+ for ( key in o ) {
+ e.setAttribute ( prefix + key, o[ key ])
+ }
- if ( el.jqmData( "rel" ) === "popup" && el.attr( "href" ) ) {
+ if ( $.mobile.getAttrFixed( e, prefix + "rel" ) === "popup" && el.attr( "href" ) ) {
e.setAttribute( "aria-haspopup", true );
e.setAttribute( "aria-owns", e.getAttribute( "href" ) );
}
+ if ( e.tagName !== "LI" && e.tagName !== "LABEL" ) {
+ e.setAttribute( "role", "button" );
+ e.setAttribute( "tabindex", "0" );
+ }
+
// Check if this element is already enhanced
buttonElements = $.data( ( ( e.tagName === "INPUT" || e.tagName === "BUTTON" ) ? e.parentNode : e ), "buttonElements" );
buttonClass += o.corners ? " ui-btn-corner-all" : "";
// To distinguish real buttons
- if( el.jqmData("role") == "button" || e.tagName == "BUTTON" || e.tagName == "DIV" ){
+ if( $.mobile.getAttrFixed( e, prefix + "role" ) == "button" || e.tagName == "BUTTON" || e.tagName == "DIV" ){
buttonClass += " ui-btn-box-" + o.theme;
}
/* TIZEN style markup */
- buttonStyle = el.jqmData("style");
+ buttonStyle = $.mobile.getAttrFixed( e, prefix + "style" );
if ( buttonStyle == "circle" && !($(el).text().length > 0) ) {
/* style : no text, Icon only */
buttonClass += " ui-btn-icon_only";
innerClass += " ui-btn-icon-only";
+
+ if ( e.tagName !== "LABEL" ) {
+ $( el ).text( o.icon.replace( "naviframe-", "" ) );
+ }
}
} else {
if ( $(el).text().length > 0 ) {
var attachEvents = function() {
var hoverDelay = $.mobile.buttonMarkup.hoverDelay, hov, foc;
- $( document ).bind( {
+ $.mobile.$document.bind( {
"vmousedown vmousecancel vmouseup vmouseover vmouseout focus blur scrollstart touchend touchcancel": function( event ) {
var theme,
$btn = $( closestEnabledButton( event.target ) ),
//links in bars, or those with data-role become buttons
//auto self-init widgets
-$( document ).bind( "pagecreate create", function( e ) {
+$.mobile.$document.bind( "pagecreate create", function( e ) {
$( ":jqmData(role='button'), .ui-bar > a, .ui-header > a, .ui-footer > a, .ui-bar > :jqmData(role='controlgroup') > a", e.target )
.jqmEnhanceable()
$.widget( "mobile.collapsible", $.mobile.widget, {
options: {
- expandCueText: " click to expand contents",
- collapseCueText: " click to collapse contents",
+ expandCueText: " Expandable list, tap to open list",
+ collapseCueText: " Expandable list, tap to close list",
collapsed: true,
heading: "h1,h2,h3,h4,h5,h6,legend",
theme: null,
o = this.options,
collapsible = $el.addClass( "ui-collapsible" ),
collapsibleHeading = $el.children( o.heading ).first(),
- collapsedIcon = $el.jqmData( "collapsed-icon" ) || o.collapsedIcon,
- expandedIcon = $el.jqmData( "expanded-icon" ) || o.expandedIcon,
+ collapsedIcon = $.mobile.getAttrFixed( $el[0], "data-" + $.mobile.ns + "collapsed-icon" ) || o.collapsedIcon,
+ expandedIcon = $.mobile.getAttrFixed( $el[0], "data-" + $.mobile.ns + "expanded-icon" ) || o.expandedIcon,
collapsibleContent = collapsible.wrapInner( "<div class='ui-collapsible-content'></div>" ).children( ".ui-collapsible-content" ),
collapsibleSet = $el.closest( ":jqmData(role='collapsible-set')" ).addClass( "ui-collapsible-set" );
if ( collapsibleSet.length ) {
// Inherit the theme from collapsible-set
if ( !o.theme ) {
- o.theme = collapsibleSet.jqmData( "theme" ) || $.mobile.getInheritedTheme( collapsibleSet, "c" );
+ o.theme = $.mobile.getAttrFixed( collapsibleSet[0], "data-" + $.mobile.ns + "theme" ) || $.mobile.getInheritedTheme( collapsibleSet, "c" );
}
// Inherit the content-theme from collapsible-set
if ( !o.contentTheme ) {
- o.contentTheme = collapsibleSet.jqmData( "content-theme" );
+ o.contentTheme = $.mobile.getAttrFixed( collapsibleSet[0], "data-" + $.mobile.ns + "content-theme" );
}
// Get the preference for collapsed icon in the set
if ( !o.collapsedIcon ) {
- o.collapsedIcon = collapsibleSet.jqmData( "collapsed-icon" );
+ o.collapsedIcon = $.mobile.getAttrFixed( collapsibleSet[0], "data-" + $.mobile.ns + "collapsed-icon" );
}
// Get the preference for expanded icon in the set
if ( !o.expandedIcon ) {
- o.expandedIcon = collapsibleSet.jqmData( "expanded-icon" );
+ o.expandedIcon = $.mobile.getAttrFixed( collapsibleSet[0], "data-" + $.mobile.ns + "expanded-icon" );
}
// Gets the preference icon position in the set
if ( !o.iconPos ) {
- o.iconPos = collapsibleSet.jqmData( "iconpos" );
+ o.iconPos = $.mobile.getAttrFixed( collapsibleSet[0], "data-" + $.mobile.ns + "iconpos" );
}
// Inherit the preference for inset from collapsible-set or set the default value to ensure equalty within a set
- if ( collapsibleSet.jqmData( "inset" ) !== undefined ) {
- o.inset = collapsibleSet.jqmData( "inset" );
+ if ( $.mobile.getAttrFixed( collapsibleSet[0], "data-" + $.mobile.ns + "inset" ) !== undefined ) {
+ o.inset = $.mobile.getAttrFixed( collapsibleSet[0], "data-" + $.mobile.ns + "inset" );
} else {
o.inset = true;
}
// Gets the preference for mini in the set
if ( !o.mini ) {
- o.mini = collapsibleSet.jqmData( "mini" );
+ o.mini = $.mobile.getAttrFixed( collapsibleSet[0], "data-" + $.mobile.ns + "mini" );
}
} else {
// get inherited theme if not a set and no theme has been set
collapsibleContent.addClass( ( o.contentTheme ) ? ( "ui-body-" + o.contentTheme ) : "");
- collapsedIcon = $el.jqmData( "collapsed-icon" ) || o.collapsedIcon || "plus";
- expandedIcon = $el.jqmData( "expanded-icon" ) || o.expandedIcon || "minus";
+ collapsedIcon = $.mobile.getAttrFixed( $el[0], "data-" + $.mobile.ns + "collapsed-icon" ) || o.collapsedIcon || "plus";
+ expandedIcon = $.mobile.getAttrFixed( $el[0], "data-" + $.mobile.ns + "expanded-icon" ) || o.expandedIcon || "minus";
collapsibleHeading
//drop heading in before content
.buttonMarkup({
shadow: false,
corners: false,
- iconpos: $el.jqmData( "iconpos" ) || o.iconPos || "left",
+ iconpos: $.mobile.getAttrFixed( $el[0], "data-" + $.mobile.ns + "iconpos" ) || o.iconPos || "left",
icon: collapsedIcon,
mini: o.mini,
theme: o.theme
- });
+ })
+ .attr( "role", "");
if ( !!o.inset ) {
collapsibleHeading
$this.toggleClass( "ui-collapsible-collapsed", isCollapse );
collapsibleContent.toggleClass( "ui-collapsible-content-collapsed", isCollapse ).attr( "aria-hidden", isCollapse );
+ collapsibleContent.children( "li" ).not( "ui-collapsible-content" ).attr( "tabindex", isCollapse ? "" : "0" );
if ( contentTheme && !!o.inset && ( !collapsibleSet.length || collapsible.jqmData( "collapsible-last" ) ) ) {
collapsibleHeading
}
});
-//auto self-init widgets
-$( document ).bind( "pagecreate create", function( e ) {
- $.mobile.collapsible.prototype.enhanceWithin( e.target );
-});
+//delegate auto self-init widgets
+$.delegateSelfInitWithSingleSelector( $.mobile.collapsible );
})( jQuery );
}
// Inherit the content-theme from collapsible-set
if ( !o.contentTheme ) {
- o.contentTheme = $el.jqmData( "content-theme" );
+ o.contentTheme = $.mobile.getAttrFixed( $el[0], "data-" + $.mobile.ns + "content-theme" );
}
- if ( $el.jqmData( "inset" ) !== undefined ) {
- o.inset = $el.jqmData( "inset" );
+ if ( $.mobile.getAttrFixed( $el[0], "data-" + $.mobile.ns + "inset" ) !== undefined ) {
+ o.inset = $.mobile.getAttrFixed( $el[0], "data-" + $.mobile.ns + "inset" );
}
o.inset = o.inset !== undefined ? o.inset : true;
}
});
-//auto self-init widgets
-$( document ).bind( "pagecreate create", function( e ) {
- $.mobile.collapsibleset.prototype.enhanceWithin( e.target );
-});
+//delegate auto self-init widgets
+$.delegateSelfInitWithSingleSelector( $.mobile.collapsibleset );
})( jQuery );
}
});
-//auto self-init widgets
-$( document ).bind( "pagecreate create", function( e ) {
- $.mobile.navbar.prototype.enhanceWithin( e.target );
-});
+//delegate auto self-init widgets
+$.delegateSelfInitWithSingleSelector( $.mobile.navbar );
})( jQuery );
for ( i = 0; i < len; i++ ) {
img = $( this._findFirstElementByTagName( containers[ i ].firstChild, "nextSibling", "img", "IMG" ) );
if ( img.length ) {
- img.addClass( "ui-li-thumb" );
+ img.addClass( "ui-li-thumb" ).attr( {
+ "role" : "",
+ "aria-label" : "icon"
+ });
$( this._findFirstElementByTagName( img[ 0 ].parentNode, "parentNode", "li", "LI" ) ).addClass( img.is( ".ui-li-icon" ) ? "ui-li-has-icon" : "ui-li-has-thumb" );
}
}
{
var i, btnAttr, len = containers.length;
for ( i = 0; i < len; i++ ) {
- btnAttr = $( containers[ i ] ).find( ":jqmData(role='button')" ) || ( $( containers[ i ] ).find( "input" ).attr( "type" ) == "button" );
+ btnAttr = $( containers[ i ] ).find( ":jqmData(role='button'),input[type='button'],select:jqmData(role='slider')" );
if ( btnAttr.length ) {
if ( btnAttr.jqmData( "style" ) == "circle" ) {
$( containers[ i ] ).addClass( "ui-li-has-right-circle-btn" );
var o = this.options,
$list = this.element,
self = this,
- dividertheme = $list.jqmData( "dividertheme" ) || o.dividerTheme,
- listsplittheme = $list.jqmData( "splittheme" ),
- listspliticon = $list.jqmData( "spliticon" ),
+ dividertheme = $.mobile.getAttrFixed( $list[0], "data-" + $.mobile.ns + "dividertheme" ) || o.dividerTheme,
+ listsplittheme = $.mobile.getAttrFixed( $list[0], "data-" + $.mobile.ns + "splittheme" ),
+ listspliticon = $.mobile.getAttrFixed( $list[0], "data-" + $.mobile.ns + "spliticon" ),
li = this._getChildrenByTagName( $list[ 0 ], "li", "LI" ),
ol = !!$.nodeName( $list[ 0 ], "ol" ),
jsCount = !$.support.cssPseudoElement,
// If we're creating the element, we update it regardless
if ( create || !item.hasClass( "ui-li" ) ) {
- itemTheme = item.jqmData( "theme" ) || o.theme;
- a = this._getChildrenByTagName( item[ 0 ], "a", "A" );
- var isDivider = ( item.jqmData( "role" ) === "list-divider" );
+ itemTheme = $.mobile.getAttrFixed( item[0], "data-" + $.mobile.ns + "theme" ) || o.theme;
+ a = this._getChildrenByTagName( item[ 0 ], "a", "A" ).attr( {
+ "role": "",
+ "tabindex": "0"
+ });
+ var isDivider = ( $.mobile.getAttrFixed( item[0], "data-" + $.mobile.ns + "role" ) === "list-divider" );
+
+ if ( item.hasClass( "ui-li-has-checkbox" ) || item.hasClass( "ui-li-has-radio" ) ) {
+ item.on( "vclick", function ( e ) {
+ var targetItem = $( e.target );
+ var checkboxradio = targetItem.find( ".ui-checkbox" );
+ if ( !checkboxradio.length ) {
+ checkboxradio = targetItem.find( ".ui-radio" );
+ }
+
+ if ( checkboxradio.length ) {
+ checkboxradio.children( "label" ).trigger( "vclick" );
+ }
+ });
+ }
if ( a.length && !isDivider ) {
- icon = item.jqmData( "icon" );
+ icon = $.mobile.getAttrFixed( item[0], "data-" + $.mobile.ns + "icon" );
/* Remove auto populated right-arrow button. */
if ( icon === undefined ) {
itemClass += " ui-li-has-alt";
last = a.last();
- splittheme = listsplittheme || last.jqmData( "theme" ) || o.splitTheme;
- linkIcon = last.jqmData( "icon" );
+ splittheme = listsplittheme || $.mobile.getAttrFixed( last[0], "data-" + $.mobile.ns + "theme" ) || o.splitTheme;
+ linkIcon = $.mobile.getAttrFixed( last[0], "data-" + $.mobile.ns + "icon" );
last.appendTo( item )
.attr( "title", last.getEncodedText() )
} else if ( isDivider ) {
itemClass += " ui-li-divider ui-bar-" + dividertheme;
- item.attr( "role", "heading" );
+ item.attr( { "role": "heading", "tabindex": "0" } );
if ( ol ) {
//reset counter when a divider heading is encountered
} else {
itemClass += " ui-li-static ui-btn-up-" + itemTheme;
+ item.attr( "tabindex", "0" );
}
}
.find( ".ui-li-count" ).each(function() {
$( this ).closest( "li" ).addClass( "ui-li-has-count" );
- }).addClass( "ui-btn-up-" + ( $list.jqmData( "counttheme" ) || this.options.countTheme) + " ui-btn-corner-all" );
+ }).addClass( "ui-btn-up-" + ( $.mobile.getAttrFixed( $list[0], "data-" + $.mobile.ns + "counttheme" ) || this.options.countTheme) + " ui-btn-corner-all" );
// The idea here is to look at the first image in the list item
// itself, and any .ui-link-inherit element it may contain, so we
nodeEls = nodeElsFull.length ? nodeElsFull : $( "<span>" + $.trim(parent.contents()[ 0 ].nodeValue) + "</span>" ),
title = nodeEls.first().getEncodedText(),//url limits to first 30 chars of text
id = ( parentUrl || "" ) + "&" + $.mobile.subPageUrlKey + "=" + listId,
- theme = list.jqmData( "theme" ) || o.theme,
- countTheme = list.jqmData( "counttheme" ) || parentList.jqmData( "counttheme" ) || o.countTheme,
+ theme = $.mobile.getAttrFixed( list[0], "data-" + $.mobile.ns + "theme" ) || o.theme,
+ countTheme = $.mobile.getAttrFixed( list[0], "data-" + $.mobile.ns + "counttheme" ) || $.mobile.getAttrFixed( parentList[0], "data-" + $.mobile.ns + "counttheme" ) || o.countTheme,
newPage, anchor;
//define hasSubPages for use in later removal
}
});
-//auto self-init widgets
-$( document ).bind( "pagecreate create", function( e ) {
- $.mobile.listview.prototype.enhanceWithin( e.target );
-});
+//delegate auto self-init widgets
+$.delegateSelfInitWithSingleSelector( $.mobile.listview );
})( jQuery );
return text;
};
-$( document ).delegate( "ul,ol", "listviewcreate", function() {
+$.mobile.$document.delegate( "ul,ol", "listviewcreate", function() {
var list = $( this ),
listview = list.data( "listview" );
checkedClass = "ui-" + checkedState + activeBtn,
uncheckedClass = "ui-" + uncheckedState,
checkedicon = "ui-icon-" + checkedState,
- uncheckedicon = "ui-icon-" + uncheckedState;
+ uncheckedicon = "ui-icon-" + uncheckedState,
+ ariaCheckedAttr = "";
if ( inputtype !== "checkbox" && inputtype !== "radio" ) {
return;
}
+ ariaCheckedAttr = ( inputtype === "checkbox" ) ? "aria-checked" : "aria-selected";
+
// Support fake label
if ( label.length == 0 ) {
label = $( "<label for='" + input[ 0 ].id +
checkedClass: checkedClass,
uncheckedClass: uncheckedClass,
checkedicon: checkedicon,
- uncheckedicon: uncheckedicon
+ uncheckedicon: uncheckedicon,
+ ariaCheckedAttr : ariaCheckedAttr
});
// If there's no selected theme check the data attr
// Wrap the input + label in a div
var wrapper = document.createElement('div');
wrapper.className = 'ui-' + inputtype;
+ wrapper.setAttribute( "role", inputtype );
if ( input.hasClass( "favorite" ) ) {
wrapper.className += ' favorite';
refresh: function() {
var input = this.element[0],
label = this.label,
+ wrapper = input.parentNode,
icon = label.find( ".ui-icon" );
if ( input.checked ) {
label.addClass( this.checkedClass ).removeClass( this.uncheckedClass );
icon.addClass( this.checkedicon ).removeClass( this.uncheckedicon );
+ wrapper.setAttribute( this.ariaCheckedAttr, true );
} else {
label.removeClass( this.checkedClass ).addClass( this.uncheckedClass );
icon.removeClass( this.checkedicon ).addClass( this.uncheckedicon );
+ wrapper.setAttribute( this.ariaCheckedAttr, false );
}
if ( input.disabled ) {
});
//auto self-init widgets
-$( document ).bind( "pagecreate create", function( e ) {
+$.mobile.$document.bind( "pagecreate create", function( e ) {
$.mobile.checkboxradio.prototype.enhanceWithin( e.target, true );
});
o = this.options,
type,
name,
- inline = o.inline || $el.jqmData( "inline" ),
- mini = o.mini || $el.jqmData( "mini" ),
+ inline = o.inline || $.mobile.getAttrFixed( $el[0], "data-" + $.mobile.ns + "inline" ),
+ mini = o.mini || $.mobile.getAttrFixed( $el[0], "data-" + $.mobile.ns + "mini" ),
classes = "",
$buttonPlaceholder;
}).insertBefore( $el );
// Bind to doc to remove after submit handling
- $( document ).one( "submit", function() {
+ $.mobile.$document.one( "submit", function() {
$buttonPlaceholder.remove();
// reset the local var so that the hidden input
});
//auto self-init widgets
-$( document ).bind( "pagecreate create", function( e ) {
+$.mobile.$document.bind( "pagecreate create", function( e ) {
$.mobile.button.prototype.enhanceWithin( e.target, true );
});
return this.each(function() {
var $el = $( this ),
o = $.extend({
- direction: $el.jqmData( "type" ) || "vertical",
+ direction: $.mobile.getAttrFixed( $el[0], "data-"+ $.mobile.ns + "type" ) || "vertical",
shadow: false,
excludeInvisible: true,
- mini: $el.jqmData( "mini" )
+ mini: $.mobile.getAttrFixed( $el[0], "data-"+ $.mobile.ns + "mini" )
}, options ),
grouplegend = $el.children( "legend" ),
groupheading = $el.children( ".ui-controlgroup-label" ),
(function( $, undefined ) {
-$( document ).bind( "pagecreate create", function( e ) {
+$.mobile.$document.bind( "pagecreate create", function( e ) {
//links within content areas, tests included with page
$( e.target )
}
function windowCoords() {
- var $win = $( window );
+ var $win = $.mobile.$window;
return {
x: $win.scrollLeft(),
_orientationchangeInProgress: false,
_globalHandlers: [
{
- src: $( window ),
+ src: $.mobile.$window,
handler: {
orientationchange: $.proxy( this, "_handleWindowOrientationchange" ),
resize: $.proxy( this, "_handleWindowResize" ),
{
case 0:
correctionValue = [ -$(this.link).width() , 0];
- arrow.attr( "class", "" )
- .addClass( "ui-arrow right" );
+ arrowtop = ( linkOffset.top - ret.y ) + ( $(this.link).height() / 2 ) - parseInt( $(this._ui.arrow).css("border-width") ) ;
+ arrowleft = menuSize.cx;
+ $(this._ui.arrow).attr( "class", "" )
+ .addClass( "ui-arrow left" )
break;
case 1:
correctionValue = [ 0 , -(ret.y + menuSize.cy - linkOffset.top)];
- arrowtop = menuSize.cy - 1;
+ arrowtop = menuSize.cy - 2;
arrowleft = (linkOffset.left - ret.x + correctionValue[0]) + ( $(this.link).width() / 2 ) - parseInt( $(this._ui.arrow).css("border-width") ) / 2;
$(this._ui.arrow).attr( "class", "" )
.addClass( "ui-arrow bottom" );
if( !options ) {
options = [];
}
+
if ( !options.link ) {
- self.link = $(event.target).closest('a')[0];
+ if ( !event ) {
+ self.positionTo = "window";
+ } else {
+ self.link = ( $(event.target).closest('a')[0] || $(event.target).closest('div')[0] );
+ }
} else {
self.link = options.link;
}
- self.positionTo = ( options != null && options.positionTo != null ) ? options.positionTo : "origin";
+ if ( event ) {
+ self.positionTo = ( options != null && options.positionTo != null ) ? options.positionTo : "origin";
+ }
+
if ( $(self.link).jqmData("position-to") !== "window"
&& self.positionTo !== "window" ) {
}
} else {
$(self._ui.arrow).hide();
+ // apply opacity back screen
+ this._setOverlayTheme( "dim" );
}
if( !options.x
&& self.positionTo === "origin" ) {
popup.popup( "open", {
x: offset.left + $link.outerWidth() / 2,
y: offset.top + $link.outerHeight() / 2,
- transition: $link.jqmData( "transition" ),
- positionTo: $link.jqmData( "position-to" ),
+ transition: $.mobile.getAttrFixed( $link[0], "data-" + $.mobile.ns + "transition" ),
+ positionTo: $.mobile.getAttrFixed( $link[0], "data-" + $.mobile.ns + "position-to" ),
link: $link
});
}
};
// TODO move inside _create
- $( document ).bind( "pagebeforechange", function( e, data ) {
+ $.mobile.$document.bind( "pagebeforechange", function( e, data ) {
if ( data.options.role === "popup" ) {
$.mobile.popup.handleLink( data.options.link );
e.preventDefault();
}
});
- $( document ).bind( "pagecreate create", function( e ) {
+ $.mobile.$document.bind( "pagecreate create", function( e ) {
$.mobile.popup.prototype.enhanceWithin( e.target, true );
});
o = this.options,
theme = o.theme || $.mobile.getInheritedTheme( this.element, "c" ),
themeclass = " ui-body-" + theme,
- mini = input.jqmData( "mini" ) === true,
+ mini = $.mobile.getAttrFixed( input[0], "data-" + $.mobile.ns + "mini" ) === true,
miniclass = mini ? " ui-mini" : "",
focusedEl, clearbtn;
focusedEl = input.addClass("ui-input-text ui-body-"+ theme );
+ switch ( input.attr( "type" ) ) {
+ case "text":
+ case "password":
+ case "number":
+ case "email":
+ case "url":
+ case "tel":
+ input.attr( { "role" : "textbox", "aria-label" : "Keyboard opened" } );
+ break;
+ default:
+ if ( input.prop( "tagName" ).toLowerCase() === "textarea" ) {
+ input.attr( { "role" : "textbox", "aria-label" : "Keyboard opened" } );
+ }
+ }
+
// XXX: Temporary workaround for issue 785 (Apple bug 8910589).
// Turn off autocorrect and autocomplete on non-iOS 5 devices
// since the popup they use can't be dismissed by the user. Note
// binding to pagechange here ensures that for pages loaded via
// ajax the height is recalculated without user input
- this._on( $(document), {"pagechange": "_keyup" });
+ this._on( $.mobile.$document, {"pagechange": "_keyup" });
// Issue 509: the browser is not providing scrollHeight properly until the styles load
if ( $.trim( input.val() ) ) {
// bind to the window load to make sure the height is calculated based on BOTH
// the DOM and CSS
- this._on( $(window), {"load": "_keyup"});
+ this._on( $.mobile.$window, {"load": "_keyup"});
}
}
if ( input.attr( "disabled" ) ) {
});
//auto self-init widgets
-$( document ).bind( "pagecreate create", function( e ) {
+$.mobile.$document.bind( "pagecreate create", function( e ) {
$.mobile.textinput.prototype.enhanceWithin( e.target, true );
});
$.mobile.listview.prototype.options.filterCallback = defaultFilterCallback;
-$( document ).delegate( ":jqmData(role='listview')", "listviewcreate", function() {
+$.mobile.$document.delegate( ":jqmData(role='listview')", "listviewcreate", function() {
var list = $( this ),
listview = list.data( "listview" );
for ( var i = listItems.length - 1; i >= 0; i-- ) {
item = $( listItems[ i ] );
- itemtext = item.jqmData( "filtertext" ) || item.text();
+ itemtext = $.mobile.getAttrFixed( item[0], "data-" + $.mobile.ns + "filtertext" ) || item.text();
if ( item.is( "li:jqmData(role=list-divider)" ) ) {
step = window.parseFloat( control.attr( "step" ) || 1 ),
- inlineClass = ( this.options.inline || control.jqmData( "inline" ) === true ) ? " ui-slider-inline" : "",
+ inlineClass = ( this.options.inline || $.mobile.getAttrFixed( control[0], "data-" + $.mobile.ns + "inline" ) === true ) ? " ui-slider-inline" : "",
- miniClass = ( this.options.mini || control.jqmData( "mini" ) ) ? " ui-slider-mini" : "",
+ miniClass = ( this.options.mini || $.mobile.getAttrFixed( control[0], "data-" + $.mobile.ns + "min" ) ) ? " ui-slider-mini" : "",
domHandle = document.createElement( 'a' ),
domSlider = document.createElement( 'div' ),
slider = $( domSlider ),
- valuebg = control.jqmData( "highlight" ) !== false && cType !== "select" ? (function() {
+ valuebg = $.mobile.getAttrFixed( control[0], "data-" + $.mobile.ns + "highlight" ) !== false && cType !== "select" ? (function() {
var bg = document.createElement('div');
bg.className = 'ui-slider-bg ' + $.mobile.activeBtnClass + ' ui-btn-corner-all';
return $( bg ).prependTo( slider );
}
}
- this._on( $( document ), { "vmousemove": this._preventDocumentDrag });
+ this._on( $.mobile.$document, { "vmousemove": this._preventDocumentDrag });
// it appears the clicking the up and down buttons in chrome on
// range/number inputs doesn't trigger a change until the field is
});
//auto self-init widgets
-$( document ).bind( "pagecreate create", function( e ) {
+$.mobile.$document.bind( "pagecreate create", function( e ) {
$.mobile.slider.prototype.enhanceWithin( e.target, true );
});
options = this.options,
- inline = options.inline || this.select.jqmData( "inline" ),
- mini = options.mini || this.select.jqmData( "mini" ),
- iconpos = options.icon ? ( options.iconpos || this.select.jqmData( "iconpos" ) ) : false,
+ inline = options.inline || $.mobile.getAttrFixed( this.select[0], "data-" + $.mobile.ns + "inline" ),
+ mini = options.mini || $.mobile.getAttrFixed( this.select[0], "data-" + $.mobile.ns + "mini" ),
+ iconpos = options.icon ? ( options.iconpos || $.mobile.getAttrFixed( this.select[0], "data-" + $.mobile.ns + "iconpos" ) ) : false,
// IE throws an exception at options.item() function when
// there is no selected item
});
//auto self-init widgets
-$( document ).bind( "pagecreate create", function( e ) {
+$.mobile.$document.bind( "pagecreate create", function( e ) {
$.mobile.selectmenu.prototype.enhanceWithin( e.target, true );
});
})( jQuery );
}
var self = this,
- $window = $( window ),
+ $window = $.mobile.$window,
selfListParent = self.list.parent(),
menuHeight = selfListParent.outerHeight(),
menuWidth = selfListParent.outerWidth(),
};
// issue #3894 - core doesn't trigger events on disabled delegates
- $( document ).bind( "selectmenubeforecreate", function( event ) {
+ $.mobile.$document.bind( "selectmenubeforecreate", function( event ) {
var selectmenuWidget = $( event.target ).data( "selectmenu" );
if ( !selectmenuWidget.options.nativeMenu &&
var thisPage = this;
self.updatePagePadding( thisPage );
if ( o.updatePagePadding ) {
- $( window ).bind( "throttledresize." + self.widgetName, function() {
+ $.mobile.$window.bind( "throttledresize." + self.widgetName, function() {
self.updatePagePadding( thisPage );
});
}
$.mobile.zoom.enable( true );
}
if ( o.updatePagePadding ) {
- $( window ).unbind( "throttledresize." + self.widgetName );
+ $.mobile.$window.unbind( "throttledresize." + self.widgetName );
}
if ( o.trackPersistentToolbars ) {
},
_useTransition: function( notransition ) {
- var $win = $( window ),
+ var $win = $.mobile.$window,
$el = this.element,
scroll = $win.scrollTop(),
elHeight = $el.height(),
});
//auto self-init widgets
- $( document )
+ $.mobile.$document
.bind( "pagecreate create", function( e ) {
// DEPRECATED in 1.1: support for data-fullscreen=true|false on the page element.
}
}
- $( window )
+ $.mobile.$window
.bind( "orientationchange.iosorientationfix", zoom.enable )
.bind( "devicemotion.iosorientationfix", checkTilt );
(function( $, window, undefined ) {
var $html = $( "html" ),
$head = $( "head" ),
- $window = $( window );
+ $window = $.mobile.$window;
//remove initial build class (only present on first pageshow)
function hideRenderingClass() {
var $this = $( this );
// unless the data url is already set set it to the pathname
- if ( !$this.jqmData( "url" ) ) {
+ if ( !$this[0].getAttribute( "data-" + $.mobile.ns + "url" ) ) {
$this.attr( "data-" + $.mobile.ns + "url", $this.attr( "id" ) || location.pathname + location.search );
}
});
$.mobile.firstPage = $pages.first();
// define page container
- $.mobile.pageContainer = $pages.first().parent().addClass( "ui-mobile-viewport" );
+ $.mobile.pageContainer = $.mobile.firstPage.parent().addClass( "ui-mobile-viewport" );
// alert listeners that the pagecontainer has been determined for binding
// to events triggered on it
// if defaultHomeScroll hasn't been set yet, see if scrollTop is 1
// it should be 1 in most browsers, but android treats 1 as 0 (for hiding addr bar)
// so if it's 1, use 0 from now on
- $.mobile.defaultHomeScroll = ( !$.support.scrollTop || $( window ).scrollTop() === 1 ) ? 0 : 1;
+ $.mobile.defaultHomeScroll = ( !$.support.scrollTop || $.mobile.$window.scrollTop() === 1 ) ? 0 : 1;
// TODO: Implement a proper registration mechanism with dependency handling in order to not have exceptions like the one below
//auto self-init widgets for those widgets that have a soft dependency on others
if ( $.fn.controlgroup ) {
- $( document ).bind( "pagecreate create", function( e ) {
+ $.mobile.$document.bind( "pagecreate create", function( e ) {
$( ":jqmData(role='controlgroup')", e.target )
.jqmEnhanceable()
.controlgroup({ excludeInvisible: false });
// by adding the 'ui-disabled' class to them. Using a JavaScript workaround for those browser.
// https://github.com/jquery/jquery-mobile/issues/3558
- $( document ).delegate( ".ui-disabled", "vclick",
+ $.mobile.$document.delegate( ".ui-disabled", "vclick",
function( e ) {
e.preventDefault();
e.stopImmediatePropagation();
}( jQuery, this ));
}));
+/*!
+ * Globalize
+ *
+ * http://github.com/jquery/globalize
+ *
+ * Copyright Software Freedom Conservancy, Inc.
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ */
+
+(function( window, undefined ) {
+
+var Globalize,
+ // private variables
+ regexHex,
+ regexInfinity,
+ regexParseFloat,
+ regexTrim,
+ // private JavaScript utility functions
+ arrayIndexOf,
+ endsWith,
+ extend,
+ isArray,
+ isFunction,
+ isObject,
+ startsWith,
+ trim,
+ truncate,
+ zeroPad,
+ // private Globalization utility functions
+ appendPreOrPostMatch,
+ expandFormat,
+ formatDate,
+ formatNumber,
+ getTokenRegExp,
+ getEra,
+ getEraYear,
+ parseExact,
+ parseNegativePattern;
+
+// Global variable (Globalize) or CommonJS module (globalize)
+Globalize = function( cultureSelector ) {
+ return new Globalize.prototype.init( cultureSelector );
+};
+
+if ( typeof require !== "undefined"
+ && typeof exports !== "undefined"
+ && typeof module !== "undefined" ) {
+ // Assume CommonJS
+ module.exports = Globalize;
+} else {
+ // Export as global variable
+ window.Globalize = Globalize;
+}
+
+Globalize.cultures = {};
+
+Globalize.prototype = {
+ constructor: Globalize,
+ init: function( cultureSelector ) {
+ this.cultures = Globalize.cultures;
+ this.cultureSelector = cultureSelector;
+
+ return this;
+ }
+};
+Globalize.prototype.init.prototype = Globalize.prototype;
+
+// 1. When defining a culture, all fields are required except the ones stated as optional.
+// 2. Each culture should have a ".calendars" object with at least one calendar named "standard"
+// which serves as the default calendar in use by that culture.
+// 3. Each culture should have a ".calendar" object which is the current calendar being used,
+// it may be dynamically changed at any time to one of the calendars in ".calendars".
+Globalize.cultures[ "default" ] = {
+ // A unique name for the culture in the form <language code>-<country/region code>
+ name: "en",
+ // the name of the culture in the english language
+ englishName: "English",
+ // the name of the culture in its own language
+ nativeName: "English",
+ // whether the culture uses right-to-left text
+ isRTL: false,
+ // "language" is used for so-called "specific" cultures.
+ // For example, the culture "es-CL" means "Spanish, in Chili".
+ // It represents the Spanish-speaking culture as it is in Chili,
+ // which might have different formatting rules or even translations
+ // than Spanish in Spain. A "neutral" culture is one that is not
+ // specific to a region. For example, the culture "es" is the generic
+ // Spanish culture, which may be a more generalized version of the language
+ // that may or may not be what a specific culture expects.
+ // For a specific culture like "es-CL", the "language" field refers to the
+ // neutral, generic culture information for the language it is using.
+ // This is not always a simple matter of the string before the dash.
+ // For example, the "zh-Hans" culture is netural (Simplified Chinese).
+ // And the "zh-SG" culture is Simplified Chinese in Singapore, whose lanugage
+ // field is "zh-CHS", not "zh".
+ // This field should be used to navigate from a specific culture to it's
+ // more general, neutral culture. If a culture is already as general as it
+ // can get, the language may refer to itself.
+ language: "en",
+ // numberFormat defines general number formatting rules, like the digits in
+ // each grouping, the group separator, and how negative numbers are displayed.
+ numberFormat: {
+ // [negativePattern]
+ // Note, numberFormat.pattern has no "positivePattern" unlike percent and currency,
+ // but is still defined as an array for consistency with them.
+ // negativePattern: one of "(n)|-n|- n|n-|n -"
+ pattern: [ "-n" ],
+ // number of decimal places normally shown
+ decimals: 2,
+ // string that separates number groups, as in 1,000,000
+ ",": ",",
+ // string that separates a number from the fractional portion, as in 1.99
+ ".": ".",
+ // array of numbers indicating the size of each number group.
+ // TODO: more detailed description and example
+ groupSizes: [ 3 ],
+ // symbol used for positive numbers
+ "+": "+",
+ // symbol used for negative numbers
+ "-": "-",
+ // symbol used for NaN (Not-A-Number)
+ NaN: "NaN",
+ // symbol used for Negative Infinity
+ negativeInfinity: "-Infinity",
+ // symbol used for Positive Infinity
+ positiveInfinity: "Infinity",
+ percent: {
+ // [negativePattern, positivePattern]
+ // negativePattern: one of "-n %|-n%|-%n|%-n|%n-|n-%|n%-|-% n|n %-|% n-|% -n|n- %"
+ // positivePattern: one of "n %|n%|%n|% n"
+ pattern: [ "-n %", "n %" ],
+ // number of decimal places normally shown
+ decimals: 2,
+ // array of numbers indicating the size of each number group.
+ // TODO: more detailed description and example
+ groupSizes: [ 3 ],
+ // string that separates number groups, as in 1,000,000
+ ",": ",",
+ // string that separates a number from the fractional portion, as in 1.99
+ ".": ".",
+ // symbol used to represent a percentage
+ symbol: "%"
+ },
+ currency: {
+ // [negativePattern, positivePattern]
+ // negativePattern: one of "($n)|-$n|$-n|$n-|(n$)|-n$|n-$|n$-|-n $|-$ n|n $-|$ n-|$ -n|n- $|($ n)|(n $)"
+ // positivePattern: one of "$n|n$|$ n|n $"
+ pattern: [ "($n)", "$n" ],
+ // number of decimal places normally shown
+ decimals: 2,
+ // array of numbers indicating the size of each number group.
+ // TODO: more detailed description and example
+ groupSizes: [ 3 ],
+ // string that separates number groups, as in 1,000,000
+ ",": ",",
+ // string that separates a number from the fractional portion, as in 1.99
+ ".": ".",
+ // symbol used to represent currency
+ symbol: "$"
+ }
+ },
+ // calendars defines all the possible calendars used by this culture.
+ // There should be at least one defined with name "standard", and is the default
+ // calendar used by the culture.
+ // A calendar contains information about how dates are formatted, information about
+ // the calendar's eras, a standard set of the date formats,
+ // translations for day and month names, and if the calendar is not based on the Gregorian
+ // calendar, conversion functions to and from the Gregorian calendar.
+ calendars: {
+ standard: {
+ // name that identifies the type of calendar this is
+ name: "Gregorian_USEnglish",
+ // separator of parts of a date (e.g. "/" in 11/05/1955)
+ "/": "/",
+ // separator of parts of a time (e.g. ":" in 05:44 PM)
+ ":": ":",
+ // the first day of the week (0 = Sunday, 1 = Monday, etc)
+ firstDay: 0,
+ days: {
+ // full day names
+ names: [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ],
+ // abbreviated day names
+ namesAbbr: [ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" ],
+ // shortest day names
+ namesShort: [ "Su", "Mo", "Tu", "We", "Th", "Fr", "Sa" ]
+ },
+ months: {
+ // full month names (13 months for lunar calendards -- 13th month should be "" if not lunar)
+ names: [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" ],
+ // abbreviated month names
+ namesAbbr: [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "" ]
+ },
+ // AM and PM designators in one of these forms:
+ // The usual view, and the upper and lower case versions
+ // [ standard, lowercase, uppercase ]
+ // The culture does not use AM or PM (likely all standard date formats use 24 hour time)
+ // null
+ AM: [ "AM", "am", "AM" ],
+ PM: [ "PM", "pm", "PM" ],
+ eras: [
+ // eras in reverse chronological order.
+ // name: the name of the era in this culture (e.g. A.D., C.E.)
+ // start: when the era starts in ticks (gregorian, gmt), null if it is the earliest supported era.
+ // offset: offset in years from gregorian calendar
+ {
+ "name": "A.D.",
+ "start": null,
+ "offset": 0
+ }
+ ],
+ // when a two digit year is given, it will never be parsed as a four digit
+ // year greater than this year (in the appropriate era for the culture)
+ // Set it as a full year (e.g. 2029) or use an offset format starting from
+ // the current year: "+19" would correspond to 2029 if the current year 2010.
+ twoDigitYearMax: 2029,
+ // set of predefined date and time patterns used by the culture
+ // these represent the format someone in this culture would expect
+ // to see given the portions of the date that are shown.
+ patterns: {
+ // short date pattern
+ d: "M/d/yyyy",
+ // long date pattern
+ D: "dddd, MMMM dd, yyyy",
+ // short time pattern
+ t: "h:mm tt",
+ // long time pattern
+ T: "h:mm:ss tt",
+ // long date, short time pattern
+ f: "dddd, MMMM dd, yyyy h:mm tt",
+ // long date, long time pattern
+ F: "dddd, MMMM dd, yyyy h:mm:ss tt",
+ // month/day pattern
+ M: "MMMM dd",
+ // month/year pattern
+ Y: "yyyy MMMM",
+ // S is a sortable format that does not vary by culture
+ S: "yyyy\u0027-\u0027MM\u0027-\u0027dd\u0027T\u0027HH\u0027:\u0027mm\u0027:\u0027ss"
+ }
+ // optional fields for each calendar:
+ /*
+ monthsGenitive:
+ Same as months but used when the day preceeds the month.
+ Omit if the culture has no genitive distinction in month names.
+ For an explaination of genitive months, see http://blogs.msdn.com/michkap/archive/2004/12/25/332259.aspx
+ convert:
+ Allows for the support of non-gregorian based calendars. This convert object is used to
+ to convert a date to and from a gregorian calendar date to handle parsing and formatting.
+ The two functions:
+ fromGregorian( date )
+ Given the date as a parameter, return an array with parts [ year, month, day ]
+ corresponding to the non-gregorian based year, month, and day for the calendar.
+ toGregorian( year, month, day )
+ Given the non-gregorian year, month, and day, return a new Date() object
+ set to the corresponding date in the gregorian calendar.
+ */
+ }
+ },
+ // For localized strings
+ messages: {}
+};
+
+Globalize.cultures[ "default" ].calendar = Globalize.cultures[ "default" ].calendars.standard;
+
+Globalize.cultures[ "en" ] = Globalize.cultures[ "default" ];
+
+Globalize.cultureSelector = "en";
+
+//
+// private variables
+//
+
+regexHex = /^0x[a-f0-9]+$/i;
+regexInfinity = /^[+-]?infinity$/i;
+regexParseFloat = /^[+-]?\d*\.?\d*(e[+-]?\d+)?$/;
+regexTrim = /^\s+|\s+$/g;
+
+//
+// private JavaScript utility functions
+//
+
+arrayIndexOf = function( array, item ) {
+ if ( array.indexOf ) {
+ return array.indexOf( item );
+ }
+ for ( var i = 0, length = array.length; i < length; i++ ) {
+ if ( array[i] === item ) {
+ return i;
+ }
+ }
+ return -1;
+};
+
+endsWith = function( value, pattern ) {
+ return value.substr( value.length - pattern.length ) === pattern;
+};
+
+extend = function( deep ) {
+ var options, name, src, copy, copyIsArray, clone,
+ target = arguments[0] || {},
+ i = 1,
+ length = arguments.length,
+ deep = false;
+
+ // Handle a deep copy situation
+ if ( typeof target === "boolean" ) {
+ deep = target;
+ target = arguments[1] || {};
+ // skip the boolean and the target
+ i = 2;
+ }
+
+ // Handle case when target is a string or something (possible in deep copy)
+ if ( typeof target !== "object" && !isFunction(target) ) {
+ target = {};
+ }
+
+ for ( ; i < length; i++ ) {
+ // Only deal with non-null/undefined values
+ if ( (options = arguments[ i ]) != null ) {
+ // Extend the base object
+ for ( name in options ) {
+ src = target[ name ];
+ copy = options[ name ];
+
+ // Prevent never-ending loop
+ if ( target === copy ) {
+ continue;
+ }
+
+ // Recurse if we're merging plain objects or arrays
+ if ( deep && copy && ( isObject(copy) || (copyIsArray = isArray(copy)) ) ) {
+ if ( copyIsArray ) {
+ copyIsArray = false;
+ clone = src && isArray(src) ? src : [];
+
+ } else {
+ clone = src && isObject(src) ? src : {};
+ }
+
+ // Never move original objects, clone them
+ target[ name ] = extend( deep, clone, copy );
+
+ // Don't bring in undefined values
+ } else if ( copy !== undefined ) {
+ target[ name ] = copy;
+ }
+ }
+ }
+ }
+
+ // Return the modified object
+ return target;
+};
+
+isArray = Array.isArray || function( obj ) {
+ return Object.prototype.toString.call( obj ) === "[object Array]";
+};
+
+isFunction = function( obj ) {
+ return Object.prototype.toString.call( obj ) === "[object Function]";
+};
+
+isObject = function( obj ) {
+ return Object.prototype.toString.call( obj ) === "[object Object]";
+};
+
+startsWith = function( value, pattern ) {
+ return value.indexOf( pattern ) === 0;
+};
+
+trim = function( value ) {
+ return ( value + "" ).replace( regexTrim, "" );
+};
+
+truncate = function( value ) {
+ if ( isNaN( value ) ) {
+ return NaN;
+ }
+ return Math[ value < 0 ? "ceil" : "floor" ]( value );
+};
+
+zeroPad = function( str, count, left ) {
+ var l;
+ for ( l = str.length; l < count; l += 1 ) {
+ str = ( left ? ("0" + str) : (str + "0") );
+ }
+ return str;
+};
+
+//
+// private Globalization utility functions
+//
+
+appendPreOrPostMatch = function( preMatch, strings ) {
+ // appends pre- and post- token match strings while removing escaped characters.
+ // Returns a single quote count which is used to determine if the token occurs
+ // in a string literal.
+ var quoteCount = 0,
+ escaped = false;
+ for ( var i = 0, il = preMatch.length; i < il; i++ ) {
+ var c = preMatch.charAt( i );
+ switch ( c ) {
+ case "\'":
+ if ( escaped ) {
+ strings.push( "\'" );
+ }
+ else {
+ quoteCount++;
+ }
+ escaped = false;
+ break;
+ case "\\":
+ if ( escaped ) {
+ strings.push( "\\" );
+ }
+ escaped = !escaped;
+ break;
+ default:
+ strings.push( c );
+ escaped = false;
+ break;
+ }
+ }
+ return quoteCount;
+};
+
+expandFormat = function( cal, format ) {
+ // expands unspecified or single character date formats into the full pattern.
+ format = format || "F";
+ var pattern,
+ patterns = cal.patterns,
+ len = format.length;
+ if ( len === 1 ) {
+ pattern = patterns[ format ];
+ if ( !pattern ) {
+ throw "Invalid date format string \'" + format + "\'.";
+ }
+ format = pattern;
+ }
+ else if ( len === 2 && format.charAt(0) === "%" ) {
+ // %X escape format -- intended as a custom format string that is only one character, not a built-in format.
+ format = format.charAt( 1 );
+ }
+ return format;
+};
+
+formatDate = function( value, format, culture ) {
+ var cal = culture.calendar,
+ convert = cal.convert;
+
+ if ( !format || !format.length || format === "i" ) {
+ var ret;
+ if ( culture && culture.name.length ) {
+ if ( convert ) {
+ // non-gregorian calendar, so we cannot use built-in toLocaleString()
+ ret = formatDate( value, cal.patterns.F, culture );
+ }
+ else {
+ var eraDate = new Date( value.getTime() ),
+ era = getEra( value, cal.eras );
+ eraDate.setFullYear( getEraYear(value, cal, era) );
+ ret = eraDate.toLocaleString();
+ }
+ }
+ else {
+ ret = value.toString();
+ }
+ return ret;
+ }
+
+ var eras = cal.eras,
+ sortable = format === "s";
+ format = expandFormat( cal, format );
+
+ // Start with an empty string
+ ret = [];
+ var hour,
+ zeros = [ "0", "00", "000" ],
+ foundDay,
+ checkedDay,
+ dayPartRegExp = /([^d]|^)(d|dd)([^d]|$)/g,
+ quoteCount = 0,
+ tokenRegExp = getTokenRegExp(),
+ converted;
+
+ function padZeros( num, c ) {
+ var r, s = num + "";
+ if ( c > 1 && s.length < c ) {
+ r = ( zeros[c - 2] + s);
+ return r.substr( r.length - c, c );
+ }
+ else {
+ r = s;
+ }
+ return r;
+ }
+
+ function hasDay() {
+ if ( foundDay || checkedDay ) {
+ return foundDay;
+ }
+ foundDay = dayPartRegExp.test( format );
+ checkedDay = true;
+ return foundDay;
+ }
+
+ function getPart( date, part ) {
+ if ( converted ) {
+ return converted[ part ];
+ }
+ switch ( part ) {
+ case 0: return date.getFullYear();
+ case 1: return date.getMonth();
+ case 2: return date.getDate();
+ }
+ }
+
+ if ( !sortable && convert ) {
+ converted = convert.fromGregorian( value );
+ }
+
+ for ( ; ; ) {
+ // Save the current index
+ var index = tokenRegExp.lastIndex,
+ // Look for the next pattern
+ ar = tokenRegExp.exec( format );
+
+ // Append the text before the pattern (or the end of the string if not found)
+ var preMatch = format.slice( index, ar ? ar.index : format.length );
+ quoteCount += appendPreOrPostMatch( preMatch, ret );
+
+ if ( !ar ) {
+ break;
+ }
+
+ // do not replace any matches that occur inside a string literal.
+ if ( quoteCount % 2 ) {
+ ret.push( ar[0] );
+ continue;
+ }
+
+ var current = ar[ 0 ],
+ clength = current.length;
+
+ switch ( current ) {
+ case "ddd":
+ //Day of the week, as a three-letter abbreviation
+ case "dddd":
+ // Day of the week, using the full name
+ var names = ( clength === 3 ) ? cal.days.namesAbbr : cal.days.names;
+ ret.push( names[value.getDay()] );
+ break;
+ case "d":
+ // Day of month, without leading zero for single-digit days
+ case "dd":
+ // Day of month, with leading zero for single-digit days
+ foundDay = true;
+ ret.push(
+ padZeros( getPart(value, 2), clength )
+ );
+ break;
+ case "MMM":
+ // Month, as a three-letter abbreviation
+ case "MMMM":
+ // Month, using the full name
+ var part = getPart( value, 1 );
+ ret.push(
+ ( cal.monthsGenitive && hasDay() )
+ ?
+ cal.monthsGenitive[ clength === 3 ? "namesAbbr" : "names" ][ part ]
+ :
+ cal.months[ clength === 3 ? "namesAbbr" : "names" ][ part ]
+ );
+ break;
+ case "M":
+ // Month, as digits, with no leading zero for single-digit months
+ case "MM":
+ // Month, as digits, with leading zero for single-digit months
+ ret.push(
+ padZeros( getPart(value, 1) + 1, clength )
+ );
+ break;
+ case "y":
+ // Year, as two digits, but with no leading zero for years less than 10
+ case "yy":
+ // Year, as two digits, with leading zero for years less than 10
+ case "yyyy":
+ // Year represented by four full digits
+ part = converted ? converted[ 0 ] : getEraYear( value, cal, getEra(value, eras), sortable );
+ if ( clength < 4 ) {
+ part = part % 100;
+ }
+ ret.push(
+ padZeros( part, clength )
+ );
+ break;
+ case "h":
+ // Hours with no leading zero for single-digit hours, using 12-hour clock
+ case "hh":
+ // Hours with leading zero for single-digit hours, using 12-hour clock
+ hour = value.getHours() % 12;
+ if ( hour === 0 ) hour = 12;
+ ret.push(
+ padZeros( hour, clength )
+ );
+ break;
+ case "H":
+ // Hours with no leading zero for single-digit hours, using 24-hour clock
+ case "HH":
+ // Hours with leading zero for single-digit hours, using 24-hour clock
+ ret.push(
+ padZeros( value.getHours(), clength )
+ );
+ break;
+ case "m":
+ // Minutes with no leading zero for single-digit minutes
+ case "mm":
+ // Minutes with leading zero for single-digit minutes
+ ret.push(
+ padZeros( value.getMinutes(), clength )
+ );
+ break;
+ case "s":
+ // Seconds with no leading zero for single-digit seconds
+ case "ss":
+ // Seconds with leading zero for single-digit seconds
+ ret.push(
+ padZeros( value.getSeconds(), clength )
+ );
+ break;
+ case "t":
+ // One character am/pm indicator ("a" or "p")
+ case "tt":
+ // Multicharacter am/pm indicator
+ part = value.getHours() < 12 ? ( cal.AM ? cal.AM[0] : " " ) : ( cal.PM ? cal.PM[0] : " " );
+ ret.push( clength === 1 ? part.charAt(0) : part );
+ break;
+ case "f":
+ // Deciseconds
+ case "ff":
+ // Centiseconds
+ case "fff":
+ // Milliseconds
+ ret.push(
+ padZeros( value.getMilliseconds(), 3 ).substr( 0, clength )
+ );
+ break;
+ case "z":
+ // Time zone offset, no leading zero
+ case "zz":
+ // Time zone offset with leading zero
+ hour = value.getTimezoneOffset() / 60;
+ ret.push(
+ ( hour <= 0 ? "+" : "-" ) + padZeros( Math.floor(Math.abs(hour)), clength )
+ );
+ break;
+ case "zzz":
+ // Time zone offset with leading zero
+ hour = value.getTimezoneOffset() / 60;
+ ret.push(
+ ( hour <= 0 ? "+" : "-" ) + padZeros( Math.floor(Math.abs(hour)), 2 )
+ // Hard coded ":" separator, rather than using cal.TimeSeparator
+ // Repeated here for consistency, plus ":" was already assumed in date parsing.
+ + ":" + padZeros( Math.abs(value.getTimezoneOffset() % 60), 2 )
+ );
+ break;
+ case "g":
+ case "gg":
+ if ( cal.eras ) {
+ ret.push(
+ cal.eras[ getEra(value, eras) ].name
+ );
+ }
+ break;
+ case "/":
+ ret.push( cal["/"] );
+ break;
+ default:
+ throw "Invalid date format pattern \'" + current + "\'.";
+ break;
+ }
+ }
+ return ret.join( "" );
+};
+
+// formatNumber
+(function() {
+ var expandNumber;
+
+ expandNumber = function( number, precision, formatInfo ) {
+ var groupSizes = formatInfo.groupSizes,
+ curSize = groupSizes[ 0 ],
+ curGroupIndex = 1,
+ factor = Math.pow( 10, precision ),
+ rounded = Math.round( number * factor ) / factor;
+
+ if ( !isFinite(rounded) ) {
+ rounded = number;
+ }
+ number = rounded;
+
+ var numberString = number+"",
+ right = "",
+ split = numberString.split( /e/i ),
+ exponent = split.length > 1 ? parseInt( split[1], 10 ) : 0;
+ numberString = split[ 0 ];
+ split = numberString.split( "." );
+ numberString = split[ 0 ];
+ right = split.length > 1 ? split[ 1 ] : "";
+
+ var l;
+ if ( exponent > 0 ) {
+ right = zeroPad( right, exponent, false );
+ numberString += right.slice( 0, exponent );
+ right = right.substr( exponent );
+ }
+ else if ( exponent < 0 ) {
+ exponent = -exponent;
+ numberString = zeroPad( numberString, exponent + 1 );
+ right = numberString.slice( -exponent, numberString.length ) + right;
+ numberString = numberString.slice( 0, -exponent );
+ }
+
+ if ( precision > 0 ) {
+ right = formatInfo[ "." ] +
+ ( (right.length > precision) ? right.slice(0, precision) : zeroPad(right, precision) );
+ }
+ else {
+ right = "";
+ }
+
+ var stringIndex = numberString.length - 1,
+ sep = formatInfo[ "," ],
+ ret = "";
+
+ while ( stringIndex >= 0 ) {
+ if ( curSize === 0 || curSize > stringIndex ) {
+ return numberString.slice( 0, stringIndex + 1 ) + ( ret.length ? (sep + ret + right) : right );
+ }
+ ret = numberString.slice( stringIndex - curSize + 1, stringIndex + 1 ) + ( ret.length ? (sep + ret) : "" );
+
+ stringIndex -= curSize;
+
+ if ( curGroupIndex < groupSizes.length ) {
+ curSize = groupSizes[ curGroupIndex ];
+ curGroupIndex++;
+ }
+ }
+
+ return numberString.slice( 0, stringIndex + 1 ) + sep + ret + right;
+ };
+
+ formatNumber = function( value, format, culture ) {
+ if ( !isFinite(value) ) {
+ if ( value === Infinity ) {
+ return culture.numberFormat.positiveInfinity;
+ }
+ if ( value === -Infinity ) {
+ return culture.numberFormat.negativeInfinity;
+ }
+ return culture.numberFormat.NaN;
+ }
+ if ( !format || format === "i" ) {
+ return culture.name.length ? value.toLocaleString() : value.toString();
+ }
+ format = format || "D";
+
+ var nf = culture.numberFormat,
+ number = Math.abs( value ),
+ precision = -1,
+ pattern;
+ if ( format.length > 1 ) precision = parseInt( format.slice(1), 10 );
+
+ var current = format.charAt( 0 ).toUpperCase(),
+ formatInfo;
+
+ switch ( current ) {
+ case "D":
+ pattern = "n";
+ number = truncate( number );
+ if ( precision !== -1 ) {
+ number = zeroPad( "" + number, precision, true );
+ }
+ if ( value < 0 ) number = "-" + number;
+ break;
+ case "N":
+ formatInfo = nf;
+ // fall through
+ case "C":
+ formatInfo = formatInfo || nf.currency;
+ // fall through
+ case "P":
+ formatInfo = formatInfo || nf.percent;
+ pattern = value < 0 ? formatInfo.pattern[ 0 ] : ( formatInfo.pattern[1] || "n" );
+ if ( precision === -1 ) precision = formatInfo.decimals;
+ number = expandNumber( number * (current === "P" ? 100 : 1), precision, formatInfo );
+ break;
+ default:
+ throw "Bad number format specifier: " + current;
+ }
+
+ var patternParts = /n|\$|-|%/g,
+ ret = "";
+ for ( ; ; ) {
+ var index = patternParts.lastIndex,
+ ar = patternParts.exec( pattern );
+
+ ret += pattern.slice( index, ar ? ar.index : pattern.length );
+
+ if ( !ar ) {
+ break;
+ }
+
+ switch ( ar[0] ) {
+ case "n":
+ ret += number;
+ break;
+ case "$":
+ ret += nf.currency.symbol;
+ break;
+ case "-":
+ // don't make 0 negative
+ if ( /[1-9]/.test(number) ) {
+ ret += nf[ "-" ];
+ }
+ break;
+ case "%":
+ ret += nf.percent.symbol;
+ break;
+ }
+ }
+
+ return ret;
+ };
+
+}());
+
+getTokenRegExp = function() {
+ // regular expression for matching date and time tokens in format strings.
+ return /\/|dddd|ddd|dd|d|MMMM|MMM|MM|M|yyyy|yy|y|hh|h|HH|H|mm|m|ss|s|tt|t|fff|ff|f|zzz|zz|z|gg|g/g;
+};
+
+getEra = function( date, eras ) {
+ if ( !eras ) return 0;
+ var start, ticks = date.getTime();
+ for ( var i = 0, l = eras.length; i < l; i++ ) {
+ start = eras[ i ].start;
+ if ( start === null || ticks >= start ) {
+ return i;
+ }
+ }
+ return 0;
+};
+
+getEraYear = function( date, cal, era, sortable ) {
+ var year = date.getFullYear();
+ if ( !sortable && cal.eras ) {
+ // convert normal gregorian year to era-shifted gregorian
+ // year by subtracting the era offset
+ year -= cal.eras[ era ].offset;
+ }
+ return year;
+};
+
+// parseExact
+(function() {
+ var expandYear,
+ getDayIndex,
+ getMonthIndex,
+ getParseRegExp,
+ outOfRange,
+ toUpper,
+ toUpperArray;
+
+ expandYear = function( cal, year ) {
+ // expands 2-digit year into 4 digits.
+ if ( year < 100 ) {
+ var now = new Date(),
+ era = getEra( now ),
+ curr = getEraYear( now, cal, era ),
+ twoDigitYearMax = cal.twoDigitYearMax;
+ twoDigitYearMax = typeof twoDigitYearMax === "string" ? new Date().getFullYear() % 100 + parseInt( twoDigitYearMax, 10 ) : twoDigitYearMax;
+ year += curr - ( curr % 100 );
+ if ( year > twoDigitYearMax ) {
+ year -= 100;
+ }
+ }
+ return year;
+ };
+
+ getDayIndex = function ( cal, value, abbr ) {
+ var ret,
+ days = cal.days,
+ upperDays = cal._upperDays;
+ if ( !upperDays ) {
+ cal._upperDays = upperDays = [
+ toUpperArray( days.names ),
+ toUpperArray( days.namesAbbr ),
+ toUpperArray( days.namesShort )
+ ];
+ }
+ value = toUpper( value );
+ if ( abbr ) {
+ ret = arrayIndexOf( upperDays[1], value );
+ if ( ret === -1 ) {
+ ret = arrayIndexOf( upperDays[2], value );
+ }
+ }
+ else {
+ ret = arrayIndexOf( upperDays[0], value );
+ }
+ return ret;
+ };
+
+ getMonthIndex = function( cal, value, abbr ) {
+ var months = cal.months,
+ monthsGen = cal.monthsGenitive || cal.months,
+ upperMonths = cal._upperMonths,
+ upperMonthsGen = cal._upperMonthsGen;
+ if ( !upperMonths ) {
+ cal._upperMonths = upperMonths = [
+ toUpperArray( months.names ),
+ toUpperArray( months.namesAbbr )
+ ];
+ cal._upperMonthsGen = upperMonthsGen = [
+ toUpperArray( monthsGen.names ),
+ toUpperArray( monthsGen.namesAbbr )
+ ];
+ }
+ value = toUpper( value );
+ var i = arrayIndexOf( abbr ? upperMonths[1] : upperMonths[0], value );
+ if ( i < 0 ) {
+ i = arrayIndexOf( abbr ? upperMonthsGen[1] : upperMonthsGen[0], value );
+ }
+ return i;
+ };
+
+ getParseRegExp = function( cal, format ) {
+ // converts a format string into a regular expression with groups that
+ // can be used to extract date fields from a date string.
+ // check for a cached parse regex.
+ var re = cal._parseRegExp;
+ if ( !re ) {
+ cal._parseRegExp = re = {};
+ }
+ else {
+ var reFormat = re[ format ];
+ if ( reFormat ) {
+ return reFormat;
+ }
+ }
+
+ // expand single digit formats, then escape regular expression characters.
+ var expFormat = expandFormat( cal, format ).replace( /([\^\$\.\*\+\?\|\[\]\(\)\{\}])/g, "\\\\$1" ),
+ regexp = [ "^" ],
+ groups = [],
+ index = 0,
+ quoteCount = 0,
+ tokenRegExp = getTokenRegExp(),
+ match;
+
+ // iterate through each date token found.
+ while ( (match = tokenRegExp.exec(expFormat)) !== null ) {
+ var preMatch = expFormat.slice( index, match.index );
+ index = tokenRegExp.lastIndex;
+
+ // don't replace any matches that occur inside a string literal.
+ quoteCount += appendPreOrPostMatch( preMatch, regexp );
+ if ( quoteCount % 2 ) {
+ regexp.push( match[0] );
+ continue;
+ }
+
+ // add a regex group for the token.
+ var m = match[ 0 ],
+ len = m.length,
+ add;
+ switch ( m ) {
+ case "dddd": case "ddd":
+ case "MMMM": case "MMM":
+ case "gg": case "g":
+ add = "(\\D+)";
+ break;
+ case "tt": case "t":
+ add = "(\\D*)";
+ break;
+ case "yyyy":
+ case "fff":
+ case "ff":
+ case "f":
+ add = "(\\d{" + len + "})";
+ break;
+ case "dd": case "d":
+ case "MM": case "M":
+ case "yy": case "y":
+ case "HH": case "H":
+ case "hh": case "h":
+ case "mm": case "m":
+ case "ss": case "s":
+ add = "(\\d\\d?)";
+ break;
+ case "zzz":
+ add = "([+-]?\\d\\d?:\\d{2})";
+ break;
+ case "zz": case "z":
+ add = "([+-]?\\d\\d?)";
+ break;
+ case "/":
+ add = "(\\" + cal[ "/" ] + ")";
+ break;
+ default:
+ throw "Invalid date format pattern \'" + m + "\'.";
+ break;
+ }
+ if ( add ) {
+ regexp.push( add );
+ }
+ groups.push( match[0] );
+ }
+ appendPreOrPostMatch( expFormat.slice(index), regexp );
+ regexp.push( "$" );
+
+ // allow whitespace to differ when matching formats.
+ var regexpStr = regexp.join( "" ).replace( /\s+/g, "\\s+" ),
+ parseRegExp = { "regExp": regexpStr, "groups": groups };
+
+ // cache the regex for this format.
+ return re[ format ] = parseRegExp;
+ };
+
+ outOfRange = function( value, low, high ) {
+ return value < low || value > high;
+ };
+
+ toUpper = function( value ) {
+ // "he-IL" has non-breaking space in weekday names.
+ return value.split( "\u00A0" ).join( " " ).toUpperCase();
+ };
+
+ toUpperArray = function( arr ) {
+ var results = [];
+ for ( var i = 0, l = arr.length; i < l; i++ ) {
+ results[ i ] = toUpper( arr[i] );
+ }
+ return results;
+ };
+
+ parseExact = function( value, format, culture ) {
+ // try to parse the date string by matching against the format string
+ // while using the specified culture for date field names.
+ value = trim( value );
+ var cal = culture.calendar,
+ // convert date formats into regular expressions with groupings.
+ // use the regexp to determine the input format and extract the date fields.
+ parseInfo = getParseRegExp( cal, format ),
+ match = new RegExp( parseInfo.regExp ).exec( value );
+ if ( match === null ) {
+ return null;
+ }
+ // found a date format that matches the input.
+ var groups = parseInfo.groups,
+ era = null, year = null, month = null, date = null, weekDay = null,
+ hour = 0, hourOffset, min = 0, sec = 0, msec = 0, tzMinOffset = null,
+ pmHour = false;
+ // iterate the format groups to extract and set the date fields.
+ for ( var j = 0, jl = groups.length; j < jl; j++ ) {
+ var matchGroup = match[ j + 1 ];
+ if ( matchGroup ) {
+ var current = groups[ j ],
+ clength = current.length,
+ matchInt = parseInt( matchGroup, 10 );
+ switch ( current ) {
+ case "dd": case "d":
+ // Day of month.
+ date = matchInt;
+ // check that date is generally in valid range, also checking overflow below.
+ if ( outOfRange(date, 1, 31) ) return null;
+ break;
+ case "MMM": case "MMMM":
+ month = getMonthIndex( cal, matchGroup, clength === 3 );
+ if ( outOfRange(month, 0, 11) ) return null;
+ break;
+ case "M": case "MM":
+ // Month.
+ month = matchInt - 1;
+ if ( outOfRange(month, 0, 11) ) return null;
+ break;
+ case "y": case "yy":
+ case "yyyy":
+ year = clength < 4 ? expandYear( cal, matchInt ) : matchInt;
+ if ( outOfRange(year, 0, 9999) ) return null;
+ break;
+ case "h": case "hh":
+ // Hours (12-hour clock).
+ hour = matchInt;
+ if ( hour === 12 ) hour = 0;
+ if ( outOfRange(hour, 0, 11) ) return null;
+ break;
+ case "H": case "HH":
+ // Hours (24-hour clock).
+ hour = matchInt;
+ if ( outOfRange(hour, 0, 23) ) return null;
+ break;
+ case "m": case "mm":
+ // Minutes.
+ min = matchInt;
+ if ( outOfRange(min, 0, 59) ) return null;
+ break;
+ case "s": case "ss":
+ // Seconds.
+ sec = matchInt;
+ if ( outOfRange(sec, 0, 59) ) return null;
+ break;
+ case "tt": case "t":
+ // AM/PM designator.
+ // see if it is standard, upper, or lower case PM. If not, ensure it is at least one of
+ // the AM tokens. If not, fail the parse for this format.
+ pmHour = cal.PM && ( matchGroup === cal.PM[0] || matchGroup === cal.PM[1] || matchGroup === cal.PM[2] );
+ if (
+ !pmHour && (
+ !cal.AM || ( matchGroup !== cal.AM[0] && matchGroup !== cal.AM[1] && matchGroup !== cal.AM[2] )
+ )
+ ) return null;
+ break;
+ case "f":
+ // Deciseconds.
+ case "ff":
+ // Centiseconds.
+ case "fff":
+ // Milliseconds.
+ msec = matchInt * Math.pow( 10, 3 - clength );
+ if ( outOfRange(msec, 0, 999) ) return null;
+ break;
+ case "ddd":
+ // Day of week.
+ case "dddd":
+ // Day of week.
+ weekDay = getDayIndex( cal, matchGroup, clength === 3 );
+ if ( outOfRange(weekDay, 0, 6) ) return null;
+ break;
+ case "zzz":
+ // Time zone offset in +/- hours:min.
+ var offsets = matchGroup.split( /:/ );
+ if ( offsets.length !== 2 ) return null;
+ hourOffset = parseInt( offsets[0], 10 );
+ if ( outOfRange(hourOffset, -12, 13) ) return null;
+ var minOffset = parseInt( offsets[1], 10 );
+ if ( outOfRange(minOffset, 0, 59) ) return null;
+ tzMinOffset = ( hourOffset * 60 ) + ( startsWith(matchGroup, "-") ? -minOffset : minOffset );
+ break;
+ case "z": case "zz":
+ // Time zone offset in +/- hours.
+ hourOffset = matchInt;
+ if ( outOfRange(hourOffset, -12, 13) ) return null;
+ tzMinOffset = hourOffset * 60;
+ break;
+ case "g": case "gg":
+ var eraName = matchGroup;
+ if ( !eraName || !cal.eras ) return null;
+ eraName = trim( eraName.toLowerCase() );
+ for ( var i = 0, l = cal.eras.length; i < l; i++ ) {
+ if ( eraName === cal.eras[i].name.toLowerCase() ) {
+ era = i;
+ break;
+ }
+ }
+ // could not find an era with that name
+ if ( era === null ) return null;
+ break;
+ }
+ }
+ }
+ var result = new Date(), defaultYear, convert = cal.convert;
+ defaultYear = convert ? convert.fromGregorian( result )[ 0 ] : result.getFullYear();
+ if ( year === null ) {
+ year = defaultYear;
+ }
+ else if ( cal.eras ) {
+ // year must be shifted to normal gregorian year
+ // but not if year was not specified, its already normal gregorian
+ // per the main if clause above.
+ year += cal.eras[( era || 0 )].offset;
+ }
+ // set default day and month to 1 and January, so if unspecified, these are the defaults
+ // instead of the current day/month.
+ if ( month === null ) {
+ month = 0;
+ }
+ if ( date === null ) {
+ date = 1;
+ }
+ // now have year, month, and date, but in the culture's calendar.
+ // convert to gregorian if necessary
+ if ( convert ) {
+ result = convert.toGregorian( year, month, date );
+ // conversion failed, must be an invalid match
+ if ( result === null ) return null;
+ }
+ else {
+ // have to set year, month and date together to avoid overflow based on current date.
+ result.setFullYear( year, month, date );
+ // check to see if date overflowed for specified month (only checked 1-31 above).
+ if ( result.getDate() !== date ) return null;
+ // invalid day of week.
+ if ( weekDay !== null && result.getDay() !== weekDay ) {
+ return null;
+ }
+ }
+ // if pm designator token was found make sure the hours fit the 24-hour clock.
+ if ( pmHour && hour < 12 ) {
+ hour += 12;
+ }
+ result.setHours( hour, min, sec, msec );
+ if ( tzMinOffset !== null ) {
+ // adjust timezone to utc before applying local offset.
+ var adjustedMin = result.getMinutes() - ( tzMinOffset + result.getTimezoneOffset() );
+ // Safari limits hours and minutes to the range of -127 to 127. We need to use setHours
+ // to ensure both these fields will not exceed this range. adjustedMin will range
+ // somewhere between -1440 and 1500, so we only need to split this into hours.
+ result.setHours( result.getHours() + parseInt(adjustedMin / 60, 10), adjustedMin % 60 );
+ }
+ return result;
+ };
+}());
+
+parseNegativePattern = function( value, nf, negativePattern ) {
+ var neg = nf[ "-" ],
+ pos = nf[ "+" ],
+ ret;
+ switch ( negativePattern ) {
+ case "n -":
+ neg = " " + neg;
+ pos = " " + pos;
+ // fall through
+ case "n-":
+ if ( endsWith(value, neg) ) {
+ ret = [ "-", value.substr(0, value.length - neg.length) ];
+ }
+ else if ( endsWith(value, pos) ) {
+ ret = [ "+", value.substr(0, value.length - pos.length) ];
+ }
+ break;
+ case "- n":
+ neg += " ";
+ pos += " ";
+ // fall through
+ case "-n":
+ if ( startsWith(value, neg) ) {
+ ret = [ "-", value.substr(neg.length) ];
+ }
+ else if ( startsWith(value, pos) ) {
+ ret = [ "+", value.substr(pos.length) ];
+ }
+ break;
+ case "(n)":
+ if ( startsWith(value, "(") && endsWith(value, ")") ) {
+ ret = [ "-", value.substr(1, value.length - 2) ];
+ }
+ break;
+ }
+ return ret || [ "", value ];
+};
+
+//
+// public instance functions
+//
+
+Globalize.prototype.findClosestCulture = function( cultureSelector ) {
+ return Globalize.findClosestCulture.call( this, cultureSelector );
+};
+
+Globalize.prototype.format = function( value, format, cultureSelector ) {
+ return Globalize.format.call( this, value, format, cultureSelector );
+};
+
+Globalize.prototype.localize = function( key, cultureSelector ) {
+ return Globalize.localize.call( this, key, cultureSelector );
+};
+
+Globalize.prototype.parseInt = function( value, radix, cultureSelector ) {
+ return Globalize.parseInt.call( this, value, radix, cultureSelector );
+};
+
+Globalize.prototype.parseFloat = function( value, radix, cultureSelector ) {
+ return Globalize.parseFloat.call( this, value, radix, cultureSelector );
+};
+
+Globalize.prototype.culture = function( cultureSelector ) {
+ return Globalize.culture.call( this, cultureSelector );
+};
+
+//
+// public singleton functions
+//
+
+Globalize.addCultureInfo = function( cultureName, baseCultureName, info ) {
+
+ var base = {},
+ isNew = false;
+
+ if ( typeof cultureName !== "string" ) {
+ // cultureName argument is optional string. If not specified, assume info is first
+ // and only argument. Specified info deep-extends current culture.
+ info = cultureName;
+ cultureName = this.culture().name;
+ base = this.cultures[ cultureName ];
+ } else if ( typeof baseCultureName !== "string" ) {
+ // baseCultureName argument is optional string. If not specified, assume info is second
+ // argument. Specified info deep-extends specified culture.
+ // If specified culture does not exist, create by deep-extending default
+ info = baseCultureName;
+ isNew = ( this.cultures[ cultureName ] == null );
+ base = this.cultures[ cultureName ] || this.cultures[ "default" ];
+ } else {
+ // cultureName and baseCultureName specified. Assume a new culture is being created
+ // by deep-extending an specified base culture
+ isNew = true;
+ base = this.cultures[ baseCultureName ];
+ }
+
+ this.cultures[ cultureName ] = extend(true, {},
+ base,
+ info
+ );
+ // Make the standard calendar the current culture if it's a new culture
+ if ( isNew ) {
+ this.cultures[ cultureName ].calendar = this.cultures[ cultureName ].calendars.standard;
+ }
+};
+
+Globalize.findClosestCulture = function( name ) {
+ var match;
+ if ( !name ) {
+ return this.findClosestCulture( this.cultureSelector ) || this.cultures[ "default" ];
+ }
+ if ( typeof name === "string" ) {
+ name = name.split( "," );
+ }
+ if ( isArray(name) ) {
+ var lang,
+ cultures = this.cultures,
+ list = name,
+ i, l = list.length,
+ prioritized = [];
+ for ( i = 0; i < l; i++ ) {
+ name = trim( list[i] );
+ var pri, parts = name.split( ";" );
+ lang = trim( parts[0] );
+ if ( parts.length === 1 ) {
+ pri = 1;
+ }
+ else {
+ name = trim( parts[1] );
+ if ( name.indexOf("q=") === 0 ) {
+ name = name.substr( 2 );
+ pri = parseFloat( name );
+ pri = isNaN( pri ) ? 0 : pri;
+ }
+ else {
+ pri = 1;
+ }
+ }
+ prioritized.push({ lang: lang, pri: pri });
+ }
+ prioritized.sort(function( a, b ) {
+ return a.pri < b.pri ? 1 : -1;
+ });
+
+ // exact match
+ for ( i = 0; i < l; i++ ) {
+ lang = prioritized[ i ].lang;
+ match = cultures[ lang ];
+ if ( match ) {
+ return match;
+ }
+ }
+
+ // neutral language match
+ for ( i = 0; i < l; i++ ) {
+ lang = prioritized[ i ].lang;
+ do {
+ var index = lang.lastIndexOf( "-" );
+ if ( index === -1 ) {
+ break;
+ }
+ // strip off the last part. e.g. en-US => en
+ lang = lang.substr( 0, index );
+ match = cultures[ lang ];
+ if ( match ) {
+ return match;
+ }
+ }
+ while ( 1 );
+ }
+
+ // last resort: match first culture using that language
+ for ( i = 0; i < l; i++ ) {
+ lang = prioritized[ i ].lang;
+ for ( var cultureKey in cultures ) {
+ var culture = cultures[ cultureKey ];
+ if ( culture.language == lang ) {
+ return culture;
+ }
+ }
+ }
+ }
+ else if ( typeof name === "object" ) {
+ return name;
+ }
+ return match || null;
+};
+
+Globalize.format = function( value, format, cultureSelector ) {
+ culture = this.findClosestCulture( cultureSelector );
+ if ( value instanceof Date ) {
+ value = formatDate( value, format, culture );
+ }
+ else if ( typeof value === "number" ) {
+ value = formatNumber( value, format, culture );
+ }
+ return value;
+};
+
+Globalize.localize = function( key, cultureSelector ) {
+ return this.findClosestCulture( cultureSelector ).messages[ key ] ||
+ this.cultures[ "default" ].messages[ key ];
+};
+
+Globalize.parseDate = function( value, formats, culture ) {
+ culture = this.findClosestCulture( culture );
+
+ var date, prop, patterns;
+ if ( formats ) {
+ if ( typeof formats === "string" ) {
+ formats = [ formats ];
+ }
+ if ( formats.length ) {
+ for ( var i = 0, l = formats.length; i < l; i++ ) {
+ var format = formats[ i ];
+ if ( format ) {
+ date = parseExact( value, format, culture );
+ if ( date ) {
+ break;
+ }
+ }
+ }
+ }
+ } else {
+ patterns = culture.calendar.patterns;
+ for ( prop in patterns ) {
+ date = parseExact( value, patterns[prop], culture );
+ if ( date ) {
+ break;
+ }
+ }
+ }
+
+ return date || null;
+};
+
+Globalize.parseInt = function( value, radix, cultureSelector ) {
+ return truncate( Globalize.parseFloat(value, radix, cultureSelector) );
+};
+
+Globalize.parseFloat = function( value, radix, cultureSelector ) {
+ // radix argument is optional
+ if ( typeof radix !== "number" ) {
+ cultureSelector = radix;
+ radix = 10;
+ }
+
+ var culture = this.findClosestCulture( cultureSelector );
+ var ret = NaN,
+ nf = culture.numberFormat;
+
+ if ( value.indexOf(culture.numberFormat.currency.symbol) > -1 ) {
+ // remove currency symbol
+ value = value.replace( culture.numberFormat.currency.symbol, "" );
+ // replace decimal seperator
+ value = value.replace( culture.numberFormat.currency["."], culture.numberFormat["."] );
+ }
+
+ // trim leading and trailing whitespace
+ value = trim( value );
+
+ // allow infinity or hexidecimal
+ if ( regexInfinity.test(value) ) {
+ ret = parseFloat( value );
+ }
+ else if ( !radix && regexHex.test(value) ) {
+ ret = parseInt( value, 16 );
+ }
+ else {
+
+ // determine sign and number
+ var signInfo = parseNegativePattern( value, nf, nf.pattern[0] ),
+ sign = signInfo[ 0 ],
+ num = signInfo[ 1 ];
+
+ // #44 - try parsing as "(n)"
+ if ( sign === "" && nf.pattern[0] !== "(n)" ) {
+ signInfo = parseNegativePattern( value, nf, "(n)" );
+ sign = signInfo[ 0 ];
+ num = signInfo[ 1 ];
+ }
+
+ // try parsing as "-n"
+ if ( sign === "" && nf.pattern[0] !== "-n" ) {
+ signInfo = parseNegativePattern( value, nf, "-n" );
+ sign = signInfo[ 0 ];
+ num = signInfo[ 1 ];
+ }
+
+ sign = sign || "+";
+
+ // determine exponent and number
+ var exponent,
+ intAndFraction,
+ exponentPos = num.indexOf( "e" );
+ if ( exponentPos < 0 ) exponentPos = num.indexOf( "E" );
+ if ( exponentPos < 0 ) {
+ intAndFraction = num;
+ exponent = null;
+ }
+ else {
+ intAndFraction = num.substr( 0, exponentPos );
+ exponent = num.substr( exponentPos + 1 );
+ }
+ // determine decimal position
+ var integer,
+ fraction,
+ decSep = nf[ "." ],
+ decimalPos = intAndFraction.indexOf( decSep );
+ if ( decimalPos < 0 ) {
+ integer = intAndFraction;
+ fraction = null;
+ }
+ else {
+ integer = intAndFraction.substr( 0, decimalPos );
+ fraction = intAndFraction.substr( decimalPos + decSep.length );
+ }
+ // handle groups (e.g. 1,000,000)
+ var groupSep = nf[ "," ];
+ integer = integer.split( groupSep ).join( "" );
+ var altGroupSep = groupSep.replace( /\u00A0/g, " " );
+ if ( groupSep !== altGroupSep ) {
+ integer = integer.split( altGroupSep ).join( "" );
+ }
+ // build a natively parsable number string
+ var p = sign + integer;
+ if ( fraction !== null ) {
+ p += "." + fraction;
+ }
+ if ( exponent !== null ) {
+ // exponent itself may have a number patternd
+ var expSignInfo = parseNegativePattern( exponent, nf, "-n" );
+ p += "e" + ( expSignInfo[0] || "+" ) + expSignInfo[ 1 ];
+ }
+ if ( regexParseFloat.test(p) ) {
+ ret = parseFloat( p );
+ }
+ }
+ return ret;
+};
+
+Globalize.culture = function( cultureSelector ) {
+ // setter
+ if ( typeof cultureSelector !== "undefined" ) {
+ this.cultureSelector = cultureSelector;
+ }
+ // getter
+ return this.findClosestCulture( cultureSelector ) || this.culture[ "default" ];
+};
+
+}( this ));
+/**
+ * @fileoverview gl-matrix - High performance matrix and vector operations for WebGL
+ * @author Brandon Jones
+ * @author Colin MacKenzie IV
+ * @version 1.3.7
+ */
+
+/*
+ * Copyright (c) 2012 Brandon Jones, Colin MacKenzie IV
+ *
+ * This software is provided 'as-is', without any express or implied
+ * warranty. In no event will the authors be held liable for any damages
+ * arising from the use of this software.
+ *
+ * Permission is granted to anyone to use this software for any purpose,
+ * including commercial applications, and to alter it and redistribute it
+ * freely, subject to the following restrictions:
+ *
+ * 1. The origin of this software must not be misrepresented; you must not
+ * claim that you wrote the original software. If you use this software
+ * in a product, an acknowledgment in the product documentation would be
+ * appreciated but is not required.
+ *
+ * 2. Altered source versions must be plainly marked as such, and must not
+ * be misrepresented as being the original software.
+ *
+ * 3. This notice may not be removed or altered from any source
+ * distribution.
+ */
+
+// Updated to use a modification of the "returnExportsGlobal" pattern from https://github.com/umdjs/umd
+
+(function (root, factory) {
+ if (typeof exports === 'object') {
+ // Node. Does not work with strict CommonJS, but
+ // only CommonJS-like enviroments that support module.exports,
+ // like Node.
+ module.exports = factory(global);
+ } else if (typeof define === 'function' && define.amd) {
+ // AMD. Register as an anonymous module.
+ define([], function () {
+ return factory(root);
+ });
+ } else {
+ // Browser globals
+ factory(root);
+ }
+}(this, function (root) {
+ "use strict";
+
+ // Tweak to your liking
+ var FLOAT_EPSILON = 0.000001;
+
+ var glMath = {};
+ (function() {
+ if (typeof(Float32Array) != 'undefined') {
+ var y = new Float32Array(1);
+ var i = new Int32Array(y.buffer);
+
+ /**
+ * Fast way to calculate the inverse square root,
+ * see http://jsperf.com/inverse-square-root/5
+ *
+ * If typed arrays are not available, a slower
+ * implementation will be used.
+ *
+ * @param {Number} number the number
+ * @returns {Number} Inverse square root
+ */
+ glMath.invsqrt = function(number) {
+ var x2 = number * 0.5;
+ y[0] = number;
+ var threehalfs = 1.5;
+
+ i[0] = 0x5f3759df - (i[0] >> 1);
+
+ var number2 = y[0];
+
+ return number2 * (threehalfs - (x2 * number2 * number2));
+ };
+ } else {
+ glMath.invsqrt = function(number) { return 1.0 / Math.sqrt(number); };
+ }
+ })();
+
+ /**
+ * @class System-specific optimal array type
+ * @name MatrixArray
+ */
+ var MatrixArray = null;
+
+ // explicitly sets and returns the type of array to use within glMatrix
+ function setMatrixArrayType(type) {
+ MatrixArray = type;
+ return MatrixArray;
+ }
+
+ // auto-detects and returns the best type of array to use within glMatrix, falling
+ // back to Array if typed arrays are unsupported
+ function determineMatrixArrayType() {
+ MatrixArray = (typeof Float32Array !== 'undefined') ? Float32Array : Array;
+ return MatrixArray;
+ }
+
+ determineMatrixArrayType();
+
+ /**
+ * @class 3 Dimensional Vector
+ * @name vec3
+ */
+ var vec3 = {};
+
+ /**
+ * Creates a new instance of a vec3 using the default array type
+ * Any javascript array-like objects containing at least 3 numeric elements can serve as a vec3
+ *
+ * @param {vec3} [vec] vec3 containing values to initialize with
+ *
+ * @returns {vec3} New vec3
+ */
+ vec3.create = function (vec) {
+ var dest = new MatrixArray(3);
+
+ if (vec) {
+ dest[0] = vec[0];
+ dest[1] = vec[1];
+ dest[2] = vec[2];
+ } else {
+ dest[0] = dest[1] = dest[2] = 0;
+ }
+
+ return dest;
+ };
+
+ /**
+ * Creates a new instance of a vec3, initializing it with the given arguments
+ *
+ * @param {number} x X value
+ * @param {number} y Y value
+ * @param {number} z Z value
+
+ * @returns {vec3} New vec3
+ */
+ vec3.createFrom = function (x, y, z) {
+ var dest = new MatrixArray(3);
+
+ dest[0] = x;
+ dest[1] = y;
+ dest[2] = z;
+
+ return dest;
+ };
+
+ /**
+ * Copies the values of one vec3 to another
+ *
+ * @param {vec3} vec vec3 containing values to copy
+ * @param {vec3} dest vec3 receiving copied values
+ *
+ * @returns {vec3} dest
+ */
+ vec3.set = function (vec, dest) {
+ dest[0] = vec[0];
+ dest[1] = vec[1];
+ dest[2] = vec[2];
+
+ return dest;
+ };
+
+ /**
+ * Compares two vectors for equality within a certain margin of error
+ *
+ * @param {vec3} a First vector
+ * @param {vec3} b Second vector
+ *
+ * @returns {Boolean} True if a is equivalent to b
+ */
+ vec3.equal = function (a, b) {
+ return a === b || (
+ Math.abs(a[0] - b[0]) < FLOAT_EPSILON &&
+ Math.abs(a[1] - b[1]) < FLOAT_EPSILON &&
+ Math.abs(a[2] - b[2]) < FLOAT_EPSILON
+ );
+ };
+
+ /**
+ * Performs a vector addition
+ *
+ * @param {vec3} vec First operand
+ * @param {vec3} vec2 Second operand
+ * @param {vec3} [dest] vec3 receiving operation result. If not specified result is written to vec
+ *
+ * @returns {vec3} dest if specified, vec otherwise
+ */
+ vec3.add = function (vec, vec2, dest) {
+ if (!dest || vec === dest) {
+ vec[0] += vec2[0];
+ vec[1] += vec2[1];
+ vec[2] += vec2[2];
+ return vec;
+ }
+
+ dest[0] = vec[0] + vec2[0];
+ dest[1] = vec[1] + vec2[1];
+ dest[2] = vec[2] + vec2[2];
+ return dest;
+ };
+
+ /**
+ * Performs a vector subtraction
+ *
+ * @param {vec3} vec First operand
+ * @param {vec3} vec2 Second operand
+ * @param {vec3} [dest] vec3 receiving operation result. If not specified result is written to vec
+ *
+ * @returns {vec3} dest if specified, vec otherwise
+ */
+ vec3.subtract = function (vec, vec2, dest) {
+ if (!dest || vec === dest) {
+ vec[0] -= vec2[0];
+ vec[1] -= vec2[1];
+ vec[2] -= vec2[2];
+ return vec;
+ }
+
+ dest[0] = vec[0] - vec2[0];
+ dest[1] = vec[1] - vec2[1];
+ dest[2] = vec[2] - vec2[2];
+ return dest;
+ };
+
+ /**
+ * Performs a vector multiplication
+ *
+ * @param {vec3} vec First operand
+ * @param {vec3} vec2 Second operand
+ * @param {vec3} [dest] vec3 receiving operation result. If not specified result is written to vec
+ *
+ * @returns {vec3} dest if specified, vec otherwise
+ */
+ vec3.multiply = function (vec, vec2, dest) {
+ if (!dest || vec === dest) {
+ vec[0] *= vec2[0];
+ vec[1] *= vec2[1];
+ vec[2] *= vec2[2];
+ return vec;
+ }
+
+ dest[0] = vec[0] * vec2[0];
+ dest[1] = vec[1] * vec2[1];
+ dest[2] = vec[2] * vec2[2];
+ return dest;
+ };
+
+ /**
+ * Negates the components of a vec3
+ *
+ * @param {vec3} vec vec3 to negate
+ * @param {vec3} [dest] vec3 receiving operation result. If not specified result is written to vec
+ *
+ * @returns {vec3} dest if specified, vec otherwise
+ */
+ vec3.negate = function (vec, dest) {
+ if (!dest) { dest = vec; }
+
+ dest[0] = -vec[0];
+ dest[1] = -vec[1];
+ dest[2] = -vec[2];
+ return dest;
+ };
+
+ /**
+ * Multiplies the components of a vec3 by a scalar value
+ *
+ * @param {vec3} vec vec3 to scale
+ * @param {number} val Value to scale by
+ * @param {vec3} [dest] vec3 receiving operation result. If not specified result is written to vec
+ *
+ * @returns {vec3} dest if specified, vec otherwise
+ */
+ vec3.scale = function (vec, val, dest) {
+ if (!dest || vec === dest) {
+ vec[0] *= val;
+ vec[1] *= val;
+ vec[2] *= val;
+ return vec;
+ }
+
+ dest[0] = vec[0] * val;
+ dest[1] = vec[1] * val;
+ dest[2] = vec[2] * val;
+ return dest;
+ };
+
+ /**
+ * Generates a unit vector of the same direction as the provided vec3
+ * If vector length is 0, returns [0, 0, 0]
+ *
+ * @param {vec3} vec vec3 to normalize
+ * @param {vec3} [dest] vec3 receiving operation result. If not specified result is written to vec
+ *
+ * @returns {vec3} dest if specified, vec otherwise
+ */
+ vec3.normalize = function (vec, dest) {
+ if (!dest) { dest = vec; }
+
+ var x = vec[0], y = vec[1], z = vec[2],
+ len = Math.sqrt(x * x + y * y + z * z);
+
+ if (!len) {
+ dest[0] = 0;
+ dest[1] = 0;
+ dest[2] = 0;
+ return dest;
+ } else if (len === 1) {
+ dest[0] = x;
+ dest[1] = y;
+ dest[2] = z;
+ return dest;
+ }
+
+ len = 1 / len;
+ dest[0] = x * len;
+ dest[1] = y * len;
+ dest[2] = z * len;
+ return dest;
+ };
+
+ /**
+ * Generates the cross product of two vec3s
+ *
+ * @param {vec3} vec First operand
+ * @param {vec3} vec2 Second operand
+ * @param {vec3} [dest] vec3 receiving operation result. If not specified result is written to vec
+ *
+ * @returns {vec3} dest if specified, vec otherwise
+ */
+ vec3.cross = function (vec, vec2, dest) {
+ if (!dest) { dest = vec; }
+
+ var x = vec[0], y = vec[1], z = vec[2],
+ x2 = vec2[0], y2 = vec2[1], z2 = vec2[2];
+
+ dest[0] = y * z2 - z * y2;
+ dest[1] = z * x2 - x * z2;
+ dest[2] = x * y2 - y * x2;
+ return dest;
+ };
+
+ /**
+ * Caclulates the length of a vec3
+ *
+ * @param {vec3} vec vec3 to calculate length of
+ *
+ * @returns {number} Length of vec
+ */
+ vec3.length = function (vec) {
+ var x = vec[0], y = vec[1], z = vec[2];
+ return Math.sqrt(x * x + y * y + z * z);
+ };
+
+ /**
+ * Caclulates the squared length of a vec3
+ *
+ * @param {vec3} vec vec3 to calculate squared length of
+ *
+ * @returns {number} Squared Length of vec
+ */
+ vec3.squaredLength = function (vec) {
+ var x = vec[0], y = vec[1], z = vec[2];
+ return x * x + y * y + z * z;
+ };
+
+ /**
+ * Caclulates the dot product of two vec3s
+ *
+ * @param {vec3} vec First operand
+ * @param {vec3} vec2 Second operand
+ *
+ * @returns {number} Dot product of vec and vec2
+ */
+ vec3.dot = function (vec, vec2) {
+ return vec[0] * vec2[0] + vec[1] * vec2[1] + vec[2] * vec2[2];
+ };
+
+ /**
+ * Generates a unit vector pointing from one vector to another
+ *
+ * @param {vec3} vec Origin vec3
+ * @param {vec3} vec2 vec3 to point to
+ * @param {vec3} [dest] vec3 receiving operation result. If not specified result is written to vec
+ *
+ * @returns {vec3} dest if specified, vec otherwise
+ */
+ vec3.direction = function (vec, vec2, dest) {
+ if (!dest) { dest = vec; }
+
+ var x = vec[0] - vec2[0],
+ y = vec[1] - vec2[1],
+ z = vec[2] - vec2[2],
+ len = Math.sqrt(x * x + y * y + z * z);
+
+ if (!len) {
+ dest[0] = 0;
+ dest[1] = 0;
+ dest[2] = 0;
+ return dest;
+ }
+
+ len = 1 / len;
+ dest[0] = x * len;
+ dest[1] = y * len;
+ dest[2] = z * len;
+ return dest;
+ };
+
+ /**
+ * Performs a linear interpolation between two vec3
+ *
+ * @param {vec3} vec First vector
+ * @param {vec3} vec2 Second vector
+ * @param {number} lerp Interpolation amount between the two inputs
+ * @param {vec3} [dest] vec3 receiving operation result. If not specified result is written to vec
+ *
+ * @returns {vec3} dest if specified, vec otherwise
+ */
+ vec3.lerp = function (vec, vec2, lerp, dest) {
+ if (!dest) { dest = vec; }
+
+ dest[0] = vec[0] + lerp * (vec2[0] - vec[0]);
+ dest[1] = vec[1] + lerp * (vec2[1] - vec[1]);
+ dest[2] = vec[2] + lerp * (vec2[2] - vec[2]);
+
+ return dest;
+ };
+
+ /**
+ * Calculates the euclidian distance between two vec3
+ *
+ * Params:
+ * @param {vec3} vec First vector
+ * @param {vec3} vec2 Second vector
+ *
+ * @returns {number} Distance between vec and vec2
+ */
+ vec3.dist = function (vec, vec2) {
+ var x = vec2[0] - vec[0],
+ y = vec2[1] - vec[1],
+ z = vec2[2] - vec[2];
+
+ return Math.sqrt(x*x + y*y + z*z);
+ };
+
+ // Pre-allocated to prevent unecessary garbage collection
+ var unprojectMat = null;
+ var unprojectVec = new MatrixArray(4);
+ /**
+ * Projects the specified vec3 from screen space into object space
+ * Based on the <a href="http://webcvs.freedesktop.org/mesa/Mesa/src/glu/mesa/project.c?revision=1.4&view=markup">Mesa gluUnProject implementation</a>
+ *
+ * @param {vec3} vec Screen-space vector to project
+ * @param {mat4} view View matrix
+ * @param {mat4} proj Projection matrix
+ * @param {vec4} viewport Viewport as given to gl.viewport [x, y, width, height]
+ * @param {vec3} [dest] vec3 receiving unprojected result. If not specified result is written to vec
+ *
+ * @returns {vec3} dest if specified, vec otherwise
+ */
+ vec3.unproject = function (vec, view, proj, viewport, dest) {
+ if (!dest) { dest = vec; }
+
+ if(!unprojectMat) {
+ unprojectMat = mat4.create();
+ }
+
+ var m = unprojectMat;
+ var v = unprojectVec;
+
+ v[0] = (vec[0] - viewport[0]) * 2.0 / viewport[2] - 1.0;
+ v[1] = (vec[1] - viewport[1]) * 2.0 / viewport[3] - 1.0;
+ v[2] = 2.0 * vec[2] - 1.0;
+ v[3] = 1.0;
+
+ mat4.multiply(proj, view, m);
+ if(!mat4.inverse(m)) { return null; }
+
+ mat4.multiplyVec4(m, v);
+ if(v[3] === 0.0) { return null; }
+
+ dest[0] = v[0] / v[3];
+ dest[1] = v[1] / v[3];
+ dest[2] = v[2] / v[3];
+
+ return dest;
+ };
+
+ var xUnitVec3 = vec3.createFrom(1,0,0);
+ var yUnitVec3 = vec3.createFrom(0,1,0);
+ var zUnitVec3 = vec3.createFrom(0,0,1);
+
+ var tmpvec3 = vec3.create();
+ /**
+ * Generates a quaternion of rotation between two given normalized vectors
+ *
+ * @param {vec3} a Normalized source vector
+ * @param {vec3} b Normalized target vector
+ * @param {quat4} [dest] quat4 receiving operation result.
+ *
+ * @returns {quat4} dest if specified, a new quat4 otherwise
+ */
+ vec3.rotationTo = function (a, b, dest) {
+ if (!dest) { dest = quat4.create(); }
+
+ var d = vec3.dot(a, b);
+ var axis = tmpvec3;
+ if (d >= 1.0) {
+ quat4.set(identityQuat4, dest);
+ } else if (d < (0.000001 - 1.0)) {
+ vec3.cross(xUnitVec3, a, axis);
+ if (vec3.length(axis) < 0.000001)
+ vec3.cross(yUnitVec3, a, axis);
+ if (vec3.length(axis) < 0.000001)
+ vec3.cross(zUnitVec3, a, axis);
+ vec3.normalize(axis);
+ quat4.fromAngleAxis(Math.PI, axis, dest);
+ } else {
+ var s = Math.sqrt((1.0 + d) * 2.0);
+ var sInv = 1.0 / s;
+ vec3.cross(a, b, axis);
+ dest[0] = axis[0] * sInv;
+ dest[1] = axis[1] * sInv;
+ dest[2] = axis[2] * sInv;
+ dest[3] = s * 0.5;
+ quat4.normalize(dest);
+ }
+ if (dest[3] > 1.0) dest[3] = 1.0;
+ else if (dest[3] < -1.0) dest[3] = -1.0;
+ return dest;
+ };
+
+ /**
+ * Returns a string representation of a vector
+ *
+ * @param {vec3} vec Vector to represent as a string
+ *
+ * @returns {string} String representation of vec
+ */
+ vec3.str = function (vec) {
+ return '[' + vec[0] + ', ' + vec[1] + ', ' + vec[2] + ']';
+ };
+
+ /**
+ * @class 3x3 Matrix
+ * @name mat3
+ */
+ var mat3 = {};
+
+ /**
+ * Creates a new instance of a mat3 using the default array type
+ * Any javascript array-like object containing at least 9 numeric elements can serve as a mat3
+ *
+ * @param {mat3} [mat] mat3 containing values to initialize with
+ *
+ * @returns {mat3} New mat3
+ */
+ mat3.create = function (mat) {
+ var dest = new MatrixArray(9);
+
+ if (mat) {
+ dest[0] = mat[0];
+ dest[1] = mat[1];
+ dest[2] = mat[2];
+ dest[3] = mat[3];
+ dest[4] = mat[4];
+ dest[5] = mat[5];
+ dest[6] = mat[6];
+ dest[7] = mat[7];
+ dest[8] = mat[8];
+ } else {
+ dest[0] = dest[1] =
+ dest[2] = dest[3] =
+ dest[4] = dest[5] =
+ dest[6] = dest[7] =
+ dest[8] = 0;
+ }
+
+ return dest;
+ };
+
+ /**
+ * Creates a new instance of a mat3, initializing it with the given arguments
+ *
+ * @param {number} m00
+ * @param {number} m01
+ * @param {number} m02
+ * @param {number} m10
+ * @param {number} m11
+ * @param {number} m12
+ * @param {number} m20
+ * @param {number} m21
+ * @param {number} m22
+
+ * @returns {mat3} New mat3
+ */
+ mat3.createFrom = function (m00, m01, m02, m10, m11, m12, m20, m21, m22) {
+ var dest = new MatrixArray(9);
+
+ dest[0] = m00;
+ dest[1] = m01;
+ dest[2] = m02;
+ dest[3] = m10;
+ dest[4] = m11;
+ dest[5] = m12;
+ dest[6] = m20;
+ dest[7] = m21;
+ dest[8] = m22;
+
+ return dest;
+ };
+
+ /**
+ * Calculates the determinant of a mat3
+ *
+ * @param {mat3} mat mat3 to calculate determinant of
+ *
+ * @returns {Number} determinant of mat
+ */
+ mat3.determinant = function (mat) {
+ var a00 = mat[0], a01 = mat[1], a02 = mat[2],
+ a10 = mat[3], a11 = mat[4], a12 = mat[5],
+ a20 = mat[6], a21 = mat[7], a22 = mat[8];
+
+ return a00 * (a22 * a11 - a12 * a21) + a01 * (-a22 * a10 + a12 * a20) + a02 * (a21 * a10 - a11 * a20);
+ };
+
+ /**
+ * Calculates the inverse matrix of a mat3
+ *
+ * @param {mat3} mat mat3 to calculate inverse of
+ * @param {mat3} [dest] mat3 receiving inverse matrix. If not specified result is written to mat
+ *
+ * @param {mat3} dest is specified, mat otherwise, null if matrix cannot be inverted
+ */
+ mat3.inverse = function (mat, dest) {
+ var a00 = mat[0], a01 = mat[1], a02 = mat[2],
+ a10 = mat[3], a11 = mat[4], a12 = mat[5],
+ a20 = mat[6], a21 = mat[7], a22 = mat[8],
+
+ b01 = a22 * a11 - a12 * a21,
+ b11 = -a22 * a10 + a12 * a20,
+ b21 = a21 * a10 - a11 * a20,
+
+ d = a00 * b01 + a01 * b11 + a02 * b21,
+ id;
+
+ if (!d) { return null; }
+ id = 1 / d;
+
+ if (!dest) { dest = mat3.create(); }
+
+ dest[0] = b01 * id;
+ dest[1] = (-a22 * a01 + a02 * a21) * id;
+ dest[2] = (a12 * a01 - a02 * a11) * id;
+ dest[3] = b11 * id;
+ dest[4] = (a22 * a00 - a02 * a20) * id;
+ dest[5] = (-a12 * a00 + a02 * a10) * id;
+ dest[6] = b21 * id;
+ dest[7] = (-a21 * a00 + a01 * a20) * id;
+ dest[8] = (a11 * a00 - a01 * a10) * id;
+ return dest;
+ };
+
+ /**
+ * Performs a matrix multiplication
+ *
+ * @param {mat3} mat First operand
+ * @param {mat3} mat2 Second operand
+ * @param {mat3} [dest] mat3 receiving operation result. If not specified result is written to mat
+ *
+ * @returns {mat3} dest if specified, mat otherwise
+ */
+ mat3.multiply = function (mat, mat2, dest) {
+ if (!dest) { dest = mat; }
+
+
+ // Cache the matrix values (makes for huge speed increases!)
+ var a00 = mat[0], a01 = mat[1], a02 = mat[2],
+ a10 = mat[3], a11 = mat[4], a12 = mat[5],
+ a20 = mat[6], a21 = mat[7], a22 = mat[8],
+
+ b00 = mat2[0], b01 = mat2[1], b02 = mat2[2],
+ b10 = mat2[3], b11 = mat2[4], b12 = mat2[5],
+ b20 = mat2[6], b21 = mat2[7], b22 = mat2[8];
+
+ dest[0] = b00 * a00 + b01 * a10 + b02 * a20;
+ dest[1] = b00 * a01 + b01 * a11 + b02 * a21;
+ dest[2] = b00 * a02 + b01 * a12 + b02 * a22;
+
+ dest[3] = b10 * a00 + b11 * a10 + b12 * a20;
+ dest[4] = b10 * a01 + b11 * a11 + b12 * a21;
+ dest[5] = b10 * a02 + b11 * a12 + b12 * a22;
+
+ dest[6] = b20 * a00 + b21 * a10 + b22 * a20;
+ dest[7] = b20 * a01 + b21 * a11 + b22 * a21;
+ dest[8] = b20 * a02 + b21 * a12 + b22 * a22;
+
+ return dest;
+ };
+
+ /**
+ * Transforms the vec2 according to the given mat3.
+ *
+ * @param {mat3} matrix mat3 to multiply against
+ * @param {vec2} vec the vector to multiply
+ * @param {vec2} [dest] an optional receiving vector. If not given, vec is used.
+ *
+ * @returns {vec2} The multiplication result
+ **/
+ mat3.multiplyVec2 = function(matrix, vec, dest) {
+ if (!dest) dest = vec;
+ var x = vec[0], y = vec[1];
+ dest[0] = x * matrix[0] + y * matrix[3] + matrix[6];
+ dest[1] = x * matrix[1] + y * matrix[4] + matrix[7];
+ return dest;
+ };
+
+ /**
+ * Transforms the vec3 according to the given mat3
+ *
+ * @param {mat3} matrix mat3 to multiply against
+ * @param {vec3} vec the vector to multiply
+ * @param {vec3} [dest] an optional receiving vector. If not given, vec is used.
+ *
+ * @returns {vec3} The multiplication result
+ **/
+ mat3.multiplyVec3 = function(matrix, vec, dest) {
+ if (!dest) dest = vec;
+ var x = vec[0], y = vec[1], z = vec[2];
+ dest[0] = x * matrix[0] + y * matrix[3] + z * matrix[6];
+ dest[1] = x * matrix[1] + y * matrix[4] + z * matrix[7];
+ dest[2] = x * matrix[2] + y * matrix[5] + z * matrix[8];
+
+ return dest;
+ };
+
+ /**
+ * Copies the values of one mat3 to another
+ *
+ * @param {mat3} mat mat3 containing values to copy
+ * @param {mat3} dest mat3 receiving copied values
+ *
+ * @returns {mat3} dest
+ */
+ mat3.set = function (mat, dest) {
+ dest[0] = mat[0];
+ dest[1] = mat[1];
+ dest[2] = mat[2];
+ dest[3] = mat[3];
+ dest[4] = mat[4];
+ dest[5] = mat[5];
+ dest[6] = mat[6];
+ dest[7] = mat[7];
+ dest[8] = mat[8];
+ return dest;
+ };
+
+ /**
+ * Compares two matrices for equality within a certain margin of error
+ *
+ * @param {mat3} a First matrix
+ * @param {mat3} b Second matrix
+ *
+ * @returns {Boolean} True if a is equivalent to b
+ */
+ mat3.equal = function (a, b) {
+ return a === b || (
+ Math.abs(a[0] - b[0]) < FLOAT_EPSILON &&
+ Math.abs(a[1] - b[1]) < FLOAT_EPSILON &&
+ Math.abs(a[2] - b[2]) < FLOAT_EPSILON &&
+ Math.abs(a[3] - b[3]) < FLOAT_EPSILON &&
+ Math.abs(a[4] - b[4]) < FLOAT_EPSILON &&
+ Math.abs(a[5] - b[5]) < FLOAT_EPSILON &&
+ Math.abs(a[6] - b[6]) < FLOAT_EPSILON &&
+ Math.abs(a[7] - b[7]) < FLOAT_EPSILON &&
+ Math.abs(a[8] - b[8]) < FLOAT_EPSILON
+ );
+ };
+
+ /**
+ * Sets a mat3 to an identity matrix
+ *
+ * @param {mat3} dest mat3 to set
+ *
+ * @returns dest if specified, otherwise a new mat3
+ */
+ mat3.identity = function (dest) {
+ if (!dest) { dest = mat3.create(); }
+ dest[0] = 1;
+ dest[1] = 0;
+ dest[2] = 0;
+ dest[3] = 0;
+ dest[4] = 1;
+ dest[5] = 0;
+ dest[6] = 0;
+ dest[7] = 0;
+ dest[8] = 1;
+ return dest;
+ };
+
+ /**
+ * Transposes a mat3 (flips the values over the diagonal)
+ *
+ * Params:
+ * @param {mat3} mat mat3 to transpose
+ * @param {mat3} [dest] mat3 receiving transposed values. If not specified result is written to mat
+ *
+ * @returns {mat3} dest is specified, mat otherwise
+ */
+ mat3.transpose = function (mat, dest) {
+ // If we are transposing ourselves we can skip a few steps but have to cache some values
+ if (!dest || mat === dest) {
+ var a01 = mat[1], a02 = mat[2],
+ a12 = mat[5];
+
+ mat[1] = mat[3];
+ mat[2] = mat[6];
+ mat[3] = a01;
+ mat[5] = mat[7];
+ mat[6] = a02;
+ mat[7] = a12;
+ return mat;
+ }
+
+ dest[0] = mat[0];
+ dest[1] = mat[3];
+ dest[2] = mat[6];
+ dest[3] = mat[1];
+ dest[4] = mat[4];
+ dest[5] = mat[7];
+ dest[6] = mat[2];
+ dest[7] = mat[5];
+ dest[8] = mat[8];
+ return dest;
+ };
+
+ /**
+ * Copies the elements of a mat3 into the upper 3x3 elements of a mat4
+ *
+ * @param {mat3} mat mat3 containing values to copy
+ * @param {mat4} [dest] mat4 receiving copied values
+ *
+ * @returns {mat4} dest if specified, a new mat4 otherwise
+ */
+ mat3.toMat4 = function (mat, dest) {
+ if (!dest) { dest = mat4.create(); }
+
+ dest[15] = 1;
+ dest[14] = 0;
+ dest[13] = 0;
+ dest[12] = 0;
+
+ dest[11] = 0;
+ dest[10] = mat[8];
+ dest[9] = mat[7];
+ dest[8] = mat[6];
+
+ dest[7] = 0;
+ dest[6] = mat[5];
+ dest[5] = mat[4];
+ dest[4] = mat[3];
+
+ dest[3] = 0;
+ dest[2] = mat[2];
+ dest[1] = mat[1];
+ dest[0] = mat[0];
+
+ return dest;
+ };
+
+ /**
+ * Returns a string representation of a mat3
+ *
+ * @param {mat3} mat mat3 to represent as a string
+ *
+ * @param {string} String representation of mat
+ */
+ mat3.str = function (mat) {
+ return '[' + mat[0] + ', ' + mat[1] + ', ' + mat[2] +
+ ', ' + mat[3] + ', ' + mat[4] + ', ' + mat[5] +
+ ', ' + mat[6] + ', ' + mat[7] + ', ' + mat[8] + ']';
+ };
+
+ /**
+ * @class 4x4 Matrix
+ * @name mat4
+ */
+ var mat4 = {};
+
+ /**
+ * Creates a new instance of a mat4 using the default array type
+ * Any javascript array-like object containing at least 16 numeric elements can serve as a mat4
+ *
+ * @param {mat4} [mat] mat4 containing values to initialize with
+ *
+ * @returns {mat4} New mat4
+ */
+ mat4.create = function (mat) {
+ var dest = new MatrixArray(16);
+
+ if (mat) {
+ dest[0] = mat[0];
+ dest[1] = mat[1];
+ dest[2] = mat[2];
+ dest[3] = mat[3];
+ dest[4] = mat[4];
+ dest[5] = mat[5];
+ dest[6] = mat[6];
+ dest[7] = mat[7];
+ dest[8] = mat[8];
+ dest[9] = mat[9];
+ dest[10] = mat[10];
+ dest[11] = mat[11];
+ dest[12] = mat[12];
+ dest[13] = mat[13];
+ dest[14] = mat[14];
+ dest[15] = mat[15];
+ }
+
+ return dest;
+ };
+
+ /**
+ * Creates a new instance of a mat4, initializing it with the given arguments
+ *
+ * @param {number} m00
+ * @param {number} m01
+ * @param {number} m02
+ * @param {number} m03
+ * @param {number} m10
+ * @param {number} m11
+ * @param {number} m12
+ * @param {number} m13
+ * @param {number} m20
+ * @param {number} m21
+ * @param {number} m22
+ * @param {number} m23
+ * @param {number} m30
+ * @param {number} m31
+ * @param {number} m32
+ * @param {number} m33
+
+ * @returns {mat4} New mat4
+ */
+ mat4.createFrom = function (m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) {
+ var dest = new MatrixArray(16);
+
+ dest[0] = m00;
+ dest[1] = m01;
+ dest[2] = m02;
+ dest[3] = m03;
+ dest[4] = m10;
+ dest[5] = m11;
+ dest[6] = m12;
+ dest[7] = m13;
+ dest[8] = m20;
+ dest[9] = m21;
+ dest[10] = m22;
+ dest[11] = m23;
+ dest[12] = m30;
+ dest[13] = m31;
+ dest[14] = m32;
+ dest[15] = m33;
+
+ return dest;
+ };
+
+ /**
+ * Copies the values of one mat4 to another
+ *
+ * @param {mat4} mat mat4 containing values to copy
+ * @param {mat4} dest mat4 receiving copied values
+ *
+ * @returns {mat4} dest
+ */
+ mat4.set = function (mat, dest) {
+ dest[0] = mat[0];
+ dest[1] = mat[1];
+ dest[2] = mat[2];
+ dest[3] = mat[3];
+ dest[4] = mat[4];
+ dest[5] = mat[5];
+ dest[6] = mat[6];
+ dest[7] = mat[7];
+ dest[8] = mat[8];
+ dest[9] = mat[9];
+ dest[10] = mat[10];
+ dest[11] = mat[11];
+ dest[12] = mat[12];
+ dest[13] = mat[13];
+ dest[14] = mat[14];
+ dest[15] = mat[15];
+ return dest;
+ };
+
+ /**
+ * Compares two matrices for equality within a certain margin of error
+ *
+ * @param {mat4} a First matrix
+ * @param {mat4} b Second matrix
+ *
+ * @returns {Boolean} True if a is equivalent to b
+ */
+ mat4.equal = function (a, b) {
+ return a === b || (
+ Math.abs(a[0] - b[0]) < FLOAT_EPSILON &&
+ Math.abs(a[1] - b[1]) < FLOAT_EPSILON &&
+ Math.abs(a[2] - b[2]) < FLOAT_EPSILON &&
+ Math.abs(a[3] - b[3]) < FLOAT_EPSILON &&
+ Math.abs(a[4] - b[4]) < FLOAT_EPSILON &&
+ Math.abs(a[5] - b[5]) < FLOAT_EPSILON &&
+ Math.abs(a[6] - b[6]) < FLOAT_EPSILON &&
+ Math.abs(a[7] - b[7]) < FLOAT_EPSILON &&
+ Math.abs(a[8] - b[8]) < FLOAT_EPSILON &&
+ Math.abs(a[9] - b[9]) < FLOAT_EPSILON &&
+ Math.abs(a[10] - b[10]) < FLOAT_EPSILON &&
+ Math.abs(a[11] - b[11]) < FLOAT_EPSILON &&
+ Math.abs(a[12] - b[12]) < FLOAT_EPSILON &&
+ Math.abs(a[13] - b[13]) < FLOAT_EPSILON &&
+ Math.abs(a[14] - b[14]) < FLOAT_EPSILON &&
+ Math.abs(a[15] - b[15]) < FLOAT_EPSILON
+ );
+ };
+
+ /**
+ * Sets a mat4 to an identity matrix
+ *
+ * @param {mat4} dest mat4 to set
+ *
+ * @returns {mat4} dest
+ */
+ mat4.identity = function (dest) {
+ if (!dest) { dest = mat4.create(); }
+ dest[0] = 1;
+ dest[1] = 0;
+ dest[2] = 0;
+ dest[3] = 0;
+ dest[4] = 0;
+ dest[5] = 1;
+ dest[6] = 0;
+ dest[7] = 0;
+ dest[8] = 0;
+ dest[9] = 0;
+ dest[10] = 1;
+ dest[11] = 0;
+ dest[12] = 0;
+ dest[13] = 0;
+ dest[14] = 0;
+ dest[15] = 1;
+ return dest;
+ };
+
+ /**
+ * Transposes a mat4 (flips the values over the diagonal)
+ *
+ * @param {mat4} mat mat4 to transpose
+ * @param {mat4} [dest] mat4 receiving transposed values. If not specified result is written to mat
+ *
+ * @param {mat4} dest is specified, mat otherwise
+ */
+ mat4.transpose = function (mat, dest) {
+ // If we are transposing ourselves we can skip a few steps but have to cache some values
+ if (!dest || mat === dest) {
+ var a01 = mat[1], a02 = mat[2], a03 = mat[3],
+ a12 = mat[6], a13 = mat[7],
+ a23 = mat[11];
+
+ mat[1] = mat[4];
+ mat[2] = mat[8];
+ mat[3] = mat[12];
+ mat[4] = a01;
+ mat[6] = mat[9];
+ mat[7] = mat[13];
+ mat[8] = a02;
+ mat[9] = a12;
+ mat[11] = mat[14];
+ mat[12] = a03;
+ mat[13] = a13;
+ mat[14] = a23;
+ return mat;
+ }
+
+ dest[0] = mat[0];
+ dest[1] = mat[4];
+ dest[2] = mat[8];
+ dest[3] = mat[12];
+ dest[4] = mat[1];
+ dest[5] = mat[5];
+ dest[6] = mat[9];
+ dest[7] = mat[13];
+ dest[8] = mat[2];
+ dest[9] = mat[6];
+ dest[10] = mat[10];
+ dest[11] = mat[14];
+ dest[12] = mat[3];
+ dest[13] = mat[7];
+ dest[14] = mat[11];
+ dest[15] = mat[15];
+ return dest;
+ };
+
+ /**
+ * Calculates the determinant of a mat4
+ *
+ * @param {mat4} mat mat4 to calculate determinant of
+ *
+ * @returns {number} determinant of mat
+ */
+ mat4.determinant = function (mat) {
+ // Cache the matrix values (makes for huge speed increases!)
+ var a00 = mat[0], a01 = mat[1], a02 = mat[2], a03 = mat[3],
+ a10 = mat[4], a11 = mat[5], a12 = mat[6], a13 = mat[7],
+ a20 = mat[8], a21 = mat[9], a22 = mat[10], a23 = mat[11],
+ a30 = mat[12], a31 = mat[13], a32 = mat[14], a33 = mat[15];
+
+ return (a30 * a21 * a12 * a03 - a20 * a31 * a12 * a03 - a30 * a11 * a22 * a03 + a10 * a31 * a22 * a03 +
+ a20 * a11 * a32 * a03 - a10 * a21 * a32 * a03 - a30 * a21 * a02 * a13 + a20 * a31 * a02 * a13 +
+ a30 * a01 * a22 * a13 - a00 * a31 * a22 * a13 - a20 * a01 * a32 * a13 + a00 * a21 * a32 * a13 +
+ a30 * a11 * a02 * a23 - a10 * a31 * a02 * a23 - a30 * a01 * a12 * a23 + a00 * a31 * a12 * a23 +
+ a10 * a01 * a32 * a23 - a00 * a11 * a32 * a23 - a20 * a11 * a02 * a33 + a10 * a21 * a02 * a33 +
+ a20 * a01 * a12 * a33 - a00 * a21 * a12 * a33 - a10 * a01 * a22 * a33 + a00 * a11 * a22 * a33);
+ };
+
+ /**
+ * Calculates the inverse matrix of a mat4
+ *
+ * @param {mat4} mat mat4 to calculate inverse of
+ * @param {mat4} [dest] mat4 receiving inverse matrix. If not specified result is written to mat
+ *
+ * @param {mat4} dest is specified, mat otherwise, null if matrix cannot be inverted
+ */
+ mat4.inverse = function (mat, dest) {
+ if (!dest) { dest = mat; }
+
+ // Cache the matrix values (makes for huge speed increases!)
+ var a00 = mat[0], a01 = mat[1], a02 = mat[2], a03 = mat[3],
+ a10 = mat[4], a11 = mat[5], a12 = mat[6], a13 = mat[7],
+ a20 = mat[8], a21 = mat[9], a22 = mat[10], a23 = mat[11],
+ a30 = mat[12], a31 = mat[13], a32 = mat[14], a33 = mat[15],
+
+ b00 = a00 * a11 - a01 * a10,
+ b01 = a00 * a12 - a02 * a10,
+ b02 = a00 * a13 - a03 * a10,
+ b03 = a01 * a12 - a02 * a11,
+ b04 = a01 * a13 - a03 * a11,
+ b05 = a02 * a13 - a03 * a12,
+ b06 = a20 * a31 - a21 * a30,
+ b07 = a20 * a32 - a22 * a30,
+ b08 = a20 * a33 - a23 * a30,
+ b09 = a21 * a32 - a22 * a31,
+ b10 = a21 * a33 - a23 * a31,
+ b11 = a22 * a33 - a23 * a32,
+
+ d = (b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06),
+ invDet;
+
+ // Calculate the determinant
+ if (!d) { return null; }
+ invDet = 1 / d;
+
+ dest[0] = (a11 * b11 - a12 * b10 + a13 * b09) * invDet;
+ dest[1] = (-a01 * b11 + a02 * b10 - a03 * b09) * invDet;
+ dest[2] = (a31 * b05 - a32 * b04 + a33 * b03) * invDet;
+ dest[3] = (-a21 * b05 + a22 * b04 - a23 * b03) * invDet;
+ dest[4] = (-a10 * b11 + a12 * b08 - a13 * b07) * invDet;
+ dest[5] = (a00 * b11 - a02 * b08 + a03 * b07) * invDet;
+ dest[6] = (-a30 * b05 + a32 * b02 - a33 * b01) * invDet;
+ dest[7] = (a20 * b05 - a22 * b02 + a23 * b01) * invDet;
+ dest[8] = (a10 * b10 - a11 * b08 + a13 * b06) * invDet;
+ dest[9] = (-a00 * b10 + a01 * b08 - a03 * b06) * invDet;
+ dest[10] = (a30 * b04 - a31 * b02 + a33 * b00) * invDet;
+ dest[11] = (-a20 * b04 + a21 * b02 - a23 * b00) * invDet;
+ dest[12] = (-a10 * b09 + a11 * b07 - a12 * b06) * invDet;
+ dest[13] = (a00 * b09 - a01 * b07 + a02 * b06) * invDet;
+ dest[14] = (-a30 * b03 + a31 * b01 - a32 * b00) * invDet;
+ dest[15] = (a20 * b03 - a21 * b01 + a22 * b00) * invDet;
+
+ return dest;
+ };
+
+ /**
+ * Copies the upper 3x3 elements of a mat4 into another mat4
+ *
+ * @param {mat4} mat mat4 containing values to copy
+ * @param {mat4} [dest] mat4 receiving copied values
+ *
+ * @returns {mat4} dest is specified, a new mat4 otherwise
+ */
+ mat4.toRotationMat = function (mat, dest) {
+ if (!dest) { dest = mat4.create(); }
+
+ dest[0] = mat[0];
+ dest[1] = mat[1];
+ dest[2] = mat[2];
+ dest[3] = mat[3];
+ dest[4] = mat[4];
+ dest[5] = mat[5];
+ dest[6] = mat[6];
+ dest[7] = mat[7];
+ dest[8] = mat[8];
+ dest[9] = mat[9];
+ dest[10] = mat[10];
+ dest[11] = mat[11];
+ dest[12] = 0;
+ dest[13] = 0;
+ dest[14] = 0;
+ dest[15] = 1;
+
+ return dest;
+ };
+
+ /**
+ * Copies the upper 3x3 elements of a mat4 into a mat3
+ *
+ * @param {mat4} mat mat4 containing values to copy
+ * @param {mat3} [dest] mat3 receiving copied values
+ *
+ * @returns {mat3} dest is specified, a new mat3 otherwise
+ */
+ mat4.toMat3 = function (mat, dest) {
+ if (!dest) { dest = mat3.create(); }
+
+ dest[0] = mat[0];
+ dest[1] = mat[1];
+ dest[2] = mat[2];
+ dest[3] = mat[4];
+ dest[4] = mat[5];
+ dest[5] = mat[6];
+ dest[6] = mat[8];
+ dest[7] = mat[9];
+ dest[8] = mat[10];
+
+ return dest;
+ };
+
+ /**
+ * Calculates the inverse of the upper 3x3 elements of a mat4 and copies the result into a mat3
+ * The resulting matrix is useful for calculating transformed normals
+ *
+ * Params:
+ * @param {mat4} mat mat4 containing values to invert and copy
+ * @param {mat3} [dest] mat3 receiving values
+ *
+ * @returns {mat3} dest is specified, a new mat3 otherwise, null if the matrix cannot be inverted
+ */
+ mat4.toInverseMat3 = function (mat, dest) {
+ // Cache the matrix values (makes for huge speed increases!)
+ var a00 = mat[0], a01 = mat[1], a02 = mat[2],
+ a10 = mat[4], a11 = mat[5], a12 = mat[6],
+ a20 = mat[8], a21 = mat[9], a22 = mat[10],
+
+ b01 = a22 * a11 - a12 * a21,
+ b11 = -a22 * a10 + a12 * a20,
+ b21 = a21 * a10 - a11 * a20,
+
+ d = a00 * b01 + a01 * b11 + a02 * b21,
+ id;
+
+ if (!d) { return null; }
+ id = 1 / d;
+
+ if (!dest) { dest = mat3.create(); }
+
+ dest[0] = b01 * id;
+ dest[1] = (-a22 * a01 + a02 * a21) * id;
+ dest[2] = (a12 * a01 - a02 * a11) * id;
+ dest[3] = b11 * id;
+ dest[4] = (a22 * a00 - a02 * a20) * id;
+ dest[5] = (-a12 * a00 + a02 * a10) * id;
+ dest[6] = b21 * id;
+ dest[7] = (-a21 * a00 + a01 * a20) * id;
+ dest[8] = (a11 * a00 - a01 * a10) * id;
+
+ return dest;
+ };
+
+ /**
+ * Performs a matrix multiplication
+ *
+ * @param {mat4} mat First operand
+ * @param {mat4} mat2 Second operand
+ * @param {mat4} [dest] mat4 receiving operation result. If not specified result is written to mat
+ *
+ * @returns {mat4} dest if specified, mat otherwise
+ */
+ mat4.multiply = function (mat, mat2, dest) {
+ if (!dest) { dest = mat; }
+
+ // Cache the matrix values (makes for huge speed increases!)
+ var a00 = mat[ 0], a01 = mat[ 1], a02 = mat[ 2], a03 = mat[3];
+ var a10 = mat[ 4], a11 = mat[ 5], a12 = mat[ 6], a13 = mat[7];
+ var a20 = mat[ 8], a21 = mat[ 9], a22 = mat[10], a23 = mat[11];
+ var a30 = mat[12], a31 = mat[13], a32 = mat[14], a33 = mat[15];
+
+ // Cache only the current line of the second matrix
+ var b0 = mat2[0], b1 = mat2[1], b2 = mat2[2], b3 = mat2[3];
+ dest[0] = b0*a00 + b1*a10 + b2*a20 + b3*a30;
+ dest[1] = b0*a01 + b1*a11 + b2*a21 + b3*a31;
+ dest[2] = b0*a02 + b1*a12 + b2*a22 + b3*a32;
+ dest[3] = b0*a03 + b1*a13 + b2*a23 + b3*a33;
+
+ b0 = mat2[4];
+ b1 = mat2[5];
+ b2 = mat2[6];
+ b3 = mat2[7];
+ dest[4] = b0*a00 + b1*a10 + b2*a20 + b3*a30;
+ dest[5] = b0*a01 + b1*a11 + b2*a21 + b3*a31;
+ dest[6] = b0*a02 + b1*a12 + b2*a22 + b3*a32;
+ dest[7] = b0*a03 + b1*a13 + b2*a23 + b3*a33;
+
+ b0 = mat2[8];
+ b1 = mat2[9];
+ b2 = mat2[10];
+ b3 = mat2[11];
+ dest[8] = b0*a00 + b1*a10 + b2*a20 + b3*a30;
+ dest[9] = b0*a01 + b1*a11 + b2*a21 + b3*a31;
+ dest[10] = b0*a02 + b1*a12 + b2*a22 + b3*a32;
+ dest[11] = b0*a03 + b1*a13 + b2*a23 + b3*a33;
+
+ b0 = mat2[12];
+ b1 = mat2[13];
+ b2 = mat2[14];
+ b3 = mat2[15];
+ dest[12] = b0*a00 + b1*a10 + b2*a20 + b3*a30;
+ dest[13] = b0*a01 + b1*a11 + b2*a21 + b3*a31;
+ dest[14] = b0*a02 + b1*a12 + b2*a22 + b3*a32;
+ dest[15] = b0*a03 + b1*a13 + b2*a23 + b3*a33;
+
+ return dest;
+ };
+
+ /**
+ * Transforms a vec3 with the given matrix
+ * 4th vector component is implicitly '1'
+ *
+ * @param {mat4} mat mat4 to transform the vector with
+ * @param {vec3} vec vec3 to transform
+ * @param {vec3} [dest] vec3 receiving operation result. If not specified result is written to vec
+ *
+ * @returns {vec3} dest if specified, vec otherwise
+ */
+ mat4.multiplyVec3 = function (mat, vec, dest) {
+ if (!dest) { dest = vec; }
+
+ var x = vec[0], y = vec[1], z = vec[2];
+
+ dest[0] = mat[0] * x + mat[4] * y + mat[8] * z + mat[12];
+ dest[1] = mat[1] * x + mat[5] * y + mat[9] * z + mat[13];
+ dest[2] = mat[2] * x + mat[6] * y + mat[10] * z + mat[14];
+
+ return dest;
+ };
+
+ /**
+ * Transforms a vec4 with the given matrix
+ *
+ * @param {mat4} mat mat4 to transform the vector with
+ * @param {vec4} vec vec4 to transform
+ * @param {vec4} [dest] vec4 receiving operation result. If not specified result is written to vec
+ *
+ * @returns {vec4} dest if specified, vec otherwise
+ */
+ mat4.multiplyVec4 = function (mat, vec, dest) {
+ if (!dest) { dest = vec; }
+
+ var x = vec[0], y = vec[1], z = vec[2], w = vec[3];
+
+ dest[0] = mat[0] * x + mat[4] * y + mat[8] * z + mat[12] * w;
+ dest[1] = mat[1] * x + mat[5] * y + mat[9] * z + mat[13] * w;
+ dest[2] = mat[2] * x + mat[6] * y + mat[10] * z + mat[14] * w;
+ dest[3] = mat[3] * x + mat[7] * y + mat[11] * z + mat[15] * w;
+
+ return dest;
+ };
+
+ /**
+ * Translates a matrix by the given vector
+ *
+ * @param {mat4} mat mat4 to translate
+ * @param {vec3} vec vec3 specifying the translation
+ * @param {mat4} [dest] mat4 receiving operation result. If not specified result is written to mat
+ *
+ * @returns {mat4} dest if specified, mat otherwise
+ */
+ mat4.translate = function (mat, vec, dest) {
+ var x = vec[0], y = vec[1], z = vec[2],
+ a00, a01, a02, a03,
+ a10, a11, a12, a13,
+ a20, a21, a22, a23;
+
+ if (!dest || mat === dest) {
+ mat[12] = mat[0] * x + mat[4] * y + mat[8] * z + mat[12];
+ mat[13] = mat[1] * x + mat[5] * y + mat[9] * z + mat[13];
+ mat[14] = mat[2] * x + mat[6] * y + mat[10] * z + mat[14];
+ mat[15] = mat[3] * x + mat[7] * y + mat[11] * z + mat[15];
+ return mat;
+ }
+
+ a00 = mat[0]; a01 = mat[1]; a02 = mat[2]; a03 = mat[3];
+ a10 = mat[4]; a11 = mat[5]; a12 = mat[6]; a13 = mat[7];
+ a20 = mat[8]; a21 = mat[9]; a22 = mat[10]; a23 = mat[11];
+
+ dest[0] = a00; dest[1] = a01; dest[2] = a02; dest[3] = a03;
+ dest[4] = a10; dest[5] = a11; dest[6] = a12; dest[7] = a13;
+ dest[8] = a20; dest[9] = a21; dest[10] = a22; dest[11] = a23;
+
+ dest[12] = a00 * x + a10 * y + a20 * z + mat[12];
+ dest[13] = a01 * x + a11 * y + a21 * z + mat[13];
+ dest[14] = a02 * x + a12 * y + a22 * z + mat[14];
+ dest[15] = a03 * x + a13 * y + a23 * z + mat[15];
+ return dest;
+ };
+
+ /**
+ * Scales a matrix by the given vector
+ *
+ * @param {mat4} mat mat4 to scale
+ * @param {vec3} vec vec3 specifying the scale for each axis
+ * @param {mat4} [dest] mat4 receiving operation result. If not specified result is written to mat
+ *
+ * @param {mat4} dest if specified, mat otherwise
+ */
+ mat4.scale = function (mat, vec, dest) {
+ var x = vec[0], y = vec[1], z = vec[2];
+
+ if (!dest || mat === dest) {
+ mat[0] *= x;
+ mat[1] *= x;
+ mat[2] *= x;
+ mat[3] *= x;
+ mat[4] *= y;
+ mat[5] *= y;
+ mat[6] *= y;
+ mat[7] *= y;
+ mat[8] *= z;
+ mat[9] *= z;
+ mat[10] *= z;
+ mat[11] *= z;
+ return mat;
+ }
+
+ dest[0] = mat[0] * x;
+ dest[1] = mat[1] * x;
+ dest[2] = mat[2] * x;
+ dest[3] = mat[3] * x;
+ dest[4] = mat[4] * y;
+ dest[5] = mat[5] * y;
+ dest[6] = mat[6] * y;
+ dest[7] = mat[7] * y;
+ dest[8] = mat[8] * z;
+ dest[9] = mat[9] * z;
+ dest[10] = mat[10] * z;
+ dest[11] = mat[11] * z;
+ dest[12] = mat[12];
+ dest[13] = mat[13];
+ dest[14] = mat[14];
+ dest[15] = mat[15];
+ return dest;
+ };
+
+ /**
+ * Rotates a matrix by the given angle around the specified axis
+ * If rotating around a primary axis (X,Y,Z) one of the specialized rotation functions should be used instead for performance
+ *
+ * @param {mat4} mat mat4 to rotate
+ * @param {number} angle Angle (in radians) to rotate
+ * @param {vec3} axis vec3 representing the axis to rotate around
+ * @param {mat4} [dest] mat4 receiving operation result. If not specified result is written to mat
+ *
+ * @returns {mat4} dest if specified, mat otherwise
+ */
+ mat4.rotate = function (mat, angle, axis, dest) {
+ var x = axis[0], y = axis[1], z = axis[2],
+ len = Math.sqrt(x * x + y * y + z * z),
+ s, c, t,
+ a00, a01, a02, a03,
+ a10, a11, a12, a13,
+ a20, a21, a22, a23,
+ b00, b01, b02,
+ b10, b11, b12,
+ b20, b21, b22;
+
+ if (!len) { return null; }
+ if (len !== 1) {
+ len = 1 / len;
+ x *= len;
+ y *= len;
+ z *= len;
+ }
+
+ s = Math.sin(angle);
+ c = Math.cos(angle);
+ t = 1 - c;
+
+ a00 = mat[0]; a01 = mat[1]; a02 = mat[2]; a03 = mat[3];
+ a10 = mat[4]; a11 = mat[5]; a12 = mat[6]; a13 = mat[7];
+ a20 = mat[8]; a21 = mat[9]; a22 = mat[10]; a23 = mat[11];
+
+ // Construct the elements of the rotation matrix
+ b00 = x * x * t + c; b01 = y * x * t + z * s; b02 = z * x * t - y * s;
+ b10 = x * y * t - z * s; b11 = y * y * t + c; b12 = z * y * t + x * s;
+ b20 = x * z * t + y * s; b21 = y * z * t - x * s; b22 = z * z * t + c;
+
+ if (!dest) {
+ dest = mat;
+ } else if (mat !== dest) { // If the source and destination differ, copy the unchanged last row
+ dest[12] = mat[12];
+ dest[13] = mat[13];
+ dest[14] = mat[14];
+ dest[15] = mat[15];
+ }
+
+ // Perform rotation-specific matrix multiplication
+ dest[0] = a00 * b00 + a10 * b01 + a20 * b02;
+ dest[1] = a01 * b00 + a11 * b01 + a21 * b02;
+ dest[2] = a02 * b00 + a12 * b01 + a22 * b02;
+ dest[3] = a03 * b00 + a13 * b01 + a23 * b02;
+
+ dest[4] = a00 * b10 + a10 * b11 + a20 * b12;
+ dest[5] = a01 * b10 + a11 * b11 + a21 * b12;
+ dest[6] = a02 * b10 + a12 * b11 + a22 * b12;
+ dest[7] = a03 * b10 + a13 * b11 + a23 * b12;
+
+ dest[8] = a00 * b20 + a10 * b21 + a20 * b22;
+ dest[9] = a01 * b20 + a11 * b21 + a21 * b22;
+ dest[10] = a02 * b20 + a12 * b21 + a22 * b22;
+ dest[11] = a03 * b20 + a13 * b21 + a23 * b22;
+ return dest;
+ };
+
+ /**
+ * Rotates a matrix by the given angle around the X axis
+ *
+ * @param {mat4} mat mat4 to rotate
+ * @param {number} angle Angle (in radians) to rotate
+ * @param {mat4} [dest] mat4 receiving operation result. If not specified result is written to mat
+ *
+ * @returns {mat4} dest if specified, mat otherwise
+ */
+ mat4.rotateX = function (mat, angle, dest) {
+ var s = Math.sin(angle),
+ c = Math.cos(angle),
+ a10 = mat[4],
+ a11 = mat[5],
+ a12 = mat[6],
+ a13 = mat[7],
+ a20 = mat[8],
+ a21 = mat[9],
+ a22 = mat[10],
+ a23 = mat[11];
+
+ if (!dest) {
+ dest = mat;
+ } else if (mat !== dest) { // If the source and destination differ, copy the unchanged rows
+ dest[0] = mat[0];
+ dest[1] = mat[1];
+ dest[2] = mat[2];
+ dest[3] = mat[3];
+
+ dest[12] = mat[12];
+ dest[13] = mat[13];
+ dest[14] = mat[14];
+ dest[15] = mat[15];
+ }
+
+ // Perform axis-specific matrix multiplication
+ dest[4] = a10 * c + a20 * s;
+ dest[5] = a11 * c + a21 * s;
+ dest[6] = a12 * c + a22 * s;
+ dest[7] = a13 * c + a23 * s;
+
+ dest[8] = a10 * -s + a20 * c;
+ dest[9] = a11 * -s + a21 * c;
+ dest[10] = a12 * -s + a22 * c;
+ dest[11] = a13 * -s + a23 * c;
+ return dest;
+ };
+
+ /**
+ * Rotates a matrix by the given angle around the Y axis
+ *
+ * @param {mat4} mat mat4 to rotate
+ * @param {number} angle Angle (in radians) to rotate
+ * @param {mat4} [dest] mat4 receiving operation result. If not specified result is written to mat
+ *
+ * @returns {mat4} dest if specified, mat otherwise
+ */
+ mat4.rotateY = function (mat, angle, dest) {
+ var s = Math.sin(angle),
+ c = Math.cos(angle),
+ a00 = mat[0],
+ a01 = mat[1],
+ a02 = mat[2],
+ a03 = mat[3],
+ a20 = mat[8],
+ a21 = mat[9],
+ a22 = mat[10],
+ a23 = mat[11];
+
+ if (!dest) {
+ dest = mat;
+ } else if (mat !== dest) { // If the source and destination differ, copy the unchanged rows
+ dest[4] = mat[4];
+ dest[5] = mat[5];
+ dest[6] = mat[6];
+ dest[7] = mat[7];
+
+ dest[12] = mat[12];
+ dest[13] = mat[13];
+ dest[14] = mat[14];
+ dest[15] = mat[15];
+ }
+
+ // Perform axis-specific matrix multiplication
+ dest[0] = a00 * c + a20 * -s;
+ dest[1] = a01 * c + a21 * -s;
+ dest[2] = a02 * c + a22 * -s;
+ dest[3] = a03 * c + a23 * -s;
+
+ dest[8] = a00 * s + a20 * c;
+ dest[9] = a01 * s + a21 * c;
+ dest[10] = a02 * s + a22 * c;
+ dest[11] = a03 * s + a23 * c;
+ return dest;
+ };
+
+ /**
+ * Rotates a matrix by the given angle around the Z axis
+ *
+ * @param {mat4} mat mat4 to rotate
+ * @param {number} angle Angle (in radians) to rotate
+ * @param {mat4} [dest] mat4 receiving operation result. If not specified result is written to mat
+ *
+ * @returns {mat4} dest if specified, mat otherwise
+ */
+ mat4.rotateZ = function (mat, angle, dest) {
+ var s = Math.sin(angle),
+ c = Math.cos(angle),
+ a00 = mat[0],
+ a01 = mat[1],
+ a02 = mat[2],
+ a03 = mat[3],
+ a10 = mat[4],
+ a11 = mat[5],
+ a12 = mat[6],
+ a13 = mat[7];
+
+ if (!dest) {
+ dest = mat;
+ } else if (mat !== dest) { // If the source and destination differ, copy the unchanged last row
+ dest[8] = mat[8];
+ dest[9] = mat[9];
+ dest[10] = mat[10];
+ dest[11] = mat[11];
+
+ dest[12] = mat[12];
+ dest[13] = mat[13];
+ dest[14] = mat[14];
+ dest[15] = mat[15];
+ }
+
+ // Perform axis-specific matrix multiplication
+ dest[0] = a00 * c + a10 * s;
+ dest[1] = a01 * c + a11 * s;
+ dest[2] = a02 * c + a12 * s;
+ dest[3] = a03 * c + a13 * s;
+
+ dest[4] = a00 * -s + a10 * c;
+ dest[5] = a01 * -s + a11 * c;
+ dest[6] = a02 * -s + a12 * c;
+ dest[7] = a03 * -s + a13 * c;
+
+ return dest;
+ };
+
+ /**
+ * Generates a frustum matrix with the given bounds
+ *
+ * @param {number} left Left bound of the frustum
+ * @param {number} right Right bound of the frustum
+ * @param {number} bottom Bottom bound of the frustum
+ * @param {number} top Top bound of the frustum
+ * @param {number} near Near bound of the frustum
+ * @param {number} far Far bound of the frustum
+ * @param {mat4} [dest] mat4 frustum matrix will be written into
+ *
+ * @returns {mat4} dest if specified, a new mat4 otherwise
+ */
+ mat4.frustum = function (left, right, bottom, top, near, far, dest) {
+ if (!dest) { dest = mat4.create(); }
+ var rl = (right - left),
+ tb = (top - bottom),
+ fn = (far - near);
+ dest[0] = (near * 2) / rl;
+ dest[1] = 0;
+ dest[2] = 0;
+ dest[3] = 0;
+ dest[4] = 0;
+ dest[5] = (near * 2) / tb;
+ dest[6] = 0;
+ dest[7] = 0;
+ dest[8] = (right + left) / rl;
+ dest[9] = (top + bottom) / tb;
+ dest[10] = -(far + near) / fn;
+ dest[11] = -1;
+ dest[12] = 0;
+ dest[13] = 0;
+ dest[14] = -(far * near * 2) / fn;
+ dest[15] = 0;
+ return dest;
+ };
+
+ /**
+ * Generates a perspective projection matrix with the given bounds
+ *
+ * @param {number} fovy Vertical field of view
+ * @param {number} aspect Aspect ratio. typically viewport width/height
+ * @param {number} near Near bound of the frustum
+ * @param {number} far Far bound of the frustum
+ * @param {mat4} [dest] mat4 frustum matrix will be written into
+ *
+ * @returns {mat4} dest if specified, a new mat4 otherwise
+ */
+ mat4.perspective = function (fovy, aspect, near, far, dest) {
+ var top = near * Math.tan(fovy * Math.PI / 360.0),
+ right = top * aspect;
+ return mat4.frustum(-right, right, -top, top, near, far, dest);
+ };
+
+ /**
+ * Generates a orthogonal projection matrix with the given bounds
+ *
+ * @param {number} left Left bound of the frustum
+ * @param {number} right Right bound of the frustum
+ * @param {number} bottom Bottom bound of the frustum
+ * @param {number} top Top bound of the frustum
+ * @param {number} near Near bound of the frustum
+ * @param {number} far Far bound of the frustum
+ * @param {mat4} [dest] mat4 frustum matrix will be written into
+ *
+ * @returns {mat4} dest if specified, a new mat4 otherwise
+ */
+ mat4.ortho = function (left, right, bottom, top, near, far, dest) {
+ if (!dest) { dest = mat4.create(); }
+ var rl = (right - left),
+ tb = (top - bottom),
+ fn = (far - near);
+ dest[0] = 2 / rl;
+ dest[1] = 0;
+ dest[2] = 0;
+ dest[3] = 0;
+ dest[4] = 0;
+ dest[5] = 2 / tb;
+ dest[6] = 0;
+ dest[7] = 0;
+ dest[8] = 0;
+ dest[9] = 0;
+ dest[10] = -2 / fn;
+ dest[11] = 0;
+ dest[12] = -(left + right) / rl;
+ dest[13] = -(top + bottom) / tb;
+ dest[14] = -(far + near) / fn;
+ dest[15] = 1;
+ return dest;
+ };
+
+ /**
+ * Generates a look-at matrix with the given eye position, focal point, and up axis
+ *
+ * @param {vec3} eye Position of the viewer
+ * @param {vec3} center Point the viewer is looking at
+ * @param {vec3} up vec3 pointing "up"
+ * @param {mat4} [dest] mat4 frustum matrix will be written into
+ *
+ * @returns {mat4} dest if specified, a new mat4 otherwise
+ */
+ mat4.lookAt = function (eye, center, up, dest) {
+ if (!dest) { dest = mat4.create(); }
+
+ var x0, x1, x2, y0, y1, y2, z0, z1, z2, len,
+ eyex = eye[0],
+ eyey = eye[1],
+ eyez = eye[2],
+ upx = up[0],
+ upy = up[1],
+ upz = up[2],
+ centerx = center[0],
+ centery = center[1],
+ centerz = center[2];
+
+ if (eyex === centerx && eyey === centery && eyez === centerz) {
+ return mat4.identity(dest);
+ }
+
+ //vec3.direction(eye, center, z);
+ z0 = eyex - centerx;
+ z1 = eyey - centery;
+ z2 = eyez - centerz;
+
+ // normalize (no check needed for 0 because of early return)
+ len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2);
+ z0 *= len;
+ z1 *= len;
+ z2 *= len;
+
+ //vec3.normalize(vec3.cross(up, z, x));
+ x0 = upy * z2 - upz * z1;
+ x1 = upz * z0 - upx * z2;
+ x2 = upx * z1 - upy * z0;
+ len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2);
+ if (!len) {
+ x0 = 0;
+ x1 = 0;
+ x2 = 0;
+ } else {
+ len = 1 / len;
+ x0 *= len;
+ x1 *= len;
+ x2 *= len;
+ }
+
+ //vec3.normalize(vec3.cross(z, x, y));
+ y0 = z1 * x2 - z2 * x1;
+ y1 = z2 * x0 - z0 * x2;
+ y2 = z0 * x1 - z1 * x0;
+
+ len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2);
+ if (!len) {
+ y0 = 0;
+ y1 = 0;
+ y2 = 0;
+ } else {
+ len = 1 / len;
+ y0 *= len;
+ y1 *= len;
+ y2 *= len;
+ }
+
+ dest[0] = x0;
+ dest[1] = y0;
+ dest[2] = z0;
+ dest[3] = 0;
+ dest[4] = x1;
+ dest[5] = y1;
+ dest[6] = z1;
+ dest[7] = 0;
+ dest[8] = x2;
+ dest[9] = y2;
+ dest[10] = z2;
+ dest[11] = 0;
+ dest[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);
+ dest[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);
+ dest[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);
+ dest[15] = 1;
+
+ return dest;
+ };
+
+ /**
+ * Creates a matrix from a quaternion rotation and vector translation
+ * This is equivalent to (but much faster than):
+ *
+ * mat4.identity(dest);
+ * mat4.translate(dest, vec);
+ * var quatMat = mat4.create();
+ * quat4.toMat4(quat, quatMat);
+ * mat4.multiply(dest, quatMat);
+ *
+ * @param {quat4} quat Rotation quaternion
+ * @param {vec3} vec Translation vector
+ * @param {mat4} [dest] mat4 receiving operation result. If not specified result is written to a new mat4
+ *
+ * @returns {mat4} dest if specified, a new mat4 otherwise
+ */
+ mat4.fromRotationTranslation = function (quat, vec, dest) {
+ if (!dest) { dest = mat4.create(); }
+
+ // Quaternion math
+ var x = quat[0], y = quat[1], z = quat[2], w = quat[3],
+ x2 = x + x,
+ y2 = y + y,
+ z2 = z + z,
+
+ xx = x * x2,
+ xy = x * y2,
+ xz = x * z2,
+ yy = y * y2,
+ yz = y * z2,
+ zz = z * z2,
+ wx = w * x2,
+ wy = w * y2,
+ wz = w * z2;
+
+ dest[0] = 1 - (yy + zz);
+ dest[1] = xy + wz;
+ dest[2] = xz - wy;
+ dest[3] = 0;
+ dest[4] = xy - wz;
+ dest[5] = 1 - (xx + zz);
+ dest[6] = yz + wx;
+ dest[7] = 0;
+ dest[8] = xz + wy;
+ dest[9] = yz - wx;
+ dest[10] = 1 - (xx + yy);
+ dest[11] = 0;
+ dest[12] = vec[0];
+ dest[13] = vec[1];
+ dest[14] = vec[2];
+ dest[15] = 1;
+
+ return dest;
+ };
+
+ /**
+ * Returns a string representation of a mat4
+ *
+ * @param {mat4} mat mat4 to represent as a string
+ *
+ * @returns {string} String representation of mat
+ */
+ mat4.str = function (mat) {
+ return '[' + mat[0] + ', ' + mat[1] + ', ' + mat[2] + ', ' + mat[3] +
+ ', ' + mat[4] + ', ' + mat[5] + ', ' + mat[6] + ', ' + mat[7] +
+ ', ' + mat[8] + ', ' + mat[9] + ', ' + mat[10] + ', ' + mat[11] +
+ ', ' + mat[12] + ', ' + mat[13] + ', ' + mat[14] + ', ' + mat[15] + ']';
+ };
+
+ /**
+ * @class Quaternion
+ * @name quat4
+ */
+ var quat4 = {};
+
+ /**
+ * Creates a new instance of a quat4 using the default array type
+ * Any javascript array containing at least 4 numeric elements can serve as a quat4
+ *
+ * @param {quat4} [quat] quat4 containing values to initialize with
+ *
+ * @returns {quat4} New quat4
+ */
+ quat4.create = function (quat) {
+ var dest = new MatrixArray(4);
+
+ if (quat) {
+ dest[0] = quat[0];
+ dest[1] = quat[1];
+ dest[2] = quat[2];
+ dest[3] = quat[3];
+ } else {
+ dest[0] = dest[1] = dest[2] = dest[3] = 0;
+ }
+
+ return dest;
+ };
+
+ /**
+ * Creates a new instance of a quat4, initializing it with the given arguments
+ *
+ * @param {number} x X value
+ * @param {number} y Y value
+ * @param {number} z Z value
+ * @param {number} w W value
+
+ * @returns {quat4} New quat4
+ */
+ quat4.createFrom = function (x, y, z, w) {
+ var dest = new MatrixArray(4);
+
+ dest[0] = x;
+ dest[1] = y;
+ dest[2] = z;
+ dest[3] = w;
+
+ return dest;
+ };
+
+ /**
+ * Copies the values of one quat4 to another
+ *
+ * @param {quat4} quat quat4 containing values to copy
+ * @param {quat4} dest quat4 receiving copied values
+ *
+ * @returns {quat4} dest
+ */
+ quat4.set = function (quat, dest) {
+ dest[0] = quat[0];
+ dest[1] = quat[1];
+ dest[2] = quat[2];
+ dest[3] = quat[3];
+
+ return dest;
+ };
+
+ /**
+ * Compares two quaternions for equality within a certain margin of error
+ *
+ * @param {quat4} a First vector
+ * @param {quat4} b Second vector
+ *
+ * @returns {Boolean} True if a is equivalent to b
+ */
+ quat4.equal = function (a, b) {
+ return a === b || (
+ Math.abs(a[0] - b[0]) < FLOAT_EPSILON &&
+ Math.abs(a[1] - b[1]) < FLOAT_EPSILON &&
+ Math.abs(a[2] - b[2]) < FLOAT_EPSILON &&
+ Math.abs(a[3] - b[3]) < FLOAT_EPSILON
+ );
+ };
+
+ /**
+ * Creates a new identity Quat4
+ *
+ * @param {quat4} [dest] quat4 receiving copied values
+ *
+ * @returns {quat4} dest is specified, new quat4 otherwise
+ */
+ quat4.identity = function (dest) {
+ if (!dest) { dest = quat4.create(); }
+ dest[0] = 0;
+ dest[1] = 0;
+ dest[2] = 0;
+ dest[3] = 1;
+ return dest;
+ };
+
+ var identityQuat4 = quat4.identity();
+
+ /**
+ * Calculates the W component of a quat4 from the X, Y, and Z components.
+ * Assumes that quaternion is 1 unit in length.
+ * Any existing W component will be ignored.
+ *
+ * @param {quat4} quat quat4 to calculate W component of
+ * @param {quat4} [dest] quat4 receiving calculated values. If not specified result is written to quat
+ *
+ * @returns {quat4} dest if specified, quat otherwise
+ */
+ quat4.calculateW = function (quat, dest) {
+ var x = quat[0], y = quat[1], z = quat[2];
+
+ if (!dest || quat === dest) {
+ quat[3] = -Math.sqrt(Math.abs(1.0 - x * x - y * y - z * z));
+ return quat;
+ }
+ dest[0] = x;
+ dest[1] = y;
+ dest[2] = z;
+ dest[3] = -Math.sqrt(Math.abs(1.0 - x * x - y * y - z * z));
+ return dest;
+ };
+
+ /**
+ * Calculates the dot product of two quaternions
+ *
+ * @param {quat4} quat First operand
+ * @param {quat4} quat2 Second operand
+ *
+ * @return {number} Dot product of quat and quat2
+ */
+ quat4.dot = function(quat, quat2){
+ return quat[0]*quat2[0] + quat[1]*quat2[1] + quat[2]*quat2[2] + quat[3]*quat2[3];
+ };
+
+ /**
+ * Calculates the inverse of a quat4
+ *
+ * @param {quat4} quat quat4 to calculate inverse of
+ * @param {quat4} [dest] quat4 receiving inverse values. If not specified result is written to quat
+ *
+ * @returns {quat4} dest if specified, quat otherwise
+ */
+ quat4.inverse = function(quat, dest) {
+ var q0 = quat[0], q1 = quat[1], q2 = quat[2], q3 = quat[3],
+ dot = q0*q0 + q1*q1 + q2*q2 + q3*q3,
+ invDot = dot ? 1.0/dot : 0;
+
+ // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0
+
+ if(!dest || quat === dest) {
+ quat[0] *= -invDot;
+ quat[1] *= -invDot;
+ quat[2] *= -invDot;
+ quat[3] *= invDot;
+ return quat;
+ }
+ dest[0] = -quat[0]*invDot;
+ dest[1] = -quat[1]*invDot;
+ dest[2] = -quat[2]*invDot;
+ dest[3] = quat[3]*invDot;
+ return dest;
+ };
+
+
+ /**
+ * Calculates the conjugate of a quat4
+ * If the quaternion is normalized, this function is faster than quat4.inverse and produces the same result.
+ *
+ * @param {quat4} quat quat4 to calculate conjugate of
+ * @param {quat4} [dest] quat4 receiving conjugate values. If not specified result is written to quat
+ *
+ * @returns {quat4} dest if specified, quat otherwise
+ */
+ quat4.conjugate = function (quat, dest) {
+ if (!dest || quat === dest) {
+ quat[0] *= -1;
+ quat[1] *= -1;
+ quat[2] *= -1;
+ return quat;
+ }
+ dest[0] = -quat[0];
+ dest[1] = -quat[1];
+ dest[2] = -quat[2];
+ dest[3] = quat[3];
+ return dest;
+ };
+
+ /**
+ * Calculates the length of a quat4
+ *
+ * Params:
+ * @param {quat4} quat quat4 to calculate length of
+ *
+ * @returns Length of quat
+ */
+ quat4.length = function (quat) {
+ var x = quat[0], y = quat[1], z = quat[2], w = quat[3];
+ return Math.sqrt(x * x + y * y + z * z + w * w);
+ };
+
+ /**
+ * Generates a unit quaternion of the same direction as the provided quat4
+ * If quaternion length is 0, returns [0, 0, 0, 0]
+ *
+ * @param {quat4} quat quat4 to normalize
+ * @param {quat4} [dest] quat4 receiving operation result. If not specified result is written to quat
+ *
+ * @returns {quat4} dest if specified, quat otherwise
+ */
+ quat4.normalize = function (quat, dest) {
+ if (!dest) { dest = quat; }
+
+ var x = quat[0], y = quat[1], z = quat[2], w = quat[3],
+ len = Math.sqrt(x * x + y * y + z * z + w * w);
+ if (len === 0) {
+ dest[0] = 0;
+ dest[1] = 0;
+ dest[2] = 0;
+ dest[3] = 0;
+ return dest;
+ }
+ len = 1 / len;
+ dest[0] = x * len;
+ dest[1] = y * len;
+ dest[2] = z * len;
+ dest[3] = w * len;
+
+ return dest;
+ };
+
+ /**
+ * Performs quaternion addition
+ *
+ * @param {quat4} quat First operand
+ * @param {quat4} quat2 Second operand
+ * @param {quat4} [dest] quat4 receiving operation result. If not specified result is written to quat
+ *
+ * @returns {quat4} dest if specified, quat otherwise
+ */
+ quat4.add = function (quat, quat2, dest) {
+ if(!dest || quat === dest) {
+ quat[0] += quat2[0];
+ quat[1] += quat2[1];
+ quat[2] += quat2[2];
+ quat[3] += quat2[3];
+ return quat;
+ }
+ dest[0] = quat[0]+quat2[0];
+ dest[1] = quat[1]+quat2[1];
+ dest[2] = quat[2]+quat2[2];
+ dest[3] = quat[3]+quat2[3];
+ return dest;
+ };
+
+ /**
+ * Performs a quaternion multiplication
+ *
+ * @param {quat4} quat First operand
+ * @param {quat4} quat2 Second operand
+ * @param {quat4} [dest] quat4 receiving operation result. If not specified result is written to quat
+ *
+ * @returns {quat4} dest if specified, quat otherwise
+ */
+ quat4.multiply = function (quat, quat2, dest) {
+ if (!dest) { dest = quat; }
+
+ var qax = quat[0], qay = quat[1], qaz = quat[2], qaw = quat[3],
+ qbx = quat2[0], qby = quat2[1], qbz = quat2[2], qbw = quat2[3];
+
+ dest[0] = qax * qbw + qaw * qbx + qay * qbz - qaz * qby;
+ dest[1] = qay * qbw + qaw * qby + qaz * qbx - qax * qbz;
+ dest[2] = qaz * qbw + qaw * qbz + qax * qby - qay * qbx;
+ dest[3] = qaw * qbw - qax * qbx - qay * qby - qaz * qbz;
+
+ return dest;
+ };
+
+ /**
+ * Transforms a vec3 with the given quaternion
+ *
+ * @param {quat4} quat quat4 to transform the vector with
+ * @param {vec3} vec vec3 to transform
+ * @param {vec3} [dest] vec3 receiving operation result. If not specified result is written to vec
+ *
+ * @returns dest if specified, vec otherwise
+ */
+ quat4.multiplyVec3 = function (quat, vec, dest) {
+ if (!dest) { dest = vec; }
+
+ var x = vec[0], y = vec[1], z = vec[2],
+ qx = quat[0], qy = quat[1], qz = quat[2], qw = quat[3],
+
+ // calculate quat * vec
+ ix = qw * x + qy * z - qz * y,
+ iy = qw * y + qz * x - qx * z,
+ iz = qw * z + qx * y - qy * x,
+ iw = -qx * x - qy * y - qz * z;
+
+ // calculate result * inverse quat
+ dest[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;
+ dest[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;
+ dest[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;
+
+ return dest;
+ };
+
+ /**
+ * Multiplies the components of a quaternion by a scalar value
+ *
+ * @param {quat4} quat to scale
+ * @param {number} val Value to scale by
+ * @param {quat4} [dest] quat4 receiving operation result. If not specified result is written to quat
+ *
+ * @returns {quat4} dest if specified, quat otherwise
+ */
+ quat4.scale = function (quat, val, dest) {
+ if(!dest || quat === dest) {
+ quat[0] *= val;
+ quat[1] *= val;
+ quat[2] *= val;
+ quat[3] *= val;
+ return quat;
+ }
+ dest[0] = quat[0]*val;
+ dest[1] = quat[1]*val;
+ dest[2] = quat[2]*val;
+ dest[3] = quat[3]*val;
+ return dest;
+ };
+
+ /**
+ * Calculates a 3x3 matrix from the given quat4
+ *
+ * @param {quat4} quat quat4 to create matrix from
+ * @param {mat3} [dest] mat3 receiving operation result
+ *
+ * @returns {mat3} dest if specified, a new mat3 otherwise
+ */
+ quat4.toMat3 = function (quat, dest) {
+ if (!dest) { dest = mat3.create(); }
+
+ var x = quat[0], y = quat[1], z = quat[2], w = quat[3],
+ x2 = x + x,
+ y2 = y + y,
+ z2 = z + z,
+
+ xx = x * x2,
+ xy = x * y2,
+ xz = x * z2,
+ yy = y * y2,
+ yz = y * z2,
+ zz = z * z2,
+ wx = w * x2,
+ wy = w * y2,
+ wz = w * z2;
+
+ dest[0] = 1 - (yy + zz);
+ dest[1] = xy + wz;
+ dest[2] = xz - wy;
+
+ dest[3] = xy - wz;
+ dest[4] = 1 - (xx + zz);
+ dest[5] = yz + wx;
+
+ dest[6] = xz + wy;
+ dest[7] = yz - wx;
+ dest[8] = 1 - (xx + yy);
+
+ return dest;
+ };
+
+ /**
+ * Calculates a 4x4 matrix from the given quat4
+ *
+ * @param {quat4} quat quat4 to create matrix from
+ * @param {mat4} [dest] mat4 receiving operation result
+ *
+ * @returns {mat4} dest if specified, a new mat4 otherwise
+ */
+ quat4.toMat4 = function (quat, dest) {
+ if (!dest) { dest = mat4.create(); }
+
+ var x = quat[0], y = quat[1], z = quat[2], w = quat[3],
+ x2 = x + x,
+ y2 = y + y,
+ z2 = z + z,
+
+ xx = x * x2,
+ xy = x * y2,
+ xz = x * z2,
+ yy = y * y2,
+ yz = y * z2,
+ zz = z * z2,
+ wx = w * x2,
+ wy = w * y2,
+ wz = w * z2;
+
+ dest[0] = 1 - (yy + zz);
+ dest[1] = xy + wz;
+ dest[2] = xz - wy;
+ dest[3] = 0;
+
+ dest[4] = xy - wz;
+ dest[5] = 1 - (xx + zz);
+ dest[6] = yz + wx;
+ dest[7] = 0;
+
+ dest[8] = xz + wy;
+ dest[9] = yz - wx;
+ dest[10] = 1 - (xx + yy);
+ dest[11] = 0;
+
+ dest[12] = 0;
+ dest[13] = 0;
+ dest[14] = 0;
+ dest[15] = 1;
+
+ return dest;
+ };
+
+ /**
+ * Performs a spherical linear interpolation between two quat4
+ *
+ * @param {quat4} quat First quaternion
+ * @param {quat4} quat2 Second quaternion
+ * @param {number} slerp Interpolation amount between the two inputs
+ * @param {quat4} [dest] quat4 receiving operation result. If not specified result is written to quat
+ *
+ * @returns {quat4} dest if specified, quat otherwise
+ */
+ quat4.slerp = function (quat, quat2, slerp, dest) {
+ if (!dest) { dest = quat; }
+
+ var cosHalfTheta = quat[0] * quat2[0] + quat[1] * quat2[1] + quat[2] * quat2[2] + quat[3] * quat2[3],
+ halfTheta,
+ sinHalfTheta,
+ ratioA,
+ ratioB;
+
+ if (Math.abs(cosHalfTheta) >= 1.0) {
+ if (dest !== quat) {
+ dest[0] = quat[0];
+ dest[1] = quat[1];
+ dest[2] = quat[2];
+ dest[3] = quat[3];
+ }
+ return dest;
+ }
+
+ halfTheta = Math.acos(cosHalfTheta);
+ sinHalfTheta = Math.sqrt(1.0 - cosHalfTheta * cosHalfTheta);
+
+ if (Math.abs(sinHalfTheta) < 0.001) {
+ dest[0] = (quat[0] * 0.5 + quat2[0] * 0.5);
+ dest[1] = (quat[1] * 0.5 + quat2[1] * 0.5);
+ dest[2] = (quat[2] * 0.5 + quat2[2] * 0.5);
+ dest[3] = (quat[3] * 0.5 + quat2[3] * 0.5);
+ return dest;
+ }
+
+ ratioA = Math.sin((1 - slerp) * halfTheta) / sinHalfTheta;
+ ratioB = Math.sin(slerp * halfTheta) / sinHalfTheta;
+
+ dest[0] = (quat[0] * ratioA + quat2[0] * ratioB);
+ dest[1] = (quat[1] * ratioA + quat2[1] * ratioB);
+ dest[2] = (quat[2] * ratioA + quat2[2] * ratioB);
+ dest[3] = (quat[3] * ratioA + quat2[3] * ratioB);
+
+ return dest;
+ };
+
+ /**
+ * Creates a quaternion from the given 3x3 rotation matrix.
+ * If dest is omitted, a new quaternion will be created.
+ *
+ * @param {mat3} mat the rotation matrix
+ * @param {quat4} [dest] an optional receiving quaternion
+ *
+ * @returns {quat4} the quaternion constructed from the rotation matrix
+ *
+ */
+ quat4.fromRotationMatrix = function(mat, dest) {
+ if (!dest) dest = quat4.create();
+
+ // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes
+ // article "Quaternion Calculus and Fast Animation".
+
+ var fTrace = mat[0] + mat[4] + mat[8];
+ var fRoot;
+
+ if ( fTrace > 0.0 ) {
+ // |w| > 1/2, may as well choose w > 1/2
+ fRoot = Math.sqrt(fTrace + 1.0); // 2w
+ dest[3] = 0.5 * fRoot;
+ fRoot = 0.5/fRoot; // 1/(4w)
+ dest[0] = (mat[7]-mat[5])*fRoot;
+ dest[1] = (mat[2]-mat[6])*fRoot;
+ dest[2] = (mat[3]-mat[1])*fRoot;
+ } else {
+ // |w| <= 1/2
+ var s_iNext = quat4.fromRotationMatrix.s_iNext = quat4.fromRotationMatrix.s_iNext || [1,2,0];
+ var i = 0;
+ if ( mat[4] > mat[0] )
+ i = 1;
+ if ( mat[8] > mat[i*3+i] )
+ i = 2;
+ var j = s_iNext[i];
+ var k = s_iNext[j];
+
+ fRoot = Math.sqrt(mat[i*3+i]-mat[j*3+j]-mat[k*3+k] + 1.0);
+ dest[i] = 0.5 * fRoot;
+ fRoot = 0.5 / fRoot;
+ dest[3] = (mat[k*3+j] - mat[j*3+k]) * fRoot;
+ dest[j] = (mat[j*3+i] + mat[i*3+j]) * fRoot;
+ dest[k] = (mat[k*3+i] + mat[i*3+k]) * fRoot;
+ }
+
+ return dest;
+ };
+
+ /**
+ * Alias. See the description for quat4.fromRotationMatrix().
+ */
+ mat3.toQuat4 = quat4.fromRotationMatrix;
+
+ (function() {
+ var mat = mat3.create();
+
+ /**
+ * Creates a quaternion from the 3 given vectors. They must be perpendicular
+ * to one another and represent the X, Y and Z axes.
+ *
+ * If dest is omitted, a new quat4 will be created.
+ *
+ * Example: The default OpenGL orientation has a view vector [0, 0, -1],
+ * right vector [1, 0, 0], and up vector [0, 1, 0]. A quaternion representing
+ * this orientation could be constructed with:
+ *
+ * quat = quat4.fromAxes([0, 0, -1], [1, 0, 0], [0, 1, 0], quat4.create());
+ *
+ * @param {vec3} view the view vector, or direction the object is pointing in
+ * @param {vec3} right the right vector, or direction to the "right" of the object
+ * @param {vec3} up the up vector, or direction towards the object's "up"
+ * @param {quat4} [dest] an optional receiving quat4
+ *
+ * @returns {quat4} dest
+ **/
+ quat4.fromAxes = function(view, right, up, dest) {
+ mat[0] = right[0];
+ mat[3] = right[1];
+ mat[6] = right[2];
+
+ mat[1] = up[0];
+ mat[4] = up[1];
+ mat[7] = up[2];
+
+ mat[2] = view[0];
+ mat[5] = view[1];
+ mat[8] = view[2];
+
+ return quat4.fromRotationMatrix(mat, dest);
+ };
+ })();
+
+ /**
+ * Sets a quat4 to the Identity and returns it.
+ *
+ * @param {quat4} [dest] quat4 to set. If omitted, a
+ * new quat4 will be created.
+ *
+ * @returns {quat4} dest
+ */
+ quat4.identity = function(dest) {
+ if (!dest) dest = quat4.create();
+ dest[0] = 0;
+ dest[1] = 0;
+ dest[2] = 0;
+ dest[3] = 1;
+ return dest;
+ };
+
+ /**
+ * Sets a quat4 from the given angle and rotation axis,
+ * then returns it. If dest is not given, a new quat4 is created.
+ *
+ * @param {Number} angle the angle in radians
+ * @param {vec3} axis the axis around which to rotate
+ * @param {quat4} [dest] the optional quat4 to store the result
+ *
+ * @returns {quat4} dest
+ **/
+ quat4.fromAngleAxis = function(angle, axis, dest) {
+ // The quaternion representing the rotation is
+ // q = cos(A/2)+sin(A/2)*(x*i+y*j+z*k)
+ if (!dest) dest = quat4.create();
+
+ var half = angle * 0.5;
+ var s = Math.sin(half);
+ dest[3] = Math.cos(half);
+ dest[0] = s * axis[0];
+ dest[1] = s * axis[1];
+ dest[2] = s * axis[2];
+
+ return dest;
+ };
+
+ /**
+ * Stores the angle and axis in a vec4, where the XYZ components represent
+ * the axis and the W (4th) component is the angle in radians.
+ *
+ * If dest is not given, src will be modified in place and returned, after
+ * which it should not be considered not a quaternion (just an axis and angle).
+ *
+ * @param {quat4} quat the quaternion whose angle and axis to store
+ * @param {vec4} [dest] the optional vec4 to receive the data
+ *
+ * @returns {vec4} dest
+ */
+ quat4.toAngleAxis = function(src, dest) {
+ if (!dest) dest = src;
+ // The quaternion representing the rotation is
+ // q = cos(A/2)+sin(A/2)*(x*i+y*j+z*k)
+
+ var sqrlen = src[0]*src[0]+src[1]*src[1]+src[2]*src[2];
+ if (sqrlen > 0)
+ {
+ dest[3] = 2 * Math.acos(src[3]);
+ var invlen = glMath.invsqrt(sqrlen);
+ dest[0] = src[0]*invlen;
+ dest[1] = src[1]*invlen;
+ dest[2] = src[2]*invlen;
+ } else {
+ // angle is 0 (mod 2*pi), so any axis will do
+ dest[3] = 0;
+ dest[0] = 1;
+ dest[1] = 0;
+ dest[2] = 0;
+ }
+
+ return dest;
+ };
+
+ /**
+ * Returns a string representation of a quaternion
+ *
+ * @param {quat4} quat quat4 to represent as a string
+ *
+ * @returns {string} String representation of quat
+ */
+ quat4.str = function (quat) {
+ return '[' + quat[0] + ', ' + quat[1] + ', ' + quat[2] + ', ' + quat[3] + ']';
+ };
+
+ /**
+ * @class 2 Dimensional Vector
+ * @name vec2
+ */
+ var vec2 = {};
+
+ /**
+ * Creates a new vec2, initializing it from vec if vec
+ * is given.
+ *
+ * @param {vec2} [vec] the vector's initial contents
+ * @returns {vec2} a new 2D vector
+ */
+ vec2.create = function(vec) {
+ var dest = new MatrixArray(2);
+
+ if (vec) {
+ dest[0] = vec[0];
+ dest[1] = vec[1];
+ } else {
+ dest[0] = 0;
+ dest[1] = 0;
+ }
+ return dest;
+ };
+
+ /**
+ * Creates a new instance of a vec2, initializing it with the given arguments
+ *
+ * @param {number} x X value
+ * @param {number} y Y value
+
+ * @returns {vec2} New vec2
+ */
+ vec2.createFrom = function (x, y) {
+ var dest = new MatrixArray(2);
+
+ dest[0] = x;
+ dest[1] = y;
+
+ return dest;
+ };
+
+ /**
+ * Adds the vec2's together. If dest is given, the result
+ * is stored there. Otherwise, the result is stored in vecB.
+ *
+ * @param {vec2} vecA the first operand
+ * @param {vec2} vecB the second operand
+ * @param {vec2} [dest] the optional receiving vector
+ * @returns {vec2} dest
+ */
+ vec2.add = function(vecA, vecB, dest) {
+ if (!dest) dest = vecB;
+ dest[0] = vecA[0] + vecB[0];
+ dest[1] = vecA[1] + vecB[1];
+ return dest;
+ };
+
+ /**
+ * Subtracts vecB from vecA. If dest is given, the result
+ * is stored there. Otherwise, the result is stored in vecB.
+ *
+ * @param {vec2} vecA the first operand
+ * @param {vec2} vecB the second operand
+ * @param {vec2} [dest] the optional receiving vector
+ * @returns {vec2} dest
+ */
+ vec2.subtract = function(vecA, vecB, dest) {
+ if (!dest) dest = vecB;
+ dest[0] = vecA[0] - vecB[0];
+ dest[1] = vecA[1] - vecB[1];
+ return dest;
+ };
+
+ /**
+ * Multiplies vecA with vecB. If dest is given, the result
+ * is stored there. Otherwise, the result is stored in vecB.
+ *
+ * @param {vec2} vecA the first operand
+ * @param {vec2} vecB the second operand
+ * @param {vec2} [dest] the optional receiving vector
+ * @returns {vec2} dest
+ */
+ vec2.multiply = function(vecA, vecB, dest) {
+ if (!dest) dest = vecB;
+ dest[0] = vecA[0] * vecB[0];
+ dest[1] = vecA[1] * vecB[1];
+ return dest;
+ };
+
+ /**
+ * Divides vecA by vecB. If dest is given, the result
+ * is stored there. Otherwise, the result is stored in vecB.
+ *
+ * @param {vec2} vecA the first operand
+ * @param {vec2} vecB the second operand
+ * @param {vec2} [dest] the optional receiving vector
+ * @returns {vec2} dest
+ */
+ vec2.divide = function(vecA, vecB, dest) {
+ if (!dest) dest = vecB;
+ dest[0] = vecA[0] / vecB[0];
+ dest[1] = vecA[1] / vecB[1];
+ return dest;
+ };
+
+ /**
+ * Scales vecA by some scalar number. If dest is given, the result
+ * is stored there. Otherwise, the result is stored in vecA.
+ *
+ * This is the same as multiplying each component of vecA
+ * by the given scalar.
+ *
+ * @param {vec2} vecA the vector to be scaled
+ * @param {Number} scalar the amount to scale the vector by
+ * @param {vec2} [dest] the optional receiving vector
+ * @returns {vec2} dest
+ */
+ vec2.scale = function(vecA, scalar, dest) {
+ if (!dest) dest = vecA;
+ dest[0] = vecA[0] * scalar;
+ dest[1] = vecA[1] * scalar;
+ return dest;
+ };
+
+ /**
+ * Calculates the euclidian distance between two vec2
+ *
+ * Params:
+ * @param {vec2} vecA First vector
+ * @param {vec2} vecB Second vector
+ *
+ * @returns {number} Distance between vecA and vecB
+ */
+ vec2.dist = function (vecA, vecB) {
+ var x = vecB[0] - vecA[0],
+ y = vecB[1] - vecA[1];
+ return Math.sqrt(x*x + y*y);
+ };
+
+ /**
+ * Copies the values of one vec2 to another
+ *
+ * @param {vec2} vec vec2 containing values to copy
+ * @param {vec2} dest vec2 receiving copied values
+ *
+ * @returns {vec2} dest
+ */
+ vec2.set = function (vec, dest) {
+ dest[0] = vec[0];
+ dest[1] = vec[1];
+ return dest;
+ };
+
+ /**
+ * Compares two vectors for equality within a certain margin of error
+ *
+ * @param {vec2} a First vector
+ * @param {vec2} b Second vector
+ *
+ * @returns {Boolean} True if a is equivalent to b
+ */
+ vec2.equal = function (a, b) {
+ return a === b || (
+ Math.abs(a[0] - b[0]) < FLOAT_EPSILON &&
+ Math.abs(a[1] - b[1]) < FLOAT_EPSILON
+ );
+ };
+
+ /**
+ * Negates the components of a vec2
+ *
+ * @param {vec2} vec vec2 to negate
+ * @param {vec2} [dest] vec2 receiving operation result. If not specified result is written to vec
+ *
+ * @returns {vec2} dest if specified, vec otherwise
+ */
+ vec2.negate = function (vec, dest) {
+ if (!dest) { dest = vec; }
+ dest[0] = -vec[0];
+ dest[1] = -vec[1];
+ return dest;
+ };
+
+ /**
+ * Normlize a vec2
+ *
+ * @param {vec2} vec vec2 to normalize
+ * @param {vec2} [dest] vec2 receiving operation result. If not specified result is written to vec
+ *
+ * @returns {vec2} dest if specified, vec otherwise
+ */
+ vec2.normalize = function (vec, dest) {
+ if (!dest) { dest = vec; }
+ var mag = vec[0] * vec[0] + vec[1] * vec[1];
+ if (mag > 0) {
+ mag = Math.sqrt(mag);
+ dest[0] = vec[0] / mag;
+ dest[1] = vec[1] / mag;
+ } else {
+ dest[0] = dest[1] = 0;
+ }
+ return dest;
+ };
+
+ /**
+ * Computes the cross product of two vec2's. Note that the cross product must by definition
+ * produce a 3D vector. If a dest vector is given, it will contain the resultant 3D vector.
+ * Otherwise, a scalar number will be returned, representing the vector's Z coordinate, since
+ * its X and Y must always equal 0.
+ *
+ * Examples:
+ * var crossResult = vec3.create();
+ * vec2.cross([1, 2], [3, 4], crossResult);
+ * //=> [0, 0, -2]
+ *
+ * vec2.cross([1, 2], [3, 4]);
+ * //=> -2
+ *
+ * See http://stackoverflow.com/questions/243945/calculating-a-2d-vectors-cross-product
+ * for some interesting facts.
+ *
+ * @param {vec2} vecA left operand
+ * @param {vec2} vecB right operand
+ * @param {vec2} [dest] optional vec2 receiving result. If not specified a scalar is returned
+ *
+ */
+ vec2.cross = function (vecA, vecB, dest) {
+ var z = vecA[0] * vecB[1] - vecA[1] * vecB[0];
+ if (!dest) return z;
+ dest[0] = dest[1] = 0;
+ dest[2] = z;
+ return dest;
+ };
+
+ /**
+ * Caclulates the length of a vec2
+ *
+ * @param {vec2} vec vec2 to calculate length of
+ *
+ * @returns {Number} Length of vec
+ */
+ vec2.length = function (vec) {
+ var x = vec[0], y = vec[1];
+ return Math.sqrt(x * x + y * y);
+ };
+
+ /**
+ * Caclulates the squared length of a vec2
+ *
+ * @param {vec2} vec vec2 to calculate squared length of
+ *
+ * @returns {Number} Squared Length of vec
+ */
+ vec2.squaredLength = function (vec) {
+ var x = vec[0], y = vec[1];
+ return x * x + y * y;
+ };
+
+ /**
+ * Caclulates the dot product of two vec2s
+ *
+ * @param {vec2} vecA First operand
+ * @param {vec2} vecB Second operand
+ *
+ * @returns {Number} Dot product of vecA and vecB
+ */
+ vec2.dot = function (vecA, vecB) {
+ return vecA[0] * vecB[0] + vecA[1] * vecB[1];
+ };
+
+ /**
+ * Generates a 2D unit vector pointing from one vector to another
+ *
+ * @param {vec2} vecA Origin vec2
+ * @param {vec2} vecB vec2 to point to
+ * @param {vec2} [dest] vec2 receiving operation result. If not specified result is written to vecA
+ *
+ * @returns {vec2} dest if specified, vecA otherwise
+ */
+ vec2.direction = function (vecA, vecB, dest) {
+ if (!dest) { dest = vecA; }
+
+ var x = vecA[0] - vecB[0],
+ y = vecA[1] - vecB[1],
+ len = x * x + y * y;
+
+ if (!len) {
+ dest[0] = 0;
+ dest[1] = 0;
+ dest[2] = 0;
+ return dest;
+ }
+
+ len = 1 / Math.sqrt(len);
+ dest[0] = x * len;
+ dest[1] = y * len;
+ return dest;
+ };
+
+ /**
+ * Performs a linear interpolation between two vec2
+ *
+ * @param {vec2} vecA First vector
+ * @param {vec2} vecB Second vector
+ * @param {Number} lerp Interpolation amount between the two inputs
+ * @param {vec2} [dest] vec2 receiving operation result. If not specified result is written to vecA
+ *
+ * @returns {vec2} dest if specified, vecA otherwise
+ */
+ vec2.lerp = function (vecA, vecB, lerp, dest) {
+ if (!dest) { dest = vecA; }
+ dest[0] = vecA[0] + lerp * (vecB[0] - vecA[0]);
+ dest[1] = vecA[1] + lerp * (vecB[1] - vecA[1]);
+ return dest;
+ };
+
+ /**
+ * Returns a string representation of a vector
+ *
+ * @param {vec2} vec Vector to represent as a string
+ *
+ * @returns {String} String representation of vec
+ */
+ vec2.str = function (vec) {
+ return '[' + vec[0] + ', ' + vec[1] + ']';
+ };
+
+ /**
+ * @class 2x2 Matrix
+ * @name mat2
+ */
+ var mat2 = {};
+
+ /**
+ * Creates a new 2x2 matrix. If src is given, the new matrix
+ * is initialized to those values.
+ *
+ * @param {mat2} [src] the seed values for the new matrix, if any
+ * @returns {mat2} a new matrix
+ */
+ mat2.create = function(src) {
+ var dest = new MatrixArray(4);
+
+ if (src) {
+ dest[0] = src[0];
+ dest[1] = src[1];
+ dest[2] = src[2];
+ dest[3] = src[3];
+ } else {
+ dest[0] = dest[1] = dest[2] = dest[3] = 0;
+ }
+ return dest;
+ };
+
+ /**
+ * Creates a new instance of a mat2, initializing it with the given arguments
+ *
+ * @param {number} m00
+ * @param {number} m01
+ * @param {number} m10
+ * @param {number} m11
+
+ * @returns {mat2} New mat2
+ */
+ mat2.createFrom = function (m00, m01, m10, m11) {
+ var dest = new MatrixArray(4);
+
+ dest[0] = m00;
+ dest[1] = m01;
+ dest[2] = m10;
+ dest[3] = m11;
+
+ return dest;
+ };
+
+ /**
+ * Copies the values of one mat2 to another
+ *
+ * @param {mat2} mat mat2 containing values to copy
+ * @param {mat2} dest mat2 receiving copied values
+ *
+ * @returns {mat2} dest
+ */
+ mat2.set = function (mat, dest) {
+ dest[0] = mat[0];
+ dest[1] = mat[1];
+ dest[2] = mat[2];
+ dest[3] = mat[3];
+ return dest;
+ };
+
+ /**
+ * Compares two matrices for equality within a certain margin of error
+ *
+ * @param {mat2} a First matrix
+ * @param {mat2} b Second matrix
+ *
+ * @returns {Boolean} True if a is equivalent to b
+ */
+ mat2.equal = function (a, b) {
+ return a === b || (
+ Math.abs(a[0] - b[0]) < FLOAT_EPSILON &&
+ Math.abs(a[1] - b[1]) < FLOAT_EPSILON &&
+ Math.abs(a[2] - b[2]) < FLOAT_EPSILON &&
+ Math.abs(a[3] - b[3]) < FLOAT_EPSILON
+ );
+ };
+
+ /**
+ * Sets a mat2 to an identity matrix
+ *
+ * @param {mat2} [dest] mat2 to set. If omitted a new one will be created.
+ *
+ * @returns {mat2} dest
+ */
+ mat2.identity = function (dest) {
+ if (!dest) { dest = mat2.create(); }
+ dest[0] = 1;
+ dest[1] = 0;
+ dest[2] = 0;
+ dest[3] = 1;
+ return dest;
+ };
+
+ /**
+ * Transposes a mat2 (flips the values over the diagonal)
+ *
+ * @param {mat2} mat mat2 to transpose
+ * @param {mat2} [dest] mat2 receiving transposed values. If not specified result is written to mat
+ *
+ * @param {mat2} dest if specified, mat otherwise
+ */
+ mat2.transpose = function (mat, dest) {
+ // If we are transposing ourselves we can skip a few steps but have to cache some values
+ if (!dest || mat === dest) {
+ var a00 = mat[1];
+ mat[1] = mat[2];
+ mat[2] = a00;
+ return mat;
+ }
+
+ dest[0] = mat[0];
+ dest[1] = mat[2];
+ dest[2] = mat[1];
+ dest[3] = mat[3];
+ return dest;
+ };
+
+ /**
+ * Calculates the determinant of a mat2
+ *
+ * @param {mat2} mat mat2 to calculate determinant of
+ *
+ * @returns {Number} determinant of mat
+ */
+ mat2.determinant = function (mat) {
+ return mat[0] * mat[3] - mat[2] * mat[1];
+ };
+
+ /**
+ * Calculates the inverse matrix of a mat2
+ *
+ * @param {mat2} mat mat2 to calculate inverse of
+ * @param {mat2} [dest] mat2 receiving inverse matrix. If not specified result is written to mat
+ *
+ * @param {mat2} dest is specified, mat otherwise, null if matrix cannot be inverted
+ */
+ mat2.inverse = function (mat, dest) {
+ if (!dest) { dest = mat; }
+ var a0 = mat[0], a1 = mat[1], a2 = mat[2], a3 = mat[3];
+ var det = a0 * a3 - a2 * a1;
+ if (!det) return null;
+
+ det = 1.0 / det;
+ dest[0] = a3 * det;
+ dest[1] = -a1 * det;
+ dest[2] = -a2 * det;
+ dest[3] = a0 * det;
+ return dest;
+ };
+
+ /**
+ * Performs a matrix multiplication
+ *
+ * @param {mat2} matA First operand
+ * @param {mat2} matB Second operand
+ * @param {mat2} [dest] mat2 receiving operation result. If not specified result is written to matA
+ *
+ * @returns {mat2} dest if specified, matA otherwise
+ */
+ mat2.multiply = function (matA, matB, dest) {
+ if (!dest) { dest = matA; }
+ var a11 = matA[0],
+ a12 = matA[1],
+ a21 = matA[2],
+ a22 = matA[3];
+ dest[0] = a11 * matB[0] + a12 * matB[2];
+ dest[1] = a11 * matB[1] + a12 * matB[3];
+ dest[2] = a21 * matB[0] + a22 * matB[2];
+ dest[3] = a21 * matB[1] + a22 * matB[3];
+ return dest;
+ };
+
+ /**
+ * Rotates a 2x2 matrix by an angle
+ *
+ * @param {mat2} mat The matrix to rotate
+ * @param {Number} angle The angle in radians
+ * @param {mat2} [dest] Optional mat2 receiving the result. If omitted mat will be used.
+ *
+ * @returns {mat2} dest if specified, mat otherwise
+ */
+ mat2.rotate = function (mat, angle, dest) {
+ if (!dest) { dest = mat; }
+ var a11 = mat[0],
+ a12 = mat[1],
+ a21 = mat[2],
+ a22 = mat[3],
+ s = Math.sin(angle),
+ c = Math.cos(angle);
+ dest[0] = a11 * c + a12 * s;
+ dest[1] = a11 * -s + a12 * c;
+ dest[2] = a21 * c + a22 * s;
+ dest[3] = a21 * -s + a22 * c;
+ return dest;
+ };
+
+ /**
+ * Multiplies the vec2 by the given 2x2 matrix
+ *
+ * @param {mat2} matrix the 2x2 matrix to multiply against
+ * @param {vec2} vec the vector to multiply
+ * @param {vec2} [dest] an optional receiving vector. If not given, vec is used.
+ *
+ * @returns {vec2} The multiplication result
+ **/
+ mat2.multiplyVec2 = function(matrix, vec, dest) {
+ if (!dest) dest = vec;
+ var x = vec[0], y = vec[1];
+ dest[0] = x * matrix[0] + y * matrix[1];
+ dest[1] = x * matrix[2] + y * matrix[3];
+ return dest;
+ };
+
+ /**
+ * Scales the mat2 by the dimensions in the given vec2
+ *
+ * @param {mat2} matrix the 2x2 matrix to scale
+ * @param {vec2} vec the vector containing the dimensions to scale by
+ * @param {vec2} [dest] an optional receiving mat2. If not given, matrix is used.
+ *
+ * @returns {mat2} dest if specified, matrix otherwise
+ **/
+ mat2.scale = function(matrix, vec, dest) {
+ if (!dest) { dest = matrix; }
+ var a11 = matrix[0],
+ a12 = matrix[1],
+ a21 = matrix[2],
+ a22 = matrix[3],
+ b11 = vec[0],
+ b22 = vec[1];
+ dest[0] = a11 * b11;
+ dest[1] = a12 * b22;
+ dest[2] = a21 * b11;
+ dest[3] = a22 * b22;
+ return dest;
+ };
+
+ /**
+ * Returns a string representation of a mat2
+ *
+ * @param {mat2} mat mat2 to represent as a string
+ *
+ * @param {String} String representation of mat
+ */
+ mat2.str = function (mat) {
+ return '[' + mat[0] + ', ' + mat[1] + ', ' + mat[2] + ', ' + mat[3] + ']';
+ };
+
+ /**
+ * @class 4 Dimensional Vector
+ * @name vec4
+ */
+ var vec4 = {};
+
+ /**
+ * Creates a new vec4, initializing it from vec if vec
+ * is given.
+ *
+ * @param {vec4} [vec] the vector's initial contents
+ * @returns {vec4} a new 2D vector
+ */
+ vec4.create = function(vec) {
+ var dest = new MatrixArray(4);
+
+ if (vec) {
+ dest[0] = vec[0];
+ dest[1] = vec[1];
+ dest[2] = vec[2];
+ dest[3] = vec[3];
+ } else {
+ dest[0] = 0;
+ dest[1] = 0;
+ dest[2] = 0;
+ dest[3] = 0;
+ }
+ return dest;
+ };
+
+ /**
+ * Creates a new instance of a vec4, initializing it with the given arguments
+ *
+ * @param {number} x X value
+ * @param {number} y Y value
+ * @param {number} z Z value
+ * @param {number} w W value
+
+ * @returns {vec4} New vec4
+ */
+ vec4.createFrom = function (x, y, z, w) {
+ var dest = new MatrixArray(4);
+
+ dest[0] = x;
+ dest[1] = y;
+ dest[2] = z;
+ dest[3] = w;
+
+ return dest;
+ };
+
+ /**
+ * Adds the vec4's together. If dest is given, the result
+ * is stored there. Otherwise, the result is stored in vecB.
+ *
+ * @param {vec4} vecA the first operand
+ * @param {vec4} vecB the second operand
+ * @param {vec4} [dest] the optional receiving vector
+ * @returns {vec4} dest
+ */
+ vec4.add = function(vecA, vecB, dest) {
+ if (!dest) dest = vecB;
+ dest[0] = vecA[0] + vecB[0];
+ dest[1] = vecA[1] + vecB[1];
+ dest[2] = vecA[2] + vecB[2];
+ dest[3] = vecA[3] + vecB[3];
+ return dest;
+ };
+
+ /**
+ * Subtracts vecB from vecA. If dest is given, the result
+ * is stored there. Otherwise, the result is stored in vecB.
+ *
+ * @param {vec4} vecA the first operand
+ * @param {vec4} vecB the second operand
+ * @param {vec4} [dest] the optional receiving vector
+ * @returns {vec4} dest
+ */
+ vec4.subtract = function(vecA, vecB, dest) {
+ if (!dest) dest = vecB;
+ dest[0] = vecA[0] - vecB[0];
+ dest[1] = vecA[1] - vecB[1];
+ dest[2] = vecA[2] - vecB[2];
+ dest[3] = vecA[3] - vecB[3];
+ return dest;
+ };
+
+ /**
+ * Multiplies vecA with vecB. If dest is given, the result
+ * is stored there. Otherwise, the result is stored in vecB.
+ *
+ * @param {vec4} vecA the first operand
+ * @param {vec4} vecB the second operand
+ * @param {vec4} [dest] the optional receiving vector
+ * @returns {vec4} dest
+ */
+ vec4.multiply = function(vecA, vecB, dest) {
+ if (!dest) dest = vecB;
+ dest[0] = vecA[0] * vecB[0];
+ dest[1] = vecA[1] * vecB[1];
+ dest[2] = vecA[2] * vecB[2];
+ dest[3] = vecA[3] * vecB[3];
+ return dest;
+ };
+
+ /**
+ * Divides vecA by vecB. If dest is given, the result
+ * is stored there. Otherwise, the result is stored in vecB.
+ *
+ * @param {vec4} vecA the first operand
+ * @param {vec4} vecB the second operand
+ * @param {vec4} [dest] the optional receiving vector
+ * @returns {vec4} dest
+ */
+ vec4.divide = function(vecA, vecB, dest) {
+ if (!dest) dest = vecB;
+ dest[0] = vecA[0] / vecB[0];
+ dest[1] = vecA[1] / vecB[1];
+ dest[2] = vecA[2] / vecB[2];
+ dest[3] = vecA[3] / vecB[3];
+ return dest;
+ };
+
+ /**
+ * Scales vecA by some scalar number. If dest is given, the result
+ * is stored there. Otherwise, the result is stored in vecA.
+ *
+ * This is the same as multiplying each component of vecA
+ * by the given scalar.
+ *
+ * @param {vec4} vecA the vector to be scaled
+ * @param {Number} scalar the amount to scale the vector by
+ * @param {vec4} [dest] the optional receiving vector
+ * @returns {vec4} dest
+ */
+ vec4.scale = function(vecA, scalar, dest) {
+ if (!dest) dest = vecA;
+ dest[0] = vecA[0] * scalar;
+ dest[1] = vecA[1] * scalar;
+ dest[2] = vecA[2] * scalar;
+ dest[3] = vecA[3] * scalar;
+ return dest;
+ };
+
+ /**
+ * Copies the values of one vec4 to another
+ *
+ * @param {vec4} vec vec4 containing values to copy
+ * @param {vec4} dest vec4 receiving copied values
+ *
+ * @returns {vec4} dest
+ */
+ vec4.set = function (vec, dest) {
+ dest[0] = vec[0];
+ dest[1] = vec[1];
+ dest[2] = vec[2];
+ dest[3] = vec[3];
+ return dest;
+ };
+
+ /**
+ * Compares two vectors for equality within a certain margin of error
+ *
+ * @param {vec4} a First vector
+ * @param {vec4} b Second vector
+ *
+ * @returns {Boolean} True if a is equivalent to b
+ */
+ vec4.equal = function (a, b) {
+ return a === b || (
+ Math.abs(a[0] - b[0]) < FLOAT_EPSILON &&
+ Math.abs(a[1] - b[1]) < FLOAT_EPSILON &&
+ Math.abs(a[2] - b[2]) < FLOAT_EPSILON &&
+ Math.abs(a[3] - b[3]) < FLOAT_EPSILON
+ );
+ };
+
+ /**
+ * Negates the components of a vec4
+ *
+ * @param {vec4} vec vec4 to negate
+ * @param {vec4} [dest] vec4 receiving operation result. If not specified result is written to vec
+ *
+ * @returns {vec4} dest if specified, vec otherwise
+ */
+ vec4.negate = function (vec, dest) {
+ if (!dest) { dest = vec; }
+ dest[0] = -vec[0];
+ dest[1] = -vec[1];
+ dest[2] = -vec[2];
+ dest[3] = -vec[3];
+ return dest;
+ };
+
+ /**
+ * Caclulates the length of a vec2
+ *
+ * @param {vec2} vec vec2 to calculate length of
+ *
+ * @returns {Number} Length of vec
+ */
+ vec4.length = function (vec) {
+ var x = vec[0], y = vec[1], z = vec[2], w = vec[3];
+ return Math.sqrt(x * x + y * y + z * z + w * w);
+ };
+
+ /**
+ * Caclulates the squared length of a vec4
+ *
+ * @param {vec4} vec vec4 to calculate squared length of
+ *
+ * @returns {Number} Squared Length of vec
+ */
+ vec4.squaredLength = function (vec) {
+ var x = vec[0], y = vec[1], z = vec[2], w = vec[3];
+ return x * x + y * y + z * z + w * w;
+ };
+
+ /**
+ * Performs a linear interpolation between two vec4
+ *
+ * @param {vec4} vecA First vector
+ * @param {vec4} vecB Second vector
+ * @param {Number} lerp Interpolation amount between the two inputs
+ * @param {vec4} [dest] vec4 receiving operation result. If not specified result is written to vecA
+ *
+ * @returns {vec4} dest if specified, vecA otherwise
+ */
+ vec4.lerp = function (vecA, vecB, lerp, dest) {
+ if (!dest) { dest = vecA; }
+ dest[0] = vecA[0] + lerp * (vecB[0] - vecA[0]);
+ dest[1] = vecA[1] + lerp * (vecB[1] - vecA[1]);
+ dest[2] = vecA[2] + lerp * (vecB[2] - vecA[2]);
+ dest[3] = vecA[3] + lerp * (vecB[3] - vecA[3]);
+ return dest;
+ };
+
+ /**
+ * Returns a string representation of a vector
+ *
+ * @param {vec4} vec Vector to represent as a string
+ *
+ * @returns {String} String representation of vec
+ */
+ vec4.str = function (vec) {
+ return '[' + vec[0] + ', ' + vec[1] + ', ' + vec[2] + ', ' + vec[3] + ']';
+ };
+
+ /*
+ * Exports
+ */
+
+ if(root) {
+ root.glMatrixArrayType = MatrixArray;
+ root.MatrixArray = MatrixArray;
+ root.setMatrixArrayType = setMatrixArrayType;
+ root.determineMatrixArrayType = determineMatrixArrayType;
+ root.glMath = glMath;
+ root.vec2 = vec2;
+ root.vec3 = vec3;
+ root.vec4 = vec4;
+ root.mat2 = mat2;
+ root.mat3 = mat3;
+ root.mat4 = mat4;
+ root.quat4 = quat4;
+ }
+
+ return {
+ glMatrixArrayType: MatrixArray,
+ MatrixArray: MatrixArray,
+ setMatrixArrayType: setMatrixArrayType,
+ determineMatrixArrayType: determineMatrixArrayType,
+ glMath: glMath,
+ vec2: vec2,
+ vec3: vec3,
+ vec4: vec4,
+ mat2: mat2,
+ mat3: mat3,
+ mat4: mat4,
+ quat4: quat4
+ };
+}));
* http://jquery.org/license
*/(function(a,b){function m(b,c,d,e){var h={data:e||e===0||e===!1?e:c?c.data:{},_wrap:c?c._wrap:null,tmpl:null,parent:c||null,nodes:[],calls:u,nest:v,wrap:w,html:x,update:y};return b&&a.extend(h,b,{nodes:[],parent:c}),d&&(h.tmpl=d,h._ctnt=h._ctnt||h.tmpl(a,h),h.key=++j,(l.length?g:f)[j]=h),h}function n(b,c,e){var f,g=e?a.map(e,function(a){return typeof a=="string"?b.key?a.replace(/(<\w+)(?=[\s>])(?![^>]*_tmplitem)([^>]*)/g,"$1 "+d+'="'+b.key+'" $2'):a:n(a,b,a._ctnt)}):b;return c?g:(g=g.join(""),g.replace(/^\s*([^<\s][^<]*)?(<[\w\W]+>)([^>]*[^>\s])?\s*$/,function(b,c,d,e){f=a(d).get(),t(f),c&&(f=o(c).concat(f)),e&&(f=f.concat(o(e)))}),f?f:o(g))}function o(b){var c=document.createElement("div");return c.innerHTML=b,a.makeArray(c.childNodes)}function p(b){return new Function("jQuery","$item","var $=jQuery,call,__=[],$data=$item.data;with($data){__.push('"+a.trim(b).replace(/([\\'])/g,"\\$1").replace(/[\r\t\n]/g," ").replace(/\$\{([^\}]*)\}/g,"{{= $1}}").replace(/\{\{(\/?)(\w+|.)(?:\(((?:[^\}]|\}(?!\}))*?)?\))?(?:\s+(.*?)?)?(\(((?:[^\}]|\}(?!\}))*?)\))?\s*\}\}/g,function(b,c,d,e,f,g,h){var i=a.tmpl.tag[d],j,k,l;if(!i)throw"Unknown template tag: "+d;return j=i._default||[],g&&!/\w$/.test(f)&&(f+=g,g=""),f?(f=r(f),h=h?","+r(h)+")":g?")":"",k=g?f.indexOf(".")>-1?f+r(g):"("+f+").call($item"+h:f,l=g?k:"(typeof("+f+")==='function'?("+f+").call($item):("+f+"))"):l=k=j.$1||"null",e=r(e),"');"+i[c?"close":"open"].split("$notnull_1").join(f?"typeof("+f+")!=='undefined' && ("+f+")!=null":"true").split("$1a").join(l).split("$1").join(k).split("$2").join(e||j.$2||"")+"__.push('"})+"');}return __;")}function q(b,c){b._wrap=n(b,!0,a.isArray(c)?c:[e.test(c)?c:a(c).html()]).join("")}function r(a){return a?a.replace(/\\'/g,"'").replace(/\\\\/g,"\\"):null}function s(a){var b=document.createElement("div");return b.appendChild(a.cloneNode(!0)),b.innerHTML}function t(b){function p(b){function p(a){a+=c,n=i[a]=i[a]||m(n,f[n.parent.key+c]||n.parent)}var e,h=b,l,n,o;if(o=b.getAttribute(d)){while(h.parentNode&&(h=h.parentNode).nodeType===1&&!(e=h.getAttribute(d)));e!==o&&(h=h.parentNode?h.nodeType===11?0:h.getAttribute(d)||0:0,(n=f[o])||(n=g[o],n=m(n,f[h]||g[h]),n.key=++j,f[j]=n),k&&p(o)),b.removeAttribute(d)}else k&&(n=a.data(b,"tmplItem"))&&(p(n.key),f[n.key]=n,h=a.data(b.parentNode,"tmplItem"),h=h?h.key:0);if(n){l=n;while(l&&l.key!=h)l.nodes.push(b),l=l.parent;delete n._ctnt,delete n._wrap,a.data(b,"tmplItem",n)}}var c="_"+k,e,h,i={},l,n,o;for(l=0,n=b.length;l<n;l++){if((e=b[l]).nodeType!==1)continue;h=e.getElementsByTagName("*");for(o=h.length-1;o>=0;o--)p(h[o]);p(e)}}function u(a,b,c,d){if(!a)return l.pop();l.push({_:a,tmpl:b,item:this,data:c,options:d})}function v(b,c,d){return a.tmpl(a.template(b),c,d,this)}function w(b,c){var d=b.options||{};return d.wrapped=c,a.tmpl(a.template(b.tmpl),b.data,d,b.item)}function x(b,c){var d=this._wrap;return a.map(a(a.isArray(d)?d.join(""):d).filter(b||"*"),function(a){return c?a.innerText||a.textContent:a.outerHTML||s(a)})}function y(){var b=this.nodes;a.tmpl(null,null,null,this).insertBefore(b[0]),a(b).remove()}var c=a.fn.domManip,d="_tmplitem",e=/^[^<]*(<[\w\W]+>)[^>]*$|\{\{\! /,f={},g={},h,i={key:0,data:{}},j=0,k=0,l=[];a.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(b,c){a.fn[b]=function(d){var e=[],g=a(d),i,j,l,m,n=this.length===1&&this[0].parentNode;h=f||{};if(n&&n.nodeType===11&&n.childNodes.length===1&&g.length===1)g[c](this[0]),e=this;else{for(j=0,l=g.length;j<l;j++)k=j,i=(j>0?this.clone(!0):this).get(),a(g[j])[c](i),e=e.concat(i);k=0,e=this.pushStack(e,b,g.selector)}return m=h,h=null,a.tmpl.complete(m),e}}),a.fn.extend({tmpl:function(b,c,d){return a.tmpl(this[0],b,c,d)},tmplItem:function(){return a.tmplItem(this[0])},template:function(b){return a.template(b,this[0])},domManip:function(b,d,e,g){if(b[0]&&a.isArray(b[0])){var i=a.makeArray(arguments),j=b[0],l=j.length,m=0,n;while(m<l&&!(n=a.data(j[m++],"tmplItem")));n&&k&&(i[2]=function(b){a.tmpl.afterManip(this,b,e)}),c.apply(this,i)}else c.apply(this,arguments);return k=0,h||a.tmpl.complete(f),this}}),a.extend({tmpl:function(b,c,d,e){var h,j=!e;if(j)e=i,b=a.template[b]||a.template(null,b),g={};else if(!b)return b=e.tmpl,f[e.key]=e,e.nodes=[],e.wrapped&&q(e,e.wrapped),a(n(e,null,e.tmpl(a,e)));return b?(typeof c=="function"&&(c=c.call(e||{})),d&&d.wrapped&&q(d,d.wrapped),h=a.isArray(c)?a.map(c,function(a){return a?m(d,e,b,a):null}):[m(d,e,b,c)],j?a(n(e,null,h)):h):[]},tmplItem:function(b){var c;b instanceof a&&(b=b[0]);while(b&&b.nodeType===1&&!(c=a.data(b,"tmplItem"))&&(b=b.parentNode));return c||i},template:function(b,c){return c?(typeof c=="string"?c=p(c):c instanceof a&&(c=c[0]||{}),c.nodeType&&(c=a.data(c,"tmpl")||a.data(c,"tmpl",p(c.innerHTML))),typeof b=="string"?a.template[b]=c:c):b?typeof b!="string"?a.template(null,b):a.template[b]||a.template(null,e.test(b)?b:a(b)):null},encode:function(a){return(""+a).split("<").join("<").split(">").join(">").split('"').join(""").split("'").join("'")}}),a.extend(a.tmpl,{tag:{tmpl:{_default:{$2:"null"},open:"if($notnull_1){__=__.concat($item.nest($1,$2));}"},wrap:{_default:{$2:"null"},open:"$item.calls(__,$1,$2);__=[];",close:"call=$item.calls();__=call._.concat($item.wrap(call,__));"},each:{_default:{$2:"$index, $value"},open:"if($notnull_1){$.each($1a,function($2){with(this){",close:"}});}"},"if":{open:"if(($notnull_1) && $1a){",close:"}"},"else":{_default:{$1:"true"},open:"}else if(($notnull_1) && $1a){"},html:{open:"if($notnull_1){__.push($1a);}"},"=":{_default:{$1:"$data"},open:"if($notnull_1){__.push($.encode($1a));}"},"!":{open:""}},complete:function(a){f={}},afterManip:function(c,d,e){var f=d.nodeType===11?a.makeArray(d.childNodes):d.nodeType===1?[d]:[];e.call(c,d),t(f),k++}})})(jQuery);
/*
-* jQuery Mobile Framework Git Build: SHA1: 8f3c14b8b7b116570e29760a99cbdb8ca27a0307 <> Date: Mon Jan 28 22:00:34 2013 +0900
+* jQuery Mobile Framework Git Build: SHA1: e8f95df072513dc95469b346e4085d7eaa9dabf3 <> Date: Fri Mar 29 19:38:09 2013 +0900
* http://jquerymobile.com
*
* Copyright 2012 jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
-*/(function(a,b,c){typeof define=="function"&&define.amd?define(["jquery"],function(d){return c(d,a,b),d.mobile}):c(a.jQuery,a,b)})(this,document,function(a,b,c,d){(function(a,b,d){var e={};a.mobile=a.extend({},{version:"1.2.0",ns:"",subPageUrlKey:"ui-page",activePageClass:"ui-page-active",activeBtnClass:"ui-btn-active",focusClass:"ui-focus",ajaxEnabled:!0,hashListeningEnabled:!0,linkBindingEnabled:!0,defaultPageTransition:"fade",maxTransitionWidth:!1,minScrollBack:250,touchOverflowEnabled:!1,defaultDialogTransition:"pop",pageLoadErrorMessage:"Error Loading Page",pageLoadErrorMessageTheme:"e",phonegapNavigationEnabled:!1,autoInitializePage:!0,pushStateEnabled:!0,ignoreContentEnabled:!1,orientationChangeEnabled:!0,buttonMarkup:{hoverDelay:200},keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91},silentScroll:function(d){a.type(d)!=="number"&&(d=a.mobile.defaultHomeScroll),a.event.special.scrollstart.enabled=!1,setTimeout(function(){b.scrollTo(0,d),a(c).trigger("silentscroll",{x:0,y:d})},20),setTimeout(function(){a.event.special.scrollstart.enabled=!0},150)},nsNormalizeDict:e,nsNormalize:function(b){if(!b)return;return e[b]||(e[b]=a.camelCase(a.mobile.ns+b))},getInheritedTheme:function(a,b){var c=a[0],d="",e=/ui-(bar|body|overlay)-([a-z])\b/,f,g;while(c){f=c.className||"";if(f&&(g=e.exec(f))&&(d=g[2]))break;c=c.parentNode}return d||b||"a"},closestPageData:function(a){return a.closest(':jqmData(role="page"), :jqmData(role="dialog")').data("page")},enhanceable:function(a){return this.haveParents(a,"enhance")},hijackable:function(a){return this.haveParents(a,"ajax")},haveParents:function(b,c){if(!a.mobile.ignoreContentEnabled)return b;var d=b.length,e=a(),f,g,h;for(var i=0;i<d;i++){g=b.eq(i),h=!1,f=b[i];while(f){var j=f.getAttribute?f.getAttribute("data-"+a.mobile.ns+c):"";if(j==="false"){h=!0;break}f=f.parentNode}h||(e=e.add(g))}return e},getScreenHeight:function(){return b.innerHeight||a(b).height()}},a.mobile),a.fn.jqmData=function(b,c){var e;return typeof b!="undefined"&&(b&&(b=a.mobile.nsNormalize(b)),arguments.length<2||c===d?e=this.data(b):e=this.data(b,c)),e},a.jqmData=function(b,c,d){var e;return typeof c!="undefined"&&(e=a.data(b,c?a.mobile.nsNormalize(c):c,d)),e},a.fn.jqmRemoveData=function(b){return this.removeData(a.mobile.nsNormalize(b))},a.jqmRemoveData=function(b,c){return a.removeData(b,a.mobile.nsNormalize(c))},a.fn.removeWithDependents=function(){a.removeWithDependents(this)},a.removeWithDependents=function(b){var c=a(b);(c.jqmData("dependents")||a()).remove(),c.remove()},a.fn.addDependents=function(b){a.addDependents(a(this),b)},a.addDependents=function(b,c){var d=a(b).jqmData("dependents")||a();a(b).jqmData("dependents",a.merge(d,c))},a.fn.getEncodedText=function(){return a("<div/>").text(a(this).text()).html()},a.fn.jqmEnhanceable=function(){return a.mobile.enhanceable(this)},a.fn.jqmHijackable=function(){return a.mobile.hijackable(this)};var f=a.find,g=/:jqmData\(([^)]*)\)/g;a.find=function(b,c,d,e){return b=b.replace(g,"[data-"+(a.mobile.ns||"")+"$1]"),f.call(this,b,c,d,e)},a.extend(a.find,f),a.find.matches=function(b,c){return a.find(b,null,null,c)},a.find.matchesSelector=function(b,c){return a.find(c,null,null,[b]).length>0}})(a,this),function(a,b){var c=0,d=Array.prototype.slice,e=a.cleanData;a.cleanData=function(b){for(var c=0,d;(d=b[c])!=null;c++)try{a(d).triggerHandler("remove")}catch(f){}e(b)},a.widget=function(b,c,d){var e,f,g,h,i=b.split(".")[0];b=b.split(".")[1],e=i+"-"+b,d||(d=c,c=a.Widget),a.expr[":"][e]=function(b){return!!a.data(b,e)},a[i]=a[i]||{},f=a[i][b],g=a[i][b]=function(a,b){if(!this._createWidget)return new g(a,b);arguments.length&&this._createWidget(a,b)},a.extend(g,f,{version:d.version,_proto:a.extend({},d),_childConstructors:[]}),h=new c,h.options=a.widget.extend({},h.options),a.each(d,function(b,e){a.isFunction(e)&&(d[b]=function(){var a=function(){return c.prototype[b].apply(this,arguments)},d=function(a){return c.prototype[b].apply(this,a)};return function(){var b=this._super,c=this._superApply,f;return this._super=a,this._superApply=d,f=e.apply(this,arguments),this._super=b,this._superApply=c,f}}())}),g.prototype=a.widget.extend(h,{widgetEventPrefix:b},d,{constructor:g,namespace:i,widgetName:b,widgetBaseClass:e,widgetFullName:e}),f?(a.each(f._childConstructors,function(b,c){var d=c.prototype;a.widget(d.namespace+"."+d.widgetName,g,c._proto)}),delete f._childConstructors):c._childConstructors.push(g),a.widget.bridge(b,g)},a.widget.extend=function(c){var e=d.call(arguments,1),f=0,g=e.length,h,i;for(;f<g;f++)for(h in e[f])i=e[f][h],e[f].hasOwnProperty(h)&&i!==b&&(c[h]=a.isPlainObject(i)?a.widget.extend({},c[h],i):i);return c},a.widget.bridge=function(c,e){var f=e.prototype.widgetFullName;a.fn[c]=function(g){var h=typeof g=="string",i=d.call(arguments,1),j=this;return g=!h&&i.length?a.widget.extend.apply(null,[g].concat(i)):g,h?this.each(function(){var d,e=a.data(this,f);if(!e)return a.error("cannot call methods on "+c+" prior to initialization; "+"attempted to call method '"+g+"'");if(!a.isFunction(e[g])||g.charAt(0)==="_")return a.error("no such method '"+g+"' for "+c+" widget instance");d=e[g].apply(e,i);if(d!==e&&d!==b)return j=d&&d.jquery?j.pushStack(d.get()):d,!1}):this.each(function(){var b=a.data(this,f);b?b.option(g||{})._init():new e(g,this)}),j}},a.Widget=function(a,b){},a.Widget._childConstructors=[],a.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(b,d){d=a(d||this.defaultElement||this)[0],this.element=a(d),this.uuid=c++,this.eventNamespace="."+this.widgetName+this.uuid,this.options=a.widget.extend({},this.options,this._getCreateOptions(),b),this.bindings=a(),this.hoverable=a(),this.focusable=a(),d!==this&&(a.data(d,this.widgetName,this),a.data(d,this.widgetFullName,this),this._on({remove:"destroy"}),this.document=a(d.style?d.ownerDocument:d.document||d),this.window=a(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:a.noop,_getCreateEventData:a.noop,_create:a.noop,_init:a.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(a.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled "+"ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:a.noop,widget:function(){return this.element},option:function(c,d){var e=c,f,g,h;if(arguments.length===0)return a.widget.extend({},this.options);if(typeof c=="string"){e={},f=c.split("."),c=f.shift();if(f.length){g=e[c]=a.widget.extend({},this.options[c]);for(h=0;h<f.length-1;h++)g[f[h]]=g[f[h]]||{},g=g[f[h]];c=f.pop();if(d===b)return g[c]===b?null:g[c];g[c]=d}else{if(d===b)return this.options[c]===b?null:this.options[c];e[c]=d}}return this._setOptions(e),this},_setOptions:function(a){var b;for(b in a)this._setOption(b,a[b]);return this},_setOption:function(a,b){return this.options[a]=b,a==="disabled"&&(this.widget().toggleClass(this.widgetFullName+"-disabled ui-state-disabled",!!b).attr("aria-disabled",b),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_on:function(b,c){c?(b=a(b),this.bindings=this.bindings.add(b)):(c=b,b=this.element);var d=this;a.each(c,function(c,e){function f(){if(d.options.disabled===!0||a(this).hasClass("ui-state-disabled"))return;return(typeof e=="string"?d[e]:e).apply(d,arguments)}typeof e!="string"&&(f.guid=e.guid=e.guid||f.guid||a.guid++);var g=c.match(/^(\w+)\s*(.*)$/),h=g[1]+d.eventNamespace,i=g[2];i?d.widget().delegate(i,h,f):b.bind(h,f)})},_off:function(a,b){b=(b||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,a.unbind(b).undelegate(b)},_delay:function(a,b){function c(){return(typeof a=="string"?d[a]:a).apply(d,arguments)}var d=this;return setTimeout(c,b||0)},_hoverable:function(b){this.hoverable=this.hoverable.add(b),this._on(b,{mouseenter:function(b){a(b.currentTarget).addClass("ui-state-hover")},mouseleave:function(b){a(b.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(b){this.focusable=this.focusable.add(b),this._on(b,{focusin:function(b){a(b.currentTarget).addClass("ui-state-focus")},focusout:function(b){a(b.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(b,c,d){var e,f,g=this.options[b];d=d||{},c=a.Event(c),c.type=(b===this.widgetEventPrefix?b:this.widgetEventPrefix+b).toLowerCase(),c.target=this.element[0],f=c.originalEvent;if(f)for(e in f)e in c||(c[e]=f[e]);return this.element.trigger(c,d),!(a.isFunction(g)&&g.apply(this.element[0],[c].concat(d))===!1||c.isDefaultPrevented())}},a.each({show:"fadeIn",hide:"fadeOut"},function(b,c){a.Widget.prototype["_"+b]=function(d,e,f){typeof e=="string"&&(e={effect:e});var g,h=e?e===!0||typeof e=="number"?c:e.effect||c:b;e=e||{},typeof e=="number"&&(e={duration:e}),g=!a.isEmptyObject(e),e.complete=f,e.delay&&d.delay(e.delay),g&&a.effects&&(a.effects.effect[h]||a.uiBackCompat!==!1&&a.effects[h])?d[b](e):h!==b&&d[h]?d[h](e.duration,e.easing,f):d.queue(function(c){a(this)[b](),f&&f.call(d[0]),c()})}}),a.uiBackCompat!==!1&&(a.Widget.prototype._getCreateOptions=function(){return a.metadata&&a.metadata.get(this.element[0])[this.widgetName]})}(a),function(a,b){a.widget("mobile.widget",{_createWidget:function(){a.Widget.prototype._createWidget.apply(this,arguments),this._trigger("init")},_getCreateOptions:function(){var c=this.element,d={};return a.each(this.options,function(a){var e=c.jqmData(a.replace(/[A-Z]/g,function(a){return"-"+a.toLowerCase()}));e!==b&&(d[a]=e)}),d},enhanceWithin:function(b,c){this.enhance(a(this.options.initSelector,a(b)),c)},enhance:function(b,c){var d,e,f=a(b),g=this;f=a.mobile.enhanceable(f),c&&f.length&&(d=a.mobile.closestPageData(f),e=d&&d.keepNativeSelector()||"",f=f.not(e)),f[this.widgetName]()},raise:function(a){throw"Widget ["+this.widgetName+"]: "+a}})}(a),function(a,b){a.extend(a.mobile,{loadingMessageTextVisible:d,loadingMessageTheme:d,loadingMessage:d,showPageLoadingMsg:function(b,c,d){a.mobile.loading("show",b,c,d)},hidePageLoadingMsg:function(){a.mobile.loading("hide")},loading:function(){this.loaderWidget.loader.apply(this.loaderWidget,arguments)}});var c="ui-loader",e=a("html"),f=a(b);a.widget("mobile.loader",{options:{theme:"a",textVisible:!1,html:"",text:"loading"},defaultHtml:"<div class='"+c+"'>"+"<span class='ui-icon ui-icon-loading'></span>"+"<h1></h1>"+"</div>",fakeFixLoader:function(){var b=a("."+a.mobile.activeBtnClass).first();this.element.css({top:a.support.scrollTop&&f.scrollTop()+f.height()/2||b.length&&b.offset().top||100})},checkLoaderPosition:function(){var b=this.element.offset(),c=f.scrollTop(),d=a.mobile.getScreenHeight();if(b.top<c||b.top-c>d)this.element.addClass("ui-loader-fakefix"),this.fakeFixLoader(),f.unbind("scroll",this.checkLoaderPosition).bind("scroll",this.fakeFixLoader)},resetHtml:function(){this.element.html(a(this.defaultHtml).html())},show:function(b,g,h){var i,j,k,l;this.resetHtml(),a.type(b)==="object"?(l=a.extend({},this.options,b),b=l.theme||a.mobile.loadingMessageTheme):(l=this.options,b=b||a.mobile.loadingMessageTheme||l.theme),j=g||a.mobile.loadingMessage||l.text,e.addClass("ui-loading");if(a.mobile.loadingMessage!==!1||l.html)a.mobile.loadingMessageTextVisible!==d?i=a.mobile.loadingMessageTextVisible:i=l.textVisible,this.element.attr("class",c+" ui-corner-all ui-body-"+b+" ui-loader-"+(i||g||b.text?"verbose":"default")+(l.textonly||h?" ui-loader-textonly":"")),l.html?this.element.html(l.html):this.element.find("h1").text(j),this.element.appendTo(a.mobile.pageContainer),this.checkLoaderPosition(),f.bind("scroll",a.proxy(this.checkLoaderPosition,this))},hide:function(){e.removeClass("ui-loading"),a.mobile.loadingMessage&&this.element.removeClass("ui-loader-fakefix"),a(b).unbind("scroll",a.proxy(this.fakeFixLoader,this)),a(b).unbind("scroll",a.proxy(this.checkLoaderPosition,this))}}),f.bind("pagecontainercreate",function(){a.mobile.loaderWidget=a.mobile.loaderWidget||a(a.mobile.loader.prototype.defaultHtml).loader()})}(a,this),function(a,b,c,d){function x(a){while(a&&typeof a.originalEvent!="undefined")a=a.originalEvent;return a}function y(b,c){var e=b.type,f,g,i,k,l,m,n,o,p;b=a.Event(b),b.type=c,f=b.originalEvent,g=a.event.props,e.search(/^(mouse|click)/)>-1&&(g=j);if(f)for(n=g.length,k;n;)k=g[--n],b[k]=f[k];e.search(/mouse(down|up)|click/)>-1&&!b.which&&(b.which=1);if(e.search(/^touch/)!==-1){i=x(f),e=i.touches,l=i.changedTouches,m=e&&e.length?e[0]:l&&l.length?l[0]:d;if(m)for(o=0,p=h.length;o<p;o++)k=h[o],b[k]=m[k]}return b}function z(b){var c={},d,f;while(b){d=a.data(b,e);for(f in d)d[f]&&(c[f]=c.hasVirtualBinding=!0);b=b.parentNode}return c}function A(b,c){var d;while(b){d=a.data(b,e);if(d&&(!c||d[c]))return b;b=b.parentNode}return null}function B(){r=!1}function C(){r=!0}function D(){v=0,p.length=0,q=!1,C()}function E(){B()}function F(){G(),l=setTimeout(function(){l=0,D()},a.vmouse.resetTimerDuration)}function G(){l&&(clearTimeout(l),l=0)}function H(b,c,d){var e;if(d&&d[b]||!d&&A(c.target,b))e=y(c,b),a(c.target).trigger(e);return e}function I(b){var c=a.data(b.target,f);if(a.support.touch===!0&&c===d)return;if(!q&&(!v||v!==c)){var e=H("v"+b.type,b);e&&(e.isDefaultPrevented()&&b.preventDefault(),e.isPropagationStopped()&&b.stopPropagation(),e.isImmediatePropagationStopped()&&b.stopImmediatePropagation())}}function J(b){var c=x(b).touches,d,e;if(c&&c.length===1){d=b.target,e=z(d);if(e.hasVirtualBinding){v=u++,a.data(d,f,v),G(),E(),o=!1;var g=x(b).touches[0];m=g.pageX,n=g.pageY,H("vmouseover",b,e),H("vmousedown",b,e)}}}function K(a){if(r)return;o||H("vmousecancel",a,z(a.target)),o=!0,F()}function L(b){if(r)return;var c=x(b).touches[0],d=o,e=a.vmouse.moveDistanceThreshold,f=z(b.target);o=o||Math.abs(c.pageX-m)>e||Math.abs(c.pageY-n)>e,o&&!d&&H("vmousecancel",b,f),H("vmousemove",b,f),F()}function M(a){if(r)return;C();var b=z(a.target),c;H("vmouseup",a,b);if(!o){var d=H("vclick",a,b);d&&d.isDefaultPrevented()&&(c=x(a).changedTouches[0],p.push({touchID:v,target:a.target,x:c.clientX,y:c.clientY}),q=!0)}H("vmouseout",a,b),o=!1,F()}function N(b){var c=a.data(b,e),d;if(c)for(d in c)if(c[d])return!0;return!1}function O(){}function P(b){var c=b.substr(1);return{setup:function(d,f){N(this)||a.data(this,e,{});var g=a.data(this,e);g[b]=!0,k[b]=(k[b]||0)+1,k[b]===1&&t.bind(c,I),a(this).bind(c,O),s&&(k.touchstart=(k.touchstart||0)+1,k.touchstart===1&&t.bind("touchstart",J).bind("touchend",M).bind("touchmove",L).bind("scroll",K))},teardown:function(d,f){--k[b],k[b]||t.unbind(c,I),s&&(--k.touchstart,k.touchstart||t.unbind("touchstart",J).unbind("touchmove",L).unbind("touchend",M).unbind("scroll",K));var g=a(this),h=a.data(this,e);h&&(h[b]=!1),g.unbind(c,O),N(this)||g.removeData(e)}}}var e="virtualMouseBindings",f="virtualTouchID",g="vmouseover vmousedown vmousemove vmouseup vclick vmouseout vmousecancel".split(" "),h="clientX clientY pageX pageY screenX screenY".split(" "),i=a.event.mouseHooks?a.event.mouseHooks.props:[],j=a.event.props.concat(i),k={},l=0,m=0,n=0,o=!1,p=[],q=!1,r=!1,s="addEventListener"in c,t=a(c),u=1,v=0,w;a.vmouse={moveDistanceThreshold:10,clickDistanceThreshold:10,resetTimerDuration:1500};for(var Q=0;Q<g.length;Q++)a.event.special[g[Q]]=P(g[Q]);s&&c.addEventListener("click",function(b){var c=p.length,d=b.target,e,g,h,i,j,k;if(c){e=b.clientX,g=b.clientY,w=a.vmouse.clickDistanceThreshold,h=d;while(h){for(i=0;i<c;i++){j=p[i],k=0;if(h===d&&d===j.target&&Math.abs(j.x-e)<w&&Math.abs(j.y-g)<w||a.data(h,f)===j.touchID){b.preventDefault(),b.stopPropagation();return}}h=h.parentNode}}},!0)}(a,b,c),function(a,b){var d={touch:"ontouchend"in c};a.mobile=a.mobile||{},a.mobile.support=a.mobile.support||{},a.extend(a.support,d),a.extend(a.mobile.support,d)}(a),function(a,b,d){function j(b,c,e){var f=e.type;e.type=c,e.liveFired=d,a.event.handle.call(b,e),e.type=f}a.each("touchstart touchmove touchend tap taphold swipe swipeleft swiperight scrollstart scrollstop".split(" "),function(b,c){a.fn[c]=function(a){return a?this.bind(c,a):this.trigger(c)},a.attrFn&&(a.attrFn[c]=!0)});var e=a.mobile.support.touch,f="touchmove scroll",g=e?"touchstart":"mousedown",h=e?"touchend":"mouseup",i=e?"touchmove":"mousemove";a.event.special.scrollstart={enabled:!0,setup:function(){function g(a,c){d=c,j(b,d?"scrollstart":"scrollstop",a)}var b=this,c=a(b),d,e;c.bind(f,function(b){if(!a.event.special.scrollstart.enabled)return;d||g(b,!0),clearTimeout(e),e=setTimeout(function(){g(b,!1)},50)})}},a.event.special.tap={tapholdThreshold:750,setup:function(){var b=this,d=a(b);d.bind("vmousedown",function(e){function i(){clearTimeout(h)}function k(){i(),d.unbind("vclick",l).unbind("vmouseup",i),a(c).unbind("vmousecancel",k)}function l(a){k(),f===a.target&&j(b,"tap",a)}if(e.which&&e.which!==1)return!1;var f=e.target,g=e.originalEvent,h;d.bind("vmouseup",i).bind("vclick",l),a(c).bind("vmousecancel",k),h=setTimeout(function(){j(b,"taphold",a.Event("taphold",{target:f}))},a.event.special.tap.tapholdThreshold)})}},a.event.special.swipe={scrollSupressionThreshold:30,durationThreshold:1e3,horizontalDistanceThreshold:30,verticalDistanceThreshold:75,setup:function(){var b=this,c=a(b);c.bind(g,function(b){function j(b){if(!f)return;var c=b.originalEvent.touches?b.originalEvent.touches[0]:b;g={time:(new Date).getTime(),coords:[c.pageX,c.pageY]},Math.abs(f.coords[0]-g.coords[0])>a.event.special.swipe.scrollSupressionThreshold&&b.preventDefault()}var e=b.originalEvent.touches?b.originalEvent.touches[0]:b,f={time:(new Date).getTime(),coords:[e.pageX,e.pageY],origin:a(b.target)},g;c.bind(i,j).one(h,function(b){c.unbind(i,j),f&&g&&g.time-f.time<a.event.special.swipe.durationThreshold&&Math.abs(f.coords[0]-g.coords[0])>a.event.special.swipe.horizontalDistanceThreshold&&Math.abs(f.coords[1]-g.coords[1])<a.event.special.swipe.verticalDistanceThreshold&&f.origin.trigger("swipe").trigger(f.coords[0]>g.coords[0]?"swipeleft":"swiperight"),f=g=d})})}},a.each({scrollstop:"scrollstart",taphold:"tap",swipeleft:"swipe",swiperight:"swipe"},function(b,c){a.event.special[b]={setup:function(){a(this).bind(c,a.noop)}}})}(a,this),function(a,c){a.extend(a.support,{orientation:"orientation"in b&&"onorientationchange"in b})}(a),function(a){a.event.special.throttledresize={setup:function(){a(this).bind("resize",c)},teardown:function(){a(this).unbind("resize",c)}};var b=250,c=function(){f=(new Date).getTime(),g=f-d,g>=b?(d=f,a(this).trigger("throttledresize")):(e&&clearTimeout(e),e=setTimeout(c,b-g))},d=0,e,f,g}(a),function(a,b){function o(){var a=g();a!==h&&(h=a,d.trigger(e))}var d=a(b),e="orientationchange",f,g,h,i,j,k={0:!0,180:!0};if(a.support.orientation){var l=b.innerWidth||a(b).width(),m=b.innerHeight||a(b).height(),n=50;i=l>m&&l-m>n,j=k[b.orientation];if(i&&j||!i&&!j)k={"-90":!0,90:!0}}a.event.special.orientationchange=a.extend({},a.event.special.orientationchange,{setup:function(){if(a.support.orientation&&!a.event.special.orientationchange.disabled)return!1;h=g(),d.bind("throttledresize",o)},teardown:function(){if(a.support.orientation&&!a.event.special.orientationchange.disabled)return!1;d.unbind("throttledresize",o)},add:function(a){var b=a.handler;a.handler=function(a){return a.orientation=g(),b.apply(this,arguments)}}}),a.event.special.orientationchange.orientation=g=function(){var d=!0,e=c.documentElement;return a.support.orientation?d=k[b.orientation]:d=e&&e.clientWidth/e.clientHeight<1.1,d?"portrait":"landscape"},a.fn[e]=function(a){return a?this.bind(e,a):this.trigger(e)},a.attrFn&&(a.attrFn[e]=!0)}(a,this),function(a,d){var e=a(b),f=a("html");a.mobile.media=function(){var b={},d=a("<div id='jquery-mediatest'></div>"),e=a("<body>").append(d);return function(a){if(!(a in b)){var g=c.createElement("style"),h="@media "+a+" { #jquery-mediatest { position:absolute; } }";g.type="text/css",g.styleSheet?g.styleSheet.cssText=h:g.appendChild(c.createTextNode(h)),f.prepend(e).prepend(g),b[a]=d.css("position")==="absolute",e.add(g).remove()}return b[a]}}()}(a),function(a,d){function e(a){var b=a.charAt(0).toUpperCase()+a.substr(1),c=(a+" "+h.join(b+" ")+b).split(" ");for(var e in c)if(g[c[e]]!==d)return!0}function m(a,b,d){var e=c.createElement("div"),f=function(a){return a.charAt(0).toUpperCase()+a.substr(1)},g=function(a){return"-"+a.charAt(0).toLowerCase()+a.substr(1)+"-"},i=function(c){var d=g(c)+a+": "+b+";",h=f(c),i=h+f(a);e.setAttribute("style",d),!e.style[i]||(k=!0)},j=d?[d]:h,k;for(var l=0;l<j.length;l++)i(j[l]);return!!k}function n(){var b="transform-3d";return m("perspective","10px","moz")||a.mobile.media("(-"+h.join("-"+b+"),(-")+"-"+b+"),("+b+")")}function o(){var b=location.protocol+"//"+location.host+location.pathname+"ui-dir/",c=a("head base"),d=null,e="",g,h;return c.length?e=c.attr("href"):c=d=a("<base>",{href:b}).appendTo("head"),g=a("<a href='testurl' />").prependTo(f),h=g[0].href,c[0].href=e||location.pathname,d&&d.remove(),h.indexOf(b)===0}function p(){var a=c.createElement("x"),d=c.documentElement,e=b.getComputedStyle,f;return"pointerEvents"in a.style?(a.style.pointerEvents="auto",a.style.pointerEvents="x",d.appendChild(a),f=e&&e(a,"").pointerEvents==="auto",d.removeChild(a),!!f):!1}function q(){var a=c.createElement("div");return typeof a.getBoundingClientRect!="undefined"}var f=a("<body>").prependTo("html"),g=f[0].style,h=["Webkit","Moz","O"],i="palmGetResource"in b,j=b.opera,k=b.operamini&&{}.toString.call(b.operamini)==="[object OperaMini]",l=b.blackberry&&!e("-webkit-transform");a.extend(a.mobile,{browser:{}}),a.mobile.browser.ie=function(){var a=3,b=c.createElement("div"),d=b.all||[];do b.innerHTML="<!--[if gt IE "+ ++a+"]><br><![endif]-->";while(d[0]);return a>4?a:!a}(),a.extend(a.support,{cssTransitions:"WebKitTransitionEvent"in b||m("transition","height 100ms linear")&&!j,pushState:"pushState"in history&&"replaceState"in history,mediaquery:a.mobile.media("only all"),cssPseudoElement:!!e("content"),touchOverflow:!!e("overflowScrolling"),cssTransform3d:n(),boxShadow:!!e("boxShadow")&&!l,scrollTop:("pageXOffset"in b||"scrollTop"in c.documentElement||"scrollTop"in f[0])&&!i&&!k,dynamicBaseTag:o(),cssPointerEvents:p(),boundingRect:q()}),f.remove();var r=function(){var a=b.navigator.userAgent;return a.indexOf("Nokia")>-1&&(a.indexOf("Symbian/3")>-1||a.indexOf("Series60/5")>-1)&&a.indexOf("AppleWebKit")>-1&&a.match(/(BrowserNG|NokiaBrowser)\/7\.[0-3]/)}();a.mobile.gradeA=function(){return(a.support.mediaquery||a.mobile.browser.ie&&a.mobile.browser.ie>=7)&&(a.support.boundingRect||a.fn.jquery.match(/1\.[0-7+]\.[0-9+]?/)!==null)},a.mobile.ajaxBlacklist=b.blackberry&&!b.WebKitPoint||k||r,r&&a(function(){a("head link[rel='stylesheet']").attr("rel","alternate stylesheet").attr("rel","stylesheet")}),a.support.boxShadow||a("html").addClass("ui-mobile-nosupport-boxshadow")}(a),function(a,b){a.widget("mobile.page",a.mobile.widget,{options:{theme:"c",domCache:!1,keepNativeDefault:":jqmData(role='none'), :jqmData(role='nojs')"},_create:function(){var a=this;if(a._trigger("beforecreate")===!1)return!1;a.element.attr("tabindex","0").addClass("ui-page ui-body-"+a.options.theme).bind("pagebeforehide",function(){a.removeContainerBackground()}).bind("pagebeforeshow",function(){a.setContainerBackground()})},refresh:function(){a(this.element).children(".ui-content").trigger("updatelayout",["external"])},setToolbar:function(){a(this.element).trigger("pagebeforeshow")},removeContainerBackground:function(){a.mobile.pageContainer.removeClass("ui-overlay-"+a.mobile.getInheritedTheme(this.element.parent()))},setContainerBackground:function(b){this.options.theme&&a.mobile.pageContainer.addClass("ui-overlay-"+(b||this.options.theme))},addBackBtn:function(b){var c=a(".ui-page-active .ui-footer");b=="header"&&(c=a(".ui-page-active .ui-header")),backBtn=a("<a href='#' class='ui-btn-back' data-"+a.mobile.ns+"rel='back'></a>").buttonMarkup({icon:"header-back-btn",theme:"s"}),c.find(".ui-btn-back").length||backBtn.prependTo(c)},keepNativeSelector:function(){var b=this.options,c=b.keepNative&&a.trim(b.keepNative);return c&&b.keepNative!==b.keepNativeDefault?[b.keepNative,b.keepNativeDefault].join(", "):b.keepNativeDefault}})}(a),function(a,b,d){function k(a){return a=a||location.href,"#"+a.replace(/^[^#]*#?(.*)$/,"$1")}var e="hashchange",f=c,g,h=a.event.special,i=f.documentMode,j="on"+e in b&&(i===d||i>7);a.fn[e]=function(a){return a?this.bind(e,a):this.trigger(e)},a.fn[e].delay=50,h[e]=a.extend(h[e],{setup:function(){if(j)return!1;a(g.start)},teardown:function(){if(j)return!1;a(g.stop)}}),g=function(){function n(){var c=k(),d=m(h);c!==h?(l(h=c,d),a(b).trigger(e)):d!==h&&(location.href=location.href.replace(/#.*/,"")+d),g=setTimeout(n,a.fn[e].delay)}var c={},g,h=k(),i=function(a){return a},l=i,m=i;return c.start=function(){g||n()},c.stop=function(){g&&clearTimeout(g),g=d},a.browser.msie&&!j&&function(){var b,d;c.start=function(){b||(d=a.fn[e].src,d=d&&d+k(),b=a('<iframe tabindex="-1" title="empty"/>').hide().one("load",function(){d||l(k()),n()}).attr("src",d||"javascript:0").insertAfter("body")[0].contentWindow,f.onpropertychange=function(){try{event.propertyName==="title"&&(b.document.title=f.title)}catch(a){}})},c.stop=i,m=function(){return k(b.location.href)},l=function(c,d){var g=b.document,h=a.fn[e].domain;c!==d&&(g.title=f.title,g.open(),h&&g.write('<script>document.domain="'+h+'"</script>'),g.close(),b.location.hash=c)}}(),c}()}(a,this),function(a,b,c){var d=function(d){return d===c&&(d=!0),function(c,e,f,g){var h=new a.Deferred,i=e?" reverse":"",j=a.mobile.urlHistory.getActive(),k=j.lastScroll||a.mobile.defaultHomeScroll,l=a.mobile.getScreenHeight(),m=a.mobile.maxTransitionWidth!==!1&&a(b).width()>a.mobile.maxTransitionWidth,n=!a.support.cssTransitions||m||!c||c==="none"||Math.max(a(b).scrollTop(),k)>a.mobile.getMaxScrollForTransition(),o=" ui-page-pre-in",p=function(){a.mobile.pageContainer.toggleClass("ui-mobile-viewport-transitioning viewport-"+c)},q=function(){var c=a(b).scrollTop();if(c===k||a.mobile.defaultHomeScroll===k&&c==0)return;a.event.special.scrollstart.enabled=!1,b.scrollTo(0,k),setTimeout(function(){a.event.special.scrollstart.enabled=!0},150)},r=function(){g.removeClass(a.mobile.activePageClass+" out in reverse "+c).height("")},s=function(){d?g.animationComplete(t):t(),g.height(l+a(b).scrollTop()).addClass(c+" out"+i)},t=function(){g&&d&&r(),u()},u=function(){f.css("z-index",-10),f.addClass(a.mobile.activePageClass+o),a.mobile.focusPage(f),f.height(l+k),q(),f.css("z-index",""),n||f.animationComplete(v),f.removeClass(o).addClass(c+" in"+i),n&&setTimeout(v,0)},v=function(){d||g&&r(),f.removeClass("out in reverse "+c).height(""),p(),a(b).scrollTop()!==k&&q(),h.resolve(c,e,f,g,!0)};return p(),g&&!n?s():t(),h.promise()}},e=d(),f=d(!1),g=function(){return a.mobile.getScreenHeight()*3};a.mobile.defaultTransitionHandler=e,a.mobile.transitionHandlers={"default":a.mobile.defaultTransitionHandler,sequential:e,simultaneous:f},a.mobile.transitionFallbacks={},a.mobile._maybeDegradeTransition=function(b){return b&&!a.support.cssTransform3d&&a.mobile.transitionFallbacks[b]&&(b=a.mobile.transitionFallbacks[b]),b},a.mobile.getMaxScrollForTransition=a.mobile.getMaxScrollForTransition||g}(a,this),function(a,d){function u(b){!!i&&(!i.closest("."+a.mobile.activePageClass).length||b)&&i.removeClass(a.mobile.activeBtnClass),i=null}function v(){m=!1,l.length>0&&a.mobile.changePage.apply(null,l.pop())}function z(b,c,d,e){c&&c.data("page")._trigger("beforehide",null,{nextPage:b}),b.data("page")._trigger("beforeshow",null,{prevPage:c||a("")}),a.mobile.hidePageLoadingMsg(),d=a.mobile._maybeDegradeTransition(d);var f=a.mobile.transitionHandlers[d||"default"]||a.mobile.defaultTransitionHandler,g=f(d,e,b,c);return g.done(function(){c&&c.data("page")._trigger("hide",null,{nextPage:b}),b.data("page")._trigger("show",null,{prevPage:c||a("")}),setTimeout(function(){a.mobile.removeEventBlocker()},0)}),g}function A(){var b=a("."+a.mobile.activePageClass),c=parseFloat(b.css("padding-top")),d=parseFloat(b.css("padding-bottom")),e=parseFloat(b.css("border-top-width")),f=parseFloat(b.css("border-bottom-width"));b.css("min-height",s()-c-d-e-f)}function B(b,c){c&&b.attr("data-"+a.mobile.ns+"role",c),b.page()}function C(a){while(a){if(typeof a.nodeName=="string"&&a.nodeName.toLowerCase()==="a")break;a=a.parentNode}return a}function D(b){var c=a(b).closest(".ui-page").jqmData("url"),d=q.hrefNoHash;if(!c||!h.isPath(c))c=d;return h.makeUrlAbsolute(c,d)}var e=a(b),f=a("html"),g=a("head"),h={urlParseRE:/^(((([^:\/#\?]+:)?(?:(\/\/)((?:(([^:@\/#\?]+)(?:\:([^:@\/#\?]+))?)@)?(([^:\/#\?\]\[]+|\[[^\/\]@#?]+\])(?:\:([0-9]+))?))?)?)?((\/?(?:[^\/\?#]+\/+)*)([^\?#]*)))?(\?[^#]+)?)(#.*)?/,getLocation:function(a){var b=a?this.parseUrl(a):location,c=this.parseUrl(a||location.href).hash;return c=c==="#"?"":c,b.protocol+"//"+b.host+b.pathname+b.search+c},parseLocation:function(){return this.parseUrl(this.getLocation())},parseUrl:function(b){if(a.type(b)==="object")return b;var c=h.urlParseRE.exec(b||"")||[];return{href:c[0]||"",hrefNoHash:c[1]||"",hrefNoSearch:c[2]||"",domain:c[3]||"",protocol:c[4]||"",doubleSlash:c[5]||"",authority:c[6]||"",username:c[8]||"",password:c[9]||"",host:c[10]||"",hostname:c[11]||"",port:c[12]||"",pathname:c[13]||"",directory:c[14]||"",filename:c[15]||"",search:c[16]||"",hash:c[17]||""}},makePathAbsolute:function(a,b){if(a&&a.charAt(0)==="/")return a;a=a||"",b=b?b.replace(/^\/|(\/[^\/]*|[^\/]+)$/g,""):"";var c=b?b.split("/"):[],d=a.split("/");for(var e=0;e<d.length;e++){var f=d[e];switch(f){case".":break;case"..":c.length&&c.pop();break;default:c.push(f)}}return"/"+c.join("/")},isSameDomain:function(a,b){return h.parseUrl(a).domain===h.parseUrl(b).domain},isRelativeUrl:function(a){return h.parseUrl(a).protocol===""},isAbsoluteUrl:function(a){return h.parseUrl(a).protocol!==""},makeUrlAbsolute:function(a,b){if(!h.isRelativeUrl(a))return a;b===d&&(b=q);var c=h.parseUrl(a),e=h.parseUrl(b),f=c.protocol||e.protocol,g=c.protocol?c.doubleSlash:c.doubleSlash||e.doubleSlash,i=c.authority||e.authority,j=c.pathname!=="",k=h.makePathAbsolute(c.pathname||e.filename,e.pathname),l=c.search||!j&&e.search||"",m=c.hash;return f+g+i+k+l+m},addSearchParams:function(b,c){var d=h.parseUrl(b),e=typeof c=="object"?a.param(c):c,f=d.search||"?";return d.hrefNoSearch+f+(f.charAt(f.length-1)!=="?"?"&":"")+e+(d.hash||"")},convertUrlToDataUrl:function(a){var c=h.parseUrl(a);return h.isEmbeddedPage(c)?c.hash.split(n)[0].replace(/^#/,""):h.isSameDomain(c,q)?c.hrefNoHash.replace(q.domain,"").split(n)[0]:b.decodeURIComponent(a)},get:function(a){return a===d&&(a=h.parseLocation().hash),h.stripHash(a).replace(/[^\/]*\.[^\/*]+$/,"")},getFilePath:function(b){var c="&"+a.mobile.subPageUrlKey;return b&&b.split(c)[0].split(n)[0]},set:function(a){location.hash=a},isPath:function(a){return/\//.test(a)},clean:function(a){return a.replace(q.domain,"")},stripHash:function(a){return a.replace(/^#/,"")},cleanHash:function(a){return h.stripHash(a.replace(/\?.*$/,"").replace(n,""))},isHashValid:function(a){return/^#[^#]+$/.test(a)},isExternal:function(a){var b=h.parseUrl(a);return b.protocol&&b.domain!==p.domain?!0:!1},hasProtocol:function(a){return/^(:?\w+:)/.test(a)},isFirstPageUrl:function(b){var c=h.parseUrl(h.makeUrlAbsolute(b,q)),e=c.hrefNoHash===p.hrefNoHash||r&&c.hrefNoHash===q.hrefNoHash,f=a.mobile.firstPage,g=f&&f[0]?f[0].id:d;return e&&(!c.hash||c.hash==="#"||g&&c.hash.replace(/^#/,"")===g)},isEmbeddedPage:function(a){var b=h.parseUrl(a);return b.protocol!==""?b.hash&&(b.hrefNoHash===p.hrefNoHash||r&&b.hrefNoHash===q.hrefNoHash):/^#/.test(b.href)},isPermittedCrossDomainRequest:function(b,c){return a.mobile.allowCrossDomainPages&&b.protocol==="file:"&&c.search(/^https?:/)!==-1}},i=null,j={stack:[],activeIndex:0,getActive:function(){return j.stack[j.activeIndex]},getPrev:function(){return j.stack[j.activeIndex-1]},getNext:function(
-){return j.stack[j.activeIndex+1]},addNew:function(a,b,c,d,e){j.getNext()&&j.clearForward(),j.stack.push({url:a,transition:b,title:c,pageUrl:d,role:e}),j.activeIndex=j.stack.length-1},clearForward:function(){j.stack=j.stack.slice(0,j.activeIndex+1)},directHashChange:function(b){var c,e,f,g=this.getActive();a.each(j.stack,function(a,d){decodeURIComponent(b.currentUrl)===decodeURIComponent(d.url)&&(c=a<j.activeIndex,e=!c,f=a)}),this.activeIndex=f!==d?f:this.activeIndex,c?(b.either||b.isBack)(!0):e&&(b.either||b.isForward)(!1)},ignoreNextHashChange:!1},k="[tabindex],a,button:visible,select:visible,input",l=[],m=!1,n="&ui-state=dialog",o=g.children("base"),p=h.parseLocation(),q=o.length?h.parseUrl(h.makeUrlAbsolute(o.attr("href"),p.href)):p,r=p.hrefNoHash!==q.hrefNoHash,s=a.mobile.getScreenHeight,t=a.support.dynamicBaseTag?{element:o.length?o:a("<base>",{href:q.hrefNoHash}).prependTo(g),set:function(a){t.element.attr("href",h.makeUrlAbsolute(a,q))},reset:function(){t.element.attr("href",q.hrefNoHash)}}:d;a.mobile.back=function(){var a=b.navigator;this.phonegapNavigationEnabled&&a&&a.app&&a.app.backHistory?a.app.backHistory():b.history.back()},a.mobile.focusPage=function(a){var b=a.find("[autofocus]"),c=a.find(".ui-title:eq(0)");if(b.length){b.focus();return}c.length?c.focus():a.focus()};var w=!0,x,y;x=function(){if(!w)return;var b=a.mobile.urlHistory.getActive();if(b){var c=e.scrollTop();b.lastScroll=c<a.mobile.minScrollBack?a.mobile.defaultHomeScroll:c}},y=function(){setTimeout(x,100)},e.bind(a.support.pushState?"popstate":"hashchange",function(){w=!1}),e.one(a.support.pushState?"popstate":"hashchange",function(){w=!0}),e.one("pagecontainercreate",function(){a.mobile.pageContainer.bind("pagechange",function(){w=!0,e.unbind("scrollstop",y),e.bind("scrollstop",y)})}),e.bind("scrollstop",y),a.mobile._maybeDegradeTransition=a.mobile._maybeDegradeTransition||function(a){return a},a.fn.animationComplete=function(b){return a.support.cssTransitions?a(this).one("webkitAnimationEnd animationend",b):(setTimeout(b,0),a(this))},a.mobile.path=h,a.mobile.base=t,a.mobile.urlHistory=j,a.mobile.dialogHashKey=n,a.mobile.allowCrossDomainPages=!1,a.mobile.getDocumentUrl=function(b){return b?a.extend({},p):p.href},a.mobile.getDocumentBase=function(b){return b?a.extend({},q):q.href},a.mobile._bindPageRemove=function(){var b=a(this);!b.data("page").options.domCache&&b.is(":jqmData(external-page='true')")&&b.bind("pagehide.remove",function(){var b=a(this),c=new a.Event("pageremove");b.trigger(c),c.isDefaultPrevented()||b.removeWithDependents()})},a.mobile.loadPage=function(b,c){var e=a.Deferred(),f=a.extend({},a.mobile.loadPage.defaults,c),g=null,i=null,j=function(){var b=a.mobile.activePage&&D(a.mobile.activePage);return b||q.hrefNoHash},k=h.makeUrlAbsolute(b,j());f.data&&f.type==="get"&&(k=h.addSearchParams(k,f.data),f.data=d),f.data&&f.type==="post"&&(f.reloadPage=!0);var l=h.getFilePath(k),m=h.convertUrlToDataUrl(k);f.pageContainer=f.pageContainer||a.mobile.pageContainer,g=f.pageContainer.children("[data-"+a.mobile.ns+"url='"+m+"']"),g.length===0&&m&&!h.isPath(m)&&(g=f.pageContainer.children("#"+m).attr("data-"+a.mobile.ns+"url",m).jqmData("url",m));if(g.length===0)if(a.mobile.firstPage&&h.isFirstPageUrl(l))a.mobile.firstPage.parent().length&&(g=a(a.mobile.firstPage));else if(h.isEmbeddedPage(l))return e.reject(k,c),e.promise();if(g.length){if(!f.reloadPage)return B(g,f.role),e.resolve(k,c,g),e.promise();i=g}var n=f.pageContainer,o=new a.Event("pagebeforeload"),r={url:b,absUrl:k,dataUrl:m,deferred:e,options:f};n.trigger(o,r);if(o.isDefaultPrevented())return e.promise();if(f.showLoadMsg)var s=setTimeout(function(){a.mobile.showPageLoadingMsg()},f.loadMsgDelay),u=function(){clearTimeout(s),a.mobile.hidePageLoadingMsg()};return t&&t.reset(),!a.mobile.allowCrossDomainPages&&!h.isSameDomain(p,k)?e.reject(k,c):a.ajax({url:l,type:f.type,data:f.data,dataType:"html",success:function(d,j,n){var o=a("<div></div>"),p=d.match(/<title[^>]*>([^<]*)/)&&RegExp.$1,q=new RegExp("(<[^>]+\\bdata-"+a.mobile.ns+"role=[\"']?page[\"']?[^>]*>)"),s=new RegExp("\\bdata-"+a.mobile.ns+"url=[\"']?([^\"'>]*)[\"']?");q.test(d)&&RegExp.$1&&s.test(RegExp.$1)&&RegExp.$1&&(b=l=h.getFilePath(a("<div>"+RegExp.$1+"</div>").text())),t&&t.set(l),o.get(0).innerHTML=d,g=o.find(":jqmData(role='page'), :jqmData(role='dialog')").first(),g.length||(g=a("<div data-"+a.mobile.ns+"role='page'>"+d.split(/<\/?body[^>]*>/gmi)[1]+"</div>")),p&&!g.jqmData("title")&&(~p.indexOf("&")&&(p=a("<div>"+p+"</div>").text()),g.jqmData("title",p));if(!a.support.dynamicBaseTag){var v=h.get(l);g.find("[src], link[href], a[rel='external'], :jqmData(ajax='false'), a[target]").each(function(){var b=a(this).is("[href]")?"href":a(this).is("[src]")?"src":"action",c=a(this).attr(b);c=c.replace(location.protocol+"//"+location.host+location.pathname,""),/^(\w+:|#|\/)/.test(c)||a(this).attr(b,v+c)})}g.attr("data-"+a.mobile.ns+"url",h.convertUrlToDataUrl(l)).attr("data-"+a.mobile.ns+"external-page",!0).appendTo(f.pageContainer),g.one("pagecreate",a.mobile._bindPageRemove),B(g,f.role),k.indexOf("&"+a.mobile.subPageUrlKey)>-1&&(g=f.pageContainer.children("[data-"+a.mobile.ns+"url='"+m+"']")),f.showLoadMsg&&u(),r.xhr=n,r.textStatus=j,r.page=g,f.pageContainer.trigger("pageload",r),e.resolve(k,c,g,i)},error:function(b,d,g){t&&t.set(h.get()),r.xhr=b,r.textStatus=d,r.errorThrown=g;var i=new a.Event("pageloadfailed");f.pageContainer.trigger(i,r);if(i.isDefaultPrevented())return;f.showLoadMsg&&(u(),a.mobile.showPageLoadingMsg(a.mobile.pageLoadErrorMessageTheme,a.mobile.pageLoadErrorMessage,!0),setTimeout(a.mobile.hidePageLoadingMsg,1500)),e.reject(k,c)}}),e.promise()},a.mobile.loadPage.defaults={type:"get",data:d,reloadPage:!1,role:d,showLoadMsg:!1,pageContainer:d,loadMsgDelay:50},a.mobile.changePage=function(b,e){if(m){l.unshift(arguments);return}var f=a.extend({},a.mobile.changePage.defaults,e);f.pageContainer=f.pageContainer||a.mobile.pageContainer,f.fromPage=f.fromPage||a.mobile.activePage;var g=f.pageContainer,i=new a.Event("pagebeforechange"),k={toPage:b,options:f};g.trigger(i,k);if(i.isDefaultPrevented())return;b=k.toPage,m=!0;if(typeof b=="string"){a.mobile.loadPage(b,f).done(function(b,c,d,e){m=!1,c.duplicateCachedPage=e,a.mobile.changePage(d,c)}).fail(function(a,b){m=!1,u(!0),v(),f.pageContainer.trigger("pagechangefailed",k)});return}b[0]===a.mobile.firstPage[0]&&!f.dataUrl&&(f.dataUrl=p.hrefNoHash);var o=f.fromPage,q=f.dataUrl&&h.convertUrlToDataUrl(f.dataUrl)||b.jqmData("url"),r=q,s=h.getFilePath(q),t=j.getActive(),w=j.activeIndex===0,x=0,y=c.title,A=f.role==="dialog"||b.jqmData("role")==="dialog";if(o&&o[0]===b[0]&&!f.allowSamePageTransition){m=!1,g.trigger("pagechange",k),f.fromHashChange&&j.directHashChange({currentUrl:q,isBack:function(){},isForward:function(){}});return}B(b,f.role),f.fromHashChange&&j.directHashChange({currentUrl:q,isBack:function(){x=-1},isForward:function(){x=1}});try{c.activeElement&&c.activeElement.nodeName.toLowerCase()!=="body"?a(c.activeElement).blur():a("input:focus, textarea:focus, select:focus").blur()}catch(C){}var D=!1;A&&t&&(t.url.indexOf(n)>-1&&!a.mobile.activePage.is(".ui-dialog")&&(f.changeHash=!1,D=!0),q=(t.url||"")+(D?"":n),j.activeIndex===0&&q===j.initialDst&&(q+=n)),f.changeHash!==!1&&q&&(j.ignoreNextHashChange=!0,h.set(q));var E=t?b.jqmData("title")||b.children(":jqmData(role='header')").find(".ui-title").getEncodedText():y;!!E&&y===c.title&&(y=E),b.jqmData("title")||b.jqmData("title",y),f.transition=f.transition||(x&&!w?t.transition:d)||(A?a.mobile.defaultDialogTransition:a.mobile.defaultPageTransition),x||(D&&(j.activeIndex=Math.max(0,j.activeIndex-1)),j.addNew(q,f.transition,y,r,f.role)),c.title=j.getActive().title,a.mobile.activePage=b,f.reverse=f.reverse||x<0,z(b,o,f.transition,f.reverse).done(function(c,d,e,h,i){u(),f.duplicateCachedPage&&f.duplicateCachedPage.remove(),i||a.mobile.focusPage(b),v(),g.trigger("pagechange",k)})},a.mobile.changePage.defaults={transition:d,reverse:!1,changeHash:!0,fromHashChange:!1,role:d,duplicateCachedPage:d,pageContainer:d,showLoadMsg:!0,dataUrl:d,fromPage:d,allowSamePageTransition:!1},a.mobile.navreadyDeferred=a.Deferred(),a.mobile.navreadyDeferred.done(function(){a(c).delegate("form","submit",function(b){var c=a(this);if(!a.mobile.ajaxEnabled||c.is(":jqmData(ajax='false')")||!c.jqmHijackable().length)return;var d=c.attr("method"),e=c.attr("target"),f=c.attr("action");f||(f=D(c),f===q.hrefNoHash&&(f=p.hrefNoSearch)),f=h.makeUrlAbsolute(f,D(c));if(h.isExternal(f)&&!h.isPermittedCrossDomainRequest(p,f)||e)return;a.mobile.changePage(f,{type:d&&d.length&&d.toLowerCase()||"get",data:c.serialize(),transition:c.jqmData("transition"),reverse:c.jqmData("direction")==="reverse",reloadPage:!0}),b.preventDefault()}),a(c).bind("vclick",function(b){if(b.which>1||!a.mobile.linkBindingEnabled)return;var c=C(b.target);if(!a(c).jqmHijackable().length)return;c&&h.parseUrl(c.getAttribute("href")||"#").hash!=="#"&&(u(!0),i=a(c).closest(".ui-btn").not(".ui-disabled"),i.addClass(a.mobile.activeBtnClass))}),a(c).bind("click",function(c){if(!a.mobile.linkBindingEnabled)return;var e=C(c.target),f=a(e),g;if(!e||c.which>1||!f.jqmHijackable().length)return;g=function(){b.setTimeout(function(){u(!0)},200)};if(f.is(":jqmData(rel='back')"))return a.mobile.back(),!1;var i=D(f),j=h.makeUrlAbsolute(f.attr("href")||"#",i);if(!a.mobile.ajaxEnabled&&!h.isEmbeddedPage(j)){g();return}if(j.search("#")!==-1){j=j.replace(/[^#]*#/,"");if(!j){c.preventDefault();return}h.isPath(j)?j=h.makeUrlAbsolute(j,i):j=h.makeUrlAbsolute("#"+j,p.hrefNoHash)}var k=f.is("[rel='external']")||f.is(":jqmData(ajax='false')")||f.is("[target]"),l=k||h.isExternal(j)&&!h.isPermittedCrossDomainRequest(p,j);if(l){g();return}var m=f.jqmData("transition"),n=f.jqmData("direction")==="reverse"||f.jqmData("back"),o=f.attr("data-"+a.mobile.ns+"rel")||d;a.mobile.changePage(j,{transition:m,reverse:n,role:o,link:f}),c.preventDefault()}),a(c).delegate(".ui-page","pageshow.prefetch",function(){var b=[];a(this).find("a:jqmData(prefetch)").each(function(){var c=a(this),d=c.attr("href");d&&a.inArray(d,b)===-1&&(b.push(d),a.mobile.loadPage(d,{role:c.attr("data-"+a.mobile.ns+"rel")}))})}),a.mobile._handleHashChange=function(c){var e=h.stripHash(c),f=a.mobile.urlHistory.stack.length===0?"none":d,g=new a.Event("navigate"),i={transition:f,changeHash:!1,fromHashChange:!0};0===j.stack.length&&(j.initialDst=e),a.mobile.pageContainer.trigger(g);if(g.isDefaultPrevented())return;if(!a.mobile.hashListeningEnabled||j.ignoreNextHashChange){j.ignoreNextHashChange=!1;return}if(j.stack.length>1&&e.indexOf(n)>-1&&j.initialDst!==e){if(!a.mobile.activePage.is(".ui-dialog")){j.directHashChange({currentUrl:e,isBack:function(){a.mobile.back()},isForward:function(){b.history.forward()}});return}j.directHashChange({currentUrl:e,either:function(b){var c=a.mobile.urlHistory.getActive();e=c.pageUrl,a.extend(i,{role:c.role,transition:c.transition,reverse:b})}})}e?(e=typeof e=="string"&&!h.isPath(e)?h.makeUrlAbsolute("#"+e,q):e,e===h.makeUrlAbsolute("#"+j.initialDst,q)&&j.stack.length&&j.stack[0].url!==j.initialDst.replace(n,"")&&(e=a.mobile.firstPage),a.mobile.changePage(e,i)):a.mobile.changePage(a.mobile.firstPage,i)},e.bind("hashchange",function(b,c){a.mobile._handleHashChange(h.parseLocation().hash)}),a(c).bind("pageshow",A),a(b).bind("throttledresize",A)})}(a),function(a,b){var e={},f=e,g=a(b),h=a.mobile.path.parseLocation(),i=a.Deferred(),j=a.Deferred();a(c).ready(a.proxy(j,"resolve")),a(c).one("mobileinit",a.proxy(i,"resolve")),a.extend(e,{initialFilePath:function(){return h.pathname+h.search}(),hashChangeTimeout:200,hashChangeEnableTimer:d,initialHref:h.hrefNoHash,state:function(){return{hash:a.mobile.path.parseLocation().hash||"#"+f.initialFilePath,title:c.title,initialHref:f.initialHref}},resetUIKeys:function(b){var c=a.mobile.dialogHashKey,d="&"+a.mobile.subPageUrlKey,e=b.indexOf(c);return e>-1?b=b.slice(0,e)+"#"+b.slice(e):b.indexOf(d)>-1&&(b=b.split(d).join("#"+d)),b},nextHashChangePrevented:function(b){a.mobile.urlHistory.ignoreNextHashChange=b,f.onHashChangeDisabled=b},onHashChange:function(b){if(f.onHashChangeDisabled)return;var d,e,g=a.mobile.path.parseLocation().hash,h=a.mobile.path.isPath(g),i=h?a.mobile.path.getLocation():a.mobile.getDocumentUrl();g=h?g.replace("#",""):g,e=f.state(),d=a.mobile.path.makeUrlAbsolute(g,i),h&&(d=f.resetUIKeys(d)),history.replaceState(e,c.title,d)},onPopState:function(b){var c=b.originalEvent.state,d,e,g;c&&(clearTimeout(f.hashChangeEnableTimer),f.nextHashChangePrevented(!1),a.mobile._handleHashChange(c.hash),f.nextHashChangePrevented(!0),f.hashChangeEnableTimer=setTimeout(function(){f.nextHashChangePrevented(!1)},f.hashChangeTimeout))},init:function(){g.bind("hashchange",f.onHashChange),g.bind("popstate",f.onPopState),location.hash===""&&history.replaceState(f.state(),c.title,a.mobile.path.getLocation())}}),a.when(j,i,a.mobile.navreadyDeferred).done(function(){a.mobile.pushStateEnabled&&a.support.pushState&&e.init()})}(a,this),function(a,b,c){a.mobile.transitionFallbacks.flip="fade"}(a,this),function(a,b,c){a.mobile.transitionFallbacks.flow="fade"}(a,this),function(a,b,c){a.mobile.transitionFallbacks.pop="fade"}(a,this),function(a,b,c){a.mobile.transitionHandlers.slide=a.mobile.transitionHandlers.simultaneous,a.mobile.transitionFallbacks.slide="fade"}(a,this),function(a,b,c){a.mobile.transitionFallbacks.slidedown="fade"}(a,this),function(a,b,c){a.mobile.transitionFallbacks.slidefade="fade"}(a,this),function(a,b,c){a.mobile.transitionFallbacks.slideup="fade"}(a,this),function(a,b,c){a.mobile.transitionFallbacks.turn="fade"}(a,this),function(a,b){a.mobile.page.prototype.options.degradeInputs={color:!1,date:!1,datetime:!1,"datetime-local":!1,email:!1,month:!1,number:!1,range:"number",search:"text",tel:!1,time:!1,url:!1,week:!1},a(c).bind("pagecreate create",function(b){var c=a.mobile.closestPageData(a(b.target)),d;if(!c)return;d=c.options,a(b.target).find("input").not(c.keepNativeSelector()).each(function(){var b=a(this),c=this.getAttribute("type"),e=d.degradeInputs[c]||"text";if(d.degradeInputs[c]){var f=a("<div>").html(b.clone()).html(),g=f.indexOf(" type=")>-1,h=g?/\s+type=["']?\w+['"]?/:/\/?>/,i=' type="'+e+'" data-'+a.mobile.ns+'type="'+c+'"'+(g?"":">");b.replaceWith(f.replace(h,i))}})})}(a),function(a,b,d){a.widget("mobile.dialog",a.mobile.widget,{options:{closeBtnText:"Close",overlayTheme:"a",initSelector:":jqmData(role='dialog')"},_create:function(){var b=this,c=this.element,d=a("<a href='#' data-"+a.mobile.ns+"icon='delete' data-"+a.mobile.ns+"iconpos='notext'>"+this.options.closeBtnText+"</a>"),e=a("<div/>",{role:"dialog","class":"ui-dialog-contain ui-corner-all ui-overlay-shadow"});c.addClass("ui-dialog ui-overlay-"+this.options.overlayTheme),c.wrapInner(e).children().find(":jqmData(role='header')").prepend(d).end().children(":first-child").addClass("ui-corner-top").end().children(":last-child").addClass("ui-corner-bottom"),d.bind("click",function(){b.close()}),c.bind("vclick submit",function(b){var c=a(b.target).closest(b.type==="vclick"?"a":"form"),d;c.length&&!c.jqmData("transition")&&(d=a.mobile.urlHistory.getActive()||{},c.attr("data-"+a.mobile.ns+"transition",d.transition||a.mobile.defaultDialogTransition).attr("data-"+a.mobile.ns+"direction","reverse"))}).bind("pagehide",function(b,c){a(this).find("."+a.mobile.activeBtnClass).not(".ui-slider-bg").removeClass(a.mobile.activeBtnClass)}).bind("pagebeforeshow",function(){b._isCloseable=!0,b.options.overlayTheme&&b.element.page("removeContainerBackground").page("setContainerBackground",b.options.overlayTheme)})},close:function(){var b;this._isCloseable&&(this._isCloseable=!1,a.mobile.hashListeningEnabled?a.mobile.back():(b=a.mobile.urlHistory.getPrev().url,a.mobile.path.isPath(b)||(b=a.mobile.path.makeUrlAbsolute("#"+b)),a.mobile.changePage(b,{changeHash:!1,fromHashChange:!0})))}}),a(c).delegate(a.mobile.dialog.prototype.options.initSelector,"pagecreate",function(){a.mobile.dialog.prototype.enhance(this)})}(a,this),function(a,b){a.mobile.page.prototype.options.backBtnText="Back",a.mobile.page.prototype.options.addBackBtn=!1,a.mobile.page.prototype.options.backBtnTheme=null,a.mobile.page.prototype.options.headerTheme="a",a.mobile.page.prototype.options.footerTheme="a",a.mobile.page.prototype.options.contentTheme=null,a(c).bind("pagecreate",function(b){var c=a(b.target),d=c.data("page").options,e=c.jqmData("role"),f=d.theme;a(":jqmData(role='header'), :jqmData(role='footer'), :jqmData(role='content')",c).jqmEnhanceable().each(function(){var b=a(this),g=b.jqmData("role"),h=b.jqmData("theme"),i=h||d.contentTheme||e==="dialog"&&f,j,k,l,m=c.find(".ui-footer"),n;b.addClass("ui-"+g);if(g==="header"||g==="footer"){var p=h||(g==="header"?d.headerTheme:d.footerTheme)||f;b.addClass("ui-bar-"+p).attr("role",g==="header"?"banner":"contentinfo"),g==="header"&&(j=b.children("a, button"),k=j.hasClass("ui-btn-left"),l=j.hasClass("ui-btn-right"),k=k||j.eq(0).not(".ui-btn-right").addClass("ui-btn-left").length,l=l||j.eq(1).addClass("ui-btn-right").length),d.addBackBtn&&(g==="footer"||g==="header")&&c.jqmData("url")!==a.mobile.path.stripHash(location.hash)&&!k&&(d.addBackBtn=="header"?m=c.find(".ui-header"):m=c.find(".ui-footer"),n=a("<a href='javascript:void(0);' class='ui-btn-back' data-"+a.mobile.ns+"rel='back' data-"+a.mobile.ns+"icon='header-back-btn'></a>").attr("data-"+a.mobile.ns+"theme",d.backBtnTheme||p),m.find(".ui-btn-back").length||n.prependTo(m)),b.children("h1, h2, h3, h4, h5, h6").addClass("ui-title").attr({role:"heading","aria-level":"1"})}else g==="content"&&(i&&b.addClass("ui-body-"+i),b.attr("role","main"))})})}(a),function(a,b){a.fn.fieldcontain=function(a){return this.addClass("ui-field-contain ui-body ui-br").contents().filter(function(){return this.nodeType===3&&!/\S/.test(this.nodeValue)}).remove()},a(c).bind("pagecreate create",function(b){a(":jqmData(role='fieldcontain')",b.target).jqmEnhanceable().fieldcontain()})}(a),function(a,b){a.fn.grid=function(b){return this.each(function(){var c=a(this),d=a.extend({grid:null},b),e=c.children(),f={solo:1,a:2,b:3,c:4,d:5},g=d.grid,h;if(!g)if(e.length<=5)for(var i in f)f[i]===e.length&&(g=i);else g="a",c.addClass("ui-grid-duo");h=f[g],c.addClass("ui-grid-"+g),e.filter(":nth-child("+h+"n+1)").addClass("ui-block-a"),h>1&&e.filter(":nth-child("+h+"n+2)").addClass("ui-block-b"),h>2&&e.filter(":nth-child("+h+"n+3)").addClass("ui-block-c"),h>3&&e.filter(":nth-child("+h+"n+4)").addClass("ui-block-d"),h>4&&e.filter(":nth-child("+h+"n+5)").addClass("ui-block-e")})}}(a),function(a,b){a(c).bind("pagecreate create",function(b){a(":jqmData(role='nojs')",b.target).addClass("ui-nojs")})}(a),function(a,b){function d(a){var b;while(a){b=typeof a.className=="string"&&a.className+" ";if(b&&b.indexOf("ui-btn ")>-1&&b.indexOf("ui-disabled ")<0)break;a=a.parentNode}return a}a.fn.buttonMarkup=function(d){var f=this,g=function(b,c){j.setAttribute("data-"+a.mobile.ns+b,c),i.jqmData(b,c)};d=d&&a.type(d)==="object"?d:{};for(var h=0;h<f.length;h++){var i=f.eq(h),j=i[0],k=a.extend({},a.fn.buttonMarkup.defaults,{icon:d.icon!==b?d.icon:i.jqmData("icon"),iconpos:d.iconpos!==b?d.iconpos:i.jqmData("iconpos"),theme:d.theme!==b?d.theme:i.jqmData("theme")||a.mobile.getInheritedTheme(i,a.fn.buttonMarkup.defaults.theme),inline:d.inline!==b?d.inline:i.jqmData("inline"),shadow:d.shadow!==b?d.shadow:i.jqmData("shadow"),corners:d.corners!==b?d.corners:i.jqmData("corners"),iconshadow:d.iconshadow!==b?d.iconshadow:i.jqmData("iconshadow"),mini:d.mini!==b?d.mini:i.jqmData("mini")},d),l="ui-btn-inner",m="ui-btn-text",n,o,p,q,r,s;a.each(k,g),i.jqmData("rel")==="popup"&&i.attr("href")&&(j.setAttribute("aria-haspopup",!0),j.setAttribute("aria-owns",j.getAttribute("href"))),s=a.data(j.tagName==="INPUT"||j.tagName==="BUTTON"?j.parentNode:j,"buttonElements"),s?(j=s.outer,i=a(j),p=s.inner,q=s.text,a(s.icon).remove(),s.icon=null):(p=c.createElement(k.wrapperEls),q=c.createElement(k.wrapperEls)),r=k.icon?c.createElement("span"):null,e&&!s&&e(),k.theme||(k.theme=a.mobile.getInheritedTheme(i,"c")),n="ui-btn ui-btn-up-"+k.theme,n+=k.shadow?" ui-shadow":"",n+=k.corners?" ui-btn-corner-all":"";if(i.jqmData("role")=="button"||j.tagName=="BUTTON"||j.tagName=="DIV")n+=" ui-btn-box-"+k.theme;buttonStyle=i.jqmData("style");if(buttonStyle!="circle"||a(i).text().length>0){if(buttonStyle=="nobg")n+=" ui-btn-icon-nobg",n+=" ui-btn-icon_only";else if(buttonStyle=="edit")n+=" ui-btn-edit";else if(buttonStyle=="round"||buttonStyle=="circle"&&a(i).text().length>0)n+=" ui-btn-round"}else n+=" ui-btn-corner-circle",n+=" ui-btn-icon_only";if(k.icon)if(a(i).text().length>0){switch(k.iconpos){case"right":case"left":case"top":case"bottom":m+=" ui-btn-text-padding-"+k.iconpos;break;default:m+=" ui-btn-text-padding-left"}l+=" ui-btn-hastxt"}else buttonStyle=="circle"?l+=" ui-btn-corner-circle":buttonStyle=="nobg"&&(l+=" ui-btn-icon-nobg"),n+=" ui-btn-icon_only",l+=" ui-btn-icon-only";else a(i).text().length>0?l+=" ui-btn-hastxt":buttonStyle=="circle"&&(n+=" ui-btn-round");k.mini!==b&&(n+=k.mini===!0?" ui-mini":" ui-fullsize"),k.inline!==b&&(n+=k.inline===!0?" ui-btn-inline":" ui-btn-block"),k.icon&&(k.icon="ui-icon-"+k.icon,k.iconpos=k.iconpos||"left",o="ui-icon "+k.icon,k.iconshadow&&(o+=" ui-icon-shadow")),k.iconpos&&(n+=" ui-btn-icon-"+k.iconpos,k.iconpos==="notext"&&!i.attr("title")&&i.attr("title",i.getEncodedText())),l+=k.corners?" ui-btn-corner-all":"",k.iconpos&&k.iconpos==="notext"&&!i.attr("title")&&i.attr("title",i.getEncodedText()),s&&i.removeClass(s.bcls||""),i.removeClass("ui-link").addClass(n),p.className=l,q.className=m,s||p.appendChild(q);if(r){r.className=o;if(!s||!s.icon)r.innerHTML=" ",p.appendChild(r)}while(j.firstChild&&!s)q.appendChild(j.firstChild);s||j.appendChild(p),s={bcls:n,outer:j,inner:p,text:q,icon:r},a.data(j,"buttonElements",s),a.data(p,"buttonElements",s),a.data(q,"buttonElements",s),r&&a.data(r,"buttonElements",s)}return this},a.fn.buttonMarkup.defaults={theme:"c",corners:!0,shadow:!0,iconshadow:!0,wrapperEls:"span"};var e=function(){var b=a.mobile.buttonMarkup.hoverDelay,f,g;a(c).bind({"vmousedown vmousecancel vmouseup vmouseover vmouseout focus blur scrollstart touchend touchcancel":function(c){var e,h=a(d(c.target)),i=c.originalEvent&&/^touch/.test(c.originalEvent.type),j=c.type;if(h.length){e=h.attr("data-"+a.mobile.ns+"theme");if(j==="vmousedown")i?f=setTimeout(function(){h.removeClass("ui-btn-up-"+e).addClass("ui-btn-down-"+e)},b):h.removeClass("ui-btn-up-"+e).addClass("ui-btn-down-"+e);else if(j==="vmousecancel"||j==="vmouseup"||j==="touchend"||j==="touchcancel")h.removeClass("ui-btn-down-"+e).addClass("ui-btn-up-"+e);else if(j==="vmouseover"||j==="focus")i?g=setTimeout(function(){h.removeClass("ui-btn-up-"+e).addClass("ui-btn-hover-"+e)},b):h.removeClass("ui-btn-up-"+e).addClass("ui-btn-hover-"+e);else if(j==="vmouseout"||j==="blur"||j==="scrollstart")h.removeClass("ui-btn-hover-"+e+" ui-btn-down-"+e).addClass("ui-btn-up-"+e),f&&clearTimeout(f),g&&clearTimeout(g)}},"focusin focus":function(b){a(d(b.target)).addClass(a.mobile.focusClass)},"focusout blur":function(b){a(d(b.target)).removeClass(a.mobile.focusClass)}}),e=null};a(c).bind("pagecreate create",function(b){a(":jqmData(role='button'), .ui-bar > a, .ui-header > a, .ui-footer > a, .ui-bar > :jqmData(role='controlgroup') > a",b.target).jqmEnhanceable().not("button, input, .ui-btn, :jqmData(role='none'), :jqmData(role='nojs')").buttonMarkup()})}(a),function(a,b){a.widget("mobile.collapsible",a.mobile.widget,{options:{expandCueText:" click to expand contents",collapseCueText:" click to collapse contents",collapsed:!0,heading:"h1,h2,h3,h4,h5,h6,legend",theme:null,contentTheme:null,inset:!0,mini:!1,initSelector:":jqmData(role='collapsible')"},_create:function(){var c=this.element,d=this.options,e=c.addClass("ui-collapsible"),f=c.children(d.heading).first(),g=c.jqmData("collapsed-icon")||d.collapsedIcon,h=c.jqmData("expanded-icon")||d.expandedIcon,i=e.wrapInner("<div class='ui-collapsible-content'></div>").children(".ui-collapsible-content"),j=c.closest(":jqmData(role='collapsible-set')").addClass("ui-collapsible-set");f.is("legend")&&(f=a("<div role='heading'>"+f.html()+"</div>").insertBefore(f),f.next().remove()),j.length?(d.theme||(d.theme=j.jqmData("theme")||a.mobile.getInheritedTheme(j,"c")),d.contentTheme||(d.contentTheme=j.jqmData("content-theme")),d.collapsedIcon||(d.collapsedIcon=j.jqmData("collapsed-icon")),d.expandedIcon||(d.expandedIcon=j.jqmData("expanded-icon")),d.iconPos||(d.iconPos=j.jqmData("iconpos")),j.jqmData("inset")!==b?d.inset=j.jqmData("inset"):d.inset=!0,d.mini||(d.mini=j.jqmData("mini"))):d.theme||(d.theme=a.mobile.getInheritedTheme(c,"c")),!d.inset||e.addClass("ui-collapsible-inset"),i.addClass(d.contentTheme?"ui-body-"+d.contentTheme:""),g=c.jqmData("collapsed-icon")||d.collapsedIcon||"plus",h=c.jqmData("expanded-icon")||d.expandedIcon||"minus",f.insertBefore(i).addClass("ui-collapsible-heading").append("<span class='ui-collapsible-heading-status'></span>").wrapInner("<a href='#' class='ui-collapsible-heading-toggle'></a>").find("a").first().buttonMarkup({shadow:!1,corners:!1,iconpos:c.jqmData("iconpos")||d.iconPos||"left",icon:g,mini:d.mini,theme:d.theme}),!d.inset||f.find("a").first().add(".ui-btn-inner",c).addClass("ui-corner-top ui-corner-bottom"),e.bind("expand collapse",function(b){if(!b.isDefaultPrevented()){var c=a(this),k=b.type==="collapse",l=d.contentTheme;b.preventDefault(),d.customEventHandler&&d.customEventHandler.call(this,k),f.toggleClass("ui-collapsible-heading-collapsed",k).find(".ui-collapsible-heading-status").text(k?d.expandCueText:d.collapseCueText).end().find(".ui-icon").toggleClass("ui-icon-"+h,!k).toggleClass("ui-icon-"+g,k||h===g).end().find("a").first().removeClass(a.mobile.activeBtnClass),c.toggleClass("ui-collapsible-collapsed",k),i.toggleClass("ui-collapsible-content-collapsed",k).attr("aria-hidden",k),l&&!!d.inset&&(!j.length||e.jqmData("collapsible-last"))&&(f.find("a").first().add(f.find(".ui-btn-inner")).toggleClass("ui-corner-bottom",k),i.toggleClass("ui-corner-bottom",!k)),i.trigger("updatelayout")}}).trigger(d.collapsed?"collapse":"expand"),f.bind("tap",function(b){f.find("a").first().addClass(a.mobile.activeBtnClass)}).bind("click",function(a){var b=f.is(".ui-collapsible-heading-collapsed")?"expand":"collapse";e.trigger(b),a.preventDefault(),a.stopPropagation()})}}),a(c).bind("pagecreate create",function(b){a.mobile.collapsible.prototype.enhanceWithin(b.target)})}(a),function(a,b){a.widget("mobile.collapsibleset",a.mobile.widget,{options:{initSelector:":jqmData(role='collapsible-set')"},_create:function(){var c=this.element.addClass("ui-collapsible-set"),d=this.options;d.theme||(d.theme=a.mobile.getInheritedTheme(c,"c")),d.contentTheme||(d.contentTheme=c.jqmData("content-theme")),c.jqmData("inset")!==b&&(d.inset=c.jqmData("inset")),d.inset=d.inset!==b?d.inset:!0,c.jqmData("collapsiblebound")||c.jqmData("collapsiblebound",!0).bind("expand collapse",function(b){var c=b.type==="collapse",e=a(b.target).closest(".ui-collapsible"),f=e.data("collapsible");e.jqmData("collapsible-last")&&!!d.inset&&(e.find(".ui-collapsible-heading").first().find("a").first().toggleClass("ui-corner-bottom",c).find(".ui-btn-inner").toggleClass("ui-corner-bottom",c),e.find(".ui-collapsible-content").toggleClass("ui-corner-bottom",!c))}).bind("expand",function(b){var c=a(b.target).closest(".ui-collapsible");c.parent().is(":jqmData(role='collapsible-set')")&&c.siblings(".ui-collapsible").trigger("collapse")})},_init:function(){var a=this.element,b=a.children(":jqmData(role='collapsible')"),c=b.filter(":jqmData(collapsed='false')");this.refresh(),c.trigger("expand")},refresh:function(){var b=this.element,c=this.options,d=b.children(":jqmData(role='collapsible')");a.mobile.collapsible.prototype.enhance(d.not(".ui-collapsible")),!c.inset||(d.each(function(){a(this).jqmRemoveData("collapsible-last").find(".ui-collapsible-heading").find("a").first().removeClass("ui-corner-top ui-corner-bottom").find(".ui-btn-inner").removeClass("ui-corner-top ui-corner-bottom")}),d.first().find("a").first().addClass("ui-corner-top").find(".ui-btn-inner").addClass("ui-corner-top"),d.last().jqmData("collapsible-last",!0).find("a").first().addClass("ui-corner-bottom").find(".ui-btn-inner").addClass("ui-corner-bottom"))}}),a(c).bind("pagecreate create",function(b){a.mobile.collapsibleset.prototype.enhanceWithin(b.target)})}(a),function(a,b){a.widget("mobile.navbar",a.mobile.widget,{options:{iconpos:"top",grid:null,initSelector:":jqmData(role='navbar')"},_create:function(){var c=this.element,d=c.find("a"),e=d.filter(":jqmData(icon)").length?this.options.iconpos:b;c.addClass("ui-navbar ui-mini").attr("role","navigation").find("ul").jqmEnhanceable().grid({grid:this.options.grid}),d.buttonMarkup({corners:!1,shadow:!1,inline:!0,iconpos:e}),c.delegate("a","vclick",function(b){a(b.target).hasClass("ui-disabled")||(d.removeClass(a.mobile.activeBtnClass),a(this).addClass(a.mobile.activeBtnClass))}),c.closest(".ui-page").bind("pagebeforeshow",function(){d.filter(".ui-state-persist").addClass(a.mobile.activeBtnClass)})}}),a(c).bind("pagecreate create",function(b){a.mobile.navbar.prototype.enhanceWithin(b.target)})}(a),function(a,b){var d={};a.widget("mobile.listview",a.mobile.widget,{options:{theme:null,countTheme:"c",headerTheme:"b",dividerTheme:"b",splitIcon:"arrow-r",splitTheme:"b",inset:!1,initSelector:":jqmData(role='listview')"},_create:function(){var a=this,b="";b+=a.options.inset?" ui-listview-inset ui-corner-all ui-shadow ":"",a.element.addClass(function(a,c){return c+" ui-listview "+b}),a.refresh(!0)},_removeCorners:function(a,b){var c="ui-corner-top ui-corner-tr ui-corner-tl",d="ui-corner-bottom ui-corner-br ui-corner-bl";a=a.add(a.find(".ui-btn-inner, .ui-li-link-alt, .ui-li-thumb")),b==="top"?a.removeClass(c):b==="bottom"?a.removeClass(d):a.removeClass(c+" "+d)},_refreshCorners:function(a){var b,c,d,e;b=this.element.children("li"),c=a||b.filter(":visible").length===0?b.not(".ui-screen-hidden"):b.filter(":visible"),b.filter(".ui-li-last").removeClass("ui-li-last"),this.options.inset?(this._removeCorners(b),d=c.first().addClass("ui-corner-top"),d.add(d.find(".ui-btn-inner").not(".ui-li-link-alt span:first-child")).addClass("ui-corner-top").end().find(".ui-li-link-alt, .ui-li-link-alt span:first-child").addClass("ui-corner-tr").end().find(".ui-li-thumb").not(".ui-li-icon").addClass("ui-corner-tl"),e=c.last().addClass("ui-corner-bottom ui-li-last"),e.add(e.find(".ui-btn-inner")).find(".ui-li-link-alt").addClass("ui-corner-br").end().find(".ui-li-thumb").not(".ui-li-icon").addClass("ui-corner-bl")):c.last().addClass("ui-li-last"),a||this.element.trigger("updatelayout")},_findFirstElementByTagName:function(a,b,c,d){var e={};e[c]=e[d]=!0;while(a){if(e[a.nodeName])return a;a=a[b]}return null},_getChildrenByTagName:function(b,c,d){var e=[],f={};f[c]=f[d]=!0,b=b.firstChild;while(b)f[b.nodeName]&&e.push(b),b=b.nextSibling;return a(e)},_addThumbClasses:function(b){var c,d,e=b.length;for(c=0;c<e;c++)d=a(this._findFirstElementByTagName(b[c].firstChild,"nextSibling","img","IMG")),d.length&&(d.addClass("ui-li-thumb"),a(this._findFirstElementByTagName(d[0].parentNode,"parentNode","li","LI")).addClass(d.is(".ui-li-icon")?"ui-li-has-icon":"ui-li-has-thumb"))},_addCheckboxRadioClasses:function(b){var c,d,e=b.length;for(c=0;c<e;c++)d=a(b[c]).find("input"),d.attr("type")=="checkbox"?a(b[c]).addClass("ui-li-has-checkbox"):d.attr("type")=="radio"&&a(b[c]).addClass("ui-li-has-radio")},_addRightBtnClasses:function(b){var c,d,e=b.length;for(c=0;c<e;c++)d=a(b[c]).find(":jqmData(role='button')")||a(b[c]).find("input").attr("type")=="button",d.length&&(d.jqmData("style")=="circle"?a(b[c]).addClass("ui-li-has-right-circle-btn"):a(b[c]).addClass("ui-li-has-right-btn"))},refresh:function(d){this.parentPage=this.element.closest(".ui-page"),this._createSubPages();var e=this.options,f=this.element,g=this,h=f.jqmData("dividertheme")||e.dividerTheme,i=f.jqmData("splittheme"),j=f.jqmData("spliticon"),k=this._getChildrenByTagName(f[0],"li","LI"),l=!!a.nodeName(f[0],"ol"),m=!a.support.cssPseudoElement,n=f.attr("start"),o={},p,q,r,s,t,u,v,w,x,y,z,A,B,C;l&&m&&f.find(".ui-li-dec").remove(),l&&(n||n===0?m?v=parseFloat(n):(w=parseFloat(n)-1,f.css("counter-reset","listnumbering "+w)):m&&(v=1)),e.theme||(e.theme=a.mobile.getInheritedTheme(this.element,"c"));for(var D=0,E=k.length;D<E;D++){p=k.eq(D),q="ui-li";if(d||!p.hasClass("ui-li")){r=p.jqmData("theme")||e.theme,s=this._getChildrenByTagName(p[0],"a","A");var F=p.jqmData("role")==="list-divider";s.length&&!F?(z=p.jqmData("icon"),z===b&&(z=!1),p.buttonMarkup({wrapperEls:"div",shadow:!1,corners:!1,iconpos:"right",icon:s.length>1||z===!1?!1:z||"arrow-r",theme:r}),z!==!1&&s.length===1&&
-p.addClass("ui-li-has-arrow"),s.first().removeClass("ui-link").addClass("ui-link-inherit"),s.length>1&&(q+=" ui-li-has-alt",t=s.last(),u=i||t.jqmData("theme")||e.splitTheme,C=t.jqmData("icon"),t.appendTo(p).attr("title",t.getEncodedText()).addClass("ui-li-link-alt").empty().buttonMarkup({shadow:!1,corners:!1,theme:r,icon:!1,iconpos:"notext"}).find(".ui-btn-inner").append(a(c.createElement("span")).buttonMarkup({shadow:!0,corners:!0,theme:u,iconpos:"notext",icon:C||z||j||e.splitIcon})))):F?(q+=" ui-li-divider ui-bar-"+h,p.attr("role","heading"),l&&(n||n===0?m?v=parseFloat(n):(x=parseFloat(n)-1,p.css("counter-reset","listnumbering "+x)):m&&(v=1))):q+=" ui-li-static ui-btn-up-"+r}l&&m&&q.indexOf("ui-li-divider")<0&&(y=q.indexOf("ui-li-static")>0?p:p.find(".ui-link-inherit"),y.addClass("ui-li-jsnumbering").prepend("<span class='ui-li-dec'>"+v++ +". </span>")),o[q]||(o[q]=[]),o[q].push(p[0])}for(q in o)a(o[q]).addClass(q).children(".ui-btn-inner").addClass(q);f.find("h1, h2, h3, h4, h5, h6").addClass("ui-li-heading").end().find("p, dl").addClass("ui-li-desc").end().find(".ui-li-aside").each(function(){var b=a(this);b.prependTo(b.parent())}).end().find(".ui-li-count").each(function(){a(this).closest("li").addClass("ui-li-has-count")}).addClass("ui-btn-up-"+(f.jqmData("counttheme")||this.options.countTheme)+" ui-btn-corner-all"),this._addThumbClasses(k),this._addThumbClasses(f.find(".ui-link-inherit")),this._addCheckboxRadioClasses(k),this._addCheckboxRadioClasses(f.find(".ui-link-inherit")),this._addRightBtnClasses(k),this._addRightBtnClasses(f.find(".ui-link-inherit")),this._refreshCorners(d),this._trigger("afterrefresh")},_idStringEscape:function(a){return a.replace(/[^a-zA-Z0-9]/g,"-")},_createSubPages:function(){var b=this.element,c=b.closest(".ui-page"),e=c.jqmData("url"),f=e||c[0][a.expando],g=b.attr("id"),h=this.options,i="data-"+a.mobile.ns,j=this,k=c.find(":jqmData(role='footer')").jqmData("id"),l;typeof d[f]=="undefined"&&(d[f]=-1),g=g||++d[f],a(b.find("li>ul, li>ol").toArray().reverse()).each(function(c){var d=this,f=a(this),j=f.attr("id")||g+"-"+c,m=f.parent(),n=a(f.prevAll().toArray().reverse()),p=n.length?n:a("<span>"+a.trim(m.contents()[0].nodeValue)+"</span>"),q=p.first().getEncodedText(),r=(e||"")+"&"+a.mobile.subPageUrlKey+"="+j,s=f.jqmData("theme")||h.theme,t=f.jqmData("counttheme")||b.jqmData("counttheme")||h.countTheme,u,v;l=!0,u=f.detach().wrap("<div "+i+"role='page' "+i+"url='"+r+"' "+i+"theme='"+s+"' "+i+"count-theme='"+t+"'><div "+i+"role='content'></div></div>").parent().before("<div "+i+"role='header' "+i+"theme='"+h.headerTheme+"'><div class='ui-title'>"+q+"</div></div>").after(k?a("<div "+i+"role='footer' "+i+"id='"+k+"'>"):"").parent().appendTo(a.mobile.pageContainer),u.page(),v=m.find("a:first"),v.length||(v=a("<a/>").html(p||q).prependTo(m.empty())),v.attr("href","#"+r)}).listview();if(l&&c.is(":jqmData(external-page='true')")&&c.data("page").options.domCache===!1){var m=function(b,d){var f=d.nextPage,g,h=new a.Event("pageremove");d.nextPage&&(g=f.jqmData("url"),g.indexOf(e+"&"+a.mobile.subPageUrlKey)!==0&&(j.childPages().remove(),c.trigger(h),h.isDefaultPrevented()||c.removeWithDependents()))};c.unbind("pagehide.remove").bind("pagehide.remove",m)}},addItem:function(b,c){var d=a(b),e,f=this;e=f.element.children("li"),d.css({opacity:0,display:"none"}),e.length==0||e.length<=c?a(f.element).append(d):a(e.get(c)).before(d),a(f.element).trigger("create").listview("refresh"),d.css("min-height","0px"),d.slideDown("fast",function(){d.addClass("addli"),d.css({opacity:1})})},removeItem:function(b){var c,d,e=this;d=e.element.children("li");if(d.length<=0||d.length<b)return;c=a(d.get(b)),c.addClass("removeli"),c.slideUp("normal",function(){a(this).remove()})},childPages:function(){var b=this.parentPage.jqmData("url");return a(":jqmData(url^='"+b+"&"+a.mobile.subPageUrlKey+"')")}}),a(c).bind("pagecreate create",function(b){a.mobile.listview.prototype.enhanceWithin(b.target)})}(a),function(a,b){a.mobile.listview.prototype.options.autodividers=!1,a.mobile.listview.prototype.options.autodividersSelector=function(a){var b=a.text()||null;return b?(b=b.trim().slice(0,1).toUpperCase(),b):null},a(c).delegate("ul,ol","listviewcreate",function(){var b=a(this),d=b.data("listview");if(!d||!d.options.autodividers)return;var e=function(){b.find("li:jqmData(role='list-divider')").remove();var e=b.find("li"),f=null,g,h;for(var i=0;i<e.length;i++){g=e[i],h=d.options.autodividersSelector(a(g));if(h&&f!==h){var j=c.createElement("li");j.appendChild(c.createTextNode(h)),j.setAttribute("data-"+a.mobile.ns+"role","list-divider"),g.parentNode.insertBefore(j,g)}f=h}},f=function(){b.unbind("listviewafterrefresh",f),e(),d.refresh(),b.bind("listviewafterrefresh",f)};f()})}(a),function(a,b){a.widget("mobile.checkboxradio",a.mobile.widget,{options:{theme:null,initSelector:"input[type='checkbox'],input[type='radio']"},_create:function(){var d=this,e=this.element,f=function(a,b){return a.jqmData(b)||a.closest("form, fieldset").jqmData(b)},g=a(e).closest("label"),h=g.length?g:e[0].id?a(e).closest("form, fieldset, :jqmData(role='page'), :jqmData(role='dialog')").find("label").filter("[for='"+e[0].id+"']"):[],i=e[0].type,j=f(e,"mini"),k=i+"-on",l=i+"-off",m=e.parents(":jqmData(type='horizontal')").length?b:l,n=f(e,"iconpos"),o=m?"":" "+a.mobile.activeBtnClass,p="ui-"+k+o,q="ui-"+l,r="ui-icon-"+k,s="ui-icon-"+l;if(i!=="checkbox"&&i!=="radio")return;h.length==0&&(h=a("<label for='"+e[0].id+"'></label>")),a.extend(this,{label:h,inputtype:i,checkedClass:p,uncheckedClass:q,checkedicon:r,uncheckedicon:s}),this.options.theme||(this.options.theme=a.mobile.getInheritedTheme(this.element,"c")),h.buttonMarkup({theme:this.options.theme,icon:m,shadow:!1,mini:j,iconpos:n});var t=c.createElement("div");t.className="ui-"+i,e.hasClass("favorite")&&(t.className+=" favorite"),e.add(h).wrapAll(t),h.bind({vmouseover:function(b){a(this).parent().is(".ui-disabled")&&b.stopPropagation()},vclick:function(a){if(e.is(":disabled")){a.preventDefault();return}return d._cacheVals(),e.prop("checked",i==="radio"&&!0||!e.prop("checked")),e.triggerHandler("click"),d._getInputSet().not(e).prop("checked",!1),d._updateAll(),!1}}),e.bind({vmousedown:function(){d._cacheVals()},vclick:function(){var b=a(this);b.is(":checked")?(b.prop("checked",!0),d._getInputSet().not(b).prop("checked",!1)):b.prop("checked",!1),d._updateAll()},focus:function(){h.addClass(a.mobile.focusClass)},blur:function(){h.removeClass(a.mobile.focusClass)}}),this.refresh()},_cacheVals:function(){this._getInputSet().each(function(){a(this).jqmData("cacheVal",this.checked)})},_getInputSet:function(){return this.inputtype==="checkbox"?this.element:this.element.closest("form, fieldset, :jqmData(role='page'), :jqmData(role='dialog')").find("input[name='"+this.element[0].name+"'][type='"+this.inputtype+"']")},_updateAll:function(){var b=this;this._getInputSet().each(function(){var c=a(this);(this.checked||b.inputtype==="checkbox")&&c.trigger("change"),c.focus()}).checkboxradio("refresh")},refresh:function(){var a=this.element[0],b=this.label,c=b.find(".ui-icon");a.checked?(b.addClass(this.checkedClass).removeClass(this.uncheckedClass),c.addClass(this.checkedicon).removeClass(this.uncheckedicon)):(b.removeClass(this.checkedClass).addClass(this.uncheckedClass),c.removeClass(this.checkedicon).addClass(this.uncheckedicon)),a.disabled?this.disable():this.enable()},disable:function(){this.element.prop("disabled",!0).parent().addClass("ui-disabled")},enable:function(){this.element.prop("disabled",!1).parent().removeClass("ui-disabled")}}),a(c).bind("pagecreate create",function(b){a.mobile.checkboxradio.prototype.enhanceWithin(b.target,!0)})}(a),function(a,b){a.widget("mobile.button",a.mobile.widget,{options:{theme:null,icon:null,iconpos:null,corners:!0,shadow:!0,iconshadow:!0,initSelector:"button, [type='button'], [type='submit'], [type='reset']"},_create:function(){var d=this.element,e,f=this.options,g,h,i=f.inline||d.jqmData("inline"),j=f.mini||d.jqmData("mini"),k="",l;if(d[0].tagName==="A"){d.hasClass("ui-btn")||d.buttonMarkup();return}this.options.theme||(this.options.theme=a.mobile.getInheritedTheme(this.element,"c")),!~d[0].className.indexOf("ui-btn-left")||(k="ui-btn-left"),!~d[0].className.indexOf("ui-btn-right")||(k="ui-btn-right");if(d.attr("type")==="submit"||d.attr("type")==="reset")k?k+=" ui-submit":k="ui-submit";a("label[for='"+d.attr("id")+"']").addClass("ui-submit"),this.button=a("<div></div>")[d.html()?"html":"text"](d.html()||d.val()).insertBefore(d).buttonMarkup({theme:f.theme,icon:f.icon,iconpos:f.iconpos,inline:i,corners:f.corners,shadow:f.shadow,iconshadow:f.iconshadow,mini:j}).addClass(k).append(d.addClass("ui-btn-hidden")),e=this.button,g=d.attr("type"),h=d.attr("name"),g!=="button"&&g!=="reset"&&h&&d.bind("vclick",function(){l===b&&(l=a("<input>",{type:"hidden",name:d.attr("name"),value:d.attr("value")}).insertBefore(d),a(c).one("submit",function(){l.remove(),l=b}))}),d.bind({focus:function(){e.addClass(a.mobile.focusClass)},blur:function(){e.removeClass(a.mobile.focusClass)}}),this.refresh()},enable:function(){return this.element.attr("disabled",!1),this.button.removeClass("ui-disabled").attr("aria-disabled",!1),this._setOption("disabled",!1)},disable:function(){return this.element.attr("disabled",!0),this.button.addClass("ui-disabled").attr("aria-disabled",!0),this._setOption("disabled",!0)},refresh:function(){var b=this.element;b.prop("disabled")?this.disable():this.enable(),a(this.button.data("buttonElements").text)[b.html()?"html":"text"](b.html()||b.val())}}),a(c).bind("pagecreate create",function(b){a.mobile.button.prototype.enhanceWithin(b.target,!0)})}(a),function(a,b){a.fn.controlgroup=function(b){function c(a,b){a.removeClass("ui-btn-corner-all ui-corner-top ui-corner-bottom ui-corner-left ui-corner-right ui-controlgroup-last ui-shadow").eq(0).addClass(b[0]).end().last().addClass(b[1]).addClass("ui-controlgroup-last")}return this.each(function(){var d=a(this),e=a.extend({direction:d.jqmData("type")||"vertical",shadow:!1,excludeInvisible:!0,mini:d.jqmData("mini")},b),f=d.children("legend"),g=d.children(".ui-controlgroup-label"),h=d.children(".ui-controlgroup-controls"),i=e.direction==="horizontal"?["ui-corner-left","ui-corner-right"]:["ui-corner-top","ui-corner-bottom"],j=d.find("input").first().attr("type");h.length&&h.contents().unwrap(),d.wrapInner("<div class='ui-controlgroup-controls'></div>"),f.length?(a("<div role='heading' class='ui-controlgroup-label'>"+f.html()+"</div>").insertBefore(d.children(0)),f.remove()):g.length&&d.prepend(g),d.addClass("ui-corner-all ui-controlgroup ui-controlgroup-"+e.direction),c(d.find(".ui-btn"+(e.excludeInvisible?":visible":"")).not(".ui-slider-handle"),i),c(d.find(".ui-btn-inner"),i),e.shadow&&d.addClass("ui-shadow"),e.mini&&d.addClass("ui-mini")})}}(a),function(a,b){a(c).bind("pagecreate create",function(b){a(b.target).find("a").jqmEnhanceable().not(".ui-btn, .ui-link-inherit, :jqmData(role='none'), :jqmData(role='nojs')").addClass("ui-link")})}(a),function(a,d){function e(a,b,c,d){var e=d;return a<b?e=c+(a-b)/2:e=Math.min(Math.max(c,d-b/2),c+a-b),e}function f(){var c=a(b);return{x:c.scrollLeft(),y:c.scrollTop(),cx:b.innerWidth||c.width(),cy:b.innerHeight||c.height()}}a.widget("mobile.popup",a.mobile.widget,{options:{theme:null,overlayTheme:null,shadow:!0,corners:!0,transition:"pop",positionTo:"origin",tolerance:null,initSelector:":jqmData(role='popup')",closeLinkSelector:"a:jqmData(rel='back')",closeLinkEvents:"click.popup",navigateEvents:"navigate.popup",closeEvents:"navigate.popup pagebeforechange.popup",history:!1},_eatEventAndClose:function(a){return a.preventDefault(),a.stopImmediatePropagation(),this.close(),!1},_resizeScreen:function(){var a=this._ui.container.outerHeight(!0);this._ui.screen.removeAttr("style"),a>this._ui.screen.height()&&this._ui.screen.height(a)},_handleWindowKeyUp:function(b){if(this._isOpen&&b.keyCode===a.mobile.keyCode.ESCAPE)return this._eatEventAndClose(b)},_maybeRefreshTimeout:function(){var b=f();if(this._resizeData){if(b.x===this._resizeData.winCoords.x&&b.y===this._resizeData.winCoords.y&&b.cx===this._resizeData.winCoords.cx&&b.cy===this._resizeData.winCoords.cy)return!1;clearTimeout(this._resizeData.timeoutId)}return this._resizeData={timeoutId:setTimeout(a.proxy(this,"_resizeTimeout"),200),winCoords:b},!0},_resizeTimeout:function(){!this._maybeRefreshTimeout()&&this.positionTo==="window"&&(this._trigger("beforeposition"),this._ui.container.removeClass("ui-selectmenu-hidden").offset(this._placementCoords(this._desiredCoords(d,d,"window"))),this._resizeScreen(),this._resizeData=null,this._orientationchangeInProgress=!1)},_handleWindowResize:function(a){this._isOpen&&this._maybeRefreshTimeout()},_handleWindowOrientationchange:function(a){this._orientationchangeInProgress||(this._ui.container.addClass("ui-selectmenu-hidden").removeAttr("style"),this._orientationchangeInProgress=!0)},_create:function(){var c={screen:a("<div class='ui-screen-hidden ui-popup-screen'></div>"),placeholder:a("<div style='display: none;'><!-- placeholder --></div>"),container:a("<div class='ui-popup-container ui-selectmenu-hidden'></div>"),arrow:a("<div class='ui-arrow'></div>")},e=this.element.closest(".ui-page"),f=this.element.attr("id"),g=this;this.options.history=this.options.history&&a.mobile.ajaxEnabled&&a.mobile.hashListeningEnabled,e.length===0&&(e=a("body")),this.options.container=this.options.container||a.mobile.pageContainer,e.append(c.screen),c.container.insertAfter(c.screen),c.placeholder.insertAfter(this.element),f&&(c.screen.attr("id",f+"-screen"),c.container.attr("id",f+"-popup"),c.placeholder.html("<!-- placeholder for "+f+" -->")),c.container.append(this.element),c.container.append(c.arrow),this.element.addClass("ui-popup"),a.extend(this,{_page:e,_ui:c,_fallbackTransition:"",_currentTransition:!1,_prereqs:null,_isOpen:!1,_tolerance:null,_resizeData:null,_orientationchangeInProgress:!1,_globalHandlers:[{src:a(b),handler:{orientationchange:a.proxy(this,"_handleWindowOrientationchange"),resize:a.proxy(this,"_handleWindowResize"),keyup:a.proxy(this,"_handleWindowKeyUp")}}]}),a.each(this.options,function(a,b){g.options[a]=d,g._setOption(a,b,!0)}),c.screen.bind("vclick",a.proxy(this,"_eatEventAndClose")),a.each(this._globalHandlers,function(a,b){b.src.bind(b.handler)})},_applyTheme:function(a,b,c){var d=(a.attr("class")||"").split(" "),e=!0,f=null,g,h=String(b);while(d.length>0){f=d.pop(),g=(new RegExp("^ui-"+c+"-([a-z])$")).exec(f);if(g&&g.length>1){f=g[1];break}f=null}b!==f&&(a.removeClass("ui-"+c+"-"+f),b!==null&&b!=="none"&&a.addClass("ui-"+c+"-"+h))},_setTheme:function(a){this._applyTheme(this.element,a,"body")},_setOverlayTheme:function(a){this._applyTheme(this._ui.screen,a,"overlay"),this._isOpen&&this._ui.screen.addClass("in")},_setShadow:function(a){this.element.toggleClass("ui-overlay-shadow",a)},_setCorners:function(a){this.element.toggleClass("ui-corner-all",a)},_applyTransition:function(b){this._ui.container.removeClass(this._fallbackTransition),b&&b!=="none"&&(this._fallbackTransition=a.mobile._maybeDegradeTransition(b),this._ui.container.addClass(this._fallbackTransition))},_setTransition:function(a){this._currentTransition||this._applyTransition(a)},_setTolerance:function(b){var c={t:5,r:5,b:5,l:5};if(b){var d=String(b).split(",");a.each(d,function(a,b){d[a]=parseInt(b,10)});switch(d.length){case 1:isNaN(d[0])||(c.t=c.r=c.b=c.l=d[0]);break;case 2:isNaN(d[0])||(c.t=c.b=d[0]),isNaN(d[1])||(c.l=c.r=d[1]);break;case 4:isNaN(d[0])||(c.t=d[0]),isNaN(d[1])||(c.r=d[1]),isNaN(d[2])||(c.b=d[2]),isNaN(d[3])||(c.l=d[3]);break;default:}}this._tolerance=c},_setOption:function(b,c){var e,f="_set"+b.charAt(0).toUpperCase()+b.slice(1);this[f]!==d&&this[f](c),e=["initSelector","closeLinkSelector","closeLinkEvents","navigateEvents","closeEvents","history","container"],a.mobile.widget.prototype._setOption.apply(this,arguments),a.inArray(b,e)===-1&&this.element.attr("data-"+(a.mobile.ns||"")+b.replace(/([A-Z])/,"-$1").toLowerCase(),c)},_placementCoords:function(d){var g=f(),h={x:this._tolerance.l,y:g.y+this._tolerance.t,cx:g.cx-this._tolerance.l-this._tolerance.r,cy:g.cy-this._tolerance.t-this._tolerance.b},i,j,k=a(this.link).offset(),l=[],m=[0,0],n;this._ui.container.css("max-width",h.cx),i={cx:this._ui.container.outerWidth(!0),cy:this._ui.container.outerHeight(!0)},j={x:e(h.cx,i.cx,h.x,d.x),y:e(h.cy,i.cy,h.y,d.y)},j.y=Math.max(0,j.y);var o=c.documentElement,p=c.body,q=Math.max(o.clientHeight,p.scrollHeight,p.offsetHeight,o.scrollHeight,o.offsetHeight);j.y-=Math.min(j.y,Math.max(0,j.y+i.cy-q));if(this.positionTo!=="origin")return{left:j.x,top:j.y,arrowleft:0,arrowtop:0};l=[k.left,k.top,o.clientHeight-(k.top+a(this.link).height()),o.clientWidth-(k.left+a(this.link).width())],n=l.indexOf(Math.max.apply(b,l));switch(n){case 0:m=[-a(this.link).width(),0],arrow.attr("class","").addClass("ui-arrow right");break;case 1:m=[0,-(j.y+i.cy-k.top)],arrowtop=i.cy-1,arrowleft=k.left-j.x+m[0]+a(this.link).width()/2-parseInt(a(this._ui.arrow).css("border-width"))/2,a(this._ui.arrow).attr("class","").addClass("ui-arrow bottom");break;case 2:m=[0,k.top+a(this.link).height()-j.y],arrowtop=-parseInt(a(this._ui.arrow).css("border-width"))*2+1,arrowleft=k.left-j.x+m[0]+a(this.link).width()/2-parseInt(a(this._ui.arrow).css("border-width"))/2,a(this._ui.arrow).attr("class","").addClass("ui-arrow top");break;case 3:m=[i.cx<a(this.link).width()?a(this.link).width()/2+i.cx/2:a(this.link).width(),0],arrowtop=k.top-j.y+a(this.link).height()/2-parseInt(a(this._ui.arrow).css("border-width")),arrowleft=-parseInt(a(this._ui.arrow).css("border-width"))*2,a(this._ui.arrow).attr("class","").addClass("ui-arrow right")}return{left:j.x+m[0],top:j.y+m[1],arrowleft:arrowleft,arrowtop:arrowtop}},_createPrereqs:function(b,c,d){var e=this,f;f={screen:a.Deferred(),container:a.Deferred()},f.screen.then(function(){f===e._prereqs&&b()}),f.container.then(function(){f===e._prereqs&&c()}),a.when(f.screen,f.container).done(function(){f===e._prereqs&&(e._prereqs=null,d())}),e._prereqs=f},_animate:function(b){this._ui.screen.removeClass(b.classToRemove).addClass(b.screenClassToAdd),b.prereqs.screen.resolve(),b.transition&&b.transition!=="none"?(b.applyTransition&&this._applyTransition(b.transition),this._ui.container.animationComplete(a.proxy(b.prereqs.container,"resolve")).addClass(b.containerClassToAdd).removeClass(b.classToRemove)):b.prereqs.container.resolve()},_desiredCoords:function(b,c,d){var e=null,g,h=f();if(d&&d!=="origin")if(d==="window")b=h.cx/2+h.x,c=h.cy/2+h.y;else{try{e=a(d)}catch(i){e=null}e&&(e.filter(":visible"),e.length===0&&(e=null))}e&&(g=e.offset(),b=g.left+e.outerWidth()/2,c=g.top+e.outerHeight()/2);if(a.type(b)!=="number"||isNaN(b))b=h.cx/2+h.x;if(a.type(c)!=="number"||isNaN(c))c=h.cy/2+h.y;return{x:b,y:c}},_openPrereqsComplete:function(){var a=this;a._ui.container.addClass("ui-popup-active"),a._isOpen=!0,a._resizeScreen(),setTimeout(function(){a._ui.container.attr("tabindex","0").focus(),a._trigger("afteropen")})},_open:function(c){var d,e,f=function(){var a=b,c=navigator.userAgent,d=c.match(/AppleWebKit\/([0-9\.]+)/),e=!!d&&d[1],f=c.match(/Android (\d+(?:\.\d+))/),g=!!f&&f[1],h=c.indexOf("Chrome")>-1;return f!==null&&g==="4.0"&&e&&e>534.13&&!h?!0:!1}();c=c||{},e=c.transition||this.options.transition,this._trigger("beforeposition"),d=this._placementCoords(this._desiredCoords(c.x,c.y,c.positionTo||this.options.positionTo||"origin")),this._createPrereqs(a.noop,a.noop,a.proxy(this,"_openPrereqsComplete")),e?(this._currentTransition=e,this._applyTransition(e)):e=this.options.transition,this.options.theme||this._setTheme(this._page.jqmData("theme")||a.mobile.getInheritedTheme(this._page,"c")),this._ui.screen.removeClass("ui-screen-hidden"),this._ui.container.removeClass("ui-selectmenu-hidden").offset(d),this._ui.arrow.css({top:d.arrowtop,left:d.arrowleft}),this.options.overlayTheme&&f&&this.element.closest(".ui-page").addClass("ui-popup-open"),this._animate({additionalCondition:!0,transition:e,classToRemove:"",screenClassToAdd:"in",containerClassToAdd:"in",applyTransition:!1,prereqs:this._prereqs})},_closePrereqScreen:function(){this._ui.screen.removeClass("out").addClass("ui-screen-hidden")},_closePrereqContainer:function(){this._ui.container.removeClass("reverse out").addClass("ui-selectmenu-hidden").removeAttr("style")},_closePrereqsDone:function(){var b=this,c=b.options;b._ui.container.removeAttr("tabindex"),c.container.unbind(c.closeEvents),b.element.undelegate(c.closeLinkSelector,c.closeLinkEvents),a.mobile.popup.active=d,b._trigger("afterclose")},_close:function(){this._ui.container.removeClass("ui-popup-active"),this._page.removeClass("ui-popup-open"),this._isOpen=!1,this.element.find("input").blur(),this._createPrereqs(a.proxy(this,"_closePrereqScreen"),a.proxy(this,"_closePrereqContainer"),a.proxy(this,"_closePrereqsDone")),this._animate({additionalCondition:this._ui.screen.hasClass("in"),transition:this._currentTransition||this.options.transition,classToRemove:"in",screenClassToAdd:"out",containerClassToAdd:"reverse out",applyTransition:!0,prereqs:this._prereqs})},_destroy:function(){var b=this;b._close(),b._setTheme("none"),b.element.insertAfter(b._ui.placeholder).removeClass("ui-popup ui-overlay-shadow ui-corner-all"),b._ui.screen.remove(),b._ui.container.remove(),b._ui.placeholder.remove(),a.each(b._globalHandlers,function(b,c){a.each(c.handler,function(a,b){c.src.unbind(a,b)})})},_bindContainerClose:function(){var b=this;b.options.container.one(b.options.closeEvents,a.proxy(b._close,b))},open:function(b){var c=this,e=this.options,f,g,h,i,j,k;if(a.mobile.popup.active)return;a.mobile.popup.active=this,b||(b=[]),b.link?c.link=b.link:c.link=a(event.target).closest("a")[0],c.positionTo=b!=null&&b.positionTo!=null?b.positionTo:"origin",a(c.link).jqmData("position-to")!=="window"&&c.positionTo!=="window"?(a(c.element).addClass("ui-ctxpopup"),a(c._ui.container).removeClass("ui-popup-container").addClass("ui-ctxpopup-container"),c.positionTo!=="origin"?a(c._ui.arrow).hide():a(c._ui.arrow).show()):a(c._ui.arrow).hide(),!b.x&&c.positionTo==="origin"&&(b.x=a(c.link).offset().left+a(c.link).outerWidth()/2),!b.y&&c.positionTo==="origin"&&(b.y=a(c.link).offset().top+a(c.link).outerHeight()/2);if(!e.history){c._open(b),c._bindContainerClose(),c.element.delegate(e.closeLinkSelector,e.closeLinkEvents,function(a){return c._close(),!1});return}g=a.mobile.dialogHashKey,h=a.mobile.activePage,i=h.is(".ui-dialog"),f=a.mobile.urlHistory.getActive().url,j=f.indexOf(g)>-1&&!i,k=a.mobile.urlHistory;if(j){c._open(b),c._bindContainerClose();return}f.indexOf(g)===-1&&!i?f+=g:f=a.mobile.path.parseLocation().hash+g,k.activeIndex===0&&f===k.initialDst&&(f+=g),e.container.one(e.navigateEvents,function(a){a.preventDefault(),c._open(b),c._bindContainerClose()}),k.ignoreNextHashChange=i,k.addNew(f,d,d,d,"dialog"),a.mobile.path.set(f)},close:function(){if(!a.mobile.popup.active)return;this.options.history?a.mobile.back():this._close()}}),a.mobile.popup.handleLink=function(b){var c=b.closest(":jqmData(role='page')"),d=c.length===0?a("body"):c,e=a(a.mobile.path.parseUrl(b.attr("href")).hash,d[0]),f;e.data("popup")&&(f=b.offset(),e.popup("open",{x:f.left+b.outerWidth()/2,y:f.top+b.outerHeight()/2,transition:b.jqmData("transition"),positionTo:b.jqmData("position-to"),link:b})),setTimeout(function(){b.removeClass(a.mobile.activeBtnClass)},300)},a(c).bind("pagebeforechange",function(b,c){c.options.role==="popup"&&(a.mobile.popup.handleLink(c.options.link),b.preventDefault())}),a(c).bind("pagecreate create",function(b){a.mobile.popup.prototype.enhanceWithin(b.target,!0)})}(a),function(a){var b=a("meta[name=viewport]"),c=b.attr("content"),d=c+",maximum-scale=1, user-scalable=no",e=c+",maximum-scale=10, user-scalable=yes",f=/(user-scalable[\s]*=[\s]*no)|(maximum-scale[\s]*=[\s]*1)[$,\s]/.test(c);a.mobile.zoom=a.extend({},{enabled:!f,locked:!1,disable:function(c){!f&&!a.mobile.zoom.locked&&(b.attr("content",d),a.mobile.zoom.enabled=!1,a.mobile.zoom.locked=c||!1)},enable:function(c){!f&&(!a.mobile.zoom.locked||c===!0)&&(b.attr("content",e),a.mobile.zoom.enabled=!0,a.mobile.zoom.locked=!1)},restore:function(){f||(b.attr("content",c),a.mobile.zoom.enabled=!0)}})}(a),function(a,d){a.widget("mobile.textinput",a.mobile.widget,{options:{theme:null,preventFocusZoom:/iPhone|iPad|iPod/.test(navigator.platform)&&navigator.userAgent.indexOf("AppleWebKit")>-1,initSelector:"input[type='text'], input[type='number'], :jqmData(type='number'), input[type='password'], input[type='email'], input[type='url'], input[type='tel'], textarea, input[type='time'], input[type='date'], input[type='month'], input[type='week'], input[type='datetime'], input[type='datetime-local'], input[type='color'], input:not([type])",disabled:!1},_create:function(){function m(){setTimeout(function(){l.toggleClass("ui-input-clear-hidden",!e.val())},0)}var d=this,e=this.element,f=this.options,g=f.theme||a.mobile.getInheritedTheme(this.element,"c"),h=" ui-body-"+g,i=e.jqmData("mini")===!0,j=i?" ui-mini":"",k,l;a("label[for='"+e.attr("id")+"']").addClass("ui-input-text"),k=e.addClass("ui-input-text ui-body-"+g),typeof e[0].autocorrect!="undefined"&&!a.support.touchOverflow&&(e[0].setAttribute("autocorrect","off"),e[0].setAttribute("autocomplete","off")),e.focus(function(){k.addClass(a.mobile.focusClass)}).blur(function(){k.removeClass(a.mobile.focusClass)}).bind("focus",function(){f.preventFocusZoom&&a.mobile.zoom.disable(!0)}).bind("blur",function(){f.preventFocusZoom&&a.mobile.zoom.enable(!0)});if(e.is("textarea")){var n=15,o=100,p;this._keyup=function(){var a=e[0].scrollHeight,c=e[0].clientHeight;c<a&&b.innerHeight/2>a&&e.height(a+n)},e.keyup(function(){clearTimeout(p),p=setTimeout(d._keyup,o)}),this._on(a(c),{pagechange:"_keyup"}),a.trim(e.val())&&this._on(a(b),{load:"_keyup"})}e.attr("disabled")&&this.disable()},disable:function(){var a;if(!this.element.attr("disabled",!0))return;return a=this.element,a.addClass("ui-disabled"),this._setOption("disabled",!0)},enable:function(){var a;if(!this.element.attr("disabled",!1))return;return a=this.element,a.removeClass("ui-disabled"),this._setOption("disabled",!1)}}),a(c).bind("pagecreate create",function(b){a.mobile.textinput.prototype.enhanceWithin(b.target,!0)})}(a),function(a,b){a.mobile.listview.prototype.options.filter=!1,a.mobile.listview.prototype.options.filterPlaceholder="",a.mobile.listview.prototype.options.filterTheme="c";var d=function(a,b,c){return a.toString().toLowerCase().indexOf(b)===-1};a.mobile.listview.prototype.options.filterCallback=d,a(c).delegate(":jqmData(role='listview')","listviewcreate",function(){var b=a(this),c=b.data("listview");if(!c.options.filter)return;var e=a("<form>",{"class":"ui-listview-filter ui-bar-"+c.options.filterTheme,role:"search"}),f=a("<input>",{placeholder:c.options.filterPlaceholder}).attr("data-"+a.mobile.ns+"type","search").jqmData("lastval","").bind("keyup change",function(){var e=a(this),f=this.value.toLowerCase(),g=null,h=e.jqmData("lastval")+"",i=!1,j="",k,l=c.options.filterCallback!==d;c._trigger("beforefilter","beforefilter",{input:this}),e.jqmData("lastval",f),l||f.length<h.length||f.indexOf(h)!==0?g=b.children():g=b.children(":not(.ui-screen-hidden)");if(f){for(var m=g.length-1;m>=0;m--)k=a(g[m]),j=k.jqmData("filtertext")||k.text(),k.is("li:jqmData(role=list-divider)")?(k.toggleClass("ui-filter-hidequeue",!i),i=!1):c.options.filterCallback(j,f,k)?k.toggleClass("ui-filter-hidequeue",!0):i=!0;g.filter(":not(.ui-filter-hidequeue)").toggleClass("ui-screen-hidden",!1),g.filter(".ui-filter-hidequeue").toggleClass("ui-screen-hidden",!0).toggleClass("ui-filter-hidequeue",!1)}else g.toggleClass("ui-screen-hidden",!1);c._refreshCorners()}).appendTo(e).textinput();c.options.inset&&e.addClass("ui-listview-filter-inset"),e.bind("submit",function(){return!1}).insertBefore(b)})}(a),function(a,d){a.widget("mobile.slider",a.mobile.widget,{widgetEventPrefix:"slide",options:{theme:null,trackTheme:null,disabled:!1,initSelector:"input[type='range'], :jqmData(type='range'), :jqmData(role='slider')",mini:!1},_create:function(){var e=this,f=this.element,g=a.mobile.getInheritedTheme(f,"c"),h=this.options.theme||g,i=this.options.trackTheme||g,j=f[0].nodeName.toLowerCase(),k=j==="select"?"ui-slider-switch":"",l=f.attr("id"),m=a("[for='"+l+"']"),n=m.attr("id")||l+"-label",o=m.attr("id",n),p=function(){return j==="input"?parseFloat(f.val()):f[0].selectedIndex},q=j==="input"?parseFloat(f.attr("min")):0,r=j==="input"?parseFloat(f.attr("max")):f.find("option").length-1,s=b.parseFloat(f.attr("step")||1),t=this.options.inline||f.jqmData("inline")===!0?" ui-slider-inline":"",u=this.options.mini||f.jqmData("mini")?" ui-slider-mini":"",v=c.createElement("a"),w=a(v),x=c.createElement("div"),y=a(x),z=f.jqmData("highlight")!==!1&&j!=="select"?function(){var b=c.createElement("div");return b.className="ui-slider-bg "+a.mobile.activeBtnClass+" ui-btn-corner-all",a(b).prependTo(y)}():!1,A;this._type=j,v.setAttribute("href","#"),x.setAttribute("role","application"),x.className=["ui-slider ",k," ui-btn-down-",i," ui-btn-corner-all",t,u].join(""),v.className="ui-slider-handle",x.appendChild(v),a(f).find("option").length&&a(f).find("option").text()===""&&a(x).addClass("ui-toggle-switch"),w.buttonMarkup({corners:!0,theme:h,shadow:!0}).attr({role:"slider","aria-valuemin":q,"aria-valuemax":r,"aria-valuenow":p(),"aria-valuetext":p(),title:p(),"aria-labelledby":n}),a.extend(this,{slider:y,handle:w,valuebg:z,dragging:!1,beforeStart:null,userModified:!1,mouseMoved:!1});if(j==="select"){var B=c.createElement("div");B.className="ui-slider-inneroffset";for(var C=0,D=x.childNodes.length;C<D;C++)B.appendChild(x.childNodes[C]);x.appendChild(B),w.addClass("ui-slider-handle-snapping"),A=f.find("option");for(var E=0,F=A.length;E<F;E++){var G=E?"a":"b",H=E?" "+a.mobile.activeBtnClass:" ui-btn-down-"+i,I=c.createElement("div"),J=c.createElement("span");J.className=["ui-slider-label ui-slider-label-",G,H," ui-btn-corner-all"].join(""),J.setAttribute("role","img"),J.appendChild(c.createTextNode(A[E].innerHTML)),a(J).html()?a(J).html(a(J).text()):a(J).html(),a(J).prependTo(y)}e._labels=a(".ui-slider-label",y)}o.addClass("ui-slider"),f.addClass(j==="input"?"ui-slider-input":"ui-slider-switch").change(function(){e.mouseMoved||e.refresh(p(),!0)}).keyup(function(){e.refresh(p(),!0,!0)}).blur(function(){e.refresh(p(),!0)}),this._preventDocumentDrag=function(a){if(e.dragging&&!e.options.disabled)return e.mouseMoved=!0,j==="select"&&w.removeClass("ui-slider-handle-snapping"),e.refresh(a),e.userModified=e.beforeStart!==f[0].selectedIndex,!1},this._on(a(c),{vmousemove:this._preventDocumentDrag}),f.bind("vmouseup",a.proxy(e._checkedRefresh,e)),y.bind("vmousedown",function(a){return e.options.disabled?!1:(e.dragging=!0,e.userModified=!1,e.mouseMoved=!1,j==="select"&&(e.beforeStart=f[0].selectedIndex),e.refresh(a),e._trigger("start"),!1)}).bind("vclick",!1),this._sliderMouseUp=function(){if(e.dragging)return e.dragging=!1,j==="select"&&(w.addClass("ui-slider-handle-snapping"),e.mouseMoved?e.userModified?e.refresh(e.beforeStart===0?1:0):e.refresh(e.beforeStart):e.refresh(e.beforeStart===0?1:0)),e.mouseMoved=!1,e._trigger("stop"),!1},this._on(y.add(c),{vmouseup:this._sliderMouseUp}),y.insertAfter(f),j==="select"&&this.handle.bind({focus:function(){y.addClass(a.mobile.focusClass)},blur:function(){y.removeClass(a.mobile.focusClass)}}),this.handle.bind({vmousedown:function(){a(this).focus()},vclick:!1,keydown:function(b){var c=p();if(e.options.disabled)return;switch(b.keyCode){case a.mobile.keyCode.HOME:case a.mobile.keyCode.END:case a.mobile.keyCode.PAGE_UP:case a.mobile.keyCode.PAGE_DOWN:case a.mobile.keyCode.UP:case a.mobile.keyCode.RIGHT:case a.mobile.keyCode.DOWN:case a.mobile.keyCode.LEFT:b.preventDefault(),e._keySliding||(e._keySliding=!0,a(this).addClass("ui-state-active"))}switch(b.keyCode){case a.mobile.keyCode.HOME:e.refresh(q);break;case a.mobile.keyCode.END:e.refresh(r);break;case a.mobile.keyCode.PAGE_UP:case a.mobile.keyCode.UP:case a.mobile.keyCode.RIGHT:e.refresh(c+s);break;case a.mobile.keyCode.PAGE_DOWN:case a.mobile.keyCode.DOWN:case a.mobile.keyCode.LEFT:e.refresh(c-s)}},keyup:function(b){e._keySliding&&(e._keySliding=!1,a(this).removeClass("ui-state-active"))}}),this.refresh(d,d,!0)},_checkedRefresh:function(){this.value!=this._value()&&this.refresh(this._value())},_value:function(){return this._type==="input"?parseFloat(this.element.val()):this.element[0].selectedIndex},refresh:function(b,c,d){var e=!1,f;a(this.handle).parents().is(".ui-toggle-switch")&&(e=!0),(this.options.disabled||this.element.attr("disabled"))&&this.disable(),this.value=this._value();var g=this.element,h,i=g[0].nodeName.toLowerCase(),j=i==="input"?
-parseFloat(g.attr("min")):0,k=i==="input"?parseFloat(g.attr("max")):g.find("option").length-1,l=i==="input"&&parseFloat(g.attr("step"))>0?parseFloat(g.attr("step")):1;if(typeof b=="object"){var m=b,n=8;if(!this.dragging||m.pageX<this.slider.offset().left-n||m.pageX>this.slider.offset().left+this.slider.width()+n)return;h=Math.round((m.pageX-this.slider.offset().left)/this.slider.width()*100)}else b==null&&(b=i==="input"?parseFloat(g.val()||0):g[0].selectedIndex),h=(parseFloat(b)-j)/(k-j)*100;if(isNaN(h))return;h<0&&(h=0),h>100&&(h=100);var o=h/100*(k-j)+j,p=(o-j)%l,q=o-p;Math.abs(p)*2>=l&&(q+=p>0?l:-l),o=parseFloat(q.toFixed(5)),o<j&&(o=j),o>k&&(o=k),this.handle.css("left",h+"%"),this.handle.attr({"aria-valuenow":i==="input"?o:g.find("option").eq(o).attr("value"),"aria-valuetext":i==="input"?o:g.find("option").eq(o).getEncodedText(),title:i==="input"?o:g.find("option").eq(o).getEncodedText()}),e||this.valuebg&&this.valuebg.css("width",h+"%");if(e)f=a(this.handle).parents(".ui-slider"),a(this.handle).attr("aria-valuenow")==="on"?(f.children("span.ui-slider-label-a").show(),f.children("span.ui-slider-label-b").hide()):(f.children("span.ui-slider-label-b").show(),f.children("span.ui-slider-label-a").hide());else if(this._labels){var r=this.handle.width()/this.slider.width()*100,s=h&&r+(100-r)*h/100,t=h===100?0:Math.min(r+100-s,100);this._labels.each(function(){var b=a(this).is(".ui-slider-label-a");a(this).width((b?s:t)+"%")})}if(!d){var u=!1;i==="input"?(u=g.val()!==o,g.val(o)):(u=g[0].selectedIndex!==o,g[0].selectedIndex=o),!c&&u&&g.trigger("change")}},enable:function(){return this.element.attr("disabled",!1),this.slider.removeClass("ui-disabled").attr("aria-disabled",!1),this._setOption("disabled",!1)},disable:function(){return this.element.attr("disabled",!0),this.slider.addClass("ui-disabled").attr("aria-disabled",!0),this._setOption("disabled",!0)}}),a(c).bind("pagecreate create",function(b){a.mobile.slider.prototype.enhanceWithin(b.target,!0)})}(a),function(a,d){a.widget("mobile.selectmenu",a.mobile.widget,{options:{theme:null,disabled:!1,icon:"arrow-d",iconpos:"right",inline:!1,corners:!0,shadow:!0,iconshadow:!0,overlayTheme:"a",hidePlaceholderMenuItems:!0,closeText:"Close",nativeMenu:!0,preventFocusZoom:/iPhone|iPad|iPod/.test(navigator.platform)&&navigator.userAgent.indexOf("AppleWebKit")>-1,initSelector:"select:not( :jqmData(role='slider') )",mini:!1},_button:function(){return a("<div/>")},_setDisabled:function(a){return this.element.attr("disabled",a),this.button.attr("aria-disabled",a),this._setOption("disabled",a)},_focusButton:function(){var a=this;setTimeout(function(){a.button.focus()},40)},_selectOptions:function(){return this.select.find("option")},_preExtension:function(){var b="";!~this.element[0].className.indexOf("ui-btn-left")||(b=" ui-btn-left"),!~this.element[0].className.indexOf("ui-btn-right")||(b=" ui-btn-right"),this.select=this.element.wrap("<div class='ui-select"+b+"'>"),this.selectID=this.select.attr("id"),this.label=a("label[for='"+this.selectID+"']").addClass("ui-select"),this.isMultiple=this.select[0].multiple,this.options.theme||(this.options.theme=a.mobile.getInheritedTheme(this.select,"c"))},_create:function(){this._preExtension(),this._trigger("beforeCreate"),this.button=this._button();var c=this,d=this.options,e=d.inline||this.select.jqmData("inline"),f=d.mini||this.select.jqmData("mini"),g=d.icon?d.iconpos||this.select.jqmData("iconpos"):!1,h=this.select[0].selectedIndex===-1?0:this.select[0].selectedIndex,i=this.button.insertBefore(this.select).buttonMarkup({theme:d.theme,icon:d.icon,iconpos:g,inline:e,corners:d.corners,shadow:d.shadow,iconshadow:d.iconshadow,mini:f});this.setButtonText(),d.nativeMenu&&b.opera&&b.opera.version&&i.addClass("ui-select-nativeonly"),this.isMultiple&&(this.buttonCount=a("<span>").addClass("ui-li-count ui-btn-up-c ui-btn-corner-all").hide().appendTo(i.addClass("ui-li-has-count"))),(d.disabled||this.element.attr("disabled"))&&this.disable(),this.select.change(function(){c.refresh()}),this.build()},build:function(){var b=this;this.select.appendTo(b.button).bind("vmousedown",function(){b.button.addClass(a.mobile.activeBtnClass)}).bind("focus",function(){b.button.addClass(a.mobile.focusClass)}).bind("blur",function(){b.button.removeClass(a.mobile.focusClass)}).bind("focus vmouseover",function(){b.button.trigger("vmouseover")}).bind("vmousemove",function(){b.button.removeClass(a.mobile.activeBtnClass)}).bind("change blur vmouseout",function(){b.button.trigger("vmouseout").removeClass(a.mobile.activeBtnClass)}).bind("change blur",function(){b.button.removeClass("ui-btn-down-"+b.options.theme)}),b.button.bind("vmousedown",function(){b.options.preventFocusZoom&&a.mobile.zoom.disable(!0)}).bind("mouseup",function(){b.options.preventFocusZoom&&setTimeout(function(){a.mobile.zoom.enable(!0)},0)})},selected:function(){return this._selectOptions().filter(":selected")},selectedIndices:function(){var a=this;return this.selected().map(function(){return a._selectOptions().index(this)}).get()},setButtonText:function(){var b=this,d=this.selected(),e=this.placeholder,f=a(c.createElement("span"));this.button.find(".ui-btn-text").html(function(){return d.length?e=d.map(function(){return a(this).text()}).get().join(", "):e=b.placeholder,f.text(e).addClass(b.select.attr("class")).addClass(d.attr("class"))})},setButtonCount:function(){var a=this.selected();this.isMultiple&&this.buttonCount[a.length>1?"show":"hide"]().text(a.length)},refresh:function(){this.setButtonText(),this.setButtonCount()},open:a.noop,close:a.noop,disable:function(){this._setDisabled(!0),this.button.addClass("ui-disabled")},enable:function(){this._setDisabled(!1),this.button.removeClass("ui-disabled")}}),a(c).bind("pagecreate create",function(b){a.mobile.selectmenu.prototype.enhanceWithin(b.target,!0)})}(a),function(a,d){var e=function(d){var e=d.select,f=d.selectID,g=d.label,h=d.select.closest(".ui-page"),i=d._selectOptions(),j=d.isMultiple=d.select[0].multiple,k=f+"-button",l=f+"-menu",m=a("<div data-"+a.mobile.ns+"role='dialog' data-"+a.mobile.ns+"theme='"+d.options.theme+"' data-"+a.mobile.ns+"overlay-theme='"+d.options.overlayTheme+"'>"+"<div data-"+a.mobile.ns+"role='header'>"+"<div class='ui-title'>"+g.getEncodedText()+"</div>"+"</div>"+"<div data-"+a.mobile.ns+"role='content'></div>"+"</div>"),n=a("<div>",{"class":"ui-selectmenu"}).insertAfter(d.select).popup({theme:"a"}),o=a("<ul>",{"class":"ui-selectmenu-list",id:l,role:"listbox","aria-labelledby":k}).attr("data-"+a.mobile.ns+"theme",d.options.theme).appendTo(n),p=a("<div>",{"class":"ui-header ui-bar-"+d.options.theme}).prependTo(n),q=a("<h1>",{"class":"ui-title"}).appendTo(p),r,s,t;d.isMultiple&&(t=a("<a>",{text:d.options.closeText,href:"#","class":"ui-btn-left"}).attr("data-"+a.mobile.ns+"iconpos","notext").attr("data-"+a.mobile.ns+"icon","delete").appendTo(p).buttonMarkup()),a.extend(d,{select:d.select,selectID:f,buttonId:k,menuId:l,thisPage:h,menuPage:m,label:g,selectOptions:i,isMultiple:j,theme:d.options.theme,listbox:n,list:o,header:p,headerTitle:q,headerClose:t,menuPageContent:r,menuPageClose:s,placeholder:"",build:function(){var b=this;b.refresh(),b.select.attr("tabindex","-1").focus(function(){a(this).blur(),b.button.focus()}),b.button.bind("vclick keydown",function(c){if(c.type==="vclick"||c.keyCode&&(c.keyCode===a.mobile.keyCode.ENTER||c.keyCode===a.mobile.keyCode.SPACE))b.open(),c.preventDefault()}),b.list.attr("role","listbox").bind("focusin",function(b){a(b.target).attr("tabindex","0").trigger("vmouseover")}).bind("focusout",function(b){a(b.target).attr("tabindex","-1").trigger("vmouseout")}).delegate("li:not(.ui-disabled, .ui-li-divider)","click",function(c){var e=b.select[0].selectedIndex,f=b.list.find("li:not(.ui-li-divider)").index(this),g=b._selectOptions().eq(f)[0];g.selected=b.isMultiple?!g.selected:!0,b.isMultiple&&a(this).find(".ui-icon").toggleClass("ui-icon-checkbox-on",g.selected).toggleClass("ui-icon-checkbox-off",!g.selected),(b.isMultiple||e!==f)&&b.select.trigger("change"),b.isMultiple?b.list.find("li:not(.ui-li-divider)").eq(f).addClass("ui-btn-down-"+d.options.theme).find("a").first().focus():b.close(),c.preventDefault()}).keydown(function(b){var c=a(b.target),e=c.closest("li"),f,g;switch(b.keyCode){case 38:return f=e.prev().not(".ui-selectmenu-placeholder"),f.is(".ui-li-divider")&&(f=f.prev()),f.length&&(c.blur().attr("tabindex","-1"),f.addClass("ui-btn-down-"+d.options.theme).find("a").first().focus()),!1;case 40:return g=e.next(),g.is(".ui-li-divider")&&(g=g.next()),g.length&&(c.blur().attr("tabindex","-1"),g.addClass("ui-btn-down-"+d.options.theme).find("a").first().focus()),!1;case 13:case 32:return c.trigger("click"),!1}}),b.menuPage.bind("pagehide",function(){b.list.appendTo(b.listbox),b._focusButton(),a.mobile._bindPageRemove.call(b.thisPage)}),b.listbox.bind("popupafterclose",function(a){b.close()}),b.isMultiple&&b.headerClose.click(function(){if(b.menuType==="overlay")return b.close(),!1}),b.thisPage.addDependents(this.menuPage)},_isRebuildRequired:function(){var a=this.list.find("li"),b=this._selectOptions();return b.text()!==a.text()},selected:function(){return this._selectOptions().filter(":selected:not( :jqmData(placeholder='true') )")},refresh:function(b,c){var d=this,e=this.element,f=this.isMultiple,g;(b||this._isRebuildRequired())&&d._buildList(),g=this.selectedIndices(),d.setButtonText(),d.setButtonCount(),d.list.find("li:not(.ui-li-divider)").removeClass(a.mobile.activeBtnClass).attr("aria-selected",!1).each(function(b){if(a.inArray(b,g)>-1){var c=a(this);c.attr("aria-selected",!0),d.isMultiple?c.find(".ui-icon").removeClass("ui-icon-checkbox-off").addClass("ui-icon-checkbox-on"):c.is(".ui-selectmenu-placeholder")?c.next().addClass(a.mobile.activeBtnClass):c.addClass(a.mobile.activeBtnClass)}})},close:function(){if(this.options.disabled||!this.isOpen)return;var b=this;b.menuType==="page"?a.mobile.back():(b.listbox.popup("close"),b.list.appendTo(b.listbox),b._focusButton()),b.isOpen=!1},open:function(){function o(){var b=c.list.find("."+a.mobile.activeBtnClass+" a");b.length===0&&(b=c.list.find("li.ui-btn:not( :jqmData(placeholder='true') ) a")),b.first().focus().closest("li").addClass("ui-btn-down-"+d.options.theme)}if(this.options.disabled)return;var c=this,e=a(b),f=c.list.parent(),g=f.outerHeight(),h=f.outerWidth(),i=a("."+a.mobile.activePageClass),j=e.scrollTop(),k=c.button.offset().top,l=e.height(),n=e.width();c.button.addClass(a.mobile.activeBtnClass),setTimeout(function(){c.button.removeClass(a.mobile.activeBtnClass)},300),g>l-80||!a.support.scrollTop?(c.menuPage.appendTo(a.mobile.pageContainer).page(),c.menuPageContent=m.find(".ui-content"),c.menuPageClose=m.find(".ui-header a"),c.thisPage.unbind("pagehide.remove"),j===0&&k>l&&c.thisPage.one("pagehide",function(){a(this).jqmData("lastScroll",k)}),c.menuPage.one("pageshow",function(){o(),c.isOpen=!0}),c.menuType="page",c.menuPageContent.append(c.list),c.menuPage.find("div .ui-title").text(c.label.text()),a.mobile.changePage(c.menuPage,{transition:a.mobile.defaultDialogTransition})):(c.menuType="overlay",c.listbox.one("popupafteropen",o).popup("open",{x:c.button.offset().left+c.button.outerWidth()/2,y:c.button.offset().top+c.button.outerHeight()/2}),c.isOpen=!0)},_buildList:function(){var b=this,d=this.options,e=this.placeholder,f=!0,g=[],h=[],i=b.isMultiple?"checkbox-off":"false";b.list.empty().filter(".ui-listview").listview("destroy");var j=b.select.find("option"),k=j.length,l=this.select[0],m="data-"+a.mobile.ns,n=m+"option-index",o=m+"icon",p=m+"role",q=m+"placeholder",r=c.createDocumentFragment(),s=!1,t;for(var u=0;u<k;u++,s=!1){var v=j[u],w=a(v),x=v.parentNode,y=w.text(),z=c.createElement("a"),A=[];z.setAttribute("href","#"),z.appendChild(c.createTextNode(y));if(x!==l&&x.nodeName.toLowerCase()==="optgroup"){var B=x.getAttribute("label");if(B!==t){var C=c.createElement("li");C.setAttribute(p,"list-divider"),C.setAttribute("role","option"),C.setAttribute("tabindex","-1"),C.appendChild(c.createTextNode(B)),r.appendChild(C),t=B}}f&&(!v.getAttribute("value")||y.length===0||w.jqmData("placeholder"))&&(f=!1,s=!0,v.setAttribute(q,!0),d.hidePlaceholderMenuItems&&A.push("ui-selectmenu-placeholder"),e||(e=b.placeholder=y));var D=c.createElement("li");v.disabled&&(A.push("ui-disabled"),D.setAttribute("aria-disabled",!0)),D.setAttribute(n,u),D.setAttribute(o,i),s&&D.setAttribute(q,!0),D.className=A.join(" "),D.setAttribute("role","option"),z.setAttribute("tabindex","-1"),D.appendChild(z),r.appendChild(D)}b.list[0].appendChild(r),!this.isMultiple&&!e.length?this.header.hide():this.headerTitle.text(this.placeholder),b.list.listview()},_button:function(){return a("<a>",{href:"#",role:"button",id:this.buttonId,"aria-haspopup":"true","aria-owns":this.menuId})}})};a(c).bind("selectmenubeforecreate",function(b){var c=a(b.target).data("selectmenu");!c.options.nativeMenu&&c.element.parents(":jqmData(role='popup')").length===0&&e(c)})}(a),function(a,d){a.widget("mobile.fixedtoolbar",a.mobile.widget,{options:{visibleOnPageShow:!0,disablePageZoom:!0,transition:"slide",fullscreen:!1,tapToggle:!0,tapToggleBlacklist:"a, button, input, select, textarea, .ui-header-fixed, .ui-footer-fixed, .ui-popup",hideDuringFocus:"input, textarea, select",updatePagePadding:!0,trackPersistentToolbars:!0,supportBlacklist:function(){var a=b,c=navigator.userAgent,d=navigator.platform,e=c.match(/AppleWebKit\/([0-9]+)/),f=!!e&&e[1],g=c.match(/Fennec\/([0-9]+)/),h=!!g&&g[1],i=c.match(/Opera Mobi\/([0-9]+)/),j=!!i&&i[1];return(d.indexOf("iPhone")>-1||d.indexOf("iPad")>-1||d.indexOf("iPod")>-1)&&f&&f<534||a.operamini&&{}.toString.call(a.operamini)==="[object OperaMini]"||i&&j<7458||c.indexOf("Android")>-1&&f&&f<533||h&&h<6||"palmGetResource"in b&&f&&f<534||c.indexOf("MeeGo")>-1&&c.indexOf("NokiaBrowser/8.5.0")>-1?!0:!1},initSelector:":jqmData(position='dummy')"},_create:function(){var a=this,b=a.options,c=a.element,d=c.is(":jqmData(role='header')")?"header":"footer",e=c.closest(".ui-page");if(b.supportBlacklist()){a.destroy();return}c.addClass("ui-"+d+"-fixed"),b.fullscreen?(c.addClass("ui-"+d+"-fullscreen"),e.addClass("ui-page-"+d+"-fullscreen")):e.addClass("ui-page-"+d+"-fixed"),a._addTransitionClass(),a._bindPageEvents(),a._bindToggleHandlers()},_addTransitionClass:function(){var a=this.options.transition;a&&a!=="none"&&(a==="slide"&&(a=this.element.is(".ui-header")?"slidedown":"slideup"),this.element.addClass(a))},_bindPageEvents:function(){var c=this,d=c.options,e=c.element;e.closest(".ui-page").bind("pagebeforeshow",function(){d.disablePageZoom&&a.mobile.zoom.disable(!0),d.visibleOnPageShow||c.hide(!0)}).bind("webkitAnimationStart animationstart updatelayout",function(){var a=this;d.updatePagePadding&&c.updatePagePadding(a)}).bind("pageshow",function(){var e=this;c.updatePagePadding(e),d.updatePagePadding&&a(b).bind("throttledresize."+c.widgetName,function(){c.updatePagePadding(e)})}).bind("pagebeforehide",function(e,f){d.disablePageZoom&&a.mobile.zoom.enable(!0),d.updatePagePadding&&a(b).unbind("throttledresize."+c.widgetName);if(d.trackPersistentToolbars){var g=a(".ui-footer-fixed:jqmData(id)",this),h=a(".ui-header-fixed:jqmData(id)",this),i=g.length&&f.nextPage&&a(".ui-footer-fixed:jqmData(id='"+g.jqmData("id")+"')",f.nextPage)||a(),j=h.length&&f.nextPage&&a(".ui-header-fixed:jqmData(id='"+h.jqmData("id")+"')",f.nextPage)||a();if(i.length||j.length)i.add(j).appendTo(a.mobile.pageContainer),f.nextPage.one("pageshow",function(){i.add(j).appendTo(this)})}})},_visible:!0,updatePagePadding:function(b){var c=this.element,d=c.is(".ui-header");if(this.options.fullscreen)return;b=b||c.closest(".ui-page"),a(b).css("padding-"+(d?"top":"bottom"),c.outerHeight())},_useTransition:function(c){var d=a(b),e=this.element,f=d.scrollTop(),g=e.height(),h=e.closest(".ui-page").height(),i=a.mobile.getScreenHeight(),j=e.is(":jqmData(role='header')")?"header":"footer";return!c&&(this.options.transition&&this.options.transition!=="none"&&(j==="header"&&!this.options.fullscreen&&f>g||j==="footer"&&!this.options.fullscreen&&f+i<h-g)||this.options.fullscreen)},show:function(a){var b="ui-fixed-hidden",c=this.element;this._useTransition(a)?c.removeClass("out "+b).addClass("in"):c.removeClass(b),this._visible=!0},hide:function(a){var b="ui-fixed-hidden",c=this.element,d="out"+(this.options.transition==="slide"?" reverse":"");this._useTransition(a)?c.addClass(d).removeClass("in").animationComplete(function(){c.addClass(b).removeClass(d)}):c.addClass(b).removeClass(d),this._visible=!1},toggle:function(){this[this._visible?"hide":"show"]()},_bindToggleHandlers:function(){var b=this,c=b.options,d=b.element;d.closest(".ui-page").bind("vclick",function(d){c.tapToggle&&!a(d.target).closest(c.tapToggleBlacklist).length&&b.toggle()}).bind("focusin focusout",function(d){screen.width<500&&a(d.target).is(c.hideDuringFocus)&&!a(d.target).closest(".ui-header-fixed, .ui-footer-fixed").length&&b[d.type==="focusin"&&b._visible?"hide":"show"]()})},destroy:function(){this.element.removeClass("ui-header-fixed ui-footer-fixed ui-header-fullscreen ui-footer-fullscreen in out fade slidedown slideup ui-fixed-hidden"),this.element.closest(".ui-page").removeClass("ui-page-header-fixed ui-page-footer-fixed ui-page-header-fullscreen ui-page-footer-fullscreen")}}),a(c).bind("pagecreate create",function(b){a(b.target).jqmData("fullscreen")&&a(a.mobile.fixedtoolbar.prototype.options.initSelector,b.target).not(":jqmData(fullscreen)").jqmData("fullscreen",!0),a.mobile.fixedtoolbar.prototype.enhanceWithin(b.target)})}(a),function(a,b){function i(a){d=a.originalEvent,h=d.accelerationIncludingGravity,e=Math.abs(h.x),f=Math.abs(h.y),g=Math.abs(h.z),!b.orientation&&(e>7||(g>6&&f<8||g<8&&f>6)&&e>5)?c.enabled&&c.disable():c.enabled||c.enable()}if(!(/iPhone|iPad|iPod/.test(navigator.platform)&&navigator.userAgent.indexOf("AppleWebKit")>-1))return;var c=a.mobile.zoom,d,e,f,g,h;a(b).bind("orientationchange.iosorientationfix",c.enable).bind("devicemotion.iosorientationfix",i)}(a,this),function(a,b,d){function h(){e.removeClass("ui-mobile-rendering")}var e=a("html"),f=a("head"),g=a(b);a(b.document).trigger("mobileinit");if(!a.mobile.gradeA())return;a.mobile.ajaxBlacklist&&(a.mobile.ajaxEnabled=!1),e.addClass("ui-mobile ui-mobile-rendering"),setTimeout(h,5e3),a.extend(a.mobile,{addEventBlocker:function(){e.addClass("ui-blocker"),e.bind("touchstart touchend vclick mousedown mouseup click",function(){return!1})},removeEventBlocker:function(){e.removeClass("ui-blocker"),e.unbind("touchstart touchend vclick mousedown mouseup click")},initializePage:function(){var b=a(":jqmData(role='page'), :jqmData(role='dialog')"),d=a.mobile.path.parseLocation().hash.replace("#",""),e=c.getElementById(d);b.length||(b=a("body").wrapInner("<div data-"+a.mobile.ns+"role='page'></div>").children(0)),b.each(function(){var b=a(this);b.jqmData("url")||b.attr("data-"+a.mobile.ns+"url",b.attr("id")||location.pathname+location.search)}),a.mobile.firstPage=b.first(),a.mobile.pageContainer=b.first().parent().addClass("ui-mobile-viewport"),g.trigger("pagecontainercreate"),a.mobile.showPageLoadingMsg(),a.mobile.addEventBlocker(),h(),!a.mobile.hashListeningEnabled||!a.mobile.path.isHashValid(location.hash)||!a(e).is(':jqmData(role="page")')&&!a.mobile.path.isPath(d)&&d!==a.mobile.dialogHashKey?(a.mobile.path.isHashValid(location.hash)&&(a.mobile.urlHistory.initialDst=d.replace("#","")),a.mobile.changePage(a.mobile.firstPage,{transition:"none",reverse:!0,changeHash:!1,fromHashChange:!0})):g.trigger("hashchange",[!0])}}),a.mobile.navreadyDeferred.resolve(),a(function(){b.scrollTo(0,1),a.mobile.defaultHomeScroll=!a.support.scrollTop||a(b).scrollTop()===1?0:1,a.fn.controlgroup&&a(c).bind("pagecreate create",function(b){a(":jqmData(role='controlgroup')",b.target).jqmEnhanceable().controlgroup({excludeInvisible:!1})}),a.mobile.autoInitializePage&&a.mobile.initializePage(),g.load(a.mobile.silentScroll),a.support.cssPointerEvents||a(c).delegate(".ui-disabled","vclick",function(a){a.preventDefault(),a.stopImmediatePropagation()})})}(a,this)});
+*/(function(a,b,c){typeof define=="function"&&define.amd?define(["jquery"],function(d){return c(d,a,b),d.mobile}):c(a.jQuery,a,b)})(this,document,function(a,b,c,d){(function(a,b,d){var e={};a.mobile=a.extend({},{version:"1.2.0",ns:"",subPageUrlKey:"ui-page",activePageClass:"ui-page-active",activeBtnClass:"ui-btn-active",focusClass:"ui-focus",ajaxEnabled:!0,hashListeningEnabled:!0,linkBindingEnabled:!0,defaultPageTransition:"fade",maxTransitionWidth:!1,minScrollBack:250,touchOverflowEnabled:!1,defaultDialogTransition:"pop",pageLoadErrorMessage:"Error Loading Page",pageLoadErrorMessageTheme:"e",phonegapNavigationEnabled:!1,autoInitializePage:!0,pushStateEnabled:!0,ignoreContentEnabled:!1,orientationChangeEnabled:!0,buttonMarkup:{hoverDelay:200},$window:a(b),$document:a(c),getAttrFixed:function(a,b){var c=a.getAttribute(b);return c==="true"?!0:c==="false"?!1:c===null?d:c},keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91},silentScroll:function(c){a.type(c)!=="number"&&(c=a.mobile.defaultHomeScroll),a.event.special.scrollstart.enabled=!1,setTimeout(function(){b.scrollTo(0,c),a.mobile.$document.trigger("silentscroll",{x:0,y:c})},20),setTimeout(function(){a.event.special.scrollstart.enabled=!0},150)},nsNormalizeDict:e,nsNormalize:function(b){if(!b)return;return e[b]||(e[b]=a.camelCase(a.mobile.ns+b))},getInheritedTheme:function(a,b){var c=a[0],d="",e=/ui-(bar|body|overlay)-([a-z])\b/,f,g;while(c){f=c.className||"";if(f&&(g=e.exec(f))&&(d=g[2]))break;c=c.parentNode}return d||b||"a"},closestPageData:function(a){return a.closest(':jqmData(role="page"), :jqmData(role="dialog")').data("page")},enhanceable:function(a){return this.haveParents(a,"enhance")},hijackable:function(a){return this.haveParents(a,"ajax")},haveParents:function(b,c){if(!a.mobile.ignoreContentEnabled)return b;var d=b.length,e=a(),f,g,h;for(var i=0;i<d;i++){g=b.eq(i),h=!1,f=b[i];while(f){var j=f.getAttribute?f.getAttribute("data-"+a.mobile.ns+c):"";if(j==="false"){h=!0;break}f=f.parentNode}h||(e=e.add(g))}return e},getScreenHeight:function(){return b.innerHeight||a.mobile.$window.height()}},a.mobile),a.fn.jqmData=function(b,c){var e;return typeof b!="undefined"&&(b&&(b=a.mobile.nsNormalize(b)),arguments.length<2||c===d?e=this.data(b):e=this.data(b,c)),e},a.jqmData=function(b,c,d){var e;return typeof c!="undefined"&&(e=a.data(b,c?a.mobile.nsNormalize(c):c,d)),e},a.fn.jqmRemoveData=function(b){return this.removeData(a.mobile.nsNormalize(b))},a.jqmRemoveData=function(b,c){return a.removeData(b,a.mobile.nsNormalize(c))},a.fn.removeWithDependents=function(){a.removeWithDependents(this)},a.removeWithDependents=function(b){var c=a(b);(c.jqmData("dependents")||a()).remove(),c.remove()},a.fn.addDependents=function(b){a.addDependents(a(this),b)},a.addDependents=function(b,c){var d=a(b).jqmData("dependents")||a();a(b).jqmData("dependents",a.merge(d,c))},a.fn.getEncodedText=function(){return a("<div/>").text(a(this).text()).html()},a.fn.jqmEnhanceable=function(){return a.mobile.enhanceable(this)},a.fn.jqmHijackable=function(){return a.mobile.hijackable(this)};var f=a.find,g=/:jqmData\(([^)]*)\)/g;a.find=function(b,c,d,e){return b=b.replace(g,"[data-"+(a.mobile.ns||"")+"$1]"),f.call(this,b,c,d,e)},a.extend(a.find,f),a.find.matches=function(b,c){return a.find(b,null,null,c)},a.find.matchesSelector=function(b,c){return a.find(c,null,null,[b]).length>0},a.extend({creatorDict:{},delegateSelfInitWithSingleSelector:function(b,c){if(typeof b!="function")return!1;var d=b.prototype.options.initSelector,e=/:jqmData\(role='[A-z\-]+'\)$/;if(e.test(d)){var f=d.indexOf("'")+1,g=d.lastIndexOf("'"),h=d.substring(f,g);if(!a.creatorDict.hasOwnProperty(h))return a.creatorDict[h]={},a.creatorDict[h].target=b,c===!0&&(a.creatorDict[h].useKeepNative=c),!0}return!1}}),a(c).bind("pagecreate create",function(b){var c="*[data-"+a.mobile.ns+"role]";a(c,b.target).each(function(){dataRoleValue=this.getAttribute("data-role"),matchedObj=a.creatorDict[dataRoleValue],matchedObj&&matchedObj.target.prototype.enhance(this,matchedObj.useKeepNative)})})})(a,this),function(a,b){var c=0,d=Array.prototype.slice,e=a.cleanData;a.cleanData=function(b){for(var c=0,d;(d=b[c])!=null;c++)try{a(d).triggerHandler("remove")}catch(f){}e(b)},a.widget=function(b,c,d){var e,f,g,h,i=b.split(".")[0];b=b.split(".")[1],e=i+"-"+b,d||(d=c,c=a.Widget),a.expr[":"][e]=function(b){return!!a.data(b,e)},a[i]=a[i]||{},f=a[i][b],g=a[i][b]=function(a,b){if(!this._createWidget)return new g(a,b);arguments.length&&this._createWidget(a,b)},a.extend(g,f,{version:d.version,_proto:a.extend({},d),_childConstructors:[]}),h=new c,h.options=a.widget.extend({},h.options),a.each(d,function(b,e){a.isFunction(e)&&(d[b]=function(){var a=function(){return c.prototype[b].apply(this,arguments)},d=function(a){return c.prototype[b].apply(this,a)};return function(){var b=this._super,c=this._superApply,f;return this._super=a,this._superApply=d,f=e.apply(this,arguments),this._super=b,this._superApply=c,f}}())}),g.prototype=a.widget.extend(h,{widgetEventPrefix:b},d,{constructor:g,namespace:i,widgetName:b,widgetBaseClass:e,widgetFullName:e}),f?(a.each(f._childConstructors,function(b,c){var d=c.prototype;a.widget(d.namespace+"."+d.widgetName,g,c._proto)}),delete f._childConstructors):c._childConstructors.push(g),a.widget.bridge(b,g)},a.widget.extend=function(c){var e=d.call(arguments,1),f=0,g=e.length,h,i;for(;f<g;f++)for(h in e[f])i=e[f][h],e[f].hasOwnProperty(h)&&i!==b&&(c[h]=a.isPlainObject(i)?a.widget.extend({},c[h],i):i);return c},a.widget.bridge=function(c,e){var f=e.prototype.widgetFullName;a.fn[c]=function(g){var h=typeof g=="string",i=d.call(arguments,1),j=this;return g=!h&&i.length?a.widget.extend.apply(null,[g].concat(i)):g,h?this.each(function(){var d,e=a.data(this,f);if(!e)return a.error("cannot call methods on "+c+" prior to initialization; "+"attempted to call method '"+g+"'");if(!a.isFunction(e[g])||g.charAt(0)==="_")return a.error("no such method '"+g+"' for "+c+" widget instance");d=e[g].apply(e,i);if(d!==e&&d!==b)return j=d&&d.jquery?j.pushStack(d.get()):d,!1}):this.each(function(){var b=a.data(this,f);b?b.option(g||{})._init():new e(g,this)}),j}},a.Widget=function(a,b){},a.Widget._childConstructors=[],a.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(b,d){d=a(d||this.defaultElement||this)[0],this.element=a(d),this.uuid=c++,this.eventNamespace="."+this.widgetName+this.uuid,this.options=a.widget.extend({},this.options,this._getCreateOptions(),b),this.bindings=a(),this.hoverable=a(),this.focusable=a(),d!==this&&(a.data(d,this.widgetName,this),a.data(d,this.widgetFullName,this),this._on({remove:"destroy"}),this.document=a(d.style?d.ownerDocument:d.document||d),this.window=a(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:a.noop,_getCreateEventData:a.noop,_create:a.noop,_init:a.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(a.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled "+"ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:a.noop,widget:function(){return this.element},option:function(c,d){var e=c,f,g,h;if(arguments.length===0)return a.widget.extend({},this.options);if(typeof c=="string"){e={},f=c.split("."),c=f.shift();if(f.length){g=e[c]=a.widget.extend({},this.options[c]);for(h=0;h<f.length-1;h++)g[f[h]]=g[f[h]]||{},g=g[f[h]];c=f.pop();if(d===b)return g[c]===b?null:g[c];g[c]=d}else{if(d===b)return this.options[c]===b?null:this.options[c];e[c]=d}}return this._setOptions(e),this},_setOptions:function(a){var b;for(b in a)this._setOption(b,a[b]);return this},_setOption:function(a,b){return this.options[a]=b,a==="disabled"&&(this.widget().toggleClass(this.widgetFullName+"-disabled ui-state-disabled",!!b).attr("aria-disabled",b),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_on:function(b,c){c?(b=a(b),this.bindings=this.bindings.add(b)):(c=b,b=this.element);var d=this;a.each(c,function(c,e){function f(){if(d.options.disabled===!0||a(this).hasClass("ui-state-disabled"))return;return(typeof e=="string"?d[e]:e).apply(d,arguments)}typeof e!="string"&&(f.guid=e.guid=e.guid||f.guid||a.guid++);var g=c.match(/^(\w+)\s*(.*)$/),h=g[1]+d.eventNamespace,i=g[2];i?d.widget().delegate(i,h,f):b.bind(h,f)})},_off:function(a,b){b=(b||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,a.unbind(b).undelegate(b)},_delay:function(a,b){function c(){return(typeof a=="string"?d[a]:a).apply(d,arguments)}var d=this;return setTimeout(c,b||0)},_hoverable:function(b){this.hoverable=this.hoverable.add(b),this._on(b,{mouseenter:function(b){a(b.currentTarget).addClass("ui-state-hover")},mouseleave:function(b){a(b.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(b){this.focusable=this.focusable.add(b),this._on(b,{focusin:function(b){a(b.currentTarget).addClass("ui-state-focus")},focusout:function(b){a(b.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(b,c,d){var e,f,g=this.options[b];d=d||{},c=a.Event(c),c.type=(b===this.widgetEventPrefix?b:this.widgetEventPrefix+b).toLowerCase(),c.target=this.element[0],f=c.originalEvent;if(f)for(e in f)e in c||(c[e]=f[e]);return this.element.trigger(c,d),!(a.isFunction(g)&&g.apply(this.element[0],[c].concat(d))===!1||c.isDefaultPrevented())}},a.each({show:"fadeIn",hide:"fadeOut"},function(b,c){a.Widget.prototype["_"+b]=function(d,e,f){typeof e=="string"&&(e={effect:e});var g,h=e?e===!0||typeof e=="number"?c:e.effect||c:b;e=e||{},typeof e=="number"&&(e={duration:e}),g=!a.isEmptyObject(e),e.complete=f,e.delay&&d.delay(e.delay),g&&a.effects&&(a.effects.effect[h]||a.uiBackCompat!==!1&&a.effects[h])?d[b](e):h!==b&&d[h]?d[h](e.duration,e.easing,f):d.queue(function(c){a(this)[b](),f&&f.call(d[0]),c()})}}),a.uiBackCompat!==!1&&(a.Widget.prototype._getCreateOptions=function(){return a.metadata&&a.metadata.get(this.element[0])[this.widgetName]})}(a),function(a,b){a.widget("mobile.widget",{_createWidget:function(){a.Widget.prototype._createWidget.apply(this,arguments),this._trigger("init")},_getCreateOptions:function(){var c=this.element,d={};return a.each(this.options,function(a){var e=c.jqmData(a.replace(/[A-Z]/g,function(a){return"-"+a.toLowerCase()}));e!==b&&(d[a]=e)}),d},enhanceWithin:function(b,c){this.enhance(a(this.options.initSelector,a(b)),c)},enhance:function(b,c){var d,e,f=a(b),g=this;f=a.mobile.enhanceable(f),c&&f.length&&(d=a.mobile.closestPageData(f),e=d&&d.keepNativeSelector()||"",f=f.not(e)),f[this.widgetName]()},raise:function(a){throw"Widget ["+this.widgetName+"]: "+a}})}(a),function(a,b){a.extend(a.mobile,{loadingMessageTextVisible:d,loadingMessageTheme:d,loadingMessage:d,showPageLoadingMsg:function(b,c,d){a.mobile.loading("show",b,c,d)},hidePageLoadingMsg:function(){a.mobile.loading("hide")},loading:function(){this.loaderWidget.loader.apply(this.loaderWidget,arguments)}});var c="ui-loader",e=a("html"),f=a.mobile.$window;a.widget("mobile.loader",{options:{theme:"a",textVisible:!1,html:"",text:"loading"},defaultHtml:"<div class='"+c+"'>"+"<span class='ui-icon ui-icon-loading'></span>"+"<h1></h1>"+"</div>",fakeFixLoader:function(){var b=a("."+a.mobile.activeBtnClass).first();this.element.css({top:a.support.scrollTop&&f.scrollTop()+f.height()/2||b.length&&b.offset().top||100})},checkLoaderPosition:function(){var b=this.element.offset(),c=f.scrollTop(),d=a.mobile.getScreenHeight();if(b.top<c||b.top-c>d)this.element.addClass("ui-loader-fakefix"),this.fakeFixLoader(),f.unbind("scroll",this.checkLoaderPosition).bind("scroll",this.fakeFixLoader)},resetHtml:function(){this.element.html(a(this.defaultHtml).html())},show:function(b,g,h){var i,j,k,l;this.resetHtml(),a.type(b)==="object"?(l=a.extend({},this.options,b),b=l.theme||a.mobile.loadingMessageTheme):(l=this.options,b=b||a.mobile.loadingMessageTheme||l.theme),j=g||a.mobile.loadingMessage||l.text,e.addClass("ui-loading");if(a.mobile.loadingMessage!==!1||l.html)a.mobile.loadingMessageTextVisible!==d?i=a.mobile.loadingMessageTextVisible:i=l.textVisible,this.element.attr("class",c+" ui-corner-all ui-body-"+b+" ui-loader-"+(i||g||b.text?"verbose":"default")+(l.textonly||h?" ui-loader-textonly":"")),l.html?this.element.html(l.html):this.element.find("h1").text(j),this.element.appendTo(a.mobile.pageContainer),this.checkLoaderPosition(),f.bind("scroll",a.proxy(this.checkLoaderPosition,this))},hide:function(){e.removeClass("ui-loading"),a.mobile.loadingMessage&&this.element.removeClass("ui-loader-fakefix"),a.mobile.$window.unbind("scroll",a.proxy(this.fakeFixLoader,this)),a.mobile.$window.unbind("scroll",a.proxy(this.checkLoaderPosition,this))}}),f.bind("pagecontainercreate",function(){a.mobile.loaderWidget=a.mobile.loaderWidget||a(a.mobile.loader.prototype.defaultHtml).loader()})}(a,this),function(a,b,c,d){function x(a){while(a&&typeof a.originalEvent!="undefined")a=a.originalEvent;return a}function y(b,c){var e=b.type,f,g,i,k,l,m,n,o,p;b=a.Event(b),b.type=c,f=b.originalEvent,g=a.event.props,e.search(/^(mouse|click)/)>-1&&(g=j);if(f)for(n=g.length,k;n;)k=g[--n],b[k]=f[k];e.search(/mouse(down|up)|click/)>-1&&!b.which&&(b.which=1);if(e.search(/^touch/)!==-1){i=x(f),e=i.touches,l=i.changedTouches,m=e&&e.length?e[0]:l&&l.length?l[0]:d;if(m)for(o=0,p=h.length;o<p;o++)k=h[o],b[k]=m[k]}return b}function z(b){var c={},d,f;while(b){d=a.data(b,e);for(f in d)d[f]&&(c[f]=c.hasVirtualBinding=!0);b=b.parentNode}return c}function A(b,c){var d;while(b){d=a.data(b,e);if(d&&(!c||d[c]))return b;b=b.parentNode}return null}function B(){r=!1}function C(){r=!0}function D(){v=0,p.length=0,q=!1,C()}function E(){B()}function F(){G(),l=setTimeout(function(){l=0,D()},a.vmouse.resetTimerDuration)}function G(){l&&(clearTimeout(l),l=0)}function H(b,c,d){var e;if(d&&d[b]||!d&&A(c.target,b))e=y(c,b),a(c.target).trigger(e);return e}function I(b){var c=a.data(b.target,f);if(a.support.touch===!0&&c===d)return;if(!q&&(!v||v!==c)){var e=H("v"+b.type,b);e&&(e.isDefaultPrevented()&&b.preventDefault(),e.isPropagationStopped()&&b.stopPropagation(),e.isImmediatePropagationStopped()&&b.stopImmediatePropagation())}}function J(b){var c=x(b).touches,d,e;if(c&&c.length===1){d=b.target,e=z(d);if(e.hasVirtualBinding){v=u++,a.data(d,f,v),G(),E(),o=!1;var g=x(b).touches[0];m=g.pageX,n=g.pageY,H("vmouseover",b,e),H("vmousedown",b,e)}}}function K(a){if(r)return;o||H("vmousecancel",a,z(a.target)),o=!0,F()}function L(b){if(r)return;var c=x(b).touches[0],d=o,e=a.vmouse.moveDistanceThreshold,f=z(b.target);o=o||Math.abs(c.pageX-m)>e||Math.abs(c.pageY-n)>e,o&&!d&&H("vmousecancel",b,f),H("vmousemove",b,f),F()}function M(a){if(r)return;C();var b=z(a.target),c;H("vmouseup",a,b);if(!o){var d=H("vclick",a,b);d&&d.isDefaultPrevented()&&(c=x(a).changedTouches[0],p.push({touchID:v,target:a.target,x:c.clientX,y:c.clientY}),q=!0)}H("vmouseout",a,b),o=!1,F()}function N(b){var c=a.data(b,e),d;if(c)for(d in c)if(c[d])return!0;return!1}function O(){}function P(b){var c=b.substr(1);return{setup:function(d,f){N(this)||a.data(this,e,{});var g=a.data(this,e);g[b]=!0,k[b]=(k[b]||0)+1,k[b]===1&&t.bind(c,I),a(this).bind(c,O),s&&(k.touchstart=(k.touchstart||0)+1,k.touchstart===1&&t.bind("touchstart",J).bind("touchend",M).bind("touchmove",L).bind("scroll",K))},teardown:function(d,f){--k[b],k[b]||t.unbind(c,I),s&&(--k.touchstart,k.touchstart||t.unbind("touchstart",J).unbind("touchmove",L).unbind("touchend",M).unbind("scroll",K));var g=a(this),h=a.data(this,e);h&&(h[b]=!1),g.unbind(c,O),N(this)||g.removeData(e)}}}var e="virtualMouseBindings",f="virtualTouchID",g="vmouseover vmousedown vmousemove vmouseup vclick vmouseout vmousecancel".split(" "),h="clientX clientY pageX pageY screenX screenY".split(" "),i=a.event.mouseHooks?a.event.mouseHooks.props:[],j=a.event.props.concat(i),k={},l=0,m=0,n=0,o=!1,p=[],q=!1,r=!1,s="addEventListener"in c,t=a.mobile.$document,u=1,v=0,w;a.vmouse={moveDistanceThreshold:10,clickDistanceThreshold:10,resetTimerDuration:1500};for(var Q=0;Q<g.length;Q++)a.event.special[g[Q]]=P(g[Q]);s&&c.addEventListener("click",function(b){var c=p.length,d=b.target,e,g,h,i,j,k;if(c){e=b.clientX,g=b.clientY,w=a.vmouse.clickDistanceThreshold,h=d;while(h){for(i=0;i<c;i++){j=p[i],k=0;if(h===d&&d===j.target&&Math.abs(j.x-e)<w&&Math.abs(j.y-g)<w||a.data(h,f)===j.touchID){b.preventDefault(),b.stopPropagation();return}}h=h.parentNode}}},!0)}(a,b,c),function(a,b){var d={touch:"ontouchend"in c};a.mobile=a.mobile||{},a.mobile.support=a.mobile.support||{},a.extend(a.support,d),a.extend(a.mobile.support,d)}(a),function(a,b,c){function i(b,d,e){var f=e.type;e.type=d,e.liveFired=c,a.event.handle.call(b,e),e.type=f}a.each("touchstart touchmove touchend tap taphold swipe swipeleft swiperight scrollstart scrollstop".split(" "),function(b,c){a.fn[c]=function(a){return a?this.bind(c,a):this.trigger(c)},a.attrFn&&(a.attrFn[c]=!0)});var d=a.mobile.support.touch,e="touchmove scroll",f=d?"touchstart":"mousedown",g=d?"touchend":"mouseup",h=d?"touchmove":"mousemove";a.event.special.scrollstart={enabled:!0,setup:function(){function g(a,c){d=c,i(b,d?"scrollstart":"scrollstop",a)}var b=this,c=a(b),d,f;c.bind(e,function(b){if(!a.event.special.scrollstart.enabled)return;d||g(b,!0),clearTimeout(f),f=setTimeout(function(){g(b,!1)},50)})}},a.event.special.tap={tapholdThreshold:750,setup:function(){var b=this,c=a(b);c.bind("vmousedown",function(d){function h(){clearTimeout(g)}function j(){h(),c.unbind("vclick",k).unbind("vmouseup",h),a.mobile.$document.unbind("vmousecancel",j)}function k(a){j(),e===a.target&&i(b,"tap",a)}if(d.which&&d.which!==1)return!1;var e=d.target,f=d.originalEvent,g;c.bind("vmouseup",h).bind("vclick",k),a.mobile.$document.bind("vmousecancel",j),g=setTimeout(function(){i(b,"taphold",a.Event("taphold",{target:e}))},a.event.special.tap.tapholdThreshold)})}},a.event.special.swipe={scrollSupressionThreshold:30,durationThreshold:1e3,horizontalDistanceThreshold:30,verticalDistanceThreshold:75,setup:function(){var b=this,d=a(b);d.bind(f,function(b){function j(b){if(!f)return;var c=b.originalEvent.touches?b.originalEvent.touches[0]:b;i={time:(new Date).getTime(),coords:[c.pageX,c.pageY]},Math.abs(f.coords[0]-i.coords[0])>a.event.special.swipe.scrollSupressionThreshold&&b.preventDefault()}var e=b.originalEvent.touches?b.originalEvent.touches[0]:b,f={time:(new Date).getTime(),coords:[e.pageX,e.pageY],origin:a(b.target)},i;d.bind(h,j).one(g,function(b){d.unbind(h,j),f&&i&&i.time-f.time<a.event.special.swipe.durationThreshold&&Math.abs(f.coords[0]-i.coords[0])>a.event.special.swipe.horizontalDistanceThreshold&&Math.abs(f.coords[1]-i.coords[1])<a.event.special.swipe.verticalDistanceThreshold&&f.origin.trigger("swipe").trigger(f.coords[0]>i.coords[0]?"swipeleft":"swiperight"),f=i=c})})}},a.each({scrollstop:"scrollstart",taphold:"tap",swipeleft:"swipe",swiperight:"swipe"},function(b,c){a.event.special[b]={setup:function(){a(this).bind(c,a.noop)}}})}(a,this),function(a,c){a.extend(a.support,{orientation:"orientation"in b&&"onorientationchange"in b})}(a),function(a){a.event.special.throttledresize={setup:function(){a(this).bind("resize",c)},teardown:function(){a(this).unbind("resize",c)}};var b=250,c=function(){f=(new Date).getTime(),g=f-d,g>=b?(d=f,a(this).trigger("throttledresize")):(e&&clearTimeout(e),e=setTimeout(c,b-g))},d=0,e,f,g}(a),function(a,b){function o(){var a=g();a!==h&&(h=a,d.trigger(e))}var d=a.mobile.$window,e="orientationchange",f,g,h,i,j,k={0:!0,180:!0};if(a.support.orientation){var l=b.innerWidth||a.mobile.$window.width(),m=b.innerHeight||a.mobile.$window.height(),n=50;i=l>m&&l-m>n,j=k[b.orientation];if(i&&j||!i&&!j)k={"-90":!0,90:!0}}a.event.special.orientationchange=a.extend({},a.event.special.orientationchange,{setup:function(){if(a.support.orientation&&!a.event.special.orientationchange.disabled)return!1;h=g(),d.bind("throttledresize",o)},teardown:function(){if(a.support.orientation&&!a.event.special.orientationchange.disabled)return!1;d.unbind("throttledresize",o)},add:function(a){var b=a.handler;a.handler=function(a){return a.orientation=g(),b.apply(this,arguments)}}}),a.event.special.orientationchange.orientation=g=function(){var d=!0,e=c.documentElement;return a.support.orientation?d=k[b.orientation]:d=e&&e.clientWidth/e.clientHeight<1.1,d?"portrait":"landscape"},a.fn[e]=function(a){return a?this.bind(e,a):this.trigger(e)},a.attrFn&&(a.attrFn[e]=!0)}(a,this),function(a,b){var d=a.mobile.$window,e=a("html");a.mobile.media=function(){var b={},d=a("<div id='jquery-mediatest'></div>"),f=a("<body>").append(d);return function(a){if(!(a in b)){var g=c.createElement("style"),h="@media "+a+" { #jquery-mediatest { position:absolute; } }";g.type="text/css",g.styleSheet?g.styleSheet.cssText=h:g.appendChild(c.createTextNode(h)),e.prepend(f).prepend(g),b[a]=d.css("position")==="absolute",f.add(g).remove()}return b[a]}}()}(a),function(a,d){function e(a){var b=a.charAt(0).toUpperCase()+a.substr(1),c=(a+" "+h.join(b+" ")+b).split(" ");for(var e in c)if(g[c[e]]!==d)return!0}function m(a,b,d){var e=c.createElement("div"),f=function(a){return a.charAt(0).toUpperCase()+a.substr(1)},g=function(a){return"-"+a.charAt(0).toLowerCase()+a.substr(1)+"-"},i=function(c){var d=g(c)+a+": "+b+";",h=f(c),i=h+f(a);e.setAttribute("style",d),!e.style[i]||(k=!0)},j=d?[d]:h,k;for(var l=0;l<j.length;l++)i(j[l]);return!!k}function n(){var b="transform-3d";return m("perspective","10px","moz")||a.mobile.media("(-"+h.join("-"+b+"),(-")+"-"+b+"),("+b+")")}function o(){var b=location.protocol+"//"+location.host+location.pathname+"ui-dir/",c=a("head base"),d=null,e="",g,h;return c.length?e=c.attr("href"):c=d=a("<base>",{href:b}).appendTo("head"),g=a("<a href='testurl' />").prependTo(f),h=g[0].href,c[0].href=e||location.pathname,d&&d.remove(),h.indexOf(b)===0}function p(){var a=c.createElement("x"),d=c.documentElement,e=b.getComputedStyle,f;return"pointerEvents"in a.style?(a.style.pointerEvents="auto",a.style.pointerEvents="x",d.appendChild(a),f=e&&e(a,"").pointerEvents==="auto",d.removeChild(a),!!f):!1}function q(){var a=c.createElement("div");return typeof a.getBoundingClientRect!="undefined"}var f=a("<body>").prependTo("html"),g=f[0].style,h=["Webkit","Moz","O"],i="palmGetResource"in b,j=b.opera,k=b.operamini&&{}.toString.call(b.operamini)==="[object OperaMini]",l=b.blackberry&&!e("-webkit-transform");a.extend(a.mobile,{browser:{}}),a.mobile.browser.ie=function(){var a=3,b=c.createElement("div"),d=b.all||[];do b.innerHTML="<!--[if gt IE "+ ++a+"]><br><![endif]-->";while(d[0]);return a>4?a:!a}(),a.extend(a.support,{cssTransitions:"WebKitTransitionEvent"in b||m("transition","height 100ms linear")&&!j,pushState:"pushState"in history&&"replaceState"in history,mediaquery:a.mobile.media("only all"),cssPseudoElement:!!e("content"),touchOverflow:!!e("overflowScrolling"),cssTransform3d:n(),boxShadow:!!e("boxShadow")&&!l,scrollTop:("pageXOffset"in b||"scrollTop"in c.documentElement||"scrollTop"in f[0])&&!i&&!k,dynamicBaseTag:o(),cssPointerEvents:p(),boundingRect:q()}),f.remove();var r=function(){var a=b.navigator.userAgent;return a.indexOf("Nokia")>-1&&(a.indexOf("Symbian/3")>-1||a.indexOf("Series60/5")>-1)&&a.indexOf("AppleWebKit")>-1&&a.match(/(BrowserNG|NokiaBrowser)\/7\.[0-3]/)}();a.mobile.gradeA=function(){return(a.support.mediaquery||a.mobile.browser.ie&&a.mobile.browser.ie>=7)&&(a.support.boundingRect||a.fn.jquery.match(/1\.[0-7+]\.[0-9+]?/)!==null)},a.mobile.ajaxBlacklist=b.blackberry&&!b.WebKitPoint||k||r,r&&a(function(){a("head link[rel='stylesheet']").attr("rel","alternate stylesheet").attr("rel","stylesheet")}),a.support.boxShadow||a("html").addClass("ui-mobile-nosupport-boxshadow")}(a),function(a,b){a.widget("mobile.page",a.mobile.widget,{options:{theme:"c",domCache:!1,keepNativeDefault:":jqmData(role='none'), :jqmData(role='nojs')"},_create:function(){var a=this;if(a._trigger("beforecreate")===!1)return!1;a.element.addClass("ui-page ui-body-"+a.options.theme).bind("pagebeforehide",function(){a.removeContainerBackground()}).bind("pagebeforeshow",function(){a.setContainerBackground()})},refresh:function(){a(this.element).children(".ui-content").trigger("updatelayout",["external"])},setToolbar:function(){a(this.element).trigger("pagebeforeshow")},removeContainerBackground:function(){a.mobile.pageContainer.removeClass("ui-overlay-"+a.mobile.getInheritedTheme(this.element.parent()))},setContainerBackground:function(b){this.options.theme&&a.mobile.pageContainer.addClass("ui-overlay-"+(b||this.options.theme))},addBackBtn:function(b){var c=a(".ui-page-active .ui-footer");b=="header"&&(c=a(".ui-page-active .ui-header")),backBtn=a("<a href='#' class='ui-btn-back' data-"+a.mobile.ns+"rel='back'></a>").buttonMarkup({icon:"header-back-btn",theme:"s"}),c.find(".ui-btn-back").length||backBtn.prependTo(c)},keepNativeSelector:function(){var b=this.options,c=b.keepNative&&a.trim(b.keepNative);return c&&b.keepNative!==b.keepNativeDefault?[b.keepNative,b.keepNativeDefault].join(", "):b.keepNativeDefault}})}(a),function(a,b,d){function k(a){return a=a||location.href,"#"+a.replace(/^[^#]*#?(.*)$/,"$1")}var e="hashchange",f=c,g,h=a.event.special,i=f.documentMode,j="on"+e in b&&(i===d||i>7);a.fn[e]=function(a){return a?this.bind(e,a):this.trigger(e)},a.fn[e].delay=50,h[e]=a.extend(h[e],{setup:function(){if(j)return!1;a(g.start)},teardown:function(){if(j)return!1;a(g.stop)}}),g=function(){function n(){var c=k(),d=m(h);c!==h?(l(h=c,d),a(b).trigger(e)):d!==h&&(location.href=location.href.replace(/#.*/,"")+d),g=setTimeout(n,a.fn[e].delay)}var c={},g,h=k(),i=function(a){return a},l=i,m=i;return c.start=function(){g||n()},c.stop=function(){g&&clearTimeout(g),g=d},a.browser.msie&&!j&&function(){var b,d;c.start=function(){b||(d=a.fn[e].src,d=d&&d+k(),b=a('<iframe tabindex="-1" title="empty"/>').hide().one("load",function(){d||l(k()),n()}).attr("src",d||"javascript:0").insertAfter("body")[0].contentWindow,f.onpropertychange=function(){try{event.propertyName==="title"&&(b.document.title=f.title)}catch(a){}})},c.stop=i,m=function(){return k(b.location.href)},l=function(c,d){var g=b.document,h=a.fn[e].domain;c!==d&&(g.title=f.title,g.open(),h&&g.write('<script>document.domain="'+h+'"</script>'),g.close(),b.location.hash=c)}}(),c}()}(a,this),function(a,b,c){var d=function(d){return d===c&&(d=!0),function(c,e,f,g){var h=new a.Deferred,i=e?" reverse":"",j=a.mobile.urlHistory.getActive(),k=j.lastScroll||a.mobile.defaultHomeScroll,l=a.mobile.getScreenHeight(),m=a.mobile.maxTransitionWidth!==!1&&a.mobile.$window.width()>a.mobile.maxTransitionWidth,n=!a.support.cssTransitions||m||!c||c==="none"||Math.max(a.mobile.$window.scrollTop(),k)>a.mobile.getMaxScrollForTransition(),o=" ui-page-pre-in",p=function(){a.mobile.pageContainer.toggleClass("ui-mobile-viewport-transitioning viewport-"+c)},q=function(){var c=a.mobile.$window.scrollTop();if(c===k||a.mobile.defaultHomeScroll===k&&c==0)return;a.event.special.scrollstart.enabled=!1,b.scrollTo(0,k),setTimeout(function(){a.event.special.scrollstart.enabled=!0},150)},r=function(){g.removeClass(a.mobile.activePageClass+" out in reverse "+c).height("")},s=function(){d?g.animationComplete(t):t(),g.height(l+a.mobile.$window.scrollTop()).addClass(c+" out"+i)},t=function(){g&&d&&r(),u()},u=function(){f.css("z-index",-10),f.addClass(a.mobile.activePageClass+o),a.mobile.focusPage(f),f.height(l+k),q(),f.css("z-index",""),n||f.animationComplete(v),f.removeClass(o).addClass(c+" in"+i),n&&setTimeout(v,0)},v=function(){d||g&&r(),f.removeClass("out in reverse "+c).height(""),p(),a.mobile.$window.scrollTop()!==k&&q(),h.resolve(c,e,f,g,!0)};return p(),g&&!n?s():t(),h.promise()}},e=d(),f=d(!1),g=function(){return a.mobile.getScreenHeight()*3};a.mobile.defaultTransitionHandler=e,a.mobile.transitionHandlers={"default":a.mobile.defaultTransitionHandler,sequential:e,simultaneous:f},a.mobile.transitionFallbacks={},a.mobile._maybeDegradeTransition=function(b){return b&&!a.support.cssTransform3d&&a.mobile.transitionFallbacks[b]&&(b=a.mobile.transitionFallbacks[b]),b},a.mobile.getMaxScrollForTransition=a.mobile.getMaxScrollForTransition||g}(a,this),function(a,d){function u(b){!!i&&(!i.closest("."+a.mobile.activePageClass).length||b)&&i.removeClass(a.mobile.activeBtnClass),i=null}function v(){m=!1,l.length>0&&a.mobile.changePage.apply(null,l.pop())}function z(b,c,d,e){c&&c.data("page")._trigger("beforehide",null,{nextPage:b}),b.data("page")._trigger("beforeshow",null,{prevPage:c||a("")}),a.mobile.hidePageLoadingMsg(),d=a.mobile._maybeDegradeTransition(d);var f=a.mobile.transitionHandlers[d||"default"]||a.mobile.defaultTransitionHandler,g=f(d,e,b,c);return g.done(function(){c&&c.data("page")._trigger("hide",null,{nextPage:b}),b.data("page")._trigger("show",null,{prevPage:c||a("")}),setTimeout(function(){a.mobile.removeEventBlocker()},0)}),g}function A(b,c){c&&b.attr("data-"+a.mobile.ns+"role",c),b.page()}function B(a){while(a){if(typeof a.nodeName=="string"&&a.nodeName.toLowerCase()==="a")break;a=a.parentNode}return a}function C(b){var c=a(b).closest(".ui-page").jqmData("url"),d=q.hrefNoHash;if(!c||!h.isPath(c))c=d;return h.makeUrlAbsolute(c,d)}var e=a.mobile.$window,f=a("html"),g=a("head"),h={urlParseRE:/^(((([^:\/#\?]+:)?(?:(\/\/)((?:(([^:@\/#\?]+)(?:\:([^:@\/#\?]+))?)@)?(([^:\/#\?\]\[]+|\[[^\/\]@#?]+\])(?:\:([0-9]+))?))?)?)?((\/?(?:[^\/\?#]+\/+)*)([^\?#]*)))?(\?[^#]+)?)(#.*)?/,getLocation:function(a){var b=a?this.parseUrl(a):location,c=this.parseUrl(a||location.href).hash;return c=c==="#"?"":c,b.protocol+"//"+b.host+b.pathname+b.search+c},parseLocation:function(){return this.parseUrl(this.getLocation())},parseUrl:function(b){if(a.type(b)==="object")return b;var c=h.urlParseRE.exec(b||"")||[];return{href:c[0]||"",hrefNoHash:c[1]||"",hrefNoSearch:c[2]||"",domain:c[3]||"",protocol:c[4]||"",doubleSlash:c[5]||"",authority:c[6]||"",username:c[8]||"",password:c[9]||"",host:c[10]||"",hostname:c[11]||"",port:c[12]||"",pathname:c[13]||"",directory:c[14]||"",filename:c[15]||"",search:c[16]||"",hash:c[17]||""}},makePathAbsolute:function(a,b){if(a&&a.charAt(0)==="/")return a;a=a||"",b=b?b.replace(/^\/|(\/[^\/]*|[^\/]+)$/g,""):"";var c=b?b.split("/"):[],d=a.split("/");for(var e=0;e<d.length;e++){var f=d[e];switch(f){case".":break;case"..":c.length&&c.pop();break;default:c.push(f)}}return"/"+c.join("/")},isSameDomain:function(a,b){return h.parseUrl(a).domain===h.parseUrl(b).domain},isRelativeUrl:function(a){return h.parseUrl(a).protocol===""},isAbsoluteUrl:function(a){return h.parseUrl(a).protocol!==""},makeUrlAbsolute:function(a,b){if(!h.isRelativeUrl(a))return a;b===d&&(b=q);var c=h.parseUrl(a),e=h.parseUrl(b),f=c.protocol||e.protocol,g=c.protocol?c.doubleSlash:c.doubleSlash||e.doubleSlash,i=c.authority||e.authority,j=c.pathname!=="",k=h.makePathAbsolute(c.pathname||e.filename,e.pathname),l=c.search||!j&&e.search||"",m=c.hash;return f+g+i+k+l+m},addSearchParams:function(b,c){var d=h.parseUrl(b),e=typeof c=="object"?a.param(c):c,f=d.search||"?";return d.hrefNoSearch+f+(f.charAt(f.length-1)!=="?"?"&":"")+e+(d.hash||"")},convertUrlToDataUrl:function(a){var c=h.parseUrl(a);return h.isEmbeddedPage(c)?c.hash.split(n)[0].replace(/^#/,""):h.isSameDomain(c,q)?c.hrefNoHash.replace(q.domain,"").split(n)[0]:b.decodeURIComponent(a)},get:function(a){return a===d&&(a=h.parseLocation().hash),h.stripHash(a).replace(/[^\/]*\.[^\/*]+$/,"")},getFilePath:function(b){var c="&"+a.mobile.subPageUrlKey;return b&&b.split(c)[0].split(n)[0]},set:function(a){location.hash=a},isPath:function(a){return/\//.test(a)},clean:function(a){return a.replace(q.domain,"")},stripHash:function(a){return a.replace(/^#/,"")},cleanHash:function(a){return h.stripHash(a.replace(/\?.*$/,"").replace(n,""))},isHashValid:function(a){return/^#[^#]+$/.test(a)},isExternal:function(a){var b=h.parseUrl(a);return b
+.protocol&&b.domain!==p.domain?!0:!1},hasProtocol:function(a){return/^(:?\w+:)/.test(a)},isFirstPageUrl:function(b){var c=h.parseUrl(h.makeUrlAbsolute(b,q)),e=c.hrefNoHash===p.hrefNoHash||r&&c.hrefNoHash===q.hrefNoHash,f=a.mobile.firstPage,g=f&&f[0]?f[0].id:d;return e&&(!c.hash||c.hash==="#"||g&&c.hash.replace(/^#/,"")===g)},isEmbeddedPage:function(a){var b=h.parseUrl(a);return b.protocol!==""?b.hash&&(b.hrefNoHash===p.hrefNoHash||r&&b.hrefNoHash===q.hrefNoHash):/^#/.test(b.href)},isPermittedCrossDomainRequest:function(b,c){return a.mobile.allowCrossDomainPages&&b.protocol==="file:"&&c.search(/^https?:/)!==-1}},i=null,j={stack:[],activeIndex:0,getActive:function(){return j.stack[j.activeIndex]},getPrev:function(){return j.stack[j.activeIndex-1]},getNext:function(){return j.stack[j.activeIndex+1]},addNew:function(a,b,c,d,e){j.getNext()&&j.clearForward(),j.stack.push({url:a,transition:b,title:c,pageUrl:d,role:e}),j.activeIndex=j.stack.length-1},clearForward:function(){j.stack=j.stack.slice(0,j.activeIndex+1)},directHashChange:function(b){var c,e,f,g=this.getActive();a.each(j.stack,function(a,d){decodeURIComponent(b.currentUrl)===decodeURIComponent(d.url)&&(c=a<j.activeIndex,e=!c,f=a)}),this.activeIndex=f!==d?f:this.activeIndex,c?(b.either||b.isBack)(!0):e&&(b.either||b.isForward)(!1)},ignoreNextHashChange:!1},k="[tabindex],a,button:visible,select:visible,input",l=[],m=!1,n="&ui-state=dialog",o=g.children("base"),p=h.parseLocation(),q=o.length?h.parseUrl(h.makeUrlAbsolute(o.attr("href"),p.href)):p,r=p.hrefNoHash!==q.hrefNoHash,s=a.mobile.getScreenHeight,t=a.support.dynamicBaseTag?{element:o.length?o:a("<base>",{href:q.hrefNoHash}).prependTo(g),set:function(a){t.element.attr("href",h.makeUrlAbsolute(a,q))},reset:function(){t.element.attr("href",q.hrefNoHash)}}:d;a.mobile.back=function(){var a=b.navigator;this.phonegapNavigationEnabled&&a&&a.app&&a.app.backHistory?a.app.backHistory():b.history.back()},a.mobile.focusPage=function(a){var b=a.find("[autofocus]"),c=a.find(".ui-title:eq(0)");if(b.length){b.focus();return}c.length?c.focus():a.focus()};var w=!0,x,y;x=function(){if(!w)return;var b=a.mobile.urlHistory.getActive();if(b){var c=e.scrollTop();b.lastScroll=c<a.mobile.minScrollBack?a.mobile.defaultHomeScroll:c}},y=function(){setTimeout(x,100)},e.bind(a.support.pushState?"popstate":"hashchange",function(){w=!1}),e.one(a.support.pushState?"popstate":"hashchange",function(){w=!0}),e.one("pagecontainercreate",function(){a.mobile.pageContainer.bind("pagechange",function(){w=!0,e.unbind("scrollstop",y),e.bind("scrollstop",y)})}),e.bind("scrollstop",y),a.mobile._maybeDegradeTransition=a.mobile._maybeDegradeTransition||function(a){return a},a.fn.animationComplete=function(b){return a.support.cssTransitions?a(this).one("webkitAnimationEnd animationend",b):(setTimeout(b,0),a(this))},a.mobile.path=h,a.mobile.base=t,a.mobile.urlHistory=j,a.mobile.dialogHashKey=n,a.mobile.allowCrossDomainPages=!1,a.mobile.getDocumentUrl=function(b){return b?a.extend({},p):p.href},a.mobile.getDocumentBase=function(b){return b?a.extend({},q):q.href},a.mobile._bindPageRemove=function(){var b=a(this);!b.data("page").options.domCache&&b.is(":jqmData(external-page='true')")&&b.bind("pagehide.remove",function(){var b=a(this),c=new a.Event("pageremove");b.trigger(c),c.isDefaultPrevented()||b.removeWithDependents()})},a.mobile.loadPage=function(b,c){var e=a.Deferred(),f=a.extend({},a.mobile.loadPage.defaults,c),g=null,i=null,j=function(){var b=a.mobile.activePage&&C(a.mobile.activePage);return b||q.hrefNoHash},k=h.makeUrlAbsolute(b,j());f.data&&f.type==="get"&&(k=h.addSearchParams(k,f.data),f.data=d),f.data&&f.type==="post"&&(f.reloadPage=!0);var l=h.getFilePath(k),m=h.convertUrlToDataUrl(k);f.pageContainer=f.pageContainer||a.mobile.pageContainer,g=f.pageContainer.children("[data-"+a.mobile.ns+"url='"+m+"']"),g.length===0&&m&&!h.isPath(m)&&(g=f.pageContainer.children("#"+m).attr("data-"+a.mobile.ns+"url",m).jqmData("url",m));if(g.length===0)if(a.mobile.firstPage&&h.isFirstPageUrl(l))a.mobile.firstPage.parent().length&&(g=a(a.mobile.firstPage));else if(h.isEmbeddedPage(l))return e.reject(k,c),e.promise();if(g.length){if(!f.reloadPage)return A(g,f.role),e.resolve(k,c,g),e.promise();i=g}var n=f.pageContainer,o=new a.Event("pagebeforeload"),r={url:b,absUrl:k,dataUrl:m,deferred:e,options:f};n.trigger(o,r);if(o.isDefaultPrevented())return e.promise();if(f.showLoadMsg)var s=setTimeout(function(){a.mobile.showPageLoadingMsg()},f.loadMsgDelay),u=function(){clearTimeout(s),a.mobile.hidePageLoadingMsg()};return t&&t.reset(),!a.mobile.allowCrossDomainPages&&!h.isSameDomain(p,k)?e.reject(k,c):a.ajax({url:l,type:f.type,data:f.data,dataType:"html",success:function(d,j,n){var o=a("<div></div>"),p=d.match(/<title[^>]*>([^<]*)/)&&RegExp.$1,q=new RegExp("(<[^>]+\\bdata-"+a.mobile.ns+"role=[\"']?page[\"']?[^>]*>)"),s=new RegExp("\\bdata-"+a.mobile.ns+"url=[\"']?([^\"'>]*)[\"']?");q.test(d)&&RegExp.$1&&s.test(RegExp.$1)&&RegExp.$1&&(b=l=h.getFilePath(a("<div>"+RegExp.$1+"</div>").text())),t&&t.set(l),o.get(0).innerHTML=d,g=o.find(":jqmData(role='page'), :jqmData(role='dialog')").first(),g.length||(g=a("<div data-"+a.mobile.ns+"role='page'>"+d.split(/<\/?body[^>]*>/gmi)[1]+"</div>")),p&&!g.jqmData("title")&&(~p.indexOf("&")&&(p=a("<div>"+p+"</div>").text()),g.jqmData("title",p));if(!a.support.dynamicBaseTag){var v=h.get(l);g.find("[src], link[href], a[rel='external'], :jqmData(ajax='false'), a[target]").each(function(){var b=a(this).is("[href]")?"href":a(this).is("[src]")?"src":"action",c=a(this).attr(b);c=c.replace(location.protocol+"//"+location.host+location.pathname,""),/^(\w+:|#|\/)/.test(c)||a(this).attr(b,v+c)})}g.attr("data-"+a.mobile.ns+"url",h.convertUrlToDataUrl(l)).attr("data-"+a.mobile.ns+"external-page",!0).appendTo(f.pageContainer),g.one("pagecreate",a.mobile._bindPageRemove),A(g,f.role),k.indexOf("&"+a.mobile.subPageUrlKey)>-1&&(g=f.pageContainer.children("[data-"+a.mobile.ns+"url='"+m+"']")),f.showLoadMsg&&u(),r.xhr=n,r.textStatus=j,r.page=g,f.pageContainer.trigger("pageload",r),e.resolve(k,c,g,i)},error:function(b,d,g){t&&t.set(h.get()),r.xhr=b,r.textStatus=d,r.errorThrown=g;var i=new a.Event("pageloadfailed");f.pageContainer.trigger(i,r);if(i.isDefaultPrevented())return;f.showLoadMsg&&(u(),a.mobile.showPageLoadingMsg(a.mobile.pageLoadErrorMessageTheme,a.mobile.pageLoadErrorMessage,!0),setTimeout(a.mobile.hidePageLoadingMsg,1500)),e.reject(k,c)}}),e.promise()},a.mobile.loadPage.defaults={type:"get",data:d,reloadPage:!1,role:d,showLoadMsg:!1,pageContainer:d,loadMsgDelay:50},a.mobile.changePage=function(b,e){if(m){l.unshift(arguments);return}var f=a.extend({},a.mobile.changePage.defaults,e);f.pageContainer=f.pageContainer||a.mobile.pageContainer,f.fromPage=f.fromPage||a.mobile.activePage;var g=f.pageContainer,i=new a.Event("pagebeforechange"),k={toPage:b,options:f};g.trigger(i,k);if(i.isDefaultPrevented())return;b=k.toPage,m=!0;if(typeof b=="string"){a.mobile.loadPage(b,f).done(function(b,c,d,e){m=!1,c.duplicateCachedPage=e,a.mobile.changePage(d,c)}).fail(function(a,b){m=!1,u(!0),v(),f.pageContainer.trigger("pagechangefailed",k)});return}b[0]===a.mobile.firstPage[0]&&!f.dataUrl&&(f.dataUrl=p.hrefNoHash);var o=f.fromPage,q=f.dataUrl&&h.convertUrlToDataUrl(f.dataUrl)||b.jqmData("url"),r=q,s=h.getFilePath(q),t=j.getActive(),w=j.activeIndex===0,x=0,y=c.title,B=f.role==="dialog"||a.mobile.getAttrFixed(b[0],"data-"+a.mobile.ns+"role")==="dialog";if(o&&o[0]===b[0]&&!f.allowSamePageTransition){m=!1,g.trigger("pagechange",k),f.fromHashChange&&j.directHashChange({currentUrl:q,isBack:function(){},isForward:function(){}});return}A(b,f.role),f.fromHashChange&&j.directHashChange({currentUrl:q,isBack:function(){x=-1},isForward:function(){x=1}});try{c.activeElement&&c.activeElement.nodeName.toLowerCase()!=="body"?a(c.activeElement).blur():a("input:focus, textarea:focus, select:focus").blur()}catch(C){}var D=!1;B&&t&&(t.url.indexOf(n)>-1&&!a.mobile.activePage.is(".ui-dialog")&&(f.changeHash=!1,D=!0),q=(t.url||"")+(D?"":n),j.activeIndex===0&&q===j.initialDst&&(q+=n)),f.changeHash!==!1&&q&&(j.ignoreNextHashChange=!0,h.set(q));var E=t?b.jqmData("title")||b.children(":jqmData(role='header')").find(".ui-title").getEncodedText():y;!!E&&y===c.title&&(y=E),b.jqmData("title")||b.jqmData("title",y),f.transition=f.transition||(x&&!w?t.transition:d)||(B?a.mobile.defaultDialogTransition:a.mobile.defaultPageTransition),x||(D&&(j.activeIndex=Math.max(0,j.activeIndex-1)),j.addNew(q,f.transition,y,r,f.role)),c.title=j.getActive().title,a.mobile.activePage=b,f.reverse=f.reverse||x<0,z(b,o,f.transition,f.reverse).done(function(c,d,e,h,i){u(),f.duplicateCachedPage&&f.duplicateCachedPage.remove(),i||a.mobile.focusPage(b),v(),g.trigger("pagechange",k)})},a.mobile.changePage.defaults={transition:d,reverse:!1,changeHash:!0,fromHashChange:!1,role:d,duplicateCachedPage:d,pageContainer:d,showLoadMsg:!0,dataUrl:d,fromPage:d,allowSamePageTransition:!1},a.mobile.navreadyDeferred=a.Deferred(),a.mobile.navreadyDeferred.done(function(){a.mobile.$document.delegate("form","submit",function(b){var c=a(this);if(!a.mobile.ajaxEnabled||c.is(":jqmData(ajax='false')")||!c.jqmHijackable().length)return;var d=c.attr("method"),e=c.attr("target"),f=c.attr("action");f||(f=C(c),f===q.hrefNoHash&&(f=p.hrefNoSearch)),f=h.makeUrlAbsolute(f,C(c));if(h.isExternal(f)&&!h.isPermittedCrossDomainRequest(p,f)||e)return;a.mobile.changePage(f,{type:d&&d.length&&d.toLowerCase()||"get",data:c.serialize(),transition:a.mobile.getAttrFixed(c[0],"data-"+a.mobile.ns+"transition"),reverse:a.mobile.getAttrFixed(c[0],"data-"+a.mobile.ns+"direction")==="reverse",reloadPage:!0}),b.preventDefault()}),a.mobile.$document.bind("vclick",function(b){if(b.which>1||!a.mobile.linkBindingEnabled)return;var c=B(b.target);if(!a(c).jqmHijackable().length)return;c&&h.parseUrl(c.getAttribute("href")||"#").hash!=="#"&&(u(!0),i=a(c).closest(".ui-btn").not(".ui-disabled"),i.addClass(a.mobile.activeBtnClass))}),a.mobile.$document.bind("click",function(c){if(!a.mobile.linkBindingEnabled)return;var e=B(c.target),f=a(e),g;if(!e||c.which>1||!f.jqmHijackable().length)return;g=function(){b.setTimeout(function(){u(!0)},200)};if(f.is(":jqmData(rel='back')"))return a.mobile.back(),!1;var i=C(f),j=h.makeUrlAbsolute(f.attr("href")||"#",i);if(!a.mobile.ajaxEnabled&&!h.isEmbeddedPage(j)){g();return}if(j.search("#")!==-1){j=j.replace(/[^#]*#/,"");if(!j){c.preventDefault();return}h.isPath(j)?j=h.makeUrlAbsolute(j,i):j=h.makeUrlAbsolute("#"+j,p.hrefNoHash)}var k=f.is("[rel='external']")||f.is(":jqmData(ajax='false')")||f.is("[target]"),l=k||h.isExternal(j)&&!h.isPermittedCrossDomainRequest(p,j);if(l){g();return}var m=a.mobile.getAttrFixed(f[0],"data-"+a.mobile.ns+"transition"),n=a.mobile.getAttrFixed(f[0],"data-"+a.mobile.ns+"direction")==="reverse"||a.mobile.getAttrFixed(f[0],"data-"+a.mobile.ns+"back"),o=f.attr("data-"+a.mobile.ns+"rel")||d;a.mobile.changePage(j,{transition:m,reverse:n,role:o,link:f}),c.preventDefault()}),a.mobile.$document.delegate(".ui-page","pageshow.prefetch",function(){var b=[];a(this).find("a:jqmData(prefetch)").each(function(){var c=a(this),d=c.attr("href");d&&a.inArray(d,b)===-1&&(b.push(d),a.mobile.loadPage(d,{role:c.attr("data-"+a.mobile.ns+"rel")}))})}),a.mobile._handleHashChange=function(c){var e=h.stripHash(c),f=a.mobile.urlHistory.stack.length===0?"none":d,g=new a.Event("navigate"),i={transition:f,changeHash:!1,fromHashChange:!0};0===j.stack.length&&(j.initialDst=e),a.mobile.pageContainer.trigger(g);if(g.isDefaultPrevented())return;if(!a.mobile.hashListeningEnabled||j.ignoreNextHashChange){j.ignoreNextHashChange=!1;return}if(j.stack.length>1&&e.indexOf(n)>-1&&j.initialDst!==e){if(!a.mobile.activePage.is(".ui-dialog")){j.directHashChange({currentUrl:e,isBack:function(){a.mobile.back()},isForward:function(){b.history.forward()}});return}j.directHashChange({currentUrl:e,either:function(b){var c=a.mobile.urlHistory.getActive();e=c.pageUrl,a.extend(i,{role:c.role,transition:c.transition,reverse:b})}})}e?(e=typeof e=="string"&&!h.isPath(e)?h.makeUrlAbsolute("#"+e,q):e,e===h.makeUrlAbsolute("#"+j.initialDst,q)&&j.stack.length&&j.stack[0].url!==j.initialDst.replace(n,"")&&(e=a.mobile.firstPage),a.mobile.changePage(e,i)):a.mobile.changePage(a.mobile.firstPage,i)},e.bind("hashchange",function(b,c){a.mobile._handleHashChange(h.parseLocation().hash)})})}(a),function(a,b){var e={},f=e,g=a.mobile.$window,h=a.mobile.path.parseLocation(),i=a.Deferred(),j=a.Deferred();a.mobile.$document.ready(a.proxy(j,"resolve")),a.mobile.$document.one("mobileinit",a.proxy(i,"resolve")),a.extend(e,{initialFilePath:function(){return h.pathname+h.search}(),hashChangeTimeout:200,hashChangeEnableTimer:d,initialHref:h.hrefNoHash,state:function(){return{hash:a.mobile.path.parseLocation().hash||"#"+f.initialFilePath,title:c.title,initialHref:f.initialHref}},resetUIKeys:function(b){var c=a.mobile.dialogHashKey,d="&"+a.mobile.subPageUrlKey,e=b.indexOf(c);return e>-1?b=b.slice(0,e)+"#"+b.slice(e):b.indexOf(d)>-1&&(b=b.split(d).join("#"+d)),b},nextHashChangePrevented:function(b){a.mobile.urlHistory.ignoreNextHashChange=b,f.onHashChangeDisabled=b},onHashChange:function(b){if(f.onHashChangeDisabled)return;var d,e,g=a.mobile.path.parseLocation().hash,h=a.mobile.path.isPath(g),i=h?a.mobile.path.getLocation():a.mobile.getDocumentUrl();g=h?g.replace("#",""):g,e=f.state(),d=a.mobile.path.makeUrlAbsolute(g,i),h&&(d=f.resetUIKeys(d)),history.replaceState(e,c.title,d)},onPopState:function(b){var c=b.originalEvent.state,d,e,g;c&&(clearTimeout(f.hashChangeEnableTimer),f.nextHashChangePrevented(!1),a.mobile._handleHashChange(c.hash),f.nextHashChangePrevented(!0),f.hashChangeEnableTimer=setTimeout(function(){f.nextHashChangePrevented(!1)},f.hashChangeTimeout))},init:function(){g.bind("hashchange",f.onHashChange),g.bind("popstate",f.onPopState),location.hash===""&&history.replaceState(f.state(),c.title,a.mobile.path.getLocation())}}),a.when(j,i,a.mobile.navreadyDeferred).done(function(){a.mobile.pushStateEnabled&&a.support.pushState&&e.init()})}(a,this),function(a,b,c){a.mobile.transitionFallbacks.flip="fade"}(a,this),function(a,b,c){a.mobile.transitionFallbacks.flow="fade"}(a,this),function(a,b,c){a.mobile.transitionFallbacks.pop="fade"}(a,this),function(a,b,c){a.mobile.transitionHandlers.slide=a.mobile.transitionHandlers.simultaneous,a.mobile.transitionFallbacks.slide="fade"}(a,this),function(a,b,c){a.mobile.transitionFallbacks.slidedown="fade"}(a,this),function(a,b,c){a.mobile.transitionFallbacks.slidefade="fade"}(a,this),function(a,b,c){a.mobile.transitionFallbacks.slideup="fade"}(a,this),function(a,b,c){a.mobile.transitionFallbacks.turn="fade"}(a,this),function(a,b){a.mobile.page.prototype.options.degradeInputs={color:!1,date:!1,datetime:!1,"datetime-local":!1,email:!1,month:!1,number:!1,range:"number",search:"text",tel:!1,time:!1,url:!1,week:!1},a.mobile.$document.bind("pagecreate create",function(b){var c=a.mobile.closestPageData(a(b.target)),d;if(!c)return;d=c.options,a(b.target).find("input").not(c.keepNativeSelector()).each(function(){var b=a(this),c=this.getAttribute("type"),e=d.degradeInputs[c]||"text";if(d.degradeInputs[c]){var f=a("<div>").html(b.clone()).html(),g=f.indexOf(" type=")>-1,h=g?/\s+type=["']?\w+['"]?/:/\/?>/,i=' type="'+e+'" data-'+a.mobile.ns+'type="'+c+'"'+(g?"":">");b.replaceWith(f.replace(h,i))}})})}(a),function(a,b,c){a.widget("mobile.dialog",a.mobile.widget,{options:{closeBtnText:"Close",overlayTheme:"a",initSelector:":jqmData(role='dialog')"},_create:function(){var b=this,c=this.element,d=a("<a href='#' data-"+a.mobile.ns+"icon='delete' data-"+a.mobile.ns+"iconpos='notext'>"+this.options.closeBtnText+"</a>"),e=a("<div/>",{role:"dialog","class":"ui-dialog-contain ui-corner-all ui-overlay-shadow"});c.addClass("ui-dialog ui-overlay-"+this.options.overlayTheme),c.wrapInner(e).children().find(":jqmData(role='header')").prepend(d).end().children(":first-child").addClass("ui-corner-top").end().children(":last-child").addClass("ui-corner-bottom"),d.bind("click",function(){b.close()}),c.bind("vclick submit",function(b){var c=a(b.target).closest(b.type==="vclick"?"a":"form"),d;c.length&&!a.mobile.getAttrFixed(c[0],"data-"+a.mobile.ns+"transition")&&(d=a.mobile.urlHistory.getActive()||{},c.attr("data-"+a.mobile.ns+"transition",d.transition||a.mobile.defaultDialogTransition).attr("data-"+a.mobile.ns+"direction","reverse"))}).bind("pagehide",function(b,c){a(this).find("."+a.mobile.activeBtnClass).not(".ui-slider-bg").removeClass(a.mobile.activeBtnClass)}).bind("pagebeforeshow",function(){b._isCloseable=!0,b.options.overlayTheme&&b.element.page("removeContainerBackground").page("setContainerBackground",b.options.overlayTheme)})},close:function(){var b;this._isCloseable&&(this._isCloseable=!1,a.mobile.hashListeningEnabled?a.mobile.back():(b=a.mobile.urlHistory.getPrev().url,a.mobile.path.isPath(b)||(b=a.mobile.path.makeUrlAbsolute("#"+b)),a.mobile.changePage(b,{changeHash:!1,fromHashChange:!0})))}}),a.mobile.$document.delegate(a.mobile.dialog.prototype.options.initSelector,"pagecreate",function(){a.mobile.dialog.prototype.enhance(this)})}(a,this),function(a,b){a.mobile.page.prototype.options.backBtnText="Back",a.mobile.page.prototype.options.addBackBtn=!1,a.mobile.page.prototype.options.backBtnTheme=null,a.mobile.page.prototype.options.headerTheme="a",a.mobile.page.prototype.options.footerTheme="a",a.mobile.page.prototype.options.contentTheme=null,a.mobile.$document.bind("pagecreate",function(c){var d=a(c.target),e=d.data("page").options,f="data-"+a.mobile.ns,g=d[0].getAttribute(f+"role")||b,h=e.theme;a(":jqmData(role='header'), :jqmData(role='footer'), :jqmData(role='content')",d).jqmEnhanceable().each(function(){var c=a(this),i=c[0].getAttribute(f+"role")||b,j=c[0].getAttribute(f+"theme")||b,k=j||e.contentTheme||g==="dialog"&&h,l,m,n,p=d.find(".ui-footer"),q;c.addClass("ui-"+i);if(i==="header"||i==="footer"){var r=j||(i==="header"?e.headerTheme:e.footerTheme)||h;c.addClass("ui-bar-"+r).attr("role",i==="header"?"banner":"contentinfo"),i==="header"&&(l=c.children("a, button"),m=l.hasClass("ui-btn-left"),n=l.hasClass("ui-btn-right"),m=m||l.eq(0).not(".ui-btn-right").addClass("ui-btn-left").length,n=n||l.eq(1).addClass("ui-btn-right").length,a(l.get().reverse()).each(function(b){a(this).addClass("ui-btn-right-"+b)})),e.addBackBtn&&(i==="footer"||i==="header")&&d[0].getAttribute(f+"url")!==a.mobile.path.stripHash(location.hash)&&!m&&(e.addBackBtn=="header"?p=d.find(".ui-header"):p=d.find(".ui-footer"),p.find(".ui-btn-back").length||(q=a("<a href='javascript:void(0);' class='ui-btn-back' data-"+a.mobile.ns+"rel='back'></a>").buttonMarkup({icon:"header-back-btn",theme:e.backBtnTheme||r}),q.find(".ui-btn-text").text(e.backBtnText),q.appendTo(p))),c.children("h1, h2, h3, h4, h5, h6").addClass("ui-title").attr({role:"heading","aria-level":"1","aria-label":"title",tabindex:"0"}),a(".ui-title-text-sub").attr({tabindex:"0","aria-label":"subtitle"})}else i==="content"&&(k&&c.addClass("ui-body-"+k),c.attr("role","main"))})})}(a),function(a,b){a.fn.fieldcontain=function(a){return this.addClass("ui-field-contain ui-body ui-br").contents().filter(function(){return this.nodeType===3&&!/\S/.test(this.nodeValue)}).remove()},a.mobile.$document.bind("pagecreate create",function(b){a(":jqmData(role='fieldcontain')",b.target).jqmEnhanceable().fieldcontain()})}(a),function(a,b){a.fn.grid=function(b){return this.each(function(){var c=a(this),d=a.extend({grid:null},b),e=c.children(),f={solo:1,a:2,b:3,c:4,d:5},g=d.grid,h;if(!g)if(e.length<=5)for(var i in f)f[i]===e.length&&(g=i);else g="a",c.addClass("ui-grid-duo");h=f[g],c.addClass("ui-grid-"+g),e.filter(":nth-child("+h+"n+1)").addClass("ui-block-a"),h>1&&e.filter(":nth-child("+h+"n+2)").addClass("ui-block-b"),h>2&&e.filter(":nth-child("+h+"n+3)").addClass("ui-block-c"),h>3&&e.filter(":nth-child("+h+"n+4)").addClass("ui-block-d"),h>4&&e.filter(":nth-child("+h+"n+5)").addClass("ui-block-e")})}}(a),function(a,b){a.mobile.$document.bind("pagecreate create",function(b){a(":jqmData(role='nojs')",b.target).addClass("ui-nojs")})}(a),function(a,b){function d(a){var b;while(a){b=typeof a.className=="string"&&a.className+" ";if(b&&b.indexOf("ui-btn ")>-1&&b.indexOf("ui-disabled ")<0)break;a=a.parentNode}return a}a.fn.buttonMarkup=function(d){var f=this,g="data-"+a.mobile.ns,h=function(b,c){k.setAttribute("data-"+a.mobile.ns+b,c),j.jqmData(b,c)};d=d&&a.type(d)==="object"?d:{};for(var i=0;i<f.length;i++){var j=f.eq(i),k=j[0],l=a.extend({},a.fn.buttonMarkup.defaults,{icon:d.icon!==b?d.icon:a.mobile.getAttrFixed(k,g+"icon"),iconpos:d.iconpos!==b?d.iconpos:a.mobile.getAttrFixed(k,g+"iconpos"),theme:d.theme!==b?d.theme:a.mobile.getAttrFixed(k,g+"theme")||a.mobile.getInheritedTheme(j,a.fn.buttonMarkup.defaults.theme),inline:d.inline!==b?d.inline:a.mobile.getAttrFixed(k,g+"inline"),shadow:d.shadow!==b?d.shadow:a.mobile.getAttrFixed(k,g+"shadow"),corners:d.corners!==b?d.corners:a.mobile.getAttrFixed(k,g+"corners"),iconshadow:d.iconshadow!==b?d.iconshadow:a.mobile.getAttrFixed(k,g+"iconshadow"),mini:d.mini!==b?d.mini:a.mobile.getAttrFixed(k,g+"mini")},d),m="ui-btn-inner",n="ui-btn-text",o,p,q,r,s,t;for(key in l)k.setAttribute(g+key,l[key]);a.mobile.getAttrFixed(k,g+"rel")==="popup"&&j.attr("href")&&(k.setAttribute("aria-haspopup",!0),k.setAttribute("aria-owns",k.getAttribute("href"))),k.tagName!=="LI"&&k.tagName!=="LABEL"&&(k.setAttribute("role","button"),k.setAttribute("tabindex","0")),t=a.data(k.tagName==="INPUT"||k.tagName==="BUTTON"?k.parentNode:k,"buttonElements"),t?(k=t.outer,j=a(k),q=t.inner,r=t.text,a(t.icon).remove(),t.icon=null):(q=c.createElement(l.wrapperEls),r=c.createElement(l.wrapperEls)),s=l.icon?c.createElement("span"):null,e&&!t&&e(),l.theme||(l.theme=a.mobile.getInheritedTheme(j,"c")),o="ui-btn ui-btn-up-"+l.theme,o+=l.shadow?" ui-shadow":"",o+=l.corners?" ui-btn-corner-all":"";if(a.mobile.getAttrFixed(k,g+"role")=="button"||k.tagName=="BUTTON"||k.tagName=="DIV")o+=" ui-btn-box-"+l.theme;buttonStyle=a.mobile.getAttrFixed(k,g+"style");if(buttonStyle!="circle"||a(j).text().length>0){if(buttonStyle=="nobg")o+=" ui-btn-icon-nobg",o+=" ui-btn-icon_only";else if(buttonStyle=="edit")o+=" ui-btn-edit";else if(buttonStyle=="round"||buttonStyle=="circle"&&a(j).text().length>0)o+=" ui-btn-round"}else o+=" ui-btn-corner-circle",o+=" ui-btn-icon_only";if(l.icon)if(a(j).text().length>0){switch(l.iconpos){case"right":case"left":case"top":case"bottom":n+=" ui-btn-text-padding-"+l.iconpos;break;default:n+=" ui-btn-text-padding-left"}m+=" ui-btn-hastxt"}else buttonStyle=="circle"?m+=" ui-btn-corner-circle":buttonStyle=="nobg"&&(m+=" ui-btn-icon-nobg"),o+=" ui-btn-icon_only",m+=" ui-btn-icon-only",k.tagName!=="LABEL"&&a(j).text(l.icon.replace("naviframe-",""));else a(j).text().length>0?m+=" ui-btn-hastxt":buttonStyle=="circle"&&(o+=" ui-btn-round");l.mini!==b&&(o+=l.mini===!0?" ui-mini":" ui-fullsize"),l.inline!==b&&(o+=l.inline===!0?" ui-btn-inline":" ui-btn-block"),l.icon&&(l.icon="ui-icon-"+l.icon,l.iconpos=l.iconpos||"left",p="ui-icon "+l.icon,l.iconshadow&&(p+=" ui-icon-shadow")),l.iconpos&&(o+=" ui-btn-icon-"+l.iconpos,l.iconpos==="notext"&&!j.attr("title")&&j.attr("title",j.getEncodedText())),m+=l.corners?" ui-btn-corner-all":"",l.iconpos&&l.iconpos==="notext"&&!j.attr("title")&&j.attr("title",j.getEncodedText()),t&&j.removeClass(t.bcls||""),j.removeClass("ui-link").addClass(o),q.className=m,r.className=n,t||q.appendChild(r);if(s){s.className=p;if(!t||!t.icon)s.innerHTML=" ",q.appendChild(s)}while(k.firstChild&&!t)r.appendChild(k.firstChild);t||k.appendChild(q),t={bcls:o,outer:k,inner:q,text:r,icon:s},a.data(k,"buttonElements",t),a.data(q,"buttonElements",t),a.data(r,"buttonElements",t),s&&a.data(s,"buttonElements",t)}return this},a.fn.buttonMarkup.defaults={theme:"c",corners:!0,shadow:!0,iconshadow:!0,wrapperEls:"span"};var e=function(){var b=a.mobile.buttonMarkup.hoverDelay,c,f;a.mobile.$document.bind({"vmousedown vmousecancel vmouseup vmouseover vmouseout focus blur scrollstart touchend touchcancel":function(e){var g,h=a(d(e.target)),i=e.originalEvent&&/^touch/.test(e.originalEvent.type),j=e.type;if(h.length){g=h.attr("data-"+a.mobile.ns+"theme");if(j==="vmousedown")i?c=setTimeout(function(){h.removeClass("ui-btn-up-"+g).addClass("ui-btn-down-"+g)},b):h.removeClass("ui-btn-up-"+g).addClass("ui-btn-down-"+g);else if(j==="vmousecancel"||j==="vmouseup"||j==="touchend"||j==="touchcancel")h.removeClass("ui-btn-down-"+g).addClass("ui-btn-up-"+g);else if(j==="vmouseover"||j==="focus")i?f=setTimeout(function(){h.removeClass("ui-btn-up-"+g).addClass("ui-btn-hover-"+g)},b):h.removeClass("ui-btn-up-"+g).addClass("ui-btn-hover-"+g);else if(j==="vmouseout"||j==="blur"||j==="scrollstart")h.removeClass("ui-btn-hover-"+g+" ui-btn-down-"+g).addClass("ui-btn-up-"+g),c&&clearTimeout(c),f&&clearTimeout(f)}},"focusin focus":function(b){a(d(b.target)).addClass(a.mobile.focusClass)},"focusout blur":function(b){a(d(b.target)).removeClass(a.mobile.focusClass)}}),e=null};a.mobile.$document.bind("pagecreate create",function(b){a(":jqmData(role='button'), .ui-bar > a, .ui-header > a, .ui-footer > a, .ui-bar > :jqmData(role='controlgroup') > a",b.target).jqmEnhanceable().not("button, input, .ui-btn, :jqmData(role='none'), :jqmData(role='nojs')").buttonMarkup()})}(a),function(a,b){a.widget("mobile.collapsible",a.mobile.widget,{options:{expandCueText:" Expandable list, tap to open list",collapseCueText:" Expandable list, tap to close list",collapsed:!0,heading:"h1,h2,h3,h4,h5,h6,legend",theme:null,contentTheme:null,inset:!0,mini:!1,initSelector:":jqmData(role='collapsible')"},_create:function(){var c=this.element,d=this.options,e=c.addClass("ui-collapsible"),f=c.children(d.heading).first(),g=a.mobile.getAttrFixed(c[0],"data-"+a.mobile.ns+"collapsed-icon")||d.collapsedIcon,h=a.mobile.getAttrFixed(c[0],"data-"+a.mobile.ns+"expanded-icon")||d.expandedIcon,i=e.wrapInner("<div class='ui-collapsible-content'></div>").children(".ui-collapsible-content"),j=c.closest(":jqmData(role='collapsible-set')").addClass("ui-collapsible-set");f.is("legend")&&(f=a("<div role='heading'>"+f.html()+"</div>").insertBefore(f),f.next().remove()),j.length?(d.theme||(d.theme=a.mobile.getAttrFixed(j[0],"data-"+a.mobile.ns+"theme")||a.mobile.getInheritedTheme(j,"c")),d.contentTheme||(d.contentTheme=a.mobile.getAttrFixed(j[0],"data-"+a.mobile.ns+"content-theme")),d.collapsedIcon||(d.collapsedIcon=a.mobile.getAttrFixed(j[0],"data-"+a.mobile.ns+"collapsed-icon")),d.expandedIcon||(d.expandedIcon=a.mobile.getAttrFixed(j[0],"data-"+a.mobile.ns+"expanded-icon")),d.iconPos||(d.iconPos=a.mobile.getAttrFixed(j[0],"data-"+a.mobile.ns+"iconpos")),a.mobile.getAttrFixed(j[0],"data-"+a.mobile.ns+"inset")!==b?d.inset=a.mobile.getAttrFixed(j[0],"data-"+a.mobile.ns+"inset"):d.inset=!0,d.mini||(d.mini=a.mobile.getAttrFixed(j[0],"data-"+a.mobile.ns+"mini"))):d.theme||(d.theme=a.mobile.getInheritedTheme(c,"c")),!d.inset||e.addClass("ui-collapsible-inset"),i.addClass(d.contentTheme?"ui-body-"+d.contentTheme:""),g=a.mobile.getAttrFixed(c[0],"data-"+a.mobile.ns+"collapsed-icon")||d.collapsedIcon||"plus",h=a.mobile.getAttrFixed(c[0],"data-"+a.mobile.ns+"expanded-icon")||d.expandedIcon||"minus",f.insertBefore(i).addClass("ui-collapsible-heading").append("<span class='ui-collapsible-heading-status'></span>").wrapInner("<a href='#' class='ui-collapsible-heading-toggle'></a>").find("a").first().buttonMarkup({shadow:!1,corners:!1,iconpos:a.mobile.getAttrFixed(c[0],"data-"+a.mobile.ns+"iconpos")||d.iconPos||"left",icon:g,mini:d.mini,theme:d.theme}).attr("role",""),!d.inset||f.find("a").first().add(".ui-btn-inner",c).addClass("ui-corner-top ui-corner-bottom"),e.bind("expand collapse",function(b){if(!b.isDefaultPrevented()){var c=a(this),k=b.type==="collapse",l=d.contentTheme;b.preventDefault(),d.customEventHandler&&d.customEventHandler.call(this,k),f.toggleClass("ui-collapsible-heading-collapsed",k).find(".ui-collapsible-heading-status").text(k?d.expandCueText:d.collapseCueText).end().find(".ui-icon").toggleClass("ui-icon-"+h,!k).toggleClass("ui-icon-"+g,k||h===g).end().find("a").first().removeClass(a.mobile.activeBtnClass),c.toggleClass("ui-collapsible-collapsed",k),i.toggleClass("ui-collapsible-content-collapsed",k).attr("aria-hidden",k),i.children("li").not("ui-collapsible-content").attr("tabindex",k?"":"0"),l&&!!d.inset&&(!j.length||e.jqmData("collapsible-last"))&&(f.find("a").first().add(f.find(".ui-btn-inner")).toggleClass("ui-corner-bottom",k),i.toggleClass("ui-corner-bottom",!k)),i.trigger("updatelayout")}}).trigger(d.collapsed?"collapse":"expand"),f.bind("tap",function(b){f.find("a").first().addClass(a.mobile.activeBtnClass)}).bind("click",function(a){var b=f.is(".ui-collapsible-heading-collapsed")?"expand":"collapse";e.trigger(b),a.preventDefault(),a.stopPropagation()})}}),a.delegateSelfInitWithSingleSelector(a.mobile.collapsible)}(a),function(a,b){a.widget("mobile.collapsibleset",a.mobile.widget,{options:{initSelector:":jqmData(role='collapsible-set')"},_create:function(){var c=this.element.addClass("ui-collapsible-set"),d=this.options;d.theme||(d.theme=a.mobile.getInheritedTheme(c,"c")),d.contentTheme||(d.contentTheme=a.mobile.getAttrFixed(c[0],"data-"+a.mobile.ns+"content-theme")),a.mobile.getAttrFixed(c[0],"data-"+a.mobile.ns+"inset")!==b&&(d.inset=a.mobile.getAttrFixed(c[0],"data-"+a.mobile.ns+"inset")),d.inset=d.inset!==b?d.inset:!0,c.jqmData("collapsiblebound")||c.jqmData("collapsiblebound",!0).bind("expand collapse",function(b){var c=b.type==="collapse",e=a(b.target).closest(".ui-collapsible"),f=e.data("collapsible");e.jqmData("collapsible-last")&&!!d.inset&&(e.find(".ui-collapsible-heading").first().find("a").first().toggleClass("ui-corner-bottom",c).find(".ui-btn-inner").toggleClass("ui-corner-bottom",c),e.find(".ui-collapsible-content").toggleClass("ui-corner-bottom",!c))}).bind("expand",function(b){var c=a(b.target).closest(".ui-collapsible");c.parent().is(":jqmData(role='collapsible-set')")&&c.siblings(".ui-collapsible").trigger("collapse")})},_init:function(){var a=this.element,b=a.children(":jqmData(role='collapsible')"),c=b.filter(":jqmData(collapsed='false')");this.refresh(),c.trigger("expand")},refresh:function(){var b=this.element,c=this.options,d=b.children(":jqmData(role='collapsible')");a.mobile.collapsible.prototype.enhance(d.not(".ui-collapsible")),!c.inset||(d.each(function(){a(this).jqmRemoveData("collapsible-last").find(".ui-collapsible-heading").find("a").first().removeClass("ui-corner-top ui-corner-bottom").find(".ui-btn-inner").removeClass("ui-corner-top ui-corner-bottom")}),d.first().find("a").first().addClass("ui-corner-top").find(".ui-btn-inner").addClass("ui-corner-top"),d.last().jqmData("collapsible-last",!0).find("a").first().addClass("ui-corner-bottom").find(".ui-btn-inner").addClass("ui-corner-bottom"))}}),a.delegateSelfInitWithSingleSelector(a.mobile.collapsibleset)}(a),function(a,b){a.widget("mobile.navbar",a.mobile.widget,{options:{iconpos:"top",grid:null,initSelector:":jqmData(role='navbar')"},_create:function(){var c=this.element,d=c.find("a"),e=d.filter(":jqmData(icon)").length?this.options.iconpos:b;c.addClass("ui-navbar ui-mini").attr("role","navigation").find("ul").jqmEnhanceable().grid({grid:this.options.grid}),d.buttonMarkup({corners:!1,shadow:!1,inline:!0,iconpos:e}),c.delegate("a","vclick",function(b){a(b.target).hasClass("ui-disabled")||(d.removeClass(a.mobile.activeBtnClass),a(this).addClass(a.mobile.activeBtnClass))}),c.closest(".ui-page").bind("pagebeforeshow",function(){d.filter(".ui-state-persist").addClass(a.mobile.activeBtnClass)})}}),a.delegateSelfInitWithSingleSelector(a.mobile.navbar)}(a),function(a,b){var d={};a.widget("mobile.listview",a.mobile.widget,{options:{theme:null,countTheme:"c",headerTheme:"b",dividerTheme:"b",splitIcon:"arrow-r",splitTheme:"b",inset:!1,initSelector:":jqmData(role='listview')"},_create:function(){var a=this,b="";b+=a.options.inset?" ui-listview-inset ui-corner-all ui-shadow ":"",a.element.addClass(function(a,c){return c+" ui-listview "+b}),a.refresh(!0)},_removeCorners:function(a,b){var c="ui-corner-top ui-corner-tr ui-corner-tl",d="ui-corner-bottom ui-corner-br ui-corner-bl";a=a.add(a.find(".ui-btn-inner, .ui-li-link-alt, .ui-li-thumb")),b==="top"?a.removeClass(c):b==="bottom"?a.removeClass(d):a.removeClass(c+" "+d)},_refreshCorners:function(a){var b,c,d,e;b=this.element.children("li"),c=a||b.filter(":visible").length===0?b.not(".ui-screen-hidden"):b.filter(":visible"),b.filter(".ui-li-last").removeClass("ui-li-last"),this.options.inset?(this._removeCorners(b),d=c.first().addClass("ui-corner-top"),d.add(d.find(".ui-btn-inner").not(".ui-li-link-alt span:first-child")).addClass("ui-corner-top").end().find(".ui-li-link-alt, .ui-li-link-alt span:first-child").addClass("ui-corner-tr"
+).end().find(".ui-li-thumb").not(".ui-li-icon").addClass("ui-corner-tl"),e=c.last().addClass("ui-corner-bottom ui-li-last"),e.add(e.find(".ui-btn-inner")).find(".ui-li-link-alt").addClass("ui-corner-br").end().find(".ui-li-thumb").not(".ui-li-icon").addClass("ui-corner-bl")):c.last().addClass("ui-li-last"),a||this.element.trigger("updatelayout")},_findFirstElementByTagName:function(a,b,c,d){var e={};e[c]=e[d]=!0;while(a){if(e[a.nodeName])return a;a=a[b]}return null},_getChildrenByTagName:function(b,c,d){var e=[],f={};f[c]=f[d]=!0,b=b.firstChild;while(b)f[b.nodeName]&&e.push(b),b=b.nextSibling;return a(e)},_addThumbClasses:function(b){var c,d,e=b.length;for(c=0;c<e;c++)d=a(this._findFirstElementByTagName(b[c].firstChild,"nextSibling","img","IMG")),d.length&&(d.addClass("ui-li-thumb").attr({role:"","aria-label":"icon"}),a(this._findFirstElementByTagName(d[0].parentNode,"parentNode","li","LI")).addClass(d.is(".ui-li-icon")?"ui-li-has-icon":"ui-li-has-thumb"))},_addCheckboxRadioClasses:function(b){var c,d,e=b.length;for(c=0;c<e;c++)d=a(b[c]).find("input"),d.attr("type")=="checkbox"?a(b[c]).addClass("ui-li-has-checkbox"):d.attr("type")=="radio"&&a(b[c]).addClass("ui-li-has-radio")},_addRightBtnClasses:function(b){var c,d,e=b.length;for(c=0;c<e;c++)d=a(b[c]).find(":jqmData(role='button'),input[type='button'],select:jqmData(role='slider')"),d.length&&(d.jqmData("style")=="circle"?a(b[c]).addClass("ui-li-has-right-circle-btn"):a(b[c]).addClass("ui-li-has-right-btn"))},refresh:function(d){this.parentPage=this.element.closest(".ui-page"),this._createSubPages();var e=this.options,f=this.element,g=this,h=a.mobile.getAttrFixed(f[0],"data-"+a.mobile.ns+"dividertheme")||e.dividerTheme,i=a.mobile.getAttrFixed(f[0],"data-"+a.mobile.ns+"splittheme"),j=a.mobile.getAttrFixed(f[0],"data-"+a.mobile.ns+"spliticon"),k=this._getChildrenByTagName(f[0],"li","LI"),l=!!a.nodeName(f[0],"ol"),m=!a.support.cssPseudoElement,n=f.attr("start"),o={},p,q,r,s,t,u,v,w,x,y,z,A,B,C;l&&m&&f.find(".ui-li-dec").remove(),l&&(n||n===0?m?v=parseFloat(n):(w=parseFloat(n)-1,f.css("counter-reset","listnumbering "+w)):m&&(v=1)),e.theme||(e.theme=a.mobile.getInheritedTheme(this.element,"c"));for(var D=0,E=k.length;D<E;D++){p=k.eq(D),q="ui-li";if(d||!p.hasClass("ui-li")){r=a.mobile.getAttrFixed(p[0],"data-"+a.mobile.ns+"theme")||e.theme,s=this._getChildrenByTagName(p[0],"a","A").attr({role:"",tabindex:"0"});var F=a.mobile.getAttrFixed(p[0],"data-"+a.mobile.ns+"role")==="list-divider";(p.hasClass("ui-li-has-checkbox")||p.hasClass("ui-li-has-radio"))&&p.on("vclick",function(b){var c=a(b.target),d=c.find(".ui-checkbox");d.length||(d=c.find(".ui-radio")),d.length&&d.children("label").trigger("vclick")}),s.length&&!F?(z=a.mobile.getAttrFixed(p[0],"data-"+a.mobile.ns+"icon"),z===b&&(z=!1),p.buttonMarkup({wrapperEls:"div",shadow:!1,corners:!1,iconpos:"right",icon:s.length>1||z===!1?!1:z||"arrow-r",theme:r}),z!==!1&&s.length===1&&p.addClass("ui-li-has-arrow"),s.first().removeClass("ui-link").addClass("ui-link-inherit"),s.length>1&&(q+=" ui-li-has-alt",t=s.last(),u=i||a.mobile.getAttrFixed(t[0],"data-"+a.mobile.ns+"theme")||e.splitTheme,C=a.mobile.getAttrFixed(t[0],"data-"+a.mobile.ns+"icon"),t.appendTo(p).attr("title",t.getEncodedText()).addClass("ui-li-link-alt").empty().buttonMarkup({shadow:!1,corners:!1,theme:r,icon:!1,iconpos:"notext"}).find(".ui-btn-inner").append(a(c.createElement("span")).buttonMarkup({shadow:!0,corners:!0,theme:u,iconpos:"notext",icon:C||z||j||e.splitIcon})))):F?(q+=" ui-li-divider ui-bar-"+h,p.attr({role:"heading",tabindex:"0"}),l&&(n||n===0?m?v=parseFloat(n):(x=parseFloat(n)-1,p.css("counter-reset","listnumbering "+x)):m&&(v=1))):(q+=" ui-li-static ui-btn-up-"+r,p.attr("tabindex","0"))}l&&m&&q.indexOf("ui-li-divider")<0&&(y=q.indexOf("ui-li-static")>0?p:p.find(".ui-link-inherit"),y.addClass("ui-li-jsnumbering").prepend("<span class='ui-li-dec'>"+v++ +". </span>")),o[q]||(o[q]=[]),o[q].push(p[0])}for(q in o)a(o[q]).addClass(q).children(".ui-btn-inner").addClass(q);f.find("h1, h2, h3, h4, h5, h6").addClass("ui-li-heading").end().find("p, dl").addClass("ui-li-desc").end().find(".ui-li-aside").each(function(){var b=a(this);b.prependTo(b.parent())}).end().find(".ui-li-count").each(function(){a(this).closest("li").addClass("ui-li-has-count")}).addClass("ui-btn-up-"+(a.mobile.getAttrFixed(f[0],"data-"+a.mobile.ns+"counttheme")||this.options.countTheme)+" ui-btn-corner-all"),this._addThumbClasses(k),this._addThumbClasses(f.find(".ui-link-inherit")),this._addCheckboxRadioClasses(k),this._addCheckboxRadioClasses(f.find(".ui-link-inherit")),this._addRightBtnClasses(k),this._addRightBtnClasses(f.find(".ui-link-inherit")),this._refreshCorners(d),this._trigger("afterrefresh")},_idStringEscape:function(a){return a.replace(/[^a-zA-Z0-9]/g,"-")},_createSubPages:function(){var b=this.element,c=b.closest(".ui-page"),e=c.jqmData("url"),f=e||c[0][a.expando],g=b.attr("id"),h=this.options,i="data-"+a.mobile.ns,j=this,k=c.find(":jqmData(role='footer')").jqmData("id"),l;typeof d[f]=="undefined"&&(d[f]=-1),g=g||++d[f],a(b.find("li>ul, li>ol").toArray().reverse()).each(function(c){var d=this,f=a(this),j=f.attr("id")||g+"-"+c,m=f.parent(),n=a(f.prevAll().toArray().reverse()),p=n.length?n:a("<span>"+a.trim(m.contents()[0].nodeValue)+"</span>"),q=p.first().getEncodedText(),r=(e||"")+"&"+a.mobile.subPageUrlKey+"="+j,s=a.mobile.getAttrFixed(f[0],"data-"+a.mobile.ns+"theme")||h.theme,t=a.mobile.getAttrFixed(f[0],"data-"+a.mobile.ns+"counttheme")||a.mobile.getAttrFixed(b[0],"data-"+a.mobile.ns+"counttheme")||h.countTheme,u,v;l=!0,u=f.detach().wrap("<div "+i+"role='page' "+i+"url='"+r+"' "+i+"theme='"+s+"' "+i+"count-theme='"+t+"'><div "+i+"role='content'></div></div>").parent().before("<div "+i+"role='header' "+i+"theme='"+h.headerTheme+"'><div class='ui-title'>"+q+"</div></div>").after(k?a("<div "+i+"role='footer' "+i+"id='"+k+"'>"):"").parent().appendTo(a.mobile.pageContainer),u.page(),v=m.find("a:first"),v.length||(v=a("<a/>").html(p||q).prependTo(m.empty())),v.attr("href","#"+r)}).listview();if(l&&c.is(":jqmData(external-page='true')")&&c.data("page").options.domCache===!1){var m=function(b,d){var f=d.nextPage,g,h=new a.Event("pageremove");d.nextPage&&(g=f.jqmData("url"),g.indexOf(e+"&"+a.mobile.subPageUrlKey)!==0&&(j.childPages().remove(),c.trigger(h),h.isDefaultPrevented()||c.removeWithDependents()))};c.unbind("pagehide.remove").bind("pagehide.remove",m)}},addItem:function(b,c){var d=a(b),e,f=this;e=f.element.children("li"),d.css({opacity:0,display:"none"}),e.length==0||e.length<=c?a(f.element).append(d):a(e.get(c)).before(d),a(f.element).trigger("create").listview("refresh"),d.css("min-height","0px"),d.slideDown("fast",function(){d.addClass("addli"),d.css({opacity:1})})},removeItem:function(b){var c,d,e=this;d=e.element.children("li");if(d.length<=0||d.length<b)return;c=a(d.get(b)),c.addClass("removeli"),c.slideUp("normal",function(){a(this).remove()})},childPages:function(){var b=this.parentPage.jqmData("url");return a(":jqmData(url^='"+b+"&"+a.mobile.subPageUrlKey+"')")}}),a.delegateSelfInitWithSingleSelector(a.mobile.listview)}(a),function(a,b){a.mobile.listview.prototype.options.autodividers=!1,a.mobile.listview.prototype.options.autodividersSelector=function(a){var b=a.text()||null;return b?(b=b.trim().slice(0,1).toUpperCase(),b):null},a.mobile.$document.delegate("ul,ol","listviewcreate",function(){var b=a(this),d=b.data("listview");if(!d||!d.options.autodividers)return;var e=function(){b.find("li:jqmData(role='list-divider')").remove();var e=b.find("li"),f=null,g,h;for(var i=0;i<e.length;i++){g=e[i],h=d.options.autodividersSelector(a(g));if(h&&f!==h){var j=c.createElement("li");j.appendChild(c.createTextNode(h)),j.setAttribute("data-"+a.mobile.ns+"role","list-divider"),g.parentNode.insertBefore(j,g)}f=h}},f=function(){b.unbind("listviewafterrefresh",f),e(),d.refresh(),b.bind("listviewafterrefresh",f)};f()})}(a),function(a,b){a.widget("mobile.checkboxradio",a.mobile.widget,{options:{theme:null,initSelector:"input[type='checkbox'],input[type='radio']"},_create:function(){var d=this,e=this.element,f=function(a,b){return a.jqmData(b)||a.closest("form, fieldset").jqmData(b)},g=a(e).closest("label"),h=g.length?g:e[0].id?a(e).closest("form, fieldset, :jqmData(role='page'), :jqmData(role='dialog')").find("label").filter("[for='"+e[0].id+"']"):[],i=e[0].type,j=f(e,"mini"),k=i+"-on",l=i+"-off",m=e.parents(":jqmData(type='horizontal')").length?b:l,n=f(e,"iconpos"),o=m?"":" "+a.mobile.activeBtnClass,p="ui-"+k+o,q="ui-"+l,r="ui-icon-"+k,s="ui-icon-"+l,t="";if(i!=="checkbox"&&i!=="radio")return;t=i==="checkbox"?"aria-checked":"aria-selected",h.length==0&&(h=a("<label for='"+e[0].id+"'></label>")),a.extend(this,{label:h,inputtype:i,checkedClass:p,uncheckedClass:q,checkedicon:r,uncheckedicon:s,ariaCheckedAttr:t}),this.options.theme||(this.options.theme=a.mobile.getInheritedTheme(this.element,"c")),h.buttonMarkup({theme:this.options.theme,icon:m,shadow:!1,mini:j,iconpos:n});var u=c.createElement("div");u.className="ui-"+i,u.setAttribute("role",i),e.hasClass("favorite")&&(u.className+=" favorite"),e.add(h).wrapAll(u),h.bind({vmouseover:function(b){a(this).parent().is(".ui-disabled")&&b.stopPropagation()},vclick:function(a){if(e.is(":disabled")){a.preventDefault();return}return d._cacheVals(),e.prop("checked",i==="radio"&&!0||!e.prop("checked")),e.triggerHandler("click"),d._getInputSet().not(e).prop("checked",!1),d._updateAll(),!1}}),e.bind({vmousedown:function(){d._cacheVals()},vclick:function(){var b=a(this);b.is(":checked")?(b.prop("checked",!0),d._getInputSet().not(b).prop("checked",!1)):b.prop("checked",!1),d._updateAll()},focus:function(){h.addClass(a.mobile.focusClass)},blur:function(){h.removeClass(a.mobile.focusClass)}}),this.refresh()},_cacheVals:function(){this._getInputSet().each(function(){a(this).jqmData("cacheVal",this.checked)})},_getInputSet:function(){return this.inputtype==="checkbox"?this.element:this.element.closest("form, fieldset, :jqmData(role='page'), :jqmData(role='dialog')").find("input[name='"+this.element[0].name+"'][type='"+this.inputtype+"']")},_updateAll:function(){var b=this;this._getInputSet().each(function(){var c=a(this);(this.checked||b.inputtype==="checkbox")&&c.trigger("change"),c.focus()}).checkboxradio("refresh")},refresh:function(){var a=this.element[0],b=this.label,c=a.parentNode,d=b.find(".ui-icon");a.checked?(b.addClass(this.checkedClass).removeClass(this.uncheckedClass),d.addClass(this.checkedicon).removeClass(this.uncheckedicon),c.setAttribute(this.ariaCheckedAttr,!0)):(b.removeClass(this.checkedClass).addClass(this.uncheckedClass),d.removeClass(this.checkedicon).addClass(this.uncheckedicon),c.setAttribute(this.ariaCheckedAttr,!1)),a.disabled?this.disable():this.enable()},disable:function(){this.element.prop("disabled",!0).parent().addClass("ui-disabled")},enable:function(){this.element.prop("disabled",!1).parent().removeClass("ui-disabled")}}),a.mobile.$document.bind("pagecreate create",function(b){a.mobile.checkboxradio.prototype.enhanceWithin(b.target,!0)})}(a),function(a,b){a.widget("mobile.button",a.mobile.widget,{options:{theme:null,icon:null,iconpos:null,corners:!0,shadow:!0,iconshadow:!0,initSelector:"button, [type='button'], [type='submit'], [type='reset']"},_create:function(){var c=this.element,d,e=this.options,f,g,h=e.inline||a.mobile.getAttrFixed(c[0],"data-"+a.mobile.ns+"inline"),i=e.mini||a.mobile.getAttrFixed(c[0],"data-"+a.mobile.ns+"mini"),j="",k;if(c[0].tagName==="A"){c.hasClass("ui-btn")||c.buttonMarkup();return}this.options.theme||(this.options.theme=a.mobile.getInheritedTheme(this.element,"c")),!~c[0].className.indexOf("ui-btn-left")||(j="ui-btn-left"),!~c[0].className.indexOf("ui-btn-right")||(j="ui-btn-right");if(c.attr("type")==="submit"||c.attr("type")==="reset")j?j+=" ui-submit":j="ui-submit";a("label[for='"+c.attr("id")+"']").addClass("ui-submit"),this.button=a("<div></div>")[c.html()?"html":"text"](c.html()||c.val()).insertBefore(c).buttonMarkup({theme:e.theme,icon:e.icon,iconpos:e.iconpos,inline:h,corners:e.corners,shadow:e.shadow,iconshadow:e.iconshadow,mini:i}).addClass(j).append(c.addClass("ui-btn-hidden")),d=this.button,f=c.attr("type"),g=c.attr("name"),f!=="button"&&f!=="reset"&&g&&c.bind("vclick",function(){k===b&&(k=a("<input>",{type:"hidden",name:c.attr("name"),value:c.attr("value")}).insertBefore(c),a.mobile.$document.one("submit",function(){k.remove(),k=b}))}),c.bind({focus:function(){d.addClass(a.mobile.focusClass)},blur:function(){d.removeClass(a.mobile.focusClass)}}),this.refresh()},enable:function(){return this.element.attr("disabled",!1),this.button.removeClass("ui-disabled").attr("aria-disabled",!1),this._setOption("disabled",!1)},disable:function(){return this.element.attr("disabled",!0),this.button.addClass("ui-disabled").attr("aria-disabled",!0),this._setOption("disabled",!0)},refresh:function(){var b=this.element;b.prop("disabled")?this.disable():this.enable(),a(this.button.data("buttonElements").text)[b.html()?"html":"text"](b.html()||b.val())}}),a.mobile.$document.bind("pagecreate create",function(b){a.mobile.button.prototype.enhanceWithin(b.target,!0)})}(a),function(a,b){a.fn.controlgroup=function(b){function c(a,b){a.removeClass("ui-btn-corner-all ui-corner-top ui-corner-bottom ui-corner-left ui-corner-right ui-controlgroup-last ui-shadow").eq(0).addClass(b[0]).end().last().addClass(b[1]).addClass("ui-controlgroup-last")}return this.each(function(){var d=a(this),e=a.extend({direction:a.mobile.getAttrFixed(d[0],"data-"+a.mobile.ns+"type")||"vertical",shadow:!1,excludeInvisible:!0,mini:a.mobile.getAttrFixed(d[0],"data-"+a.mobile.ns+"mini")},b),f=d.children("legend"),g=d.children(".ui-controlgroup-label"),h=d.children(".ui-controlgroup-controls"),i=e.direction==="horizontal"?["ui-corner-left","ui-corner-right"]:["ui-corner-top","ui-corner-bottom"],j=d.find("input").first().attr("type");h.length&&h.contents().unwrap(),d.wrapInner("<div class='ui-controlgroup-controls'></div>"),f.length?(a("<div role='heading' class='ui-controlgroup-label'>"+f.html()+"</div>").insertBefore(d.children(0)),f.remove()):g.length&&d.prepend(g),d.addClass("ui-corner-all ui-controlgroup ui-controlgroup-"+e.direction),c(d.find(".ui-btn"+(e.excludeInvisible?":visible":"")).not(".ui-slider-handle"),i),c(d.find(".ui-btn-inner"),i),e.shadow&&d.addClass("ui-shadow"),e.mini&&d.addClass("ui-mini")})}}(a),function(a,b){a.mobile.$document.bind("pagecreate create",function(b){a(b.target).find("a").jqmEnhanceable().not(".ui-btn, .ui-link-inherit, :jqmData(role='none'), :jqmData(role='nojs')").addClass("ui-link")})}(a),function(a,d){function e(a,b,c,d){var e=d;return a<b?e=c+(a-b)/2:e=Math.min(Math.max(c,d-b/2),c+a-b),e}function f(){var c=a.mobile.$window;return{x:c.scrollLeft(),y:c.scrollTop(),cx:b.innerWidth||c.width(),cy:b.innerHeight||c.height()}}a.widget("mobile.popup",a.mobile.widget,{options:{theme:null,overlayTheme:null,shadow:!0,corners:!0,transition:"pop",positionTo:"origin",tolerance:null,initSelector:":jqmData(role='popup')",closeLinkSelector:"a:jqmData(rel='back')",closeLinkEvents:"click.popup",navigateEvents:"navigate.popup",closeEvents:"navigate.popup pagebeforechange.popup",history:!1},_eatEventAndClose:function(a){return a.preventDefault(),a.stopImmediatePropagation(),this.close(),!1},_resizeScreen:function(){var a=this._ui.container.outerHeight(!0);this._ui.screen.removeAttr("style"),a>this._ui.screen.height()&&this._ui.screen.height(a)},_handleWindowKeyUp:function(b){if(this._isOpen&&b.keyCode===a.mobile.keyCode.ESCAPE)return this._eatEventAndClose(b)},_maybeRefreshTimeout:function(){var b=f();if(this._resizeData){if(b.x===this._resizeData.winCoords.x&&b.y===this._resizeData.winCoords.y&&b.cx===this._resizeData.winCoords.cx&&b.cy===this._resizeData.winCoords.cy)return!1;clearTimeout(this._resizeData.timeoutId)}return this._resizeData={timeoutId:setTimeout(a.proxy(this,"_resizeTimeout"),200),winCoords:b},!0},_resizeTimeout:function(){!this._maybeRefreshTimeout()&&this.positionTo==="window"&&(this._trigger("beforeposition"),this._ui.container.removeClass("ui-selectmenu-hidden").offset(this._placementCoords(this._desiredCoords(d,d,"window"))),this._resizeScreen(),this._resizeData=null,this._orientationchangeInProgress=!1)},_handleWindowResize:function(a){this._isOpen&&this._maybeRefreshTimeout()},_handleWindowOrientationchange:function(a){this._orientationchangeInProgress||(this._ui.container.addClass("ui-selectmenu-hidden").removeAttr("style"),this._orientationchangeInProgress=!0)},_create:function(){var b={screen:a("<div class='ui-screen-hidden ui-popup-screen'></div>"),placeholder:a("<div style='display: none;'><!-- placeholder --></div>"),container:a("<div class='ui-popup-container ui-selectmenu-hidden'></div>"),arrow:a("<div class='ui-arrow'></div>")},c=this.element.closest(".ui-page"),e=this.element.attr("id"),f=this;this.options.history=this.options.history&&a.mobile.ajaxEnabled&&a.mobile.hashListeningEnabled,c.length===0&&(c=a("body")),this.options.container=this.options.container||a.mobile.pageContainer,c.append(b.screen),b.container.insertAfter(b.screen),b.placeholder.insertAfter(this.element),e&&(b.screen.attr("id",e+"-screen"),b.container.attr("id",e+"-popup"),b.placeholder.html("<!-- placeholder for "+e+" -->")),b.container.append(this.element),b.container.append(b.arrow),this.element.addClass("ui-popup"),a.extend(this,{_page:c,_ui:b,_fallbackTransition:"",_currentTransition:!1,_prereqs:null,_isOpen:!1,_tolerance:null,_resizeData:null,_orientationchangeInProgress:!1,_globalHandlers:[{src:a.mobile.$window,handler:{orientationchange:a.proxy(this,"_handleWindowOrientationchange"),resize:a.proxy(this,"_handleWindowResize"),keyup:a.proxy(this,"_handleWindowKeyUp")}}]}),a.each(this.options,function(a,b){f.options[a]=d,f._setOption(a,b,!0)}),b.screen.bind("vclick",a.proxy(this,"_eatEventAndClose")),a.each(this._globalHandlers,function(a,b){b.src.bind(b.handler)})},_applyTheme:function(a,b,c){var d=(a.attr("class")||"").split(" "),e=!0,f=null,g,h=String(b);while(d.length>0){f=d.pop(),g=(new RegExp("^ui-"+c+"-([a-z])$")).exec(f);if(g&&g.length>1){f=g[1];break}f=null}b!==f&&(a.removeClass("ui-"+c+"-"+f),b!==null&&b!=="none"&&a.addClass("ui-"+c+"-"+h))},_setTheme:function(a){this._applyTheme(this.element,a,"body")},_setOverlayTheme:function(a){this._applyTheme(this._ui.screen,a,"overlay"),this._isOpen&&this._ui.screen.addClass("in")},_setShadow:function(a){this.element.toggleClass("ui-overlay-shadow",a)},_setCorners:function(a){this.element.toggleClass("ui-corner-all",a)},_applyTransition:function(b){this._ui.container.removeClass(this._fallbackTransition),b&&b!=="none"&&(this._fallbackTransition=a.mobile._maybeDegradeTransition(b),this._ui.container.addClass(this._fallbackTransition))},_setTransition:function(a){this._currentTransition||this._applyTransition(a)},_setTolerance:function(b){var c={t:5,r:5,b:5,l:5};if(b){var d=String(b).split(",");a.each(d,function(a,b){d[a]=parseInt(b,10)});switch(d.length){case 1:isNaN(d[0])||(c.t=c.r=c.b=c.l=d[0]);break;case 2:isNaN(d[0])||(c.t=c.b=d[0]),isNaN(d[1])||(c.l=c.r=d[1]);break;case 4:isNaN(d[0])||(c.t=d[0]),isNaN(d[1])||(c.r=d[1]),isNaN(d[2])||(c.b=d[2]),isNaN(d[3])||(c.l=d[3]);break;default:}}this._tolerance=c},_setOption:function(b,c){var e,f="_set"+b.charAt(0).toUpperCase()+b.slice(1);this[f]!==d&&this[f](c),e=["initSelector","closeLinkSelector","closeLinkEvents","navigateEvents","closeEvents","history","container"],a.mobile.widget.prototype._setOption.apply(this,arguments),a.inArray(b,e)===-1&&this.element.attr("data-"+(a.mobile.ns||"")+b.replace(/([A-Z])/,"-$1").toLowerCase(),c)},_placementCoords:function(d){var g=f(),h={x:this._tolerance.l,y:g.y+this._tolerance.t,cx:g.cx-this._tolerance.l-this._tolerance.r,cy:g.cy-this._tolerance.t-this._tolerance.b},i,j,k=a(this.link).offset(),l=[],m=[0,0],n;this._ui.container.css("max-width",h.cx),i={cx:this._ui.container.outerWidth(!0),cy:this._ui.container.outerHeight(!0)},j={x:e(h.cx,i.cx,h.x,d.x),y:e(h.cy,i.cy,h.y,d.y)},j.y=Math.max(0,j.y);var o=c.documentElement,p=c.body,q=Math.max(o.clientHeight,p.scrollHeight,p.offsetHeight,o.scrollHeight,o.offsetHeight);j.y-=Math.min(j.y,Math.max(0,j.y+i.cy-q));if(this.positionTo!=="origin")return{left:j.x,top:j.y,arrowleft:0,arrowtop:0};l=[k.left,k.top,o.clientHeight-(k.top+a(this.link).height()),o.clientWidth-(k.left+a(this.link).width())],n=l.indexOf(Math.max.apply(b,l));switch(n){case 0:m=[-a(this.link).width(),0],arrowtop=k.top-j.y+a(this.link).height()/2-parseInt(a(this._ui.arrow).css("border-width")),arrowleft=i.cx,a(this._ui.arrow).attr("class","").addClass("ui-arrow left");break;case 1:m=[0,-(j.y+i.cy-k.top)],arrowtop=i.cy-2,arrowleft=k.left-j.x+m[0]+a(this.link).width()/2-parseInt(a(this._ui.arrow).css("border-width"))/2,a(this._ui.arrow).attr("class","").addClass("ui-arrow bottom");break;case 2:m=[0,k.top+a(this.link).height()-j.y],arrowtop=-parseInt(a(this._ui.arrow).css("border-width"))*2+1,arrowleft=k.left-j.x+m[0]+a(this.link).width()/2-parseInt(a(this._ui.arrow).css("border-width"))/2,a(this._ui.arrow).attr("class","").addClass("ui-arrow top");break;case 3:m=[i.cx<a(this.link).width()?a(this.link).width()/2+i.cx/2:a(this.link).width(),0],arrowtop=k.top-j.y+a(this.link).height()/2-parseInt(a(this._ui.arrow).css("border-width")),arrowleft=-parseInt(a(this._ui.arrow).css("border-width"))*2,a(this._ui.arrow).attr("class","").addClass("ui-arrow right")}return{left:j.x+m[0],top:j.y+m[1],arrowleft:arrowleft,arrowtop:arrowtop}},_createPrereqs:function(b,c,d){var e=this,f;f={screen:a.Deferred(),container:a.Deferred()},f.screen.then(function(){f===e._prereqs&&b()}),f.container.then(function(){f===e._prereqs&&c()}),a.when(f.screen,f.container).done(function(){f===e._prereqs&&(e._prereqs=null,d())}),e._prereqs=f},_animate:function(b){this._ui.screen.removeClass(b.classToRemove).addClass(b.screenClassToAdd),b.prereqs.screen.resolve(),b.transition&&b.transition!=="none"?(b.applyTransition&&this._applyTransition(b.transition),this._ui.container.animationComplete(a.proxy(b.prereqs.container,"resolve")).addClass(b.containerClassToAdd).removeClass(b.classToRemove)):b.prereqs.container.resolve()},_desiredCoords:function(b,c,d){var e=null,g,h=f();if(d&&d!=="origin")if(d==="window")b=h.cx/2+h.x,c=h.cy/2+h.y;else{try{e=a(d)}catch(i){e=null}e&&(e.filter(":visible"),e.length===0&&(e=null))}e&&(g=e.offset(),b=g.left+e.outerWidth()/2,c=g.top+e.outerHeight()/2);if(a.type(b)!=="number"||isNaN(b))b=h.cx/2+h.x;if(a.type(c)!=="number"||isNaN(c))c=h.cy/2+h.y;return{x:b,y:c}},_openPrereqsComplete:function(){var a=this;a._ui.container.addClass("ui-popup-active"),a._isOpen=!0,a._resizeScreen(),setTimeout(function(){a._ui.container.attr("tabindex","0").focus(),a._trigger("afteropen")})},_open:function(c){var d,e,f=function(){var a=b,c=navigator.userAgent,d=c.match(/AppleWebKit\/([0-9\.]+)/),e=!!d&&d[1],f=c.match(/Android (\d+(?:\.\d+))/),g=!!f&&f[1],h=c.indexOf("Chrome")>-1;return f!==null&&g==="4.0"&&e&&e>534.13&&!h?!0:!1}();c=c||{},e=c.transition||this.options.transition,this._trigger("beforeposition"),d=this._placementCoords(this._desiredCoords(c.x,c.y,c.positionTo||this.options.positionTo||"origin")),this._createPrereqs(a.noop,a.noop,a.proxy(this,"_openPrereqsComplete")),e?(this._currentTransition=e,this._applyTransition(e)):e=this.options.transition,this.options.theme||this._setTheme(this._page.jqmData("theme")||a.mobile.getInheritedTheme(this._page,"c")),this._ui.screen.removeClass("ui-screen-hidden"),this._ui.container.removeClass("ui-selectmenu-hidden").offset(d),this._ui.arrow.css({top:d.arrowtop,left:d.arrowleft}),this.options.overlayTheme&&f&&this.element.closest(".ui-page").addClass("ui-popup-open"),this._animate({additionalCondition:!0,transition:e,classToRemove:"",screenClassToAdd:"in",containerClassToAdd:"in",applyTransition:!1,prereqs:this._prereqs})},_closePrereqScreen:function(){this._ui.screen.removeClass("out").addClass("ui-screen-hidden")},_closePrereqContainer:function(){this._ui.container.removeClass("reverse out").addClass("ui-selectmenu-hidden").removeAttr("style")},_closePrereqsDone:function(){var b=this,c=b.options;b._ui.container.removeAttr("tabindex"),c.container.unbind(c.closeEvents),b.element.undelegate(c.closeLinkSelector,c.closeLinkEvents),a.mobile.popup.active=d,b._trigger("afterclose")},_close:function(){this._ui.container.removeClass("ui-popup-active"),this._page.removeClass("ui-popup-open"),this._isOpen=!1,this.element.find("input").blur(),this._createPrereqs(a.proxy(this,"_closePrereqScreen"),a.proxy(this,"_closePrereqContainer"),a.proxy(this,"_closePrereqsDone")),this._animate({additionalCondition:this._ui.screen.hasClass("in"),transition:this._currentTransition||this.options.transition,classToRemove:"in",screenClassToAdd:"out",containerClassToAdd:"reverse out",applyTransition:!0,prereqs:this._prereqs})},_destroy:function(){var b=this;b._close(),b._setTheme("none"),b.element.insertAfter(b._ui.placeholder).removeClass("ui-popup ui-overlay-shadow ui-corner-all"),b._ui.screen.remove(),b._ui.container.remove(),b._ui.placeholder.remove(),a.each(b._globalHandlers,function(b,c){a.each(c.handler,function(a,b){c.src.unbind(a,b)})})},_bindContainerClose:function(){var b=this;b.options.container.one(b.options.closeEvents,a.proxy(b._close,b))},open:function(b){var c=this,e=this.options,f,g,h,i,j,k;if(a.mobile.popup.active)return;a.mobile.popup.active=this,b||(b=[]),b.link?c.link=b.link:event?c.link=a(event.target).closest("a")[0]||a(event.target).closest("div")[0]:c.positionTo="window",event&&(c.positionTo=b!=null&&b.positionTo!=null?b.positionTo:"origin"),a(c.link).jqmData("position-to")!=="window"&&c.positionTo!=="window"?(a(c.element).addClass("ui-ctxpopup"),a(c._ui.container).removeClass("ui-popup-container").addClass("ui-ctxpopup-container"),c.positionTo!=="origin"?a(c._ui.arrow).hide():a(c._ui.arrow).show()):(a(c._ui.arrow).hide(),this._setOverlayTheme("dim")),!b.x&&c.positionTo==="origin"&&(b.x=a(c.link).offset().left+a(c.link).outerWidth()/2),!b.y&&c.positionTo==="origin"&&(b.y=a(c.link).offset().top+a(c.link).outerHeight()/2);if(!e.history){c._open(b),c._bindContainerClose(),c.element.delegate(e.closeLinkSelector,e.closeLinkEvents,function(a){return c._close(),!1});return}g=a.mobile.dialogHashKey,h=a.mobile.activePage,i=h.is(".ui-dialog"),f=a.mobile.urlHistory.getActive().url,j=f.indexOf(g)>-1&&!i,k=a.mobile.urlHistory;if(j){c._open(b),c._bindContainerClose();return}f.indexOf(g)===-1&&!i?f+=g:f=a.mobile.path.parseLocation().hash+g,k.activeIndex===0&&f===k.initialDst&&(f+=g),e.container.one(e.navigateEvents,function(a){a.preventDefault(),c._open(b),c._bindContainerClose()}),k.ignoreNextHashChange=i,k.addNew(f,d,d,d,"dialog"),a.mobile.path.set(f)},close:function(){if(!a.mobile.popup.active)return;this.options.history?a.mobile.back():this._close()}}),a.mobile.popup.handleLink=function(b){var c=b.closest(":jqmData(role='page')"),d=c.length===0?a("body"):c,e=a(a.mobile.path.parseUrl(b.attr("href")).hash,d[0]),f;e.data("popup")&&(f=b.offset(),e.popup("open",{x:f.left+b.outerWidth()/2,y:f.top+b.outerHeight()/2,transition:a.mobile.getAttrFixed(b[0],"data-"+a.mobile.ns+"transition"),positionTo:a.mobile.getAttrFixed(b[0],"data-"+a.mobile.ns+"position-to"),link:b})),setTimeout(function(){b.removeClass(a.mobile.activeBtnClass)},300)},a.mobile.$document.bind("pagebeforechange",function(b,c){c.options.role==="popup"&&(a.mobile.popup.handleLink(c.options.link),b.preventDefault())}),a.mobile.$document.bind("pagecreate create",function(b){a.mobile.popup.prototype.enhanceWithin(b.target,!0)})}(a),function(a){var b=a("meta[name=viewport]"),c=b.attr("content"),d=c+",maximum-scale=1, user-scalable=no",e=c+",maximum-scale=10, user-scalable=yes",f=/(user-scalable[\s]*=[\s]*no)|(maximum-scale[\s]*=[\s]*1)[$,\s]/.test(c);a.mobile.zoom=a.extend({},{enabled:!f,locked:!1,disable:function(c){!f&&!a.mobile.zoom.locked&&(b.attr("content",d),a.mobile.zoom.enabled=!1,a.mobile.zoom.locked=c||!1)},enable:function(c){!f&&(!a.mobile.zoom.locked||c===!0)&&(b.attr("content",e),a.mobile.zoom.enabled=!0,a.mobile.zoom.locked=!1)},restore:function(){f||(b.attr("content",c),a.mobile.zoom.enabled=!0)}})}(a),function(a,c){a.widget("mobile.textinput",a.mobile.widget,{options:{theme:null,preventFocusZoom:/iPhone|iPad|iPod/.test(navigator.platform)&&navigator.userAgent.indexOf("AppleWebKit")>-1,initSelector:"input[type='text'], input[type='number'], :jqmData(type='number'), input[type='password'], input[type='email'], input[type='url'], input[type='tel'], textarea, input[type='time'], input[type='date'], input[type='month'], input[type='week'], input[type='datetime'], input[type='datetime-local'], input[type='color'], input:not([type])",disabled:!1},_create:function(){function l(){setTimeout(function(){k.toggleClass("ui-input-clear-hidden",!d.val())},0)}var c=this,d=this.element,e=this.options,f=e.theme||a.mobile.getInheritedTheme(this.element,"c"),g=" ui-body-"+f,h=a.mobile.getAttrFixed(d[0],"data-"+a.mobile.ns+"mini")===!0,i=h?" ui-mini":"",j,k;a("label[for='"+d.attr("id")+"']").addClass("ui-input-text"),j=d.addClass("ui-input-text ui-body-"+f);switch(d.attr("type")){case"text":case"password":case"number":case"email":case"url":case"tel":d.attr({role:"textbox","aria-label":"Keyboard opened"});break;default:d.prop("tagName").toLowerCase()==="textarea"&&d.attr({role:"textbox","aria-label":"Keyboard opened"})}typeof d[0].autocorrect!="undefined"&&!a.support.touchOverflow&&(d[0].setAttribute("autocorrect","off"),d[0].setAttribute("autocomplete","off")),d.focus(function(){j.addClass(a.mobile.focusClass)}).blur(function(){j.removeClass(a.mobile.focusClass)}).bind("focus",function(){e.preventFocusZoom&&a.mobile.zoom.disable(!0)}).bind("blur",function(){e.preventFocusZoom&&a.mobile.zoom.enable(!0)});if(d.is("textarea")){var m=15,n=100,o;this._keyup=function(){var a=d[0].scrollHeight,c=d[0].clientHeight;c<a&&b.innerHeight/2>a&&d.height(a+m)},d.keyup(function(){clearTimeout(o),o=setTimeout(c._keyup,n)}),this._on(a.mobile.$document,{pagechange:"_keyup"}),a.trim(d.val())&&this._on(a.mobile.$window,{load:"_keyup"})}d.attr("disabled")&&this.disable()},disable:function(){var a;if(!this.element.attr("disabled",!0))return;return a=this.element,a.addClass("ui-disabled"),this._setOption("disabled",!0)},enable:function(){var a;if(!this.element.attr("disabled",!1))return;return a=this.element,a.removeClass("ui-disabled"),this._setOption("disabled",!1)}}),a.mobile.$document.bind("pagecreate create",function(b){a.mobile.textinput.prototype.enhanceWithin(b.target,!0)})}(a),function(a,b){a.mobile.listview.prototype.options.filter=!1,a.mobile.listview.prototype.options.filterPlaceholder="",a.mobile.listview.prototype.options.filterTheme="c";var c=function(a,b,c){return a.toString().toLowerCase().indexOf(b)===-1};a.mobile.listview.prototype.options.filterCallback=c,a.mobile.$document.delegate(":jqmData(role='listview')","listviewcreate",function(){var b=a(this),d=b.data("listview");if(!d.options.filter)return;var e=a("<form>",{"class":"ui-listview-filter ui-bar-"+d.options.filterTheme,role:"search"}),f=a("<input>",{placeholder:d.options.filterPlaceholder}).attr("data-"+a.mobile.ns+"type","search").jqmData("lastval","").bind("keyup change",function(){var e=a(this),f=this.value.toLowerCase(),g=null,h=e.jqmData("lastval")+"",i=!1,j="",k,l=d.options.filterCallback!==c;d._trigger("beforefilter","beforefilter",{input:this}),e.jqmData("lastval",f),l||f.length<h.length||f.indexOf(h)!==0?g=b.children():g=b.children(":not(.ui-screen-hidden)");if(f){for(var m=g.length-1;m>=0;m--)k=a(g[m]),j=a.mobile.getAttrFixed(k[0],"data-"+a.mobile.ns+"filtertext")||k.text(),k.is("li:jqmData(role=list-divider)")?(k.toggleClass("ui-filter-hidequeue",!i),i=!1):d.options.filterCallback(j,f,k)?k.toggleClass("ui-filter-hidequeue",!0):i=!0;g.filter(":not(.ui-filter-hidequeue)").toggleClass("ui-screen-hidden",!1),g.filter(".ui-filter-hidequeue").toggleClass("ui-screen-hidden",!0).toggleClass("ui-filter-hidequeue",!1)}else g.toggleClass("ui-screen-hidden",!1);d._refreshCorners()}).appendTo(e).textinput();d.options.inset&&e.addClass("ui-listview-filter-inset"),e.bind("submit",function(){return!1}).insertBefore(b)})}(a),function(a,d){a.widget("mobile.slider",a.mobile.widget,{widgetEventPrefix:"slide",options:{theme:null,trackTheme:null,disabled:!1,initSelector:"input[type='range'], :jqmData(type='range'), :jqmData(role='slider')",mini:!1},_create:function(){var e=this,f=this.element,g=a.mobile.getInheritedTheme(f,"c"),h=this.options.theme||g,i=this.options.trackTheme||g,j=f[0].nodeName.toLowerCase(),k=j==="select"?"ui-slider-switch":"",l=f.attr("id"),m=a("[for='"+l+"']"),n=m.attr("id")||l+"-label",o=m.attr("id",n),p=function(){return j==="input"?parseFloat(f.val()):f[0].selectedIndex},q=j==="input"?
+parseFloat(f.attr("min")):0,r=j==="input"?parseFloat(f.attr("max")):f.find("option").length-1,s=b.parseFloat(f.attr("step")||1),t=this.options.inline||a.mobile.getAttrFixed(f[0],"data-"+a.mobile.ns+"inline")===!0?" ui-slider-inline":"",u=this.options.mini||a.mobile.getAttrFixed(f[0],"data-"+a.mobile.ns+"min")?" ui-slider-mini":"",v=c.createElement("a"),w=a(v),x=c.createElement("div"),y=a(x),z=a.mobile.getAttrFixed(f[0],"data-"+a.mobile.ns+"highlight")!==!1&&j!=="select"?function(){var b=c.createElement("div");return b.className="ui-slider-bg "+a.mobile.activeBtnClass+" ui-btn-corner-all",a(b).prependTo(y)}():!1,A;this._type=j,v.setAttribute("href","#"),x.setAttribute("role","application"),x.className=["ui-slider ",k," ui-btn-down-",i," ui-btn-corner-all",t,u].join(""),v.className="ui-slider-handle",x.appendChild(v),a(f).find("option").length&&a(f).find("option").text()===""&&a(x).addClass("ui-toggle-switch"),w.buttonMarkup({corners:!0,theme:h,shadow:!0}).attr({role:"slider","aria-valuemin":q,"aria-valuemax":r,"aria-valuenow":p(),"aria-valuetext":p(),title:p(),"aria-labelledby":n}),a.extend(this,{slider:y,handle:w,valuebg:z,dragging:!1,beforeStart:null,userModified:!1,mouseMoved:!1});if(j==="select"){var B=c.createElement("div");B.className="ui-slider-inneroffset";for(var C=0,D=x.childNodes.length;C<D;C++)B.appendChild(x.childNodes[C]);x.appendChild(B),w.addClass("ui-slider-handle-snapping"),A=f.find("option");for(var E=0,F=A.length;E<F;E++){var G=E?"a":"b",H=E?" "+a.mobile.activeBtnClass:" ui-btn-down-"+i,I=c.createElement("div"),J=c.createElement("span");J.className=["ui-slider-label ui-slider-label-",G,H," ui-btn-corner-all"].join(""),J.setAttribute("role","img"),J.appendChild(c.createTextNode(A[E].innerHTML)),a(J).html()?a(J).html(a(J).text()):a(J).html(),a(J).prependTo(y)}e._labels=a(".ui-slider-label",y)}o.addClass("ui-slider"),f.addClass(j==="input"?"ui-slider-input":"ui-slider-switch").change(function(){e.mouseMoved||e.refresh(p(),!0)}).keyup(function(){e.refresh(p(),!0,!0)}).blur(function(){e.refresh(p(),!0)}),this._preventDocumentDrag=function(a){if(e.dragging&&!e.options.disabled)return e.mouseMoved=!0,j==="select"&&w.removeClass("ui-slider-handle-snapping"),e.refresh(a),e.userModified=e.beforeStart!==f[0].selectedIndex,!1},this._on(a.mobile.$document,{vmousemove:this._preventDocumentDrag}),f.bind("vmouseup",a.proxy(e._checkedRefresh,e)),y.bind("vmousedown",function(a){return e.options.disabled?!1:(e.dragging=!0,e.userModified=!1,e.mouseMoved=!1,j==="select"&&(e.beforeStart=f[0].selectedIndex),e.refresh(a),e._trigger("start"),!1)}).bind("vclick",!1),this._sliderMouseUp=function(){if(e.dragging)return e.dragging=!1,j==="select"&&(w.addClass("ui-slider-handle-snapping"),e.mouseMoved?e.userModified?e.refresh(e.beforeStart===0?1:0):e.refresh(e.beforeStart):e.refresh(e.beforeStart===0?1:0)),e.mouseMoved=!1,e._trigger("stop"),!1},this._on(y.add(c),{vmouseup:this._sliderMouseUp}),y.insertAfter(f),j==="select"&&this.handle.bind({focus:function(){y.addClass(a.mobile.focusClass)},blur:function(){y.removeClass(a.mobile.focusClass)}}),this.handle.bind({vmousedown:function(){a(this).focus()},vclick:!1,keydown:function(b){var c=p();if(e.options.disabled)return;switch(b.keyCode){case a.mobile.keyCode.HOME:case a.mobile.keyCode.END:case a.mobile.keyCode.PAGE_UP:case a.mobile.keyCode.PAGE_DOWN:case a.mobile.keyCode.UP:case a.mobile.keyCode.RIGHT:case a.mobile.keyCode.DOWN:case a.mobile.keyCode.LEFT:b.preventDefault(),e._keySliding||(e._keySliding=!0,a(this).addClass("ui-state-active"))}switch(b.keyCode){case a.mobile.keyCode.HOME:e.refresh(q);break;case a.mobile.keyCode.END:e.refresh(r);break;case a.mobile.keyCode.PAGE_UP:case a.mobile.keyCode.UP:case a.mobile.keyCode.RIGHT:e.refresh(c+s);break;case a.mobile.keyCode.PAGE_DOWN:case a.mobile.keyCode.DOWN:case a.mobile.keyCode.LEFT:e.refresh(c-s)}},keyup:function(b){e._keySliding&&(e._keySliding=!1,a(this).removeClass("ui-state-active"))}}),this.refresh(d,d,!0)},_checkedRefresh:function(){this.value!=this._value()&&this.refresh(this._value())},_value:function(){return this._type==="input"?parseFloat(this.element.val()):this.element[0].selectedIndex},refresh:function(b,c,d){var e=!1,f;a(this.handle).parents().is(".ui-toggle-switch")&&(e=!0),(this.options.disabled||this.element.attr("disabled"))&&this.disable(),this.value=this._value();var g=this.element,h,i=g[0].nodeName.toLowerCase(),j=i==="input"?parseFloat(g.attr("min")):0,k=i==="input"?parseFloat(g.attr("max")):g.find("option").length-1,l=i==="input"&&parseFloat(g.attr("step"))>0?parseFloat(g.attr("step")):1;if(typeof b=="object"){var m=b,n=8;if(!this.dragging||m.pageX<this.slider.offset().left-n||m.pageX>this.slider.offset().left+this.slider.width()+n)return;h=Math.round((m.pageX-this.slider.offset().left)/this.slider.width()*100)}else b==null&&(b=i==="input"?parseFloat(g.val()||0):g[0].selectedIndex),h=(parseFloat(b)-j)/(k-j)*100;if(isNaN(h))return;h<0&&(h=0),h>100&&(h=100);var o=h/100*(k-j)+j,p=(o-j)%l,q=o-p;Math.abs(p)*2>=l&&(q+=p>0?l:-l),o=parseFloat(q.toFixed(5)),o<j&&(o=j),o>k&&(o=k),this.handle.css("left",h+"%"),this.handle.attr({"aria-valuenow":i==="input"?o:g.find("option").eq(o).attr("value"),"aria-valuetext":i==="input"?o:g.find("option").eq(o).getEncodedText(),title:i==="input"?o:g.find("option").eq(o).getEncodedText()}),e||this.valuebg&&this.valuebg.css("width",h+"%");if(e)f=a(this.handle).parents(".ui-slider"),a(this.handle).attr("aria-valuenow")==="on"?(f.children("span.ui-slider-label-a").show(),f.children("span.ui-slider-label-b").hide()):(f.children("span.ui-slider-label-b").show(),f.children("span.ui-slider-label-a").hide());else if(this._labels){var r=this.handle.width()/this.slider.width()*100,s=h&&r+(100-r)*h/100,t=h===100?0:Math.min(r+100-s,100);this._labels.each(function(){var b=a(this).is(".ui-slider-label-a");a(this).width((b?s:t)+"%")})}if(!d){var u=!1;i==="input"?(u=g.val()!==o,g.val(o)):(u=g[0].selectedIndex!==o,g[0].selectedIndex=o),!c&&u&&g.trigger("change")}},enable:function(){return this.element.attr("disabled",!1),this.slider.removeClass("ui-disabled").attr("aria-disabled",!1),this._setOption("disabled",!1)},disable:function(){return this.element.attr("disabled",!0),this.slider.addClass("ui-disabled").attr("aria-disabled",!0),this._setOption("disabled",!0)}}),a.mobile.$document.bind("pagecreate create",function(b){a.mobile.slider.prototype.enhanceWithin(b.target,!0)})}(a),function(a,d){a.widget("mobile.selectmenu",a.mobile.widget,{options:{theme:null,disabled:!1,icon:"arrow-d",iconpos:"right",inline:!1,corners:!0,shadow:!0,iconshadow:!0,overlayTheme:"a",hidePlaceholderMenuItems:!0,closeText:"Close",nativeMenu:!0,preventFocusZoom:/iPhone|iPad|iPod/.test(navigator.platform)&&navigator.userAgent.indexOf("AppleWebKit")>-1,initSelector:"select:not( :jqmData(role='slider') )",mini:!1},_button:function(){return a("<div/>")},_setDisabled:function(a){return this.element.attr("disabled",a),this.button.attr("aria-disabled",a),this._setOption("disabled",a)},_focusButton:function(){var a=this;setTimeout(function(){a.button.focus()},40)},_selectOptions:function(){return this.select.find("option")},_preExtension:function(){var b="";!~this.element[0].className.indexOf("ui-btn-left")||(b=" ui-btn-left"),!~this.element[0].className.indexOf("ui-btn-right")||(b=" ui-btn-right"),this.select=this.element.wrap("<div class='ui-select"+b+"'>"),this.selectID=this.select.attr("id"),this.label=a("label[for='"+this.selectID+"']").addClass("ui-select"),this.isMultiple=this.select[0].multiple,this.options.theme||(this.options.theme=a.mobile.getInheritedTheme(this.select,"c"))},_create:function(){this._preExtension(),this._trigger("beforeCreate"),this.button=this._button();var c=this,d=this.options,e=d.inline||a.mobile.getAttrFixed(this.select[0],"data-"+a.mobile.ns+"inline"),f=d.mini||a.mobile.getAttrFixed(this.select[0],"data-"+a.mobile.ns+"mini"),g=d.icon?d.iconpos||a.mobile.getAttrFixed(this.select[0],"data-"+a.mobile.ns+"iconpos"):!1,h=this.select[0].selectedIndex===-1?0:this.select[0].selectedIndex,i=this.button.insertBefore(this.select).buttonMarkup({theme:d.theme,icon:d.icon,iconpos:g,inline:e,corners:d.corners,shadow:d.shadow,iconshadow:d.iconshadow,mini:f});this.setButtonText(),d.nativeMenu&&b.opera&&b.opera.version&&i.addClass("ui-select-nativeonly"),this.isMultiple&&(this.buttonCount=a("<span>").addClass("ui-li-count ui-btn-up-c ui-btn-corner-all").hide().appendTo(i.addClass("ui-li-has-count"))),(d.disabled||this.element.attr("disabled"))&&this.disable(),this.select.change(function(){c.refresh()}),this.build()},build:function(){var b=this;this.select.appendTo(b.button).bind("vmousedown",function(){b.button.addClass(a.mobile.activeBtnClass)}).bind("focus",function(){b.button.addClass(a.mobile.focusClass)}).bind("blur",function(){b.button.removeClass(a.mobile.focusClass)}).bind("focus vmouseover",function(){b.button.trigger("vmouseover")}).bind("vmousemove",function(){b.button.removeClass(a.mobile.activeBtnClass)}).bind("change blur vmouseout",function(){b.button.trigger("vmouseout").removeClass(a.mobile.activeBtnClass)}).bind("change blur",function(){b.button.removeClass("ui-btn-down-"+b.options.theme)}),b.button.bind("vmousedown",function(){b.options.preventFocusZoom&&a.mobile.zoom.disable(!0)}).bind("mouseup",function(){b.options.preventFocusZoom&&setTimeout(function(){a.mobile.zoom.enable(!0)},0)})},selected:function(){return this._selectOptions().filter(":selected")},selectedIndices:function(){var a=this;return this.selected().map(function(){return a._selectOptions().index(this)}).get()},setButtonText:function(){var b=this,d=this.selected(),e=this.placeholder,f=a(c.createElement("span"));this.button.find(".ui-btn-text").html(function(){return d.length?e=d.map(function(){return a(this).text()}).get().join(", "):e=b.placeholder,f.text(e).addClass(b.select.attr("class")).addClass(d.attr("class"))})},setButtonCount:function(){var a=this.selected();this.isMultiple&&this.buttonCount[a.length>1?"show":"hide"]().text(a.length)},refresh:function(){this.setButtonText(),this.setButtonCount()},open:a.noop,close:a.noop,disable:function(){this._setDisabled(!0),this.button.addClass("ui-disabled")},enable:function(){this._setDisabled(!1),this.button.removeClass("ui-disabled")}}),a.mobile.$document.bind("pagecreate create",function(b){a.mobile.selectmenu.prototype.enhanceWithin(b.target,!0)})}(a),function(a,b){var d=function(b){var d=b.select,e=b.selectID,f=b.label,g=b.select.closest(".ui-page"),h=b._selectOptions(),i=b.isMultiple=b.select[0].multiple,j=e+"-button",k=e+"-menu",l=a("<div data-"+a.mobile.ns+"role='dialog' data-"+a.mobile.ns+"theme='"+b.options.theme+"' data-"+a.mobile.ns+"overlay-theme='"+b.options.overlayTheme+"'>"+"<div data-"+a.mobile.ns+"role='header'>"+"<div class='ui-title'>"+f.getEncodedText()+"</div>"+"</div>"+"<div data-"+a.mobile.ns+"role='content'></div>"+"</div>"),m=a("<div>",{"class":"ui-selectmenu"}).insertAfter(b.select).popup({theme:"a"}),n=a("<ul>",{"class":"ui-selectmenu-list",id:k,role:"listbox","aria-labelledby":j}).attr("data-"+a.mobile.ns+"theme",b.options.theme).appendTo(m),o=a("<div>",{"class":"ui-header ui-bar-"+b.options.theme}).prependTo(m),p=a("<h1>",{"class":"ui-title"}).appendTo(o),q,r,s;b.isMultiple&&(s=a("<a>",{text:b.options.closeText,href:"#","class":"ui-btn-left"}).attr("data-"+a.mobile.ns+"iconpos","notext").attr("data-"+a.mobile.ns+"icon","delete").appendTo(o).buttonMarkup()),a.extend(b,{select:b.select,selectID:e,buttonId:j,menuId:k,thisPage:g,menuPage:l,label:f,selectOptions:h,isMultiple:i,theme:b.options.theme,listbox:m,list:n,header:o,headerTitle:p,headerClose:s,menuPageContent:q,menuPageClose:r,placeholder:"",build:function(){var c=this;c.refresh(),c.select.attr("tabindex","-1").focus(function(){a(this).blur(),c.button.focus()}),c.button.bind("vclick keydown",function(b){if(b.type==="vclick"||b.keyCode&&(b.keyCode===a.mobile.keyCode.ENTER||b.keyCode===a.mobile.keyCode.SPACE))c.open(),b.preventDefault()}),c.list.attr("role","listbox").bind("focusin",function(b){a(b.target).attr("tabindex","0").trigger("vmouseover")}).bind("focusout",function(b){a(b.target).attr("tabindex","-1").trigger("vmouseout")}).delegate("li:not(.ui-disabled, .ui-li-divider)","click",function(d){var e=c.select[0].selectedIndex,f=c.list.find("li:not(.ui-li-divider)").index(this),g=c._selectOptions().eq(f)[0];g.selected=c.isMultiple?!g.selected:!0,c.isMultiple&&a(this).find(".ui-icon").toggleClass("ui-icon-checkbox-on",g.selected).toggleClass("ui-icon-checkbox-off",!g.selected),(c.isMultiple||e!==f)&&c.select.trigger("change"),c.isMultiple?c.list.find("li:not(.ui-li-divider)").eq(f).addClass("ui-btn-down-"+b.options.theme).find("a").first().focus():c.close(),d.preventDefault()}).keydown(function(c){var d=a(c.target),e=d.closest("li"),f,g;switch(c.keyCode){case 38:return f=e.prev().not(".ui-selectmenu-placeholder"),f.is(".ui-li-divider")&&(f=f.prev()),f.length&&(d.blur().attr("tabindex","-1"),f.addClass("ui-btn-down-"+b.options.theme).find("a").first().focus()),!1;case 40:return g=e.next(),g.is(".ui-li-divider")&&(g=g.next()),g.length&&(d.blur().attr("tabindex","-1"),g.addClass("ui-btn-down-"+b.options.theme).find("a").first().focus()),!1;case 13:case 32:return d.trigger("click"),!1}}),c.menuPage.bind("pagehide",function(){c.list.appendTo(c.listbox),c._focusButton(),a.mobile._bindPageRemove.call(c.thisPage)}),c.listbox.bind("popupafterclose",function(a){c.close()}),c.isMultiple&&c.headerClose.click(function(){if(c.menuType==="overlay")return c.close(),!1}),c.thisPage.addDependents(this.menuPage)},_isRebuildRequired:function(){var a=this.list.find("li"),b=this._selectOptions();return b.text()!==a.text()},selected:function(){return this._selectOptions().filter(":selected:not( :jqmData(placeholder='true') )")},refresh:function(b,c){var d=this,e=this.element,f=this.isMultiple,g;(b||this._isRebuildRequired())&&d._buildList(),g=this.selectedIndices(),d.setButtonText(),d.setButtonCount(),d.list.find("li:not(.ui-li-divider)").removeClass(a.mobile.activeBtnClass).attr("aria-selected",!1).each(function(b){if(a.inArray(b,g)>-1){var c=a(this);c.attr("aria-selected",!0),d.isMultiple?c.find(".ui-icon").removeClass("ui-icon-checkbox-off").addClass("ui-icon-checkbox-on"):c.is(".ui-selectmenu-placeholder")?c.next().addClass(a.mobile.activeBtnClass):c.addClass(a.mobile.activeBtnClass)}})},close:function(){if(this.options.disabled||!this.isOpen)return;var b=this;b.menuType==="page"?a.mobile.back():(b.listbox.popup("close"),b.list.appendTo(b.listbox),b._focusButton()),b.isOpen=!1},open:function(){function n(){var d=c.list.find("."+a.mobile.activeBtnClass+" a");d.length===0&&(d=c.list.find("li.ui-btn:not( :jqmData(placeholder='true') ) a")),d.first().focus().closest("li").addClass("ui-btn-down-"+b.options.theme)}if(this.options.disabled)return;var c=this,d=a.mobile.$window,e=c.list.parent(),f=e.outerHeight(),g=e.outerWidth(),h=a("."+a.mobile.activePageClass),i=d.scrollTop(),j=c.button.offset().top,k=d.height(),m=d.width();c.button.addClass(a.mobile.activeBtnClass),setTimeout(function(){c.button.removeClass(a.mobile.activeBtnClass)},300),f>k-80||!a.support.scrollTop?(c.menuPage.appendTo(a.mobile.pageContainer).page(),c.menuPageContent=l.find(".ui-content"),c.menuPageClose=l.find(".ui-header a"),c.thisPage.unbind("pagehide.remove"),i===0&&j>k&&c.thisPage.one("pagehide",function(){a(this).jqmData("lastScroll",j)}),c.menuPage.one("pageshow",function(){n(),c.isOpen=!0}),c.menuType="page",c.menuPageContent.append(c.list),c.menuPage.find("div .ui-title").text(c.label.text()),a.mobile.changePage(c.menuPage,{transition:a.mobile.defaultDialogTransition})):(c.menuType="overlay",c.listbox.one("popupafteropen",n).popup("open",{x:c.button.offset().left+c.button.outerWidth()/2,y:c.button.offset().top+c.button.outerHeight()/2}),c.isOpen=!0)},_buildList:function(){var b=this,d=this.options,e=this.placeholder,f=!0,g=[],h=[],i=b.isMultiple?"checkbox-off":"false";b.list.empty().filter(".ui-listview").listview("destroy");var j=b.select.find("option"),k=j.length,l=this.select[0],m="data-"+a.mobile.ns,n=m+"option-index",o=m+"icon",p=m+"role",q=m+"placeholder",r=c.createDocumentFragment(),s=!1,t;for(var u=0;u<k;u++,s=!1){var v=j[u],w=a(v),x=v.parentNode,y=w.text(),z=c.createElement("a"),A=[];z.setAttribute("href","#"),z.appendChild(c.createTextNode(y));if(x!==l&&x.nodeName.toLowerCase()==="optgroup"){var B=x.getAttribute("label");if(B!==t){var C=c.createElement("li");C.setAttribute(p,"list-divider"),C.setAttribute("role","option"),C.setAttribute("tabindex","-1"),C.appendChild(c.createTextNode(B)),r.appendChild(C),t=B}}f&&(!v.getAttribute("value")||y.length===0||w.jqmData("placeholder"))&&(f=!1,s=!0,v.setAttribute(q,!0),d.hidePlaceholderMenuItems&&A.push("ui-selectmenu-placeholder"),e||(e=b.placeholder=y));var D=c.createElement("li");v.disabled&&(A.push("ui-disabled"),D.setAttribute("aria-disabled",!0)),D.setAttribute(n,u),D.setAttribute(o,i),s&&D.setAttribute(q,!0),D.className=A.join(" "),D.setAttribute("role","option"),z.setAttribute("tabindex","-1"),D.appendChild(z),r.appendChild(D)}b.list[0].appendChild(r),!this.isMultiple&&!e.length?this.header.hide():this.headerTitle.text(this.placeholder),b.list.listview()},_button:function(){return a("<a>",{href:"#",role:"button",id:this.buttonId,"aria-haspopup":"true","aria-owns":this.menuId})}})};a.mobile.$document.bind("selectmenubeforecreate",function(b){var c=a(b.target).data("selectmenu");!c.options.nativeMenu&&c.element.parents(":jqmData(role='popup')").length===0&&d(c)})}(a),function(a,c){a.widget("mobile.fixedtoolbar",a.mobile.widget,{options:{visibleOnPageShow:!0,disablePageZoom:!0,transition:"slide",fullscreen:!1,tapToggle:!0,tapToggleBlacklist:"a, button, input, select, textarea, .ui-header-fixed, .ui-footer-fixed, .ui-popup",hideDuringFocus:"input, textarea, select",updatePagePadding:!0,trackPersistentToolbars:!0,supportBlacklist:function(){var a=b,c=navigator.userAgent,d=navigator.platform,e=c.match(/AppleWebKit\/([0-9]+)/),f=!!e&&e[1],g=c.match(/Fennec\/([0-9]+)/),h=!!g&&g[1],i=c.match(/Opera Mobi\/([0-9]+)/),j=!!i&&i[1];return(d.indexOf("iPhone")>-1||d.indexOf("iPad")>-1||d.indexOf("iPod")>-1)&&f&&f<534||a.operamini&&{}.toString.call(a.operamini)==="[object OperaMini]"||i&&j<7458||c.indexOf("Android")>-1&&f&&f<533||h&&h<6||"palmGetResource"in b&&f&&f<534||c.indexOf("MeeGo")>-1&&c.indexOf("NokiaBrowser/8.5.0")>-1?!0:!1},initSelector:":jqmData(position='dummy')"},_create:function(){var a=this,b=a.options,c=a.element,d=c.is(":jqmData(role='header')")?"header":"footer",e=c.closest(".ui-page");if(b.supportBlacklist()){a.destroy();return}c.addClass("ui-"+d+"-fixed"),b.fullscreen?(c.addClass("ui-"+d+"-fullscreen"),e.addClass("ui-page-"+d+"-fullscreen")):e.addClass("ui-page-"+d+"-fixed"),a._addTransitionClass(),a._bindPageEvents(),a._bindToggleHandlers()},_addTransitionClass:function(){var a=this.options.transition;a&&a!=="none"&&(a==="slide"&&(a=this.element.is(".ui-header")?"slidedown":"slideup"),this.element.addClass(a))},_bindPageEvents:function(){var b=this,c=b.options,d=b.element;d.closest(".ui-page").bind("pagebeforeshow",function(){c.disablePageZoom&&a.mobile.zoom.disable(!0),c.visibleOnPageShow||b.hide(!0)}).bind("webkitAnimationStart animationstart updatelayout",function(){var a=this;c.updatePagePadding&&b.updatePagePadding(a)}).bind("pageshow",function(){var d=this;b.updatePagePadding(d),c.updatePagePadding&&a.mobile.$window.bind("throttledresize."+b.widgetName,function(){b.updatePagePadding(d)})}).bind("pagebeforehide",function(d,e){c.disablePageZoom&&a.mobile.zoom.enable(!0),c.updatePagePadding&&a.mobile.$window.unbind("throttledresize."+b.widgetName);if(c.trackPersistentToolbars){var f=a(".ui-footer-fixed:jqmData(id)",this),g=a(".ui-header-fixed:jqmData(id)",this),h=f.length&&e.nextPage&&a(".ui-footer-fixed:jqmData(id='"+f.jqmData("id")+"')",e.nextPage)||a(),i=g.length&&e.nextPage&&a(".ui-header-fixed:jqmData(id='"+g.jqmData("id")+"')",e.nextPage)||a();if(h.length||i.length)h.add(i).appendTo(a.mobile.pageContainer),e.nextPage.one("pageshow",function(){h.add(i).appendTo(this)})}})},_visible:!0,updatePagePadding:function(b){var c=this.element,d=c.is(".ui-header");if(this.options.fullscreen)return;b=b||c.closest(".ui-page"),a(b).css("padding-"+(d?"top":"bottom"),c.outerHeight())},_useTransition:function(b){var c=a.mobile.$window,d=this.element,e=c.scrollTop(),f=d.height(),g=d.closest(".ui-page").height(),h=a.mobile.getScreenHeight(),i=d.is(":jqmData(role='header')")?"header":"footer";return!b&&(this.options.transition&&this.options.transition!=="none"&&(i==="header"&&!this.options.fullscreen&&e>f||i==="footer"&&!this.options.fullscreen&&e+h<g-f)||this.options.fullscreen)},show:function(a){var b="ui-fixed-hidden",c=this.element;this._useTransition(a)?c.removeClass("out "+b).addClass("in"):c.removeClass(b),this._visible=!0},hide:function(a){var b="ui-fixed-hidden",c=this.element,d="out"+(this.options.transition==="slide"?" reverse":"");this._useTransition(a)?c.addClass(d).removeClass("in").animationComplete(function(){c.addClass(b).removeClass(d)}):c.addClass(b).removeClass(d),this._visible=!1},toggle:function(){this[this._visible?"hide":"show"]()},_bindToggleHandlers:function(){var b=this,c=b.options,d=b.element;d.closest(".ui-page").bind("vclick",function(d){c.tapToggle&&!a(d.target).closest(c.tapToggleBlacklist).length&&b.toggle()}).bind("focusin focusout",function(d){screen.width<500&&a(d.target).is(c.hideDuringFocus)&&!a(d.target).closest(".ui-header-fixed, .ui-footer-fixed").length&&b[d.type==="focusin"&&b._visible?"hide":"show"]()})},destroy:function(){this.element.removeClass("ui-header-fixed ui-footer-fixed ui-header-fullscreen ui-footer-fullscreen in out fade slidedown slideup ui-fixed-hidden"),this.element.closest(".ui-page").removeClass("ui-page-header-fixed ui-page-footer-fixed ui-page-header-fullscreen ui-page-footer-fullscreen")}}),a.mobile.$document.bind("pagecreate create",function(b){a(b.target).jqmData("fullscreen")&&a(a.mobile.fixedtoolbar.prototype.options.initSelector,b.target).not(":jqmData(fullscreen)").jqmData("fullscreen",!0),a.mobile.fixedtoolbar.prototype.enhanceWithin(b.target)})}(a),function(a,b){function i(a){d=a.originalEvent,h=d.accelerationIncludingGravity,e=Math.abs(h.x),f=Math.abs(h.y),g=Math.abs(h.z),!b.orientation&&(e>7||(g>6&&f<8||g<8&&f>6)&&e>5)?c.enabled&&c.disable():c.enabled||c.enable()}if(!(/iPhone|iPad|iPod/.test(navigator.platform)&&navigator.userAgent.indexOf("AppleWebKit")>-1))return;var c=a.mobile.zoom,d,e,f,g,h;a.mobile.$window.bind("orientationchange.iosorientationfix",c.enable).bind("devicemotion.iosorientationfix",i)}(a,this),function(a,b,d){function h(){e.removeClass("ui-mobile-rendering")}var e=a("html"),f=a("head"),g=a.mobile.$window;a(b.document).trigger("mobileinit");if(!a.mobile.gradeA())return;a.mobile.ajaxBlacklist&&(a.mobile.ajaxEnabled=!1),e.addClass("ui-mobile ui-mobile-rendering"),setTimeout(h,5e3),a.extend(a.mobile,{addEventBlocker:function(){e.addClass("ui-blocker"),e.bind("touchstart touchend vclick mousedown mouseup click",function(){return!1})},removeEventBlocker:function(){e.removeClass("ui-blocker"),e.unbind("touchstart touchend vclick mousedown mouseup click")},initializePage:function(){var b=a(":jqmData(role='page'), :jqmData(role='dialog')"),d=a.mobile.path.parseLocation().hash.replace("#",""),e=c.getElementById(d);b.length||(b=a("body").wrapInner("<div data-"+a.mobile.ns+"role='page'></div>").children(0)),b.each(function(){var b=a(this);b[0].getAttribute("data-"+a.mobile.ns+"url")||b.attr("data-"+a.mobile.ns+"url",b.attr("id")||location.pathname+location.search)}),a.mobile.firstPage=b.first(),a.mobile.pageContainer=a.mobile.firstPage.parent().addClass("ui-mobile-viewport"),g.trigger("pagecontainercreate"),a.mobile.showPageLoadingMsg(),a.mobile.addEventBlocker(),h(),!a.mobile.hashListeningEnabled||!a.mobile.path.isHashValid(location.hash)||!a(e).is(':jqmData(role="page")')&&!a.mobile.path.isPath(d)&&d!==a.mobile.dialogHashKey?(a.mobile.path.isHashValid(location.hash)&&(a.mobile.urlHistory.initialDst=d.replace("#","")),a.mobile.changePage(a.mobile.firstPage,{transition:"none",reverse:!0,changeHash:!1,fromHashChange:!0})):g.trigger("hashchange",[!0])}}),a.mobile.navreadyDeferred.resolve(),a(function(){b.scrollTo(0,1),a.mobile.defaultHomeScroll=!a.support.scrollTop||a.mobile.$window.scrollTop()===1?0:1,a.fn.controlgroup&&a.mobile.$document.bind("pagecreate create",function(b){a(":jqmData(role='controlgroup')",b.target).jqmEnhanceable().controlgroup({excludeInvisible:!1})}),a.mobile.autoInitializePage&&a.mobile.initializePage(),g.load(a.mobile.silentScroll),a.support.cssPointerEvents||a.mobile.$document.delegate(".ui-disabled","vclick",function(a){a.preventDefault(),a.stopImmediatePropagation()})})}(a,this)});
+/*!
+ * Globalize
+ *
+ * http://github.com/jquery/globalize
+ *
+ * Copyright Software Freedom Conservancy, Inc.
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ */(function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z;c=function(a){return new c.prototype.init(a)},typeof require!="undefined"&&typeof exports!="undefined"&&typeof module!="undefined"?module.exports=c:a.Globalize=c,c.cultures={},c.prototype={constructor:c,init:function(a){return this.cultures=c.cultures,this.cultureSelector=a,this}},c.prototype.init.prototype=c.prototype,c.cultures["default"]={name:"en",englishName:"English",nativeName:"English",isRTL:!1,language:"en",numberFormat:{pattern:["-n"],decimals:2,",":",",".":".",groupSizes:[3],"+":"+","-":"-",NaN:"NaN",negativeInfinity:"-Infinity",positiveInfinity:"Infinity",percent:{pattern:["-n %","n %"],decimals:2,groupSizes:[3],",":",",".":".",symbol:"%"},currency:{pattern:["($n)","$n"],decimals:2,groupSizes:[3],",":",",".":".",symbol:"$"}},calendars:{standard:{name:"Gregorian_USEnglish","/":"/",":":":",firstDay:0,days:{names:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],namesAbbr:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],namesShort:["Su","Mo","Tu","We","Th","Fr","Sa"]},months:{names:["January","February","March","April","May","June","July","August","September","October","November","December",""],namesAbbr:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""]},AM:["AM","am","AM"],PM:["PM","pm","PM"],eras:[{name:"A.D.",start:null,offset:0}],twoDigitYearMax:2029,patterns:{d:"M/d/yyyy",D:"dddd, MMMM dd, yyyy",t:"h:mm tt",T:"h:mm:ss tt",f:"dddd, MMMM dd, yyyy h:mm tt",F:"dddd, MMMM dd, yyyy h:mm:ss tt",M:"MMMM dd",Y:"yyyy MMMM",S:"yyyy'-'MM'-'dd'T'HH':'mm':'ss"}}},messages:{}},c.cultures["default"].calendar=c.cultures["default"].calendars.standard,c.cultures.en=c.cultures["default"],c.cultureSelector="en",d=/^0x[a-f0-9]+$/i,e=/^[+-]?infinity$/i,f=/^[+-]?\d*\.?\d*(e[+-]?\d+)?$/,g=/^\s+|\s+$/g,h=function(a,b){if(a.indexOf)return a.indexOf(b);for(var c=0,d=a.length;c<d;c++)if(a[c]===b)return c;return-1},i=function(a,b){return a.substr(a.length-b.length)===b},j=function(a){var c,d,e,f,g,h,i=arguments[0]||{},n=1,o=arguments.length,a=!1;typeof i=="boolean"&&(a=i,i=arguments[1]||{},n=2),typeof i!="object"&&!l(i)&&(i={});for(;n<o;n++)if((c=arguments[n])!=null)for(d in c){e=i[d],f=c[d];if(i===f)continue;a&&f&&(m(f)||(g=k(f)))?(g?(g=!1,h=e&&k(e)?e:[]):h=e&&m(e)?e:{},i[d]=j(a,h,f)):f!==b&&(i[d]=f)}return i},k=Array.isArray||function(a){return Object.prototype.toString.call(a)==="[object Array]"},l=function(a){return Object.prototype.toString.call(a)==="[object Function]"},m=function(a){return Object.prototype.toString.call(a)==="[object Object]"},n=function(a,b){return a.indexOf(b)===0},o=function(a){return(a+"").replace(g,"")},p=function(a){return isNaN(a)?NaN:Math[a<0?"ceil":"floor"](a)},q=function(a,b,c){var d;for(d=a.length;d<b;d+=1)a=c?"0"+a:a+"0";return a},r=function(a,b){var c=0,d=!1;for(var e=0,f=a.length;e<f;e++){var g=a.charAt(e);switch(g){case"'":d?b.push("'"):c++,d=!1;break;case"\\":d&&b.push("\\"),d=!d;break;default:b.push(g),d=!1}}return c},s=function(a,b){b=b||"F";var c,d=a.patterns,e=b.length;if(e===1){c=d[b];if(!c)throw"Invalid date format string '"+b+"'.";b=c}else e===2&&b.charAt(0)==="%"&&(b=b.charAt(1));return b},t=function(a,b,c){function y(a,b){var c,d=a+"";return b>1&&d.length<b?(c=l[b-2]+d,c.substr(c.length-b,b)):(c=d,c)}function z(){return m||n?m:(m=o.test(b),n=!0,m)}function A(a,b){if(u)return u[b];switch(b){case 0:return a.getFullYear();case 1:return a.getMonth();case 2:return a.getDate()}}var d=c.calendar,e=d.convert;if(!b||!b.length||b==="i"){var f;if(c&&c.name.length)if(e)f=t(a,d.patterns.F,c);else{var g=new Date(a.getTime()),h=w(a,d.eras);g.setFullYear(x(a,d,h)),f=g.toLocaleString()}else f=a.toString();return f}var i=d.eras,j=b==="s";b=s(d,b),f=[];var k,l=["0","00","000"],m,n,o=/([^d]|^)(d|dd)([^d]|$)/g,p=0,q=v(),u;!j&&e&&(u=e.fromGregorian(a));for(;;){var B=q.lastIndex,C=q.exec(b),D=b.slice(B,C?C.index:b.length);p+=r(D,f);if(!C)break;if(p%2){f.push(C[0]);continue}var E=C[0],F=E.length;switch(E){case"ddd":case"dddd":var G=F===3?d.days.namesAbbr:d.days.names;f.push(G[a.getDay()]);break;case"d":case"dd":m=!0,f.push(y(A(a,2),F));break;case"MMM":case"MMMM":var H=A(a,1);f.push(d.monthsGenitive&&z()?d.monthsGenitive[F===3?"namesAbbr":"names"][H]:d.months[F===3?"namesAbbr":"names"][H]);break;case"M":case"MM":f.push(y(A(a,1)+1,F));break;case"y":case"yy":case"yyyy":H=u?u[0]:x(a,d,w(a,i),j),F<4&&(H%=100),f.push(y(H,F));break;case"h":case"hh":k=a.getHours()%12,k===0&&(k=12),f.push(y(k,F));break;case"H":case"HH":f.push(y(a.getHours(),F));break;case"m":case"mm":f.push(y(a.getMinutes(),F));break;case"s":case"ss":f.push(y(a.getSeconds(),F));break;case"t":case"tt":H=a.getHours()<12?d.AM?d.AM[0]:" ":d.PM?d.PM[0]:" ",f.push(F===1?H.charAt(0):H);break;case"f":case"ff":case"fff":f.push(y(a.getMilliseconds(),3).substr(0,F));break;case"z":case"zz":k=a.getTimezoneOffset()/60,f.push((k<=0?"+":"-")+y(Math.floor(Math.abs(k)),F));break;case"zzz":k=a.getTimezoneOffset()/60,f.push((k<=0?"+":"-")+y(Math.floor(Math.abs(k)),2)+":"+y(Math.abs(a.getTimezoneOffset()%60),2));break;case"g":case"gg":d.eras&&f.push(d.eras[w(a,i)].name);break;case"/":f.push(d["/"]);break;default:throw"Invalid date format pattern '"+E+"'."}}return f.join("")},function(){var a;a=function(a,b,c){var d=c.groupSizes,e=d[0],f=1,g=Math.pow(10,b),h=Math.round(a*g)/g;isFinite(h)||(h=a),a=h;var i=a+"",j="",k=i.split(/e/i),l=k.length>1?parseInt(k[1],10):0;i=k[0],k=i.split("."),i=k[0],j=k.length>1?k[1]:"";var m;l>0?(j=q(j,l,!1),i+=j.slice(0,l),j=j.substr(l)):l<0&&(l=-l,i=q(i,l+1),j=i.slice(-l,i.length)+j,i=i.slice(0,-l)),b>0?j=c["."]+(j.length>b?j.slice(0,b):q(j,b)):j="";var n=i.length-1,o=c[","],p="";while(n>=0){if(e===0||e>n)return i.slice(0,n+1)+(p.length?o+p+j:j);p=i.slice(n-e+1,n+1)+(p.length?o+p:""),n-=e,f<d.length&&(e=d[f],f++)}return i.slice(0,n+1)+o+p+j},u=function(b,c,d){if(!isFinite(b))return b===Infinity?d.numberFormat.positiveInfinity:b===-Infinity?d.numberFormat.negativeInfinity:d.numberFormat.NaN;if(!c||c==="i")return d.name.length?b.toLocaleString():b.toString();c=c||"D";var e=d.numberFormat,f=Math.abs(b),g=-1,h;c.length>1&&(g=parseInt(c.slice(1),10));var i=c.charAt(0).toUpperCase(),j;switch(i){case"D":h="n",f=p(f),g!==-1&&(f=q(""+f,g,!0)),b<0&&(f="-"+f);break;case"N":j=e;case"C":j=j||e.currency;case"P":j=j||e.percent,h=b<0?j.pattern[0]:j.pattern[1]||"n",g===-1&&(g=j.decimals),f=a(f*(i==="P"?100:1),g,j);break;default:throw"Bad number format specifier: "+i}var k=/n|\$|-|%/g,l="";for(;;){var m=k.lastIndex,n=k.exec(h);l+=h.slice(m,n?n.index:h.length);if(!n)break;switch(n[0]){case"n":l+=f;break;case"$":l+=e.currency.symbol;break;case"-":/[1-9]/.test(f)&&(l+=e["-"]);break;case"%":l+=e.percent.symbol}}return l}}(),v=function(){return/\/|dddd|ddd|dd|d|MMMM|MMM|MM|M|yyyy|yy|y|hh|h|HH|H|mm|m|ss|s|tt|t|fff|ff|f|zzz|zz|z|gg|g/g},w=function(a,b){if(!b)return 0;var c,d=a.getTime();for(var e=0,f=b.length;e<f;e++){c=b[e].start;if(c===null||d>=c)return e}return 0},x=function(a,b,c,d){var e=a.getFullYear();return!d&&b.eras&&(e-=b.eras[c].offset),e},function(){var a,b,c,d,e,f,g;a=function(a,b){if(b<100){var c=new Date,d=w(c),e=x(c,a,d),f=a.twoDigitYearMax;f=typeof f=="string"?(new Date).getFullYear()%100+parseInt(f,10):f,b+=e-e%100,b>f&&(b-=100)}return b},b=function(a,b,c){var d,e=a.days,i=a._upperDays;return i||(a._upperDays=i=[g(e.names),g(e.namesAbbr),g(e.namesShort)]),b=f(b),c?(d=h(i[1],b),d===-1&&(d=h(i[2],b))):d=h(i[0],b),d},c=function(a,b,c){var d=a.months,e=a.monthsGenitive||a.months,i=a._upperMonths,j=a._upperMonthsGen;i||(a._upperMonths=i=[g(d.names),g(d.namesAbbr)],a._upperMonthsGen=j=[g(e.names),g(e.namesAbbr)]),b=f(b);var k=h(c?i[1]:i[0],b);return k<0&&(k=h(c?j[1]:j[0],b)),k},d=function(a,b){var c=a._parseRegExp;if(!c)a._parseRegExp=c={};else{var d=c[b];if(d)return d}var e=s(a,b).replace(/([\^\$\.\*\+\?\|\[\]\(\)\{\}])/g,"\\\\$1"),f=["^"],g=[],h=0,i=0,j=v(),k;while((k=j.exec(e))!==null){var l=e.slice(h,k.index);h=j.lastIndex,i+=r(l,f);if(i%2){f.push(k[0]);continue}var m=k[0],n=m.length,o;switch(m){case"dddd":case"ddd":case"MMMM":case"MMM":case"gg":case"g":o="(\\D+)";break;case"tt":case"t":o="(\\D*)";break;case"yyyy":case"fff":case"ff":case"f":o="(\\d{"+n+"})";break;case"dd":case"d":case"MM":case"M":case"yy":case"y":case"HH":case"H":case"hh":case"h":case"mm":case"m":case"ss":case"s":o="(\\d\\d?)";break;case"zzz":o="([+-]?\\d\\d?:\\d{2})";break;case"zz":case"z":o="([+-]?\\d\\d?)";break;case"/":o="(\\"+a["/"]+")";break;default:throw"Invalid date format pattern '"+m+"'."}o&&f.push(o),g.push(k[0])}r(e.slice(h),f),f.push("$");var p=f.join("").replace(/\s+/g,"\\s+"),q={regExp:p,groups:g};return c[b]=q},e=function(a,b,c){return a<b||a>c},f=function(a){return a.split("\u00a0").join(" ").toUpperCase()},g=function(a){var b=[];for(var c=0,d=a.length;c<d;c++)b[c]=f(a[c]);return b},y=function(f,g,h){f=o(f);var i=h.calendar,j=d(i,g),k=(new RegExp(j.regExp)).exec(f);if(k===null)return null;var l=j.groups,m=null,p=null,q=null,r=null,s=null,t=0,u,v=0,w=0,x=0,y=null,z=!1;for(var A=0,B=l.length;A<B;A++){var C=k[A+1];if(C){var D=l[A],E=D.length,F=parseInt(C,10);switch(D){case"dd":case"d":r=F;if(e(r,1,31))return null;break;case"MMM":case"MMMM":q=c(i,C,E===3);if(e(q,0,11))return null;break;case"M":case"MM":q=F-1;if(e(q,0,11))return null;break;case"y":case"yy":case"yyyy":p=E<4?a(i,F):F;if(e(p,0,9999))return null;break;case"h":case"hh":t=F,t===12&&(t=0);if(e(t,0,11))return null;break;case"H":case"HH":t=F;if(e(t,0,23))return null;break;case"m":case"mm":v=F;if(e(v,0,59))return null;break;case"s":case"ss":w=F;if(e(w,0,59))return null;break;case"tt":case"t":z=i.PM&&(C===i.PM[0]||C===i.PM[1]||C===i.PM[2]);if(!z&&(!i.AM||C!==i.AM[0]&&C!==i.AM[1]&&C!==i.AM[2]))return null;break;case"f":case"ff":case"fff":x=F*Math.pow(10,3-E);if(e(x,0,999))return null;break;case"ddd":case"dddd":s=b(i,C,E===3);if(e(s,0,6))return null;break;case"zzz":var G=C.split(/:/);if(G.length!==2)return null;u=parseInt(G[0],10);if(e(u,-12,13))return null;var H=parseInt(G[1],10);if(e(H,0,59))return null;y=u*60+(n(C,"-")?-H:H);break;case"z":case"zz":u=F;if(e(u,-12,13))return null;y=u*60;break;case"g":case"gg":var I=C;if(!I||!i.eras)return null;I=o(I.toLowerCase());for(var J=0,K=i.eras.length;J<K;J++)if(I===i.eras[J].name.toLowerCase()){m=J;break}if(m===null)return null}}}var L=new Date,M,N=i.convert;M=N?N.fromGregorian(L)[0]:L.getFullYear(),p===null?p=M:i.eras&&(p+=i.eras[m||0].offset),q===null&&(q=0),r===null&&(r=1);if(N){L=N.toGregorian(p,q,r);if(L===null)return null}else{L.setFullYear(p,q,r);if(L.getDate()!==r)return null;if(s!==null&&L.getDay()!==s)return null}z&&t<12&&(t+=12),L.setHours(t,v,w,x);if(y!==null){var O=L.getMinutes()-(y+L.getTimezoneOffset());L.setHours(L.getHours()+parseInt(O/60,10),O%60)}return L}}(),z=function(a,b,c){var d=b["-"],e=b["+"],f;switch(c){case"n -":d=" "+d,e=" "+e;case"n-":i(a,d)?f=["-",a.substr(0,a.length-d.length)]:i(a,e)&&(f=["+",a.substr(0,a.length-e.length)]);break;case"- n":d+=" ",e+=" ";case"-n":n(a,d)?f=["-",a.substr(d.length)]:n(a,e)&&(f=["+",a.substr(e.length)]);break;case"(n)":n(a,"(")&&i(a,")")&&(f=["-",a.substr(1,a.length-2)])}return f||["",a]},c.prototype.findClosestCulture=function(a){return c.findClosestCulture.call(this,a)},c.prototype.format=function(a,b,d){return c.format.call(this,a,b,d)},c.prototype.localize=function(a,b){return c.localize.call(this,a,b)},c.prototype.parseInt=function(a,b,d){return c.parseInt.call(this,a,b,d)},c.prototype.parseFloat=function(a,b,d){return c.parseFloat.call(this,a,b,d)},c.prototype.culture=function(a){return c.culture.call(this,a)},c.addCultureInfo=function(a,b,c){var d={},e=!1;typeof a!="string"?(c=a,a=this.culture().name,d=this.cultures[a]):typeof b!="string"?(c=b,e=this.cultures[a]==null,d=this.cultures[a]||this.cultures["default"]):(e=!0,d=this.cultures[b]),this.cultures[a]=j(!0,{},d,c),e&&(this.cultures[a].calendar=this.cultures[a].calendars.standard)},c.findClosestCulture=function(a){var b;if(!a)return this.findClosestCulture(this.cultureSelector)||this.cultures["default"];typeof a=="string"&&(a=a.split(","));if(k(a)){var c,d=this.cultures,e=a,f,g=e.length,h=[];for(f=0;f<g;f++){a=o(e[f]);var i,j=a.split(";");c=o(j[0]),j.length===1?i=1:(a=o(j[1]),a.indexOf("q=")===0?(a=a.substr(2),i=parseFloat(a),i=isNaN(i)?0:i):i=1),h.push({lang:c,pri:i})}h.sort(function(a,b){return a.pri<b.pri?1:-1});for(f=0;f<g;f++){c=h[f].lang,b=d[c];if(b)return b}for(f=0;f<g;f++){c=h[f].lang;do{var l=c.lastIndexOf("-");if(l===-1)break;c=c.substr(0,l),b=d[c];if(b)return b}while(1)}for(f=0;f<g;f++){c=h[f].lang;for(var m in d){var n=d[m];if(n.language==c)return n}}}else if(typeof a=="object")return a;return b||null},c.format=function(a,b,c){return culture=this.findClosestCulture(c),a instanceof Date?a=t(a,b,culture):typeof a=="number"&&(a=u(a,b,culture)),a},c.localize=function(a,b){return this.findClosestCulture(b).messages[a]||this.cultures["default"].messages[a]},c.parseDate=function(a,b,c){c=this.findClosestCulture(c);var d,e,f;if(b){typeof b=="string"&&(b=[b]);if(b.length)for(var g=0,h=b.length;g<h;g++){var i=b[g];if(i){d=y(a,i,c);if(d)break}}}else{f=c.calendar.patterns;for(e in f){d=y(a,f[e],c);if(d)break}}return d||null},c.parseInt=function(a,b,d){return p(c.parseFloat(a,b,d))},c.parseFloat=function(a,b,c){typeof b!="number"&&(c=b,b=10);var g=this.findClosestCulture(c),h=NaN,i=g.numberFormat;a.indexOf(g.numberFormat.currency.symbol)>-1&&(a=a.replace(g.numberFormat.currency.symbol,""),a=a.replace(g.numberFormat.currency["."],g.numberFormat["."])),a=o(a);if(e.test(a))h=parseFloat(a);else if(!b&&d.test(a))h=parseInt(a,16);else{var j=z(a,i,i.pattern[0]),k=j[0],l=j[1];k===""&&i.pattern[0]!=="(n)"&&(j=z(a,i,"(n)"),k=j[0],l=j[1]),k===""&&i.pattern[0]!=="-n"&&(j=z(a,i,"-n"),k=j[0],l=j[1]),k=k||"+";var m,n,p=l.indexOf("e");p<0&&(p=l.indexOf("E")),p<0?(n=l,m=null):(n=l.substr(0,p),m=l.substr(p+1));var q,r,s=i["."],t=n.indexOf(s);t<0?(q=n,r=null):(q=n.substr(0,t),r=n.substr(t+s.length));var u=i[","];q=q.split(u).join("");var v=u.replace(/\u00A0/g," ");u!==v&&(q=q.split(v).join(""));var w=k+q;r!==null&&(w+="."+r);if(m!==null){var x=z(m,i,"-n");w+="e"+(x[0]||"+")+x[1]}f.test(w)&&(h=parseFloat(w))}return h},c.culture=function(a){return typeof a!="undefined"&&(this.cultureSelector=a),this.findClosestCulture(a)||this.culture["default"]}})(this);
+/**
+ * @fileoverview gl-matrix - High performance matrix and vector operations for WebGL
+ * @author Brandon Jones
+ * @author Colin MacKenzie IV
+ * @version 1.3.7
+ *//*
+ * Copyright (c) 2012 Brandon Jones, Colin MacKenzie IV
+ *
+ * This software is provided 'as-is', without any express or implied
+ * warranty. In no event will the authors be held liable for any damages
+ * arising from the use of this software.
+ *
+ * Permission is granted to anyone to use this software for any purpose,
+ * including commercial applications, and to alter it and redistribute it
+ * freely, subject to the following restrictions:
+ *
+ * 1. The origin of this software must not be misrepresented; you must not
+ * claim that you wrote the original software. If you use this software
+ * in a product, an acknowledgment in the product documentation would be
+ * appreciated but is not required.
+ *
+ * 2. Altered source versions must be plainly marked as such, and must not
+ * be misrepresented as being the original software.
+ *
+ * 3. This notice may not be removed or altered from any source
+ * distribution.
+ */// Updated to use a modification of the "returnExportsGlobal" pattern from https://github.com/umdjs/umd
+(function(a,b){typeof exports=="object"?module.exports=b(global):typeof define=="function"&&define.amd?define([],function(){return b(a)}):b(a)})(this,function(a){function e(a){return d=a,d}function f(){return d=typeof Float32Array!="undefined"?Float32Array:Array,d}"use strict";var b=1e-6,c={};(function(){if(typeof Float32Array!="undefined"){var a=new Float32Array(1),b=new Int32Array(a.buffer);c.invsqrt=function(c){var d=c*.5;a[0]=c;var e=1.5;b[0]=1597463007-(b[0]>>1);var f=a[0];return f*(e-d*f*f)}}else c.invsqrt=function(a){return 1/Math.sqrt(a)}})();var d=null;f();var g={};g.create=function(a){var b=new d(3);return a?(b[0]=a[0],b[1]=a[1],b[2]=a[2]):b[0]=b[1]=b[2]=0,b},g.createFrom=function(a,b,c){var e=new d(3);return e[0]=a,e[1]=b,e[2]=c,e},g.set=function(a,b){return b[0]=a[0],b[1]=a[1],b[2]=a[2],b},g.equal=function(a,c){return a===c||Math.abs(a[0]-c[0])<b&&Math.abs(a[1]-c[1])<b&&Math.abs(a[2]-c[2])<b},g.add=function(a,b,c){return!c||a===c?(a[0]+=b[0],a[1]+=b[1],a[2]+=b[2],a):(c[0]=a[0]+b[0],c[1]=a[1]+b[1],c[2]=a[2]+b[2],c)},g.subtract=function(a,b,c){return!c||a===c?(a[0]-=b[0],a[1]-=b[1],a[2]-=b[2],a):(c[0]=a[0]-b[0],c[1]=a[1]-b[1],c[2]=a[2]-b[2],c)},g.multiply=function(a,b,c){return!c||a===c?(a[0]*=b[0],a[1]*=b[1],a[2]*=b[2],a):(c[0]=a[0]*b[0],c[1]=a[1]*b[1],c[2]=a[2]*b[2],c)},g.negate=function(a,b){return b||(b=a),b[0]=-a[0],b[1]=-a[1],b[2]=-a[2],b},g.scale=function(a,b,c){return!c||a===c?(a[0]*=b,a[1]*=b,a[2]*=b,a):(c[0]=a[0]*b,c[1]=a[1]*b,c[2]=a[2]*b,c)},g.normalize=function(a,b){b||(b=a);var c=a[0],d=a[1],e=a[2],f=Math.sqrt(c*c+d*d+e*e);return f?f===1?(b[0]=c,b[1]=d,b[2]=e,b):(f=1/f,b[0]=c*f,b[1]=d*f,b[2]=e*f,b):(b[0]=0,b[1]=0,b[2]=0,b)},g.cross=function(a,b,c){c||(c=a);var d=a[0],e=a[1],f=a[2],g=b[0],h=b[1],i=b[2];return c[0]=e*i-f*h,c[1]=f*g-d*i,c[2]=d*h-e*g,c},g.length=function(a){var b=a[0],c=a[1],d=a[2];return Math.sqrt(b*b+c*c+d*d)},g.squaredLength=function(a){var b=a[0],c=a[1],d=a[2];return b*b+c*c+d*d},g.dot=function(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]},g.direction=function(a,b,c){c||(c=a);var d=a[0]-b[0],e=a[1]-b[1],f=a[2]-b[2],g=Math.sqrt(d*d+e*e+f*f);return g?(g=1/g,c[0]=d*g,c[1]=e*g,c[2]=f*g,c):(c[0]=0,c[1]=0,c[2]=0,c)},g.lerp=function(a,b,c,d){return d||(d=a),d[0]=a[0]+c*(b[0]-a[0]),d[1]=a[1]+c*(b[1]-a[1]),d[2]=a[2]+c*(b[2]-a[2]),d},g.dist=function(a,b){var c=b[0]-a[0],d=b[1]-a[1],e=b[2]-a[2];return Math.sqrt(c*c+d*d+e*e)};var h=null,i=new d(4);g.unproject=function(a,b,c,d,e){e||(e=a),h||(h=o.create());var f=h,g=i;return g[0]=(a[0]-d[0])*2/d[2]-1,g[1]=(a[1]-d[1])*2/d[3]-1,g[2]=2*a[2]-1,g[3]=1,o.multiply(c,b,f),o.inverse(f)?(o.multiplyVec4(f,g),g[3]===0?null:(e[0]=g[0]/g[3],e[1]=g[1]/g[3],e[2]=g[2]/g[3],e)):null};var j=g.createFrom(1,0,0),k=g.createFrom(0,1,0),l=g.createFrom(0,0,1),m=g.create();g.rotationTo=function(a,b,c){c||(c=p.create());var d=g.dot(a,b),e=m;if(d>=1)p.set(q,c);else if(d<1e-6-1)g.cross(j,a,e),g.length(e)<1e-6&&g.cross(k,a,e),g.length(e)<1e-6&&g.cross(l,a,e),g.normalize(e),p.fromAngleAxis(Math.PI,e,c);else{var f=Math.sqrt((1+d)*2),h=1/f;g.cross(a,b,e),c[0]=e[0]*h,c[1]=e[1]*h,c[2]=e[2]*h,c[3]=f*.5,p.normalize(c)}return c[3]>1?c[3]=1:c[3]<-1&&(c[3]=-1),c},g.str=function(a){return"["+a[0]+", "+a[1]+", "+a[2]+"]"};var n={};n.create=function(a){var b=new d(9);return a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[8]=a[8]):b[0]=b[1]=b[2]=b[3]=b[4]=b[5]=b[6]=b[7]=b[8]=0,b},n.createFrom=function(a,b,c,e,f,g,h,i,j){var k=new d(9);return k[0]=a,k[1]=b,k[2]=c,k[3]=e,k[4]=f,k[5]=g,k[6]=h,k[7]=i,k[8]=j,k},n.determinant=function(a){var b=a[0],c=a[1],d=a[2],e=a[3],f=a[4],g=a[5],h=a[6],i=a[7],j=a[8];return b*(j*f-g*i)+c*(-j*e+g*h)+d*(i*e-f*h)},n.inverse=function(a,b){var c=a[0],d=a[1],e=a[2],f=a[3],g=a[4],h=a[5],i=a[6],j=a[7],k=a[8],l=k*g-h*j,m=-k*f+h*i,o=j*f-g*i,p=c*l+d*m+e*o,q;return p?(q=1/p,b||(b=n.create()),b[0]=l*q,b[1]=(-k*d+e*j)*q,b[2]=(h*d-e*g)*q,b[3]=m*q,b[4]=(k*c-e*i)*q,b[5]=(-h*c+e*f)*q,b[6]=o*q,b[7]=(-j*c+d*i)*q,b[8]=(g*c-d*f)*q,b):null},n.multiply=function(a,b,c){c||(c=a);var d=a[0],e=a[1],f=a[2],g=a[3],h=a[4],i=a[5],j=a[6],k=a[7],l=a[8],m=b[0],n=b[1],o=b[2],p=b[3],q=b[4],r=b[5],s=b[6],t=b[7],u=b[8];return c[0]=m*d+n*g+o*j,c[1]=m*e+n*h+o*k,c[2]=m*f+n*i+o*l,c[3]=p*d+q*g+r*j,c[4]=p*e+q*h+r*k,c[5]=p*f+q*i+r*l,c[6]=s*d+t*g+u*j,c[7]=s*e+t*h+u*k,c[8]=s*f+t*i+u*l,c},n.multiplyVec2=function(a,b,c){c||(c=b);var d=b[0],e=b[1];return c[0]=d*a[0]+e*a[3]+a[6],c[1]=d*a[1]+e*a[4]+a[7],c},n.multiplyVec3=function(a,b,c){c||(c=b);var d=b[0],e=b[1],f=b[2];return c[0]=d*a[0]+e*a[3]+f*a[6],c[1]=d*a[1]+e*a[4]+f*a[7],c[2]=d*a[2]+e*a[5]+f*a[8],c},n.set=function(a,b){return b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[8]=a[8],b},n.equal=function(a,c){return a===c||Math.abs(a[0]-c[0])<b&&Math.abs(a[1]-c[1])<b&&Math.abs(a[2]-c[2])<b&&Math.abs(a[3]-c[3])<b&&Math.abs(a[4]-c[4])<b&&Math.abs(a[5]-c[5])<b&&Math.abs(a[6]-c[6])<b&&Math.abs(a[7]-c[7])<b&&Math.abs(a[8]-c[8])<b},n.identity=function(a){return a||(a=n.create()),a[0]=1,a[1]=0,a[2]=0,a[3]=0,a[4]=1,a[5]=0,a[6]=0,a[7]=0,a[8]=1,a},n.transpose=function(a,b){if(!b||a===b){var c=a[1],d=a[2],e=a[5];return a[1]=a[3],a[2]=a[6],a[3]=c,a[5]=a[7],a[6]=d,a[7]=e,a}return b[0]=a[0],b[1]=a[3],b[2]=a[6],b[3]=a[1],b[4]=a[4],b[5]=a[7],b[6]=a[2],b[7]=a[5],b[8]=a[8],b},n.toMat4=function(a,b){return b||(b=o.create()),b[15]=1,b[14]=0,b[13]=0,b[12]=0,b[11]=0,b[10]=a[8],b[9]=a[7],b[8]=a[6],b[7]=0,b[6]=a[5],b[5]=a[4],b[4]=a[3],b[3]=0,b[2]=a[2],b[1]=a[1],b[0]=a[0],b},n.str=function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+a[8]+"]"};var o={};o.create=function(a){var b=new d(16);return a&&(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[8]=a[8],b[9]=a[9],b[10]=a[10],b[11]=a[11],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15]),b},o.createFrom=function(a,b,c,e,f,g,h,i,j,k,l,m,n,o,p,q){var r=new d(16);return r[0]=a,r[1]=b,r[2]=c,r[3]=e,r[4]=f,r[5]=g,r[6]=h,r[7]=i,r[8]=j,r[9]=k,r[10]=l,r[11]=m,r[12]=n,r[13]=o,r[14]=p,r[15]=q,r},o.set=function(a,b){return b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[8]=a[8],b[9]=a[9],b[10]=a[10],b[11]=a[11],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15],b},o.equal=function(a,c){return a===c||Math.abs(a[0]-c[0])<b&&Math.abs(a[1]-c[1])<b&&Math.abs(a[2]-c[2])<b&&Math.abs(a[3]-c[3])<b&&Math.abs(a[4]-c[4])<b&&Math.abs(a[5]-c[5])<b&&Math.abs(a[6]-c[6])<b&&Math.abs(a[7]-c[7])<b&&Math.abs(a[8]-c[8])<b&&Math.abs(a[9]-c[9])<b&&Math.abs(a[10]-c[10])<b&&Math.abs(a[11]-c[11])<b&&Math.abs(a[12]-c[12])<b&&Math.abs(a[13]-c[13])<b&&Math.abs(a[14]-c[14])<b&&Math.abs(a[15]-c[15])<b},o.identity=function(a){return a||(a=o.create()),a[0]=1,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=1,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=1,a[11]=0,a[12]=0,a[13]=0,a[14]=0,a[15]=1,a},o.transpose=function(a,b){if(!b||a===b){var c=a[1],d=a[2],e=a[3],f=a[6],g=a[7],h=a[11];return a[1]=a[4],a[2]=a[8],a[3]=a[12],a[4]=c,a[6]=a[9],a[7]=a[13],a[8]=d,a[9]=f,a[11]=a[14],a[12]=e,a[13]=g,a[14]=h,a}return b[0]=a[0],b[1]=a[4],b[2]=a[8],b[3]=a[12],b[4]=a[1],b[5]=a[5],b[6]=a[9],b[7]=a[13],b[8]=a[2],b[9]=a[6],b[10]=a[10],b[11]=a[14],b[12]=a[3],b[13]=a[7],b[14]=a[11],b[15]=a[15],b},o.determinant=function(a){var b=a[0],c=a[1],d=a[2],e=a[3],f=a[4],g=a[5],h=a[6],i=a[7],j=a[8],k=a[9],l=a[10],m=a[11],n=a[12],o=a[13],p=a[14],q=a[15];return n*k*h*e-j*o*h*e-n*g*l*e+f*o*l*e+j*g*p*e-f*k*p*e-n*k*d*i+j*o*d*i+n*c*l*i-b*o*l*i-j*c*p*i+b*k*p*i+n*g*d*m-f*o*d*m-n*c*h*m+b*o*h*m+f*c*p*m-b*g*p*m-j*g*d*q+f*k*d*q+j*c*h*q-b*k*h*q-f*c*l*q+b*g*l*q},o.inverse=function(a,b){b||(b=a);var c=a[0],d=a[1],e=a[2],f=a[3],g=a[4],h=a[5],i=a[6],j=a[7],k=a[8],l=a[9],m=a[10],n=a[11],o=a[12],p=a[13],q=a[14],r=a[15],s=c*h-d*g,t=c*i-e*g,u=c*j-f*g,v=d*i-e*h,w=d*j-f*h,x=e*j-f*i,y=k*p-l*o,z=k*q-m*o,A=k*r-n*o,B=l*q-m*p,C=l*r-n*p,D=m*r-n*q,E=s*D-t*C+u*B+v*A-w*z+x*y,F;return E?(F=1/E,b[0]=(h*D-i*C+j*B)*F,b[1]=(-d*D+e*C-f*B)*F,b[2]=(p*x-q*w+r*v)*F,b[3]=(-l*x+m*w-n*v)*F,b[4]=(-g*D+i*A-j*z)*F,b[5]=(c*D-e*A+f*z)*F,b[6]=(-o*x+q*u-r*t)*F,b[7]=(k*x-m*u+n*t)*F,b[8]=(g*C-h*A+j*y)*F,b[9]=(-c*C+d*A-f*y)*F,b[10]=(o*w-p*u+r*s)*F,b[11]=(-k*w+l*u-n*s)*F,b[12]=(-g*B+h*z-i*y)*F,b[13]=(c*B-d*z+e*y)*F,b[14]=(-o*v+p*t-q*s)*F,b[15]=(k*v-l*t+m*s)*F,b):null},o.toRotationMat=function(a,b){return b||(b=o.create()),b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[8]=a[8],b[9]=a[9],b[10]=a[10],b[11]=a[11],b[12]=0,b[13]=0,b[14]=0,b[15]=1,b},o.toMat3=function(a,b){return b||(b=n.create()),b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[4],b[4]=a[5],b[5]=a[6],b[6]=a[8],b[7]=a[9],b[8]=a[10],b},o.toInverseMat3=function(a,b){var c=a[0],d=a[1],e=a[2],f=a[4],g=a[5],h=a[6],i=a[8],j=a[9],k=a[10],l=k*g-h*j,m=-k*f+h*i,o=j*f-g*i,p=c*l+d*m+e*o,q;return p?(q=1/p,b||(b=n.create()),b[0]=l*q,b[1]=(-k*d+e*j)*q,b[2]=(h*d-e*g)*q,b[3]=m*q,b[4]=(k*c-e*i)*q,b[5]=(-h*c+e*f)*q,b[6]=o*q,b[7]=(-j*c+d*i)*q,b[8]=(g*c-d*f)*q,b):null},o.multiply=function(a,b,c){c||(c=a);var d=a[0],e=a[1],f=a[2],g=a[3],h=a[4],i=a[5],j=a[6],k=a[7],l=a[8],m=a[9],n=a[10],o=a[11],p=a[12],q=a[13],r=a[14],s=a[15],t=b[0],u=b[1],v=b[2],w=b[3];return c[0]=t*d+u*h+v*l+w*p,c[1]=t*e+u*i+v*m+w*q,c[2]=t*f+u*j+v*n+w*r,c[3]=t*g+u*k+v*o+w*s,t=b[4],u=b[5],v=b[6],w=b[7],c[4]=t*d+u*h+v*l+w*p,c[5]=t*e+u*i+v*m+w*q,c[6]=t*f+u*j+v*n+w*r,c[7]=t*g+u*k+v*o+w*s,t=b[8],u=b[9],v=b[10],w=b[11],c[8]=t*d+u*h+v*l+w*p,c[9]=t*e+u*i+v*m+w*q,c[10]=t*f+u*j+v*n+w*r,c[11]=t*g+u*k+v*o+w*s,t=b[12],u=b[13],v=b[14],w=b[15],c[12]=t*d+u*h+v*l+w*p,c[13]=t*e+u*i+v*m+w*q,c[14]=t*f+u*j+v*n+w*r,c[15]=t*g+u*k+v*o+w*s,c},o.multiplyVec3=function(a,b,c){c||(c=b);var d=b[0],e=b[1],f=b[2];return c[0]=a[0]*d+a[4]*e+a[8]*f+a[12],c[1]=a[1]*d+a[5]*e+a[9]*f+a[13],c[2]=a[2]*d+a[6]*e+a[10]*f+a[14],c},o.multiplyVec4=function(a,b,c){c||(c=b);var d=b[0],e=b[1],f=b[2],g=b[3];return c[0]=a[0]*d+a[4]*e+a[8]*f+a[12]*g,c[1]=a[1]*d+a[5]*e+a[9]*f+a[13]*g,c[2]=a[2]*d+a[6]*e+a[10]*f+a[14]*g,c[3]=a[3]*d+a[7]*e+a[11]*f+a[15]*g,c},o.translate=function(a,b,c){var d=b[0],e=b[1],f=b[2],g,h,i,j,k,l,m,n,o,p,q,r;return!c||a===c?(a[12]=a[0]*d+a[4]*e+a[8]*f+a[12],a[13]=a[1]*d+a[5]*e+a[9]*f+a[13],a[14]=a[2]*d+a[6]*e+a[10]*f+a[14],a[15]=a[3]*d+a[7]*e+a[11]*f+a[15],a):(g=a[0],h=a[1],i=a[2],j=a[3],k=a[4],l=a[5],m=a[6],n=a[7],o=a[8],p=a[9],q=a[10],r=a[11],c[0]=g,c[1]=h,c[2]=i,c[3]=j,c[4]=k,c[5]=l,c[6]=m,c[7]=n,c[8]=o,c[9]=p,c[10]=q,c[11]=r,c[12]=g*d+k*e+o*f+a[12],c[13]=h*d+l*e+p*f+a[13],c[14]=i*d+m*e+q*f+a[14],c[15]=j*d+n*e+r*f+a[15],c)},o.scale=function(a,b,c){var d=b[0],e=b[1],f=b[2];return!c||a===c?(a[0]*=d,a[1]*=d,a[2]*=d,a[3]*=d,a[4]*=e,a[5]*=e,a[6]*=e,a[7]*=e,a[8]*=f,a[9]*=f,a[10]*=f,a[11]*=f,a):(c[0]=a[0]*d,c[1]=a[1]*d,c[2]=a[2]*d,c[3]=a[3]*d,c[4]=a[4]*e,c[5]=a[5]*e,c[6]=a[6]*e,c[7]=a[7]*e,c[8]=a[8]*f,c[9]=a[9]*f,c[10]=a[10]*f,c[11]=a[11]*f,c[12]=a[12],c[13]=a[13],c[14]=a[14],c[15]=a[15],c)},o.rotate=function(a,b,c,d){var e=c[0],f=c[1],g=c[2],h=Math.sqrt(e*e+f*f+g*g),i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F;return h?(h!==1&&(h=1/h,e*=h,f*=h,g*=h),i=Math.sin(b),j=Math.cos(b),k=1-j,l=a[0],m=a[1],n=a[2],o=a[3],p=a[4],q=a[5],r=a[6],s=a[7],t=a[8],u=a[9],v=a[10],w=a[11],x=e*e*k+j,y=f*e*k+g*i,z=g*e*k-f*i,A=e*f*k-g*i,B=f*f*k+j,C=g*f*k+e*i,D=e*g*k+f*i,E=f*g*k-e*i,F=g*g*k+j,d?a!==d&&(d[12]=a[12],d[13]=a[13],d[14]=a[14],d[15]=a[15]):d=a,d[0]=l*x+p*y+t*z,d[1]=m*x+q*y+u*z,d[2]=n*x+r*y+v*z,d[3]=o*x+s*y+w*z,d[4]=l*A+p*B+t*C,d[5]=m*A+q*B+u*C,d[6]=n*A+r*B+v*C,d[7]=o*A+s*B+w*C,d[8]=l*D+p*E+t*F,d[9]=m*D+q*E+u*F,d[10]=n*D+r*E+v*F,d[11]=o*D+s*E+w*F,d):null},o.rotateX=function(a,b,c){var d=Math.sin(b),e=Math.cos(b),f=a[4],g=a[5],h=a[6],i=a[7],j=a[8],k=a[9],l=a[10],m=a[11];return c?a!==c&&(c[0]=a[0],c[1]=a[1],c[2]=a[2],c[3]=a[3],c[12]=a[12],c[13]=a[13],c[14]=a[14],c[15]=a[15]):c=a,c[4]=f*e+j*d,c[5]=g*e+k*d,c[6]=h*e+l*d,c[7]=i*e+m*d,c[8]=f*-d+j*e,c[9]=g*-d+k*e,c[10]=h*-d+l*e,c[11]=i*-d+m*e,c},o.rotateY=function(a,b,c){var d=Math.sin(b),e=Math.cos(b),f=a[0],g=a[1],h=a[2],i=a[3],j=a[8],k=a[9],l=a[10],m=a[11];return c?a!==c&&(c[4]=a[4],c[5]=a[5],c[6]=a[6],c[7]=a[7],c[12]=a[12],c[13]=a[13],c[14]=a[14],c[15]=a[15]):c=a,c[0]=f*e+j*-d,c[1]=g*e+k*-d,c[2]=h*e+l*-d,c[3]=i*e+m*-d,c[8]=f*d+j*e,c[9]=g*d+k*e,c[10]=h*d+l*e,c[11]=i*d+m*e,c},o.rotateZ=function(a,b,c){var d=Math.sin(b),e=Math.cos(b),f=a[0],g=a[1],h=a[2],i=a[3],j=a[4],k=a[5],l=a[6],m=a[7];return c?a!==c&&(c[8]=a[8],c[9]=a[9],c[10]=a[10],c[11]=a[11],c[12]=a[12],c[13]=a[13],c[14]=a[14],c[15]=a[15]):c=a,c[0]=f*e+j*d,c[1]=g*e+k*d,c[2]=h*e+l*d,c[3]=i*e+m*d,c[4]=f*-d+j*e,c[5]=g*-d+k*e,c[6]=h*-d+l*e,c[7]=i*-d+m*e,c},o.frustum=function(a,b,c,d,e,f,g){g||(g=o.create());var h=b-a,i=d-c,j=f-e;return g[0]=e*2/h,g[1]=0,g[2]=0,g[3]=0,g[4]=0,g[5]=e*2/i,g[6]=0,g[7]=0,g[8]=(b+a)/h,g[9]=(d+c)/i,g[10]=-(f+e)/j,g[11]=-1,g[12]=0,g[13]=0,g[14]=-(f*e*2)/j,g[15]=0,g},o.perspective=function(a,b,c,d,e){var f=c*Math.tan(a*Math.PI/360),g=f*b;return o.frustum(-g,g,-f,f,c,d,e)},o.ortho=function(a,b,c,d,e,f,g){g||(g=o.create());var h=b-a,i=d-c,j=f-e;return g[0]=2/h,g[1]=0,g[2]=0,g[3]=0,g[4]=0,g[5]=2/i,g[6]=0,g[7]=0,g[8]=0,g[9]=0,g[10]=-2/j,g[11]=0,g[12]=-(a+b)/h,g[13]=-(d+c)/i,g[14]=-(f+e)/j,g[15]=1,g},o.lookAt=function(a,b,c,d){d||(d=o.create());var e,f,g,h,i,j,k,l,m,n,p=a[0],q=a[1],r=a[2],s=c[0],t=c[1],u=c[2],v=b[0],w=b[1],x=b[2];return p===v&&q===w&&r===x?o.identity(d):(k=p-v,l=q-w,m=r-x,n=1/Math.sqrt(k*k+l*l+m*m),k*=n,l*=n,m*=n,e=t*m-u*l,f=u*k-s*m,g=s*l-t*k,n=Math.sqrt(e*e+f*f+g*g),n?(n=1/n,e*=n,f*=n,g*=n):(e=0,f=0,g=0),h=l*g-m*f,i=m*e-k*g,j=k*f-l*e,n=Math.sqrt(h*h+i*i+j*j),n?(n=1/n,h*=n,i*=n,j*=n):(h=0,i=0,j=0),d[0]=e,d[1]=h,d[2]=k,d[3]=0,d[4]=f,d[5]=i,d[6]=l,d[7]=0,d[8]=g,d[9]=j,d[10]=m,d[11]=0,d[12]=-(e*p+f*q+g*r),d[13]=-(h*p+i*q+j*r),d[14]=-(k*p+l*q+m*r),d[15]=1,d)},o.fromRotationTranslation=function(a,b,c){c||(c=o.create());var d=a[0],e=a[1],f=a[2],g=a[3],h=d+d,i=e+e,j=f+f,k=d*h,l=d*i,m=d*j,n=e*i,p=e*j,q=f*j,r=g*h,s=g*i,t=g*j;return c[0]=1-(n+q),c[1]=l+t,c[2]=m-s,c[3]=0,c[4]=l-t,c[5]=1-(k+q),c[6]=p+r,c[7]=0,c[8]=m+s,c[9]=p-r,c[10]=1-(k+n),c[11]=0,c[12]=b[0],c[13]=b[1],c[14]=b[2],c[15]=1,c},o.str=function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+a[8]+", "+a[9]+", "+a[10]+", "+a[11]+", "+a[12]+", "+a[13]+", "+a[14]+", "+a[15]+"]"};var p={};p.create=function(a){var b=new d(4);return a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3]):b[0]=b[1]=b[2]=b[3]=0,b},p.createFrom=function(a,b,c,e){var f=new d(4);return f[0]=a,f[1]=b,f[2]=c,f[3]=e,f},p.set=function(a,b){return b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b},p.equal=function(a,c){return a===c||Math.abs(a[0]-c[0])<b&&Math.abs(a[1]-c[1])<b&&Math.abs(a[2]-c[2])<b&&Math.abs(a[3]-c[3])<b},p.identity=function(a){return a||(a=p.create()),a[0]=0,a[1]=0,a[2]=0,a[3]=1,a};var q=p.identity();p.calculateW=function(a,b){var c=a[0],d=a[1],e=a[2];return!b||a===b?(a[3]=-Math.sqrt(Math.abs(1-c*c-d*d-e*e)),a):(b[0]=c,b[1]=d,b[2]=e,b[3]=-Math.sqrt(Math.abs(1-c*c-d*d-e*e)),b)},p.dot=function(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]},p.inverse=function(a,b){var c=a[0],d=a[1],e=a[2],f=a[3],g=c*c+d*d+e*e+f*f,h=g?1/g:0;return!b||a===b?(a[0]*=-h,a[1]*=-h,a[2]*=-h,a[3]*=h,a):(b[0]=-a[0]*h,b[1]=-a[1]*h,b[2]=-a[2]*h,b[3]=a[3]*h,b)},p.conjugate=function(a,b){return!b||a===b?(a[0]*=-1,a[1]*=-1,a[2]*=-1,a):(b[0]=-a[0],b[1]=-a[1],b[2]=-a[2],b[3]=a[3],b)},p.length=function(a){var b=a[0],c=a[1],d=a[2],e=a[3];return Math.sqrt(b*b+c*c+d*d+e*e)},p.normalize=function(a,b){b||(b=a);var c=a[0],d=a[1],e=a[2],f=a[3],g=Math.sqrt(c*c+d*d+e*e+f*f);return g===0?(b[0]=0,b[1]=0,b[2]=0,b[3]=0,b):(g=1/g,b[0]=c*g,b[1]=d*g,b[2]=e*g,b[3]=f*g,b)},p.add=function(a,b,c){return!c||a===c?(a[0]+=b[0],a[1]+=b[1],a[2]+=b[2],a[3]+=b[3],a):(c[0]=a[0]+b[0],c[1]=a[1]+b[1],c[2]=a[2]+b[2],c[3]=a[3]+b[3],c)},p.multiply=function(a,b,c){c||(c=a);var d=a[0],e=a[1],f=a[2],g=a[3],h=b[0],i=b[1],j=b[2],k=b[3];return c[0]=d*k+g*h+e*j-f*i,c[1]=e*k+g*i+f*h-d*j,c[2]=f*k+g*j+d*i-e*h,c[3]=g*k-d*h-e*i-f*j,c},p.multiplyVec3=function(a,b,c){c||(c=b);var d=b[0],e=b[1],f=b[2],g=a[0],h=a[1],i=a[2],j=a[3],k=j*d+h*f-i*e,l=j*e+i*d-g*f,m=j*f+g*e-h*d,n=-g*d-h*e-i*f;return c[0]=k*j+n*-g+l*-i-m*-h,c[1]=l*j+n*-h+m*-g-k*-i,c[2]=m*j+n*-i+k*-h-l*-g,c},p.scale=function(a,b,c){return!c||a===c?(a[0]*=b,a[1]*=b,a[2]*=b,a[3]*=b,a):(c[0]=a[0]*b,c[1]=a[1]*b,c[2]=a[2]*b,c[3]=a[3]*b,c)},p.toMat3=function(a,b){b||(b=n.create());var c=a[0],d=a[1],e=a[2],f=a[3],g=c+c,h=d+d,i=e+e,j=c*g,k=c*h,l=c*i,m=d*h,o=d*i,p=e*i,q=f*g,r=f*h,s=f*i;return b[0]=1-(m+p),b[1]=k+s,b[2]=l-r,b[3]=k-s,b[4]=1-(j+p),b[5]=o+q,b[6]=l+r,b[7]=o-q,b[8]=1-(j+m),b},p.toMat4=function(a,b){b||(b=o.create());var c=a[0],d=a[1],e=a[2],f=a[3],g=c+c,h=d+d,i=e+e,j=c*g,k=c*h,l=c*i,m=d*h,n=d*i,p=e*i,q=f*g,r=f*h,s=f*i;return b[0]=1-(m+p),b[1]=k+s,b[2]=l-r,b[3]=0,b[4]=k-s,b[5]=1-(j+p),b[6]=n+q,b[7]=0,b[8]=l+r,b[9]=n-q,b[10]=1-(j+m),b[11]=0,b[12]=0,b[13]=0,b[14]=0,b[15]=1,b},p.slerp=function(a,b,c,d){d||(d=a);var e=a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3],f,g,h,i;return Math.abs(e)>=1?(d!==a&&(d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=a[3]),d):(f=Math.acos(e),g=Math.sqrt(1-e*e),Math.abs(g)<.001?(d[0]=a[0]*.5+b[0]*.5,d[1]=a[1]*.5+b[1]*.5,d[2]=a[2]*.5+b[2]*.5,d[3]=a[3]*.5+b[3]*.5,d):(h=Math.sin((1-c)*f)/g,i=Math.sin(c*f)/g,d[0]=a[0]*h+b[0]*i,d[1]=a[1]*h+b[1]*i,d[2]=a[2]*h+b[2]*i,d[3]=a[3]*h+b[3]*i,d))},p.fromRotationMatrix=function(a,b){b||(b=p.create());var c=a[0]+a[4]+a[8],d;if(c>0)d=Math.sqrt(c+1),b[3]=.5*d,d=.5/d,b[0]=(a[7]-a[5])*d,b[1]=(a[2]-a[6])*d,b[2]=(a[3]-a[1])*d;else{var e=p.fromRotationMatrix.s_iNext=p.fromRotationMatrix.s_iNext||[1,2,0],f=0;a[4]>a[0]&&(f=1),a[8]>a[f*3+f]&&(f=2);var g=e[f],h=e[g];d=Math.sqrt(a[f*3+f]-a[g*3+g]-a[h*3+h]+1),b[f]=.5*d,d=.5/d,b[3]=(a[h*3+g]-a[g*3+h])*d,b[g]=(a[g*3+f]+a[f*3+g])*d,b[h]=(a[h*3+f]+a[f*3+h])*d}return b},n.toQuat4=p.fromRotationMatrix,function(){var a=n.create();p.fromAxes=function(b,c,d,e){return a[0]=c[0],a[3]=c[1],a[6]=c[2],a[1]=d[0],a[4]=d[1],a[7]=d[2],a[2]=b[0],a[5]=b[1],a[8]=b[2],p.fromRotationMatrix(a,e)}}(),p.identity=function(a){return a||(a=p.create()),a[0]=0,a[1]=0,a[2]=0,a[3]=1,a},p.fromAngleAxis=function(a,b,c){c||(c=p.create());var d=a*.5,e=Math.sin(d);return c[3]=Math.cos(d),c[0]=e*b[0],c[1]=e*b[1],c[2]=e*b[2],c},p.toAngleAxis=function(a,b){b||(b=a);var d=a[0]*a[0]+a[1]*a[1]+a[2]*a[2];if(d>0){b[3]=2*Math.acos(a[3]);var e=c.invsqrt(d);b[0]=a[0]*e,b[1]=a[1]*e,b[2]=a[2]*e}else b[3]=0,b[0]=1,b[1]=0,b[2]=0;return b},p.str=function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"};var r={};r.create=function(a){var b=new d(2);return a?(b[0]=a[0],b[1]=a[1]):(b[0]=0,b[1]=0),b},r.createFrom=function(a,b){var c=new d(2);return c[0]=a,c[1]=b,c},r.add=function(a,b,c){return c||(c=b),c[0]=a[0]+b[0],c[1]=a[1]+b[1],c},r.subtract=function(a,b,c){return c||(c=b),c[0]=a[0]-b[0],c[1]=a[1]-b[1],c},r.multiply=function(a,b,c){return c||(c=b),c[0]=a[0]*b[0],c[1]=a[1]*b[1],c},r.divide=function(a,b,c){return c||(c=b),c[0]=a[0]/b[0],c[1]=a[1]/b[1],c},r.scale=function(a,b,c){return c||(c=a),c[0]=a[0]*b,c[1]=a[1]*b,c},r.dist=function(a,b){var c=b[0]-a[0],d=b[1]-a[1];return Math.sqrt(c*c+d*d)},r.set=function(a,b){return b[0]=a[0],b[1]=a[1],b},r.equal=function(a,c){return a===c||Math.abs(a[0]-c[0])<b&&Math.abs(a[1]-c[1])<b},r.negate=function(a,b){return b||(b=a),b[0]=-a[0],b[1]=-a[1],b},r.normalize=function(a,b){b||(b=a);var c=a[0]*a[0]+a[1]*a[1];return c>0?(c=Math.sqrt(c),b[0]=a[0]/c,b[1]=a[1]/c):b[0]=b[1]=0,b},r.cross=function(a,b,c){var d=a[0]*b[1]-a[1]*b[0];return c?(c[0]=c[1]=0,c[2]=d,c):d},r.length=function(a){var b=a[0],c=a[1];return Math.sqrt(b*b+c*c)},r.squaredLength=function(a){var b=a[0],c=a[1];return b*b+c*c},r.dot=function(a,b){return a[0]*b[0]+a[1]*b[1]},r.direction=function(a,b,c){c||(c=a);var d=a[0]-b[0],e=a[1]-b[1],f=d*d+e*e;return f?(f=1/Math.sqrt(f),c[0]=d*f,c[1]=e*f,c):(c[0]=0,c[1]=0,c[2]=0,c)},r.lerp=function(a,b,c,d){return d||(d=a),d[0]=a[0]+c*(b[0]-a[0]),d[1]=a[1]+c*(b[1]-a[1]),d},r.str=function(a){return"["+a[0]+", "+a[1]+"]"};var s={};s.create=function(a){var b=new d(4);return a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3]):b[0]=b[1]=b[2]=b[3]=0,b},s.createFrom=function(a,b,c,e){var f=new d(4);return f[0]=a,f[1]=b,f[2]=c,f[3]=e,f},s.set=function(a,b){return b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b},s.equal=function(a,c){return a===c||Math.abs(a[0]-c[0])<b&&Math.abs(a[1]-c[1])<b&&Math.abs(a[2]-c[2])<b&&Math.abs(a[3]-c[3])<b},s.identity=function(a){return a||(a=s.create()),a[0]=1,a[1]=0,a[2]=0,a[3]=1,a},s.transpose=function(a,b){if(!b||a===b){var c=a[1];return a[1]=a[2],a[2]=c,a}return b[0]=a[0],b[1]=a[2],b[2]=a[1],b[3]=a[3],b},s.determinant=function(a){return a[0]*a[3]-a[2]*a[1]},s.inverse=function(a,b){b||(b=a);var c=a[0],d=a[1],e=a[2],f=a[3],g=c*f-e*d;return g?(g=1/g,b[0]=f*g,b[1]=-d*g,b[2]=-e*g,b[3]=c*g,b):null},s.multiply=function(a,b,c){c||(c=a);var d=a[0],e=a[1],f=a[2],g=a[3];return c[0]=d*b[0]+e*b[2],c[1]=d*b[1]+e*b[3],c[2]=f*b[0]+g*b[2],c[3]=f*b[1]+g*b[3],c},s.rotate=function(a,b,c){c||(c=a);var d=a[0],e=a[1],f=a[2],g=a[3],h=Math.sin(b),i=Math.cos(b);return c[0]=d*i+e*h,c[1]=d*-h+e*i,c[2]=f*i+g*h,c[3]=f*-h+g*i,c},s.multiplyVec2=function(a,b,c){c||(c=b);var d=b[0],e=b[1];return c[0]=d*a[0]+e*a[1],c[1]=d*a[2]+e*a[3],c},s.scale=function(a,b,c){c||(c=a);var d=a[0],e=a[1],f=a[2],g=a[3],h=b[0],i=b[1];return c[0]=d*h,c[1]=e*i,c[2]=f*h,c[3]=g*i,c},s.str=function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"};var t={};return t.create=function(a){var b=new d(4);return a?(b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3]):(b[0]=0,b[1]=0,b[2]=0,b[3]=0),b},t.createFrom=function(a,b,c,e){var f=new d(4);return f[0]=a,f[1]=b,f[2]=c,f[3]=e,f},t.add=function(a,b,c){return c||(c=b),c[0]=a[0]+b[0],c[1]=a[1]+b[1],c[2]=a[2]+b[2],c[3]=a[3]+b[3],c},t.subtract=function(a,b,c){return c||(c=b),c[0]=a[0]-b[0],c[1]=a[1]-b[1],c[2]=a[2]-b[2],c[3]=a[3]-b[3],c},t.multiply=function(a,b,c){return c||(c=b),c[0]=a[0]*b[0],c[1]=a[1]*b[1],c[2]=a[2]*b[2],c[3]=a[3]*b[3],c},t.divide=function(a,b,c){return c||(c=b),c[0]=a[0]/b[0],c[1]=a[1]/b[1],c[2]=a[2]/b[2],c[3]=a[3]/b[3],c},t.scale=function(a,b,c){return c||(c=a),c[0]=a[0]*b,c[1]=a[1]*b,c[2]=a[2]*b,c[3]=a[3]*b,c},t.set=function(a,b){return b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b},t.equal=function(a,c){return a===c||Math.abs(a[0]-c[0])<b&&Math.abs(a[1]-c[1])<b&&Math.abs(a[2]-c[2])<b&&Math.abs(a[3]-c[3])<b},t.negate=function(a,b){return b||(b=a),b[0]=-a[0],b[1]=-a[1],b[2]=-a[2],b[3]=-a[3],b},t.length=function(a){var b=a[0],c=a[1],d=a[2],e=a[3];return Math.sqrt(b*b+c*c+d*d+e*e)},t.squaredLength=function(a){var b=a[0],c=a[1],d=a[2],e=a[3];return b*b+c*c+d*d+e*e},t.lerp=function(a,b,c,d){return d||(d=a),d[0]=a[0]+c*(b[0]-a[0]),d[1]=a[1]+c*(b[1]-a[1]),d[2]=a[2]+c*(b[2]-a[2]),d[3]=a[3]+c*(b[3]-a[3]),d},t.str=function(a){return"["+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+"]"},a&&(a.glMatrixArrayType=d,a.MatrixArray=d,a.setMatrixArrayType=e,a.determineMatrixArrayType=f,a.glMath=c,a.vec2=r,a.vec3=g,a.vec4=t,a.mat2=s,a.mat3=n,a.mat4=o,a.quat4=p),{glMatrixArrayType:d,MatrixArray:d,setMatrixArrayType:e,determineMatrixArrayType:f,glMath:c,vec2:r,vec3:g,vec4:t,mat2:s,mat3:n,mat4:o,quat4:p}});
+
/*
- *
- * This software is licensed under the MIT licence (as defined by the OSI at
- * http://www.opensource.org/licenses/mit-license.php)
- *
- * ***************************************************************************
- * Copyright (C) 2011 by Intel Corporation Ltd.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software" ),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- * ***************************************************************************
- */
+* jQuery Mobile Framework : scrollview plugin
+* Copyright (c) 2010 Adobe Systems Incorporated - Kin Blas (jblas@adobe.com)
+* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses.
+* Note: Code is in draft form and is subject to change
+* Modified by Koeun Choi <koeun.choi@samsung.com>
+* Modified by Minkyu Kang <mk7.kang@samsung.com>
+*/
-// Base class for widgets that need the following features:
-//
-// I. HTML prototype loading
-//
-// This class provides HTML prototype loading for widgets. That is, the widget implementation specifies its HTML portions
-// in one continuous HTML snippet, and it optionally provides an object containing selectors into the various parts of the
-// HTML snippet. This widget loads the HTML snippet into a jQuery object, and optionally assigns jQuery objects to each of
-// the selectors in the optionally provided object.
-//
-// To use this functionality you can either derive from this class, or you can call its prototype's gtype method.
-//
-// 1. Widgets deriving from this class should define _htmlProto as part of their prototype declaration. _htmlProto looks like
-// this:
-//
-// _htmlProto: {
-// source: string|jQuery object (optional) default: string - The name of the widget
-// ui: {
-// uiElement1: "#ui-element-1-selector",
-// uiElement2: "#ui-element-2-selector",
-// ...
-// subElement: {
-// subElement1: "#sub-element-1-selector",
-// subElement2: "#sub-element-2-selector",
-// ...
-// }
-// ...
-// }
-// }
-//
-// If neither 'source' nor 'ui' are defined, you must still include an empty _htmlProto key (_htmlProto: {}) to indicate
-// that you wish to make use of this feature. This will cause a prototype HTML file named after your widget to be loaded.
-// The loaded prototype will be placed into your widget's prototype's _protoHtml.source key.
-//
-// If 'source' is defined as a string, it is the name of the widget (including namespace). This is the default. If your
-// widget's HTML prototype is loaded via AJAX and the name of the AJAX file is different from the name of your widget
-// (that is, it is not "<widgetName>.prototype.html", then you should explicitly define 'source' as:
-//
-// If you wish to load HTML prototypes via AJAX, modify the getProtoPath() function defined below to reflect the directory
-// structure holding your widget HTML prototypes.
-//
-// source: "alternateWidgetName"
-//
-// If AJAX loading fails, source is set to a jQuery object containing a div with an error message. You can check whether
-// loading failed via the jQuery object's jqmData( "tizen.widgetex.ajax.fail" ) data item. If false, then the jQuery object
-// is the actual prototype loaded via AJAX or present inline. Otherwise, the jQuery object is the error message div.
-//
-// If 'source' is defined as a jQuery object, it is considered already loaded.
-//
-// if 'ui' is defined inside _htmlProto, It is assumed to be an object such that every one of its keys is either a string,
-// or another object with the same properties as itself.
-//
-// When a widget is instantiated, the HTML prototype is loaded if not already present in the prototype. If 'ui' is present
-// inside _htmlProto, the prototype is cloned. Then, a new structure is created based on 'ui' with each selector replaced
-// by a jQuery object containing the results of performing .find() on the prototype's clone with the filter set to the
-// value of the string. In the special case where the selector starts with a '#', the ID is removed from the element after
-// it is assigned into the structure being created. This structure is then made accessible from the widget instance via
-// the '_ui' key (i.e., this._ui).
-//
-// 2. Use the loadPrototype method when your widget does not derive from $.tizen.widgetex:
-// Add _htmlProto to your widget's prototype as described above. Then, in your widget's _create() method, call
-// loadPrototype in the following manner:
-//
-// $.tizen.widgetex.loadPrototype.call(this, "namespace.widgetName" );
-//
-// Thereafter, you may use the HTML prototype from your widget's prototype or, if you have specified a 'ui' key in your
-// _htmlProto key, you may use this._ui from your widget instance.
-//
-// II. realize method
-//
-// When a widget is created, some of its properties cannot be set immediately, because they depend on the widths/heights
-// of its constituent elements. They can only be calculated when the page containing the widget is made visible via the
-// "pageshow" event, because widths/heights always evaluate to 0 when retrieved from a widget that is not visible. When
-// you inherit from widgetex, you can add a "_realize" function to your prototype. This function will be called once right
-// after _create() if the element that anchors your widget is on a visible page. Otherwise, it will be called when the
-// page to which the widget belongs emits the "pageshow" event.
-//
-// NB: If your widget is inside a container which is itself not visible, such as an expandable or a collapsible, your
-// widget will remain hidden even though "pageshow" is fired and therefore _realize is called. In this case, widths and
-// heights will be unreliable even during _realize.
-//
-// III. systematic option handling
-//
-// If a widget has lots of options, the _setOption function can become a long switch for setting each recognized option.
-// It is also tempting to allow options to determine the way a widget is created, by basing decisions on various options
-// during _create(). Often, the actions based on option values in _create() are the same as those in _setOption. To avoid
-// such code duplication, this class calls _setOption once for each option after _create() has completed.
-//
-// Furthermore, to avoid writing long switches in a widget's _setOption method, this class implements _setOption in such
-// a way that, for any given option (e.g. "myOption" ), _setOption looks for a method _setMyOption in the widget's
-// implementation, and if found, calls the method with the value of the option.
-//
-// If your widget does not inherit from widgetex, you can still use widgetex' systematic option handling:
-// 1. define the _setOption method for your widget as follows:
-// _setOption: $.tizen.widgetex.prototype._setOption
-// 2. Call this._setOptions(this.options) from your widget's _create() function.
-// 3. As with widgetex-derived widgets, implement a corresponding _setMyOptionName function for each option myOptionName
-// you wish to handle.
-//
-// IV. systematic value handling for input elements
-//
-// If your widget happens to be constructed from an <input> element, you have to handle the "value" attribute specially,
-// and you have to emit the "change" signal whenever it changes, in addition to your widget's normal signals and option
-// changes. With widgetex, you can assign one of your widget's "data-*" properties to be synchronized to the "value"
-// property whenever your widget is constructed onto an <input> element. To do this, define, in your prototype:
-//
-// _value: {
-// attr: "data-my-attribute",
-// signal: "signal-to-emit"
-// }
-//
-// Then, call this._setValue(newValue) whenever you wish to set the value for your widget. This will set the data-*
-// attribute, emit the custom signal (if set) with the new value as its parameter, and, if the widget is based on an
-// <input> element, it will also set the "value" attribute and emit the "change" signal.
-//
-// "attr" is required if you choose to define "_value", and identifies the data-attribute to set in addition to "value",
-// if your widget's element is an input.
-// "signal" is optional, and will be emitted when setting the data-attribute via this._setValue(newValue).
-//
-// If your widget does not derive from widgetex, you can still define "_value" as described above and call
-// $.tizen.widgetex.setValue(widget, newValue).
-//
-// V. Systematic enabled/disabled handling for input elements
-//
-// widgetex implements _setDisabled which will disable the input associated with this widget, if any. Thus, if you derive
-// from widgetex and you plan on implementing the disabled state, you should chain up to
-// $.tizen.widgetex.prototype._setDisabled(value), rather than $.Widget.prototype._setOption( "disabled", value).
+(function ( $, window, document, undefined ) {
-(function ($, undefined) {
+ function resizePageContentHeight( page ) {
+ var $page = $( page ),
+ $content = $page.children(".ui-content"),
+ hh = $page.children(".ui-header").outerHeight() || 0,
+ fh = $page.children(".ui-footer").outerHeight() || 0,
+ pt = parseFloat( $content.css("padding-top") ),
+ pb = parseFloat( $content.css("padding-bottom") ),
+ wh = $( window ).height();
-// Framework-specific HTML prototype path for AJAX loads
- function getProtoPath() {
- var theScriptTag = $( "script[data-framework-version][data-framework-root][data-framework-theme]" );
+ $content.height( wh - (hh + fh) - (pt + pb) );
+ }
- return (theScriptTag.attr( "data-framework-root" ) + "/" +
- theScriptTag.attr( "data-framework-version" ) + "/themes/" +
- theScriptTag.attr( "data-framework-theme" ) + "/proto-html" );
+ function MomentumTracker( options ) {
+ this.options = $.extend( {}, options );
+ this.easing = "easeOutQuad";
+ this.reset();
}
- $.widget( "tizen.widgetex", $.mobile.widget, {
- _createWidget: function () {
- $.tizen.widgetex.loadPrototype.call( this, this.namespace + "." + this.widgetName );
- $.mobile.widget.prototype._createWidget.apply( this, arguments );
- },
+ var tstates = {
+ scrolling: 0,
+ overshot: 1,
+ snapback: 2,
+ done: 3
+ };
- _init: function () {
- // TODO THIS IS TEMPORARY PATCH TO AVOID CTXPOPUP PAGE CRASH
- if ( this.element === undefined ) {
- return;
- }
+ function getCurrentTime() {
+ return Date.now();
+ }
- var page = this.element.closest( ".ui-page" ),
- self = this,
- myOptions = {};
+ jQuery.widget( "tizen.scrollview", jQuery.mobile.widget, {
+ options: {
+ direction: null, // "x", "y", or null for both.
- if ( page.is( ":visible" ) ) {
- this._realize();
- } else {
- page.bind( "pageshow", function () { self._realize(); } );
- }
+ timerInterval: 10,
+ scrollDuration: 1000, // Duration of the scrolling animation in msecs.
+ overshootDuration: 250, // Duration of the overshoot animation in msecs.
+ snapbackDuration: 500, // Duration of the snapback animation in msecs.
- $.extend( myOptions, this.options );
+ moveThreshold: 30, // User must move this many pixels in any direction to trigger a scroll.
+ moveIntervalThreshold: 150, // Time between mousemoves must not exceed this threshold.
- this.options = {};
+ scrollMethod: "translate", // "translate", "position"
+ startEventName: "scrollstart",
+ updateEventName: "scrollupdate",
+ stopEventName: "scrollstop",
- this._setOptions( myOptions );
+ eventType: $.support.touch ? "touch" : "mouse",
+
+ showScrollBars: true,
+ overshootEnable: false,
+ outerScrollEnable: false,
+ overflowEnable: true,
+ scrollJump: false,
},
- _getCreateOptions: function () {
- // if we're dealing with an <input> element, value takes precedence over corresponding data-* attribute, if a
- // mapping has been established via this._value. So, assign the value to the data-* attribute, so that it may
- // then be assigned to this.options in the superclass' _getCreateOptions
+ _getViewHeight: function () {
+ return this._$view.height();
+ },
- if (this.element.is( "input" ) && this._value !== undefined) {
- var theValue =
- ( ( this.element.attr( "type" ) === "checkbox" || this.element.attr( "type" ) === "radio" )
- ? this.element.is( ":checked" )
- : this.element.is( "[value]" )
- ? this.element.attr( "value" )
- : undefined);
+ _getViewWidth: function () {
+ return this._$view.width();
+ },
- if ( theValue != undefined ) {
- this.element.attr( this._value.attr, theValue );
- }
+ _makePositioned: function ( $ele ) {
+ if ( $ele.css("position") === "static" ) {
+ $ele.css( "position", "relative" );
}
-
- return $.mobile.widget.prototype._getCreateOptions.apply( this, arguments );
},
- _setOption: function ( key, value ) {
- var setter = "_set" + key.replace(/^[a-z]/, function (c) { return c.toUpperCase(); } );
+ _create: function () {
+ var direction,
+ self = this;
- if ( this[setter] !== undefined ) {
- this[setter]( value );
+ this._$clip = $( this.element ).addClass("ui-scrollview-clip");
+
+ if ( this._$clip.children(".ui-scrollview-view").length ) {
+ this._$view = this._$clip.children(".ui-scrollview-view");
} else {
- $.mobile.widget.prototype._setOption.apply( this, arguments );
+ this._$view = this._$clip.wrapInner("<div></div>").children()
+ .addClass("ui-scrollview-view");
}
- },
- _setDisabled: function ( value ) {
- $.Widget.prototype._setOption.call( this, "disabled", value );
- if ( this.element.is( "input" ) ) {
- this.element.attr( "disabled", value );
+ if ( this.options.scrollMethod === "translate" ) {
+ if ( this._$view.css("transform") === undefined ) {
+ this.options.scrollMethod = "position";
+ }
}
- },
- _setValue: function ( newValue ) {
- $.tizen.widgetex.setValue( this, newValue );
- },
+ this._$clip.css( "overflow", "hidden" );
+ this._makePositioned( this._$clip );
- _realize: function () {}
- } );
+ this._makePositioned( this._$view );
+ this._$view.css( { left: 0, top: 0 } );
- $.tizen.widgetex.setValue = function ( widget, newValue ) {
- if ( widget._value !== undefined ) {
- var valueString = ( widget._value.makeString ? widget._value.makeString(newValue) : newValue ),
- inputType;
+ this._view_height = this._getViewHeight();
- widget.element.attr( widget._value.attr, valueString );
- if ( widget._value.signal !== undefined ) {
- widget.element.triggerHandler( widget._value.signal, newValue );
- }
+ this._sx = 0;
+ this._sy = 0;
- if ( widget.element.is( "input" ) ) {
- inputType = widget.element.attr( "type" );
+ direction = this.options.direction;
- // Special handling for checkboxes and radio buttons, where the presence of the "checked" attribute is really
- // the value
- if ( inputType === "checkbox" || inputType === "radio" ) {
- if ( newValue ) {
- widget.element.attr( "checked", true );
- } else {
- widget.element.removeAttr( "checked" );
- }
- } else {
- widget.element.attr( "value", valueString );
- }
+ this._hTracker = ( direction !== "y" ) ?
+ new MomentumTracker( this.options ) : null;
+ this._vTracker = ( direction !== "x" ) ?
+ new MomentumTracker( this.options ) : null;
- widget.element.trigger( "change" );
- }
- }
- };
+ this._timerInterval = this.options.timerInterval;
+ this._timerID = 0;
- $.tizen.widgetex.assignElements = function (proto, obj) {
- var ret = {},
- key;
+ this._timerCB = function () {
+ self._handleMomentumScroll();
+ };
- for ( key in obj ) {
- if ( ( typeof obj[key] ) === "string" ) {
- ret[key] = proto.find( obj[key] );
- if ( obj[key].match(/^#/) ) {
- ret[key].removeAttr( "id" );
- }
- } else {
- if ( (typeof obj[key]) === "object" ) {
- ret[key] = $.tizen.widgetex.assignElements( proto, obj[key] );
- }
- }
- }
+ this._add_event();
+ this._add_scrollbar();
+ this._add_scroll_jump();
+ this._add_overflow_indicator();
+ },
- return ret;
- };
+ _startMScroll: function ( speedX, speedY ) {
+ var keepGoing = false,
+ duration = this.options.scrollDuration,
+ ht = this._hTracker,
+ vt = this._vTracker,
+ c,
+ v;
- $.tizen.widgetex.loadPrototype = function ( widget, ui ) {
- var ar = widget.split( "." ),
- namespace,
- widgetName,
- source,
- noSource = false,
- htmlProto,
- protoPath;
+ this._$clip.trigger( this.options.startEventName );
- if ( ar.length == 2 ) {
- namespace = ar[0];
- widgetName = ar[1];
+ if ( ht ) {
+ c = this._$clip.width();
+ v = this._getViewWidth();
- // If htmlProto is defined
- if ( $[namespace][widgetName].prototype._htmlProto !== undefined ) {
- // If no source is defined, use the widget name
- source = $[namespace][widgetName].prototype._htmlProto.source;
- if ( source === undefined ) {
- source = widgetName;
- noSource = true;
+ if ( (( this._sx === 0 && speedX > 0 ) ||
+ ( this._sx === -(v - c) && speedX < 0 )) &&
+ v > c ) {
+ return;
}
- // Load the HTML prototype via AJAX if not defined inline
- if ( typeof source === "string" ) {
- if ( noSource ) { // use external htmlproto file
- // Establish the path for the proto file
- widget = source;
- protoPath = getProtoPath();
+ ht.start( this._sx, speedX,
+ duration, (v > c) ? -(v - c) : 0, 0 );
+ keepGoing = !ht.done();
+ }
- // Make the AJAX call
- $.ajax( {
- url: protoPath + "/" + widget + ".prototype.html",
- async: false,
- dataType: "html"
- }).success( function (data, textStatus, jqXHR ) {
- source = $( "<div></div>" ).html(data).jqmData( "tizen.widgetex.ajax.fail", false );
- } );
+ if ( vt ) {
+ c = this._$clip.height();
+ v = this._getViewHeight();
- // Assign the HTML proto to the widget prototype
- source = $( "<div></div>" )
- .text( "Failed to load proto for widget " + namespace + "." + widgetName + "!" )
- .css( {background: "red", color: "blue", border: "1px solid black"} )
- .jqmData( "tizen.widgetex.ajax.fail", true );
+ if ( (( this._sy === 0 && speedY > 0 ) ||
+ ( this._sy === -(v - c) && speedY < 0 )) &&
+ v > c ) {
+ return;
+ }
- } else {
- // inline definition (string)
- source = $( source ).jqmData( "tizen.widgetex.ajax.fail", false );
- }
+ vt.start( this._sy, speedY,
+ duration, (v > c) ? -(v - c) : 0, 0 );
+ keepGoing = keepGoing || !vt.done();
+ }
- } else {
- // inline definition (object)
- // AJAX loading has trivially succeeded, since there was no AJAX loading at all
- source.jqmData( "tizen.widgetex.ajax.fail", false );
- }
- htmlProto = source;
- $[namespace][widgetName].prototype._htmlProto.source = source;
+ if ( keepGoing ) {
+ this._timerID = setTimeout( this._timerCB, this._timerInterval );
+ } else {
+ this._stopMScroll();
+ }
+ },
- // If there's a "ui" portion in the HTML proto, copy it over to this instance, and
- // replace the selectors with the selected elements from a copy of the HTML prototype
- if ( $[namespace][widgetName].prototype._htmlProto.ui !== undefined ) {
- // Assign the relevant parts of the proto
- $.extend( this, {
- _ui: $.tizen.widgetex.assignElements( htmlProto.clone(), $[namespace][widgetName].prototype._htmlProto.ui )
- });
- }
+ _stopMScroll: function () {
+ if ( this._timerID ) {
+ this._$clip.trigger( this.options.stopEventName );
+ clearTimeout( this._timerID );
}
- }
- };
+ this._timerID = 0;
-}( jQuery ) );
-/**
- @class Button
- The button widget shows a control on the screen that you can use to generate an action event when it is pressed and released. This widget is coded with standard HTML anchor and input elements and then enhanced by jQueryMobile to make it more attractive and usable on a mobile device. Buttons can be used in Tizen as described in the jQueryMobile documentation for buttons.
+ if ( this._vTracker ) {
+ this._vTracker.reset();
+ }
- To add a button widget to the application, use the following code
+ if ( this._hTracker ) {
+ this._hTracker.reset();
+ }
- <div data-role="button" data-inline="true">Text Button Test</div>
- <div data-role="button" data-inline="true" data-icon="plus" data-style="circle"></div>
- <div data-role="button" data-inline="true" data-icon="plus" data-style="nobg"></div>
+ this._hideScrollBars();
+ this._hideOverflowIndicator();
+ },
- The button can define callbacks for events as described in the jQueryMobile documentation for button events.<br/>
- You can use methods with the button as described in the jQueryMobile documentation for button methods.
-*/
+ _handleMomentumScroll: function () {
+ var keepGoing = false,
+ x = 0,
+ y = 0,
+ scroll_height = 0,
+ self = this,
+ end_effect = function ( dir ) {
+ setTimeout( function () {
+ self._effect_dir = dir;
+ self._setEndEffect( "in" );
+ }, 100 );
-/**
- @property {String} data-style
- Defines the button style. <br/> The default value is box. If the value is set to circle, a circle-shaped button is created. If the value is set to nobg, a button is created without a background.
+ setTimeout( function () {
+ self._setEndEffect( "out" );
+ }, 350 );
+ },
+ vt = this._vTracker,
+ ht = this._hTracker;
-*/
-/**
- @property {String} data-icon
- Defines an icon for a button. Tizen supports 12 icon styles: reveal, closed, opened, info, rename, call, warning, plus, minus, cancel, send, and favorite.
+ if ( this._outerScrolling ) {
+ return;
+ }
-*/
-/**\r
- @class Checkbox\r
- The check box widget shows a list of options on the screen where one or more can be selected. Check boxes can be used in Tizen as described in the jQueryMobile documentation for check boxes.<br/> To add a check box widget to the application, use the following code:\r
-\r
- <input type="checkbox" name="mycheck" id="check-test" class="favorite" />\r
- <label for="check-test">Favorite</label>\r
- <input type="checkbox" name="check-favorite" id="check-test2" checked="checked" disabled="disabled" class="favorite" />\r
- <label for="check-test2">Favorite Checked, Disabled</label>\r
-\r
- The check box can define callbacks for events as described in the jQueryMobile documentation for check box events.\r
- You can use methods with the check box as described in the jQueryMobile documentation for check box methods.\r
-\r
-*/\r
-/**\r
- @property {String} class\r
- Defines the check box style. <br/> The default value is check. If the value is set to favorite, a star-shaped check box is created.\r
-*/
-/* ***************************************************************************
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software" ),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- * ***************************************************************************
- */
+ if ( vt ) {
+ vt.update( this.options.overshootEnable );
+ y = vt.getPosition();
+ keepGoing = !vt.done();
-// most of following codes are derived from jquery.mobile.scrollview.js
-(function ( $, window, document, undefined ) {
+ if ( vt.getRemained() > this.options.overshootDuration ) {
+ scroll_height = this._getViewHeight() - this._$clip.height();
- function circularNum( num, total ) {
- var n = num % total;
- if ( n < 0 ) {
- n = total + n;
- }
- return n;
- }
+ if ( !vt.isAvail() ) {
+ if ( this._speedY > 0 ) {
+ this._outerScroll( vt.getRemained() / 3, scroll_height );
+ } else {
+ this._outerScroll( y - vt.getRemained() / 3, scroll_height );
+ }
+ } else if ( vt.isMin() ) {
+ this._outerScroll( y - vt.getRemained() / 3, scroll_height );
- function setElementTransform( $ele, x, y ) {
- var v = "translate3d( " + x + "," + y + ", 0px)";
- $ele.css({
- "-ms-transform": v,
- "-o-transform": v,
- "-moz-transform": v,
- "-webkit-transform": v,
- "transform": v
- } );
- }
+ if ( scroll_height > 0 ) {
+ end_effect( 1 );
+ }
+ } else if ( vt.isMax() ) {
+ this._outerScroll( vt.getRemained() / 3, scroll_height );
- function MomentumTracker( options ) {
- this.options = $.extend( {}, options );
- this.easing = "easeOutQuad";
- this.reset();
- }
+ if ( scroll_height > 0 ) {
+ end_effect( 0 );
+ }
+ }
+ }
+ }
- var tstates = {
- scrolling : 0,
- done : 1
- };
+ if ( ht ) {
+ ht.update( this.options.overshootEnable );
+ x = ht.getPosition();
+ keepGoing = keepGoing || !ht.done();
+ }
- function getCurrentTime() {
- return Date.now();
- }
+ this._setScrollPosition( x, y );
+ this._$clip.trigger( this.options.updateEventName,
+ [ { x: x, y: y } ] );
- $.extend( MomentumTracker.prototype, {
- start: function ( pos, speed, duration ) {
- this.state = ( speed != 0 ) ? tstates.scrolling : tstates.done;
- this.pos = pos;
- this.speed = speed;
- this.duration = duration;
+ if ( keepGoing ) {
+ this._timerID = setTimeout( this._timerCB, this._timerInterval );
+ } else {
+ this._stopMScroll();
+ }
+ },
- this.fromPos = 0;
- this.toPos = 0;
+ _setElementTransform: function ( $ele, x, y, duration ) {
+ var translate,
+ transition;
- this.startTime = getCurrentTime();
- },
+ if ( !duration || duration === undefined ) {
+ transition = "none";
+ } else {
+ transition = "-webkit-transform " + duration / 1000 + "s ease-out";
+ }
- reset: function () {
- this.state = tstates.done;
- this.pos = 0;
- this.speed = 0;
- this.duration = 0;
+ if ( $.support.cssTransform3d ) {
+ translate = "translate3d(" + x + "," + y + ", 0px)";
+ } else {
+ translate = "translate(" + x + "," + y + ")";
+ }
+
+ $ele.css({
+ "-moz-transform": translate,
+ "-webkit-transform": translate,
+ "-ms-transform": translate,
+ "-o-transform": translate,
+ "transform": translate,
+ "-webkit-transition": transition
+ });
},
- update: function () {
- var state = this.state,
- duration,
- elapsed,
- dx,
- x;
+ _setEndEffect: function ( dir ) {
+ var scroll_height = this._getViewHeight() - this._$clip.height();
- if ( state == tstates.done ) {
- return this.pos;
+ if ( this._softkeyboard ) {
+ if ( this._effect_dir ) {
+ this._outerScroll( -scroll_height - this._softkeyboardHeight,
+ scroll_height );
+ } else {
+ this._outerScroll( this._softkeyboardHeight, scroll_height );
+ }
+ return;
}
- duration = this.duration;
- elapsed = getCurrentTime() - this.startTime;
- elapsed = elapsed > duration ? duration : elapsed;
+ if ( dir === "in" ) {
+ if ( this._endEffect ) {
+ return;
+ }
- dx = this.speed * ( 1 - $.easing[this.easing](elapsed / duration, elapsed, 0, 1, duration ) );
+ this._endEffect = true;
+ this._setOverflowIndicator( this._effect_dir );
+ this._showOverflowIndicator();
+ } else if ( dir === "out" ) {
+ if ( !this._endEffect ) {
+ return;
+ }
- x = this.pos + dx;
- this.pos = x;
+ this._endEffect = false;
+ } else {
+ this._endEffect = false;
+ this._setOverflowIndicator();
+ this._showOverflowIndicator();
+ }
+ },
- if ( elapsed >= duration ) {
- this.state = tstates.done;
+ _setCalibration: function ( x, y ) {
+ if ( this.options.overshootEnable ) {
+ this._sx = x;
+ this._sy = y;
+ return;
}
- return this.pos;
- },
+ var $v = this._$view,
+ $c = this._$clip,
+ dirLock = this._directionLock,
+ scroll_height = 0,
+ scroll_width = 0;
- done: function () {
- return this.state == tstates.done;
- },
+ if ( dirLock !== "y" && this._hTracker ) {
+ scroll_width = $v.width() - $c.width();
- getPosition: function () {
- return this.pos;
- }
- } );
+ if ( x >= 0 ) {
+ this._sx = 0;
+ } else if ( x < -scroll_width ) {
+ this._sx = -scroll_width;
+ } else {
+ this._sx = x;
+ }
- jQuery.widget( "mobile.circularview", jQuery.mobile.widget, {
- options: {
- fps: 60,
+ if ( scroll_width < 0 ) {
+ this._sx = 0;
+ }
+ }
- scrollDuration: 2000,
+ if ( dirLock !== "x" && this._vTracker ) {
+ scroll_height = this._getViewHeight() - $c.height();
- moveThreshold: 10,
- moveIntervalThreshold: 150,
+ if ( y > 0 ) {
+ this._sy = 0;
- startEventName: "scrollstart",
- updateEventName: "scrollupdate",
- stopEventName: "scrollstop",
+ if ( this._didDrag && scroll_height > 0 ) {
+ this._effect_dir = 0;
+ this._setEndEffect( "in" );
+ }
+ } else if ( y < -scroll_height ) {
+ this._sy = -scroll_height;
- eventType: $.support.touch ? "touch" : "mouse",
+ if ( this._didDrag && scroll_height > 0 ) {
+ this._effect_dir = 1;
+ this._setEndEffect( "in" );
+ }
+ } else {
+ if ( this._endEffect && this._sy !== y ) {
+ this._setEndEffect();
+ }
- delayedClickSelector: "a, .ui-btn",
- delayedClickEnabled: false
- },
+ this._sy = y;
+ }
- _makePositioned: function ( $ele ) {
- if ( $ele.css( 'position' ) == 'static' ) {
- $ele.css( 'position', 'relative' );
+ if ( scroll_height < 0 ) {
+ this._sy = 0;
+ }
}
},
- _create: function () {
- var self = this;
+ _setScrollPosition: function ( x, y, duration ) {
+ var $v = this._$view,
+ sm = this.options.scrollMethod,
+ $vsb = this._$vScrollBar,
+ $hsb = this._$hScrollBar,
+ $sbt;
- this._items = $( this.element ).jqmData('list');
- this._$clip = $( this.element ).addClass( "ui-scrollview-clip" );
- this._$clip.wrapInner( '<div class="ui-scrollview-view"></div>' );
- this._$view = $('.ui-scrollview-view', this._$clip );
- this._$list = $( 'ul', this._$clip );
-
- this._$clip.css( "overflow", "hidden" );
- this._makePositioned( this._$clip );
-
- this._$view.css( "overflow", "hidden" );
- this._tracker = new MomentumTracker( this.options );
-
- this._timerInterval = 1000 / this.options.fps;
- this._timerID = 0;
-
- this._timerCB = function () { self._handleMomentumScroll(); };
+ this._setCalibration( x, y );
- this.refresh();
+ x = this._sx;
+ y = this._sy;
- this._addBehaviors();
- },
+ if ( sm === "translate" ) {
+ this._setElementTransform( $v, x + "px", y + "px", duration );
+ } else {
+ $v.css( {left: x + "px", top: y + "px"} );
+ }
- reflow: function () {
- var xy = this.getScrollPosition();
- this.refresh();
- this.scrollTo( xy.x, xy.y );
- },
+ if ( $vsb ) {
+ $sbt = $vsb.find(".ui-scrollbar-thumb");
- refresh: function () {
- var itemsPerView;
+ if ( sm === "translate" ) {
+ this._setElementTransform( $sbt, "0px",
+ -y / this._getViewHeight() * $sbt.parent().height() + "px",
+ duration );
+ } else {
+ $sbt.css( "top", -y / this._getViewHeight() * 100 + "%" );
+ }
+ }
- this._$clip.width( $(window).width() );
- this._clipWidth = this._$clip.width();
- this._$list.empty();
- this._$list.append(this._items[0]);
- this._itemWidth = $(this._items[0]).outerWidth();
- $(this._items[0]).detach();
+ if ( $hsb ) {
+ $sbt = $hsb.find(".ui-scrollbar-thumb");
- itemsPerView = this._clipWidth / this._itemWidth;
- itemsPerView = Math.ceil( itemsPerView * 10 ) / 10;
- this._itemsPerView = parseInt( itemsPerView, 10 );
- while ( this._itemsPerView + 1 > this._items.length ) {
- $.merge( this._items, $(this._items).clone() );
+ if ( sm === "translate" ) {
+ this._setElementTransform( $sbt,
+ -x / $v.width() * $sbt.parent().width() + "px", "0px",
+ duration);
+ } else {
+ $sbt.css("left", -x / $v.width() * 100 + "%");
+ }
}
- this._rx = -this._itemWidth;
- this._sx = -this._itemWidth;
- this._setItems();
},
- _startMScroll: function ( speedX, speedY ) {
- this._stopMScroll();
-
- var keepGoing = false,
- duration = this.options.scrollDuration,
- t = this._tracker,
- c = this._clipWidth,
- v = this._viewWidth;
-
- this._$clip.trigger( this.options.startEventName);
-
- t.start( this._rx, speedX, duration, (v > c ) ? -(v - c) : 0, 0 );
- keepGoing = !t.done();
+ _outerScroll: function ( y, scroll_height ) {
+ var self = this,
+ top = $( window ).scrollTop() - window.screenTop,
+ sy = 0,
+ duration = this.options.snapbackDuration,
+ start = getCurrentTime(),
+ tfunc;
- if ( keepGoing ) {
- this._timerID = setTimeout( this._timerCB, this._timerInterval );
- } else {
- this._stopMScroll();
+ if ( !this.options.outerScrollEnable ) {
+ return;
}
- //console.log( "startmscroll" + this._rx + "," + this._sx );
- },
- _stopMScroll: function () {
- if ( this._timerID ) {
- this._$clip.trigger( this.options.stopEventName );
- clearTimeout( this._timerID );
+ if ( this._$clip.jqmData("scroll") !== "y" ) {
+ return;
}
- this._timerID = 0;
-
- if ( this._tracker ) {
- this._tracker.reset();
+ if ( this._outerScrolling ) {
+ return;
}
- //console.log( "stopmscroll" + this._rx + "," + this._sx );
- },
-
- _handleMomentumScroll: function () {
- var keepGoing = false,
- v = this._$view,
- x = 0,
- y = 0,
- t = this._tracker;
-
- if ( t ) {
- t.update();
- x = t.getPosition();
-
- keepGoing = !t.done();
+ if ( y > 0 ) {
+ sy = ( window.screenTop ? window.screenTop : -y );
+ } else if ( y < -scroll_height ) {
+ sy = -y - scroll_height;
+ } else {
+ return;
}
- this._setScrollPosition( x, y );
- this._rx = x;
-
- this._$clip.trigger( this.options.updateEventName, [ { x: x, y: y } ] );
+ tfunc = function () {
+ var elapsed = getCurrentTime() - start;
- if ( keepGoing ) {
- this._timerID = setTimeout( this._timerCB, this._timerInterval );
- } else {
- this._stopMScroll();
- }
- },
+ if ( elapsed >= duration ) {
+ window.scrollTo( 0, top + sy );
+ self._outerScrolling = undefined;
- _setItems: function () {
- var i,
- $item;
+ self._stopMScroll();
+ } else {
+ ec = $.easing.easeOutQuad( elapsed / duration,
+ elapsed, 0, 1, duration );
- for ( i = -1; i < this._itemsPerView + 1; i++ ) {
- $item = this._items[ circularNum( i, this._items.length ) ];
- this._$list.append( $item );
- }
- setElementTransform( this._$view, this._sx + "px", 0 );
- this._$view.width( this._itemWidth * ( this._itemsPerView + 2 ) );
- this._viewWidth = this._$view.width();
+ window.scrollTo( 0, top + ( sy * ec ) );
+ self._outerScrolling = setTimeout( tfunc, self._timerInterval );
+ }
+ };
+ this._outerScrolling = setTimeout( tfunc, self._timerInterval );
},
- _setScrollPosition: function ( x, y ) {
- var sx = this._sx,
+ _scrollTo: function ( x, y, duration ) {
+ var self = this,
+ start = getCurrentTime(),
+ efunc = $.easing.easeOutQuad,
+ sx = this._sx,
+ sy = this._sy,
dx = x - sx,
- di = parseInt( dx / this._itemWidth, 10 ),
- i,
- idx,
- $item;
+ dy = y - sy,
+ tfunc;
- if ( di > 0 ) {
- for ( i = 0; i < di; i++ ) {
- this._$list.children().last().detach();
- idx = -parseInt( ( sx / this._itemWidth ) + i + 3, 10 );
- $item = this._items[ circularNum( idx, this._items.length ) ];
- this._$list.prepend( $item );
- //console.log( "di > 0 : " + idx );
- }
- } else if ( di < 0 ) {
- for ( i = 0; i > di; i-- ) {
- this._$list.children().first().detach();
- idx = this._itemsPerView - parseInt( ( sx / this._itemWidth ) + i, 10 );
- $item = this._items[ circularNum( idx, this._items.length ) ];
- this._$list.append( $item );
- //console.log( "di < 0 : " + idx );
+ x = -x;
+ y = -y;
+
+ tfunc = function () {
+ var elapsed = getCurrentTime() - start,
+ ec;
+
+ if ( elapsed >= duration ) {
+ self._timerID = 0;
+ self._setScrollPosition( x, y );
+ } else {
+ ec = efunc( elapsed / duration, elapsed, 0, 1, duration );
+
+ self._setScrollPosition( sx + ( dx * ec ), sy + ( dy * ec ) );
+ self._timerID = setTimeout( tfunc, self._timerInterval );
}
- }
+ };
- this._sx += di * this._itemWidth;
+ this._timerID = setTimeout( tfunc, this._timerInterval );
+ },
- setElementTransform( this._$view, ( x - this._sx - this._itemWidth ) + "px", 0 );
+ scrollTo: function ( x, y, duration ) {
+ this._stopMScroll();
+ this._didDrag = false;
- //console.log( "rx " + this._rx + "sx " + this._sx );
+ if ( !duration || this.options.scrollMethod === "translate" ) {
+ this._setScrollPosition( x, y, duration );
+ } else {
+ this._scrollTo( x, y, duration );
+ }
},
- _enableTracking: function () {
- $(document).bind( this._dragMoveEvt, this._dragMoveCB );
- $(document).bind( this._dragStopEvt, this._dragStopCB );
+ getScrollPosition: function () {
+ return { x: -this._sx, y: -this._sy };
},
- _disableTracking: function () {
- $(document).unbind( this._dragMoveEvt, this._dragMoveCB );
- $(document).unbind( this._dragStopEvt, this._dragStopCB );
+ skipDragging: function ( value ) {
+ this._skip_dragging = value;
},
_getScrollHierarchy: function () {
var svh = [],
d;
- this._$clip.parents( '.ui-scrollview-clip' ).each( function () {
- d = $( this ).jqmData( 'circulaview' );
+
+ this._$clip.parents( ".ui-scrollview-clip").each( function () {
+ d = $( this ).jqmData("scrollview");
if ( d ) {
svh.unshift( d );
}
return svh;
},
- centerTo: function ( selector, duration ) {
- var i,
- newX;
+ _getAncestorByDirection: function ( dir ) {
+ var svh = this._getScrollHierarchy(),
+ n = svh.length,
+ sv,
+ svdir;
- for ( i = 0; i < this._items.length; i++ ) {
- if ( $( this._items[i]).is( selector ) ) {
- newX = -( i * this._itemWidth - this._clipWidth / 2 + this._itemWidth * 1.5 );
- this.scrollTo( newX + this._itemWidth, 0 );
- this.scrollTo( newX, 0, duration );
- return;
+ while ( 0 < n-- ) {
+ sv = svh[n];
+ svdir = sv.options.direction;
+
+ if (!svdir || svdir === dir) {
+ return sv;
}
}
+ return null;
},
- scrollTo: function ( x, y, duration ) {
+ _handleDragStart: function ( e, ex, ey ) {
this._stopMScroll();
- if ( !duration ) {
- this._setScrollPosition( x, y );
- this._rx = x;
- return;
- }
- var self = this,
- start = getCurrentTime(),
- efunc = $.easing.easeOutQuad,
- sx = this._rx,
- sy = 0,
- dx = x - sx,
- dy = 0,
- tfunc,
- elapsed,
- ec;
+ this._didDrag = false;
+ this._skip_dragging = false;
- this._rx = x;
+ var target = $( e.target ),
+ self = this,
+ $c = this._$clip,
+ svdir = this.options.direction;
- tfunc = function () {
- elapsed = getCurrentTime() - start;
- if ( elapsed >= duration ) {
- self._timerID = 0;
- self._setScrollPosition( x, y );
- self._$clip.trigger("scrollend");
- } else {
- ec = efunc( elapsed / duration, elapsed, 0, 1, duration );
- self._setScrollPosition( sx + ( dx * ec ), sy + ( dy * ec ) );
- self._timerID = setTimeout( tfunc, self._timerInterval );
- }
- };
+ /* should prevent the default behavior when click the button */
+ this._is_button = target.is( '.ui-btn' ) ||
+ target.is( '.ui-btn-text' ) ||
+ target.is( '.ui-btn-inner' ) ||
+ target.is( '.ui-btn-inner .ui-icon' );
- this._timerID = setTimeout( tfunc, this._timerInterval );
- },
+ /* should prevent the default behavior when click the slider */
+ if ( target.parents('.ui-slider').length || target.is('.ui-slider') ) {
+ this._skip_dragging = true;
+ return;
+ }
- getScrollPosition: function () {
- return { x: -this._rx, y: 0 };
- },
+ if ( target.is('textarea') ) {
+ target.bind( "scroll", function () {
+ self._skip_dragging = true;
+ target.unbind("scroll");
+ });
+ }
- _handleDragStart: function ( e, ex, ey ) {
- $.each( this._getScrollHierarchy(), function ( i, sv ) {
- sv._stopMScroll();
- } );
+ /*
+ * We need to prevent the default behavior to
+ * suppress accidental selection of text, etc.
+ */
+ this._is_inputbox = target.is(':input') ||
+ target.parents(':input').length > 0;
- this._stopMScroll();
+ if ( this._is_inputbox ) {
+ target.one( "resize.scrollview", function () {
+ if ( ey > $c.height() ) {
+ self.scrollTo( -ex, self._sy - ey + $c.height(),
+ self.options.snapbackDuration );
+ }
+ });
+ }
- if ( this.options.delayedClickEnabled ) {
- this._$clickEle = $( e.target ).closest( this.options.delayedClickSelector );
+ if ( this.options.eventType === "mouse" && !this._is_inputbox && !this._is_button ) {
+ e.preventDefault();
}
+
this._lastX = ex;
this._lastY = ey;
+ this._startY = ey;
+ this._doSnapBackX = false;
+ this._doSnapBackY = false;
this._speedX = 0;
this._speedY = 0;
- this._didDrag = false;
+ this._directionLock = "";
this._lastMove = 0;
this._enableTracking();
- this._ox = ex;
- this._nx = this._rx;
+ this._set_scrollbar_size();
+ },
- if ( this.options.eventType == "mouse" || this.options.delayedClickEnabled ) {
- e.preventDefault();
- }
- //console.log( "scrollstart" + this._rx + "," + this._sx );
- e.stopPropagation();
+ _propagateDragMove: function ( sv, e, ex, ey, dir ) {
+ this._hideScrollBars();
+ this._hideOverflowIndicator();
+ this._disableTracking();
+ sv._handleDragStart( e, ex, ey );
+ sv._directionLock = dir;
+ sv._didDrag = this._didDrag;
},
_handleDragMove: function ( e, ex, ey ) {
- this._lastMove = getCurrentTime();
+ if ( this._skip_dragging ) {
+ return;
+ }
- var dx = ex - this._lastX,
- dy = ey - this._lastY;
+ if ( !this._dragging ) {
+ return;
+ }
- this._speedX = dx;
- this._speedY = 0;
+ if ( !this._is_inputbox && !this._is_button ) {
+ e.preventDefault();
+ }
- this._didDrag = true;
+ var mt = this.options.moveThreshold,
+ dx = ex - this._lastX,
+ dy = ey - this._lastY,
+ svdir = this.options.direction,
+ dir = null,
+ x,
+ y,
+ sv,
+ scope,
+ newX,
+ newY,
+ dirLock;
- this._lastX = ex;
- this._lastY = ey;
+ this._lastMove = getCurrentTime();
- this._mx = ex - this._ox;
+ if ( !this._directionLock ) {
+ x = Math.abs( dx );
+ y = Math.abs( dy );
- this._setScrollPosition( this._nx + this._mx, 0 );
+ if ( x < mt && y < mt ) {
+ return false;
+ }
- //console.log( "scrollmove" + this._rx + "," + this._sx );
- return false;
- },
+ if ( x < y && (x / y) < 0.5 ) {
+ dir = "y";
+ } else if ( x > y && (y / x) < 0.5 ) {
+ dir = "x";
+ }
- _handleDragStop: function ( e ) {
- var l = this._lastMove,
- t = getCurrentTime(),
- doScroll = l && ( t - l ) <= this.options.moveIntervalThreshold,
- sx = ( this._tracker && this._speedX && doScroll ) ? this._speedX : 0,
- sy = 0;
+ if ( svdir && dir && svdir !== dir ) {
+ /*
+ * This scrollview can't handle the direction the user
+ * is attempting to scroll. Find an ancestor scrollview
+ * that can handle the request.
+ */
- this._rx = this._mx ? this._nx + this._mx : this._rx;
+ sv = this._getAncestorByDirection( dir );
+ if ( sv ) {
+ this._propagateDragMove( sv, e, ex, ey, dir );
+ return false;
+ }
+ }
- if ( sx ) {
- this._startMScroll( sx, sy );
+ this._directionLock = svdir || (dir || "none");
}
- //console.log( "scrollstop" + this._rx + "," + this._sx );
+ newX = this._sx;
+ newY = this._sy;
+ dirLock = this._directionLock;
- this._disableTracking();
+ if ( dirLock !== "y" && this._hTracker ) {
+ x = this._sx;
+ this._speedX = dx;
+ newX = x + dx;
- if ( !this._didDrag && this.options.delayedClickEnabled && this._$clickEle.length ) {
- this._$clickEle
- .trigger( "mousedown" )
- .trigger( "mouseup" )
- .trigger( "click" );
- }
+ this._doSnapBackX = false;
- if ( this._didDrag ) {
- e.preventDefault();
- e.stopPropagation();
- }
+ scope = ( newX > 0 || newX < this._maxX );
- return this._didDrag ? false : undefined;
- },
+ if ( scope && dirLock === "x" ) {
+ sv = this._getAncestorByDirection("x");
+ if ( sv ) {
+ this._setScrollPosition( newX > 0 ?
+ 0 : this._maxX, newY );
+ this._propagateDragMove( sv, e, ex, ey, dir );
+ return false;
+ }
- _addBehaviors: function () {
- var self = this;
+ newX = x + ( dx / 2 );
+ this._doSnapBackX = true;
+ }
+ }
- if ( this.options.eventType === "mouse" ) {
- this._dragStartEvt = "mousedown";
- this._dragStartCB = function ( e ) {
- return self._handleDragStart( e, e.clientX, e.clientY );
- };
+ if ( dirLock !== "x" && this._vTracker ) {
+ if ( Math.abs( this._startY - ey ) < mt && dirLock !== "xy" ) {
+ return;
+ }
- this._dragMoveEvt = "mousemove";
- this._dragMoveCB = function ( e ) {
- return self._handleDragMove( e, e.clientX, e.clientY );
- };
+ y = this._sy;
+ this._speedY = dy;
+ newY = y + dy;
- this._dragStopEvt = "mouseup";
- this._dragStopCB = function ( e ) {
- return self._handleDragStop( e );
- };
+ this._doSnapBackY = false;
- this._$view.bind( "vclick", function (e) {
- return !self._didDrag;
- } );
+ scope = ( newY > 0 || newY < this._maxY );
- } else { //touch
- this._dragStartEvt = "touchstart";
- this._dragStartCB = function ( e ) {
- var t = e.originalEvent.targetTouches[0];
- return self._handleDragStart(e, t.pageX, t.pageY );
- };
+ if ( scope && dirLock === "y" ) {
+ sv = this._getAncestorByDirection("y");
+ if ( sv ) {
+ this._setScrollPosition( newX,
+ newY > 0 ? 0 : this._maxY );
+ this._propagateDragMove( sv, e, ex, ey, dir );
+ return false;
+ }
- this._dragMoveEvt = "touchmove";
- this._dragMoveCB = function ( e ) {
- var t = e.originalEvent.targetTouches[0];
- return self._handleDragMove(e, t.pageX, t.pageY );
- };
+ newY = y + ( dy / 2 );
+ this._doSnapBackY = true;
+ }
+ }
- this._dragStopEvt = "touchend";
- this._dragStopCB = function ( e ) {
- return self._handleDragStop( e );
- };
+ if ( this.options.overshootEnable === false ) {
+ this._doSnapBackX = false;
+ this._doSnapBackY = false;
}
- this._$view.bind( this._dragStartEvt, this._dragStartCB );
- }
- } );
- $( document ).bind( "pagecreate create", function ( e ) {
- $( $.mobile.circularview.prototype.options.initSelector, e.target ).circularview();
- } );
+ this._lastX = ex;
+ this._lastY = ey;
-}( jQuery, window, document ) ); // End Component
-/*
- *
- * This software is licensed under the MIT licence (as defined by the OSI at
- * http://www.opensource.org/licenses/mit-license.php)
- *
- * ***************************************************************************
- * Copyright (C) 2011 by Intel Corporation Ltd.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- * ***************************************************************************
- */
+ this._setScrollPosition( newX, newY );
-// Ensure that the given namespace is defined. If not, define it to be an empty object.
-// This is kinda like the mkdir -p command.
+ if ( this._didDrag === false ) {
+ this._didDrag = true;
+ this._showScrollBars();
+ this._showOverflowIndicator();
-function ensureNS(ns) {
- var nsAr = ns.split("."),
- nsSoFar = "";
+ this._$clip.parents(".ui-scrollview-clip").each( function () {
+ $( this ).scrollview( "skipDragging", true );
+ } );
+ }
+ },
- for (var Nix in nsAr) {
- nsSoFar = nsSoFar + (Nix > 0 ? "." : "") + nsAr[Nix];
- eval (nsSoFar + " = " + nsSoFar + " || {};");
- }
-}
-/*
- *
- * This software is licensed under the MIT licence (as defined by the OSI at
- * http://www.opensource.org/licenses/mit-license.php)
- *
- * ***************************************************************************
- * Copyright (C) 2011 by Intel Corporation Ltd.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- * ***************************************************************************
- */
+ _handleDragStop: function ( e ) {
+ var self = this;
-// Add markup for labels
+ if ( this._skip_dragging ) {
+ return;
+ }
-(function($, undefined) {
+ var l = this._lastMove,
+ t = getCurrentTime(),
+ doScroll = (l && (t - l) <= this.options.moveIntervalThreshold),
+ sx = ( this._hTracker && this._speedX && doScroll ) ?
+ this._speedX : ( this._doSnapBackX ? 1 : 0 ),
+ sy = ( this._vTracker && this._speedY && doScroll ) ?
+ this._speedY : ( this._doSnapBackY ? 1 : 0 ),
+ svdir = this.options.direction,
+ x,
+ y;
-$(document).bind("pagecreate create", function(e) {
- $(":jqmData(role='label')", e.target).not(":jqmData(role='none'), :jqmData(role='nojs')").each(function() {
- $(this).addClass("jquery-mobile-ui-label")
- .html($("<span>", {"class": "jquery-mobile-ui-label-text"}).text($(this).text()));
- });
-});
+ if ( sx || sy ) {
+ if ( !this._setGestureScroll( sx, sy ) ) {
+ this._startMScroll( sx, sy );
+ }
+ } else {
+ this._hideScrollBars();
+ this._hideOverflowIndicator();
+ }
-})(jQuery);
-ensureNS("jQuery.mobile.tizen.clrlib");
+ this._disableTracking();
-jQuery.extend( jQuery.mobile.tizen.clrlib,
-{
- nearestInt: function(val) {
- var theFloor = Math.floor(val);
+ if ( this._endEffect ) {
+ setTimeout( function () {
+ self._setEndEffect( "out" );
+ self._hideScrollBars();
+ self._hideOverflowIndicator();
+ }, 300 );
+ }
- return (((val - theFloor) > 0.5) ? (theFloor + 1) : theFloor);
- },
+ return !this._didDrag;
+ },
- /*
- * Converts html color string to rgb array.
- *
- * Input: string clr_str, where
- * clr_str is of the form "#aabbcc"
- *
- * Returns: [ r, g, b ], where
- * r is in [0, 1]
- * g is in [0, 1]
- * b is in [0, 1]
- */
- HTMLToRGB: function(clr_str) {
- clr_str = (('#' == clr_str.charAt(0)) ? clr_str.substring(1) : clr_str);
+ _setGestureScroll: function ( sx, sy ) {
+ var self = this,
+ reset = function () {
+ clearTimeout( self._gesture_timer );
+ self._gesture_dir = 0;
+ self._gesture_timer = undefined;
+ },
+ direction = {
+ top: 0,
+ bottom: 1,
+ left: 2,
+ right: 3
+ };
- return ([
- clr_str.substring(0, 2),
- clr_str.substring(2, 4),
- clr_str.substring(4, 6)
- ].map(function(val) {
- return parseInt(val, 16) / 255.0;
- }));
- },
+ if ( !sy && !sx ) {
+ return false;
+ }
- /*
- * Converts rgb array to html color string.
- *
- * Input: [ r, g, b ], where
- * r is in [0, 1]
- * g is in [0, 1]
- * b is in [0, 1]
- *
- * Returns: string of the form "#aabbcc"
- */
- RGBToHTML: function(rgb) {
- return ("#" +
- rgb.map(function(val) {
- var ret = val * 255,
- theFloor = Math.floor(ret);
+ if ( Math.abs( sx ) > Math.abs( sy ) ) {
+ dir = sx > 0 ? direction.left : direction.right;
+ } else {
+ dir = sy > 0 ? direction.top : direction.bottom;
+ }
- ret = ((ret - theFloor > 0.5) ? (theFloor + 1) : theFloor);
- ret = (((ret < 16) ? "0" : "") + (ret & 0xff).toString(16));
- return ret;
- })
- .join(""));
- },
+ if ( !this._gesture_timer ) {
+ this._gesture_dir = dir;
- /*
- * Converts hsl to rgb.
- *
- * From http://130.113.54.154/~monger/hsl-rgb.html
- *
- * Input: [ h, s, l ], where
- * h is in [0, 360]
- * s is in [0, 1]
- * l is in [0, 1]
- *
- * Returns: [ r, g, b ], where
- * r is in [0, 1]
- * g is in [0, 1]
- * b is in [0, 1]
- */
- HSLToRGB: function(hsl) {
- var h = hsl[0] / 360.0, s = hsl[1], l = hsl[2];
+ this._gesture_timer = setTimeout( function () {
+ reset();
+ }, 1000 );
- if (0 === s)
- return [ l, l, l ];
+ return false;
+ }
- var temp2 = ((l < 0.5)
- ? l * (1.0 + s)
- : l + s - l * s),
- temp1 = 2.0 * l - temp2,
- temp3 = {
- r: h + 1.0 / 3.0,
- g: h,
- b: h - 1.0 / 3.0
- };
+ if ( this._gesture_dir !== dir ) {
+ reset();
+ return false;
+ }
- temp3.r = ((temp3.r < 0) ? (temp3.r + 1.0) : ((temp3.r > 1) ? (temp3.r - 1.0) : temp3.r));
- temp3.g = ((temp3.g < 0) ? (temp3.g + 1.0) : ((temp3.g > 1) ? (temp3.g - 1.0) : temp3.g));
- temp3.b = ((temp3.b < 0) ? (temp3.b + 1.0) : ((temp3.b > 1) ? (temp3.b - 1.0) : temp3.b));
+ return false;
+ },
- ret = [
- (((6.0 * temp3.r) < 1) ? (temp1 + (temp2 - temp1) * 6.0 * temp3.r) :
- (((2.0 * temp3.r) < 1) ? temp2 :
- (((3.0 * temp3.r) < 2) ? (temp1 + (temp2 - temp1) * ((2.0 / 3.0) - temp3.r) * 6.0) :
- temp1))),
- (((6.0 * temp3.g) < 1) ? (temp1 + (temp2 - temp1) * 6.0 * temp3.g) :
- (((2.0 * temp3.g) < 1) ? temp2 :
- (((3.0 * temp3.g) < 2) ? (temp1 + (temp2 - temp1) * ((2.0 / 3.0) - temp3.g) * 6.0) :
- temp1))),
- (((6.0 * temp3.b) < 1) ? (temp1 + (temp2 - temp1) * 6.0 * temp3.b) :
- (((2.0 * temp3.b) < 1) ? temp2 :
- (((3.0 * temp3.b) < 2) ? (temp1 + (temp2 - temp1) * ((2.0 / 3.0) - temp3.b) * 6.0) :
- temp1)))];
+ _enableTracking: function () {
+ this._dragging = true;
+ },
- return ret;
- },
+ _disableTracking: function () {
+ this._dragging = false;
+ },
- /*
- * Converts hsv to rgb.
- *
- * Input: [ h, s, v ], where
- * h is in [0, 360]
- * s is in [0, 1]
- * v is in [0, 1]
- *
- * Returns: [ r, g, b ], where
- * r is in [0, 1]
- * g is in [0, 1]
- * b is in [0, 1]
- */
- HSVToRGB: function(hsv) {
- return $.mobile.tizen.clrlib.HSLToRGB($.mobile.tizen.clrlib.HSVToHSL(hsv));
- },
+ _showScrollBars: function ( interval ) {
+ var vclass = "ui-scrollbar-visible",
+ self = this;
- /*
- * Converts rgb to hsv.
- *
- * from http://coecsl.ece.illinois.edu/ge423/spring05/group8/FinalProject/HSV_writeup.pdf
- *
- * Input: [ r, g, b ], where
- * r is in [0, 1]
- * g is in [0, 1]
- * b is in [0, 1]
- *
- * Returns: [ h, s, v ], where
- * h is in [0, 360]
- * s is in [0, 1]
- * v is in [0, 1]
- */
- RGBToHSV: function(rgb) {
- var min, max, delta, h, s, v, r = rgb[0], g = rgb[1], b = rgb[2];
+ if ( !this.options.showScrollBars ) {
+ return;
+ }
+ if ( this._scrollbar_showed ) {
+ return;
+ }
- min = Math.min(r, Math.min(g, b));
- max = Math.max(r, Math.max(g, b));
- delta = max - min;
+ if ( this._$vScrollBar ) {
+ this._$vScrollBar.addClass( vclass );
+ }
+ if ( this._$hScrollBar ) {
+ this._$hScrollBar.addClass( vclass );
+ }
- h = 0;
- s = 0;
- v = max;
+ this._scrollbar_showed = true;
- if (delta > 0.00001) {
- s = delta / max;
+ if ( interval ) {
+ setTimeout( function () {
+ self._hideScrollBars();
+ }, interval );
+ }
+ },
- if (r === max)
- h = (g - b) / delta ;
- else
- if (g === max)
- h = 2 + (b - r) / delta ;
- else
- h = 4 + (r - g) / delta ;
+ _hideScrollBars: function () {
+ var vclass = "ui-scrollbar-visible";
- h *= 60 ;
+ if ( !this.options.showScrollBars ) {
+ return;
+ }
+ if ( !this._scrollbar_showed ) {
+ return;
+ }
- if (h < 0)
- h += 360 ;
- }
+ if ( this._$vScrollBar ) {
+ this._$vScrollBar.removeClass( vclass );
+ }
+ if ( this._$hScrollBar ) {
+ this._$hScrollBar.removeClass( vclass );
+ }
- return [h, s, v];
- },
+ this._scrollbar_showed = false;
+ },
- /*
- * Converts hsv to hsl.
- *
- * Input: [ h, s, v ], where
- * h is in [0, 360]
- * s is in [0, 1]
- * v is in [0, 1]
- *
- * Returns: [ h, s, l ], where
- * h is in [0, 360]
- * s is in [0, 1]
- * l is in [0, 1]
- */
- HSVToHSL: function(hsv) {
- var max = hsv[2],
- delta = hsv[1] * max,
- min = max - delta,
- sum = max + min,
- half_sum = sum / 2,
- s_divisor = ((half_sum < 0.5) ? sum : (2 - max - min));
+ _setOverflowIndicator: function ( dir ) {
+ if ( dir === 1 ) {
+ this._opacity_top = "0";
+ this._opacity_bottom = "0.8";
+ } else if ( dir === 0 ) {
+ this._opacity_top = "0.8";
+ this._opacity_bottom = "0";
+ } else {
+ this._opacity_top = "0.5";
+ this._opacity_bottom = "0.5";
+ }
+ },
- return [ hsv[0], ((0 == s_divisor) ? 0 : (delta / s_divisor)), half_sum ];
- },
+ _showOverflowIndicator: function () {
+ if ( !this.options.overflowEnable || !this._overflowAvail || this._softkeyboard ) {
+ return;
+ }
- /*
- * Converts rgb to hsl
- *
- * Input: [ r, g, b ], where
- * r is in [0, 1]
- * g is in [0, 1]
- * b is in [0, 1]
- *
- * Returns: [ h, s, l ], where
- * h is in [0, 360]
- * s is in [0, 1]
- * l is in [0, 1]
- */
- RGBToHSL: function(rgb) {
- return $.mobile.tizen.clrlib.HSVToHSL($.mobile.tizen.clrlib.RGBToHSV(rgb));
- }
-});
-/*
- * set TIZEN specific configures
- */
+ this._overflow_top.animate( { opacity: this._opacity_top }, 300 );
+ this._overflow_bottom.animate( { opacity: this._opacity_bottom }, 300 );
-( function( $, window, undefined ) {
+ this._overflow_showed = true;
+ },
- /* set default transition */
- $.mobile.defaultPageTransition = "none";
+ _hideOverflowIndicator: function () {
+ if ( !this.options.overflowEnable || !this._overflowAvail || this._softkeyboard ) {
+ return;
+ }
- /* depth transition */
- $.mobile.transitionHandlers.depth = $.mobile.transitionHandlers.simultaneous;
- $.mobile.transitionFallbacks.depth = "fade";
+ if ( this._overflow_showed === false ) {
+ return;
+ }
- /* Button data-corners default value */
- $.fn.buttonMarkup.defaults.corners = false;
+ this._overflow_top.animate( { opacity: 0 }, 300 );
+ this._overflow_bottom.animate( { opacity: 0 }, 300 );
- /* button hover delay */
- $.mobile.buttonMarkup.hoverDelay = 0;
+ this._overflow_showed = false;
+ this._setOverflowIndicator();
+ },
-})( jQuery, this );
-/*
- * jQuery Mobile Widget @VERSION
- *
- * TODO: remove unnecessary codes....
- *
- * This software is licensed under the MIT licence (as defined by the OSI at
- * http://www.opensource.org/licenses/mit-license.php)
- *
- * ***************************************************************************
- * Copyright (C) 2011 by Intel Corporation Ltd.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- * ***************************************************************************
- *
- * Authors: Kalyan Kondapally <kalyan.kondapally@intel.com>
- */
+ _add_event: function () {
+ var self = this,
+ $c = this._$clip,
+ $v = this._$view;
-ensureNS("jQuery.mobile.tizen");
+ if ( this.options.eventType === "mouse" ) {
+ this._dragEvt = "mousedown mousemove mouseup click mousewheel";
-(function () {
-jQuery.extend(jQuery.mobile.tizen, {
- disableSelection: function (element) {
- var self = this;
- $(element).find('*').each( function() {
- if( ( $(this).get(0).tagName !== 'INPUT' &&
- $(this).attr("type") !== 'text' ) &&
- $(this).get(0).tagName !== 'TEXTAREA' ) {
- self.enableSelection( this, 'none' );
- }
- } );
- return true;
- },
+ this._dragCB = function ( e ) {
+ switch ( e.type ) {
+ case "mousedown":
+ return self._handleDragStart( e,
+ e.clientX, e.clientY );
- enableSelection: function (element, value) {
- return $(element).each( function () {
- switch( value ) {
- case 'text' :
- case 'auto' :
- case 'none' :
- val = value;
- break;
+ case "mousemove":
+ return self._handleDragMove( e,
+ e.clientX, e.clientY );
- default :
- val = 'auto';
- break;
- }
- $(this).css( {
- 'user-select': val,
- '-moz-user-select': val,
- '-webkit-user-select': val,
- '-o-user-select': val,
- '-ms-transform': val
- } );
- } );
- },
+ case "mouseup":
+ return self._handleDragStop( e );
- disableContextMenu: function(element) {
- var self = this;
- $(element).find('*').each( function() {
- if( ( $(this).get(0).tagName !== 'INPUT' &&
- $(this).attr("type") !== 'text' ) &&
- $(this).get(0).tagName !== 'TEXTAREA' ) {
- self._disableContextMenu( this );
- }
- } );
- },
+ case "click":
+ return !self._didDrag;
- _disableContextMenu: function(element) {
+ case "mousewheel":
+ var old = self.getScrollPosition();
+ self.scrollTo( -old.x,
+ -(old.y - e.originalEvent.wheelDelta) );
+ break;
+ }
+ };
+ } else {
+ this._dragEvt = "touchstart touchmove touchend click";
- $(element).each( function() {
- $(this).bind("contextmenu", function( event ) {
- return false;
- } );
- } );
- },
+ this._dragCB = function ( e ) {
+ var touches = e.originalEvent.touches;
- enableContextMenu: function(element) {
- $(element).each( function() {
- $(this).unbind( "contextmenu" );
- } );
- },
+ switch ( e.type ) {
+ case "touchstart":
+ if ( touches.length != 1) {
+ return;
+ }
- // Get document-relative mouse coordinates from a given event
- // From: http://www.quirksmode.org/js/events_properties.html#position
- documentRelativeCoordsFromEvent: function(ev) {
- var e = ev ? ev : window.event,
- client = { x: e.clientX, y: e.clientY },
- page = { x: e.pageX, y: e.pageY },
- posx = 0,
- posy = 0;
+ return self._handleDragStart( e,
+ touches[0].pageX, touches[0].pageY );
- // Grab useful coordinates from touch events
- if (e.type.match(/^touch/)) {
- page = {
- x: e.originalEvent.targetTouches[0].pageX,
- y: e.originalEvent.targetTouches[0].pageY
- };
- client = {
- x: e.originalEvent.targetTouches[0].clientX,
- y: e.originalEvent.targetTouches[0].clientY
- };
- }
+ case "touchmove":
+ if ( touches.length != 1) {
+ return;
+ }
- if (page.x || page.y) {
- posx = page.x;
- posy = page.y;
- }
- else
- if (client.x || client.y) {
- posx = client.x + document.body.scrollLeft + document.documentElement.scrollLeft;
- posy = client.y + document.body.scrollTop + document.documentElement.scrollTop;
- }
+ return self._handleDragMove( e,
+ touches[0].pageX, touches[0].pageY );
- return { x: posx, y: posy };
- },
+ case "touchend":
+ if ( touches.length != 0) {
+ return;
+ }
- // TODO : offsetX, offsetY. touch events don't have offsetX and offsetY. support for touch devices.
- // check algorithm...
- targetRelativeCoordsFromEvent: function(e) {
- var coords = { x: e.offsetX, y: e.offsetY };
+ return self._handleDragStop( e );
- if (coords.x === undefined || isNaN(coords.x) ||
- coords.y === undefined || isNaN(coords.y)) {
- var offset = $(e.target).offset();
- //coords = documentRelativeCoordsFromEvent(e); // Old code. Must be checked again.
- coords = $.mobile.tizen.documentRelativeCoordsFromEvent(e);
- coords.x -= offset.left;
- coords.y -= offset.top;
- }
+ case "click":
+ return !self._didDrag;
+ }
+ };
+ }
- return coords;
- }
-});
+ $v.bind( this._dragEvt, this._dragCB );
-})();
-(function($, undefined) {
+ $v.bind( "keydown", function ( e ) {
+ var elem,
+ elem_top,
+ scroll_top = $( window ).scrollTop() - window.screenTop,
+ screen_h;
-ensureNS("jQuery.mobile.tizen");
+ if ( e.keyCode == 9 ) {
+ return false;
+ }
-jQuery.extend( jQuery.mobile.tizen,
-{
- _widgetPrototypes: {},
+ elem = $c.find(".ui-focus");
- /*
- * load the prototype for a widget.
- *
- * If @widget is a string, the function looks for @widget.prototype.html in the proto-html/ subdirectory of the
- * framework's current theme and loads the file via AJAX into a string. Note that the file will only be loaded via
- * AJAX once. If two widget instances based on the same @widget value are to be constructed, the second will be
- * constructed from the cached copy of the prototype of the first instance.
- *
- * If @widget is not a string, it is assumed to be a hash containing at least one key, "proto", the value of which is
- * the string to be used for the widget prototype. if another key named "key" is also provided, it will serve as the
- * key under which to cache the prototype, so it need not be rendered again in the future.
- *
- * Given the string for the widget prototype, the following patterns occurring in the string are replaced:
- *
- * "${FRAMEWORK_ROOT}" - replaced with the path to the root of the framework
- *
- * The function then creates a jQuery $("<div>") object containing the prototype from the string.
- *
- * If @ui is not provided, the jQuery object containing the prototype is returned.
- *
- * If @ui is provided, it is assumed to be a (possibly multi-level) hash containing CSS selectors. For every level of
- * the hash and for each string-valued key at that level, the CSS selector specified as the value is sought in the
- * prototype jQuery object and, if found, the value of the key is replaced with the jQuery object resulting from the
- * search. Additionally, if the CSS selector is of the form "#widgetid", the "id" attribute will be removed from the
- * elements contained within the resulting jQuery object. The resulting hash is returned.
- *
- * Examples:
- *
- * 1.
- * $.mobile.tizen.loadPrototype("mywidget") => Returns a <div> containing the structure from the file
- * mywidget.prototype.html located in the current theme folder of the current framework.
- *
- * 2. $.mobile.tizen.loadPrototype("mywidget", ui):
- * where ui is a hash that looks like this:
- * ui = {
- * element1: "<css selector 1>",
- * element2: "<css selector 2>",
- * group1: {
- * group1element1: "<css selector 3>",
- * group1element1: "<css selector 4>"
- * }
- * ...
- * }
- *
- * In this case, after loading the prototype as in Example 1, loadPrototype will traverse @ui and replace the CSS
- * selector strings with the result of the search for the selector string upon the prototype. If any of the CSS
- * selectors are of the form "#elementid" then the "id" attribute will be stripped from the elements selected. This
- * means that they will no longer be accessible via the selector used initially. @ui is then returned thus modified.
- */
+ if ( elem === undefined ) {
+ return;
+ }
- loadPrototype: function(widget, ui) {
- var ret = undefined,
- theScriptTag = $("script[data-framework-version][data-framework-root][data-framework-theme]"),
- frameworkRootPath = theScriptTag.attr("data-framework-root") + "/" +
- theScriptTag.attr("data-framework-version") + "/";
+ elem_top = elem.offset().top - scroll_top;
+ screen_h = $c.offset().top + $c.height() - elem.height();
- function replaceVariables(s) {
- return s.replace(/\$\{FRAMEWORK_ROOT\}/g, frameworkRootPath);
- }
+ if ( self._softkeyboard ) {
+ screen_h -= self._softkeyboardHeight;
+ }
- function fillObj(obj, uiProto) {
- var selector;
+ if ( ( elem_top < $c.offset().top ) || ( elem_top > screen_h ) ) {
+ self.scrollTo( 0, self._sy -
+ ( elem_top - $c.offset().top - elem.height() ) );
+ }
- for (var key in obj) {
- if (typeof obj[key] === "string") {
- selector = obj[key];
- obj[key] = uiProto.find(obj[key]);
- if (selector.substring(0, 1) === "#")
- obj[key].removeAttr("id");
- }
- else
- if (typeof obj[key] === "object")
- obj[key] = fillObj(obj[key], uiProto);
- }
- return obj;
- }
+ return;
+ });
- /* If @widget is a string ... */
- if (typeof widget === "string") {
- /* ... try to use it as a key into the cached prototype hash ... */
- ret = $.mobile.tizen._widgetPrototypes[widget];
- if (ret === undefined) {
- /* ... and if the proto was not found, try to load its definition ... */
- var protoPath = frameworkRootPath + "proto-html" + "/" +
- theScriptTag.attr("data-framework-theme");
- $.ajax({
- url: protoPath + "/" + widget + ".prototype.html",
- async: false,
- dataType: "html"
- })
- .success(function(data, textStatus, jqXHR) {
- /* ... and if loading succeeds, cache it and use a copy of it ... */
- $.mobile.tizen._widgetPrototypes[widget] = $("<div>").html(replaceVariables(data));
- ret = $.mobile.tizen._widgetPrototypes[widget].clone();
- });
- }
- }
- /* Otherwise ... */
- else {
- /* ... if a key was provided ... */
- if (widget.key !== undefined)
- /* ... try to use it as a key into the cached prototype hash ... */
- ret = $.mobile.tizen._widgetPrototypes[widget.key];
+ $v.bind( "keyup", function ( e ) {
+ var input,
+ elem,
+ elem_top,
+ scroll_top = $( window ).scrollTop() - window.screenTop,
+ screen_h;
- /* ... and if the proto was not found in the cache ... */
- if (ret === undefined) {
- /* ... and a proto definition string was provided ... */
- if (widget.proto !== undefined) {
- /* ... create a new proto from the definition ... */
- ret = $("<div>").html(replaceVariables(widget.proto));
- /* ... and if a key was provided ... */
- if (widget.key !== undefined)
- /* ... cache a copy of the proto under that key */
- $.mobile.tizen._widgetPrototypes[widget.key] = ret.clone();
- }
- }
- else
- /* otherwise, if the proto /was/ found in the cache, return a copy of it */
- ret = ret.clone();
- }
+ if ( e.keyCode != 9 ) {
+ return;
+ }
- /* If the prototype was found/created successfully ... */
- if (ret != undefined)
- /* ... and @ui was provided */
- if (ui != undefined)
- /* ... return @ui, but replace the CSS selectors it contains with the elements they select */
- ret = fillObj(ui, ret);
+ /* Tab Key */
- return ret;
- }
-});
-})(jQuery);
-/*
-* jQuery Mobile Framework : scrollview plugin
-* Copyright (c) 2010 Adobe Systems Incorporated - Kin Blas (jblas@adobe.com)
-* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses.
-* Note: Code is in draft form and is subject to change
-* Modified by Koeun Choi <koeun.choi@samsung.com>
-* Modified by Minkyu Kang <mk7.kang@samsung.com>
-*/
-
-(function ( $, window, document, undefined ) {
-
- function resizePageContentHeight( page ) {
- var $page = $( page ),
- $content = $page.children(".ui-content"),
- hh = $page.children(".ui-header").outerHeight() || 0,
- fh = $page.children(".ui-footer").outerHeight() || 0,
- pt = parseFloat( $content.css("padding-top") ),
- pb = parseFloat( $content.css("padding-bottom") ),
- wh = $( window ).height();
-
- $content.height( wh - (hh + fh) - (pt + pb) );
- }
-
- function MomentumTracker( options ) {
- this.options = $.extend( {}, options );
- this.easing = "easeOutQuad";
- this.reset();
- }
-
- var tstates = {
- scrolling: 0,
- overshot: 1,
- snapback: 2,
- done: 3
- };
+ input = $( this ).find(":input");
- function getCurrentTime() {
- return Date.now();
- }
+ for ( i = 0; i < input.length; i++ ) {
+ if ( !$( input[i] ).hasClass("ui-focus") ) {
+ continue;
+ }
- jQuery.widget( "tizen.scrollview", jQuery.mobile.widget, {
- options: {
- direction: null, // "x", "y", or null for both.
+ if ( i + 1 == input.length ) {
+ elem = $( input[0] );
+ } else {
+ elem = $( input[i + 1] );
+ }
- timerInterval: 10,
- scrollDuration: 1000, // Duration of the scrolling animation in msecs.
- overshootDuration: 250, // Duration of the overshoot animation in msecs.
- snapbackDuration: 500, // Duration of the snapback animation in msecs.
+ elem_top = elem.offset().top - scroll_top;
+ screen_h = $c.offset().top + $c.height() - elem.height();
- moveThreshold: 30, // User must move this many pixels in any direction to trigger a scroll.
- moveIntervalThreshold: 150, // Time between mousemoves must not exceed this threshold.
+ if ( self._softkeyboard ) {
+ screen_h -= self._softkeyboardHeight;
+ }
- scrollMethod: "translate", // "translate", "position"
- startEventName: "scrollstart",
- updateEventName: "scrollupdate",
- stopEventName: "scrollstop",
+ if ( ( elem_top < 0 ) || ( elem_top > screen_h ) ) {
+ self.scrollTo( 0, self._sy - elem_top +
+ elem.height() + $c.offset().top, 0);
+ }
- eventType: $.support.touch ? "touch" : "mouse",
+ elem.focus();
- showScrollBars: true,
- overshootEnable: false,
- outerScrollEnable: true,
- overflowEnable: true,
- scrollJump: false,
- },
+ break;
+ }
- _getViewHeight: function () {
- return this._$view.height();
- },
+ return false;
+ });
- _makePositioned: function ( $ele ) {
- if ( $ele.css("position") === "static" ) {
- $ele.css( "position", "relative" );
- }
- },
+ $c.bind( "updatelayout", function ( e ) {
+ var sy,
+ vh,
+ view_h = self._getViewHeight();
- _create: function () {
- var direction,
- self = this;
+ if ( !$c.height() || !view_h ) {
+ self.scrollTo( 0, 0, 0 );
+ return;
+ }
- this._$clip = $( this.element ).addClass("ui-scrollview-clip");
+ sy = $c.height() - view_h;
+ vh = view_h - self._view_height;
- if ( this._$clip.children(".ui-scrollview-view").length ) {
- this._$view = this._$clip.children(".ui-scrollview-view");
- } else {
- this._$view = this._$clip.wrapInner("<div></div>").children()
- .addClass("ui-scrollview-view");
- }
+ self._view_height = view_h;
- if ( this.options.scrollMethod === "translate" ) {
- if ( this._$view.css("transform") === undefined ) {
- this.options.scrollMethod = "position";
+ if ( vh == 0 || vh > $c.height() / 2 ) {
+ return;
}
- }
- this._$clip.css( "overflow", "hidden" );
- this._makePositioned( this._$clip );
+ if ( sy > 0 ) {
+ self.scrollTo( 0, 0, 0 );
+ } else if ( self._sy - sy <= -vh ) {
+ self.scrollTo( 0, self._sy,
+ self.options.snapbackDuration );
+ } else if ( self._sy - sy <= vh + self.options.moveThreshold ) {
+ self.scrollTo( 0, sy,
+ self.options.snapbackDuration );
+ }
+ });
- this._makePositioned( this._$view );
- this._$view.css( { left: 0, top: 0 } );
+ $( window ).bind( "resize", function ( e ) {
+ var focused,
+ view_h = self._getViewHeight();
- this._view_height = this._getViewHeight();
+ if ( $(".ui-page-active").get(0) !== $c.closest(".ui-page").get(0) ) {
+ return;
+ }
- this._sx = 0;
- this._sy = 0;
+ if ( !$c.height() || !view_h ) {
+ return;
+ }
- direction = this.options.direction;
+ focused = $c.find(".ui-focus");
- this._hTracker = ( direction !== "y" ) ?
- new MomentumTracker( this.options ) : null;
- this._vTracker = ( direction !== "x" ) ?
- new MomentumTracker( this.options ) : null;
+ if ( focused ) {
+ focused.trigger("resize.scrollview");
+ }
- this._timerInterval = this.options.timerInterval;
- this._timerID = 0;
+ /* calibration - after triggered throttledresize */
+ setTimeout( function () {
+ if ( self._sy < $c.height() - self._getViewHeight() ) {
+ self.scrollTo( 0, $c.height() - self._getViewHeight(),
+ self.options.overshootDuration );
+ }
+ }, 260 );
- this._timerCB = function () {
- self._handleMomentumScroll();
- };
+ self._view_height = view_h;
+ });
- this._add_event();
- this._add_scrollbar();
- this._add_scroll_jump();
- this._add_overflow_indicator();
- },
+ $( window ).bind( "vmouseout", function ( e ) {
+ var drag_stop = false;
- _startMScroll: function ( speedX, speedY ) {
- var keepGoing = false,
- duration = this.options.scrollDuration,
- ht = this._hTracker,
- vt = this._vTracker,
- c,
- v;
+ if ( $(".ui-page-active").get(0) !== $c.closest(".ui-page").get(0) ) {
+ return;
+ }
- this._$clip.trigger( this.options.startEventName );
+ if ( !self._dragging ) {
+ return;
+ }
- if ( ht ) {
- c = this._$clip.width();
- v = this._$view.width();
+ if ( e.pageX < 0 || e.pageX > $( window ).width() ) {
+ drag_stop = true;
+ }
- if ( (( this._sx === 0 && speedX > 0 ) ||
- ( this._sx === -(v - c) && speedX < 0 )) &&
- v > c ) {
- return;
+ if ( e.pageY < 0 || e.pageY > $( window ).height() ) {
+ drag_stop = true;
}
- ht.start( this._sx, speedX,
- duration, (v > c) ? -(v - c) : 0, 0 );
- keepGoing = !ht.done();
- }
+ if ( drag_stop ) {
+ self._hideScrollBars();
+ self._hideOverflowIndicator();
+ self._disableTracking();
+ }
+ });
- if ( vt ) {
- c = this._$clip.height();
- v = this._getViewHeight();
+ this._softkeyboard = false;
+ this._softkeyboardHeight = 0;
- if ( (( this._sy === 0 && speedY > 0 ) ||
- ( this._sy === -(v - c) && speedY < 0 )) &&
- v > c ) {
+ window.addEventListener( "softkeyboardchange", function ( e ) {
+ if ( $(".ui-page-active").get(0) !== $c.closest(".ui-page").get(0) ) {
return;
}
- vt.start( this._sy, speedY,
- duration, (v > c) ? -(v - c) : 0, 0 );
- keepGoing = keepGoing || !vt.done();
- }
+ self._softkeyboard = ( e.state === "on" ? true : false );
+ self._softkeyboardHeight = parseInt( e.height ) *
+ ( $( window ).width() / window.screen.availWidth );
+ });
- if ( keepGoing ) {
- this._timerID = setTimeout( this._timerCB, this._timerInterval );
- } else {
- this._stopMScroll();
- }
+ $c.closest(".ui-page")
+ .bind( "pageshow", function ( e ) {
+ /* should be called after pagelayout */
+ setTimeout( function () {
+ self._view_height = self._getViewHeight();
+ self._set_scrollbar_size();
+ self._setScrollPosition( self._sx, self._sy );
+ self._showScrollBars( 2000 );
+ }, 0 );
+ });
},
- _stopMScroll: function () {
- if ( this._timerID ) {
- this._$clip.trigger( this.options.stopEventName );
- clearTimeout( this._timerID );
+ _add_scrollbar: function () {
+ var $c = this._$clip,
+ prefix = "<div class=\"ui-scrollbar ui-scrollbar-",
+ suffix = "\"><div class=\"ui-scrollbar-track\"><div class=\"ui-scrollbar-thumb\"></div></div></div>";
+
+ if ( !this.options.showScrollBars ) {
+ return;
}
- this._timerID = 0;
if ( this._vTracker ) {
- this._vTracker.reset();
+ $c.append( prefix + "y" + suffix );
+ this._$vScrollBar = $c.children(".ui-scrollbar-y");
}
-
if ( this._hTracker ) {
- this._hTracker.reset();
+ $c.append( prefix + "x" + suffix );
+ this._$hScrollBar = $c.children(".ui-scrollbar-x");
}
- this._hideScrollBars();
- this._hideOverflowIndicator();
+ this._scrollbar_showed = false;
},
- _handleMomentumScroll: function () {
- var keepGoing = false,
- x = 0,
- y = 0,
- scroll_height = 0,
+ _add_scroll_jump: function () {
+ var $c = this._$clip,
self = this,
- end_effect = function ( dir ) {
- setTimeout( function () {
- self._effect_dir = dir;
- self._setEndEffect( "in" );
- }, 100 );
-
- setTimeout( function () {
- self._setEndEffect( "out" );
- }, 350 );
- },
- vt = this._vTracker,
- ht = this._hTracker;
+ top_btn,
+ left_btn;
- if ( this._outerScrolling ) {
+ if ( !this.options.scrollJump ) {
return;
}
- if ( vt ) {
- vt.update( this.options.overshootEnable );
- y = vt.getPosition();
- keepGoing = !vt.done();
-
- if ( vt.getRemained() > this.options.overshootDuration ) {
- scroll_height = this._getViewHeight() - this._$clip.height();
-
- if ( !vt.isAvail() ) {
- if ( this._speedY > 0 ) {
- this._outerScroll( vt.getRemained() / 3, scroll_height );
- } else {
- this._outerScroll( y - vt.getRemained() / 3, scroll_height );
- }
- } else if ( vt.isMin() ) {
- this._outerScroll( y - vt.getRemained() / 3, scroll_height );
-
- if ( scroll_height > 0 ) {
- end_effect( 1 );
- }
- } else if ( vt.isMax() ) {
- this._outerScroll( vt.getRemained() / 3, scroll_height );
-
- if ( scroll_height > 0 ) {
- end_effect( 0 );
- }
- }
- }
- }
+ if ( this._vTracker ) {
+ top_btn = $( '<div class="ui-scroll-jump-top-bg">' +
+ '<div data-role="button" data-inline="true" data-icon="scrolltop" data-style="box"></div></div>' );
+ $c.append( top_btn ).trigger("create");
- if ( ht ) {
- ht.update( this.options.overshootEnable );
- x = ht.getPosition();
- keepGoing = keepGoing || !ht.done();
+ top_btn.bind( "vclick", function () {
+ self.scrollTo( 0, 0, self.options.overshootDuration );
+ } );
}
- this._setScrollPosition( x, y );
- this._$clip.trigger( this.options.updateEventName,
- [ { x: x, y: y } ] );
+ if ( this._hTracker ) {
+ left_btn = $( '<div class="ui-scroll-jump-left-bg">' +
+ '<div data-role="button" data-inline="true" data-icon="scrollleft" data-style="box"></div></div>' );
+ $c.append( left_btn ).trigger("create");
- if ( keepGoing ) {
- this._timerID = setTimeout( this._timerCB, this._timerInterval );
- } else {
- this._stopMScroll();
+ left_btn.bind( "vclick", function () {
+ self.scrollTo( 0, 0, self.options.overshootDuration );
+ } );
}
},
- _setElementTransform: function ( $ele, x, y, duration ) {
- var translate,
- transition;
-
- if ( !duration || duration === undefined ) {
- transition = "none";
- } else {
- transition = "-webkit-transform " + duration / 1000 + "s ease-out";
+ _add_overflow_indicator: function () {
+ if ( !this.options.overflowEnable ) {
+ return;
}
- if ( $.support.cssTransform3d ) {
- translate = "translate3d(" + x + "," + y + ", 0px)";
- } else {
- translate = "translate(" + x + "," + y + ")";
- }
+ this._overflow_top = $( '<div class="ui-overflow-indicator-top"></div>' );
+ this._overflow_bottom = $( '<div class="ui-overflow-indicator-bottom"></div>' );
- $ele.css({
- "-moz-transform": translate,
- "-webkit-transform": translate,
- "-ms-transform": translate,
- "-o-transform": translate,
- "transform": translate,
- "-webkit-transition": transition
- });
+ this._$clip.append( this._overflow_top );
+ this._$clip.append( this._overflow_bottom );
+
+ this._opacity_top = "0.5";
+ this._opacity_bottom = "0.5";
+ this._overflow_showed = false;
},
- _setEndEffect: function ( dir ) {
- var scroll_height = this._getViewHeight() - this._$clip.height();
+ _set_scrollbar_size: function () {
+ var $c = this._$clip,
+ $v = this._$view,
+ cw = 0,
+ vw = 0,
+ ch = 0,
+ vh = 0,
+ thumb;
- if ( this._softkeyboard ) {
- if ( this._effect_dir ) {
- this._outerScroll( -scroll_height - this._softkeyboardHeight,
- scroll_height );
- } else {
- this._outerScroll( this._softkeyboardHeight, scroll_height );
- }
+ if ( !this.options.showScrollBars ) {
return;
}
- if ( dir === "in" ) {
- if ( this._endEffect ) {
- return;
- }
+ if ( this._hTracker ) {
+ cw = $c.width();
+ vw = $v.width();
+ this._maxX = cw - vw;
- this._endEffect = true;
- this._setOverflowIndicator( this._effect_dir );
- this._showOverflowIndicator();
- } else if ( dir === "out" ) {
- if ( !this._endEffect ) {
- return;
+ if ( this._maxX > 0 ) {
+ this._maxX = 0;
+ }
+ if ( this._$hScrollBar && vw ) {
+ thumb = this._$hScrollBar.find(".ui-scrollbar-thumb");
+ thumb.css( "width", (cw >= vw ? "0" :
+ (Math.floor(cw / vw * 100) || 1) + "%") );
}
-
- this._endEffect = false;
- } else {
- this._endEffect = false;
- this._setOverflowIndicator();
- this._showOverflowIndicator();
- }
- },
-
- _setCalibration: function ( x, y ) {
- if ( this.options.overshootEnable ) {
- this._sx = x;
- this._sy = y;
- return;
}
- var $v = this._$view,
- $c = this._$clip,
- dirLock = this._directionLock,
- scroll_height = 0,
- scroll_width = 0;
-
- if ( dirLock !== "y" && this._hTracker ) {
- scroll_width = $v.width() - $c.width();
+ if ( this._vTracker ) {
+ ch = $c.height();
+ vh = this._getViewHeight();
+ this._maxY = ch - vh;
- if ( x >= 0 ) {
- this._sx = 0;
- } else if ( x < -scroll_width ) {
- this._sx = -scroll_width;
- } else {
- this._sx = x;
+ if ( this._maxY > 0 || vh === 0 ) {
+ this._maxY = 0;
}
+ if ( ( this._$vScrollBar && vh ) || vh === 0 ) {
+ thumb = this._$vScrollBar.find(".ui-scrollbar-thumb");
+ thumb.css( "height", (ch >= vh ? "0" :
+ (Math.floor(ch / vh * 100) || 1) + "%") );
- if ( scroll_width < 0 ) {
- this._sx = 0;
+ this._overflowAvail = !!thumb.height();
}
}
+ }
+ });
- if ( dirLock !== "x" && this._vTracker ) {
- scroll_height = this._getViewHeight() - $c.height();
-
- if ( y > 0 ) {
- this._sy = 0;
+ $.extend( MomentumTracker.prototype, {
+ start: function ( pos, speed, duration, minPos, maxPos ) {
+ var tstate = ( pos < minPos || pos > maxPos ) ?
+ tstates.snapback : tstates.scrolling,
+ pos_temp;
- if ( this._didDrag && scroll_height > 0 ) {
- this._effect_dir = 0;
- this._setEndEffect( "in" );
- }
- } else if ( y < -scroll_height ) {
- this._sy = -scroll_height;
+ this.state = ( speed !== 0 ) ? tstate : tstates.done;
+ this.pos = pos;
+ this.speed = speed;
+ this.duration = ( this.state === tstates.snapback ) ?
+ this.options.snapbackDuration : duration;
+ this.minPos = minPos;
+ this.maxPos = maxPos;
- if ( this._didDrag && scroll_height > 0 ) {
- this._effect_dir = 1;
- this._setEndEffect( "in" );
- }
- } else {
- if ( this._endEffect && this._sy !== y ) {
- this._setEndEffect();
- }
+ this.fromPos = ( this.state === tstates.snapback ) ? this.pos : 0;
+ pos_temp = ( this.pos < this.minPos ) ? this.minPos : this.maxPos;
+ this.toPos = ( this.state === tstates.snapback ) ? pos_temp : 0;
- this._sy = y;
- }
+ this.startTime = getCurrentTime();
+ },
- if ( scroll_height < 0 ) {
- this._sy = 0;
- }
- }
+ reset: function () {
+ this.state = tstates.done;
+ this.pos = 0;
+ this.speed = 0;
+ this.minPos = 0;
+ this.maxPos = 0;
+ this.duration = 0;
+ this.remained = 0;
},
- _setScrollPosition: function ( x, y, duration ) {
- var $v = this._$view,
- sm = this.options.scrollMethod,
- $vsb = this._$vScrollBar,
- $hsb = this._$hScrollBar,
- $sbt;
+ update: function ( overshootEnable ) {
+ var state = this.state,
+ cur_time = getCurrentTime(),
+ duration = this.duration,
+ elapsed = cur_time - this.startTime,
+ dx,
+ x,
+ didOverShoot;
- this._setCalibration( x, y );
-
- x = this._sx;
- y = this._sy;
-
- if ( sm === "translate" ) {
- this._setElementTransform( $v, x + "px", y + "px", duration );
- } else {
- $v.css( {left: x + "px", top: y + "px"} );
+ if ( state === tstates.done ) {
+ return this.pos;
}
- if ( $vsb ) {
- $sbt = $vsb.find(".ui-scrollbar-thumb");
+ elapsed = elapsed > duration ? duration : elapsed;
- if ( sm === "translate" ) {
- this._setElementTransform( $sbt, "0px",
- -y / this._getViewHeight() * $sbt.parent().height() + "px",
- duration );
- } else {
- $sbt.css( "top", -y / this._getViewHeight() * 100 + "%" );
- }
- }
+ this.remained = duration - elapsed;
- if ( $hsb ) {
- $sbt = $hsb.find(".ui-scrollbar-thumb");
+ if ( state === tstates.scrolling || state === tstates.overshot ) {
+ dx = this.speed *
+ ( 1 - $.easing[this.easing]( elapsed / duration,
+ elapsed, 0, 1, duration ) );
- if ( sm === "translate" ) {
- this._setElementTransform( $sbt,
- -x / $v.width() * $sbt.parent().width() + "px", "0px",
- duration);
- } else {
- $sbt.css("left", -x / $v.width() * 100 + "%");
- }
- }
- },
+ x = this.pos + dx;
- _outerScroll: function ( y, scroll_height ) {
- var self = this,
- top = $( window ).scrollTop() - window.screenTop,
- sy = 0,
- duration = this.options.snapbackDuration,
- start = getCurrentTime(),
- tfunc;
+ didOverShoot = ( state === tstates.scrolling ) &&
+ ( x < this.minPos || x > this.maxPos );
- if ( !this.options.outerScrollEnable ) {
- return;
- }
+ if ( didOverShoot ) {
+ x = ( x < this.minPos ) ? this.minPos : this.maxPos;
+ }
- if ( this._$clip.jqmData("scroll") !== "y" ) {
- return;
- }
+ this.pos = x;
- if ( this._outerScrolling ) {
- return;
+ if ( state === tstates.overshot ) {
+ if ( !overshootEnable ) {
+ this.state = tstates.done;
+ }
+ if ( elapsed >= duration ) {
+ this.state = tstates.snapback;
+ this.fromPos = this.pos;
+ this.toPos = ( x < this.minPos ) ?
+ this.minPos : this.maxPos;
+ this.duration = this.options.snapbackDuration;
+ this.startTime = cur_time;
+ elapsed = 0;
+ }
+ } else if ( state === tstates.scrolling ) {
+ if ( didOverShoot && overshootEnable ) {
+ this.state = tstates.overshot;
+ this.speed = dx / 2;
+ this.duration = this.options.overshootDuration;
+ this.startTime = cur_time;
+ } else if ( elapsed >= duration ) {
+ this.state = tstates.done;
+ }
+ }
+ } else if ( state === tstates.snapback ) {
+ if ( elapsed >= duration ) {
+ this.pos = this.toPos;
+ this.state = tstates.done;
+ } else {
+ this.pos = this.fromPos + (( this.toPos - this.fromPos ) *
+ $.easing[this.easing]( elapsed / duration,
+ elapsed, 0, 1, duration ));
+ }
}
- if ( y > 0 ) {
- sy = ( window.screenTop ? window.screenTop : -y );
- } else if ( y < -scroll_height ) {
- sy = -y - scroll_height;
- } else {
- return;
- }
+ return this.pos;
+ },
- tfunc = function () {
- var elapsed = getCurrentTime() - start;
+ done: function () {
+ return this.state === tstates.done;
+ },
- if ( elapsed >= duration ) {
- window.scrollTo( 0, top + sy );
- self._outerScrolling = undefined;
+ isMin: function () {
+ return this.pos === this.minPos;
+ },
- self._stopMScroll();
- } else {
- ec = $.easing.easeOutQuad( elapsed / duration,
- elapsed, 0, 1, duration );
+ isMax: function () {
+ return this.pos === this.maxPos;
+ },
- window.scrollTo( 0, top + ( sy * ec ) );
- self._outerScrolling = setTimeout( tfunc, self._timerInterval );
- }
- };
- this._outerScrolling = setTimeout( tfunc, self._timerInterval );
+ isAvail: function () {
+ return !( this.minPos === this.maxPos );
},
- _scrollTo: function ( x, y, duration ) {
- var self = this,
- start = getCurrentTime(),
- efunc = $.easing.easeOutQuad,
- sx = this._sx,
- sy = this._sy,
- dx = x - sx,
- dy = y - sy,
- tfunc;
+ getRemained: function () {
+ return this.remained;
+ },
- x = -x;
- y = -y;
+ getPosition: function () {
+ return this.pos;
+ }
+ });
- tfunc = function () {
- var elapsed = getCurrentTime() - start,
- ec;
+ $( document ).bind( 'pagecreate create', function ( e ) {
+ var $page = $( e.target ),
+ content_scroll = $page.find(".ui-content").jqmData("scroll");
- if ( elapsed >= duration ) {
- self._timerID = 0;
- self._setScrollPosition( x, y );
- } else {
- ec = efunc( elapsed / duration, elapsed, 0, 1, duration );
+ /* content scroll */
+ if ( $.support.scrollview === undefined ) {
+ $.support.scrollview = true;
+ }
- self._setScrollPosition( sx + ( dx * ec ), sy + ( dy * ec ) );
- self._timerID = setTimeout( tfunc, self._timerInterval );
- }
- };
+ if ( $.support.scrollview === true && content_scroll === undefined ) {
+ content_scroll = "y";
+ }
- this._timerID = setTimeout( tfunc, this._timerInterval );
- },
+ if ( content_scroll !== "y" ) {
+ content_scroll = "none";
+ }
- scrollTo: function ( x, y, duration ) {
- this._stopMScroll();
+ $page.find(".ui-content").attr( "data-scroll", content_scroll );
- if ( !duration || this.options.scrollMethod === "translate" ) {
- this._setScrollPosition( x, y, duration );
+ $page.find(":jqmData(scroll)").not(".ui-scrollview-clip").each( function () {
+ if ( $( this ).hasClass("ui-scrolllistview") ) {
+ $( this ).scrolllistview();
} else {
- this._scrollTo( x, y, duration );
- }
- },
-
- getScrollPosition: function () {
- return { x: -this._sx, y: -this._sy };
- },
-
- _getScrollHierarchy: function () {
- var svh = [],
- d;
+ var st = $( this ).jqmData("scroll"),
+ dir = st && ( st.search(/^[xy]/) !== -1 ) ? st : null,
+ content = $(this).hasClass("ui-content"),
+ opts;
- this._$clip.parents( ".ui-scrollview-clip").each( function () {
- d = $( this ).jqmData("scrollview");
- if ( d ) {
- svh.unshift( d );
+ if ( st === "none" ) {
+ return;
}
- } );
- return svh;
- },
-
- _getAncestorByDirection: function ( dir ) {
- var svh = this._getScrollHierarchy(),
- n = svh.length,
- sv,
- svdir;
- while ( 0 < n-- ) {
- sv = svh[n];
- svdir = sv.options.direction;
+ opts = {
+ direction: dir || undefined,
+ overflowEnable: content,
+ scrollMethod: $( this ).jqmData("scroll-method") || undefined,
+ scrollJump: $( this ).jqmData("scroll-jump") || undefined
+ };
- if (!svdir || svdir === dir) {
- return sv;
- }
+ $( this ).scrollview( opts );
}
- return null;
- },
+ });
+ });
- _handleDragStart: function ( e, ex, ey ) {
- this._stopMScroll();
+ $( document ).bind( 'pageshow', function ( e ) {
+ var $page = $( e.target ),
+ scroll = $page.find(".ui-content").jqmData("scroll");
- this._didDrag = false;
- this._skip_dragging = false;
+ if ( scroll === "y" ) {
+ resizePageContentHeight( e.target );
+ }
+ });
- var target = $( e.target ),
- self = this,
- $c = this._$clip,
- svdir = this.options.direction;
+}( jQuery, window, document ) );
- /* should prevent the default behavior when click the button */
- this._is_button = target.is( '.ui-btn' ) ||
- target.is( '.ui-btn-text' ) ||
- target.is( '.ui-btn-inner' ) ||
- target.is( '.ui-btn-inner .ui-icon' );
- /* should prevent the default behavior when click the slider */
- if ( target.parents('.ui-slider').length || target.is('.ui-slider') ) {
- this._skip_dragging = true;
- return;
- }
- /*
- * We need to prevent the default behavior to
- * suppress accidental selection of text, etc.
- */
- this._is_inputbox = target.is(':input') ||
- target.parents(':input').length > 0;
+/* ***************************************************************************
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software" ),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * ***************************************************************************
+ */
- if ( this._is_inputbox ) {
- target.one( "resize.scrollview", function () {
- if ( ey > $c.height() ) {
- self.scrollTo( -ex, self._sy - ey + $c.height(),
- self.options.snapbackDuration );
- }
- });
- }
+// most of following codes are derived from jquery.mobile.scrollview.js
+(function ( $, window, document, undefined ) {
- if ( this.options.eventType === "mouse" && !this._is_inputbox && !this._is_button ) {
- e.preventDefault();
- }
+ function circularNum( num, total ) {
+ var n = num % total;
+ if ( n < 0 ) {
+ n = total + n;
+ }
+ return n;
+ }
- this._lastX = ex;
- this._lastY = ey;
- this._startY = ey;
- this._doSnapBackX = false;
- this._doSnapBackY = false;
- this._speedX = 0;
- this._speedY = 0;
- this._directionLock = "";
+ function setElementTransform( $ele, x, y ) {
+ var v = "translate3d( " + x + "," + y + ", 0px)";
+ $ele.css({
+ "-ms-transform": v,
+ "-o-transform": v,
+ "-moz-transform": v,
+ "-webkit-transform": v,
+ "transform": v
+ } );
+ }
- this._lastMove = 0;
- this._enableTracking();
+ function MomentumTracker( options ) {
+ this.options = $.extend( {}, options );
+ this.easing = "easeOutQuad";
+ this.reset();
+ }
- this._set_scrollbar_size();
- },
+ var tstates = {
+ scrolling : 0,
+ done : 1
+ };
- _propagateDragMove: function ( sv, e, ex, ey, dir ) {
- this._hideScrollBars();
- this._hideOverflowIndicator();
- this._disableTracking();
- sv._handleDragStart( e, ex, ey );
- sv._directionLock = dir;
- sv._didDrag = this._didDrag;
+ function getCurrentTime() {
+ return Date.now();
+ }
+
+ $.extend( MomentumTracker.prototype, {
+ start: function ( pos, speed, duration ) {
+ this.state = ( speed != 0 ) ? tstates.scrolling : tstates.done;
+ this.pos = pos;
+ this.speed = speed;
+ this.duration = duration;
+
+ this.fromPos = 0;
+ this.toPos = 0;
+
+ this.startTime = getCurrentTime();
},
- _handleDragMove: function ( e, ex, ey ) {
- if ( this._skip_dragging ) {
- return;
- }
+ reset: function () {
+ this.state = tstates.done;
+ this.pos = 0;
+ this.speed = 0;
+ this.duration = 0;
+ },
- if ( !this._dragging ) {
- return;
- }
+ update: function () {
+ var state = this.state,
+ duration,
+ elapsed,
+ dx,
+ x;
- if ( !this._is_inputbox && !this._is_button ) {
- e.preventDefault();
+ if ( state == tstates.done ) {
+ return this.pos;
}
- var mt = this.options.moveThreshold,
- dx = ex - this._lastX,
- dy = ey - this._lastY,
- svdir = this.options.direction,
- dir = null,
- x,
- y,
- sv,
- scope,
- newX,
- newY,
- dirLock;
+ duration = this.duration;
+ elapsed = getCurrentTime() - this.startTime;
+ elapsed = elapsed > duration ? duration : elapsed;
- this._lastMove = getCurrentTime();
+ dx = this.speed * ( 1 - $.easing[this.easing](elapsed / duration, elapsed, 0, 1, duration ) );
- if ( !this._directionLock ) {
- x = Math.abs( dx );
- y = Math.abs( dy );
+ x = this.pos + dx;
+ this.pos = x;
- if ( x < mt && y < mt ) {
- return false;
- }
+ if ( elapsed >= duration ) {
+ this.state = tstates.done;
+ }
- if ( x < y && (x / y) < 0.5 ) {
- dir = "y";
- } else if ( x > y && (y / x) < 0.5 ) {
- dir = "x";
- }
+ return this.pos;
+ },
- if ( svdir && dir && svdir !== dir ) {
- /*
- * This scrollview can't handle the direction the user
- * is attempting to scroll. Find an ancestor scrollview
- * that can handle the request.
- */
+ done: function () {
+ return this.state == tstates.done;
+ },
- sv = this._getAncestorByDirection( dir );
- if ( sv ) {
- this._propagateDragMove( sv, e, ex, ey, dir );
- return false;
- }
- }
+ getPosition: function () {
+ return this.pos;
+ }
+ } );
- this._directionLock = svdir || (dir || "none");
- }
+ jQuery.widget( "mobile.circularview", jQuery.mobile.widget, {
+ options: {
+ fps: 60,
- newX = this._sx;
- newY = this._sy;
- dirLock = this._directionLock;
+ scrollDuration: 2000,
- if ( dirLock !== "y" && this._hTracker ) {
- x = this._sx;
- this._speedX = dx;
- newX = x + dx;
+ moveThreshold: 10,
+ moveIntervalThreshold: 150,
- this._doSnapBackX = false;
+ startEventName: "scrollstart",
+ updateEventName: "scrollupdate",
+ stopEventName: "scrollstop",
- scope = ( newX > 0 || newX < this._maxX );
+ eventType: $.support.touch ? "touch" : "mouse",
- if ( scope && dirLock === "x" ) {
- sv = this._getAncestorByDirection("x");
- if ( sv ) {
- this._setScrollPosition( newX > 0 ?
- 0 : this._maxX, newY );
- this._propagateDragMove( sv, e, ex, ey, dir );
- return false;
- }
+ delayedClickSelector: "a, .ui-btn",
+ delayedClickEnabled: false
+ },
- newX = x + ( dx / 2 );
- this._doSnapBackX = true;
- }
+ _makePositioned: function ( $ele ) {
+ if ( $ele.css( 'position' ) == 'static' ) {
+ $ele.css( 'position', 'relative' );
}
+ },
- if ( dirLock !== "x" && this._vTracker ) {
- if ( Math.abs( this._startY - ey ) < mt && dirLock !== "xy" ) {
- return;
- }
+ _create: function () {
+ var self = this;
- y = this._sy;
- this._speedY = dy;
- newY = y + dy;
+ this._items = $( this.element ).jqmData('list');
+ this._$clip = $( this.element ).addClass( "ui-scrollview-clip" );
+ this._$clip.wrapInner( '<div class="ui-scrollview-view"></div>' );
+ this._$view = $('.ui-scrollview-view', this._$clip );
+ this._$list = $( 'ul', this._$clip );
- this._doSnapBackY = false;
+ this._$clip.css( "overflow", "hidden" );
+ this._makePositioned( this._$clip );
- scope = ( newY > 0 || newY < this._maxY );
+ this._$view.css( "overflow", "hidden" );
+ this._tracker = new MomentumTracker( this.options );
- if ( scope && dirLock === "y" ) {
- sv = this._getAncestorByDirection("y");
- if ( sv ) {
- this._setScrollPosition( newX,
- newY > 0 ? 0 : this._maxY );
- this._propagateDragMove( sv, e, ex, ey, dir );
- return false;
- }
+ this._timerInterval = 1000 / this.options.fps;
+ this._timerID = 0;
- newY = y + ( dy / 2 );
- this._doSnapBackY = true;
- }
- }
+ this._timerCB = function () { self._handleMomentumScroll(); };
- if ( this.options.overshootEnable === false ) {
- this._doSnapBackX = false;
- this._doSnapBackY = false;
- }
+ this.refresh();
- this._lastX = ex;
- this._lastY = ey;
+ this._addBehaviors();
+ },
- this._setScrollPosition( newX, newY );
+ reflow: function () {
+ var xy = this.getScrollPosition();
+ this.refresh();
+ this.scrollTo( xy.x, xy.y );
+ },
- if ( this._didDrag === false ) {
- this._didDrag = true;
- this._showScrollBars();
- this._showOverflowIndicator();
+ refresh: function () {
+ var itemsPerView;
+
+ this._$clip.width( $(window).width() );
+ this._clipWidth = this._$clip.width();
+ this._$list.empty();
+ this._$list.append(this._items[0]);
+ this._itemWidth = $(this._items[0]).outerWidth();
+ $(this._items[0]).detach();
+
+ itemsPerView = this._clipWidth / this._itemWidth;
+ itemsPerView = Math.ceil( itemsPerView * 10 ) / 10;
+ this._itemsPerView = parseInt( itemsPerView, 10 );
+ while ( this._itemsPerView + 1 > this._items.length ) {
+ $.merge( this._items, $(this._items).clone() );
}
+ this._rx = -this._itemWidth;
+ this._sx = -this._itemWidth;
+ this._setItems();
},
- _handleDragStop: function ( e ) {
- var self = this;
+ _startMScroll: function ( speedX, speedY ) {
+ this._stopMScroll();
- if ( this._skip_dragging ) {
- return;
- }
+ var keepGoing = false,
+ duration = this.options.scrollDuration,
+ t = this._tracker,
+ c = this._clipWidth,
+ v = this._viewWidth;
- var l = this._lastMove,
- t = getCurrentTime(),
- doScroll = (l && (t - l) <= this.options.moveIntervalThreshold),
- sx = ( this._hTracker && this._speedX && doScroll ) ?
- this._speedX : ( this._doSnapBackX ? 1 : 0 ),
- sy = ( this._vTracker && this._speedY && doScroll ) ?
- this._speedY : ( this._doSnapBackY ? 1 : 0 ),
- svdir = this.options.direction,
- x,
- y;
+ this._$clip.trigger( this.options.startEventName);
- if ( sx || sy ) {
- if ( !this._setGestureScroll( sx, sy ) ) {
- this._startMScroll( sx, sy );
- }
+ t.start( this._rx, speedX, duration, (v > c ) ? -(v - c) : 0, 0 );
+ keepGoing = !t.done();
+
+ if ( keepGoing ) {
+ this._timerID = setTimeout( this._timerCB, this._timerInterval );
} else {
- this._hideScrollBars();
- this._hideOverflowIndicator();
+ this._stopMScroll();
}
+ //console.log( "startmscroll" + this._rx + "," + this._sx );
+ },
- this._disableTracking();
-
- if ( this._endEffect ) {
- setTimeout( function () {
- self._setEndEffect( "out" );
- self._hideScrollBars();
- self._hideOverflowIndicator();
- }, 300 );
+ _stopMScroll: function () {
+ if ( this._timerID ) {
+ this._$clip.trigger( this.options.stopEventName );
+ clearTimeout( this._timerID );
}
- return !this._didDrag;
- },
-
- _setGestureScroll: function ( sx, sy ) {
- var self = this,
- reset = function () {
- clearTimeout( self._gesture_timer );
- self._gesture_dir = 0;
- self._gesture_count = 0;
- self._gesture_timer = undefined;
- };
+ this._timerID = 0;
- if ( !sy ) {
- return false;
+ if ( this._tracker ) {
+ this._tracker.reset();
}
+ //console.log( "stopmscroll" + this._rx + "," + this._sx );
+ },
- dir = sy > 0 ? 1 : -1;
-
- if ( !this._gesture_timer ) {
- this._gesture_count = 1;
- this._gesture_dir = dir;
+ _handleMomentumScroll: function () {
+ var keepGoing = false,
+ v = this._$view,
+ x = 0,
+ y = 0,
+ t = this._tracker;
- this._gesture_timer = setTimeout( function () {
- reset();
- }, 1000 );
+ if ( t ) {
+ t.update();
+ x = t.getPosition();
- return false;
- }
+ keepGoing = !t.done();
- if ( this._gesture_dir !== dir ) {
- reset();
- return false;
}
- this._gesture_count++;
+ this._setScrollPosition( x, y );
+ this._rx = x;
- if ( this._gesture_count === 3 ) {
- if ( dir > 0 ) {
- this.scrollTo( 0, 0, this.options.overshootDuration );
- } else {
- this.scrollTo( 0, -( this._getViewHeight() - this._$clip.height() ),
- this.options.overshootDuration );
- }
- reset();
+ this._$clip.trigger( this.options.updateEventName, [ { x: x, y: y } ] );
- return true;
+ if ( keepGoing ) {
+ this._timerID = setTimeout( this._timerCB, this._timerInterval );
+ } else {
+ this._stopMScroll();
}
-
- return false;
},
- _enableTracking: function () {
- this._dragging = true;
- },
+ _setItems: function () {
+ var i,
+ $item;
- _disableTracking: function () {
- this._dragging = false;
+ for ( i = -1; i < this._itemsPerView + 1; i++ ) {
+ $item = this._items[ circularNum( i, this._items.length ) ];
+ this._$list.append( $item );
+ }
+ setElementTransform( this._$view, this._sx + "px", 0 );
+ this._$view.width( this._itemWidth * ( this._itemsPerView + 2 ) );
+ this._viewWidth = this._$view.width();
},
- _showScrollBars: function ( interval ) {
- var vclass = "ui-scrollbar-visible",
- self = this;
+ _setScrollPosition: function ( x, y ) {
+ var sx = this._sx,
+ dx = x - sx,
+ di = parseInt( dx / this._itemWidth, 10 ),
+ i,
+ idx,
+ $item;
- if ( !this.options.showScrollBars ) {
- return;
- }
- if ( this._scrollbar_showed ) {
- return;
+ if ( di > 0 ) {
+ for ( i = 0; i < di; i++ ) {
+ this._$list.children().last().detach();
+ idx = -parseInt( ( sx / this._itemWidth ) + i + 3, 10 );
+ $item = this._items[ circularNum( idx, this._items.length ) ];
+ this._$list.prepend( $item );
+ //console.log( "di > 0 : " + idx );
+ }
+ } else if ( di < 0 ) {
+ for ( i = 0; i > di; i-- ) {
+ this._$list.children().first().detach();
+ idx = this._itemsPerView - parseInt( ( sx / this._itemWidth ) + i, 10 );
+ $item = this._items[ circularNum( idx, this._items.length ) ];
+ this._$list.append( $item );
+ //console.log( "di < 0 : " + idx );
+ }
}
- if ( this._$vScrollBar ) {
- this._$vScrollBar.addClass( vclass );
- }
- if ( this._$hScrollBar ) {
- this._$hScrollBar.addClass( vclass );
- }
+ this._sx += di * this._itemWidth;
- this._scrollbar_showed = true;
+ setElementTransform( this._$view, ( x - this._sx - this._itemWidth ) + "px", 0 );
- if ( interval ) {
- setTimeout( function () {
- self._hideScrollBars();
- }, interval );
- }
+ //console.log( "rx " + this._rx + "sx " + this._sx );
},
- _hideScrollBars: function () {
- var vclass = "ui-scrollbar-visible";
-
- if ( !this.options.showScrollBars ) {
- return;
- }
- if ( !this._scrollbar_showed ) {
- return;
- }
+ _enableTracking: function () {
+ $(document).bind( this._dragMoveEvt, this._dragMoveCB );
+ $(document).bind( this._dragStopEvt, this._dragStopCB );
+ },
- if ( this._$vScrollBar ) {
- this._$vScrollBar.removeClass( vclass );
- }
- if ( this._$hScrollBar ) {
- this._$hScrollBar.removeClass( vclass );
- }
+ _disableTracking: function () {
+ $(document).unbind( this._dragMoveEvt, this._dragMoveCB );
+ $(document).unbind( this._dragStopEvt, this._dragStopCB );
+ },
- this._scrollbar_showed = false;
+ _getScrollHierarchy: function () {
+ var svh = [],
+ d;
+ this._$clip.parents( '.ui-scrollview-clip' ).each( function () {
+ d = $( this ).jqmData( 'circulaview' );
+ if ( d ) {
+ svh.unshift( d );
+ }
+ } );
+ return svh;
},
- _setOverflowIndicator: function ( dir ) {
- if ( dir === 1 ) {
- this._opacity_top = "0";
- this._opacity_bottom = "0.8";
- } else if ( dir === 0 ) {
- this._opacity_top = "0.8";
- this._opacity_bottom = "0";
- } else {
- this._opacity_top = "0.5";
- this._opacity_bottom = "0.5";
+ centerTo: function ( selector, duration ) {
+ var i,
+ newX;
+
+ for ( i = 0; i < this._items.length; i++ ) {
+ if ( $( this._items[i]).is( selector ) ) {
+ newX = -( i * this._itemWidth - this._clipWidth / 2 + this._itemWidth * 1.5 );
+ this.scrollTo( newX + this._itemWidth, 0 );
+ this.scrollTo( newX, 0, duration );
+ return;
+ }
}
},
- _showOverflowIndicator: function () {
- if ( !this.options.overflowEnable || !this._overflowAvail || this._softkeyboard ) {
+ scrollTo: function ( x, y, duration ) {
+ this._stopMScroll();
+ if ( !duration ) {
+ this._setScrollPosition( x, y );
+ this._rx = x;
return;
}
- this._overflow_top.animate( { opacity: this._opacity_top }, 300 );
- this._overflow_bottom.animate( { opacity: this._opacity_bottom }, 300 );
-
- this._overflow_showed = true;
- },
-
- _hideOverflowIndicator: function () {
- if ( !this.options.overflowEnable || !this._overflowAvail || this._softkeyboard ) {
- return;
- }
-
- if ( this._overflow_showed === false ) {
- return;
- }
-
- this._overflow_top.animate( { opacity: 0 }, 300 );
- this._overflow_bottom.animate( { opacity: 0 }, 300 );
-
- this._overflow_showed = false;
- this._setOverflowIndicator();
- },
-
- _add_event: function () {
var self = this,
- $c = this._$clip,
- $v = this._$view;
+ start = getCurrentTime(),
+ efunc = $.easing.easeOutQuad,
+ sx = this._rx,
+ sy = 0,
+ dx = x - sx,
+ dy = 0,
+ tfunc,
+ elapsed,
+ ec;
- if ( this.options.eventType === "mouse" ) {
- this._dragEvt = "mousedown mousemove mouseup click mousewheel";
+ this._rx = x;
- this._dragCB = function ( e ) {
- switch ( e.type ) {
- case "mousedown":
- return self._handleDragStart( e,
- e.clientX, e.clientY );
+ tfunc = function () {
+ elapsed = getCurrentTime() - start;
+ if ( elapsed >= duration ) {
+ self._timerID = 0;
+ self._setScrollPosition( x, y );
+ self._$clip.trigger("scrollend");
+ } else {
+ ec = efunc( elapsed / duration, elapsed, 0, 1, duration );
+ self._setScrollPosition( sx + ( dx * ec ), sy + ( dy * ec ) );
+ self._timerID = setTimeout( tfunc, self._timerInterval );
+ }
+ };
- case "mousemove":
- return self._handleDragMove( e,
- e.clientX, e.clientY );
+ this._timerID = setTimeout( tfunc, this._timerInterval );
+ },
- case "mouseup":
- return self._handleDragStop( e );
+ getScrollPosition: function () {
+ return { x: -this._rx, y: 0 };
+ },
- case "click":
- return !self._didDrag;
+ _handleDragStart: function ( e, ex, ey ) {
+ $.each( this._getScrollHierarchy(), function ( i, sv ) {
+ sv._stopMScroll();
+ } );
- case "mousewheel":
- var old = self.getScrollPosition();
- self.scrollTo( -old.x,
- -(old.y - e.originalEvent.wheelDelta) );
- break;
- }
- };
- } else {
- this._dragEvt = "touchstart touchmove touchend click";
+ this._stopMScroll();
- this._dragCB = function ( e ) {
- var touches = e.originalEvent.touches;
+ if ( this.options.delayedClickEnabled ) {
+ this._$clickEle = $( e.target ).closest( this.options.delayedClickSelector );
+ }
+ this._lastX = ex;
+ this._lastY = ey;
+ this._speedX = 0;
+ this._speedY = 0;
+ this._didDrag = false;
- switch ( e.type ) {
- case "touchstart":
- if ( touches.length != 1) {
- return;
- }
+ this._lastMove = 0;
+ this._enableTracking();
- return self._handleDragStart( e,
- touches[0].pageX, touches[0].pageY );
+ this._ox = ex;
+ this._nx = this._rx;
- case "touchmove":
- if ( touches.length != 1) {
- return;
- }
+ if ( this.options.eventType == "mouse" || this.options.delayedClickEnabled ) {
+ e.preventDefault();
+ }
+ //console.log( "scrollstart" + this._rx + "," + this._sx );
+ e.stopPropagation();
+ },
- return self._handleDragMove( e,
- touches[0].pageX, touches[0].pageY );
+ _handleDragMove: function ( e, ex, ey ) {
+ this._lastMove = getCurrentTime();
- case "touchend":
- if ( touches.length != 0) {
- return;
- }
+ var dx = ex - this._lastX,
+ dy = ey - this._lastY;
- return self._handleDragStop( e );
+ this._speedX = dx;
+ this._speedY = 0;
- case "click":
- return !self._didDrag;
- }
- };
- }
+ this._didDrag = true;
- $v.bind( this._dragEvt, this._dragCB );
+ this._lastX = ex;
+ this._lastY = ey;
- $v.bind( "keydown", function ( e ) {
- var elem,
- elem_top,
- screen_h;
+ this._mx = ex - this._ox;
- if ( e.keyCode == 9 ) {
- return false;
- }
+ this._setScrollPosition( this._nx + this._mx, 0 );
- elem = $c.find(".ui-focus");
+ //console.log( "scrollmove" + this._rx + "," + this._sx );
+ return false;
+ },
- if ( elem === undefined ) {
- return;
- }
+ _handleDragStop: function ( e ) {
+ var l = this._lastMove,
+ t = getCurrentTime(),
+ doScroll = l && ( t - l ) <= this.options.moveIntervalThreshold,
+ sx = ( this._tracker && this._speedX && doScroll ) ? this._speedX : 0,
+ sy = 0;
- elem_top = elem.offset().top;
- screen_h = $c.offset().top + $c.height() - elem.height();
+ this._rx = this._mx ? this._nx + this._mx : this._rx;
- if ( self._softkeyboard ) {
- screen_h -= self._softkeyboardHeight;
- }
+ if ( sx ) {
+ this._startMScroll( sx, sy );
+ }
- if ( ( elem_top < 0 ) || ( elem_top > screen_h ) ) {
- self.scrollTo( 0, self._sy - elem_top +
- elem.height() + $c.offset().top, 0);
- }
+ //console.log( "scrollstop" + this._rx + "," + this._sx );
- return;
- });
+ this._disableTracking();
- $v.bind( "keyup", function ( e ) {
- var input,
- elem,
- elem_top,
- screen_h;
+ if ( !this._didDrag && this.options.delayedClickEnabled && this._$clickEle.length ) {
+ this._$clickEle
+ .trigger( "mousedown" )
+ .trigger( "mouseup" )
+ .trigger( "click" );
+ }
- if ( e.keyCode != 9 ) {
- return;
- }
+ if ( this._didDrag ) {
+ e.preventDefault();
+ e.stopPropagation();
+ }
- /* Tab Key */
+ return this._didDrag ? false : undefined;
+ },
- input = $( this ).find(":input");
+ _addBehaviors: function () {
+ var self = this;
- for ( i = 0; i < input.length; i++ ) {
- if ( !$( input[i] ).hasClass("ui-focus") ) {
- continue;
- }
+ if ( this.options.eventType === "mouse" ) {
+ this._dragStartEvt = "mousedown";
+ this._dragStartCB = function ( e ) {
+ return self._handleDragStart( e, e.clientX, e.clientY );
+ };
- if ( i + 1 == input.length ) {
- elem = $( input[0] );
- } else {
- elem = $( input[i + 1] );
- }
+ this._dragMoveEvt = "mousemove";
+ this._dragMoveCB = function ( e ) {
+ return self._handleDragMove( e, e.clientX, e.clientY );
+ };
- elem_top = elem.offset().top;
- screen_h = $c.offset().top + $c.height() - elem.height();
+ this._dragStopEvt = "mouseup";
+ this._dragStopCB = function ( e ) {
+ return self._handleDragStop( e );
+ };
- if ( self._softkeyboard ) {
- screen_h -= self._softkeyboardHeight;
- }
+ this._$view.bind( "vclick", function (e) {
+ return !self._didDrag;
+ } );
- if ( ( elem_top < 0 ) || ( elem_top > screen_h ) ) {
- self.scrollTo( 0, self._sy - elem_top +
- elem.height() + $c.offset().top, 0);
- }
+ } else { //touch
+ this._dragStartEvt = "touchstart";
+ this._dragStartCB = function ( e ) {
+ var t = e.originalEvent.targetTouches[0];
+ return self._handleDragStart(e, t.pageX, t.pageY );
+ };
- elem.focus();
+ this._dragMoveEvt = "touchmove";
+ this._dragMoveCB = function ( e ) {
+ var t = e.originalEvent.targetTouches[0];
+ return self._handleDragMove(e, t.pageX, t.pageY );
+ };
- break;
- }
+ this._dragStopEvt = "touchend";
+ this._dragStopCB = function ( e ) {
+ return self._handleDragStop( e );
+ };
+ }
+ this._$view.bind( this._dragStartEvt, this._dragStartCB );
+ }
+ } );
- return false;
- });
+ $( document ).bind( "pagecreate create", function ( e ) {
+ $( $.mobile.circularview.prototype.options.initSelector, e.target ).circularview();
+ } );
- $c.bind( "updatelayout", function ( e ) {
- var sy,
- vh,
- view_h = self._getViewHeight();
+}( jQuery, window, document ) ); // End Component
- if ( !$c.height() || !view_h ) {
- self.scrollTo( 0, 0, 0 );
- return;
- }
- sy = $c.height() - view_h;
- vh = view_h - self._view_height;
- self._view_height = view_h;
-
- if ( vh == 0 || vh > $c.height() / 2 ) {
- return;
- }
-
- if ( sy > 0 ) {
- self.scrollTo( 0, 0, 0 );
- } else if ( self._sy - sy <= -vh ) {
- self.scrollTo( 0, self._sy,
- self.options.snapbackDuration );
- } else if ( self._sy - sy <= vh + self.options.moveThreshold ) {
- self.scrollTo( 0, sy,
- self.options.snapbackDuration );
- }
- });
-
- $( window ).bind( "resize", function ( e ) {
- var focused,
- view_h = self._getViewHeight();
-
- if ( $(".ui-page-active").get(0) !== $c.closest(".ui-page").get(0) ) {
- return;
- }
+/* ***************************************************************************
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * ***************************************************************************
+ *
+ * Author: Minkyu Kang <mk7.kang@samsung.com>
+ */
- if ( !$c.height() || !view_h ) {
- return;
- }
+/*
+ * Gallery widget
+ *
+ * HTML Attributes
+ *
+ * data-role: set to 'gallery'
+ * data-index: start index
+ * data-vertical-align: set to top or middle or bottom.
+ *
+ * APIs
+ *
+ * add(file): add the image (parameter: url of iamge)
+ * remove(index): remove the image (parameter: index of image)
+ * refresh(index): refresh the widget, should be called after add or remove. (parameter: start index)
+ * empty: remove all of images from the gallery
+ * length: get length of images
+ * value(index): get or set current index of gallery (parameter: index of image)
+ *
+ * Events
+ *
+ * N/A
+ *
+ * Example
+ *
+ * <div data-role="gallery" id="gallery" data-index="3" data-vertical-align="middle">
+ * <img src="01.jpg">
+ * <img src="02.jpg">
+ * <img src="03.jpg">
+ * <img src="04.jpg">
+ * <img src="05.jpg">
+ * </div>
+ *
+ *
+ * $('#gallery-add').bind('vmouseup', function ( e ) {
+ * $('#gallery').gallery('add', '9.jpg');
+ * $('#gallery').gallery('add', '10.jpg');
+ * $('#gallery').gallery('refresh');
+ * });
+ *
+ * $('#gallery-del').bind('vmouseup', function ( e ) {
+ * $('#gallery').gallery('remove');
+ * });
+ *
+ */
- focused = $c.find(".ui-focus");
+ /**
+ @class Gallery
+ The gallery widget shows images in a gallery on the screen. <br/><br/> To add an gallery widget to the application, use the following code:
- if ( focused ) {
- focused.trigger("resize.scrollview");
- }
+ <div data-role="gallery" id="gallery" data-vertical-align="middle" data-index="3">
+ <img src="01.jpg">
+ <img src="02.jpg">
+ <img src="03.jpg">
+ <img src="04.jpg">
+ <img src="05.jpg">
+ </div>
+*/
+/**
+ @property {Integer} data-index
+ Defines the index number of the first image in the gallery.
+ <br/>The default value is 0.
+*/
+/**
+ @property {String} data-vertical-align
+ Defines the image alignment. The alignment options are top, middle, and bottom.
+ <br/>The default value is top.
+*/
+/**
+ @method add
+ The add method is used to add an image to the gallery. The image_file attribute defines the image file URL.
- /* calibration - after triggered throttledresize */
- setTimeout( function () {
- if ( self._sy < $c.height() - self._getViewHeight() ) {
- self.scrollTo( 0, $c.height() - self._getViewHeight(),
- self.options.overshootDuration );
- }
- }, 260 );
+ <div id="gallery" data-role="gallery" data-vertical-align="middle"></div>
+ $("#gallery").gallery('add', [image_file]);
+*/
+/**
+ @method remove
+ The remove method is used to delete an image from the gallery. The image_index attribute defines the index of the image to be deleted. If not set removes current image.
- self._view_height = view_h;
- });
+ <div id="gallery" data-role="gallery" data-vertical-align="middle"></div>
+ $("#gallery").gallery('remove', [image_index]);
+*/
+/**
+ @method refresh
+ The refresh method is used to refresh the gallery. This method must be called after adding images to the gallery.
- $( window ).bind( "vmouseout", function ( e ) {
- var drag_stop = false;
+ <div id="gallery" data-role="gallery" data-vertical-align="middle"></div>
+ $("#gallery").gallery('refresh');
+*/
+/**
+ @method empty
+ The empty method is used to remove all of images from the gallery.
- if ( $(".ui-page-active").get(0) !== $c.closest(".ui-page").get(0) ) {
- return;
- }
+ <div id="gallery" data-role="gallery" data-vertical-align="middle"></div>
+ $("#gallery").gallery('empty');
+*/
+/**
+ @method length
+ The length method is used to get length of images.
- if ( !self._dragging ) {
- return;
- }
+ <div id="gallery" data-role="gallery" data-vertical-align="middle"></div>
+ length = $("#gallery").gallery('length');
+*/
+/**
+ @method value
+ The value method is used to get or set current index of gallery. The image_index attribute defines the index of the image to be set. If not get current index.
- if ( e.pageX < 0 || e.pageX > $( window ).width() ) {
- drag_stop = true;
- }
+ <div id="gallery" data-role="gallery" data-vertical-align="middle"></div>
+ value = $("#gallery").gallery('value');
+ $("#gallery").gallery('value', [image_index]);
+*/
+(function ( $, window, undefined ) {
+ $.widget( "tizen.gallery", $.mobile.widget, {
+ options: {
+ flicking: false,
+ duration: 500
+ },
- if ( e.pageY < 0 || e.pageY > $( window ).height() ) {
- drag_stop = true;
- }
+ dragging: false,
+ moving: false,
+ max_width: 0,
+ max_height: 0,
+ org_x: 0,
+ org_time: null,
+ cur_img: null,
+ prev_img: null,
+ next_img: null,
+ images: [],
+ images_hold: [],
+ index: 0,
+ align_type: null,
+ direction: 1,
+ container: null,
- if ( drag_stop ) {
- self._hideScrollBars();
- self._hideOverflowIndicator();
- self._disableTracking();
- }
- });
+ _resize: function ( index ) {
+ var img = this.images[index],
+ width = this.images[index].width(),
+ height = this.images[index].height(),
+ margin = 0,
+ ratio,
+ img_max_width = this.max_width - margin,
+ img_max_height = this.max_height - margin;
- this._softkeyboard = false;
- this._softkeyboardHeight = 0;
+ ratio = height / width;
- window.addEventListener( "softkeyboardchange", function ( e ) {
- if ( $(".ui-page-active").get(0) !== $c.closest(".ui-page").get(0) ) {
- return;
- }
+ if ( width > img_max_width ) {
+ img.width( img_max_width );
+ img.height( img_max_width * ratio );
+ }
- self._softkeyboard = ( e.state === "on" ? true : false );
- self._softkeyboardHeight = e.height;
- });
+ height = img.height();
- $c.closest(".ui-page")
- .bind( "pageshow", function ( e ) {
- /* should be called after pagelayout */
- setTimeout( function () {
- self._view_height = self._getViewHeight();
- self._set_scrollbar_size();
- self._setScrollPosition( self._sx, self._sy );
- self._showScrollBars( 2000 );
- }, 0 );
- });
+ if ( height > img_max_height ) {
+ img.height( img_max_height );
+ img.width( img_max_height / ratio );
+ }
},
- _add_scrollbar: function () {
- var $c = this._$clip,
- prefix = "<div class=\"ui-scrollbar ui-scrollbar-",
- suffix = "\"><div class=\"ui-scrollbar-track\"><div class=\"ui-scrollbar-thumb\"></div></div></div>";
+ _align: function ( index, obj ) {
+ var img = this.images[index],
+ img_top = 0;
- if ( !this.options.showScrollBars ) {
+ if ( !obj ) {
+ return;
+ }
+ if ( !obj.length ) {
return;
}
- if ( this._vTracker ) {
- $c.append( prefix + "y" + suffix );
- this._$vScrollBar = $c.children(".ui-scrollbar-y");
- }
- if ( this._hTracker ) {
- $c.append( prefix + "x" + suffix );
- this._$hScrollBar = $c.children(".ui-scrollbar-x");
+ if ( this.align_type == "middle" ) {
+ img_top = ( this.max_height - img.height() ) / 2;
+ } else if ( this.align_type == "bottom" ) {
+ img_top = this.max_height - img.height();
+ } else {
+ img_top = 0;
}
- this._scrollbar_showed = false;
+ obj.css( 'top', img_top + 'px' );
},
- _add_scroll_jump: function () {
- var $c = this._$clip,
- self = this,
- top_btn,
- left_btn;
+ _attach: function ( index, obj ) {
+ var self = this,
+ processing = function () {
+ self._resize( index );
+ self._align( index, obj );
+ },
+ loading = function () {
+ if ( self.images[index] === undefined ) {
+ return;
+ }
- if ( !this.options.scrollJump ) {
- return;
- }
+ if ( !self.images[index].height() ) {
+ setTimeout( loading, 10 );
+ return;
+ }
- if ( this._vTracker ) {
- top_btn = $( '<div class="ui-scroll-jump-top-bg">' +
- '<div data-role="button" data-inline="true" data-icon="scrolltop" data-style="box"></div></div>' );
- $c.append( top_btn ).trigger("create");
+ processing();
+ };
- top_btn.bind( "vclick", function () {
- self.scrollTo( 0, 0, self.options.overshootDuration );
- } );
+ if ( !obj ) {
+ return;
+ }
+ if ( !obj.length ) {
+ return;
+ }
+ if ( index < 0 ) {
+ return;
+ }
+ if ( !this.images.length ) {
+ return;
+ }
+ if ( index >= this.images.length ) {
+ return;
}
- if ( this._hTracker ) {
- left_btn = $( '<div class="ui-scroll-jump-left-bg">' +
- '<div data-role="button" data-inline="true" data-icon="scrollleft" data-style="box"></div></div>' );
- $c.append( left_btn ).trigger("create");
+ obj.css( "display", "block" );
+ obj.append( this.images[index] );
- left_btn.bind( "vclick", function () {
- self.scrollTo( 0, 0, self.options.overshootDuration );
- } );
- }
+ loading();
},
- _add_overflow_indicator: function () {
- if ( !this.options.overflowEnable ) {
+ _detach: function ( index, obj ) {
+ if ( !obj ) {
+ return;
+ }
+ if ( !obj.length ) {
+ return;
+ }
+ if ( index < 0 ) {
+ return;
+ }
+ if ( index >= this.images.length ) {
return;
}
- this._overflow_top = $( '<div class="ui-overflow-indicator-top"></div>' );
- this._overflow_bottom = $( '<div class="ui-overflow-indicator-bottom"></div>' );
+ obj.css( "display", "none" );
+ this.images[index].removeAttr("style");
+ this.images[index].detach();
+ },
- this._$clip.append( this._overflow_top );
- this._$clip.append( this._overflow_bottom );
+ _detach_all: function () {
+ var i;
- this._opacity_top = "0.5";
- this._opacity_bottom = "0.5";
- this._overflow_showed = false;
+ for ( i = 0; i < this.images.length; i++ ) {
+ this.images[i].detach();
+ }
},
- _set_scrollbar_size: function () {
- var $c = this._$clip,
- $v = this._$view,
- cw = 0,
- vw = 0,
- ch = 0,
- vh = 0,
- thumb;
+ _drag: function ( _x ) {
+ var delta,
+ coord_x;
- if ( !this.options.showScrollBars ) {
+ if ( !this.dragging ) {
return;
}
- if ( this._hTracker ) {
- cw = $c.width();
- vw = $v.width();
- this._maxX = cw - vw;
+ if ( this.options.flicking === false ) {
+ delta = this.org_x - _x;
- if ( this._maxX > 0 ) {
- this._maxX = 0;
+ // first image
+ if ( delta < 0 && !this.prev_img.length ) {
+ return;
}
- if ( this._$hScrollBar && vw ) {
- thumb = this._$hScrollBar.find(".ui-scrollbar-thumb");
- thumb.css( "width", (cw >= vw ? "0" :
- (Math.floor(cw / vw * 100) || 1) + "%") );
+ // last image
+ if ( delta > 0 && !this.next_img.length ) {
+ return;
}
}
- if ( this._vTracker ) {
- ch = $c.height();
- vh = this._getViewHeight();
- this._maxY = ch - vh;
+ coord_x = _x - this.org_x;
- if ( this._maxY > 0 ) {
- this._maxY = 0;
- }
- if ( this._$vScrollBar && vh ) {
- thumb = this._$vScrollBar.find(".ui-scrollbar-thumb");
- thumb.css( "height", (ch >= vh ? "0" :
- (Math.floor(ch / vh * 100) || 1) + "%") );
+ this._moveLeft( this.cur_img , coord_x + 'px');
+ if ( this.next_img.length ) {
+ this._moveLeft( this.next_img , coord_x + this.window_width + 'px' );
+ }
+ if ( this.prev_img.length ) {
+ this._moveLeft( this.prev_img , coord_x - this.window_width + 'px' );
+ }
+ },
- this._overflowAvail = !!thumb.height();
- }
+ _move: function ( _x ) {
+ var delta = this.org_x - _x,
+ flip = 0,
+ drag_time,
+ sec,
+ self;
+
+ if ( delta == 0 ) {
+ return;
}
- }
- });
- $.extend( MomentumTracker.prototype, {
- start: function ( pos, speed, duration, minPos, maxPos ) {
- var tstate = ( pos < minPos || pos > maxPos ) ?
- tstates.snapback : tstates.scrolling,
- pos_temp;
+ if ( delta > 0 ) {
+ flip = delta < ( this.max_width * 0.45 ) ? 0 : 1;
+ } else {
+ flip = -delta < ( this.max_width * 0.45 ) ? 0 : 1;
+ }
- this.state = ( speed !== 0 ) ? tstate : tstates.done;
- this.pos = pos;
- this.speed = speed;
- this.duration = ( this.state === tstates.snapback ) ?
- this.options.snapbackDuration : duration;
- this.minPos = minPos;
- this.maxPos = maxPos;
+ if ( !flip ) {
+ drag_time = Date.now() - this.org_time;
- this.fromPos = ( this.state === tstates.snapback ) ? this.pos : 0;
- pos_temp = ( this.pos < this.minPos ) ? this.minPos : this.maxPos;
- this.toPos = ( this.state === tstates.snapback ) ? pos_temp : 0;
+ if ( Math.abs( delta ) / drag_time > 1 ) {
+ flip = 1;
+ }
+ }
- this.startTime = getCurrentTime();
- },
+ if ( flip ) {
+ if ( delta > 0 && this.next_img.length ) {
+ /* next */
+ this._detach( this.index - 1, this.prev_img );
- reset: function () {
- this.state = tstates.done;
- this.pos = 0;
- this.speed = 0;
- this.minPos = 0;
- this.maxPos = 0;
- this.duration = 0;
- this.remained = 0;
- },
+ this.prev_img = this.cur_img;
+ this.cur_img = this.next_img;
+ this.next_img = this.next_img.next();
- update: function ( overshootEnable ) {
- var state = this.state,
- cur_time = getCurrentTime(),
- duration = this.duration,
- elapsed = cur_time - this.startTime,
- dx,
- x,
- didOverShoot;
+ this.index++;
- if ( state === tstates.done ) {
- return this.pos;
- }
+ if ( this.next_img.length ) {
+ this._moveLeft( this.next_img , this.window_width + 'px' );
+ this._attach( this.index + 1, this.next_img );
+ }
- elapsed = elapsed > duration ? duration : elapsed;
+ this.direction = 1;
- this.remained = duration - elapsed;
+ } else if ( delta < 0 && this.prev_img.length ) {
+ /* prev */
+ this._detach( this.index + 1, this.next_img );
- if ( state === tstates.scrolling || state === tstates.overshot ) {
- dx = this.speed *
- ( 1 - $.easing[this.easing]( elapsed / duration,
- elapsed, 0, 1, duration ) );
+ this.next_img = this.cur_img;
+ this.cur_img = this.prev_img;
+ this.prev_img = this.prev_img.prev();
- x = this.pos + dx;
+ this.index--;
- didOverShoot = ( state === tstates.scrolling ) &&
- ( x < this.minPos || x > this.maxPos );
+ if ( this.prev_img.length ) {
+ this._moveLeft( this.prev_img , -this.window_width + 'px' );
+ this._attach( this.index - 1, this.prev_img );
+ }
- if ( didOverShoot ) {
- x = ( x < this.minPos ) ? this.minPos : this.maxPos;
+ this.direction = -1;
}
+ }
- this.pos = x;
+ sec = this.options.duration;
+ self = this;
- if ( state === tstates.overshot ) {
- if ( !overshootEnable ) {
- this.state = tstates.done;
- }
- if ( elapsed >= duration ) {
- this.state = tstates.snapback;
- this.fromPos = this.pos;
- this.toPos = ( x < this.minPos ) ?
- this.minPos : this.maxPos;
- this.duration = this.options.snapbackDuration;
- this.startTime = cur_time;
- elapsed = 0;
- }
- } else if ( state === tstates.scrolling ) {
- if ( didOverShoot && overshootEnable ) {
- this.state = tstates.overshot;
- this.speed = dx / 2;
- this.duration = this.options.overshootDuration;
- this.startTime = cur_time;
- } else if ( elapsed >= duration ) {
- this.state = tstates.done;
- }
+ this.moving = true;
+
+ setTimeout( function () {
+ self.moving = false;
+ }, sec - 25 );
+
+ this._moveLeft( this.cur_img, 0 + 'px', sec );
+ if ( this.next_img.length ) {
+ this._moveLeft( this.next_img, this.window_width + 'px', sec );
+ }
+ if ( this.prev_img.length ) {
+ this._moveLeft( this.prev_img, -this.window_width + 'px', sec );
+ }
+ },
+
+ _add_event: function () {
+ var self = this,
+ date;
+
+ this.container.bind( 'vmousemove', function ( e ) {
+ e.preventDefault();
+
+ if ( self.moving ) {
+ return;
}
- } else if ( state === tstates.snapback ) {
- if ( elapsed >= duration ) {
- this.pos = this.toPos;
- this.state = tstates.done;
- } else {
- this.pos = this.fromPos + (( this.toPos - this.fromPos ) *
- $.easing[this.easing]( elapsed / duration,
- elapsed, 0, 1, duration ));
+ if ( !self.dragging ) {
+ return;
+ }
+
+ self._drag( e.pageX );
+ } );
+
+ this.container.bind( 'vmousedown', function ( e ) {
+ e.preventDefault();
+
+ if ( self.moving ) {
+ return;
+ }
+
+ self.dragging = true;
+
+ self.org_x = e.pageX;
+
+ self.org_time = Date.now();
+ } );
+
+ this.container.bind( 'vmouseup', function ( e ) {
+ if ( self.moving ) {
+ return;
+ }
+
+ self.dragging = false;
+
+ self._move( e.pageX );
+ } );
+
+ this.container.bind( 'vmouseout', function ( e ) {
+ if ( self.moving ) {
+ return;
+ }
+ if ( !self.dragging ) {
+ return;
+ }
+
+ if ( ( e.pageX < 20 ) ||
+ ( e.pageX > ( self.max_width - 20 ) ) ) {
+ self._move( e.pageX );
+ self.dragging = false;
}
+ } );
+ },
+
+ _del_event: function () {
+ this.container.unbind( 'vmousemove' );
+ this.container.unbind( 'vmousedown' );
+ this.container.unbind( 'vmouseup' );
+ this.container.unbind( 'vmouseout' );
+ },
+ _moveLeft : function ( $ele , value , duration) {
+ var translate,
+ transition = "",
+ cssArray = null;
+
+ if ( $.support.cssTransform3d ) {
+ translate = "translate3d(" + value + ", 0px, 0px)";
+ } else {
+ translate = "translate(" + value + ", 0px)";
+ }
+ if( !duration || duration !== undefined ) {
+ transition = "-webkit-transform " + (duration / 1000)+ "s ease";
+ }
+ cssArray = {"-moz-transform": translate,
+ "-webkit-transform": translate,
+ "-ms-transform": translate,
+ "-o-transform": translate,
+ "transform": translate};
+ if( transition !== "" ) {
+ cssArray["-webkit-transition"] = transition ;
}
- return this.pos;
+ $ele.css(cssArray);
+ return $ele;
},
+ _show: function () {
+ /* resizing */
+ this.window_width = $( window ).width();
+ this.max_width = this._get_width();
+ this.max_height = this._get_height();
+ this.container.css( 'height', this.max_height );
- done: function () {
- return this.state === tstates.done;
+ this.cur_img = $( 'div' ).find( '.ui-gallery-bg:eq(' + this.index + ')' );
+ this.prev_img = this.cur_img.prev();
+ this.next_img = this.cur_img.next();
+
+ this._attach( this.index - 1, this.prev_img );
+ this._attach( this.index, this.cur_img );
+ this._attach( this.index + 1, this.next_img );
+
+ if ( this.prev_img.length ) {
+ this._moveLeft( this.prev_img, -this.window_width + 'px');
+ }
+
+ this._moveLeft( this.cur_img, '0px');
+ if ( this.next_img.length ) {
+ this._moveLeft( this.next_img, this.window_width + 'px' );
+ }
},
- isMin: function () {
- return this.pos === this.minPos;
+ show: function () {
+ if ( !this.images.length ) {
+ return;
+ }
+
+ this._show();
+ this._add_event();
},
- isMax: function () {
- return this.pos === this.maxPos;
+ _hide: function () {
+ this._detach( this.index - 1, this.prev_img );
+ this._detach( this.index, this.cur_img );
+ this._detach( this.index + 1, this.next_img );
},
- isAvail: function () {
- return !( this.minPos === this.maxPos );
+ hide: function () {
+ this._hide();
+ this._del_event();
},
- getRemained: function () {
- return this.remained;
+ _get_width: function () {
+ return $( this.element ).width();
},
- getPosition: function () {
- return this.pos;
- }
- });
+ _get_height: function () {
+ var $page = $( this.element ).parentsUntil( 'ui-page' ),
+ $content = $page.children( '.ui-content' ),
+ header_h = $page.children( '.ui-header' ).outerHeight() || 0,
+ footer_h = $page.children( '.ui-footer' ).outerHeight() || 0,
+ padding = parseFloat( $content.css( 'padding-top' ) )
+ + parseFloat( $content.css( 'padding-bottom' ) ),
+ content_h = $( window ).height() - header_h - footer_h - padding;
- $( document ).bind( 'pagecreate create', function ( e ) {
- var $page = $( e.target ),
- content_scroll = $page.find(".ui-content").jqmData("scroll");
+ return content_h;
+ },
- /* content scroll */
- if ( $.support.scrollview === undefined ) {
- $.support.scrollview = true;
- }
+ _create: function () {
+ var temp_img,
+ self = this,
+ index,
+ i = 0;
- if ( $.support.scrollview === true && content_scroll === undefined ) {
- content_scroll = "y";
- }
+ $( this.element ).wrapInner( '<div class="ui-gallery"></div>' );
+ $( this.element ).find( 'img' ).wrap( '<div class="ui-gallery-bg"></div>' );
- if ( content_scroll !== "y" ) {
- content_scroll = "none";
- }
+ this.container = $( this.element ).find('.ui-gallery');
- $page.find(".ui-content").attr( "data-scroll", content_scroll );
+ temp_img = $( 'div' ).find( '.ui-gallery-bg:first' );
- $page.find(":jqmData(scroll)").not(".ui-scrollview-clip").each( function () {
- if ( $( this ).hasClass("ui-scrolllistview") ) {
- $( this ).scrolllistview();
- } else {
- var st = $( this ).jqmData("scroll"),
- dir = st && ( st.search(/^[xy]/) !== -1 ) ? st : null,
- content = $(this).hasClass("ui-content"),
- opts;
+ while ( temp_img.length ) {
+ this.images[i] = temp_img.find( 'img' );
+ temp_img = temp_img.next();
+ i++;
+ }
- if ( st === "none" ) {
- return;
- }
+ this._detach_all();
- opts = {
- direction: dir || undefined,
- overflowEnable: content,
- scrollMethod: $( this ).jqmData("scroll-method") || undefined,
- scrollJump: $( this ).jqmData("scroll-jump") || undefined
- };
+ index = parseInt( $( this.element ).jqmData( 'index' ), 10 );
+ if ( !index ) {
+ index = 0;
+ }
+ if ( index < 0 ) {
+ index = 0;
+ }
+ if ( index >= this.images.length ) {
+ index = this.images.length - 1;
+ }
- $( this ).scrollview( opts );
+ this.index = index;
+
+ this.align_type = $( this.element ).jqmData( 'vertical-align' );
+
+ $( window ).bind( 'resize', function () {
+ self.refresh();
+ });
+ },
+
+ _update: function () {
+ var image_file,
+ bg_html,
+ temp_img;
+
+ while ( this.images_hold.length ) {
+ image_file = this.images_hold.shift();
+
+ bg_html = $( '<div class="ui-gallery-bg"></div>' );
+ temp_img = $( '<img src="' + image_file + '"></div>' );
+
+ bg_html.append( temp_img );
+ this.container.append( bg_html );
+ this.images.push( temp_img );
}
- });
- });
- $( document ).bind( 'pageshow', function ( e ) {
- var $page = $( e.target ),
- scroll = $page.find(".ui-content").jqmData("scroll");
+ this._detach_all();
+ },
- if ( scroll === "y" ) {
- resizePageContentHeight( e.target );
- }
- });
+ refresh: function ( start_index ) {
+ this._update();
-}( jQuery, window, document ) );
-/*global Globalize:false, range:false, regexp:false*/
-/*
- * jQuery Mobile Widget @VERSION
- *
- * This software is licensed under the MIT licence (as defined by the OSI at
- * http://www.opensource.org/licenses/mit-license.php)
- *
- * ***************************************************************************
- * Copyright (C) 2011 by Intel Corporation Ltd.
+ this._hide();
+
+ if ( start_index === undefined ) {
+ start_index = this.index;
+ }
+ if ( start_index < 0 ) {
+ start_index = 0;
+ }
+ if ( start_index >= this.images.length ) {
+ start_index = this.images.length - 1;
+ }
+
+ this.index = start_index;
+
+ this._show();
+
+ return this.index;
+ },
+
+ add: function ( file ) {
+ this.images_hold.push( file );
+ },
+
+ remove: function ( index ) {
+ var temp_img;
+
+ if ( index === undefined ) {
+ index = this.index;
+ }
+
+ if ( index < 0 || index >= this.images.length ) {
+ return;
+ }
+
+ if ( index == this.index ) {
+ temp_img = this.cur_img;
+
+ if ( this.index == 0 ) {
+ this.direction = 1;
+ } else if ( this.index == this.images.length - 1 ) {
+ this.direction = -1;
+ }
+
+ if ( this.direction < 0 ) {
+ this.cur_img = this.prev_img;
+ this.prev_img = this.prev_img.prev();
+ if ( this.prev_img.length ) {
+ this._moveLeft( this.prev_img, -this.window_width);
+ this._attach( index - 2, this.prev_img );
+ }
+ this.index--;
+ } else {
+ this.cur_img = this.next_img;
+ this.next_img = this.next_img.next();
+ if ( this.next_img.length ) {
+ this._moveLeft( this.next_img, this.window_width);
+ this._attach( index + 2, this.next_img );
+ }
+ }
+ this._moveLeft( this.cur_img, '0px', this.options.duration );
+
+ } else if ( index == this.index - 1 ) {
+ temp_img = this.prev_img;
+ this.prev_img = this.prev_img.prev();
+ if ( this.prev_img.length ) {
+ this._moveLeft( this.prev_img, -this.window_width);
+ this._attach( index - 1, this.prev_img );
+ }
+ this.index--;
+
+ } else if ( index == this.index + 1 ) {
+ temp_img = this.next_img;
+ this.next_img = this.next_img.next();
+ if ( this.next_img.length ) {
+ this._moveLeft( this.next_img, this.window_width);
+ this._attach( index + 1, this.next_img );
+ }
+
+ } else {
+ temp_img = $( 'div' ).find( '.ui-gallery-bg:eq(' + index + ')' );
+ }
+
+ this.images.splice( index, 1 );
+ temp_img.detach();
+ },
+
+ empty: function () {
+ this.images.splice( 0, this.images.length );
+ this.container.find('.ui-gallery-bg').detach();
+ },
+
+ length: function () {
+ return this.images.length;
+ },
+
+ value: function ( index ) {
+ if ( index === undefined ) {
+ return this.index;
+ }
+
+ this.refresh( index );
+ }
+ }); /* End of widget */
+
+ // auto self-init widgets
+ $( document ).bind( "pagecreate create", function ( e ) {
+ $( e.target ).find( ":jqmData(role='gallery')" ).gallery();
+ });
+
+ $( document ).bind( "pageshow", function ( e ) {
+ $( e.target ).find( ":jqmData(role='gallery')" ).gallery( 'show' );
+ });
+
+ $( document ).bind( "pagebeforehide", function ( e ) {
+ $( e.target ).find( ":jqmData(role='gallery')" ).gallery( 'hide' );
+ } );
+
+}( jQuery, this ) );
+
+
+\r
+/**\r
+ @class Checkbox\r
+ The check box widget shows a list of options on the screen where one or more can be selected. Check boxes can be used in Tizen as described in the jQueryMobile documentation for check boxes.<br/> To add a check box widget to the application, use the following code:\r
+\r
+ <input type="checkbox" name="mycheck" id="check-test" class="favorite" />\r
+ <label for="check-test">Favorite</label>\r
+ <input type="checkbox" name="check-favorite" id="check-test2" checked="checked" disabled="disabled" class="favorite" />\r
+ <label for="check-test2">Favorite Checked, Disabled</label>\r
+\r
+ The check box can define callbacks for events as described in the jQueryMobile documentation for check box events.\r
+ You can use methods with the check box as described in the jQueryMobile documentation for check box methods.\r
+\r
+*/\r
+/**\r
+ @property {String} class\r
+ Defines the check box style. <br/> The default value is check. If the value is set to favorite, a star-shaped check box is created.\r
+*/\r
+\r
+
+
+/****************************************************************************
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* DEALINGS IN THE SOFTWARE.
* ***************************************************************************
*
- * Authors: Salvatore Iovene <salvatore.iovene@intel.com>
- * Daehyon Jung <darrenh.jung@samsung.com>
- */
+ * Author: Wongi Lee <wongi11.lee@samsung.com>
+*/
/**
- * datetimepicker is a widget that lets the user select a date and/or a
- * time. If you'd prefer use as auto-initialization of form elements,
- * use input elements with type=date/time/datetime within form tag
- * as same as other form elements.
- *
+ * Extendable List Widget for unlimited data.
+ * To support more then 1,000 items, special list widget developed.
+ * Fast initialize and append some element into the DOM tree repeatedly.
+ * DB connection and works like DB cursor.
+ *
* HTML Attributes:
- *
- * data-role: 'datetimepicker'
- * data-format: date format string. e.g) "MMM dd yyyy, HH:mm"
- * type: 'date', 'datetime', 'time'
- * value: pre-set value. only accepts ISO date string. e.g) "2012-05-04", "2012-05-04T01:02:03+09:00"
- * data-date: any date/time string "new Date()" accepts.
*
- * Options:
- * type: 'date', 'datetime', 'time'
- * format: see data-format in HTML Attributes.
- * value: see value in HTML Attributes.
- * date: preset value as JavaScript Date Object representation.
+ * data-role: extendablelist
+ * data-template : jQuery.template ID that populate into extendable list. A button : a <DIV> element with "data-role : button" should be included on data-template.
+ * data-dbtable : DB Table name. It used as window[DB NAME]. Loaded data should be converted as window object.
+ * data-extenditems : Number of elements to extend at once.
+ *
+ * ID : <UL> element that has "data-role=extendablelist" must have ID attribute.
+ * Class : <UL> element that has "data-role=extendablelist" should have "vlLoadSuccess" class to guaranty DB loading is completed.
+ * tmp_load_more : Template ID for "load more" message and button.
*
- * APIs:
- * value( datestring )
- * : Set date/time to 'datestring'.
- * value()
- * : Get current selected date/time as W3C DTF style string.
- * getValue() - replaced with 'value()'
- * : same as value()
- * setValue( datestring ) - replaced with 'value(datestring)'
- * : same as value( datestring )
- * changeTypeFormat( type, format ) - deprecated
- * : Change Type and Format options. use datetimepicker( "option", "format" ) instead
*
- * Events:
- * date-changed: Raised when date/time was changed.
+ *APIs:
+ * create ( {
+ * itemData: function ( idx ) { return json_obj; },
+ * numItemData: number or function () { return number; },
+ * cacheItemData: function ( minIdx, maxIdx ) {}
+ * } )
+ * : Create a extendable list widget. At this moment, _create method is called.
+ * args : A collection of options
+ * itemData: A function that returns JSON object for given index. Mandatory.
+ * numItemData: Total number of itemData. Mandatory.
+ * cacheItemData: Extendable list will ask itemData between minIdx and maxIdx.
+ * Developers can implement this function for preparing data.
+ * Optional.
+ *
+ *Examples:
+ *
+ * <script id="tmp-3-1-1" type="text/x-jquery-tmpl">
+ * <li class="ui-li-3-1-1"><span class="ui-li-text-main">${NAME}</span></li>
+ * </script>
+ *
+ * <script id="tmp_load_more" type="text/x-jquery-tmpl">
+ * <li class="ui-li-3-1-1" style="text-align:center; margin:0 auto">
+ * <div data-role="button">Load ${NUM_MORE_ITEMS} more items</div>
+ * </li>
+ * </script>
+ *
+ * <ul id = "extendable_list_main" data-role="extendablelist" data-extenditems="50" data-template="tmp-3-1-1">
+ * </ul>
*
- * Examples:
- * <ul data-role="listview">
- * <li class="ui-li-3-2-2">
- * <span class="ui-li-text-main">
- * <input type="datetime" name="demo-date" id="demo-date"
- * data-format="MMM dd yyyy hh:mm tt"/>
- * </span>
- * <span class="ui-li-text-sub">
- * Date/Time Picker - <span id="selected-date1"><em>(select a date first)</em></span>
- * </span>
- * </li>
- * <li class="ui-li-3-2-2">
- * <span class="ui-li-text-main">
- * <input type="date" name="demo-date2" id="demo-date2"/>
- * </span>
- * <span class="ui-li-text-sub">
- * Date Picker - <span id="selected-date2"><em>(select a date first)</em></span>
- * </span>
- * </li>
- * <li class="ui-li-3-2-2">
- * <span class="ui-li-text-main">
- * <input type="time" name="demo-date3" id="demo-date3"/>
- * </span>
- * <span class="ui-li-text-sub">
- * Time Picker - <span id="selected-date3"><em>(select a date first)</em></span>
- * </span>
- * </li>
- * </ul>
- * How to get a return value:
- * ==========================
- * Bind to the 'date-changed' event, e.g.:
- * $("#myDatetimepicker").bind("date-changed", function(e, date) {
- * alert("New date: " + date.toString());
- * });
*/
/**
- @class DateTimePicker
- The picker widgets show a control that you can use to enter date and time values. <br/> To add a date time picker widget to the application, use the following code:
+ @class Extendablelist
+ In the Web environment, it is challenging to display a large amount of data in a list, such as displaying a contact list of over 1000 list items. It takes time to display the entire list in HTML and the DOM manipulation is complex.
+ The extendable list widget is used to display a list of unlimited data elements on the screen for better performance. The list is extended if you click the button at the bottom of the list to load more data elements. Extendable lists are based on the jQuery.template plugin as described in the jQuery documentation for jQuery.template plugin.<br/>
+ To add a extendable list widget to the application, use the following code:
- <li class="ui-li-dialogue ui-datetime">
- <div class="ui-datetime-text-main">
- <input type="datetime" data-format="MMM dd yyyy hh:mm:ss" name="demo-date" id="demo-date" />
- </div>
- <div class="ui-li-text-sub">Date/Time Picker
- <span id="selected-date1"><em>(select a date first)</em></span>
- </div>
- </li>
+ <script id="tmp-3-1-1" type="text/x-jquery-tmpl">
+ <li class="ui-li-3-1-1"><span class="ui-li-text-main">${NAME}</span></li>
+ </script>
+ <script id="tmp_load_more" type="text/x-jquery-tmpl">
+ <li class="ui-li-3-1-1" style="text-align:center; margin:0 auto">
+ <div data-role="button">Load ${NUM_MORE_ITEMS} more items</div>
+ </li>
+ </script>
+ <ul id="extendable_list_main" data-role="extendablelist" data-extenditems="50" data-template="tmp-3-1-1">
+ </ul>
*/
+/**
+ @property {String} data-role
+ Creates the extendable list view. The value must be set to extendablelist. Only the <ul> element, which a id attribute defined, supports this option. Also, the elLoadSuccess class attribute must be defined in the <ul> element to ensure that loading data from the database is complete.
+*/
+/**
+ @property {String} data-template
+ Specifies the jQuery.template element ID. The jQuery.template must be defined. The template style can use rem units to support scalability. For using the button at the bottom of the list to load more data elements, there must be list view template with the button. The attribute ID must be tmp_load_more.
+*/
+/**
+ @property {Integer} data-extenditems
+ Defines the number of data elements to be extended at a time.
+*/
+( function ( $, undefined ) {
+ //Keeps track of the number of lists per page UID
+ //This allows support for multiple nested list in the same page
+ //https://github.com/jquery/jquery-mobile/issues/1617
+ var listCountPerPage = {};
-( function ( $, window, undefined ) {
- $.widget( "tizen.datetimepicker", $.tizen.widgetex, {
-
+ $.widget( "tizen.extendablelist", $.mobile.widget, {
options: {
- type: null, // date, time, datetime applicable
- format: null,
- date: null,
- initSelector: "input[type='date'], input[type='datetime'], input[type='time'], :jqmData(role='datetimepicker')"
+ theme: "s",
+ countTheme: "c",
+ headerTheme: "b",
+ dividerTheme: "b",
+ splitIcon: "arrow-r",
+ splitTheme: "b",
+ inset: false,
+ id: "", /* Extendable list UL elemet's ID */
+ extenditems: 50, /* Number of append items */
+ childSelector: " li", /* To support swipe list */
+ dbtable: "",
+ template : "", /* Template for each list item */
+ loadmore : "tmp_load_more", /* Template for "Load more" message */
+ scrollview: false,
+ initSelector: ":jqmData(role='extendablelist')"
},
- _calendar: function () {
- return window.Globalize.culture().calendars.standard;
+ _stylerMouseUp: function () {
+ $( this ).addClass( "ui-btn-up-s" );
+ $( this ).removeClass( "ui-btn-down-s" );
},
- _value: {
- attr: "data-" + ( $.mobile.ns || "" ) + "date",
- signal: "date-changed"
+ _stylerMouseDown: function () {
+ $( this ).addClass( "ui-btn-down-s" );
+ $( this ).removeClass( "ui-btn-up-s" );
},
- _daysInMonth: [ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ],
-
- _isLeapYear: function ( year ) {
- return year % 4 ? 0 : ( year % 100 ? 1 : ( year % 400 ? 0 : 1 ) );
+ _stylerMouseOver: function () {
+ $( this ).toggleClass( "ui-btn-hover-s" );
},
- _makeTwoDigits: function ( val ) {
- var ret = val.toString(10);
- if ( val < 10 ) {
- ret = "0" + ret;
- }
- return ret;
+ _stylerMouseOut: function () {
+ $( this ).toggleClass( "ui-btn-hover-s" );
+ $( this ).addClass( "ui-btn-up-s" );
+ $( this ).removeClass( "ui-btn-down-s" );
},
- _setType: function ( type ) {
- //datetime, date, time
- switch (type) {
- case 'datetime':
- case 'date':
- case 'time':
- this.options.type = type;
- break;
- default:
- this.options.type = 'datetime';
- break;
- }
+ _pushData: function ( template ) {
+ var o = this.options,
+ t = this,
+ i = 0,
+ myTemplate = $( "#" + template ),
+ loadMoreItems = ( o.extenditems > t._numItemData - t._lastIndex ? t._numItemData - t.lastIndex : o.extenditems ),
+ htmlData;
- this.element.attr( "data-" + ( $.mobile.ns ? $.mobile.ns + "-" : "" ) + "type", this.options.type );
- return this.options.type;
- },
+ for (i = 0; i < loadMoreItems; i++ ) {
+ htmlData = myTemplate.tmpl( t._itemData( i ) );
+ $( o.id ).append( $( htmlData ).attr( 'id', 'li_' + i ) );
- _setFormat: function ( format ) {
- if ( this.options.format != format ) {
- this.options.format = format;
- } else {
- return;
+ /* Add style */
+ $( o.id + ">" + o.childSelector )
+ .addClass( "ui-btn-up-s" )
+ .bind( "mouseup", t._stylerMouseUp )
+ .bind( "mousedown", t._stylerMouseDown )
+ .bind( "mouseover", t._stylerMouseOver )
+ .bind( "mouseout", t._stylerMouseOut );
+
+ t._lastIndex += 1;
}
- this.ui.children().remove();
+ /* After push data, re-style extendable list widget */
+ $( o.id ).trigger( "create" );
+ },
- var token = this._parsePattern( format ),
- div = document.createElement('div'),
- pat,
- tpl,
- period,
- btn,
- obj = this;
+ _loadmore: function ( event ) {
+ var t = event.data, // <li> element
+ o = t.options,
+ i = 0,
+ myTemplate = $( "#" + o.template ),
+ loadMoreItems = ( o.extenditems > t._numItemData - t._lastIndex ? t._numItemData - t._lastIndex : o.extenditems ),
+ htmlData,
+ more_items_to_load,
+ num_next_load_items;
- while ( token.length > 0 ) {
- pat = token.shift();
- tpl = '<span class="ui-datefield-%1" data-pat="' + pat + '">%2</span>';
- switch ( pat ) {
- case 'H': //0 1 2 3 ... 21 22 23
- case 'HH': //00 01 02 ... 21 22 23
- case 'h': //0 1 2 3 ... 11 12
- case 'hh': //00 01 02 ... 11 12
- $(div).append( tpl.replace('%1', 'hour') );
- break;
- case 'mm': //00 01 ... 59
- case 'm': //0 1 2 ... 59
- if ( this.options.type == 'date' ) {
- $(div).append( tpl.replace('%1', 'month') );
- } else {
- $(div).append( tpl.replace('%1', 'min') );
- }
- break;
- case 'ss':
- case 's':
- $(div).append( tpl.replace('%1', 'sec') );
- break;
- case 'd': // day of month 5
- case 'dd': // day of month(leading zero) 05
- $(div).append( tpl.replace('%1', 'day') );
- break;
- case 'M': // Month of year 9
- case 'MM': // Month of year(leading zero) 09
- case 'MMM':
- case 'MMMM':
- $(div).append( tpl.replace('%1', 'month') );
- break;
- case 'yy': // year two digit
- case 'yyyy': // year four digit
- $(div).append( tpl.replace('%1', 'year') );
- break;
- case 't': //AM / PM indicator(first letter) A, P
- // add button
- case 'tt': //AM / PM indicator AM/PM
- // add button
- btn = '<a href="#" class="ui-datefield-period"' +
- ' data-role="button" data-inline="true">period</a>';
- $(div).append( btn );
- break;
- case 'g':
- case 'gg':
- $(div).append( tpl.replace('%1', 'era').replace('%2', this._calendar().eras.name) );
- break;
- case '\t':
- $(div).append( tpl.replace('%1', 'tab').replace('%2', pat) );
- break;
- default : // string or any non-clickable object
- $(div).append( tpl.replace('%1', 'seperator').replace('%2', pat) );
- break;
- }
- }
+ /* Remove load more message */
+ $( "#load_more_message" ).remove();
- this.ui.append( div );
- if ( this.options.date ) {
- this._setDate( this.options.date );
+ /* Append More Items */
+ for ( i = 0; i < loadMoreItems; i++ ) {
+ htmlData = myTemplate.tmpl( t._itemData( t._lastIndex ) );
+ $( o.id ).append( $( htmlData ).attr( 'id', 'li_' + t._lastIndex ) );
+ t._lastIndex += 1;
}
- this.ui.find('.ui-datefield-period').buttonMarkup().bind( 'vclick', function ( e ) {
- obj._switchAmPm( obj );
- });
+ /* Append "Load more" message on the last of list */
+ if ( t._numItemData > t._lastIndex ) {
+ myTemplate = $( "#" + o.loadmore );
+ more_items_to_load = t._numItemData - t._lastIndex;
+ num_next_load_items = ( o.extenditems <= more_items_to_load ) ? o.extenditems : more_items_to_load;
+ htmlData = myTemplate.tmpl( { NUM_MORE_ITEMS : num_next_load_items } );
+ // Button minimum height(37px)
+ $( o.id ).append( $( htmlData ).attr( 'id', "load_more_message" ).css( 'min-height' , "37px") );
+ }
- this.element.attr( "data-" + ( $.mobile.ns ? $.mobile.ns + "-" : "" ) + "format", this.options.format );
- return this.options.format;
+ $( o.id ).trigger( "create" );
+ $( o.id ).extendablelist( "refresh" );
},
- _setDate: function ( newdate ) {
- if ( typeof ( newdate ) == "string" ) {
- newdate = new Date( newdate );
- }
+ recreate: function ( newArray ) {
+ this._create( {
+ itemData: function ( idx ) { return newArray[ idx ]; },
+ numItemData: newArray.length
+ } );
+ },
- var fields = $('span,a', this.ui),
- type,
- fn,
- $field,
- btn,
- i;
+ _initList: function (args ) {
+ var t = this,
+ o = this.options,
+ myTemplate,
+ more_items_to_load,
+ num_next_load_items,
+ htmlData;
- function getMonth() {
- return newdate.getMonth() + 1;
- }
+ /* Make Gen list by template */
+ if ( t._lastIndex <= 0 ) {
+ t._pushData( o.template );
- for ( i = 0; i < fields.length; i++ ) {
- $field = $(fields[i]);
- type = $field.attr("class").match(/ui-datefield-([\w]*)/);
- if ( !type ) {
- type = "";
- }
- switch ( type[1] ) {
- case 'hour':
- fn = newdate.getHours;
- break;
- case 'min':
- fn = newdate.getMinutes;
- break;
- case 'sec':
- fn = newdate.getSeconds;
- break;
- case 'year':
- fn = newdate.getFullYear;
- break;
- case 'month':
- fn = getMonth;
- break;
- case 'day':
- fn = newdate.getDate;
- break;
- case 'period':
- fn = newdate.getHours() < 12 ? this._calendar().AM[0] : this._calendar().PM[0];
- btn = $field.find( '.ui-btn-text' );
- if ( btn.length == 0 ) {
- $field.text(fn);
- } else if ( btn.text() != fn ) {
- btn.text( fn );
- }
- fn = null;
- break;
- default:
- fn = null;
- break;
- }
- if ( fn ) {
- this._updateField( $field, fn.call( newdate ) );
+ /* Append "Load more" message on the last of list */
+ if ( t._numItemData > t._lastIndex ) {
+ myTemplate = $( "#" + o.loadmore );
+ more_items_to_load = t._numItemData - t._lastIndex;
+ num_next_load_items = ( o.extenditems <= more_items_to_load) ? o.extenditems : more_items_to_load;
+ htmlData = myTemplate.tmpl( { NUM_MORE_ITEMS : num_next_load_items } );
+ // Button minimum height(37px)
+ $( o.id ).append( $( htmlData ).attr( 'id', "load_more_message" ).css( 'min-height' , "37px") );
+
+ $( "#load_more_message" ).live( "click", t, t._loadmore );
+ } else {
+ /* No more items to load */
+ $( "#load_more_message" ).die();
+ $( "#load_more_message" ).remove();
}
}
- this.options.date = newdate;
+ if ( o.childSelector == " ul" ) {
+ $( o.id + " ul" ).swipelist();
+ }
- this._setValue( newdate );
+ $( o.id ).trigger( "create" );
- this.element.attr( "data-" + ( $.mobile.ns ? $.mobile.ns + "-" : "" ) + "date", this.options.date );
- return this.options.date;
+ t.refresh( true );
},
- destroy: function () {
- if ( this.ui ) {
- this.ui.remove();
- }
+ create: function () {
+ var o = this.options;
- if ( this.element ) {
- this.element.show();
- }
+ /* external API for AJAX callback */
+ this._create.apply( this, arguments );
},
- value: function ( val ) {
- function timeStr( t, obj ) {
- return obj._makeTwoDigits( t.getHours() ) + ':' +
- obj._makeTwoDigits( t.getMinutes() ) + ':' +
- obj._makeTwoDigits( t.getSeconds() );
- }
+ _create: function ( args ) {
+ var t = this,
+ o = this.options,
+ $el = this.element,
+ dbtable_name;
- function dateStr( d, obj ) {
- return ( ( d.getFullYear() % 10000 ) + 10000 ).toString().substr(1) + '-' +
- obj._makeTwoDigits( d.getMonth() + 1 ) + '-' +
- obj._makeTwoDigits( d.getDate() );
- }
- var rvalue = null;
- if ( val ) {
- rvalue = this._setDate( val );
- } else {
- switch ( this.options.type ) {
- case 'time':
- rvalue = timeStr( this.options.date, this );
- break;
- case 'date':
- rvalue = dateStr( this.options.date, this );
- break;
- default:
- rvalue = dateStr( this.options.date, this ) + 'T' + timeStr( this.options.date, this );
- break;
- }
- }
- return rvalue;
- },
+ t.destroy();
- setValue: function ( newdate ) {
- console.warn( "setValue was deprecated. use datetimepicker('option', 'date', value) instead." );
- return this.value( newdate );
- },
+ $.extend(this, {
+ _itemData: function ( idx ) { return null; },
+ _numItemData: 0,
+ _cacheItemData: function ( minIdx, maxIdx ) { },
+ _lastIndex: 0
+ });
- /**
- * return W3C DTF string
- */
- getValue: function () {
- console.warn("getValue() was deprecated. use datetimepicker('value') instead.");
- return this.value();
- },
- _updateField: function ( target, value ) {
- if ( !target || target.length == 0 ) {
- return;
- }
+ // create listview markup
+ t.element.addClass( function ( i, orig ) {
+ return orig + " ui-listview ui-extendable-list-container" + ( t.options.inset ? " ui-listview-inset ui-corner-all ui-shadow " : "" );
+ });
- if ( value == 0 ) {
- value = "0";
+ o.id = "#" + $el.attr( "id" );
+
+ if ( $el.data( "extenditems" ) ) {
+ o.extenditems = parseInt( $el.data( "extenditems" ), 10 );
}
- var pat = target.jqmData( 'pat' ),
- hour,
- text,
- self = this;
+ $( o.id ).bind( "pagehide", function (e) {
+ $( o.id ).empty();
+ });
- switch ( pat ) {
- case 'H':
- case 'HH':
- case 'h':
- case 'hh':
- hour = value;
- if ( pat.charAt(0) == 'h' ) {
- if ( hour > 12 ) {
- hour -= 12;
- } else if ( hour == 0 ) {
- hour = 12;
- }
- }
- hour = this._makeTwoDigits( hour );
- text = hour;
- break;
- case 'm':
- case 'M':
- case 'd':
- case 's':
- text = value;
- break;
- case 'mm':
- case 'dd':
- case 'MM':
- case 'ss':
- text = this._makeTwoDigits( value );
- break;
- case 'MMM':
- text = this._calendar().months.namesAbbr[ value - 1];
- break;
- case 'MMMM':
- text = this._calendar().months.names[ value - 1 ];
- break;
- case 'yy':
- text = this._makeTwoDigits( value % 100 );
- break;
- case 'yyyy':
- if ( value < 10 ) {
- value = '000' + value;
- } else if ( value < 100 ) {
- value = '00' + value;
- } else if ( value < 1000 ) {
- value = '0' + value;
- }
- text = value;
- break;
+ /* Scroll view */
+ if ( $( ".ui-scrollview-clip" ).size() > 0) {
+ o.scrollview = true;
+ } else {
+ o.scrollview = false;
}
- // to avoid reflow where its value isn't out-dated
- if ( target.text() != text ) {
- if ( target.hasClass("ui-datefield-selected") ) {
- target.addClass("out");
- this._new_value = text;
+ if ( args ) {
+ if ( !t._loadData( args ) ) {
+ return;
+ }
+ } else {
+ // Legacy support: dbtable
+ console.warn("WARNING: The data interface of extendable list is changed. \nOld data interface(data-dbtable) is still supported, but will be removed in next version. \nPlease fix your code soon!");
- target.animationComplete( function () {
- target.text( self._new_value);
- target.addClass("in")
- .removeClass("out");
+ if ( $( o.id ).hasClass( "elLoadSuccess" ) ) {
+ dbtable_name = $el.jqmData('dbtable');
+ o.dbtable = window[ dbtable_name ];
+ if ( !(o.dbtable) ) {
+ o.dbtable = { };
+ }
+ t._itemData = function ( idx ) {
+ return o.dbtable[ idx ];
+ };
+ t._numItemData = o.dbtable.length;
- target.animationComplete( function () {
- target.removeClass("in").
- removeClass("ui-datefield-selected");
- });
- });
} else {
- target.text( text );
+ console.warn("No elLoadSuccess class");
+ return;
}
}
- },
- _switchAmPm: function ( obj ) {
- if ( this._calendar().AM != null ) {
- var date = new Date( this.options.date ),
- text,
- change = 1000 * 60 * 60 * 12;
- if ( date.getHours() > 11 ) {
- change = -change;
+ if ( $el.data( "template" ) ) {
+ o.template = $el.data( "template" );
+
+ /* to support swipe list, <li> or <ul> can be main node of extendable list. */
+ if ( $el.data( "swipelist" ) == true ) {
+ o.childSelector = " ul";
+ } else {
+ o.shildSelector = " li";
}
- date.setTime( date.getTime() + change );
- this._setDate( date );
}
+ t._initList( args );
},
- _parsePattern: function ( pattern ) {
- var regex = /\/|\s|dd|d|MMMM|MMM|MM|M|yyyy|yy|y|hh|h|HH|H|mm|m|ss|s|tt|t|f|gg|g|\'[\w\W]*\'$|[\w\W]/g,
- matches,
- i;
-
- matches = pattern.match( regex );
+ _loadData : function ( args ) {
+ var self = this;
- for ( i = 0; i < matches.length; i++ ) {
- if ( matches[i].charAt(0) == "'" ) {
- matches[i] = matches[i].substr( 1, matches[i].length - 2 );
+ if ( args.itemData && typeof args.itemData == 'function' ) {
+ self._itemData = args.itemData;
+ } else {
+ return false;
+ }
+ if ( args.numItemData ) {
+ if ( typeof args.numItemData == 'function' ) {
+ self._numItemData = args.numItemData( );
+ } else if ( typeof args.numItemData == 'number' ) {
+ self._numItemData = args.numItemData;
+ } else {
+ return false;
}
+ } else {
+ return false;
}
+ return true;
+ },
- return matches;
+
+ destroy : function () {
+ var o = this.options,
+ eOTAL_ITEMS = 0,
+ last_index = 0;
+
+ $( o.id ).empty();
+
+ $( "#load_more_message" ).die();
},
- changeTypeFormat: function ( type, format ) {
- console.warn('changeTypeFormat() was deprecated. use datetimepicker("option", "type"|"format", value) instead');
- if ( type ) {
- this._setType( type );
+ _itemApply: function ( $list, item ) {
+ var $countli = item.find( ".ui-li-count" );
+
+ if ( $countli.length ) {
+ item.addClass( "ui-li-has-count" );
}
- if ( format ) {
- this._setFormat( format );
+ $countli.addClass( "ui-btn-up-" + ( $list.jqmData( "counttheme" ) || this.options.countTheme ) + " ui-btn-corner-all" );
+
+ // TODO class has to be defined in markup
+ item.find( "h1, h2, h3, h4, h5, h6" ).addClass( "ui-li-heading" ).end()
+ .find( "p, dl" ).addClass( "ui-li-desc" ).end()
+ .find( ">img:eq(0), .ui-link-inherit>img:eq(0)" ).addClass( "ui-li-thumb" ).each(function () {
+ item.addClass( $( this ).is( ".ui-li-icon" ) ? "ui-li-has-icon" : "ui-li-has-thumb" );
+ }).end()
+ .find( ".ui-li-aside" ).each(function () {
+ var $this = $( this );
+ $this.prependTo( $this.parent() ); //shift aside to front for css float
+ });
+ },
+
+ _removeCorners: function ( li, which ) {
+ var top = "ui-corner-top ui-corner-tr ui-corner-tl",
+ bot = "ui-corner-bottom ui-corner-br ui-corner-bl";
+
+ li = li.add( li.find( ".ui-btn-inner, .ui-li-link-alt, .ui-li-thumb" ) );
+
+ if ( which === "top" ) {
+ li.removeClass( top );
+ } else if ( which === "bottom" ) {
+ li.removeClass( bot );
+ } else {
+ li.removeClass( top + " " + bot );
}
},
- _create: function () {
- var obj = this;
+ _refreshCorners: function ( create ) {
+ var $li,
+ $visibleli,
+ $topli,
+ $bottomli;
- if ( this.element.is( "input" ) ) {
- ( function ( obj ) {
- var type, value, format;
+ if ( this.options.inset ) {
+ $li = this.element.children( "li" );
+ // at create time the li are not visible yet so we need to rely on .ui-screen-hidden
+ $visibleli = create ? $li.not( ".ui-screen-hidden" ) : $li.filter( ":visible" );
- type = obj.element.get(0).getAttribute( "type" );
- obj.options.type = type;
+ this._removeCorners( $li );
- value = obj.element.get(0).getAttribute( "value" );
- if ( value ) {
- obj.options.date = new Date( value );
- }
- }( this ) );
- }
+ // Select the first visible li element
+ $topli = $visibleli.first()
+ .addClass( "ui-corner-top" );
- if ( !this.options.format ) {
- switch ( this.options.type ) {
- case 'datetime':
- this.options.format = this._calendar().patterns.d + "\t" + this._calendar().patterns.t;
- break;
- case 'date':
- this.options.format = this._calendar().patterns.d;
- break;
- case 'time':
- this.options.format = this._calendar().patterns.t;
- break;
- }
+ $topli.add( $topli.find( ".ui-btn-inner" ) )
+ .find( ".ui-li-link-alt" )
+ .addClass( "ui-corner-tr" )
+ .end()
+ .find( ".ui-li-thumb" )
+ .not( ".ui-li-icon" )
+ .addClass( "ui-corner-tl" );
+
+ // Select the last visible li element
+ $bottomli = $visibleli.last()
+ .addClass( "ui-corner-bottom" );
+
+ $bottomli.add( $bottomli.find( ".ui-btn-inner" ) )
+ .find( ".ui-li-link-alt" )
+ .addClass( "ui-corner-br" )
+ .end()
+ .find( ".ui-li-thumb" )
+ .not( ".ui-li-icon" )
+ .addClass( "ui-corner-bl" );
}
+ },
- if ( !this.options.date ) {
- this.options.date = new Date();
+ refresh: function ( create ) {
+ this.parentPage = this.element.closest( ".ui-page" );
+ this._createSubPages();
+
+ var o = this.options,
+ $list = this.element,
+ self = this,
+ dividertheme = $list.jqmData( "dividertheme" ) || o.dividerTheme,
+ listsplittheme = $list.jqmData( "splittheme" ),
+ listspliticon = $list.jqmData( "spliticon" ),
+ li = $list.children( "li" ),
+ counter = $.support.cssPseudoElement || !$.nodeName( $list[ 0 ], "ol" ) ? 0 : 1,
+ item,
+ itemClass,
+ itemTheme,
+ a,
+ last,
+ splittheme,
+ countParent,
+ icon,
+ pos,
+ numli;
+
+ if ( counter ) {
+ $list.find( ".ui-li-dec" ).remove();
}
- this.element.hide();
- this.ui = $('<div class="ui-datefield"></div>');
- $(this.element).after( this.ui );
+ for ( pos = 0, numli = li.length; pos < numli; pos++ ) {
+ item = li.eq( pos );
+ itemClass = "ui-li";
- this._popup_open = false;
- this.ui.bind('vclick', function ( e ) {
- obj._showDataSelector( obj, this, e.target );
- });
- },
+ // If we're creating the element, we update it regardless
+ if ( create || !item.hasClass( "ui-li" ) ) {
+ itemTheme = item.jqmData( "theme" ) || o.theme;
+ a = item.children( "a" );
- _populateDataSelector: function ( field, pat ) {
- var values,
- numItems,
- current,
- data,
- range = window.range,
- local,
- yearlb,
- yearhb,
- day;
+ if ( a.length ) {
+ icon = item.jqmData( "icon" );
+
+ item.buttonMarkup({
+ wrapperEls: "div",
+ shadow: false,
+ corners: false,
+ iconpos: "right",
+ /* icon: a.length > 1 || icon === false ? false : icon || "arrow-r",*/
+ icon: false, /* Remove unnecessary arrow icon */
+ theme: itemTheme
+ });
+
+ if ( ( icon != false ) && ( a.length == 1 ) ) {
+ item.addClass( "ui-li-has-arrow" );
+ }
+
+ a.first().addClass( "ui-link-inherit" );
+
+ if ( a.length > 1 ) {
+ itemClass += " ui-li-has-alt";
+
+ last = a.last();
+ splittheme = listsplittheme || last.jqmData( "theme" ) || o.splitTheme;
+
+ last.appendTo(item)
+ .attr( "title", last.getEncodedText() )
+ .addClass( "ui-li-link-alt" )
+ .empty()
+ .buttonMarkup({
+ shadow: false,
+ corners: false,
+ theme: itemTheme,
+ icon: false,
+ iconpos: false
+ })
+ .find( ".ui-btn-inner" )
+ .append(
+ $( "<span />" ).buttonMarkup( {
+ shadow : true,
+ corners : true,
+ theme : splittheme,
+ iconpos : "notext",
+ icon : listspliticon || last.jqmData( "icon" ) || o.splitIcon
+ })
+ );
+ }
+ } else if ( item.jqmData( "role" ) === "list-divider" ) {
+
+ itemClass += " ui-li-divider ui-btn ui-bar-" + dividertheme;
+ item.attr( "role", "heading" );
+
+ //reset counter when a divider heading is encountered
+ if ( counter ) {
+ counter = 1;
+ }
- switch ( field ) {
- case 'hour':
- if ( pat == 'H' || pat == 'HH' ) {
- // twentyfour
- values = range( 0, 23 );
- data = range( 0, 23 );
- current = this.options.date.getHours();
- } else {
- values = range( 1, 12 );
- current = this.options.date.getHours() - 1;//11
- if ( current >= 11 ) {
- current = current - 12;
- data = range( 13, 23 );
- data.push( 12 ); // consider 12:00 am as 00:00
} else {
- data = range( 1, 11 );
- data.push( 0 );
- }
- if ( current < 0 ) {
- current = 11; // 12:00 or 00:00
+ itemClass += " ui-li-static ui-body-" + itemTheme;
}
}
- if ( pat.length == 2 ) {
- // two digit
- values = values.map( this._makeTwoDigits );
- }
- numItems = values.length;
- break;
- case 'min':
- case 'sec':
- values = range( 0, 59 );
- if ( pat.length == 2 ) {
- values = values.map( this._makeTwoDigits );
- }
- data = range( 0, 59 );
- current = ( field == 'min' ? this.options.date.getMinutes() : this.options.date.getSeconds() );
- numItems = values.length;
- break;
- case 'year':
- yearlb = 1900;
- yearhb = 2100;
- data = range( yearlb, yearhb );
- current = this.options.date.getFullYear() - yearlb;
- values = range( yearlb, yearhb );
- numItems = values.length;
- break;
- case 'month':
- switch ( pat.length ) {
- case 1:
- values = range( 1, 12 );
- break;
- case 2:
- values = range( 1, 12 ).map( this._makeTwoDigits );
- break;
- case 3:
- values = this._calendar().months.namesAbbr.slice();
- break;
- case 4:
- values = this._calendar().months.names.slice();
- break;
- }
- if ( values.length == 13 ) { // @TODO Lunar calendar support
- if ( values[12] == "" ) { // to remove lunar calendar reserved space
- values.pop();
- }
- }
- data = range( 1, values.length );
- current = this.options.date.getMonth();
- numItems = values.length;
- break;
- case 'day':
- day = this._daysInMonth[ this.options.date.getMonth() ];
- if ( day == 28 ) {
- day += this._isLeapYear( this.options.date.getFullYear() );
- }
- values = range( 1, day );
- if ( pat.length == 2 ) {
- values = values.map( this._makeTwoDigits );
+
+ if ( counter && itemClass.indexOf( "ui-li-divider" ) < 0 ) {
+ countParent = item.is( ".ui-li-static:first" ) ? item : item.find( ".ui-link-inherit" );
+
+ countParent.addClass( "ui-li-jsnumbering" )
+ .prepend( "<span class='ui-li-dec'>" + (counter++) + ". </span>" );
}
- data = range( 1, day );
- current = this.options.date.getDate() - 1;
- numItems = day;
- break;
- }
- return {
- values: values,
- data: data,
- numItems: numItems,
- current: current
- };
+ item.add( item.children( ".ui-btn-inner" ) ).addClass( itemClass );
+
+ self._itemApply( $list, item );
+ }
+ this._refreshCorners( create );
},
- _showDataSelector: function ( obj, ui, target ) {
- target = $(target);
+ //create a string for ID/subpage url creation
+ _idStringEscape: function ( str ) {
+ return str.replace(/\W/g , "-");
- var attr = target.attr("class"),
- field = attr ? attr.match(/ui-datefield-([\w]*)/) : undefined,
- pat,
- data,
- values,
- numItems,
- current,
- valuesData,
- html,
- datans,
- $ul,
- $div,
- $ctx,
- $li,
- i,
- newLeft = 10,
- self = this;
+ },
- if ( !attr ) {
- return;
- }
- if ( !field ) {
- return;
- }
- if ( this._popup_open ) {
- return;
- }
+ _createSubPages: function () {
+ var parentList = this.element,
+ parentPage = parentList.closest( ".ui-page" ),
+ parentUrl = parentPage.jqmData( "url" ),
+ parentId = parentUrl || parentPage[ 0 ][ $.expando ],
+ parentListId = parentList.attr( "id" ),
+ o = this.options,
+ dns = "data-" + $.mobile.ns,
+ self = this,
+ persistentFooterID = parentPage.find( ":jqmData(role='footer')" ).jqmData( "id" ),
+ hasSubPages,
+ newRemove;
- target.not('.ui-datefield-seperator').addClass('ui-datefield-selected');
+ if ( typeof listCountPerPage[ parentId ] === "undefined" ) {
+ listCountPerPage[ parentId ] = -1;
+ }
- pat = target.jqmData('pat');
- data = obj._populateDataSelector.call( obj, field[1], pat );
+ parentListId = parentListId || ++listCountPerPage[ parentId ];
- values = data.values;
- numItems = data.numItems;
- current = data.current;
- valuesData = data.data;
+ $( parentList.find( "li>ul, li>ol" ).toArray().reverse() ).each(function ( i ) {
+ var self = this,
+ list = $( this ),
+ listId = list.attr( "id" ) || parentListId + "-" + i,
+ parent = list.parent(),
+ nodeEls,
+ title = nodeEls.first().getEncodedText(),//url limits to first 30 chars of text
+ id = ( parentUrl || "" ) + "&" + $.mobile.subPageUrlKey + "=" + listId,
+ theme = list.jqmData( "theme" ) || o.theme,
+ countTheme = list.jqmData( "counttheme" ) || parentList.jqmData( "counttheme" ) || o.countTheme,
+ newPage,
+ anchor;
- if ( values ) {
- datans = "data-" + ($.mobile.ns ? ($.mobile.ns + '-') : "") + 'val="';
- for ( i = 0; i < values.length; i++ ) {
- html += '<li><a class="ui-link" ' + datans + valuesData[i] + '">' + values[i] + '</a></li>';
- }
+ nodeEls = $( list.prevAll().toArray().reverse() );
+ nodeEls = nodeEls.length ? nodeEls : $( "<span>" + $.trim(parent.contents()[ 0 ].nodeValue) + "</span>" );
- $ul = $("<ul></ul>");
- $div = $('<div class="ui-datetimepicker-selector" data-transition="fade" data-fade="false"></div>');
- $div.append( $ul ).appendTo( ui );
- $ctx = $div.ctxpopup();
- $ctx.parents('.ui-popupwindow').addClass('ui-datetimepicker');
- $li = $(html);
- $( $li[current] ).addClass("current");
- $div.jqmData( "list", $li );
- $div.circularview();
- // cause ctxpopup forced to subtract 10
- if ( $( window ).width() / 2 < target.offset().left ) {
- newLeft = -10;
- }
- $ctx.popupwindow( 'open',
- target.offset().left + ( target.width() / 2 ) + newLeft - window.pageXOffset ,
- target.offset().top + target.height() - window.pageYOffset );
+ //define hasSubPages for use in later removal
+ hasSubPages = true;
- this._popup_open = true;
+ newPage = list.detach()
+ .wrap( "<div " + dns + "role='page' " + dns + "url='" + id + "' " + dns + "theme='" + theme + "' " + dns + "count-theme='" + countTheme + "'><div " + dns + "role='content'></div></div>" )
+ .parent()
+ .before( "<div " + dns + "role='header' " + dns + "theme='" + o.headerTheme + "'><div class='ui-title'>" + title + "</div></div>" )
+ .after( persistentFooterID ? $( "<div " + dns + "role='footer' " + dns + "id='" + persistentFooterID + "'>" ) : "" )
+ .parent()
+ .appendTo( $.mobile.pageContainer );
- $div.bind('popupafterclose', function ( e ) {
- if ( obj._reflow ) {
- $(window).unbind("resize", obj._reflow);
- obj._reflow = null;
- }
+ newPage.page();
- if ( !( target.hasClass("in") || target.hasClass("out") ) ) {
- target.removeClass("ui-datefield-selected");
- }
+ anchor = parent.find('a:first');
- $div.unbind( 'popupafterclose' );
- $ul.unbind( 'vclick' );
- $(obj).unbind( 'update' );
- $ctx.popupwindow( 'destroy' );
- $div.remove();
+ if ( !anchor.length ) {
+ anchor = $( "<a/>" ).html( nodeEls || title ).prependTo( parent.empty() );
+ }
- self._popup_open = false;
- });
+ anchor.attr( "href", "#" + id );
- $(obj).bind( 'update', function ( e, val ) {
- var date = new Date( this.options.date ),
- month,
- date_calibration = function () {
- date.setDate( 1 );
- date.setDate( date.getDate() - 1 );
- };
+ }).extendablelist();
- switch ( field[1] ) {
- case 'min':
- date.setMinutes( val );
- break;
- case 'hour':
- date.setHours( val );
- break;
- case 'sec':
- date.setSeconds( val );
- break;
- case 'year':
- month = date.getMonth();
- date.setFullYear( val );
+ // on pagehide, remove any nested pages along with the parent page, as long as they aren't active
+ // and aren't embedded
+ if ( hasSubPages &&
+ parentPage.is( ":jqmData(external-page='true')" ) &&
+ parentPage.data( "page" ).options.domCache === false ) {
- if ( date.getMonth() != month ) {
- date_calibration();
- }
- break;
- case 'month':
- date.setMonth( val - 1 );
+ newRemove = function ( e, ui ) {
+ var nextPage = ui.nextPage, npURL;
- if ( date.getMonth() == val ) {
- date_calibration();
+ if ( ui.nextPage ) {
+ npURL = nextPage.jqmData( "url" );
+ if ( npURL.indexOf( parentUrl + "&" + $.mobile.subPageUrlKey ) !== 0 ) {
+ self.childPages().remove();
+ parentPage.remove();
}
- break;
- case 'day':
- date.setDate( val );
- break;
}
+ };
- obj._setDate( date );
+ // unbind the original page remove and replace with our specialized version
+ parentPage
+ .unbind( "pagehide.remove" )
+ .bind( "pagehide.remove", newRemove);
+ }
+ },
- $ctx.popupwindow( 'close' );
- });
+ // TODO sort out a better way to track sub pages of the extendable listview this is brittle
+ childPages: function () {
+ var parentUrl = this.parentPage.jqmData( "url" );
- $ul.bind( 'click', function ( e ) {
- if ( $(e.target).is('a') ) {
- $ul.find(".current").removeClass("current");
- $(e.target).parent().addClass('current');
- var val = $(e.target).jqmData("val");
- $(obj).trigger( 'update', val ); // close popup, unselect field
- }
- });
-
- $div.circularview( 'centerTo', '.current', 500 );
- $div.bind( 'scrollend' , function ( e ) {
- if ( !obj._reflow ) {
- obj._reflow = function () {
- $div.circularview("reflow");
- };
- $(window).bind("resize", obj._reflow);
- }
- });
- }
- return ui;
+ return $( ":jqmData(url^='" + parentUrl + "&" + $.mobile.subPageUrlKey + "')" );
}
-
});
- $(document).bind("pagecreate create", function ( e ) {
- $($.tizen.datetimepicker.prototype.options.initSelector, e.target)
- .not(":jqmData(role='none'), :jqmData(role='nojs')")
- .datetimepicker();
+ //auto self-init widgets
+ $( document ).bind( "pagecreate create", function ( e ) {
+ $( $.tizen.extendablelist.prototype.options.initSelector, e.target ).extendablelist();
});
-} ( jQuery, this ) );
-/*
- * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL licenses
- * http://phpjs.org/functions/range
- * original by: Waldo Malqui Silva
- * version: 1107.2516
- */
-function range( low, high, step ) {
- // Create an array containing the range of integers or characters
- // from low to high (inclusive)
- //
- // version: 1107.2516
- // discuss at: http://phpjs.org/functions/range
- // + original by: Waldo Malqui Silva
- // * example 1: range ( 0, 12 );
- // * returns 1: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
- // * example 2: range( 0, 100, 10 );
- // * returns 2: [0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100]
- // * example 3: range( 'a', 'i' );
- // * returns 3: ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i']
- // * example 4: range( 'c', 'a' );
- // * returns 4: ['c', 'b', 'a']
- var matrix = [],
- inival,
- endval,
- plus,
- walker = step || 1,
- chars = false;
-
- if (!isNaN(low) && !isNaN(high)) {
- inival = low;
- endval = high;
- } else if (isNaN(low) && isNaN(high)) {
- chars = true;
- inival = low.charCodeAt(0);
- endval = high.charCodeAt(0);
- } else {
- inival = (isNaN(low) ? 0 : low);
- endval = (isNaN(high) ? 0 : high);
- }
+}( jQuery ));
- plus = ((inival > endval) ? false : true);
- if (plus) {
- while (inival <= endval) {
- matrix.push(((chars) ? String.fromCharCode(inival) : inival));
- inival += walker;
- }
- } else {
- while (inival >= endval) {
- matrix.push(((chars) ? String.fromCharCode(inival) : inival));
- inival -= walker;
- }
- }
- return matrix;
-}
-/****************************************************************************
+/*
+ * jQuery Mobile Widget @VERSION
+ *
+ * This software is licensed under the MIT licence (as defined by the OSI at
+ * http://www.opensource.org/licenses/mit-license.php)
+ *
+ * ***************************************************************************
* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2011 by Intel Corporation Ltd.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* DEALINGS IN THE SOFTWARE.
* ***************************************************************************
*
- * Author: Wongi Lee <wongi11.lee@samsung.com>
-*/
-
-/**
- * Extendable List Widget for unlimited data.
- * To support more then 1,000 items, special list widget developed.
- * Fast initialize and append some element into the DOM tree repeatedly.
- * DB connection and works like DB cursor.
- *
- * HTML Attributes:
- *
- * data-role: extendablelist
- * data-template : jQuery.template ID that populate into extendable list. A button : a <DIV> element with "data-role : button" should be included on data-template.
- * data-dbtable : DB Table name. It used as window[DB NAME]. Loaded data should be converted as window object.
- * data-extenditems : Number of elements to extend at once.
- *
- * ID : <UL> element that has "data-role=extendablelist" must have ID attribute.
- * Class : <UL> element that has "data-role=extendablelist" should have "vlLoadSuccess" class to guaranty DB loading is completed.
- * tmp_load_more : Template ID for "load more" message and button.
- *
- *
- *APIs:
- * create ( {
- * itemData: function ( idx ) { return json_obj; },
- * numItemData: number or function () { return number; },
- * cacheItemData: function ( minIdx, maxIdx ) {}
- * } )
- * : Create a extendable list widget. At this moment, _create method is called.
- * args : A collection of options
- * itemData: A function that returns JSON object for given index. Mandatory.
- * numItemData: Total number of itemData. Mandatory.
- * cacheItemData: Extendable list will ask itemData between minIdx and maxIdx.
- * Developers can implement this function for preparing data.
- * Optional.
- *
- *Examples:
- *
- * <script id="tmp-3-1-1" type="text/x-jquery-tmpl">
- * <li class="ui-li-3-1-1"><span class="ui-li-text-main">${NAME}</span></li>
- * </script>
- *
- * <script id="tmp_load_more" type="text/x-jquery-tmpl">
- * <li class="ui-li-3-1-1" style="text-align:center; margin:0 auto">
- * <div data-role="button">Load ${NUM_MORE_ITEMS} more items</div>
- * </li>
- * </script>
- *
- * <ul id = "extendable_list_main" data-role="extendablelist" data-extenditems="50" data-template="tmp-3-1-1">
- * </ul>
- *
+ * Authors: Elliot Smith <elliot.smith@intel.com>
+ * Yonghwi Park <yonghwi0324.park@samsung.com>
*/
+// fastscroll is a scrollview controller, which binds
+// a scrollview to a a list of short cuts; the shortcuts are built
+// from the text on dividers in the list. Clicking on a shortcut
+// instantaneously jumps the scrollview to the selected list divider;
+// mouse movements on the shortcut column move the scrollview to the
+// list divider matching the text currently under the touch; a popup
+// with the text currently under the touch is also displayed.
+//
+// To apply, add the attribute data-fastscroll="true" to a listview
+// (a <ul> or <ol> element inside a page). Alternatively, call
+// fastscroll() on an element.
+//
+// The closest element with class ui-scrollview-clip is used as the
+// scrollview to be controlled.
+//
+// If a listview has no dividers or a single divider, the widget won't
+// display.
+
/**
- @class Extendablelist
- In the Web environment, it is challenging to display a large amount of data in a list, such as displaying a contact list of over 1000 list items. It takes time to display the entire list in HTML and the DOM manipulation is complex.
- The extendable list widget is used to display a list of unlimited data elements on the screen for better performance. The list is extended if you click the button at the bottom of the list to load more data elements. Extendable lists are based on the jQuery.template plugin as described in the jQuery documentation for jQuery.template plugin.<br/>
- To add a extendable list widget to the application, use the following code:
+ @class fastscroll
+ The shortcut scroll widget shows a shortcut list that is bound to its parent scroll bar and respective list view. This widget is displayed as a text pop-up representing shortcuts to different list dividers in the list view. If you select a shortcut text from the shortcut scroll, the parent list view is moved to the location representing the selected shortcut.
- <script id="tmp-3-1-1" type="text/x-jquery-tmpl">
- <li class="ui-li-3-1-1"><span class="ui-li-text-main">${NAME}</span></li>
- </script>
- <script id="tmp_load_more" type="text/x-jquery-tmpl">
- <li class="ui-li-3-1-1" style="text-align:center; margin:0 auto">
- <div data-role="button">Load ${NUM_MORE_ITEMS} more items</div>
- </li>
- </script>
- <ul id="extendable_list_main" data-role="extendablelist" data-extenditems="50" data-template="tmp-3-1-1">
+ To add a shortcut scroll widget to the application, use the following code:
+
+ <div class="content" data-role="content" data-scroll="y">
+ <ul id="contacts" data-role="listview" data-fastscroll="true">
+ <li>Anton</li>
</ul>
+ </div>
+
+ For the shortcut scroll widget to be visible, the parent list view must have multiple list dividers.
*/
+
/**
- @property {String} data-role
- Creates the extendable list view. The value must be set to extendablelist. Only the <ul> element, which a id attribute defined, supports this option. Also, the elLoadSuccess class attribute must be defined in the <ul> element to ensure that loading data from the database is complete.
+ @property {Boolean} data-fastscroll
+ When set to true, creates a shortcut scroll using the HTML unordered list (<ul>) element.
*/
/**
- @property {String} data-template
- Specifies the jQuery.template element ID. The jQuery.template must be defined. The template style can use rem units to support scalability. For using the button at the bottom of the list to load more data elements, there must be list view template with the button. The attribute ID must be tmp_load_more.
+ @method fastscroll
+ The shortcut scroll is created for the closest list view with the ui-scrollview-clip class.
*/
/**
- @property {Integer} data-extenditems
- Defines the number of data elements to be extended at a time.
-*/
-( function ( $, undefined ) {
+ @method indexString
+ The indexString method is used to get (if no value is defined) or set the string to present the index.
- //Keeps track of the number of lists per page UID
- //This allows support for multiple nested list in the same page
- //https://github.com/jquery/jquery-mobile/issues/1617
- var listCountPerPage = {};
+ <div class="content" data-role="content" data-scroll="y">
+ ul id="contacts" data-role="listview" data-fastscroll="true">
+ <li data-role="list-divider">A</li>
+ <li>Anton</li>
+ </ul>
+ </div>
- $.widget( "tizen.extendablelist", $.mobile.widget, {
+ $(".selector").fastscroll( "indexString" [, indexAlphabet] );
+*/
+(function ( $, undefined ) {
+
+ $.widget( "tizen.fastscroll", $.mobile.widget, {
options: {
- theme: "s",
- countTheme: "c",
- headerTheme: "b",
- dividerTheme: "b",
- splitIcon: "arrow-r",
- splitTheme: "b",
- inset: false,
- id: "", /* Extendable list UL elemet's ID */
- extenditems: 50, /* Number of append items */
- childSelector: " li", /* To support swipe list */
- dbtable: "",
- template : "", /* Template for each list item */
- loadmore : "tmp_load_more", /* Template for "Load more" message */
- scrollview: false,
- initSelector: ":jqmData(role='extendablelist')"
+ initSelector: ":jqmData(fastscroll)",
},
- _stylerMouseUp: function () {
- $( this ).addClass( "ui-btn-up-s" );
- $( this ).removeClass( "ui-btn-down-s" );
- },
+ _primaryLanguage: null,
+ _secondLanguage: null,
- _stylerMouseDown: function () {
- $( this ).addClass( "ui-btn-down-s" );
- $( this ).removeClass( "ui-btn-up-s" );
- },
+ _create: function () {
+ var $el = this.element,
+ self = this,
+ $popup,
+ page = $el.closest( ':jqmData(role="page")' ),
+ jumpToDivider;
- _stylerMouseOver: function () {
- $( this ).toggleClass( "ui-btn-hover-s" );
- },
+ this.scrollview = $el.closest( '.ui-scrollview-clip' );
+ this.shortcutsContainer = $( '<div class="ui-fastscroll" aria-label="Fast scroll bar, double tap to fast scroll mode" tabindex="0"/>' );
+ this.shortcutsList = $( '<ul aria-hidden="true"></ul>' );
- _stylerMouseOut: function () {
- $( this ).toggleClass( "ui-btn-hover-s" );
- $( this ).addClass( "ui-btn-up-s" );
- $( this ).removeClass( "ui-btn-down-s" );
- },
+ // popup for the hovering character
+ this.scrollview.append($( '<div class="ui-fastscroll-popup"></div>' ) );
+ $popup = this.scrollview.find( '.ui-fastscroll-popup' );
- _pushData: function ( template ) {
- var o = this.options,
- t = this,
- i = 0,
- myTemplate = $( "#" + template ),
- loadMoreItems = ( o.extenditems > t._numItemData - t._lastIndex ? t._numItemData - t.lastIndex : o.extenditems ),
- htmlData;
+ this.shortcutsContainer.append( this.shortcutsList );
+ this.scrollview.append( this.shortcutsContainer );
- for (i = 0; i < loadMoreItems; i++ ) {
- htmlData = myTemplate.tmpl( t._itemData( i ) );
- $( o.id ).append( $( htmlData ).attr( 'id', 'li_' + i ) );
+ // find the bottom of the last item in the listview
+ this.lastListItem = $el.children().last();
- /* Add style */
- $( o.id + ">" + o.childSelector )
- .addClass( "ui-btn-up-s" )
- .bind( "mouseup", t._stylerMouseUp )
- .bind( "mousedown", t._stylerMouseDown )
- .bind( "mouseover", t._stylerMouseOver )
- .bind( "mouseout", t._stylerMouseOut );
+ // remove scrollbars from scrollview
+ this.scrollview.find( '.ui-scrollbar' ).hide();
- t._lastIndex += 1;
- }
+ this.jumpToDivider = function ( divider ) {
+ // get the vertical position of the divider (so we can scroll to it)
+ var dividerY = $( divider ).position().top,
+ // find the bottom of the last list item
+ bottomOffset = self.lastListItem.outerHeight( true ) + self.lastListItem.position().top,
+ scrollviewHeight = self.scrollview.height(),
- /* After push data, re-style extendable list widget */
- $( o.id ).trigger( "create" );
- },
+ // check that after the candidate scroll, the bottom of the
+ // last item will still be at the bottom of the scroll view
+ // and not some way up the page
+ maxScroll = bottomOffset - scrollviewHeight,
+ dstOffset;
- _loadmore: function ( event ) {
- var t = event.data, // <li> element
- o = t.options,
- i = 0,
- myTemplate = $( "#" + o.template ),
- loadMoreItems = ( o.extenditems > t._numItemData - t._lastIndex ? t._numItemData - t._lastIndex : o.extenditems ),
- htmlData,
- more_items_to_load,
- num_next_load_items;
+ dividerY = ( dividerY > maxScroll ? maxScroll : dividerY );
- /* Remove load more message */
- $( "#load_more_message" ).remove();
+ // don't apply a negative scroll, as this means the
+ // divider should already be visible
+ dividerY = Math.max( dividerY, 0 );
- /* Append More Items */
- for ( i = 0; i < loadMoreItems; i++ ) {
- htmlData = myTemplate.tmpl( t._itemData( t._lastIndex ) );
- $( o.id ).append( $( htmlData ).attr( 'id', 'li_' + t._lastIndex ) );
- t._lastIndex += 1;
- }
+ // apply the scroll
+ self.scrollview.scrollview( 'scrollTo', 0, -dividerY );
- /* Append "Load more" message on the last of list */
- if ( t._numItemData > t._lastIndex ) {
- myTemplate = $( "#" + o.loadmore );
- more_items_to_load = t._numItemData - t._lastIndex;
- num_next_load_items = ( o.extenditems <= more_items_to_load ) ? o.extenditems : more_items_to_load;
- htmlData = myTemplate.tmpl( { NUM_MORE_ITEMS : num_next_load_items } );
+ dstOffset = self.scrollview.offset();
+ };
+
+ this.shortcutsList
+ // bind mouse over so it moves the scroller to the divider
+ .bind( 'touchstart mousedown vmousedown touchmove vmousemove vmouseover', function ( e ) {
+ // Get coords relative to the element
+ var coords = $.mobile.tizen.targetRelativeCoordsFromEvent( e ),
+ shortcutsListOffset = self.shortcutsList.offset();
+
+ // If the element is a list item, get coordinates relative to the shortcuts list
+ if ( e.target.tagName.toLowerCase() === "li" ) {
+ coords.x += $( e.target ).offset().left - shortcutsListOffset.left;
+ coords.y += $( e.target ).offset().top - shortcutsListOffset.top;
+ }
+
+ if ( e.target.tagName.toLowerCase() === "span" ) {
+ coords.x += $( e.target ).parent().offset().left - shortcutsListOffset.left;
+ coords.y += $( e.target ).parent().offset().top - shortcutsListOffset.top;
+ }
+
+ self.shortcutsList.find( 'li' ).each( function () {
+ var listItem = $( this );
+ $( listItem )
+ .removeClass( "ui-fastscroll-hover" )
+ .removeClass( "ui-fastscroll-hover-up" )
+ .removeClass( "ui-fastscroll-hover-down" );
+ });
+ // Hit test each list item
+ self.shortcutsList.find( 'li' ).each( function () {
+ var listItem = $( this ),
+ l = listItem.offset().left - shortcutsListOffset.left,
+ t = listItem.offset().top - shortcutsListOffset.top,
+ r = l + Math.abs(listItem.outerWidth( true ) ),
+ b = t + Math.abs(listItem.outerHeight( true ) );
+
+ if ( coords.x >= l && coords.x <= r && coords.y >= t && coords.y <= b ) {
+ self._hitItem( listItem );
+ return false;
+ }
+ return true;
+ } );
+
+ e.preventDefault();
+ e.stopPropagation();
+ } )
+ // bind mouseout of the fastscroll container to remove popup
+ .bind( 'touchend mouseup vmouseup vmouseout', function () {
+ $popup.hide();
+ $( ".ui-fastscroll-hover" ).removeClass( "ui-fastscroll-hover" );
+ $( ".ui-fastscroll-hover-first-item" ).removeClass( "ui-fastscroll-hover-first-item" );
+ $( ".ui-fastscroll-hover-up" ).removeClass( "ui-fastscroll-hover-up" );
+ $( ".ui-fastscroll-hover-down" ).removeClass( "ui-fastscroll-hover-down" );
+ } );
- $( o.id ).append( $( htmlData ).attr( 'id', "load_more_message" ) );
+ if ( page && !( page.is( ':visible' ) ) ) {
+ page.bind( 'pageshow', function () { self.refresh(); } );
+ } else {
+ self.refresh();
}
- $( o.id ).trigger( "create" );
- $( o.id ).extendablelist( "refresh" );
- },
+ // refresh the list when dividers are filtered out
+ $el.bind( 'updatelayout', function () {
+ self.refresh();
+ } );
- recreate: function ( newArray ) {
- this._create( {
- itemData: function ( idx ) { return newArray[ idx ]; },
- numItemData: newArray.length
+ $( window ).unbind( ".fastscroll" ).bind( "resize.fastscroll", function ( e ) {
+ self.refresh();
} );
},
- _initList: function (args ) {
- var t = this,
- o = this.options,
- myTemplate,
- more_items_to_load,
- num_next_load_items,
- htmlData;
+ _hitItem: function ( listItem ) {
+ var self = this,
+ $popup = self.scrollview.find( '.ui-fastscroll-popup' );
- /* Make Gen list by template */
- if ( t._lastIndex <= 0 ) {
- t._pushData( o.template );
+ if ( typeof listItem.data( 'divider' ) !== "undefined" ) {
+ self.jumpToDivider( $( listItem.data( 'divider' ) ) );
+ }
- /* Append "Load more" message on the last of list */
- if ( t._numItemData > t._lastIndex ) {
- myTemplate = $( "#" + o.loadmore );
- more_items_to_load = t._numItemData - t._lastIndex;
- num_next_load_items = ( o.extenditems <= more_items_to_load) ? o.extenditems : more_items_to_load;
- htmlData = myTemplate.tmpl( { NUM_MORE_ITEMS : num_next_load_items } );
+ if ( listItem.text() !== "." ) {
+ $popup.text( listItem.text() )
+ .css( { marginLeft: -( $popup.width() / 2 ),
+ marginTop: -( $popup.height() / 2 ),
+ padding: $popup.css( "paddingTop" ) } )
+ .width( $popup.height() )
+ .show();
+ } else {
+ $popup.hide();
+ }
+
+ $( listItem ).addClass( "ui-fastscroll-hover" );
+ if ( listItem.index() === 0 ) {
+ $( listItem ).addClass( "ui-fastscroll-hover-first-item" );
+ }
+ if ( listItem.index() > 0 ) {
+ $( listItem ).siblings().eq( listItem.index() - 1 ).addClass( "ui-fastscroll-hover-up" );
+ }
+ $( listItem ).siblings().eq( listItem.index() ).addClass( "ui-fastscroll-hover-down" );
+ },
- $( o.id ).append( $( htmlData ).attr( 'id', "load_more_message" ) );
+ _focusItem: function ( listItem ) {
+ var self = this,
+ $popup = self.scrollview.find( '.ui-fastscroll-popup' );
+
+ listItem.focusin( function ( e ) {
+ self._hitItem( listItem );
+ }).focusout( function ( e ) {
+ $popup.hide();
+ $( ".ui-fastscroll-hover" ).removeClass( "ui-fastscroll-hover" );
+ $( ".ui-fastscroll-hover-first-item" ).removeClass( "ui-fastscroll-hover-first-item" );
+ $( ".ui-fastscroll-hover-up" ).removeClass( "ui-fastscroll-hover-up" );
+ $( ".ui-fastscroll-hover-down" ).removeClass( "ui-fastscroll-hover-down" );
+ });
+ },
- $( "#load_more_message" ).live( "click", t, t._loadmore );
- } else {
- /* No more items to load */
- $( "#load_more_message" ).die();
- $( "#load_more_message" ).remove();
+ _contentHeight: function () {
+ var self = this,
+ $content = $( '.ui-scrollview-clip' ),
+ header = null,
+ footer = null,
+ paddingValue = 0,
+ clipSize = $( window ).height();
+
+ if ( $content.hasClass( "ui-content" ) ) {
+ paddingValue = parseInt( $content.css( "padding-top" ), 10 );
+ clipSize = clipSize - ( paddingValue || 0 );
+ paddingValue = parseInt( $content.css( "padding-bottom" ), 10 );
+ clipSize = clipSize - ( paddingValue || 0 );
+ header = $content.siblings( ".ui-header:visible" );
+ footer = $content.siblings( ".ui-footer:visible" );
+
+ if ( header ) {
+ if ( header.outerHeight( true ) === null ) {
+ clipSize = clipSize - ( $( ".ui-header" ).outerHeight() || 0 );
+ } else {
+ clipSize = clipSize - header.outerHeight( true );
+ }
+ }
+ if ( footer ) {
+ clipSize = clipSize - footer.outerHeight( true );
}
+ } else {
+ clipSize = $content.height();
}
+ return clipSize;
+ },
- if ( o.childSelector == " ul" ) {
- $( o.id + " ul" ).swipelist();
+ _omit: function ( numOfItems, maxNumOfItems ) {
+ var maxGroupNum = parseInt( ( maxNumOfItems - 1 ) / 2, 10 ),
+ numOfExtraItems = numOfItems - maxNumOfItems,
+ groupPos = [],
+ omitInfo = [],
+ groupPosLength,
+ group,
+ size,
+ i;
+
+ if ( ( maxNumOfItems < 3 ) || ( numOfItems <= maxNumOfItems ) ) {
+ return;
}
- $( o.id ).trigger( "create" );
+ if ( numOfExtraItems >= maxGroupNum ) {
+ size = 2;
+ group = 1;
+ groupPosLength = maxGroupNum;
+ } else {
+ size = maxNumOfItems / ( numOfExtraItems + 1 );
+ group = size;
+ groupPosLength = numOfExtraItems;
+ }
- t.refresh( true );
- },
+ for ( i = 0; i < groupPosLength; i++ ) {
+ groupPos.push( parseInt( group, 10 ) );
+ group += size;
+ }
- create: function () {
- var o = this.options;
+ for ( i = 0; i < maxNumOfItems; i++ ) {
+ omitInfo.push( 1 );
+ }
- /* external API for AJAX callback */
- this._create.apply( this, arguments );
+ for ( i = 0; i < numOfExtraItems; i++ ) {
+ omitInfo[ groupPos[ i % maxGroupNum ] ]++;
+ }
+
+ return omitInfo;
},
- _create: function ( args ) {
- var t = this,
- o = this.options,
- $el = this.element,
- dbtable_name;
+ indexString: function ( indexAlphabet ) {
+ var self = this,
+ characterSet = [];
+ if ( typeof indexAlphabet === " undefined" ) {
+ return self._primaryLanguage + ":" + self._secondLanguage;
+ }
- t.destroy();
+ characterSet = indexAlphabet.split( ":" );
+ self._primaryLanguage = characterSet[ 0 ];
+ if ( characterSet.length === 2 ) {
+ self._secondLanguage = characterSet[ 1 ];
+ }
+ },
- $.extend(this, {
- _itemData: function ( idx ) { return null; },
- _numItemData: 0,
- _cacheItemData: function ( minIdx, maxIdx ) { },
- _lastIndex: 0
- });
+ refresh: function () {
+ var self = this,
+ primaryCharacterSet = self._primaryLanguage ? self._primaryLanguage.replace( /,/g, "" ) : null,
+ secondCharacterSet = self._secondLanguage ? self._secondLanguage.replace( /,/g, "" ) : null,
+ contentHeight = self._contentHeight(),
+ shapItem = $( '<li tabindex="0" aria-label="double to move Number list"><span aria-hidden="true">#</span><span aria-label="Number"/></li>' ),
+ omitIndex = 0,
+ matchToDivider,
+ containerHeight,
+ shortcutsItems,
+ shortcutItem,
+ shortcutsTop,
+ minClipHeight,
+ maxNumOfItems,
+ numOfItems,
+ minHeight,
+ padding,
+ omitInfo,
+ dividers,
+ listItems,
+ emptySize,
+ correction,
+ indexChar,
+ lastIndex,
+ seconds,
+ height,
+ size,
+ i;
+ matchToDivider = function ( index, divider ) {
+ if ( $( divider ).text() === indexChar ) {
+ shortcutItem.data( 'divider', divider )
+ .bind( 'vclick', function ( e ) {
+ $( divider ).next().focus();
+ } );
+ }
+ };
- // create listview markup
- t.element.addClass( function ( i, orig ) {
- return orig + " ui-listview ui-extendable-list-container" + ( t.options.inset ? " ui-listview-inset ui-corner-all ui-shadow " : "" );
- });
+ self.shortcutsList.find( 'li' ).remove();
- o.id = "#" + $el.attr( "id" );
+ // get all the dividers from the list and turn them into shortcuts
+ dividers = self.element.find( '.ui-li-divider' );
- if ( $el.data( "extenditems" ) ) {
- o.extenditems = parseInt( $el.data( "extenditems" ), 10 );
- }
+ // get all the list items
+ listItems = self.element.find('li').not('.ui-li-divider');
- $( o.id ).bind( "pagehide", function (e) {
- $( o.id ).empty();
- });
+ // only use visible dividers
+ dividers = dividers.filter( ':visible' );
+ listItems = listItems.filter( ':visible' );
- /* Scroll view */
- if ( $( ".ui-scrollview-clip" ).size() > 0) {
- o.scrollview = true;
- } else {
- o.scrollview = false;
+ if ( dividers.length < 2 ) {
+ self.shortcutsList.hide();
+ return;
}
- if ( args ) {
- if ( !t._loadData( args ) ) {
+ self.shortcutsList.show();
+ self.lastListItem = listItems.last();
+ self.shortcutsList.append( shapItem );
+ self._focusItem( shapItem );
+
+ if ( primaryCharacterSet !== null ) {
+ padding = parseInt( shapItem.css( "padding" ), 10 );
+ minHeight = shapItem.height() + ( padding * 2 );
+ maxNumOfItems = parseInt( ( contentHeight / minHeight ) - 1, 10 );
+ numOfItems = primaryCharacterSet.length;
+
+ maxNumOfItems = secondCharacterSet ? maxNumOfItems - 2 : maxNumOfItems;
+
+ if ( maxNumOfItems < 3 ) {
+ shapItem.remove();
return;
}
- } else {
- // Legacy support: dbtable
- console.warn("WARNING: The data interface of extendable list is changed. \nOld data interface(data-dbtable) is still supported, but will be removed in next version. \nPlease fix your code soon!");
- if ( $( o.id ).hasClass( "elLoadSuccess" ) ) {
- dbtable_name = $el.jqmData('dbtable');
- o.dbtable = window[ dbtable_name ];
- if ( !(o.dbtable) ) {
- o.dbtable = { };
+ omitInfo = self._omit( numOfItems, maxNumOfItems );
+
+ for ( i = 0; i < primaryCharacterSet.length; i++ ) {
+ indexChar = primaryCharacterSet.charAt( i );
+ shortcutItem = $( '<li tabindex="0" aria-label="double to move ' + indexChar + ' list">' + indexChar + '</li>' );
+
+ self._focusItem( shortcutItem );
+ dividers.each( matchToDivider );
+
+ if ( typeof omitInfo !== "undefined" && omitInfo[ omitIndex ] > 1 ) {
+ shortcutItem = $( '<li>.</li>' );
+ i += omitInfo[ omitIndex ] - 1;
}
- t._itemData = function ( idx ) {
- return o.dbtable[ idx ];
- };
- t._numItemData = o.dbtable.length;
- } else {
- console.warn("No elLoadSuccess class");
- return;
+ shapItem.before( shortcutItem );
+ omitIndex++;
}
- }
- if ( $el.data( "template" ) ) {
- o.template = $el.data( "template" );
+ if ( secondCharacterSet !== null ) {
+ lastIndex = secondCharacterSet.length - 1;
+ seconds = [];
- /* to support swipe list, <li> or <ul> can be main node of extendable list. */
- if ( $el.data( "swipelist" ) == true ) {
- o.childSelector = " ul";
- } else {
- o.shildSelector = " li";
- }
- }
- t._initList( args );
- },
+ seconds.push( secondCharacterSet.charAt( 0 ) );
+ seconds.push( secondCharacterSet.charAt( lastIndex ) );
- _loadData : function ( args ) {
- var self = this;
+ for ( i = 0; i < seconds.length; i++ ) {
+ indexChar = seconds[ i ];
+ shortcutItem = $( '<li tabindex="0" aria-label="double to move ' + indexChar + ' list">' + indexChar + '</li>' );
- if ( args.itemData && typeof args.itemData == 'function' ) {
- self._itemData = args.itemData;
- } else {
- return false;
- }
- if ( args.numItemData ) {
- if ( typeof args.numItemData == 'function' ) {
- self._numItemData = args.numItemData( );
- } else if ( typeof args.numItemData == 'number' ) {
- self._numItemData = args.numItemData;
- } else {
- return false;
+ self._focusItem( shortcutItem );
+ dividers.each( matchToDivider );
+
+ shapItem.before( shortcutItem );
+ }
}
} else {
- return false;
+ dividers.each( function ( index, divider ) {
+ indexChar = $( divider ).text();
+ shortcutItem = $( '<li tabindex="0" aria-label="double to move ' + indexChar + ' list">' + indexChar + '</li>' );
+
+ shortcutItem.data( 'divider', divider );
+ self._focusItem( shortcutItem );
+ shapItem.before( shortcutItem );
+ } );
}
- return true;
- },
+ containerHeight = self.shortcutsContainer.outerHeight();
+ emptySize = contentHeight - containerHeight;
+ shortcutsItems = self.shortcutsList.children();
+ size = parseInt( emptySize / shortcutsItems.length, 10 );
+ correction = emptySize - ( shortcutsItems.length * size );
- destroy : function () {
- var o = this.options,
- eOTAL_ITEMS = 0,
- last_index = 0;
+ if ( emptySize > 0 ) {
+ shortcutsItems.each( function ( index, item ) {
+ height = $( item ).height() + size;
+ if ( correction !== 0 ) {
+ height += 1;
+ correction -= 1;
+ }
+ $( item ).css( {
+ height: height,
+ lineHeight: height + "px"
+ } );
+ } );
+ }
- $( o.id ).empty();
+ // position the shortcut flush with the top of the first list divider
+ shortcutsTop = dividers.first().position().top;
+ self.shortcutsContainer.css( 'top', shortcutsTop );
- $( "#load_more_message" ).die();
- },
+ // make the scrollview clip tall enough to show the whole of the shortcutslist
+ minClipHeight = shortcutsTop + self.shortcutsContainer.outerHeight() + 'px';
+ self.scrollview.css( 'min-height', minClipHeight );
+ }
+ } );
- _itemApply: function ( $list, item ) {
- var $countli = item.find( ".ui-li-count" );
+ $( document ).bind( "pagecreate create", function ( e ) {
+ $( $.tizen.fastscroll.prototype.options.initSelector, e.target )
+ .not( ":jqmData(role='none'), :jqmData(role='nojs')" )
+ .fastscroll();
+ } );
- if ( $countli.length ) {
- item.addClass( "ui-li-has-count" );
- }
+} ( jQuery ) );
- $countli.addClass( "ui-btn-up-" + ( $list.jqmData( "counttheme" ) || this.options.countTheme ) + " ui-btn-corner-all" );
- // TODO class has to be defined in markup
- item.find( "h1, h2, h3, h4, h5, h6" ).addClass( "ui-li-heading" ).end()
- .find( "p, dl" ).addClass( "ui-li-desc" ).end()
- .find( ">img:eq(0), .ui-link-inherit>img:eq(0)" ).addClass( "ui-li-thumb" ).each(function () {
- item.addClass( $( this ).is( ".ui-li-icon" ) ? "ui-li-has-icon" : "ui-li-has-thumb" );
- }).end()
- .find( ".ui-li-aside" ).each(function () {
- var $this = $( this );
- $this.prependTo( $this.parent() ); //shift aside to front for css float
- });
- },
- _removeCorners: function ( li, which ) {
- var top = "ui-corner-top ui-corner-tr ui-corner-tl",
- bot = "ui-corner-bottom ui-corner-br ui-corner-bl";
+/* ***************************************************************************
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * ***************************************************************************
+ *
+ * Authors: Yonghwi Park <yonghwi0324.park@samsung.com>
+ * Wonseop Kim <wonseop.kim@samsung.com>
+*/
- li = li.add( li.find( ".ui-btn-inner, .ui-li-link-alt, .ui-li-thumb" ) );
+/**
+ *
+ * MultiMediaView is a widget that lets the user view and handle multimedia contents.
+ * Video and audio elements are coded as standard HTML elements and enhanced by the
+ * MultiMediaview to make them attractive and usable on a mobile device.
+ *
+ * HTML Attributes:
+ * data-theme : Set a theme of widget.
+ * If this value is not defined, widget will use parent`s theme. (optional)
+ * data-controls : If this value is 'true', widget will use belonging controller.
+ * If this value is 'false', widget will use browser`s controller.
+ * Default value is 'true'.
+ * data-full-screen : Set a status that full-screen when inital start.
+ * Default value is 'false'.
+ *
+ * APIs:
+ * width( [number] )
+ * : Get or set the width of widget.
+ * The first argument is the width of widget.
+ * If no first argument is specified, will act as a getter.
+ * height( [number] )
+ * : Get or set the height of widget.
+ * The first argument is the height of widget.
+ * If no first argument is specified, will act as a getter.
+ * fullScreen( [boolean] )
+ * : Get or Set the status of full-screen.
+ * If no first argument is specified, will act as a getter.
+ *
+ * Events:
+ *
+ * create : triggered when a multimediaview is created.
+ *
+ * Examples:
+ *
+ * VIDEO :
+ * <video data-controls="true" style="width:100%;">
+ * <source src="media/oceans-clip.mp4" type="video/mp4" />
+ * Your browser does not support the video tag.
+ * </video>
+ *
+ * AUDIO :
+ * <audio data-controls="true" style="width:100%;">
+ * <source src="media/Over the horizon.mp3" type="audio/mp3" />
+ * Your browser does not support the audio tag.
+ * </audio>
+ *
+ */
+/**
+ @class MutimediaView
+ The multimedia view widget shows a player control that you can use to view and handle multimedia content. This widget uses the standard HTML video and audio elements, which have been enhanced for use on a mobile device.
- if ( which === "top" ) {
- li.removeClass( top );
- } else if ( which === "bottom" ) {
- li.removeClass( bot );
- } else {
- li.removeClass( top + " " + bot );
- }
- },
+ To add a multimedia view widget to the application, use the following code:
+
+ // Video player control
+ <video data-controls="true" style="width:100%;">
+ <source src="<VIDEO_FILE_URL>" type="video/mp4" /> Your browser does not support the video tag. </video>
+ // Audio player control
+ <audio data-controls="true" style="width:100%;"> <source src="<AUDIO_FILE_URL>" type="audio/mp3" /> Your browser does not support the audio tag.
+ </audio>
- _refreshCorners: function ( create ) {
- var $li,
- $visibleli,
- $topli,
- $bottomli;
+ The multimedia view can define a callback for the create event, which is fired when the widget is created.
+ $('.selector').multimediaview({
+ create:function(event, u){...}
+ });
+ $(".selector").bind("create", function(event, ui)
+ {
+ // Respond to the multimedia view widget creation
+ });
+*/
+/**
+ @property {Boolean} data-control
+ Sets the controls for the widget.
+ The default value is true. If the value is set to true, the widget uses its own player controls. If the value is set to false, the widget uses the browser's player controls.
+*/
+/**
+ @property {Boolean} data-full-screen
+ Defines whether the widget opens in the fullscreen view mode.
+ The default value is false.
+*/
+/**
+ @property {String} data-theme
+ Sets the widget theme.
+ If the value is not set, the parent control's theme is used
+*/
+/**
+ @method width
+ The width method is used to get (if no value is defined) or set the multimedia view widget width:
+ <video>
+ <source src="test.mp4" type="video/mp4" />
+ </video>
+ $(".selector").multimediaview("width", [value]);
+*/
+/**
+ @method height
+ The height method is used to get (if no value is defined) or set the multimedia view widget height:
+ <video>
+ <source src="test.mp4" type="video/mp4" />
+ </video>
+ $(".selector").multimediaview("height", [value]);
+*/
+/**
+ @method fullScreen
+ The fullScreen method is used to get (if no value is defined) or set the full-screen mode of the multimedia view widget. If the value is true, the full-screen mode is used; otherwise the multimedia view widget runs in the normal mode.
- if ( this.options.inset ) {
- $li = this.element.children( "li" );
- // at create time the li are not visible yet so we need to rely on .ui-screen-hidden
- $visibleli = create ? $li.not( ".ui-screen-hidden" ) : $li.filter( ":visible" );
+ <video>
+ <source src="test.mp4" type="video/mp4" />
+ </video>
+ $(".selector").multimediaview("fullScreen", [value]);
+*/
+( function ( $, document, window, undefined ) {
+ $.widget( "tizen.multimediaview", $.mobile.widget, {
+ options: {
+ theme: null,
+ controls: true,
+ fullScreen: false,
+ initSelector: "video, audio"
+ },
- this._removeCorners( $li );
+ _create: function () {
+ var self = this,
+ view = self.element,
+ viewElement = view[0],
+ isVideo = ( viewElement.nodeName === "VIDEO" ),
+ option = self.options,
+ parentTheme = $.mobile.getInheritedTheme( view, "s" ),
+ theme = option.theme || parentTheme,
+ width = viewElement.style.getPropertyValue( "width" ) || "",
+ wrap = $( "<div class='ui-multimediaview-wrap ui-multimediaview-" + theme + "'>" ),
+ control = null;
- // Select the first visible li element
- $topli = $visibleli.first()
- .addClass( "ui-corner-top" );
+ $.extend( this, {
+ role: null,
+ controlTimer: null,
+ isVolumeHide: true,
+ backupView: null,
+ _reserveVolume: -1,
+ _isVideo: isVideo
+ });
- $topli.add( $topli.find( ".ui-btn-inner" ) )
- .find( ".ui-li-link-alt" )
- .addClass( "ui-corner-tr" )
- .end()
- .find( ".ui-li-thumb" )
- .not( ".ui-li-icon" )
- .addClass( "ui-corner-tl" );
-
- // Select the last visible li element
- $bottomli = $visibleli.last()
- .addClass( "ui-corner-bottom" );
-
- $bottomli.add( $bottomli.find( ".ui-btn-inner" ) )
- .find( ".ui-li-link-alt" )
- .addClass( "ui-corner-br" )
- .end()
- .find( ".ui-li-thumb" )
- .not( ".ui-li-icon" )
- .addClass( "ui-corner-bl" );
- }
- },
+ view.addClass( "ui-multimediaview" );
+ control = self._createControl();
+ control.hide();
- refresh: function ( create ) {
- this.parentPage = this.element.closest( ".ui-page" );
- this._createSubPages();
+ control.find( ".ui-button" ).each( function ( index ) {
+ $( this ).buttonMarkup( { corners: true, theme: theme, shadow: true } );
+ });
- var o = this.options,
- $list = this.element,
- self = this,
- dividertheme = $list.jqmData( "dividertheme" ) || o.dividerTheme,
- listsplittheme = $list.jqmData( "splittheme" ),
- listspliticon = $list.jqmData( "spliticon" ),
- li = $list.children( "li" ),
- counter = $.support.cssPseudoElement || !$.nodeName( $list[ 0 ], "ol" ) ? 0 : 1,
- item,
- itemClass,
- itemTheme,
- a,
- last,
- splittheme,
- countParent,
- icon,
- pos,
- numli;
+ view.wrap( wrap ).after( control );
- if ( counter ) {
- $list.find( ".ui-li-dec" ).remove();
+ if ( isVideo ) {
+ control.addClass( "ui-multimediaview-video" );
+ } else {
+ self.width( width );
+ self.options.fullScreen = false;
}
- for ( pos = 0, numli = li.length; pos < numli; pos++ ) {
- item = li.eq( pos );
- itemClass = "ui-li";
+ if ( option.controls && view.attr( "controls" ) ) {
+ view.removeAttr( "controls" );
+ }
- // If we're creating the element, we update it regardless
- if ( create || !item.hasClass( "ui-li" ) ) {
- itemTheme = item.jqmData( "theme" ) || o.theme;
- a = item.children( "a" );
+ self._addEvent();
+ },
- if ( a.length ) {
- icon = item.jqmData( "icon" );
+ _resize: function () {
+ this._resizeFullscreen( this.options.fullScreen );
+ this._resizeControl();
+ this._updateSeekBar();
+ this._updateVolumeState();
+ },
- item.buttonMarkup({
- wrapperEls: "div",
- shadow: false,
- corners: false,
- iconpos: "right",
- /* icon: a.length > 1 || icon === false ? false : icon || "arrow-r",*/
- icon: false, /* Remove unnecessary arrow icon */
- theme: itemTheme
- });
+ _resizeControl: function () {
+ var self = this,
+ view = self.element,
+ viewElement = view[0],
+ isVideo = self._isVideo,
+ wrap = view.parent( ".ui-multimediaview-wrap" ),
+ control = wrap.find( ".ui-multimediaview-control" ),
+ buttons = control.find( ".ui-button" ),
+ playpauseButton = control.find( ".ui-playpausebutton" ),
+ seekBar = control.find( ".ui-seekbar" ),
+ durationLabel = control.find( ".ui-durationlabel" ),
+ timestampLabel = control.find( ".ui-timestamplabel" ),
+ volumeControl = control.find( ".ui-volumecontrol" ),
+ volumeBar = volumeControl.find( ".ui-volumebar" ),
+ width = ( isVideo ? view.width() : wrap.width() ),
+ height = ( isVideo ? view.height() : control.height() ),
+ offset = view.offset(),
+ controlHeight = control.height(),
+ availableWidth = 0,
+ controlOffset = null;
- if ( ( icon != false ) && ( a.length == 1 ) ) {
- item.addClass( "ui-li-has-arrow" );
- }
+ if ( control ) {
+ if ( isVideo ) {
+ controlOffset = control.offset();
+ controlOffset.left = offset.left;
+ controlOffset.top = offset.top + height - controlHeight;
+ control.offset( controlOffset );
+ }
+ control.width( width );
+ }
- a.first().addClass( "ui-link-inherit" );
+ if ( seekBar ) {
+ availableWidth = control.width() - ( buttons.outerWidth( true ) * buttons.length );
+ availableWidth -= ( parseInt( buttons.eq( 0 ).css( "margin-left" ), 10 ) + parseInt( buttons.eq( 0 ).css( "margin-right" ), 10 ) ) * buttons.length;
+ if ( !self.isVolumeHide ) {
+ availableWidth -= volumeControl.outerWidth( true );
+ }
+ seekBar.width( availableWidth );
+ }
- if ( a.length > 1 ) {
- itemClass += " ui-li-has-alt";
+ if ( durationLabel && !isNaN( viewElement.duration ) ) {
+ durationLabel.find( "p" ).text( self._convertTimeFormat( viewElement.duration ) );
+ }
- last = a.last();
- splittheme = listsplittheme || last.jqmData( "theme" ) || o.splitTheme;
+ if ( viewElement.autoplay && viewElement.paused === false ) {
+ playpauseButton.removeClass( "ui-play-icon" ).addClass( "ui-pause-icon" );
+ }
- last.appendTo(item)
- .attr( "title", last.getEncodedText() )
- .addClass( "ui-li-link-alt" )
- .empty()
- .buttonMarkup({
- shadow: false,
- corners: false,
- theme: itemTheme,
- icon: false,
- iconpos: false
- })
- .find( ".ui-btn-inner" )
- .append(
- $( "<span />" ).buttonMarkup( {
- shadow : true,
- corners : true,
- theme : splittheme,
- iconpos : "notext",
- icon : listspliticon || last.jqmData( "icon" ) || o.splitIcon
- })
- );
- }
- } else if ( item.jqmData( "role" ) === "list-divider" ) {
+ if ( seekBar.width() < ( volumeBar.width() + timestampLabel.width() + durationLabel.width() ) ) {
+ durationLabel.hide();
+ } else {
+ durationLabel.show();
+ }
+ },
- itemClass += " ui-li-divider ui-btn ui-bar-" + dividertheme;
- item.attr( "role", "heading" );
+ _resizeFullscreen: function ( isFullscreen ) {
+ if ( !this._isVideo ) {
+ return;
+ }
- //reset counter when a divider heading is encountered
- if ( counter ) {
- counter = 1;
- }
+ var self = this,
+ view = self.element,
+ viewElement = view[0],
+ wrap = view.parent( ".ui-multimediaview-wrap" ),
+ control = wrap.find( ".ui-multimediaview-control" ),
+ fullscreenButton = control.find( ".ui-fullscreenbutton" ),
+ currentPage = $( ".ui-page-active" ),
+ playpauseButton = control.find( ".ui-playpausebutton" ),
+ timestampLabel = control.find( ".ui-timestamplabel" ),
+ seekBar = control.find( ".ui-seekbar" ),
+ durationBar = seekBar.find( ".ui-duration" ),
+ currenttimeBar = seekBar.find( ".ui-currenttime" ),
+ body = $( "body" )[0],
+ header = currentPage.children( ".ui-header" ),
+ footer = currentPage.children( ".ui-footer" ),
+ docWidth = 0,
+ docHeight = 0;
- } else {
- itemClass += " ui-li-static ui-body-" + itemTheme;
- }
+ if ( isFullscreen ) {
+ if ( !self.backupView ) {
+ self.backupView = {
+ width: viewElement.style.getPropertyValue( "width" ) || "",
+ height: viewElement.style.getPropertyValue( "height" ) || "",
+ position: view.css( "position" ),
+ zindex: view.css( "z-index" ),
+ wrapHeight: wrap[0].style.getPropertyValue( "height" ) || ""
+ };
}
+ docWidth = body.clientWidth;
+ docHeight = body.clientHeight;
+
+ header.hide();
+ footer.hide();
+ view.parents().each( function ( e ) {
+ var element = $( this );
+ element.addClass( "ui-fullscreen-parents" )
+ .siblings()
+ .addClass( "ui-multimediaview-siblings-off" );
+ });
+ this._fitContentArea( currentPage );
+ fullscreenButton.removeClass( "ui-fullscreen-on" ).addClass( "ui-fullscreen-off" );
- if ( counter && itemClass.indexOf( "ui-li-divider" ) < 0 ) {
- countParent = item.is( ".ui-li-static:first" ) ? item : item.find( ".ui-link-inherit" );
-
- countParent.addClass( "ui-li-jsnumbering" )
- .prepend( "<span class='ui-li-dec'>" + (counter++) + ". </span>" );
+ view.width( docWidth ).height( docHeight - 1 );
+ wrap.height( docHeight - 1 );
+ view.offset( {
+ top: 0,
+ left: 0
+ }).addClass( "ui-multimediaview-fullscreen" );
+ } else {
+ if ( !self.backupView ) {
+ return;
}
- item.add( item.children( ".ui-btn-inner" ) ).addClass( itemClass );
+ header.show();
+ footer.show();
+ view.parents().each( function ( e ) {
+ var element = $( this );
+ element.removeClass( "ui-fullscreen-parents" )
+ .siblings()
+ .removeClass( "ui-multimediaview-siblings-off" );
+ });
+ this._fitContentArea( currentPage );
+ fullscreenButton.removeClass( "ui-fullscreen-off" ).addClass( "ui-fullscreen-on" );
- self._itemApply( $list, item );
+ wrap.css( "height", self.backupView.wrapHeight );
+ view.css( {
+ "width": self.backupView.width,
+ "height": self.backupView.height,
+ "position": self.backupView.position,
+ "z-index": self.backupView.zindex
+ }).removeClass( "ui-multimediaview-fullscreen" );
+ self.backupView = null;
}
-
- this._refreshCorners( create );
},
- //create a string for ID/subpage url creation
- _idStringEscape: function ( str ) {
- return str.replace(/\W/g , "-");
+ _addEvent: function () {
+ var self = this,
+ view = self.element,
+ option = self.options,
+ viewElement = view[0],
+ isVideo = self._isVideo,
+ control = view.parent( ".ui-multimediaview-wrap" ).find( ".ui-multimediaview-control" ),
+ playpauseButton = control.find( ".ui-playpausebutton" ),
+ timestampLabel = control.find( ".ui-timestamplabel" ),
+ durationLabel = control.find( ".ui-durationlabel" ),
+ volumeButton = control.find( ".ui-volumebutton" ),
+ volumeControl = control.find( ".ui-volumecontrol" ),
+ volumeBar = volumeControl.find( ".ui-volumebar" ),
+ volumeGuide = volumeControl.find( ".ui-guide" ),
+ volumeHandle = volumeControl.find( ".ui-handle" ),
+ fullscreenButton = control.find( ".ui-fullscreenbutton" ),
+ seekBar = control.find( ".ui-seekbar" ),
+ durationBar = seekBar.find( ".ui-duration" ),
+ currenttimeBar = seekBar.find( ".ui-currenttime" ),
+ $document = $( document );
- },
+ $document.unbind( ".multimediaview" ).bind( "pagechange.multimediaview", function ( e ) {
+ var $page = $( e.target );
+ if ( $page.find( view ).length > 0 && viewElement.autoplay ) {
+ viewElement.play();
+ }
- _createSubPages: function () {
- var parentList = this.element,
- parentPage = parentList.closest( ".ui-page" ),
- parentUrl = parentPage.jqmData( "url" ),
- parentId = parentUrl || parentPage[ 0 ][ $.expando ],
- parentListId = parentList.attr( "id" ),
- o = this.options,
- dns = "data-" + $.mobile.ns,
- self = this,
- persistentFooterID = parentPage.find( ":jqmData(role='footer')" ).jqmData( "id" ),
- hasSubPages,
- newRemove;
+ if ( option.controls ) {
+ self._resize();
+ }
+ }).bind( "pagebeforechange.multimediaview", function ( e ) {
+ if ( option.fullScreen ) {
+ self.fullScreen( !option.fullScreen );
+ }
- if ( typeof listCountPerPage[ parentId ] === "undefined" ) {
- listCountPerPage[ parentId ] = -1;
- }
+ if ( viewElement.played.length !== 0 ) {
+ viewElement.pause();
+ }
+ });
- parentListId = parentListId || ++listCountPerPage[ parentId ];
+ $( window ).unbind( ".multimediaview" ).bind( "resize.multimediaview orientationchange.multimediaview", function ( e ) {
+ if ( !option.controls ) {
+ return;
+ }
+ var $page = $( e.target ),
+ $scrollview = view.parents( ".ui-scrollview-clip" );
- $( parentList.find( "li>ul, li>ol" ).toArray().reverse() ).each(function ( i ) {
- var self = this,
- list = $( this ),
- listId = list.attr( "id" ) || parentListId + "-" + i,
- parent = list.parent(),
- nodeEls,
- title = nodeEls.first().getEncodedText(),//url limits to first 30 chars of text
- id = ( parentUrl || "" ) + "&" + $.mobile.subPageUrlKey + "=" + listId,
- theme = list.jqmData( "theme" ) || o.theme,
- countTheme = list.jqmData( "counttheme" ) || parentList.jqmData( "counttheme" ) || o.countTheme,
- newPage,
- anchor;
+ $scrollview.each( function ( i ) {
+ if ( $.data( this, "scrollview" ) ) {
+ $( this ).scrollview( "scrollTo", 0, 0 );
+ }
+ });
- nodeEls = $( list.prevAll().toArray().reverse() );
- nodeEls = nodeEls.length ? nodeEls : $( "<span>" + $.trim(parent.contents()[ 0 ].nodeValue) + "</span>" );
+ // for maintaining page layout
+ if ( !option.fullScreen ) {
+ $( ".ui-footer:visible" ).show();
+ } else {
+ $( ".ui-footer" ).hide();
+ self._fitContentArea( $page );
+ }
- //define hasSubPages for use in later removal
- hasSubPages = true;
+ if ( control.css( "display" ) !== "none" ) {
+ self._resize();
+ }
+ });
- newPage = list.detach()
- .wrap( "<div " + dns + "role='page' " + dns + "url='" + id + "' " + dns + "theme='" + theme + "' " + dns + "count-theme='" + countTheme + "'><div " + dns + "role='content'></div></div>" )
- .parent()
- .before( "<div " + dns + "role='header' " + dns + "theme='" + o.headerTheme + "'><div class='ui-title'>" + title + "</div></div>" )
- .after( persistentFooterID ? $( "<div " + dns + "role='footer' " + dns + "id='" + persistentFooterID + "'>" ) : "" )
- .parent()
- .appendTo( $.mobile.pageContainer );
+ view.bind( "loadedmetadata.multimediaview", function ( e ) {
+ if ( !isNaN( viewElement.duration ) ) {
+ durationLabel.find( "p" ).text( self._convertTimeFormat( viewElement.duration ) );
+ }
+ self._resize();
+ }).bind( "timeupdate.multimediaview", function ( e ) {
+ self._updateSeekBar();
+ }).bind( "play.multimediaview", function ( e ) {
+ playpauseButton.removeClass( "ui-play-icon" ).addClass( "ui-pause-icon" );
+ }).bind( "pause.multimediaview", function ( e ) {
+ playpauseButton.removeClass( "ui-pause-icon" ).addClass( "ui-play-icon" );
+ }).bind( "ended.multimediaview", function ( e ) {
+ if ( typeof viewElement.loop == "undefined" || viewElement.loop === "" ) {
+ self.stop();
+ }
+ }).bind( "volumechange.multimediaview", function ( e ) {
+ if ( viewElement.muted && viewElement.volume > 0.1 ) {
+ volumeButton.removeClass( "ui-volume-icon" ).addClass( "ui-mute-icon" );
+ self._reserveVolume = viewElement.volume;
+ viewElement.volume = 0;
+ } else if ( self._reserveVolume !== -1 && !viewElement.muted ) {
+ volumeButton.removeClass( "ui-mute-icon" ).addClass( "ui-volume-icon" );
+ viewElement.volume = self._reserveVolume;
+ self._reserveVolume = -1;
+ } else if ( viewElement.volume < 0.1 ) {
+ volumeButton.removeClass( "ui-volume-icon" ).addClass( "ui-mute-icon" );
+ } else {
+ volumeButton.removeClass( "ui-mute-icon" ).addClass( "ui-volume-icon" );
+ }
- newPage.page();
+ if ( !self.isVolumeHide ) {
+ self._updateVolumeState();
+ }
+ }).bind( "durationchange.multimediaview", function ( e ) {
+ if ( !isNaN( viewElement.duration ) ) {
+ durationLabel.find( "p" ).text( self._convertTimeFormat( viewElement.duration ) );
+ }
+ self._resize();
+ }).bind( "click.multimediaview", function ( e ) {
+ if ( !self.options.controls ) {
+ return;
+ }
- anchor = parent.find('a:first');
+ control.fadeToggle( "fast" );
+ self._resize();
+ }).bind( "multimediaviewinit", function ( e ) {
+ if ( option.controls ) {
+ control.show();
+ }
+ self._resize();
+ });
- if ( !anchor.length ) {
- anchor = $( "<a/>" ).html( nodeEls || title ).prependTo( parent.empty() );
+ playpauseButton.bind( "click.multimediaview", function () {
+ self._endTimer();
+
+ if ( viewElement.paused ) {
+ viewElement.play();
+ } else {
+ viewElement.pause();
}
- anchor.attr( "href", "#" + id );
+ if ( isVideo ) {
+ self._startTimer();
+ }
+ });
- }).extendablelist();
+ fullscreenButton.bind( "click.multimediaview", function ( e ) {
+ e.preventDefault();
+ self.fullScreen( !self.options.fullScreen );
+ control.fadeIn( "fast", function () {
+ self._resize();
+ });
+ self._endTimer();
+ e.stopPropagation();
+ });
- // on pagehide, remove any nested pages along with the parent page, as long as they aren't active
- // and aren't embedded
- if ( hasSubPages &&
- parentPage.is( ":jqmData(external-page='true')" ) &&
- parentPage.data( "page" ).options.domCache === false ) {
+ seekBar.bind( "vmousedown.multimediaview", function ( e ) {
+ var x = e.clientX,
+ duration = viewElement.duration,
+ durationOffset = durationBar.offset(),
+ durationWidth = durationBar.width(),
+ timerate = ( x - durationOffset.left ) / durationWidth,
+ time = duration * timerate;
- newRemove = function ( e, ui ) {
- var nextPage = ui.nextPage, npURL;
+ if ( !viewElement.played.length ) {
+ return;
+ }
- if ( ui.nextPage ) {
- npURL = nextPage.jqmData( "url" );
- if ( npURL.indexOf( parentUrl + "&" + $.mobile.subPageUrlKey ) !== 0 ) {
- self.childPages().remove();
- parentPage.remove();
- }
- }
- };
+ viewElement.currentTime = time;
- // unbind the original page remove and replace with our specialized version
- parentPage
- .unbind( "pagehide.remove" )
- .bind( "pagehide.remove", newRemove);
- }
- },
+ self._endTimer();
- // TODO sort out a better way to track sub pages of the extendable listview this is brittle
- childPages: function () {
- var parentUrl = this.parentPage.jqmData( "url" );
+ e.preventDefault();
- return $( ":jqmData(url^='" + parentUrl + "&" + $.mobile.subPageUrlKey + "')" );
- }
- });
+ $document.bind( "vmousemove.multimediaview", function ( e ) {
+ var x = e.clientX,
+ timerate = ( x - durationOffset.left ) / durationWidth;
- //auto self-init widgets
- $( document ).bind( "pagecreate create", function ( e ) {
- $( $.tizen.extendablelist.prototype.options.initSelector, e.target ).extendablelist();
- });
+ viewElement.currentTime = duration * timerate;
-}( jQuery ));
-/*
- * jQuery Mobile Widget @VERSION
- *
- * This software is licensed under the MIT licence (as defined by the OSI at
- * http://www.opensource.org/licenses/mit-license.php)
- *
- * ***************************************************************************
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
- * Copyright (c) 2011 by Intel Corporation Ltd.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- * ***************************************************************************
- *
- * Authors: Elliot Smith <elliot.smith@intel.com>
- */
+ e.preventDefault();
+ }).bind( "vmouseup.multimediaview", function () {
+ $document.unbind( "vmousemove.multimediaview vmouseup.multimediaview" );
+ if ( viewElement.paused ) {
+ viewElement.pause();
+ } else {
+ viewElement.play();
+ }
+ });
+ });
-// fastscroll is a scrollview controller, which binds
-// a scrollview to a a list of short cuts; the shortcuts are built
-// from the text on dividers in the list. Clicking on a shortcut
-// instantaneously jumps the scrollview to the selected list divider;
-// mouse movements on the shortcut column move the scrollview to the
-// list divider matching the text currently under the touch; a popup
-// with the text currently under the touch is also displayed.
-//
-// To apply, add the attribute data-fastscroll="true" to a listview
-// (a <ul> or <ol> element inside a page). Alternatively, call
-// fastscroll() on an element.
-//
-// The closest element with class ui-scrollview-clip is used as the
-// scrollview to be controlled.
-//
-// If a listview has no dividers or a single divider, the widget won't
-// display.
+ volumeButton.bind( "click.multimediaview", function () {
+ if ( self.isVolumeHide ) {
+ var view = self.element,
+ volume = viewElement.volume;
-/**
- @class fastscroll
- The shortcut scroll widget shows a shortcut list that is bound to its parent scroll bar and respective list view. This widget is displayed as a text pop-up representing shortcuts to different list dividers in the list view. If you select a shortcut text from the shortcut scroll, the parent list view is moved to the location representing the selected shortcut.
+ self.isVolumeHide = false;
+ volumeControl.fadeIn( "fast", function () {
+ self._updateVolumeState();
+ self._updateSeekBar();
+ });
+ self._resize();
+ } else {
+ self.isVolumeHide = true;
+ volumeControl.fadeOut( "fast", function () {
+ self._resize();
+ });
+ }
+ });
- To add a shortcut scroll widget to the application, use the following code:
+ volumeBar.bind( "vmousedown.multimediaview", function ( e ) {
+ var baseX = e.clientX,
+ volumeGuideLeft = volumeGuide.offset().left,
+ volumeGuideWidth = volumeGuide.width(),
+ volumeBase = volumeGuideLeft + volumeGuideWidth,
+ handlerOffset = volumeHandle.offset(),
+ volumerate = ( baseX - volumeGuideLeft ) / volumeGuideWidth,
+ currentVolume = ( baseX - volumeGuideLeft ) / volumeGuideWidth;
- <div class="content" data-role="content" data-scroll="y">
- <ul id="contacts" data-role="listview" data-fastscroll="true">
- <li>Anton</li>
- </ul>
- </div>
+ self._endTimer();
+ self._setVolume( currentVolume.toFixed( 2 ) );
- For the shortcut scroll widget to be visible, the parent list view must have multiple list dividers.
-*/
+ e.preventDefault();
-/**
- @property {Boolean} data-fastscroll
- When set to true, creates a shortcut scroll using the HTML unordered list (<ul>) element.
-*/
-/**
- @method fastscroll
- The shortcut scroll is created for the closest list view with the ui-scrollview-clip class.
-*/
-(function ( $, undefined ) {
+ $document.bind( "vmousemove.multimediaview", function ( e ) {
+ var currentX = e.clientX,
+ currentVolume = ( currentX - volumeGuideLeft ) / volumeGuideWidth;
- $.widget( "tizen.fastscroll", $.mobile.widget, {
- options: {
- initSelector: ":jqmData(fastscroll)"
- },
+ self._setVolume( currentVolume.toFixed( 2 ) );
- _create: function () {
- var $el = this.element,
- self = this,
- $popup,
- page = $el.closest( ':jqmData(role="page")' ),
- jumpToDivider;
-
- this.scrollview = $el.closest( '.ui-scrollview-clip' );
- this.shortcutsContainer = $( '<div class="ui-fastscroll"/>' );
- this.shortcutsList = $( '<ul></ul>' );
+ e.preventDefault();
+ }).bind( "vmouseup.multimediaview", function () {
+ $document.unbind( "vmousemove.multimediaview vmouseup.multimediaview" );
+ });
+ });
+ },
- // popup for the hovering character
- this.scrollview.append($( '<div class="ui-fastscroll-popup"></div>' ) );
- $popup = this.scrollview.find( '.ui-fastscroll-popup' );
+ _removeEvent: function () {
+ var view = this.element,
+ control = view.parent( ".ui-multimediaview-wrap" ).find( ".ui-multimediaview-control" ),
+ playpauseButton = control.find( ".ui-playpausebutton" ),
+ fullscreenButton = control.find( ".ui-fullscreenbutton" ),
+ seekBar = control.find( ".ui-seekbar" ),
+ volumeControl = control.find( ".ui-volumecontrol" ),
+ volumeBar = volumeControl.find( ".ui-volumebar" ),
+ volumeHandle = volumeControl.find( ".ui-handle" );
- this.shortcutsContainer.append( this.shortcutsList );
- this.scrollview.append( this.shortcutsContainer );
+ view.unbind( ".multimediaview" );
+ playpauseButton.unbind( ".multimediaview" );
+ fullscreenButton.unbind( ".multimediaview" );
+ seekBar.unbind( ".multimediaview" );
+ volumeBar.unbind( ".multimediaview" );
+ volumeHandle.unbind( ".multimediaview" );
+ },
- // find the bottom of the last item in the listview
- this.lastListItem = $el.children().last();
+ _createControl: function () {
+ var view = this.element,
+ viewElement = view[0],
+ control = $( "<span></span>" ).addClass( "ui-multimediaview-control" ),
+ playpauseButton = $( "<span></span>" ).addClass( "ui-playpausebutton ui-button" ),
+ seekBar = $( "<span></span>" ).addClass( "ui-seekbar ui-multimediaview-bar" ),
+ timestampLabel = $( "<span><p>00:00:00</p></span>" ).addClass( "ui-timestamplabel" ),
+ durationLabel = $( "<span><p>00:00:00</p></span>" ).addClass( "ui-durationlabel" ),
+ volumeButton = $( "<span></span>" ).addClass( "ui-volumebutton ui-button" ),
+ volumeControl = $( "<span></span>" ).addClass( "ui-volumecontrol" ),
+ volumeBar = $( "<div></div>" ).addClass( "ui-volumebar ui-multimediaview-bar" ),
+ volumeGuide = $( "<span></span>" ).addClass( "ui-guide ui-multimediaview-bar-bg" ),
+ volumeValue = $( "<span></span>" ).addClass( "ui-value ui-multimediaview-bar-highlight" ),
+ volumeHandle = $( "<span></span>" ).addClass( "ui-handle" ),
+ fullscreenButton = $( "<span></span>" ).addClass( "ui-fullscreenbutton ui-button" ),
+ durationBar = $( "<span></span>" ).addClass( "ui-duration ui-multimediaview-bar-bg" ),
+ currenttimeBar = $( "<span></span>" ).addClass( "ui-currenttime ui-multimediaview-bar-highlight" );
- // remove scrollbars from scrollview
- this.scrollview.find( '.ui-scrollbar' ).hide();
+ seekBar.append( durationBar ).append( currenttimeBar ).append( durationLabel ).append( timestampLabel );
- jumpToDivider = function ( divider ) {
- // get the vertical position of the divider (so we can scroll to it)
- var dividerY = $( divider ).position().top,
- // find the bottom of the last list item
- bottomOffset = self.lastListItem.outerHeight( true ) + self.lastListItem.position().top,
- scrollviewHeight = self.scrollview.height(),
+ playpauseButton.addClass( "ui-play-icon" );
+ volumeButton.addClass( viewElement.muted ? "ui-mute-icon" : "ui-volume-icon" );
+ volumeBar.append( volumeGuide ).append( volumeValue ).append( volumeHandle );
+ volumeControl.append( volumeBar );
- // check that after the candidate scroll, the bottom of the
- // last item will still be at the bottom of the scroll view
- // and not some way up the page
- maxScroll = bottomOffset - scrollviewHeight,
- dstOffset;
+ control.append( playpauseButton ).append( seekBar ).append( volumeControl ).append( volumeButton );
- dividerY = ( dividerY > maxScroll ? maxScroll : dividerY );
+ if ( this._isVideo ) {
+ $( fullscreenButton ).addClass( "ui-fullscreen-on" );
+ control.append( fullscreenButton );
+ }
+ volumeControl.hide();
- // don't apply a negative scroll, as this means the
- // divider should already be visible
- dividerY = Math.max( dividerY, 0 );
+ return control;
+ },
- // apply the scroll
- self.scrollview.scrollview( 'scrollTo', 0, -dividerY );
+ _startTimer: function ( duration ) {
+ this._endTimer();
- dstOffset = self.scrollview.offset();
- $popup
- .text( $( divider ).text() )
- .css( { marginLeft: -($popup.width() / 2),
- marginTop: -($popup.height() / 2) } )
- .show();
- };
+ if ( !duration ) {
+ duration = 3000;
+ }
- this.shortcutsList
- // bind mouse over so it moves the scroller to the divider
- .bind( 'touchstart mousedown vmousedown touchmove vmousemove vmouseover ', function ( e ) {
- // Get coords relative to the element
- var coords = $.mobile.tizen.targetRelativeCoordsFromEvent( e ),
- shortcutsListOffset = self.shortcutsList.offset();
+ var self = this,
+ view = self.element,
+ control = view.parent( ".ui-multimediaview-wrap" ).find( ".ui-multimediaview-control" ),
+ volumeControl = control.find( ".ui-volumecontrol" );
- // If the element is a list item, get coordinates relative to the shortcuts list
- if ( e.target.tagName.toLowerCase() === "li" ) {
- coords.x += $( e.target ).offset().left - shortcutsListOffset.left;
- coords.y += $( e.target ).offset().top - shortcutsListOffset.top;
- }
+ self.controlTimer = setTimeout( function () {
+ self.isVolumeHide = true;
+ self.controlTimer = null;
+ volumeControl.hide();
+ control.fadeOut( "fast" );
+ }, duration );
+ },
- self.shortcutsList.find( 'li' ).each( function () {
- var listItem = $( this );
- $( listItem )
- .removeClass( "ui-fastscroll-hover" )
- .removeClass( "ui-fastscroll-hover-up" )
- .removeClass( "ui-fastscroll-hover-down" );
- });
- // Hit test each list item
- self.shortcutsList.find( 'li' ).each( function () {
- var listItem = $( this ),
- l = listItem.offset().left - shortcutsListOffset.left,
- t = listItem.offset().top - shortcutsListOffset.top,
- r = l + Math.abs(listItem.outerWidth( true ) ),
- b = t + Math.abs(listItem.outerHeight( true ) );
+ _endTimer: function () {
+ if ( this.controlTimer ) {
+ clearTimeout( this.controlTimer );
+ this.controlTimer = null;
+ }
+ },
- if ( coords.x >= l && coords.x <= r && coords.y >= t && coords.y <= b ) {
- jumpToDivider( $( listItem.data( 'divider' ) ) );
- $( listItem ).addClass( "ui-fastscroll-hover" );
- if ( listItem.index() > 0 ) {
- $( listItem ).siblings().eq( listItem.index() - 1 ).addClass( "ui-fastscroll-hover-up" );
- }
- $( listItem ).siblings().eq( listItem.index() ).addClass( "ui-fastscroll-hover-down" );
- return false;
- }
- return true;
- } );
+ _convertTimeFormat: function ( systime ) {
+ if ( !$.isNumeric( systime ) ) {
+ return "Playback Error";
+ }
+ var ss = parseInt( systime % 60, 10 ).toString(),
+ mm = parseInt( ( systime / 60 ) % 60, 10 ).toString(),
+ hh = parseInt( systime / 3600, 10 ).toString(),
+ time = ( ( hh.length < 2 ) ? "0" + hh : hh ) + ":" +
+ ( ( mm.length < 2 ) ? "0" + mm : mm ) + ":" +
+ ( ( ss.length < 2 ) ? "0" + ss : ss );
+ return time;
+ },
- e.preventDefault();
- e.stopPropagation();
- } )
- // bind mouseout of the fastscroll container to remove popup
- .bind( 'touchend mouseup vmouseup vmouseout', function () {
- $popup.hide();
- } );
+ _updateSeekBar: function ( currenttime ) {
+ var view = this.element,
+ viewElement = view[0],
+ duration = viewElement.duration,
+ control = view.parent( ".ui-multimediaview-wrap" ).find( ".ui-multimediaview-control" ),
+ seekBar = control.find( ".ui-seekbar" ),
+ durationBar = seekBar.find( ".ui-duration" ),
+ currenttimeBar = seekBar.find( ".ui-currenttime" ),
+ timestampLabel = control.find( ".ui-timestamplabel" ),
+ durationOffset = durationBar.offset(),
+ durationWidth = durationBar.width(),
+ durationHeight = durationBar.height(),
+ timebarWidth = 0;
- if ( page && !( page.is( ':visible' ) ) ) {
- page.bind( 'pageshow', function () { self.refresh(); } );
- } else {
- this.refresh();
+ if ( typeof currenttime === "undefined" ) {
+ currenttime = viewElement.currentTime;
}
+ timebarWidth = parseInt( currenttime / duration * durationWidth, 10 );
+ durationBar.offset( durationOffset );
+ currenttimeBar.offset( durationOffset ).width( timebarWidth );
+ timestampLabel.find( "p" ).text( this._convertTimeFormat( currenttime ) );
+ },
- // refresh the list when dividers are filtered out
- $el.bind( 'updatelayout', function () {
- self.refresh();
- } );
+ _updateVolumeState: function () {
+ var view = this.element,
+ control = view.parent( ".ui-multimediaview-wrap" ).find( ".ui-multimediaview-control" ),
+ volumeControl = control.find( ".ui-volumecontrol" ),
+ volumeButton = control.find( ".ui-volumebutton" ),
+ volumeBar = volumeControl.find( ".ui-volumebar" ),
+ volumeGuide = volumeControl.find( ".ui-guide" ),
+ volumeValue = volumeControl.find( ".ui-value" ),
+ volumeHandle = volumeControl.find( ".ui-handle" ),
+ handlerWidth = volumeHandle.width(),
+ handlerHeight = volumeHandle.height(),
+ volumeGuideHeight = volumeGuide.height(),
+ volumeGuideWidth = volumeGuide.width(),
+ volumeGuideTop = 0,
+ volumeGuideLeft = 0,
+ volumeBase = 0,
+ handlerOffset = null,
+ volume = view[0].volume;
+
+ volumeGuideTop = parseInt( volumeGuide.offset().top, 10 );
+ volumeGuideLeft = parseInt( volumeGuide.offset().left, 10 );
+ volumeBase = volumeGuideLeft;
+ handlerOffset = volumeHandle.offset();
+ handlerOffset.top = volumeGuideTop - parseInt( ( handlerHeight - volumeGuideHeight ) / 2, 10 );
+ handlerOffset.left = volumeBase + parseInt( volumeGuideWidth * volume, 10 ) - parseInt( handlerWidth / 2, 10 );
+ volumeHandle.offset( handlerOffset );
+ volumeValue.offset( volumeGuide.offset() ).width( parseInt( volumeGuideWidth * ( volume ), 10 ) );
},
- refresh: function () {
- var self = this,
- shortcutsTop,
- minClipHeight,
- dividers,
- listItems;
+ _setVolume: function ( value ) {
+ var viewElement = this.element[0];
- this.shortcutsList.find( 'li' ).remove();
+ if ( value < 0.0 || value > 1.0 ) {
+ return;
+ }
- // get all the dividers from the list and turn them into shortcuts
- dividers = this.element.find( '.ui-li-divider' );
+ viewElement.volume = value;
+ },
- // get all the list items
- listItems = this.element.find('li').not('.ui-li-divider');
+ _fitContentArea: function ( page, parent ) {
+ if ( typeof parent === "undefined" ) {
+ parent = window;
+ }
- // only use visible dividers
- dividers = dividers.filter( ':visible' );
- listItems = listItems.filter( ':visible' );
+ var $page = $( page ),
+ $content = $( ".ui-content:visible:first" ),
+ hh = $( ".ui-header:visible" ).outerHeight() || 0,
+ fh = $( ".ui-footer:visible" ).outerHeight() || 0,
+ pt = parseFloat( $content.css( "padding-top" ) ),
+ pb = parseFloat( $content.css( "padding-bottom" ) ),
+ wh = ( ( parent === window ) ? window.innerHeight : $( parent ).height() ),
+ height = wh - ( hh + fh ) - ( pt + pb );
- if ( dividers.length < 2 ) {
- this.shortcutsList.hide();
+ $content.offset( {
+ top: ( hh + pt )
+ }).height( height );
+ },
+
+ width: function ( value ) {
+ if ( this.options.fullScreen ) {
return;
}
- this.shortcutsList.show();
+ var view = this.element,
+ wrap = view.parent( ".ui-multimediaview-wrap" );
- this.lastListItem = listItems.last();
+ if ( arguments.length === 0 ) {
+ return view.width();
+ }
- dividers.each( function ( index, divider ) {
- self.shortcutsList
- .append( $( '<li>' + $( divider ).text() + '</li>' )
- .data( 'divider', divider ) );
- } );
+ if ( !this._isVideo ) {
+ wrap.width( value );
+ }
- // position the shortcut flush with the top of the first list divider
- shortcutsTop = dividers.first().position().top;
- this.shortcutsContainer.css( 'top', shortcutsTop );
+ view.width( value );
+ this._resize();
+ },
- // make the scrollview clip tall enough to show the whole of the shortcutslist
- minClipHeight = shortcutsTop + this.shortcutsContainer.outerHeight() + 'px';
- this.scrollview.css( 'min-height', minClipHeight );
- }
- } );
+ height: function ( value ) {
+ if ( !this._isVideo || this.options.fullScreen ) {
+ return;
+ }
- $( document ).bind( "pagecreate create", function ( e ) {
- $( $.tizen.fastscroll.prototype.options.initSelector, e.target )
- .not( ":jqmData(role='none'), :jqmData(role='nojs')" )
- .fastscroll();
- } );
+ var view = this.element;
-} ( jQuery ) );
-/* ***************************************************************************
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- * ***************************************************************************
- *
- * Author: Minkyu Kang <mk7.kang@samsung.com>
- */
+ if ( arguments.length === 0 ) {
+ return view.height();
+ }
-/*
- * Gallery widget
- *
- * HTML Attributes
- *
- * data-role: set to 'gallery'
- * data-index: start index
- * data-vertical-align: set to top or middle or bottom.
- *
- * APIs
- *
- * add(file): add the image (parameter: url of iamge)
- * remove(index): remove the image (parameter: index of image)
- * refresh(index): refresh the widget, should be called after add or remove. (parameter: start index)
- * empty: remove all of images from the gallery
- * length: get length of images
- * value(index): get or set current index of gallery (parameter: index of image)
- *
- * Events
- *
- * N/A
- *
- * Example
- *
- * <div data-role="gallery" id="gallery" data-index="3" data-vertical-align="middle">
- * <img src="01.jpg">
- * <img src="02.jpg">
- * <img src="03.jpg">
- * <img src="04.jpg">
- * <img src="05.jpg">
- * </div>
- *
- *
- * $('#gallery-add').bind('vmouseup', function ( e ) {
- * $('#gallery').gallery('add', '9.jpg');
- * $('#gallery').gallery('add', '10.jpg');
- * $('#gallery').gallery('refresh');
- * });
- *
- * $('#gallery-del').bind('vmouseup', function ( e ) {
- * $('#gallery').gallery('remove');
- * });
- *
- */
+ view.height( value );
+ this._resize();
+ },
- /**
- @class Gallery
- The gallery widget shows images in a gallery on the screen. <br/><br/> To add an gallery widget to the application, use the following code:
+ fullScreen: function ( value ) {
+ if ( !this._isVideo ) {
+ return;
+ }
- <div data-role="gallery" id="gallery" data-vertical-align="middle" data-index="3">
- <img src="01.jpg">
- <img src="02.jpg">
- <img src="03.jpg">
- <img src="04.jpg">
- <img src="05.jpg">
- </div>
-*/
-/**
- @property {Integer} data-index
- Defines the index number of the first image in the gallery.
- <br/>The default value is 0.
-*/
-/**
- @property {String} data-vertical-align
- Defines the image alignment. The alignment options are top, middle, and bottom.
- <br/>The default value is top.
-*/
-/**
- @method add
- The add method is used to add an image to the gallery. The image_file attribute defines the image file URL.
+ var view = this.element,
+ option = this.options;
- <div id="gallery" data-role="gallery" data-vertical-align="middle"></div>
- $("#gallery").gallery('add', [image_file]);
-*/
-/**
- @method remove
- The remove method is used to delete an image from the gallery. The image_index attribute defines the index of the image to be deleted. If not set removes current image.
+ if ( arguments.length === 0 ) {
+ return option.fullScreen;
+ }
- <div id="gallery" data-role="gallery" data-vertical-align="middle"></div>
- $("#gallery").gallery('remove', [image_index]);
-*/
-/**
- @method refresh
- The refresh method is used to refresh the gallery. This method must be called after adding images to the gallery.
+ view.parents( ".ui-scrollview-clip" ).scrollview( "scrollTo", 0, 0 );
- <div id="gallery" data-role="gallery" data-vertical-align="middle"></div>
- $("#gallery").gallery('refresh');
-*/
-/**
- @method empty
- The empty method is used to remove all of images from the gallery.
+ this.options.fullScreen = value;
- <div id="gallery" data-role="gallery" data-vertical-align="middle"></div>
- $("#gallery").gallery('empty');
-*/
-/**
- @method length
- The length method is used to get length of images.
+ this._resize();
+ },
- <div id="gallery" data-role="gallery" data-vertical-align="middle"></div>
- length = $("#gallery").gallery('length');
-*/
-/**
- @method value
- The value method is used to get or set current index of gallery. The image_index attribute defines the index of the image to be set. If not get current index.
+ refresh: function () {
+ this._resize();
+ }
+ });
- <div id="gallery" data-role="gallery" data-vertical-align="middle"></div>
- value = $("#gallery").gallery('value');
- $("#gallery").gallery('value', [image_index]);
-*/
-(function ( $, window, undefined ) {
- $.widget( "tizen.gallery", $.mobile.widget, {
- options: {
- flicking: false,
- duration: 500
- },
+ $( document ).bind( "pagecreate create", function ( e ) {
+ $.tizen.multimediaview.prototype.enhanceWithin( e.target );
+ });
+} ( jQuery, document, window ) );
- dragging: false,
- moving: false,
- max_width: 0,
- max_height: 0,
- org_x: 0,
- org_time: null,
- cur_img: null,
- prev_img: null,
- next_img: null,
- images: [],
- images_hold: [],
- index: 0,
- align_type: null,
- direction: 1,
- container: null,
- _resize: function ( index ) {
- var img = this.images[index],
- width = this.images[index].width(),
- height = this.images[index].height(),
- margin = 0,
- ratio,
- img_max_width = this.max_width - margin,
- img_max_height = this.max_height - margin;
- ratio = height / width;
+/*
+ * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL licenses
+ * http://phpjs.org/functions/range
+ * original by: Waldo Malqui Silva
+ * version: 1107.2516
+ */
+function range( low, high, step ) {
+ // Create an array containing the range of integers or characters
+ // from low to high (inclusive)
+ //
+ // version: 1107.2516
+ // discuss at: http://phpjs.org/functions/range
+ // + original by: Waldo Malqui Silva
+ // * example 1: range ( 0, 12 );
+ // * returns 1: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
+ // * example 2: range( 0, 100, 10 );
+ // * returns 2: [0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100]
+ // * example 3: range( 'a', 'i' );
+ // * returns 3: ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i']
+ // * example 4: range( 'c', 'a' );
+ // * returns 4: ['c', 'b', 'a']
+ var matrix = [],
+ inival,
+ endval,
+ plus,
+ walker = step || 1,
+ chars = false;
- if ( width > img_max_width ) {
- img.width( img_max_width );
- img.height( img_max_width * ratio );
- }
+ if (!isNaN(low) && !isNaN(high)) {
+ inival = low;
+ endval = high;
+ } else if (isNaN(low) && isNaN(high)) {
+ chars = true;
+ inival = low.charCodeAt(0);
+ endval = high.charCodeAt(0);
+ } else {
+ inival = (isNaN(low) ? 0 : low);
+ endval = (isNaN(high) ? 0 : high);
+ }
- height = img.height();
+ plus = ((inival > endval) ? false : true);
+ if (plus) {
+ while (inival <= endval) {
+ matrix.push(((chars) ? String.fromCharCode(inival) : inival));
+ inival += walker;
+ }
+ } else {
+ while (inival >= endval) {
+ matrix.push(((chars) ? String.fromCharCode(inival) : inival));
+ inival -= walker;
+ }
+ }
- if ( height > img_max_height ) {
- img.height( img_max_height );
- img.width( img_max_height / ratio );
- }
- },
+ return matrix;
+}
- _align: function ( index, obj ) {
- var img = this.images[index],
- img_top = 0;
- if ( !obj ) {
- return;
- }
- if ( !obj.length ) {
- return;
- }
- if ( this.align_type == "middle" ) {
- img_top = ( this.max_height - img.height() ) / 2;
- } else if ( this.align_type == "bottom" ) {
- img_top = this.max_height - img.height();
- } else {
- img_top = 0;
- }
+/*
+ * set TIZEN specific configures
+ */
- obj.css( 'top', img_top + 'px' );
- },
+( function( $, window, undefined ) {
- _attach: function ( index, obj ) {
- var self = this,
- processing = function () {
- self._resize( index );
- self._align( index, obj );
- },
- loading = function () {
- if ( self.images[index] === undefined ) {
- return;
- }
-
- if ( !self.images[index].height() ) {
- setTimeout( loading, 10 );
- return;
- }
-
- processing();
- };
-
- if ( !obj ) {
- return;
- }
- if ( !obj.length ) {
- return;
- }
- if ( index < 0 ) {
- return;
- }
- if ( !this.images.length ) {
- return;
- }
- if ( index >= this.images.length ) {
- return;
- }
-
- obj.css( "display", "block" );
- obj.append( this.images[index] );
-
- loading();
- },
+ /* set default transition */
+ $.mobile.defaultPageTransition = "none";
- _detach: function ( index, obj ) {
- if ( !obj ) {
- return;
- }
- if ( !obj.length ) {
- return;
- }
- if ( index < 0 ) {
- return;
- }
- if ( index >= this.images.length ) {
- return;
- }
+ /* depth transition */
+ $.mobile.transitionHandlers.depth = $.mobile.transitionHandlers.simultaneous;
+ $.mobile.transitionFallbacks.depth = "fade";
- obj.css( "display", "none" );
- this.images[index].removeAttr("style");
- this.images[index].detach();
- },
+ /* Button data-corners default value */
+ $.fn.buttonMarkup.defaults.corners = false;
- _detach_all: function () {
- var i;
+ /* button hover delay */
+ $.mobile.buttonMarkup.hoverDelay = 0;
- for ( i = 0; i < this.images.length; i++ ) {
- this.images[i].detach();
- }
- },
+})( jQuery, this );
- _drag: function ( _x ) {
- var delta,
- coord_x;
- if ( !this.dragging ) {
- return;
- }
- if ( this.options.flicking === false ) {
- delta = this.org_x - _x;
- // first image
- if ( delta < 0 && !this.prev_img.length ) {
- return;
- }
- // last image
- if ( delta > 0 && !this.next_img.length ) {
- return;
- }
- }
+(function($, undefined) {
- coord_x = _x - this.org_x;
+ensureNS("jQuery.mobile.tizen");
- this.cur_img.css( 'left', coord_x + 'px' );
- if ( this.next_img.length ) {
- this.next_img.css( 'left', coord_x + this.window_width + 'px' );
- }
- if ( this.prev_img.length ) {
- this.prev_img.css( 'left', coord_x - this.window_width + 'px' );
- }
- },
+jQuery.extend( jQuery.mobile.tizen,
+{
+ _widgetPrototypes: {},
- _move: function ( _x ) {
- var delta = this.org_x - _x,
- flip = 0,
- drag_time,
- sec,
- self;
+ /*
+ * load the prototype for a widget.
+ *
+ * If @widget is a string, the function looks for @widget.prototype.html in the proto-html/ subdirectory of the
+ * framework's current theme and loads the file via AJAX into a string. Note that the file will only be loaded via
+ * AJAX once. If two widget instances based on the same @widget value are to be constructed, the second will be
+ * constructed from the cached copy of the prototype of the first instance.
+ *
+ * If @widget is not a string, it is assumed to be a hash containing at least one key, "proto", the value of which is
+ * the string to be used for the widget prototype. if another key named "key" is also provided, it will serve as the
+ * key under which to cache the prototype, so it need not be rendered again in the future.
+ *
+ * Given the string for the widget prototype, the following patterns occurring in the string are replaced:
+ *
+ * "${FRAMEWORK_ROOT}" - replaced with the path to the root of the framework
+ *
+ * The function then creates a jQuery $("<div>") object containing the prototype from the string.
+ *
+ * If @ui is not provided, the jQuery object containing the prototype is returned.
+ *
+ * If @ui is provided, it is assumed to be a (possibly multi-level) hash containing CSS selectors. For every level of
+ * the hash and for each string-valued key at that level, the CSS selector specified as the value is sought in the
+ * prototype jQuery object and, if found, the value of the key is replaced with the jQuery object resulting from the
+ * search. Additionally, if the CSS selector is of the form "#widgetid", the "id" attribute will be removed from the
+ * elements contained within the resulting jQuery object. The resulting hash is returned.
+ *
+ * Examples:
+ *
+ * 1.
+ * $.mobile.tizen.loadPrototype("mywidget") => Returns a <div> containing the structure from the file
+ * mywidget.prototype.html located in the current theme folder of the current framework.
+ *
+ * 2. $.mobile.tizen.loadPrototype("mywidget", ui):
+ * where ui is a hash that looks like this:
+ * ui = {
+ * element1: "<css selector 1>",
+ * element2: "<css selector 2>",
+ * group1: {
+ * group1element1: "<css selector 3>",
+ * group1element1: "<css selector 4>"
+ * }
+ * ...
+ * }
+ *
+ * In this case, after loading the prototype as in Example 1, loadPrototype will traverse @ui and replace the CSS
+ * selector strings with the result of the search for the selector string upon the prototype. If any of the CSS
+ * selectors are of the form "#elementid" then the "id" attribute will be stripped from the elements selected. This
+ * means that they will no longer be accessible via the selector used initially. @ui is then returned thus modified.
+ */
- if ( delta == 0 ) {
- return;
- }
+ loadPrototype: function(widget, ui) {
+ var ret = undefined,
+ theScriptTag = $("script[data-framework-version][data-framework-root][data-framework-theme]"),
+ frameworkRootPath = theScriptTag.attr("data-framework-root") + "/" +
+ theScriptTag.attr("data-framework-version") + "/";
- if ( delta > 0 ) {
- flip = delta < ( this.max_width * 0.45 ) ? 0 : 1;
- } else {
- flip = -delta < ( this.max_width * 0.45 ) ? 0 : 1;
- }
+ function replaceVariables(s) {
+ return s.replace(/\$\{FRAMEWORK_ROOT\}/g, frameworkRootPath);
+ }
- if ( !flip ) {
- drag_time = Date.now() - this.org_time;
+ function fillObj(obj, uiProto) {
+ var selector;
- if ( Math.abs( delta ) / drag_time > 1 ) {
- flip = 1;
- }
- }
+ for (var key in obj) {
+ if (typeof obj[key] === "string") {
+ selector = obj[key];
+ obj[key] = uiProto.find(obj[key]);
+ if (selector.substring(0, 1) === "#")
+ obj[key].removeAttr("id");
+ }
+ else
+ if (typeof obj[key] === "object")
+ obj[key] = fillObj(obj[key], uiProto);
+ }
+ return obj;
+ }
- if ( flip ) {
- if ( delta > 0 && this.next_img.length ) {
- /* next */
- this._detach( this.index - 1, this.prev_img );
+ /* If @widget is a string ... */
+ if (typeof widget === "string") {
+ /* ... try to use it as a key into the cached prototype hash ... */
+ ret = $.mobile.tizen._widgetPrototypes[widget];
+ if (ret === undefined) {
+ /* ... and if the proto was not found, try to load its definition ... */
+ var protoPath = frameworkRootPath + "proto-html" + "/" +
+ theScriptTag.attr("data-framework-theme");
+ $.ajax({
+ url: protoPath + "/" + widget + ".prototype.html",
+ async: false,
+ dataType: "html"
+ })
+ .success(function(data, textStatus, jqXHR) {
+ /* ... and if loading succeeds, cache it and use a copy of it ... */
+ $.mobile.tizen._widgetPrototypes[widget] = $("<div>").html(replaceVariables(data));
+ ret = $.mobile.tizen._widgetPrototypes[widget].clone();
+ });
+ }
+ }
+ /* Otherwise ... */
+ else {
+ /* ... if a key was provided ... */
+ if (widget.key !== undefined)
+ /* ... try to use it as a key into the cached prototype hash ... */
+ ret = $.mobile.tizen._widgetPrototypes[widget.key];
- this.prev_img = this.cur_img;
- this.cur_img = this.next_img;
- this.next_img = this.next_img.next();
+ /* ... and if the proto was not found in the cache ... */
+ if (ret === undefined) {
+ /* ... and a proto definition string was provided ... */
+ if (widget.proto !== undefined) {
+ /* ... create a new proto from the definition ... */
+ ret = $("<div>").html(replaceVariables(widget.proto));
+ /* ... and if a key was provided ... */
+ if (widget.key !== undefined)
+ /* ... cache a copy of the proto under that key */
+ $.mobile.tizen._widgetPrototypes[widget.key] = ret.clone();
+ }
+ }
+ else
+ /* otherwise, if the proto /was/ found in the cache, return a copy of it */
+ ret = ret.clone();
+ }
- this.index++;
+ /* If the prototype was found/created successfully ... */
+ if (ret != undefined)
+ /* ... and @ui was provided */
+ if (ui != undefined)
+ /* ... return @ui, but replace the CSS selectors it contains with the elements they select */
+ ret = fillObj(ui, ret);
- if ( this.next_img.length ) {
- this.next_img.css( 'left', this.window_width + 'px' );
- this._attach( this.index + 1, this.next_img );
- }
+ return ret;
+ }
+});
+})(jQuery);
- this.direction = 1;
- } else if ( delta < 0 && this.prev_img.length ) {
- /* prev */
- this._detach( this.index + 1, this.next_img );
- this.next_img = this.cur_img;
- this.cur_img = this.prev_img;
- this.prev_img = this.prev_img.prev();
+/*
+ *
+ * This software is licensed under the MIT licence (as defined by the OSI at
+ * http://www.opensource.org/licenses/mit-license.php)
+ *
+ * ***************************************************************************
+ * Copyright (C) 2011 by Intel Corporation Ltd.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * ***************************************************************************
+ */
- this.index--;
+// Ensure that the given namespace is defined. If not, define it to be an empty object.
+// This is kinda like the mkdir -p command.
- if ( this.prev_img.length ) {
- this.prev_img.css( 'left', -this.window_width + 'px' );
- this._attach( this.index - 1, this.prev_img );
- }
+function ensureNS(ns) {
+ var nsAr = ns.split("."),
+ nsSoFar = "";
- this.direction = -1;
- }
- }
+ for (var Nix in nsAr) {
+ nsSoFar = nsSoFar + (Nix > 0 ? "." : "") + nsAr[Nix];
+ eval (nsSoFar + " = " + nsSoFar + " || {};");
+ }
+}
- sec = this.options.duration;
- self = this;
- this.moving = true;
- setTimeout( function () {
- self.moving = false;
- }, sec - 50 );
+ensureNS("jQuery.mobile.tizen.clrlib");
- this.cur_img.animate( { left: 0 }, sec );
- if ( this.next_img.length ) {
- this.next_img.animate( { left: this.window_width }, sec );
- }
- if ( this.prev_img.length ) {
- this.prev_img.animate( { left: -this.window_width }, sec );
- }
- },
+jQuery.extend( jQuery.mobile.tizen.clrlib,
+{
+ nearestInt: function(val) {
+ var theFloor = Math.floor(val);
- _add_event: function () {
- var self = this,
- date;
+ return (((val - theFloor) > 0.5) ? (theFloor + 1) : theFloor);
+ },
- this.container.bind( 'vmousemove', function ( e ) {
- e.preventDefault();
+ /*
+ * Converts html color string to rgb array.
+ *
+ * Input: string clr_str, where
+ * clr_str is of the form "#aabbcc"
+ *
+ * Returns: [ r, g, b ], where
+ * r is in [0, 1]
+ * g is in [0, 1]
+ * b is in [0, 1]
+ */
+ HTMLToRGB: function(clr_str) {
+ clr_str = (('#' == clr_str.charAt(0)) ? clr_str.substring(1) : clr_str);
- if ( self.moving ) {
- return;
- }
- if ( !self.dragging ) {
- return;
- }
+ return ([
+ clr_str.substring(0, 2),
+ clr_str.substring(2, 4),
+ clr_str.substring(4, 6)
+ ].map(function(val) {
+ return parseInt(val, 16) / 255.0;
+ }));
+ },
- self._drag( e.pageX );
- } );
+ /*
+ * Converts rgb array to html color string.
+ *
+ * Input: [ r, g, b ], where
+ * r is in [0, 1]
+ * g is in [0, 1]
+ * b is in [0, 1]
+ *
+ * Returns: string of the form "#aabbcc"
+ */
+ RGBToHTML: function(rgb) {
+ return ("#" +
+ rgb.map(function(val) {
+ var ret = val * 255,
+ theFloor = Math.floor(ret);
- this.container.bind( 'vmousedown', function ( e ) {
- e.preventDefault();
+ ret = ((ret - theFloor > 0.5) ? (theFloor + 1) : theFloor);
+ ret = (((ret < 16) ? "0" : "") + (ret & 0xff).toString(16));
+ return ret;
+ })
+ .join(""));
+ },
- if ( self.moving ) {
- return;
- }
+ /*
+ * Converts hsl to rgb.
+ *
+ * From http://130.113.54.154/~monger/hsl-rgb.html
+ *
+ * Input: [ h, s, l ], where
+ * h is in [0, 360]
+ * s is in [0, 1]
+ * l is in [0, 1]
+ *
+ * Returns: [ r, g, b ], where
+ * r is in [0, 1]
+ * g is in [0, 1]
+ * b is in [0, 1]
+ */
+ HSLToRGB: function(hsl) {
+ var h = hsl[0] / 360.0, s = hsl[1], l = hsl[2];
- self.dragging = true;
+ if (0 === s)
+ return [ l, l, l ];
- self.org_x = e.pageX;
+ var temp2 = ((l < 0.5)
+ ? l * (1.0 + s)
+ : l + s - l * s),
+ temp1 = 2.0 * l - temp2,
+ temp3 = {
+ r: h + 1.0 / 3.0,
+ g: h,
+ b: h - 1.0 / 3.0
+ };
- self.org_time = Date.now();
- } );
+ temp3.r = ((temp3.r < 0) ? (temp3.r + 1.0) : ((temp3.r > 1) ? (temp3.r - 1.0) : temp3.r));
+ temp3.g = ((temp3.g < 0) ? (temp3.g + 1.0) : ((temp3.g > 1) ? (temp3.g - 1.0) : temp3.g));
+ temp3.b = ((temp3.b < 0) ? (temp3.b + 1.0) : ((temp3.b > 1) ? (temp3.b - 1.0) : temp3.b));
- this.container.bind( 'vmouseup', function ( e ) {
- if ( self.moving ) {
- return;
- }
+ ret = [
+ (((6.0 * temp3.r) < 1) ? (temp1 + (temp2 - temp1) * 6.0 * temp3.r) :
+ (((2.0 * temp3.r) < 1) ? temp2 :
+ (((3.0 * temp3.r) < 2) ? (temp1 + (temp2 - temp1) * ((2.0 / 3.0) - temp3.r) * 6.0) :
+ temp1))),
+ (((6.0 * temp3.g) < 1) ? (temp1 + (temp2 - temp1) * 6.0 * temp3.g) :
+ (((2.0 * temp3.g) < 1) ? temp2 :
+ (((3.0 * temp3.g) < 2) ? (temp1 + (temp2 - temp1) * ((2.0 / 3.0) - temp3.g) * 6.0) :
+ temp1))),
+ (((6.0 * temp3.b) < 1) ? (temp1 + (temp2 - temp1) * 6.0 * temp3.b) :
+ (((2.0 * temp3.b) < 1) ? temp2 :
+ (((3.0 * temp3.b) < 2) ? (temp1 + (temp2 - temp1) * ((2.0 / 3.0) - temp3.b) * 6.0) :
+ temp1)))];
- self.dragging = false;
+ return ret;
+ },
- self._move( e.pageX );
- } );
+ /*
+ * Converts hsv to rgb.
+ *
+ * Input: [ h, s, v ], where
+ * h is in [0, 360]
+ * s is in [0, 1]
+ * v is in [0, 1]
+ *
+ * Returns: [ r, g, b ], where
+ * r is in [0, 1]
+ * g is in [0, 1]
+ * b is in [0, 1]
+ */
+ HSVToRGB: function(hsv) {
+ return $.mobile.tizen.clrlib.HSLToRGB($.mobile.tizen.clrlib.HSVToHSL(hsv));
+ },
- this.container.bind( 'vmouseout', function ( e ) {
- if ( self.moving ) {
- return;
- }
- if ( !self.dragging ) {
- return;
- }
+ /*
+ * Converts rgb to hsv.
+ *
+ * from http://coecsl.ece.illinois.edu/ge423/spring05/group8/FinalProject/HSV_writeup.pdf
+ *
+ * Input: [ r, g, b ], where
+ * r is in [0, 1]
+ * g is in [0, 1]
+ * b is in [0, 1]
+ *
+ * Returns: [ h, s, v ], where
+ * h is in [0, 360]
+ * s is in [0, 1]
+ * v is in [0, 1]
+ */
+ RGBToHSV: function(rgb) {
+ var min, max, delta, h, s, v, r = rgb[0], g = rgb[1], b = rgb[2];
- if ( ( e.pageX < 20 ) ||
- ( e.pageX > ( self.max_width - 20 ) ) ) {
- self._move( e.pageX );
- self.dragging = false;
- }
- } );
- },
+ min = Math.min(r, Math.min(g, b));
+ max = Math.max(r, Math.max(g, b));
+ delta = max - min;
- _del_event: function () {
- this.container.unbind( 'vmousemove' );
- this.container.unbind( 'vmousedown' );
- this.container.unbind( 'vmouseup' );
- this.container.unbind( 'vmouseout' );
- },
+ h = 0;
+ s = 0;
+ v = max;
- _show: function () {
- /* resizing */
- this.window_width = $( window ).width();
- this.max_width = this._get_width();
- this.max_height = this._get_height();
- this.container.css( 'height', this.max_height );
+ if (delta > 0.00001) {
+ s = delta / max;
- this.cur_img = $( 'div' ).find( '.ui-gallery-bg:eq(' + this.index + ')' );
- this.prev_img = this.cur_img.prev();
- this.next_img = this.cur_img.next();
+ if (r === max)
+ h = (g - b) / delta ;
+ else
+ if (g === max)
+ h = 2 + (b - r) / delta ;
+ else
+ h = 4 + (r - g) / delta ;
- this._attach( this.index - 1, this.prev_img );
- this._attach( this.index, this.cur_img );
- this._attach( this.index + 1, this.next_img );
-
- if ( this.prev_img.length ) {
- this.prev_img.css( 'left', -this.window_width + 'px' );
- }
-
- this.cur_img.css( 'left', '0px' );
-
- if ( this.next_img.length ) {
- this.next_img.css( 'left', this.window_width + 'px' );
- }
- },
+ h *= 60 ;
- show: function () {
- if ( !this.images.length ) {
- return;
- }
+ if (h < 0)
+ h += 360 ;
+ }
- this._show();
- this._add_event();
- },
+ return [h, s, v];
+ },
- _hide: function () {
- this._detach( this.index - 1, this.prev_img );
- this._detach( this.index, this.cur_img );
- this._detach( this.index + 1, this.next_img );
- },
+ /*
+ * Converts hsv to hsl.
+ *
+ * Input: [ h, s, v ], where
+ * h is in [0, 360]
+ * s is in [0, 1]
+ * v is in [0, 1]
+ *
+ * Returns: [ h, s, l ], where
+ * h is in [0, 360]
+ * s is in [0, 1]
+ * l is in [0, 1]
+ */
+ HSVToHSL: function(hsv) {
+ var max = hsv[2],
+ delta = hsv[1] * max,
+ min = max - delta,
+ sum = max + min,
+ half_sum = sum / 2,
+ s_divisor = ((half_sum < 0.5) ? sum : (2 - max - min));
- hide: function () {
- this._hide();
- this._del_event();
- },
+ return [ hsv[0], ((0 == s_divisor) ? 0 : (delta / s_divisor)), half_sum ];
+ },
- _get_width: function () {
- return $( this.element ).width();
- },
+ /*
+ * Converts rgb to hsl
+ *
+ * Input: [ r, g, b ], where
+ * r is in [0, 1]
+ * g is in [0, 1]
+ * b is in [0, 1]
+ *
+ * Returns: [ h, s, l ], where
+ * h is in [0, 360]
+ * s is in [0, 1]
+ * l is in [0, 1]
+ */
+ RGBToHSL: function(rgb) {
+ return $.mobile.tizen.clrlib.HSVToHSL($.mobile.tizen.clrlib.RGBToHSV(rgb));
+ }
+});
- _get_height: function () {
- var $page = $( this.element ).parentsUntil( 'ui-page' ),
- $content = $page.children( '.ui-content' ),
- header_h = $page.children( '.ui-header' ).outerHeight() || 0,
- footer_h = $page.children( '.ui-footer' ).outerHeight() || 0,
- padding = parseFloat( $content.css( 'padding-top' ) )
- + parseFloat( $content.css( 'padding-bottom' ) ),
- content_h = $( window ).height() - header_h - footer_h - padding;
- return content_h;
- },
+\r
+/* ***************************************************************************\r
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.\r
+ *\r
+ * Permission is hereby granted, free of charge, to any person obtaining a\r
+ * copy of this software and associated documentation files (the "Software"),\r
+ * to deal in the Software without restriction, including without limitation\r
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,\r
+ * and/or sell copies of the Software, and to permit persons to whom the\r
+ * Software is furnished to do so, subject to the following conditions:\r
+ *\r
+ * The above copyright notice and this permission notice shall be included in\r
+ * all copies or substantial portions of the Software.\r
+ *\r
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\r
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\r
+ * DEALINGS IN THE SOFTWARE.\r
+ * ***************************************************************************\r
+ *\r
+ * Authors: Hyunsook Park <hyunsook.park@samsung.com>\r
+ * Wonseop Kim <wonseop.kim@samsung.com>\r
+*/\r
+\r
+( function ( $, window, document, undefined ) {\r
+ var _canvas = document.createElement( 'canvas' ),\r
+ _context = _canvas.getContext( '2d' );\r
+\r
+ function fileSystemErrorMessage( e ) {\r
+ var FileError = window.FileError,\r
+ msg = '';\r
+ switch ( e.code ) {\r
+ case FileError.QUOTA_EXCEEDED_ERR:\r
+ msg = 'QUOTA_EXCEEDED_ERR';\r
+ break;\r
+ case FileError.NOT_FOUND_ERR:\r
+ msg = 'NOT_FOUND_ERR';\r
+ break;\r
+ case FileError.SECURITY_ERR:\r
+ msg = 'SECURITY_ERR';\r
+ break;\r
+ case FileError.INVALID_MODIFICATION_ERR:\r
+ msg = 'INVALID_MODIFICATION_ERR';\r
+ break;\r
+ case FileError.INVALID_STATE_ERR:\r
+ msg = 'INVALID_STATE_ERR';\r
+ break;\r
+ default:\r
+ msg = 'Unknown Error';\r
+ break;\r
+ }\r
+ return msg;\r
+ }\r
+\r
+ function getInternalURLFromURL( url ) {\r
+ var internalURL = url.replace( /\//gi, "_" );\r
+ return internalURL;\r
+ }\r
+\r
+ function resize( imagewidth, imageheight, thumbwidth, thumbheight, fit ) {\r
+ var w = 0, h = 0, x = 0, y = 0,\r
+ widthratio = imagewidth / thumbwidth,\r
+ heightratio = imageheight / thumbheight,\r
+ maxratio = Math.max( widthratio, heightratio );\r
+\r
+ if ( fit ) {\r
+ w = thumbwidth;\r
+ h = thumbheight;\r
+ } else {\r
+ if ( maxratio > 1 ) {\r
+ w = imagewidth / maxratio;\r
+ h = imageheight / maxratio;\r
+ } else {\r
+ w = imagewidth;\r
+ h = imageheight;\r
+ }\r
+ x = ( thumbwidth - w ) / 2;\r
+ y = ( thumbheight - h ) / 2;\r
+ }\r
+\r
+ return { w: w, h: h, x: x, y: y };\r
+ }\r
+\r
+ function getThumbnail( img, thumbwidth, thumbheight, fit ) {\r
+ var dimensions, url;\r
+ _canvas.width = thumbwidth;\r
+ _canvas.height = thumbheight;\r
+ dimensions = resize( img.width, img.height, thumbwidth, thumbheight, fit );\r
+ _context.fillStyle = "#000000";\r
+ _context.fillRect ( 0, 0, thumbwidth, thumbheight );\r
+ _context.drawImage( img, dimensions.x, dimensions.y, dimensions.w, dimensions.h );\r
+ url = _canvas.toDataURL();\r
+ return url;\r
+ }\r
+\r
+ $.imageloader = {\r
+ _grantedBytes: 1024 * 1024,\r
+ getThumbnail: function ( url, _callback ) {\r
+ var internalURL, canvasDataURI;\r
+ function errorHandler( e ) {\r
+ var msg = fileSystemErrorMessage( e );\r
+ if ( _callback ) {\r
+ _callback( ( msg === "NOT_FOUND_ERR" ) ? msg : null );\r
+ }\r
+ }\r
+\r
+ internalURL = getInternalURLFromURL( url );\r
+ try {\r
+ canvasDataURI = localStorage.getItem( internalURL );\r
+ if ( _callback ) {\r
+ _callback( ( canvasDataURI === null ) ? "NOT_FOUND_ERR" : canvasDataURI );\r
+ }\r
+ } catch ( e ) {\r
+ if ( _callback ) {\r
+ _callback( ( e.type === "non_object_property_load" ) ? "NOT_FOUND_ERR" : null );\r
+ }\r
+ }\r
+ },\r
+\r
+ setThumbnail: function ( url, _callback, thumbWidth, thumbHeight, fit ) {\r
+ var image, internalURL, canvasDataURI;\r
+ function errorHandler( e ) {\r
+ var msg = fileSystemErrorMessage( e );\r
+ if ( _callback ) {\r
+ _callback( ( msg === "NOT_FOUND_ERR" ) ? msg : null );\r
+ }\r
+ }\r
+\r
+ thumbWidth = thumbWidth || 128;\r
+ thumbHeight = thumbHeight || 128;\r
+ fit = fit || true;\r
+ image = new Image();\r
+ image.onload = function () {\r
+ internalURL = getInternalURLFromURL( url );\r
+ canvasDataURI = getThumbnail( this, thumbWidth, thumbHeight, fit );\r
+ try {\r
+ localStorage.setItem( internalURL, canvasDataURI );\r
+ if ( _callback ) {\r
+ _callback( canvasDataURI );\r
+ }\r
+ } catch ( e ) {\r
+ if ( _callback ) {\r
+ _callback( ( e.type === "non_object_property_load" ) ? "NOT_FOUND_ERR" : null );\r
+ }\r
+ }\r
+ };\r
+ image.src = url;\r
+ },\r
+\r
+ removeThumbnail: function ( url ) {\r
+ var internalURL;\r
+ function errorHandler( e ) {\r
+ fileSystemErrorMessage( e );\r
+ }\r
+\r
+ internalURL = getInternalURLFromURL( url );\r
+ try {\r
+ localStorage.removeItem( internalURL );\r
+ } catch ( e ) {\r
+ throw e;\r
+ }\r
+ }\r
+ };\r
+\r
+} ( jQuery, window, document ) );\r
+\r
- _create: function () {
- var temp_img,
- self = this,
- index,
- i = 0;
- $( this.element ).wrapInner( '<div class="ui-gallery"></div>' );
- $( this.element ).find( 'img' ).wrap( '<div class="ui-gallery-bg"></div>' );
+/**
+ @class Button
+ The button widget shows a control on the screen that you can use to generate an action event when it is pressed and released. This widget is coded with standard HTML anchor and input elements and then enhanced by jQueryMobile to make it more attractive and usable on a mobile device. Buttons can be used in Tizen as described in the jQueryMobile documentation for buttons.
- this.container = $( this.element ).find('.ui-gallery');
+ To add a button widget to the application, use the following code
- temp_img = $( 'div' ).find( '.ui-gallery-bg:first' );
+ <div data-role="button" data-inline="true">Text Button Test</div>
+ <div data-role="button" data-inline="true" data-icon="plus" data-style="circle"></div>
+ <div data-role="button" data-inline="true" data-icon="plus" data-style="nobg"></div>
- while ( temp_img.length ) {
- this.images[i] = temp_img.find( 'img' );
- temp_img = temp_img.next();
- i++;
- }
+ The button can define callbacks for events as described in the jQueryMobile documentation for button events.<br/>
+ You can use methods with the button as described in the jQueryMobile documentation for button methods.
+*/
- this._detach_all();
+/**
+ @property {String} data-style
+ Defines the button style. <br/> The default value is box. If the value is set to circle, a circle-shaped button is created. If the value is set to nobg, a button is created without a background.
- index = parseInt( $( this.element ).jqmData( 'index' ), 10 );
- if ( !index ) {
- index = 0;
- }
- if ( index < 0 ) {
- index = 0;
- }
- if ( index >= this.images.length ) {
- index = this.images.length - 1;
- }
+*/
+/**
+ @property {String} data-icon
+ Defines an icon for a button. Tizen supports 12 icon styles: reveal, closed, opened, info, rename, call, warning, plus, minus, cancel, send, and favorite.
- this.index = index;
+*/
- this.align_type = $( this.element ).jqmData( 'vertical-align' );
- $( window ).bind( 'resize', function () {
- self.refresh();
- });
- },
- _update: function () {
- var image_file,
- bg_html,
- temp_img;
+/* ***************************************************************************
+* style : normal, check
+* option :
+* - folded : decide to show divider press effect or not
+* - line : decide to draw divider line or not
+*/
+/**
+ @class ListDivider
+ The list divider widget is used as a list separator for grouping lists. List dividers can be used in Tizen as described in the jQueryMobile documentation for list dividers.<br/>
+ To add a list divider widget to the application, use the following code:
- while ( this.images_hold.length ) {
- image_file = this.images_hold.shift();
+ <li data-role="list-divider" data-style="check">
+ <form><input type="checkbox" name="c2line-check1" /></form></li>
- bg_html = $( '<div class="ui-gallery-bg"></div>' );
- temp_img = $( '<img src="' + image_file + '"></div>' );
+ The list divider can define callbacks for events as described in the jQueryMobile documentation for list events. <br/> You can use methods with the list divider as described in the jQueryMobile documentation for list methods.
- bg_html.append( temp_img );
- this.container.append( bg_html );
- this.images.push( temp_img );
- }
+ @since tizen2.0
+*/
+/**
+ @property {String} data-style
+ Sets the style of the list divider. The style options are dialogue, check, expandable, and checkexpandable.
+*/
- this._detach_all();
+(function ( $, undefined ) {
+ $.widget( "tizen.listdivider", $.mobile.widget, {
+ options: {
+ initSelector: ":jqmData(role='list-divider')",
+ folded : false,
+ listDividerLine : true,
},
- refresh: function ( start_index ) {
- this._update();
+ _create: function () {
- this._hide();
+ var $listdivider = this.element,
+ openStatus = true,
+ expandSrc,
+ listDividerLine = true,
+ style = $listdivider.attr( "data-style" );
- if ( start_index === undefined ) {
- start_index = this.index;
- }
- if ( start_index < 0 ) {
- start_index = 0;
- }
- if ( start_index >= this.images.length ) {
- start_index = this.images.length - 1;
+ if ( $listdivider.data("line") === false ) {
+ this.options.listDividerLine = false;
}
- this.index = start_index;
+ if ( $listdivider.data("folded") === true ) {
+ this.options.folded = true;
+ }
- this._show();
+ if ( style == undefined || style === "normal" || style === "check" ) {
+ if ( this.options.folded ) {
+ $listdivider.buttonMarkup();
+ } else {
+ $listdivider.wrapInner("<span class='ui-btn-text'></span>");
+ }
- return this.index;
- },
+ if ( this.options.listDividerLine ) {
+ expandSrc = "<span class='ui-divider-normal-line'></span>";
+ if ( this.options.folded ) {
+ $( expandSrc ).appendTo( $listdivider.children( ".ui-btn-inner" ) );
+ } else {
+ $( expandSrc ).appendTo( $listdivider);
+ }
+ }
+ }
- add: function ( file ) {
- this.images_hold.push( file );
+ $listdivider.bind( "vclick", function ( event, ui ) {
+ /* need to implement expand/collapse divider */
+ });
},
+ });
- remove: function ( index ) {
- var temp_img;
-
- if ( index === undefined ) {
- index = this.index;
- }
-
- if ( index < 0 || index >= this.images.length ) {
- return;
- }
+ //auto self-init widgets
+ $( document ).bind( "pagecreate create", function ( e ) {
+ $( $.tizen.listdivider.prototype.options.initSelector, e.target ).listdivider();
+ });
+}( jQuery ) );
- if ( index == this.index ) {
- temp_img = this.cur_img;
- if ( this.index == 0 ) {
- this.direction = 1;
- } else if ( this.index == this.images.length - 1 ) {
- this.direction = -1;
- }
-
- if ( this.direction < 0 ) {
- this.cur_img = this.prev_img;
- this.prev_img = this.prev_img.prev();
- if ( this.prev_img.length ) {
- this.prev_img.css( 'left', -this.window_width );
- this._attach( index - 2, this.prev_img );
- }
- this.index--;
- } else {
- this.cur_img = this.next_img;
- this.next_img = this.next_img.next();
- if ( this.next_img.length ) {
- this.next_img.css( 'left', this.window_width );
- this._attach( index + 2, this.next_img );
- }
- }
-
- this.cur_img.animate( { left: 0 }, this.options.duration );
+\r
+/* ***************************************************************************\r
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.\r
+ *\r
+ * Permission is hereby granted, free of charge, to any person obtaining a\r
+ * copy of this software and associated documentation files (the "Software"),\r
+ * to deal in the Software without restriction, including without limitation\r
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,\r
+ * and/or sell copies of the Software, and to permit persons to whom the\r
+ * Software is furnished to do so, subject to the following conditions:\r
+ *\r
+ * The above copyright notice and this permission notice shall be included in\r
+ * all copies or substantial portions of the Software.\r
+ *\r
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\r
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\r
+ * DEALINGS IN THE SOFTWARE.\r
+ * ***************************************************************************\r
+ *\r
+ * Authors: Hyunsook Park <hyunsook.park@samsung.com>\r
+ * Wonseop Kim <wonseop.kim@samsung.com>\r
+*/\r
+\r
+( function ( $, undefined ) {\r
+ $.webgl = {};\r
+\r
+ $.webgl.shader = {\r
+ _vertexShader: null,\r
+ _fragmentShader: null,\r
+\r
+ deleteShaders: function ( gl ) {\r
+ gl.deleteShader( this._vertexShader );\r
+ gl.deleteShader( this._fragmentShader );\r
+ },\r
+\r
+ addShaderProgram : function ( gl, vs, fs, isFile ) {\r
+ var shaderProgram,\r
+ vertexShaderSource = {},\r
+ fragmentShaderSource = {};\r
+\r
+ if ( isFile ) {\r
+ vertexShaderSource = this.loadShaderFile( vs );\r
+ fragmentShaderSource = this.loadShaderFile( fs );\r
+ } else {\r
+ vertexShaderSource.source = vs;\r
+ fragmentShaderSource.source = fs;\r
+ }\r
+\r
+ this._vertexShader = this.getShader( gl, gl.VERTEX_SHADER, vertexShaderSource );\r
+ this._fragmentShader = this.getShader( gl, gl.FRAGMENT_SHADER, fragmentShaderSource );\r
+\r
+ shaderProgram = gl.createProgram();\r
+ gl.attachShader( shaderProgram, this._vertexShader);\r
+ gl.attachShader( shaderProgram, this._fragmentShader);\r
+ gl.linkProgram( shaderProgram );\r
+\r
+ if ( !gl.getProgramParameter( shaderProgram, gl.LINK_STATUS ) ) {\r
+ window.alert( "Could not initialize Shaders!" );\r
+ }\r
+ return shaderProgram;\r
+ },\r
+\r
+ loadShaderFile : function ( path ) {\r
+ var cache = null;\r
+ $.ajax({\r
+ async : false,\r
+ url : path,\r
+ success : function ( result ) {\r
+ cache = {\r
+ source: result\r
+ };\r
+ }\r
+ });\r
+ return cache;\r
+ },\r
+\r
+ getShader: function ( gl, type, script ) {\r
+ var shader;\r
+\r
+ if ( !gl || !type || !script ) {\r
+ return null;\r
+ }\r
+\r
+ shader = gl.createShader( type );\r
+\r
+ gl.shaderSource( shader, script.source );\r
+ gl.compileShader( shader );\r
+\r
+ if ( !gl.getShaderParameter( shader, gl.COMPILE_STATUS ) ) {\r
+ window.alert( gl.getShaderInfoLog( shader ) );\r
+ gl.deleteShader( shader );\r
+ return null;\r
+ }\r
+ return shader;\r
+ }\r
+ };\r
+\r
+ $.webgl.buffer = {\r
+ attribBufferData: function ( gl, attribArray ) {\r
+ var attribBuffer = gl.createBuffer();\r
+\r
+ gl.bindBuffer( gl.ARRAY_BUFFER, attribBuffer );\r
+ gl.bufferData( gl.ARRAY_BUFFER, attribArray, gl.STATIC_DRAW );\r
+ gl.bindBuffer( gl.ARRAY_BUFFER, null );\r
+\r
+ return attribBuffer;\r
+ }\r
+ };\r
+\r
+} ( jQuery ) );\r
+\r
- } else if ( index == this.index - 1 ) {
- temp_img = this.prev_img;
- this.prev_img = this.prev_img.prev();
- if ( this.prev_img.length ) {
- this.prev_img.css( 'left', -this.window_width );
- this._attach( index - 1, this.prev_img );
- }
- this.index--;
- } else if ( index == this.index + 1 ) {
- temp_img = this.next_img;
- this.next_img = this.next_img.next();
- if ( this.next_img.length ) {
- this.next_img.css( 'left', this.window_width );
- this._attach( index + 1, this.next_img );
- }
+/*
+ *
+ * This software is licensed under the MIT licence (as defined by the OSI at
+ * http://www.opensource.org/licenses/mit-license.php)
+ *
+ * ***************************************************************************
+ * Copyright (C) 2011 by Intel Corporation Ltd.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * ***************************************************************************
+ */
- } else {
- temp_img = $( 'div' ).find( '.ui-gallery-bg:eq(' + index + ')' );
- }
+// Add markup for labels
- this.images.splice( index, 1 );
- temp_img.detach();
- },
- empty: function () {
- this.images.splice( 0, this.images.length );
- this.container.find('.ui-gallery-bg').detach();
- },
+(function($, undefined) {
- length: function () {
- return this.images.length;
- },
+$(document).bind("pagecreate create", function(e) {
+ $(":jqmData(role='label')", e.target).not(":jqmData(role='none'), :jqmData(role='nojs')").each(function() {
+ $(this).addClass("jquery-mobile-ui-label")
+ .html($("<span>", {"class": "jquery-mobile-ui-label-text"}).text($(this).text()));
+ });
+});
- value: function ( index ) {
- if ( index === undefined ) {
- return this.index;
- }
+})(jQuery);
- this.refresh( index );
- }
- }); /* End of widget */
- // auto self-init widgets
- $( document ).bind( "pagecreate create", function ( e ) {
- $( e.target ).find( ":jqmData(role='gallery')" ).gallery();
- });
- $( document ).bind( "pageshow", function ( e ) {
- $( e.target ).find( ":jqmData(role='gallery')" ).gallery( 'show' );
- });
+\r
+/* ***************************************************************************\r
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.\r
+ *\r
+ * Permission is hereby granted, free of charge, to any person obtaining a\r
+ * copy of this software and associated documentation files (the "Software"),\r
+ * to deal in the Software without restriction, including without limitation\r
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,\r
+ * and/or sell copies of the Software, and to permit persons to whom the\r
+ * Software is furnished to do so, subject to the following conditions:\r
+ *\r
+ * The above copyright notice and this permission notice shall be included in\r
+ * all copies or substantial portions of the Software.\r
+ *\r
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\r
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\r
+ * DEALINGS IN THE SOFTWARE.\r
+ * ***************************************************************************\r
+ *\r
+ * Authors: Hyunsook Park <hyunsook.park@samsung.com>\r
+ * Wonseop Kim <wonseop.kim@samsung.com>\r
+*/\r
+\r
+( function ( $, window, undefined ) {\r
+ var HALF_PI = Math.PI / 2,\r
+ DEFAULT_STEP = 0.001,\r
+ MotionPath = {},\r
+ vec3 = window.vec3,\r
+ arcLength2d = function ( p0, p1 ) {\r
+ var d = [ p1[0] - p0[0], p1[1] - p0[1] ],\r
+ value = Math.sqrt( d[0] * d[0] + d[1] * d[1] );\r
+ return value;\r
+ },\r
+ arcLength3d = function ( p0, p1 ) {\r
+ var d = [ p1[0] - p0[0], p1[1] - p0[1], p1[2] - p0[2] ],\r
+ value = Math.sqrt( d[0] * d[0] + d[1] * d[1] + d[2] * d[2] );\r
+ return value;\r
+ };\r
+\r
+ MotionPath.base = function () {};\r
+ MotionPath.base.prototype = {\r
+ points: [],\r
+ step: DEFAULT_STEP,\r
+ length: 0,\r
+ levels: [],\r
+ init: function ( data ) {},\r
+ calculateLevel: function ( maxLevel ) {},\r
+ calculateTotalLength: function () {},\r
+ getPosition: function ( percent ) {},\r
+ getPercent: function ( start, interval ) {},\r
+ getAngle: function ( percent ) {}\r
+ };\r
+\r
+ MotionPath.bezier2d = function () {};\r
+ MotionPath.bezier2d.prototype = $.extend( true, {}, MotionPath.base.prototype, {\r
+ init: function ( data ) {\r
+ this.points = data.points;\r
+ this.step = data.step || DEFAULT_STEP;\r
+ this.length = this.calculateTotalLength();\r
+ this.levels = this.calculateLevel( data.maxLevel ) || [];\r
+ },\r
+\r
+ calculateLevel: function ( maxLevel ) {\r
+ var totalLength = this.length,\r
+ interval = totalLength / maxLevel,\r
+ levels = [],\r
+ i;\r
+\r
+ if ( !maxLevel ) {\r
+ return null;\r
+ }\r
+\r
+ for ( i = 0; i < maxLevel; i += 1 ) {\r
+ levels[maxLevel - i] = this.getPercent( 0, interval * i );\r
+ }\r
+\r
+ return levels;\r
+ },\r
+\r
+ calculateTotalLength: function () {\r
+ var step = this.step,\r
+ current = this.getPosition( 0 ),\r
+ last = current,\r
+ length = 0,\r
+ percent;\r
+ for ( percent = step; percent <= 1; percent += step ) {\r
+ current = this.getPosition( percent );\r
+ length += arcLength2d( last, current );\r
+ last = current;\r
+ }\r
+ return length;\r
+ },\r
+\r
+ getPosition: function ( percent ) {\r
+ var points = this.points,\r
+ getValue = function ( p1, c1, c2, p2, t ) {\r
+ return Math.pow(1 - t, 3) * p1 +\r
+ 3 * t * Math.pow( 1 - t, 2 ) * c1 +\r
+ 3 * Math.pow( t, 2 ) * ( 1 - t ) * c2 +\r
+ Math.pow( t, 3 ) * p2;\r
+ },\r
+ result = [\r
+ getValue( points[0][0], points[1][0], points[2][0], points[3][0], percent ),\r
+ getValue( points[0][1], points[1][1], points[2][1], points[3][1], percent )\r
+ ];\r
+ return result;\r
+ },\r
+\r
+ getPercent: function ( start, interval ) {\r
+ var step = this.step,\r
+ current = this.getPosition( start = start || 0 ),\r
+ last = current,\r
+ targetLength = start + interval,\r
+ length = 0,\r
+ percent;\r
+\r
+ for ( percent = start + step; percent <= 1; percent += step ) {\r
+ current = this.getPosition( percent );\r
+ length += arcLength2d( last, current );\r
+ if ( length >= targetLength ) {\r
+ return percent;\r
+ }\r
+ last = current;\r
+ }\r
+ return 1;\r
+ },\r
+\r
+ getAngle: function ( percent ) {\r
+ var points = this.points,\r
+ getTangent = function ( p1, c1, c2, p2, t ) {\r
+ return 3 * t * t * ( -p1 + 3 * c1 - 3 * c2 + p2 ) + 6 * t * ( p1 - 2 * c1 + c2 ) + 3 * ( -p1 + c1 );\r
+ },\r
+ tx = getTangent( points[0][0], points[1][0], points[2][0], points[3][0], percent ),\r
+ ty = getTangent( points[0][1], points[1][1], points[2][1], points[3][1], percent );\r
+ return Math.atan2( tx, ty ) - HALF_PI;\r
+ }\r
+\r
+ } );\r
+\r
+ // clamped cubic B-spline curve\r
+ // http://web.mit.edu/hyperbook/Patrikalakis-Maekawa-Cho/node17.html\r
+ // http://www.cs.mtu.edu/~shene/COURSES/cs3621/NOTES/spline/B-spline/bspline-curve-coef.html\r
+ MotionPath.bspline = function () {};\r
+ MotionPath.bspline.prototype = $.extend( true, {}, MotionPath.base.prototype, {\r
+ _degree: 3,\r
+ _numberOfControls : 0,\r
+ _knotVectors: [],\r
+ _numberOfKnots: 0,\r
+\r
+ init: function ( data ) {\r
+ this.points = data.points;\r
+ this.step = data.step || DEFAULT_STEP;\r
+ this._numberOfPoints = this.points.length - 1;\r
+ this._numberOfKnots = this._numberOfPoints + this._degree + 1;\r
+\r
+ var deltaKnot = 1 / ( this._numberOfKnots - ( 2 * this._degree ) ),\r
+ v = deltaKnot,\r
+ i = 0;\r
+\r
+ while ( i <= this._numberOfKnots ) {\r
+ if ( i <= this._degree ) {\r
+ this._knotVectors.push( 0 );\r
+ } else if ( i < this._numberOfKnots - this._degree + 1 ) {\r
+ this._knotVectors.push( v );\r
+ v += deltaKnot;\r
+ } else {\r
+ this._knotVectors.push( 1 );\r
+ }\r
+ i += 1;\r
+ }\r
+\r
+ this.length = this.calculateTotalLength();\r
+ this.levels = this.calculateLevel( data.maxLevel ) || [];\r
+ },\r
+\r
+ _Np: function ( percent, i, degree ) {\r
+ var knots = this._knotVectors,\r
+ A = 0,\r
+ B = 0,\r
+ denominator = 0,\r
+ N0 = function ( percent, i ) {\r
+ return ( ( knots[i] <= percent && percent < knots[i + 1] ) ? 1 : 0 );\r
+ };\r
+\r
+ if ( degree === 1 ) {\r
+ A = N0( percent, i );\r
+ B = N0( percent, i + 1 );\r
+ } else {\r
+ A = this._Np( percent, i, degree - 1 );\r
+ B = this._Np( percent, i + 1, degree - 1 );\r
+ }\r
+\r
+ denominator = knots[i + degree] - knots[i];\r
+ A *= ( denominator !== 0 ) ? ( ( percent - knots[i] ) / denominator ) : 0;\r
+ denominator = knots[i + degree + 1] - knots[i + 1];\r
+ B *= ( denominator !== 0 ) ? ( ( knots[i + degree + 1] - percent ) / denominator ) : 0;\r
+\r
+ return A + B;\r
+ },\r
+\r
+ calculateLevel: function ( maxLevel ) {\r
+ var totalLength = this.length,\r
+ interval = totalLength / maxLevel,\r
+ levels = [],\r
+ i;\r
+\r
+ if ( !maxLevel ) {\r
+ return null;\r
+ }\r
+\r
+ for ( i = 0; i < maxLevel; i += 1 ) {\r
+ levels[maxLevel - i] = this.getPercent( 0, interval * i );\r
+ }\r
+ return levels;\r
+ },\r
+\r
+ calculateTotalLength: function () {\r
+ var step = this.step,\r
+ current = this.getPosition( 0 ),\r
+ last = current,\r
+ length = 0,\r
+ percent;\r
+ for ( percent = step; percent <= 1; percent += step ) {\r
+ current = this.getPosition( percent );\r
+ length += arcLength3d( last, current );\r
+ last = current;\r
+ }\r
+ return length;\r
+ },\r
+\r
+ getPosition: function ( percent ) {\r
+ var result = [], i, j, sum;\r
+ percent = percent.toFixed( 4 );\r
+ for ( j = 0; j < 3; j += 1 ) {\r
+ sum = 0;\r
+ for ( i = 0; i <= this._numberOfPoints; i += 1 ) {\r
+ sum += this.points[i][j] * this._Np( percent, i, this._degree );\r
+ }\r
+ result[j] = sum;\r
+ }\r
+\r
+ return result;\r
+ },\r
+\r
+ getPercent: function ( start, interval ) {\r
+ var step = this.step,\r
+ current = this.getPosition( start = start || 0 ),\r
+ last = current,\r
+ targetLength = start + interval,\r
+ length = 0,\r
+ percent;\r
+\r
+ for ( percent = start + step; percent <= 1; percent += step ) {\r
+ current = this.getPosition( percent );\r
+ length += arcLength3d( last, current );\r
+ if ( length >= targetLength ) {\r
+ return percent;\r
+ }\r
+ last = current;\r
+ }\r
+ return 1;\r
+ },\r
+\r
+ getAngle: function ( percent ) {\r
+ var prev = this.getPosition( percent ),\r
+ next = this.getPosition( percent + 0.001 ),\r
+ dir = vec3.normalize( vec3.direction( prev, next ) ),\r
+ cosValue = vec3.dot( dir, [1, 0, 0] );\r
+\r
+ return Math.acos( cosValue ) + Math.PI;\r
+ }\r
+ } );\r
+\r
+ $.motionpath = function ( type, data ) {\r
+ var object = new MotionPath[type]();\r
+ object.init( data );\r
+ return object;\r
+ };\r
+} ( jQuery, window ) );\r
+\r
- $( document ).bind( "pagebeforehide", function ( e ) {
- $( e.target ).find( ":jqmData(role='gallery')" ).gallery( 'hide' );
- } );
-}( jQuery, this ) );
/* ***************************************************************************
* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
*
* DEALINGS IN THE SOFTWARE.
* ***************************************************************************
*
- * Authors: Wonseop Kim ( wonseop.kim@samsung.com )
+ * Author: Sanghee Lee <sang-hee.lee@samsung.com>
*/
/**
- * "Handler" is a widget helping a user to scroll a window or panel.
- * It is different from the scrollview feature in that the handler has a fixed size
- * and disappears when a scroll size is smaller than a parent window's size.
- * If the handler widget is activated, a scroll bar on the screen will be deactivated.
- * The handler widget supports scrolling up and down and indicates the position of the scrolled window.
+ * Splitview is a widget which can show different HTML contents at the same time on each divided pane.
+ * A user can place Splitview controls on JQuery Mobile's Content area and arrange two panes on the widget.
+ * And HTML fragments or another Splitview also can be placed on the pane.
+ * The number of panes inside of Splitview is restricted as two.
+ * If a user define only one pane in Splitview, a empty pane will be added automatically,
+ * on the other hand, if 3 or more panes are defined in Splitview, the panes after two will be ignored and removed from the DOM tree.
+ * The HTML fragments of a pane should be composed of elements describing a part of Web page (e.g. <div>…</div>).
+ * Also widgets can be included in the HTML fragments.
*
- * HTML Attributes:
+ * HTML Attributes:
*
- * data-handler : This attribute is indicating that whether enable.
- * If you want to use, you will set 'true'.
- * data-handler-theme : Set the widget theme ( optional )
+ * data-fixed : The resizing mode of panes - fixed and flexible mode.
+ * If the value is true, the panes' sizes will be fixed, or if not, it will be flexible. (Default : false)
+ * data-divider-vertical : The direction of dividers.
+ * If the value is true, the panes will be placed in horizontal direction,
+ * or if not, it will be placed in vertical direction. (Default : "true")
+ * data-ratio : The ratio of two panes' widths or heights. (Default : [ 1/2, 1/2 ]
*
- * APIs:
+ * APIs:
*
- * enableHandler ( boolean )
- * : Get or set the use of handler widget.
- * If the value is "true", it will be run handler widget.
- * If the value is "false", it will be not run handler widget.
- * If no value is specified, will act as a getter.
+ * pane ( id [ , element ] )
+ * : This method replaces child contents of a pane indicated by id attribute with contents of inputted element.
+ * If second argument is not specified, it will act as a getter method.
+ * The string of id has to be started with "#" which means "id" of CSS selectors.
+ * maximize ( id )
+ * : This method maximizes a pane's size indicated by id.
+ * The string of id has to be started with "#" which means "id" of CSS selectors.
+ * restore ()
+ * : This method restores all panes' sizes to the ratio prior to maximization.
*
- * Events:
+ * Examples:
*
- * Examples:
+ * <div data-role="splitview" data-fixed="false" data-divider-vertical="true" data-ratio="0.5, 0.5">
+ * <div class="ui-pane">pane0</div>
+ * <div class="ui-pane">pane1</div>
+ * </div>
*
- * <div data-role="content" data-scroll="y" data-handler="true">
- * <ul data-role="listview">
- * <li data-role="list-divider">A</li>
- * <li><a href="#">Adam Kinkaid</a></li>
- * ...
- * </ul>
- * </div>
*/
+
/**
- @class handler
- The handler widget enables the user to vertically scroll through a page or panel using a fixed-size handle. The widget indicates the position of the scrolled window, and only appears on the screen if the parent page or panel's scroll size is larger than the screen size. <br/> To add a handler widget to the application, use the following code:
+ @class Splitview
+ Splitview widget enables a user to place and arrange several panes. Each divided pane can show repective HTML contents.
- <div data-role="content" data-scroll="y" data-handler="true">
- <ul data-role="listview">
- <li data-role="list-divider">A</li>
- <li><a href="#">Adam Kinkaid</a></li>
- ...
- </ul>
- </div>
-
- You can use the enableHandler method with the handler widget to get (if no value is defined) or set the handler usage status. If the [enable] value is true, the handler is enabled; otherwise the handler is not used.
+ To add a Splitview widget to the application, use the following code:
- $("#.selector").scrollview("enableHandler", [enable]);
+ <div data-role="splitview" data-fixed="false" data-divider-vertical="true" data-ratio="0.5, 0.5">
+ <div class="ui-pane">pane0</div>
+ <div class="ui-pane">pane1</div>
+ </div>
*/
+
/**
- @property {Boolean} data-handler
- Enables the handler widget. The value must be set to true.
+ @property {Boolean} data-fixed
+ The resizing mode of panes - fixed and flexible mode.
*/
+
/**
- @property {String} data-handler-theme
- Sets the handler widget theme.
+ @property {Boolean} data-divider-vertical
+ The direction of dividers - horizontal or vertical.
+ */
+
+/**
+ @property {Array} data-ratio
+ The ratio of two panes' widths or heights.
*/
-( function ( $, document, undefined ) {
- // The options of handler in scrollview
- $.tizen.scrollview.prototype.options.handler = false;
- $.tizen.scrollview.prototype.options.handlerTheme = "s";
- var originSetOption = $.tizen.scrollview.prototype._setOption,
- createHandler = function ( target ) {
- var $view = target,
- prefix = "<div class=\"ui-handler ui-handler-direction-",
- suffix = "\"><div class=\"ui-handler-track\"><div class=\"ui-handler-thumb\"></div></div></div>",
- scrollview = $view.data( "scrollview" ),
- options = scrollview.options,
- direction = options.direction,
- parentTheme = $.mobile.getInheritedTheme( scrollview, "s" ),
- theme = options.theme || parentTheme,
- isHorizontal = ( scrollview.options.direction === "x" ),
- _$view = scrollview._$view,
- _$clip = scrollview._$clip,
- scrollbar = $view.find( ".ui-scrollbar" ),
- handler = null,
- handlerThumb = null,
- viewLength = 0,
- clipLength = 0,
- handlerHeight = 0,
- handlerMargin = 0,
- trackLength = 0,
- moveTimer,
- isTouchable = $.support.touch,
- dragStartEvt = ( isTouchable ? "touchstart" : "mousedown" ) + ".handler",
- dragMoveEvt = ( isTouchable ? "touchmove" : "mousemove" ) + ".handler",
- dragStopEvt = ( isTouchable ? "touchend" : "mouseup" ) + ".handler",
- dragLeaveEvt = ( isTouchable ? " touchleave" : " mouseleave" ) + ".handler",
- calculateLength = function () {
- clipLength = ( isHorizontal ? _$clip.width() : _$clip.height() );
- viewLength = ( isHorizontal ? _$view.width() : _$view.height() ) - clipLength;
- trackLength = clipLength - handlerHeight - handlerMargin * 2;
- },
- setHanderPostion = function ( scrollPos ) {
- var handlerPos = Math.round( ( isHorizontal ? scrollPos.x : scrollPos.y ) / viewLength * trackLength );
- handlerThumb[0].style[ ( isHorizontal ? "left" : "top" ) ] = handlerPos + "px";
- },
- stopHandlerScroll = function () {
- $( document ).unbind( ".handler" );
- $view.moveData = null;
- _$view.trigger( "scrollstop" );
- };
+/**
+ @method pane
+ This method replaces child contents of a pane indicated by id attribute with contents of inputted element.
+ If second argument is not specified, it will act as a getter method.
- if ( $view.find( ".ui-handler-thumb" ).length !== 0 || typeof direction !== "string" ) {
- return;
- }
+ <div data-role="splitview">
+ <div class="ui-pane" id="pane0">pane0</div>
+ <div class="ui-pane" id="pane1">pane1</div>
+ </div>
+ $(".selector").splitview("pane", id, element);
+*/
- handler = $( [ prefix, direction, suffix ].join( "" ) ).appendTo( $view.addClass( " ui-handler-" + theme ) );
- handlerThumb = $view.find( ".ui-handler-thumb" ).hide();
- handlerHeight = ( isHorizontal ? handlerThumb.width() : handlerThumb.height() );
- handlerMargin = ( isHorizontal ? parseInt( handler.css( "right" ), 10 ) : parseInt( handler.css( "bottom" ), 10 ) );
-
- $.extend( $view, {
- moveData : null
- });
+/**
+ @method maximize
+ This method maximizes a pane's size indicated by id.
- // handler drag
- handlerThumb.bind( dragStartEvt, {
- e : handlerThumb[0]
- }, function ( event ) {
- scrollview._stopMScroll();
+ <div data-role="splitview">
+ <div class="ui-pane" id="pane0">pane0</div>
+ <div class="ui-pane" id="pane1">pane1</div>
+ </div>
+ $(".selector").splitview("maximize", id);
+*/
- var target = event.data.e,
- t = ( isTouchable ? event.originalEvent.targetTouches[0] : event );
+/**
+ @method restore
+ This method restores all panes' sizes to the ratio prior to maximization.
- target.style.opacity = 1.0;
+ <div data-role="splitview">
+ <div class="ui-pane" id="pane0">pane0</div>
+ <div class="ui-pane" id="pane1">pane1</div>
+ </div>
+ $(".selector").splitview("restore");
+*/
- $view.moveData = {
- target : target,
- X : parseInt( target.style.left, 10 ) || 0,
- Y : parseInt( target.style.top, 10 ) || 0,
- pX : t.pageX,
- pY : t.pageY
- };
- calculateLength();
+( function ( $, window, document, undefined ) {
+ $.widget( "tizen.splitview", $.mobile.widget, {
+ options : {
+ fixed : false,
+ dividerVertical : true,
+ ratio : [],
+ initSelector : ":jqmData(role='splitview')"
+ },
- _$view.trigger( "scrollstart" );
+ _create : function () {
+ var self = this,
+ $el = self.element,
+ opt = self.options,
+ $panes = $el.children( ".ui-pane" ),
+ panesLength = $panes.length,
+ spliters = [],
+ spliterBars = [],
+ ratioAttr = this.element.attr( "data-ratio" ),
+ containerSize = [ 0, 0 ],
+ resizeTimer = null,
+ i = 0;
- if ( !isTouchable ) {
- event.preventDefault();
+ if ( panesLength !== 2 ) {
+ if ( panesLength < 2 ) {
+ for ( i = panesLength ; i < 2 ; ++i ) {
+ self._addEmptyPanes();
+ }
+ } else {
+ $panes.slice( 2 ).remove();
}
- $( document ).bind( dragMoveEvt, function ( event ) {
- var moveData = $view.moveData,
- target = moveData.target,
- handlePos = 0,
- scrollPos = 0,
- t = ( isTouchable ? event.originalEvent.targetTouches[0] : event );
+ $panes = $el.children( ".ui-pane" );
+ panesLength = $panes.length;
+ }
- handlePos = ( isHorizontal ? moveData.X + t.pageX - moveData.pX : moveData.Y + t.pageY - moveData.pY );
+ spliters[ 0 ] = $( "<a href='#' class='ui-spliter' aria-label='Drag scroll, double tap and move to adjust split area'></a>" ).insertAfter( $panes[ 0 ] );
+ spliterBars[ 0 ] = $( "<div class='ui-spliter-bar'></div>" ).appendTo( spliters[ 0 ] );
+ $( "<div class='ui-spliter-handle'></div>" ).appendTo( spliterBars[ 0 ] );
- if ( handlePos < 0 ) {
- handlePos = 0;
- }
+ $.extend( this, {
+ moveTarget : null,
+ moveData : {},
+ spliters : spliters,
+ spliterBars : spliterBars,
+ panes : $panes,
+ containerSize : containerSize,
+ touchStatus : false,
+ minPaneWidth : 50,
+ savedRatio : []
+ });
- if ( handlePos > trackLength ) {
- handlePos = trackLength;
- }
- scrollPos = - Math.round( handlePos / trackLength * viewLength );
+ self._bindTouchEvents();
+ self._convertRatio( ratioAttr, $panes.length );
- if ( isHorizontal ) {
- scrollview._setScrollPosition( scrollPos, 0 );
- target.style.left = handlePos + "px";
- } else {
- scrollview._setScrollPosition( 0, scrollPos );
- target.style.top = handlePos + "px";
+ $el.addClass( "ui-splitview ui-direction-" + self._direction( opt.dividerVertical ) );
+
+ if ( $el.parent().closest( ".ui-splitview" ).length ) {
+ if ( self._getContainerSize( $el[ 0 ].style.width, $el[ 0 ].style.height ) ) {
+ self._layout();
+ }
+ }
+
+ $( window ).bind( "pagechange", function ( e ) {
+ if ( !$el.parent().closest( ".ui-splitview" ).length ) {
+ if ( self._getContainerSize( $el[ 0 ].style.width, $el[ 0 ].style.height ) ) {
+ self._layout();
}
+ }
+ }).resize( function () {
+ if ( resizeTimer ) {
+ clearTimeout( resizeTimer );
+ }
- event.preventDefault();
- }).bind( dragStopEvt + dragLeaveEvt, function ( event ) {
- stopHandlerScroll();
- });
+ resizeTimer = setTimeout( function () {
+ if ( !$el.parent().closest( ".ui-splitview" ).length ) {
+ if ( self._getContainerSize( $el[ 0 ].style.width, $el[ 0 ].style.height ) ) {
+ self._layout();
+ }
+ }
+ }, 250);
});
+ },
- _$view.bind( dragStopEvt, function ( event ) {
- stopHandlerScroll();
- });
+ _addEmptyPanes : function () {
+ var self = this,
+ $el = self.element,
+ opt = self.options,
+ $panes = $el.children( ".ui-pane" ),
+ scrollAttribute = ( $.support.scrollview ) ? "data-scroll='y'" : "",
+ pane = $( "<div class='ui-pane' " + scrollAttribute + "></div>" );
- $view.bind( "scrollstart", function ( event ) {
- if ( !scrollview.enableHandler() ) {
- return;
- }
+ if ( scrollAttribute.length ) {
+ pane.scrollview( { direction: "y" } );
+ }
- calculateLength();
+ if ( !$panes.length ) {
+ $el.append( pane );
+ } else {
+ $panes.last().after( pane );
+ }
+ },
- if ( viewLength < 0 || clipLength < handlerHeight ) {
- if ( scrollbar.is( ":hidden" ) ) {
- scrollbar.show();
+ _direction : function ( isHorizontal ) {
+ return isHorizontal ? "horizontal" : "vertical";
+ },
+
+ _isStyleSpecified : function ( cssString ) {
+ return ( typeof cssString !== "undefined" && cssString.length );
+ },
+
+ _getContainerSize : function ( widthString, heightString ) {
+ var self = this,
+ $el = self.element,
+ widthSpecified = self._isStyleSpecified( widthString ),
+ heightSpecified = self._isStyleSpecified( heightString );
+
+ self.containerSize[ 0 ] = ( widthSpecified ) ? $el.outerWidth( true ) : self._parentWidth();
+ self.containerSize[ 1 ] = ( heightSpecified ) ? $el.outerHeight( true ) : self._parentHeight();
+
+ if ( !self.containerSize[ 0 ] || !self.containerSize[ 1 ] ) {
+ return false;
+ }
+
+ return true;
+ },
+
+ _parentWidth : function () {
+ var $parent = this.element.parent();
+
+ if ( !$parent && typeof $parent === "undefined" && !$parent.length ) {
+ return $( window ).width();
+ }
+
+ return $parent.width();
+ },
+
+ _parentHeight : function () {
+ var $parent = this.element.parent(),
+ heightString = "",
+ heightSpecified = false,
+ parentHeight = 0;
+
+ while ( $parent && typeof $parent !== "undefined" && $parent.length ) {
+ if ( typeof $parent[ 0 ].style !== "undefined" ) {
+ heightString = $parent[ 0 ].style.height;
+ heightSpecified = ( typeof heightString !== "undefined" && heightString.length );
+ if ( heightSpecified ) {
+ parentHeight = $parent.height();
+ break;
}
- return;
}
- if ( scrollbar.is( ":visible" ) ) {
- scrollbar.hide();
+ $parent = $parent.parent();
+ }
+
+ if ( !heightSpecified ) {
+ parentHeight = $(window).height();
+ }
+
+ return parentHeight;
+ },
+
+ _convertRatio : function ( ratioParam, panesLength ) {
+ var self = this,
+ ratio = [],
+ loop = 0,
+ type = typeof ratioParam,
+ ratioArray = null,
+ i;
+
+ for ( i = 0; i < panesLength; ++i ) {
+ ratio.push( 0 );
+ }
+
+ switch ( type ) {
+ case "number":
+ if ( panesLength ) {
+ ratio[ 0 ] = ratioParam;
}
+ break;
- if ( moveTimer ) {
- clearInterval( moveTimer );
- moveTimer = undefined;
+ case "string":
+ ratioArray = ratioParam.split( "," );
+ loop = Math.min( ratioArray.length, panesLength );
+ for ( i = 0; i < loop; ++i ) {
+ ratio[ i ] = parseFloat( ratioArray[ i ] );
}
+ break;
- handler.addClass( "ui-handler-visible" );
- handlerThumb.stop( true, true )
- .fadeIn();
- }).bind( "scrollupdate", function ( event, data ) {
- if ( !scrollview.enableHandler() || viewLength < 0 || clipLength < handlerHeight ) {
- return;
+ case "object":
+ if ( !$.isArray( ratioParam ) ) {
+ break;
}
- setHanderPostion( scrollview.getScrollPosition() );
- }).bind( "scrollstop", function ( event ) {
- if ( !scrollview.enableHandler() || viewLength < 0 || clipLength < handlerHeight ) {
- return;
+ loop = Math.min( ratioParam.length, panesLength );
+ for ( i = 0; i < loop; ++i ) {
+ type = typeof ratioParam[ i ];
+ ratio[ i ] = ( type === "string" ) ? parseFloat( ratioParam[ i ] ) :
+ ( type === "number" ) ? ratioParam[ i ] : 0;
}
+ break;
+ }
- moveTimer = setInterval( function () {
- setHanderPostion( scrollview.getScrollPosition() );
- if ( !scrollview._gesture_timer ) {
- clearInterval( moveTimer );
- moveTimer = undefined;
- }
- }, 10 );
+ self.options.ratio = ratio;
+ self._adjustRatio( panesLength );
+ },
- if ( scrollview._handlerTimer ) {
- clearTimeout( scrollview._handlerTimer );
- scrollview._handlerTimer = 0;
- }
- scrollview._handlerTimer = setTimeout( function () {
- if ( scrollview._timerID === 0 && $view.moveData === null ) {
- handlerThumb.stop( true, true )
- .css( "opacity", 1.0 )
- .fadeOut( function () {
- handler.removeClass( "ui-handler-visible" );
- });
- scrollview._handlerTimer = 0;
- }
- }, 1000 );
- }).bind( "mousewheel", function ( event ) {
- handler.removeClass( "ui-handler-visible" );
- setHanderPostion( scrollview.getScrollPosition() );
- });
- };
+ _adjustRatio : function ( panesLength ) {
+ var self = this,
+ ratio = self.options.ratio,
+ sum = 0,
+ remain = 0,
+ value = 0,
+ subValue = 0,
+ subRemain = 0,
+ i;
- $.extend( $.tizen.scrollview.prototype, {
- enableHandler: function ( enabled ) {
- if ( typeof enabled === 'undefined' ) {
- return this.options.handler;
+ if ( !panesLength ) {
+ self.options.ratio = [];
+ return;
}
- this.options.handler = !!enabled;
+ for ( i in ratio ) {
+ sum += ratio[ i ];
+ }
- var $view = this.element;
- if ( this.options.handler ) {
- if ( $view.find( ".ui-handler" ).length === 0 ) {
- createHandler( $view );
+ if ( sum !== 1 ) {
+ remain = 1 - sum;
+ value = remain / panesLength;
+
+ for ( i in ratio ) {
+ if ( value >= 0 ) {
+ ratio[ i ] += value;
+ remain = Math.max( 0, remain - value );
+ } else {
+ subRemain += value;
+ subValue = Math.max( subRemain, ratio[ i ] * -1 );
+ ratio[ i ] = Math.max( 0, ratio[ i ] + subValue );
+ remain = Math.min( 0, remain - subValue );
+ subRemain -= subValue;
+ }
}
- $view.find( ".ui-scrollbar" ).hide();
- $view.find( ".ui-handler" ).show();
- } else {
- $view.find( ".ui-handler" ).removeClass( "ui-handler-visible" ).hide();
- $view.find( ".ui-scrollbar" ).show();
+ if ( remain ) {
+ if ( remain > 0 ) {
+ ratio[ ratio.length - 1 ] += remain;
+ } else {
+ for ( i = ratio.length - 1; i >= 0; --i ) {
+ subValue = Math.max( remain, ratio[ i ] * -1 );
+ ratio[ i ] = Math.max( 0, ratio[ i ] + subValue );
+ remain = Math.min( 0, remain - subValue );
+ if ( !remain ) {
+ break;
+ }
+ }
+ }
+ }
+
+ self.options.ratio = ratio;
}
},
- _setHandlerTheme: function ( handlerTheme ) {
- if ( !handlerTheme ) {
+ _setOption : function ( key, value ) {
+ var self = this,
+ orgValue = self.options[ key ];
+
+ if ( orgValue === value ) {
return;
}
- var oldClass = "ui-handler-" + this.options.handlerTheme,
- newClass = "ui-handler-" + handlerTheme;
-
- this.element.removeClass( oldClass ).addClass( newClass );
- this.options.handlerTheme = handlerTheme;
- },
+ $.Widget.prototype._setOption.apply( this, arguments );
- _setOption: function ( key, value ) {
switch ( key ) {
- case "handler":
- this.enableHandler( value );
+ case "fixed":
+ self._fixed( value );
break;
- case "handlerTheme":
- this._setHandlerTheme( value );
+
+ case "dividerVertical":
+ self._dividerVertical( value );
+ break;
+
+ case "ratio":
+ self._ratio( value );
break;
- default:
- originSetOption.call( this, key, value );
}
},
- _handlerTimer : 0
- });
+ _subtractDiffWidth : function ( width, diff ) {
+ var self = this;
- $( document ).delegate( ":jqmData(scroll)", "scrollviewcreate", function () {
- var widget = $( this );
- if ( widget.attr( "data-" + $.mobile.ns + "scroll" ) === "none"
- || widget.attr( "data-" + $.mobile.ns + "handler" ) !== "true" ) {
- return;
- }
- widget.scrollview( "enableHandler", "true" );
- });
-} ( jQuery, document ) );
-/* ***************************************************************************
-* style : normal, check
-* option :
-* - folded : decide to show divider press effect or not
-* - line : decide to draw divider line or not
-*/
-/**
- @class ListDivider
- The list divider widget is used as a list separator for grouping lists. List dividers can be used in Tizen as described in the jQueryMobile documentation for list dividers.<br/>
- To add a list divider widget to the application, use the following code:
+ if ( width <= self.minPaneWidth ) {
+ return {
+ width: width,
+ diff: diff
+ };
+ }
- <li data-role="list-divider" data-style="check">
- <form><input type="checkbox" name="c2line-check1" /></form></li>
+ width += diff;
+ if ( width >= self.minPaneWidth ) {
+ return {
+ width: width,
+ diff: 0
+ };
+ }
- The list divider can define callbacks for events as described in the jQueryMobile documentation for list events. <br/> You can use methods with the list divider as described in the jQueryMobile documentation for list methods.
+ return {
+ width: self.minPaneWidth,
+ diff: width - self.minPaneWidth
+ };
+ },
- @since tizen2.0
-*/
-/**
- @property {String} data-style
- Sets the style of the list divider. The style options are dialogue, check, expandable, and checkexpandable.
-*/
+ _initRatio : function ( fromFirstPane, panes, isHorizontal, availableWidth ) {
+ var self = this,
+ sum = 0,
+ widths = [],
+ diff = 0,
+ panesLength = panes.length,
+ ret,
+ i;
-(function ( $, undefined ) {
- $.widget( "tizen.listdivider", $.mobile.widget, {
- options: {
- initSelector: ":jqmData(role='list-divider')",
- folded : false,
- listDividerLine : true,
- },
+ panes.each( function ( i ) {
+ var pane = $( this );
+ widths.push( isHorizontal ? pane.width() : pane.height() );
+ sum += widths[ i ];
+ });
- _create: function () {
+ diff = availableWidth - sum;
+ if ( !diff ) {
+ return widths;
+ }
- var $listdivider = this.element,
- openStatus = true,
- expandSrc,
- listDividerLine = true,
- style = $listdivider.attr( "data-style" );
+ if ( diff > 0 ) {
+ widths[ fromFirstPane ? 0 : panesLength - 1 ] += diff;
+ } else {
+ if ( fromFirstPane ) {
+ for ( i = 0; i < panesLength; ++i ) {
+ ret = self._subtractDiffWidth( widths[ i ], diff );
+ widths[ i ] = ret.width;
+ diff = ret.diff;
+ if ( !diff ) {
+ break;
+ }
+ }
+ } else {
+ for ( i = panesLength - 1; i >= 0; --i ) {
+ diff = self._subtractDiffWidth( widths[ i ], diff );
+ widths[ i ] = ret.width;
+ diff = ret.diff;
+ if ( !diff ) {
+ break;
+ }
+ }
+ }
+ }
- if ( $listdivider.data("line") === false ) {
- this.options.listDividerLine = false;
+ sum = 0;
+ for ( i in widths ) {
+ sum += widths[ i ];
}
- if ( $listdivider.data("folded") === true ) {
- this.options.folded = true;
+ for ( i in self.options.ratio ) {
+ self.options.ratio[ i ] = widths[ i ] / sum;
}
- if ( style == undefined || style === "normal" || style === "check" ) {
- if ( this.options.folded ) {
- $listdivider.buttonMarkup();
+ return widths;
+ },
+
+ _horizontalBoundary : function () {
+ var self = this,
+ $el = self.element;
+
+ return $el.outerWidth( true ) - $el.width();
+ },
+
+ _verticalBoundary : function () {
+ var self = this,
+ $el = self.element;
+
+ return $el.outerHeight( true ) - $el.height();
+ },
+
+ _boundary : function ( type ) {
+ var self = this,
+ $el = self.element,
+ computedStyle = window.getComputedStyle( $el[ 0 ], null ),
+ margin = parseFloat( computedStyle[ "margin" + type ] ),
+ border = parseFloat( computedStyle[ "border" + type + "Width" ] ),
+ padding = parseFloat( computedStyle[ "padding" + type ] );
+
+ return {
+ margin: margin,
+ border: border,
+ padding: padding
+ };
+ },
+
+ _layout : function ( initRatio, fromFirstPane ) {
+ var self = this,
+ $el = self.element,
+ opt = self.options,
+ isHorizontal = opt.dividerVertical,
+ $panes = self.panes,
+ spliters = self.spliters,
+ spliterBars = self.spliterBars,
+ spliterBar = self.spliterBars.length ? $( spliterBars[ 0 ] ) : null,
+ spliterWidth = !spliterBar ? 0 :
+ isHorizontal ? spliterBar.outerWidth() :
+ spliterBar.outerHeight(),
+ spliterBarMargin = !spliterBar ? 0 :
+ isHorizontal ?
+ spliterBar.outerWidth( true ) - spliterBar.outerWidth() :
+ spliterBar.outerHeight( true ) - spliterBar.outerHeight(),
+ panesLength = $panes.length,
+ currentAvailable = 0,
+ spliterSize = spliterWidth * ( panesLength - 1 ),
+ parentWidth = self.containerSize[ 0 ],
+ parentHeight = self.containerSize[ 1 ],
+ width = parentWidth - self._horizontalBoundary(),
+ height = parentHeight - self._verticalBoundary(),
+ innerSize = isHorizontal ? height : width,
+ availableWidth = isHorizontal ? width - spliterSize :
+ height - spliterSize,
+ initializedWidth = [],
+ widthSum = 0,
+ childSplitview = null;
+
+ if ( typeof initRatio === "undefined" ) {
+ initRatio = false;
+ }
+
+ if ( initRatio && typeof fromFirstPane === "undefined" ) {
+ fromFirstPane = false;
+ }
+
+ $el.css( {
+ "min-width" : width,
+ "min-height" : height
+ });
+
+ if ( initRatio ) {
+ initializedWidth = self._initRatio( fromFirstPane, $panes, isHorizontal, availableWidth );
+ }
+
+ currentAvailable = availableWidth;
+ $panes.each( function ( i ) {
+ var $pane = $( this ),
+ paneWidth = initRatio ? initializedWidth[ i ] :
+ Math.floor( availableWidth * self.options.ratio[i] ),
+ prevPane = ( ( i ) ? $panes.eq( i - 1 ) : null ),
+ posValue = 0,
+ widthValue = 0,
+ heightValue = 0,
+ boundary = 0;
+
+ currentAvailable -= paneWidth;
+ if ( i === ( panesLength - 1 ) ) {
+ paneWidth = Math.max( Math.min( paneWidth, self.minPaneWidth ), paneWidth + currentAvailable );
+ }
+
+ widthSum += paneWidth;
+
+ if ( !prevPane ) {
+ boundary = self._boundary( isHorizontal ? "Left" : "Top" );
+ posValue = boundary.padding;
} else {
- $listdivider.wrapInner("<span class='ui-btn-text'></span>");
+ posValue = parseInt( prevPane.css( isHorizontal ? "left" : "top" ), 10 );
+ posValue += isHorizontal ? prevPane.width() : prevPane.height();
+ posValue += spliterWidth;
}
- if ( this.options.listDividerLine ) {
- expandSrc = "<span class='ui-divider-normal-line'></span>";
- if ( this.options.folded ) {
- $( expandSrc ).appendTo( $listdivider.children( ".ui-btn-inner" ) );
+ widthValue = isHorizontal ? paneWidth : innerSize;
+ heightValue = isHorizontal ? innerSize : paneWidth;
+
+ $pane.css( {
+ "width" : widthValue ,
+ "height" : heightValue
+ } );
+
+ $pane.css( ( isHorizontal ? "left" : "top" ), posValue );
+ });
+
+ $panes.each( function ( i ) {
+ var $pane = $( this ),
+ paneWidth = isHorizontal ? $pane.width() : $pane.height();
+
+ self.options.ratio[ i ] = paneWidth / widthSum;
+ });
+
+ $.each( spliters, function ( i ) {
+ var spliter = $( this ),
+ prevPane = $panes.eq( i ),
+ bar = spliter.children( ".ui-spliter-bar" ),
+ handle = bar.children( ".ui-spliter-handle" ),
+ posValue = 0;
+
+ if ( isHorizontal ) {
+ posValue = parseInt( prevPane.css( "left" ), 10 ) + prevPane.width() - spliterBarMargin;
+ spliter.outerHeight( innerSize ).css( "left", posValue );
+ } else {
+ posValue = parseInt( prevPane.css( "top" ), 10 ) + prevPane.height() - spliterBarMargin;
+ spliter.outerWidth( innerSize ).css( "top", posValue );
+ }
+
+ if ( typeof bar !== "undefined" && bar ) {
+ if ( isHorizontal ) {
+ bar.outerHeight( innerSize );
} else {
- $( expandSrc ).appendTo( $listdivider);
+ bar.outerWidth( innerSize );
+ }
+ }
+ if ( typeof handle !== "undefined" && handle ) {
+ if ( isHorizontal ) {
+ handle.css( "top", ( innerSize - spliterWidth ) / 2 );
+ } else {
+ handle.css( "left", ( innerSize - spliterWidth ) / 2 );
}
}
+ });
+
+ childSplitview = $el.find( ":jqmData(role='splitview'):first" );
+ if ( !childSplitview.length ) {
+ return;
}
- $listdivider.bind( "vclick", function ( event, ui ) {
- /* need to implement expand/collapse divider */
+ childSplitview = childSplitview.data( "splitview" );
+ if ( childSplitview ) {
+ childSplitview._refresh();
+ }
+ },
+
+ _bindTouchEvents : function () {
+ var self = this,
+ $el = self.element,
+ $panes = self.panes,
+ spliters = self.spliters;
+
+ $.each( spliters, function ( i ) {
+ var spliter = $( this );
+ self._bindSpliterTouchEvents( spliter );
+ });
+
+ $el.mouseleave( function () {
+ if ( self.touchStatus ) {
+ $el.children( ".ui-spliter" ).trigger( "vmouseup" );
+ }
+ });
+
+ $panes.bind( "vmousedown", function () {
+ $el.find( ".ui-spliter" ).trigger( "vmouseup" );
+ });
+ },
+
+ _bindSpliterTouchEvents : function ( spliter ) {
+ var self = this,
+ $el = self.element,
+ opt = self.options;
+
+ spliter.bind( "vmousedown", { e : spliter }, function ( event ) {
+ if ( self.options.fixed ) {
+ return;
+ }
+
+ var targetSpliter = event.data.e,
+ prevPane = targetSpliter.prev(),
+ nextPane = targetSpliter.next(),
+ splitviewInPrev = prevPane.find( ":jqmData(role='splitview'):first" ),
+ splitviewInNext = nextPane.find( ":jqmData(role='splitview'):first" ),
+ isHorizontal = opt.dividerVertical,
+ spliterWidth = isHorizontal ?
+ $( self.spliterBars[0] ).outerWidth() :
+ $( self.spliterBars[0] ).outerHeight();
+
+ $el.closest( ".ui-page" ).find( ".ui-spliter" ).trigger( "vmouseup" );
+
+ self.moveTarget = targetSpliter;
+ self.moveData = {
+ spliterWidth : spliterWidth || 0,
+ prevPane : prevPane,
+ nextPane : nextPane,
+ splitviewInPrev : splitviewInPrev,
+ splitviewInNext : splitviewInNext,
+ prevPanePos : parseInt( prevPane.css( isHorizontal ? "left" : "top" ), 10 ) || 0,
+ prevPaneWidth : parseInt( prevPane.css( isHorizontal ? "width" : "height" ), 10 ) || 0,
+ nextPanePos : parseInt( nextPane.css( isHorizontal ? "left" : "top" ), 10 ) || 0,
+ nextPaneWidth : parseInt( nextPane.css( isHorizontal ? "width" : "height" ), 10 ) || 0,
+ targetPos : parseInt( targetSpliter.css( isHorizontal ? "left" : "top" ), 10 ) || 0,
+ pagePos : isHorizontal ? event.pageX : event.pageY
+ };
+
+ targetSpliter.addClass( "ui-spliter-active" );
+
+ $( document ).bind( "vmousemove.splitview", function ( event ) {
+ if ( !self.touchStatus ) {
+ return;
+ }
+
+ self._drag( event );
+
+ event.preventDefault();
+ event.stopPropagation();
+ }).bind( "vmouseup.splitview", function ( event ) {
+ if ( !self.touchStatus ) {
+ return;
+ }
+
+ self._stop( event );
+
+ event.preventDefault();
+ event.stopPropagation();
+
+ self.touchStatus = false;
+ });
+
+ event.preventDefault();
+ event.stopPropagation();
+
+ self.touchStatus = true;
+ });
+ },
+
+ _drag : function ( e ) {
+ if ( !this.moveData || typeof this.moveData === "undefined" ) {
+ return;
+ }
+
+ var self = this,
+ $el = self.element,
+ opt = self.options,
+ isHorizontal = opt.dividerVertical,
+ moveData = self.moveData,
+ moveTarget = self.moveTarget,
+ prevPane = moveData.prevPane,
+ nextPane = moveData.nextPane,
+ splitviewInPrev = moveData.splitviewInPrev,
+ splitviewInNext = moveData.splitviewInNext,
+ spliterWidth = moveData.spliterWidth,
+ movement = null,
+ targetPos = null,
+ nextPanePos = null,
+ prevPaneWidth = null,
+ nextPaneWidth = null,
+ pagePos = isHorizontal ? e.pageX : e.pageY,
+ splitview = null;
+
+ movement = pagePos - moveData.pagePos;
+ if ( movement > 0 ) {
+ movement = Math.min( Math.max( moveData.nextPaneWidth - self.minPaneWidth, 0 ), movement );
+ } else {
+ movement = Math.max( Math.max( moveData.prevPaneWidth - self.minPaneWidth, 0 ) * -1, movement );
+ }
+
+ nextPanePos = moveData.nextPanePos + movement;
+ prevPaneWidth = Math.max( moveData.prevPaneWidth + movement, 0 );
+ nextPaneWidth = Math.max( moveData.nextPaneWidth - movement, 0 );
+ targetPos = moveData.targetPos + movement;
+
+ moveTarget.css( isHorizontal ? { left : targetPos } : { top : targetPos } );
+ prevPane.css( isHorizontal ? { width : prevPaneWidth } : { height : prevPaneWidth } );
+ nextPane.css( isHorizontal ? { width : nextPaneWidth, left : nextPanePos } :
+ { height : nextPaneWidth, top : nextPanePos } );
+
+ if ( splitviewInPrev.length ) {
+ splitview = splitviewInPrev.data( "splitview" );
+ splitview._refresh( true, false );
+ }
+
+ if ( splitviewInNext.length ) {
+ splitview = splitviewInNext.data( "splitview" );
+ splitview._refresh( true, true );
+ }
+ },
+
+ _stop : function ( e ) {
+ if ( !this.moveData || typeof this.moveData === "undefined" ) {
+ return;
+ }
+
+ var self = this,
+ $el = self.element,
+ opt = self.options,
+ $panes = self.panes,
+ panesLength = $panes.length,
+ isHorizontal = opt.dividerVertical,
+ moveData = self.moveData,
+ moveTarget = self.moveTarget,
+ prevPane = moveData.prevPane,
+ nextPane = moveData.nextPane,
+ splitviewInPrev = moveData.splitviewInPrev,
+ splitviewInNext = moveData.splitviewInNext,
+ spliterWidth = moveData.spliterWidth,
+ spliterSize = spliterWidth * ( panesLength - 1 ),
+ movement = null,
+ targetPos = null,
+ nextPanePos = null,
+ prevPaneWidth = null,
+ nextPaneWidth = null,
+ displayStyle = $el.css( "display" ),
+ parentWidth = self.containerSize[ 0 ],
+ parentHeight = self.containerSize[ 1 ],
+ width = parentWidth - self._horizontalBoundary(),
+ height = parentHeight - self._verticalBoundary(),
+ availableWidth = isHorizontal ?
+ ( width - spliterSize ) :
+ ( height - spliterSize ),
+ sum = 0;
+
+ $( document ).unbind( "vmousemove.splitview vmouseup.splitview" );
+ moveTarget.removeClass( "ui-spliter-active" );
+
+ // ratio calculation
+ $panes.each( function ( i ) {
+ var $pane = $( this ),
+ paneWidth = isHorizontal ? $pane.width() : $pane.height();
+
+ sum += paneWidth;
+ });
+
+ $panes.each( function ( i ) {
+ var $pane = $( this ),
+ paneWidth = isHorizontal ? $pane.width() : $pane.height();
+
+ self.options.ratio[ i ] = paneWidth / sum;
+ });
+
+ self.moveData = null;
+ },
+
+ _fixed : function ( isFix ) {
+ var self = this,
+ spliters = self.spliters;
+
+ $.each( spliters, function ( i ) {
+ var $spliter = $( this );
+
+ if ( isFix ) {
+ $spliter.addClass( "ui-fixed" );
+ } else {
+ $spliter.removeClass( "ui-fixed" );
+ }
+ });
+
+ self._layout();
+ },
+
+ _dividerVertical : function ( isDividerVertical ) {
+ var self = this,
+ $el = self.element,
+ isHorizontal = isDividerVertical,
+ $panes = null,
+ $spliters = null,
+ $bar = null,
+ $handle = null;
+
+ $panes = $el.children( ".ui-pane" );
+ $spliters = $el.children( ".ui-spliter" );
+ $bar = $spliters.children( ".ui-spliter-bar" );
+ $handle = $bar.children( ".ui-spliter-handle" );
+
+ $el.removeClass( "ui-direction-vertical" );
+ $el.removeClass( "ui-direction-horizontal" );
+ $el.addClass( "ui-splitview ui-direction-" + self._direction( isHorizontal ) );
+
+ $panes.css( {
+ "left" : "",
+ "top" : "",
+ "width" : "",
+ "height" : ""
+ });
+
+ $spliters.css( {
+ "left" : "",
+ "top" : "",
+ "width" : "",
+ "height" : ""
+ });
+
+ $bar.css( {
+ "width" : "",
+ "height" : ""
+ });
+
+ $handle.css( {
+ "left" : "",
+ "top" : ""
+ });
+
+ if ( self._getContainerSize( $el[ 0 ].style.width, $el[ 0 ].style.height ) ) {
+ self._layout();
+ }
+ },
+
+ _ratio : function ( ratioParam ) {
+ var self = this,
+ $el = self.element,
+ $panes = $el.children( ".ui-pane" ),
+ panesLength = $panes.length;
+
+ self._convertRatio( ratioParam, panesLength );
+ self._layout();
+ },
+
+ _refresh : function ( initRatio, fromFirstPane ) {
+ var self = this,
+ $el = self.element;
+
+ if ( typeof initRatio === "undefined" ) {
+ initRatio = false;
+ }
+
+ if ( initRatio && typeof fromFirstPane === "undefined" ) {
+ fromFirstPane = false;
+ }
+
+ if ( self._getContainerSize( $el[ 0 ].style.width, $el[ 0 ].style.height ) ) {
+ self._layout( initRatio, fromFirstPane );
+ }
+ },
+
+ pane : function ( id, element ) {
+ if ( typeof id !== "string" ) {
+ return null;
+ }
+
+ var self = this,
+ $el = self.element,
+ $targetPane = $el.children( id ),
+ $targetView = null,
+ elementParent = null;
+
+ if ( !$targetPane.hasClass( "ui-pane" ) ) {
+ return null;
+ }
+
+ // getter
+ if ( typeof element === "undefined" || !element ) {
+ return $targetPane.contents();
+ }
+
+ // setter
+ if ( $targetPane.hasClass( "ui-scrollview-clip" ) ) {
+ $targetPane.scrollview( "scrollTo", 0, 0, 0 );
+
+ $targetView = $targetPane.children( ".ui-scrollview-view" );
+ if ( !$targetView.length ) {
+ return null;
+ }
+ } else {
+ $targetView = $targetPane;
+ }
+
+ elementParent = element.parent();
+ if ( elementParent.length && elementParent[ 0 ] === $targetView[ 0 ] ) {
+ return;
+ }
+
+ $targetView.empty().append( element ).trigger( "create" );
+ $targetView.fadeIn( 'fast' );
+ },
+
+ maximize : function ( id ) {
+ if ( typeof id !== "string" ) {
+ return;
+ }
+
+ var self = this,
+ $el = self.element,
+ $panes = self.panes,
+ $targetPane = $el.children( id );
+
+ if ( !$targetPane.hasClass( "ui-pane" ) ) {
+ return;
+ }
+
+ self.savedRatio = self.options.ratio.slice();
+
+ self.options.ratio = [];
+ $panes.each( function ( i ) {
+ self.options.ratio.push( ( this === $targetPane[ 0 ] ) ? 1 : 0 );
});
+
+ self._layout();
},
+
+ restore : function () {
+ var self = this;
+
+ if ( self.savedRatio.length === 0 ) {
+ return;
+ }
+
+ self.options.ratio = self.savedRatio.slice();
+ self._adjustRatio( self.panes.length );
+
+ self._layout();
+ }
});
- //auto self-init widgets
$( document ).bind( "pagecreate create", function ( e ) {
- $( $.tizen.listdivider.prototype.options.initSelector, e.target ).listdivider();
+ $.tizen.splitview.prototype.enhanceWithin( e.target );
});
-}( jQuery ) );
-/* ***************************************************************************
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
+} ( jQuery, window, document ) );
+
+
+
+/*
+ * jQuery Mobile Widget @VERSION
+ *
+ * TODO: remove unnecessary codes....
*
+ * This software is licensed under the MIT licence (as defined by the OSI at
+ * http://www.opensource.org/licenses/mit-license.php)
+ *
+ * ***************************************************************************
+ * Copyright (C) 2011 by Intel Corporation Ltd.
+ *
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
+ *
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* DEALINGS IN THE SOFTWARE.
* ***************************************************************************
*
- * Authors: Yonghwi Park <yonghwi0324.park@samsung.com>
- * Wonseop Kim <wonseop.kim@samsung.com>
+ * Authors: Kalyan Kondapally <kalyan.kondapally@intel.com>
+ */
+
+ensureNS("jQuery.mobile.tizen");
+
+(function () {
+jQuery.extend(jQuery.mobile.tizen, {
+ disableSelection: function (element) {
+ var self = this;
+ $(element).find('*').each( function() {
+ if( ( $(this).get(0).tagName !== 'INPUT' &&
+ $(this).attr("type") !== 'text' ) &&
+ $(this).get(0).tagName !== 'TEXTAREA' ) {
+ self.enableSelection( this, 'none' );
+ }
+ } );
+ return true;
+ },
+
+ enableSelection: function (element, value) {
+ return $(element).each( function () {
+ switch( value ) {
+ case 'text' :
+ case 'auto' :
+ case 'none' :
+ val = value;
+ break;
+
+ default :
+ val = 'auto';
+ break;
+ }
+ $(this).css( {
+ 'user-select': val,
+ '-moz-user-select': val,
+ '-webkit-user-select': val,
+ '-o-user-select': val,
+ '-ms-transform': val
+ } );
+ } );
+ },
+
+ disableContextMenu: function(element) {
+ var self = this;
+ $(element).find('*').each( function() {
+ if( ( $(this).get(0).tagName !== 'INPUT' &&
+ $(this).attr("type") !== 'text' ) &&
+ $(this).get(0).tagName !== 'TEXTAREA' ) {
+ self._disableContextMenu( this );
+ }
+ } );
+ },
+
+ _disableContextMenu: function(element) {
+
+ $(element).each( function() {
+ $(this).bind("contextmenu", function( event ) {
+ return false;
+ } );
+ } );
+ },
+
+ enableContextMenu: function(element) {
+ $(element).each( function() {
+ $(this).unbind( "contextmenu" );
+ } );
+ },
+
+ // Get document-relative mouse coordinates from a given event
+ // From: http://www.quirksmode.org/js/events_properties.html#position
+ documentRelativeCoordsFromEvent: function(ev) {
+ var e = ev ? ev : window.event,
+ client = { x: e.clientX, y: e.clientY },
+ page = { x: e.pageX, y: e.pageY },
+ posx = 0,
+ posy = 0;
+
+ // Grab useful coordinates from touch events
+ if (e.type.match(/^touch/)) {
+ page = {
+ x: e.originalEvent.targetTouches[0].pageX,
+ y: e.originalEvent.targetTouches[0].pageY
+ };
+ client = {
+ x: e.originalEvent.targetTouches[0].clientX,
+ y: e.originalEvent.targetTouches[0].clientY
+ };
+ }
+
+ if (page.x || page.y) {
+ posx = page.x;
+ posy = page.y;
+ }
+ else
+ if (client.x || client.y) {
+ posx = client.x + document.body.scrollLeft + document.documentElement.scrollLeft;
+ posy = client.y + document.body.scrollTop + document.documentElement.scrollTop;
+ }
+
+ return { x: posx, y: posy };
+ },
+
+ // TODO : offsetX, offsetY. touch events don't have offsetX and offsetY. support for touch devices.
+ // check algorithm...
+ targetRelativeCoordsFromEvent: function(e) {
+ var coords = { x: e.offsetX, y: e.offsetY };
+
+ if (coords.x === undefined || isNaN(coords.x) ||
+ coords.y === undefined || isNaN(coords.y)) {
+ var offset = $(e.target).offset();
+ //coords = documentRelativeCoordsFromEvent(e); // Old code. Must be checked again.
+ coords = $.mobile.tizen.documentRelativeCoordsFromEvent(e);
+ coords.x -= offset.left;
+ coords.y -= offset.top;
+ }
+
+ return coords;
+ }
+});
+
+})();
+
+
+
+/* ***************************************************************************
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * ***************************************************************************
+ *
+ * Author: Kangsik Kim <kangsik81.kim@samsung.com>
+ * Youmin Ha <youmin.ha@samsung.com>
*/
/**
- *
- * MultiMediaView is a widget that lets the user view and handle multimedia contents.
- * Video and audio elements are coded as standard HTML elements and enhanced by the
- * MultiMediaview to make them attractive and usable on a mobile device.
+ * In the web environment, it is challenging to display a large amount of data in a grid.
+ * When an application needs to show, for example, image gallery with over 1,000 images,
+ * the same enormous data must be inserted into a HTML document.
+ * It takes a long time to display the data and manipulating DOM is complex.
+ * The virtual grid widget supports storing unlimited data without performance issues
+ * by reusing a limited number of grid elements.
+ * The virtual grid widget is based on the jQuery.template plug-in
+ * For more information, see jQuery.template.
*
* HTML Attributes:
- * data-theme : Set a theme of widget.
- * If this value is not defined, widget will use parent`s theme. (optional)
- * data-controls : If this value is 'true', widget will use belonging controller.
- * If this value is 'false', widget will use browser`s controller.
- * Default value is 'true'.
- * data-full-screen : Set a status that full-screen when inital start.
- * Default value is 'false'.
+ *
+ * data-role: virtualgrid
+ * data-template : Has the ID of the jQuery.template element.
+ * jQuery.template for a virtual grid must be defined.
+ * Style for template would use rem unit to support scalability.
+ * data-direction : This option define the direction of the scroll.
+ * You must choose one of the 'x' and 'y' (Default : y)
+ * data-rotation : This option defines whether or not the circulation of the data.
+ * If option is 'true' and scroll is reached the last data,
+ * Widget will present the first data on the screen.
+ * If option is ‘false’, Widget will operate like a scrollview.
+ *
+ * ID : <DIV> element that has "data-role=virtualgrid" must have ID attribute.
*
* APIs:
- * width( [number] )
- * : Get or set the width of widget.
- * The first argument is the width of widget.
- * If no first argument is specified, will act as a getter.
- * height( [number] )
- * : Get or set the height of widget.
- * The first argument is the height of widget.
- * If no first argument is specified, will act as a getter.
- * fullScreen( [boolean] )
- * : Get or Set the status of full-screen.
- * If no first argument is specified, will act as a getter.
*
- * Events:
+ * create ( {
+ * itemData: function ( idx ) { return json_obj; },
+ * numItemData: number or function () { return number; },
+ * cacheItemData: function ( minIdx, maxIdx ) {}
+ * } )
+ * : Create VirtualGrid widget. At this moment, _create method is called.
+ * args : A collection of options
+ * itemData: A function that returns JSON object for given index. Mandatory.
+ * numItemData: Total number of itemData. Mandatory.
+ * cacheItemData: Virtuallist will ask itemData between minIdx and maxIdx.
+ * Developers can implement this function for preparing data.
+ * Optional.
*
- * create : triggered when a multimediaview is created.
+ * centerTo ( String )
+ * : Find a DOM Element with the given class name.
+ * This element will be centered on the screen.
+ * Serveral elements were found, the first element is displayed.
*
- * Examples:
+ * Events:
+ * scrollstart : : This event triggers when a user begin to move the scroll on VirtualGrid.
+ * scrollupdate : : This event triggers while a user moves the scroll on VirtualGrid.
+ * scrollstop : This event triggers when a user stop the scroll on VirtualGrid.
+ * select : This event triggers when a cell is selected.
*
- * VIDEO :
- * <video data-controls="true" style="width:100%;">
- * <source src="media/oceans-clip.mp4" type="video/mp4" />
- * Your browser does not support the video tag.
- * </video>
+ * Examples:
*
- * AUDIO :
- * <audio data-controls="true" style="width:100%;">
- * <source src="media/Over the horizon.mp3" type="audio/mp3" />
- * Your browser does not support the audio tag.
- * </audio>
+ * <script id="tizen-demo-namecard" type="text/x-jquery-tmpl">
+ * <div class="ui-demo-namecard">
+ * <div class="ui-demo-namecard-pic">
+ * <img class="ui-demo-namecard-pic-img" src="${TEAM_LOGO}" />
+ * </div>
+ * <div class="ui-demo-namecard-contents">
+ * <span class="name ui-li-text-main">${NAME}</span>
+ * <span class="active ui-li-text-sub">${ACTIVE}</span>
+ * <span class="from ui-li-text-sub">${FROM}</span>
+ * </div>
+ * </div>
+ * </script>
+ * <div id="virtualgrid-demo" data-role="virtualgrid" data-template="tizen-demo-namecard" >
+ * </div>
*
*/
-/**
- @class MutimediaView
- The multimedia view widget shows a player control that you can use to view and handle multimedia content. This widget uses the standard HTML video and audio elements, which have been enhanced for use on a mobile device.
- To add a multimedia view widget to the application, use the following code:
-
- // Video player control
- <video data-controls="true" style="width:100%;">
- <source src="<VIDEO_FILE_URL>" type="video/mp4" /> Your browser does not support the video tag. </video>
- // Audio player control
- <audio data-controls="true" style="width:100%;"> <source src="<AUDIO_FILE_URL>" type="audio/mp3" /> Your browser does not support the audio tag.
- </audio>
+// most of following codes are derived from jquery.mobile.scrollview.js
- The multimedia view can define a callback for the create event, which is fired when the widget is created.
- $('.selector').multimediaview({
- create:function(event, u){...}
- });
- $(".selector").bind("create", function(event, ui)
- {
- // Respond to the multimedia view widget creation
- });
+/**
+ @class VirtualGrid
+ In the Web environment, it is challenging to display large amount of data in a list, such as displaying a contact list of over 1000 list items. It takes time to display the entire list in HTML and the DOM manipulation is complex.
+
+ The virtual grid widget is used to display a list of unlimited data elements on the screen for better performance. This widget displays the data in the grid format by reusing the existing grid control space. Virtual grids are based on the jQuery.template plugin as described in the jQuery documentation for jQuery.template plugin.
+
+ To add a virtual grid widget to the application, use the following code:
+
+ <script id="tizen-demo-namecard" type="text/x-jquery-tmpl">
+ <div class="ui-demo-namecard">
+ <div class="ui-demo-namecard-pic">
+ <img class="ui-demo-namecard-pic-img" src="${TEAM_LOGO}" />
+ </div>
+ <div class="ui-demo-namecard-contents">
+ <span class="name ui-li-text-main">${NAME}</span>
+ </div>
+ </div>
+ </script>
+ <div id="virtualgrid-demo" data-role="virtualgrid" data-template="tizen-demo-namecard">
+ </div>
*/
/**
- @property {Boolean} data-control
- Sets the controls for the widget.
- The default value is true. If the value is set to true, the widget uses its own player controls. If the value is set to false, the widget uses the browser's player controls.
+ @property {String} data-template
+ Specifies the jQuery.template element ID.
+ The jQuery.template must be defined. The template style can use rem units to support scalability.
*/
/**
- @property {Boolean} data-full-screen
- Defines whether the widget opens in the fullscreen view mode.
+ @property {String} data-direction
+ Defines the scroll direction. The direction options are x (horizontal) and y (vertical).
+ The default value is y.
+*/
+/**
+ @property {Boolean} data-rotation
+ Defines whether the data elements are displayed from the beginning of the list again once the end of file is reached.
The default value is false.
*/
/**
- @property {String} data-theme
- Sets the widget theme.
- If the value is not set, the parent control's theme is used
+ @event scrollstart
+ The scrollstart event is fired when the user starts scrolling through the grid:
+
+ <div data-role="virtualgrid" data-scroll="y" data-template="tizen-demo-namecard"></div>
+ // Option 01
+ $(".selector").virtualgrid
+ ({
+ scrollstart: function(event, ui)
+ {
+ // Handle the scrollstart event
+ }
+ });
+ // Option 02
+ $(".selector").bind("scrollstart", function(event, ui)
+ {
+ // Handle the scrollstart event
+ });
*/
/**
- @method width
- The width method is used to get (if no value is defined) or set the multimedia view widget width:
- <video>
- <source src="test.mp4" type="video/mp4" />
- </video>
- $(".selector").multimediaview("width", [value]);
+ @event scrollupdate
+ The scrollupdate event is fired when the user moves the scroll bar in the grid:
+
+ <div data-role="virtualgrid" data-scroll="y" data-template="tizen-demo-namecard"></div>
+ // Option 01
+ $(".selector").virtualgrid
+ ({
+ scrollupdate: function(event, ui)
+ {
+ // Handle the scrollupdate event
+ }
+ });
+ // Option 02
+ $(".selector").bind("scrollupdate", function(event, ui)
+ {
+ // Handle the scrollupdate event
+ });
*/
/**
- @method height
- The height method is used to get (if no value is defined) or set the multimedia view widget height:
- <video>
- <source src="test.mp4" type="video/mp4" />
- </video>
- $(".selector").multimediaview("height", [value]);
+ @event scrollstop
+ The scrollstop event is fired when the user stops scrolling:
+
+ <div data-role="virtualgrid" data-scroll="y" data-template="tizen-demo-namecard"></div>
+ // Option 01
+ $(".selector").virtualgrid
+ ({
+ scrollstop: function(event, ui)
+ {
+ // Handle the scrollstop event
+ }
+ });
+ // Option 02
+ $(".selector").bind("scrollstop", function(event, ui)
+ {
+ // Handle the scrollstop event
+ });
*/
/**
- @method fullScreen
- The fullScreen method is used to get (if no value is defined) or set the full-screen mode of the multimedia view widget. If the value is true, the full-screen mode is used; otherwise the multimedia view widget runs in the normal mode.
+ @event select
+ The select event is fired when a virtual grid cell is selected:
- <video>
- <source src="test.mp4" type="video/mp4" />
- </video>
- $(".selector").multimediaview("fullScreen", [value]);
+ <div data-role="virtualgrid" data-scroll="y" data-template="tizen-demo-namecard"></div>
+ // Option 01
+ $(".selector").virtualgrid
+ ({
+ select: function(event, ui)
+ {
+ // Handle the select event
+ }
+ });
+ // Option 02
+ $(".selector").bind("select", function(event, ui)
+ {
+ // Handle the select event
+ });
*/
-( function ( $, document, window, undefined ) {
- $.widget( "tizen.multimediaview", $.mobile.widget, {
- options: {
- theme: null,
- controls: true,
- fullScreen: false,
- initSelector: "video, audio"
- },
+/**
+ @method create
+ @param {function} itemData(index)
+ @param {Number} numItemData
+ @param {function} cacheItemData(minIndex, maxIndex)
+ The create method is used to call the jQuery _create method. In the method parameters:
- _create: function () {
- var self = this,
- view = self.element,
- viewElement = view[0],
- option = self.options,
- parentTheme = $.mobile.getInheritedTheme( view, "s" ),
- theme = option.theme || parentTheme,
- role = "multimediaview",
- control = null;
+ function itemData(index) returns the JSON object matched with the given index. The index value is between 0 and numItemData-1.<br/>
+ number numItemData or function numItemData() defines or returns a static number of items.<br/>
+ function cacheItemData(minIndex, maxIndex) prepares the JSON data. This method is called before calling the itemData() method with index values between minIndex and maxIndex.<br/>
- $.extend( this, {
- role: null,
- isControlHide: false,
- controlTimer: null,
- isVolumeHide: true,
- isVertical: true,
- backupView: null
+ <div data-role="virtualgrid" data-scroll="y" data-template="tizen-demo-namecard"></div>
+ function itemData(idx)
+ {
+ return DATA[idx];
+ }
+ function cacheItemData(minIdx, maxIdx)
+ {
+ // Prepare JSON data between minIdx and maxIdx
+ }
+ var numItemData = DATA.length;
+ $(".selector").virtualgrid("create",
+ {
+ itemData, numItemData, cacheItemData
});
+*/
+/**
+ @method centerTo
+ The centerTo method is used to search for the DOM element with a specified class name. The retrieved element is placed at the center of the virtual grid. If multiple elements are retrieved, the first element from the result list is placed at the center of the virtual grid.
- self.role = role;
- view.addClass( "ui-multimediaview" );
- control = self._createControl();
- control.find( ".ui-button" ).each( function ( index ) {
- $( this ).buttonMarkup( { corners: true, theme: theme, shadow: true } );
- });
+ <div data-role="virtualgrid" data-scroll="y" data-template="tizen-demo-namecard"></div>
+ $(".selector").virtualgrid("centerTo", "selector");
+*/
+/**
+ @method resize
+ The resize method is used to rearrange the DOM elements to fit a new screen size when the screen is resized:
- if ( view[0].nodeName === "VIDEO" ) {
- control.addClass( "ui-" + role + "-video" );
- }
+ <div data-role="virtualgrid" data-scroll="y" data-template="tizen-demo-namecard"></div>
+ ".selector").virtualgrid("resize");
- control.hide();
- view.wrap( [ "<div class='ui-", role, "-wrap ui-", role , "-", theme, "'>" ].join( "" ) ).after( control );
- if ( option.controls && view.attr( "controls" ) ) {
- view.removeAttr( "controls" );
- }
+ @since Tizen2.0
+*/
- self._addEvent();
+( function ( $, window, document, undefined ) {
+
+ function circularNum ( num, total ) {
+ var n = num % total;
+ if ( n < 0 ) {
+ n = total + n;
+ }
+ return n;
+ }
+
+ function MomentumTracker ( options ) {
+ this.options = $.extend( {}, options );
+ this.easing = "easeOutQuad";
+ this.reset();
+ }
+
+ var tstates = {
+ scrolling : 0,
+ done : 1
},
+ _OVERFLOW_DIR_NONE = 0, /* ENUM */
+ _OVERFLOW_DIR_UP = 1, /* ENUM */
+ _OVERFLOW_DIR_DOWN = -1, /* ENUM */
+ imgTagSrcAttrRE = /src\s*=\s*[\"\'][\w\/.]+.[A-z]+[\"\']/;
- _resize: function () {
- var view = this.element,
- parent = view.parent(),
- control = parent.find( ".ui-multimediaview-control" ),
- viewWidth = 0,
- viewHeight = 0,
- viewOffset = null;
+ function getCurrentTime () {
+ return Date.now();
+ }
- this._resizeFullscreen( this.options.fullScreen );
- viewWidth = ( ( view[0].nodeName === "VIDEO" ) ? view.width() : parent.width() );
- viewHeight = ( ( view[0].nodeName === "VIDEO" ) ? view.height() : control.height() );
- viewOffset = view.offset();
+ $.extend( MomentumTracker.prototype, {
+ start : function ( pos, speed, duration ) {
+ this.state = ( speed !== 0 ) ? tstates.scrolling : tstates.done;
+ this.pos = pos;
+ this.speed = speed;
+ this.duration = duration;
- this._resizeControl( viewOffset, viewWidth, viewHeight );
+ this.fromPos = 0;
+ this.toPos = 0;
- this._updateSeekBar();
- this._updateVolumeState();
+ this.startTime = getCurrentTime();
},
- _resizeControl: function ( offset, width, height ) {
- var self = this,
- view = self.element,
- viewElement = view[0],
- control = view.parent().find( ".ui-multimediaview-control" ),
- buttons = control.find( ".ui-button" ),
- playpauseButton = control.find( ".ui-playpausebutton" ),
- seekBar = control.find( ".ui-seekbar" ),
- durationLabel = control.find( ".ui-durationlabel" ),
- timestampLabel = control.find( ".ui-timestamplabel" ),
- volumeControl = control.find( ".ui-volumecontrol" ),
- volumeBar = volumeControl.find( ".ui-volumebar" ),
- controlWidth = width,
- controlHeight = control.outerHeight( true ),
- availableWidth = 0,
- controlOffset = null;
+ reset : function () {
+ this.state = tstates.done;
+ this.pos = 0;
+ this.speed = 0;
+ this.duration = 0;
+ },
- if ( control ) {
- if ( view[0].nodeName === "VIDEO" ) {
- controlOffset = control.offset();
- controlOffset.left = offset.left;
- controlOffset.top = offset.top + height - controlHeight;
- control.offset( controlOffset );
- }
+ update : function () {
+ var state = this.state, duration, elapsed, dx, x;
- control.width( controlWidth );
- }
-
- if ( seekBar ) {
- availableWidth = control.width() - ( buttons.outerWidth( true ) * buttons.length );
- availableWidth -= ( parseInt( buttons.eq( 0 ).css( "margin-left" ), 10 ) + parseInt( buttons.eq( 0 ).css( "margin-right" ), 10 ) ) * buttons.length;
- if ( !self.isVolumeHide ) {
- availableWidth -= volumeControl.outerWidth( true );
- }
- seekBar.width( availableWidth );
- }
-
- if ( durationLabel && !isNaN( viewElement.duration ) ) {
- durationLabel.find( "p" ).text( self._convertTimeFormat( viewElement.duration ) );
- }
-
- if ( viewElement.autoplay && viewElement.paused === false ) {
- playpauseButton.removeClass( "ui-play-icon" ).addClass( "ui-pause-icon" );
+ if ( state == tstates.done ) {
+ return this.pos;
}
+ duration = this.duration;
+ elapsed = getCurrentTime () - this.startTime;
+ elapsed = elapsed > duration ? duration : elapsed;
+ dx = this.speed * ( 1 - $.easing[this.easing]( elapsed / duration, elapsed, 0, 1, duration ) );
+ x = this.pos + ( dx / 2 );
+ this.pos = x;
- if ( seekBar.width() < ( volumeBar.width() + timestampLabel.width() + durationLabel.width() ) ) {
- durationLabel.hide();
- } else {
- durationLabel.show();
+ if ( elapsed >= duration ) {
+ this.state = tstates.done;
}
+ return this.pos;
},
- _resizeFullscreen: function ( isFullscreen ) {
- var self = this,
- view = self.element,
- parent = view.parent(),
- control = view.parent().find( ".ui-multimediaview-control" ),
- playpauseButton = control.find( ".ui-playpausebutton" ),
- timestampLabel = control.find( ".ui-timestamplabel" ),
- seekBar = control.find( ".ui-seekbar" ),
- durationBar = seekBar.find( ".ui-duration" ),
- currenttimeBar = seekBar.find( ".ui-currenttime" ),
- docWidth = 0,
- docHeight = 0;
-
- if ( isFullscreen ) {
- if ( !self.backupView ) {
- self.backupView = {
- width: view[0].style.getPropertyValue( "width" ) || "",
- height: view[0].style.getPropertyValue( "height" ) || "",
- position: view.css( "position" ),
- zindex: view.css( "z-index" )
- };
- }
- docWidth = $( "body" )[0].clientWidth;
- docHeight = $( "body" )[0].clientHeight;
+ done : function () {
+ return this.state == tstates.done;
+ },
- view.width( docWidth ).height( docHeight - 1 );
- view.closest(".ui-multimediaview-wrap").height( docHeight - 1 );
- view.addClass( "ui-" + self.role + "-fullscreen" );
- view.offset( {
- top: 0,
- left: 0
- });
- } else {
- if ( !self.backupView ) {
- return;
- }
+ getPosition : function () {
+ return this.pos;
+ }
+ });
- view.removeClass( "ui-" + self.role + "-fullscreen" );
- view.css( {
- "width": self.backupView.width,
- "height": self.backupView.height,
- "position": self.backupView.position,
- "z-index": self.backupView.zindex
- });
- view.closest(".ui-multimediaview-wrap").css( "height", "" );
- self.backupView = null;
- }
- parent.show();
+ jQuery.widget ( "mobile.virtualgrid", jQuery.mobile.widget, {
+ options : {
+ // virtualgrid option
+ template : "",
+ direction : "y",
+ rotation : false
},
- _addEvent: function () {
- var self = this,
- view = self.element,
- option = self.options,
- viewElement = view[0],
- control = view.parent().find( ".ui-multimediaview-control" ),
- playpauseButton = control.find( ".ui-playpausebutton" ),
- timestampLabel = control.find( ".ui-timestamplabel" ),
- durationLabel = control.find( ".ui-durationlabel" ),
- volumeButton = control.find( ".ui-volumebutton" ),
- volumeControl = control.find( ".ui-volumecontrol" ),
- volumeBar = volumeControl.find( ".ui-volumebar" ),
- volumeGuide = volumeControl.find( ".ui-guide" ),
- volumeHandle = volumeControl.find( ".ui-handler" ),
- fullscreenButton = control.find( ".ui-fullscreenbutton" ),
- seekBar = control.find( ".ui-seekbar" ),
- durationBar = seekBar.find( ".ui-duration" ),
- currenttimeBar = seekBar.find( ".ui-currenttime" );
+ create : function () {
+ this._create.apply( this, arguments );
+ },
- $( document ).unbind( ".multimediaview" ).bind( "pagechange.multimediaview", function ( e ) {
- var $page = $( e.target );
- if ( $page.find( view ).length > 0 && viewElement.autoplay ) {
- viewElement.play();
- }
+ _create : function ( args ) {
+ $.extend( this, {
+ // view
+ _$view : null,
+ _$clip : null,
+ _$rows : null,
+ _tracker : null,
+ _viewSize : 0,
+ _clipSize : 0,
+ _cellSize : undefined,
+ _currentItemCount : 0,
+ _itemCount : 1,
+ _inheritedSize : null,
- if ( option.controls ) {
- control.show();
- self._resize();
- }
- }).bind( "pagebeforechange.multimediaview", function ( e ) {
- if ( viewElement.played.length !== 0 ) {
- viewElement.pause();
- control.hide();
- }
- });
+ // timer
+ _timerInterval : 0,
+ _timerID : 0,
+ _timerCB : null,
+ _lastMove : null,
- $( window ).unbind( ".multimediaview" ).bind( "resize.multimediaview orientationchange.multimediaview", function ( e ) {
- if ( !option.controls ) {
- return;
- }
- var $page = $( e.target ),
- $scrollview = view.parents( ".ui-scrollview-clip" );
+ // Data
+ _itemData : function ( idx ) { return null; },
+ _numItemData : 0,
+ _cacheItemData : function ( minIdx, maxIdx ) { },
+ _totalRowCnt : 0,
+ _templateText : null,
+ _maxViewSize : 0,
+ _modifyViewPos : 0,
+ _maxSizeExceptClip : 0,
+ _maxSize : 0,
- $scrollview.each( function ( i ) {
- if ( $.data( this, "scrollview" ) ) {
- $( this ).scrollview( "scrollTo", 0, 0 );
- }
- });
+ // axis - ( true : x , false : y )
+ _direction : false,
+ _didDrag : true,
+ _reservedPos : 0,
+ _scalableSize : 0,
+ _eventPos : 0,
+ _nextPos : 0,
+ _movePos : 0,
+ _lastY : 0,
+ _speedY : 0,
+ _lastX : 0,
+ _speedX : 0,
+ _rowsPerView : 0,
+ _fragment : null,
- // for maintaining page layout
- if ( !option.fullScreen ) {
- $( ".ui-footer:visible" ).show();
- } else {
- $( ".ui-footer" ).hide();
- self._fitContentArea( $page );
- }
+ _filterRatio : 0.9,
- self._resize();
+ _overflowStartPos : 0,
+ _overflowDir : 0,
+ _overflowMaxDragDist : 100
});
- view.bind( "loadedmetadata.multimediaview", function ( e ) {
- if ( !isNaN( viewElement.duration ) ) {
- durationLabel.find( "p" ).text( self._convertTimeFormat( viewElement.duration ) );
- }
- self._resize();
- }).bind( "timeupdate.multimediaview", function ( e ) {
- self._updateSeekBar();
- }).bind( "play.multimediaview", function ( e ) {
- playpauseButton.removeClass( "ui-play-icon" ).addClass( "ui-pause-icon" );
- }).bind( "pause.multimediaview", function ( e ) {
- playpauseButton.removeClass( "ui-pause-icon" ).addClass( "ui-play-icon" );
- }).bind( "ended.multimediaview", function ( e ) {
- if ( typeof viewElement.loop == "undefined" || viewElement.loop === "" ) {
- self.stop();
- }
- }).bind( "volumechange.multimediaview", function ( e ) {
- if ( viewElement.volume < 0.1 ) {
- viewElement.muted = true;
- volumeButton.removeClass( "ui-volume-icon" ).addClass( "ui-mute-icon" );
- } else {
- viewElement.muted = false;
- volumeButton.removeClass( "ui-mute-icon" ).addClass( "ui-volume-icon" );
- }
+ var self = this,
+ $dom = $( self.element ),
+ opts = self.options,
+ $item = null;
- if ( !self.isVolumeHide ) {
- self._updateVolumeState();
- }
- }).bind( "durationchange.multimediaview", function ( e ) {
- if ( !isNaN( viewElement.duration ) ) {
- durationLabel.find( "p" ).text( self._convertTimeFormat( viewElement.duration ) );
- }
- self._resize();
- }).bind( "error.multimediaview", function ( e ) {
- switch ( e.target.error.code ) {
- case e.target.error.MEDIA_ERR_ABORTED:
- window.alert( 'You aborted the video playback.' );
- break;
- case e.target.error.MEDIA_ERR_NETWORK:
- window.alert( 'A network error caused the video download to fail part-way.' );
- break;
- case e.target.error.MEDIA_ERR_DECODE:
- window.alert( 'The video playback was aborted due to a corruption problem or because the video used features your browser did not support.' );
- break;
- case e.target.error.MEDIA_ERR_SRC_NOT_SUPPORTED:
- window.alert( 'The video could not be loaded, either because the server or network failed or because the format is not supported.' );
- break;
- default:
- window.alert( 'An unknown error occurred.' );
- break;
- }
- }).bind( "vclick.multimediaview", function ( e ) {
- if ( !self.options.controls ) {
- return;
- }
+ // itemData
+ // If mandatory options are not given, Do nothing.
+ if ( !args ) {
+ return ;
+ }
- control.fadeToggle( "fast", function () {
- var offset = control.offset();
- self.isControlHide = !self.isControlHide;
- if ( self.options.mediatype == "video" ) {
- self._startTimer();
- }
- });
- self._resize();
- });
+ if ( !self._loadData( args ) ) {
+ return;
+ }
- playpauseButton.bind( "vclick.multimediaview", function () {
- self._endTimer();
+ // make a fragment.
+ self._fragment = document.createDocumentFragment();
- if ( viewElement.paused ) {
- viewElement.play();
- } else {
- viewElement.pause();
- }
+ // read defined properties(width and height) from dom element.
+ self._inheritedSize = self._getinheritedSize( self.element );
- if ( self.options.mediatype == "video" ) {
- self._startTimer();
- }
- });
+ // set a scroll direction.
+ self._direction = opts.direction === 'x' ? true : false;
- fullscreenButton.bind( "vclick.multimediaview", function ( e ) {
- self.fullScreen( !self.options.fullScreen );
- control.fadeIn( "fast" );
- self._endTimer();
- e.preventDefault();
- e.stopPropagation();
- });
+ // make view layer
+ self._$clip = $dom.addClass( "ui-scrollview-clip" ).addClass( "ui-virtualgrid-view" );
+ $item = $( document.createElement( "div" ) ).addClass( "ui-scrollview-view" );
+ self._clipSize = self._calculateClipSize();
+ self._$clip.append( $item );
+ self._$view = $item;
+ self._$clip.css( "overflow", "hidden" );
+ self._$view.css( "overflow", "hidden" );
- seekBar.bind( "vmousedown.multimediaview", function ( e ) {
- var x = e.clientX,
- duration = viewElement.duration,
- durationOffset = durationBar.offset(),
- durationWidth = durationBar.width(),
- timerate = ( x - durationOffset.left ) / durationWidth,
- time = duration * timerate;
+ // inherit from scrollview widget.
+ self._scrollView = $.tizen.scrollview.prototype;
+ self._initScrollView();
- if ( !viewElement.played.length ) {
- return;
- }
+ // create tracker.
+ self._createTracker();
+ self._makePositioned( self._$clip );
+ self._timerInterval = 1000 / self.options.fps;
- viewElement.currentTime = time;
+ self._timerID = 0;
+ self._timerCB = function () {
+ self._handleMomentumScroll();
+ };
+ $dom.closest( ".ui-content" ).addClass( "ui-virtualgrid-content" ).css( "overflow", "hidden" );
- self._endTimer();
-
- e.preventDefault();
- e.stopPropagation();
-
- $( document ).bind( "vmousemove.multimediaview", function ( e ) {
- var x = e.clientX,
- timerate = ( x - durationOffset.left ) / durationWidth;
-
- viewElement.currentTime = duration * timerate;
+ // add event handler.
+ self._addBehaviors();
- e.preventDefault();
- e.stopPropagation();
- }).bind( "vmouseup.multimediaview", function () {
- $( document ).unbind( "vmousemove.multimediaview vmouseup.multimediaview" );
- if ( viewElement.paused ) {
- viewElement.pause();
- } else {
- viewElement.play();
- }
- });
- });
+ self._currentItemCount = 0;
+ self._createOverflowArea();
+ self._createScrollBar();
+ self.refresh();
+ },
- volumeButton.bind( "vclick.multimediaview", function () {
- if ( self.isVolumeHide ) {
- var view = self.element,
- volume = viewElement.volume;
+ // The argument is checked for compliance with the specified format.
+ // @param args : Object
+ // @return boolean
+ _loadData : function ( args ) {
+ var self = this;
- self.isVolumeHide = false;
- self._resize();
- volumeControl.fadeIn( "fast" );
- self._updateVolumeState();
- self._updateSeekBar();
+ if ( args.itemData && typeof args.itemData == 'function' ) {
+ self._itemData = args.itemData;
+ } else {
+ return false;
+ }
+ if ( args.numItemData ) {
+ if ( typeof args.numItemData == 'function' ) {
+ self._numItemData = args.numItemData( );
+ } else if ( typeof args.numItemData == 'number' ) {
+ self._numItemData = args.numItemData;
} else {
- self.isVolumeHide = true;
- volumeControl.fadeOut( "fast", function () {
- self._resize();
- });
- self._updateSeekBar();
+ return false;
}
- });
+ } else {
+ return false;
+ }
+ self._getObjectNames( self._itemData( 0 ) );
+ return true;
+ },
- volumeBar.bind( "vmousedown.multimediaview", function ( e ) {
- var baseX = e.clientX,
- volumeGuideLeft = volumeGuide.offset().left,
- volumeGuideWidth = volumeGuide.width(),
- volumeBase = volumeGuideLeft + volumeGuideWidth,
- handlerOffset = volumeHandle.offset(),
- volumerate = ( baseX - volumeGuideLeft ) / volumeGuideWidth,
- currentVolume = ( baseX - volumeGuideLeft ) / volumeGuideWidth;
+ // Make up the first screen.
+ _initLayout: function () {
+ var self = this,
+ opts = self.options,
+ i,
+ $row;
- self._endTimer();
- self._setVolume( currentVolume.toFixed( 2 ) );
+ for ( i = -1; i < self._rowsPerView + 1; i += 1 ) {
+ $row = self._$rows[ circularNum( i, self._$rows.length ) ];
+ self._$view.append( $row );
+ }
+ self._setElementTransform( -self._cellSize );
- e.preventDefault();
- e.stopPropagation();
+ self._replaceRow( self._$view[0].firstChild, self._totalRowCnt - 1 );
+ if ( opts.rotation && self._rowsPerView >= self._totalRowCnt ) {
+ self._replaceRow( self._$view[0].lastChild, 0 );
+ }
+ self._setViewSize();
+ },
- $( document ).bind( "vmousemove.multimediaview", function ( e ) {
- var currentX = e.clientX,
- currentVolume = ( currentX - volumeGuideLeft ) / volumeGuideWidth;
+ _setViewSize : function () {
+ var self = this,
+ height = 0,
+ width = 0;
- self._setVolume( currentVolume.toFixed( 2 ) );
+ if ( self._direction ) {
+ width = self._cellSize * ( self._rowsPerView + 2 );
+ width = parseInt( width, 10 ) + 1;
+ self._$view.width( width );
+ self._viewSize = self._$view.width();
+ } else {
+ self._$view.height( self._cellSize * ( self._rowsPerView + 2 ) );
+ self._$clip.height( self._clipSize );
+ self._viewSize = self._$view.height();
+ }
+ },
- e.preventDefault();
- e.stopPropagation();
- }).bind( "vmouseup.multimediaview", function () {
- $( document ).unbind( "vmousemove.multimediaview vmouseup.multimediaview" );
+ _getViewWidth : function () {
+ var self = this;
+ return self._maxSize;
+ },
- if ( self.options.mediatype == "video" ) {
- self._startTimer();
- }
- });
- });
+ _getViewHeight : function () {
+ var self = this;
+ return self._maxSize;
},
- _removeEvent: function () {
+ refresh : function () {
var self = this,
- view = self.element,
- control = view.parent().find( ".ui-multimediaview-control" ),
- playpauseButton = control.find( ".ui-playpausebutton" ),
- fullscreenButton = control.find( ".ui-fullscreenbutton" ),
- seekBar = control.find( ".ui-seekbar" ),
- volumeControl = control.find( ".ui-volumecontrol" ),
- volumeBar = volumeControl.find( ".ui-volumebar" ),
- volumeHandle = volumeControl.find( ".ui-handler" );
+ opts = self.options,
+ width = 0,
+ height = 0,
+ $template = null;
- view.unbind( ".multimediaview" );
- playpauseButton.unbind( ".multimediaview" );
- fullscreenButton.unbind( ".multimediaview" );
- seekBar.unbind( ".multimediaview" );
- volumeBar.unbind( ".multimediaview" );
- volumeHandle.unbind( ".multimediaview" );
+ $template = $( "#" + opts.template );
+ if ( !$template ) {
+ return ;
+ }
+ self._templateText = self._insertAriaAttrToTmpl( $template.text() );
+
+ width = self._calculateClipWidth();
+ height = self._calculateClipHeight();
+ self._$view.width( width ).height( height );
+ self._$clip.width( width ).height( height );
+
+ self._clipSize = self._calculateClipSize();
+ self._calculateColumnSize();
+ self._initPageProperty();
+ self._setScrollBarSize();
},
- _createControl: function () {
+ _initPageProperty : function () {
var self = this,
- view = self.element,
- control = $( "<span></span>" ).addClass( "ui-" + self.role + "-control" ),
- playpauseButton = $( "<span></span>" ).addClass( "ui-playpausebutton ui-button" ),
- seekBar = $( "<span></span>" ).addClass( "ui-seekbar" ),
- timestampLabel = $( "<span><p>00:00:00</p></span>" ).addClass( "ui-timestamplabel" ),
- durationLabel = $( "<span><p>00:00:00</p></span>" ).addClass( "ui-durationlabel" ),
- volumeButton = $( "<span></span>" ).addClass( "ui-volumebutton ui-button" ),
- volumeControl = $( "<span></span>" ).addClass( "ui-volumecontrol" ),
- volumeBar = $( "<div></div>" ).addClass( "ui-volumebar" ),
- volumeGuide = $( "<span></span>" ).addClass( "ui-guide" ),
- volumeValue = $( "<span></span>" ).addClass( "ui-value" ),
- volumeHandle = $( "<span></span>" ).addClass( "ui-handler" ),
- fullscreenButton = $( "<span></span>" ).addClass( "ui-fullscreenbutton ui-button" ),
- durationBar = $( "<span></span>" ).addClass( "ui-duration" ),
- currenttimeBar = $( "<span></span>" ).addClass( "ui-currenttime" );
-
- seekBar.append( durationBar ).append( currenttimeBar ).append( durationLabel ).append( timestampLabel );
+ rowsPerView = 0,
+ $child,
+ columnCount = 0,
+ totalRowCnt = 0,
+ attributeName = self._direction ? "width" : "height";
- playpauseButton.addClass( "ui-play-icon" );
- volumeButton.addClass( view[0].muted ? "ui-mute-icon" : "ui-volume-icon" );
- volumeBar.append( volumeGuide ).append( volumeValue ).append( volumeHandle );
- volumeControl.append( volumeBar );
+ columnCount = self._calculateColumnCount();
- control.append( playpauseButton ).append( seekBar ).append( volumeControl ).append( volumeButton );
+ totalRowCnt = parseInt( self._numItemData / columnCount, 10 );
+ self._totalRowCnt = self._numItemData % columnCount === 0 ? totalRowCnt : totalRowCnt + 1;
+ self._itemCount = columnCount;
- if ( self.element[0].nodeName === "VIDEO" ) {
- $( fullscreenButton ).addClass( "ui-fullscreen-on" );
- control.append( fullscreenButton );
+ if ( self._cellSize <= 0 ) {
+ return ;
}
- volumeControl.hide();
- return control;
- },
-
- _startTimer: function ( duration ) {
- this._endTimer();
+ rowsPerView = self._clipSize / self._cellSize;
+ rowsPerView = Math.ceil( rowsPerView );
+ self._rowsPerView = parseInt( rowsPerView, 10 );
- if ( !duration ) {
- duration = 3000;
- }
+ $child = $( self._makeRows( rowsPerView + 2 ) );
+ self._$view.append( $child.children() );
+ self._$view.children().css( attributeName, self._cellSize + "px" );
+ self._$rows = self._$view.children().detach();
- var self = this,
- view = self.element,
- control = view.parent().find( ".ui-multimediaview-control" ),
- volumeControl = control.find( ".ui-volumecontrol" );
+ self._reservedPos = -self._cellSize;
+ self._scalableSize = -self._cellSize;
- self.controlTimer = setTimeout( function () {
- self.isVolumeHide = true;
- self.isControlHide = true;
- self.controlTimer = null;
- volumeControl.hide();
- control.fadeOut( "fast" );
- }, duration );
- },
+ self._initLayout();
- _endTimer: function () {
- if ( this.controlTimer ) {
- clearTimeout( this.controlTimer );
- this.controlTimer = null;
+ self._blockScroll = self._rowsPerView > self._totalRowCnt;
+ self._maxSizeExceptClip = ( self._totalRowCnt - self._rowsPerView ) * self._cellSize;
+ self._maxSize = self._totalRowCnt * self._cellSize;
+ self._maxViewSize = ( self._rowsPerView ) * self._cellSize;
+ self._modifyViewPos = -self._cellSize;
+ if ( self._clipSize < self._maxViewSize ) {
+ self._modifyViewPos = ( -self._cellSize ) + ( self._clipSize - self._maxViewSize );
}
},
- _convertTimeFormat: function ( systime ) {
- var ss = parseInt( systime % 60, 10 ).toString(),
- mm = parseInt( ( systime / 60 ) % 60, 10 ).toString(),
- hh = parseInt( systime / 3600, 10 ).toString(),
- time = ( ( hh.length < 2 ) ? "0" + hh : hh ) + ":" +
- ( ( mm.length < 2 ) ? "0" + mm : mm ) + ":" +
- ( ( ss.length < 2 ) ? "0" + ss : ss );
+ _getinheritedSize : function ( elem ) {
+ var $target = $( elem ),
+ height,
+ width,
+ NODETYPE = { ELEMENT_NODE : 1, TEXT_NODE : 3 },
+ ret = {
+ isDefinedWidth : false,
+ isDefinedHeight : false,
+ width : 0,
+ height : 0
+ };
- return time;
- },
+ while ( $target[0].nodeType === NODETYPE.ELEMENT_NODE && ( ret.isDefinedWidth === false || ret.isHeightDefined === false ) ) {
+ height = $target[0].style.height;
+ width = $target[0].style.width;
- _updateSeekBar: function ( currenttime ) {
- var self = this,
- view = self.element,
- duration = view[0].duration,
- control = view.parent().find( ".ui-multimediaview-control" ),
- seekBar = control.find( ".ui-seekbar" ),
- durationBar = seekBar.find( ".ui-duration" ),
- currenttimeBar = seekBar.find( ".ui-currenttime" ),
- timestampLabel = control.find( ".ui-timestamplabel" ),
- durationOffset = durationBar.offset(),
- durationWidth = durationBar.width(),
- durationHeight = durationBar.height(),
- timebarWidth = 0;
+ if ( ret.isDefinedHeight === false && height !== "" ) {
+ // Size was defined
+ ret.isDefinedHeight = true;
+ ret.height = parseInt( height, 10 );
+ }
- if ( typeof currenttime == "undefined" ) {
- currenttime = view[0].currentTime;
+ if ( ret.isDefinedWidth === false && width !== "" ) {
+ // Size was defined
+ ret.isDefinedWidth = true;
+ ret.width = parseInt( width, 10 );
+ }
+ $target = $target.parent();
+ if ( $target.hasClass( "ui-content" ) ) {
+ break;
+ }
}
- timebarWidth = parseInt( currenttime / duration * durationWidth, 10 );
- durationBar.offset( durationOffset );
- currenttimeBar.offset( durationOffset ).width( timebarWidth );
- timestampLabel.find( "p" ).text( self._convertTimeFormat( currenttime ) );
+ return ret;
},
- _updateVolumeState: function () {
+ resize : function () {
var self = this,
- view = self.element,
- control = view.parent().find( ".ui-multimediaview-control" ),
- volumeControl = control.find( ".ui-volumecontrol" ),
- volumeButton = control.find( ".ui-volumebutton" ),
- volumeBar = volumeControl.find( ".ui-volumebar" ),
- volumeGuide = volumeControl.find( ".ui-guide" ),
- volumeValue = volumeControl.find( ".ui-value" ),
- volumeHandle = volumeControl.find( ".ui-handler" ),
- handlerWidth = volumeHandle.width(),
- handlerHeight = volumeHandle.height(),
- volumeGuideHeight = volumeGuide.height(),
- volumeGuideWidth = volumeGuide.width(),
- volumeGuideTop = 0,
- volumeGuideLeft = 0,
- volumeBase = 0,
- handlerOffset = null,
- volume = view[0].volume;
+ ret = null,
+ rowsPerView = 0,
+ itemCount = 0,
+ totalRowCnt = 0,
+ diffRowCnt = 0,
+ clipSize = 0,
+ prevcnt = 0,
+ clipPosition = 0;
- volumeGuideTop = parseInt( volumeGuide.offset().top, 10 );
- volumeGuideLeft = parseInt( volumeGuide.offset().left, 10 );
- volumeBase = volumeGuideLeft;
- handlerOffset = volumeHandle.offset();
- handlerOffset.top = volumeGuideTop - parseInt( ( handlerHeight - volumeGuideHeight ) / 2, 10 );
- handlerOffset.left = volumeBase + parseInt( volumeGuideWidth * volume, 10 ) - parseInt( handlerWidth / 2, 10 );
- volumeHandle.offset( handlerOffset );
- volumeValue.width( parseInt( volumeGuideWidth * ( volume ), 10 ) );
+ itemCount = self._calculateColumnCount();
+ if ( itemCount != self._itemCount ) {
+ totalRowCnt = parseInt( self._numItemData / itemCount, 10 );
+ self._totalRowCnt = self._numItemData % itemCount === 0 ? totalRowCnt : totalRowCnt + 1;
+ prevcnt = self._itemCount;
+ self._itemCount = itemCount;
+ clipPosition = self._getClipPosition();
+ self._$view.hide();
+
+ diffRowCnt = self._replaceRows( itemCount, prevcnt, self._totalRowCnt, clipPosition );
+ self._maxSizeExceptClip = ( self._totalRowCnt - self._rowsPerView ) * self._cellSize;
+ self._maxSize = self._totalRowCnt * self._cellSize;
+ self._scalableSize += ( -diffRowCnt ) * self._cellSize;
+ self._reservedPos += ( -diffRowCnt ) * self._cellSize;
+ self._setScrollBarSize();
+ self._setScrollBarPosition( diffRowCnt );
+
+ self._$view.show();
+ }
+
+ clipSize = self._calculateClipSize();
+ if ( clipSize !== self._clipSize ) {
+ rowsPerView = clipSize / self._cellSize;
+ rowsPerView = parseInt( Math.ceil( rowsPerView ), 10 );
+
+ if ( rowsPerView > self._rowsPerView ) {
+ // increase row.
+ self._increaseRow( rowsPerView - self._rowsPerView );
+ } else if ( rowsPerView < self._rowsPerView ) {
+ // decrease row.
+ self._decreaseRow( self._rowsPerView - rowsPerView );
+ }
+ self._rowsPerView = rowsPerView;
+ self._clipSize = clipSize;
+ self._blockScroll = self._rowsPerView > self._totalRowCnt;
+ self._maxSizeExceptClip = ( self._totalRowCnt - self._rowsPerView ) * self._cellSize;
+ self._maxSize = self._totalRowCnt * self._cellSize;
+ self._maxViewSize = ( self._rowsPerView ) * self._cellSize;
+ if ( self._clipSize < self._maxViewSize ) {
+ self._modifyViewPos = ( -self._cellSize ) + ( self._clipSize - self._maxViewSize );
+ }
+ if ( self._direction ) {
+ self._$clip.width( self._clipSize );
+ } else {
+ self._$clip.height( self._clipSize );
+ }
+ self._setScrollBarSize();
+ self._setScrollBarPosition( 0 );
+ self._setViewSize();
+ }
},
- _setVolume: function ( value ) {
- var viewElement = this.element[0];
+ _initScrollView : function () {
+ var self = this;
+ $.extend( self.options, self._scrollView.options );
+ self.options.moveThreshold = 10;
+ self.options.showScrollBars = false;
+ self._getScrollHierarchy = self._scrollView._getScrollHierarchy;
+ self._makePositioned = self._scrollView._makePositioned;
+ self._set_scrollbar_size = self._scrollView._set_scrollbar_size;
+ self._setStyleTransform = self._scrollView._setElementTransform;
+ self._hideOverflowIndicator = self._scrollView._hideOverflowIndicator;
+ self._showOverflowIndicator = self._scrollView._showOverflowIndicator;
+ self._setGestureScroll = self._scrollView._setGestureScroll;
+ },
- if ( value < 0.0 || value > 1.0 ) {
+ _createTracker : function () {
+ var self = this;
+
+ self._tracker = new MomentumTracker( self.options );
+ if ( self._direction ) {
+ self._hTracker = self._tracker;
+ self._$clip.width( self._clipSize );
+ } else {
+ self._vTracker = self._tracker;
+ self._$clip.height( self._clipSize );
+ }
+ },
+
+ //----------------------------------------------------//
+ // Overflow effect
+ //----------------------------------------------------//
+ _createOverflowArea : function () {
+ var self = this,
+ prefix = "<div class=\"ui-virtualgrid-overflow-indicator-",
+ suffixTop = "-top\"></div>",
+ suffixBottom = "-bottom\"></div>";
+
+ if ( self.options.rotation ) {
return;
}
- viewElement.volume = value;
+ if ( self._direction ) {
+ self._overflowTop = $( prefix + "x" + suffixTop );
+ self._overflowBottom = $( prefix + "x" + suffixBottom );
+ } else {
+ self._overflowTop = $( prefix + "y" + suffixTop );
+ self._overflowBottom = $( prefix + "y" + suffixBottom );
+ }
+
+ self._$clip.append( self._overflowTop );
+ self._$clip.append( self._overflowBottom );
+ self._overflowDisplayed = false;
},
- _fitContentArea: function ( page, parent ) {
- if ( typeof parent == "undefined" ) {
- parent = window;
+ _hideVGOverflowIndicator : function () {
+ if ( this._overflowDisplayed === false ) {
+ return;
}
- var $page = $( page ),
- $content = $( ".ui-content:visible:first" ),
- hh = $( ".ui-header:visible" ).outerHeight() || 0,
- fh = $( ".ui-footer:visible" ).outerHeight() || 0,
- pt = parseFloat( $content.css( "padding-top" ) ),
- pb = parseFloat( $content.css( "padding-bottom" ) ),
- wh = ( ( parent === window ) ? window.innerHeight : $( parent ).height() ),
- height = wh - ( hh + fh ) - ( pt + pb );
-
- $content.offset( {
- top: ( hh + pt )
- }).height( height );
+ this._overflowTop.animate( { opacity: 0 }, 300 );
+ this._overflowBottom.animate( { opacity: 0 }, 300 );
+ this._overflowDisplayed = false;
},
- width: function ( value ) {
+ //----------------------------------------------------//
+ // Scrollbar //
+ //----------------------------------------------------//
+ _createScrollBar : function () {
var self = this,
- args = arguments,
- view = self.element;
+ prefix = "<div class=\"ui-scrollbar ui-scrollbar-",
+ suffix = "\"><div class=\"ui-scrollbar-track\"><div class=\"ui-scrollbar-thumb\"></div></div></div>";
- if ( args.length === 0 ) {
- return view.width();
+ if ( self.options.rotation ) {
+ return ;
}
- if ( args.length === 1 ) {
- view.width( value );
- self._resize();
+
+ if ( self._direction ) {
+ self._$clip.append( prefix + "x" + suffix );
+ self._hScrollBar = self._$clip.children( ".ui-scrollbar-x" );
+ self._hScrollBar.find( ".ui-scrollbar-thumb" ).addClass( "ui-scrollbar-thumb-x" );
+ } else {
+ self._$clip.append( prefix + "y" + suffix );
+ self._vScrollBar = self._$clip.children( ".ui-scrollbar-y" );
+ self._vScrollBar.find( ".ui-scrollbar-thumb" ).addClass( "ui-scrollbar-thumb-y" );
}
},
- height: function ( value ) {
+ _setScrollBarSize: function () {
var self = this,
- view = self.element,
- args = arguments;
+ scrollBarSize = 0,
+ currentSize = 0,
+ $scrollBar,
+ attrName,
+ className;
- if ( args.length === 0 ) {
- return view.height();
+ if ( self.options.rotation ) {
+ return ;
}
- if ( args.length === 1 ) {
- view.height( value );
- self._resize();
+
+ scrollBarSize = parseInt( self._maxViewSize / self._clipSize, 10 );
+ if ( self._direction ) {
+ $scrollBar = self._hScrollBar.find( ".ui-scrollbar-thumb" );
+ attrName = "width";
+ currentSize = $scrollBar.width();
+ className = "ui-scrollbar-thumb-x";
+ self._hScrollBar.css( "width", self._clipSize );
+ } else {
+ $scrollBar = self._vScrollBar.find( ".ui-scrollbar-thumb" );
+ attrName = "height";
+ className = "ui-scrollbar-thumb-y";
+ currentSize = $scrollBar.height();
+ self._vScrollBar.css( "height", self._clipSize );
+ }
+
+ if ( scrollBarSize > currentSize ) {
+ $scrollBar.removeClass( className );
+ $scrollBar.css( attrName, scrollBarSize );
+ } else {
+ scrollBarSize = currentSize;
}
+
+ self._itemScrollSize = parseFloat( ( self._clipSize - scrollBarSize ) / ( self._totalRowCnt - self._rowsPerView ) );
+ self._itemScrollSize = Math.round( self._itemScrollSize * 100 ) / 100;
},
- fullScreen: function ( value ) {
+ _setScrollBarPosition : function ( di, duration ) {
var self = this,
- view = self.element,
- control = view.parent().find( ".ui-multimediaview-control" ),
- fullscreenButton = control.find( ".ui-fullscreenbutton" ),
- args = arguments,
- option = self.options,
- currentPage = $( ".ui-page-active" );
+ $sbt = null,
+ x = "0px",
+ y = "0px",
+ translate;
- if ( args.length === 0 ) {
- return option.fullScreen;
+ if ( self.options.rotation ) {
+ return ;
}
- if ( args.length === 1 ) {
- view.parents( ".ui-content" ).scrollview( "scrollTo", 0, 0 );
- this.options.fullScreen = value;
- if ( value ) {
- currentPage.children( ".ui-header" ).hide();
- currentPage.children( ".ui-footer" ).hide();
- currentPage.addClass( "ui-fullscreen-page" );
- this._fitContentArea( currentPage );
- fullscreenButton.removeClass( "ui-fullscreen-on" ).addClass( "ui-fullscreen-off" );
- } else {
- currentPage.children( ".ui-header" ).show();
- currentPage.children( ".ui-footer" ).show();
- currentPage.removeClass( "ui-fullscreen-page" );
- this._fitContentArea( currentPage );
- fullscreenButton.removeClass( "ui-fullscreen-off" ).addClass( "ui-fullscreen-on" );
- }
- self._resize();
+ self._currentItemCount = self._currentItemCount + di;
+ if ( self._vScrollBar ) {
+ $sbt = self._vScrollBar.find( ".ui-scrollbar-thumb" );
+ y = ( self._currentItemCount * self._itemScrollSize ) + "px";
+ } else {
+ $sbt = self._hScrollBar.find( ".ui-scrollbar-thumb" );
+ x = ( self._currentItemCount * self._itemScrollSize ) + "px";
}
+ self._setStyleTransform( $sbt, x, y, duration );
},
- refresh: function () {
- this._resize();
- }
- });
+ _hideScrollBars : function () {
+ var self = this,
+ vclass = "ui-scrollbar-visible";
- $( document ).bind( "pagecreate create", function ( e ) {
- $.tizen.multimediaview.prototype.enhanceWithin( e.target );
- });
-} ( jQuery, document, window ) );
-/* ***************************************************************************
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- * ***************************************************************************
- *
- * Author: Minkyu Kang <mk7.kang@samsung.com>
- */
+ if ( self.options.rotation ) {
+ return ;
+ }
-/*
- * Notification widget
- *
- * HTML Attributes
- *
- * data-role: set to 'notification'.
- * data-type: 'ticker' or 'popup'.
- * data-interval: time to showing. If don't set, will show infinitely.
- *
- * APIs
- *
- * open(): open the notification.
- * close(): close the notification.
- * text(text0, text1): set texts or get texts
- * icon(src): set the icon (tickernoti only)
- *
- * Events
- *
- * N/A
- *
- * Examples
- *
- * // tickernoti
- * <div data-role="notification" id="notification" data-type="ticker" data-interval="3000">
- * <img src="icon01.png">
- * <p>Hello World</p>
- * <p>Denis</p>
- * </div>
- *
- * // smallpopup
- * <div data-role="notification" id="notification" data-type="popup" data-interval="3000">
- * <p>Hello World</p>
- * </div>
- *
- */
+ if ( self._vScrollBar ) {
+ self._vScrollBar.removeClass( vclass );
+ } else {
+ self._hScrollBar.removeClass( vclass );
+ }
+ },
-/**
- @class Notification
- The notification widget shows a pop-up window on the screen to provide notifications.
- To add a notification widget to the application, use the following code:
+ _showScrollBars : function () {
+ var self = this,
+ vclass = "ui-scrollbar-visible";
- <div data-role="page">
- <div data-role="notification" data-type="smallpopup">
- <p>text1</p>
- </div>
- <div data-role="header"></div>
- <div data-role="content"></div>
- <div data-role="footer"></div>
- </div>
-*/
-/**
- @property {String} data-type
- Defines the notification type. The type options are tickernoti and smallpopup. <br/>The default value is smallpopup.
-
-*/
-/**
- @property {Integer} data-interval
- Defines the time to showing a notification widget. <br/>The default is infinitely.
-
-*/
-/**
- @method open
- The open method is used to open the notification widget:
-
- <div data-role="notification" data-type="smallpopup" data-interval="3000"></div>
- $('#notification').notification('open');
-*/
-/**
- @method close
- The close method is used to close the notification widget:
-
- <div data-role="notification" data-type="smallpopup" data-interval="3000"></div>
- $('#notification').notification('close');
-*/
-/**
- @method text
- The text method is used to set or get the notification text:
-
- <div data-role="notification" data-type="smallpopup" data-interval="3000"></div>
- // Set notification text
- $('#notification').notification('text', 'setThisText');
- // Get notification text
- texts = $('#notification').notification('text');
- @since Tizen2.0
-*/
-/**
- @method icon
- The setIcon method is used to set the ticker notification icon. The icon can be set only if the notification type is set to tickernoti.
-
- <div data-role="notification" data-type="ticker" data-interval="3000"></div>
- $('#notification').notification('icon', './test.png');
-*/
-(function ( $, window ) {
- $.widget( "tizen.notification", $.mobile.widget, {
- btn: null,
- text_bg: [],
- icon_img: [],
- interval: null,
- seconds: null,
- running: false,
-
- _get_text: function () {
- var text = new Array( 2 );
+ if ( self.options.rotation ) {
+ return ;
+ }
- if ( this.type === 'ticker' ) {
- text[0] = $( this.text_bg[0] ).text();
- text[1] = $( this.text_bg[1] ).text();
+ if ( self._vScrollBar ) {
+ self._vScrollBar.addClass( vclass );
} else {
- text[0] = $( this.text_bg[0] ).text();
+ self._hScrollBar.addClass( vclass );
}
-
- return text;
},
- _set_text: function ( text0, text1 ) {
- var _set = function ( elem, text ) {
- if ( !text ) {
+ //----------------------------------------------------//
+ // scroll process //
+ //----------------------------------------------------//
+ centerTo: function ( selector ) {
+ var self = this,
+ i,
+ newX = 0,
+ newY = 0;
+
+ if ( !self.options.rotation ) {
+ return;
+ }
+
+ for ( i = 0; i < self._$rows.length; i++ ) {
+ if ( $( self._$rows[i] ).hasClass( selector ) ) {
+ if ( self._direction ) {
+ newX = -( i * self._cellSize - self._clipSize / 2 + self._cellSize * 2 );
+ } else {
+ newY = -( i * self._cellSize - self._clipSize / 2 + self._cellSize * 2 );
+ }
+ self.scrollTo( newX, newY );
return;
}
- elem.text( text );
- };
+ }
+ },
- if ( this.type === 'ticker' ) {
- _set( $( this.text_bg[0] ), text0 );
- _set( $( this.text_bg[1] ), text1 );
+ scrollTo: function ( x, y, duration ) {
+ var self = this;
+ if ( self._direction ) {
+ x -= self._cellSize;
+ self._sx = self._reservedPos;
+ self._reservedPos = x;
} else {
- _set( $( this.text_bg[0] ), text0 );
+ y -= self._cellSize;
+ self._sy = self._reservedPos;
+ self._reservedPos = y;
}
+ self._scrollView.scrollTo.apply( this, [ x, y, duration ] );
},
- text: function ( text0, text1 ) {
- if ( text0 === undefined && text1 === undefined ) {
- return this._get_text();
+ getScrollPosition: function () {
+ if ( this.direction ) {
+ return { x: -this._ry, y: 0 };
}
-
- this._set_text( text0, text1 );
+ return { x: 0, y: -this._ry };
},
- icon: function ( src ) {
- if ( src === undefined ) {
+ _setScrollPosition: function ( x, y ) {
+ var self = this,
+ sy = self._scalableSize,
+ distance = self._direction ? x : y,
+ dy = distance - sy,
+ di = parseInt( dy / self._cellSize, 10 ),
+ i = 0,
+ idx = 0,
+ replaceStartIdx = 0,
+ realRowCount = self._rowsPerView + 2,
+ rawView = self._$view[0];
+
+ if ( self._blockScroll ) {
+ if ( dy > 0 && distance >= -self._cellSize && self._scalableSize >= -self._cellSize ) {
+ self._overflowDir = _OVERFLOW_DIR_UP;
+ }
+ if ( dy < 0 && self._scalableSize <= -( self._maxSizeExceptClip + self._cellSize ) ) {
+ self._overflowDir = _OVERFLOW_DIR_DOWN;
+ }
return;
}
- this.icon_img.detach();
- this.icon_img = $( "<img src='" + src + "' class='ui-ticker-icon'>" );
- $( this.element ).find(".ui-ticker").append( this.icon_img );
- },
-
- _refresh: function () {
- var container = this._get_container();
-
- $( container ).addClass("fix")
- .removeClass("show")
- .removeClass("hide");
+ if ( ! self.options.rotation ) {
+ if ( dy > 0 && distance >= -self._cellSize && self._scalableSize >= -self._cellSize ) {
+ // top
+ self._stopMScroll();
+ self._scalableSize = -self._cellSize;
+ self._setElementTransform( -self._cellSize );
+ if ( self._overflowDir === _OVERFLOW_DIR_NONE ) {
+ self._overflowDir = _OVERFLOW_DIR_UP;
+ }
+ return;
+ }
+ if ( dy < 0 && self._scalableSize <= -( self._maxSizeExceptClip + self._cellSize ) ) {
+ // bottom
+ self._stopMScroll();
+ self._scalableSize = -( self._maxSizeExceptClip + self._cellSize );
+ self._setElementTransform( self._modifyViewPos );
+ if ( self._overflowDir === _OVERFLOW_DIR_NONE ) {
+ self._overflowDir = _OVERFLOW_DIR_DOWN;
+ }
+ return;
+ }
+ }
- this._set_interval();
+ replaceStartIdx = ( Math.abs( di ) < realRowCount ) ? 0 : ( di > 0 ) ? di - realRowCount : di + realRowCount;
+ if ( di > 0 ) { // scroll up
+ for ( i = replaceStartIdx; i < di; i++ ) {
+ idx = -parseInt( ( sy / self._cellSize ) + i + 3, 10 );
+ self._replaceRow( rawView.lastChild, circularNum( idx, self._totalRowCnt ) );
+ rawView.insertBefore( rawView.lastChild, rawView.firstChild );
+ }
+ } else if ( di < 0 ) { // scroll down
+ for ( i = replaceStartIdx; i > di; i-- ) {
+ idx = self._rowsPerView - parseInt( ( sy / self._cellSize ) + i, 10 );
+ self._replaceRow( rawView.firstChild, circularNum( idx, self._totalRowCnt ) );
+ rawView.insertBefore( rawView.firstChild, rawView.lastChild.nextSibling );
+ }
+ }
+ self._setScrollBarPosition( -di );
+ self._scalableSize += di * self._cellSize;
+ self._setElementTransform( distance - self._scalableSize - self._cellSize );
},
- open: function () {
- var container = this._get_container();
+ _setElementTransform : function ( value ) {
+ var self = this,
+ x = 0,
+ y = 0;
- if ( this.running ) {
- this._refresh();
- return;
+ if ( self._direction ) {
+ x = value + "px";
+ } else {
+ y = value + "px";
}
+ self._setStyleTransform( self._$view, x, y );
+ },
- $( container ).addClass("show")
- .removeClass("hide")
- .removeClass("fix");
+ //----------------------------------------------------//
+ // Event handler //
+ //----------------------------------------------------//
+ _handleMomentumScroll: function () {
+ var self = this,
+ opts = self.options,
+ keepGoing = false,
+ v = this._$view,
+ x = 0,
+ y = 0,
+ t = self._tracker;
- this.running = true;
+ if ( t ) {
+ t.update();
+ if ( self._direction ) {
+ x = t.getPosition();
+ } else {
+ y = t.getPosition();
+ }
+ keepGoing = !t.done();
+ }
- if ( this.type === 'popup' ) {
- this._set_position();
+ self._setScrollPosition( x, y );
+ if ( !opts.rotation ) {
+ keepGoing = !t.done();
+ self._reservedPos = self._direction ? x : y;
+ // bottom
+ self._reservedPos = self._reservedPos <= (-(self._maxSizeExceptClip - self._modifyViewPos)) ? ( - ( self._maxSizeExceptClip + self._cellSize) ) : self._reservedPos;
+ // top
+ self._reservedPos = self._reservedPos > -self._cellSize ? -self._cellSize : self._reservedPos;
+ } else {
+ self._reservedPos = self._direction ? x : y;
}
+ self._$clip.trigger( self.options.updateEventName, [ { x: x, y: y } ] );
- this._set_interval();
+ if ( keepGoing ) {
+ self._timerID = setTimeout( self._timerCB, self._timerInterval );
+ } else {
+ self._stopMScroll();
+ }
},
- close: function () {
- var container = this._get_container();
-
- if ( !this.running ) {
- return;
+ _startMScroll: function ( speedX, speedY ) {
+ var self = this;
+ if ( self._direction ) {
+ self._sx = self._reservedPos;
+ } else {
+ self._sy = self._reservedPos;
}
+ self._scrollView._startMScroll.apply( self, [ speedX, speedY ] );
+ },
- $( container ).addClass("hide")
- .removeClass("show")
- .removeClass("fix");
+ _stopMScroll: function () {
+ this._scrollView._stopMScroll.apply( this );
+ },
- this.running = false;
- clearInterval( this.interval );
+ _enableTracking: function () {
+ var self = this;
+ self._$view.bind( self._dragMoveEvt, self._dragMoveCB );
+ self._$view.bind( self._dragStopEvt, self._dragStopCB );
+ self._scrollView._enableTracking.apply( self );
},
- destroy: function () {
- var container = this._get_container();
+ _disableTracking: function () {
+ var self = this;
+ self._$view.unbind( self._dragMoveEvt, self._dragMoveCB );
+ self._$view.unbind( self._dragStopEvt, self._dragStopCB );
+ self._scrollView._disableTracking.apply( self );
+ },
- $( container ).removeClass("show")
- .removeClass("hide")
- .removeClass("fix");
+ _handleDragStart: function ( e, ex, ey ) {
+ var self = this;
+ self._scrollView._handleDragStart.apply( this, [ e, ex, ey ] );
+ self._eventPos = self._direction ? ex : ey;
+ self._nextPos = self._reservedPos;
+ },
- this._del_event();
+ _handleDragMove: function ( e, ex, ey ) {
+ var self = this,
+ dx = ex - self._lastX,
+ dy = ey - self._lastY,
+ x = 0,
+ y = 0,
+ diffFromStartPos = 0,
+ diffFromLastPos = 0,
+ opacity = 0,
+ overflowPos = 0,
+ overFlowTarget = null;
- this.running = false;
- },
+ self._lastMove = getCurrentTime();
+ self._speedX = dx;
+ self._speedY = dy;
- _get_container: function () {
- if ( this.type === 'ticker' ) {
- return $( this.element ).find(".ui-ticker");
+ self._didDrag = true;
+
+ self._lastX = ex;
+ self._lastY = ey;
+
+ if ( self._direction ) {
+ self._movePos = ex - self._eventPos;
+ x = self._nextPos + self._movePos;
+ overflowPos = ex;
+ } else {
+ self._movePos = ey - self._eventPos;
+ y = self._nextPos + self._movePos;
+ overflowPos = ey;
+ }
+ self._showScrollBars();
+ self._setScrollPosition( x, y );
+ if ( self._overflowDir !== _OVERFLOW_DIR_NONE ) {
+ overFlowTarget = ( self._overflowDir === _OVERFLOW_DIR_UP ) ? self._overflowTop : self._overflowBottom;
+ if ( !self._overflowDisplayed ) {
+ self._overflowDisplayed = true;
+ self._overflowStartPos = overflowPos;
+ }
+ diffFromStartPos = ( overflowPos - self._overflowStartPos ) * self._overflowDir;
+ opacity = ( diffFromStartPos < 0 ) ?
+ 0 : ( diffFromStartPos > self._overflowMaxDragDist ) ?
+ 1 : ( diffFromStartPos / self._overflowMaxDragDist );
+ overFlowTarget.css( "opacity", opacity );
}
- return $( this.element ).find(".ui-smallpopup");
+ return false;
},
- _set_interval: function () {
+ _handleDragStop: function ( e ) {
var self = this;
- clearInterval( this.interval );
-
- if ( this.seconds !== undefined && this.second !== 0 ) {
- this.interval = setInterval( function () {
- self.close();
- }, this.seconds );
+ self._reservedPos = self._movePos ? self._nextPos + self._movePos : self._reservedPos;
+ self._scrollView._handleDragStop.apply( this, [ e ] );
+ if ( self._overflowDir !== _OVERFLOW_DIR_NONE ) {
+ self._overflowDir = _OVERFLOW_DIR_NONE;
+ self._hideVGOverflowIndicator();
}
+ return self._didDrag ? false : undefined;
},
- _add_event: function () {
- var self = this,
- container = this._get_container();
+ _addBehaviors: function () {
+ var self = this;
- if ( this.type === 'ticker' ) {
- container.find(".ui-ticker-btn").append( this.btn ).trigger("create");
+ // scroll event handler.
+ if ( self.options.eventType === "mouse" ) {
+ self._dragStartEvt = "mousedown";
+ self._dragStartCB = function ( e ) {
+ return self._handleDragStart( e, e.clientX, e.clientY );
+ };
- this.btn.bind( "vmouseup", function () {
- self.close();
- });
- }
+ self._dragMoveEvt = "mousemove";
+ self._dragMoveCB = function ( e ) {
+ return self._handleDragMove( e, e.clientX, e.clientY );
+ };
- container.bind( 'vmouseup', function () {
- self.close();
- });
- },
+ self._dragStopEvt = "mouseup";
+ self._dragStopCB = function ( e ) {
+ return self._handleDragStop( e, e.clientX, e.clientY );
+ };
- _del_event: function () {
- var container = this._get_container();
+ self._$view.bind( "vclick", function ( e ) {
+ return !self._didDrag;
+ } );
+ } else { //touch
+ self._dragStartEvt = "touchstart";
+ self._dragStartCB = function ( e ) {
+ var t = e.originalEvent.targetTouches[0];
+ return self._handleDragStart( e, t.pageX, t.pageY );
+ };
- if ( this.type === 'ticker' ) {
- this.btn.unbind("vmouseup");
+ self._dragMoveEvt = "touchmove";
+ self._dragMoveCB = function ( e ) {
+ var t = e.originalEvent.targetTouches[0];
+ return self._handleDragMove( e, t.pageX, t.pageY );
+ };
+
+ self._dragStopEvt = "touchend";
+ self._dragStopCB = function ( e ) {
+ return self._handleDragStop( e );
+ };
}
- container.unbind('vmouseup');
- clearInterval( this.interval );
- },
+ self._$view.bind( self._dragStartEvt, self._dragStartCB );
- _set_position: function () {
- var container = this._get_container(),
- $footer = $('.ui-page-active').children('.ui-footer'),
- footer_h = $footer.outerHeight() || 0;
+ // other events.
+ self._$view.delegate( ".virtualgrid-item", "click", function ( event ) {
+ var $selectedItem = $( this );
+ $selectedItem.trigger( "select", this );
+ } );
- container.css( 'bottom', footer_h);
+ $( window ).bind( "resize", function ( e ) {
+ var height = 0,
+ $virtualgrid = $( ".ui-virtualgrid-view" );
+ if ( $virtualgrid.length !== 0 ) {
+ if ( self._direction ) {
+ height = self._calculateClipHeight();
+ self._$view.height( height );
+ self._$clip.height( height );
+ } else {
+ height = self._calculateClipWidth();
+ self._$view.width( height );
+ self._$clip.width( height );
+ }
+ self.resize();
+ }
+ } );
+
+ $( document ).one( "pageshow", function ( event ) {
+ var $page = $( self.element ).parents( ".ui-page" ),
+ $header = $page.find( ":jqmData(role='header')" ),
+ $footer = $page.find( ":jqmData(role='footer')" ),
+ $content = $page.find( ":jqmData(role='content')" ),
+ footerHeight = $footer ? $footer.height() : 0,
+ headerHeight = $header ? $header.height() : 0;
+
+ if ( $page && $content ) {
+ $content.height( window.innerHeight - headerHeight - footerHeight ).css( "overflow", "hidden" );
+ $content.addClass( "ui-virtualgrid-content" );
+ }
+ } );
},
- _create: function () {
+ //----------------------------------------------------//
+ // Calculate size about dom element. //
+ //----------------------------------------------------//
+ _calculateClipSize : function () {
var self = this,
- elem = $( this.element ),
- i;
+ clipSize = 0;
- this.btn = $('<div data-role="button" data-inline="true">Close</div>');
+ if ( self._direction ) {
+ clipSize = self._calculateClipWidth();
+ } else {
+ clipSize = self._calculateClipHeight();
+ }
+ return clipSize;
+ },
- this.seconds = elem.jqmData('interval');
- this.type = elem.jqmData('type') || 'popup';
+ _calculateClipWidth : function () {
+ var self = this,
+ $parent = self._$clip.parent(),
+ paddingValue = 0,
+ clipSize = $( window ).width();
- if ( this.type === 'ticker' ) {
- elem.wrapInner("<div class='ui-ticker'></div>");
- elem.find(".ui-ticker").append("<div class='ui-ticker-body'></div>" +
- "<div class='ui-ticker-btn'></div>");
- this.text_bg = elem.find("p");
+ if ( self._inheritedSize.isDefinedWidth ) {
+ return self._inheritedSize.width;
+ }
- if ( this.text_bg.length < 2 ) {
- elem.find(".ui-ticker").append("<p></p><p></p>");
- this.text_bg = elem.find("p");
- } else if ( this.text_bg.length > 2 ) {
- for ( i = 2; i < this.text_bg.length; i++ ) {
- $( this.text_bg[i] ).css( "display", "none" );
- }
- }
+ if ( $parent.hasClass( "ui-content" ) ) {
+ paddingValue = parseInt( $parent.css( "padding-left" ), 10 );
+ clipSize = clipSize - ( paddingValue || 0 );
+ paddingValue = parseInt( $parent.css( "padding-right" ), 10 );
+ clipSize = clipSize - ( paddingValue || 0 );
+ } else {
+ clipSize = self._$clip.width();
+ }
+ return clipSize;
+ },
- $( this.text_bg[0] ).addClass("ui-ticker-text1-bg");
- $( this.text_bg[1] ).addClass("ui-ticker-text2-bg");
+ _calculateClipHeight : function () {
+ var self = this,
+ $parent = self._$clip.parent(),
+ header = null,
+ footer = null,
+ paddingValue = 0,
+ clipSize = $( window ).height();
- this.icon_img = elem.find("img");
+ if ( self._inheritedSize.isDefinedHeight ) {
+ return self._inheritedSize.height;
+ }
- if ( this.icon_img.length ) {
- $( this.icon_img ).addClass("ui-ticker-icon");
+ if ( $parent.hasClass( "ui-content" ) ) {
+ paddingValue = parseInt( $parent.css( "padding-top" ), 10 );
+ clipSize = clipSize - ( paddingValue || 0 );
+ paddingValue = parseInt( $parent.css( "padding-bottom" ), 10 );
+ clipSize = clipSize - ( paddingValue || 0 );
+ header = $parent.siblings( ".ui-header" );
+ footer = $parent.siblings( ".ui-footer" );
- for ( i = 1; i < this.icon_img.length; i++ ) {
- $( this.icon_img[i] ).css( "display", "none" );
+ if ( header ) {
+ if ( header.outerHeight( true ) === null ) {
+ clipSize = clipSize - ( $( ".ui-header" ).outerHeight() || 0 );
+ } else {
+ clipSize = clipSize - header.outerHeight( true );
}
}
+ if ( footer ) {
+ clipSize = clipSize - footer.outerHeight( true );
+ }
} else {
- elem.wrapInner("<div class='ui-smallpopup'></div>");
- this.text_bg = elem.find("p").addClass("ui-smallpopup-text-bg");
+ clipSize = self._$clip.height();
+ }
+ return clipSize;
+ },
- if ( this.text_bg.length < 1 ) {
- elem.find(".ui-smallpopup")
- .append("<p class='ui-smallpopup-text-bg'></p>");
- this.text_bg = elem.find("p");
- } else if ( this.text_bg.length > 1 ) {
- for ( i = 1; i < this.text_bg.length; i++ ) {
- $( this.text_bg[i] ).css( "display", "none" );
- }
- }
+ _calculateColumnSize : function () {
+ var self = this,
+ $tempBlock,
+ $cell;
- this._set_position();
+ $tempBlock = $( self._makeRows( 1 ) );
+ self._$view.append( $tempBlock.children().first() );
+ if ( self._direction ) {
+ // x-axis
+ self._viewSize = self._$view.width();
+ $cell = self._$view.children().first().children().first();
+ self._cellSize = $cell.outerWidth( true );
+ self._cellOtherSize = $cell.outerHeight( true );
+ } else {
+ // y-axis
+ self._viewSize = self._$view.height();
+ $cell = self._$view.children().first().children().first();
+ self._cellSize = $cell.outerHeight( true );
+ self._cellOtherSize = $cell.outerWidth( true );
}
+ $tempBlock.remove();
+ self._$view.children().remove();
+ },
- this._add_event();
+ _calculateColumnCount : function ( ) {
+ var self = this,
+ $view = self._$clip,
+ viewSize = self._direction ? $view.innerHeight() : $view.innerWidth(),
+ itemCount = 0 ;
- $( window ).bind( "resize", function () {
- if ( !self.running ) {
- return;
- }
+ if ( self._direction ) {
+ viewSize = viewSize - ( parseInt( $view.css( "padding-top" ), 10 ) + parseInt( $view.css( "padding-bottom" ), 10 ) );
+ } else {
+ viewSize = viewSize - ( parseInt( $view.css( "padding-left" ), 10 ) + parseInt( $view.css( "padding-right" ), 10 ) );
+ }
- self._refresh();
+ itemCount = parseInt( ( viewSize / self._cellOtherSize ), 10 );
+ return itemCount > 0 ? itemCount : 1 ;
+ },
- if ( self.type === 'popup' ) {
- self._set_position();
- }
- });
- }
- }); // End of widget
+ // Read the position of clip form property ('webkit-transform').
+ // @return : number - position of clip.
+ _getClipPosition : function () {
+ var self = this,
+ matrix = null,
+ contents = null,
+ result = -self._cellSize,
+ $scrollview = self._$view.closest( ".ui-scrollview-view" );
- // auto self-init widgets
- $( document ).bind( "pagecreate create", function ( e ) {
- $( e.target ).find(":jqmData(role='notification')").notification();
- });
-
- $( document ).bind( "pagebeforehide", function ( e ) {
- $( e.target ).find(":jqmData(role='notification')").notification('destroy');
- });
-}( jQuery, this ));
-/* ***************************************************************************
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- * ***************************************************************************
- *
- * Author: Jinhyuk Jun <jinhyuk.jun@samsung.com>
- */
-
-(function ( $, undefined ) {
+ if ( $scrollview ) {
+ matrix = $scrollview.css( "-webkit-transform" );
+ contents = matrix.substr( 7 );
+ contents = contents.substr( 0, contents.length - 1 );
+ contents = contents.split( ', ' );
+ result = Math.abs( contents [5] );
+ }
+ return result;
+ },
- $.widget( "mobile.pagelayout", $.mobile.widget, {
- options: {
- visibleOnPageShow: true,
- disablePageZoom: true,
- transition: "slide", //can be none, fade, slide (slide maps to slideup or slidedown)
- fullscreen: false,
- tapToggle: true,
- tapToggleBlacklist: "a, input, select, textarea, .ui-header-fixed, .ui-footer-fixed",
- hideDuringFocus: "input, textarea, select",
- updatePagePadding: true,
- trackPersistentToolbars: true,
- // Browser detection! Weeee, here we go...
- // Unfortunately, position:fixed is costly, not to mention probably impossible, to feature-detect accurately.
- // Some tests exist, but they currently return false results in critical devices and browsers, which could lead to a broken experience.
- // Testing fixed positioning is also pretty obtrusive to page load, requiring injected elements and scrolling the window
- // The following function serves to rule out some popular browsers with known fixed-positioning issues
- // This is a plugin option like any other, so feel free to improve or overwrite it
- supportBlacklist: function () {
- var w = window,
- ua = navigator.userAgent,
- platform = navigator.platform,
- // Rendering engine is Webkit, and capture major version
- wkmatch = ua.match( /AppleWebKit\/([0-9]+)/ ),
- wkversion = !!wkmatch && wkmatch[ 1 ],
- ffmatch = ua.match( /Fennec\/([0-9]+)/ ),
- ffversion = !!ffmatch && ffmatch[ 1 ],
- operammobilematch = ua.match( /Opera Mobi\/([0-9]+)/ ),
- omversion = !!operammobilematch && operammobilematch[ 1 ];
+ //----------------------------------------------------//
+ // DOM Element handle //
+ //----------------------------------------------------//
+ _makeRows : function ( count ) {
+ var self = this,
+ index = 0,
+ row = null,
+ wrapper = null;
- if (
- // iOS 4.3 and older : Platform is iPhone/Pad/Touch and Webkit version is less than 534 (ios5)
- ( ( platform.indexOf( "iPhone" ) > -1 || platform.indexOf( "iPad" ) > -1 || platform.indexOf( "iPod" ) > -1 ) && wkversion && wkversion < 534 ) ||
- // Opera Mini
- ( w.operamini && ({}).toString.call( w.operamini ) === "[object OperaMini]" ) ||
- ( operammobilematch && omversion < 7458 ) ||
- //Android lte 2.1: Platform is Android and Webkit version is less than 533 (Android 2.2)
- ( ua.indexOf( "Android" ) > -1 && wkversion && wkversion < 533 ) ||
- // Firefox Mobile before 6.0 -
- ( ffversion && ffversion < 6 ) ||
- // WebOS less than 3
- ( window.palmGetResource !== undefined && wkversion && wkversion < 534 ) ||
- // MeeGo
- ( ua.indexOf( "MeeGo" ) > -1 && ua.indexOf( "NokiaBrowser/8.5.0" ) > -1 )
- ) {
- return true;
+ wrapper = self._createElement( "div" );
+ wrapper.setAttribute( "class", "ui-scrollview-view" );
+ for ( index = 0; index < count ; index += 1 ) {
+ row = self._makeRow( index );
+ if ( self._direction ) {
+ row.style.top = 0;
+ row.style.left = index * self._cellSize;
}
-
- return false;
- },
- initSelector: ":jqmData(role='content')"
+ wrapper.appendChild( row );
+ }
+ return wrapper;
},
- _create: function () {
-
+ // make a single row block
+ _makeRow : function ( rowIndex ) {
var self = this,
- o = self.options,
- $el = self.element;
+ index = rowIndex * self._itemCount,
+ colIndex = 0,
+ blockClassName = self._direction ? "ui-virtualgrid-wrapblock-x" : "ui-virtualgrid-wrapblock-y",
+ wrapBlock = self._createElement( "div" ),
+ strWrapInner = "",
+ attrName = self._direction ? "top" : "left";
- // Feature detecting support for
- if ( o.supportBlacklist() ) {
- self.destroy();
- return;
+ for ( colIndex = 0; colIndex < self._itemCount; colIndex++ ) {
+ strWrapInner += self._makeHtmlData( index, colIndex, attrName );
+ index += 1;
}
+ wrapBlock.innerHTML = strWrapInner;
+ wrapBlock.setAttribute( "class", blockClassName );
+ wrapBlock.setAttribute( "row-index", String( rowIndex ) );
+ self._fragment.appendChild( wrapBlock );
+ return wrapBlock;
+ },
- self._addFixedClass();
- self._addTransitionClass();
- self._bindPageEvents();
+ _makeHtmlData : function ( dataIndex, colIndex, attrName ) {
+ var self = this,
+ htmlStr = "",
+ itemData = null;
- // only content
- self._bindContentControlEvents();
+ itemData = self._itemData( dataIndex );
+ if ( itemData ) {
+ htmlStr = self._getConvertedTmplStr( itemData );
+ htmlStr = self._insertPosToTmplStr( htmlStr, attrName, ( colIndex * self._cellOtherSize ) );
+ }
+ return htmlStr;
},
- /* add minimum fixed css style to bar(header/footer) and content
- * it need to update when core source modified(jquery.mobile.page.section.js)
- * modified from core source cuz initSelector different */
- _addFixedClass: function () {
- var self = this,
- o = self.options,
- $el = self.element,
- $elHeader = $el.siblings( ":jqmData(role='header')" ),
- $elFooter = $el.siblings( ":jqmData(role='footer')" ),
- $elPage = $el.closest(".ui-page");
+ _insertPosToTmplStr : function ( tmplStr, attrName, posVal ) {
+ var tagCloseIdx = tmplStr.indexOf( '>' ),
+ classIdx = -1,
+ firstPart,
+ lastPart,
+ result,
+ found = false,
+ targetIdx = 0,
+ firstPartLen,
+ i = 0;
- $elHeader.addClass( "ui-header-fixed" );
- $elFooter.addClass( "ui-footer-fixed" );
+ if ( tagCloseIdx === -1 ) {
+ return;
+ }
- // "fullscreen" overlay positioning
- if ( o.fullscreen ) {
- $elHeader.addClass( "ui-header-fullscreen" );
- $elFooter.addClass( "ui-footer-fullscreen" );
- $elPage
- .addClass( "ui-page-header-fullscreen" )
- .addClass( "ui-page-footer-fullscreen" );
+ firstPart = tmplStr.slice( 0, tagCloseIdx );
+ lastPart = tmplStr.slice( tagCloseIdx, tmplStr.length );
+
+ classIdx = firstPart.indexOf( 'class' );
+
+ if ( classIdx !== -1 ) {
+ firstPartLen = firstPart.length;
+ for ( i = classIdx + 6; i < firstPartLen; i++ ) {
+ if ( firstPart.charAt( i ) === "\"" || firstPart.charAt( i ) === "\'" ) {
+ if ( found === false ) {
+ found = true;
+ } else {
+ targetIdx = i;
+ break;
+ }
+ }
+ }
+ result = firstPart.slice( 0, targetIdx ) + " virtualgrid-item" + firstPart.slice( targetIdx, firstPartLen ) + lastPart;
} else {
- // If not fullscreen, add class to page to set top or bottom padding
- $elPage.addClass( "ui-page-header-fixed" )
- .addClass( "ui-page-footer-fixed" );
+ result = firstPart + " class=\"virtualgrid-item\"" + lastPart;
}
+
+ if ( !isNaN( posVal ) ) {
+ result = result.replace( '>', " style=\"" + attrName + ": " + String( posVal ) + "px\">");
+ }
+
+ return result;
},
- /* original core source(jquery.mobile.fixedToolbar.js)
- * never changed */
- _addTransitionClass: function () {
- var tclass = this.options.transition;
+ _increaseRow : function ( num ) {
+ var self = this,
+ rotation = self.options.rotation,
+ $row = null,
+ headItemIndex = 0,
+ tailItemIndex = 0,
+ itemIndex = 0,
+ size = self._scalableSize,
+ idx = 0;
- if ( tclass && tclass !== "none" ) {
- // use appropriate slide for header or footer
- if ( tclass === "slide" ) {
- tclass = this.element.is( ".ui-header" ) ? "slidedown" : "slideup";
+ headItemIndex = parseInt( $( self._$view.children().first() ).attr( "row-index" ), 10 ) - 1;
+ tailItemIndex = parseInt( $( self._$view.children()[self._rowsPerView] ).attr( "row-index" ), 10 ) + 1;
+
+ for ( idx = 1 ; idx <= num ; idx++ ) {
+ if ( tailItemIndex + idx >= self._totalRowCnt ) {
+ $row = $( self._makeRow( headItemIndex ) );
+ self._$view.prepend( $row );
+ headItemIndex -= 1;
+ } else {
+ $row = $( self._makeRow( tailItemIndex + idx ) );
+ self._$view.append( $row );
}
+ if ( self._direction ) {
+ $row.width( self._cellSize );
+ } else {
+ $row.height( self._cellSize );
+ }
+ }
+ },
- this.element.addClass( tclass );
+ _decreaseRow : function ( num ) {
+ var self = this,
+ idx = 0;
+
+ for ( idx = 0 ; idx < num ; idx++ ) {
+ self._$view.children().last().remove();
}
},
+ _replaceRows : function ( curCnt, prevCnt, maxCnt, clipPosition ) {
+ var self = this,
+ $rows = self._$view.children(),
+ prevRowIndex = 0,
+ rowIndex = 0,
+ diffRowCnt = 0,
+ targetCnt = 1,
+ filterCondition = ( self._filterRatio * self._cellSize ) + self._cellSize,
+ idx = 0;
- /* Set default page positon
- * 1. add title style to header
- * 2. Set default header/footer position */
- setHeaderFooter: function ( thisPage ) {
- var $elPage = $( thisPage ),
- $elHeader = $elPage.find( ":jqmData(role='header')" ).length ? $elPage.find( ":jqmData(role='header')") : $elPage.siblings( ":jqmData(role='header')"),
- $elContent = $elPage.find( ".ui-content" ),
- $elFooter = $elPage.find( ":jqmData(role='footer')" ),
- $elFooterGroup = $elFooter.find( ":jqmData(role='fieldcontain')" );
+ if ( filterCondition < clipPosition ) {
+ targetCnt += 1;
+ }
- // divide content mode scrollview and non-scrollview
- if ( !$elPage.is( ".ui-dialog" ) ) {
- if ( $elHeader.jqmData("position") == "fixed" || ( $.support.scrollview && $.tizen.frameworkData.theme.match(/tizen/) ) ) {
- $elHeader
- .css( "position", "fixed" )
- .css( "top", "0px" );
- } else if ( !$.support.scrollview && $elHeader.jqmData("position") != "fixed" ) {
- $elHeader.css( "position", "relative" );
+ prevRowIndex = parseInt( $( $rows[targetCnt] ).attr( "row-index" ), 10 );
+ if ( prevRowIndex === 0 ) {
+ // only top.
+ rowIndex = maxCnt - targetCnt;
+ } else {
+ rowIndex = Math.round( ( prevRowIndex * prevCnt ) / curCnt );
+ if ( rowIndex + self._rowsPerView >= maxCnt ) {
+ // only bottom.
+ rowIndex = maxCnt - self._rowsPerView;
}
+ diffRowCnt = prevRowIndex - rowIndex;
+ rowIndex -= targetCnt;
}
- /* set Title style */
- if ( $elHeader.find("span.ui-title-text-sub").length ) {
- $elHeader.addClass( "ui-title-multiline");
+ for ( idx = 0 ; idx < $rows.length ; idx += 1 ) {
+ self._replaceRow( $rows[idx], circularNum( rowIndex, self._totalRowCnt ) );
+ rowIndex++;
}
+ return -diffRowCnt;
+ },
- if ( $elFooterGroup.find( "div" ).is( ".ui-controlgroup-label" ) ) {
- $elFooterGroup.find( "div.ui-controlgroup-label" ).remove();
+ _replaceRow : function ( block, index ) {
+ var self = this,
+ tempBlocks = null;
+
+ while ( block.hasChildNodes() ) {
+ block.removeChild( block.lastChild );
+ }
+
+ tempBlocks = self._makeRow( index );
+ while ( tempBlocks.children.length ) {
+ block.appendChild( tempBlocks.children[0] );
}
+ tempBlocks.parentNode.removeChild( tempBlocks );
},
- _bindPageEvents: function () {
- var self = this,
- o = self.options,
- $el = self.element,
- $elCurrentFooter;
+ _createElement : function ( tag ) {
+ var element = document.createElement( tag );
- //page event bindings
- // Fixed toolbars require page zoom to be disabled, otherwise usability issues crop up
- // This method is meant to disable zoom while a fixed-positioned toolbar page is visible
- $el.closest( ".ui-page" )
- .bind( "pagebeforeshow", function ( event ) {
- var thisPage = this;
- if ( o.disablePageZoom ) {
- $.mobile.zoom.disable( true );
- }
- if ( !o.visibleOnPageShow ) {
- self.hide( true );
- }
- self.setHeaderFooter( thisPage );
- self._setContentMinHeight( thisPage );
- } )
- .bind( "webkitAnimationStart animationstart updatelayout", function ( e, data ) {
- var thisPage = this;
- if ( o.updatePagePadding ) {
- self.updatePagePadding(thisPage);
- self.updatePageLayout( false, thisPage);
- }
- })
-
- .bind( "pageshow", function ( event ) {
- var thisPage = this;
- self._setContentMinHeight( thisPage );
- self.updatePagePadding( thisPage );
- self._updateHeaderArea( thisPage );
- if ( o.updatePagePadding ) {
- $( window ).bind( "throttledresize." + self.widgetName, function () {
- self.updatePagePadding(thisPage);
-
- self.updatePageLayout( false, thisPage);
- self._updateHeaderArea( thisPage );
- self._setContentMinHeight( thisPage );
- });
- }
- })
-
- .bind( "pagebeforehide", function ( e, ui ) {
- if ( o.disablePageZoom ) {
- $.mobile.zoom.enable( true );
- }
- if ( o.updatePagePadding ) {
- $( window ).unbind( "throttledresize." + self.widgetName );
- }
-
- if ( o.trackPersistentToolbars ) {
- var thisFooter = $( ".ui-footer-fixed:jqmData(id)", this ),
- thisHeader = $( ".ui-header-fixed:jqmData(id)", this ),
- nextFooter = thisFooter.length && ui.nextPage && $( ".ui-footer-fixed:jqmData(id='" + thisFooter.jqmData( "id" ) + "')", ui.nextPage ),
- nextHeader = thisHeader.length && ui.nextPage && $( ".ui-header-fixed:jqmData(id='" + thisHeader.jqmData( "id" ) + "')", ui.nextPage );
-
- nextFooter = nextFooter || $();
-
- if ( nextFooter.length || nextHeader.length ) {
-
- nextFooter.add( nextHeader ).appendTo( $.mobile.pageContainer );
-
- ui.nextPage.one( "pageshow", function () {
- nextFooter.add( nextHeader ).appendTo( this );
- });
- }
- }
- });
-
- window.addEventListener( "softkeyboardchange", function ( e ) {
- var thisPage = this;
-
- if ( e.state == "on" ) {
- $elCurrentFooter = $( ".ui-page-active .ui-footer" );
- $elCurrentFooter.hide();
- } else if (e.state == "off") {
- $elCurrentFooter.show();
- }
- self.updatePagePadding( thisPage );
- self.updatePageLayout( true, thisPage );
- });
- },
-
- _bindContentControlEvents: function () {
- var self = this,
- o = self.options,
- $el = self.element;
-
- $el.closest( ".ui-page" )
- .bind( "pagebeforeshow", function ( event ) {
-
- });
- },
-
- _setContentMinHeight : function ( thisPage ) {
- var $elPage = $( thisPage ),
- $elHeader = $elPage.find( ":jqmData(role='header')" ),
- $elFooter = $elPage.find( ":jqmData(role='footer')" ),
- $elContent = $elPage.find( ":jqmData(role='content')" ),
- resultMinHeight;
-
- resultMinHeight = window.innerHeight - $elHeader.height() - $elFooter.height();
-
- $elContent.css( "min-height", resultMinHeight - parseFloat( $elContent.css("padding-top") ) - parseFloat( $elContent.css("padding-bottom") ) + "px" );
+ this._fragment.appendChild( element );
+ return element;
},
- _updateHeaderArea : function ( thisPage ) {
- var $elPage = $( thisPage ),
- $elHeader = $elPage.find( ":jqmData(role='header')" ).length ? $elPage.find( ":jqmData(role='header')") : $elPage.siblings( ":jqmData(role='header')"),
- headerBtnNum = $elHeader.children("a").length,
- headerSrcNum = $elHeader.children("img").length;
+ _getObjectNames : function ( obj ) {
+ var properties = [],
+ name = "";
- if ( !$elPage.is( ".ui-dialog" ) ) {
- $elHeader.find( "h1" ).css( "width", window.innerWidth - $elHeader.children( "a" ).width() * headerBtnNum - $elHeader.children( "a" ).width() / 4 - $elHeader.children( "img" ).width() * headerSrcNum * 4 );
+ for ( name in obj ) {
+ properties.push( name );
}
- /* add half width for default space between text and button, and img tag area is too narrow, so multiply three for img width*/
+ this._properties = properties;
},
- _visible: true,
-
- // This will set the content element's top or bottom padding equal to the toolbar's height
- updatePagePadding: function ( tbPage ) {
- var $el = this.element,
- header = $el.siblings( ".ui-header" ).length,
- footer = $el.siblings( ".ui-footer" ).length;
+ _getConvertedTmplStr : function ( data ) {
+ var self = this,
+ dataProperties = self._properties,
+ i = 0,
+ plainMsg,
+ ret = "";
- // This behavior only applies to "fixed", not "fullscreen"
- if ( this.options.fullscreen ) {
- return;
+ if ( !data ) {
+ return ;
}
- tbPage = tbPage || $el.closest( ".ui-page" );
-
- if ( $el.siblings( ".ui-header" ).jqmData("position") == "fixed" || $.support.scrollview ) {
- $( tbPage ).css( "padding-top", ( header ? $el.siblings( ".ui-header" ).outerHeight() : 0 ) );
+ plainMsg = self._templateText;
+ for ( i = 0; i < dataProperties.length; i++ ) {
+ plainMsg = self._strReplace( plainMsg, "${" + dataProperties[ i ] + "}" , data[ dataProperties[ i ] ] );
}
- $( tbPage ).css( "padding-bottom", ( footer ? $el.siblings( ".ui-footer" ).outerHeight() : 0 ) );
- },
+ plainMsg = self._changeImgSrcAriaAttrFromTmpl( plainMsg );
- /* 1. Calculate and update content height */
- updatePageLayout: function ( receiveType, thisPage ) {
- var $elFooter,
- $elPage = $( thisPage ),
- $elHeader = $elPage.find( ":jqmData(role='header')" ),
- $elContent = $elPage.find( ":jqmData(role='content')" ),
- resultContentHeight = 0,
- resultFooterHeight = 0,
- resultHeaderHeight = 0;
+ return plainMsg;
+ },
- if ( $elPage.length ) {
- $elFooter = $elPage.find( ":jqmData(role='footer')" );
- } else {
- $elFooter = $( document ).find( ":jqmData(role='footer')" ).eq( 0 );
+ _changeImgSrcAriaAttrFromTmpl : function ( plainMsg ) {
+ var self = this,
+ ret = "",
+ targetTagIdx,
+ beforeTargetTag = "",
+ afterTargetTag = "",
+ imgFileName,
+ imgSrcSlashIdx,
+ temp,
+ srcRegExpResult;
+
+ temp = plainMsg;
+ targetTagIdx = temp.indexOf( "$ARIA-IMG-SRC-ALT$" );
+ while ( targetTagIdx !== -1 ) {
+ imgFileName = "";
+ beforeTargetTag = beforeTargetTag + temp.slice( 0, targetTagIdx + 19 );
+ afterTargetTag = temp.slice( targetTagIdx + 19, temp.length );
+ srcRegExpResult = afterTargetTag.match( imgTagSrcAttrRE );
+ if ( srcRegExpResult ) {
+ imgSrcSlashIdx = srcRegExpResult[0].lastIndexOf( "/" );
+ if ( imgSrcSlashIdx !== -1 ) {
+ imgFileName = srcRegExpResult[0].slice( imgSrcSlashIdx + 1, -1 );
+ }
+ }
+ beforeTargetTag = beforeTargetTag.replace( "$ARIA-IMG-SRC-ALT$", imgFileName );
+ temp = afterTargetTag;
+ targetTagIdx = temp.indexOf( "$ARIA-IMG-SRC-ALT$" );
+ ret = beforeTargetTag + afterTargetTag;
}
- // calculate footer height
- resultFooterHeight = ( $elFooter.css( "display" ) == "none" ) ? 0 : $elFooter.height();
- resultHeaderHeight = ( $elHeader.css( "display" ) == "none" ) ? 0 : $elHeader.height();
-
- if (resultFooterHeight != 0 ) {
- $elFooter.css( "bottom", 0 );
+ if ( ret === "" ) {
+ ret = plainMsg;
}
- resultContentHeight = window.innerHeight - resultFooterHeight - resultHeaderHeight;
+ return ret;
+ },
- if ( $.support.scrollview ) {
- $elContent.height( resultContentHeight -
- parseFloat( $elContent.css("padding-top") ) -
- parseFloat( $elContent.css("padding-bottom") ) );
+ _insertAriaAttrToTmpl : function ( plainMsg ) {
+ var ret = "",
+ targetTagIdx,
+ beforeTargetTag = "",
+ afterTargetTag = "",
+ temp;
+
+ temp = plainMsg.replace( "<div", "<div tabindex=\"0\" aria-selected=\"true\"" );
+ targetTagIdx = temp.indexOf( "<img" );
+ if ( targetTagIdx !== -1 ) {
+ while ( targetTagIdx !== -1 ) {
+ beforeTargetTag = beforeTargetTag + temp.slice( 0, targetTagIdx + 4 );
+ afterTargetTag = temp.slice( targetTagIdx + 4, temp.length );
+ beforeTargetTag = beforeTargetTag + " role=\"img\" alt=\"$ARIA-IMG-SRC-ALT$\"";
+ temp = afterTargetTag;
+ targetTagIdx = temp.indexOf( "<img" );
+ ret = beforeTargetTag + afterTargetTag;
+ }
+ temp = ret;
+ targetTagIdx = temp.indexOf( "<span" );
+ beforeTargetTag = "";
+ while ( targetTagIdx !== -1 ) {
+ beforeTargetTag = beforeTargetTag + temp.slice( 0, targetTagIdx + 5 );
+ afterTargetTag = temp.slice( targetTagIdx + 5, temp.length );
+ beforeTargetTag = beforeTargetTag + " aria-hidden=\"true\" tabindex=\"-1\"";
+ temp = afterTargetTag;
+ targetTagIdx = temp.indexOf( "<span" );
+ ret = beforeTargetTag + afterTargetTag;
+ }
}
- // External call page( "refresh") - in case title changed
- if ( receiveType ) {
- $elPage
- .css( "min-height", resultContentHeight )
- .css( "padding-top", resultHeaderHeight )
- .css( "padding-bottom", resultFooterHeight );
+ if ( ret === "" ) {
+ ret = plainMsg;
}
- },
- show: function ( notransition ) {
- /* blank function: deprecated */
+ return ret;
},
- hide: function ( notransition ) {
- /* blank function: deprecated */
- },
+ _strReplace : function ( plainMsg, stringToFind, stringToReplace ) {
+ var temp = plainMsg,
+ index = plainMsg.indexOf( stringToFind );
+ while ( index !== -1 ) {
+ temp = temp.replace( stringToFind, stringToReplace );
+ index = temp.indexOf( stringToFind );
+ }
+ return temp;
+ }
- toggle: function () {
- this[ this._visible ? "hide" : "show" ]();
- },
+ } );
- destroy: function () {
- this.element.removeClass( "ui-header-fixed ui-footer-fixed ui-header-fullscreen ui-footer-fullscreen in out fade slidedown slideup ui-fixed-hidden" );
- this.element.closest( ".ui-page" ).removeClass( "ui-page-header-fixed ui-page-footer-fixed ui-page-header-fullscreen ui-page-footer-fullscreen" );
- }
- });
+ $( document ).bind( "pagecreate create", function ( e ) {
+ $( ":jqmData(role='virtualgrid')" ).virtualgrid();
+ } );
+} ( jQuery, window, document ) );
- //auto self-init widgets
- $( document )
- .bind( "pagecreate create", function ( e ) {
- // DEPRECATED in 1.1: support for data-fullscreen=true|false on the page element.
- // This line ensures it still works, but we recommend moving the attribute to the toolbars themselves.
- if ( $( e.target ).jqmData( "fullscreen" ) ) {
- $( $.mobile.pagelayout.prototype.options.initSelector, e.target ).not( ":jqmData(fullscreen)" ).jqmData( "fullscreen", true );
- }
- $.mobile.pagelayout.prototype.enhanceWithin( e.target );
- });
-}( jQuery ));
-/*
- * jQuery Mobile Widget @VERSION
- *
- * This software is licensed under the MIT licence (as defined by the OSI at
- * http://www.opensource.org/licenses/mit-license.php)
- *
- * ***************************************************************************
+
+/* ***************************************************************************
* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
- * Copyright (c) 2011 by Intel Corporation Ltd.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* DEALINGS IN THE SOFTWARE.
* ***************************************************************************
*
- * Authors: Gabriel Schulhof <gabriel.schulhof@intel.com>,
- * Elliot Smith <elliot.smith@intel.com>
- * Hyunjung Kim <hjnim.kim@samsung.com>
+ * Author: Wongi Lee <wongi11.lee@samsung.com>
+ * Youmin Ha <youmin.ha@samsung.com>
*/
-/*
- * % Popupwindow widget do not use anymore(will be deprecated, internal use only)
- *
+/**
+ * Virtual List Widget for unlimited data.
+ * To support more then 1,000 items, special list widget developed.
+ * Fast initialize and light DOM tree.
+ * DB connection and works like DB cursor.
+ *
+ * HTML Attributes:
*
- * Shows other elements inside a popup window.
+ * data-role: virtuallistview
+ * data-template : jQuery.template ID that populate into virtual list
+ * data-row : Optional. Set number of <li> elements that are used for data handling.
+ *
+ * ID : <UL> element that has "data-role=virtuallist" must have ID attribute.
*
- * To apply, add the attribute data-role="popupwindow" to a <div> element inside
- * a page. Alternatively, call popupwindow()
- * on an element, eg :
+ * * APIs:
*
- * $("#mypopupwindowContent").popupwindow();
- * where the html might be :
- * <div id="mypopupwindowContent"></div>
+ * create ( {
+ * itemData: function ( idx ) { return json_obj; },
+ * numItemData: number or function () { return number; },
+ * cacheItemData: function ( minIdx, maxIdx ) {}
+ * } )
+ * : Create a virtuallist widget. At this moment, _create method is called.
+ * args : A collection of options
+ * itemData: A function that returns JSON object for given index. Mandatory.
+ * numItemData: Total number of itemData. Mandatory.
+ * cacheItemData: Virtuallist will ask itemData between minIdx and maxIdx.
+ * Developers can implement this function for preparing data.
+ * Optional.
*
- * To trigger the popupwindow to appear, it is necessary to make a call to its
- * 'open()' method. This is typically done by binding a function to an event
- * emitted by an input element, such as a the clicked event emitted by a button
- * element. The open() method takes two arguments, specifying the x and y
- * screen coordinates of the center of the popup window.
-
- * You can associate a button with a popup window like this:
- * <div id="mypopupContent" style="display: table;" data-role="popupwindow">
- * <table>
- * <tr> <td>Eenie</td> <td>Meenie</td> <td>Mynie</td> <td>Mo</td> </tr>
- * <tr> <td>Catch-a</td> <td>Tiger</td> <td>By-the</td> <td>Toe</td> </tr>
- * <tr> <td>If-he</td> <td>Hollers</td> <td>Let-him</td> <td>Go</td> </tr>
- * <tr> <td>Eenie</td> <td>Meenie</td> <td>Mynie</td> <td>Mo</td> </tr>
- * </table>
- * </div>
- * <a href="#myPopupContent" data-rel="popupwindow" data-role="button">Show popup</a>
+ * Events:
*
- * Options:
+ * touchstart : Temporary preventDefault applied on touchstart event to avoid broken screen.
*
- * theme: String; the theme for the popupwindow contents
- * Default: null
+ * Examples:
*
- * overlayTheme: String; the theme for the popupwindow
- * Default: null
+ * <script id="tmp-3-2-7" type="text/x-jquery-tmpl">
+ * <li class="ui-li-3-2-7">
+ * <span class="ui-li-text-main">${NAME}</span>
+ * <img src="00_winset_icon_favorite_on.png" class="ui-li-icon-sub">
+ * <span class="ui-li-text-sub">${ACTIVE}</span>
+ * <span class="ui-li-text-sub2">${FROM}</span>
+ * </li>
+ * </script>
*
- * shadow: Boolean; display a shadow around the popupwindow
- * Default: true
+ * <ul id="virtuallist-normal_3_2_7_ul" data-role="virtuallistview" data-template="tmp-3-2-7" data-dbtable="JSON_DATA" data-row="100">
+ * </ul>
*
- * corners: Boolean; display a shadow around the popupwindow
- * Default: true
- *
- * fade: Boolean; fades the opening and closing of the popupwindow
- *
- * transition: String; the transition to use when opening or closing
- * a popupwindow
- * Default: $.mobile.defaultDialogTransition
- *
- * Events:
- * popupbeforeposition: triggered after a popup has completed preparations for opening, but has not yet opened
- * popupafteropen: triggered after a popup has completely opened
- * popupafterclose triggered when a popup has completely closed
-*/
+ */
/**
- class Popupwindow
- The pop-up widget shows a list of items in a pop-up window in the middle of the screen. It automatically optimizes the pop-up window size within the screen.
- To add a pop-up widget to the application, use the following code:
+ @class VirtualList
+ In the Web environment, it is challenging to display a large amount of data in a list, such as displaying a contact list of over 1000 list items. It takes time to display the entire list in HTML and the DOM manipulation is complex.
- // Basic pop-up
- <div id="center_info" data-role="popup" data-style="center_info">
- <div data-role="text">
- <p>
- Pop-up dialog box, a child window that blocks user interaction in the parent window
- </p>
- </div>
- </div>
- // Pop-up with a title and button
- <div id="center_title_1btn" data-role="popup" data-style="center_title_1btn">
- <p data-role="title">
- Pop-up title
- </p>
- <p data-role="text">
- Pop-up dialog box
- </p>
- <div data-role="button-bg">
- <input type="button" value="Text Button" />
- </div>
- </div>
+ The virtual list widget is used to display a list of unlimited data elements on the screen for better performance. This widget provides easy access to databases to retrieve and display data. Virtual lists are based on the jQuery.template plugin as described in the jQuery documentation for jQuery.template plugin.
- The pop-up can define callbacks for events as described in the jQueryMobile documentation for pop-up events. <br/>You can use methods with the pop-up as described in the jQueryMobile documentation for pop-up methods.
+ To add a virtual list widget to the application, use the following code:
- @deprecated 2.0 verisons
+ <script id="tmp-3-2-7" type="text/x-jquery-tmpl">
+ <li class="ui-li-3-2-7">
+ <span class="ui-li-text-main">${NAME}</span>
+ <img src="00_winset_icon_favorite_on.png" class="ui-li-icon-sub"/>
+ <span class="ui-li-text-sub">${ACTIVE}</span>
+ <span class="ui-li-text-sub2">${FROM}</span>
+ </li>
+ </script>
+ <ul id="vlist" data-role="virtuallistview" data-template="tmp-3-2-7" data-dbtable="JSON_DATA" data-row="100"></ul>
*/
-
/**
- @property {String} data-style
- Defines the pop-up window style.
- The following styles are available:
-
- center_info: basic pop-up message
- center_title: pop-up message with a title
- center_basic_1btn: pop-up message with 1 button
- center_basic_2btn: pop-up message with 2 horizontal buttons
- center_title_1btn: pop-up message with a title and 1 button
- center_title_2btn: pop-up message with a title and 2 horizontal buttons
- center_title_3btn: pop-up message with a title and 3 horizontal buttons
- center_button_vertical: pop-up message with vertical buttons
- center_checkbox: pop-up message with a check box
- center_liststyle_1btn>: pop-up message with a list and 1 button
- center_liststyle_2btn: pop-up message with a list and 2 horizontal buttons
- center_liststyle_3btn: pop-up message with a list and 3 horizontal buttons
+ @property {String} data-role
+ Creates the virtual list view. The value must be set to virtuallistview.
+ Only the >ul< element, which a id attribute defined, supports this option. Also, the vlLoadSuccess class attribute must be defined in the >ul< element to ensure that loading data from the database is complete.
+*/
+/**
+ @property {String} data-template
+ Defines the jQuery.template element ID.
+ The jQuery.template must be defined. The template style can use rem units to support scalability.
+*/
+/**
+ @property {Number} data-row
+ Defines the number of virtual list child elements.
+ The minimum value is 20 and the default value is 100. As the value gets higher, the loading time increases while the system performance improves. So you need to pick a value that provides the best performance without excessive loading time.
+*/
+/**
+ @method create
+ @param {function} itemData(index)
+ : function itemData(index) returns the JSON object matched with the given index. The index value is between 0 and numItemData-1.
+ @param {Number} numItemData
+ : number numItemData or function numItemData() defines or returns a static number of items.
+ @param {function} cacheItemData(minIndex, maxIndex)
+ : function cacheItemData(minIndex, maxIndex) prepares the JSON data. This method is called before calling the itemData() method with index values between minIndex and maxIndex.
*/
(function ( $, undefined ) {
- $.widget( "tizen.popupwindow", $.tizen.widgetex, {
+
+ /* Code for Virtual List Demo */
+ var listCountPerPage = {}, /* Keeps track of the number of lists per page UID. This allows support for multiple nested list in the same page. https://github.com/jquery/jquery-mobile/issues/1617 */
+ _NO_SCROLL = 0, /* ENUM */
+ _SCROLL_DOWN = 1, /* ENUM */
+ _SCROLL_UP = -1; /* ENUM */
+
+ $.widget( "tizen.virtuallistview", $.mobile.widget, {
options: {
- theme: null,
- overlayTheme: "s",
- style: "custom",
- disabled: false,
- shadow: true,
- corners: true,
- fade: false,
- opacity: 0.7,
- widthRatio: 0.8612,
- transition: $.mobile.defaultDialogTransition,
- initSelector: ":jqmData(role='popupwindow')"
+ theme: "s",
+ countTheme: "s",
+ headerTheme: "s",
+ dividerTheme: "s",
+ splitIcon: "arrow-r",
+ splitTheme: "s",
+ inset: false,
+ id: "", /* Virtual list UL elemet's ID */
+ childSelector: " li", /* To support swipe list */
+ dbtable: "",
+ template : "",
+ dbkey: false, /* Data's unique Key */
+ scrollview: false,
+ row: 100,
+ page_buf: 30,
+ initSelector: ":jqmData(role='virtuallistview')"
},
- _htmlProto: {
-source:
+ _stylerMouseUp: function () {
+ $( this ).addClass( "ui-btn-up-s" );
+ $( this ).removeClass( "ui-btn-down-s" );
+ },
- [ "<div><div>" ,
- " <div id='popupwindow-screen' class='ui-selectmenu-screen ui-screen-hidden ui-popupwindow-screen'></div>" ,
- " <div id='popupwindow-container' class='ui-popupwindow ui-popupwindow-padding ui-selectmenu-hidden ui-overlay-shadow ui-corner-all'></div>" ,
- "</div>" ,
- "</div>" ].join("")
-, ui: {
- screen: "#popupwindow-screen",
- container: "#popupwindow-container"
- }
+ _stylerMouseDown: function () {
+ $( this ).addClass( "ui-btn-down-s" );
+ $( this ).removeClass( "ui-btn-up-s" );
},
- _setStyle: function () {
- var popup = this.element,
- style = popup.attr( 'data-style' );
+ _stylerMouseOver: function () {
+ $( this ).toggleClass( "ui-btn-hover-s" );
+ },
- if ( style ) {
- this.options.style = style;
+ _stylerMouseOut: function () {
+ $( this ).toggleClass( "ui-btn-hover-s" );
+ $( this ).addClass( "ui-btn-up-s" );
+ $( this ).removeClass( "ui-btn-down-s" );
+ },
+
+ // ?
+ // this virtuallistview object
+ // @param[in] template template name(string)
+ _pushData: function ( template ) {
+ var o = this.options,
+ i,
+ myTemplate = $( "#" + template ), // Get template object
+ // NOTE: o.row = # of rows handled at once. Default value is 100.
+ lastIndex = ( o.row > this._numItemData ? this._numItemData : o.row ), // last index of handled data
+ htmlData;
+
+ for ( i = 0; i < lastIndex; i++ ) {
+ htmlData = myTemplate.tmpl( this._itemData( i ) ); // Make rows with template,
+ $( o.id ).append( $( htmlData ).attr( 'id', o.itemIDPrefix + i ) ); // and append it to the vlist object
}
- popup.addClass( this.options.style );
- popup.find( ":jqmData(role='title')" )
- .wrapAll( "<div class='popup-title'></div>" );
- popup.find( ":jqmData(role='text')" )
- .wrapAll( "<div class='popup-text'></div>" );
- popup.find( ":jqmData(role='button-bg')" )
- .wrapAll( "<div class='popup-button-bg'></div>" );
- popup.find( ":jqmData(role='check-bg')" )
- .wrapAll( "<div class='popup-check-bg'></div>" );
- popup.find( ":jqmData(role='scroller-bg')" )
- .addClass( "popup-scroller-bg" );
- popup.find( ":jqmData(role='text-bottom-bg')" )
- .wrapAll( "<div class='popup-text-bottom-bg'></div>" );
- popup.find( ":jqmData(role='text-left')" )
- .wrapAll( "<div class='popup-text-left'></div>" );
- popup.find( ":jqmData(role='text-right')" )
- .wrapAll( "<div class='popup-text-right'></div>" );
- popup.find( ":jqmData(role='progress-bg')" )
- .wrapAll( "<div class='popup-progress-bg'></div>" );
+ // After pushing data re-style virtuallist widget
+ $( o.id ).trigger( "create" );
},
- _create: function () {
- console.warn("popupwindow() was deprecated. use popup() instead.");
- var thisPage = this.element.closest(":jqmData(role='page')"),
- self = this;
+ // Set children <li> elements' position
+ //
+ // this: virtuallist element
+ // event: virtuallistview.options
+ // TODO: Why this arg name is 'event'? Not resonable.
+ // (this function is not called with event element as args!)
+ _reposition: function ( event ) {
+ var o,
+ t = this,
+ padding,
+ margin;
- if ( thisPage.length === 0 ) {
- thisPage = $("body");
+ if ( event.data ) {
+ o = event.data;
+ } else {
+ o = event;
}
+ if ( $( o.id + o.childSelector ).size() > 0 ) { // $("#vlistid li")
+ // first child's top position
+ // NOTE: the first element may not be '0'!!!
+ t._title_h = $( o.id + o.childSelector + ':first' ).position().top;
+ // first child's outer height (TODO: reuse selected items)
+ t._line_h = $( o.id + o.childSelector + ':first' ).outerHeight();
- this._ui.placeholder =
- $( "<div><!-- placeholder for " + this.element.attr("id") + " --></div>" )
- .css("display", "none")
- .insertBefore( this.element );
+ // container(vlist element)'s innerwidth
+ t._container_w = $( o.id ).innerWidth();
- thisPage.append( this._ui.screen );
- this._ui.container.insertAfter( this._ui.screen );
- this._ui.container.append( this.element );
+ // get sum of container's left/right padding
+ padding = parseInt( $( o.id + o.childSelector ).css( "padding-left" ), 10 )
+ + parseInt( $( o.id + o.childSelector ).css( "padding-right" ), 10 );
- this._setStyle();
+ // Add CSS to all <li> elements
+ // * absolute position
+ // * btn-up
+ // * mouse up/down/over/out styles
+ $( o.id + ">" + o.childSelector )
+ .addClass( "position_absolute" )
+ .addClass( "ui-btn-up-s" )
+ .bind( "mouseup", t._stylerMouseUp )
+ .bind( "mousedown", t._stylerMouseDown )
+ .bind( "mouseover", t._stylerMouseOver )
+ .bind( "mouseout", t._stylerMouseOut );
+ }
- this._isOpen = false;
+ // Set absolute top/left position of each <li>
+ $( o.id + ">" + o.childSelector ).each( function ( index ) {
+ margin = parseInt( $( this ).css( "margin-left" ), 10 )
+ + parseInt( $( this ).css( "margin-right" ), 10 );
- this._ui.screen.bind( "vclick", function ( e ) {
- self.close();
- return false;
- } );
-
- this.element.bind( "vclick", function ( e ) {
- if ( $( e.target ).is("ui-btn-ctxpopup-close") ) {
- self.close();
- }
+ $( this ).css( "top", t._title_h + t._line_h * index + 'px' )
+ .css( "width", t._container_w - padding - margin );
} );
- },
- destroy: function () {
- this.element.insertBefore( this._ui.placeholder );
-
- this._ui.placeholder.remove();
- this._ui.container.remove();
- this._ui.screen.remove();
- this.element.triggerHandler("destroyed");
- $.Widget.prototype.destroy.call( this );
+ // Set Max Listview Height
+ $( o.id ).height( t._numItemData * t._line_h );
},
- _placementCoords: function ( x, y, cw, ch ) {
- var screenHeight = $( window ).height(),
- screenWidth = $( window ).width(),
- halfheight = ch / 2,
- maxwidth = parseFloat( this._ui.container.css( "max-width" ) ),
- roomtop = y,
- roombot = screenHeight - y,
- newtop,
- newleft;
+ _resize: function ( event ) {
+ var o,
+ t = this,
+ padding,
+ margin;
- if ( roomtop > ch / 2 && roombot > ch / 2 ) {
- newtop = y - halfheight;
+ if ( event.data ) {
+ o = event.data;
} else {
- newtop = roomtop > roombot ? screenHeight - ch - 30 : 30;
+ o = event;
}
- if ( cw < maxwidth ) {
- newleft = ( screenWidth - cw ) / 2;
- } else {
- newleft = x - cw / 2;
+ t._container_w = $( o.id ).innerWidth();
- if ( newleft < 10 ) {
- newleft = 10;
- } else if ( ( newleft + cw ) > screenWidth ) {
- newleft = screenWidth - cw - 10;
- }
- }
+ padding = parseInt( $( o.id + o.childSelector ).css( "padding-left" ), 10 )
+ + parseInt( $( o.id + o.childSelector ).css( "padding-right" ), 10 );
- return { x : newleft, y : newtop };
+ $( o.id + o.childSelector ).each( function (index) {
+ margin = parseInt( $( this ).css( "margin-left" ), 10 )
+ + parseInt( $( this ).css( "margin-right" ), 10 );
+ $( this ).css( "width", t._container_w - padding - margin );
+ } );
},
- _setPosition: function ( x_where, y_where ) {
- var x = ( undefined === x_where ? $( window ).width() / 2 : x_where ),
- y = ( undefined === y_where ? $( window ).height() / 2 : y_where ),
- coords,
- ctxpopup = this.element.data("ctxpopup"),
- popupWidth,
- menuHeight,
- menuWidth,
- screenHeight,
- screenWidth,
- roomtop,
- roombot,
- halfheight,
- maxwidth,
- newtop,
- newleft;
-
- if ( !ctxpopup ) {
- popupWidth = $( window ).width() * this.options.widthRatio;
- this._ui.container.css( "width", popupWidth );
+ // New scrollmove function supporting scrollTo
+ _scrollmove: function ( ev ) {
+ var t = ev.data, // vlist (JQM object)
+ o = t.options, // options
+ prevTopBufLen = t._num_top_items, // Previous(remembered) top buf length
+ timerInterval = 100,
+ i,
+ _scrollView,
+ _normalScroll;
- if ( this._ui.container.outerWidth() > $( window ).width() ) {
- this._ui.container.css( {"max-width" : $( window ).width() - 30} );
+ _scrollView = {
+ viewTop: function ( ) {
+ var sv = $( o.id ).parentsUntil( ".ui-page" ).find( ".ui-scrollview-view" ),
+ svTrans = sv.css( "-webkit-transform" ),
+ svTransVal = "0,0,0,0,0,0";
+ if ( svTrans ) {
+ svTransVal = svTrans.replace( /matrix\s*\((.*)\)/, "$1" ); // matrix(a,c,b,d,tx,ty)
+ }
+ return - parseInt( svTransVal.split(',')[5], 10 );
+ }
+ };
+ _normalScroll = {
+ viewTop: function ( ) {
+ return $( window ).scrollTop( ); // TODO: - _line_h?
}
+ };
+ // Get current view top position
+ function viewTop ( ) {
+ return o.scrollview ? _scrollView.viewTop() : _normalScroll.viewTop();
}
-
- coords = this._placementCoords( x, y,
- this._ui.container.outerWidth(),
- this._ui.container.outerHeight() );
-
- menuHeight = this._ui.container.innerHeight();
- menuWidth = this._ui.container.innerWidth();
- screenHeight = $( window ).height();
- screenWidth = $( window ).width();
- roomtop = y;
- roombot = screenHeight - y;
- halfheight = menuHeight / 2;
- maxwidth = parseFloat( this._ui.container.css( "max-width" ) );
- newtop = ( screenHeight - menuHeight ) / 2;
-
- if ( !maxwidth || menuWidth < maxwidth ) {
- newleft = ( screenWidth - menuWidth ) / 2;
- } else {
- newleft = x - menuWidth / 2;
-
- if ( newleft < 30 ) {
- newleft = 30;
- } else if ( ( newleft + menuWidth ) > screenWidth ) {
- newleft = screenWidth - menuWidth - 30;
+ // log function for debug
+ function log ( msg ) {
+ var debug = false;
+ if ( debug ) {
+ console.log( ">>virtualllist: " + msg );
}
}
- if ( ctxpopup ) {
- newtop = coords.y;
- newleft = coords.x;
- }
+ // Timer interval function
+ // @param[in] vl virtuallist object (JQM object)
+ function timerMove ( vl, undefined ) {
+ var cy, // current y position
+ cti, // current top idx
+ cbi, // current bottom idx
+ oti = vl._first_index, // old top idx
+ obi = vl._last_index, // old botton idx
+ dti, // delta of top idx
+ fromIdx,
+ toIdx, // index range to be moved
+ delta, // moveItem delta
+ rowLen = vl.options.row, // max. # of items handled at once
+ bufSize, // top/bottom buffer size. unit: # of items
+ i;
- this._ui.container.css({
- top: newtop,
- left: newleft
- });
+ // subroutine: Move itemContents in i2 into i1
+ function moveItemContents( vl, i1, i2 ) {
+ // TODO: Find a efficient way to replace data!
+ // Assumption: i1 and i2 has same children.
+ var NODETYPE = { ELEMENT_NODE: 1, TEXT_NODE: 3 },
+ c1, // child item 1 (old)
+ c2, // child item 2 (new)
+ newText,
+ newImg,
+ i;
- this._ui.screen.css( "height", screenHeight );
- },
- open: function ( x_where, y_where, backgroundclose ) {
- var self = this,
- zIndexMax = 0;
+ $( i1 ).find( ".ui-li-text-main", ".ui-li-text-sub", ".ui-li-text-sub2", "ui-btn-text" ).each( function ( index ) {
+ c1 = $( this );
+ newText = $( i2 ).find( ".ui-li-text-main", ".ui-li-text-sub", "ui-btn-text" ).eq( index ).text();
- if ( this._isOpen || this.options.disabled ) {
- return;
- }
+ $( c1 ).contents().filter( function () {
+ return ( this.nodeType == NODETYPE.TEXT_NODE );
+ } ).get( 0 ).data = newText;
+ } );
- $( document ).find("*").each( function () {
- var el = $( this ),
- zIndex = parseInt( el.css("z-index"), 10 );
+ $( i1 ).find( "img" ).each( function ( imgIdx ) {
+ var c1 = $( this );
+ newImg = $( i2 ).find( "img" ).eq( imgIdx ).attr( "src" );
- if ( !( el.is( self._ui.container ) ||
- el.is( self._ui.screen ) ||
- isNaN( zIndex ))) {
- zIndexMax = Math.max( zIndexMax, zIndex );
- }
- } );
+ $( c1 ).attr( "src", newImg );
+ } );
- this._ui.screen.css( "height", $( window ).height() );
+ $( i1 ).removeData( ); // Clear old data
+ }
- if ( backgroundclose ) {
- this._ui.screen.css( "opacity", 0 )
- .removeClass("ui-screen-hidden");
- } else {
- this._ui.removeClass("ui-screen-hidden");
+ // subroutine: Move item
+ function moveItem( vl, fromIdx, toIdx ) {
+ var itemData, // data from itemData()
+ item, // item element
+ newItem, // new item element
+ tmpl; // template
- if ( this.options.fade ) {
- this._ui.screen.animate( {opacity: this.options.opacity}, "fast" );
- } else {
- this._ui.screen.css( {opacity: this.options.opacity} );
- }
- }
+ log( ">> move item: " + fromIdx + " --> " + toIdx );
- this._setPosition( x_where, y_where );
+ // Find current item
+ item = $( '#' + vl.options.itemIDPrefix + fromIdx ); // TODO: refactor ID generation!
+ if ( ! item || ! item.length ) {
+ return false;
+ }
- this.element.trigger("popupbeforeposition");
+ // Get new item
+ tmpl = $( "#" + vl.options.template );
+ if ( tmpl ) {
+ newItem = tmpl.tmpl( vl._itemData( toIdx ) );
- this._ui.container
- .removeClass("ui-selectmenu-hidden")
- .addClass("in")
- .animationComplete( function () {
- self.element.trigger("popupafteropen");
- } );
+ // TODO: Consider touch block while moving?
- this._isOpen = true;
+ // Move item contents
+ moveItemContents( vl, item, newItem );
- if ( !this._reflow ) {
- this._reflow = function () {
- if ( !self._isOpen ) {
- return;
+ // clean up temporary item
+ newItem.remove();
}
- self._setPosition( x_where, y_where );
- };
+ // Move position, and set id
+ item.css( 'top', toIdx * vl._line_h )
+ .attr( 'id' , vl.options.itemIDPrefix + toIdx ); // TODO: refactor ID generation!
- $( window ).bind( "resize", this._reflow );
- }
- },
+ // TODO: Apply jqmdata? check following old code;
+ // $( oldItem ).removeData( ); // Clear old data
+ // if (key) { $( oldItem ).data( key, $( newItem ).data( key ) ); }
- close: function () {
- if ( !this._isOpen ) {
- return;
- }
+ return true;
+ }
- if ( this._reflow ) {
- $( window ).unbind( "resize", this._reflow );
- this._reflow = null;
- }
- var self = this,
- hideScreen = function () {
- self._ui.screen.addClass("ui-screen-hidden");
- self._isOpen = false;
- };
+ // Get current view position
+ cy = viewTop();
- this._ui.container.removeClass("in").addClass("reverse out");
+ // Calculate bufSize: rowLen / 3
+ // NOTE: Assumption: total row length = visible items * 3 (upper+visible+lower)
+ bufSize = Math.ceil( rowLen / 3 );
- if ( this.options.transition === "none" ) {
- this._ui.container
- .addClass("ui-selectmenu-hidden")
- .removeAttr("style");
- this.element.trigger("popupafterclose");
- } else {
- this._ui.container.animationComplete( function () {
- self._ui.container
- .removeClass("reverse out")
- .addClass("ui-selectmenu-hidden")
- .removeAttr("style");
- self.element.trigger("popupafterclose");
- } );
- }
+ // Calculate current top/bottom index (to be applied)
+ // top index = current position / line height
+ cti = Math.floor( cy / vl._line_h ) - bufSize; // TODO: consider buffer!
+ cbi = cti + rowLen - 1;
- if ( this.options.fade ) {
- this._ui.screen.animate( {opacity: 0}, "fast", hideScreen );
- } else {
- hideScreen();
- }
- },
+ if ( cti < 0 ) { // Top boundary check
+ cbi += ( - cti );
+ cti = 0;
+ } else if ( cbi > ( vl._numItemData - 1 ) ) { // Bottom boundary check
+ cti -= ( cbi - ( vl._numItemData - 1 ) );
+ cbi = ( vl._numItemData - 1 );
+ }
- _realSetTheme: function ( dst, theme ) {
- var classes = ( dst.attr("class") || "" ).split(" "),
- alreadyAdded = true,
- currentTheme = null,
- matches;
+ // Calculate dti
+ dti = cti - oti;
+ log( "cy=" + cy + ", oti=" + oti + ", obi=" + obi + ", cti=" + cti + ", cbi=" + cbi + ", dti=" + dti );
- while ( classes.length > 0 ) {
- currentTheme = classes.pop();
- matches = currentTheme.match(/^ui-body-([a-z])$/);
+ // switch: dti = 0 --> timer stop condition: delta=0 or scrollstop event comes. END.
+ if ( 0 == dti ) {
+ // Check timer runtime
+ vl.timerStillCount += 1;
+ if ( vl.timerStillCount < 12 ) { // check count ( TODO: test and adjust )
+ log("dti=0 " + vl.timerStillCount + " times");
+ vl.timerMoveID = setTimeout( timerMove, timerInterval, vl ); // run once more
+ return;
+ }
- if ( matches && matches.length > 1 ) {
- currentTheme = matches[1];
- break;
+ log("dti=0 " + vl.timerStillCount + " times. End timer.");
+ vl.timerStillCount = 0;
+ // Stop timer
+ if ( vl.timerMoveID ) {
+ clearTimeout( vl.timerMoveID );
+ vl.timerMoveID = null;
+ }
} else {
- currentTheme = null;
+ // switch: dti >= # of max elements --> total replace.
+ vl.timerStillCount = 0; // Reset still counter
+
+ if ( Math.abs( dti ) >= rowLen ) {
+ fromIdx = oti;
+ toIdx = obi;
+ delta = dti;
+ log( ">>> WHOLE CHANGE! delta=" + delta );
+ } else {
+ // switch: dti < # of max elements --> move t2b or b2t until new top/bottom idx is covered
+ if ( dti > 0 ) {
+ fromIdx = oti;
+ toIdx = oti + dti - 1;
+ delta = rowLen;
+ } else {
+ fromIdx = obi + dti + 1; // dti < 0
+ toIdx = obi;
+ delta = -rowLen;
+ }
+ log( ">>> partial change. delta=" + delta );
+ }
+
+ // Move items
+ for ( i = fromIdx; i <= toIdx; i++ ) {
+ moveItem( vl, i, i + delta ); // Change data and position
+ }
+
+ // Store current top/bottom idx into vl
+ vl._first_index = cti;
+ vl._last_index = cbi;
+
+ // Register timer to check again
+ vl.timerMoveID = setTimeout( timerMove, timerInterval, vl );
}
+ return; // End of function
}
- dst.removeClass( "ui-body-" + currentTheme );
- if ( ( theme || "" ).match(/[a-z]/) ) {
- dst.addClass( "ui-body-" + theme );
+ // ==== function start ====
+
+ t.timerStillCount = 0; // Count do-nothing time. For behavior tuning.
+
+ // If a timer function is alive, clear it
+ if ( t.timerMoveID ) {
+ clearTimeout( t.timerMoveID );
+ t.timerMoveID = null;
}
+ // run TimerMove()
+ timerMove( t );
},
- _setTheme: function ( value ) {
- this._realSetTheme( this.element, value );
- this.options.theme = value;
- this.element.attr( "data-" + ( $.mobile.ns || "" ) + "theme", value );
- },
+ _recreate: function ( newArray ) {
+ var t = this,
+ o = this.options;
- _setOverlayTheme: function ( value ) {
- this._realSetTheme( this._ui.container, value );
- this.options.overlayTheme = value;
- this.element.attr( "data-" + ( $.mobile.ns || "" ) + "overlay-theme", value );
- },
+ $( o.id ).empty();
- _setShadow: function ( value ) {
- this.options.shadow = value;
- this.element.attr( "data-" + ( $.mobile.ns || "" ) + "shadow", value );
- this._ui.container[value ? "addClass" : "removeClass"]("ui-overlay-shadow");
- },
+ t._numItemData = newArray.length;
+ t._direction = _NO_SCROLL;
+ t._first_index = 0;
+ t._last_index = o.row - 1;
- _setCorners: function ( value ) {
- this.options.corners = value;
- this.element.attr( "data-" + ( $.mobile.ns || "" ) + "corners", value );
- this._ui.container[value ? "addClass" : "removeClass"]("ui-corner-all");
- },
+ t._pushData( o.template );
- _setFade: function ( value ) {
- this.options.fade = value;
- this.element.attr( "data-" + ( $.mobile.ns || "" ) + "fade", value );
- },
+ if (o.childSelector == " ul" ) {
+ $( o.id + " ul" ).swipelist();
+ }
- _setTransition: function ( value ) {
- this._ui.container
- .removeClass( this.options.transition || "" )
- .addClass( value );
- this.options.transition = value;
- this.element.attr( "data-" + ( $.mobile.ns || "" ) + "transition", value );
+ $( o.id ).virtuallistview();
+
+ t.refresh( true );
+
+ t._reposition( o );
},
- _setDisabled: function ( value ) {
- $.Widget.prototype._setOption.call( this, "disabled", value );
- if ( value ) {
- this.close();
- }
- }
- });
+ // Init virtuallistview
+ // this virtuallistview object
+ _initList: function () {
+ var t = this,
+ o = this.options;
- $.tizen.popupwindow.bindPopupToButton = function ( btn, popup ) {
- if ( btn.length === 0 || popup.length === 0 ) {
- return;
- }
+ /* After AJAX loading success */
- var btnVClickHandler = function ( e ) {
- if ( !popup.jqmData("overlay-theme-set") ) {
- popup.popupwindow( "option", "overlayTheme", btn.jqmData("theme") );
- }
+ // Put initial <li> elements
+ t._pushData( o.template );
- popup.popupwindow( "open",
- btn.offset().left + btn.outerWidth() / 2,
- btn.offset().top + btn.outerHeight() / 2 );
+ // find a parent page, and run _reposition() at 'pageshow' event
+ // TODO: Consider replace parentsUntil().parent() to parent('.ui-page') ???
+ $( o.id ).parentsUntil( ".ui-page" ).parent().one( "pageshow", function () {
+ setTimeout( function () {
+ t._reposition( o );
+ }, 0);
+ });
- return false;
- };
+ // Bind _scrollmove() at 'scrollstart.virtuallist' event
+ $( document ).bind( "scrollstart.virtuallist scrollstop.vrituallist", t, t._scrollmove );
- if ( ( popup.popupwindow("option", "overlayTheme") || "" ).match(/[a-z]/) ) {
- popup.jqmData( "overlay-theme-set", true );
- }
+ // Bind _resize() at 'resize.virtuallist'
+ $( window ).bind( "resize.virtuallist", t._resize );
- btn
- .attr({
- "aria-haspopup": true,
- "aria-owns": btn.attr("href")
- })
- .removeAttr("href")
- .bind( "vclick", btnVClickHandler );
+ // when ul is a childselector, assume that this is also a swipelist,
+ // and run swipelist constructor
+ if ( o.childSelector == " ul" ) {
+ $( o.id + " ul" ).swipelist();
+ }
- popup.bind( "destroyed", function () {
- btn.unbind( "vclick", btnVClickHandler );
- } );
- };
+ t.refresh( true );
+ },
- $( document ).bind( "pagecreate create", function ( e ) {
- $( $.tizen.popupwindow.prototype.options.initSelector, e.target )
- .not(":jqmData(role='none'), :jqmData(role='nojs')")
- .popupwindow();
+ create: function () {
+ var o = this.options;
- $( "a[href^='#']:jqmData(rel='popupwindow')", e.target ).each( function () {
- $.tizen.popupwindow.bindPopupToButton( $( this ), $( $( this ).attr("href") ) );
- });
- });
-}( jQuery ));
-/*
- * jQuery Mobile Widget @VERSION
- *
- * This software is licensed under the MIT licence (as defined by the OSI at
- * http://www.opensource.org/licenses/mit-license.php)
- *
- * ***************************************************************************
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
- * Copyright (c) 2011 by Intel Corporation Ltd.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- * ***************************************************************************
- *
- * Authors: Gabriel Schulhof <gabriel.schulhof@intel.com>
- * Hyunjung Kim <hjnim.kim@samsung.com>
- */
+ /* external API for AJAX callback */
+ this._create.apply( this, arguments );
-/*
- * % ContextPopup widget do not use anymore(will be deprecated, internal use only)
- */
-// This widget is implemented in an extremely ugly way. It should derive from $.tizen.popupwindow, but it doesn't
-// because there's a bug in jquery.ui.widget.js which was fixed in jquery-ui commit
-// b9153258b0f0edbff49496ed16d2aa93bec07d95. Once a version of jquery-ui containing that commit is released
-// (probably >= 1.9m5), and jQuery Mobile picks up the widget from there, this widget needs to be rewritten properly.
-// The problem is that, when a widget inherits from a superclass and declares an object in its prototype identical in key
-// to one in the superclass, upon calling $.widget the object is overwritten in both the prototype of the superclass and
-// the prototype of the subclass. The prototype of the superclass should remain unchanged.
+ // TODO: remove this line? _initList() calls reposition...
+ this._reposition( o );
+ },
-/**
- class ContextPopup
- The context pop-up widget shows a list of options and automatically optimizes its size within the screen. This widget is intended for a small list of options for a larger list, use the List widget. <br/>The context pop-up widget requires a target button, which must be clicked to open the context pop-up. In the default application theme, an arrow pointer is displayed at the top-left corner of the context pop-up widget when it is opened.<br/><br/> To add a context pop-up widget to the application, use the following code:
+ _create: function ( args ) {
+ // Extend instance variables
+ $.extend( this, {
+ _itemData : function ( idx ) { return null; },
+ _numItemData : 0,
+ _cacheItemData : function ( minIdx, maxIdx ) { },
+ _title_h : 0,
+ _container_w : 0,
+ _minimum_row : 100,
+ _direction : _NO_SCROLL,
+ _first_index : 0,
+ _last_index : 0,
+ _num_top_items : 0 // By scroll move, number of hidden elements.
+ } );
- // Target button
- <a href="#pop_3_icons" id="btn_3_icons" data-role="button" data-inline="true" data-rel="popupwindow">3 Icons</a>
- // Context pop-up
- <div class="horizontal" id="pop_3_icons" data-role="popupwindow" data-show-arrow="true">
- <ul>
- <li class="icon">
- <a href="#" data-role="button" data-icon="call"></a>
- </li>
- <li class="icon">
- <a href="#" data-role="button" data-icon="favorite"></a>
- </li>
- <li class="text">
- <a href="#">Function</a>
- </li>
- </ul>
- </div>
- The context pop-up can define callbacks for events as described in the [jQueryMobile documentation for pop-up events.][1]
- You can use methods with the context pop-up as described in the [jQueryMobile documentation for pop-up methods.][2]
- [1]: http://jquerymobile.com/demos/1.2.0-alpha.1/docs/pages/popup/events.html
- [2]: http://jquerymobile.com/demos/1.2.0-alpha.1/docs/pages/popup/methods.html
+ // local variables
+ var t = this,
+ o = this.options,
+ $el = this.element,
+ shortcutsContainer = $('<div class="ui-virtuallist"/>'),
+ shortcutsList = $('<ul></ul>'),
+ dividers = $el.find(':jqmData(role="virtuallistview" )'),
+ lastListItem = null,
+ shortcutscroll = this,
+ dbtable_name,
+ dbtable;
- @deprecated 2.0 verisons
-*/
-(function ( $, undefined ) {
- $.widget( "tizen.ctxpopup", $.tizen.widgetex, {
- options: $.extend( {}, $.tizen.popupwindow.prototype.options, {
- initSelector: ":jqmData(show-arrow)"
- } ),
+ // Add CSS classes to $el (=virtuallistview)
+ $el.addClass( function ( i, orig ) {
+ return orig + " ui-listview ui-virtual-list-container" + ( t.options.inset ? " ui-listview-inset ui-corner-all ui-shadow " : "" );
+ });
- _htmlProto: {
-source:
+ // keep the vlist's ID
+ o.itemIDPrefix = $el.attr( "id" ) + '_';
+ o.id = "#" + $el.attr( "id" );
- [ "<div><div id='outer' class='ui-ctxpopup'>" ,
- " <div id='top' class='ui-ctxpopup-row' data-role='triangle' data-location='top'></div>" ,
- " <div class='ui-ctxpopup-row'>" ,
- " <div id='left' class='ui-ctxpopup-cell' data-role='triangle' data-location='left'></div>" ,
- " <div id='container' class='ui-ctxpopup-cell'></div>" ,
- " <div id='right' class='ui-ctxpopup-cell' data-role='triangle' data-location='right'></div>" ,
- " </div>" ,
- " <div id='bottom' class='ui-ctxpopup-row' data-role='triangle' data-location='bottom'></div>" ,
- "</div>" ,
- "</div>" ].join("")
-, ui: {
- outer : "#outer",
- container : "#container", // the key has to have the name "container"
- arrow : {
- all : ":jqmData(role='triangle')",
- l : "#left",
- t : "#top",
- r : "#right",
- b : "#bottom"
- }
+ // when page hides, empty all child elements
+ $( o.id ).bind( "pagehide", function ( e ) {
+ $( o.id ).empty();
+ });
+
+ // Find if scrollview is used
+ if ( $( ".ui-scrollview-clip" ).size() > 0 ) {
+ o.scrollview = true;
+ } else {
+ o.scrollview = false;
}
- },
- _create: function () {
- console.warn("ctxpopup() was deprecated. use popup() instead.");
- if ( !this.element.data( "popupwindow" ) ) {
- this.element.popupwindow();
+ // Calculate page buffer size
+ if ( $el.data( "row" ) ) {
+ o.row = $el.data( "row" );
+
+ if ( o.row < t._minimum_row ) {
+ o.row = t._minimum_row;
+ }
+
+ o.page_buf = parseInt( ( o.row / 2 ), 10 );
}
- this.element.data( "popupwindow" )
- ._ui.container
- .removeClass( "ui-popupwindow-padding" )
- .append( this._ui.outer );
- this._ui.outer.trigger( "create" ); // Creates the triangle widgets
- this._ui.container
- .addClass( "ui-popupwindow-padding" )
- .append( this.element );
- },
+ // Get arguments
+ if ( args ) {
+ if ( args.itemData && typeof args.itemData == 'function' ) {
+ t._itemData = args.itemData;
+ } else {
+ return;
+ }
+ if ( args.numItemData ) {
+ if ( typeof args.numItemData == 'function' ) {
+ t._numItemData = args.numItemData( );
+ } else if ( typeof args.numItemData == 'number' ) {
+ t._numItemData = args.numItemData;
+ } else {
+ return;
+ }
+ } else {
+ return;
+ }
+ } else { // No option is given
+ // Legacy support: dbtable
+ console.warn( "WARNING: The data interface of virtuallist is changed. \nOld data interface(data-dbtable) is still supported, but will be removed in next version. \nPlease fix your code soon!" );
- _setOption: function ( key, value ) {
- $.tizen.popupwindow.prototype._setOption.apply( this.element.data( "popupwindow" ), arguments );
- this.options[key] = value;
- }
- } );
+ /* After DB Load complete, Init Vritual list */
+ if ( $( o.id ).hasClass( "vlLoadSuccess" ) ) {
+ dbtable_name = $el.jqmData('dbtable');
+ dbtable = window[ dbtable_name ];
- var origOpen = $.tizen.popupwindow.prototype.open,
- orig_setOption = $.tizen.popupwindow.prototype._setOption,
- orig_placementCoords = $.tizen.popupwindow.prototype._placementCoords;
+ $( o.id ).empty();
- $.tizen.popupwindow.prototype._setOption = function ( key, value ) {
- var ctxpopup = this.element.data( "ctxpopup" ),
- needsApplying = true,
- origContainer;
- if ( ctxpopup ) {
- if ( "shadow" === key || "overlayTheme" === key || "corners" === key ) {
- origContainer = this._ui.container;
+ if ( !dbtable ) {
+ dbtable = { };
+ }
- this._ui.container = ctxpopup._ui.container;
- orig_setOption.apply( this, arguments );
- this._ui.container = origContainer;
- needsApplying = false;
+ t._itemData = function ( idx ) {
+ return dbtable[ idx ];
+ };
+ t._numItemData = dbtable.length;
+ } else {
+ return; // Do nothing
+ }
}
- ctxpopup.options[key] = value;
- }
- if ( needsApplying ) {
- orig_setOption.apply(this, arguments);
- }
- };
+ // Get template data
+ if ( $el.data( "template" ) ) {
+ o.template = $el.data( "template" );
- $.tizen.popupwindow.prototype._placementCoords = function ( x, y, cx, cy ) {
- var ctxpopup = this.element.data( "ctxpopup" ),
- self = this,
- coords = {},
- minDiff,
- minDiffIdx;
+ /* to support swipe list, <li> or <ul> can be main node of virtual list. */
+ if ( $el.data( "swipelist" ) == true ) {
+ o.childSelector = " ul";
+ } else {
+ o.childSelector = " li";
+ }
+ }
- function getCoords( arrow, x_factor, y_factor ) {
- // Unhide the arrow we want to test to take it into account
- ctxpopup._ui.arrow.all.hide();
- ctxpopup._ui.arrow[arrow].show();
+ // Set data's unique key
+ // NOTE: Unnecessary?
+ if ( $el.data( "dbkey" ) ) {
+ o.dbkey = $el.data( "dbkey" );
+ }
- var isHorizontal = ( "b" === arrow || "t" === arrow ),
- // Names of keys used in calculations depend on whether things are horizontal or not
- coord = ( isHorizontal
- ? { point: "x", size: "cx", beg: "left", outerSize: "outerWidth", niceSize: "width", triangleSize : "height" }
- : { point: "y", size: "cy", beg: "top", outerSize: "outerHeight", niceSize: "height", triangleSize : "width" } ),
- size = {
- cx : self._ui.container.width(),
- cy : self._ui.container.height()
- },
- halfSize = {
- cx : size.cx / 2,
- cy : size.cy / 2
- },
- desired = {
- "x" : x + halfSize.cx * x_factor,
- "y" : y + halfSize.cy * y_factor
- },
- orig = orig_placementCoords.call( self, desired.x, desired.y, size.cx, size.cy ),
+ t._first_index = 0; // initial top idx of <li> element.
+ t._last_index = o.row - 1; // initial bottom idx of <li> element.
+ t._initList(); // NOTE: Called at here only!
+ },
- // The triangleOffset must be clamped to the range described below:
- //
- // +-------...
- // | /\
- // | / \
- // ----+--+-,-----...
- //lowerDiff -->____| |/ <-- possible rounded corner
- //triangle size --> | /|
- // ____|/ |
- // ^ |\ | <-- lowest possible offset for triangle
- // actual range of | | \|
- // arrow offset | | |
- // values due to | . . Payload table cell looks like
- // possible rounded | . . a popup window, and it may have
- // corners and arrow | . . arbitrary things like borders,
- // triangle size - | | | shadows, and rounded corners.
- // our clamp range | | /|
- // _v__|/ |
- //triangle size --> |\ | <-- highest possible offset for triangle
- // ____| \|
- //upperDiff --> | |\ <-- possible rounded corner
- // ----+--+-'-----...
- // | \ /
- // | \/
- // +-------...
- //
- // We calculate lowerDiff and upperDiff by considering the offset and width of the payload (this.element)
- // versus the offset and width of the element enclosing the triangle, because the payload is inside
- // whatever decorations (such as borders, shadow, rounded corners) and thus can give a reliable indication
- // of the thickness of the combined decorations
+ destroy : function () {
+ var o = this.options;
- arrowBeg = ctxpopup._ui.arrow[arrow].offset()[coord.beg],
- arrowSize = ctxpopup._ui.arrow[arrow][coord.outerSize]( true ),
- payloadBeg = self.element.offset()[coord.beg],
- payloadSize = self.element[coord.outerSize]( true ),
- triangleSize = ctxpopup._ui.arrow[arrow][coord.triangleSize](),
- triangleOffset =
- Math.max(
- triangleSize // triangle size
- + Math.max( 0, payloadBeg - arrowBeg ), // lowerDiff
- Math.min(
- arrowSize // bottom
- - triangleSize // triangle size
- - Math.max( 0, arrowBeg + arrowSize - ( payloadBeg + payloadSize ) ), // upperDiff
- arrowSize / 2 // arrow unrestricted offset
- + desired[coord.point]
- - orig[coord.point]
- - halfSize[coord.size]
- )
- ),
- // Triangle points here
- final = {
- "x": orig.x + ( isHorizontal ? triangleOffset : 0) + ("r" === arrow ? size.cx : 0),
- "y": orig.y + (!isHorizontal ? triangleOffset : 0) + ("b" === arrow ? size.cy : 0)
- },
- ret = {
- actual : orig,
- triangleOffset : triangleOffset,
- absDiff : Math.abs( x - final.x ) + Math.abs( y - final.y )
- };
+ $( document ).unbind( "scrollstop" );
- // Hide it back
- ctxpopup._ui.arrow[arrow].hide();
+ $( window ).unbind( "resize.virtuallist" );
- return ret;
- }
+ $( o.id ).empty();
- if ( ctxpopup ) {
- // Returns:
- // {
- // absDiff: int
- // triangleOffset: int
- // actual: { x: int, y: int }
- // }
+ if ( this.timerMoveID ) {
+ clearTimeout( this.timerMoveID );
+ this.timerMoveID = null;
+ }
+ },
- coords = {
- l : getCoords( "l", 1, 0 ),
- r : getCoords( "r", -1, 0 ),
- t : getCoords( "t", 0, 1 ),
- b : getCoords( "b", 0, -1 )
- };
+ _itemApply: function ( $list, item ) {
+ var $countli = item.find( ".ui-li-count" );
- $.each( coords, function ( key, value ) {
- if ( minDiff === undefined || value.absDiff < minDiff ) {
- minDiff = value.absDiff;
- minDiffIdx = key;
- }
- } );
+ if ( $countli.length ) {
+ item.addClass( "ui-li-has-count" );
+ }
- // Side-effect: show the appropriate arrow and move it to the right offset
- ctxpopup._ui.arrow[minDiffIdx]
- .show()
- .triangle( "option", "offset", coords[minDiffIdx].triangleOffset );
- return coords[minDiffIdx].actual;
- }
+ $countli.addClass( "ui-btn-up-" + ( $list.jqmData( "counttheme" ) || this.options.countTheme ) + " ui-btn-corner-all" );
- return orig_placementCoords.call( this, x, y, cx, cy );
- };
+ // TODO class has to be defined in markup
+ item.find( "h1, h2, h3, h4, h5, h6" ).addClass( "ui-li-heading" ).end()
+ .find( "p, dl" ).addClass( "ui-li-desc" ).end()
+ .find( ">img:eq(0), .ui-link-inherit>img:eq(0)" ).addClass( "ui-li-thumb" ).each( function () {
+ item.addClass( $( this ).is( ".ui-li-icon" ) ? "ui-li-has-icon" : "ui-li-has-thumb" );
+ }).end()
+ .find( ".ui-li-aside" ).each(function () {
+ var $this = $( this );
+ $this.prependTo( $this.parent() ); //shift aside to front for css float
+ } );
+ },
- $.tizen.popupwindow.prototype.open = function ( x, y ) {
- var ctxpopup = this.element.data( "ctxpopup" );
+ _removeCorners: function ( li, which ) {
+ var top = "ui-corner-top ui-corner-tr ui-corner-tl",
+ bot = "ui-corner-bottom ui-corner-br ui-corner-bl";
- if ( ctxpopup ) {
- this._setFade( false );
- this._setShadow( false );
- this._setCorners( false );
- this._setOverlayTheme( null );
- this._setOption( "overlayTheme", ctxpopup.options.overlayTheme );
- ctxpopup._ui.arrow.all.triangle( "option", "color", ctxpopup._ui.container.css( "background-color" ) );
+ li = li.add( li.find( ".ui-btn-inner, .ui-li-link-alt, .ui-li-thumb" ) );
- // temporary
- $( '.ui-popupwindow' ).css( 'background', 'none' );
- }
+ if ( which === "top" ) {
+ li.removeClass( top );
+ } else if ( which === "bottom" ) {
+ li.removeClass( bot );
+ } else {
+ li.removeClass( top + " " + bot );
+ }
+ },
- origOpen.call( this, x, y, true );
- };
+ _refreshCorners: function ( create ) {
+ var $li,
+ $visibleli,
+ $topli,
+ $bottomli;
- //auto self-init widgets
- $( document ).bind( "pagecreate create", function ( e ) {
- var ctxpopups = $( $.tizen.ctxpopup.prototype.options.initSelector, e.target );
- $.tizen.ctxpopup.prototype.enhanceWithin( e.target );
- } );
-}( jQuery ) );
-/* ***************************************************************************
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software" ),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- * ***************************************************************************
- *
- * Author: Minkyu Kang <mk7.kang@samsung.com>
- * Author: Koeun Choi <koeun.choi@samsung.com>
- */
+ if ( this.options.inset ) {
+ $li = this.element.children( "li" );
+ // at create time the li are not visible yet so we need to rely on .ui-screen-hidden
+ $visibleli = create ? $li.not( ".ui-screen-hidden" ) : $li.filter( ":visible" );
-/*
- * Progress widget
- *
- * HTML Attributes
- *
- * data-role: set to 'progress'.
- * data-style: 'circle' or 'pending'.
- *
- * APIs
- *
- * show(): show the progress.
- * hide(): hide the progress.
- * running(boolean): start or stop the running.
- *
- * Events
- *
- * N/A
- *
- * Examples
- *
- * <li data-role="list-divider">Progress Pending</li>
- * <li>
- * <div data-role="progress" data-style="pending" id="pending"></div>
- * </li>
- * <li data-role="list-divider">Progress ~ing</li>
- * <li>
- * <div data-role="progress" data-style="circle" id="progress"></div>Loading..
- * </li>
- *
- * $("#pending").progress( "running", true );
- * $("#progress").progress( "running", true );
- *
- */
+ this._removeCorners( $li );
-/**
- @class Progress
- The progress widget shows that an operation is in progress. <br/>To add a progress widget to the application, use the following code:
+ // Select the first visible li element
+ $topli = $visibleli.first()
+ .addClass( "ui-corner-top" );
- <div data-role="progress" data-style="circle"></div>
-*/
-/**
- @property {String} data-style
- Sets the style of the progress widget. The style options are pending (pending progress style) and circle (circular progress status style).
-*/
-/**
- @method running
- The running method is used to set the current running state of the pending or circular progress widget:
+ $topli.add( $topli.find( ".ui-btn-inner" ) )
+ .find( ".ui-li-link-alt" )
+ .addClass( "ui-corner-tr" )
+ .end()
+ .find( ".ui-li-thumb" )
+ .not( ".ui-li-icon" )
+ .addClass( "ui-corner-tl" );
- <div id="foo" data-role="progress" data-style="pending"></div>
- $("#foo").progress("running", true);
-*/
-/**
- @method show
- The show method is used to show the pending or circular progress widget:
+ // Select the last visible li element
+ $bottomli = $visibleli.last()
+ .addClass( "ui-corner-bottom" );
- <div id="foo" data-role="progress" data-style="pending"></div>
- $("#foo").progress("show");
-*/
-/**
- @method hide
- The show method is used to hide the pending or circular progress widget:
-
- <div id="foo" data-role="progress" data-style="pending"></div>
- $("#foo").progress("hide");
-*/
-
-(function ( $, window, undefined ) {
- $.widget( "tizen.progress", $.mobile.widget, {
- options: {
- style: "circle",
- running: false
+ $bottomli.add( $bottomli.find( ".ui-btn-inner" ) )
+ .find( ".ui-li-link-alt" )
+ .addClass( "ui-corner-br" )
+ .end()
+ .find( ".ui-li-thumb" )
+ .not( ".ui-li-icon" )
+ .addClass( "ui-corner-bl" );
+ }
},
- show: function () {
- $( this.element ).show();
- },
+ // this virtuallistview object
+ refresh: function ( create ) {
+ this.parentPage = this.element.closest( ".ui-page" );
+ // Make sub page, and move the virtuallist into it...
+ // NOTE: check this subroutine.
+ this._createSubPages();
- hide: function () {
- $( this.element ).hide();
- },
+ var o = this.options,
+ $list = this.element,
+ self = this,
+ dividertheme = $list.jqmData( "dividertheme" ) || o.dividerTheme,
+ listsplittheme = $list.jqmData( "splittheme" ),
+ listspliticon = $list.jqmData( "spliticon" ),
+ li = $list.children( "li" ),
+ counter = $.support.cssPseudoElement || !$.nodeName( $list[ 0 ], "ol" ) ? 0 : 1,
+ item,
+ itemClass,
+ temTheme,
+ a,
+ last,
+ splittheme,
+ countParent,
+ icon,
+ pos,
+ numli,
+ itemTheme;
- _start: function () {
- if ( !this.init ) {
- $( this.element ).append( this.html );
- this.init = true;
+ // TODO: ?
+ if ( counter ) {
+ $list.find( ".ui-li-dec" ).remove();
}
- this.show();
+ for ( pos = 0, numli = li.length; pos < numli; pos++ ) {
+ item = li.eq( pos );
+ itemClass = "ui-li";
- $( this.element )
- .find( ".ui-progress-" + this.options.style )
- .addClass( this.runningClass );
- },
+ // If we're creating the element, we update it regardless
+ if ( create || !item.hasClass( "ui-li" ) ) {
+ itemTheme = item.jqmData( "theme" ) || o.theme;
+ a = item.children( "a" );
- _stop: function () {
- $( this.element )
- .find( ".ui-progress-" + this.options.style )
- .removeClass( this.runningClass );
- },
+ if ( a.length ) {
+ icon = item.jqmData( "icon" );
- running: function ( running ) {
- if ( running === undefined ) {
- return this.options.running;
- }
+ item.buttonMarkup({
+ wrapperEls: "div",
+ shadow: false,
+ corners: false,
+ iconpos: "right",
+ /* icon: a.length > 1 || icon === false ? false : icon || "arrow-r",*/
+ icon: false, /* Remove unnecessary arrow icon */
+ theme: itemTheme
+ });
- this._setOption( "running", running );
- },
+ if ( ( icon != false ) && ( a.length == 1 ) ) {
+ item.addClass( "ui-li-has-arrow" );
+ }
- _setOption: function ( key, value ) {
- if ( key === "running" ) {
- if ( typeof value !== "boolean" ) {
- window.alert( "running value MUST be boolean type!" );
- return;
- }
+ a.first().addClass( "ui-link-inherit" );
- this.options.running = value;
- this._refresh();
- }
- },
+ if ( a.length > 1 ) {
+ itemClass += " ui-li-has-alt";
- _refresh: function () {
- if ( this.options.running ) {
- this._start();
- } else {
- this._stop();
- }
- },
+ last = a.last();
+ splittheme = listsplittheme || last.jqmData( "theme" ) || o.splitTheme;
- _create: function () {
- var self = this,
- element = this.element,
- style = element.jqmData( "style" ),
- _html,
- runningClass;
+ last.appendTo(item)
+ .attr( "title", last.getEncodedText() )
+ .addClass( "ui-li-link-alt" )
+ .empty()
+ .buttonMarkup({
+ shadow: false,
+ corners: false,
+ theme: itemTheme,
+ icon: false,
+ iconpos: false
+ })
+ .find( ".ui-btn-inner" )
+ .append(
+ $( "<span />" ).buttonMarkup({
+ shadow: true,
+ corners: true,
+ theme: splittheme,
+ iconpos: "notext",
+ icon: listspliticon || last.jqmData( "icon" ) || o.splitIcon
+ })
+ );
+ }
+ } else if ( item.jqmData( "role" ) === "list-divider" ) {
- if ( style ) {
- this.options.style = style;
- } else {
- style = this.options.style;
- }
+ itemClass += " ui-li-divider ui-btn ui-bar-" + dividertheme;
+ item.attr( "role", "heading" );
- if ( style == "circle" ) {
- $( this.element ).addClass("ui-progress-container-circle");
+ //reset counter when a divider heading is encountered
+ if ( counter ) {
+ counter = 1;
+ }
- _html = '<div class="ui-progress-circle"></div>';
- } else if ( style === "pending" ) {
- $( this.element ).addClass("ui-progressbar");
+ } else {
+ itemClass += " ui-li-static ui-body-" + itemTheme;
+ }
+ }
- _html = '<div class="ui-progressbar-bg">' +
- '<div class="ui-progress-pending"></div>' +
- '</div>';
- }
+ if ( counter && itemClass.indexOf( "ui-li-divider" ) < 0 ) {
+ countParent = item.is( ".ui-li-static:first" ) ? item : item.find( ".ui-link-inherit" );
- this.html = $( _html );
+ countParent.addClass( "ui-li-jsnumbering" )
+ .prepend( "<span class='ui-li-dec'>" + (counter++) + ". </span>" );
+ }
- runningClass = "ui-progress-" + style + "-running";
+ item.add( item.children( ".ui-btn-inner" ) ).addClass( itemClass );
- $.extend( this, {
- init: false,
- runningClass: runningClass
- } );
- this._refresh();
- }
- } ); /* End of widget */
+ self._itemApply( $list, item );
+ }
- $( document ).bind( "pagecreate create", function ( e ) {
- $( e.target ).find( ":jqmData(role='progress')" ).progress();
- } );
-}( jQuery, this ));
-/*
- * jQuery UI Progressbar @VERSION
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Progressbar
- *
- * Depends:
- * jquery.ui.core.js
- * jquery.ui.widget.js
- * Original file:
- * jquery.ui.progressbar.js
- */
-/* This is from jquery ui plugin - progressbar 11/16/2011 */
+ this._refreshCorners( create );
+ },
+ //create a string for ID/subpage url creation
+ _idStringEscape: function ( str ) {
+ return str.replace(/\W/g , "-");
+ },
-/**
- @class ProgressBar
- The progress bar widget shows a control that indicates the progress percentage of an on-going operation. This widget can be scaled to fit inside a parent container.
+ // ?
+ // this virtuallistview object
+ _createSubPages: function () {
+ var parentList = this.element,
+ parentPage = parentList.closest( ".ui-page" ),
+ parentUrl = parentPage.jqmData( "url" ),
+ parentId = parentUrl || parentPage[ 0 ][ $.expando ],
+ parentListId = parentList.attr( "id" ),
+ o = this.options,
+ dns = "data-" + $.mobile.ns,
+ self = this,
+ persistentFooterID = parentPage.find( ":jqmData(role='footer')" ).jqmData( "id" ),
+ hasSubPages,
+ newRemove;
- To add a progress bar widget to the application, use the following code:
+ if ( typeof listCountPerPage[ parentId ] === "undefined" ) {
+ listCountPerPage[ parentId ] = -1;
+ }
- <div id="foo" data-role="progressbar"</div>
-*/
-/**
- @event change
- The progress bar can define a callback for the change event, which is fired when the progress value is changed:
- <div id="foo" data-role="progressbar"></div>
- $("#foo").bind("change", function (ev, val) {
- Console.log("Value is changed to " + val);
- });
-*/
-/**
- @method value
- You can use the value method with the pickers to set or get the current default progress bar value:
+ parentListId = parentListId || ++listCountPerPage[ parentId ];
- <div id="foo" data-role="progressbar"></div>
- var oldVal = $("#foo").progressbar("value");
- $("#foo").progressbar("value", 50);
-*/
+ $( parentList.find( "li>ul, li>ol" ).toArray().reverse() ).each(function ( i ) {
+ var self = this,
+ list = $( this ),
+ listId = list.attr( "id" ) || parentListId + "-" + i,
+ parent = list.parent(),
+ nodeEls,
+ title = nodeEls.first().getEncodedText(),//url limits to first 30 chars of text
+ id = ( parentUrl || "" ) + "&" + $.mobile.subPageUrlKey + "=" + listId,
+ theme = list.jqmData( "theme" ) || o.theme,
+ countTheme = list.jqmData( "counttheme" ) || parentList.jqmData( "counttheme" ) || o.countTheme,
+ newPage,
+ anchor;
-(function ( $, window, undefined ) {
+ nodeEls = $( list.prevAll().toArray().reverse() );
+ nodeEls = nodeEls.length ? nodeEls : $( "<span>" + $.trim( parent.contents()[ 0 ].nodeValue ) + "</span>" );
- $.widget( "tizen.progressbar", $.mobile.widget, {
- options: {
- value: 0,
- max: 100
- },
+ //define hasSubPages for use in later removal
+ hasSubPages = true;
- min: 0,
+ newPage = list.detach()
+ .wrap( "<div " + dns + "role='page' " + dns + "url='" + id + "' " + dns + "theme='" + theme + "' " + dns + "count-theme='" + countTheme + "'><div " + dns + "role='content'></div></div>" )
+ .parent()
+ .before( "<div " + dns + "role='header' " + dns + "theme='" + o.headerTheme + "'><div class='ui-title'>" + title + "</div></div>" )
+ .after( persistentFooterID ? $( "<div " + dns + "role='footer' " + dns + "id='" + persistentFooterID + "'>" ) : "" )
+ .parent()
+ .appendTo( $.mobile.pageContainer );
- _create: function () {
- this.element
- .addClass( "ui-progressbar" )
- .attr( {
- role: "progressbar",
- "aria-valuemin": this.min,
- "aria-valuemax": this.options.max,
- "aria-valuenow": this._value()
- } );
+ newPage.page();
- this.valueDiv = $( "<div class='ui-progressbar-value'></div>" )
- .appendTo( this.element );
+ anchor = parent.find('a:first');
- this.valueDiv.wrap("<div class='ui-progressbar-bg'></div>");
+ if ( !anchor.length ) {
+ anchor = $( "<a/>" ).html( nodeEls || title ).prependTo( parent.empty() );
+ }
- this.oldValue = this._value();
- this._refreshValue();
- },
+ anchor.attr( "href", "#" + id );
- _destroy: function () {
- this.element
- .removeClass( "ui-progressbar" )
- .removeAttr( "role" )
- .removeAttr( "aria-valuemin" )
- .removeAttr( "aria-valuemax" )
- .removeAttr( "aria-valuenow" );
+ }).virtuallistview();
- this.valueDiv.remove();
- },
+ // on pagehide, remove any nested pages along with the parent page, as long as they aren't active
+ // and aren't embedded
+ if ( hasSubPages &&
+ parentPage.is( ":jqmData(external-page='true')" ) &&
+ parentPage.data( "page" ).options.domCache === false ) {
- value: function ( newValue ) {
- if ( newValue === undefined ) {
- return this._value();
- }
+ newRemove = function ( e, ui ) {
+ var nextPage = ui.nextPage, npURL;
- this._setOption( "value", newValue );
- return this;
- },
+ if ( ui.nextPage ) {
+ npURL = nextPage.jqmData( "url" );
+ if ( npURL.indexOf( parentUrl + "&" + $.mobile.subPageUrlKey ) !== 0 ) {
+ self.childPages().remove();
+ parentPage.remove();
+ }
+ }
+ };
- _setOption: function ( key, value ) {
- if ( key === "value" ) {
- this.options.value = value;
- this._refreshValue();
- if ( this._value() === this.options.max ) {
- this.element.trigger( "complete" );
- }
+ // unbind the original page remove and replace with our specialized version
+ parentPage
+ .unbind( "pagehide.remove" )
+ .bind( "pagehide.remove", newRemove );
}
- // jquery.ui.widget.js MUST be updated to new version!
- //this._super( "_setOption", key, value );
},
- _value: function () {
- var val = this.options.value;
- // normalize invalid value
- if ( typeof val !== "number" ) {
- val = 0;
- }
- return Math.min( this.options.max, Math.max( this.min, val ) );
- },
+ // TODO sort out a better way to track sub pages of the virtuallistview this is brittle
+ childPages: function () {
+ var parentUrl = this.parentPage.jqmData( "url" );
- _percentage: function () {
- return 100 * this._value() / this.options.max;
- },
+ return $( ":jqmData(url^='" + parentUrl + "&" + $.mobile.subPageUrlKey + "')" );
+ }
+ });
- _refreshValue: function () {
- var value = this.value(),
- percentage = this._percentage();
+ //auto self-init widgets
+ $( document ).bind( "pagecreate create", function ( e ) {
+ $( $.tizen.virtuallistview.prototype.options.initSelector, e.target ).virtuallistview();
+ });
- if ( this.oldValue !== value ) {
- this.oldValue = value;
- this.element.trigger( "change" );
- }
+} ( jQuery ) );
- this.valueDiv
- .toggle( value > this.min )
- .width( percentage.toFixed(0) + "%" );
- this.element.attr( "aria-valuenow", value );
- }
- } );
- // auto self-init widgets
- $( document ).bind( "pagecreate", function ( e ) {
- $( e.target ).find( ":jqmData(role='progressbar')" ).progressbar();
- } );
-}( jQuery, this ) );
/* ***************************************************************************
* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
*
* Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
+ * 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
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
* ***************************************************************************
+ *
+ * Author: Minkyu Kang <mk7.kang@samsung.com>
+ * Author: Koeun Choi <koeun.choi@samsung.com>
*/
-/*
-* jQuery Mobile Framework : "textinput" plugin for text inputs, textareas
-* Copyright (c) jQuery Project
-* Dual licensed under the MIT or GPL Version 2 licenses.
-* http://jquery.org/license
-* Authors: Jinhyuk Jun <jinhyuk.jun@samsung.com>
-* Wongi Lee <wongi11.lee@samsung.com>
-*/
-/**
- * Searchbar can be created using <input> element with type=search
- * <input type="search" name="search" id="search1" value="" />
+/*
+ * Progress widget
*
- * Searchbar can be inserted 3 cases
- * content : seachbar behave same as content element
- * header : searchbar placed below title(header), It doesn't move when scrolling page
- * inside optionheader : Searchbar placed inside optionheader, searchbar can be seen only expand optionheader
+ * HTML Attributes
*
- * Examples:
+ * data-role: set to 'progress'.
+ * data-style: 'circle' or 'pending'.
*
- * HTML markup for creating Searchbar
- * <input type="search"/>
+ * APIs
*
- * How to make searchbar in content
- * <input type="search" name="" id="" value="" />
+ * show(): show the progress.
+ * hide(): hide the progress.
+ * running(boolean): start or stop the running.
*
- * How to make cancel button in searchbar
- * <div data-role="header" data-position ="fixed" >
- * <h1>Searchbar</h1>
- * <input type="search" data-cancel-btn=true name="" id="" value="" />
- * </div>
+ * Events
*
- * How to make icon in front of searchbar
- * <div data-role="header" data-position ="fixed" >
- * <h1>Searchbar</h1>
- * <input type="search" data-icon="call" name="" id="" value="" />
- * </div>
-*/
+ * N/A
+ *
+ * Examples
+ *
+ * <li data-role="list-divider">Progress Pending</li>
+ * <li>
+ * <div data-role="progress" data-style="pending" id="pending"></div>
+ * </li>
+ * <li data-role="list-divider">Progress ~ing</li>
+ * <li>
+ * <div data-role="progress" data-style="circle" id="progress"></div>Loading..
+ * </li>
+ *
+ * $("#pending").progress( "running", true );
+ * $("#progress").progress( "running", true );
+ *
+ */
/**
- @class SearchBar
- The search bar widget is used to search for page content. This widget can be placed in the header, option header, or page content.
+ @class Progress
+ The progress widget shows that an operation is in progress. <br/>To add a progress widget to the application, use the following code:
- To add a search bar widget to the application, use the following code:
+ <div data-role="progress" data-style="circle"></div>
+*/
+/**
+ @property {String} data-style
+ Sets the style of the progress widget. The style options are pending (pending progress style) and circle (circular progress status style).
+*/
+/**
+ @method running
+ The running method is used to set the current running state of the pending or circular progress widget:
- <label for="search-basic">Search Input:</label>
- <input type="search" name="search" id="searc-basic" value="" data-mini="true" />
+ <div id="foo" data-role="progress" data-style="pending"></div>
+ $("#foo").progress("running", true);
+*/
+/**
+ @method show
+ The show method is used to show the pending or circular progress widget:
- Tizen supports many search bar options as described in the jQueryMobile documentation for search bar options.
- The search bar can define callbacks for events as described in the jQueryMobile documentation for search bar events.
- You can use methods with the search bar as described in the jQueryMobile documentation for search bar methods.
+ <div id="foo" data-role="progress" data-style="pending"></div>
+ $("#foo").progress("show");
*/
+/**
+ @method hide
+ The show method is used to hide the pending or circular progress widget:
-(function ( $, undefined ) {
+ <div id="foo" data-role="progress" data-style="pending"></div>
+ $("#foo").progress("hide");
+*/
- $.widget( "tizen.searchbar", $.mobile.widget, {
+(function ( $, window, undefined ) {
+ $.widget( "tizen.progress", $.mobile.widget, {
options: {
- theme: null,
- initSelector: "input[type='search'],:jqmData(type='search'), input[type='tizen-search'],:jqmData(type='tizen-search')"
+ style: "circle",
+ running: false
},
- _create: function () {
- var input = this.element,
- o = this.options,
- theme = o.theme || $.mobile.getInheritedTheme( this.element, "c" ),
- themeclass = " ui-body-" + theme,
- focusedEl,
- clearbtn,
- cancelbtn,
- defaultText,
- defaultTextClass,
- trimedText,
- newClassName,
- newStyle,
- newDiv,
- searchimage,
- inputedText,
- useCancelBtn = false,
- frontIcon = false;
+ show: function () {
+ $( this.element ).show();
+ },
- $( "label[for='" + input.attr( "id" ) + "']" ).addClass( "ui-input-text" );
+ hide: function () {
+ $( this.element ).hide();
+ },
- if ( typeof input[0].autocorrect !== "undefined" && !$.support.touchOverflow ) {
- // Set the attribute instead of the property just in case there
- // is code that attempts to make modifications via HTML.
- input[0].setAttribute( "autocorrect", "off" );
- input[0].setAttribute( "autocomplete", "off" );
+ _start: function () {
+ if ( !this.init ) {
+ $( this.element ).append( this.html );
+ this.init = true;
}
- focusedEl = input.wrap( "<div class='ui-input-search ui-shadow-inset ui-corner-all ui-btn-shadow" + themeclass + "'></div>" ).parent();
-
- if ( $( this.element ).data( "cancel-btn" ) === true ) {
- useCancelBtn = true;
- focusedEl.addClass( "ui-input-search-default" );
- }
- if ( $( this.element ).data( "icon" ) != undefined ) {
- frontIcon = true;
- focusedEl.addClass( "ui-search-bar-icon" );
- }
+ this.show();
- clearbtn = $( "<a href='#' class='ui-input-clear' title='clear text'>clear text</a>" )
- .bind('click', function ( event ) {
- if ( input.attr( "disabled" ) == "disabled" ) {
- return false;
- }
- input
- .val( "" )
- .focus()
- .trigger( "change" );
- clearbtn.addClass( "ui-input-clear-hidden" );
- event.preventDefault();
- })
- .appendTo( focusedEl )
- .buttonMarkup({
- icon: "deleteSearch",
- iconpos: "notext",
- corners: true,
- shadow: true
- });
+ $( this.element )
+ .find( ".ui-progress-" + this.options.style )
+ .addClass( this.runningClass );
+ },
- function toggleClear() {
- setTimeout(function () {
- clearbtn.toggleClass( "ui-input-clear-hidden", !input.val() );
- }, 0);
- }
+ _stop: function () {
+ $( this.element )
+ .find( ".ui-progress-" + this.options.style )
+ .removeClass( this.runningClass );
+ },
- function showCancel() {
- focusedEl
- .addClass( "ui-input-search-default" )
- .removeClass( "ui-input-search-wide" );
- cancelbtn
- .addClass( "ui-btn-cancel-show" )
- .removeClass( "ui-btn-cancel-hide" );
+ running: function ( running ) {
+ if ( running === undefined ) {
+ return this.options.running;
}
- function hideCancel() {
- focusedEl
- .addClass( "ui-input-search-wide" )
- .removeClass( "ui-input-search-default" );
- cancelbtn
- .addClass( "ui-btn-cancel-hide" )
- .removeClass( "ui-btn-cancel-show" );
- toggleClear();
- }
+ this._setOption( "running", running );
+ },
- function makeFrontIcon() {
- var IconStyle = $( input ).jqmData( "icon" ),
- frontIcon = $( "<div data-role='button' data-style='circle'></div>" );
+ _setOption: function ( key, value ) {
+ if ( key === "running" ) {
+ if ( typeof value !== "boolean" ) {
+ window.alert( "running value MUST be boolean type!" );
+ return;
+ }
- frontIcon
- .appendTo( focusedEl.parent() )
- .buttonMarkup( {
- icon: IconStyle,
- corners: true,
- shadow: true
- } );
- frontIcon.addClass( "ui-btn-search-front-icon" );
+ this.options.running = value;
+ this._refresh();
}
+ },
- toggleClear();
-
- input.bind( 'paste cut keyup focus change blur', toggleClear );
-
- //SLP --start search bar with cancel button
- focusedEl.wrapAll( "<div class='input-search-bar'></div>" );
- searchimage = $("<div class='ui-image-search'></div>").appendTo( focusedEl );
-
- if ( frontIcon ) {
- makeFrontIcon();
+ _refresh: function () {
+ if ( this.options.running ) {
+ this._start();
+ } else {
+ this._stop();
}
+ },
- if ( useCancelBtn ) {
- cancelbtn = $( "<div data-role='button' class='ui-input-cancel' title='clear text'>Cancel</div>" )
- .bind('click', function ( event ) {
- if ( input.attr( "disabled" ) == "disabled" ) {
- return false;
- }
- event.preventDefault();
- event.stopPropagation();
-
- input
- .val( "" )
- .blur()
- .trigger( "change" );
+ _create: function () {
+ var self = this,
+ element = this.element,
+ style = element.jqmData( "style" ),
+ _html,
+ runningClass;
- if ( useCancelBtn ) {
- hideCancel();
- }
- } )
- .appendTo( focusedEl.parent() )
- .buttonMarkup( {
- iconpos: "cancel",
- corners: true,
- shadow: true
- } );
+ if ( style ) {
+ this.options.style = style;
+ } else {
+ style = this.options.style;
}
- // Input Focused
- input
- .focus( function () {
- if ( input.attr( "disabled" ) == "disabled" ) {
- return false;
- }
- if ( useCancelBtn ) {
- showCancel();
- }
- focusedEl.addClass( $.mobile.focusClass );
- })
- .blur(function () {
- focusedEl.removeClass( $.mobile.focusClass );
- });
-
- // Default Text
- defaultText = input.jqmData( "default-text" );
-
- if ( ( defaultText != undefined ) && ( defaultText.length > 0 ) ) {
- defaultTextClass = "ui-input-default-text";
- trimedText = defaultText.replace(/\s/g, "");
+ if ( style == "circle" ) {
+ $( this.element ).addClass("ui-progress-container-circle");
- /* Make new class for default text string */
- newClassName = defaultTextClass + "-" + trimedText;
- newStyle = $( "<style>" + '.' + newClassName + ":after" + "{content:" + "'" + defaultText + "'" + "}" + "</style>" );
- $( 'html > head' ).append( newStyle );
+ _html = '<div class="ui-progress-circle"></div>';
+ } else if ( style === "pending" ) {
+ $( this.element ).addClass("ui-progressbar");
- /* Make new empty <DIV> for default text */
- newDiv = $( "<div></div>" );
+ _html = '<div class="ui-progressbar-bg">' +
+ '<div class="ui-progress-pending"></div>' +
+ '</div>';
+ }
- /* Add class and append new div */
- newDiv.addClass( defaultTextClass );
- newDiv.addClass( newClassName );
- newDiv.tap( function ( event ) {
- input.blur();
- input.focus();
- } );
+ this.html = $( _html );
- input.parent().append( newDiv );
+ runningClass = "ui-progress-" + style + "-running";
- /* When focus, default text will be hide. */
- input
- .focus( function () {
- input.parent().find( "div.ui-input-default-text" ).addClass( "ui-input-default-hidden" );
- } )
- .blur( function () {
- var inputedText = input.val();
- if ( inputedText.length > 0 ) {
- input.parent().find( "div.ui-input-default-text" ).addClass( "ui-input-default-hidden" );
- } else {
- input.parent().find( "div.ui-input-default-text" ).removeClass( "ui-input-default-hidden" );
- }
- } );
- }
+ $.extend( this, {
+ init: false,
+ runningClass: runningClass
+ } );
- if ( !input.attr("placeholder") ) {
- input.attr( "placeholder", "Search" );
+ if ( style === "pending" ) {
+ $( this.element ).append( this.html );
+ this.init = true;
}
- },
-
- disable: function () {
- this.element.attr( "disabled", true );
- this.element.parent().addClass( "ui-disabled" );
- $( this.element ).blur();
- this.element.parent().parent().find(".ui-input-cancel").addClass( "ui-disabled" );
- },
- enable: function () {
- this.element.attr( "disabled", false );
- this.element.parent().removeClass( "ui-disabled" );
- this.element.parent().parent().find(".ui-input-cancel").removeClass( "ui-disabled" );
- $( this.element ).focus();
+ this._refresh();
}
- } );
+ } ); /* End of widget */
- //auto self-init widgets
$( document ).bind( "pagecreate create", function ( e ) {
- $.tizen.searchbar.prototype.enhanceWithin( e.target );
+ $( e.target ).find( ":jqmData(role='progress')" ).progress();
} );
+}( jQuery, this ));
-}( jQuery ) );
-/*
- * jQuery Mobile Widget @VERSION
- *
- * This software is licensed under the MIT licence (as defined by the OSI at
- * http://www.opensource.org/licenses/mit-license.php)
- *
- * ***************************************************************************
+
+
+/* ***************************************************************************
* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
- * Copyright (c) 2011 by Intel Corporation Ltd.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* DEALINGS IN THE SOFTWARE.
* ***************************************************************************
*
- * Authors: Max Waterman <max.waterman@intel.com>
- * Authors: Minkyu Kang <mk7.kang@samsung.com>
- */
-
+ * Author: Kangsik Kim <kangsik81.kim@samsung.com>
+ * Minkyeong Kim <minkyeong.kim@samsung.com>
+*/
+
/**
- * tizenslider modifies the JQuery Mobile slider and is created in the same way.
+ * The TokenTextArea widget changes a text item to a button. It can be comprised of a number of button widgets.
+ * When a user types text and the text gets a specific event to change from a text to a button,
+ * the input text is changed to a TokenTextArea widget.
+ * A user can add the TokenTextArea widget to a contact list, email list, or another list.
+ * The typical use of this widget is composing a number of contacts or phone numbers in a specific area of the screen.
*
- * See the JQuery Mobile slider widget for more information :
- * http://jquerymobile.com/demos/1.0a4.1/docs/forms/forms-slider.html
+ * HTML Attributes:
*
- * The JQuery Mobile slider option:
- * theme: specify the theme using the 'data-theme' attribute
+ * data-link : Represents the page id.
+ * The page contains data for the user, for example, an address book.
+ * If the value is null, anchor button doesn't work. (Default : null)
+ * data-label: Provide a label for a user-guide. (Default : 'To : ')
+ * data-description : This attribute is managing message format.
+ * This message is displayed when widget status was changed to 'focusout'. (Default : '+ {0}')
*
- * Options:
- * theme: string; the theme to use if none is specified using the 'data-theme' attribute
- * default: 'c'
- * popup: boolean; controls whether the popup is displayed or not
- * specify if the popup is enabled using the 'data-popup' attribute
- * set from javascript using .tizenslider('option','popup',newValue)
+ * APIs:
*
- * Events:
- * changed: triggers when the value is changed (rather than when the handle is moved)
+ * inputtext ( [string] )
+ * : If argument is not exist, will get a string from inputbox.
+ * If argument is exist, will set a string to inputbox.
+ * select ( [number] )
+ * : If no argument exists, gets a string of the selected block.
+ * If any button isn't selected on a token text area widget, this method returns "null" value.
+ * When a user call this method with an argument which is a number type,
+ * this method selects the button which is matched with the argument.
+ * add ( text, [number] )
+ * : If second argument does not exist, will insert to a new button at last position.
+ * Insert a new button at indexed position. The position is decided by the second argument.
+ * "index of position" means that the position of inserting a new button is decided by the second argument on "add" method.
+ * For example, if a user call the method like this "add("Tizen", 2)",
+ * new button labed "Tizen" will be inserted on the third position.
+ * remove ( [number] )
+ * : If no argument exists, all buttons are removed.
+ * Remove a button at indexed position.
+ * The position is decided by the second argument. (index: index of button)
+ * length ( void )
+ * : Get a number of buttons.
+ * foucsIn ( void )
+ * : This method change a status to 'focusin'.
+ * This status is able to manage a widget.
+ * focusOut ( void )
+ * : Changes the focus status to 'focus out'.
+ * The status is not able to manage a widget.
+ * All buttons that contained in the widget are removed and
+ * summarized message is displayed.
+ * destroy ( void )
+ * : Remove all of the new DOM elements for the current widget that you created.
*
- * Examples:
+ * Events:
*
- * <a href="#" id="popupEnabler" data-role="button" data-inline="true">Enable popup</a>
- * <a href="#" id="popupDisabler" data-role="button" data-inline="true">Disable popup</a>
- * <div data-role="fieldcontain">
- * <input id="mySlider" data-theme='a' data-popup='false' type="range" name="slider" value="7" min="0" max="9" />
- * </div>
- * <div data-role="fieldcontain">
- * <input id="mySlider2" type="range" name="slider" value="77" min="0" max="777" />
- * </div>
+ * create : Occur when create TokenTextArea widget.
+ * select : Occur when a button is selected.
+ * add : Occur when new button is inserted. (@since Tizen 2.1 deprecated, You can still use this event. But not recommended.)
+ * remove : Occur when a button is removed. (@since Tizen 2.1 deprecated, You can still use this event. But not recommended.)
*
- * // disable popup from javascript
- * $('#mySlider').tizenslider('option','popup',false);
+ * Examples:
+ *
+ * <div data-role="tokentextarea" data-label="To : " data-link:"#addressbook" data-description="+ {0}">
+ * </div>
*
- * // from buttons
- * $('#popupEnabler').bind('vclick', function() {
- * $('#mySlider').tizenslider('option','popup',true);
- * });
- * $('#popupDisabler').bind('vclick', function() {
- * $('#mySlider').tizenslider('option','popup',false);
- * });
*/
-/**
- @class Slider
- The slider widget shows a control on the screen that you can use to change values by dragging a handle on a horizontal scale. Sliders can be used in Tizen as described in the jQueryMobile documentation for sliders.
- To add a slider widget to the application, use the following code:
+/**
+ @class TokenTextArea
+ The TokenTextArea widget enables the user to enter text and convert it to a button. Each button that is created from entered text as a result of a change event forms a token text area widget. This widget is useful in composing an e-mail or SMS message to a group of addresses, each of which is a clickable item for more actions, such as copying, editing, or removing the address.
- <input data-popup='false' type="range" name="slider" value="5" min="0" max="10" data-icon="text" data-text-left="Min" data-text-right="Max" />
+ To add a token text area widget to the application, use the following code:
- The slider can define callbacks for events as described in the jQueryMobile documentation for slider events.
- You can use methods with the slider as described in the jQueryMobile documentation for slider methods.
+ <div data-role="tokentextarea" data-label="To : " data-link="pageId">
+ </div>
*/
+
/**
- @property {String} data-icon
- Defines the icon style for the slider ends. The icon options are bright, volume, and text.
- The default value is text.
+ @property {String} data-label
+ Sets a label as a guide for the user.
+ For example, while composing an e-mail message, the 'To : ' label is a guide for the user to enter e-mail addresses.
*/
+
/**
- @property {Boolean} data-popup
- Enables or disables a pop-up showing the current value while the handle is dragged.
- The default value is true.
-*/
+ @property {String} data-decription
+ Manages the message format.
+ The message is displayed when the widget status changes to focus out
+ */
/**
- @property {String} data-text-left
- Defines the text displayed on the left side of the slider.
- The data-icon option must be set to text.
+ @property {String} data-link
+ Sets the ID of the page to which the button links.
*/
/**
- @property {String} data-text-right
- Defines the text displayed on the right side of the slider.
- The data-icon option must be set to text.
-*/
-
-(function ($, window, undefined) {
- $.widget("tizen.tizenslider", $.mobile.widget, {
- options: {
- popup: true
- },
+ @event create
+ The create event is fired when the token text area widget is created:
- popup: null,
- handle: null,
- handleText: null,
+ <div data-role="tokentextarea">
+ </div>
+ $(".selector").tokentextarea
+ ({
+ create: function(event, ui)
+ {
+ // Handle the create event
+ }
+ });
+**/
+/**
+ @event select
+ The select event is fired when a token text area widget button is selected:
- _create: function () {
- this.currentValue = null;
- this.popupVisible = false;
+ <div data-role="tokentextarea">
+ </div>
+ $(".selector").bind("select", function(event, ui)
+ {
+ // Handle the select event
+ });
+*/
+/**
+ @event add (@since Tizen 2.1 deprecated, You can still use this event. But not recommended.)
+ The add event is fired when a token text area widget button is created:
- var self = this,
- inputElement = $( this.element ),
- slider,
- handle_press,
- popupEnabledAttr,
- icon,
- text_right,
- text_left,
- text_length,
- elem_left,
- elem_right,
- margin_left,
- margin_right;
+ <div data-role="tokentextarea">
+ </div>
+ $(".selector").bind("add", function(event, ui)
+ {
+ // Handle the add event
+ });
+*/
+/**
+ @event remove (@since Tizen 2.1 deprecated, You can still use this event. But not recommended.)
+ The remove event is fired when a token text area widget button is removed:
+ Restriction : "remove" event works under only "bind" event handling.
- // apply jqm slider
- inputElement.slider();
+ <div data-role="tokentextarea">
+ </div>
+ $(".selector").bind("remove", function(event, ui)
+ {
+ // Handle the remove event
+ });
+*/
+/**
+ @method destroy
+ The destroy method is used to remove in the current widget all the new DOM elements that you have created.
+
+ <div data-role="tokentextarea">
+ </div>
+ $(".selector").tokentextarea("destroy");
+
+ @since Tizen2.0
+*/
+/**
+ @method inputText
+ The inputText method is used to manage the widget input box text. If no parameter is set, the method gets the input box text. If a parameter is set, the parameter text is set in the input box.
+
+ <div data-role="tokentextarea">
+ </div>
+ $(".selector").tokentextarea("inputText", [text]);
+*/
+/**
+ @method select
+ The select method is used to select a token text area widget button based on its index value. If no index value is defined, the method returns the string of the selected block. If there are no buttons present in the widget, the method returns null.
- // hide the slider input element proper
- inputElement.hide();
+ <div data-role="tokentextarea">
+ </div>
+ $(".selector").tokentextarea("select", [index]);
+*/
+/**
+ @method add
+ The add method is used to add a new token text area widget button with the specified label text at the specified index position. If the index parameter is not defined, the widget button is added at the bottom of the list. For example, the $(".selector").tokentextarea("add", "Tizen", 2) method call creates a new widget button labeled 'Tizen' at the third position in the widget.
- self.popup = $('<div class="ui-slider-popup"></div>');
+ <div data-role="tokentextarea">
+ </div>
+ $(".selector").tokentextarea("add", [text], [index]);
+*/
+/**
+ @method remove
+ The remove method is used to remove a token text area widget button at the specified index position. If the parameter is not defined, all the widget buttons are removed.
- // set the popup according to the html attribute
- popupEnabledAttr = inputElement.jqmData('popup');
- if ( popupEnabledAttr !== undefined ) {
- self.options.popup = ( popupEnabledAttr == true );
- }
+ <div data-role="tokentextarea">
+ </div>
+ $(".selector").tokentextarea("remove", [index]);
+*/
+/**
+ @method length
+ The length method is used to retrieve the number of buttons in the token text area widget:
+ <div data-role="tokentextarea">
+ </div>
+ $(".selector").tokentextarea("length");
+*/
+/**
+ @method focusIn
+ The focusIn method is used to set the focus status to "focus in". This focus state enables the user to add or remove buttons in the token text area widget.
- // get the actual slider added by jqm
- slider = inputElement.next('.ui-slider');
+ <div data-role="tokentextarea">
+ </div>
+ $(".selector").tokentextarea("focusIn");
+*/
+/**
+ @method focusOut
+ The focusOut method is used to set the focus status to "focus out". In this focus state, the user cannot manage the buttons in the widget, all the buttons are removed, and a message is displayed.
- icon = inputElement.attr('data-icon');
+ <div data-role="tokentextarea">
+ </div>
+ $(".selector").tokentextarea("focusOut");
+*/
+( function ( $, window, document, undefined ) {
+ $.widget( "tizen.tokentextarea", $.mobile.widget, {
+ _focusStatus : null,
+ _items : null,
+ _viewWidth : 0,
+ _reservedWidth : 0,
+ _currentWidth : 0,
+ _fontSize : 0,
+ _anchorWidth : 0,
+ _labelWidth : 0,
+ _marginWidth : 0,
+ options : {
+ label : "To : ",
+ link : null,
+ description : "+ {0}"
+ },
- // wrap the background
- slider.wrap('<div class="ui-slider-container"></div>');
+ _create : function () {
+ var self = this,
+ $view = this.element,
+ role = $view.jqmData( "role" ),
+ option = this.options,
+ className = "ui-tokentextarea-link",
+ inputbox = $( document.createElement( "input" ) ),
+ labeltag = $( document.createElement( "span" ) ),
+ moreBlock = $( document.createElement( "a" ) );
- // get the handle
- self.handle = slider.find('.ui-slider-handle');
+ $view.hide().empty().addClass( "ui-" + role );
- // remove the rounded corners from the slider and its children
- slider.removeClass('ui-btn-corner-all');
- slider.find('*').removeClass('ui-btn-corner-all');
+ // create a label tag.
+ $( labeltag ).text( option.label ).addClass( "ui-tokentextarea-label" ).attr( "tabindex", 0 );
+ $view.append( labeltag );
- // add icon
- switch ( icon ) {
- case 'bright':
- case 'volume':
- elem_left = $('<div class="ui-slider-left-' + icon + '"></div>');
- elem_right = $('<div class="ui-slider-right-' + icon + '"></div>');
+ // create a input tag
+ $( inputbox ).addClass( "ui-tokentextarea-input ui-tokentextarea-input-visible ui-input-text ui-body-s" ).attr( "role", "textbox" );
+ $view.append( inputbox );
- slider.before( elem_left );
- slider.after( elem_right );
+ // create a anchor tag.
+ if ( option.link === null || $.trim( option.link ).length < 1 || $( option.link ).length === 0 ) {
+ className += "-dim";
+ }
+ $( moreBlock ).attr( "data-role", "button" )
+ .buttonMarkup( {
+ inline: true,
+ icon: "plus",
+ style: "circle"
+ })
+ .attr( { "href" : $.trim( option.link ), "tabindex" : 0 } )
+ .addClass( "ui-tokentextarea-link-base" )
+ .addClass( className )
+ .find( "span.ui-btn-text" )
+ .text( "Add recipient" );
- margin_left = elem_left.width() + 16;
- margin_right = elem_right.width() + 16;
- break;
+ // append default htmlelements to main widget.
+ $view.append( moreBlock );
- case 'text':
- text_left = ( inputElement.attr('data-text-left') === undefined ) ? '' :
- inputElement.attr('data-text-left').substring( 0, 3 );
- text_right = ( inputElement.attr('data-text-right') === undefined ) ? '' :
- inputElement.attr('data-text-right').substring( 0, 3 );
+ // bind a event
+ this._bindEvents();
+ self._focusStatus = "init";
+ // display widget
+ $view.show();
- text_length = Math.max( text_left.length, text_right.length ) + 1;
+ // assign global variables
+ self._viewWidth = $view.innerWidth();
+ self._reservedWidth += self._calcBlockWidth( moreBlock );
+ self._reservedWidth += self._calcBlockWidth( labeltag );
+ self._fontSize = parseInt( $( moreBlock ).css( "font-size" ), 10 );
+ self._currentWidth = self._reservedWidth;
+ self._modifyInputBoxWidth();
+ },
- margin_left = text_length + "rem";
- margin_right = text_length + "rem";
+ // bind events
+ _bindEvents : function () {
+ var self = this,
+ $view = self.element,
+ option = self.options,
+ inputbox = $view.find( ".ui-tokentextarea-input" ),
+ moreBlock = $view.find( ".ui-tokentextarea-link-base" ),
+ isSeparator = false;
- elem_left = $('<div class="ui-slider-left-text" style="left:' +
- -( text_length ) + 'rem; width:' + text_length + 'rem;">' +
- '<span style="position:relative;top:0.4em;">' +
- text_left +
- '</span></div>');
- elem_right = $('<div class="ui-slider-right-text" style="right:' +
- -( text_length ) + 'rem; width:' + text_length + 'rem;">' +
- '<span style="position:relative;top:0.4em;">' +
- text_right +
- '</span></div>');
+ // delegate a event to HTMLDivElement(each block).
+ $view.delegate( "div", "click", function ( event ) {
+ if ( $( this ).hasClass( "ui-tokentextarea-sblock" ) ) {
+ // If block is selected, it will be removed.
+ self._removeTextBlock();
+ }
- slider.before( elem_left );
- slider.after( elem_right );
- break;
- }
+ var lockBlock = $view.find( "div.ui-tokentextarea-sblock" );
+ if ( typeof lockBlock !== "undefined" ) {
+ lockBlock.removeClass( "ui-tokentextarea-sblock" ).addClass( "ui-tokentextarea-block" );
+ }
+ $( this ).removeClass( "ui-tokentextarea-block" ).addClass( "ui-tokentextarea-sblock" );
+ $view.trigger( "select" );
+ });
- if ( icon ) {
- slider.parent('.ui-slider-container').css({
- "margin-left": margin_left,
- "margin-right": margin_right
- });
- }
+ inputbox.bind( "keyup", function ( event ) {
+ // 8 : backspace
+ // 13 : Enter
+ // 186 : semi-colon
+ // 188 : comma
+ var keyValue = event.keyCode,
+ valueString = $( inputbox ).val(),
+ valueStrings = [],
+ index;
- // handle press
- slider.append($('<div class="ui-slider-handle-press"></div>'));
- self.handle_press = slider.find('.ui-slider-handle-press');
- self.handle_press.css('display', 'none');
+ if ( keyValue === 8 ) {
+ if ( valueString.length === 0 ) {
+ self._validateTargetBlock();
+ }
+ } else if ( keyValue === 13 || keyValue === 186 || keyValue === 188 ) {
+ if ( valueString.length !== 0 ) {
+ // split content by separators(',', ';')
+ valueStrings = valueString.split ( /[,;]/ );
+ for ( index = 0; index < valueStrings.length; index++ ) {
+ if ( valueStrings[index].length !== 0 && valueStrings[index].replace( /\s/g, "" ).length !== 0 ) {
+ self._addTextBlock( valueStrings[index] );
+ }
+ }
+ }
+ inputbox.val( "" );
+ isSeparator = true;
+ } else {
+ self._unlockTextBlock();
+ }
- // add a popup element (hidden initially)
- slider.before( self.popup );
- self.popup.hide();
+ return !isSeparator;
+ });
- // get the element where value can be displayed
- self.handleText = slider.find('.ui-btn-text');
+ moreBlock.click( function () {
+ if ( $( moreBlock ).hasClass( "ui-tokentextarea-link-dim" ) ) {
+ return;
+ }
- // set initial value
- self.updateSlider();
+ $( inputbox ).removeClass( "ui-tokentextarea-input-visible" ).addClass( "ui-tokentextarea-input-invisible" );
- // bind to changes in the slider's value to update handle text
- this.element.bind('change', function () {
- self.updateSlider();
+ $.mobile.changePage( option.link, {
+ transition: "slide",
+ reverse: false,
+ changeHash: false
+ });
});
- // bind clicks on the handle to show the popup
- self.handle.bind('vmousedown', function () {
- self.showPopup();
+ $( document ).bind( "pagechange.mbe", function ( event ) {
+ if ( $view.innerWidth() === 0 ) {
+ return ;
+ }
+ self._modifyInputBoxWidth();
+ $( inputbox ).removeClass( "ui-tokentextarea-input-invisible" ).addClass( "ui-tokentextarea-input-visible" );
});
- // watch events on the document to turn off the slider popup
- slider.add( document ).bind('vmouseup', function () {
- self.hidePopup();
+ $view.bind( "click", function ( event ) {
+ if ( self._focusStatus === "focusOut" ) {
+ self.focusIn();
+ }
});
},
- _handle_press_show: function () {
- this.handle_press.css('display', '');
- },
+ // create a textbutton and append this button to parent layer.
+ // @param arg1 : string
+ // @param arg2 : index
+ _addTextBlock : function ( messages, blockIndex ) {
+ if ( arguments.length === 0 ) {
+ return;
+ }
- _handle_press_hide: function () {
- this.handle_press.css('display', 'none');
- },
+ if ( !messages ) {
+ return ;
+ }
- // position the popup
- positionPopup: function () {
- var dstOffset = this.handle.offset();
+ var self = this,
+ $view = self.element,
+ content = messages,
+ index = blockIndex,
+ blocks = null,
+ textBlock = null;
- this.popup.offset({
- left: dstOffset.left + ( this.handle.width() - this.popup.width() ) / 2
- });
+ if ( self._viewWidth === 0 ) {
+ self._viewWidth = $view.innerWidth();
+ }
- this.handle_press.offset({
- left: dstOffset.left,
- top: dstOffset.top
+ // Create a new text HTMLDivElement.
+ textBlock = $( document.createElement( 'div' ) );
+
+ textBlock.text( content ).addClass( "ui-tokentextarea-block" ).attr( { "aria-label" : "double tap to edit", "tabindex" : 0 } );
+ textBlock.css( {'visibility': 'hidden'} );
+
+ blocks = $view.find( "div" );
+ if ( index !== null && index <= blocks.length ) {
+ $( blocks[index] ).before( textBlock );
+ } else {
+ $view.find( ".ui-tokentextarea-input" ).before( textBlock );
+ }
+
+ textBlock = self._ellipsisTextBlock( textBlock );
+ textBlock.css( {'visibility': 'visible'} );
+
+ self._modifyInputBoxWidth();
+
+ textBlock.hide();
+ textBlock.fadeIn( "fast", function () {
+ self._currentWidth += self._calcBlockWidth( textBlock );
+ $view.trigger( "add" );
});
},
- // show value on the handle and in popup
- updateSlider: function () {
- var font_size,
- font_length,
- font_top,
- padding_size,
- newValue,
- get_value_length = function ( v ) {
- var val = Math.abs( v ),
- len;
-
- if ( val > 999 ) {
- len = 4;
- } else if ( val > 99 ) {
- len = 3;
- } else if ( val > 9 ) {
- len = 2;
- } else {
- len = 1;
- }
+ _removeTextBlock : function () {
+ var self = this,
+ $view = this.element,
+ lockBlock = $view.find( "div.ui-tokentextarea-sblock" ),
+ _temp = null,
+ _dummy = function () {};
- if ( v < 0 ) {
- len++;
- }
+ if ( lockBlock !== null && lockBlock.length > 0 ) {
+ self._currentWidth -= self._calcBlockWidth( lockBlock );
- return len;
- };
+ lockBlock.fadeOut( "fast", function () {
+ lockBlock.remove();
+ self._modifyInputBoxWidth();
+ });
- // remove the title attribute from the handle (which is
- // responsible for the annoying tooltip); NB we have
- // to do it here as the jqm slider sets it every time
- // the slider's value changes :(
- this.handle.removeAttr('title');
+ this._eventRemoveCall = true;
+ if ( $view[0].remove ) {
+ _temp = $view[0].remove;
+ $view[0].remove = _dummy;
+ }
+ $view.triggerHandler( "remove" );
+ if ( _temp) {
+ $view[0].remove = _temp;
+ }
+ this._eventRemoveCall = false;
+ } else {
+ $view.find( "div:last" ).removeClass( "ui-tokentextarea-block" ).addClass( "ui-tokentextarea-sblock" );
+ }
+ },
- newValue = this.element.val();
+ _calcBlockWidth : function ( block ) {
+ return $( block ).outerWidth( true );
+ },
- font_length = get_value_length( newValue );
+ _unlockTextBlock : function () {
+ var $view = this.element,
+ lockBlock = $view.find( "div.ui-tokentextarea-sblock" );
+ if ( lockBlock ) {
+ lockBlock.removeClass( "ui-tokentextarea-sblock" ).addClass( "ui-tokentextarea-block" );
+ }
+ },
- if ( this.popupVisible ) {
- this.positionPopup();
+ // call when remove text block by backspace key.
+ _validateTargetBlock : function () {
+ var self = this,
+ $view = self.element,
+ lastBlock = $view.find( "div:last" ),
+ tmpBlock = null;
- switch ( font_length ) {
- case 1:
- case 2:
- font_size = '1.5rem';
- padding_size = '0.15rem';
- break;
- case 3:
- font_size = '1rem';
- padding_size = '0.5rem';
- break;
- default:
- font_size = '0.8rem';
- padding_size = '0.5rem';
- break;
- }
+ if ( lastBlock.hasClass( "ui-tokentextarea-sblock" ) ) {
+ self._removeTextBlock();
+ } else {
+ tmpBlock = $view.find( "div.ui-tokentextarea-sblock" );
+ tmpBlock.removeClass( "ui-tokentextarea-sblock" ).addClass( "ui-tokentextarea-block" );
+ lastBlock.removeClass( "ui-tokentextarea-block" ).addClass( "ui-tokentextarea-sblock" );
+ }
+ },
- this.popup.css({
- "font-size": font_size,
- "padding-top": padding_size
- });
+ _ellipsisTextBlock : function ( textBlock ) {
+ var self = this,
+ $view = self.element,
+ maxWidth = self._viewWidth / 2;
+
+ if ( self._calcBlockWidth( textBlock ) > maxWidth ) {
+ $( textBlock ).width( maxWidth - self._marginWidth );
}
- if ( newValue === this.currentValue ) {
+ return textBlock;
+ },
+
+ _modifyInputBoxWidth : function () {
+ var self = this,
+ $view = self.element,
+ margin = 0,
+ labelWidth = 0,
+ anchorWidth = 0,
+ inputBoxWidth = 0,
+ blocks = $view.find( "div" ),
+ blockWidth = 0,
+ index = 0,
+ inputBoxMargin = 10,
+ inputBox = $view.find( ".ui-tokentextarea-input" );
+
+ if ( $view.width() === 0 ) {
return;
}
- switch ( font_length ) {
- case 1:
- font_size = '0.95rem';
- font_top = '0';
- break;
- case 2:
- font_size = '0.85rem';
- font_top = '-0.01rem';
- break;
- case 3:
- font_size = '0.65rem';
- font_top = '-0.05rem';
- break;
- default:
- font_size = '0.45rem';
- font_top = '-0.15rem';
- break;
+ if ( self._labelWidth === 0 ) {
+ self._labelWidth = $view.find( ".ui-tokentextarea-label" ).outerWidth( true );
+ self._anchorWidth = $view.find( ".ui-tokentextarea-link-base" ).outerWidth( true );
+ self._marginWidth = parseInt( ( $( inputBox ).css( "margin-left" ) ), 10 );
+ self._marginWidth += parseInt( ( $( inputBox ).css( "margin-right" ) ), 10 );
+ self._viewWidth = $view.innerWidth();
}
- if ( font_size != this.handleText.css('font-size') ) {
- this.handleText.css({
- 'font-size': font_size,
- 'top': font_top
- });
- }
+ margin = self._marginWidth;
+ labelWidth = self._labelWidth;
+ anchorWidth = self._anchorWidth;
+ inputBoxWidth = self._viewWidth - labelWidth;
- this.currentValue = newValue;
- this.handleText.text( newValue );
- this.popup.html( newValue );
+ for ( index = 0; index < blocks.length; index += 1 ) {
+ blockWidth = self._calcBlockWidth( blocks[index] );
- this.element.trigger( 'update', newValue );
+ if ( blockWidth >= inputBoxWidth + anchorWidth ) {
+ if ( blockWidth >= inputBoxWidth ) {
+ inputBoxWidth = self._viewWidth - blockWidth;
+ } else {
+ inputBoxWidth = self._viewWidth;
+ }
+ } else {
+ if ( blockWidth > inputBoxWidth ) {
+ inputBoxWidth = self._viewWidth - blockWidth;
+ } else {
+ inputBoxWidth -= blockWidth;
+ }
+ }
+ }
+
+ inputBoxWidth -= margin;
+ if ( inputBoxWidth < anchorWidth * 2 ) {
+ inputBoxWidth = self._viewWidth - margin;
+ }
+ $( inputBox ).width( inputBoxWidth - anchorWidth - inputBoxMargin );
},
- // show the popup
- showPopup: function () {
- if ( !this.options.popup || this.popupVisible ) {
- return;
+ _stringFormat : function ( expression ) {
+ var pattern = null,
+ message = expression,
+ i = 0;
+ for ( i = 1; i < arguments.length; i += 1 ) {
+ pattern = "{" + ( i - 1 ) + "}";
+ message = message.replace( pattern, arguments[i] );
}
+ return message;
+ },
- this.popup.show();
- this.popupVisible = true;
- this._handle_press_show();
+ _resizeBlocks : function () {
+ var self = this,
+ $view = self.element,
+ blocks = $view.find( "div" ),
+ index = 0;
+
+ for ( index = 0 ; index < blocks.length ; index += 1 ) {
+ $( blocks[index] ).css( "width", "auto" );
+ blocks[index] = self._ellipsisTextBlock( blocks[index] );
+ }
},
- // hide the popup
- hidePopup: function () {
- if ( !this.options.popup || !this.popupVisible ) {
+ //---------------------------------------------------- //
+ // Public Method //
+ //----------------------------------------------------//
+ //
+ // Focus In Event
+ //
+ focusIn : function () {
+ if ( this._focusStatus === "focusIn" ) {
return;
}
- this.popup.hide();
- this.popupVisible = false;
- this._handle_press_hide();
- },
+ var $view = this.element;
- _setOption: function (key, value) {
- var needToChange = ( value !== this.options[key] );
+ $view.find( ".ui-tokentextarea-label" ).attr( "tabindex", 0 ).show();
+ $view.find( ".ui-tokentextarea-desclabel" ).remove();
+ $view.find( "div.ui-tokentextarea-sblock" ).removeClass( "ui-tokentextarea-sblock" ).addClass( "ui-tokentextarea-block" );
+ $view.find( "div" ).attr( { "aria-label" : "double tap to edit", "tabindex" : 0 } ).show();
+ $view.find( ".ui-tokentextarea-input" ).removeClass( "ui-tokentextarea-input-invisible" ).addClass( "ui-tokentextarea-input-visible" ).attr( "tabindex", 0 );
+ $view.find( "a" ).attr( "tabindex", 0 ).show();
- if ( !needToChange ) {
+ // change focus state.
+ this._modifyInputBoxWidth();
+ this._focusStatus = "focusIn";
+ $view.removeClass( "ui-tokentextarea-focusout" ).addClass( "ui-tokentextarea-focusin" ).removeAttr( "tabindex" );
+ $view.find( ".ui-tokentextarea-input" ).focus();
+ },
+
+ focusOut : function () {
+ if ( this._focusStatus === "focusOut" ) {
return;
}
- switch ( key ) {
- case 'popup':
- this.options.popup = value;
+ var self = this,
+ $view = self.element,
+ tempBlock = null,
+ stateBlock = null,
+ numBlock = null,
+ statement = "",
+ index = 0,
+ lastIndex = 10,
+ label = $view.find( ".ui-tokentextarea-label" ),
+ more = $view.find( "span" ),
+ blocks = $view.find( "div" ),
+ currentWidth = $view.outerWidth( true ) - more.outerWidth( true ) - label.outerWidth( true ),
+ blockWidth = 0;
- if ( this.options.popup) {
- this.updateSlider();
- } else {
- this.hidePopup();
+ label.removeAttr( "tabindex" );
+ $view.find( ".ui-tokentextarea-input" ).removeClass( "ui-tokentextarea-input-visible" ).addClass( "ui-tokentextarea-input-invisible" ).removeAttr( "tabindex" );
+ $view.find( "a" ).removeAttr( "tabindex" ).hide();
+ blocks.removeAttr( "aria-label" ).removeAttr( "tabindex" ).hide();
+
+ currentWidth = currentWidth - self._reservedWidth;
+
+ for ( index = 0; index < blocks.length; index++ ) {
+ blockWidth = $( blocks[index] ).outerWidth( true );
+ if ( currentWidth - blockWidth <= 0 ) {
+ lastIndex = index - 1;
+ break;
}
- break;
+ $( blocks[index] ).show();
+ currentWidth -= blockWidth;
}
- }
- });
- // stop jqm from initialising sliders
- $( document ).bind( "pagebeforecreate", function ( e ) {
- if ( $.data( window, "jqmSliderInitSelector" ) === undefined ) {
- $.data( window, "jqmSliderInitSelector",
- $.mobile.slider.prototype.options.initSelector );
- $.mobile.slider.prototype.options.initSelector = null;
- }
- });
+ if ( lastIndex !== blocks.length ) {
+ statement = self._stringFormat( self.options.description, blocks.length - lastIndex - 1 );
+ tempBlock = $( document.createElement( 'span' ) );
+ tempBlock.addClass( "ui-tokentextarea-desclabel" ).attr( { "aria-label" : "more, double tap to edit", "tabindex" : "-1" } );
+ stateBlock = $( document.createElement( 'span' ) ).text( statement ).attr( "aria-hidden", "true" );
+ numBlock = $( document.createElement( 'span' ) ).text( blocks.length - lastIndex - 1 ).attr( "aria-label", "and" ).css( "visibility", "hidden" );
+ tempBlock.append( stateBlock );
+ tempBlock.append( numBlock );
+ $( blocks[lastIndex] ).after( tempBlock );
+ }
- // initialise sliders with our own slider
- $( document ).bind( "pagecreate create", function ( e ) {
- var jqmSliderInitSelector = $.data( window, "jqmSliderInitSelector" );
- $( e.target ).find(jqmSliderInitSelector).not('select').tizenslider();
- $( e.target ).find(jqmSliderInitSelector).filter('select').slider();
+ // update focus state
+ this._focusStatus = "focusOut";
+ $view.removeClass( "ui-tokentextarea-focusin" ).addClass( "ui-tokentextarea-focusout" ).attr( "tabindex", 0 );
+ },
+
+ inputText : function ( message ) {
+ var $view = this.element;
+
+ if ( arguments.length === 0 ) {
+ return $view.find( ".ui-tokentextarea-input" ).val();
+ }
+ $view.find( ".ui-tokentextarea-input" ).val( message );
+ return message;
+ },
+
+ select : function ( index ) {
+ var $view = this.element,
+ lockBlock = null,
+ blocks = null;
+
+ if ( this._focusStatus === "focusOut" ) {
+ return;
+ }
+
+ if ( arguments.length === 0 ) {
+ // return a selected block.
+ lockBlock = $view.find( "div.ui-tokentextarea-sblock" );
+ if ( lockBlock ) {
+ return lockBlock.text();
+ }
+ return null;
+ }
+ // 1. unlock all blocks.
+ this._unlockTextBlock();
+ // 2. select pointed block.
+ blocks = $view.find( "div" );
+ if ( blocks.length > index ) {
+ $( blocks[index] ).removeClass( "ui-tokentextarea-block" ).addClass( "ui-tokentextarea-sblock" );
+ $view.trigger( "select" );
+ }
+ return null;
+ },
+
+ add : function ( message, position ) {
+ if ( this._focusStatus === "focusOut" ) {
+ return;
+ }
+
+ this._addTextBlock( message, position );
+ },
+
+ remove : function ( position ) {
+ var self = this,
+ $view = this.element,
+ blocks = $view.find( "div" ),
+ index = 0,
+ _temp = null,
+ _dummy = function () {};
+
+ if ( this._focusStatus === "focusOut" ) {
+ return;
+ }
+
+ if ( arguments.length === 0 ) {
+ blocks.fadeOut( "fast", function () {
+ blocks.remove();
+ self._modifyInputBoxWidth();
+ self._trigger( "clear" );
+ });
+ } else if ( !isNaN( position ) ) {
+ // remove selected button
+ index = ( ( position < blocks.length ) ? position : ( blocks.length - 1 ) );
+
+ $( blocks[index] ).fadeOut( "fast", function () {
+ $( blocks[index] ).remove();
+ self._modifyInputBoxWidth();
+ });
+
+ this._eventRemoveCall = true;
+ if ( $view[0].remove ) {
+ _temp = $view[0].remove;
+ $view[0].remove = _dummy;
+ }
+ $view.triggerHandler( "remove" );
+ if ( _temp) {
+ $view[0].remove = _temp;
+ }
+ this._eventRemoveCall = false;
+ }
+ },
+
+ length : function () {
+ return this.element.find( "div" ).length;
+ },
+
+ refresh : function () {
+ var self = this,
+ $view = this.element;
+
+ self._viewWidth = $view.innerWidth();
+ self._resizeBlocks();
+ self._modifyInputBoxWidth();
+ },
+
+ destroy : function () {
+ var $view = this.element,
+ _temp = null,
+ _dummy = function () {};
+
+ if ( this._eventRemoveCall ) {
+ return;
+ }
+
+ $view.find( ".ui-tokentextarea-label" ).remove();
+ $view.find( "div" ).undelegate( "click" ).remove();
+ $view.find( "a" ).remove();
+ $view.find( ".ui-tokentextarea-input" ).unbind( "keyup" ).remove();
+
+ this._eventRemoveCall = true;
+ if ( $view[0].remove ) {
+ _temp = $view[0].remove;
+ $view[0].remove = _dummy;
+ }
+ $view.remove();
+ if ( _temp) {
+ $view[0].remove = _temp;
+ }
+ this._eventRemoveCall = false;
+
+ this._trigger( "destroy" );
+ }
});
-}( jQuery, this ));
+ $( document ).bind( "pagecreate create", function () {
+ $( ":jqmData(role='tokentextarea')" ).tokentextarea();
+ });
+
+ $( window ).bind( "resize", function () {
+ $( ":jqmData(role='tokentextarea')" ).tokentextarea( "refresh" );
+ });
+} ( jQuery, window, document ) );
+
+
+
/*
- * jQuery Mobile Widget @VERSION
*
* This software is licensed under the MIT licence (as defined by the OSI at
* http://www.opensource.org/licenses/mit-license.php)
- *
+ *
* ***************************************************************************
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
- * Copyright (c) 2011 by Intel Corporation Ltd.
- *
+ * Copyright (C) 2011 by Intel Corporation Ltd.
+ *
* Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
+ * copy of this software and associated documentation files (the "Software" ),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
+ *
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
* ***************************************************************************
- *
- * Authors: Kalyan Kondapally <kalyan.kondapally@intel.com>,
- * Elliot Smith <elliot.smith@intel.com>
- * Hyunjung Kim <hjnim.kim@samsung.com>
*/
-// Widget which turns a html element into a "swipe":
-// i.e. each list item has a sliding "cover" which can be swiped
-// to the right (to reveal buttons underneath) or left (to
-// cover the buttons again). Clicking on a button under a swipe
-// also moves the cover back to the left.
+// Base class for widgets that need the following features:
//
-// In this case, the cover is over a grid of buttons;
-// but it is should also be possible to use other types of markup under the
-// list items.
+// I. HTML prototype loading
//
-// WARNING: This doesn't work well inside a scrollview widget, as
-// the touch events currently interfere with each other badly (e.g.
-// a swipe will work but cause a scroll as well).
+// This class provides HTML prototype loading for widgets. That is, the widget implementation specifies its HTML portions
+// in one continuous HTML snippet, and it optionally provides an object containing selectors into the various parts of the
+// HTML snippet. This widget loads the HTML snippet into a jQuery object, and optionally assigns jQuery objects to each of
+// the selectors in the optionally provided object.
//
-// Theme: default is to use the theme on the target element,
-// theme passed in options, parent theme, or 'c' if none of the above.
-// If list items are themed individually, the cover will pick up the
-// theme of the list item which is its parent.
+// To use this functionality you can either derive from this class, or you can call its prototype's gtype method.
//
+// 1. Widgets deriving from this class should define _htmlProto as part of their prototype declaration. _htmlProto looks like
+// this:
+//
+// _htmlProto: {
+// source: string|jQuery object (optional) default: string - The name of the widget
+// ui: {
+// uiElement1: "#ui-element-1-selector",
+// uiElement2: "#ui-element-2-selector",
+// ...
+// subElement: {
+// subElement1: "#sub-element-1-selector",
+// subElement2: "#sub-element-2-selector",
+// ...
+// }
+// ...
+// }
+// }
+//
+// If neither 'source' nor 'ui' are defined, you must still include an empty _htmlProto key (_htmlProto: {}) to indicate
+// that you wish to make use of this feature. This will cause a prototype HTML file named after your widget to be loaded.
+// The loaded prototype will be placed into your widget's prototype's _protoHtml.source key.
+//
+// If 'source' is defined as a string, it is the name of the widget (including namespace). This is the default. If your
+// widget's HTML prototype is loaded via AJAX and the name of the AJAX file is different from the name of your widget
+// (that is, it is not "<widgetName>.prototype.html", then you should explicitly define 'source' as:
+//
+// If you wish to load HTML prototypes via AJAX, modify the getProtoPath() function defined below to reflect the directory
+// structure holding your widget HTML prototypes.
+//
+// source: "alternateWidgetName"
+//
+// If AJAX loading fails, source is set to a jQuery object containing a div with an error message. You can check whether
+// loading failed via the jQuery object's jqmData( "tizen.widgetex.ajax.fail" ) data item. If false, then the jQuery object
+// is the actual prototype loaded via AJAX or present inline. Otherwise, the jQuery object is the error message div.
+//
+// If 'source' is defined as a jQuery object, it is considered already loaded.
+//
+// if 'ui' is defined inside _htmlProto, It is assumed to be an object such that every one of its keys is either a string,
+// or another object with the same properties as itself.
+//
+// When a widget is instantiated, the HTML prototype is loaded if not already present in the prototype. If 'ui' is present
+// inside _htmlProto, the prototype is cloned. Then, a new structure is created based on 'ui' with each selector replaced
+// by a jQuery object containing the results of performing .find() on the prototype's clone with the filter set to the
+// value of the string. In the special case where the selector starts with a '#', the ID is removed from the element after
+// it is assigned into the structure being created. This structure is then made accessible from the widget instance via
+// the '_ui' key (i.e., this._ui).
+//
+// 2. Use the loadPrototype method when your widget does not derive from $.tizen.widgetex:
+// Add _htmlProto to your widget's prototype as described above. Then, in your widget's _create() method, call
+// loadPrototype in the following manner:
+//
+// $.tizen.widgetex.loadPrototype.call(this, "namespace.widgetName" );
+//
+// Thereafter, you may use the HTML prototype from your widget's prototype or, if you have specified a 'ui' key in your
+// _htmlProto key, you may use this._ui from your widget instance.
+//
+// II. realize method
+//
+// When a widget is created, some of its properties cannot be set immediately, because they depend on the widths/heights
+// of its constituent elements. They can only be calculated when the page containing the widget is made visible via the
+// "pageshow" event, because widths/heights always evaluate to 0 when retrieved from a widget that is not visible. When
+// you inherit from widgetex, you can add a "_realize" function to your prototype. This function will be called once right
+// after _create() if the element that anchors your widget is on a visible page. Otherwise, it will be called when the
+// page to which the widget belongs emits the "pageshow" event.
+//
+// NB: If your widget is inside a container which is itself not visible, such as an expandable or a collapsible, your
+// widget will remain hidden even though "pageshow" is fired and therefore _realize is called. In this case, widths and
+// heights will be unreliable even during _realize.
+//
+// III. systematic option handling
+//
+// If a widget has lots of options, the _setOption function can become a long switch for setting each recognized option.
+// It is also tempting to allow options to determine the way a widget is created, by basing decisions on various options
+// during _create(). Often, the actions based on option values in _create() are the same as those in _setOption. To avoid
+// such code duplication, this class calls _setOption once for each option after _create() has completed.
+//
+// Furthermore, to avoid writing long switches in a widget's _setOption method, this class implements _setOption in such
+// a way that, for any given option (e.g. "myOption" ), _setOption looks for a method _setMyOption in the widget's
+// implementation, and if found, calls the method with the value of the option.
+//
+// If your widget does not inherit from widgetex, you can still use widgetex' systematic option handling:
+// 1. define the _setOption method for your widget as follows:
+// _setOption: $.tizen.widgetex.prototype._setOption
+// 2. Call this._setOptions(this.options) from your widget's _create() function.
+// 3. As with widgetex-derived widgets, implement a corresponding _setMyOptionName function for each option myOptionName
+// you wish to handle.
+//
+// IV. systematic value handling for input elements
+//
+// If your widget happens to be constructed from an <input> element, you have to handle the "value" attribute specially,
+// and you have to emit the "change" signal whenever it changes, in addition to your widget's normal signals and option
+// changes. With widgetex, you can assign one of your widget's "data-*" properties to be synchronized to the "value"
+// property whenever your widget is constructed onto an <input> element. To do this, define, in your prototype:
+//
+// _value: {
+// attr: "data-my-attribute",
+// signal: "signal-to-emit"
+// }
+//
+// Then, call this._setValue(newValue) whenever you wish to set the value for your widget. This will set the data-*
+// attribute, emit the custom signal (if set) with the new value as its parameter, and, if the widget is based on an
+// <input> element, it will also set the "value" attribute and emit the "change" signal.
+//
+// "attr" is required if you choose to define "_value", and identifies the data-attribute to set in addition to "value",
+// if your widget's element is an input.
+// "signal" is optional, and will be emitted when setting the data-attribute via this._setValue(newValue).
+//
+// If your widget does not derive from widgetex, you can still define "_value" as described above and call
+// $.tizen.widgetex.setValue(widget, newValue).
+//
+// V. Systematic enabled/disabled handling for input elements
+//
+// widgetex implements _setDisabled which will disable the input associated with this widget, if any. Thus, if you derive
+// from widgetex and you plan on implementing the disabled state, you should chain up to
+// $.tizen.widgetex.prototype._setDisabled(value), rather than $.Widget.prototype._setOption( "disabled", value).
-/**
- @class Swipe
- The swipe widget shows a view on the screen where the items can be swiped vertically to show a menu.
- To add a swipe widget to the application, use the following code:
-
- <ul data-role="listview">
- <li data-role="swipe">
- <div data-role="swipe-cover">
- <div data-role="button" data-inline="true">OK</div>
- <div data-role="button" data-inline="true">Cancel</div>
- </div>
- <div data-role="swipe-item-cover">
- <p>This is a swipe item cover.<br>
- This will be swiped out when swipe event comes.</p>
- </div>
- </li>
- </ul>
-
- You can use methods with the swipe as described in the jQueryMobile documentation for view methods.
-*/
-/**
- @property {String} data-role
- Creates a swipe using the HTML unordered view (>ul<) element.
- The default value is swipe.
-
- Creates a swipe item cover using an HTML $gt;div$lt; element. This cover can be swiped to show the content beneath it.
- The default value is swipe-item-cover.
-*/
-/**
- @method open
- uncover swipe item
-*/
-/**
- @method close
- cover swipe item
-*/
-/**
- @method opened
- return coveritem status( coverd or uncovred )
-*/
-/**
- @event animationstart
- The swipe can define a callback for the animationstart event, which is fired after a item is swipe and the swipe animation is start:
-*/
-/**
- @event animationend
- The swipe can define a callback for the animationend event, which is fired after a item is swiped and the swipe animation is complete:
-
- <ul data-role="listview">
- <li data-role="swipe">
- <div data-role="swipe-cover">
- <div data-role="button" data-inline="true">OK</div>
- <div data-role="button" data-inline="true">Cancel</div>
- </div>
- <div data-role="swipe-item-cover" id="foo">
- <p>This is a swipe item cover.<br>
- This will be swiped out when swipe event comes.</p>
- </div>
- </li>
- </ul>
- $("#foo").bind("animationend", function (ev)
- {
- Console.log("Swipe cover's animation is complete.");
- });
-*/
-(function ($) {
-
- $.widget("tizen.swipe", $.mobile.widget, {
- options: {
- theme: null
- },
-
- _create: function () {
- // use the theme set on the element, set in options,
- // the parent theme, or 'c' (in that order of preference)
- var theme = this.element.jqmData('theme') ||
- this.options.theme ||
- this.element.parent().jqmData('theme') ||
- 's';
-
- this.options.theme = theme;
- this._isopen = false;
- this.refresh();
- },
-
- refresh: function () {
- this._cleanupDom();
-
- var self = this,
- defaultCoverTheme,
- covers,
- coverTheme,
- item,
- itemHasThemeClass;
-
- defaultCoverTheme = 'ui-body-' + this.options.theme;
-
- if ( !this.element.parent().hasClass('ui-listview') ) {
- this.element.parent().listview();
- }
- this.element.addClass('ui-swipe');
-
- // get the item covers
- covers = this.element.find(':jqmData(role="swipe-item-cover")');
- item = this.element.find(':jqmData(role="swipe-item")');
+(function ($, undefined) {
- this._covers = covers;
- this._item = item;
- item.addClass('ui-swipe-item');
- coverTheme = defaultCoverTheme;
- itemHasThemeClass = item.parent().attr('class')
- .match(/ui\-body\-[a-z]|ui\-bar\-[a-z]/);
+// Framework-specific HTML prototype path for AJAX loads
+ function getProtoPath() {
+ var theScriptTag = $( "script[data-framework-version][data-framework-root][data-framework-theme]" );
- covers.each( function () {
- var cover = $( this );
+ return (theScriptTag.attr( "data-framework-root" ) + "/" +
+ theScriptTag.attr( "data-framework-version" ) + "/themes/" +
+ theScriptTag.attr( "data-framework-theme" ) + "/proto-html" );
+ }
- if ( itemHasThemeClass ) {
- coverTheme = itemHasThemeClass[0];
- }
+ $.widget( "tizen.widgetex", $.mobile.widget, {
+ _createWidget: function () {
+ $.tizen.widgetex.loadPrototype.call( this, this.namespace + "." + this.widgetName );
+ $.mobile.widget.prototype._createWidget.apply( this, arguments );
+ },
- cover.addClass('ui-swipe-item-cover');
- cover.addClass( coverTheme );
+ _init: function () {
+ // TODO THIS IS TEMPORARY PATCH TO AVOID CTXPOPUP PAGE CRASH
+ if ( this.element === undefined ) {
+ return;
+ }
- if ( cover.has('.ui-swipe-item-cover-inner').length === 0 ) {
- cover.wrapInner( $('<span/>').addClass('ui-swipe-item-cover-inner') );
- }
+ var page = this.element.closest( ".ui-page" ),
+ self = this,
+ myOptions = {};
- if ( !( cover.data('animateRight') && cover.data('animateLeft') ) ) {
- cover.data('animateRight', function () {
- self._animateCover( cover, 110, item );
- });
+ if ( page.is( ":visible" ) ) {
+ this._realize();
+ } else {
+ page.bind( "pageshow", function () { self._realize(); } );
+ }
- cover.data('animateLeft', function () {
- self._animateCover( cover, 0, item );
- });
- }
+ $.extend( myOptions, this.options );
- // bind to synthetic events
- item.bind( 'swipeleft', cover.data('animateLeft') );
- cover.bind( 'swiperight', cover.data('animateRight') );
- item.find( '.ui-btn' ).bind( 'vclick', cover.data('animateLeft') );
- } );
+ this.options = {};
+ this._setOptions( myOptions );
},
- _cleanupDom: function () {
- var self = this,
- defaultCoverTheme,
- cover,
- coverTheme = defaultCoverTheme,
- item,
- itemClass,
- itemHasThemeClass,
- text,
- wrapper;
+ _getCreateOptions: function () {
+ // if we're dealing with an <input> element, value takes precedence over corresponding data-* attribute, if a
+ // mapping has been established via this._value. So, assign the value to the data-* attribute, so that it may
+ // then be assigned to this.options in the superclass' _getCreateOptions
- defaultCoverTheme = 'ui-body-' + this.options.theme;
+ if (this.element.is( "input" ) && this._value !== undefined) {
+ var theValue =
+ ( ( this.element.attr( "type" ) === "checkbox" || this.element.attr( "type" ) === "radio" )
+ ? this.element.is( ":checked" )
+ : this.element.is( "[value]" )
+ ? this.element.attr( "value" )
+ : undefined);
- this.element.removeClass('ui-swipe');
+ if ( theValue != undefined ) {
+ this.element.attr( this._value.attr, theValue );
+ }
+ }
- // get the item covers
- cover = this.element.find(':jqmData(role="swipe-item-cover")');
- item = this.element.find(':jqmData(role="swipe-item")');
+ return $.mobile.widget.prototype._getCreateOptions.apply( this, arguments );
+ },
- item.removeClass('ui-swipe-item');
- cover.removeClass('ui-swipe-item-cover');
+ _setOption: function ( key, value ) {
+ var setter = "_set" + key.replace(/^[a-z]/, function (c) { return c.toUpperCase(); } );
- itemClass = item.attr('class');
- itemHasThemeClass = itemClass &&
- itemClass.match(/ui\-body\-[a-z]|ui\-bar\-[a-z]/);
+ if ( this[setter] !== undefined ) {
+ this[setter]( value );
+ } else {
+ $.mobile.widget.prototype._setOption.apply( this, arguments );
+ }
+ },
- if ( itemHasThemeClass ) {
- coverTheme = itemHasThemeClass[0];
+ _setDisabled: function ( value ) {
+ $.Widget.prototype._setOption.call( this, "disabled", value );
+ if ( this.element.is( "input" ) ) {
+ this.element.attr( "disabled", value );
}
+ },
- cover.removeClass(coverTheme);
+ _setValue: function ( newValue ) {
+ $.tizen.widgetex.setValue( this, newValue );
+ },
- // remove wrapper HTML
- wrapper = cover.find('.ui-swipe-item-cover-inner');
- wrapper.children().unwrap();
- text = wrapper.text();
+ _realize: function () {}
+ } );
- if ( text ) {
- cover.append( text );
- wrapper.remove();
- }
+ $.tizen.widgetex.setValue = function ( widget, newValue ) {
+ if ( widget._value !== undefined ) {
+ var valueString = ( widget._value.makeString ? widget._value.makeString(newValue) : newValue ),
+ inputType;
- // unbind swipe events
- if ( cover.data('animateRight') && cover.data('animateLeft') ) {
- cover.unbind( 'swiperight', cover.data('animateRight') );
- item.unbind( 'swipeleft', cover.data('animateLeft') );
+ widget.element.attr( widget._value.attr, valueString );
+ if ( widget._value.signal !== undefined ) {
+ widget.element.triggerHandler( widget._value.signal, newValue );
+ }
- // unbind clicks on buttons inside the item
- item.find('.ui-btn').unbind( 'vclick', cover.data('animateLeft') );
-
- cover.data( 'animateRight', null );
- cover.data( 'animateLeft', null );
- }
- },
-
- // NB I tried to use CSS animations for this, but the performance
- // and appearance was terrible on Android 2.2 browser;
- // so I reverted to jQuery animations
- //
- // once the cover animation is done, the cover emits an
- // animationComplete event
- _animateCover: function ( cover, leftPercentage, item ) {
- var self = this,
- animationOptions = {
- easing: 'linear',
- duration: 'normal',
- queue: true,
- complete: function () {
- cover.trigger('animationend');
- }
- };
+ if ( widget.element.is( "input" ) ) {
+ inputType = widget.element.attr( "type" );
- $( this.element.parent() )
- .find(":jqmData(role='swipe')")
- .each(
- function () {
- if ( this !== self.element.get(0) &&
- $( this ).swipe("opened") ) {
- $( this ).swipe("close");
- }
+ // Special handling for checkboxes and radio buttons, where the presence of the "checked" attribute is really
+ // the value
+ if ( inputType === "checkbox" || inputType === "radio" ) {
+ if ( newValue ) {
+ widget.element.attr( "checked", true );
+ } else {
+ widget.element.removeAttr( "checked" );
}
- );
+ } else {
+ widget.element.attr( "value", valueString );
+ }
- if ( leftPercentage == 110 ) {
- this._isopen = true;
- } else {
- this._isopen = false;
+ widget.element.trigger( "change" );
}
+ }
+ };
- cover.stop();
- cover.clearQueue();
- cover.trigger('animationstart');
- cover.animate( { left: leftPercentage + '%' }, animationOptions );
- if ( leftPercentage == 0 ) {
- item.animate({ opacity: 0 }, "slow");
+ $.tizen.widgetex.assignElements = function (proto, obj) {
+ var ret = {},
+ key;
+
+ for ( key in obj ) {
+ if ( ( typeof obj[key] ) === "string" ) {
+ ret[key] = proto.find( obj[key] );
+ if ( obj[key].match(/^#/) ) {
+ ret[key].removeAttr( "id" );
+ }
} else {
- item.animate({ opacity: 1 }, "slow");
+ if ( (typeof obj[key]) === "object" ) {
+ ret[key] = $.tizen.widgetex.assignElements( proto, obj[key] );
+ }
}
+ }
- },
+ return ret;
+ };
- destroy: function () {
- this._cleanupDom();
- },
+ $.tizen.widgetex.loadPrototype = function ( widget, ui ) {
+ var ar = widget.split( "." ),
+ namespace,
+ widgetName,
+ source,
+ noSource = false,
+ htmlProto,
+ protoPath;
- open: function () {
- var self = this;
+ if ( ar.length == 2 ) {
+ namespace = ar[0];
+ widgetName = ar[1];
- $( self._covers ).each( function () {
- var cover = $( this );
- self._animateCover( cover, 110, self._item);
- } );
- },
+ // If htmlProto is defined
+ if ( $[namespace][widgetName].prototype._htmlProto !== undefined ) {
+ // If no source is defined, use the widget name
+ source = $[namespace][widgetName].prototype._htmlProto.source;
+ if ( source === undefined ) {
+ source = widgetName;
+ noSource = true;
+ }
- opened: function () {
- return this._isopen;
- },
+ // Load the HTML prototype via AJAX if not defined inline
+ if ( typeof source === "string" ) {
+ if ( noSource ) { // use external htmlproto file
+ // Establish the path for the proto file
+ widget = source;
+ protoPath = getProtoPath();
- close: function () {
- var self = this;
+ // Make the AJAX call
+ $.ajax( {
+ url: protoPath + "/" + widget + ".prototype.html",
+ async: false,
+ dataType: "html"
+ }).success( function (data, textStatus, jqXHR ) {
+ source = $( "<div></div>" ).html(data).jqmData( "tizen.widgetex.ajax.fail", false );
+ } );
- $( self._covers ).each( function () {
- var cover = $( this );
- self._animateCover( cover, 0, self._item);
- } );
+ // Assign the HTML proto to the widget prototype
+ source = $( "<div></div>" )
+ .text( "Failed to load proto for widget " + namespace + "." + widgetName + "!" )
+ .css( {background: "red", color: "blue", border: "1px solid black"} )
+ .jqmData( "tizen.widgetex.ajax.fail", true );
+
+ } else {
+ // inline definition (string)
+ source = $( source ).jqmData( "tizen.widgetex.ajax.fail", false );
+ }
+
+ } else {
+ // inline definition (object)
+ // AJAX loading has trivially succeeded, since there was no AJAX loading at all
+ source.jqmData( "tizen.widgetex.ajax.fail", false );
+ }
+ htmlProto = source;
+ $[namespace][widgetName].prototype._htmlProto.source = source;
+
+ // If there's a "ui" portion in the HTML proto, copy it over to this instance, and
+ // replace the selectors with the selected elements from a copy of the HTML prototype
+ if ( $[namespace][widgetName].prototype._htmlProto.ui !== undefined ) {
+ // Assign the relevant parts of the proto
+ $.extend( this, {
+ _ui: $.tizen.widgetex.assignElements( htmlProto.clone(), $[namespace][widgetName].prototype._htmlProto.ui )
+ });
+ }
+ }
}
+ };
- });
+}( jQuery ) );
- $( document ).bind("pagecreate", function ( e ) {
- $( e.target ).find(":jqmData(role='swipe')").swipe();
- });
-}( jQuery ));
-/* ***************************************************************************
+
+/*
+ * jQuery Mobile Widget @VERSION
+ *
+ * This software is licensed under the MIT licence (as defined by the OSI at
+ * http://www.opensource.org/licenses/mit-license.php)
+ *
+ * ***************************************************************************
* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2011 by Intel Corporation Ltd.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* DEALINGS IN THE SOFTWARE.
* ***************************************************************************
*
- * jQuery Mobile Framework : "tabbar" plugin
- * Copyright (c) jQuery Project
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- * Authors: Jinhyuk Jun <jinhyuk.jun@samsung.com>
-*/
+ * Authors: Max Waterman <max.waterman@intel.com>
+ * Authors: Minkyu Kang <mk7.kang@samsung.com>
+ */
/**
- * Tabbar can be created using data-role = "tabbar" inside footer
- * Framework determine which tabbar will display with tabbar attribute
+ * tizenslider modifies the JQuery Mobile slider and is created in the same way.
+ *
+ * See the JQuery Mobile slider widget for more information :
+ * http://jquerymobile.com/demos/1.0a4.1/docs/forms/forms-slider.html
+ *
+ * The JQuery Mobile slider option:
+ * theme: specify the theme using the 'data-theme' attribute
+ *
+ * Options:
+ * theme: string; the theme to use if none is specified using the 'data-theme' attribute
+ * default: 'c'
+ * popup: boolean; controls whether the popup is displayed or not
+ * specify if the popup is enabled using the 'data-popup' attribute
+ * set from javascript using .tizenslider('option','popup',newValue)
+ *
+ * Events:
+ * changed: triggers when the value is changed (rather than when the handle is moved)
*
* Examples:
- *
- * HTML markup for creating tabbar: ( 2 ~ 5 li item available )
- * icon can be changed data-icon attribute (customized icon need)
- * <div data-role="footer" data-position ="fixed">
- * <div data-role="tabbar">
- * <ul>
- * <li><a href="#" class="ui-btn-active">Menu</a></li>
- * <li><a href="#">Save</a></li>
- * <li><a href="#">Share</a></li>
- * </ul>
- * </div>
- * </div>
-*/
+ *
+ * <a href="#" id="popupEnabler" data-role="button" data-inline="true">Enable popup</a>
+ * <a href="#" id="popupDisabler" data-role="button" data-inline="true">Disable popup</a>
+ * <div data-role="fieldcontain">
+ * <input id="mySlider" data-theme='a' data-popup='false' type="range" name="slider" value="7" min="0" max="9" />
+ * </div>
+ * <div data-role="fieldcontain">
+ * <input id="mySlider2" type="range" name="slider" value="77" min="0" max="777" />
+ * </div>
+ *
+ * // disable popup from javascript
+ * $('#mySlider').tizenslider('option','popup',false);
+ *
+ * // from buttons
+ * $('#popupEnabler').bind('vclick', function() {
+ * $('#mySlider').tizenslider('option','popup',true);
+ * });
+ * $('#popupDisabler').bind('vclick', function() {
+ * $('#mySlider').tizenslider('option','popup',false);
+ * });
+ */
-(function ( $, undefined ) {
+/**
+ @class Slider
+ The slider widget shows a control on the screen that you can use to change values by dragging a handle on a horizontal scale. Sliders can be used in Tizen as described in the jQueryMobile documentation for sliders.
- $.widget( "tizen.tabbar", $.mobile.widget, {
- options: {
- iconpos: "top",
- grid: null,
- defaultList : 4,
- initSelector: ":jqmData(role='tabbar')"
- },
+ To add a slider widget to the application, use the following code:
- _create: function () {
+ <input data-popup='false' type="range" name="slider" value="5" min="0" max="10" data-icon="text" data-text-left="Min" data-text-right="Max" />
- var $tabbar = this.element,
- $tabbtns,
- textpos,
- iconpos,
- theme = $.mobile.listview.prototype.options.theme, /* Get current theme */
- ww = window.innerWidth || $( window ).width(),
- wh = window.innerHeight || $( window ).height(),
- tabbarDividerLeft = "<div class='ui-tabbar-divider ui-tabbar-divider-left'></div>",
- tabbarDividerRight = "<div class='ui-tabbar-divider ui-tabbar-divider-right'></div>",
- isScrollingStart = false,
- isScrollingEnd = false,
- isLandscape;
+ The slider can define callbacks for events as described in the jQueryMobile documentation for slider events.
+ You can use methods with the slider as described in the jQueryMobile documentation for slider methods.
+*/
+/**
+ @property {String} data-icon
+ Defines the icon style for the slider ends. The icon options are bright, volume, and text.
+ The default value is text.
+*/
+/**
+ @property {Boolean} data-popup
+ Enables or disables a pop-up showing the current value while the handle is dragged.
+ The default value is true.
+*/
+/**
+ @property {String} data-text-left
+ Defines the text displayed on the left side of the slider.
+ The data-icon option must be set to text.
+*/
+/**
+ @property {String} data-text-right
+ Defines the text displayed on the right side of the slider.
+ The data-icon option must be set to text.
+*/
- isLandscape = ww > wh && ( ww - wh );
+(function ($, window, undefined) {
+ $.widget("tizen.tizenslider", $.mobile.widget, {
+ options: {
+ popup: true
+ },
- if ( isLandscape ) {
- $tabbar.removeClass( "ui-portrait-tabbar" ).addClass( "ui-landscape-tabbar" );
- } else {
- $tabbar.removeClass( "ui-landscape-tabbar" ).addClass( "ui-portrait-tabbar" );
- }
+ popup: null,
+ handle: null,
+ handleText: null,
- if ( $tabbar.find( "a" ).length ) {
- $tabbtns = $tabbar.find( "a" );
- iconpos = $tabbtns.filter( ":jqmData(icon)" ).length ? this.options.iconpos : undefined;
- textpos = $tabbtns.html().length ? true : false;
- }
+ _create: function () {
+ this.currentValue = null;
+ this.popupVisible = false;
- if ( $tabbar.parents( ".ui-header" ).length && $tabbar.parents( ".ui-scrollview-view" ).length ) {
- $tabbar.find( "li" ).addClass( "tabbar-scroll-li" );
- $tabbar.find( "ul" ).addClass( "tabbar-scroll-ul" );
+ var self = this,
+ inputElement = $( this.element ),
+ slider,
+ handle_press,
+ popupEnabledAttr,
+ icon,
+ text_right,
+ text_left,
+ text_length,
+ elem_left,
+ elem_right,
+ margin_left,
+ margin_right;
- /* add shadow divider */
- $( tabbarDividerLeft ).appendTo( $tabbar.parents( ".ui-scrollview-clip" ) );
- $( tabbarDividerRight ).appendTo( $tabbar.parents( ".ui-scrollview-clip" ) );
+ // apply jqm slider
+ inputElement.slider();
- $( ".ui-tabbar-divider-left" ).hide();
- $( ".ui-tabbar-divider-right" ).hide();
+ // hide the slider input element proper
+ inputElement.hide();
- /* add width calculation*/
- if ( $tabbar.parents( ".ui-scrollview-view" ).data("default-list") ) {
- this.options.defaultList = $tabbar.parents( ".ui-scrollview-view" ).data( "default-list" );
- }
- $tabbar.find( "li" ).css( "width", window.innerWidth / this.options.defaultList + "px" );
- } else {
- if ( $tabbar.find( "ul" ).children().length ) {
- $tabbar.addClass( "ui-navbar" )
- .find( "ul" )
- .grid( { grid: this.options.grid } );
- }
- }
+ self.popup = $('<div class="ui-slider-popup"></div>');
- if ( $tabbar.parents( ".ui-footer" ).length ) {
- $tabbar.find( "li" ).addClass( "ui-tab-btn-style" );
+ // set the popup according to the html attribute
+ popupEnabledAttr = inputElement.jqmData('popup');
+ if ( popupEnabledAttr !== undefined ) {
+ self.options.popup = ( popupEnabledAttr == true );
}
- /* title tabbar */
- if ( $tabbar.siblings( ".ui-title" ).length ) {
- $tabbar.parents( ".ui-header" ).addClass( "ui-title-tabbar" );
- }
+ // get the actual slider added by jqm
+ slider = inputElement.next('.ui-slider');
- if ( !iconpos ) {
- $tabbar.addClass( "ui-tabbar-noicons" );
- }
- if ( !textpos ) {
- $tabbar.addClass( "ui-tabbar-notext" );
- }
- if ( textpos && iconpos ) {
- $tabbar.parents( ".ui-header" ).addClass( "ui-title-tabbar-multiline" );
+ icon = inputElement.attr('data-icon');
+
+ // wrap the background
+ slider.wrap('<div class="ui-slider-container"></div>');
+
+ // get the handle
+ self.handle = slider.find('.ui-slider-handle');
+
+ // remove the rounded corners from the slider and its children
+ slider.removeClass('ui-btn-corner-all');
+ slider.find('*').removeClass('ui-btn-corner-all');
+
+ // add icon
+ switch ( icon ) {
+ case 'bright':
+ case 'volume':
+ elem_left = $('<div class="ui-slider-left-' + icon + '"></div>');
+ elem_right = $('<div class="ui-slider-right-' + icon + '"></div>');
+
+ slider.before( elem_left );
+ slider.after( elem_right );
+
+ margin_left = elem_left.width() + 16;
+ margin_right = elem_right.width() + 16;
+ break;
+
+ case 'text':
+ text_left = ( inputElement.attr('data-text-left') === undefined ) ? '' :
+ inputElement.attr('data-text-left').substring( 0, 3 );
+ text_right = ( inputElement.attr('data-text-right') === undefined ) ? '' :
+ inputElement.attr('data-text-right').substring( 0, 3 );
+
+ text_length = Math.max( text_left.length, text_right.length ) + 1;
+
+ margin_left = text_length + "rem";
+ margin_right = text_length + "rem";
+
+ elem_left = $('<div class="ui-slider-left-text" style="left:' +
+ -( text_length ) + 'rem; width:' + text_length + 'rem;">' +
+ '<span style="position:relative;top:0.4em;">' +
+ text_left +
+ '</span></div>');
+ elem_right = $('<div class="ui-slider-right-text" style="right:' +
+ -( text_length ) + 'rem; width:' + text_length + 'rem;">' +
+ '<span style="position:relative;top:0.4em;">' +
+ text_right +
+ '</span></div>');
+
+ slider.before( elem_left );
+ slider.after( elem_right );
+ break;
}
- if ( $tabbar.find( "a" ).length ) {
- $tabbtns.buttonMarkup({
- corners: false,
- shadow: false,
- iconpos: iconpos
+ if ( icon ) {
+ slider.parent('.ui-slider-container').css({
+ "margin-left": margin_left,
+ "margin-right": margin_right
});
}
- if ( $tabbar.find( ".ui-state-persist" ).length ) {
- $tabbar.addClass( "ui-tabbar-persist" );
- }
+ // handle press
+ slider.append($('<div class="ui-slider-handle-press"></div>'));
+ self.handle_press = slider.find('.ui-slider-handle-press');
+ self.handle_press.css('display', 'none');
- $tabbar.delegate( "a", "vclick", function ( event ) {
- $tabbtns.not( ".ui-state-persist" ).removeClass( $.mobile.activeBtnClass );
- $( this ).addClass( $.mobile.activeBtnClass );
- });
+ // add a popup element (hidden initially)
+ slider.parents(".ui-page").append( self.popup );
+ self.popup.hide();
- $tabbar.addClass( "ui-tabbar");
+ // get the element where value can be displayed
+ self.handleText = slider.find('.ui-btn-text');
- $( document ).bind( "pagebeforeshow", function ( event, ui ) {
- var footer_filter = $( event.target ).find( ":jqmData(role='footer')" ),
- tabbar_filter = footer_filter.find( ":jqmData(role='tabbar')" ),
- $elFooterMore = tabbar_filter.siblings( ":jqmData(icon='naviframe-more')" ),
- $elFooterBack = tabbar_filter.siblings( ".ui-btn-back" );
+ // set initial value
+ self.updateSlider();
- footer_filter
- .css( "position", "fixed" )
- .css( "bottom", 0 )
- .css( "height", tabbar_filter.height() );
- if ( $elFooterMore.length ) {
- tabbar_filter.addClass( "ui-tabbar-margin-more" );
- }
- if ( $elFooterBack.length ) {
- tabbar_filter.addClass( "ui-tabbar-margin-back" );
- }
+ // bind to changes in the slider's value to update handle text
+ this.element.bind('change', function () {
+ self.updateSlider();
+ });
- isScrollingStart = false;
+ // bind clicks on the handle to show the popup
+ self.handle.bind('vmousedown', function () {
+ self.showPopup();
});
- $( window ).bind( "tabbar.scrollstart", function ( e ) {
- if ( $( e.target ).find( ".ui-tabbar" ).length ) {
- isScrollingStart = true;
- isScrollingEnd = false;
- }
+ // watch events on the document to turn off the slider popup
+ slider.add( document ).bind('vmouseup', function () {
+ self.hidePopup();
});
+ },
- $( window ).bind( "tabbar.scrollstop", function ( e ) {
- var $tabbarScrollview = $( e.target ),
- $minElement = $tabbar.find( "li" ).eq( 0 ),
- minElementIndexVal = Math.abs( $tabbar.find( "li" ).eq( 0 ).offset().left ),
- minElementIndex = -1;
+ _handle_press_show: function () {
+ this.handle_press.css('display', '');
+ },
- isScrollingEnd = true;
- if ( $( e.target ).find( ".ui-tabbar" ).length && isScrollingStart == true ) {
- $tabbar.find( "li" ).each( function ( i ) {
- var offset = $tabbar.find( "li" ).eq( i ).offset();
- if ( Math.abs( offset.left ) < minElementIndexVal ) {
- minElementIndexVal = Math.abs( offset.left );
- minElementIndex = i;
- $minElement = $tabbar.find( "li" ).eq( i );
- }
- });
+ _handle_press_hide: function () {
+ this.handle_press.css('display', 'none');
+ },
- if ( $tabbarScrollview.length && isScrollingStart == isScrollingEnd && minElementIndex != -1) {
- isScrollingStart = false;
- $tabbarScrollview.scrollview( "scrollTo", -( window.innerWidth / $( e.target ).find( ".ui-tabbar" ).data( "defaultList" ) * minElementIndex ) , 0, 357);
- }
- }
+ // position the popup
+ positionPopup: function () {
+ var dstOffset = this.handle.offset();
- $( ".ui-tabbar-divider-left" ).hide();
- $( ".ui-tabbar-divider-right" ).hide();
+ this.popup.offset({
+ left: dstOffset.left + ( this.handle.width() - this.popup.width() ) / 2,
+ top: dstOffset.top - this.popup.height()
});
- $tabbar.bind( "touchstart vmousedown", function ( e ) {
- var $tabbarScroll = $( e.target ).parents( ".ui-scrollview-view" );
- if ( $tabbarScroll.offset() ) {
- if ( $tabbarScroll.offset().left < 0 ) {
- $( ".ui-tabbar-divider-left" ).show();
- } else {
- $( ".ui-tabbar-divider-left" ).hide();
- }
- if ( ( $tabbarScroll.width() - $tabbarScroll.parents( ".ui-scrollview-clip" ).width() ) == Math.abs( $tabbarScroll.offset().left ) ) {
- $( ".ui-tabbar-divider-right" ).hide();
- } else {
- $( ".ui-tabbar-divider-right" ).show();
- }
- }
+ this.handle_press.offset({
+ left: dstOffset.left,
+ top: dstOffset.top
});
+ },
- this._bindTabbarEvents();
- },
+ // show value on the handle and in popup
+ updateSlider: function () {
+ var font_size,
+ font_length,
+ font_top,
+ padding_size,
+ newValue,
+ get_value_length = function ( v ) {
+ var val = Math.abs( v ),
+ len;
- _bindTabbarEvents: function () {
- var $tabbar = this.element;
+ if ( val > 999 ) {
+ len = 4;
+ } else if ( val > 99 ) {
+ len = 3;
+ } else if ( val > 9 ) {
+ len = 2;
+ } else {
+ len = 1;
+ }
- $( window ).bind( "orientationchange", function ( e, ui ) {
- var ww = window.innerWidth || $( window ).width(),
- wh = window.innerHeight || $( window ).height(),
- isLandscape = ww > wh && ( ww - wh );
+ if ( v < 0 ) {
+ len++;
+ }
- if ( isLandscape ) {
- $tabbar.removeClass( "ui-portrait-tabbar" ).addClass( "ui-landscape-tabbar" );
- } else {
- $tabbar.removeClass( "ui-landscape-tabbar" ).addClass( "ui-portrait-tabbar" );
+ return len;
+ };
+
+ // remove the title attribute from the handle (which is
+ // responsible for the annoying tooltip); NB we have
+ // to do it here as the jqm slider sets it every time
+ // the slider's value changes :(
+ this.handle.removeAttr('title');
+
+ newValue = this.element.val();
+
+ font_length = get_value_length( newValue );
+
+ if ( this.popupVisible ) {
+ this.positionPopup();
+
+ switch ( font_length ) {
+ case 1:
+ case 2:
+ font_size = '1.5rem';
+ padding_size = '0.15rem';
+ break;
+ case 3:
+ font_size = '1rem';
+ padding_size = '0.5rem';
+ break;
+ default:
+ font_size = '0.8rem';
+ padding_size = '0.5rem';
+ break;
}
- });
+
+ this.popup.css({
+ "font-size": font_size,
+ "padding-top": padding_size
+ });
+ }
+
+ if ( newValue === this.currentValue ) {
+ return;
+ }
+
+ switch ( font_length ) {
+ case 1:
+ font_size = '0.95rem';
+ font_top = '0';
+ break;
+ case 2:
+ font_size = '0.85rem';
+ font_top = '-0.01rem';
+ break;
+ case 3:
+ font_size = '0.65rem';
+ font_top = '-0.05rem';
+ break;
+ default:
+ font_size = '0.45rem';
+ font_top = '-0.15rem';
+ break;
+ }
+
+ if ( font_size != this.handleText.css('font-size') ) {
+ this.handleText.css({
+ 'font-size': font_size,
+ 'top': font_top
+ });
+ }
+
+ this.currentValue = newValue;
+ this.handleText.text( newValue );
+ this.popup.html( newValue );
+
+ this.element.trigger( 'update', newValue );
},
- _setDisabled: function ( value, cnt ) {
- this.element.find( "li" ).eq( cnt ).attr( "disabled", value );
- this.element.find( "li" ).eq( cnt ).attr( "aria-disabled", value );
+ // show the popup
+ showPopup: function () {
+ if ( !this.options.popup || this.popupVisible ) {
+ return;
+ }
+
+ this.popup.show();
+ this.popupVisible = true;
+ this._handle_press_show();
},
- disable: function ( cnt ) {
- this._setDisabled( true, cnt );
- this.element.find( "li" ).eq( cnt ).addClass( "ui-disabled" );
+ // hide the popup
+ hidePopup: function () {
+ if ( !this.options.popup || !this.popupVisible ) {
+ return;
+ }
+
+ this.popup.hide();
+ this.popupVisible = false;
+ this._handle_press_hide();
},
- enable: function ( cnt ) {
- this._setDisabled( false, cnt );
- this.element.find( "li" ).eq( cnt ).removeClass( "ui-disabled" );
+ _setOption: function (key, value) {
+ var needToChange = ( value !== this.options[key] );
+
+ if ( !needToChange ) {
+ return;
+ }
+
+ switch ( key ) {
+ case 'popup':
+ this.options.popup = value;
+
+ if ( this.options.popup) {
+ this.updateSlider();
+ } else {
+ this.hidePopup();
+ }
+
+ break;
+ }
}
});
- //auto self-init widgets
+ // stop jqm from initialising sliders
+ $( document ).bind( "pagebeforecreate", function ( e ) {
+ if ( $.data( window, "jqmSliderInitSelector" ) === undefined ) {
+ $.data( window, "jqmSliderInitSelector",
+ $.mobile.slider.prototype.options.initSelector );
+ $.mobile.slider.prototype.options.initSelector = null;
+ }
+ });
+
+ // initialise sliders with our own slider
$( document ).bind( "pagecreate create", function ( e ) {
- $( $.tizen.tabbar.prototype.options.initSelector, e.target ).tabbar();
+ var jqmSliderInitSelector = $.data( window, "jqmSliderInitSelector" );
+ $( e.target ).find(jqmSliderInitSelector).not('select').tizenslider();
+ $( e.target ).find(jqmSliderInitSelector).filter('select').slider();
});
-}( jQuery ) );
-/* ***************************************************************************
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
- *
- * 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:
+
+}( jQuery, this ));
+
+
+
+/*
+ * jQuery UI Progressbar @VERSION
*
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
*
- * 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.
- * ***************************************************************************
+ * http://docs.jquery.com/UI/Progressbar
*
- * Author: Kangsik Kim <kangsik81.kim@samsung.com>
- * Minkyeong Kim <minkyeong.kim@samsung.com>
-*/
+ * Depends:
+ * jquery.ui.core.js
+ * jquery.ui.widget.js
+ * Original file:
+ * jquery.ui.progressbar.js
+ */
+/* This is from jquery ui plugin - progressbar 11/16/2011 */
+
/**
- * The TokenTextArea widget changes a text item to a button. It can be comprised of a number of button widgets.
- * When a user types text and the text gets a specific event to change from a text to a button,
- * the input text is changed to a TokenTextArea widget.
- * A user can add the TokenTextArea widget to a contact list, email list, or another list.
- * The typical use of this widget is composing a number of contacts or phone numbers in a specific area of the screen.
- *
- * HTML Attributes:
- *
- * data-link : Represents the page id.
- * The page contains data for the user, for example, an address book.
- * If the value is null, anchor button doesn't work. (Default : null)
- * data-label: Provide a label for a user-guide. (Default : 'To : ')
- * data-description : This attribute is managing message format.
- * This message is displayed when widget status was changed to 'focusout'. (Default : '+ {0}')
- *
- * APIs:
- *
- * inputtext ( [string] )
- * : If argument is not exist, will get a string from inputbox.
- * If argument is exist, will set a string to inputbox.
- * select ( [number] )
- * : If no argument exists, gets a string of the selected block.
- * If any button isn't selected on a token text area widget, this method returns "null" value.
- * When a user call this method with an argument which is a number type,
- * this method selects the button which is matched with the argument.
- * add ( text, [number] )
- * : If second argument does not exist, will insert to a new button at last position.
- * Insert a new button at indexed position. The position is decided by the second argument.
- * "index of position" means that the position of inserting a new button is decided by the second argument on "add" method.
- * For example, if a user call the method like this "add("Tizen", 2)",
- * new button labed "Tizen" will be inserted on the third position.
- * remove ( [number] )
- * : If no argument exists, all buttons are removed.
- * Remove a button at indexed position.
- * The position is decided by the second argument. (index: index of button)
- * length ( void )
- * : Get a number of buttons.
- * foucsIn ( void )
- * : This method change a status to 'focusin'.
- * This status is able to manage a widget.
- * focusOut ( void )
- * : Changes the focus status to 'focus out'.
- * The status is not able to manage a widget.
- * All buttons that contained in the widget are removed and
- * summarized message is displayed.
- * destroy ( void )
- * : Remove all of the new DOM elements for the current widget that you created.
- *
- * Events:
- *
- * create : Occur when create TokenTextArea widget.
- * select : Occur when a button is selected.
- * add : Occur when new button is inserted.
- * remove : Occur when a button is removed.
- *
- * Examples:
- *
- * <div data-role="tokentextarea" data-label="To : " data-link:"#addressbook" data-description="+ {0}">
- * </div>
- *
- */
-
-
-/**
- @class TokenTextArea
- The TokenTextArea widget enables the user to enter text and convert it to a button. Each button that is created from entered text as a result of a change event forms a token text area widget. This widget is useful in composing an e-mail or SMS message to a group of addresses, each of which is a clickable item for more actions, such as copying, editing, or removing the address.
-
- To add a token text area widget to the application, use the following code:
-
- <div data-role="tokentextarea" data-label="To : " data-link="pageId">
- </div>
-*/
-
-/**
- @property {String} data-label
- Sets a label as a guide for the user.
- For example, while composing an e-mail message, the 'To : ' label is a guide for the user to enter e-mail addresses.
-*/
-
-/**
- @property {String} data-decription
- Manages the message format.
- The message is displayed when the widget status changes to focus out
- */
-/**
- @property {String} data-link
- Sets the ID of the page to which the button links.
-*/
-/**
- @event create
- The create event is fired when the token text area widget is created:
+ @class ProgressBar
+ The progress bar widget shows a control that indicates the progress percentage of an on-going operation. This widget can be scaled to fit inside a parent container.
- <div data-role="tokentextarea">
- </div>
- // Option 01
- $(".selector").tokentextarea
- ({
- create: function(event, ui)
- {
- // Handle the create event
- }
- });
- // Option 02
- $(".selector").bind("create", function(event, ui)
- {
- // Handle the create event
- });
-**/
-/**
- @event select
- The select event is fired when a token text area widget button is selected:
+ To add a progress bar widget to the application, use the following code:
- <div data-role="tokentextarea">
- </div>
- // Option 01
- $(".selector").tokentextarea
- ({
- select: function(event, ui)
- {
- // Handle the select event
- }
- });
- // Option 02
- $(".selector").bind("select", function(event, ui)
- {
- // Handle the select event
- });
+ <div id="foo" data-role="progressbar"</div>
*/
/**
- @event add
- The add event is fired when a token text area widget button is created:
-
- <div data-role="tokentextarea">
- </div>
- // Option 01
- $(".selector").tokentextarea
- ({
- add: function(event, ui)
- {
- // Handle the add event
- }
- });
- // Option 02
- $(".selector").bind("add", function(event, ui)
- {
- // Handle the add event
+ @event change
+ The progress bar can define a callback for the change event, which is fired when the progress value is changed:
+ <div id="foo" data-role="progressbar"></div>
+ $("#foo").bind("change", function (ev, val) {
+ Console.log("Value is changed to " + val);
});
*/
/**
- @event remove
- The remove event is fired when a token text area widget button is removed:
+ @method value
+ You can use the value method with the pickers to set or get the current default progress bar value:
- <div data-role="tokentextarea">
- </div>
- // Option 01
- $(".selector").tokentextarea
- ({
- remove: function(event, ui)
- {
- // Handle the remove event
- }
- });
- // Option 02
- $(".selector").bind("remove", function(event, ui)
- {
- // Handle the remove event
- });
-*/
-/**
- @method destroy
- The destroy method is used to remove in the current widget all the new DOM elements that you have created.
-
- <div data-role="tokentextarea">
- </div>
- $(".selector").tokentextarea("destroy");
-
- @since Tizen2.0
-*/
-/**
- @method inputText
- The inputText method is used to manage the widget input box text. If no parameter is set, the method gets the input box text. If a parameter is set, the parameter text is set in the input box.
-
- <div data-role="tokentextarea">
- </div>
- $(".selector").tokentextarea("inputText", [text]);
+ <div id="foo" data-role="progressbar"></div>
+ var oldVal = $("#foo").progressbar("value");
+ $("#foo").progressbar("value", 50);
*/
-/**
- @method select
- The select method is used to select a token text area widget button based on its index value. If no index value is defined, the method returns the string of the selected block. If there are no buttons present in the widget, the method returns null.
- <div data-role="tokentextarea">
- </div>
- $(".selector").tokentextarea("select", [index]);
-*/
-/**
- @method add
- The add method is used to add a new token text area widget button with the specified label text at the specified index position. If the index parameter is not defined, the widget button is added at the bottom of the list. For example, the $(".selector").tokentextarea("add", "Tizen", 2) method call creates a new widget button labeled 'Tizen' at the third position in the widget.
+(function ( $, window, undefined ) {
- <div data-role="tokentextarea">
- </div>
- $(".selector").tokentextarea("add", [text], [index]);
-*/
-/**
- @method remove
- The remove method is used to remove a token text area widget button at the specified index position. If the parameter is not defined, all the widget buttons are removed.
+ $.widget( "tizen.progressbar", $.mobile.widget, {
+ options: {
+ value: 0,
+ max: 100
+ },
- <div data-role="tokentextarea">
- </div>
- $(".selector").tokentextarea("remove", [index]);
-*/
-/**
- @method length
- The length method is used to retrieve the number of buttons in the token text area widget:
- <div data-role="tokentextarea">
- </div>
- $(".selector").tokentextarea("length");
-*/
-/**
- @method focusIn
- The focusIn method is used to set the focus status to "focus in". This focus state enables the user to add or remove buttons in the token text area widget.
+ min: 0,
- <div data-role="tokentextarea">
- </div>
- $(".selector").tokentextarea("focusIn");
-*/
-/**
- @method focusOut
- The focusOut method is used to set the focus status to "focus out". In this focus state, the user cannot manage the buttons in the widget, all the buttons are removed, and a message is displayed.
+ _create: function () {
+ this.element
+ .addClass( "ui-progressbar" )
+ .attr( {
+ role: "progressbar",
+ "aria-valuemin": this.min,
+ "aria-valuemax": this.options.max,
+ "aria-valuenow": this._value()
+ } );
- <div data-role="tokentextarea">
- </div>
- $(".selector").tokentextarea("focusOut");
-*/
-( function ( $, window, document, undefined ) {
- $.widget( "tizen.tokentextarea", $.mobile.widget, {
- _focusStatus : null,
- _items : null,
- _viewWidth : 0,
- _reservedWidth : 0,
- _currentWidth : 0,
- _fontSize : 0,
- _anchorWidth : 0,
- _labelWidth : 0,
- _marginWidth : 0,
- options : {
- label : "To : ",
- link : null,
- description : "+ {0}"
- },
+ this.valueDiv = $( "<div class='ui-progressbar-value'></div>" )
+ .appendTo( this.element );
- _create : function () {
- var self = this,
- $view = this.element,
- role = $view.jqmData( "role" ),
- option = this.options,
- className = "ui-tokentextarea-link",
- inputbox = $( document.createElement( "input" ) ),
- labeltag = $( document.createElement( "label" ) ),
- moreBlock = $( document.createElement( "a" ) );
+ this.valueDiv.wrap("<div class='ui-progressbar-bg'></div>");
- $view.hide().empty().addClass( "ui-" + role );
+ this.oldValue = this._value();
+ this._refreshValue();
+ },
- // create a label tag.
- $( labeltag ).text( option.label ).addClass( "ui-tokentextarea-label" );
- $view.append( labeltag );
+ _destroy: function () {
+ this.element
+ .removeClass( "ui-progressbar" )
+ .removeAttr( "role" )
+ .removeAttr( "aria-valuemin" )
+ .removeAttr( "aria-valuemax" )
+ .removeAttr( "aria-valuenow" );
- // create a input tag
- $( inputbox ).addClass( "ui-tokentextarea-input ui-tokentextarea-input-visible ui-input-text ui-body-s" );
- $view.append( inputbox );
+ this.valueDiv.remove();
+ },
- // create a anchor tag.
- if ( option.link === null || $.trim( option.link ).length < 1 || $( option.link ).length === 0 ) {
- className += "-dim";
+ value: function ( newValue ) {
+ if ( newValue === undefined ) {
+ return this._value();
}
- $( moreBlock ).attr( "data-role", "button" )
- .buttonMarkup( {
- inline: true,
- icon: "plus",
- style: "circle"
- })
- .attr( "href", $.trim( option.link ) )
- .addClass( "ui-tokentextarea-link-base" )
- .addClass( className );
- // append default htmlelements to main widget.
- $view.append( moreBlock );
+ this._setOption( "value", newValue );
+ return this;
+ },
- // bind a event
- this._bindEvents();
- self._focusStatus = "init";
- // display widget
- $view.show();
- $view.attr( "tabindex", -1 ).focusin( function ( e ) {
- self.focusIn();
- });
-
- // assign global variables
- self._viewWidth = $view.innerWidth();
- self._reservedWidth += self._calcBlockWidth( moreBlock );
- self._reservedWidth += self._calcBlockWidth( labeltag );
- self._fontSize = parseInt( $( moreBlock ).css( "font-size" ), 10 );
- self._currentWidth = self._reservedWidth;
- self._modifyInputBoxWidth();
- },
-
- // bind events
- _bindEvents : function () {
- var self = this,
- $view = self.element,
- option = self.options,
- inputbox = $view.find( ".ui-tokentextarea-input" ),
- moreBlock = $view.find( ".ui-tokentextarea-link-base" ),
- isSeparator = false;
-
- // delegate a event to HTMLDivElement(each block).
- $view.delegate( "div", "click", function ( event ) {
- if ( $( this ).hasClass( "ui-tokentextarea-sblock" ) ) {
- // If block is selected, it will be removed.
- self._removeTextBlock();
- }
-
- var lockBlock = $view.find( "div.ui-tokentextarea-sblock" );
- if ( typeof lockBlock !== "undefined" ) {
- lockBlock.removeClass( "ui-tokentextarea-sblock" ).addClass( "ui-tokentextarea-block" );
- }
- $( this ).removeClass( "ui-tokentextarea-block" ).addClass( "ui-tokentextarea-sblock" );
- self._trigger( "select" );
- });
-
- inputbox.bind( "keyup", function ( event ) {
- // 8 : backspace
- // 13 : Enter
- // 186 : semi-colon
- // 188 : comma
- var keyValue = event.keyCode,
- valueString = $( inputbox ).val(),
- valueStrings = [],
- index;
-
- if ( keyValue === 8 ) {
- if ( valueString.length === 0 ) {
- self._validateTargetBlock();
- }
- } else if ( keyValue === 13 || keyValue === 186 || keyValue === 188 ) {
- if ( valueString.length !== 0 ) {
- // split content by separators(',', ';')
- valueStrings = valueString.split ( /[,;]/ );
- for ( index = 0; index < valueStrings.length; index++ ) {
- if ( valueStrings[index].length !== 0 && valueStrings[index].replace( /\s/g, "" ).length !== 0 ) {
- self._addTextBlock( valueStrings[index] );
- }
- }
- }
- inputbox.val( "" );
- isSeparator = true;
- } else {
- self._unlockTextBlock();
- }
-
- return !isSeparator;
- });
-
- moreBlock.click( function () {
- if ( $( moreBlock ).hasClass( "ui-tokentextarea-link-dim" ) ) {
- return;
- }
-
- $( inputbox ).removeClass( "ui-tokentextarea-input-visible" ).addClass( "ui-tokentextarea-input-invisible" );
-
- $.mobile.changePage( option.link, {
- transition: "slide",
- reverse: false,
- changeHash: false
- });
- });
-
- $( document ).bind( "pagechange.mbe", function ( event ) {
- if ( $view.innerWidth() === 0 ) {
- return ;
- }
- var inputBox = $view.find( ".ui-tokentextarea-input" );
- self._modifyInputBoxWidth();
- $( inputbox ).removeClass( "ui-tokentextarea-input-invisible" ).addClass( "ui-tokentextarea-input-visible" );
- });
-
- $view.bind( "click", function ( event ) {
- if ( self._focusStatus === "focusOut" ) {
- self.focusIn();
+ _setOption: function ( key, value ) {
+ if ( key === "value" ) {
+ this.options.value = value;
+ this._refreshValue();
+ if ( this._value() === this.options.max ) {
+ this.element.trigger( "complete" );
}
- });
- },
-
- // create a textbutton and append this button to parent layer.
- // @param arg1 : string
- // @param arg2 : index
- _addTextBlock : function ( messages, blockIndex ) {
- if ( arguments.length === 0 ) {
- return;
- }
-
- if ( !messages ) {
- return ;
- }
-
- var self = this,
- $view = self.element,
- content = messages,
- index = blockIndex,
- blocks = null,
- textBlock = null;
-
- if ( self._viewWidth === 0 ) {
- self._viewWidth = $view.innerWidth();
- }
-
- // Create a new text HTMLDivElement.
- textBlock = $( document.createElement( 'div' ) );
-
- textBlock.text( content ).addClass( "ui-tokentextarea-block" );
- textBlock.css( {'visibility': 'hidden'} );
-
- blocks = $view.find( "div" );
- if ( index !== null && index <= blocks.length ) {
- $( blocks[index] ).before( textBlock );
- } else {
- $view.find( ".ui-tokentextarea-input" ).before( textBlock );
- }
-
- textBlock = self._ellipsisTextBlock( textBlock );
- textBlock.css( {'visibility': 'visible'} );
-
- self._currentWidth += self._calcBlockWidth( textBlock );
- self._modifyInputBoxWidth();
- self._trigger( "add" );
- },
-
- _removeTextBlock : function () {
- var self = this,
- $view = this.element,
- lockBlock = $view.find( "div.ui-tokentextarea-sblock" );
-
- if ( lockBlock !== null && lockBlock.length > 0 ) {
- self._currentWidth -= self._calcBlockWidth( lockBlock );
- lockBlock.remove();
- self._modifyInputBoxWidth();
- this._trigger( "remove" );
- } else {
- $view.find( "div:last" ).removeClass( "ui-tokentextarea-block" ).addClass( "ui-tokentextarea-sblock" );
}
+ // jquery.ui.widget.js MUST be updated to new version!
+ //this._super( "_setOption", key, value );
},
- _calcBlockWidth : function ( block ) {
- return $( block ).outerWidth( true );
- },
-
- _unlockTextBlock : function () {
- var $view = this.element,
- lockBlock = $view.find( "div.ui-tokentextarea-sblock" );
- if ( lockBlock ) {
- lockBlock.removeClass( "ui-tokentextarea-sblock" ).addClass( "ui-tokentextarea-block" );
+ _value: function () {
+ var val = this.options.value;
+ // normalize invalid value
+ if ( typeof val !== "number" ) {
+ val = 0;
}
+ return Math.min( this.options.max, Math.max( this.min, val ) );
},
- // call when remove text block by backspace key.
- _validateTargetBlock : function () {
- var self = this,
- $view = self.element,
- lastBlock = $view.find( "div:last" ),
- tmpBlock = null;
-
- if ( lastBlock.hasClass( "ui-tokentextarea-sblock" ) ) {
- self._removeTextBlock();
- } else {
- tmpBlock = $view.find( "div.ui-tokentextarea-sblock" );
- tmpBlock.removeClass( "ui-tokentextarea-sblock" ).addClass( "ui-tokentextarea-block" );
- lastBlock.removeClass( "ui-tokentextarea-block" ).addClass( "ui-tokentextarea-sblock" );
- }
+ _percentage: function () {
+ return 100 * this._value() / this.options.max;
},
- _ellipsisTextBlock : function ( textBlock ) {
- var self = this,
- $view = self.element,
- maxWidth = self._viewWidth - ( self._labelWidth + self._anchorWidth ) * 2;
+ _refreshValue: function () {
+ var value = this.value(),
+ percentage = this._percentage();
- if ( self._calcBlockWidth( textBlock ) > maxWidth ) {
- $( textBlock ).width( maxWidth - self._marginWidth );
+ if ( this.oldValue !== value ) {
+ this.oldValue = value;
+ this.element.trigger( "change" );
}
- return textBlock;
- },
-
- _modifyInputBoxWidth : function () {
- var self = this,
- $view = self.element,
- margin = 0,
- labelWidth = 0,
- anchorWidth = 0,
- inputBoxWidth = 0,
- blocks = $view.find( "div" ),
- blockWidth = 0,
- index = 0,
- inputBoxMargin = 10,
- inputBox = $view.find( ".ui-tokentextarea-input" );
+ this.valueDiv
+ .toggle( value > this.min )
+ .width( percentage.toFixed(0) + "%" );
+ this.element.attr( "aria-valuenow", value );
+ }
+ } );
- if ( $view.width() === 0 ) {
- return;
- }
+ // auto self-init widgets
+ $( document ).bind( "pagecreate", function ( e ) {
+ $( e.target ).find( ":jqmData(role='progressbar')" ).progressbar();
+ } );
- if ( self._labelWidth === 0 ) {
- self._labelWidth = $view.find( ".ui-tokentextarea-label" ).outerWidth( true );
- self._anchorWidth = $view.find( ".ui-tokentextarea-link-base" ).outerWidth( true );
- self._marginWidth = parseInt( ( $( inputBox ).css( "margin-left" ) ), 10 );
- self._marginWidth += parseInt( ( $( inputBox ).css( "margin-right" ) ), 10 );
- self._viewWidth = $view.innerWidth();
- }
+}( jQuery, this ) );
- margin = self._marginWidth;
- labelWidth = self._labelWidth;
- anchorWidth = self._anchorWidth;
- inputBoxWidth = self._viewWidth - labelWidth;
- for ( index = 0; index < blocks.length; index += 1 ) {
- blockWidth = self._calcBlockWidth( blocks[index] );
- if ( blockWidth >= inputBoxWidth + anchorWidth ) {
- if ( blockWidth >= inputBoxWidth ) {
- inputBoxWidth = self._viewWidth - blockWidth;
- } else {
- inputBoxWidth = self._viewWidth;
- }
- } else {
- if ( blockWidth >= inputBoxWidth ) {
- inputBoxWidth = self._viewWidth - blockWidth;
- } else {
- inputBoxWidth -= blockWidth;
- }
- }
- }
-
- inputBoxWidth -= margin;
- if ( inputBoxWidth < anchorWidth * 2 ) {
- inputBoxWidth = self._viewWidth - margin;
- }
- $( inputBox ).width( inputBoxWidth - anchorWidth - inputBoxMargin );
- },
-
- _stringFormat : function ( expression ) {
- var pattern = null,
- message = expression,
- i = 0;
- for ( i = 1; i < arguments.length; i += 1 ) {
- pattern = "{" + ( i - 1 ) + "}";
- message = message.replace( pattern, arguments[i] );
- }
- return message;
- },
-
- _resizeBlocks : function () {
- var self = this,
- $view = self.element,
- blocks = $view.find( "div" ),
- index = 0;
-
- for ( index = 0 ; index < blocks.length ; index += 1 ) {
- $( blocks[index] ).css( "width", "auto" );
- blocks[index] = self._ellipsisTextBlock( blocks[index] );
- }
- },
-
- //---------------------------------------------------- //
- // Public Method //
- //----------------------------------------------------//
- //
- // Focus In Event
- //
- focusIn : function () {
- if ( this._focusStatus === "focusIn" ) {
- return;
- }
-
- var $view = this.element;
-
- $view.find( "label" ).show();
- $view.find( ".ui-tokentextarea-desclabel" ).remove();
- $view.find( "div.ui-tokentextarea-sblock" ).removeClass( "ui-tokentextarea-sblock" ).addClass( "ui-tokentextarea-block" );
- $view.find( "div" ).show();
- $view.find( ".ui-tokentextarea-input" ).removeClass( "ui-tokentextarea-input-invisible" ).addClass( "ui-tokentextarea-input-visible" );
- $view.find( "a" ).show();
-
- // change focus state.
- this._modifyInputBoxWidth();
- this._focusStatus = "focusIn";
- $view.removeClass( "ui-tokentextarea-focusout" ).addClass( "ui-tokentextarea-focusin" );
- },
-
- focusOut : function () {
- if ( this._focusStatus === "focusOut" ) {
- return;
- }
-
- var self = this,
- $view = self.element,
- tempBlock = null,
- statement = "",
- index = 0,
- lastIndex = 10,
- label = $view.find( "label" ),
- more = $view.find( "span" ),
- blocks = $view.find( "div" ),
- currentWidth = $view.outerWidth( true ) - more.outerWidth( true ) - label.outerWidth( true ),
- blockWidth = 0;
-
- $view.find( ".ui-tokentextarea-input" ).removeClass( "ui-tokentextarea-input-visible" ).addClass( "ui-tokentextarea-input-invisible" );
- $view.find( "a" ).hide();
- blocks.hide();
-
- currentWidth = currentWidth - self._reservedWidth;
-
- for ( index = 0; index < blocks.length; index++ ) {
- blockWidth = $( blocks[index] ).outerWidth( true );
- if ( currentWidth - blockWidth <= 0 ) {
- lastIndex = index - 1;
- break;
- }
-
- $( blocks[index] ).show();
- currentWidth -= blockWidth;
- }
-
- if ( lastIndex !== blocks.length ) {
- statement = self._stringFormat( self.options.description, blocks.length - lastIndex - 1 );
- tempBlock = $( document.createElement( 'label' ) );
- tempBlock.text( statement );
- tempBlock.addClass( "ui-tokentextarea-desclabel" ).addClass( "ui-tokentextarea-desclabel" );
- $( blocks[lastIndex] ).after( tempBlock );
- }
-
- // update focus state
- this._focusStatus = "focusOut";
- $view.removeClass( "ui-tokentextarea-focusin" ).addClass( "ui-tokentextarea-focusout" );
- },
-
- inputText : function ( message ) {
- var $view = this.element;
-
- if ( arguments.length === 0 ) {
- return $view.find( ".ui-tokentextarea-input" ).val();
- }
- $view.find( ".ui-tokentextarea-input" ).val( message );
- return message;
- },
-
- select : function ( index ) {
- var $view = this.element,
- lockBlock = null,
- blocks = null;
-
- if ( this._focusStatus === "focusOut" ) {
- return;
- }
-
- if ( arguments.length === 0 ) {
- // return a selected block.
- lockBlock = $view.find( "div.ui-tokentextarea-sblock" );
- if ( lockBlock ) {
- return lockBlock.text();
- }
- return null;
- }
- // 1. unlock all blocks.
- this._unlockTextBlock();
- // 2. select pointed block.
- blocks = $view.find( "div" );
- if ( blocks.length > index ) {
- $( blocks[index] ).removeClass( "ui-tokentextarea-block" ).addClass( "ui-tokentextarea-sblock" );
- this._trigger( "select" );
- }
- return null;
- },
-
- add : function ( message, position ) {
- if ( this._focusStatus === "focusOut" ) {
- return;
- }
-
- this._addTextBlock( message, position );
- },
-
- remove : function ( position ) {
- var self = this,
- $view = this.element,
- blocks = $view.find( "div" ),
- index = 0;
- if ( this._focusStatus === "focusOut" ) {
- return;
- }
-
- if ( arguments.length === 0 ) {
- blocks.remove();
- this._trigger( "clear" );
- } else if ( !isNaN( position ) ) {
- // remove selected button
- index = ( ( position < blocks.length ) ? position : ( blocks.length - 1 ) );
- $( blocks[index] ).remove();
- this._trigger( "remove" );
- }
- self._modifyInputBoxWidth();
- },
-
- length : function () {
- return this.element.find( "div" ).length;
- },
-
- refresh : function () {
- var self = this,
- $view = this.element;
-
- self._viewWidth = $view.innerWidth();
- self._resizeBlocks();
- self._modifyInputBoxWidth();
- },
-
- destroy : function () {
- var $view = this.element;
-
- $view.find( "label" ).remove();
- $view.find( "div" ).undelegate( "click" ).remove();
- $view.find( "a" ).remove();
- $view.find( ".ui-tokentextarea-input" ).unbind( "keyup" ).remove();
-
- this._trigger( "destroy" );
- }
- });
-
- $( document ).bind( "pagecreate create", function () {
- $( ":jqmData(role='tokentextarea')" ).tokentextarea();
- });
-
- $( window ).bind( "resize", function () {
- $( ":jqmData(role='tokentextarea')" ).tokentextarea( "refresh" );
- });
-} ( jQuery, window, document ) );
/*
+ * jQuery Mobile Widget @VERSION
+ *
* This software is licensed under the MIT licence (as defined by the OSI at
* http://www.opensource.org/licenses/mit-license.php)
*
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
* ***************************************************************************
+ *
+ * Authors: Gabriel Schulhof <gabriel.schulhof@intel.com>,
+ * Elliot Smith <elliot.smith@intel.com>
+ * Hyunjung Kim <hjnim.kim@samsung.com>
*/
-( function ($, undefined) {
+/*
+ * % Popupwindow widget do not use anymore(will be deprecated, internal use only)
+ *
+ *
+ * Shows other elements inside a popup window.
+ *
+ * To apply, add the attribute data-role="popupwindow" to a <div> element inside
+ * a page. Alternatively, call popupwindow()
+ * on an element, eg :
+ *
+ * $("#mypopupwindowContent").popupwindow();
+ * where the html might be :
+ * <div id="mypopupwindowContent"></div>
+ *
+ * To trigger the popupwindow to appear, it is necessary to make a call to its
+ * 'open()' method. This is typically done by binding a function to an event
+ * emitted by an input element, such as a the clicked event emitted by a button
+ * element. The open() method takes two arguments, specifying the x and y
+ * screen coordinates of the center of the popup window.
- $.widget( "tizen.triangle", $.tizen.widgetex, {
- options: {
- extraClass: "",
- offset: null,
- color: null,
- location: "top",
- initSelector: ":jqmData(role='triangle')"
- },
+ * You can associate a button with a popup window like this:
+ * <div id="mypopupContent" style="display: table;" data-role="popupwindow">
+ * <table>
+ * <tr> <td>Eenie</td> <td>Meenie</td> <td>Mynie</td> <td>Mo</td> </tr>
+ * <tr> <td>Catch-a</td> <td>Tiger</td> <td>By-the</td> <td>Toe</td> </tr>
+ * <tr> <td>If-he</td> <td>Hollers</td> <td>Let-him</td> <td>Go</td> </tr>
+ * <tr> <td>Eenie</td> <td>Meenie</td> <td>Mynie</td> <td>Mo</td> </tr>
+ * </table>
+ * </div>
+ * <a href="#myPopupContent" data-rel="popupwindow" data-role="button">Show popup</a>
+ *
+ * Options:
+ *
+ * theme: String; the theme for the popupwindow contents
+ * Default: null
+ *
+ * overlayTheme: String; the theme for the popupwindow
+ * Default: null
+ *
+ * shadow: Boolean; display a shadow around the popupwindow
+ * Default: true
+ *
+ * corners: Boolean; display a shadow around the popupwindow
+ * Default: true
+ *
+ * fade: Boolean; fades the opening and closing of the popupwindow
+ *
+ * transition: String; the transition to use when opening or closing
+ * a popupwindow
+ * Default: $.mobile.defaultDialogTransition
+ *
+ * Events:
+ * popupbeforeposition: triggered after a popup has completed preparations for opening, but has not yet opened
+ * popupafteropen: triggered after a popup has completely opened
+ * popupafterclose triggered when a popup has completely closed
+*/
- _create: function () {
- var triangle = $( "<div></div>", {"class" : "ui-triangle"} );
+/**
+ class Popupwindow
+ The pop-up widget shows a list of items in a pop-up window in the middle of the screen. It automatically optimizes the pop-up window size within the screen.
+ To add a pop-up widget to the application, use the following code:
- $.extend(this, {
- _triangle: triangle
- });
+ // Basic pop-up
+ <div id="center_info" data-role="popup" data-style="center_info">
+ <div data-role="text">
+ <p>
+ Pop-up dialog box, a child window that blocks user interaction in the parent window
+ </p>
+ </div>
+ </div>
+ // Pop-up with a title and button
+ <div id="center_title_1btn" data-role="popup" data-style="center_title_1btn">
+ <p data-role="title">
+ Pop-up title
+ </p>
+ <p data-role="text">
+ Pop-up dialog box
+ </p>
+ <div data-role="button-bg">
+ <input type="button" value="Text Button" />
+ </div>
+ </div>
- this.element.addClass( "ui-triangle-container" ).append( triangle );
- },
+ The pop-up can define callbacks for events as described in the jQueryMobile documentation for pop-up events. <br/>You can use methods with the pop-up as described in the jQueryMobile documentation for pop-up methods.
- _doCSS: function () {
- var location = ( this.options.location || "top" ),
- offsetCoord = ( ($.inArray(location, ["top", "bottom"]) === -1) ? "top" : "left"),
- cssArg = {
- "border-bottom-color" : "top" === location ? this.options.color : "transparent",
- "border-top-color" : "bottom" === location ? this.options.color : "transparent",
- "border-left-color" : "right" === location ? this.options.color : "transparent",
- "border-right-color" : "left" === location ? this.options.color : "transparent"
- };
+ @deprecated 2.0 verisons
+*/
- cssArg[offsetCoord] = this.options.offset;
+/**
+ @property {String} data-style
+ Defines the pop-up window style.
+ The following styles are available:
- this._triangle.removeAttr( "style" ).css( cssArg );
- },
+ center_info: basic pop-up message
+ center_title: pop-up message with a title
+ center_basic_1btn: pop-up message with 1 button
+ center_basic_2btn: pop-up message with 2 horizontal buttons
+ center_title_1btn: pop-up message with a title and 1 button
+ center_title_2btn: pop-up message with a title and 2 horizontal buttons
+ center_title_3btn: pop-up message with a title and 3 horizontal buttons
+ center_button_vertical: pop-up message with vertical buttons
+ center_checkbox: pop-up message with a check box
+ center_liststyle_1btn>: pop-up message with a list and 1 button
+ center_liststyle_2btn: pop-up message with a list and 2 horizontal buttons
+ center_liststyle_3btn: pop-up message with a list and 3 horizontal buttons
+*/
- _setOffset: function ( value ) {
- this.options.offset = value;
- this.element.attr( "data-" + ($.mobile.ns || "") + "offset", value );
- this._doCSS();
+(function ( $, undefined ) {
+ $.widget( "tizen.popupwindow", $.tizen.widgetex, {
+ options: {
+ theme: null,
+ overlayTheme: "s",
+ style: "custom",
+ disabled: false,
+ shadow: true,
+ corners: true,
+ fade: false,
+ opacity: 0.7,
+ widthRatio: 0.8612,
+ transition: $.mobile.defaultDialogTransition,
+ initSelector: ":jqmData(role='popupwindow')"
},
- _setExtraClass: function ( value ) {
- this._triangle.addClass( value );
- this.options.extraClass = value;
- this.element.attr( "data-" + ($.mobile.ns || "") + "extra-class", value );
- },
+ _htmlProto: {
+source:
- _setColor: function ( value ) {
- this.options.color = value;
- this.element.attr( "data-" + ($.mobile.ns || "") + "color", value );
- this._doCSS();
+ [ "<div><div>" ,
+ " <div id='popupwindow-screen' class='ui-selectmenu-screen ui-screen-hidden ui-popupwindow-screen'></div>" ,
+ " <div id='popupwindow-container' class='ui-popupwindow ui-popupwindow-padding ui-selectmenu-hidden ui-overlay-shadow ui-corner-all'></div>" ,
+ "</div>" ,
+ "</div>" ].join("")
+, ui: {
+ screen: "#popupwindow-screen",
+ container: "#popupwindow-container"
+ }
},
- _setLocation: function ( value ) {
- this.element
- .removeClass( "ui-triangle-container-" + this.options.location )
- .addClass( "ui-triangle-container-" + value );
- this._triangle
- .removeClass( "ui-triangle-" + this.options.location )
- .addClass( "ui-triangle-" + value );
+ _setStyle: function () {
+ var popup = this.element,
+ style = popup.attr( 'data-style' );
- this.options.location = value;
- this.element.attr( "data-" + ($.mobile.ns || "") + "location", value );
+ if ( style ) {
+ this.options.style = style;
+ }
- this._doCSS();
- }
- });
+ popup.addClass( this.options.style );
+ popup.find( ":jqmData(role='title')" )
+ .wrapAll( "<div class='popup-title'></div>" );
+ popup.find( ":jqmData(role='text')" )
+ .wrapAll( "<div class='popup-text'></div>" );
+ popup.find( ":jqmData(role='button-bg')" )
+ .wrapAll( "<div class='popup-button-bg'></div>" );
+ popup.find( ":jqmData(role='check-bg')" )
+ .wrapAll( "<div class='popup-check-bg'></div>" );
+ popup.find( ":jqmData(role='scroller-bg')" )
+ .addClass( "popup-scroller-bg" );
+ popup.find( ":jqmData(role='text-bottom-bg')" )
+ .wrapAll( "<div class='popup-text-bottom-bg'></div>" );
+ popup.find( ":jqmData(role='text-left')" )
+ .wrapAll( "<div class='popup-text-left'></div>" );
+ popup.find( ":jqmData(role='text-right')" )
+ .wrapAll( "<div class='popup-text-right'></div>" );
+ popup.find( ":jqmData(role='progress-bg')" )
+ .wrapAll( "<div class='popup-progress-bg'></div>" );
+ },
- $( document ).bind( "pagecreate create", function ( e ) {
- $($.tizen.triangle.prototype.options.initSelector, e.target)
- .not(":jqmData(role='none'), :jqmData(role='nojs')")
- .triangle();
- });
+ _create: function () {
+ console.warn("popupwindow() was deprecated. use popup() instead.");
+ var thisPage = this.element.closest(":jqmData(role='page')"),
+ self = this;
-}(jQuery) );
-/* ***************************************************************************
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- * ***************************************************************************
- *
- * Author: Kangsik Kim <kangsik81.kim@samsung.com>
- * Youmin Ha <youmin.ha@samsung.com>
-*/
+ if ( thisPage.length === 0 ) {
+ thisPage = $("body");
+ }
-/**
- * In the web environment, it is challenging to display a large amount of data in a grid.
- * When an application needs to show, for example, image gallery with over 1,000 images,
- * the same enormous data must be inserted into a HTML document.
- * It takes a long time to display the data and manipulating DOM is complex.
- * The virtual grid widget supports storing unlimited data without performance issues
- * by reusing a limited number of grid elements.
- * The virtual grid widget is based on the jQuery.template plug-in
- * For more information, see jQuery.template.
- *
- * HTML Attributes:
- *
- * data-role: virtualgrid
- * data-template : Has the ID of the jQuery.template element.
- * jQuery.template for a virtual grid must be defined.
- * Style for template would use rem unit to support scalability.
- * data-direction : This option define the direction of the scroll.
- * You must choose one of the 'x' and 'y' (Default : y)
- * data-rotation : This option defines whether or not the circulation of the data.
- * If option is 'true' and scroll is reached the last data,
- * Widget will present the first data on the screen.
- * If option is ‘false’, Widget will operate like a scrollview.
- *
- * ID : <DIV> element that has "data-role=virtualgrid" must have ID attribute.
- *
- * APIs:
- *
- * create ( {
- * itemData: function ( idx ) { return json_obj; },
- * numItemData: number or function () { return number; },
- * cacheItemData: function ( minIdx, maxIdx ) {}
- * } )
- * : Create VirtualGrid widget. At this moment, _create method is called.
- * args : A collection of options
- * itemData: A function that returns JSON object for given index. Mandatory.
- * numItemData: Total number of itemData. Mandatory.
- * cacheItemData: Virtuallist will ask itemData between minIdx and maxIdx.
- * Developers can implement this function for preparing data.
- * Optional.
- *
- * centerTo ( String )
- * : Find a DOM Element with the given class name.
- * This element will be centered on the screen.
- * Serveral elements were found, the first element is displayed.
- *
- * Events:
- * scrollstart : : This event triggers when a user begin to move the scroll on VirtualGrid.
- * scrollupdate : : This event triggers while a user moves the scroll on VirtualGrid.
- * scrollstop : This event triggers when a user stop the scroll on VirtualGrid.
- * select : This event triggers when a cell is selected.
- *
- * Examples:
- *
- * <script id="tizen-demo-namecard" type="text/x-jquery-tmpl">
- * <div class="ui-demo-namecard">
- * <div class="ui-demo-namecard-pic">
- * <img class="ui-demo-namecard-pic-img" src="${TEAM_LOGO}" />
- * </div>
- * <div class="ui-demo-namecard-contents">
- * <span class="name ui-li-text-main">${NAME}</span>
- * <span class="active ui-li-text-sub">${ACTIVE}</span>
- * <span class="from ui-li-text-sub">${FROM}</span>
- * </div>
- * </div>
- * </script>
- * <div id="virtualgrid-demo" data-role="virtualgrid" data-template="tizen-demo-namecard" >
- * </div>
- *
- */
+ this._ui.placeholder =
+ $( "<div><!-- placeholder for " + this.element.attr("id") + " --></div>" )
+ .css("display", "none")
+ .insertBefore( this.element );
-// most of following codes are derived from jquery.mobile.scrollview.js
+ thisPage.append( this._ui.screen );
+ this._ui.container.insertAfter( this._ui.screen );
+ this._ui.container.append( this.element );
-/**
- @class VirtualGrid
- In the Web environment, it is challenging to display large amount of data in a list, such as displaying a contact list of over 1000 list items. It takes time to display the entire list in HTML and the DOM manipulation is complex.
+ this._setStyle();
- The virtual grid widget is used to display a list of unlimited data elements on the screen for better performance. This widget displays the data in the grid format by reusing the existing grid control space. Virtual grids are based on the jQuery.template plugin as described in the jQuery documentation for jQuery.template plugin.
+ this._isOpen = false;
- To add a virtual grid widget to the application, use the following code:
+ this._ui.screen.bind( "vclick", function ( e ) {
+ self.close();
+ return false;
+ } );
- <script id="tizen-demo-namecard" type="text/x-jquery-tmpl">
- <div class="ui-demo-namecard">
- <div class="ui-demo-namecard-pic">
- <img class="ui-demo-namecard-pic-img" src="${TEAM_LOGO}" />
- </div>
- <div class="ui-demo-namecard-contents">
- <span class="name ui-li-text-main">${NAME}</span>
- </div>
- </div>
- </script>
- <div id="virtualgrid-demo" data-role="virtualgrid" data-template="tizen-demo-namecard">
- </div>
-*/
-/**
- @property {String} data-template
- Specifies the jQuery.template element ID.
- The jQuery.template must be defined. The template style can use rem units to support scalability.
-*/
-/**
- @property {String} data-direction
- Defines the scroll direction. The direction options are x (horizontal) and y (vertical).
- The default value is y.
-*/
-/**
- @property {Boolean} data-rotation
- Defines whether the data elements are displayed from the beginning of the list again once the end of file is reached.
- The default value is false.
-*/
-/**
- @event scrollstart
- The scrollstart event is fired when the user starts scrolling through the grid:
+ this.element.bind( "vclick", function ( e ) {
+ if ( $( e.target ).is("ui-btn-ctxpopup-close") ) {
+ self.close();
+ }
+ } );
+ },
- <div data-role="virtualgrid" data-scroll="y" data-template="tizen-demo-namecard"></div>
- // Option 01
- $(".selector").virtualgrid
- ({
- scrollstart: function(event, ui)
- {
- // Handle the scrollstart event
- }
- });
- // Option 02
- $(".selector").bind("scrollstart", function(event, ui)
- {
- // Handle the scrollstart event
- });
-*/
-/**
- @event scrollupdate
- The scrollupdate event is fired when the user moves the scroll bar in the grid:
+ destroy: function () {
+ this.element.insertBefore( this._ui.placeholder );
- <div data-role="virtualgrid" data-scroll="y" data-template="tizen-demo-namecard"></div>
- // Option 01
- $(".selector").virtualgrid
- ({
- scrollupdate: function(event, ui)
- {
- // Handle the scrollupdate event
- }
- });
- // Option 02
- $(".selector").bind("scrollupdate", function(event, ui)
- {
- // Handle the scrollupdate event
- });
-*/
-/**
- @event scrollstop
- The scrollstop event is fired when the user stops scrolling:
+ this._ui.placeholder.remove();
+ this._ui.container.remove();
+ this._ui.screen.remove();
+ this.element.triggerHandler("destroyed");
+ $.Widget.prototype.destroy.call( this );
+ },
- <div data-role="virtualgrid" data-scroll="y" data-template="tizen-demo-namecard"></div>
- // Option 01
- $(".selector").virtualgrid
- ({
- scrollstop: function(event, ui)
- {
- // Handle the scrollstop event
- }
- });
- // Option 02
- $(".selector").bind("scrollstop", function(event, ui)
- {
- // Handle the scrollstop event
- });
-*/
-/**
- @event select
- The select event is fired when a virtual grid cell is selected:
+ _placementCoords: function ( x, y, cw, ch ) {
+ var screenHeight = $( window ).height(),
+ screenWidth = $( window ).width(),
+ halfheight = ch / 2,
+ maxwidth = parseFloat( this._ui.container.css( "max-width" ) ),
+ roomtop = y,
+ roombot = screenHeight - y,
+ newtop,
+ newleft;
- <div data-role="virtualgrid" data-scroll="y" data-template="tizen-demo-namecard"></div>
- // Option 01
- $(".selector").virtualgrid
- ({
- select: function(event, ui)
- {
- // Handle the select event
+ if ( roomtop > ch / 2 && roombot > ch / 2 ) {
+ newtop = y - halfheight;
+ } else {
+ newtop = roomtop > roombot ? screenHeight - ch - 30 : 30;
}
- });
- // Option 02
- $(".selector").bind("select", function(event, ui)
- {
- // Handle the select event
- });
-*/
-/**
- @method create
- @param {function} itemData(index)
- @param {Number} numItemData
- @param {function} cacheItemData(minIndex, maxIndex)
- The create method is used to call the jQuery _create method. In the method parameters:
- function itemData(index) returns the JSON object matched with the given index. The index value is between 0 and numItemData-1.<br/>
- number numItemData or function numItemData() defines or returns a static number of items.<br/>
- function cacheItemData(minIndex, maxIndex) prepares the JSON data. This method is called before calling the itemData() method with index values between minIndex and maxIndex.<br/>
+ if ( cw < maxwidth ) {
+ newleft = ( screenWidth - cw ) / 2;
+ } else {
+ newleft = x - cw / 2;
- <div data-role="virtualgrid" data-scroll="y" data-template="tizen-demo-namecard"></div>
- function itemData(idx)
- {
- return DATA[idx];
- }
- function cacheItemData(minIdx, maxIdx)
- {
- // Prepare JSON data between minIdx and maxIdx
+ if ( newleft < 10 ) {
+ newleft = 10;
+ } else if ( ( newleft + cw ) > screenWidth ) {
+ newleft = screenWidth - cw - 10;
+ }
}
- var numItemData = DATA.length;
- $(".selector").virtualgrid("create",
- {
- itemData, numItemData, cacheItemData
- });
-*/
-/**
- @method centerTo
- The centerTo method is used to search for the DOM element with a specified class name. The retrieved element is placed at the center of the virtual grid. If multiple elements are retrieved, the first element from the result list is placed at the center of the virtual grid.
- <div data-role="virtualgrid" data-scroll="y" data-template="tizen-demo-namecard"></div>
- $(".selector").virtualgrid("centerTo", "selector");
-*/
-/**
- @method resize
- The resize method is used to rearrange the DOM elements to fit a new screen size when the screen is resized:
+ return { x : newleft, y : newtop };
+ },
- <div data-role="virtualgrid" data-scroll="y" data-template="tizen-demo-namecard"></div>
- ".selector").virtualgrid("resize");
+ _setPosition: function ( x_where, y_where ) {
+ var x = ( undefined === x_where ? $( window ).width() / 2 : x_where ),
+ y = ( undefined === y_where ? $( window ).height() / 2 : y_where ),
+ coords,
+ ctxpopup = this.element.data("ctxpopup"),
+ popupWidth,
+ menuHeight,
+ menuWidth,
+ screenHeight,
+ screenWidth,
+ roomtop,
+ roombot,
+ halfheight,
+ maxwidth,
+ newtop,
+ newleft;
- @since Tizen2.0
-*/
+ if ( !ctxpopup ) {
+ popupWidth = $( window ).width() * this.options.widthRatio;
+ this._ui.container.css( "width", popupWidth );
-( function ($, window, document, undefined) {
+ if ( this._ui.container.outerWidth() > $( window ).width() ) {
+ this._ui.container.css( {"max-width" : $( window ).width() - 30} );
+ }
+ }
- function circularNum (num, total) {
- var n = num % total;
- if (n < 0) {
- n = total + n;
- }
- return n;
- }
+ coords = this._placementCoords( x, y,
+ this._ui.container.outerWidth(),
+ this._ui.container.outerHeight() );
- function MomentumTracker (options) {
- this.options = $.extend({}, options);
- this.easing = "easeOutQuad";
- this.reset();
- }
+ menuHeight = this._ui.container.innerHeight();
+ menuWidth = this._ui.container.innerWidth();
+ screenHeight = $( window ).height();
+ screenWidth = $( window ).width();
+ roomtop = y;
+ roombot = screenHeight - y;
+ halfheight = menuHeight / 2;
+ maxwidth = parseFloat( this._ui.container.css( "max-width" ) );
+ newtop = ( screenHeight - menuHeight ) / 2;
- var tstates = {
- scrolling : 0,
- done : 1
- };
+ if ( !maxwidth || menuWidth < maxwidth ) {
+ newleft = ( screenWidth - menuWidth ) / 2;
+ } else {
+ newleft = x - menuWidth / 2;
- function getCurrentTime () {
- return Date.now();
- }
+ if ( newleft < 30 ) {
+ newleft = 30;
+ } else if ( ( newleft + menuWidth ) > screenWidth ) {
+ newleft = screenWidth - menuWidth - 30;
+ }
+ }
- $.extend (MomentumTracker.prototype, {
- start : function (pos, speed, duration) {
- this.state = (speed !== 0 ) ? tstates.scrolling : tstates.done;
- this.pos = pos;
- this.speed = speed;
- this.duration = duration;
+ if ( ctxpopup ) {
+ newtop = coords.y;
+ newleft = coords.x;
+ }
- this.fromPos = 0;
- this.toPos = 0;
+ this._ui.container.css({
+ top: newtop,
+ left: newleft
+ });
- this.startTime = getCurrentTime();
- },
-
- reset : function () {
- this.state = tstates.done;
- this.pos = 0;
- this.speed = 0;
- this.duration = 0;
+ this._ui.screen.css( "height", screenHeight );
},
+ open: function ( x_where, y_where, backgroundclose ) {
+ var self = this,
+ zIndexMax = 0;
- update : function () {
- var state = this.state, duration, elapsed, dx, x;
-
- if (state == tstates.done) {
- return this.pos;
+ if ( this._isOpen || this.options.disabled ) {
+ return;
}
- duration = this.duration;
- elapsed = getCurrentTime () - this.startTime;
- elapsed = elapsed > duration ? duration : elapsed;
- dx = this.speed * (1 - $.easing[this.easing] (elapsed / duration, elapsed, 0, 1, duration) );
- x = this.pos + dx;
- this.pos = x;
- if (elapsed >= duration) {
- this.state = tstates.done;
- }
- return this.pos;
- },
+ $( document ).find("*").each( function () {
+ var el = $( this ),
+ zIndex = parseInt( el.css("z-index"), 10 );
- done : function () {
- return this.state == tstates.done;
- },
+ if ( !( el.is( self._ui.container ) ||
+ el.is( self._ui.screen ) ||
+ isNaN( zIndex ))) {
+ zIndexMax = Math.max( zIndexMax, zIndex );
+ }
+ } );
- getPosition : function () {
- return this.pos;
- }
- });
+ this._ui.screen.css( "height", $( window ).height() );
- jQuery.widget ("mobile.virtualgrid", jQuery.mobile.widget, {
- options : {
- // virtualgrid option
- template : "",
- direction : "y",
- rotation : false,
- },
+ if ( backgroundclose ) {
+ this._ui.screen.css( "opacity", 0 )
+ .removeClass("ui-screen-hidden");
+ } else {
+ this._ui.removeClass("ui-screen-hidden");
- create : function () {
- this._create.apply( this, arguments );
- },
+ if ( this.options.fade ) {
+ this._ui.screen.animate( {opacity: this.options.opacity}, "fast" );
+ } else {
+ this._ui.screen.css( {opacity: this.options.opacity} );
+ }
+ }
- _create : function ( args ) {
- $.extend(this, {
- // view
- _$view : null,
- _$clip : null,
- _$rows : null,
- _tracker : null,
- _viewSize : 0,
- _clipSize : 0,
- _cellSize : undefined,
- _currentItemCount : 0,
- _itemCount : 1,
- _inheritedSize : null,
+ this._setPosition( x_where, y_where );
- // timer
- _timerInterval : 0,
- _timerID : 0,
- _timerCB : null,
- _lastMove : null,
+ this.element.trigger("popupbeforeposition");
- // Data
- _itemData : function ( idx ) { return null; },
- _numItemData : 0,
- _cacheItemData : function ( minIdx, maxIdx ) { },
- _totalRowCnt : 0,
- _template : null,
- _maxViewSize : 0,
- _modifyViewPos : 0,
- _maxSize : 0,
+ this._ui.container
+ .removeClass("ui-selectmenu-hidden")
+ .addClass("in")
+ .animationComplete( function () {
+ self.element.trigger("popupafteropen");
+ } );
- // axis - ( true : x , false : y )
- _direction : false,
- _didDrag : true,
- _reservedPos : 0,
- _scalableSize : 0,
- _eventPos : 0,
- _nextPos : 0,
- _movePos : 0,
- _lastY : 0,
- _speedY : 0,
- _lastX : 0,
- _speedX : 0,
- _rowsPerView : 0,
- _fragment : null,
+ this._isOpen = true;
- _filterRatio : 0.9
- });
+ if ( !this._reflow ) {
+ this._reflow = function () {
+ if ( !self._isOpen ) {
+ return;
+ }
- var self = this,
- $dom = $(self.element),
- opts = self.options,
- $item = null;
+ self._setPosition( x_where, y_where );
+ };
- // itemData
- // If mandatory options are not given, Do nothing.
- if ( !args ) {
- return ;
+ $( window ).bind( "resize", this._reflow );
}
+ },
- if ( !self._loadData(args) ) {
+ close: function () {
+ if ( !this._isOpen ) {
return;
}
- // make a fragment.
- self._fragment = document.createDocumentFragment();
-
- // read defined properties(width and height) from dom element.
- self._inheritedSize = self._getinheritedSize(self.element);
-
- // set a scroll direction.
- self._direction = opts.direction === 'x' ? true : false;
-
- // make view layer
- self._$clip = $(self.element).addClass("ui-scrollview-clip").addClass("ui-virtualgrid-view");
- $item = $(document.createElement("div")).addClass("ui-scrollview-view");
- self._clipSize = self._calculateClipSize();
- self._$clip.append($item);
- self._$view = $item;
- self._$clip.css("overflow", "hidden");
- self._$view.css("overflow", "hidden");
-
- // inherit from scrollview widget.
- self._scrollView = $.tizen.scrollview.prototype;
- self._initScrollView();
-
- // create tracker.
- self._createTracker();
- self._makePositioned(self._$clip);
- self._timerInterval = 1000 / self.options.fps;
-
- self._timerID = 0;
- self._timerCB = function () {
- self._handleMomentumScroll();
- };
- $dom.closest(".ui-content").addClass("ui-virtualgrid-content").css("overflow", "hidden");
-
- // add event handler.
- self._addBehaviors();
+ if ( this._reflow ) {
+ $( window ).unbind( "resize", this._reflow );
+ this._reflow = null;
+ }
- self._currentItemCount = 0;
- self._createScrollBar();
- self.refresh();
- },
+ var self = this,
+ hideScreen = function () {
+ self._ui.screen.addClass("ui-screen-hidden");
+ self._isOpen = false;
+ };
- // The argument is checked for compliance with the specified format.
- // @param args : Object
- // @return boolean
- _loadData : function ( args ) {
- var self = this;
+ this._ui.container.removeClass("in").addClass("reverse out");
- if ( args.itemData && typeof args.itemData == 'function' ) {
- self._itemData = args.itemData;
+ if ( this.options.transition === "none" ) {
+ this._ui.container
+ .addClass("ui-selectmenu-hidden")
+ .removeAttr("style");
+ this.element.trigger("popupafterclose");
} else {
- return false;
+ this._ui.container.animationComplete( function () {
+ self._ui.container
+ .removeClass("reverse out")
+ .addClass("ui-selectmenu-hidden")
+ .removeAttr("style");
+ self.element.trigger("popupafterclose");
+ } );
}
- if ( args.numItemData ) {
- if ( typeof args.numItemData == 'function' ) {
- self._numItemData = args.numItemData( );
- } else if ( typeof args.numItemData == 'number' ) {
- self._numItemData = args.numItemData;
- } else {
- return false;
- }
+
+ if ( this.options.fade ) {
+ this._ui.screen.animate( {opacity: 0}, "fast", hideScreen );
} else {
- return false;
+ hideScreen();
}
- return true;
},
- // Make up the first screen.
- _initLayout: function () {
- var self = this,
- opts = self.options,
- i,
- $row;
+ _realSetTheme: function ( dst, theme ) {
+ var classes = ( dst.attr("class") || "" ).split(" "),
+ alreadyAdded = true,
+ currentTheme = null,
+ matches;
- for ( i = -1; i < self._rowsPerView + 1; i += 1 ) {
- $row = self._$rows[ circularNum( i, self._$rows.length ) ];
- self._$view.append( $row );
- }
- self._setElementTransform( -self._cellSize );
+ while ( classes.length > 0 ) {
+ currentTheme = classes.pop();
+ matches = currentTheme.match(/^ui-body-([a-z])$/);
- self._replaceRow(self._$view.children().first(), self._totalRowCnt - 1);
- if ( opts.rotation && self._rowsPerView >= self._totalRowCnt ) {
- self._replaceRow(self._$view.children().last(), 0);
+ if ( matches && matches.length > 1 ) {
+ currentTheme = matches[1];
+ break;
+ } else {
+ currentTheme = null;
+ }
}
- self._setViewSize();
- },
-
- _setViewSize : function () {
- var self = this,
- height = 0,
- width = 0;
- if ( self._direction ) {
- width = self._cellSize * ( self._rowsPerView + 2 );
- width = parseInt(width, 10) + 1;
- self._$view.width( width );
- self._viewSize = self._$view.width();
- } else {
- self._$view.height( self._cellSize * ( self._rowsPerView + 2 ) );
- self._$clip.height( self._clipSize );
- self._viewSize = self._$view.height();
+ dst.removeClass( "ui-body-" + currentTheme );
+ if ( ( theme || "" ).match(/[a-z]/) ) {
+ dst.addClass( "ui-body-" + theme );
}
},
- _getViewHeight : function () {
- var self = this;
- return self._$view.height();
+ _setTheme: function ( value ) {
+ this._realSetTheme( this.element, value );
+ this.options.theme = value;
+ this.element.attr( "data-" + ( $.mobile.ns || "" ) + "theme", value );
},
- refresh : function () {
- var self = this,
- opts = self.options,
- width = 0,
- height = 0;
+ _setOverlayTheme: function ( value ) {
+ this._realSetTheme( this._ui.container, value );
+ this.options.overlayTheme = value;
+ this.element.attr( "data-" + ( $.mobile.ns || "" ) + "overlay-theme", value );
+ },
- self._template = $( "#" + opts.template );
- if ( !self._template ) {
- return ;
- }
+ _setShadow: function ( value ) {
+ this.options.shadow = value;
+ this.element.attr( "data-" + ( $.mobile.ns || "" ) + "shadow", value );
+ this._ui.container[value ? "addClass" : "removeClass"]("ui-overlay-shadow");
+ },
- width = self._calculateClipWidth();
- height = self._calculateClipHeight();
- self._$view.width(width).height(height);
- self._$clip.width(width).height(height);
+ _setCorners: function ( value ) {
+ this.options.corners = value;
+ this.element.attr( "data-" + ( $.mobile.ns || "" ) + "corners", value );
+ this._ui.container[value ? "addClass" : "removeClass"]("ui-corner-all");
+ },
- self._clipSize = self._calculateClipSize();
- self._calculateColumnSize();
- self._initPageProperty();
- self._setScrollBarSize();
+ _setFade: function ( value ) {
+ this.options.fade = value;
+ this.element.attr( "data-" + ( $.mobile.ns || "" ) + "fade", value );
},
- _initPageProperty : function () {
- var self = this,
- rowsPerView = 0,
- $child,
- columnCount = 0,
- totalRowCnt = 0,
- attributeName = self._direction ? "width" : "height";
+ _setTransition: function ( value ) {
+ this._ui.container
+ .removeClass( this.options.transition || "" )
+ .addClass( value );
+ this.options.transition = value;
+ this.element.attr( "data-" + ( $.mobile.ns || "" ) + "transition", value );
+ },
- columnCount = self._calculateColumnCount();
+ _setDisabled: function ( value ) {
+ $.Widget.prototype._setOption.call( this, "disabled", value );
+ if ( value ) {
+ this.close();
+ }
+ }
+ });
- totalRowCnt = parseInt(self._numItemData / columnCount , 10 );
- self._totalRowCnt = self._numItemData % columnCount === 0 ? totalRowCnt : totalRowCnt + 1;
- self._itemCount = columnCount;
+ $.tizen.popupwindow.bindPopupToButton = function ( btn, popup ) {
+ if ( btn.length === 0 || popup.length === 0 ) {
+ return;
+ }
- if ( self._cellSize <= 0) {
- return ;
+ var btnVClickHandler = function ( e ) {
+ if ( !popup.jqmData("overlay-theme-set") ) {
+ popup.popupwindow( "option", "overlayTheme", btn.jqmData("theme") );
}
- rowsPerView = self._clipSize / self._cellSize;
- rowsPerView = Math.ceil( rowsPerView );
- self._rowsPerView = parseInt( rowsPerView, 10);
+ popup.popupwindow( "open",
+ btn.offset().left + btn.outerWidth() / 2,
+ btn.offset().top + btn.outerHeight() / 2 );
- $child = self._makeRows( rowsPerView + 2 );
- $(self._$view).append($child.children());
- self._$view.children().css(attributeName, self._cellSize + "px");
- self._$rows = self._$view.children().detach();
+ return false;
+ };
- self._reservedPos = -self._cellSize;
- self._scalableSize = -self._cellSize;
+ if ( ( popup.popupwindow("option", "overlayTheme") || "" ).match(/[a-z]/) ) {
+ popup.jqmData( "overlay-theme-set", true );
+ }
- self._initLayout();
+ btn
+ .attr({
+ "aria-haspopup": true,
+ "aria-owns": btn.attr("href")
+ })
+ .removeAttr("href")
+ .bind( "vclick", btnVClickHandler );
- self._blockScroll = self._rowsPerView > self._totalRowCnt;
- self._maxSize = ( self._totalRowCnt - self._rowsPerView ) * self._cellSize;
- self._maxViewSize = ( self._rowsPerView ) * self._cellSize;
- self._modifyViewPos = -self._cellSize;
- if ( self._clipSize < self._maxViewSize ) {
- self._modifyViewPos = (-self._cellSize) + ( self._clipSize - self._maxViewSize );
+ popup.bind( "destroyed", function () {
+ btn.unbind( "vclick", btnVClickHandler );
+ } );
+ };
+
+ $( document ).bind( "pagecreate create", function ( e ) {
+ $( $.tizen.popupwindow.prototype.options.initSelector, e.target )
+ .not(":jqmData(role='none'), :jqmData(role='nojs')")
+ .popupwindow();
+
+ $( "a[href^='#']:jqmData(rel='popupwindow')", e.target ).each( function () {
+ $.tizen.popupwindow.bindPopupToButton( $( this ), $( $( this ).attr("href") ) );
+ });
+ });
+}( jQuery ));
+
+
+
+/**
+ * @class core
+ * loader.js
+ *
+ * Youmin Ha <youmin.ha@samsung.com>
+ *
+ *
+ */
+/*
+ Web UI scaling concept in Tizen Web UI
+
+Generally, web applications must be designed to be showed acceptable on various size and resolution of screens, and web winsets have to be scaled well. Tizen Web UI Framework supports various viewport settings, and Tizen Web UI widgets are designed to be scalable on various screen sizes. In order to make web applications scalable on many devices which have different screen size, it is necessary to understand how mobile web browsers deal with screen resolution, and how Tizen Web UI Framework supports scaling for web applications.
+
+
+* Viewport on mobile web browser
+
+Viewport is an area showing web content on the browser. Unlike desktop browsers, mobile browsers support logical viewport seting, which means that application can set viewport width/height and zoom level by itself.
+The very important thing that to be remembered is that the viewport resolution in pixel is 'Logical', not physical. For example, if the viewport width is set to 480 on a mobile device having 720px screen width, the viewport width is considered to 480px logically. All elements put on right side from 480px horizontal position will not be shown on the viewport.
+Most mobile browsers set viewport with given content attribute with <meta name="viewport" content="..."> tag in <head> section in the application source html, whereas desktop browsers ignore the tag.
+Detailed usage of viewport meta tag is found in here: http://www.w3.org/TR/mwabp/#bp-viewport
+
+
+* Viewport setting by application developers
+
+When developers write <meta name="viewport" content="..."> in the <head> section of the web application HTML file, Tizen Web UI Framework does not add another viewport meta tag, nor modify developer-defined viewport.
+
+
+* Automatic viewport setting by Tizen Web UI Framework
+
+If developers do not give a viewport meta tag, Tizen Web UI Framework automatically add a viewport meta tag with default viewport setting.
+
+
+* Portrait/landscape mode
+
+
+* Tizen Web UI widgets scaling
+
+
+ */
+( function ($, Globalize, window, undefined) {
+
+ var tizen = {
+ libFileName : "tizen-web-ui-fw(.min)?.js",
+
+ frameworkData : {
+ rootDir: '/usr/lib/tizen-web-ui-fw',
+ version: '0.1',
+ theme: "tizen-white",
+ viewportWidth: "device-width",
+ viewportScale: false,
+
+ defaultFontSize: 22,
+ minified: false,
+
+ debug: false
+ },
+
+ log : {
+ debug : function ( msg ) {
+ if ( tizen.frameworkData.debug ) {
+ console.log( msg );
+ }
+ },
+ warn : function ( msg ) {
+ console.warn( msg );
+ },
+ error : function ( msg ) {
+ console.error( msg );
+ },
+ alert : function ( msg ) {
+ window.alert( msg );
}
},
- _getinheritedSize : function ( elem ) {
- var $target = $(elem),
- height,
- width,
- NODETYPE = { ELEMENT_NODE : 1, TEXT_NODE : 3 },
- ret = {
- isDefinedWidth : false,
- isDefinedHeight : false,
- width : 0,
- height : 0
- };
+ util : {
- while ( $target[0].nodeType === NODETYPE.ELEMENT_NODE && (ret.isDefinedWidth === false || ret.isHeightDefined === false )) {
- height = $target[0].style.height;
- width = $target[0].style.width;
+ loadScriptSync : function ( scriptPath, successCB, errorCB ) {
+ $.ajax( {
+ url: scriptPath,
+ dataType: 'script',
+ async: false,
+ crossDomain: false,
+ success: successCB,
+ error: function ( jqXHR, textStatus, errorThrown ) {
+ if ( errorCB ) {
+ errorCB( jqXHR, textStatus, errorThrown );
+ } else {
+ var ignoreStatusList = [ 404 ], // 404: not found
+ errmsg = ( 'Error while loading ' + scriptPath + '\n' + jqXHR.status + ':' + jqXHR.statusText );
+ if ( -1 == $.inArray( jqXHR.status, ignoreStatusList ) ) {
+ tizen.log.alert( errmsg );
+ } else {
+ tizen.log.warn( errmsg );
+ }
+ }
+ }
+ } );
+ },
+ isMobileBrowser: function ( ) {
+ var mobileIdx = window.navigator.appVersion.indexOf("Mobile"),
+ isMobile = -1 < mobileIdx;
+ return isMobile;
+ }
+ },
- if (ret.isDefinedHeight === false && height !== "" ) {
- // Size was defined
- ret.isDefinedHeight = true;
- ret.height = parseInt(height, 10);
+ css : {
+ cacheBust: ( document.location.href.match( /debug=true/ ) ) ?
+ '?cacheBust=' + ( new Date( ) ).getTime( ) :
+ '',
+ addElementToHead : function ( elem ) {
+ var head = document.getElementsByTagName( 'head' )[0];
+ if ( head ) {
+ $( head ).prepend( elem );
+ }
+ },
+ makeLink : function ( href ) {
+ var cssLink = document.createElement( 'link' );
+ cssLink.setAttribute( 'rel', 'stylesheet' );
+ cssLink.setAttribute( 'href', href );
+ cssLink.setAttribute( 'name', 'tizen-theme' );
+ return cssLink;
+ },
+ load: function ( path ) {
+ var head = document.getElementsByTagName( 'head' )[0],
+ cssLinks = head.getElementsByTagName( 'link' ),
+ idx,
+ l = null;
+ // Find css link element
+ for ( idx = 0; idx < cssLinks.length; idx++ ) {
+ if ( cssLinks[idx].getAttribute( 'rel' ) != "stylesheet" ) {
+ continue;
+ }
+ if ( cssLinks[idx].getAttribute( 'name' ) == "tizen-theme"
+ || cssLinks[idx].getAttribute( 'href' ) == path ) {
+ l = cssLinks[idx];
+ break;
+ }
}
+ if ( l ) { // Found the link element!
+ if ( l.getAttribute( 'href' ) == path ) {
+ tizen.log.warn( "Theme is already loaded. Skip theme loading in the framework." );
+ } else {
+ l.setAttribute( 'href', path );
+ }
+ } else {
+ this.addElementToHead( this.makeLink( path ) );
+ }
+ }
+ },
+
+ getParams: function ( ) {
+ /* Get data-* params from <script> tag, and set tizen.frameworkData.* values
+ * Returns true if proper <script> tag is found, or false if not.
+ */
+ // Find current <script> tag element
+ var scriptElems = document.getElementsByTagName( 'script' ),
+ val = null,
+ foundScriptTag = false,
+ idx,
+ elem,
+ src,
+ tokens,
+ version_idx;
+
+ function getTizenTheme( ) {
+ var t = navigator.theme ? navigator.theme.split( ':' )[0] : null;
+ if ( t ) {
+ t = t.replace('-hd', '');
+ if ( ! t.match( /^tizen-/ ) ) {
+ t = 'tizen-' + t;
+ }
+ }
+ return t;
+ }
+
+ for ( idx in scriptElems ) {
+ elem = scriptElems[idx];
+ src = elem.src ? elem.getAttribute( 'src' ) : undefined;
+ if (src && src.match( this.libFileName )) {
+ // Set framework data, only when they are given.
+ tokens = src.split(/[\/\\]/);
+ version_idx = -3;
+ this.frameworkData.rootDir = ( elem.getAttribute( 'data-framework-root' )
+ || tokens.slice( 0, tokens.length + version_idx ).join( '/' )
+ || this.frameworkData.rootDir ).replace( /^file:(\/\/)?/, '' );
+ this.frameworkData.version = elem.getAttribute( 'data-framework-version' )
+ || tokens[ tokens.length + version_idx ]
+ || this.frameworkData.version;
+ this.frameworkData.theme = elem.getAttribute( 'data-framework-theme' )
+ || getTizenTheme( )
+ || this.frameworkData.theme;
+ this.frameworkData.viewportWidth = elem.getAttribute( 'data-framework-viewport-width' )
+ || this.frameworkData.viewportWidth;
+ this.frameworkData.viewportScale =
+ "true" === elem.getAttribute( 'data-framework-viewport-scale' ) ? true
+ : this.frameworkData.viewportScale;
+ this.frameworkData.minified = src.search(/\.min\.js$/) > -1 ? true : false;
+ this.frameworkData.debug = "true" === elem.getAttribute( 'data-framework-debug' ) ? true
+ : this.frameworkData.debug;
+ foundScriptTag = true;
+ break;
+ }
+ }
+ return foundScriptTag;
+ },
+
+ loadTheme: function ( theme ) {
+ var themePath,
+ cssPath,
+ jsPath;
+
+ if ( ! theme ) {
+ theme = tizen.frameworkData.theme;
+ }
+ themePath = [
+ tizen.frameworkData.rootDir,
+ tizen.frameworkData.version,
+ 'themes',
+ theme
+ ].join( '/' );
+
+ jsPath = [ themePath, 'theme.js' ].join( '/' );
+
+ if ( tizen.frameworkData.minified ) {
+ cssPath = [themePath, 'tizen-web-ui-fw-theme.min.css'].join( '/' );
+ } else {
+ cssPath = [themePath, 'tizen-web-ui-fw-theme.css'].join( '/' );
+ }
+ tizen.css.load( cssPath );
+ tizen.util.loadScriptSync( jsPath );
+ },
+
+ /** Load Globalize culture file, and set default culture.
+ * @param[in] language (optional) Language code. ex) en-US, en, ko-KR, ko
+ * If language is not given, read language from html 'lang' attribute,
+ * or from system setting.
+ * @param[in] cultureDic (optional) Dictionary having language code->
+ */
+ loadGlobalizeCulture: function ( language, cultureDic ) {
+ var self = this,
+ cFPath,
+ lang,
+ mockJSXHR;
+
+ function getLang ( language ) {
+ var lang = language
+ || $( 'html' ).attr( 'lang' )
+ || window.navigator.language.split( '.' )[0] // Webkit, Safari + workaround for Tizen
+ || window.navigator.userLanguage // IE
+ || 'en',
+ countryCode = null,
+ countryCodeIdx = lang.lastIndexOf('-'),
+ ignoreCodes = ['Cyrl', 'Latn', 'Mong']; // Not country code!
+ if ( countryCodeIdx != -1 ) { // Found country code!
+ countryCode = lang.substr( countryCodeIdx + 1 );
+ if ( ignoreCodes.join( '-' ).indexOf( countryCode ) < 0 ) {
+ // countryCode is not found from ignoreCodes.
+ // Make countryCode to uppercase.
+ lang = [ lang.substr( 0, countryCodeIdx ), countryCode.toUpperCase( ) ].join( '-' );
+ }
+ }
+ // NOTE: 'en' to 'en-US', because globalize has no 'en' culture file.
+ lang = lang == 'en' ? 'en-US' : lang;
+ return lang;
+ }
+
+ function getNeutralLang ( lang ) {
+ var neutralLangIdx = lang.lastIndexOf( '-' ),
+ neutralLang;
+ if ( neutralLangIdx != -1 ) {
+ neutralLang = lang.substr( 0, neutralLangIdx );
+ }
+ return neutralLang;
+ }
+
+ function getCultureFilePath ( lang, cFDic ) {
+ var cFPath = null; // error value
+
+ if ( "string" != typeof lang ) {
+ return null;
+ }
+ if ( cFDic && cFDic[lang] ) {
+ cFPath = cFDic[lang];
+ } else {
+ // Default Globalize culture file path
+ cFPath = [
+ self.frameworkData.rootDir,
+ self.frameworkData.version,
+ 'js',
+ 'cultures',
+ ['globalize.culture.', lang, '.js'].join( '' ),
+ ].join( '/' );
+ }
+ return cFPath;
+ }
+
+ function printLoadError( cFPath, jqXHR ) {
+ tizen.log.error( "Error " + jqXHR.status + ": " + jqXHR.statusText
+ + "::Culture file (" + cFPath + ") is failed to load.");
+ }
+
+ function loadCultureFile ( cFPath, errCB ) {
+ function _successCB ( ) {
+ tizen.log.debug( "Culture file (" + cFPath + ") is loaded successfully." );
+ }
+ function _errCB ( jqXHR, textStatus, err ) {
+ if ( errCB ) {
+ errCB( jqXHR, textStatus, err );
+ } else {
+ printLoadError( cFPath, jqXHR );
+ }
+ }
+
+ if ( ! cFPath ) { // Invalid cFPath -> Regard it as '404 Not Found' error.
+ mockJSXHR = {
+ status: 404,
+ statusText: "Not Found"
+ };
+ _errCB( mockJSXHR, null, null );
+ } else {
+ $.ajax( {
+ url: cFPath,
+ dataType: 'script',
+ cache: true,
+ async: false,
+ success: _successCB,
+ error: _errCB
+ } );
+ }
+ }
+
+ lang = getLang( language );
+ cFPath = getCultureFilePath( lang, cultureDic );
+ loadCultureFile( cFPath,
+ function ( jqXHR, textStatus, err ) {
+ if ( jqXHR.status == 404 ) {
+ // If culture file is not found, try once more with neutral lang.
+ var nLang = getNeutralLang( lang ),
+ ncFPath = getCultureFilePath( nLang, cultureDic );
+ loadCultureFile( ncFPath, null );
+ } else {
+ printLoadError( cFPath, jqXHR );
+ }
+ } );
+
+ return lang;
+ },
+ setGlobalize: function ( ) {
+ var lang = this.loadGlobalizeCulture( );
+
+ // Set culture
+ // NOTE: It is not needed to set with neutral lang.
+ // Globalize automatically deals with it.
+ Globalize.culture( lang );
+ },
+ /**
+ * Load custom globalize culture file
+ * Find current system language, and load appropriate culture file from given colture file list.
+ *
+ * @param[in] cultureDic collection of 'language':'culture file path' key-val pair.
+ * @example
+ * var myCultures = {
+ * "en" : "culture/en.js",
+ * "fr" : "culture/fr.js",
+ * "ko-KR" : "culture/ko-KR.js"
+ * };
+ * loadCultomGlobalizeCulture( myCultures );
+ *
+ * ex) culture/fr.js
+ * -------------------------------
+ * Globalize.addCultureInfo( "fr", {
+ * messages: {
+ * "hello" : "bonjour",
+ * "translate" : "traduire"
+ * }
+ * } );
+ * -------------------------------
+ */
+ loadCustomGlobalizeCulture: function ( cultureDic ) {
+ tizen.loadGlobalizeCulture( null, cultureDic );
+ },
+
+ /** Set viewport meta tag for mobile devices.
+ *
+ * @param[in] viewportWidth viewport width. "device-width" is OK.
+ */
+ setViewport: function ( viewportWidth ) {
+ var meta = null,
+ head,
+ content;
+
+ // Do nothing if viewport setting code is already in the code.
+ $( "meta[name=viewport]" ).each( function ( ) {
+ meta = this;
+ return;
+ });
+ if ( meta ) { // Found custom viewport!
+ content = $( meta ).prop( "content" );
+ viewportWidth = content.replace( /.*width=(device-width|\d+)\s*,?.*$/gi, "$1" );
+ tizen.log.warn( "Viewport is set to '" + viewportWidth + "' in a meta tag. Framework skips viewport setting." );
+ } else {
+ // Create a meta tag
+ meta = document.createElement( "meta" );
+ if ( meta ) {
+ meta.name = "viewport";
+ content = [ "width=", viewportWidth, ", user-scalable=no" ].join( "" );
+ if ( ! isNaN( viewportWidth ) ) {
+ // Fix scale to 1.0, if viewport width is set to fixed value.
+ // NOTE: Works wrong in Tizen browser!
+ //content = [ content, ", initial-scale=1.0, maximum-scale=1.0" ].join( "" );
+ }
+ meta.content = content;
+ tizen.log.debug( content );
+ head = document.getElementsByTagName( 'head' ).item( 0 );
+ head.insertBefore( meta, head.firstChild );
+ }
+ }
+ return viewportWidth;
+ },
+
+ /** Read body's font-size, scale it, and reset it.
+ * param[in] desired font-size / base font-size.
+ */
+ scaleBaseFontSize: function ( themeDefaultFontSize, ratio ) {
+ tizen.log.debug( "themedefaultfont size: " + themeDefaultFontSize + ", ratio: " + ratio );
+ var scaledFontSize = Math.max( Math.floor( themeDefaultFontSize * ratio ), 4 );
+
+ $( 'html.ui-mobile' ).css( { 'font-size': scaledFontSize + "px" } );
+ tizen.log.debug( 'html:font size is set to ' + scaledFontSize );
+ $( document ).ready( function ( ) {
+ $( '.ui-mobile' ).children( 'body' ).css( { 'font-size': scaledFontSize + "px" } );
+ } );
+ },
+
+ setScaling: function ( ) {
+ var viewportWidth = this.frameworkData.viewportWidth,
+ themeDefaultFontSize = this.frameworkData.defaultFontSize, // comes from theme.js
+ ratio = 1;
+
+ // Keep original font size
+ $( 'body' ).attr( 'data-tizen-theme-default-font-size', themeDefaultFontSize );
+
+ if ( !tizen.util.isMobileBrowser() ) {
+ return;
+ }
+
+ // Legacy support: tizen.frameworkData.viewportScale
+ if ( this.frameworkData.viewportScale == true ) {
+ viewportWidth = "screen-width";
+ }
+
+ if ( "screen-width" == viewportWidth ) {
+ viewportWidth = document.documentElement.clientWidth;
+ }
+
+ viewportWidth = this.setViewport( viewportWidth ); // If custom viewport setting exists, get viewport width
+
+ if ( isNaN( viewportWidth ) ) { // device-width
+ // By default, when the viewport is set to device-width, default font-size is not changed.
+ // However, if current document width is less than defaultViewportWidth(determined by theme),
+ // default font-size is scaled to scale widgets smaller.
+ if( document.documentElement.clientWidth < this.frameworkData.defaultViewportWidth ) {
+ ratio = parseFloat( document.documentElement.clientWidth / this.frameworkData.defaultViewportWidth );
+ }
+ } else { // fixed width!
+ ratio = parseFloat( viewportWidth / this.frameworkData.defaultViewportWidth );
+ }
+ this.scaleBaseFontSize( themeDefaultFontSize, ratio );
+ },
+ };
+
+ function export2TizenNS ( $, tizen ) {
+ if ( !$.tizen ) {
+ $.tizen = { };
+ }
+
+ $.tizen.frameworkData = tizen.frameworkData;
+ $.tizen.loadCustomGlobalizeCulture = tizen.loadCustomGlobalizeCulture;
+ $.tizen.loadTheme = tizen.loadTheme;
+
+ $.tizen.__tizen__ = tizen; // for unit-test
+ }
+
+ export2TizenNS( $, tizen );
+
+ tizen.getParams( );
+ tizen.loadTheme( );
+ tizen.setScaling( ); // Run after loadTheme(), for the default font size.
+ tizen.setGlobalize( );
+ // Turn off JQM's auto initialization option.
+ // NOTE: This job must be done before domready.
+ $.mobile.autoInitializePage = false;
+
+ $(document).ready( function ( ) {
+ $.mobile.initializePage( );
+ });
+
+} ( jQuery, window.Globalize, window ) );
+
+
+\r
+\r
+/* ***************************************************************************\r
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.\r
+ *\r
+ * Permission is hereby granted, free of charge, to any person obtaining a\r
+ * copy of this software and associated documentation files (the "Software"),\r
+ * to deal in the Software without restriction, including without limitation\r
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,\r
+ * and/or sell copies of the Software, and to permit persons to whom the\r
+ * Software is furnished to do so, subject to the following conditions:\r
+ *\r
+ * The above copyright notice and this permission notice shall be included in\r
+ * all copies or substantial portions of the Software.\r
+ *\r
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\r
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\r
+ * DEALINGS IN THE SOFTWARE.\r
+ * ***************************************************************************\r
+ *\r
+ * Authors: Hyunsook Park <hyunsook.park@samsung.com>\r
+ * Wonseop Kim <wonseop.kim@samsung.com>\r
+ */\r
+\r
+/**\r
+ * 'Gallery3D' is a 3D photo gallery widget.\r
+ * Images are arranged with a S-shaped curve on a 3-dimensional coordinate system.\r
+ * A user can rotate images by swiping the widget area.\r
+ * To improve performance, the size of image(s) displayed on the screen should be a square(under\r
+ * 128X128 pixel) as possible. But if a user can't resize the images, this widget supports an image\r
+ * resizing feature and he/she can use it with "data-thumbnail-cache" option. ("data-thumbnail-cache"\r
+ * option resizes the gallery images under 128x128 pixels and stores the images on a local storage.\r
+ * So when a gallery3D widget is re-launched, the widget reuse the storage and a user can improve\r
+ * launching time. A browser or web runtime engine should support "Web Storage" feature to use that\r
+ * option.)\r
+ *\r
+ * HTML Attributes:\r
+ *\r
+ * data-thumbnail-cache : Determines whether to cache and resize images.\r
+ *\r
+ * APIs:\r
+ *\r
+ * next ( void )\r
+ * : This method moves each image forward one by one.\r
+ * prev ( void )\r
+ * : This method moves each image backward one by one.\r
+ * select ( [number] )\r
+ * : When the "select" method is called with an argument, the method selects the image of given index.\r
+ * If the method is called with no argument, it will return the Javascript object having "src"\r
+ * attribute having the selected image’s URL.\r
+ * add ( object or string [, number] )\r
+ * This method adds an image to Gallery3D widget.\r
+ * If the second argument isn't inputted, the image is added at the 0th position.\r
+ * remove ( [number] )\r
+ * : This method deletes an image from Gallery3d widget.\r
+ * The argument defines the index of the image to be deleted.\r
+ * If an argument isn't inputted, it removes current image.\r
+ * clearThumbnailCache ( void )\r
+ * : This method clears the cache data of all images when thumbnailCache option is set as 'true'.\r
+ * refresh ( void )\r
+ * : This method updates and redraws current widget.\r
+ * empty ( void )\r
+ * : This method removes all of images from Gallery3D widget.\r
+ * length ( void )\r
+ * : This method gets the number of images.\r
+ *\r
+ * Events:\r
+ *\r
+ * select : Triggered when an image is selected.\r
+ *\r
+ * Examples:\r
+ *\r
+ * <script>\r
+ * $( "#gallery3d" ).on( "gallery3dcreate", function () {\r
+ * $( "#gallery3d" ).gallery3d( "add", "01.jpg" );\r
+ * });\r
+ * </script>\r
+ * <div id="gallery3d" data-role="gallery3d"></div>\r
+ */\r
+\r
+/**\r
+ @class Gallery3D\r
+ The gallery3d widget is a 3D photo gallery widget.\r
+ Images are arranged with a S-shaped curve on a 3-dimensional coordinate system.\r
+ A user can rotate images by swiping the widget area.\r
+ <br/><br/>To add an gallery3d widget to the application, use the following code:\r
+\r
+ <script>\r
+ $( "#gallery3d" ).on( "gallery3dcreate", function () {\r
+ $( "#gallery3d" ).gallery3d( "add", "01.jpg" );\r
+ });\r
+ </script>\r
+ <div id="gallery3d" data-role="gallery3d"></div>\r
+*/\r
+/**\r
+ @property {Boolean} data-thumbnail-cache\r
+ Determines whether to cache and resize images.\r
+ To improve performance, the size of image(s) displayed on the screen should be a square (under 128X128 pixels).\r
+ "data-thumbnail-cache" option resizes the gallery images under 128x128 pixels and stores the images on a local storage.\r
+ So when a gallery3D widget is re-launched, the widget reuses the storage and the launching time can be improved.\r
+ A browser or web runtime engine must support "Web Storage" feature to use this option.\r
+*/\r
+/**\r
+ @event select\r
+ Triggered when an image is selected.\r
+\r
+ <script>\r
+ $( "#gallery3d" ).on( "gallery3dcreate", function () {\r
+ $( "#gallery3d" ).gallery3d( "add", { src: "1.jpg" } )\r
+ .gallery3d( "add", { src: "2.jpg" } )\r
+ .gallery3d( "add", { src: "3.jpg" } );\r
+ }).on( "select", function ( event, data, index ) {\r
+ // Handle the select event\r
+ var urlOfImage = data.src, indexOfImage = index;\r
+ });\r
+ </script>\r
+ <div id="gallery3d" data-role="gallery3d"></div>\r
+*/\r
+/**\r
+ @method next\r
+ This method moves each image forward one by one.\r
+\r
+ <script>\r
+ $( "#gallery3d" ).on( "gallery3dcreate", function () {\r
+ $( "#gallery3d" ).gallery3d( "add", { src: "1.jpg" } )\r
+ .gallery3d( "add", { src: "2.jpg" } )\r
+ .gallery3d( "add", { src: "3.jpg" } )\r
+ .gallery3d( "next" );\r
+ });\r
+ </script>\r
+ <div id="gallery3d" data-role="gallery3d"></div>\r
+*/\r
+/**\r
+ @method prev\r
+ This method moves each image backward one by one.\r
+\r
+ <script>\r
+ $( "#gallery3d" ).on( "gallery3dcreate", function () {\r
+ $( "#gallery3d" ).gallery3d( "add", { src: "1.jpg" } )\r
+ .gallery3d( "add", { src: "2.jpg" } )\r
+ .gallery3d( "add", { src: "3.jpg" } )\r
+ .gallery3d( "prev" );\r
+ });\r
+ </script>\r
+ <div id="gallery3d" data-role="gallery3d"></div>\r
+*/\r
+/**\r
+ @method select\r
+ When the "select" method is called with an argument, the method selects the image of given index.\r
+ If the method is called with no argument, it will return the Javascript object having "src" attribute having the selected image’s URL.\r
+\r
+ <script>\r
+ $( "#gallery3d" ).on( "gallery3dcreate", function () {\r
+ $( "#gallery3d" ).gallery3d( "add", { src: "1.jpg" } )\r
+ .gallery3d( "add", { src: "2.jpg" } )\r
+ .gallery3d( "add", { src: "3.jpg" } );\r
+ var selectedImage = $("#gallery3d"). gallery3d( "select" );\r
+ // selectedImage = { src: "3.jpg" };\r
+ });\r
+ </script>\r
+ <div id="gallery3d" data-role="gallery3d"></div>\r
+*/\r
+/**\r
+ @method add\r
+ This method adds an image to Gallery3D widget.\r
+ The first argument is a Javascript object having a "src" attribute or a string of image's path.\r
+ The second argument is an index of images.\r
+ If second argument isn't inputted, the image is added at the 0th position.\r
+\r
+ <script>\r
+ $( "#gallery3d" ).on( "gallery3dcreate", function () {\r
+ $( "#gallery3d" ).gallery3d( "add", { src: "1.jpg" } )\r
+ .gallery3d( "add", "2.jpg", 1 );\r
+ });\r
+ </script>\r
+ <div id="gallery3d" data-role="gallery3d"></div>\r
+*/\r
+/**\r
+ @method remove\r
+ This method deletes an image from Gallery3d widget.\r
+ The argument defines the index of the image to be deleted.\r
+ If an argument isn't inputted, it removes current image.\r
+\r
+ <script>\r
+ $( "#gallery3d" ).on( "gallery3dcreate", function () {\r
+ $( "#gallery3d" ).gallery3d( "add", { src: "1.jpg" } )\r
+ .gallery3d( "add", { src: "2.jpg" } )\r
+ .gallery3d( "add", { src: "3.jpg" } );\r
+\r
+ $( "#gallery3d" ).gallery3d( "remove" );\r
+ $( "#gallery3d" ).gallery3d( "remove", 1 );\r
+ });\r
+ </script>\r
+ <div id="gallery3d" data-role="gallery3d"></div>\r
+*/\r
+/**\r
+ @method clearThumbnailCache\r
+ This method clears the cache data of all images when thumbnailCache option is set as 'true'\r
+\r
+ <script>\r
+ $( "#gallery3d" ).on( "gallery3dcreate", function () {\r
+ $( "#gallery3d" ).gallery3d( "add", { src: "1.jpg" } )\r
+ .gallery3d( "add", { src: "2.jpg" } )\r
+ .gallery3d( "add", { src: "3.jpg" } );\r
+\r
+ $( "#gallery3d" ).gallery3d( "clearThumbnailCache" );\r
+ });\r
+ </script>\r
+ <div id="gallery3d" data-role="gallery3d" data-thumbnail-cache="true"></div>\r
+*/\r
+/**\r
+ @method refresh\r
+ This method updates and redraws current widget.\r
+\r
+ <script>\r
+ $( "#gallery3d" ).on( "gallery3dcreate", function () {\r
+ $( "#gallery3d" ).gallery3d( "add", { src: "1.jpg" } )\r
+ .gallery3d( "add", { src: "2.jpg" } )\r
+ .gallery3d( "add", { src: "3.jpg" } );\r
+\r
+ $( "#gallery3d" ).gallery3d( "refresh" );\r
+ });\r
+ </script>\r
+ <div id="gallery3d" data-role="gallery3d"></div>\r
+*/\r
+/**\r
+ @method empty\r
+ This method removes all of images from Gallery3D widget.\r
+\r
+ <script>\r
+ $( "#gallery3d" ).on( "gallery3dcreate", function () {\r
+ $( "#gallery3d" ).gallery3d( "add", { src: "1.jpg" } )\r
+ .gallery3d( "add", { src: "2.jpg" } )\r
+ .gallery3d( "add", { src: "3.jpg" } );\r
+\r
+ $( "#gallery3d" ).gallery3d( "empty" );\r
+ });\r
+ </script>\r
+ <div id="gallery3d" data-role="gallery3d"></div>\r
+*/\r
+/**\r
+ @method length\r
+ This method gets the number of images.\r
+\r
+ <script>\r
+ $( "#gallery3d" ).on( "gallery3dcreate", function () {\r
+ $( "#gallery3d" ).gallery3d( "add", { src: "1.jpg" } )\r
+ .gallery3d( "add", { src: "2.jpg" } )\r
+ .gallery3d( "add", { src: "3.jpg" } );\r
+\r
+ var imagesLength = $( "#gallery3d" ).gallery3d( "length" );\r
+ // imagesLength = 3;\r
+ });\r
+ </script>\r
+ <div id="gallery3d" data-role="gallery3d"></div>\r
+*/\r
+\r
+( function ( $, document, window, undefined ) {\r
+ window.requestAnimationFrame = ( function () {\r
+ return function ( callback ) {\r
+ var id = window.setTimeout( callback, 1000 / 60 );\r
+ return id;\r
+ };\r
+ } () );\r
+\r
+ window.cancelAnimationFrame = ( function () {\r
+ return function ( id ) {\r
+ window.clearTimeout( id );\r
+ };\r
+ } () );\r
+\r
+ var vec3 = window.vec3,\r
+ mat3 = window.mat3,\r
+ mat4 = window.mat4,\r
+ GlArray32 = ( typeof window.Float32Array !== "undefined" ? window.Float32Array : ( typeof window.WebGLFloatArray !== "undefined" ? window.WebGLFloatArray : Array ) ),\r
+ GlArray16 = ( typeof window.Uint16Array !== "undefined" ? window.Uint16Array : Array ),\r
+ getContext3D = function ( canvas ) {\r
+ var gl, i,\r
+ contextNames = [ "experimental-webgl", "webkit-3d", "webgl", "moz-webgl" ];\r
+\r
+ for ( i = 0; i < contextNames.length; i += 1 ) {\r
+ try {\r
+ gl = canvas.getContext( contextNames[i] );\r
+ if ( gl ) {\r
+ break;\r
+ }\r
+ } catch ( e ) {\r
+ window.alert( "Unfortunately, there's a WebGL compatibility problem. </br> You may want to check your system settings." );\r
+ return;\r
+ }\r
+ }\r
+ return gl;\r
+ },\r
+ VERTEX_SHADER = [\r
+ "attribute vec3 aVertexPosition;",\r
+ "attribute vec2 aTextureCoord;",\r
+ "attribute vec3 aVertexNormal;",\r
+ "uniform mat4 uMoveMatrix;",\r
+ "uniform mat4 uPerspectiveMatrix;",\r
+ "uniform mat3 nNormalMatrix;",\r
+ "uniform vec3 uAmbientColor;",\r
+ "uniform vec3 uLightDirection;",\r
+ "uniform vec3 uDirectionColor;",\r
+ "uniform vec3 uLightDirection_first;",\r
+ "uniform vec3 uLightDirection_second;",\r
+ "varying vec2 vTextureCoord;",\r
+ "varying vec3 vLightWeight;",\r
+ "varying vec4 vFogWeight;",\r
+\r
+ "void main(void) {",\r
+ " vec4 v_Position = uMoveMatrix * vec4(aVertexPosition, 1.0);",\r
+ " gl_Position = uPerspectiveMatrix * v_Position;",\r
+ " vTextureCoord = aTextureCoord;",\r
+ " float fog = 1.0 - ((gl_Position.z + 1.5) / 60.0);",\r
+ " vFogWeight = clamp( vec4( fog, fog, fog, 1.0), 0.0, 1.0);",\r
+ " vec3 transNormalVector = nNormalMatrix * aVertexNormal;",\r
+\r
+ " float vLightWeightFirst = 0.0;",\r
+ " float vLightWeightSecond = max( dot(transNormalVector, uLightDirection_second), 0.0 );",\r
+\r
+ " vLightWeight = uAmbientColor + uDirectionColor * vLightWeightSecond;",\r
+ "}"\r
+ ].join( "\n" ),\r
+ FRAGMENT_SHADER = [\r
+ "precision mediump float;",\r
+ "varying vec2 vTextureCoord;",\r
+ "varying vec3 vLightWeight;",\r
+ "uniform sampler2D uSampler;",\r
+ "varying vec4 vFogWeight;",\r
+\r
+ "void main(void) {",\r
+ " vec4 TextureColor = (texture2D(uSampler, vec2(vTextureCoord.s, vTextureCoord.t))) * vFogWeight;",\r
+ " gl_FragColor = vec4(TextureColor.rgb * vLightWeight, TextureColor.a);",\r
+ "}"\r
+ ].join( "\n" );\r
+\r
+ function Node() {\r
+ this.vertices = [\r
+ -1.0, -1.0, 0.0,\r
+ 1.0, -1.0, 0.0,\r
+ 1.0, 1.0, 0.0,\r
+ -1.0, 1.0, 0.0\r
+ ];\r
+ this.textureCoords = [\r
+ 1.0, 0.0,\r
+ 0.0, 0.0,\r
+ 0.0, 1.0,\r
+ 1.0, 1.0\r
+ ];\r
+ this.normalVectors = [\r
+ 0.0, 0.0, 1.0,\r
+ 0.0, 0.0, 1.0,\r
+ 0.0, 0.0, 1.0,\r
+ 0.0, 0.0, 1.0\r
+ ];\r
+ this.texture = null;\r
+ this.textureBuffer = null;\r
+ this.textureBufferItemSize = 0;\r
+ this.mashOrder = [];\r
+ this.mvMatrix = null;\r
+ this.level = -1;\r
+ this.targetLevel = 0;\r
+ this.drawable = false;\r
+ this.image = null;\r
+ this.imageID = 0;\r
+ }\r
+\r
+ $.widget( "tizen.gallery3d", $.mobile.widget, {\r
+ options: {\r
+ thumbnailCache: false\r
+ },\r
+\r
+ _MAX_ITEM_COUNT: 28,\r
+ _ANIMATION_END: 999,\r
+ _DURATION_DEFAULT: 300,\r
+ _DURATION_FIRST: 1600,\r
+ _VIEWPORT_WIDTH: 1024,\r
+ _VIEWPORT_HEIGHT: 456,\r
+ _DIRECTION_LEFT: -1,\r
+ _DIRECTION_RIGHT: +1,\r
+\r
+ _gl: null,\r
+ _shaderProgram : null,\r
+ _positionBuffer : null,\r
+ _textureCoordBuffer : null,\r
+ _normalVectorBuffer : null,\r
+ _nodes: null,\r
+ _pMatrix : null,\r
+ _animationID: 0,\r
+ _dragInterval : 0,\r
+ _startTime : 0,\r
+ _sumTime : 0,\r
+ _lightsPositionStack : [\r
+ [0.0, 0.0, -1.0], // back\r
+ [-0.2, 0.0, 0.7] // front\r
+ ],\r
+ _path: null,\r
+ _swipeThresholdOfBasetimeGap: ( $.support.touch ? 30 : 70 ),\r
+ _swipeThresholdOfSensitivity: ( $.support.touch ? 2.0 : 10.0 ),\r
+ _canvas: null,\r
+ _imageList: [],\r
+ _maxDrawLength: 0,\r
+ _firstImageNumber: 0,\r
+ _lastImageNumber: 0,\r
+\r
+ _create: function () {\r
+ var self = this,\r
+ view = self.element,\r
+ option = self.options;\r
+\r
+ self._canvas = $( "<canvas class='ui-gallery3d-canvas'></canvas>" );\r
+\r
+ view.addClass( "ui-gallery3d" ).append( self._canvas );\r
+ self._addBehavier();\r
+\r
+ self._dragInterval = 1000 / 30; // 30fps\r
+\r
+ $.each( self.options, function ( key, value ) {\r
+ self.options[ key ] = undefined;\r
+ self._setOption( key, value );\r
+ });\r
+\r
+ },\r
+\r
+ _setOption: function ( key, value ) {\r
+ switch ( key ) {\r
+ case "thumbnailCache" :\r
+ if ( typeof value === "string" ) {\r
+ value = ( value === "true" ) ? true : false;\r
+ } else {\r
+ value = !!value;\r
+ }\r
+ this._reset();\r
+ break;\r
+ }\r
+\r
+ $.mobile.widget.prototype._setOption.call( this, key, value );\r
+ },\r
+\r
+ _init: function ( canvas ) {\r
+ var self = this,\r
+ pathPoints = [\r
+ [40, 0, -48],\r
+ [-12, 0, -40], // contorl Point of Point1\r
+ [24, 0, -9], // contorl Point of Point2\r
+ [-5, 0, -5]\r
+ ],\r
+ i;\r
+\r
+ canvas = canvas || self._canvas;\r
+\r
+ if ( !canvas ) {\r
+ return;\r
+ }\r
+\r
+ self._gl = self._gl || self._initGL( canvas[0] );\r
+ if ( !self._gl ) {\r
+ return;\r
+ }\r
+\r
+ if ( !self._imageList ) {\r
+ return;\r
+ }\r
+\r
+ self._shaderProgram = self._shaderProgram || self._initShader( self._gl );\r
+ if ( !self._shaderProgram ) {\r
+ return;\r
+ }\r
+\r
+ if ( self._imageList.length > self._MAX_ITEM_COUNT ) {\r
+ self._firstImageNumber = self._imageList.length - 1;\r
+ self._lastImageNumber = self._MAX_ITEM_COUNT - 1;\r
+ }\r
+\r
+ self._nodes = self._initBuffers( self._gl, self._shaderProgram );\r
+ self._initTextures( self._gl, self._nodes );\r
+ self._path = $.motionpath( "bspline", {\r
+ points: pathPoints,\r
+ maxLevel: self._MAX_ITEM_COUNT\r
+ } );\r
+ for ( i = 0; i < self._nodes.length; i += 1 ) {\r
+ self._path.levels[i] = self._path.levels[i + 1] || 0;\r
+ self._nodes[i].level = i;\r
+ }\r
+ },\r
+\r
+ _final: function ( canvas ) {\r
+ var self = this,\r
+ gl = self._gl;\r
+\r
+ if ( !gl ) {\r
+ return;\r
+ }\r
+\r
+ canvas = canvas || self._canvas;\r
+\r
+ $( self._nodes ).each( function ( i ) {\r
+ var node = self._nodes[i];\r
+ gl.deleteTexture( node.texture );\r
+ node.texture = null;\r
+ });\r
+ self._nodes = null;\r
+\r
+ gl.deleteBuffer( self._positionBuffer );\r
+ self._positionBuffer = null;\r
+ gl.deleteBuffer( self._textureCoordBuffer );\r
+ self._textureCoordBuffer = null;\r
+ gl.deleteBuffer( self._normalVectorBuffer );\r
+ self._normalVectorBuffer = null;\r
+\r
+ $.webgl.shader.deleteShaders( gl );\r
+ gl.deleteProgram( self._shaderProgram );\r
+ self._shaderProgram = null;\r
+\r
+ self._gl = gl = null;\r
+ },\r
+\r
+ _addBehavier : function () {\r
+ var self = this,\r
+ view = self.element,\r
+ canvas = self._canvas,\r
+ touchStartEvt = ( $.support.touch ? "touchstart" : "mousedown" ),\r
+ touchMoveEvt = ( $.support.touch ? "touchmove" : "mousemove" ) + ".gallery3d",\r
+ touchEndEvt = ( $.support.touch ? "touchend" : "mouseup" ) + ".gallery3d",\r
+ touchLeaveEvt = ( $.support.touch ? "touchleave" : "mouseout" ) + ".gallery3d";\r
+\r
+ $( document ).unbind( ".gallery3d" ).bind( "pagechange.gallery3d", function ( e ) {\r
+ $( e.target ).find( ".ui-gallery3d" ).gallery3d( "refresh" );\r
+ }).bind( "pageremove.gallery3d", function ( e ) {\r
+ $( e.target ).find( ".ui-gallery3d" ).trigger( "_destory" );\r
+ });\r
+\r
+ $( window ).unbind( ".gallery3d" ).bind( "resize.gallery3d orientationchange.gallery3d", function ( e ) {\r
+ $( ".ui-page-active" ).find( ".ui-gallery3d" ).gallery3d( "refresh" );\r
+ }).bind( "unload.gallery3d", function ( e ) {\r
+ $( e.target ).find( ".ui-gallery3d" ).trigger( "_destory" );\r
+ });\r
+\r
+ view.bind( "_destory", function ( e ) {\r
+ self._final();\r
+ });\r
+\r
+ canvas.bind( "webglcontextlost", function ( e ) {\r
+ e.preventDefault();\r
+ }).bind( "webglcontextrestored", function ( e ) {\r
+ self._init();\r
+ }).bind( touchStartEvt, function ( e ) {\r
+ var i = 0,\r
+ startX = 0,\r
+ deltaMaxSteps = 20,\r
+ deltas = [ deltaMaxSteps ],\r
+ deltaTimes = [ deltaMaxSteps ],\r
+ deltaIndex = 0,\r
+ dragValue = 0,\r
+ dragDirection = false,\r
+ prevTime = 0;\r
+\r
+ e.preventDefault();\r
+ e.stopPropagation();\r
+\r
+ if ( self._imageList.length <= 1 ) {\r
+ return;\r
+ }\r
+\r
+ self._stop();\r
+\r
+ startX = $.support.touch ? e.originalEvent.changedTouches[0].pageX : e.pageX;\r
+ prevTime = $.now();\r
+\r
+ for ( i = 0; i < deltaMaxSteps; i += 1 ) {\r
+ deltas[i] = startX;\r
+ deltaTimes[i] = $.now();\r
+ }\r
+\r
+ deltaIndex += 1;\r
+\r
+ view.bind( touchMoveEvt, function ( e ) {\r
+ var x, dx, interval;\r
+\r
+ e.preventDefault();\r
+ e.stopPropagation();\r
+\r
+ x = $.support.touch ? e.originalEvent.changedTouches[0].pageX : e.pageX;\r
+ dx = startX - x;\r
+\r
+ deltas[deltaIndex] = x;\r
+ deltaTimes[deltaIndex] = $.now();\r
+ interval = deltaTimes[deltaIndex] - prevTime;\r
+\r
+ deltaIndex = ( deltaIndex + 1 ) % deltaMaxSteps;\r
+\r
+ // Validation of drag\r
+ if ( Math.abs( dx ) >= 10 && interval >= self._dragInterval ) {\r
+ if ( dragDirection !== ( ( dx < 0 ) ? self._DIRECTION_RIGHT : self._DIRECTION_LEFT ) ) {\r
+ dragValue = 0;\r
+ dragDirection = ( dx < 0 ) ? self._DIRECTION_RIGHT : self._DIRECTION_LEFT;\r
+ }\r
+\r
+ dragValue += Math.abs( dx ) / 100;\r
+ if ( dragValue >= 1 ) {\r
+ self._setPosition( self._ANIMATION_END, dragDirection );\r
+ dragValue = 0;\r
+ } else {\r
+ self._setPosition( dragValue, dragDirection );\r
+ }\r
+ self._drawScene();\r
+ startX = x;\r
+ prevTime = $.now();\r
+ }\r
+ }).bind( touchEndEvt, function ( e ) {\r
+ var baseTime = 0,\r
+ recent = -1,\r
+ index = 0,\r
+ previous = 0,\r
+ baseTimeRatio = 0,\r
+ fx = 0,\r
+ lastX = 0,\r
+ velocityX = 0,\r
+ dx = 0,\r
+ isSwipe = true,\r
+ direction;\r
+\r
+ e.preventDefault();\r
+ e.stopPropagation();\r
+\r
+ // Validation of swipe\r
+ baseTime = $.now() - self._swipeThresholdOfBasetimeGap;\r
+ lastX = $.support.touch ? e.originalEvent.changedTouches[0].pageX : e.pageX;\r
+ dx = startX - lastX;\r
+ startX = 0;\r
+ for ( i = 0; i < deltaMaxSteps; i += 1 ) {\r
+ index = ( deltaIndex + i ) % deltaMaxSteps;\r
+ if ( deltaTimes[index] > baseTime ) {\r
+ recent = index;\r
+ break;\r
+ }\r
+ }\r
+ if ( recent < 0 ) {\r
+ isSwipe = false;\r
+ }\r
+\r
+ if ( isSwipe ) {\r
+ previous = recent;\r
+ for ( i = 0; i < deltaMaxSteps; i += 1 ) {\r
+ previous = ( previous - 1 + deltaMaxSteps ) % deltaMaxSteps;\r
+ if ( deltaTimes[previous] < deltaTimes[recent] ) {\r
+ break;\r
+ }\r
+ }\r
+ // too slow or too fast\r
+ if ( i === deltaMaxSteps || baseTime < deltaTimes[previous] ) {\r
+ isSwipe = false;\r
+ }\r
+ }\r
+\r
+ if ( isSwipe ) {\r
+ baseTimeRatio = ( baseTime - deltaTimes[previous] ) / ( deltaTimes[recent] - deltaTimes[previous] );\r
+ fx = ( 1.0 - baseTimeRatio ) * deltas[previous] + baseTimeRatio * deltas[recent];\r
+ if ( Math.abs( fx - lastX ) < self._swipeThresholdOfSensitivity ) {\r
+ fx = lastX;\r
+ }\r
+ velocityX = parseInt( ( lastX - fx ) / ( $.now() - baseTime ), 10 );\r
+ }\r
+\r
+ if ( isSwipe && velocityX ) {\r
+ direction = ( velocityX < 0 ) ? self._DIRECTION_LEFT : self._DIRECTION_RIGHT;\r
+ self._run( direction, Math.abs( velocityX ), dragValue );\r
+ } else if ( dragDirection !== 0 && dragValue ) {\r
+ self._animate( null, self._DURATION_DEFAULT * ( 1 - dragValue ), dragDirection, 0, dragValue );\r
+ }\r
+\r
+ view.unbind( ".gallery3d" );\r
+ }).bind( touchLeaveEvt, function ( e ) {\r
+ view.trigger( touchEndEvt );\r
+ });\r
+ });\r
+ },\r
+\r
+ // ----------------------------------------------------------\r
+ // Data parsing\r
+ // ----------------------------------------------------------\r
+ _loadData: function ( jsonUrl, key ) {\r
+ var self = this;\r
+\r
+ $.ajax({\r
+ async : false,\r
+ url : jsonUrl,\r
+ dataType: "json",\r
+ success : function ( data ) {\r
+ self._imageList = $.extend( [], data[ key ] );\r
+ }\r
+ });\r
+ },\r
+\r
+ // ----------------------------------------------------------\r
+ // WebGL\r
+ // ----------------------------------------------------------\r
+ _initGL: function ( canvas ) {\r
+ var self = this,\r
+ gl;\r
+\r
+ gl = getContext3D( canvas );\r
+ if ( !gl ) {\r
+ window.alert( "There's no WebGL context available!!!" );\r
+ return null;\r
+ }\r
+\r
+ gl.enable( gl.BLEND );\r
+ gl.blendFunc( gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA );\r
+\r
+ gl.enable( gl.DEPTH_TEST );\r
+ gl.depthFunc( gl.LEQUAL );\r
+\r
+ canvas.width = self._VIEWPORT_WIDTH;\r
+ canvas.height = self._VIEWPORT_HEIGHT;\r
+ gl.viewportWidth = canvas.width;\r
+ gl.viewportHeight = canvas.height;\r
+ gl.viewport( 0, 0, gl.viewportWidth, gl.viewportHeight );\r
+ self._pMatrix = mat4.create();\r
+ mat4.perspective( 40, gl.viewportWidth / gl.viewportHeight, 0.1, 10000.0, self._pMatrix );\r
+\r
+ gl.clearColor( 0.0, 0.0, 0.0, 1.0 );\r
+ gl.clear( gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT );\r
+\r
+ return gl;\r
+ },\r
+\r
+ _initShader : function ( gl ) {\r
+ var self = this,\r
+ shaderProgram;\r
+\r
+ shaderProgram = $.webgl.shader.addShaderProgram( self._gl, VERTEX_SHADER, FRAGMENT_SHADER );\r
+ gl.useProgram( shaderProgram );\r
+\r
+ shaderProgram.vertexPositionAttr = gl.getAttribLocation( shaderProgram, "aVertexPosition" );\r
+ gl.enableVertexAttribArray( shaderProgram.vertexPositionAttr );\r
+\r
+ shaderProgram.textureCoordAttr = gl.getAttribLocation( shaderProgram, "aTextureCoord" );\r
+ gl.enableVertexAttribArray( shaderProgram.textureCoordAttr );\r
+\r
+ // Set light normal vectors for lighting~\r
+ shaderProgram.vertexNormalAttr = gl.getAttribLocation( shaderProgram, "aVertexNormal" );\r
+ gl.enableVertexAttribArray( shaderProgram.vertexNormalAttr );\r
+\r
+ shaderProgram.perspectiveMU = gl.getUniformLocation( shaderProgram, "uPerspectiveMatrix");\r
+ shaderProgram.transformMU = gl.getUniformLocation( shaderProgram, "uMoveMatrix");\r
+ shaderProgram.sampleUniform = gl.getUniformLocation( shaderProgram, "uSampler");\r
+\r
+ // Set light variables~\r
+ shaderProgram.normalMU = gl.getUniformLocation( shaderProgram, "nNormalMatrix");\r
+ shaderProgram.ambientColorU = gl.getUniformLocation( shaderProgram, "uAmbientColor");\r
+ shaderProgram.lightDirU_first = gl.getUniformLocation( shaderProgram, "uLightDirection_first");\r
+ shaderProgram.lightDirU_second = gl.getUniformLocation( shaderProgram, "uLightDirection_second");\r
+ shaderProgram.directionColorU = gl.getUniformLocation( shaderProgram, "uDirectionColor");\r
+\r
+ return shaderProgram;\r
+ },\r
+\r
+ _initBuffers: function ( gl, shaderProgram ) {\r
+ var self = this,\r
+ i = 0,\r
+ mashBase = 0,\r
+ vertices = [],\r
+ textureCoords = [],\r
+ normalVectors = [],\r
+ nodes = [],\r
+ maxDrawLength = self._MAX_ITEM_COUNT;\r
+\r
+ for ( i = 0; i < self._imageList.length + 1; i += 1 ) {\r
+ nodes[i] = new Node();\r
+ $.merge( vertices, nodes[i].vertices );\r
+ $.merge( textureCoords, nodes[i].textureCoords );\r
+ $.merge( normalVectors, nodes[i].normalVectors );\r
+\r
+ nodes[i].textureBuffer = gl.createBuffer();\r
+ gl.bindBuffer( gl.ELEMENT_ARRAY_BUFFER, nodes[i].textureBuffer );\r
+ mashBase = i * 4;\r
+ nodes[i].meshOrder = [\r
+ mashBase, mashBase + 1, mashBase + 2,\r
+ mashBase + 2, mashBase + 3, mashBase\r
+ ];\r
+ gl.bufferData( gl.ELEMENT_ARRAY_BUFFER, new GlArray16( nodes[i].meshOrder ), gl.STATIC_DRAW );\r
+ gl.bindBuffer( gl.ELEMENT_ARRAY_BUFFER, null ); // release buffer memory\r
+ nodes[i].textureBufferItemSize = 6;\r
+ }\r
+\r
+ self._positionBuffer = $.webgl.buffer.attribBufferData( gl, new GlArray32( vertices ) );\r
+ self._positionBuffer.itemSize = 3;\r
+\r
+ self._textureCoordBuffer = $.webgl.buffer.attribBufferData( gl, new GlArray32( textureCoords ) );\r
+ self._textureCoordBuffer.itemSize = 2;\r
+\r
+ self._normalVectorBuffer = $.webgl.buffer.attribBufferData( gl, new GlArray32( normalVectors ) ); // Vertex's normal vector for Direction light\r
+ self._normalVectorBuffer.itemSize = 3;\r
+\r
+ // Ambient light\r
+ gl.uniform3f( shaderProgram.ambientColorU, 0.1, 0.1, 0.1 );\r
+ // Direcntion light\r
+ gl.uniform3f( shaderProgram.directionColorU, 1.0, 1.0, 1.0 );\r
+\r
+ return nodes;\r
+ },\r
+\r
+ // ----------------------------------------------------------\r
+ // Texture\r
+ // ----------------------------------------------------------\r
+ _initTextures: function ( gl, nodes ) {\r
+ var self = this;\r
+\r
+ $( nodes ).each( function ( i ) {\r
+ var node = nodes[i],\r
+ url;\r
+\r
+ if ( !self._imageList[i] ) {\r
+ return false;\r
+ }\r
+\r
+ url = self._imageList[i].src;\r
+ node.texture = gl.createTexture();\r
+ self._loadImage( url, i, i, gl, nodes );\r
+ });\r
+ },\r
+\r
+ _loadImage: function ( url, i, imageID, gl, nodes ) {\r
+ var self = this,\r
+ isMipmap = false,\r
+ image,\r
+ node;\r
+\r
+ gl = gl || self._gl;\r
+ nodes = nodes || self._nodes;\r
+ isMipmap = isMipmap || false;\r
+ node = nodes[i];\r
+ node.image = node.image || new Image();\r
+\r
+ $( node.image ).one( "load", function ( e ) {\r
+ self._bindTexture( gl, node, this, isMipmap );\r
+ node.imageID = imageID;\r
+\r
+ if ( !self._animationID ) {\r
+ self._setPosition( 0, 0 );\r
+ }\r
+ });\r
+\r
+ if ( self.options.thumbnailCache ) {\r
+ $.imageloader.getThumbnail( url, function ( result ) {\r
+ if ( result === "NOT_FOUND_ERR" ) {\r
+ $.imageloader.setThumbnail( url, function ( result ) {\r
+ if ( result && result.length > 30 ) {\r
+ node.image.src = result;\r
+ isMipmap = true;\r
+ } else {\r
+ node.image.src = url;\r
+ }\r
+ });\r
+ } else if ( result && result.length > 30 ) {\r
+ node.image.src = result;\r
+ isMipmap = true;\r
+ } else {\r
+ node.image.src = url;\r
+ }\r
+ });\r
+ } else {\r
+ node.image.src = url;\r
+ }\r
+ },\r
+\r
+ _bindTexture: function ( gl, node, image, isMipmap ) {\r
+ if ( !node || !node.texture ) {\r
+ return;\r
+ }\r
+\r
+ gl.pixelStorei( gl.UNPACK_FLIP_Y_WEBGL, true );\r
+\r
+ gl.bindTexture( gl.TEXTURE_2D, node.texture );\r
+ gl.texImage2D( gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, image );\r
+\r
+ if ( isMipmap ) {\r
+ gl.texParameteri( gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR );\r
+ gl.texParameteri( gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR_MIPMAP_NEAREST );\r
+ gl.generateMipmap( gl.TEXTURE_2D );\r
+ } else {\r
+ gl.texParameteri( gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR );\r
+ gl.texParameteri( gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR );\r
+ }\r
+\r
+ gl.texParameteri( gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE );\r
+ gl.texParameteri( gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE );\r
+\r
+ node.texture.loaded = true;\r
+\r
+ // release texture memory\r
+ gl.bindTexture( gl.TEXTURE_2D, null );\r
+ },\r
+\r
+ // ----------------------------------------------------------\r
+ // rendering\r
+ // ----------------------------------------------------------\r
+ _setPosition: function ( progress, direction ) {\r
+ var self = this,\r
+ nodes = self._nodes,\r
+ imageList = self._imageList,\r
+ imageListLength = imageList.length,\r
+ itemCount = self._MAX_ITEM_COUNT,\r
+ displayLength = ( imageListLength > itemCount ) ? itemCount : imageListLength,\r
+ nextLevelLenth = 0,\r
+ i = 0,\r
+ t = 0,\r
+ position = 0,\r
+ angle = 0,\r
+ current = 0,\r
+ next = 0,\r
+ nextLevel = 0,\r
+ path = self._path,\r
+ nextImageID = 0;\r
+\r
+ nextLevelLenth = ( direction >= 0 ) ? displayLength + 1 : displayLength;\r
+\r
+ if ( !nodes[i].level ) {\r
+ nodes[i].level = displayLength;\r
+ }\r
+\r
+ for ( i = 0; i < displayLength; i += 1 ) {\r
+ if ( !nodes[i].mvMatrix ) {\r
+ nodes[i].mvMatrix = mat4.create();\r
+ }\r
+\r
+ if ( direction > 0 && nodes[i].level >= displayLength ) {\r
+ nodes[i].level = 0;\r
+ }\r
+\r
+ current = path.levels[nodes[i].level];\r
+ nextLevel = ( nodes[i].level + nextLevelLenth + direction ) % nextLevelLenth;\r
+ next = path.levels[nextLevel];\r
+\r
+ if ( imageListLength > itemCount ) {\r
+ if ( direction > 0 && nextLevel === 1\r
+ && self._firstImageNumber !== nodes[i].imageID ) {\r
+ self._loadImage( imageList[self._firstImageNumber].src, i, self._firstImageNumber );\r
+ } else if ( direction < 0 && nextLevel === nextLevelLenth - 1\r
+ && self._lastImageNumber !== nodes[i].imageID ) {\r
+ self._loadImage( imageList[self._lastImageNumber].src, i, self._lastImageNumber );\r
+ }\r
+ }\r
+\r
+ mat4.identity( nodes[i].mvMatrix );\r
+ mat4.translate( nodes[i].mvMatrix, [-2.0, -2.0, 1.0] );\r
+ mat4.rotate( nodes[i].mvMatrix, self._degreeToRadian( 19 ), [1, 0, 0] );\r
+\r
+ t = ( current + ( next - current ) * ( ( progress > 1 ) ? 1 : progress ) );\r
+\r
+ if ( progress >= self._ANIMATION_END ) {\r
+ nodes[i].level = nextLevel || displayLength;\r
+ t = path.levels[nodes[i].level];\r
+ }\r
+\r
+ if ( ( progress < self._ANIMATION_END )\r
+ && ( direction <= 0 && nodes[i].level < 1 ) ) {\r
+ nodes[i].drawable = false;\r
+ } else {\r
+ nodes[i].drawable = true;\r
+ }\r
+\r
+ if ( progress === self._ANIMATION_END && nodes[i].level === 1 ) {\r
+ self.element.trigger( "select", imageList[ nodes[i].imageID ], nodes[i].imageID );\r
+ }\r
+\r
+ position = path.getPosition( t );\r
+ angle = path.getAngle( t );\r
+\r
+ mat4.translate( nodes[i].mvMatrix, position );\r
+ mat4.rotate( nodes[i].mvMatrix, angle, [0, 1, 0] );\r
+ }\r
+\r
+ if ( imageListLength > itemCount && progress >= self._ANIMATION_END ) {\r
+ self._firstImageNumber = ( self._firstImageNumber - direction ) % imageListLength;\r
+ if ( self._firstImageNumber < 0 ) {\r
+ self._firstImageNumber = imageListLength - 1;\r
+ }\r
+\r
+ self._lastImageNumber = ( self._lastImageNumber - direction ) % imageListLength;\r
+ if ( self._lastImageNumber < 0 ) {\r
+ self._lastImageNumber = imageListLength - 1;\r
+ }\r
+ }\r
+ self._drawScene();\r
+ },\r
+\r
+ _drawScene: function () {\r
+ if ( !this._gl || !this._shaderProgram ) {\r
+ return;\r
+ }\r
+\r
+ var self = this,\r
+ gl = self._gl,\r
+ shaderProgram = self._shaderProgram,\r
+ nodes = self._nodes,\r
+ nodesLength = nodes.length,\r
+ i;\r
+\r
+ gl.clear( gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT );\r
+\r
+ gl.bindBuffer( gl.ARRAY_BUFFER, self._positionBuffer );\r
+ gl.vertexAttribPointer( shaderProgram.vertexPositionAttr, self._positionBuffer.itemSize, gl.FLOAT, false, 0, 0 );\r
+\r
+ gl.bindBuffer( gl.ARRAY_BUFFER, self._textureCoordBuffer );\r
+ gl.vertexAttribPointer( shaderProgram.textureCoordAttr, self._textureCoordBuffer.itemSize, gl.FLOAT, false, 0, 0 );\r
+\r
+ gl.bindBuffer( gl.ARRAY_BUFFER, self._normalVectorBuffer );\r
+ gl.vertexAttribPointer( shaderProgram.vertexNormalAttr, self._normalVectorBuffer.itemSize, gl.FLOAT, false, 0, 0 );\r
+\r
+ for ( i = 0; i < nodesLength; i += 1 ) {\r
+ if ( nodes[i].drawable ) {\r
+ self._drawElement( self._pMatrix, nodes[i] );\r
+ }\r
+ }\r
+ },\r
+\r
+ _drawElement: function ( perspectiveMatrix, targetNode ) {\r
+ var self = this,\r
+ gl = self._gl,\r
+ shaderProgram = self._shaderProgram,\r
+ moveMatrix = targetNode.mvMatrix,\r
+ texture = targetNode.texture,\r
+ meshIndexBuffer = targetNode.textureBuffer,\r
+ meshIndexBufferItemSize = targetNode.textureBufferItemSize,\r
+ lightPositions = self._lightsPositionStack,\r
+ LightDir,\r
+ normalMatrix;\r
+\r
+ if ( !moveMatrix ) {\r
+ return;\r
+ }\r
+\r
+ gl.activeTexture( gl.TEXTURE0 );\r
+ if ( texture && texture.loaded ) {\r
+ gl.bindTexture( gl.TEXTURE_2D, texture );\r
+ }\r
+ gl.uniform1i( shaderProgram.sampleUniform, 0 );\r
+\r
+ LightDir = vec3.create();\r
+ vec3.normalize( lightPositions[0], LightDir );\r
+ vec3.scale( LightDir, -8 );\r
+ gl.uniform3fv( shaderProgram.lightDirU_first, LightDir );\r
+\r
+ vec3.normalize( lightPositions[1], LightDir );\r
+ vec3.scale( LightDir, -1 );\r
+ gl.uniform3fv( shaderProgram.lightDirU_second, LightDir );\r
+ gl.bindBuffer( gl.ELEMENT_ARRAY_BUFFER, meshIndexBuffer );\r
+\r
+ gl.uniformMatrix4fv( shaderProgram.perspectiveMU, false, perspectiveMatrix );\r
+ gl.uniformMatrix4fv( shaderProgram.transformMU, false, moveMatrix );\r
+\r
+ normalMatrix = mat3.create();\r
+ mat4.toInverseMat3( moveMatrix, normalMatrix );\r
+ mat3.transpose( normalMatrix );\r
+ gl.uniformMatrix3fv( shaderProgram.normalMU, false, normalMatrix );\r
+\r
+ gl.drawElements( gl.TRIANGLES, meshIndexBufferItemSize, gl.UNSIGNED_SHORT, 0 );\r
+\r
+ // release buffer memory\r
+ gl.bindBuffer( gl.ARRAY_BUFFER, null );\r
+ gl.bindBuffer( gl.ELEMENT_ARRAY_BUFFER, null );\r
+\r
+ // release texture memory\r
+ gl.bindTexture( gl.TEXTURE_2D, null );\r
+ },\r
+\r
+ // ----------------------------------------------------------\r
+ // Animation\r
+ // ----------------------------------------------------------\r
+ _animate: function ( easingType, duration, direction, repeatCount, startValue, _removeCount ) {\r
+ var self = this,\r
+ timeNow = $.now(),\r
+ progress,\r
+ removeCount = 0;\r
+\r
+ easingType = easingType || "linear";\r
+ startValue = startValue || 0;\r
+ _removeCount = _removeCount || 0;\r
+\r
+ if ( self._sumTime >= duration ) {\r
+ self._setPosition( self._ANIMATION_END, direction );\r
+ self._stop();\r
+ return;\r
+ }\r
+\r
+ if ( self._startTime === 0 ) {\r
+ self._startTime = timeNow;\r
+ } else {\r
+ self._sumTime = timeNow - self._startTime;\r
+ progress = $.easing[ easingType ]( self._sumTime / duration, self._sumTime, startValue, repeatCount + 1, duration );\r
+ removeCount = parseInt( Math.abs( progress ), 10 );\r
+\r
+ if ( _removeCount !== removeCount ) {\r
+ self._setPosition( self._ANIMATION_END, direction );\r
+ _removeCount = removeCount;\r
+\r
+ if ( ( repeatCount - _removeCount ) >= 0 ) {\r
+ self._animate( easingType, duration, direction, repeatCount, startValue, _removeCount );\r
+ } else {\r
+ self._stop();\r
+ }\r
+ return;\r
+ }\r
+\r
+ self._setPosition( progress - _removeCount, direction );\r
+ }\r
+\r
+ self._animationID = window.requestAnimationFrame( function () {\r
+ self._animate( easingType, duration, direction, repeatCount, startValue, _removeCount );\r
+ });\r
+ },\r
+\r
+ _run: function ( direction, repeatCount, startValue ) {\r
+ var self = this,\r
+ repeat = repeatCount || 0,\r
+ duration = self._DURATION_DEFAULT * ( repeat + 1 );\r
+\r
+ if ( self._imageList.length <= 1 ) {\r
+ return;\r
+ }\r
+\r
+ startValue = startValue || 0;\r
+ duration = ( duration >= 0 ) ? duration : 0;\r
+\r
+ if ( self._animationID ) {\r
+ self._setPosition( self._ANIMATION_END, direction );\r
+ self._stop();\r
+ }\r
+\r
+ self._animate( "easeOutExpo", duration, direction, repeat, startValue );\r
+ },\r
+\r
+ _reset: function () {\r
+ if ( !this._canvas || !this._gl ) {\r
+ return;\r
+ }\r
+\r
+ this._final();\r
+ this._init();\r
+ this.refresh();\r
+ },\r
+\r
+ _stop: function () {\r
+ if ( this._animationID ) {\r
+ window.cancelAnimationFrame( this._animationID );\r
+ }\r
+ this._animationID = 0;\r
+\r
+ this._startTime = 0;\r
+ this._sumTime = 0;\r
+ },\r
+\r
+ _degreeToRadian: function ( degree ) {\r
+ return degree * Math.PI / 180;\r
+ },\r
+\r
+ next: function () {\r
+ this._run( this._DIRECTION_LEFT , 0 );\r
+ },\r
+\r
+ prev: function () {\r
+ this._run( this._DIRECTION_RIGHT, 0 );\r
+ },\r
+\r
+ refresh: function () {\r
+ var view = this.element,\r
+ canvas = view.find( "canvas.ui-gallery3d-canvas" );\r
+\r
+ if ( canvas.width() !== view.width() ) {\r
+ canvas.width( view.width() );\r
+ }\r
+\r
+ if ( !this._animationID ) {\r
+ this._setPosition( 0, 0 );\r
+ }\r
+ },\r
+\r
+ select: function ( index ) {\r
+ var nodes = this._nodes,\r
+ repeat,\r
+ i,\r
+ imageID,\r
+ object = null,\r
+ target = 0,\r
+ direction = 0;\r
+\r
+ if ( index && this._animationID ) {\r
+ this._stop();\r
+ }\r
+\r
+ for ( i in nodes ) {\r
+ if ( nodes[i].level === 1 ) {\r
+ object = this._imageList[ nodes[i].imageID ];\r
+ imageID = nodes[i].imageID;\r
+ break;\r
+ }\r
+ }\r
+\r
+ if ( !index ) {\r
+ return object;\r
+ }\r
+\r
+ if ( index < 0 && index >= this._imageList.length ) {\r
+ return;\r
+ }\r
+\r
+ target = index - imageID;\r
+ direction = ( target > 0 ) ? this._DIRECTION_LEFT\r
+ : ( ( target < 0 ) ? this._DIRECTION_RIGHT : 0 );\r
+ if ( direction ) {\r
+ this._run( direction, Math.abs( target ) - 1 );\r
+ }\r
+ },\r
+\r
+ add: function ( item, index ) {\r
+ if ( !item ) {\r
+ return;\r
+ }\r
+\r
+ if ( typeof item === "string" ) {\r
+ item = { "src" : item };\r
+ }\r
+\r
+ index = index || 0;\r
+ if ( typeof index !== "number" && index < 0\r
+ && index >= this._imageList.length ) {\r
+ return;\r
+ }\r
+\r
+ this._imageList.splice( index, 0, item );\r
+ if ( this._gl ) {\r
+ this._reset();\r
+ }\r
+ },\r
+\r
+ remove: function ( index ) {\r
+ index = index || 0;\r
+ if ( typeof index !== "number" && index < 0\r
+ && index >= this._imageList.length ) {\r
+ return;\r
+ }\r
+\r
+ this._imageList.splice( index, 1 );\r
+ if ( this._gl ) {\r
+ this._reset();\r
+ }\r
+ },\r
+\r
+ clearThumbnailCache: function () {\r
+ if ( !this._nodes || ( this._nodes.length <= 0 ) ) {\r
+ return;\r
+ }\r
+\r
+ var i, url;\r
+ for ( i = 0; i < this._imageList.length; i += 1 ) {\r
+ url = this._imageList[i].src;\r
+ $.imageloader.removeThumbnail( url );\r
+ }\r
+ },\r
+\r
+ empty: function () {\r
+ this._imageList = [];\r
+ this._reset();\r
+ },\r
+\r
+ length: function () {\r
+ return this._imageList.length;\r
+ }\r
+ });\r
+\r
+ $( document ).bind( "pagecreate create", function ( e ) {\r
+ $( ":jqmData(role='gallery3d')" ).gallery3d();\r
+ });\r
+\r
+} ( jQuery, document, window ) );\r
+\r
- if ( ret.isDefinedWidth === false && width !== "" ) {
- // Size was defined
- ret.isDefinedWidth = true;
- ret.width = parseInt(width, 10);
- }
- $target = $target.parent();
- }
- return ret;
- },
- resize : function ( ) {
- var self = this,
- ret = null,
- rowsPerView = 0,
- itemCount = 0,
- totalRowCnt = 0,
- diffRowCnt = 0,
- clipSize = 0,
- prevcnt = 0,
- clipPosition = 0;
+/* ***************************************************************************
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * ***************************************************************************
+ *
+ * Author: Minkyu Kang <mk7.kang@samsung.com>
+ */
- itemCount = self._calculateColumnCount();
- if ( itemCount != self._itemCount ) {
- totalRowCnt = parseInt(self._numItemData / itemCount , 10 );
- self._totalRowCnt = self._numItemData % itemCount === 0 ? totalRowCnt : totalRowCnt + 1;
- prevcnt = self._itemCount;
- self._itemCount = itemCount;
- clipPosition = self._getClipPosition();
- self._$view.hide();
+/*
+ * Notification widget
+ *
+ * HTML Attributes
+ *
+ * data-role: set to 'notification'.
+ * data-type: 'ticker' or 'popup'.
+ * data-interval: time to showing. If don't set, will show infinitely.
+ *
+ * APIs
+ *
+ * open(): open the notification.
+ * close(): close the notification.
+ * text(text0, text1): set texts or get texts
+ * icon(src): set the icon (tickernoti only)
+ *
+ * Events
+ *
+ * N/A
+ *
+ * Examples
+ *
+ * // tickernoti
+ * <div data-role="notification" id="notification" data-type="ticker" data-interval="3000">
+ * <img src="icon01.png">
+ * <p>Hello World</p>
+ * <p>Denis</p>
+ * </div>
+ *
+ * // smallpopup
+ * <div data-role="notification" id="notification" data-type="popup" data-interval="3000">
+ * <p>Hello World</p>
+ * </div>
+ *
+ */
- diffRowCnt = self._replaceRows(itemCount, prevcnt, self._totalRowCnt, clipPosition);
- self._maxSize = ( self._totalRowCnt - self._rowsPerView ) * self._cellSize;
- self._scalableSize += (-diffRowCnt) * self._cellSize;
- self._reservedPos += (-diffRowCnt) * self._cellSize;
- self._setScrollBarSize();
- self._setScrollBarPosition(diffRowCnt);
+/**
+ @class Notification
+ The notification widget shows a pop-up window on the screen to provide notifications.
+ To add a notification widget to the application, use the following code:
- self._$view.show();
- }
+ <div data-role="page">
+ <div data-role="notification" data-type="smallpopup">
+ <p>text1</p>
+ </div>
+ <div data-role="header"></div>
+ <div data-role="content"></div>
+ <div data-role="footer"></div>
+ </div>
+*/
+/**
+ @property {String} data-type
+ Defines the notification type. The type options are tickernoti and smallpopup. <br/>The default value is smallpopup.
- clipSize = self._calculateClipSize();
- if ( clipSize !== self._clipSize ) {
- rowsPerView = clipSize / self._cellSize;
- rowsPerView = parseInt( Math.ceil( rowsPerView ), 10 );
+*/
+/**
+ @property {Integer} data-interval
+ Defines the time to showing a notification widget. <br/>The default is infinitely.
- if ( rowsPerView > self._rowsPerView ) {
- // increase row.
- self._increaseRow( rowsPerView - self._rowsPerView );
- } else if ( rowsPerView < self._rowsPerView ) {
- // decrease row.
- self._decreaseRow( self._rowsPerView - rowsPerView );
- }
- self._rowsPerView = rowsPerView;
- self._clipSize = clipSize;
- self._blockScroll = self._rowsPerView > self._totalRowCnt;
- self._maxSize = ( self._totalRowCnt - self._rowsPerView ) * self._cellSize;
- self._maxViewSize = ( self._rowsPerView ) * self._cellSize;
- if ( self._clipSize < self._maxViewSize ) {
- self._modifyViewPos = (-self._cellSize) + ( self._clipSize - self._maxViewSize );
- }
- if ( self._direction ) {
- self._$clip.width(self._clipSize);
- } else {
- self._$clip.height(self._clipSize);
- }
- self._setScrollBarSize();
- self._setScrollBarPosition(0);
- self._setViewSize();
- }
- },
+*/
+/**
+ @method open
+ The open method is used to open the notification widget:
- _initScrollView : function () {
- var self = this;
- $.extend(self.options, self._scrollView.options);
- self.options.moveThreshold = 10;
- self.options.showScrollBars = false;
- self._getScrollHierarchy = self._scrollView._getScrollHierarchy;
- self._makePositioned = self._scrollView._makePositioned;
- self._set_scrollbar_size = self._scrollView._set_scrollbar_size;
- self._setStyleTransform = self._scrollView._setElementTransform;
- self._hideOverflowIndicator = self._scrollView._hideOverflowIndicator;
- self._showOverflowIndicator = self._scrollView._showOverflowIndicator;
- self._setGestureScroll = self._scrollView._setGestureScroll;
- },
+ <div data-role="notification" data-type="smallpopup" data-interval="3000"></div>
+ $('#notification').notification('open');
+*/
+/**
+ @method close
+ The close method is used to close the notification widget:
- _createTracker : function () {
- var self = this;
+ <div data-role="notification" data-type="smallpopup" data-interval="3000"></div>
+ $('#notification').notification('close');
+*/
+/**
+ @method text
+ The text method is used to set or get the notification text:
- self._tracker = new MomentumTracker(self.options);
- if ( self._direction ) {
- self._hTracker = self._tracker;
- self._$clip.width(self._clipSize);
- } else {
- self._vTracker = self._tracker;
- self._$clip.height(self._clipSize);
- }
- },
+ <div data-role="notification" data-type="smallpopup" data-interval="3000"></div>
+ // Set notification text
+ $('#notification').notification('text', 'setThisText');
+ // Get notification text
+ texts = $('#notification').notification('text');
+ @since Tizen2.0
+*/
+/**
+ @method icon
+ The setIcon method is used to set the ticker notification icon. The icon can be set only if the notification type is set to tickernoti.
- //----------------------------------------------------//
- // Scrollbar //
- //----------------------------------------------------//
- _createScrollBar : function () {
- var self = this,
- prefix = "<div class=\"ui-scrollbar ui-scrollbar-",
- suffix = "\"><div class=\"ui-scrollbar-track\"><div class=\"ui-scrollbar-thumb\"></div></div></div>";
+ <div data-role="notification" data-type="ticker" data-interval="3000"></div>
+ $('#notification').notification('icon', './test.png');
+*/
+(function ( $, window ) {
+ $.widget( "tizen.notification", $.mobile.widget, {
+ btn: null,
+ text_bg: [],
+ icon_img: [],
+ interval: null,
+ seconds: null,
+ running: false,
- if ( self.options.rotation ) {
- return ;
- }
+ _get_text: function () {
+ var text = new Array( 2 );
- if ( self._direction ) {
- self._$clip.append( prefix + "x" + suffix );
- self._hScrollBar = $(self._$clip.children(".ui-scrollbar-x"));
- self._hScrollBar.find(".ui-scrollbar-thumb").addClass("ui-scrollbar-thumb-x");
+ if ( this.type === 'ticker' ) {
+ text[0] = $( this.text_bg[0] ).text();
+ text[1] = $( this.text_bg[1] ).text();
} else {
- self._$clip.append( prefix + "y" + suffix );
- self._vScrollBar = $(self._$clip.children(".ui-scrollbar-y"));
- self._vScrollBar.find(".ui-scrollbar-thumb").addClass("ui-scrollbar-thumb-y");
+ text[0] = $( this.text_bg[0] ).text();
}
- },
- _setScrollBarSize: function () {
- var self = this,
- scrollBarSize = 0,
- currentSize = 0,
- $scrollBar,
- attrName,
- className;
+ return text;
+ },
- if ( self.options.rotation ) {
- return ;
- }
+ _set_text: function ( text0, text1 ) {
+ var _set = function ( elem, text ) {
+ if ( !text ) {
+ return;
+ }
+ elem.text( text );
+ };
- scrollBarSize = parseInt( self._maxViewSize / self._clipSize , 10);
- if ( self._direction ) {
- $scrollBar = self._hScrollBar.find(".ui-scrollbar-thumb");
- attrName = "width";
- currentSize = $scrollBar.width();
- className = "ui-scrollbar-thumb-x";
- self._hScrollBar.css("width", self._clipSize);
+ if ( this.type === 'ticker' ) {
+ _set( $( this.text_bg[0] ), text0 );
+ _set( $( this.text_bg[1] ), text1 );
} else {
- $scrollBar = self._vScrollBar.find(".ui-scrollbar-thumb");
- attrName = "height";
- className = "ui-scrollbar-thumb-y";
- currentSize = $scrollBar.height();
- self._vScrollBar.css("height", self._clipSize);
+ _set( $( this.text_bg[0] ), text0 );
}
+ },
- if ( scrollBarSize > currentSize ) {
- $scrollBar.removeClass(className);
- $scrollBar.css(attrName, scrollBarSize);
- } else {
- scrollBarSize = currentSize;
+ text: function ( text0, text1 ) {
+ if ( text0 === undefined && text1 === undefined ) {
+ return this._get_text();
}
- self._itemScrollSize = parseFloat( ( self._clipSize - scrollBarSize ) / ( self._totalRowCnt - self._rowsPerView ) );
- self._itemScrollSize = Math.round(self._itemScrollSize * 100) / 100;
+ this._set_text( text0, text1 );
},
- _setScrollBarPosition : function ( di, duration ) {
- var self = this,
- $sbt = null,
- x = "0px",
- y = "0px";
-
- if ( self.options.rotation ) {
- return ;
+ icon: function ( src ) {
+ if ( src === undefined ) {
+ return;
}
- self._currentItemCount = self._currentItemCount + di;
- if ( self._vScrollBar ) {
- $sbt = self._vScrollBar .find(".ui-scrollbar-thumb");
- y = ( self._currentItemCount * self._itemScrollSize ) + "px";
- } else {
- $sbt = self._hScrollBar .find(".ui-scrollbar-thumb");
- x = ( self._currentItemCount * self._itemScrollSize ) + "px";
- }
- self._setStyleTransform( $sbt, x, y, duration );
+ this.icon_img.detach();
+ this.icon_img = $( "<img src='" + src + "' class='ui-ticker-icon'>" );
+ $( this.element ).find(".ui-ticker").append( this.icon_img );
},
- _hideScrollBars : function () {
- var self = this,
- vclass = "ui-scrollbar-visible";
+ _refresh: function () {
+ var container = this._get_container();
- if ( self.options.rotation ) {
- return ;
- }
+ $( container ).addClass("fix")
+ .removeClass("show")
+ .removeClass("hide");
- if ( self._vScrollBar ) {
- self._vScrollBar.removeClass( vclass );
- } else {
- self._hScrollBar.removeClass( vclass );
- }
+ this._set_interval();
},
- _showScrollBars : function () {
- var self = this,
- vclass = "ui-scrollbar-visible";
+ open: function () {
+ var container = this._get_container();
- if ( self.options.rotation ) {
- return ;
+ if ( this.running ) {
+ this._refresh();
+ return;
}
- if ( self._vScrollBar ) {
- self._vScrollBar.addClass( vclass );
- } else {
- self._hScrollBar.addClass( vclass );
+ $( container ).addClass("show")
+ .removeClass("hide")
+ .removeClass("fix");
+
+ this.running = true;
+
+ if ( this.type === 'popup' ) {
+ this._set_position();
}
+
+ this._set_interval();
},
- //----------------------------------------------------//
- // scroll process //
- //----------------------------------------------------//
- centerTo: function ( selector ) {
- var self = this,
- i,
- newX = 0,
- newY = 0;
+ close: function () {
+ var container = this._get_container();
- if ( !self.options.rotation ) {
+ if ( !this.running ) {
return;
}
- for ( i = 0; i < self._$rows.length; i++ ) {
- if ( $( self._$rows[i]).hasClass( selector ) ) {
- if ( self._direction ) {
- newX = -( i * self._cellSize - self._clipSize / 2 + self._cellSize * 2 );
- } else {
- newY = -( i * self._cellSize - self._clipSize / 2 + self._cellSize * 2 );
- }
- self.scrollTo( newX, newY );
- return;
- }
- }
+ $( container ).addClass("hide")
+ .removeClass("show")
+ .removeClass("fix");
+
+ this.running = false;
+ clearInterval( this.interval );
},
- scrollTo: function ( x, y, duration ) {
- var self = this;
- if ( self._direction ) {
- self._sx = self._reservedPos;
- self._reservedPos = x;
- } else {
- self._sy = self._reservedPos;
- self._reservedPos = y;
+ destroy: function () {
+ var container = this._get_container();
+
+ $( container ).removeClass("show")
+ .removeClass("hide")
+ .removeClass("fix");
+
+ this._del_event();
+
+ this.running = false;
+ },
+
+ _get_container: function () {
+ if ( this.type === 'ticker' ) {
+ return $( this.element ).find(".ui-ticker");
}
- self._scrollView.scrollTo.apply( this, [ x, y, duration ] );
+
+ return $( this.element ).find(".ui-smallpopup");
},
- getScrollPosition: function () {
- if ( this.direction ) {
- return { x: -this._ry, y: 0 };
+ _set_interval: function () {
+ var self = this;
+
+ clearInterval( this.interval );
+
+ if ( this.seconds !== undefined && this.second !== 0 ) {
+ this.interval = setInterval( function () {
+ self.close();
+ }, this.seconds );
}
- return { x: 0, y: -this._ry };
},
- _setScrollPosition: function ( x, y ) {
+ _add_event: function () {
var self = this,
- sy = self._scalableSize,
- distance = self._direction ? x : y,
- dy = distance - sy,
- di = parseInt( dy / self._cellSize, 10 ),
- i = 0,
- idx = 0,
- $row = null;
+ container = this._get_container();
- if ( self._blockScroll ) {
- return ;
- }
+ if ( this.type === 'ticker' ) {
+ container.find(".ui-ticker-btn").append( this.btn ).trigger("create");
- if ( ! self.options.rotation ) {
- if ( dy > 0 && distance >= -self._cellSize && self._scalableSize >= -self._cellSize ) {
- // top
- self._stopMScroll();
- self._scalableSize = -self._cellSize;
- self._setElementTransform( -self._cellSize );
- return;
- }
- if ( (dy < 0 && self._scalableSize <= -(self._maxSize + self._cellSize) )) {
- // bottom
- self._stopMScroll();
- self._scalableSize = -(self._maxSize + self._cellSize);
- self._setElementTransform( self._modifyViewPos );
- return;
- }
+ this.btn.bind( "vmouseup", function () {
+ self.close();
+ });
}
- if ( di > 0 ) { // scroll up
- for ( i = 0; i < di; i++ ) {
- idx = -parseInt( ( sy / self._cellSize ) + i + 3, 10 );
- $row = self._$view.children( ).last( ).detach( );
- self._replaceRow( $row, circularNum( idx, self._totalRowCnt ) );
- self._$view.prepend( $row );
- self._setScrollBarPosition(-1);
- }
- } else if ( di < 0 ) { // scroll down
- for ( i = 0; i > di; i-- ) {
- idx = self._rowsPerView - parseInt( ( sy / self._cellSize ) + i, 10 );
- $row = self._$view.children().first().detach();
- self._replaceRow($row, circularNum( idx, self._totalRowCnt ) );
- self._$view.append( $row );
- self._setScrollBarPosition(1);
- }
- }
- self._scalableSize += di * self._cellSize;
- self._setElementTransform( distance - self._scalableSize - self._cellSize );
+ container.bind( 'vmouseup', function () {
+ self.close();
+ });
},
- _setElementTransform : function ( value ) {
- var self = this,
- x = 0,
- y = 0;
+ _del_event: function () {
+ var container = this._get_container();
- if ( self._direction ) {
- x = value + "px";
- } else {
- y = value + "px";
+ if ( this.type === 'ticker' ) {
+ this.btn.unbind("vmouseup");
}
- self._setStyleTransform(self._$view, x, y );
+ container.unbind('vmouseup');
+ clearInterval( this.interval );
},
- //----------------------------------------------------//
- // Event handler //
- //----------------------------------------------------//
- _handleMomentumScroll: function () {
+ _set_position: function () {
+ var container = this._get_container(),
+ $footer = $('.ui-page-active').children('.ui-footer'),
+ footer_h = $footer.outerHeight() || 0;
+
+ container.css( 'bottom', footer_h);
+ },
+
+ _create: function () {
var self = this,
- opts = self.options,
- keepGoing = false,
- v = this._$view,
- x = 0,
- y = 0,
- t = self._tracker;
+ elem = $( this.element ),
+ i;
- if ( t ) {
- t.update();
- if ( self._direction ) {
- x = t.getPosition();
- } else {
- y = t.getPosition();
- }
- keepGoing = !t.done();
- }
+ this.btn = $('<div data-role="button" data-inline="true">Close</div>');
- self._setScrollPosition( x, y );
- if ( !opts.rotation ) {
- keepGoing = !t.done();
- self._reservedPos = self._direction ? x : y;
- // bottom
- self._reservedPos = self._reservedPos <= (-(self._maxSize - self._modifyViewPos)) ? ( - ( self._maxSize + self._cellSize) ) : self._reservedPos;
- // top
- self._reservedPos = self._reservedPos > -self._cellSize ? -self._cellSize : self._reservedPos;
- } else {
- self._reservedPos = self._direction ? x : y;
- }
- self._$clip.trigger( self.options.updateEventName, [ { x: x, y: y } ] );
+ this.seconds = elem.jqmData('interval');
+ this.type = elem.jqmData('type') || 'popup';
- if ( keepGoing ) {
- self._timerID = setTimeout( self._timerCB, self._timerInterval );
- } else {
- self._stopMScroll();
- }
- },
+ if ( this.type === 'ticker' ) {
+ elem.wrapInner("<div class='ui-ticker'></div>");
+ elem.find(".ui-ticker").append("<div class='ui-ticker-body'></div>" +
+ "<div class='ui-ticker-btn'></div>");
+ this.text_bg = elem.find("p");
- _startMScroll: function ( speedX, speedY ) {
- var self = this;
- if ( self._direction ) {
- self._sx = self._reservedPos;
- } else {
- self._sy = self._reservedPos;
- }
- self._scrollView._startMScroll.apply(self, [speedX, speedY]);
- },
+ if ( this.text_bg.length < 2 ) {
+ elem.find(".ui-ticker").append("<p></p><p></p>");
+ this.text_bg = elem.find("p");
+ } else if ( this.text_bg.length > 2 ) {
+ for ( i = 2; i < this.text_bg.length; i++ ) {
+ $( this.text_bg[i] ).css( "display", "none" );
+ }
+ }
- _stopMScroll: function () {
- this._scrollView._stopMScroll.apply(this);
- },
+ $( this.text_bg[0] ).addClass("ui-ticker-text1-bg");
+ $( this.text_bg[1] ).addClass("ui-ticker-text2-bg");
- _enableTracking: function () {
- $(document).bind( this._dragMoveEvt, this._dragMoveCB );
- $(document).bind( this._dragStopEvt, this._dragStopCB );
- },
+ this.icon_img = elem.find("img");
- _disableTracking: function () {
- $(document).unbind( this._dragMoveEvt, this._dragMoveCB );
- $(document).unbind( this._dragStopEvt, this._dragStopCB );
- },
+ if ( this.icon_img.length ) {
+ $( this.icon_img ).addClass("ui-ticker-icon");
- _handleDragStart: function ( e, ex, ey ) {
- var self = this;
- self._scrollView._handleDragStart.apply( this, [ e, ex, ey ] );
- self._eventPos = self._direction ? ex : ey;
- self._nextPos = self._reservedPos;
- },
+ for ( i = 1; i < this.icon_img.length; i++ ) {
+ $( this.icon_img[i] ).css( "display", "none" );
+ }
+ }
+ } else {
+ elem.wrapInner("<div class='ui-smallpopup'></div>");
+ this.text_bg = elem.find("p").addClass("ui-smallpopup-text-bg");
- _handleDragMove: function ( e, ex, ey ) {
- var self = this,
- dx = ex - self._lastX,
- dy = ey - self._lastY,
- x = 0,
- y = 0;
+ if ( this.text_bg.length < 1 ) {
+ elem.find(".ui-smallpopup")
+ .append("<p class='ui-smallpopup-text-bg'></p>");
+ this.text_bg = elem.find("p");
+ } else if ( this.text_bg.length > 1 ) {
+ for ( i = 1; i < this.text_bg.length; i++ ) {
+ $( this.text_bg[i] ).css( "display", "none" );
+ }
+ }
- self._lastMove = getCurrentTime();
- self._speedX = dx;
- self._speedY = dy;
+ this._set_position();
+ }
- self._didDrag = true;
+ this._add_event();
- self._lastX = ex;
- self._lastY = ey;
+ $( window ).bind( "resize", function () {
+ if ( !self.running ) {
+ return;
+ }
- if ( self._direction ) {
- self._movePos = ex - self._eventPos;
- x = self._nextPos + self._movePos;
- } else {
- self._movePos = ey - self._eventPos;
- y = self._nextPos + self._movePos;
- }
- self._showScrollBars();
- self._setScrollPosition( x, y );
- return false;
- },
+ self._refresh();
- _handleDragStop: function ( e ) {
- var self = this;
+ if ( self.type === 'popup' ) {
+ self._set_position();
+ }
+ });
+ }
+ }); // End of widget
- self._reservedPos = self._movePos ? self._nextPos + self._movePos : self._reservedPos;
- self._scrollView._handleDragStop.apply( this, [ e ] );
- return self._didDrag ? false : undefined;
- },
+ // auto self-init widgets
+ $( document ).bind( "pagecreate create", function ( e ) {
+ $( e.target ).find(":jqmData(role='notification')").notification();
+ });
- _addBehaviors: function () {
- var self = this;
+ $( document ).bind( "pagebeforehide", function ( e ) {
+ $( e.target ).find(":jqmData(role='notification')").notification('destroy');
+ });
+}( jQuery, this ));
- // scroll event handler.
- if ( self.options.eventType === "mouse" ) {
- self._dragStartEvt = "mousedown";
- self._dragStartCB = function ( e ) {
- return self._handleDragStart( e, e.clientX, e.clientY );
- };
- self._dragMoveEvt = "mousemove";
- self._dragMoveCB = function ( e ) {
- return self._handleDragMove( e, e.clientX, e.clientY );
- };
- self._dragStopEvt = "mouseup";
- self._dragStopCB = function ( e ) {
- return self._handleDragStop( e, e.clientX, e.clientY );
- };
+/*
+ * jQuery Mobile Widget @VERSION
+ *
+ * This software is licensed under the MIT licence (as defined by the OSI at
+ * http://www.opensource.org/licenses/mit-license.php)
+ *
+ * ***************************************************************************
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2011 by Intel Corporation Ltd.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * ***************************************************************************
+ *
+ * Authors: Kalyan Kondapally <kalyan.kondapally@intel.com>,
+ * Elliot Smith <elliot.smith@intel.com>
+ * Hyunjung Kim <hjnim.kim@samsung.com>
+ */
- self._$view.bind( "vclick", function (e) {
- return !self._didDrag;
- } );
- } else { //touch
- self._dragStartEvt = "touchstart";
- self._dragStartCB = function ( e ) {
- var t = e.originalEvent.targetTouches[0];
- return self._handleDragStart(e, t.pageX, t.pageY );
- };
+// Widget which turns a html element into a "swipe":
+// i.e. each list item has a sliding "cover" which can be swiped
+// to the right (to reveal buttons underneath) or left (to
+// cover the buttons again). Clicking on a button under a swipe
+// also moves the cover back to the left.
+//
+// In this case, the cover is over a grid of buttons;
+// but it is should also be possible to use other types of markup under the
+// list items.
+//
+// WARNING: This doesn't work well inside a scrollview widget, as
+// the touch events currently interfere with each other badly (e.g.
+// a swipe will work but cause a scroll as well).
+//
+// Theme: default is to use the theme on the target element,
+// theme passed in options, parent theme, or 'c' if none of the above.
+// If list items are themed individually, the cover will pick up the
+// theme of the list item which is its parent.
+//
- self._dragMoveEvt = "touchmove";
- self._dragMoveCB = function ( e ) {
- var t = e.originalEvent.targetTouches[0];
- return self._handleDragMove(e, t.pageX, t.pageY );
- };
+/**
+ @class Swipe
+ The swipe widget shows a view on the screen where the items can be swiped vertically to show a menu.
+ To add a swipe widget to the application, use the following code:
- self._dragStopEvt = "touchend";
- self._dragStopCB = function ( e ) {
- return self._handleDragStop( e );
- };
- }
- self._$view.bind( self._dragStartEvt, self._dragStartCB );
+ <ul data-role="listview">
+ <li data-role="swipe">
+ <div data-role="swipe-cover">
+ <div data-role="button" data-inline="true">OK</div>
+ <div data-role="button" data-inline="true">Cancel</div>
+ </div>
+ <div data-role="swipe-item-cover">
+ <p>This is a swipe item cover.<br>
+ This will be swiped out when swipe event comes.</p>
+ </div>
+ </li>
+ </ul>
- // other events.
- self._$view.delegate(".virtualgrid-item", "click", function (event) {
- var $selectedItem = $(this);
- $selectedItem.trigger("select", this);
- });
+ You can use methods with the swipe as described in the jQueryMobile documentation for view methods.
+*/
+/**
+ @property {String} data-role
+ Creates a swipe using the HTML unordered view (>ul<) element.
+ The default value is swipe.
- $( window ).bind("resize", function ( e ) {
- var height = 0,
- $virtualgrid = $(".ui-virtualgrid-view");
- if ( $virtualgrid.length !== 0 ) {
- if ( self._direction ) {
- height = self._calculateClipHeight();
- self._$view.height(height);
- self._$clip.height(height);
- } else {
- height = self._calculateClipWidth();
- self._$view.width(height);
- self._$clip.width(height);
- }
- self.resize( );
- }
- });
+ Creates a swipe item cover using an HTML $gt;div$lt; element. This cover can be swiped to show the content beneath it.
+ The default value is swipe-item-cover.
+*/
+/**
+ @method open
+ uncover swipe item
+*/
+/**
+ @method close
+ cover swipe item
+*/
+/**
+ @method opened
+ return coveritem status( coverd or uncovred )
+*/
+/**
+ @event animationstart
+ The swipe can define a callback for the animationstart event, which is fired after a item is swipe and the swipe animation is start:
+*/
+/**
+ @event animationend
+ The swipe can define a callback for the animationend event, which is fired after a item is swiped and the swipe animation is complete:
- $(document).one("pageshow", function (event) {
- var $page = $(self.element).parents(".ui-page"),
- $header = $page.find( ":jqmData(role='header')" ),
- $footer = $page.find( ":jqmData(role='footer')" ),
- $content = $page.find( ":jqmData(role='content')" ),
- footerHeight = $footer ? $footer.height() : 0,
- headerHeight = $header ? $header.height() : 0;
+ <ul data-role="listview">
+ <li data-role="swipe">
+ <div data-role="swipe-cover">
+ <div data-role="button" data-inline="true">OK</div>
+ <div data-role="button" data-inline="true">Cancel</div>
+ </div>
+ <div data-role="swipe-item-cover" id="foo">
+ <p>This is a swipe item cover.<br>
+ This will be swiped out when swipe event comes.</p>
+ </div>
+ </li>
+ </ul>
+ $("#foo").bind("animationend", function (ev)
+ {
+ Console.log("Swipe cover's animation is complete.");
+ });
+*/
+(function ($) {
- if ( $page && $content ) {
- $content.height(window.innerHeight - headerHeight - footerHeight).css("overflow", "hidden");
- $content.addClass("ui-virtualgrid-content");
- }
- });
+ $.widget("tizen.swipe", $.mobile.widget, {
+ options: {
+ theme: null
},
- //----------------------------------------------------//
- // Calculate size about dom element. //
- //----------------------------------------------------//
- _calculateClipSize : function () {
- var self = this,
- clipSize = 0;
+ _create: function () {
+ // use the theme set on the element, set in options,
+ // the parent theme, or 'c' (in that order of preference)
+ var theme = this.element.jqmData('theme') ||
+ this.options.theme ||
+ this.element.parent().jqmData('theme') ||
+ 's';
- if ( self._direction ) {
- clipSize = self._calculateClipWidth();
- } else {
- clipSize = self._calculateClipHeight();
- }
- return clipSize;
+ this.options.theme = theme;
+ this._isopen = false;
+ this.refresh();
},
- _calculateClipWidth : function () {
+ refresh: function () {
+ this._cleanupDom();
+
var self = this,
- view = $(self.element),
- $parent = $(self.element).parent(),
- paddingValue = 0,
- clipSize = $(window).width();
+ defaultCoverTheme,
+ covers,
+ coverTheme,
+ item,
+ itemHasThemeClass;
- if ( self._inheritedSize.isDefinedWidth ) {
- return self._inheritedSize.width;
- }
+ defaultCoverTheme = 'ui-body-' + this.options.theme;
- if ( $parent.hasClass("ui-content") ) {
- paddingValue = parseInt($parent.css("padding-left"), 10);
- clipSize = clipSize - ( paddingValue || 0 );
- paddingValue = parseInt($parent.css("padding-right"), 10);
- clipSize = clipSize - ( paddingValue || 0);
- } else {
- clipSize = view.width();
+ if ( !this.element.parent().hasClass('ui-listview') ) {
+ this.element.parent().listview();
}
- return clipSize;
- },
+ this.element.addClass('ui-swipe');
- _calculateClipHeight : function () {
- var self = this,
- view = $(self.element),
- $parent = $(self.element).parent(),
- header = null,
- footer = null,
- paddingValue = 0,
- clipSize = $(window).height();
+ // get the item covers
+ covers = this.element.find(':jqmData(role="swipe-item-cover")');
+ item = this.element.find(':jqmData(role="swipe-item")');
- if ( self._inheritedSize.isDefinedHeight ) {
- return self._inheritedSize.height;
- }
+ this._covers = covers;
+ this._item = item;
+ item.addClass('ui-swipe-item');
+ coverTheme = defaultCoverTheme;
+ itemHasThemeClass = item.parent().attr('class')
+ .match(/ui\-body\-[a-z]|ui\-bar\-[a-z]/);
- if ( $parent.hasClass("ui-content") ) {
- paddingValue = parseInt($parent.css("padding-top"), 10);
- clipSize = clipSize - ( paddingValue || 0 );
- paddingValue = parseInt($parent.css("padding-bottom"), 10);
- clipSize = clipSize - ( paddingValue || 0);
- header = $parent.siblings(".ui-header");
- footer = $parent.siblings(".ui-footer");
+ covers.each( function () {
+ var cover = $( this );
- if ( header ) {
- if ( header.outerHeight(true) === null ) {
- clipSize = clipSize - ( $(".ui-header").outerHeight() || 0 );
- } else {
- clipSize = clipSize - header.outerHeight(true);
- }
- }
- if ( footer ) {
- clipSize = clipSize - footer.outerHeight(true);
+ if ( itemHasThemeClass ) {
+ coverTheme = itemHasThemeClass[0];
}
- } else {
- clipSize = view.height();
- }
- return clipSize;
- },
-
- _calculateColumnSize : function () {
- var self = this,
- $tempBlock,
- $cell;
- $tempBlock = self._makeRows( 1 );
- self._$view.append( $tempBlock.children().first() );
- if ( self._direction ) {
- // x-axis
- self._viewSize = self._$view.width();
- $cell = self._$view.children().first().children().first();
- self._cellSize = $cell.outerWidth(true);
- self._cellOtherSize = $cell.outerHeight(true);
- } else {
- // y-axis
- self._viewSize = self._$view.height();
- $cell = self._$view.children().first().children().first();
- self._cellSize = $cell.outerHeight(true);
- self._cellOtherSize = $cell.outerWidth(true);
- }
- $tempBlock.remove();
- self._$view.children().remove();
- },
+ cover.addClass('ui-swipe-item-cover');
+ cover.addClass( coverTheme );
- _calculateColumnCount : function ( ) {
- var self = this,
- $view = $(self.element),
- viewSize = self._direction ? $view.innerHeight() : $view.innerWidth(),
- itemCount = 0 ;
+ if ( cover.has('.ui-swipe-item-cover-inner').length === 0 ) {
+ cover.wrapInner( $('<span/>').addClass('ui-swipe-item-cover-inner') );
+ }
- if ( self._direction ) {
- viewSize = viewSize - ( parseInt( $view.css("padding-top"), 10 ) + parseInt( $view.css("padding-bottom"), 10 ) );
- } else {
- viewSize = viewSize - ( parseInt( $view.css("padding-left"), 10 ) + parseInt( $view.css("padding-right"), 10 ) );
- }
+ if ( !( cover.data('animateRight') && cover.data('animateLeft') ) ) {
+ cover.data('animateRight', function () {
+ self._animateCover( cover, 110, item );
+ });
- itemCount = parseInt( (viewSize / self._cellOtherSize), 10);
- return itemCount > 0 ? itemCount : 1 ;
- },
+ cover.data('animateLeft', function () {
+ self._animateCover( cover, 0, item );
+ });
+ }
- // Read the position of clip form property ('webkit-transform').
- // @return : number - position of clip.
- _getClipPosition : function () {
- var self = this,
- matrix = null,
- contents = null,
- result = -self._cellSize,
- $scrollview = self._$view.closest(".ui-scrollview-view");
+ // bind to synthetic events
+ item.bind( 'swipeleft', cover.data('animateLeft') );
+ cover.bind( 'swiperight', cover.data('animateRight') );
+ item.find( '.ui-btn' ).bind( 'vclick', cover.data('animateLeft') );
+ } );
- if ( $scrollview ) {
- matrix = $scrollview.css("-webkit-transform");
- contents = matrix.substr( 7 );
- contents = contents.substr( 0, contents.length - 1 );
- contents = contents.split( ', ' );
- result = Math.abs(contents [5]);
- }
- return result;
},
- //----------------------------------------------------//
- // DOM Element handle //
- //----------------------------------------------------//
- _makeRows : function ( count ) {
+ _cleanupDom: function () {
var self = this,
- opts = self.options,
- index = 0,
- $row = null,
- $wrapper = null;
+ defaultCoverTheme,
+ cover,
+ coverTheme = defaultCoverTheme,
+ item,
+ itemClass,
+ itemHasThemeClass,
+ text,
+ wrapper;
- $wrapper = $( self._createElement( "div" ) );
- $wrapper.addClass("ui-scrollview-view");
- for ( index = 0; index < count ; index += 1 ) {
- $row = self._makeRow( self._template, index );
- if ( self._direction ) {
- $row.css("top", 0).css("left", ( index * self._cellSize ));
- }
- $wrapper.append($row);
- }
- return $wrapper;
- },
+ defaultCoverTheme = 'ui-body-' + this.options.theme;
- // make a single row block
- _makeRow : function ( myTemplate, rowIndex ) {
- var self = this,
- opts = self.options,
- index = rowIndex * self._itemCount,
- htmlData = null,
- itemData = null,
- colIndex = 0,
- attrName = self._direction ? "top" : "left",
- blockClassName = self._direction ? "ui-virtualgrid-wrapblock-x" : "ui-virtualgrid-wrapblock-y",
- blockAttrName = self._direction ? "top" : "left",
- wrapBlock = $( self._createElement( "div" ) );
+ this.element.removeClass('ui-swipe');
- wrapBlock.addClass( blockClassName ).attr("row-index", rowIndex);
- for ( colIndex = 0; colIndex < self._itemCount; colIndex++ ) {
- htmlData = self._makeHtmlData( myTemplate, index, colIndex);
- if ( htmlData ) {
- wrapBlock.append( htmlData );
- }
- index += 1;
- }
- return wrapBlock;
- },
+ // get the item covers
+ cover = this.element.find(':jqmData(role="swipe-item-cover")');
+ item = this.element.find(':jqmData(role="swipe-item")');
- _makeHtmlData : function ( myTemplate, dataIndex, colIndex ) {
- var self = this,
- htmlData = null,
- itemData = null,
- attrName = self._direction ? "top" : "left";
+ item.removeClass('ui-swipe-item');
+ cover.removeClass('ui-swipe-item-cover');
- itemData = self._itemData( dataIndex );
- if ( itemData ) {
- htmlData = myTemplate.tmpl( itemData );
- $(htmlData).css(attrName, ( colIndex * self._cellOtherSize )).addClass("virtualgrid-item");
+ itemClass = item.attr('class');
+ itemHasThemeClass = itemClass &&
+ itemClass.match(/ui\-body\-[a-z]|ui\-bar\-[a-z]/);
+
+ if ( itemHasThemeClass ) {
+ coverTheme = itemHasThemeClass[0];
}
- return htmlData;
- },
- _increaseRow : function ( num ) {
- var self = this,
- rotation = self.options.rotation,
- $row = null,
- headItemIndex = 0,
- tailItemIndex = 0,
- itemIndex = 0,
- size = self._scalableSize,
- idx = 0;
+ cover.removeClass(coverTheme);
- headItemIndex = parseInt( $(self._$view.children().first()).attr("row-index"), 10) - 1;
- tailItemIndex = parseInt( $(self._$view.children()[self._rowsPerView]).attr("row-index"), 10) + 1;
+ // remove wrapper HTML
+ wrapper = cover.find('.ui-swipe-item-cover-inner');
+ wrapper.children().unwrap();
+ text = wrapper.text();
- for ( idx = 1 ; idx <= num ; idx++ ) {
- if ( tailItemIndex + idx >= self._totalRowCnt ) {
- $row = self._makeRow( self._template, headItemIndex );
- self._$view.prepend($row);
- headItemIndex -= 1;
- } else {
- $row = self._makeRow( self._template, tailItemIndex + idx );
- self._$view.append($row);
- }
- if ( self._direction ) {
- $row.width(self._cellSize);
- } else {
- $row.height(self._cellSize);
- }
+ if ( text ) {
+ cover.append( text );
+ wrapper.remove();
}
- },
- _decreaseRow : function ( num ) {
- var self = this,
- idx = 0;
+ // unbind swipe events
+ if ( cover.data('animateRight') && cover.data('animateLeft') ) {
+ cover.unbind( 'swiperight', cover.data('animateRight') );
+ item.unbind( 'swipeleft', cover.data('animateLeft') );
- for ( idx = 0 ; idx < num ; idx++ ) {
- self._$view.children().last().remove();
+ // unbind clicks on buttons inside the item
+ item.find('.ui-btn').unbind( 'vclick', cover.data('animateLeft') );
+
+ cover.data( 'animateRight', null );
+ cover.data( 'animateLeft', null );
}
},
- _replaceRows : function ( curCnt, prevCnt, maxCnt, clipPosition ) {
+ // NB I tried to use CSS animations for this, but the performance
+ // and appearance was terrible on Android 2.2 browser;
+ // so I reverted to jQuery animations
+ //
+ // once the cover animation is done, the cover emits an
+ // animationComplete event
+ _animateCover: function ( cover, leftPercentage, item ) {
var self = this,
- $rows = self._$view.children(),
- prevRowIndex = 0,
- rowIndex = 0,
- diffRowCnt = 0,
- targetCnt = 1,
- filterCondition = ( self._filterRatio * self._cellSize) + self._cellSize,
- idx = 0;
+ animationOptions = {
+ easing: 'linear',
+ duration: 'normal',
+ queue: true,
+ complete: function () {
+ cover.trigger('animationend');
+ }
+ };
+
+ $( this.element.parent() )
+ .find(":jqmData(role='swipe')")
+ .each(
+ function () {
+ if ( this !== self.element.get(0) &&
+ $( this ).swipe("opened") ) {
+ $( this ).swipe("close");
+ }
+ }
+ );
- if ( filterCondition < clipPosition ) {
- targetCnt += 1;
+ if ( leftPercentage == 110 ) {
+ this._isopen = true;
+ } else {
+ this._isopen = false;
}
- prevRowIndex = parseInt( $($rows[targetCnt]).attr("row-index"), 10);
- if ( prevRowIndex === 0 ) {
- // only top.
- rowIndex = maxCnt - targetCnt;
+ cover.stop();
+ cover.clearQueue();
+ cover.trigger('animationstart');
+ cover.animate( { left: leftPercentage + '%' }, animationOptions );
+ if ( leftPercentage == 0 ) {
+ item.animate({ opacity: 0 }, "slow");
} else {
- rowIndex = Math.round( (prevRowIndex * prevCnt) / curCnt );
- if ( rowIndex + self._rowsPerView >= maxCnt ) {
- // only bottom.
- rowIndex = maxCnt - self._rowsPerView;
- }
- diffRowCnt = prevRowIndex - rowIndex;
- rowIndex -= targetCnt;
+ item.animate({ opacity: 1 }, "slow");
}
- for ( idx = 0 ; idx < $rows.length ; idx += 1 ) {
- self._replaceRow($rows[idx], circularNum( rowIndex, self._totalRowCnt ));
- rowIndex++;
- }
- return -diffRowCnt;
},
- _replaceRow : function ( block, index ) {
- var self = this,
- opts = self.options,
- $columns = null,
- $column = null,
- $block = block.attr ? block : $( block ),
- data = null,
- htmlData = null,
- myTemplate = null,
- idx = 0,
- dataIdx = 0,
- tempBlocks = null;
+ destroy: function () {
+ this._cleanupDom();
+ },
- $columns = $block.attr("row-index", index).children();
- if ( $columns.length !== self._itemCount ) {
- $block.children().remove();
- tempBlocks = $(self._makeRow( self._template, index ));
- $block.append(tempBlocks.children());
- tempBlocks.remove();
- return ;
- }
+ open: function () {
+ var self = this;
- dataIdx = index * self._itemCount;
- for ( idx = 0; idx < self._itemCount ; idx += 1 ) {
- $column = $columns.eq(idx);
- data = self._itemData(dataIdx);
- if ( $column && data ) {
- myTemplate = self._template;
- htmlData = myTemplate.tmpl( data );
- self._replace( $column, htmlData, false );
- htmlData.remove(); // Clear temporary htmlData to free cache
- dataIdx ++;
- } else if ($column && !data ) {
- $column.remove();
- }
- }
+ $( self._covers ).each( function () {
+ var cover = $( this );
+ self._animateCover( cover, 110, self._item);
+ } );
},
- _createElement : function ( tag ) {
- var element = document.createElement( tag );
-
- this._fragment.appendChild( element );
- return element;
+ opened: function () {
+ return this._isopen;
},
- /* Text & image src replace function */
- // @param oldItem : prev HtmlDivElement
- // @param newItem : new HtmlDivElement for replace
- // @param key :
- _replace : function ( oldItem, newItem, key ) {
- var NODETYPE = { ELEMENT_NODE : 1, TEXT_NODE : 3 };
+ close: function () {
+ var self = this;
+
+ $( self._covers ).each( function () {
+ var cover = $( this );
+ self._animateCover( cover, 0, self._item);
+ } );
+ }
+
+ });
- $( oldItem ).find( ".ui-li-text-main", ".ui-li-text-sub", "ui-btn-text" ).each( function ( index ) {
- var oldObj = $( this ),
- newText = $( newItem ).find( ".ui-li-text-main", ".ui-li-text-sub", "ui-btn-text" ).eq( index ).text();
+ $( document ).bind("pagecreate", function ( e ) {
+ $( e.target ).find(":jqmData(role='swipe')").swipe();
+ });
- $( oldObj ).contents().filter( function () {
- return ( this.nodeType == NODETYPE.TEXT_NODE );
- }).get( 0 ).data = newText;
- });
+}( jQuery ));
- $( oldItem ).find( "img" ).each( function ( imgIndex ) {
- var oldObj = $( this ),
- newImg = $( newItem ).find( "img" ).eq( imgIndex ).attr( "src" );
- $( oldObj ).attr( "src", newImg );
- });
- $( oldItem).removeData();
- if ( key ) {
- $( oldItem ).data( key, $( newItem ).data( key ) );
- }
- }
- } );
- $( document ).bind( "pagecreate create", function ( e ) {
- $(":jqmData(role='virtualgrid')").virtualgrid();
- } );
-} (jQuery, window, document) );
/* ***************************************************************************
* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
*
* DEALINGS IN THE SOFTWARE.
* ***************************************************************************
*
- * Author: Wongi Lee <wongi11.lee@samsung.com>
- * Youmin Ha <youmin.ha@samsung.com>
- */
+ * Authors: Wonseop Kim ( wonseop.kim@samsung.com )
+*/
/**
- * Virtual List Widget for unlimited data.
- * To support more then 1,000 items, special list widget developed.
- * Fast initialize and light DOM tree.
- * DB connection and works like DB cursor.
- *
+ * "Handler" is a widget helping a user to scroll a window or panel.
+ * It is different from the scrollview feature in that the handler has a fixed size
+ * and disappears when a scroll size is smaller than a parent window's size.
+ * If the handler widget is activated, a scroll bar on the screen will be deactivated.
+ * The handler widget supports scrolling up and down and indicates the position of the scrolled window.
+ *
* HTML Attributes:
*
- * data-role: virtuallistview
- * data-template : jQuery.template ID that populate into virtual list
- * data-row : Optional. Set number of <li> elements that are used for data handling.
- *
- * ID : <UL> element that has "data-role=virtuallist" must have ID attribute.
+ * data-handler : This attribute is indicating that whether enable.
+ * If you want to use, you will set 'true'.
+ * data-handler-theme : Set the widget theme ( optional )
*
- * * APIs:
+ * APIs:
*
- * create ( {
- * itemData: function ( idx ) { return json_obj; },
- * numItemData: number or function () { return number; },
- * cacheItemData: function ( minIdx, maxIdx ) {}
- * } )
- * : Create a virtuallist widget. At this moment, _create method is called.
- * args : A collection of options
- * itemData: A function that returns JSON object for given index. Mandatory.
- * numItemData: Total number of itemData. Mandatory.
- * cacheItemData: Virtuallist will ask itemData between minIdx and maxIdx.
- * Developers can implement this function for preparing data.
- * Optional.
+ * enableHandler ( boolean )
+ * : Get or set the use of handler widget.
+ * If the value is "true", it will be run handler widget.
+ * If the value is "false", it will be not run handler widget.
+ * If no value is specified, will act as a getter.
*
* Events:
*
- * touchstart : Temporary preventDefault applied on touchstart event to avoid broken screen.
- *
* Examples:
*
- * <script id="tmp-3-2-7" type="text/x-jquery-tmpl">
- * <li class="ui-li-3-2-7">
- * <span class="ui-li-text-main">${NAME}</span>
- * <img src="00_winset_icon_favorite_on.png" class="ui-li-icon-sub">
- * <span class="ui-li-text-sub">${ACTIVE}</span>
- * <span class="ui-li-text-sub2">${FROM}</span>
- * </li>
- * </script>
- *
- * <ul id="virtuallist-normal_3_2_7_ul" data-role="virtuallistview" data-template="tmp-3-2-7" data-dbtable="JSON_DATA" data-row="100">
- * </ul>
- *
+ * <div data-role="content" data-scroll="y" data-handler="true">
+ * <ul data-role="listview">
+ * <li data-role="list-divider">A</li>
+ * <li><a href="#">Adam Kinkaid</a></li>
+ * ...
+ * </ul>
+ * </div>
*/
/**
- @class VirtualList
- In the Web environment, it is challenging to display a large amount of data in a list, such as displaying a contact list of over 1000 list items. It takes time to display the entire list in HTML and the DOM manipulation is complex.
-
- The virtual list widget is used to display a list of unlimited data elements on the screen for better performance. This widget provides easy access to databases to retrieve and display data. Virtual lists are based on the jQuery.template plugin as described in the jQuery documentation for jQuery.template plugin.
-
- To add a virtual list widget to the application, use the following code:
-
- <script id="tmp-3-2-7" type="text/x-jquery-tmpl">
- <li class="ui-li-3-2-7">
- <span class="ui-li-text-main">${NAME}</span>
- <img src="00_winset_icon_favorite_on.png" class="ui-li-icon-sub"/>
- <span class="ui-li-text-sub">${ACTIVE}</span>
- <span class="ui-li-text-sub2">${FROM}</span>
- </li>
- </script>
- <ul id="vlist" data-role="virtuallistview" data-template="tmp-3-2-7" data-dbtable="JSON_DATA" data-row="100"></ul>
-*/
-/**
- @property {String} data-role
- Creates the virtual list view. The value must be set to virtuallistview.
- Only the >ul< element, which a id attribute defined, supports this option. Also, the vlLoadSuccess class attribute must be defined in the >ul< element to ensure that loading data from the database is complete.
-*/
-/**
- @property {String} data-template
- Defines the jQuery.template element ID.
- The jQuery.template must be defined. The template style can use rem units to support scalability.
-*/
-/**
- @property {Number} data-row
- Defines the number of virtual list child elements.
- The minimum value is 20 and the default value is 100. As the value gets higher, the loading time increases while the system performance improves. So you need to pick a value that provides the best performance without excessive loading time.
-*/
-/**
- @method create
- @param {function} itemData(index)
- : function itemData(index) returns the JSON object matched with the given index. The index value is between 0 and numItemData-1.
- @param {Number} numItemData
- : number numItemData or function numItemData() defines or returns a static number of items.
- @param {function} cacheItemData(minIndex, maxIndex)
- : function cacheItemData(minIndex, maxIndex) prepares the JSON data. This method is called before calling the itemData() method with index values between minIndex and maxIndex.
-*/
-
-(function ( $, undefined ) {
-
- /* Code for Virtual List Demo */
- var listCountPerPage = {}, /* Keeps track of the number of lists per page UID. This allows support for multiple nested list in the same page. https://github.com/jquery/jquery-mobile/issues/1617 */
- _NO_SCROLL = 0, /* ENUM */
- _SCROLL_DOWN = 1, /* ENUM */
- _SCROLL_UP = -1; /* ENUM */
-
- $.widget( "tizen.virtuallistview", $.mobile.widget, {
- options: {
- theme: "s",
- countTheme: "s",
- headerTheme: "s",
- dividerTheme: "s",
- splitIcon: "arrow-r",
- splitTheme: "s",
- inset: false,
- id: "", /* Virtual list UL elemet's ID */
- childSelector: " li", /* To support swipe list */
- dbtable: "",
- template : "",
- dbkey: false, /* Data's unique Key */
- scrollview: false,
- row: 100,
- page_buf: 30,
- initSelector: ":jqmData(role='virtuallistview')"
- },
-
- _stylerMouseUp: function () {
- $( this ).addClass( "ui-btn-up-s" );
- $( this ).removeClass( "ui-btn-down-s" );
- },
-
- _stylerMouseDown: function () {
- $( this ).addClass( "ui-btn-down-s" );
- $( this ).removeClass( "ui-btn-up-s" );
- },
-
- _stylerMouseOver: function () {
- $( this ).toggleClass( "ui-btn-hover-s" );
- },
-
- _stylerMouseOut: function () {
- $( this ).toggleClass( "ui-btn-hover-s" );
- $( this ).addClass( "ui-btn-up-s" );
- $( this ).removeClass( "ui-btn-down-s" );
- },
-
- // ?
- // this virtuallistview object
- // @param[in] template template name(string)
- _pushData: function ( template ) {
- var o = this.options,
- i,
- myTemplate = $( "#" + template ), // Get template object
- // NOTE: o.row = # of rows handled at once. Default value is 100.
- lastIndex = ( o.row > this._numItemData ? this._numItemData : o.row ), // last index of handled data
- htmlData;
+ @class handler
+ The handler widget enables the user to vertically scroll through a page or panel using a fixed-size handle. The widget indicates the position of the scrolled window, and only appears on the screen if the parent page or panel's scroll size is larger than the screen size. <br/> To add a handler widget to the application, use the following code:
- for ( i = 0; i < lastIndex; i++ ) {
- htmlData = myTemplate.tmpl( this._itemData( i ) ); // Make rows with template,
- $( o.id ).append( $( htmlData ).attr( 'id', o.itemIDPrefix + i ) ); // and append it to the vlist object
- }
+ <div data-role="content" data-scroll="y" data-handler="true">
+ <ul data-role="listview">
+ <li data-role="list-divider">A</li>
+ <li><a href="#">Adam Kinkaid</a></li>
+ ...
+ </ul>
+ </div>
+
+ You can use the enableHandler method with the handler widget to get (if no value is defined) or set the handler usage status. If the [enable] value is true, the handler is enabled; otherwise the handler is not used.
- // After pushing data re-style virtuallist widget
- $( o.id ).trigger( "create" );
- },
+ $("#.selector").scrollview("enableHandler", [enable]);
+*/
+/**
+ @property {Boolean} data-handler
+ Enables the handler widget. The value must be set to true.
+*/
+/**
+ @property {String} data-handler-theme
+ Sets the handler widget theme.
+*/
+( function ( $, document, undefined ) {
+ // The options of handler in scrollview
+ $.tizen.scrollview.prototype.options.handler = false;
+ $.tizen.scrollview.prototype.options.handlerTheme = "s";
- // Set children <li> elements' position
- //
- // this: virtuallist element
- // event: virtuallistview.options
- // TODO: Why this arg name is 'event'? Not resonable.
- // (this function is not called with event element as args!)
- _reposition: function ( event ) {
- var o,
- t = this,
- padding,
- margin;
+ var originSetOption = $.tizen.scrollview.prototype._setOption,
+ createHandler = function ( target ) {
+ var $view = target,
+ prefix = "<div class=\"ui-handler ui-handler-direction-",
+ suffix = "\"><div class=\"ui-handler-track\"><div class=\"ui-handler-thumb\"></div></div></div>",
+ scrollview = $view.data( "scrollview" ),
+ options = scrollview.options,
+ direction = options.direction,
+ parentTheme = $.mobile.getInheritedTheme( scrollview, "s" ),
+ theme = options.theme || parentTheme,
+ isHorizontal = ( scrollview.options.direction === "x" ),
+ _$view = scrollview._$view,
+ _$clip = scrollview._$clip,
+ scrollbar = $view.find( ".ui-scrollbar" ),
+ handler = null,
+ handlerThumb = null,
+ viewLength = 0,
+ clipLength = 0,
+ handlerHeight = 0,
+ handlerMargin = 0,
+ trackLength = 0,
+ moveTimer,
+ isTouchable = $.support.touch,
+ dragStartEvt = ( isTouchable ? "touchstart" : "mousedown" ) + ".handler",
+ dragMoveEvt = ( isTouchable ? "touchmove" : "mousemove" ) + ".handler",
+ dragStopEvt = ( isTouchable ? "touchend" : "mouseup" ) + ".handler",
+ dragLeaveEvt = ( isTouchable ? " touchleave" : " mouseleave" ) + ".handler",
+ calculateLength = function () {
+ clipLength = ( isHorizontal ? _$clip.width() : _$clip.height() );
+ viewLength = ( isHorizontal ? _$view.width() : _$view.height() ) - clipLength;
+ trackLength = clipLength - handlerHeight - handlerMargin * 2;
+ },
+ setHanderPostion = function ( scrollPos ) {
+ var handlerPos = Math.round( ( isHorizontal ? scrollPos.x : scrollPos.y ) / viewLength * trackLength );
+ handlerThumb[0].style[ ( isHorizontal ? "left" : "top" ) ] = handlerPos + "px";
+ },
+ stopHandlerScroll = function () {
+ $( document ).unbind( ".handler" );
+ $view.moveData = null;
+ _$view.trigger( "scrollstop" );
+ };
- if ( event.data ) {
- o = event.data;
- } else {
- o = event;
+ if ( $view.find( ".ui-handler-thumb" ).length !== 0 || typeof direction !== "string" ) {
+ return;
}
- if ( $( o.id + o.childSelector ).size() > 0 ) { // $("#vlistid li")
- // first child's top position
- // NOTE: the first element may not be '0'!!!
- t._title_h = $( o.id + o.childSelector + ':first' ).position().top;
- // first child's outer height (TODO: reuse selected items)
- t._line_h = $( o.id + o.childSelector + ':first' ).outerHeight();
- // container(vlist element)'s innerwidth
- t._container_w = $( o.id ).innerWidth();
+ handler = $( [ prefix, direction, suffix ].join( "" ) ).appendTo( $view.addClass( " ui-handler-" + theme ) );
+ handlerThumb = $view.find( ".ui-handler-thumb" ).attr( {
+ "tabindex" : "0",
+ "aria-label" : ( isHorizontal ? "Horizontal handler, double tap and move to scroll" : "Verticalhandler, double tap and move to scroll" )
+ }).hide();
+ handlerHeight = ( isHorizontal ? handlerThumb.width() : handlerThumb.height() );
+ handlerMargin = ( isHorizontal ? parseInt( handler.css( "right" ), 10 ) : parseInt( handler.css( "bottom" ), 10 ) );
- // get sum of container's left/right padding
- padding = parseInt( $( o.id + o.childSelector ).css( "padding-left" ), 10 )
- + parseInt( $( o.id + o.childSelector ).css( "padding-right" ), 10 );
+ $.extend( $view, {
+ moveData : null
+ });
- // Add CSS to all <li> elements
- // * absolute position
- // * btn-up
- // * mouse up/down/over/out styles
- $( o.id + ">" + o.childSelector )
- .addClass( "position_absolute" )
- .addClass( "ui-btn-up-s" )
- .bind( "mouseup", t._stylerMouseUp )
- .bind( "mousedown", t._stylerMouseDown )
- .bind( "mouseover", t._stylerMouseOver )
- .bind( "mouseout", t._stylerMouseOut );
- }
+ // handler drag
+ handlerThumb.bind( dragStartEvt, {
+ e : handlerThumb[0]
+ }, function ( event ) {
+ scrollview._stopMScroll();
- // Set absolute top/left position of each <li>
- $( o.id + ">" + o.childSelector ).each( function ( index ) {
- margin = parseInt( $( this ).css( "margin-left" ), 10 )
- + parseInt( $( this ).css( "margin-right" ), 10 );
+ var target = event.data.e,
+ t = ( isTouchable ? event.originalEvent.targetTouches[0] : event );
- $( this ).css( "top", t._title_h + t._line_h * index + 'px' )
- .css( "width", t._container_w - padding - margin );
- } );
+ target.style.opacity = 1.0;
- // Set Max Listview Height
- $( o.id ).height( t._numItemData * t._line_h );
- },
+ $view.moveData = {
+ target : target,
+ X : parseInt( target.style.left, 10 ) || 0,
+ Y : parseInt( target.style.top, 10 ) || 0,
+ pX : t.pageX,
+ pY : t.pageY
+ };
+ calculateLength();
- _resize: function ( event ) {
- var o,
- t = this,
- padding,
- margin;
+ _$view.trigger( "scrollstart" );
- if ( event.data ) {
- o = event.data;
- } else {
- o = event;
- }
+ if ( !isTouchable ) {
+ event.preventDefault();
+ }
- t._container_w = $( o.id ).innerWidth();
+ $( document ).bind( dragMoveEvt, function ( event ) {
+ var moveData = $view.moveData,
+ target = moveData.target,
+ handlePos = 0,
+ scrollPos = 0,
+ t = ( isTouchable ? event.originalEvent.targetTouches[0] : event );
- padding = parseInt( $( o.id + o.childSelector ).css( "padding-left" ), 10 )
- + parseInt( $( o.id + o.childSelector ).css( "padding-right" ), 10 );
+ handlePos = ( isHorizontal ? moveData.X + t.pageX - moveData.pX : moveData.Y + t.pageY - moveData.pY );
- $( o.id + o.childSelector ).each( function (index) {
- margin = parseInt( $( this ).css( "margin-left" ), 10 )
- + parseInt( $( this ).css( "margin-right" ), 10 );
- $( this ).css( "width", t._container_w - padding - margin );
- } );
- },
+ if ( handlePos < 0 ) {
+ handlePos = 0;
+ }
- // New scrollmove function supporting scrollTo
- _scrollmove: function ( ev ) {
- var t = ev.data, // vlist (JQM object)
- o = t.options, // options
- prevTopBufLen = t._num_top_items, // Previous(remembered) top buf length
- timerInterval = 100,
- i,
- _scrollView,
- _normalScroll;
+ if ( handlePos > trackLength ) {
+ handlePos = trackLength;
+ }
+ scrollPos = - Math.round( handlePos / trackLength * viewLength );
- _scrollView = {
- viewTop: function ( ) {
- var sv = $( o.id ).parentsUntil( ".ui-page" ).find( ".ui-scrollview-view" ),
- svTrans = sv.css( "-webkit-transform" ),
- svTransVal = "0,0,0,0,0,0";
- if ( svTrans ) {
- svTransVal = svTrans.replace( /matrix\s*\((.*)\)/, "$1" ); // matrix(a,c,b,d,tx,ty)
+ if ( isHorizontal ) {
+ scrollview._setScrollPosition( scrollPos, 0 );
+ target.style.left = handlePos + "px";
+ } else {
+ scrollview._setScrollPosition( 0, scrollPos );
+ target.style.top = handlePos + "px";
}
- return - parseInt( svTransVal.split(',')[5], 10 );
- }
- };
- _normalScroll = {
- viewTop: function ( ) {
- return $( window ).scrollTop( ); // TODO: - _line_h?
- }
- };
- // Get current view top position
- function viewTop ( ) {
- return o.scrollview ? _scrollView.viewTop() : _normalScroll.viewTop();
- }
- // log function for debug
- function log ( msg ) {
- var debug = false;
- if ( debug ) {
- console.log( ">>virtualllist: " + msg );
- }
- }
- // Timer interval function
- // @param[in] vl virtuallist object (JQM object)
- function timerMove ( vl, undefined ) {
- var cy, // current y position
- cti, // current top idx
- cbi, // current bottom idx
- oti = vl._first_index, // old top idx
- obi = vl._last_index, // old botton idx
- dti, // delta of top idx
- fromIdx,
- toIdx, // index range to be moved
- delta, // moveItem delta
- rowLen = vl.options.row, // max. # of items handled at once
- bufSize, // top/bottom buffer size. unit: # of items
- i;
+ event.preventDefault();
+ }).bind( dragStopEvt + dragLeaveEvt, function ( event ) {
+ stopHandlerScroll();
+ });
+ });
- // subroutine: Move itemContents in i2 into i1
- function moveItemContents( vl, i1, i2 ) {
- // TODO: Find a efficient way to replace data!
- // Assumption: i1 and i2 has same children.
- var NODETYPE = { ELEMENT_NODE: 1, TEXT_NODE: 3 },
- c1, // child item 1 (old)
- c2, // child item 2 (new)
- newText,
- newImg,
- i;
+ _$view.bind( dragStopEvt, function ( event ) {
+ stopHandlerScroll();
+ });
- $( i1 ).find( ".ui-li-text-main", ".ui-li-text-sub", ".ui-li-text-sub2", "ui-btn-text" ).each( function ( index ) {
- c1 = $( this );
- newText = $( i2 ).find( ".ui-li-text-main", ".ui-li-text-sub", "ui-btn-text" ).eq( index ).text();
+ $view.bind( "scrollstart", function ( event ) {
+ if ( !scrollview.enableHandler() ) {
+ return;
+ }
- $( c1 ).contents().filter( function () {
- return ( this.nodeType == NODETYPE.TEXT_NODE );
- } ).get( 0 ).data = newText;
- } );
+ calculateLength();
+
+ if ( viewLength < 0 || clipLength < handlerHeight ) {
+ if ( scrollbar.is( ":hidden" ) ) {
+ scrollbar.show();
+ }
+ return;
+ }
- $( i1 ).find( "img" ).each( function ( imgIdx ) {
- var c1 = $( this );
- newImg = $( i2 ).find( "img" ).eq( imgIdx ).attr( "src" );
+ if ( scrollbar.is( ":visible" ) ) {
+ scrollbar.hide();
+ }
- $( c1 ).attr( "src", newImg );
- } );
+ if ( moveTimer ) {
+ clearInterval( moveTimer );
+ moveTimer = undefined;
+ }
- $( i1 ).removeData( ); // Clear old data
+ handler.addClass( "ui-handler-visible" );
+ handlerThumb.stop( true, true )
+ .fadeIn();
+ }).bind( "scrollupdate", function ( event, data ) {
+ if ( !scrollview.enableHandler() || viewLength < 0 || clipLength < handlerHeight ) {
+ return;
}
- // subroutine: Move item
- function moveItem( vl, fromIdx, toIdx ) {
- var itemData, // data from itemData()
- item, // item element
- newItem, // new item element
- tmpl; // template
+ setHanderPostion( scrollview.getScrollPosition() );
+ }).bind( "scrollstop", function ( event ) {
+ if ( !scrollview.enableHandler() || viewLength < 0 || clipLength < handlerHeight ) {
+ return;
+ }
- log( ">> move item: " + fromIdx + " --> " + toIdx );
+ moveTimer = setInterval( function () {
+ setHanderPostion( scrollview.getScrollPosition() );
+ if ( !scrollview._gesture_timer ) {
+ clearInterval( moveTimer );
+ moveTimer = undefined;
+ }
+ }, 10 );
- // Find current item
- item = $( '#' + vl.options.itemIDPrefix + fromIdx ); // TODO: refactor ID generation!
- if ( ! item || ! item.length ) {
- return false;
+ if ( scrollview._handlerTimer ) {
+ clearTimeout( scrollview._handlerTimer );
+ scrollview._handlerTimer = 0;
+ }
+ scrollview._handlerTimer = setTimeout( function () {
+ if ( scrollview._timerID === 0 && $view.moveData === null ) {
+ handlerThumb.stop( true, true )
+ .css( "opacity", 1.0 )
+ .fadeOut( function () {
+ handler.removeClass( "ui-handler-visible" );
+ });
+ scrollview._handlerTimer = 0;
}
+ }, 1000 );
+ }).bind( "mousewheel", function ( event ) {
+ handler.removeClass( "ui-handler-visible" );
+ setHanderPostion( scrollview.getScrollPosition() );
+ });
+ };
- // Get new item
- tmpl = $( "#" + vl.options.template );
- if ( tmpl ) {
- newItem = tmpl.tmpl( vl._itemData( toIdx ) );
+ $.extend( $.tizen.scrollview.prototype, {
+ enableHandler: function ( enabled ) {
+ if ( typeof enabled === 'undefined' ) {
+ return this.options.handler;
+ }
- // TODO: Consider touch block while moving?
+ this.options.handler = !!enabled;
- // Move item contents
- moveItemContents( vl, item, newItem );
+ var $view = this.element;
+ if ( this.options.handler ) {
+ if ( $view.find( ".ui-handler" ).length === 0 ) {
+ createHandler( $view );
+ }
- // clean up temporary item
- newItem.remove();
- }
+ $view.find( ".ui-scrollbar" ).hide();
+ $view.find( ".ui-handler" ).show();
+ } else {
+ $view.find( ".ui-handler" ).removeClass( "ui-handler-visible" ).hide();
+ $view.find( ".ui-scrollbar" ).show();
+ }
+ },
- // Move position, and set id
- item.css( 'top', toIdx * vl._line_h )
- .attr( 'id' , vl.options.itemIDPrefix + toIdx ); // TODO: refactor ID generation!
+ _setHandlerTheme: function ( handlerTheme ) {
+ if ( !handlerTheme ) {
+ return;
+ }
- // TODO: Apply jqmdata? check following old code;
- // $( oldItem ).removeData( ); // Clear old data
- // if (key) { $( oldItem ).data( key, $( newItem ).data( key ) ); }
+ var oldClass = "ui-handler-" + this.options.handlerTheme,
+ newClass = "ui-handler-" + handlerTheme;
- return true;
- }
+ this.element.removeClass( oldClass ).addClass( newClass );
+ this.options.handlerTheme = handlerTheme;
+ },
+ _setOption: function ( key, value ) {
+ switch ( key ) {
+ case "handler":
+ this.enableHandler( value );
+ break;
+ case "handlerTheme":
+ this._setHandlerTheme( value );
+ break;
+ default:
+ originSetOption.call( this, key, value );
+ }
+ },
- // Get current view position
- cy = viewTop();
+ _handlerTimer : 0
+ });
- // Calculate bufSize: rowLen / 3
- // NOTE: Assumption: total row length = visible items * 3 (upper+visible+lower)
- bufSize = Math.ceil( rowLen / 3 );
+ $( document ).delegate( ":jqmData(scroll)", "scrollviewcreate", function () {
+ var widget = $( this );
+ if ( widget.attr( "data-" + $.mobile.ns + "scroll" ) === "none"
+ || widget.attr( "data-" + $.mobile.ns + "handler" ) !== "true" ) {
+ return;
+ }
+ widget.scrollview( "enableHandler", "true" );
+ });
+} ( jQuery, document ) );
- // Calculate current top/bottom index (to be applied)
- // top index = current position / line height
- cti = Math.floor( cy / vl._line_h ) - bufSize; // TODO: consider buffer!
- cbi = cti + rowLen - 1;
- if ( cti < 0 ) { // Top boundary check
- cbi += ( - cti );
- cti = 0;
- } else if ( cbi > ( vl._numItemData - 1 ) ) { // Bottom boundary check
- cti -= ( cbi - ( vl._numItemData - 1 ) );
- cbi = ( vl._numItemData - 1 );
- }
- // Calculate dti
- dti = cti - oti;
- log( "cy=" + cy + ", oti=" + oti + ", obi=" + obi + ", cti=" + cti + ", cbi=" + cbi + ", dti=" + dti );
+/* ***************************************************************************
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * ***************************************************************************
+ *
+ * Author: Jinhyuk Jun <jinhyuk.jun@samsung.com>
+ */
- // switch: dti = 0 --> timer stop condition: delta=0 or scrollstop event comes. END.
- if ( 0 == dti ) {
- // Check timer runtime
- vl.timerStillCount += 1;
- if ( vl.timerStillCount < 12 ) { // check count ( TODO: test and adjust )
- log("dti=0 " + vl.timerStillCount + " times");
- vl.timerMoveID = setTimeout( timerMove, timerInterval, vl ); // run once more
- return;
- }
+(function ( $, undefined ) {
- log("dti=0 " + vl.timerStillCount + " times. End timer.");
- vl.timerStillCount = 0;
- // Stop timer
- if ( vl.timerMoveID ) {
- clearTimeout( vl.timerMoveID );
- vl.timerMoveID = null;
- }
- } else {
- // switch: dti >= # of max elements --> total replace.
- vl.timerStillCount = 0; // Reset still counter
+ $.widget( "mobile.pagelayout", $.mobile.widget, {
+ options: {
+ visibleOnPageShow: true,
+ disablePageZoom: true,
+ transition: "slide", //can be none, fade, slide (slide maps to slideup or slidedown)
+ fullscreen: false,
+ tapToggle: true,
+ tapToggleBlacklist: "a, input, select, textarea, .ui-header-fixed, .ui-footer-fixed",
+ hideDuringFocus: "input, textarea, select",
+ updatePagePadding: true,
+ // Browser detection! Weeee, here we go...
+ // Unfortunately, position:fixed is costly, not to mention probably impossible, to feature-detect accurately.
+ // Some tests exist, but they currently return false results in critical devices and browsers, which could lead to a broken experience.
+ // Testing fixed positioning is also pretty obtrusive to page load, requiring injected elements and scrolling the window
+ // The following function serves to rule out some popular browsers with known fixed-positioning issues
+ // This is a plugin option like any other, so feel free to improve or overwrite it
+ supportBlacklist: function () {
+ var w = window,
+ ua = navigator.userAgent,
+ platform = navigator.platform,
+ // Rendering engine is Webkit, and capture major version
+ wkmatch = ua.match( /AppleWebKit\/([0-9]+)/ ),
+ wkversion = !!wkmatch && wkmatch[ 1 ],
+ ffmatch = ua.match( /Fennec\/([0-9]+)/ ),
+ ffversion = !!ffmatch && ffmatch[ 1 ],
+ operammobilematch = ua.match( /Opera Mobi\/([0-9]+)/ ),
+ omversion = !!operammobilematch && operammobilematch[ 1 ];
- if ( Math.abs( dti ) >= rowLen ) {
- fromIdx = oti;
- toIdx = obi;
- delta = dti;
- log( ">>> WHOLE CHANGE! delta=" + delta );
- } else {
- // switch: dti < # of max elements --> move t2b or b2t until new top/bottom idx is covered
- if ( dti > 0 ) {
- fromIdx = oti;
- toIdx = oti + dti - 1;
- delta = rowLen;
- } else {
- fromIdx = obi + dti + 1; // dti < 0
- toIdx = obi;
- delta = -rowLen;
- }
- log( ">>> partial change. delta=" + delta );
- }
+ if (
+ // iOS 4.3 and older : Platform is iPhone/Pad/Touch and Webkit version is less than 534 (ios5)
+ ( ( platform.indexOf( "iPhone" ) > -1 || platform.indexOf( "iPad" ) > -1 || platform.indexOf( "iPod" ) > -1 ) && wkversion && wkversion < 534 ) ||
+ // Opera Mini
+ ( w.operamini && ({}).toString.call( w.operamini ) === "[object OperaMini]" ) ||
+ ( operammobilematch && omversion < 7458 ) ||
+ //Android lte 2.1: Platform is Android and Webkit version is less than 533 (Android 2.2)
+ ( ua.indexOf( "Android" ) > -1 && wkversion && wkversion < 533 ) ||
+ // Firefox Mobile before 6.0 -
+ ( ffversion && ffversion < 6 ) ||
+ // WebOS less than 3
+ ( window.palmGetResource !== undefined && wkversion && wkversion < 534 ) ||
+ // MeeGo
+ ( ua.indexOf( "MeeGo" ) > -1 && ua.indexOf( "NokiaBrowser/8.5.0" ) > -1 )
+ ) {
+ return true;
+ }
- // Move items
- for ( i = fromIdx; i <= toIdx; i++ ) {
- moveItem( vl, i, i + delta ); // Change data and position
- }
+ return false;
+ },
+ initSelector: ":jqmData(role='content')"
+ },
- // Store current top/bottom idx into vl
- vl._first_index = cti;
- vl._last_index = cbi;
+ _create: function () {
- // Register timer to check again
- vl.timerMoveID = setTimeout( timerMove, timerInterval, vl );
- }
- return; // End of function
+ var self = this,
+ o = self.options,
+ $el = self.element;
+
+ // Feature detecting support for
+ if ( o.supportBlacklist() ) {
+ self.destroy();
+ return;
}
- // ==== function start ====
+ self._addFixedClass();
+ self._addTransitionClass();
+ self._bindPageEvents();
- t.timerStillCount = 0; // Count do-nothing time. For behavior tuning.
+ // only content
+ self._bindContentControlEvents();
+ },
- // If a timer function is alive, clear it
- if ( t.timerMoveID ) {
- clearTimeout( t.timerMoveID );
- t.timerMoveID = null;
+ /* add minimum fixed css style to bar(header/footer) and content
+ * it need to update when core source modified(jquery.mobile.page.section.js)
+ * modified from core source cuz initSelector different */
+ _addFixedClass: function () {
+ var self = this,
+ o = self.options,
+ $el = self.element,
+ $elHeader = $el.siblings( ":jqmData(role='header')" ),
+ $elFooter = $el.siblings( ":jqmData(role='footer')" ),
+ $elPage = $el.closest(".ui-page");
+
+ $elHeader.addClass( "ui-header-fixed" );
+ $elFooter.addClass( "ui-footer-fixed" );
+
+ // "fullscreen" overlay positioning
+ if ( o.fullscreen ) {
+ $elHeader.addClass( "ui-header-fullscreen" );
+ $elFooter.addClass( "ui-footer-fullscreen" );
+ $elPage
+ .addClass( "ui-page-header-fullscreen" )
+ .addClass( "ui-page-footer-fullscreen" );
+ } else {
+ // If not fullscreen, add class to page to set top or bottom padding
+ $elPage.addClass( "ui-page-header-fixed" )
+ .addClass( "ui-page-footer-fixed" );
}
- // run TimerMove()
- timerMove( t );
},
- _recreate: function ( newArray ) {
- var t = this,
- o = this.options;
+ /* original core source(jquery.mobile.fixedToolbar.js)
+ * never changed */
+ _addTransitionClass: function () {
+ var tclass = this.options.transition;
- $( o.id ).empty();
+ if ( tclass && tclass !== "none" ) {
+ // use appropriate slide for header or footer
+ if ( tclass === "slide" ) {
+ tclass = this.element.is( ".ui-header" ) ? "slidedown" : "slideup";
+ }
- t._numItemData = newArray.length;
- t._direction = _NO_SCROLL;
- t._first_index = 0;
- t._last_index = o.row - 1;
+ this.element.addClass( tclass );
+ }
+ },
- t._pushData( o.template );
- if (o.childSelector == " ul" ) {
- $( o.id + " ul" ).swipelist();
+ /* Set default page positon
+ * 1. add title style to header
+ * 2. Set default header/footer position */
+ setHeaderFooter: function ( thisPage ) {
+ var $elPage = $( thisPage ),
+ $elHeader = $elPage.find( ":jqmData(role='header')" ).length ? $elPage.find( ":jqmData(role='header')") : $elPage.siblings( ":jqmData(role='header')"),
+ $elContent = $elPage.find( ".ui-content" ),
+ $elFooter = $elPage.find( ":jqmData(role='footer')" ),
+ $elFooterGroup = $elFooter.find( ":jqmData(role='fieldcontain')" ),
+ $elFooterControlGroup = $elFooter.find( ".ui-controlgroup" );
+
+ // divide content mode scrollview and non-scrollview
+ if ( !$elPage.is( ".ui-dialog" ) ) {
+ if ( $elHeader.jqmData("position") == "fixed" || ( $.support.scrollview && $.tizen.frameworkData.theme.match(/tizen/) ) ) {
+ $elHeader
+ .css( "position", "fixed" )
+ .css( "top", "0px" );
+ } else if ( !$.support.scrollview && $elHeader.jqmData("position") != "fixed" ) {
+ $elHeader.css( "position", "relative" );
+ }
}
- $( o.id ).virtuallistview();
+ /* set Title style */
+ if ( $elHeader.find("span.ui-title-text-sub").length ) {
+ $elHeader.addClass( "ui-title-multiline");
+ }
- t.refresh( true );
+ if ( $elFooterGroup.find( "div" ).is( ".ui-controlgroup-label" ) ) {
+ $elFooterGroup.find( "div.ui-controlgroup-label" ).remove();
+ }
- t._reposition( o );
+ if ( $elFooterControlGroup.length ) {
+ var anchorPer = 100 / $elFooterControlGroup.find( "a" ).length;
+ $elFooterControlGroup.find( "a" ).each( function ( i ) {
+ $elFooterControlGroup.find( "a" ).eq( i ).width( anchorPer + "%" );
+ });
+ }
},
- // Init virtuallistview
- // this virtuallistview object
- _initList: function () {
- var t = this,
- o = this.options;
-
- /* After AJAX loading success */
+ _bindPageEvents: function () {
+ var self = this,
+ o = self.options,
+ $el = self.element,
+ $elCurrentFooter;
- // Put initial <li> elements
- t._pushData( o.template );
+ //page event bindings
+ // Fixed toolbars require page zoom to be disabled, otherwise usability issues crop up
+ // This method is meant to disable zoom while a fixed-positioned toolbar page is visible
+ $el.closest( ".ui-page" )
+ .bind( "pagebeforeshow", function ( event ) {
+ var thisPage = this;
+ if ( o.disablePageZoom ) {
+ $.mobile.zoom.disable( true );
+ }
+ if ( !o.visibleOnPageShow ) {
+ self.hide( true );
+ }
+ self.setHeaderFooter( thisPage );
+ self._setContentMinHeight( thisPage );
+ } )
+ .bind( "webkitAnimationStart animationstart updatelayout", function ( e, data ) {
+ var thisPage = this;
+ if ( o.updatePagePadding ) {
+ self.updatePagePadding(thisPage);
+ self.updatePageLayout( thisPage, data);
+ }
+ })
- // find a parent page, and run _reposition() at 'pageshow' event
- // TODO: Consider replace parentsUntil().parent() to parent('.ui-page') ???
- $( o.id ).parentsUntil( ".ui-page" ).parent().one( "pageshow", function () {
- setTimeout( function () {
- t._reposition( o );
- }, 0);
- });
+ .bind( "pageshow", function ( event ) {
+ var thisPage = this;
+ self._setContentMinHeight( thisPage );
+ self.updatePagePadding( thisPage );
+ self._updateHeaderArea( thisPage );
+ if ( o.updatePagePadding ) {
+ $( window ).bind( "throttledresize." + self.widgetName, function () {
+ self.updatePagePadding(thisPage);
- // Bind _scrollmove() at 'scrollstart.virtuallist' event
- $( document ).bind( "scrollstart.virtuallist scrollstop.vrituallist", t, t._scrollmove );
+ self.updatePageLayout( thisPage, false);
+ self._updateHeaderArea( thisPage );
+ self._setContentMinHeight( thisPage );
+ });
+ }
+ })
- // Bind _resize() at 'resize.virtuallist'
- $( window ).bind( "resize.virtuallist", t._resize );
+ .bind( "pagebeforehide", function ( e, ui ) {
+ if ( o.disablePageZoom ) {
+ $.mobile.zoom.enable( true );
+ }
+ if ( o.updatePagePadding ) {
+ $( window ).unbind( "throttledresize." + self.widgetName );
+ }
+ });
- // when ul is a childselector, assume that this is also a swipelist,
- // and run swipelist constructor
- if ( o.childSelector == " ul" ) {
- $( o.id + " ul" ).swipelist();
- }
+ window.addEventListener( "softkeyboardchange", function ( e ) {
+ var $elDownBtn = $( "<div class='ui-btn-footer-down'></div>" ),
+ $elPage = $( ".ui-page-active" ),
+ backBtnPosition = "footer";
+
+ if ( $elPage.data( "addBackBtn" ) ) {
+ $elPage.data( "addBackBtn" ) == "header" ? backBtnPosition = "header" : backBtnPosition = "footer";
+
+ if ( e.state == "on" ) {
+ if ( !$elPage.find( ".ui-" + backBtnPosition + " .ui-btn-footer-down" ).length ) {
+ $elDownBtn.buttonMarkup( { icon: "down" } ).appendTo( $elPage.find( ".ui-" + backBtnPosition ) );
+ $( ".ui-btn-footer-down" ).bind( "vclick", function ( ) {
+ $elPage.find( "input" ).blur();
+ });
+ }
+ $( ".ui-page-active .ui-btn-back" ).remove();
+ } else if ( e.state == "off" ) {
+ $elPage.page( "addBackBtn", backBtnPosition );
+ $( ".ui-btn-footer-down" ).remove();
+ }
+ }
- t.refresh( true );
+ });
},
- create: function () {
- var o = this.options;
+ _bindContentControlEvents: function () {
+ var self = this,
+ o = self.options,
+ $el = self.element;
- /* external API for AJAX callback */
- this._create.apply( this, arguments );
+ $el.closest( ".ui-page" )
+ .bind( "pagebeforeshow", function ( event ) {
- // TODO: remove this line? _initList() calls reposition...
- this._reposition( o );
+ });
},
- _create: function ( args ) {
- // Extend instance variables
- $.extend( this, {
- _itemData : function ( idx ) { return null; },
- _numItemData : 0,
- _cacheItemData : function ( minIdx, maxIdx ) { },
- _title_h : 0,
- _container_w : 0,
- _minimum_row : 100,
- _direction : _NO_SCROLL,
- _first_index : 0,
- _last_index : 0,
- _num_top_items : 0 // By scroll move, number of hidden elements.
- } );
-
- // local variables
- var t = this,
- o = this.options,
- $el = this.element,
- shortcutsContainer = $('<div class="ui-virtuallist"/>'),
- shortcutsList = $('<ul></ul>'),
- dividers = $el.find(':jqmData(role="virtuallistview" )'),
- lastListItem = null,
- shortcutscroll = this,
- dbtable_name,
- dbtable;
-
-
- // Add CSS classes to $el (=virtuallistview)
- $el.addClass( function ( i, orig ) {
- return orig + " ui-listview ui-virtual-list-container" + ( t.options.inset ? " ui-listview-inset ui-corner-all ui-shadow " : "" );
- });
+ _setContentMinHeight : function ( thisPage ) {
+ var $elPage = $( thisPage ),
+ $elHeader = $elPage.find( ":jqmData(role='header')" ),
+ $elFooter = $elPage.find( ":jqmData(role='footer')" ),
+ $elContent = $elPage.find( ":jqmData(role='content')" ),
+ resultMinHeight;
- // keep the vlist's ID
- o.itemIDPrefix = $el.attr( "id" ) + '_';
- o.id = "#" + $el.attr( "id" );
+ resultMinHeight = window.innerHeight - $elHeader.height() - $elFooter.height();
- // when page hides, empty all child elements
- $( o.id ).bind( "pagehide", function ( e ) {
- $( o.id ).empty();
- });
+ $elContent.css( "min-height", resultMinHeight - parseFloat( $elContent.css("padding-top") ) - parseFloat( $elContent.css("padding-bottom") ) + "px" );
+ },
- // Find if scrollview is used
- if ( $( ".ui-scrollview-clip" ).size() > 0 ) {
- o.scrollview = true;
- } else {
- o.scrollview = false;
+ _updateHeaderArea : function ( thisPage ) {
+ var $elPage = $( thisPage ),
+ $elHeader = $elPage.find( ":jqmData(role='header')" ).length ? $elPage.find( ":jqmData(role='header')") : $elPage.siblings( ":jqmData(role='header')"),
+ headerBtnNum = $elHeader.children("a").length,
+ headerSrcNum = $elHeader.children("img").length;
+
+ if ( !$elPage.is( ".ui-dialog" ) ) {
+ $elHeader.find( "h1" ).css( "width", window.innerWidth - parseInt( $elHeader.find( "h1" ).css( "margin-left" ), 10 ) * 2 - $elHeader.children( "a" ).width() * headerBtnNum - $elHeader.children( "a" ).width() / 4 - $elHeader.children( "img" ).width() * headerSrcNum * 4 );
}
+ /* add half width for default space between text and button, and img tag area is too narrow, so multiply three for img width*/
+ },
- // Calculate page buffer size
- if ( $el.data( "row" ) ) {
- o.row = $el.data( "row" );
+ _visible: true,
- if ( o.row < t._minimum_row ) {
- o.row = t._minimum_row;
- }
+ // This will set the content element's top or bottom padding equal to the toolbar's height
+ updatePagePadding: function ( tbPage ) {
+ var $el = this.element,
+ header = $el.siblings( ".ui-header" ).length,
+ footer = $el.siblings( ".ui-footer" ).length;
- o.page_buf = parseInt( ( o.row / 2 ), 10 );
+ // This behavior only applies to "fixed", not "fullscreen"
+ if ( this.options.fullscreen ) {
+ return;
}
- // Get arguments
- if ( args ) {
- if ( args.itemData && typeof args.itemData == 'function' ) {
- t._itemData = args.itemData;
- } else {
- return;
- }
- if ( args.numItemData ) {
- if ( typeof args.numItemData == 'function' ) {
- t._numItemData = args.numItemData( );
- } else if ( typeof args.numItemData == 'number' ) {
- t._numItemData = args.numItemData;
- } else {
- return;
- }
- } else {
- return;
- }
- } else { // No option is given
- // Legacy support: dbtable
- console.warn( "WARNING: The data interface of virtuallist is changed. \nOld data interface(data-dbtable) is still supported, but will be removed in next version. \nPlease fix your code soon!" );
-
- /* After DB Load complete, Init Vritual list */
- if ( $( o.id ).hasClass( "vlLoadSuccess" ) ) {
- dbtable_name = $el.jqmData('dbtable');
- dbtable = window[ dbtable_name ];
+ tbPage = tbPage || $el.closest( ".ui-page" );
- $( o.id ).empty();
+ if ( $el.siblings( ".ui-header" ).jqmData("position") == "fixed" || $.support.scrollview ) {
+ $( tbPage ).css( "padding-top", ( header ? $el.siblings( ".ui-header" ).outerHeight() : 0 ) );
+ }
+ $( tbPage ).css( "padding-bottom", ( footer ? $el.siblings( ".ui-footer" ).outerHeight() : 0 ) );
+ },
- if ( !dbtable ) {
- dbtable = { };
- }
+ /* 1. Calculate and update content height */
+ updatePageLayout: function ( thisPage, receiveType ) {
+ var $elFooter,
+ $elPage = $( thisPage ),
+ $elHeader = $elPage.find( ":jqmData(role='header')" ),
+ $elContent = $elPage.find( ":jqmData(role='content')" ),
+ resultContentHeight = 0,
+ resultFooterHeight = 0,
+ resultHeaderHeight = 0;
- t._itemData = function ( idx ) {
- return dbtable[ idx ];
- };
- t._numItemData = dbtable.length;
- } else {
- return; // Do nothing
- }
+ if ( $elPage.length ) {
+ $elFooter = $elPage.find( ":jqmData(role='footer')" );
+ } else {
+ $elFooter = $( document ).find( ":jqmData(role='footer')" ).eq( 0 );
}
- // Get template data
- if ( $el.data( "template" ) ) {
- o.template = $el.data( "template" );
+ // calculate footer height
+ resultFooterHeight = ( $elFooter.css( "display" ) == "none" || $elFooter.length == 0 ) ? 0 : $elFooter.height();
+ resultHeaderHeight = ( $elHeader.css( "display" ) == "none" || $elHeader.length == 0 ) ? 0 : $elHeader.height();
- /* to support swipe list, <li> or <ul> can be main node of virtual list. */
- if ( $el.data( "swipelist" ) == true ) {
- o.childSelector = " ul";
- } else {
- o.childSelector = " li";
- }
+ if (resultFooterHeight != 0 ) {
+ $elFooter.css( "bottom", 0 );
}
- // Set data's unique key
- // NOTE: Unnecessary?
- if ( $el.data( "dbkey" ) ) {
- o.dbkey = $el.data( "dbkey" );
+ resultContentHeight = window.innerHeight - resultFooterHeight - resultHeaderHeight;
+
+ if ( $.support.scrollview ) {
+ $elContent.height( resultContentHeight -
+ parseFloat( $elContent.css("padding-top") ) -
+ parseFloat( $elContent.css("padding-bottom") ) );
}
- t._first_index = 0; // initial top idx of <li> element.
- t._last_index = o.row - 1; // initial bottom idx of <li> element.
- t._initList(); // NOTE: Called at here only!
+ // External call page( "refresh") - in case title changed
+ if ( receiveType ) {
+ $elPage
+ .css( "min-height", resultContentHeight )
+ .css( "padding-top", resultHeaderHeight )
+ .css( "padding-bottom", resultFooterHeight );
+ }
},
- destroy : function () {
- var o = this.options;
-
- $( document ).unbind( "scrollstop" );
+ show: function ( notransition ) {
+ /* blank function: deprecated */
+ },
- $( window ).unbind( "resize.virtuallist" );
+ hide: function ( notransition ) {
+ /* blank function: deprecated */
+ },
- $( o.id ).empty();
+ toggle: function () {
+ this[ this._visible ? "hide" : "show" ]();
+ },
- if ( this.timerMoveID ) {
- clearTimeout( this.timerMoveID );
- this.timerMoveID = null;
- }
+ destroy: function () {
+ this.element.removeClass( "ui-header-fixed ui-footer-fixed ui-header-fullscreen ui-footer-fullscreen in out fade slidedown slideup ui-fixed-hidden" );
+ this.element.closest( ".ui-page" ).removeClass( "ui-page-header-fixed ui-page-footer-fixed ui-page-header-fullscreen ui-page-footer-fullscreen" );
},
- _itemApply: function ( $list, item ) {
- var $countli = item.find( ".ui-li-count" );
+ refresh: function () {
+ var $elPage = $( ".ui-page-active" );
+ this.setHeaderFooter( $elPage );
+ this._updateHeaderArea( $elPage );
+ }
+ });
- if ( $countli.length ) {
- item.addClass( "ui-li-has-count" );
+ //auto self-init widgets
+ $( document )
+ .bind( "pagecreate create", function ( e ) {
+ // DEPRECATED in 1.1: support for data-fullscreen=true|false on the page element.
+ // This line ensures it still works, but we recommend moving the attribute to the toolbars themselves.
+ if ( $( e.target ).jqmData( "fullscreen" ) ) {
+ $( $.mobile.pagelayout.prototype.options.initSelector, e.target ).not( ":jqmData(fullscreen)" ).jqmData( "fullscreen", true );
}
+ $.mobile.pagelayout.prototype.enhanceWithin( e.target );
+ });
- $countli.addClass( "ui-btn-up-" + ( $list.jqmData( "counttheme" ) || this.options.countTheme ) + " ui-btn-corner-all" );
+}( jQuery ));
- // TODO class has to be defined in markup
- item.find( "h1, h2, h3, h4, h5, h6" ).addClass( "ui-li-heading" ).end()
- .find( "p, dl" ).addClass( "ui-li-desc" ).end()
- .find( ">img:eq(0), .ui-link-inherit>img:eq(0)" ).addClass( "ui-li-thumb" ).each( function () {
- item.addClass( $( this ).is( ".ui-li-icon" ) ? "ui-li-has-icon" : "ui-li-has-thumb" );
- }).end()
- .find( ".ui-li-aside" ).each(function () {
- var $this = $( this );
- $this.prependTo( $this.parent() ); //shift aside to front for css float
- } );
- },
- _removeCorners: function ( li, which ) {
- var top = "ui-corner-top ui-corner-tr ui-corner-tl",
- bot = "ui-corner-bottom ui-corner-br ui-corner-bl";
- li = li.add( li.find( ".ui-btn-inner, .ui-li-link-alt, .ui-li-thumb" ) );
+/*
+ * This software is licensed under the MIT licence (as defined by the OSI at
+ * http://www.opensource.org/licenses/mit-license.php)
+ *
+ * ***************************************************************************
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2011 by Intel Corporation Ltd.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * ***************************************************************************
+ */
- if ( which === "top" ) {
- li.removeClass( top );
- } else if ( which === "bottom" ) {
- li.removeClass( bot );
- } else {
- li.removeClass( top + " " + bot );
- }
- },
+( function ($, undefined) {
- _refreshCorners: function ( create ) {
- var $li,
- $visibleli,
- $topli,
- $bottomli;
+ $.widget( "tizen.triangle", $.tizen.widgetex, {
+ options: {
+ extraClass: "",
+ offset: null,
+ color: null,
+ location: "top",
+ initSelector: ":jqmData(role='triangle')"
+ },
- if ( this.options.inset ) {
- $li = this.element.children( "li" );
- // at create time the li are not visible yet so we need to rely on .ui-screen-hidden
- $visibleli = create ? $li.not( ".ui-screen-hidden" ) : $li.filter( ":visible" );
+ _create: function () {
+ var triangle = $( "<div></div>", {"class" : "ui-triangle"} );
- this._removeCorners( $li );
+ $.extend(this, {
+ _triangle: triangle
+ });
- // Select the first visible li element
- $topli = $visibleli.first()
- .addClass( "ui-corner-top" );
+ this.element.addClass( "ui-triangle-container" ).append( triangle );
+ },
- $topli.add( $topli.find( ".ui-btn-inner" ) )
- .find( ".ui-li-link-alt" )
- .addClass( "ui-corner-tr" )
- .end()
- .find( ".ui-li-thumb" )
- .not( ".ui-li-icon" )
- .addClass( "ui-corner-tl" );
+ _doCSS: function () {
+ var location = ( this.options.location || "top" ),
+ offsetCoord = ( ($.inArray(location, ["top", "bottom"]) === -1) ? "top" : "left"),
+ cssArg = {
+ "border-bottom-color" : "top" === location ? this.options.color : "transparent",
+ "border-top-color" : "bottom" === location ? this.options.color : "transparent",
+ "border-left-color" : "right" === location ? this.options.color : "transparent",
+ "border-right-color" : "left" === location ? this.options.color : "transparent"
+ };
- // Select the last visible li element
- $bottomli = $visibleli.last()
- .addClass( "ui-corner-bottom" );
+ cssArg[offsetCoord] = this.options.offset;
- $bottomli.add( $bottomli.find( ".ui-btn-inner" ) )
- .find( ".ui-li-link-alt" )
- .addClass( "ui-corner-br" )
- .end()
- .find( ".ui-li-thumb" )
- .not( ".ui-li-icon" )
- .addClass( "ui-corner-bl" );
- }
+ this._triangle.removeAttr( "style" ).css( cssArg );
},
- // this virtuallistview object
- refresh: function ( create ) {
- this.parentPage = this.element.closest( ".ui-page" );
- // Make sub page, and move the virtuallist into it...
- // NOTE: check this subroutine.
- this._createSubPages();
+ _setOffset: function ( value ) {
+ this.options.offset = value;
+ this.element.attr( "data-" + ($.mobile.ns || "") + "offset", value );
+ this._doCSS();
+ },
- var o = this.options,
- $list = this.element,
- self = this,
- dividertheme = $list.jqmData( "dividertheme" ) || o.dividerTheme,
- listsplittheme = $list.jqmData( "splittheme" ),
- listspliticon = $list.jqmData( "spliticon" ),
- li = $list.children( "li" ),
- counter = $.support.cssPseudoElement || !$.nodeName( $list[ 0 ], "ol" ) ? 0 : 1,
- item,
- itemClass,
- temTheme,
- a,
- last,
- splittheme,
- countParent,
- icon,
- pos,
- numli,
- itemTheme;
+ _setExtraClass: function ( value ) {
+ this._triangle.addClass( value );
+ this.options.extraClass = value;
+ this.element.attr( "data-" + ($.mobile.ns || "") + "extra-class", value );
+ },
- // TODO: ?
- if ( counter ) {
- $list.find( ".ui-li-dec" ).remove();
- }
+ _setColor: function ( value ) {
+ this.options.color = value;
+ this.element.attr( "data-" + ($.mobile.ns || "") + "color", value );
+ this._doCSS();
+ },
- for ( pos = 0, numli = li.length; pos < numli; pos++ ) {
- item = li.eq( pos );
- itemClass = "ui-li";
+ _setLocation: function ( value ) {
+ this.element
+ .removeClass( "ui-triangle-container-" + this.options.location )
+ .addClass( "ui-triangle-container-" + value );
+ this._triangle
+ .removeClass( "ui-triangle-" + this.options.location )
+ .addClass( "ui-triangle-" + value );
- // If we're creating the element, we update it regardless
- if ( create || !item.hasClass( "ui-li" ) ) {
- itemTheme = item.jqmData( "theme" ) || o.theme;
- a = item.children( "a" );
+ this.options.location = value;
+ this.element.attr( "data-" + ($.mobile.ns || "") + "location", value );
- if ( a.length ) {
- icon = item.jqmData( "icon" );
+ this._doCSS();
+ }
+ });
- item.buttonMarkup({
- wrapperEls: "div",
- shadow: false,
- corners: false,
- iconpos: "right",
- /* icon: a.length > 1 || icon === false ? false : icon || "arrow-r",*/
- icon: false, /* Remove unnecessary arrow icon */
- theme: itemTheme
- });
+ $( document ).bind( "pagecreate create", function ( e ) {
+ $($.tizen.triangle.prototype.options.initSelector, e.target)
+ .not(":jqmData(role='none'), :jqmData(role='nojs')")
+ .triangle();
+ });
- if ( ( icon != false ) && ( a.length == 1 ) ) {
- item.addClass( "ui-li-has-arrow" );
- }
+}(jQuery) );
- a.first().addClass( "ui-link-inherit" );
- if ( a.length > 1 ) {
- itemClass += " ui-li-has-alt";
- last = a.last();
- splittheme = listsplittheme || last.jqmData( "theme" ) || o.splitTheme;
+/* ***************************************************************************
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * ***************************************************************************
+ *
+ * jQuery Mobile Framework : "tabbar" plugin
+ * Copyright (c) jQuery Project
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ * Authors: Jinhyuk Jun <jinhyuk.jun@samsung.com>
+*/
- last.appendTo(item)
- .attr( "title", last.getEncodedText() )
- .addClass( "ui-li-link-alt" )
- .empty()
- .buttonMarkup({
- shadow: false,
- corners: false,
- theme: itemTheme,
- icon: false,
- iconpos: false
- })
- .find( ".ui-btn-inner" )
- .append(
- $( "<span />" ).buttonMarkup({
- shadow: true,
- corners: true,
- theme: splittheme,
- iconpos: "notext",
- icon: listspliticon || last.jqmData( "icon" ) || o.splitIcon
- })
- );
- }
- } else if ( item.jqmData( "role" ) === "list-divider" ) {
+/**
+ * Tabbar can be created using data-role = "tabbar" inside footer
+ * Framework determine which tabbar will display with tabbar attribute
+ *
+ * Examples:
+ *
+ * HTML markup for creating tabbar: ( 2 ~ 5 li item available )
+ * icon can be changed data-icon attribute (customized icon need)
+ * <div data-role="footer" data-position ="fixed">
+ * <div data-role="tabbar">
+ * <ul>
+ * <li><a href="#" class="ui-btn-active">Menu</a></li>
+ * <li><a href="#">Save</a></li>
+ * <li><a href="#">Share</a></li>
+ * </ul>
+ * </div>
+ * </div>
+*/
- itemClass += " ui-li-divider ui-btn ui-bar-" + dividertheme;
- item.attr( "role", "heading" );
+(function ( $, undefined ) {
- //reset counter when a divider heading is encountered
- if ( counter ) {
- counter = 1;
- }
+ $.widget( "tizen.tabbar", $.mobile.widget, {
+ options: {
+ iconpos: "top",
+ grid: null,
+ defaultList : 4,
+ initSelector: ":jqmData(role='tabbar')"
+ },
- } else {
- itemClass += " ui-li-static ui-body-" + itemTheme;
- }
- }
+ _create: function () {
- if ( counter && itemClass.indexOf( "ui-li-divider" ) < 0 ) {
- countParent = item.is( ".ui-li-static:first" ) ? item : item.find( ".ui-link-inherit" );
+ var $tabbar = this.element,
+ $tabbtns,
+ textpos,
+ iconpos,
+ theme = $.mobile.listview.prototype.options.theme, /* Get current theme */
+ ww = window.innerWidth || $( window ).width(),
+ wh = window.innerHeight || $( window ).height(),
+ tabbarDividerLeft = "<div class='ui-tabbar-divider ui-tabbar-divider-left'></div>",
+ tabbarDividerRight = "<div class='ui-tabbar-divider ui-tabbar-divider-right'></div>",
+ isLandscape;
- countParent.addClass( "ui-li-jsnumbering" )
- .prepend( "<span class='ui-li-dec'>" + (counter++) + ". </span>" );
- }
+ isLandscape = ww > wh && ( ww - wh );
- item.add( item.children( ".ui-btn-inner" ) ).addClass( itemClass );
+ if ( isLandscape ) {
+ $tabbar.removeClass( "ui-portrait-tabbar" ).addClass( "ui-landscape-tabbar" );
+ } else {
+ $tabbar.removeClass( "ui-landscape-tabbar" ).addClass( "ui-portrait-tabbar" );
+ }
- self._itemApply( $list, item );
+ if ( $tabbar.find( "a" ).length ) {
+ $tabbtns = $tabbar.find( "a" );
+ iconpos = $tabbtns.filter( ":jqmData(icon)" ).length ? this.options.iconpos : undefined;
+ textpos = $tabbtns.html().length ? true : false;
}
- this._refreshCorners( create );
- },
+ if ( $tabbar.parents( ".ui-header" ).length && $tabbar.parents( ".ui-scrollview-view" ).length ) {
+ $tabbar.find( "li" ).addClass( "tabbar-scroll-li" );
+ $tabbar.find( "ul" ).addClass( "tabbar-scroll-ul" );
- //create a string for ID/subpage url creation
- _idStringEscape: function ( str ) {
- return str.replace(/\W/g , "-");
- },
+ /* add shadow divider */
+ $( tabbarDividerLeft ).appendTo( $tabbar.parents( ".ui-scrollview-clip" ) );
+ $( tabbarDividerRight ).appendTo( $tabbar.parents( ".ui-scrollview-clip" ) );
- // ?
- // this virtuallistview object
- _createSubPages: function () {
- var parentList = this.element,
- parentPage = parentList.closest( ".ui-page" ),
- parentUrl = parentPage.jqmData( "url" ),
- parentId = parentUrl || parentPage[ 0 ][ $.expando ],
- parentListId = parentList.attr( "id" ),
- o = this.options,
- dns = "data-" + $.mobile.ns,
- self = this,
- persistentFooterID = parentPage.find( ":jqmData(role='footer')" ).jqmData( "id" ),
- hasSubPages,
- newRemove;
+ $( ".ui-tabbar-divider-left" ).hide();
+ $( ".ui-tabbar-divider-right" ).hide();
+
+ /* add width calculation*/
+ if ( $tabbar.parents( ".ui-scrollview-view" ).data("default-list") ) {
+ this.options.defaultList = $tabbar.parents( ".ui-scrollview-view" ).data( "default-list" );
+ }
+ $tabbar.find( "li" ).css( "width", window.innerWidth / this.options.defaultList + "px" );
+ } else {
+ if ( $tabbar.find( "ul" ).children().length ) {
+ $tabbar.addClass( "ui-navbar" )
+ .find( "ul" )
+ .grid( { grid: this.options.grid } );
+ }
+ }
+
+ if ( $tabbar.parents( ".ui-footer" ).length ) {
+ $tabbar.find( "li" ).addClass( "ui-tab-btn-style" );
+ }
- if ( typeof listCountPerPage[ parentId ] === "undefined" ) {
- listCountPerPage[ parentId ] = -1;
+ /* title tabbar */
+ if ( $tabbar.siblings( ".ui-title" ).length ) {
+ $tabbar.parents( ".ui-header" ).addClass( "ui-title-tabbar" );
}
- parentListId = parentListId || ++listCountPerPage[ parentId ];
+ if ( !iconpos ) {
+ $tabbar.addClass( "ui-tabbar-noicons" );
+ }
+ if ( !textpos ) {
+ $tabbar.addClass( "ui-tabbar-notext" );
+ }
+ if ( textpos && iconpos ) {
+ $tabbar.parents( ".ui-header" ).addClass( "ui-title-tabbar-multiline" );
+ }
- $( parentList.find( "li>ul, li>ol" ).toArray().reverse() ).each(function ( i ) {
- var self = this,
- list = $( this ),
- listId = list.attr( "id" ) || parentListId + "-" + i,
- parent = list.parent(),
- nodeEls,
- title = nodeEls.first().getEncodedText(),//url limits to first 30 chars of text
- id = ( parentUrl || "" ) + "&" + $.mobile.subPageUrlKey + "=" + listId,
- theme = list.jqmData( "theme" ) || o.theme,
- countTheme = list.jqmData( "counttheme" ) || parentList.jqmData( "counttheme" ) || o.countTheme,
- newPage,
- anchor;
+ if ( $tabbar.find( "a" ).length ) {
+ $tabbtns.buttonMarkup({
+ corners: false,
+ shadow: false,
+ iconpos: iconpos
+ });
+ }
- nodeEls = $( list.prevAll().toArray().reverse() );
- nodeEls = nodeEls.length ? nodeEls : $( "<span>" + $.trim( parent.contents()[ 0 ].nodeValue ) + "</span>" );
+ if ( $tabbar.find( ".ui-state-persist" ).length ) {
+ $tabbar.addClass( "ui-tabbar-persist" );
+ }
- //define hasSubPages for use in later removal
- hasSubPages = true;
+ $tabbar.delegate( "a", "vclick", function ( event ) {
+ $tabbtns.not( ".ui-state-persist" ).removeClass( $.mobile.activeBtnClass );
+ $( this ).addClass( $.mobile.activeBtnClass );
+ });
- newPage = list.detach()
- .wrap( "<div " + dns + "role='page' " + dns + "url='" + id + "' " + dns + "theme='" + theme + "' " + dns + "count-theme='" + countTheme + "'><div " + dns + "role='content'></div></div>" )
- .parent()
- .before( "<div " + dns + "role='header' " + dns + "theme='" + o.headerTheme + "'><div class='ui-title'>" + title + "</div></div>" )
- .after( persistentFooterID ? $( "<div " + dns + "role='footer' " + dns + "id='" + persistentFooterID + "'>" ) : "" )
- .parent()
- .appendTo( $.mobile.pageContainer );
+ $tabbar.addClass( "ui-tabbar");
- newPage.page();
+ $( document ).bind( "pagebeforeshow", function ( event, ui ) {
+ var footer_filter = $( event.target ).find( ":jqmData(role='footer')" ),
+ tabbar_filter = footer_filter.find( ":jqmData(role='tabbar')" ),
+ $elFooterMore = tabbar_filter.siblings( ":jqmData(icon='naviframe-more')" ),
+ $elFooterBack = tabbar_filter.siblings( ".ui-btn-back" );
- anchor = parent.find('a:first');
+ footer_filter
+ .css( "position", "fixed" )
+ .css( "bottom", 0 )
+ .css( "height", tabbar_filter.height() );
+ if ( $elFooterMore.length ) {
+ tabbar_filter.addClass( "ui-tabbar-margin-more" );
+ }
+ if ( $elFooterBack.length ) {
+ tabbar_filter.addClass( "ui-tabbar-margin-back" );
+ }
+ });
- if ( !anchor.length ) {
- anchor = $( "<a/>" ).html( nodeEls || title ).prependTo( parent.empty() );
+ $tabbar.bind( "touchstart vmousedown", function ( e ) {
+ var $tabbarScroll = $( e.target ).parents( ".ui-scrollview-view" );
+ if ( $tabbarScroll.offset() ) {
+ if ( $tabbarScroll.offset().left < 0 ) {
+ $( ".ui-tabbar-divider-left" ).show();
+ } else {
+ $( ".ui-tabbar-divider-left" ).hide();
+ }
+ if ( ( $tabbarScroll.width() - $tabbarScroll.parents( ".ui-scrollview-clip" ).width() ) == Math.abs( $tabbarScroll.offset().left ) ) {
+ $( ".ui-tabbar-divider-right" ).hide();
+ } else {
+ $( ".ui-tabbar-divider-right" ).show();
+ }
}
+ });
- anchor.attr( "href", "#" + id );
+ this._bindTabbarEvents();
+ this._initTabbarAnimation();
+ },
- }).virtuallistview();
+ _initTabbarAnimation: function () {
+ var isScrollingStart = false,
+ isScrollingEnd = false;
+ $( document ).bind( "scrollstart.tabbar", function ( e ) {
+ if ( $( e.target ).find( ".ui-tabbar" ).length ) {
+ isScrollingStart = true;
+ isScrollingEnd = false;
+ }
+ });
- // on pagehide, remove any nested pages along with the parent page, as long as they aren't active
- // and aren't embedded
- if ( hasSubPages &&
- parentPage.is( ":jqmData(external-page='true')" ) &&
- parentPage.data( "page" ).options.domCache === false ) {
+ $( document ).bind( "scrollstop.tabbar", function ( e ) {
+ var $tabbarScrollview = $( e.target ),
+ $elTabbar = $( e.target ).find( ".ui-tabbar" ),
+ $elTabbarLI = $( e.target ).find( ".ui-tabbar li" ),
+ $minElement = $elTabbarLI.eq( 0 ),
+ minElementIndexVal,
+ minElementIndex = -1;
- newRemove = function ( e, ui ) {
- var nextPage = ui.nextPage, npURL;
+ isScrollingEnd = true;
+ if ( $elTabbar.length && isScrollingStart == true ) {
+ minElementIndexVal = Math.abs( $elTabbarLI.eq( 0 ).offset().left );
+ $elTabbarLI.each( function ( i ) {
+ var offset = $elTabbarLI.eq( i ).offset();
- if ( ui.nextPage ) {
- npURL = nextPage.jqmData( "url" );
- if ( npURL.indexOf( parentUrl + "&" + $.mobile.subPageUrlKey ) !== 0 ) {
- self.childPages().remove();
- parentPage.remove();
+ if ( Math.abs( offset.left ) < minElementIndexVal ) {
+ minElementIndexVal = Math.abs( offset.left );
+ minElementIndex = i;
+ $minElement = $elTabbarLI.eq( i );
}
+ });
+
+ if ( $tabbarScrollview.length && isScrollingStart == isScrollingEnd && minElementIndex != -1) {
+ isScrollingStart = false;
+ $tabbarScrollview.scrollview( "scrollTo", -( window.innerWidth / $elTabbar.data( "defaultList" ) * minElementIndex ) , 0, 357);
}
- };
+ }
- // unbind the original page remove and replace with our specialized version
- parentPage
- .unbind( "pagehide.remove" )
- .bind( "pagehide.remove", newRemove );
- }
+ $( ".ui-tabbar-divider-left" ).hide();
+ $( ".ui-tabbar-divider-right" ).hide();
+ });
},
- // TODO sort out a better way to track sub pages of the virtuallistview this is brittle
- childPages: function () {
- var parentUrl = this.parentPage.jqmData( "url" );
+ _bindTabbarEvents: function () {
+ var $tabbar = this.element;
- return $( ":jqmData(url^='" + parentUrl + "&" + $.mobile.subPageUrlKey + "')" );
+ $( window ).bind( "orientationchange", function ( e, ui ) {
+ var ww = window.innerWidth || $( window ).width(),
+ wh = window.innerHeight || $( window ).height(),
+ isLandscape = ww > wh && ( ww - wh );
+
+ if ( isLandscape ) {
+ $tabbar.removeClass( "ui-portrait-tabbar" ).addClass( "ui-landscape-tabbar" );
+ } else {
+ $tabbar.removeClass( "ui-landscape-tabbar" ).addClass( "ui-portrait-tabbar" );
+ }
+ });
+ },
+
+ _setDisabled: function ( value, cnt ) {
+ this.element.find( "li" ).eq( cnt ).attr( "disabled", value );
+ this.element.find( "li" ).eq( cnt ).attr( "aria-disabled", value );
+ },
+
+ disable: function ( cnt ) {
+ this._setDisabled( true, cnt );
+ this.element.find( "li" ).eq( cnt ).addClass( "ui-disabled" );
+ },
+
+ enable: function ( cnt ) {
+ this._setDisabled( false, cnt );
+ this.element.find( "li" ).eq( cnt ).removeClass( "ui-disabled" );
}
});
//auto self-init widgets
$( document ).bind( "pagecreate create", function ( e ) {
- $( $.tizen.virtuallistview.prototype.options.initSelector, e.target ).virtuallistview();
+ $( $.tizen.tabbar.prototype.options.initSelector, e.target ).tabbar();
});
+}( jQuery ) );
-} ( jQuery ) );
-/*!
- * Globalize
+
+
+/* ***************************************************************************
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
*
- * http://github.com/jquery/globalize
+ * 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:
*
- * Copyright Software Freedom Conservancy, Inc.
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * ***************************************************************************
*/
+/*
+* jQuery Mobile Framework : "textinput" plugin for text inputs, textareas
+* Copyright (c) jQuery Project
+* Dual licensed under the MIT or GPL Version 2 licenses.
+* http://jquery.org/license
+* Authors: Jinhyuk Jun <jinhyuk.jun@samsung.com>
+* Wongi Lee <wongi11.lee@samsung.com>
+*/
-(function( window, undefined ) {
-
-var Globalize,
- // private variables
- regexHex,
- regexInfinity,
- regexParseFloat,
- regexTrim,
- // private JavaScript utility functions
- arrayIndexOf,
- endsWith,
- extend,
- isArray,
- isFunction,
- isObject,
- startsWith,
- trim,
- truncate,
- zeroPad,
- // private Globalization utility functions
- appendPreOrPostMatch,
- expandFormat,
- formatDate,
- formatNumber,
- getTokenRegExp,
- getEra,
- getEraYear,
- parseExact,
- parseNegativePattern;
-
-// Global variable (Globalize) or CommonJS module (globalize)
-Globalize = function( cultureSelector ) {
- return new Globalize.prototype.init( cultureSelector );
-};
-
-if ( typeof require !== "undefined"
- && typeof exports !== "undefined"
- && typeof module !== "undefined" ) {
- // Assume CommonJS
- module.exports = Globalize;
-} else {
- // Export as global variable
- window.Globalize = Globalize;
-}
-
-Globalize.cultures = {};
-
-Globalize.prototype = {
- constructor: Globalize,
- init: function( cultureSelector ) {
- this.cultures = Globalize.cultures;
- this.cultureSelector = cultureSelector;
-
- return this;
- }
-};
-Globalize.prototype.init.prototype = Globalize.prototype;
-
-// 1. When defining a culture, all fields are required except the ones stated as optional.
-// 2. Each culture should have a ".calendars" object with at least one calendar named "standard"
-// which serves as the default calendar in use by that culture.
-// 3. Each culture should have a ".calendar" object which is the current calendar being used,
-// it may be dynamically changed at any time to one of the calendars in ".calendars".
-Globalize.cultures[ "default" ] = {
- // A unique name for the culture in the form <language code>-<country/region code>
- name: "en",
- // the name of the culture in the english language
- englishName: "English",
- // the name of the culture in its own language
- nativeName: "English",
- // whether the culture uses right-to-left text
- isRTL: false,
- // "language" is used for so-called "specific" cultures.
- // For example, the culture "es-CL" means "Spanish, in Chili".
- // It represents the Spanish-speaking culture as it is in Chili,
- // which might have different formatting rules or even translations
- // than Spanish in Spain. A "neutral" culture is one that is not
- // specific to a region. For example, the culture "es" is the generic
- // Spanish culture, which may be a more generalized version of the language
- // that may or may not be what a specific culture expects.
- // For a specific culture like "es-CL", the "language" field refers to the
- // neutral, generic culture information for the language it is using.
- // This is not always a simple matter of the string before the dash.
- // For example, the "zh-Hans" culture is netural (Simplified Chinese).
- // And the "zh-SG" culture is Simplified Chinese in Singapore, whose lanugage
- // field is "zh-CHS", not "zh".
- // This field should be used to navigate from a specific culture to it's
- // more general, neutral culture. If a culture is already as general as it
- // can get, the language may refer to itself.
- language: "en",
- // numberFormat defines general number formatting rules, like the digits in
- // each grouping, the group separator, and how negative numbers are displayed.
- numberFormat: {
- // [negativePattern]
- // Note, numberFormat.pattern has no "positivePattern" unlike percent and currency,
- // but is still defined as an array for consistency with them.
- // negativePattern: one of "(n)|-n|- n|n-|n -"
- pattern: [ "-n" ],
- // number of decimal places normally shown
- decimals: 2,
- // string that separates number groups, as in 1,000,000
- ",": ",",
- // string that separates a number from the fractional portion, as in 1.99
- ".": ".",
- // array of numbers indicating the size of each number group.
- // TODO: more detailed description and example
- groupSizes: [ 3 ],
- // symbol used for positive numbers
- "+": "+",
- // symbol used for negative numbers
- "-": "-",
- // symbol used for NaN (Not-A-Number)
- NaN: "NaN",
- // symbol used for Negative Infinity
- negativeInfinity: "-Infinity",
- // symbol used for Positive Infinity
- positiveInfinity: "Infinity",
- percent: {
- // [negativePattern, positivePattern]
- // negativePattern: one of "-n %|-n%|-%n|%-n|%n-|n-%|n%-|-% n|n %-|% n-|% -n|n- %"
- // positivePattern: one of "n %|n%|%n|% n"
- pattern: [ "-n %", "n %" ],
- // number of decimal places normally shown
- decimals: 2,
- // array of numbers indicating the size of each number group.
- // TODO: more detailed description and example
- groupSizes: [ 3 ],
- // string that separates number groups, as in 1,000,000
- ",": ",",
- // string that separates a number from the fractional portion, as in 1.99
- ".": ".",
- // symbol used to represent a percentage
- symbol: "%"
- },
- currency: {
- // [negativePattern, positivePattern]
- // negativePattern: one of "($n)|-$n|$-n|$n-|(n$)|-n$|n-$|n$-|-n $|-$ n|n $-|$ n-|$ -n|n- $|($ n)|(n $)"
- // positivePattern: one of "$n|n$|$ n|n $"
- pattern: [ "($n)", "$n" ],
- // number of decimal places normally shown
- decimals: 2,
- // array of numbers indicating the size of each number group.
- // TODO: more detailed description and example
- groupSizes: [ 3 ],
- // string that separates number groups, as in 1,000,000
- ",": ",",
- // string that separates a number from the fractional portion, as in 1.99
- ".": ".",
- // symbol used to represent currency
- symbol: "$"
- }
- },
- // calendars defines all the possible calendars used by this culture.
- // There should be at least one defined with name "standard", and is the default
- // calendar used by the culture.
- // A calendar contains information about how dates are formatted, information about
- // the calendar's eras, a standard set of the date formats,
- // translations for day and month names, and if the calendar is not based on the Gregorian
- // calendar, conversion functions to and from the Gregorian calendar.
- calendars: {
- standard: {
- // name that identifies the type of calendar this is
- name: "Gregorian_USEnglish",
- // separator of parts of a date (e.g. "/" in 11/05/1955)
- "/": "/",
- // separator of parts of a time (e.g. ":" in 05:44 PM)
- ":": ":",
- // the first day of the week (0 = Sunday, 1 = Monday, etc)
- firstDay: 0,
- days: {
- // full day names
- names: [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ],
- // abbreviated day names
- namesAbbr: [ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" ],
- // shortest day names
- namesShort: [ "Su", "Mo", "Tu", "We", "Th", "Fr", "Sa" ]
- },
- months: {
- // full month names (13 months for lunar calendards -- 13th month should be "" if not lunar)
- names: [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", "" ],
- // abbreviated month names
- namesAbbr: [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "" ]
- },
- // AM and PM designators in one of these forms:
- // The usual view, and the upper and lower case versions
- // [ standard, lowercase, uppercase ]
- // The culture does not use AM or PM (likely all standard date formats use 24 hour time)
- // null
- AM: [ "AM", "am", "AM" ],
- PM: [ "PM", "pm", "PM" ],
- eras: [
- // eras in reverse chronological order.
- // name: the name of the era in this culture (e.g. A.D., C.E.)
- // start: when the era starts in ticks (gregorian, gmt), null if it is the earliest supported era.
- // offset: offset in years from gregorian calendar
- {
- "name": "A.D.",
- "start": null,
- "offset": 0
- }
- ],
- // when a two digit year is given, it will never be parsed as a four digit
- // year greater than this year (in the appropriate era for the culture)
- // Set it as a full year (e.g. 2029) or use an offset format starting from
- // the current year: "+19" would correspond to 2029 if the current year 2010.
- twoDigitYearMax: 2029,
- // set of predefined date and time patterns used by the culture
- // these represent the format someone in this culture would expect
- // to see given the portions of the date that are shown.
- patterns: {
- // short date pattern
- d: "M/d/yyyy",
- // long date pattern
- D: "dddd, MMMM dd, yyyy",
- // short time pattern
- t: "h:mm tt",
- // long time pattern
- T: "h:mm:ss tt",
- // long date, short time pattern
- f: "dddd, MMMM dd, yyyy h:mm tt",
- // long date, long time pattern
- F: "dddd, MMMM dd, yyyy h:mm:ss tt",
- // month/day pattern
- M: "MMMM dd",
- // month/year pattern
- Y: "yyyy MMMM",
- // S is a sortable format that does not vary by culture
- S: "yyyy\u0027-\u0027MM\u0027-\u0027dd\u0027T\u0027HH\u0027:\u0027mm\u0027:\u0027ss"
- }
- // optional fields for each calendar:
- /*
- monthsGenitive:
- Same as months but used when the day preceeds the month.
- Omit if the culture has no genitive distinction in month names.
- For an explaination of genitive months, see http://blogs.msdn.com/michkap/archive/2004/12/25/332259.aspx
- convert:
- Allows for the support of non-gregorian based calendars. This convert object is used to
- to convert a date to and from a gregorian calendar date to handle parsing and formatting.
- The two functions:
- fromGregorian( date )
- Given the date as a parameter, return an array with parts [ year, month, day ]
- corresponding to the non-gregorian based year, month, and day for the calendar.
- toGregorian( year, month, day )
- Given the non-gregorian year, month, and day, return a new Date() object
- set to the corresponding date in the gregorian calendar.
- */
- }
- },
- // For localized strings
- messages: {}
-};
-
-Globalize.cultures[ "default" ].calendar = Globalize.cultures[ "default" ].calendars.standard;
-
-Globalize.cultures[ "en" ] = Globalize.cultures[ "default" ];
-
-Globalize.cultureSelector = "en";
+/**
+ * Searchbar can be created using <input> element with type=search
+ * <input type="search" name="search" id="search1" value="" />
+ *
+ * Searchbar can be inserted 3 cases
+ * content : seachbar behave same as content element
+ * header : searchbar placed below title(header), It doesn't move when scrolling page
+ * inside optionheader : Searchbar placed inside optionheader, searchbar can be seen only expand optionheader
+ *
+ * Examples:
+ *
+ * HTML markup for creating Searchbar
+ * <input type="search"/>
+ *
+ * How to make searchbar in content
+ * <input type="search" name="" id="" value="" />
+ *
+ * How to make cancel button in searchbar
+ * <div data-role="header" data-position ="fixed" >
+ * <h1>Searchbar</h1>
+ * <input type="search" data-cancel-btn=true name="" id="" value="" />
+ * </div>
+ *
+ * How to make icon in front of searchbar
+ * <div data-role="header" data-position ="fixed" >
+ * <h1>Searchbar</h1>
+ * <input type="search" data-icon="call" name="" id="" value="" />
+ * </div>
+*/
-//
-// private variables
-//
+/**
+ @class SearchBar
+ The search bar widget is used to search for page content. This widget can be placed in the header, option header, or page content.
-regexHex = /^0x[a-f0-9]+$/i;
-regexInfinity = /^[+-]?infinity$/i;
-regexParseFloat = /^[+-]?\d*\.?\d*(e[+-]?\d+)?$/;
-regexTrim = /^\s+|\s+$/g;
+ To add a search bar widget to the application, use the following code:
-//
-// private JavaScript utility functions
-//
+ <label for="search-basic">Search Input:</label>
+ <input type="search" name="search" id="searc-basic" value="" data-mini="true" />
-arrayIndexOf = function( array, item ) {
- if ( array.indexOf ) {
- return array.indexOf( item );
- }
- for ( var i = 0, length = array.length; i < length; i++ ) {
- if ( array[i] === item ) {
- return i;
- }
- }
- return -1;
-};
-
-endsWith = function( value, pattern ) {
- return value.substr( value.length - pattern.length ) === pattern;
-};
-
-extend = function( deep ) {
- var options, name, src, copy, copyIsArray, clone,
- target = arguments[0] || {},
- i = 1,
- length = arguments.length,
- deep = false;
-
- // Handle a deep copy situation
- if ( typeof target === "boolean" ) {
- deep = target;
- target = arguments[1] || {};
- // skip the boolean and the target
- i = 2;
- }
+ Tizen supports many search bar options as described in the jQueryMobile documentation for search bar options.
+ The search bar can define callbacks for events as described in the jQueryMobile documentation for search bar events.
+ You can use methods with the search bar as described in the jQueryMobile documentation for search bar methods.
+*/
- // Handle case when target is a string or something (possible in deep copy)
- if ( typeof target !== "object" && !isFunction(target) ) {
- target = {};
- }
+(function ( $, undefined ) {
- for ( ; i < length; i++ ) {
- // Only deal with non-null/undefined values
- if ( (options = arguments[ i ]) != null ) {
- // Extend the base object
- for ( name in options ) {
- src = target[ name ];
- copy = options[ name ];
+ $.widget( "tizen.searchbar", $.mobile.widget, {
+ options: {
+ theme: null,
+ initSelector: "input[type='search'],:jqmData(type='search'), input[type='tizen-search'],:jqmData(type='tizen-search')"
+ },
- // Prevent never-ending loop
- if ( target === copy ) {
- continue;
- }
+ _create: function () {
+ var input = this.element,
+ o = this.options,
+ theme = o.theme || $.mobile.getInheritedTheme( this.element, "c" ),
+ themeclass = " ui-body-" + theme,
+ focusedEl,
+ clearbtn,
+ cancelbtn,
+ defaultText,
+ defaultTextClass,
+ trimedText,
+ newClassName,
+ newStyle,
+ newDiv,
+ searchimage,
+ inputedText,
+ useCancelBtn = false,
+ frontIcon = false;
- // Recurse if we're merging plain objects or arrays
- if ( deep && copy && ( isObject(copy) || (copyIsArray = isArray(copy)) ) ) {
- if ( copyIsArray ) {
- copyIsArray = false;
- clone = src && isArray(src) ? src : [];
+ $( "label[for='" + input.attr( "id" ) + "']" ).addClass( "ui-input-text" );
- } else {
- clone = src && isObject(src) ? src : {};
- }
+ if ( typeof input[0].autocorrect !== "undefined" && !$.support.touchOverflow ) {
+ // Set the attribute instead of the property just in case there
+ // is code that attempts to make modifications via HTML.
+ input[0].setAttribute( "autocorrect", "off" );
+ input[0].setAttribute( "autocomplete", "off" );
+ }
- // Never move original objects, clone them
- target[ name ] = extend( deep, clone, copy );
+ focusedEl = input.wrap( "<div class='ui-input-search ui-shadow-inset ui-corner-all ui-btn-shadow" + themeclass + "'></div>" ).parent();
- // Don't bring in undefined values
- } else if ( copy !== undefined ) {
- target[ name ] = copy;
- }
+ if ( $( this.element ).data( "cancel-btn" ) === true ) {
+ useCancelBtn = true;
+ focusedEl.addClass( "ui-input-search-default" );
+ }
+ if ( $( this.element ).data( "icon" ) != undefined ) {
+ frontIcon = true;
+ focusedEl.addClass( "ui-search-bar-icon" );
}
- }
- }
- // Return the modified object
- return target;
-};
+ clearbtn = $( "<a href='#' class='ui-input-clear' title='clear text'>clear text</a>" )
+ .bind('click', function ( event ) {
+ if ( input.attr( "disabled" ) == "disabled" ) {
+ return false;
+ }
+ input
+ .val( "" )
+ .focus()
+ .trigger( "change" );
+ clearbtn.addClass( "ui-input-clear-hidden" );
+ event.preventDefault();
+ })
+ .appendTo( focusedEl )
+ .buttonMarkup({
+ icon: "deleteSearch",
+ iconpos: "notext",
+ corners: true,
+ shadow: true
+ });
-isArray = Array.isArray || function( obj ) {
- return Object.prototype.toString.call( obj ) === "[object Array]";
-};
+ function toggleClear() {
+ setTimeout(function () {
+ clearbtn.toggleClass( "ui-input-clear-hidden", !input.val() );
+ }, 0);
+ }
-isFunction = function( obj ) {
- return Object.prototype.toString.call( obj ) === "[object Function]";
-};
+ function showCancel() {
+ focusedEl
+ .addClass( "ui-input-search-default" )
+ .removeClass( "ui-input-search-wide" );
+ cancelbtn
+ .addClass( "ui-btn-cancel-show" )
+ .removeClass( "ui-btn-cancel-hide" );
+ }
-isObject = function( obj ) {
- return Object.prototype.toString.call( obj ) === "[object Object]";
-};
+ function hideCancel() {
+ focusedEl
+ .addClass( "ui-input-search-wide" )
+ .removeClass( "ui-input-search-default" );
+ cancelbtn
+ .addClass( "ui-btn-cancel-hide" )
+ .removeClass( "ui-btn-cancel-show" );
+ toggleClear();
+ }
-startsWith = function( value, pattern ) {
- return value.indexOf( pattern ) === 0;
-};
+ function makeFrontIcon() {
+ var IconStyle = $( input ).jqmData( "icon" ),
+ frontIcon = $( "<div data-role='button' data-style='circle'></div>" );
-trim = function( value ) {
- return ( value + "" ).replace( regexTrim, "" );
-};
+ frontIcon
+ .appendTo( focusedEl.parent() )
+ .buttonMarkup( {
+ icon: IconStyle,
+ corners: true,
+ shadow: true
+ } );
+ frontIcon.addClass( "ui-btn-search-front-icon" );
+ }
-truncate = function( value ) {
- if ( isNaN( value ) ) {
- return NaN;
- }
- return Math[ value < 0 ? "ceil" : "floor" ]( value );
-};
+ toggleClear();
-zeroPad = function( str, count, left ) {
- var l;
- for ( l = str.length; l < count; l += 1 ) {
- str = ( left ? ("0" + str) : (str + "0") );
- }
- return str;
-};
+ input.bind( 'paste cut keyup focus change blur', toggleClear );
-//
-// private Globalization utility functions
-//
+ //SLP --start search bar with cancel button
+ focusedEl.wrapAll( "<div class='input-search-bar'></div>" );
+ searchimage = $("<div class='ui-image-search'></div>").appendTo( focusedEl );
-appendPreOrPostMatch = function( preMatch, strings ) {
- // appends pre- and post- token match strings while removing escaped characters.
- // Returns a single quote count which is used to determine if the token occurs
- // in a string literal.
- var quoteCount = 0,
- escaped = false;
- for ( var i = 0, il = preMatch.length; i < il; i++ ) {
- var c = preMatch.charAt( i );
- switch ( c ) {
- case "\'":
- if ( escaped ) {
- strings.push( "\'" );
- }
- else {
- quoteCount++;
- }
- escaped = false;
- break;
- case "\\":
- if ( escaped ) {
- strings.push( "\\" );
- }
- escaped = !escaped;
- break;
- default:
- strings.push( c );
- escaped = false;
- break;
- }
- }
- return quoteCount;
-};
-
-expandFormat = function( cal, format ) {
- // expands unspecified or single character date formats into the full pattern.
- format = format || "F";
- var pattern,
- patterns = cal.patterns,
- len = format.length;
- if ( len === 1 ) {
- pattern = patterns[ format ];
- if ( !pattern ) {
- throw "Invalid date format string \'" + format + "\'.";
- }
- format = pattern;
- }
- else if ( len === 2 && format.charAt(0) === "%" ) {
- // %X escape format -- intended as a custom format string that is only one character, not a built-in format.
- format = format.charAt( 1 );
- }
- return format;
-};
-
-formatDate = function( value, format, culture ) {
- var cal = culture.calendar,
- convert = cal.convert;
-
- if ( !format || !format.length || format === "i" ) {
- var ret;
- if ( culture && culture.name.length ) {
- if ( convert ) {
- // non-gregorian calendar, so we cannot use built-in toLocaleString()
- ret = formatDate( value, cal.patterns.F, culture );
- }
- else {
- var eraDate = new Date( value.getTime() ),
- era = getEra( value, cal.eras );
- eraDate.setFullYear( getEraYear(value, cal, era) );
- ret = eraDate.toLocaleString();
+ if ( frontIcon ) {
+ makeFrontIcon();
}
- }
- else {
- ret = value.toString();
- }
- return ret;
- }
-
- var eras = cal.eras,
- sortable = format === "s";
- format = expandFormat( cal, format );
-
- // Start with an empty string
- ret = [];
- var hour,
- zeros = [ "0", "00", "000" ],
- foundDay,
- checkedDay,
- dayPartRegExp = /([^d]|^)(d|dd)([^d]|$)/g,
- quoteCount = 0,
- tokenRegExp = getTokenRegExp(),
- converted;
-
- function padZeros( num, c ) {
- var r, s = num + "";
- if ( c > 1 && s.length < c ) {
- r = ( zeros[c - 2] + s);
- return r.substr( r.length - c, c );
- }
- else {
- r = s;
- }
- return r;
- }
- function hasDay() {
- if ( foundDay || checkedDay ) {
- return foundDay;
- }
- foundDay = dayPartRegExp.test( format );
- checkedDay = true;
- return foundDay;
- }
+ if ( useCancelBtn ) {
+ cancelbtn = $( "<div data-role='button' class='ui-input-cancel' title='clear text'>Cancel</div>" )
+ .bind('click', function ( event ) {
+ if ( input.attr( "disabled" ) == "disabled" ) {
+ return false;
+ }
+ event.preventDefault();
+ event.stopPropagation();
- function getPart( date, part ) {
- if ( converted ) {
- return converted[ part ];
- }
- switch ( part ) {
- case 0: return date.getFullYear();
- case 1: return date.getMonth();
- case 2: return date.getDate();
- }
- }
+ input
+ .val( "" )
+ .blur()
+ .trigger( "change" );
- if ( !sortable && convert ) {
- converted = convert.fromGregorian( value );
- }
+ if ( useCancelBtn ) {
+ hideCancel();
+ }
+ } )
+ .appendTo( focusedEl.parent() )
+ .buttonMarkup( {
+ iconpos: "cancel",
+ corners: true,
+ shadow: true
+ } );
+ }
- for ( ; ; ) {
- // Save the current index
- var index = tokenRegExp.lastIndex,
- // Look for the next pattern
- ar = tokenRegExp.exec( format );
+ // Input Focused
+ input
+ .focus( function () {
+ if ( input.attr( "disabled" ) == "disabled" ) {
+ return false;
+ }
+ if ( useCancelBtn ) {
+ showCancel();
+ }
+ focusedEl.addClass( $.mobile.focusClass );
+ })
+ .blur(function () {
+ focusedEl.removeClass( $.mobile.focusClass );
+ });
- // Append the text before the pattern (or the end of the string if not found)
- var preMatch = format.slice( index, ar ? ar.index : format.length );
- quoteCount += appendPreOrPostMatch( preMatch, ret );
+ // Default Text
+ defaultText = input.jqmData( "default-text" );
- if ( !ar ) {
- break;
- }
+ if ( ( defaultText != undefined ) && ( defaultText.length > 0 ) ) {
+ defaultTextClass = "ui-input-default-text";
+ trimedText = defaultText.replace(/\s/g, "");
- // do not replace any matches that occur inside a string literal.
- if ( quoteCount % 2 ) {
- ret.push( ar[0] );
- continue;
- }
+ /* Make new class for default text string */
+ newClassName = defaultTextClass + "-" + trimedText;
+ newStyle = $( "<style>" + '.' + newClassName + ":after" + "{content:" + "'" + defaultText + "'" + "}" + "</style>" );
+ $( 'html > head' ).append( newStyle );
- var current = ar[ 0 ],
- clength = current.length;
+ /* Make new empty <DIV> for default text */
+ newDiv = $( "<div></div>" );
- switch ( current ) {
- case "ddd":
- //Day of the week, as a three-letter abbreviation
- case "dddd":
- // Day of the week, using the full name
- var names = ( clength === 3 ) ? cal.days.namesAbbr : cal.days.names;
- ret.push( names[value.getDay()] );
- break;
- case "d":
- // Day of month, without leading zero for single-digit days
- case "dd":
- // Day of month, with leading zero for single-digit days
- foundDay = true;
- ret.push(
- padZeros( getPart(value, 2), clength )
- );
- break;
- case "MMM":
- // Month, as a three-letter abbreviation
- case "MMMM":
- // Month, using the full name
- var part = getPart( value, 1 );
- ret.push(
- ( cal.monthsGenitive && hasDay() )
- ?
- cal.monthsGenitive[ clength === 3 ? "namesAbbr" : "names" ][ part ]
- :
- cal.months[ clength === 3 ? "namesAbbr" : "names" ][ part ]
- );
- break;
- case "M":
- // Month, as digits, with no leading zero for single-digit months
- case "MM":
- // Month, as digits, with leading zero for single-digit months
- ret.push(
- padZeros( getPart(value, 1) + 1, clength )
- );
- break;
- case "y":
- // Year, as two digits, but with no leading zero for years less than 10
- case "yy":
- // Year, as two digits, with leading zero for years less than 10
- case "yyyy":
- // Year represented by four full digits
- part = converted ? converted[ 0 ] : getEraYear( value, cal, getEra(value, eras), sortable );
- if ( clength < 4 ) {
- part = part % 100;
- }
- ret.push(
- padZeros( part, clength )
- );
- break;
- case "h":
- // Hours with no leading zero for single-digit hours, using 12-hour clock
- case "hh":
- // Hours with leading zero for single-digit hours, using 12-hour clock
- hour = value.getHours() % 12;
- if ( hour === 0 ) hour = 12;
- ret.push(
- padZeros( hour, clength )
- );
- break;
- case "H":
- // Hours with no leading zero for single-digit hours, using 24-hour clock
- case "HH":
- // Hours with leading zero for single-digit hours, using 24-hour clock
- ret.push(
- padZeros( value.getHours(), clength )
- );
- break;
- case "m":
- // Minutes with no leading zero for single-digit minutes
- case "mm":
- // Minutes with leading zero for single-digit minutes
- ret.push(
- padZeros( value.getMinutes(), clength )
- );
- break;
- case "s":
- // Seconds with no leading zero for single-digit seconds
- case "ss":
- // Seconds with leading zero for single-digit seconds
- ret.push(
- padZeros( value.getSeconds(), clength )
- );
- break;
- case "t":
- // One character am/pm indicator ("a" or "p")
- case "tt":
- // Multicharacter am/pm indicator
- part = value.getHours() < 12 ? ( cal.AM ? cal.AM[0] : " " ) : ( cal.PM ? cal.PM[0] : " " );
- ret.push( clength === 1 ? part.charAt(0) : part );
- break;
- case "f":
- // Deciseconds
- case "ff":
- // Centiseconds
- case "fff":
- // Milliseconds
- ret.push(
- padZeros( value.getMilliseconds(), 3 ).substr( 0, clength )
- );
- break;
- case "z":
- // Time zone offset, no leading zero
- case "zz":
- // Time zone offset with leading zero
- hour = value.getTimezoneOffset() / 60;
- ret.push(
- ( hour <= 0 ? "+" : "-" ) + padZeros( Math.floor(Math.abs(hour)), clength )
- );
- break;
- case "zzz":
- // Time zone offset with leading zero
- hour = value.getTimezoneOffset() / 60;
- ret.push(
- ( hour <= 0 ? "+" : "-" ) + padZeros( Math.floor(Math.abs(hour)), 2 )
- // Hard coded ":" separator, rather than using cal.TimeSeparator
- // Repeated here for consistency, plus ":" was already assumed in date parsing.
- + ":" + padZeros( Math.abs(value.getTimezoneOffset() % 60), 2 )
- );
- break;
- case "g":
- case "gg":
- if ( cal.eras ) {
- ret.push(
- cal.eras[ getEra(value, eras) ].name
- );
- }
- break;
- case "/":
- ret.push( cal["/"] );
- break;
- default:
- throw "Invalid date format pattern \'" + current + "\'.";
- break;
- }
- }
- return ret.join( "" );
-};
-
-// formatNumber
-(function() {
- var expandNumber;
-
- expandNumber = function( number, precision, formatInfo ) {
- var groupSizes = formatInfo.groupSizes,
- curSize = groupSizes[ 0 ],
- curGroupIndex = 1,
- factor = Math.pow( 10, precision ),
- rounded = Math.round( number * factor ) / factor;
-
- if ( !isFinite(rounded) ) {
- rounded = number;
- }
- number = rounded;
-
- var numberString = number+"",
- right = "",
- split = numberString.split( /e/i ),
- exponent = split.length > 1 ? parseInt( split[1], 10 ) : 0;
- numberString = split[ 0 ];
- split = numberString.split( "." );
- numberString = split[ 0 ];
- right = split.length > 1 ? split[ 1 ] : "";
-
- var l;
- if ( exponent > 0 ) {
- right = zeroPad( right, exponent, false );
- numberString += right.slice( 0, exponent );
- right = right.substr( exponent );
- }
- else if ( exponent < 0 ) {
- exponent = -exponent;
- numberString = zeroPad( numberString, exponent + 1 );
- right = numberString.slice( -exponent, numberString.length ) + right;
- numberString = numberString.slice( 0, -exponent );
- }
+ /* Add class and append new div */
+ newDiv.addClass( defaultTextClass );
+ newDiv.addClass( newClassName );
+ newDiv.tap( function ( event ) {
+ input.blur();
+ input.focus();
+ } );
- if ( precision > 0 ) {
- right = formatInfo[ "." ] +
- ( (right.length > precision) ? right.slice(0, precision) : zeroPad(right, precision) );
- }
- else {
- right = "";
- }
+ input.parent().append( newDiv );
- var stringIndex = numberString.length - 1,
- sep = formatInfo[ "," ],
- ret = "";
+ /* When focus, default text will be hide. */
+ input
+ .focus( function () {
+ input.parent().find( "div.ui-input-default-text" ).addClass( "ui-input-default-hidden" );
+ } )
+ .blur( function () {
+ var inputedText = input.val();
+ if ( inputedText.length > 0 ) {
+ input.parent().find( "div.ui-input-default-text" ).addClass( "ui-input-default-hidden" );
+ } else {
+ input.parent().find( "div.ui-input-default-text" ).removeClass( "ui-input-default-hidden" );
+ }
+ } );
+ }
- while ( stringIndex >= 0 ) {
- if ( curSize === 0 || curSize > stringIndex ) {
- return numberString.slice( 0, stringIndex + 1 ) + ( ret.length ? (sep + ret + right) : right );
+ if ( !input.attr("placeholder") ) {
+ input.attr( "placeholder", "Search" );
}
- ret = numberString.slice( stringIndex - curSize + 1, stringIndex + 1 ) + ( ret.length ? (sep + ret) : "" );
+ },
- stringIndex -= curSize;
+ disable: function () {
+ this.element.attr( "disabled", true );
+ this.element.parent().addClass( "ui-disabled" );
+ $( this.element ).blur();
+ this.element.parent().parent().find(".ui-input-cancel").addClass( "ui-disabled" );
+ },
- if ( curGroupIndex < groupSizes.length ) {
- curSize = groupSizes[ curGroupIndex ];
- curGroupIndex++;
- }
+ enable: function () {
+ this.element.attr( "disabled", false );
+ this.element.parent().removeClass( "ui-disabled" );
+ this.element.parent().parent().find(".ui-input-cancel").removeClass( "ui-disabled" );
+ $( this.element ).focus();
}
+ } );
- return numberString.slice( 0, stringIndex + 1 ) + sep + ret + right;
- };
-
- formatNumber = function( value, format, culture ) {
- if ( !isFinite(value) ) {
- if ( value === Infinity ) {
- return culture.numberFormat.positiveInfinity;
- }
- if ( value === -Infinity ) {
- return culture.numberFormat.negativeInfinity;
- }
- return culture.numberFormat.NaN;
- }
- if ( !format || format === "i" ) {
- return culture.name.length ? value.toLocaleString() : value.toString();
- }
- format = format || "D";
+ //auto self-init widgets
+ $( document ).bind( "pagecreate create", function ( e ) {
+ $.tizen.searchbar.prototype.enhanceWithin( e.target );
+ } );
- var nf = culture.numberFormat,
- number = Math.abs( value ),
- precision = -1,
- pattern;
- if ( format.length > 1 ) precision = parseInt( format.slice(1), 10 );
+}( jQuery ) );
- var current = format.charAt( 0 ).toUpperCase(),
- formatInfo;
- switch ( current ) {
- case "D":
- pattern = "n";
- number = truncate( number );
- if ( precision !== -1 ) {
- number = zeroPad( "" + number, precision, true );
- }
- if ( value < 0 ) number = "-" + number;
- break;
- case "N":
- formatInfo = nf;
- // fall through
- case "C":
- formatInfo = formatInfo || nf.currency;
- // fall through
- case "P":
- formatInfo = formatInfo || nf.percent;
- pattern = value < 0 ? formatInfo.pattern[ 0 ] : ( formatInfo.pattern[1] || "n" );
- if ( precision === -1 ) precision = formatInfo.decimals;
- number = expandNumber( number * (current === "P" ? 100 : 1), precision, formatInfo );
- break;
- default:
- throw "Bad number format specifier: " + current;
- }
- var patternParts = /n|\$|-|%/g,
- ret = "";
- for ( ; ; ) {
- var index = patternParts.lastIndex,
- ar = patternParts.exec( pattern );
+/*
+ * jQuery Mobile Widget @VERSION
+ *
+ * This software is licensed under the MIT licence (as defined by the OSI at
+ * http://www.opensource.org/licenses/mit-license.php)
+ *
+ * ***************************************************************************
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2011 by Intel Corporation Ltd.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * ***************************************************************************
+ *
+ * Authors: Gabriel Schulhof <gabriel.schulhof@intel.com>
+ * Hyunjung Kim <hjnim.kim@samsung.com>
+ */
- ret += pattern.slice( index, ar ? ar.index : pattern.length );
+/*
+ * % ContextPopup widget do not use anymore(will be deprecated, internal use only)
+ */
+// This widget is implemented in an extremely ugly way. It should derive from $.tizen.popupwindow, but it doesn't
+// because there's a bug in jquery.ui.widget.js which was fixed in jquery-ui commit
+// b9153258b0f0edbff49496ed16d2aa93bec07d95. Once a version of jquery-ui containing that commit is released
+// (probably >= 1.9m5), and jQuery Mobile picks up the widget from there, this widget needs to be rewritten properly.
+// The problem is that, when a widget inherits from a superclass and declares an object in its prototype identical in key
+// to one in the superclass, upon calling $.widget the object is overwritten in both the prototype of the superclass and
+// the prototype of the subclass. The prototype of the superclass should remain unchanged.
- if ( !ar ) {
- break;
- }
+/**
+ class ContextPopup
+ The context pop-up widget shows a list of options and automatically optimizes its size within the screen. This widget is intended for a small list of options for a larger list, use the List widget. <br/>The context pop-up widget requires a target button, which must be clicked to open the context pop-up. In the default application theme, an arrow pointer is displayed at the top-left corner of the context pop-up widget when it is opened.<br/><br/> To add a context pop-up widget to the application, use the following code:
- switch ( ar[0] ) {
- case "n":
- ret += number;
- break;
- case "$":
- ret += nf.currency.symbol;
- break;
- case "-":
- // don't make 0 negative
- if ( /[1-9]/.test(number) ) {
- ret += nf[ "-" ];
- }
- break;
- case "%":
- ret += nf.percent.symbol;
- break;
- }
- }
+ // Target button
+ <a href="#pop_3_icons" id="btn_3_icons" data-role="button" data-inline="true" data-rel="popupwindow">3 Icons</a>
+ // Context pop-up
+ <div class="horizontal" id="pop_3_icons" data-role="popupwindow" data-show-arrow="true">
+ <ul>
+ <li class="icon">
+ <a href="#" data-role="button" data-icon="call"></a>
+ </li>
+ <li class="icon">
+ <a href="#" data-role="button" data-icon="favorite"></a>
+ </li>
+ <li class="text">
+ <a href="#">Function</a>
+ </li>
+ </ul>
+ </div>
+ The context pop-up can define callbacks for events as described in the [jQueryMobile documentation for pop-up events.][1]
+ You can use methods with the context pop-up as described in the [jQueryMobile documentation for pop-up methods.][2]
+ [1]: http://jquerymobile.com/demos/1.2.0-alpha.1/docs/pages/popup/events.html
+ [2]: http://jquerymobile.com/demos/1.2.0-alpha.1/docs/pages/popup/methods.html
- return ret;
- };
+ @deprecated 2.0 verisons
+*/
-}());
+(function ( $, undefined ) {
+ $.widget( "tizen.ctxpopup", $.tizen.widgetex, {
+ options: $.extend( {}, $.tizen.popupwindow.prototype.options, {
+ initSelector: ":jqmData(show-arrow)"
+ } ),
-getTokenRegExp = function() {
- // regular expression for matching date and time tokens in format strings.
- return /\/|dddd|ddd|dd|d|MMMM|MMM|MM|M|yyyy|yy|y|hh|h|HH|H|mm|m|ss|s|tt|t|fff|ff|f|zzz|zz|z|gg|g/g;
-};
+ _htmlProto: {
+source:
-getEra = function( date, eras ) {
- if ( !eras ) return 0;
- var start, ticks = date.getTime();
- for ( var i = 0, l = eras.length; i < l; i++ ) {
- start = eras[ i ].start;
- if ( start === null || ticks >= start ) {
- return i;
- }
- }
- return 0;
-};
-
-getEraYear = function( date, cal, era, sortable ) {
- var year = date.getFullYear();
- if ( !sortable && cal.eras ) {
- // convert normal gregorian year to era-shifted gregorian
- // year by subtracting the era offset
- year -= cal.eras[ era ].offset;
- }
- return year;
-};
-
-// parseExact
-(function() {
- var expandYear,
- getDayIndex,
- getMonthIndex,
- getParseRegExp,
- outOfRange,
- toUpper,
- toUpperArray;
-
- expandYear = function( cal, year ) {
- // expands 2-digit year into 4 digits.
- if ( year < 100 ) {
- var now = new Date(),
- era = getEra( now ),
- curr = getEraYear( now, cal, era ),
- twoDigitYearMax = cal.twoDigitYearMax;
- twoDigitYearMax = typeof twoDigitYearMax === "string" ? new Date().getFullYear() % 100 + parseInt( twoDigitYearMax, 10 ) : twoDigitYearMax;
- year += curr - ( curr % 100 );
- if ( year > twoDigitYearMax ) {
- year -= 100;
+ [ "<div><div id='outer' class='ui-ctxpopup'>" ,
+ " <div id='top' class='ui-ctxpopup-row' data-role='triangle' data-location='top'></div>" ,
+ " <div class='ui-ctxpopup-row'>" ,
+ " <div id='left' class='ui-ctxpopup-cell' data-role='triangle' data-location='left'></div>" ,
+ " <div id='container' class='ui-ctxpopup-cell'></div>" ,
+ " <div id='right' class='ui-ctxpopup-cell' data-role='triangle' data-location='right'></div>" ,
+ " </div>" ,
+ " <div id='bottom' class='ui-ctxpopup-row' data-role='triangle' data-location='bottom'></div>" ,
+ "</div>" ,
+ "</div>" ].join("")
+, ui: {
+ outer : "#outer",
+ container : "#container", // the key has to have the name "container"
+ arrow : {
+ all : ":jqmData(role='triangle')",
+ l : "#left",
+ t : "#top",
+ r : "#right",
+ b : "#bottom"
+ }
}
- }
- return year;
- };
+ },
- getDayIndex = function ( cal, value, abbr ) {
- var ret,
- days = cal.days,
- upperDays = cal._upperDays;
- if ( !upperDays ) {
- cal._upperDays = upperDays = [
- toUpperArray( days.names ),
- toUpperArray( days.namesAbbr ),
- toUpperArray( days.namesShort )
- ];
- }
- value = toUpper( value );
- if ( abbr ) {
- ret = arrayIndexOf( upperDays[1], value );
- if ( ret === -1 ) {
- ret = arrayIndexOf( upperDays[2], value );
+ _create: function () {
+ console.warn("ctxpopup() was deprecated. use popup() instead.");
+ if ( !this.element.data( "popupwindow" ) ) {
+ this.element.popupwindow();
}
- }
- else {
- ret = arrayIndexOf( upperDays[0], value );
- }
- return ret;
- };
-
- getMonthIndex = function( cal, value, abbr ) {
- var months = cal.months,
- monthsGen = cal.monthsGenitive || cal.months,
- upperMonths = cal._upperMonths,
- upperMonthsGen = cal._upperMonthsGen;
- if ( !upperMonths ) {
- cal._upperMonths = upperMonths = [
- toUpperArray( months.names ),
- toUpperArray( months.namesAbbr )
- ];
- cal._upperMonthsGen = upperMonthsGen = [
- toUpperArray( monthsGen.names ),
- toUpperArray( monthsGen.namesAbbr )
- ];
- }
- value = toUpper( value );
- var i = arrayIndexOf( abbr ? upperMonths[1] : upperMonths[0], value );
- if ( i < 0 ) {
- i = arrayIndexOf( abbr ? upperMonthsGen[1] : upperMonthsGen[0], value );
- }
- return i;
- };
- getParseRegExp = function( cal, format ) {
- // converts a format string into a regular expression with groups that
- // can be used to extract date fields from a date string.
- // check for a cached parse regex.
- var re = cal._parseRegExp;
- if ( !re ) {
- cal._parseRegExp = re = {};
- }
- else {
- var reFormat = re[ format ];
- if ( reFormat ) {
- return reFormat;
- }
- }
+ this.element.data( "popupwindow" )
+ ._ui.container
+ .removeClass( "ui-popupwindow-padding" )
+ .append( this._ui.outer );
+ this._ui.outer.trigger( "create" ); // Creates the triangle widgets
+ this._ui.container
+ .addClass( "ui-popupwindow-padding" )
+ .append( this.element );
+ },
- // expand single digit formats, then escape regular expression characters.
- var expFormat = expandFormat( cal, format ).replace( /([\^\$\.\*\+\?\|\[\]\(\)\{\}])/g, "\\\\$1" ),
- regexp = [ "^" ],
- groups = [],
- index = 0,
- quoteCount = 0,
- tokenRegExp = getTokenRegExp(),
- match;
-
- // iterate through each date token found.
- while ( (match = tokenRegExp.exec(expFormat)) !== null ) {
- var preMatch = expFormat.slice( index, match.index );
- index = tokenRegExp.lastIndex;
-
- // don't replace any matches that occur inside a string literal.
- quoteCount += appendPreOrPostMatch( preMatch, regexp );
- if ( quoteCount % 2 ) {
- regexp.push( match[0] );
- continue;
- }
-
- // add a regex group for the token.
- var m = match[ 0 ],
- len = m.length,
- add;
- switch ( m ) {
- case "dddd": case "ddd":
- case "MMMM": case "MMM":
- case "gg": case "g":
- add = "(\\D+)";
- break;
- case "tt": case "t":
- add = "(\\D*)";
- break;
- case "yyyy":
- case "fff":
- case "ff":
- case "f":
- add = "(\\d{" + len + "})";
- break;
- case "dd": case "d":
- case "MM": case "M":
- case "yy": case "y":
- case "HH": case "H":
- case "hh": case "h":
- case "mm": case "m":
- case "ss": case "s":
- add = "(\\d\\d?)";
- break;
- case "zzz":
- add = "([+-]?\\d\\d?:\\d{2})";
- break;
- case "zz": case "z":
- add = "([+-]?\\d\\d?)";
- break;
- case "/":
- add = "(\\" + cal[ "/" ] + ")";
- break;
- default:
- throw "Invalid date format pattern \'" + m + "\'.";
- break;
- }
- if ( add ) {
- regexp.push( add );
- }
- groups.push( match[0] );
+ _setOption: function ( key, value ) {
+ $.tizen.popupwindow.prototype._setOption.apply( this.element.data( "popupwindow" ), arguments );
+ this.options[key] = value;
}
- appendPreOrPostMatch( expFormat.slice(index), regexp );
- regexp.push( "$" );
-
- // allow whitespace to differ when matching formats.
- var regexpStr = regexp.join( "" ).replace( /\s+/g, "\\s+" ),
- parseRegExp = { "regExp": regexpStr, "groups": groups };
-
- // cache the regex for this format.
- return re[ format ] = parseRegExp;
- };
-
- outOfRange = function( value, low, high ) {
- return value < low || value > high;
- };
+ } );
- toUpper = function( value ) {
- // "he-IL" has non-breaking space in weekday names.
- return value.split( "\u00A0" ).join( " " ).toUpperCase();
- };
+ var origOpen = $.tizen.popupwindow.prototype.open,
+ orig_setOption = $.tizen.popupwindow.prototype._setOption,
+ orig_placementCoords = $.tizen.popupwindow.prototype._placementCoords;
- toUpperArray = function( arr ) {
- var results = [];
- for ( var i = 0, l = arr.length; i < l; i++ ) {
- results[ i ] = toUpper( arr[i] );
- }
- return results;
- };
+ $.tizen.popupwindow.prototype._setOption = function ( key, value ) {
+ var ctxpopup = this.element.data( "ctxpopup" ),
+ needsApplying = true,
+ origContainer;
+ if ( ctxpopup ) {
+ if ( "shadow" === key || "overlayTheme" === key || "corners" === key ) {
+ origContainer = this._ui.container;
- parseExact = function( value, format, culture ) {
- // try to parse the date string by matching against the format string
- // while using the specified culture for date field names.
- value = trim( value );
- var cal = culture.calendar,
- // convert date formats into regular expressions with groupings.
- // use the regexp to determine the input format and extract the date fields.
- parseInfo = getParseRegExp( cal, format ),
- match = new RegExp( parseInfo.regExp ).exec( value );
- if ( match === null ) {
- return null;
- }
- // found a date format that matches the input.
- var groups = parseInfo.groups,
- era = null, year = null, month = null, date = null, weekDay = null,
- hour = 0, hourOffset, min = 0, sec = 0, msec = 0, tzMinOffset = null,
- pmHour = false;
- // iterate the format groups to extract and set the date fields.
- for ( var j = 0, jl = groups.length; j < jl; j++ ) {
- var matchGroup = match[ j + 1 ];
- if ( matchGroup ) {
- var current = groups[ j ],
- clength = current.length,
- matchInt = parseInt( matchGroup, 10 );
- switch ( current ) {
- case "dd": case "d":
- // Day of month.
- date = matchInt;
- // check that date is generally in valid range, also checking overflow below.
- if ( outOfRange(date, 1, 31) ) return null;
- break;
- case "MMM": case "MMMM":
- month = getMonthIndex( cal, matchGroup, clength === 3 );
- if ( outOfRange(month, 0, 11) ) return null;
- break;
- case "M": case "MM":
- // Month.
- month = matchInt - 1;
- if ( outOfRange(month, 0, 11) ) return null;
- break;
- case "y": case "yy":
- case "yyyy":
- year = clength < 4 ? expandYear( cal, matchInt ) : matchInt;
- if ( outOfRange(year, 0, 9999) ) return null;
- break;
- case "h": case "hh":
- // Hours (12-hour clock).
- hour = matchInt;
- if ( hour === 12 ) hour = 0;
- if ( outOfRange(hour, 0, 11) ) return null;
- break;
- case "H": case "HH":
- // Hours (24-hour clock).
- hour = matchInt;
- if ( outOfRange(hour, 0, 23) ) return null;
- break;
- case "m": case "mm":
- // Minutes.
- min = matchInt;
- if ( outOfRange(min, 0, 59) ) return null;
- break;
- case "s": case "ss":
- // Seconds.
- sec = matchInt;
- if ( outOfRange(sec, 0, 59) ) return null;
- break;
- case "tt": case "t":
- // AM/PM designator.
- // see if it is standard, upper, or lower case PM. If not, ensure it is at least one of
- // the AM tokens. If not, fail the parse for this format.
- pmHour = cal.PM && ( matchGroup === cal.PM[0] || matchGroup === cal.PM[1] || matchGroup === cal.PM[2] );
- if (
- !pmHour && (
- !cal.AM || ( matchGroup !== cal.AM[0] && matchGroup !== cal.AM[1] && matchGroup !== cal.AM[2] )
- )
- ) return null;
- break;
- case "f":
- // Deciseconds.
- case "ff":
- // Centiseconds.
- case "fff":
- // Milliseconds.
- msec = matchInt * Math.pow( 10, 3 - clength );
- if ( outOfRange(msec, 0, 999) ) return null;
- break;
- case "ddd":
- // Day of week.
- case "dddd":
- // Day of week.
- weekDay = getDayIndex( cal, matchGroup, clength === 3 );
- if ( outOfRange(weekDay, 0, 6) ) return null;
- break;
- case "zzz":
- // Time zone offset in +/- hours:min.
- var offsets = matchGroup.split( /:/ );
- if ( offsets.length !== 2 ) return null;
- hourOffset = parseInt( offsets[0], 10 );
- if ( outOfRange(hourOffset, -12, 13) ) return null;
- var minOffset = parseInt( offsets[1], 10 );
- if ( outOfRange(minOffset, 0, 59) ) return null;
- tzMinOffset = ( hourOffset * 60 ) + ( startsWith(matchGroup, "-") ? -minOffset : minOffset );
- break;
- case "z": case "zz":
- // Time zone offset in +/- hours.
- hourOffset = matchInt;
- if ( outOfRange(hourOffset, -12, 13) ) return null;
- tzMinOffset = hourOffset * 60;
- break;
- case "g": case "gg":
- var eraName = matchGroup;
- if ( !eraName || !cal.eras ) return null;
- eraName = trim( eraName.toLowerCase() );
- for ( var i = 0, l = cal.eras.length; i < l; i++ ) {
- if ( eraName === cal.eras[i].name.toLowerCase() ) {
- era = i;
- break;
- }
- }
- // could not find an era with that name
- if ( era === null ) return null;
- break;
- }
- }
- }
- var result = new Date(), defaultYear, convert = cal.convert;
- defaultYear = convert ? convert.fromGregorian( result )[ 0 ] : result.getFullYear();
- if ( year === null ) {
- year = defaultYear;
- }
- else if ( cal.eras ) {
- // year must be shifted to normal gregorian year
- // but not if year was not specified, its already normal gregorian
- // per the main if clause above.
- year += cal.eras[( era || 0 )].offset;
- }
- // set default day and month to 1 and January, so if unspecified, these are the defaults
- // instead of the current day/month.
- if ( month === null ) {
- month = 0;
- }
- if ( date === null ) {
- date = 1;
- }
- // now have year, month, and date, but in the culture's calendar.
- // convert to gregorian if necessary
- if ( convert ) {
- result = convert.toGregorian( year, month, date );
- // conversion failed, must be an invalid match
- if ( result === null ) return null;
- }
- else {
- // have to set year, month and date together to avoid overflow based on current date.
- result.setFullYear( year, month, date );
- // check to see if date overflowed for specified month (only checked 1-31 above).
- if ( result.getDate() !== date ) return null;
- // invalid day of week.
- if ( weekDay !== null && result.getDay() !== weekDay ) {
- return null;
+ this._ui.container = ctxpopup._ui.container;
+ orig_setOption.apply( this, arguments );
+ this._ui.container = origContainer;
+ needsApplying = false;
}
+ ctxpopup.options[key] = value;
}
- // if pm designator token was found make sure the hours fit the 24-hour clock.
- if ( pmHour && hour < 12 ) {
- hour += 12;
- }
- result.setHours( hour, min, sec, msec );
- if ( tzMinOffset !== null ) {
- // adjust timezone to utc before applying local offset.
- var adjustedMin = result.getMinutes() - ( tzMinOffset + result.getTimezoneOffset() );
- // Safari limits hours and minutes to the range of -127 to 127. We need to use setHours
- // to ensure both these fields will not exceed this range. adjustedMin will range
- // somewhere between -1440 and 1500, so we only need to split this into hours.
- result.setHours( result.getHours() + parseInt(adjustedMin / 60, 10), adjustedMin % 60 );
+
+ if ( needsApplying ) {
+ orig_setOption.apply(this, arguments);
}
- return result;
};
-}());
-
-parseNegativePattern = function( value, nf, negativePattern ) {
- var neg = nf[ "-" ],
- pos = nf[ "+" ],
- ret;
- switch ( negativePattern ) {
- case "n -":
- neg = " " + neg;
- pos = " " + pos;
- // fall through
- case "n-":
- if ( endsWith(value, neg) ) {
- ret = [ "-", value.substr(0, value.length - neg.length) ];
- }
- else if ( endsWith(value, pos) ) {
- ret = [ "+", value.substr(0, value.length - pos.length) ];
- }
- break;
- case "- n":
- neg += " ";
- pos += " ";
- // fall through
- case "-n":
- if ( startsWith(value, neg) ) {
- ret = [ "-", value.substr(neg.length) ];
- }
- else if ( startsWith(value, pos) ) {
- ret = [ "+", value.substr(pos.length) ];
- }
- break;
- case "(n)":
- if ( startsWith(value, "(") && endsWith(value, ")") ) {
- ret = [ "-", value.substr(1, value.length - 2) ];
- }
- break;
- }
- return ret || [ "", value ];
-};
-//
-// public instance functions
-//
+ $.tizen.popupwindow.prototype._placementCoords = function ( x, y, cx, cy ) {
+ var ctxpopup = this.element.data( "ctxpopup" ),
+ self = this,
+ coords = {},
+ minDiff,
+ minDiffIdx;
-Globalize.prototype.findClosestCulture = function( cultureSelector ) {
- return Globalize.findClosestCulture.call( this, cultureSelector );
-};
+ function getCoords( arrow, x_factor, y_factor ) {
+ // Unhide the arrow we want to test to take it into account
+ ctxpopup._ui.arrow.all.hide();
+ ctxpopup._ui.arrow[arrow].show();
-Globalize.prototype.format = function( value, format, cultureSelector ) {
- return Globalize.format.call( this, value, format, cultureSelector );
-};
+ var isHorizontal = ( "b" === arrow || "t" === arrow ),
+ // Names of keys used in calculations depend on whether things are horizontal or not
+ coord = ( isHorizontal
+ ? { point: "x", size: "cx", beg: "left", outerSize: "outerWidth", niceSize: "width", triangleSize : "height" }
+ : { point: "y", size: "cy", beg: "top", outerSize: "outerHeight", niceSize: "height", triangleSize : "width" } ),
+ size = {
+ cx : self._ui.container.width(),
+ cy : self._ui.container.height()
+ },
+ halfSize = {
+ cx : size.cx / 2,
+ cy : size.cy / 2
+ },
+ desired = {
+ "x" : x + halfSize.cx * x_factor,
+ "y" : y + halfSize.cy * y_factor
+ },
+ orig = orig_placementCoords.call( self, desired.x, desired.y, size.cx, size.cy ),
-Globalize.prototype.localize = function( key, cultureSelector ) {
- return Globalize.localize.call( this, key, cultureSelector );
-};
+ // The triangleOffset must be clamped to the range described below:
+ //
+ // +-------...
+ // | /\
+ // | / \
+ // ----+--+-,-----...
+ //lowerDiff -->____| |/ <-- possible rounded corner
+ //triangle size --> | /|
+ // ____|/ |
+ // ^ |\ | <-- lowest possible offset for triangle
+ // actual range of | | \|
+ // arrow offset | | |
+ // values due to | . . Payload table cell looks like
+ // possible rounded | . . a popup window, and it may have
+ // corners and arrow | . . arbitrary things like borders,
+ // triangle size - | | | shadows, and rounded corners.
+ // our clamp range | | /|
+ // _v__|/ |
+ //triangle size --> |\ | <-- highest possible offset for triangle
+ // ____| \|
+ //upperDiff --> | |\ <-- possible rounded corner
+ // ----+--+-'-----...
+ // | \ /
+ // | \/
+ // +-------...
+ //
+ // We calculate lowerDiff and upperDiff by considering the offset and width of the payload (this.element)
+ // versus the offset and width of the element enclosing the triangle, because the payload is inside
+ // whatever decorations (such as borders, shadow, rounded corners) and thus can give a reliable indication
+ // of the thickness of the combined decorations
-Globalize.prototype.parseInt = function( value, radix, cultureSelector ) {
- return Globalize.parseInt.call( this, value, radix, cultureSelector );
-};
+ arrowBeg = ctxpopup._ui.arrow[arrow].offset()[coord.beg],
+ arrowSize = ctxpopup._ui.arrow[arrow][coord.outerSize]( true ),
+ payloadBeg = self.element.offset()[coord.beg],
+ payloadSize = self.element[coord.outerSize]( true ),
+ triangleSize = ctxpopup._ui.arrow[arrow][coord.triangleSize](),
+ triangleOffset =
+ Math.max(
+ triangleSize // triangle size
+ + Math.max( 0, payloadBeg - arrowBeg ), // lowerDiff
+ Math.min(
+ arrowSize // bottom
+ - triangleSize // triangle size
+ - Math.max( 0, arrowBeg + arrowSize - ( payloadBeg + payloadSize ) ), // upperDiff
+ arrowSize / 2 // arrow unrestricted offset
+ + desired[coord.point]
+ - orig[coord.point]
+ - halfSize[coord.size]
+ )
+ ),
+ // Triangle points here
+ final = {
+ "x": orig.x + ( isHorizontal ? triangleOffset : 0) + ("r" === arrow ? size.cx : 0),
+ "y": orig.y + (!isHorizontal ? triangleOffset : 0) + ("b" === arrow ? size.cy : 0)
+ },
+ ret = {
+ actual : orig,
+ triangleOffset : triangleOffset,
+ absDiff : Math.abs( x - final.x ) + Math.abs( y - final.y )
+ };
-Globalize.prototype.parseFloat = function( value, radix, cultureSelector ) {
- return Globalize.parseFloat.call( this, value, radix, cultureSelector );
-};
+ // Hide it back
+ ctxpopup._ui.arrow[arrow].hide();
-Globalize.prototype.culture = function( cultureSelector ) {
- return Globalize.culture.call( this, cultureSelector );
-};
+ return ret;
+ }
-//
-// public singleton functions
-//
+ if ( ctxpopup ) {
+ // Returns:
+ // {
+ // absDiff: int
+ // triangleOffset: int
+ // actual: { x: int, y: int }
+ // }
-Globalize.addCultureInfo = function( cultureName, baseCultureName, info ) {
-
- var base = {},
- isNew = false;
-
- if ( typeof cultureName !== "string" ) {
- // cultureName argument is optional string. If not specified, assume info is first
- // and only argument. Specified info deep-extends current culture.
- info = cultureName;
- cultureName = this.culture().name;
- base = this.cultures[ cultureName ];
- } else if ( typeof baseCultureName !== "string" ) {
- // baseCultureName argument is optional string. If not specified, assume info is second
- // argument. Specified info deep-extends specified culture.
- // If specified culture does not exist, create by deep-extending default
- info = baseCultureName;
- isNew = ( this.cultures[ cultureName ] == null );
- base = this.cultures[ cultureName ] || this.cultures[ "default" ];
- } else {
- // cultureName and baseCultureName specified. Assume a new culture is being created
- // by deep-extending an specified base culture
- isNew = true;
- base = this.cultures[ baseCultureName ];
- }
+ coords = {
+ l : getCoords( "l", 1, 0 ),
+ r : getCoords( "r", -1, 0 ),
+ t : getCoords( "t", 0, 1 ),
+ b : getCoords( "b", 0, -1 )
+ };
- this.cultures[ cultureName ] = extend(true, {},
- base,
- info
- );
- // Make the standard calendar the current culture if it's a new culture
- if ( isNew ) {
- this.cultures[ cultureName ].calendar = this.cultures[ cultureName ].calendars.standard;
- }
-};
+ $.each( coords, function ( key, value ) {
+ if ( minDiff === undefined || value.absDiff < minDiff ) {
+ minDiff = value.absDiff;
+ minDiffIdx = key;
+ }
+ } );
-Globalize.findClosestCulture = function( name ) {
- var match;
- if ( !name ) {
- return this.findClosestCulture( this.cultureSelector ) || this.cultures[ "default" ];
- }
- if ( typeof name === "string" ) {
- name = name.split( "," );
- }
- if ( isArray(name) ) {
- var lang,
- cultures = this.cultures,
- list = name,
- i, l = list.length,
- prioritized = [];
- for ( i = 0; i < l; i++ ) {
- name = trim( list[i] );
- var pri, parts = name.split( ";" );
- lang = trim( parts[0] );
- if ( parts.length === 1 ) {
- pri = 1;
- }
- else {
- name = trim( parts[1] );
- if ( name.indexOf("q=") === 0 ) {
- name = name.substr( 2 );
- pri = parseFloat( name );
- pri = isNaN( pri ) ? 0 : pri;
- }
- else {
- pri = 1;
- }
- }
- prioritized.push({ lang: lang, pri: pri });
+ // Side-effect: show the appropriate arrow and move it to the right offset
+ ctxpopup._ui.arrow[minDiffIdx]
+ .show()
+ .triangle( "option", "offset", coords[minDiffIdx].triangleOffset );
+ return coords[minDiffIdx].actual;
}
- prioritized.sort(function( a, b ) {
- return a.pri < b.pri ? 1 : -1;
- });
- // exact match
- for ( i = 0; i < l; i++ ) {
- lang = prioritized[ i ].lang;
- match = cultures[ lang ];
- if ( match ) {
- return match;
- }
- }
+ return orig_placementCoords.call( this, x, y, cx, cy );
+ };
- // neutral language match
- for ( i = 0; i < l; i++ ) {
- lang = prioritized[ i ].lang;
- do {
- var index = lang.lastIndexOf( "-" );
- if ( index === -1 ) {
- break;
- }
- // strip off the last part. e.g. en-US => en
- lang = lang.substr( 0, index );
- match = cultures[ lang ];
- if ( match ) {
- return match;
- }
- }
- while ( 1 );
- }
+ $.tizen.popupwindow.prototype.open = function ( x, y ) {
+ var ctxpopup = this.element.data( "ctxpopup" );
- // last resort: match first culture using that language
- for ( i = 0; i < l; i++ ) {
- lang = prioritized[ i ].lang;
- for ( var cultureKey in cultures ) {
- var culture = cultures[ cultureKey ];
- if ( culture.language == lang ) {
- return culture;
- }
- }
+ if ( ctxpopup ) {
+ this._setFade( false );
+ this._setShadow( false );
+ this._setCorners( false );
+ this._setOverlayTheme( null );
+ this._setOption( "overlayTheme", ctxpopup.options.overlayTheme );
+ ctxpopup._ui.arrow.all.triangle( "option", "color", ctxpopup._ui.container.css( "background-color" ) );
+
+ // temporary
+ $( '.ui-popupwindow' ).css( 'background', 'none' );
}
- }
- else if ( typeof name === "object" ) {
- return name;
- }
- return match || null;
-};
-Globalize.format = function( value, format, cultureSelector ) {
- culture = this.findClosestCulture( cultureSelector );
- if ( value instanceof Date ) {
- value = formatDate( value, format, culture );
- }
- else if ( typeof value === "number" ) {
- value = formatNumber( value, format, culture );
- }
- return value;
-};
+ origOpen.call( this, x, y, true );
+ };
-Globalize.localize = function( key, cultureSelector ) {
- return this.findClosestCulture( cultureSelector ).messages[ key ] ||
- this.cultures[ "default" ].messages[ key ];
-};
+ //auto self-init widgets
+ $( document ).bind( "pagecreate create", function ( e ) {
+ var ctxpopups = $( $.tizen.ctxpopup.prototype.options.initSelector, e.target );
+ $.tizen.ctxpopup.prototype.enhanceWithin( e.target );
+ } );
+}( jQuery ) );
-Globalize.parseDate = function( value, formats, culture ) {
- culture = this.findClosestCulture( culture );
- var date, prop, patterns;
- if ( formats ) {
- if ( typeof formats === "string" ) {
- formats = [ formats ];
- }
- if ( formats.length ) {
- for ( var i = 0, l = formats.length; i < l; i++ ) {
- var format = formats[ i ];
- if ( format ) {
- date = parseExact( value, format, culture );
- if ( date ) {
- break;
- }
- }
- }
- }
- } else {
- patterns = culture.calendar.patterns;
- for ( prop in patterns ) {
- date = parseExact( value, patterns[prop], culture );
- if ( date ) {
- break;
- }
- }
- }
- return date || null;
-};
+/*global Globalize:false, range:false, regexp:false*/
+/*
+ * jQuery Mobile Widget @VERSION
+ *
+ * This software is licensed under the MIT licence (as defined by the OSI at
+ * http://www.opensource.org/licenses/mit-license.php)
+ *
+ * ***************************************************************************
+ * Copyright (C) 2011 by Intel Corporation Ltd.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * ***************************************************************************
+ *
+ * Authors: Salvatore Iovene <salvatore.iovene@intel.com>
+ * Daehyon Jung <darrenh.jung@samsung.com>
+ */
-Globalize.parseInt = function( value, radix, cultureSelector ) {
- return truncate( Globalize.parseFloat(value, radix, cultureSelector) );
-};
+/**
+ * datetimepicker is a widget that lets the user select a date and/or a
+ * time. If you'd prefer use as auto-initialization of form elements,
+ * use input elements with type=date/time/datetime within form tag
+ * as same as other form elements.
+ *
+ * HTML Attributes:
+ *
+ * data-role: 'datetimepicker'
+ * data-format: date format string. e.g) "MMM dd yyyy, HH:mm"
+ * type: 'date', 'datetime', 'time'
+ * value: pre-set value. only accepts ISO date string. e.g) "2012-05-04", "2012-05-04T01:02:03+09:00"
+ * data-date: any date/time string "new Date()" accepts.
+ *
+ * Options:
+ * type: 'date', 'datetime', 'time'
+ * format: see data-format in HTML Attributes.
+ * value: see value in HTML Attributes.
+ * date: preset value as JavaScript Date Object representation.
+ *
+ * APIs:
+ * value( datestring )
+ * : Set date/time to 'datestring'.
+ * value()
+ * : Get current selected date/time as W3C DTF style string.
+ * getValue() - replaced with 'value()'
+ * : same as value()
+ * setValue( datestring ) - replaced with 'value(datestring)'
+ * : same as value( datestring )
+ * changeTypeFormat( type, format ) - deprecated
+ * : Change Type and Format options. use datetimepicker( "option", "format" ) instead
+ *
+ * Events:
+ * date-changed: Raised when date/time was changed.
+ *
+ * Examples:
+ * <ul data-role="listview">
+ * <li class="ui-li-3-2-2">
+ * <span class="ui-li-text-main">
+ * <input type="datetime" name="demo-date" id="demo-date"
+ * data-format="MMM dd yyyy hh:mm tt"/>
+ * </span>
+ * <span class="ui-li-text-sub">
+ * Date/Time Picker - <span id="selected-date1"><em>(select a date first)</em></span>
+ * </span>
+ * </li>
+ * <li class="ui-li-3-2-2">
+ * <span class="ui-li-text-main">
+ * <input type="date" name="demo-date2" id="demo-date2"/>
+ * </span>
+ * <span class="ui-li-text-sub">
+ * Date Picker - <span id="selected-date2"><em>(select a date first)</em></span>
+ * </span>
+ * </li>
+ * <li class="ui-li-3-2-2">
+ * <span class="ui-li-text-main">
+ * <input type="time" name="demo-date3" id="demo-date3"/>
+ * </span>
+ * <span class="ui-li-text-sub">
+ * Time Picker - <span id="selected-date3"><em>(select a date first)</em></span>
+ * </span>
+ * </li>
+ * </ul>
+ * How to get a return value:
+ * ==========================
+ * Bind to the 'date-changed' event, e.g.:
+ * $("#myDatetimepicker").bind("date-changed", function(e, date) {
+ * alert("New date: " + date.toString());
+ * });
+ */
-Globalize.parseFloat = function( value, radix, cultureSelector ) {
- // radix argument is optional
- if ( typeof radix !== "number" ) {
- cultureSelector = radix;
- radix = 10;
- }
+/**
+ @class DateTimePicker
+ The picker widgets show a control that you can use to enter date and time values. <br/> To add a date time picker widget to the application, use the following code:
- var culture = this.findClosestCulture( cultureSelector );
- var ret = NaN,
- nf = culture.numberFormat;
+ <li class="ui-li-dialogue ui-datetime">
+ <div class="ui-datetime-text-main">
+ <input type="datetime" data-format="MMM dd yyyy hh:mm:ss" name="demo-date" id="demo-date" />
+ </div>
+ <div class="ui-li-text-sub">Date/Time Picker
+ <span id="selected-date1"><em>(select a date first)</em></span>
+ </div>
+ </li>
+*/
- if ( value.indexOf(culture.numberFormat.currency.symbol) > -1 ) {
- // remove currency symbol
- value = value.replace( culture.numberFormat.currency.symbol, "" );
- // replace decimal seperator
- value = value.replace( culture.numberFormat.currency["."], culture.numberFormat["."] );
- }
- // trim leading and trailing whitespace
- value = trim( value );
+( function ( $, window, undefined ) {
+ $.widget( "tizen.datetimepicker", $.tizen.widgetex, {
- // allow infinity or hexidecimal
- if ( regexInfinity.test(value) ) {
- ret = parseFloat( value );
- }
- else if ( !radix && regexHex.test(value) ) {
- ret = parseInt( value, 16 );
- }
- else {
-
- // determine sign and number
- var signInfo = parseNegativePattern( value, nf, nf.pattern[0] ),
- sign = signInfo[ 0 ],
- num = signInfo[ 1 ];
-
- // #44 - try parsing as "(n)"
- if ( sign === "" && nf.pattern[0] !== "(n)" ) {
- signInfo = parseNegativePattern( value, nf, "(n)" );
- sign = signInfo[ 0 ];
- num = signInfo[ 1 ];
- }
+ options: {
+ type: null, // date, time, datetime applicable
+ format: null,
+ date: null,
+ initSelector: "input[type='date'], input[type='datetime'], input[type='time'], :jqmData(role='datetimepicker')"
+ },
- // try parsing as "-n"
- if ( sign === "" && nf.pattern[0] !== "-n" ) {
- signInfo = parseNegativePattern( value, nf, "-n" );
- sign = signInfo[ 0 ];
- num = signInfo[ 1 ];
- }
+ _calendar: function () {
+ return window.Globalize.culture().calendars.standard;
+ },
- sign = sign || "+";
+ _value: {
+ attr: "data-" + ( $.mobile.ns || "" ) + "date",
+ signal: "date-changed"
+ },
- // determine exponent and number
- var exponent,
- intAndFraction,
- exponentPos = num.indexOf( "e" );
- if ( exponentPos < 0 ) exponentPos = num.indexOf( "E" );
- if ( exponentPos < 0 ) {
- intAndFraction = num;
- exponent = null;
- }
- else {
- intAndFraction = num.substr( 0, exponentPos );
- exponent = num.substr( exponentPos + 1 );
- }
- // determine decimal position
- var integer,
- fraction,
- decSep = nf[ "." ],
- decimalPos = intAndFraction.indexOf( decSep );
- if ( decimalPos < 0 ) {
- integer = intAndFraction;
- fraction = null;
- }
- else {
- integer = intAndFraction.substr( 0, decimalPos );
- fraction = intAndFraction.substr( decimalPos + decSep.length );
- }
- // handle groups (e.g. 1,000,000)
- var groupSep = nf[ "," ];
- integer = integer.split( groupSep ).join( "" );
- var altGroupSep = groupSep.replace( /\u00A0/g, " " );
- if ( groupSep !== altGroupSep ) {
- integer = integer.split( altGroupSep ).join( "" );
- }
- // build a natively parsable number string
- var p = sign + integer;
- if ( fraction !== null ) {
- p += "." + fraction;
- }
- if ( exponent !== null ) {
- // exponent itself may have a number patternd
- var expSignInfo = parseNegativePattern( exponent, nf, "-n" );
- p += "e" + ( expSignInfo[0] || "+" ) + expSignInfo[ 1 ];
- }
- if ( regexParseFloat.test(p) ) {
- ret = parseFloat( p );
- }
- }
- return ret;
-};
+ _daysInMonth: [ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ],
-Globalize.culture = function( cultureSelector ) {
- // setter
- if ( typeof cultureSelector !== "undefined" ) {
- this.cultureSelector = cultureSelector;
- }
- // getter
- return this.findClosestCulture( cultureSelector ) || this.culture[ "default" ];
-};
+ _isLeapYear: function ( year ) {
+ return year % 4 ? 0 : ( year % 100 ? 1 : ( year % 400 ? 0 : 1 ) );
+ },
-}( this ));
-/**
- * @class core
- * loader.js
- *
- * Youmin Ha <youmin.ha@samsung.com>
- *
- *
- */
-/*
- Web UI scaling concept in Tizen Web UI
+ _makeTwoDigits: function ( val ) {
+ var ret = val.toString(10);
+ if ( val < 10 ) {
+ ret = "0" + ret;
+ }
+ return ret;
+ },
-Generally, web applications must be designed to be showed acceptable on various size and resolution of screens, and web winsets have to be scaled well. Tizen Web UI Framework supports various viewport settings, and Tizen Web UI widgets are designed to be scalable on various screen sizes. In order to make web applications scalable on many devices which have different screen size, it is necessary to understand how mobile web browsers deal with screen resolution, and how Tizen Web UI Framework supports scaling for web applications.
+ _setType: function ( type ) {
+ //datetime, date, time
+ switch (type) {
+ case 'datetime':
+ case 'date':
+ case 'time':
+ this.options.type = type;
+ break;
+ default:
+ this.options.type = 'datetime';
+ break;
+ }
+ this.element.attr( "data-" + ( $.mobile.ns ? $.mobile.ns + "-" : "" ) + "type", this.options.type );
+ return this.options.type;
+ },
-* Viewport on mobile web browser
+ _setFormat: function ( format ) {
+ if ( this.options.format != format ) {
+ this.options.format = format;
+ } else {
+ return;
+ }
-Viewport is an area showing web content on the browser. Unlike desktop browsers, mobile browsers support logical viewport seting, which means that application can set viewport width/height and zoom level by itself.
-The very important thing that to be remembered is that the viewport resolution in pixel is 'Logical', not physical. For example, if the viewport width is set to 480 on a mobile device having 720px screen width, the viewport width is considered to 480px logically. All elements put on right side from 480px horizontal position will not be shown on the viewport.
-Most mobile browsers set viewport with given content attribute with <meta name="viewport" content="..."> tag in <head> section in the application source html, whereas desktop browsers ignore the tag.
-Detailed usage of viewport meta tag is found in here: http://www.w3.org/TR/mwabp/#bp-viewport
+ this.ui.children().remove();
+ var token = this._parsePattern( format ),
+ div = document.createElement('div'),
+ pat,
+ tpl,
+ period,
+ btn,
+ obj = this;
-* Viewport setting by application developers
+ while ( token.length > 0 ) {
+ pat = token.shift();
+ tpl = '<span class="ui-datefield-%1" data-pat="' + pat + '">%2</span>';
+ switch ( pat ) {
+ case 'H': //0 1 2 3 ... 21 22 23
+ case 'HH': //00 01 02 ... 21 22 23
+ case 'h': //0 1 2 3 ... 11 12
+ case 'hh': //00 01 02 ... 11 12
+ $(div).append( tpl.replace('%1', 'hour') );
+ break;
+ case 'mm': //00 01 ... 59
+ case 'm': //0 1 2 ... 59
+ if ( this.options.type == 'date' ) {
+ $(div).append( tpl.replace('%1', 'month') );
+ } else {
+ $(div).append( tpl.replace('%1', 'min') );
+ }
+ break;
+ case 'ss':
+ case 's':
+ $(div).append( tpl.replace('%1', 'sec') );
+ break;
+ case 'd': // day of month 5
+ case 'dd': // day of month(leading zero) 05
+ $(div).append( tpl.replace('%1', 'day') );
+ break;
+ case 'M': // Month of year 9
+ case 'MM': // Month of year(leading zero) 09
+ case 'MMM':
+ case 'MMMM':
+ $(div).append( tpl.replace('%1', 'month') );
+ break;
+ case 'yy': // year two digit
+ case 'yyyy': // year four digit
+ $(div).append( tpl.replace('%1', 'year') );
+ break;
+ case 't': //AM / PM indicator(first letter) A, P
+ // add button
+ case 'tt': //AM / PM indicator AM/PM
+ // add button
+ btn = '<a href="#" class="ui-datefield-period"' +
+ ' data-role="button" data-inline="true">period</a>';
+ $(div).append( btn );
+ break;
+ case 'g':
+ case 'gg':
+ $(div).append( tpl.replace('%1', 'era').replace('%2', this._calendar().eras.name) );
+ break;
+ case '\t':
+ $(div).append( tpl.replace('%1', 'tab').replace('%2', pat) );
+ break;
+ default : // string or any non-clickable object
+ $(div).append( tpl.replace('%1', 'seperator').replace('%2', pat) );
+ break;
+ }
+ }
-When developers write <meta name="viewport" content="..."> in the <head> section of the web application HTML file, Tizen Web UI Framework does not add another viewport meta tag, nor modify developer-defined viewport.
+ this.ui.append( div );
+ if ( this.options.date ) {
+ this._setDate( this.options.date );
+ }
+ this.ui.find('.ui-datefield-period').buttonMarkup().bind( 'vclick', function ( e ) {
+ obj._switchAmPm( obj );
+ });
-* Automatic viewport setting by Tizen Web UI Framework
+ this.element.attr( "data-" + ( $.mobile.ns ? $.mobile.ns + "-" : "" ) + "format", this.options.format );
+ return this.options.format;
+ },
-If developers do not give a viewport meta tag, Tizen Web UI Framework automatically add a viewport meta tag with default viewport setting.
+ _setDate: function ( newdate ) {
+ if ( typeof ( newdate ) == "string" ) {
+ newdate = new Date( newdate );
+ }
+ var fields = $('span,a', this.ui),
+ type,
+ fn,
+ $field,
+ btn,
+ i;
-* Portrait/landscape mode
+ function getMonth() {
+ return newdate.getMonth() + 1;
+ }
+ for ( i = 0; i < fields.length; i++ ) {
+ $field = $(fields[i]);
+ type = $field.attr("class").match(/ui-datefield-([\w]*)/);
+ if ( !type ) {
+ type = "";
+ }
+ switch ( type[1] ) {
+ case 'hour':
+ fn = newdate.getHours;
+ break;
+ case 'min':
+ fn = newdate.getMinutes;
+ break;
+ case 'sec':
+ fn = newdate.getSeconds;
+ break;
+ case 'year':
+ fn = newdate.getFullYear;
+ break;
+ case 'month':
+ fn = getMonth;
+ break;
+ case 'day':
+ fn = newdate.getDate;
+ break;
+ case 'period':
+ fn = newdate.getHours() < 12 ? this._calendar().AM[0] : this._calendar().PM[0];
+ btn = $field.find( '.ui-btn-text' );
+ if ( btn.length == 0 ) {
+ $field.text(fn);
+ } else if ( btn.text() != fn ) {
+ btn.text( fn );
+ }
+ fn = null;
+ break;
+ default:
+ fn = null;
+ break;
+ }
+ if ( fn ) {
+ this._updateField( $field, fn.call( newdate ) );
+ }
+ }
-* Tizen Web UI widgets scaling
+ this.options.date = newdate;
+ this._setValue( newdate );
- */
-( function ($, Globalize, window, undefined) {
+ this.element.attr( "data-" + ( $.mobile.ns ? $.mobile.ns + "-" : "" ) + "date", this.options.date );
+ return this.options.date;
+ },
- var tizen = {
- libFileName : "tizen-web-ui-fw(.min)?.js",
+ destroy: function () {
+ if ( this.ui ) {
+ this.ui.remove();
+ }
- frameworkData : {
- rootDir: '/usr/lib/tizen-web-ui-fw',
- version: '0.1',
- theme: "tizen-white",
- viewportWidth: "device-width",
- viewportScale: false,
+ if ( this.element ) {
+ this.element.show();
+ }
+ },
- defaultFontSize: 22,
- minified: false,
+ value: function ( val ) {
+ function timeStr( t, obj ) {
+ return obj._makeTwoDigits( t.getHours() ) + ':' +
+ obj._makeTwoDigits( t.getMinutes() ) + ':' +
+ obj._makeTwoDigits( t.getSeconds() );
+ }
- debug: false
- },
+ function dateStr( d, obj ) {
+ return ( ( d.getFullYear() % 10000 ) + 10000 ).toString().substr(1) + '-' +
+ obj._makeTwoDigits( d.getMonth() + 1 ) + '-' +
+ obj._makeTwoDigits( d.getDate() );
+ }
- log : {
- debug : function ( msg ) {
- if ( tizen.frameworkData.debug ) {
- console.log( msg );
+ var rvalue = null;
+ if ( val ) {
+ rvalue = this._setDate( val );
+ } else {
+ switch ( this.options.type ) {
+ case 'time':
+ rvalue = timeStr( this.options.date, this );
+ break;
+ case 'date':
+ rvalue = dateStr( this.options.date, this );
+ break;
+ default:
+ rvalue = dateStr( this.options.date, this ) + 'T' + timeStr( this.options.date, this );
+ break;
}
- },
- warn : function ( msg ) {
- console.warn( msg );
- },
- error : function ( msg ) {
- console.error( msg );
- },
- alert : function ( msg ) {
- window.alert( msg );
}
+ return rvalue;
},
- util : {
+ setValue: function ( newdate ) {
+ console.warn( "setValue was deprecated. use datetimepicker('option', 'date', value) instead." );
+ return this.value( newdate );
+ },
- loadScriptSync : function ( scriptPath, successCB, errorCB ) {
- $.ajax( {
- url: scriptPath,
- dataType: 'script',
- async: false,
- crossDomain: false,
- success: successCB,
- error: function ( jqXHR, textStatus, errorThrown ) {
- if ( errorCB ) {
- errorCB( jqXHR, textStatus, errorThrown );
- } else {
- var ignoreStatusList = [ 404 ], // 404: not found
- errmsg = ( 'Error while loading ' + scriptPath + '\n' + jqXHR.status + ':' + jqXHR.statusText );
- if ( -1 == $.inArray( jqXHR.status, ignoreStatusList ) ) {
- tizen.log.alert( errmsg );
- } else {
- tizen.log.warn( errmsg );
- }
- }
- }
- } );
- },
- isMobileBrowser: function ( ) {
- var mobileIdx = window.navigator.appVersion.indexOf("Mobile"),
- isMobile = -1 < mobileIdx;
- return isMobile;
- }
+ /**
+ * return W3C DTF string
+ */
+ getValue: function () {
+ console.warn("getValue() was deprecated. use datetimepicker('value') instead.");
+ return this.value();
},
- css : {
- cacheBust: ( document.location.href.match( /debug=true/ ) ) ?
- '?cacheBust=' + ( new Date( ) ).getTime( ) :
- '',
- addElementToHead : function ( elem ) {
- var head = document.getElementsByTagName( 'head' )[0];
- if ( head ) {
- $( head ).prepend( elem );
- }
- },
- makeLink : function ( href ) {
- var cssLink = document.createElement( 'link' );
- cssLink.setAttribute( 'rel', 'stylesheet' );
- cssLink.setAttribute( 'href', href );
- cssLink.setAttribute( 'name', 'tizen-theme' );
- return cssLink;
- },
- load: function ( path ) {
- var head = document.getElementsByTagName( 'head' )[0],
- cssLinks = head.getElementsByTagName( 'link' ),
- idx,
- l = null;
- // Find css link element
- for ( idx = 0; idx < cssLinks.length; idx++ ) {
- if ( cssLinks[idx].getAttribute( 'rel' ) != "stylesheet" ) {
- continue;
- }
- if ( cssLinks[idx].getAttribute( 'name' ) == "tizen-theme"
- || cssLinks[idx].getAttribute( 'href' ) == path ) {
- l = cssLinks[idx];
- break;
+ _updateField: function ( target, value ) {
+ if ( !target || target.length == 0 ) {
+ return;
+ }
+
+ if ( value == 0 ) {
+ value = "0";
+ }
+
+ var pat = target.jqmData( 'pat' ),
+ hour,
+ text,
+ self = this;
+
+ switch ( pat ) {
+ case 'H':
+ case 'HH':
+ case 'h':
+ case 'hh':
+ hour = value;
+ if ( pat.charAt(0) == 'h' ) {
+ if ( hour > 12 ) {
+ hour -= 12;
+ } else if ( hour == 0 ) {
+ hour = 12;
}
}
- if ( l ) { // Found the link element!
- if ( l.getAttribute( 'href' ) == path ) {
- tizen.log.warn( "Theme is already loaded. Skip theme loading in the framework." );
- } else {
- l.setAttribute( 'href', path );
- }
- } else {
- this.addElementToHead( this.makeLink( path ) );
+ hour = this._makeTwoDigits( hour );
+ text = hour;
+ break;
+ case 'm':
+ case 'M':
+ case 'd':
+ case 's':
+ text = value;
+ break;
+ case 'mm':
+ case 'dd':
+ case 'MM':
+ case 'ss':
+ text = this._makeTwoDigits( value );
+ break;
+ case 'MMM':
+ text = this._calendar().months.namesAbbr[ value - 1];
+ break;
+ case 'MMMM':
+ text = this._calendar().months.names[ value - 1 ];
+ break;
+ case 'yy':
+ text = this._makeTwoDigits( value % 100 );
+ break;
+ case 'yyyy':
+ if ( value < 10 ) {
+ value = '000' + value;
+ } else if ( value < 100 ) {
+ value = '00' + value;
+ } else if ( value < 1000 ) {
+ value = '0' + value;
}
+ text = value;
+ break;
}
- },
- getParams: function ( ) {
- /* Get data-* params from <script> tag, and set tizen.frameworkData.* values
- * Returns true if proper <script> tag is found, or false if not.
- */
- // Find current <script> tag element
- var scriptElems = document.getElementsByTagName( 'script' ),
- val = null,
- foundScriptTag = false,
- idx,
- elem,
- src,
- tokens,
- version_idx;
+ // to avoid reflow where its value isn't out-dated
+ if ( target.text() != text ) {
+ if ( target.hasClass("ui-datefield-selected") ) {
+ target.addClass("out");
+ this._new_value = text;
- function getTizenTheme( ) {
- var t = navigator.theme ? navigator.theme.split( ':' )[0] : null;
- if ( t ) {
- t = t.replace('-hd', '');
- if ( ! t.match( /^tizen-/ ) ) {
- t = 'tizen-' + t;
- }
+ target.animationComplete( function () {
+ target.text( self._new_value);
+ target.addClass("in")
+ .removeClass("out");
+
+ target.animationComplete( function () {
+ target.removeClass("in").
+ removeClass("ui-datefield-selected");
+ });
+ });
+ } else {
+ target.text( text );
}
- return t;
}
+ },
- for ( idx in scriptElems ) {
- elem = scriptElems[idx];
- src = elem.src ? elem.getAttribute( 'src' ) : undefined;
- if (src && src.match( this.libFileName )) {
- // Set framework data, only when they are given.
- tokens = src.split(/[\/\\]/);
- version_idx = -3;
- this.frameworkData.rootDir = ( elem.getAttribute( 'data-framework-root' )
- || tokens.slice( 0, tokens.length + version_idx ).join( '/' )
- || this.frameworkData.rootDir ).replace( /^file:(\/\/)?/, '' );
- this.frameworkData.version = elem.getAttribute( 'data-framework-version' )
- || tokens[ tokens.length + version_idx ]
- || this.frameworkData.version;
- this.frameworkData.theme = elem.getAttribute( 'data-framework-theme' )
- || getTizenTheme( )
- || this.frameworkData.theme;
- this.frameworkData.viewportWidth = elem.getAttribute( 'data-framework-viewport-width' )
- || this.frameworkData.viewportWidth;
- this.frameworkData.viewportScale =
- "true" === elem.getAttribute( 'data-framework-viewport-scale' ) ? true
- : this.frameworkData.viewportScale;
- this.frameworkData.minified = src.search(/\.min\.js$/) > -1 ? true : false;
- this.frameworkData.debug = "true" === elem.getAttribute( 'data-framework-debug' ) ? true
- : this.frameworkData.debug;
- foundScriptTag = true;
- break;
+ _switchAmPm: function ( obj ) {
+ if ( this._calendar().AM != null ) {
+ var date = new Date( this.options.date ),
+ text,
+ change = 1000 * 60 * 60 * 12;
+ if ( date.getHours() > 11 ) {
+ change = -change;
}
+ date.setTime( date.getTime() + change );
+ this._setDate( date );
}
- return foundScriptTag;
},
- loadTheme: function ( theme ) {
- var themePath,
- cssPath,
- jsPath;
+ _parsePattern: function ( pattern ) {
+ var regex = /\/|\s|dd|d|MMMM|MMM|MM|M|yyyy|yy|y|hh|h|HH|H|mm|m|ss|s|tt|t|f|gg|g|\'[\w\W]*\'$|[\w\W]/g,
+ matches,
+ i;
- if ( ! theme ) {
- theme = tizen.frameworkData.theme;
+ matches = pattern.match( regex );
+
+ for ( i = 0; i < matches.length; i++ ) {
+ if ( matches[i].charAt(0) == "'" ) {
+ matches[i] = matches[i].substr( 1, matches[i].length - 2 );
+ }
}
- themePath = [
- tizen.frameworkData.rootDir,
- tizen.frameworkData.version,
- 'themes',
- theme
- ].join( '/' );
- jsPath = [ themePath, 'theme.js' ].join( '/' );
+ return matches;
+ },
- if ( tizen.frameworkData.minified ) {
- cssPath = [themePath, 'tizen-web-ui-fw-theme.min.css'].join( '/' );
- } else {
- cssPath = [themePath, 'tizen-web-ui-fw-theme.css'].join( '/' );
+ changeTypeFormat: function ( type, format ) {
+ console.warn('changeTypeFormat() was deprecated. use datetimepicker("option", "type"|"format", value) instead');
+ if ( type ) {
+ this._setType( type );
+ }
+
+ if ( format ) {
+ this._setFormat( format );
}
- tizen.css.load( cssPath );
- tizen.util.loadScriptSync( jsPath );
},
- /** Load Globalize culture file, and set default culture.
- * @param[in] language (optional) Language code. ex) en-US, en, ko-KR, ko
- * If language is not given, read language from html 'lang' attribute,
- * or from system setting.
- * @param[in] cultureDic (optional) Dictionary having language code->
- */
- loadGlobalizeCulture: function ( language, cultureDic ) {
- var self = this,
- cFPath,
- lang,
- mockJSXHR;
+ _create: function () {
+ var obj = this;
- function getLang ( language ) {
- var lang = language
- || $( 'html' ).attr( 'lang' )
- || window.navigator.language.split( '.' )[0] // Webkit, Safari + workaround for Tizen
- || window.navigator.userLanguage // IE
- || 'en',
- countryCode = null,
- countryCodeIdx = lang.lastIndexOf('-'),
- ignoreCodes = ['Cyrl', 'Latn', 'Mong']; // Not country code!
- if ( countryCodeIdx != -1 ) { // Found country code!
- countryCode = lang.substr( countryCodeIdx + 1 );
- if ( ignoreCodes.join( '-' ).indexOf( countryCode ) < 0 ) {
- // countryCode is not found from ignoreCodes.
- // Make countryCode to uppercase.
- lang = [ lang.substr( 0, countryCodeIdx ), countryCode.toUpperCase( ) ].join( '-' );
+ if ( this.element.is( "input" ) ) {
+ ( function ( obj ) {
+ var type, value, format;
+
+ type = obj.element.get(0).getAttribute( "type" );
+ obj.options.type = type;
+
+ value = obj.element.get(0).getAttribute( "value" );
+ if ( value ) {
+ obj.options.date = new Date( value );
}
- }
- // NOTE: 'en' to 'en-US', because globalize has no 'en' culture file.
- lang = lang == 'en' ? 'en-US' : lang;
- return lang;
+ }( this ) );
}
- function getNeutralLang ( lang ) {
- var neutralLangIdx = lang.lastIndexOf( '-' ),
- neutralLang;
- if ( neutralLangIdx != -1 ) {
- neutralLang = lang.substr( 0, neutralLangIdx );
+ if ( !this.options.format ) {
+ switch ( this.options.type ) {
+ case 'datetime':
+ this.options.format = this._calendar().patterns.d + "\t" + this._calendar().patterns.t;
+ break;
+ case 'date':
+ this.options.format = this._calendar().patterns.d;
+ break;
+ case 'time':
+ this.options.format = this._calendar().patterns.t;
+ break;
}
- return neutralLang;
}
- function getCultureFilePath ( lang, cFDic ) {
- var cFPath = null; // error value
-
- if ( "string" != typeof lang ) {
- return null;
- }
- if ( cFDic && cFDic[lang] ) {
- cFPath = cFDic[lang];
- } else {
- // Default Globalize culture file path
- cFPath = [
- self.frameworkData.rootDir,
- self.frameworkData.version,
- 'js',
- 'cultures',
- ['globalize.culture.', lang, '.js'].join( '' ),
- ].join( '/' );
- }
- return cFPath;
+ if ( !this.options.date ) {
+ this.options.date = new Date();
}
- function printLoadError( cFPath, jqXHR ) {
- tizen.log.error( "Error " + jqXHR.status + ": " + jqXHR.statusText
- + "::Culture file (" + cFPath + ") is failed to load.");
- }
+ this.element.hide();
+ this.ui = $('<div class="ui-datefield"></div>');
+ $(this.element).after( this.ui );
- function loadCultureFile ( cFPath, errCB ) {
- function _successCB ( ) {
- tizen.log.debug( "Culture file (" + cFPath + ") is loaded successfully." );
- }
- function _errCB ( jqXHR, textStatus, err ) {
- if ( errCB ) {
- errCB( jqXHR, textStatus, err );
+ this._popup_open = false;
+ this.ui.bind('vclick', function ( e ) {
+ obj._showDataSelector( obj, this, e.target );
+ });
+ },
+
+ _populateDataSelector: function ( field, pat ) {
+ var values,
+ numItems,
+ current,
+ data,
+ range = window.range,
+ local,
+ yearlb,
+ yearhb,
+ day;
+
+ switch ( field ) {
+ case 'hour':
+ if ( pat == 'H' || pat == 'HH' ) {
+ // twentyfour
+ values = range( 0, 23 );
+ data = range( 0, 23 );
+ current = this.options.date.getHours();
+ } else {
+ values = range( 1, 12 );
+ current = this.options.date.getHours() - 1;//11
+ if ( current >= 11 ) {
+ current = current - 12;
+ data = range( 13, 23 );
+ data.push( 12 ); // consider 12:00 am as 00:00
} else {
- printLoadError( cFPath, jqXHR );
+ data = range( 1, 11 );
+ data.push( 0 );
+ }
+ if ( current < 0 ) {
+ current = 11; // 12:00 or 00:00
}
}
-
- if ( ! cFPath ) { // Invalid cFPath -> Regard it as '404 Not Found' error.
- mockJSXHR = {
- status: 404,
- statusText: "Not Found"
- };
- _errCB( mockJSXHR, null, null );
- } else {
- $.ajax( {
- url: cFPath,
- dataType: 'script',
- cache: true,
- async: false,
- success: _successCB,
- error: _errCB
- } );
+ if ( pat.length == 2 ) {
+ // two digit
+ values = values.map( this._makeTwoDigits );
+ }
+ numItems = values.length;
+ break;
+ case 'min':
+ case 'sec':
+ values = range( 0, 59 );
+ if ( pat.length == 2 ) {
+ values = values.map( this._makeTwoDigits );
+ }
+ data = range( 0, 59 );
+ current = ( field == 'min' ? this.options.date.getMinutes() : this.options.date.getSeconds() );
+ numItems = values.length;
+ break;
+ case 'year':
+ yearlb = 1900;
+ yearhb = 2100;
+ data = range( yearlb, yearhb );
+ current = this.options.date.getFullYear() - yearlb;
+ values = range( yearlb, yearhb );
+ numItems = values.length;
+ break;
+ case 'month':
+ switch ( pat.length ) {
+ case 1:
+ values = range( 1, 12 );
+ break;
+ case 2:
+ values = range( 1, 12 ).map( this._makeTwoDigits );
+ break;
+ case 3:
+ values = this._calendar().months.namesAbbr.slice();
+ break;
+ case 4:
+ values = this._calendar().months.names.slice();
+ break;
+ }
+ if ( values.length == 13 ) { // @TODO Lunar calendar support
+ if ( values[12] == "" ) { // to remove lunar calendar reserved space
+ values.pop();
+ }
+ }
+ data = range( 1, values.length );
+ current = this.options.date.getMonth();
+ numItems = values.length;
+ break;
+ case 'day':
+ day = this._daysInMonth[ this.options.date.getMonth() ];
+ if ( day == 28 ) {
+ day += this._isLeapYear( this.options.date.getFullYear() );
+ }
+ values = range( 1, day );
+ if ( pat.length == 2 ) {
+ values = values.map( this._makeTwoDigits );
}
+ data = range( 1, day );
+ current = this.options.date.getDate() - 1;
+ numItems = day;
+ break;
+ }
+
+ return {
+ values: values,
+ data: data,
+ numItems: numItems,
+ current: current
+ };
+
+ },
+
+ _showDataSelector: function ( obj, ui, target ) {
+ target = $(target);
+
+ var attr = target.attr("class"),
+ field = attr ? attr.match(/ui-datefield-([\w]*)/) : undefined,
+ pat,
+ data,
+ values,
+ numItems,
+ current,
+ valuesData,
+ html,
+ datans,
+ $ul,
+ $div,
+ $ctx,
+ $li,
+ i,
+ newLeft = 10,
+ self = this;
+
+ if ( !attr ) {
+ return;
+ }
+ if ( !field ) {
+ return;
+ }
+ if ( this._popup_open ) {
+ return;
}
- lang = getLang( language );
- cFPath = getCultureFilePath( lang, cultureDic );
- loadCultureFile( cFPath,
- function ( jqXHR, textStatus, err ) {
- if ( jqXHR.status == 404 ) {
- // If culture file is not found, try once more with neutral lang.
- var nLang = getNeutralLang( lang ),
- ncFPath = getCultureFilePath( nLang, cultureDic );
- loadCultureFile( ncFPath, null );
- } else {
- printLoadError( cFPath, jqXHR );
- }
- } );
+ target.not('.ui-datefield-seperator').addClass('ui-datefield-selected');
- return lang;
- },
- setGlobalize: function ( ) {
- var lang = this.loadGlobalizeCulture( );
+ pat = target.jqmData('pat');
+ data = obj._populateDataSelector.call( obj, field[1], pat );
- // Set culture
- // NOTE: It is not needed to set with neutral lang.
- // Globalize automatically deals with it.
- Globalize.culture( lang );
- },
- /**
- * Load custom globalize culture file
- * Find current system language, and load appropriate culture file from given colture file list.
- *
- * @param[in] cultureDic collection of 'language':'culture file path' key-val pair.
- * @example
- * var myCultures = {
- * "en" : "culture/en.js",
- * "fr" : "culture/fr.js",
- * "ko-KR" : "culture/ko-KR.js"
- * };
- * loadCultomGlobalizeCulture( myCultures );
- *
- * ex) culture/fr.js
- * -------------------------------
- * Globalize.addCultureInfo( "fr", {
- * messages: {
- * "hello" : "bonjour",
- * "translate" : "traduire"
- * }
- * } );
- * -------------------------------
- */
- loadCustomGlobalizeCulture: function ( cultureDic ) {
- tizen.loadGlobalizeCulture( null, cultureDic );
- },
+ values = data.values;
+ numItems = data.numItems;
+ current = data.current;
+ valuesData = data.data;
- /** Set viewport meta tag for mobile devices.
- *
- * @param[in] viewportWidth viewport width. "device-width" is OK.
- */
- setViewport: function ( viewportWidth ) {
- var meta = null,
- head,
- content;
+ if ( values ) {
+ datans = "data-" + ($.mobile.ns ? ($.mobile.ns + '-') : "") + 'val="';
+ for ( i = 0; i < values.length; i++ ) {
+ html += '<li><a class="ui-link" ' + datans + valuesData[i] + '">' + values[i] + '</a></li>';
+ }
- // Do nothing if viewport setting code is already in the code.
- $( "meta[name=viewport]" ).each( function ( ) {
- meta = this;
- return;
- });
- if ( meta ) { // Found custom viewport!
- content = $( meta ).prop( "content" );
- viewportWidth = content.replace( /.*width=(device-width|\d+)\s*,?.*$/gi, "$1" );
- tizen.log.warn( "Viewport is set to '" + viewportWidth + "' in a meta tag. Framework skips viewport setting." );
- } else {
- // Create a meta tag
- meta = document.createElement( "meta" );
- if ( meta ) {
- meta.name = "viewport";
- content = [ "width=", viewportWidth, ", user-scalable=no" ].join( "" );
- if ( ! isNaN( viewportWidth ) ) {
- // Fix scale to 1.0, if viewport width is set to fixed value.
- // NOTE: Works wrong in Tizen browser!
- //content = [ content, ", initial-scale=1.0, maximum-scale=1.0" ].join( "" );
- }
- meta.content = content;
- tizen.log.debug( content );
- head = document.getElementsByTagName( 'head' ).item( 0 );
- head.insertBefore( meta, head.firstChild );
+ $ul = $("<ul></ul>");
+ $div = $('<div class="ui-datetimepicker-selector" data-transition="fade" data-fade="false"></div>');
+ $div.append( $ul ).appendTo( ui );
+ $ctx = $div.ctxpopup();
+ $ctx.parents('.ui-popupwindow').addClass('ui-datetimepicker');
+ $li = $(html);
+ $( $li[current] ).addClass("current");
+ $div.jqmData( "list", $li );
+ $div.circularview();
+ // cause ctxpopup forced to subtract 10
+ if ( $( window ).width() / 2 < target.offset().left ) {
+ newLeft = -10;
}
- }
- return viewportWidth;
- },
+ $ctx.popupwindow( 'open',
+ target.offset().left + ( target.width() / 2 ) + newLeft - window.pageXOffset ,
+ target.offset().top + target.height() - window.pageYOffset );
- /** Read body's font-size, scale it, and reset it.
- * param[in] desired font-size / base font-size.
- */
- scaleBaseFontSize: function ( themeDefaultFontSize, ratio ) {
- tizen.log.debug( "themedefaultfont size: " + themeDefaultFontSize + ", ratio: " + ratio );
- var scaledFontSize = Math.round( themeDefaultFontSize * ratio );
+ this._popup_open = true;
- $( 'html.ui-mobile' ).css( { 'font-size': scaledFontSize + "px" } );
- tizen.log.debug( 'html:font size is set to ' + scaledFontSize );
- $( document ).ready( function ( ) {
- $( '.ui-mobile' ).children( 'body' ).css( { 'font-size': scaledFontSize + "px" } );
- } );
- },
+ $div.bind('popupafterclose', function ( e ) {
+ if ( obj._reflow ) {
+ $(window).unbind("resize", obj._reflow);
+ obj._reflow = null;
+ }
- setScaling: function ( ) {
- var viewportWidth = this.frameworkData.viewportWidth,
- themeDefaultFontSize = this.frameworkData.defaultFontSize, // comes from theme.js
- ratio = 1;
+ if ( !( target.hasClass("in") || target.hasClass("out") ) ) {
+ target.removeClass("ui-datefield-selected");
+ }
- // Keep original font size
- $( 'body' ).attr( 'data-tizen-theme-default-font-size', themeDefaultFontSize );
+ $div.unbind( 'popupafterclose' );
+ $ul.unbind( 'vclick' );
+ $(obj).unbind( 'update' );
+ $ctx.popupwindow( 'destroy' );
+ $div.remove();
- // Legacy support: tizen.frameworkData.viewportScale
- if ( this.frameworkData.viewportScale == true ) {
- viewportWidth = "screen-width";
- }
+ self._popup_open = false;
+ });
- if ( "screen-width" == viewportWidth ) {
- viewportWidth = document.documentElement.clientWidth;
- }
+ $(obj).bind( 'update', function ( e, val ) {
+ var date = new Date( this.options.date ),
+ month,
+ date_calibration = function () {
+ date.setDate( 1 );
+ date.setDate( date.getDate() - 1 );
+ };
- viewportWidth = this.setViewport( viewportWidth ); // If custom viewport setting exists, get viewport width
- if ( ! isNaN( viewportWidth ) ) { // fixed width!
- ratio = parseFloat( viewportWidth / this.frameworkData.defaultViewportWidth );
- }
- this.scaleBaseFontSize( themeDefaultFontSize, ratio );
- }
- };
+ switch ( field[1] ) {
+ case 'min':
+ date.setMinutes( val );
+ break;
+ case 'hour':
+ date.setHours( val );
+ break;
+ case 'sec':
+ date.setSeconds( val );
+ break;
+ case 'year':
+ month = date.getMonth();
+ date.setFullYear( val );
- function export2TizenNS ( $, tizen ) {
- if ( undefined == typeof $.tizen ) {
- $.tizen = { };
- }
+ if ( date.getMonth() != month ) {
+ date_calibration();
+ }
+ break;
+ case 'month':
+ date.setMonth( val - 1 );
- $.tizen.frameworkData = tizen.frameworkData;
- $.tizen.loadCustomGlobalizeCulture = tizen.loadCustomGlobalizeCulture;
- $.tizen.loadTheme = tizen.loadTheme;
+ if ( date.getMonth() == val ) {
+ date_calibration();
+ }
+ break;
+ case 'day':
+ date.setDate( val );
+ break;
+ }
- $.tizen.__tizen__ = tizen; // for unit-test
- }
+ obj._setDate( date );
- export2TizenNS( $, tizen );
+ $ctx.popupwindow( 'close' );
+ });
- tizen.getParams( );
- tizen.loadTheme( );
- tizen.setScaling( ); // Run after loadTheme(), for the default font size.
- tizen.setGlobalize( );
+ $ul.bind( 'click', function ( e ) {
+ if ( $(e.target).is('a') ) {
+ $ul.find(".current").removeClass("current");
+ $(e.target).parent().addClass('current');
+ var val = $(e.target).jqmData("val");
+ $(obj).trigger( 'update', val ); // close popup, unselect field
+ }
+ });
- // Turn off JQM's auto initialization option.
- // NOTE: This job must be done before domready.
- $.mobile.autoInitializePage = false;
+ $div.circularview( 'centerTo', '.current', 500 );
+ $div.bind( 'scrollend' , function ( e ) {
+ if ( !obj._reflow ) {
+ obj._reflow = function () {
+ $div.circularview("reflow");
+ };
+ $(window).bind("resize", obj._reflow);
+ }
+ });
+ }
+ return ui;
+ }
- $(document).ready( function ( ) {
- $.mobile.initializePage( );
});
-} ( jQuery, window.Globalize, window ) );
-(function($){$.tizen.frameworkData.pkgVersion="0.2.15";}(jQuery));
+ $(document).bind("pagecreate create", function ( e ) {
+ $($.tizen.datetimepicker.prototype.options.initSelector, e.target)
+ .not(":jqmData(role='none'), :jqmData(role='nojs')")
+ .datetimepicker();
+ });
+
+} ( jQuery, this ) );
+
+
+(function($){$.tizen.frameworkData.pkgVersion="0.2.20";}(jQuery));
(parts of) Underscore (http://documentcloud.github.com/underscore/) [MIT license]
Globalize (http://github.com/jquery/globalize/) [MIT license]
+
+glMatrix 1.3.7 (https://github.com/toji/gl-matrix) [https://github.com/toji/gl-matrix/blob/master/LICENSE.md]
*/
-function ensureNS(ns){var nsAr=ns.split("."),nsSoFar="";for(var Nix in nsAr)nsSoFar=nsSoFar+(Nix>0?".":"")+nsAr[Nix],eval(nsSoFar+" = "+nsSoFar+" || {};")}function range(a,b,c){var d=[],e,f,g,h=c||1,i=!1;!isNaN(a)&&!isNaN(b)?(e=a,f=b):isNaN(a)&&isNaN(b)?(i=!0,e=a.charCodeAt(0),f=b.charCodeAt(0)):(e=isNaN(a)?0:a,f=isNaN(b)?0:b),g=e>f?!1:!0;if(g)while(e<=f)d.push(i?String.fromCharCode(e):e),e+=h;else while(e>=f)d.push(i?String.fromCharCode(e):e),e-=h;return d}(function(a,b){function c(){var b=a("script[data-framework-version][data-framework-root][data-framework-theme]");return b.attr("data-framework-root")+"/"+b.attr("data-framework-version")+"/themes/"+b.attr("data-framework-theme")+"/proto-html"}a.widget("tizen.widgetex",a.mobile.widget,{_createWidget:function(){a.tizen.widgetex.loadPrototype.call(this,this.namespace+"."+this.widgetName),a.mobile.widget.prototype._createWidget.apply(this,arguments)},_init:function(){if(this.element===b)return;var c=this.element.closest(".ui-page"),d=this,e={};c.is(":visible")?this._realize():c.bind("pageshow",function(){d._realize()}),a.extend(e,this.options),this.options={},this._setOptions(e)},_getCreateOptions:function(){if(this.element.is("input")&&this._value!==b){var c=this.element.attr("type")==="checkbox"||this.element.attr("type")==="radio"?this.element.is(":checked"):this.element.is("[value]")?this.element.attr("value"):b;c!=b&&this.element.attr(this._value.attr,c)}return a.mobile.widget.prototype._getCreateOptions.apply(this,arguments)},_setOption:function(c,d){var e="_set"+c.replace(/^[a-z]/,function(a){return a.toUpperCase()});this[e]!==b?this[e](d):a.mobile.widget.prototype._setOption.apply(this,arguments)},_setDisabled:function(b){a.Widget.prototype._setOption.call(this,"disabled",b),this.element.is("input")&&this.element.attr("disabled",b)},_setValue:function(b){a.tizen.widgetex.setValue(this,b)},_realize:function(){}}),a.tizen.widgetex.setValue=function(a,c){if(a._value!==b){var d=a._value.makeString?a._value.makeString(c):c,e;a.element.attr(a._value.attr,d),a._value.signal!==b&&a.element.triggerHandler(a._value.signal,c),a.element.is("input")&&(e=a.element.attr("type"),e==="checkbox"||e==="radio"?c?a.element.attr("checked",!0):a.element.removeAttr("checked"):a.element.attr("value",d),a.element.trigger("change"))}},a.tizen.widgetex.assignElements=function(b,c){var d={},e;for(e in c)typeof c[e]=="string"?(d[e]=b.find(c[e]),c[e].match(/^#/)&&d[e].removeAttr("id")):typeof c[e]=="object"&&(d[e]=a.tizen.widgetex.assignElements(b,c[e]));return d},a.tizen.widgetex.loadPrototype=function(d,e){var f=d.split("."),g,h,i,j=!1,k,l;f.length==2&&(g=f[0],h=f[1],a[g][h].prototype._htmlProto!==b&&(i=a[g][h].prototype._htmlProto.source,i===b&&(i=h,j=!0),typeof i=="string"?j?(d=i,l=c(),a.ajax({url:l+"/"+d+".prototype.html",async:!1,dataType:"html"}).success(function(b,c,d){i=a("<div></div>").html(b).jqmData("tizen.widgetex.ajax.fail",!1)}),i=a("<div></div>").text("Failed to load proto for widget "+g+"."+h+"!").css({background:"red",color:"blue",border:"1px solid black"}).jqmData("tizen.widgetex.ajax.fail",!0)):i=a(i).jqmData("tizen.widgetex.ajax.fail",!1):i.jqmData("tizen.widgetex.ajax.fail",!1),k=i,a[g][h].prototype._htmlProto.source=i,a[g][h].prototype._htmlProto.ui!==b&&a.extend(this,{_ui:a.tizen.widgetex.assignElements(k.clone(),a[g][h].prototype._htmlProto.ui)})))}})(jQuery),function(a,b,c,d){function e(a,b){var c=a%b;return c<0&&(c=b+c),c}function f(a,b,c){var d="translate3d( "+b+","+c+", 0px)";a.css({"-ms-transform":d,"-o-transform":d,"-moz-transform":d,"-webkit-transform":d,transform:d})}function g(b){this.options=a.extend({},b),this.easing="easeOutQuad",this.reset()}function i(){return Date.now()}var h={scrolling:0,done:1};a.extend(g.prototype,{start:function(a,b,c){this.state=b!=0?h.scrolling:h.done,this.pos=a,this.speed=b,this.duration=c,this.fromPos=0,this.toPos=0,this.startTime=i()},reset:function(){this.state=h.done,this.pos=0,this.speed=0,this.duration=0},update:function(){var b=this.state,c,d,e,f;return b==h.done?this.pos:(c=this.duration,d=i()-this.startTime,d=d>c?c:d,e=this.speed*(1-a.easing[this.easing](d/c,d,0,1,c)),f=this.pos+e,this.pos=f,d>=c&&(this.state=h.done),this.pos)},done:function(){return this.state==h.done},getPosition:function(){return this.pos}}),jQuery.widget("mobile.circularview",jQuery.mobile.widget,{options:{fps:60,scrollDuration:2e3,moveThreshold:10,moveIntervalThreshold:150,startEventName:"scrollstart",updateEventName:"scrollupdate",stopEventName:"scrollstop",eventType:a.support.touch?"touch":"mouse",delayedClickSelector:"a, .ui-btn",delayedClickEnabled:!1},_makePositioned:function(a){a.css("position")=="static"&&a.css("position","relative")},_create:function(){var b=this;this._items=a(this.element).jqmData("list"),this._$clip=a(this.element).addClass("ui-scrollview-clip"),this._$clip.wrapInner('<div class="ui-scrollview-view"></div>'),this._$view=a(".ui-scrollview-view",this._$clip),this._$list=a("ul",this._$clip),this._$clip.css("overflow","hidden"),this._makePositioned(this._$clip),this._$view.css("overflow","hidden"),this._tracker=new g(this.options),this._timerInterval=1e3/this.options.fps,this._timerID=0,this._timerCB=function(){b._handleMomentumScroll()},this.refresh(),this._addBehaviors()},reflow:function(){var a=this.getScrollPosition();this.refresh(),this.scrollTo(a.x,a.y)},refresh:function(){var c;this._$clip.width(a(b).width()),this._clipWidth=this._$clip.width(),this._$list.empty(),this._$list.append(this._items[0]),this._itemWidth=a(this._items[0]).outerWidth(),a(this._items[0]).detach(),c=this._clipWidth/this._itemWidth,c=Math.ceil(c*10)/10,this._itemsPerView=parseInt(c,10);while(this._itemsPerView+1>this._items.length)a.merge(this._items,a(this._items).clone());this._rx=-this._itemWidth,this._sx=-this._itemWidth,this._setItems()},_startMScroll:function(a,b){this._stopMScroll();var c=!1,d=this.options.scrollDuration,e=this._tracker,f=this._clipWidth,g=this._viewWidth;this._$clip.trigger(this.options.startEventName),e.start(this._rx,a,d,g>f?-(g-f):0,0),c=!e.done(),c?this._timerID=setTimeout(this._timerCB,this._timerInterval):this._stopMScroll()},_stopMScroll:function(){this._timerID&&(this._$clip.trigger(this.options.stopEventName),clearTimeout(this._timerID)),this._timerID=0,this._tracker&&this._tracker.reset()},_handleMomentumScroll:function(){var a=!1,b=this._$view,c=0,d=0,e=this._tracker;e&&(e.update(),c=e.getPosition(),a=!e.done()),this._setScrollPosition(c,d),this._rx=c,this._$clip.trigger(this.options.updateEventName,[{x:c,y:d}]),a?this._timerID=setTimeout(this._timerCB,this._timerInterval):this._stopMScroll()},_setItems:function(){var a,b;for(a=-1;a<this._itemsPerView+1;a++)b=this._items[e(a,this._items.length)],this._$list.append(b);f(this._$view,this._sx+"px",0),this._$view.width(this._itemWidth*(this._itemsPerView+2)),this._viewWidth=this._$view.width()},_setScrollPosition:function(a,b){var c=this._sx,d=a-c,g=parseInt(d/this._itemWidth,10),h,i,j;if(g>0)for(h=0;h<g;h++)this._$list.children().last().detach(),i=-parseInt(c/this._itemWidth+h+3,10),j=this._items[e(i,this._items.length)],this._$list.prepend(j);else if(g<0)for(h=0;h>g;h--)this._$list.children().first().detach(),i=this._itemsPerView-parseInt(c/this._itemWidth+h,10),j=this._items[e(i,this._items.length)],this._$list.append(j);this._sx+=g*this._itemWidth,f(this._$view,a-this._sx-this._itemWidth+"px",0)},_enableTracking:function(){a(c).bind(this._dragMoveEvt,this._dragMoveCB),a(c).bind(this._dragStopEvt,this._dragStopCB)},_disableTracking:function(){a(c).unbind(this._dragMoveEvt,this._dragMoveCB),a(c).unbind(this._dragStopEvt,this._dragStopCB)},_getScrollHierarchy:function(){var b=[],c;return this._$clip.parents(".ui-scrollview-clip").each(function(){c=a(this).jqmData("circulaview"),c&&b.unshift(c)}),b},centerTo:function(b,c){var d,e;for(d=0;d<this._items.length;d++)if(a(this._items[d]).is(b)){e=-(d*this._itemWidth-this._clipWidth/2+this._itemWidth*1.5),this.scrollTo(e+this._itemWidth,0),this.scrollTo(e,0,c);return}},scrollTo:function(b,c,d){this._stopMScroll();if(!d){this._setScrollPosition(b,c),this._rx=b;return}var e=this,f=i(),g=a.easing.easeOutQuad,h=this._rx,j=0,k=b-h,l=0,m,n,o;this._rx=b,m=function(){n=i()-f,n>=d?(e._timerID=0,e._setScrollPosition(b,c),e._$clip.trigger("scrollend")):(o=g(n/d,n,0,1,d),e._setScrollPosition(h+k*o,j+l*o),e._timerID=setTimeout(m,e._timerInterval))},this._timerID=setTimeout(m,this._timerInterval)},getScrollPosition:function(){return{x:-this._rx,y:0}},_handleDragStart:function(b,c,d){a.each(this._getScrollHierarchy(),function(a,b){b._stopMScroll()}),this._stopMScroll(),this.options.delayedClickEnabled&&(this._$clickEle=a(b.target).closest(this.options.delayedClickSelector)),this._lastX=c,this._lastY=d,this._speedX=0,this._speedY=0,this._didDrag=!1,this._lastMove=0,this._enableTracking(),this._ox=c,this._nx=this._rx,(this.options.eventType=="mouse"||this.options.delayedClickEnabled)&&b.preventDefault(),b.stopPropagation()},_handleDragMove:function(a,b,c){this._lastMove=i();var d=b-this._lastX,e=c-this._lastY;return this._speedX=d,this._speedY=0,this._didDrag=!0,this._lastX=b,this._lastY=c,this._mx=b-this._ox,this._setScrollPosition(this._nx+this._mx,0),!1},_handleDragStop:function(a){var b=this._lastMove,c=i(),e=b&&c-b<=this.options.moveIntervalThreshold,f=this._tracker&&this._speedX&&e?this._speedX:0,g=0;return this._rx=this._mx?this._nx+this._mx:this._rx,f&&this._startMScroll(f,g),this._disableTracking(),!this._didDrag&&this.options.delayedClickEnabled&&this._$clickEle.length&&this._$clickEle.trigger("mousedown").trigger("mouseup").trigger("click"),this._didDrag&&(a.preventDefault(),a.stopPropagation()),this._didDrag?!1:d},_addBehaviors:function(){var a=this;this.options.eventType==="mouse"?(this._dragStartEvt="mousedown",this._dragStartCB=function(b){return a._handleDragStart(b,b.clientX,b.clientY)},this._dragMoveEvt="mousemove",this._dragMoveCB=function(b){return a._handleDragMove(b,b.clientX,b.clientY)},this._dragStopEvt="mouseup",this._dragStopCB=function(b){return a._handleDragStop(b)},this._$view.bind("vclick",function(b){return!a._didDrag})):(this._dragStartEvt="touchstart",this._dragStartCB=function(b){var c=b.originalEvent.targetTouches[0];return a._handleDragStart(b,c.pageX,c.pageY)},this._dragMoveEvt="touchmove",this._dragMoveCB=function(b){var c=b.originalEvent.targetTouches[0];return a._handleDragMove(b,c.pageX,c.pageY)},this._dragStopEvt="touchend",this._dragStopCB=function(b){return a._handleDragStop(b)}),this._$view.bind(this._dragStartEvt,this._dragStartCB)}}),a(c).bind("pagecreate create",function(b){a(a.mobile.circularview.prototype.options.initSelector,b.target).circularview()})}(jQuery,window,document),function(a,b){a(document).bind("pagecreate create",function(b){a(":jqmData(role='label')",b.target).not(":jqmData(role='none'), :jqmData(role='nojs')").each(function(){a(this).addClass("jquery-mobile-ui-label").html(a("<span>",{"class":"jquery-mobile-ui-label-text"}).text(a(this).text()))})})}(jQuery),ensureNS("jQuery.mobile.tizen.clrlib"),jQuery.extend(jQuery.mobile.tizen.clrlib,{nearestInt:function(a){var b=Math.floor(a);return a-b>.5?b+1:b},HTMLToRGB:function(a){return a="#"==a.charAt(0)?a.substring(1):a,[a.substring(0,2),a.substring(2,4),a.substring(4,6)].map(function(a){return parseInt(a,16)/255})},RGBToHTML:function(a){return"#"+a.map(function(a){var b=a*255,c=Math.floor(b);return b=b-c>.5?c+1:c,b=(b<16?"0":"")+(b&255).toString(16),b}).join("")},HSLToRGB:function(a){var b=a[0]/360,c=a[1],d=a[2];if(0===c)return[d,d,d];var e=d<.5?d*(1+c):d+c-d*c,f=2*d-e,g={r:b+1/3,g:b,b:b-1/3};return g.r=g.r<0?g.r+1:g.r>1?g.r-1:g.r,g.g=g.g<0?g.g+1:g.g>1?g.g-1:g.g,g.b=g.b<0?g.b+1:g.b>1?g.b-1:g.b,ret=[6*g.r<1?f+(e-f)*6*g.r:2*g.r<1?e:3*g.r<2?f+(e-f)*(2/3-g.r)*6:f,6*g.g<1?f+(e-f)*6*g.g:2*g.g<1?e:3*g.g<2?f+(e-f)*(2/3-g.g)*6:f,6*g.b<1?f+(e-f)*6*g.b:2*g.b<1?e:3*g.b<2?f+(e-f)*(2/3-g.b)*6:f],ret},HSVToRGB:function(a){return $.mobile.tizen.clrlib.HSLToRGB($.mobile.tizen.clrlib.HSVToHSL(a))},RGBToHSV:function(a){var b,c,d,e,f,g,h=a[0],i=a[1],j=a[2];return b=Math.min(h,Math.min(i,j)),c=Math.max(h,Math.max(i,j)),d=c-b,e=0,f=0,g=c,d>1e-5&&(f=d/c,h===c?e=(i-j)/d:i===c?e=2+(j-h)/d:e=4+(h-i)/d,e*=60,e<0&&(e+=360)),[e,f,g]},HSVToHSL:function(a){var b=a[2],c=a[1]*b,d=b-c,e=b+d,f=e/2,g=f<.5?e:2-b-d;return[a[0],0==g?0:c/g,f]},RGBToHSL:function(a){return $.mobile.tizen.clrlib.HSVToHSL($.mobile.tizen.clrlib.RGBToHSV(a))}}),function(a,b,c){a.mobile.defaultPageTransition="none",a.mobile.transitionHandlers.depth=a.mobile.transitionHandlers.simultaneous,a.mobile.transitionFallbacks.depth="fade",a.fn.buttonMarkup.defaults.corners=!1,a.mobile.buttonMarkup.hoverDelay=0}(jQuery,this),ensureNS("jQuery.mobile.tizen"),function(){jQuery.extend(jQuery.mobile.tizen,{disableSelection:function(a){var b=this;return $(a).find("*").each(function(){$(this).get(0).tagName!=="INPUT"&&$(this).attr("type")!=="text"&&$(this).get(0).tagName!=="TEXTAREA"&&b.enableSelection(this,"none")}),!0},enableSelection:function(a,b){return $(a).each(function(){switch(b){case"text":case"auto":case"none":val=b;break;default:val="auto"}$(this).css({"user-select":val,"-moz-user-select":val,"-webkit-user-select":val,"-o-user-select":val,"-ms-transform":val})})},disableContextMenu:function(a){var b=this;$(a).find("*").each(function(){$(this).get(0).tagName!=="INPUT"&&$(this).attr("type")!=="text"&&$(this).get(0).tagName!=="TEXTAREA"&&b._disableContextMenu(this)})},_disableContextMenu:function(a){$(a).each(function(){$(this).bind("contextmenu",function(a){return!1})})},enableContextMenu:function(a){$(a).each(function(){$(this).unbind("contextmenu")})},documentRelativeCoordsFromEvent:function(a){var b=a?a:window.event,c={x:b.clientX,y:b.clientY},d={x:b.pageX,y:b.pageY},e=0,f=0;b.type.match(/^touch/)&&(d={x:b.originalEvent.targetTouches[0].pageX,y:b.originalEvent.targetTouches[0].pageY},c={x:b.originalEvent.targetTouches[0].clientX,y:b.originalEvent.targetTouches[0].clientY});if(d.x||d.y)e=d.x,f=d.y;else if(c.x||c.y)e=c.x+document.body.scrollLeft+document.documentElement.scrollLeft,f=c.y+document.body.scrollTop+document.documentElement.scrollTop;return{x:e,y:f}},targetRelativeCoordsFromEvent:function(a){var b={x:a.offsetX,y:a.offsetY};if(b.x===undefined||isNaN(b.x)||b.y===undefined||isNaN(b.y)){var c=$(a.target).offset();b=$.mobile.tizen.documentRelativeCoordsFromEvent(a),b.x-=c.left,b.y-=c.top}return b}})}(),function(a,b){ensureNS("jQuery.mobile.tizen"),jQuery.extend(jQuery.mobile.tizen,{_widgetPrototypes:{},loadPrototype:function(c,d){function h(a){return a.replace(/\$\{FRAMEWORK_ROOT\}/g,g)}function i(a,b){var c;for(var d in a)typeof a[d]=="string"?(c=a[d],a[d]=b.find(a[d]),c.substring(0,1)==="#"&&a[d].removeAttr("id")):typeof a[d]=="object"&&(a[d]=i(a[d],b));return a}var e=b,f=a("script[data-framework-version][data-framework-root][data-framework-theme]"),g=f.attr("data-framework-root")+"/"+f.attr("data-framework-version")+"/";if(typeof c=="string"){e=a.mobile.tizen._widgetPrototypes[c];if(e===b){var j=g+"proto-html"+"/"+f.attr("data-framework-theme");a.ajax({url:j+"/"+c+".prototype.html",async:!1,dataType:"html"}).success(function(b,d,f){a.mobile.tizen._widgetPrototypes[c]=a("<div>").html(h(b)),e=a.mobile.tizen._widgetPrototypes[c].clone()})}}else c.key!==b&&(e=a.mobile.tizen._widgetPrototypes[c.key]),e===b?c.proto!==b&&(e=a("<div>").html(h(c.proto)),c.key!==b&&(a.mobile.tizen._widgetPrototypes[c.key]=e.clone())):e=e.clone();return e!=b&&d!=b&&(e=i(d,e)),e}})}(jQuery),function(a,b,c,d){function e(c){var d=a(c),e=d.children(".ui-content"),f=d.children(".ui-header").outerHeight()||0,g=d.children(".ui-footer").outerHeight()||0,h=parseFloat(e.css("padding-top")),i=parseFloat(e.css("padding-bottom")),j=a(b).height();e.height(j-(f+g)-(h+i))}function f(b){this.options=a.extend({},b),this.easing="easeOutQuad",this.reset()}function h(){return Date.now()}var g={scrolling:0,overshot:1,snapback:2,done:3};jQuery.widget("tizen.scrollview",jQuery.mobile.widget,{options:{direction:null,timerInterval:10,scrollDuration:1e3,overshootDuration:250,snapbackDuration:500,moveThreshold:30,moveIntervalThreshold:150,scrollMethod:"translate",startEventName:"scrollstart",updateEventName:"scrollupdate",stopEventName:"scrollstop",eventType:a.support.touch?"touch":"mouse",showScrollBars:!0,overshootEnable:!1,outerScrollEnable:!0,overflowEnable:!0,scrollJump:!1},_getViewHeight:function(){return this._$view.height()},_makePositioned:function(a){a.css("position")==="static"&&a.css("position","relative")},_create:function(){var b,c=this;this._$clip=a(this.element).addClass("ui-scrollview-clip"),this._$clip.children(".ui-scrollview-view").length?this._$view=this._$clip.children(".ui-scrollview-view"):this._$view=this._$clip.wrapInner("<div></div>").children().addClass("ui-scrollview-view"),this.options.scrollMethod==="translate"&&this._$view.css("transform")===d&&(this.options.scrollMethod="position"),this._$clip.css("overflow","hidden"),this._makePositioned(this._$clip),this._makePositioned(this._$view),this._$view.css({left:0,top:0}),this._view_height=this._getViewHeight(),this._sx=0,this._sy=0,b=this.options.direction,this._hTracker=b!=="y"?new f(this.options):null,this._vTracker=b!=="x"?new f(this.options):null,this._timerInterval=this.options.timerInterval,this._timerID=0,this._timerCB=function(){c._handleMomentumScroll()},this._add_event(),this._add_scrollbar(),this._add_scroll_jump(),this._add_overflow_indicator()},_startMScroll:function(a,b){var c=!1,d=this.options.scrollDuration,e=this._hTracker,f=this._vTracker,g,h;this._$clip.trigger(this.options.startEventName);if(e){g=this._$clip.width(),h=this._$view.width();if((this._sx===0&&a>0||this._sx===-(h-g)&&a<0)&&h>g)return;e.start(this._sx,a,d,h>g?-(h-g):0,0),c=!e.done()}if(f){g=this._$clip.height(),h=this._getViewHeight();if((this._sy===0&&b>0||this._sy===-(h-g)&&b<0)&&h>g)return;f.start(this._sy,b,d,h>g?-(h-g):0,0),c=c||!f.done()}c?this._timerID=setTimeout(this._timerCB,this._timerInterval):this._stopMScroll()},_stopMScroll:function(){this._timerID&&(this._$clip.trigger(this.options.stopEventName),clearTimeout(this._timerID)),this._timerID=0,this._vTracker&&this._vTracker.reset(),this._hTracker&&this._hTracker.reset(),this._hideScrollBars(),this._hideOverflowIndicator()},_handleMomentumScroll:function(){var a=!1,b=0,c=0,d=0,e=this,f=function(a){setTimeout(function(){e._effect_dir=a,e._setEndEffect("in")},100),setTimeout(function(){e._setEndEffect("out")},350)},g=this._vTracker,h=this._hTracker;if(this._outerScrolling)return;g&&(g.update(this.options.overshootEnable),c=g.getPosition(),a=!g.done(),g.getRemained()>this.options.overshootDuration&&(d=this._getViewHeight()-this._$clip.height(),g.isAvail()?g.isMin()?(this._outerScroll(c-g.getRemained()/3,d),d>0&&f(1)):g.isMax()&&(this._outerScroll(g.getRemained()/3,d),d>0&&f(0)):this._speedY>0?this._outerScroll(g.getRemained()/3,d):this._outerScroll(c-g.getRemained()/3,d))),h&&(h.update(this.options.overshootEnable),b=h.getPosition(),a=a||!h.done()),this._setScrollPosition(b,c),this._$clip.trigger(this.options.updateEventName,[{x:b,y:c}]),a?this._timerID=setTimeout(this._timerCB,this._timerInterval):this._stopMScroll()},_setElementTransform:function(b,c,e,f){var g,h;!f||f===d?h="none":h="-webkit-transform "+f/1e3+"s ease-out",a.support.cssTransform3d?g="translate3d("+c+","+e+", 0px)":g="translate("+c+","+e+")",b.css({"-moz-transform":g,"-webkit-transform":g,"-ms-transform":g,"-o-transform":g,transform:g,"-webkit-transition":h})},_setEndEffect:function(a){var b=this._getViewHeight()-this._$clip.height();if(this._softkeyboard){this._effect_dir?this._outerScroll(-b-this._softkeyboardHeight,b):this._outerScroll(this._softkeyboardHeight,b);return}if(a==="in"){if(this._endEffect)return;this._endEffect=!0,this._setOverflowIndicator(this._effect_dir),this._showOverflowIndicator()}else if(a==="out"){if(!this._endEffect)return;this._endEffect=!1}else this._endEffect=!1,this._setOverflowIndicator(),this._showOverflowIndicator()},_setCalibration:function(a,b){if(this.options.overshootEnable){this._sx=a,this._sy=b;return}var c=this._$view,d=this._$clip,e=this._directionLock,f=0,g=0;e!=="y"&&this._hTracker&&(g=c.width()-d.width(),a>=0?this._sx=0:a<-g?this._sx=-g:this._sx=a,g<0&&(this._sx=0)),e!=="x"&&this._vTracker&&(f=this._getViewHeight()-d.height(),b>0?(this._sy=0,this._didDrag&&f>0&&(this._effect_dir=0,this._setEndEffect("in"))):b<-f?(this._sy=-f,this._didDrag&&f>0&&(this._effect_dir=1,this._setEndEffect("in"))):(this._endEffect&&this._sy!==b&&this._setEndEffect(),this._sy=b),f<0&&(this._sy=0))},_setScrollPosition:function(a,b,c){var d=this._$view,e=this.options.scrollMethod,f=this._$vScrollBar,g=this._$hScrollBar,h;this._setCalibration(a,b),a=this._sx,b=this._sy,e==="translate"?this._setElementTransform(d,a+"px",b+"px",c):d.css({left:a+"px",top:b+"px"}),f&&(h=f.find(".ui-scrollbar-thumb"),e==="translate"?this._setElementTransform(h,"0px",-b/this._getViewHeight()*h.parent().height()+"px",c):h.css("top",-b/this._getViewHeight()*100+"%")),g&&(h=g.find(".ui-scrollbar-thumb"),e==="translate"?this._setElementTransform(h,-a/d.width()*h.parent().width()+"px","0px",c):h.css("left",-a/d.width()*100+"%"))},_outerScroll:function(c,e){var f=this,g=a(b).scrollTop()-b.screenTop,i=0,j=this.options.snapbackDuration,k=h(),l;if(!this.options.outerScrollEnable)return;if(this._$clip.jqmData("scroll")!=="y")return;if(this._outerScrolling)return;if(c>0)i=b.screenTop?b.screenTop:-c;else{if(!(c<-e))return;i=-c-e}l=function(){var c=h()-k;c>=j?(b.scrollTo(0,g+i),f._outerScrolling=d,f._stopMScroll()):(ec=a.easing.easeOutQuad(c/j,c,0,1,j),b.scrollTo(0,g+i*ec),f._outerScrolling=setTimeout(l,f._timerInterval))},this._outerScrolling=setTimeout(l,f._timerInterval)},_scrollTo:function(b,c,d){var e=this,f=h(),g=a.easing.easeOutQuad,i=this._sx,j=this._sy,k=b-i,l=c-j,m;b=-b,c=-c,m=function(){var a=h()-f,n;a>=d?(e._timerID=0,e._setScrollPosition(b,c)):(n=g(a/d,a,0,1,d),e._setScrollPosition(i+k*n,j+l*n),e._timerID=setTimeout(m,e._timerInterval))},this._timerID=setTimeout(m,this._timerInterval)},scrollTo:function(a,b,c){this._stopMScroll(),!c||this.options.scrollMethod==="translate"?this._setScrollPosition(a,b,c):this._scrollTo(a,b,c)},getScrollPosition:function(){return{x:-this._sx,y:-this._sy}},_getScrollHierarchy:function(){var b=[],c;return this._$clip.parents(".ui-scrollview-clip").each(function(){c=a(this).jqmData("scrollview"),c&&b.unshift(c)}),b},_getAncestorByDirection:function(a){var b=this._getScrollHierarchy(),c=b.length,d,e;while(0<c--){d=b[c],e=d.options.direction;if(!e||e===a)return d}return null},_handleDragStart:function(b,c,d){this._stopMScroll(),this._didDrag=!1,this._skip_dragging=!1;var e=a(b.target),f=this,g=this._$clip,h=this.options.direction;this._is_button=e.is(".ui-btn")||e.is(".ui-btn-text")||e.is(".ui-btn-inner")||e.is(".ui-btn-inner .ui-icon");if(e.parents(".ui-slider").length||e.is(".ui-slider")){this._skip_dragging=!0;return}this._is_inputbox=e.is(":input")||e.parents(":input").length>0,this._is_inputbox&&e.one("resize.scrollview",function(){d>g.height()&&f.scrollTo(-c,f._sy-d+g.height(),f.options.snapbackDuration)}),this.options.eventType==="mouse"&&!this._is_inputbox&&!this._is_button&&b.preventDefault(),this._lastX=c,this._lastY=d,this._startY=d,this._doSnapBackX=!1,this._doSnapBackY=!1,this._speedX=0,this._speedY=0,this._directionLock="",this._lastMove=0,this._enableTracking(),this._set_scrollbar_size()},_propagateDragMove:function(a,b,c,d,e){this._hideScrollBars(),this._hideOverflowIndicator(),this._disableTracking(),a._handleDragStart(b,c,d),a._directionLock=e,a._didDrag=this._didDrag},_handleDragMove:function(a,b,c){if(this._skip_dragging)return;if(!this._dragging)return;!this._is_inputbox&&!this._is_button&&a.preventDefault();var d=this.options.moveThreshold,e=b-this._lastX,f=c-this._lastY,g=this.options.direction,i=null,j,k,l,m,n,o,p;this._lastMove=h();if(!this._directionLock){j=Math.abs(e),k=Math.abs(f);if(j<d&&k<d)return!1;j<k&&j/k<.5?i="y":j>k&&k/j<.5&&(i="x");if(g&&i&&g!==i){l=this._getAncestorByDirection(i);if(l)return this._propagateDragMove(l,a,b,c,i),!1}this._directionLock=g||i||"none"}n=this._sx,o=this._sy,p=this._directionLock;if(p!=="y"&&this._hTracker){j=this._sx,this._speedX=e,n=j+e,this._doSnapBackX=!1,m=n>0||n<this._maxX;if(m&&p==="x"){l=this._getAncestorByDirection("x");if(l)return this._setScrollPosition(n>0?0:this._maxX,o),this._propagateDragMove(l,a,b,c,i),!1;n=j+e/2,this._doSnapBackX=!0}}if(p!=="x"&&this._vTracker){if(Math.abs(this._startY-c)<d&&p!=="xy")return;k=this._sy,this._speedY=f,o=k+f,this._doSnapBackY=!1,m=o>0||o<this._maxY;if(m&&p==="y"){l=this._getAncestorByDirection("y");if(l)return this._setScrollPosition(n,o>0?0:this._maxY),this._propagateDragMove(l,a,b,c,i),!1;o=k+f/2,this._doSnapBackY=!0}}this.options.overshootEnable===!1&&(this._doSnapBackX=!1,this._doSnapBackY=!1),this._lastX=b,this._lastY=c,this._setScrollPosition(n,o),this._didDrag===!1&&(this._didDrag=!0,this._showScrollBars(),this._showOverflowIndicator())},_handleDragStop:function(a){var b=this;if(this._skip_dragging)return;var c=this._lastMove,d=h(),e=c&&d-c<=this.options.moveIntervalThreshold,f=this._hTracker&&this._speedX&&e?this._speedX:this._doSnapBackX?1:0,g=this._vTracker&&this._speedY&&e?this._speedY:this._doSnapBackY?1:0,i=this.options.direction,j,k;return f||g?this._setGestureScroll(f,g)||this._startMScroll(f,g):(this._hideScrollBars(),this._hideOverflowIndicator()),this._disableTracking(),this._endEffect&&setTimeout(function(){b._setEndEffect("out"),b._hideScrollBars(),b._hideOverflowIndicator()},300),!this._didDrag},_setGestureScroll:function(a,b){var c=this,e=function(){clearTimeout(c._gesture_timer),c._gesture_dir=0,c._gesture_count=0,c._gesture_timer=d};return b?(dir=b>0?1:-1,this._gesture_timer?this._gesture_dir!==dir?(e(),!1):(this._gesture_count++,this._gesture_count===3?(dir>0?this.scrollTo(0,0,this.options.overshootDuration):this.scrollTo(0,-(this._getViewHeight()-this._$clip.height()),this.options.overshootDuration),e(),!0):!1):(this._gesture_count=1,this._gesture_dir=dir,this._gesture_timer=setTimeout(function(){e()},1e3),!1)):!1},_enableTracking:function(){this._dragging=!0},_disableTracking:function(){this._dragging=!1},_showScrollBars:function(a){var b="ui-scrollbar-visible",c=this;if(!this.options.showScrollBars)return;if(this._scrollbar_showed)return;this._$vScrollBar&&this._$vScrollBar.addClass(b),this._$hScrollBar&&this._$hScrollBar.addClass(b),this._scrollbar_showed=!0,a&&setTimeout(function(){c._hideScrollBars()},a)},_hideScrollBars:function(){var a="ui-scrollbar-visible";if(!this.options.showScrollBars)return;if(!this._scrollbar_showed)return;this._$vScrollBar&&this._$vScrollBar.removeClass(a),this._$hScrollBar&&this._$hScrollBar.removeClass(a),this._scrollbar_showed=!1},_setOverflowIndicator:function(a){a===1?(this._opacity_top="0",this._opacity_bottom="0.8"):a===0?(this._opacity_top="0.8",this._opacity_bottom="0"):(this._opacity_top="0.5",this._opacity_bottom="0.5")},_showOverflowIndicator:function(){if(!this.options.overflowEnable||!this._overflowAvail||this._softkeyboard)return;this._overflow_top.animate({opacity:this._opacity_top},300),this._overflow_bottom.animate({opacity:this._opacity_bottom},300),this._overflow_showed=!0},_hideOverflowIndicator:function(){if(!this.options.overflowEnable||!this._overflowAvail||this._softkeyboard)return;if(this._overflow_showed===!1)return;this._overflow_top.animate({opacity:0},300),this._overflow_bottom.animate({opacity:0},300),this._overflow_showed=!1,this._setOverflowIndicator()},_add_event:function(){var c=this,e=this._$clip,f=this._$view;this.options.eventType==="mouse"?(this._dragEvt="mousedown mousemove mouseup click mousewheel",this._dragCB=function(a){switch(a.type){case"mousedown":return c._handleDragStart(a,a.clientX,a.clientY);case"mousemove":return c._handleDragMove(a,a.clientX,a.clientY);case"mouseup":return c._handleDragStop(a);case"click":return!c._didDrag;case"mousewheel":var b=c.getScrollPosition();c.scrollTo(-b.x,-(b.y-a.originalEvent.wheelDelta))}}):(this._dragEvt="touchstart touchmove touchend click",this._dragCB=function(a){var b=a.originalEvent.touches;switch(a.type){case"touchstart":if(b.length!=1)return;return c._handleDragStart(a,b[0].pageX,b[0].pageY);case"touchmove":if(b.length!=1)return;return c._handleDragMove(a,b[0].pageX,b[0].pageY);case"touchend":if(b.length!=0)return;return c._handleDragStop(a);case"click":return!c._didDrag}}),f.bind(this._dragEvt,this._dragCB),f.bind("keydown",function(a){var b,f,g;if(a.keyCode==9)return!1;b=e.find(".ui-focus");if(b===d)return;f=b.offset().top,g=e.offset().top+e.height()-b.height(),c._softkeyboard&&(g-=c._softkeyboardHeight),(f<0||f>g)&&c.scrollTo(0,c._sy-f+b.height()+e.offset().top,0);return}),f.bind("keyup",function(b){var d,f,g,h;if(b.keyCode!=9)return;d=a(this).find(":input");for(i=0;i<d.length;i++){if(!a(d[i]).hasClass("ui-focus"))continue;i+1==d.length?f=a(d[0]):f=a(d[i+1]),g=f.offset().top,h=e.offset().top+e.height()-f.height(),c._softkeyboard&&(h-=c._softkeyboardHeight),(g<0||g>h)&&c.scrollTo(0,c._sy-g+f.height()+e.offset().top,0),f.focus();break}return!1}),e.bind("updatelayout",function(a){var b,d,f=c._getViewHeight();if(!e.height()||!f){c.scrollTo(0,0,0);return}b=e.height()-f,d=f-c._view_height,c._view_height=f;if(d==0||d>e.height()/2)return;b>0?c.scrollTo(0,0,0):c._sy-b<=-d?c.scrollTo(0,c._sy,c.options.snapbackDuration):c._sy-b<=d+c.options.moveThreshold&&c.scrollTo(0,b,c.options.snapbackDuration)}),a(b).bind("resize",function(b){var d,f=c._getViewHeight();if(a(".ui-page-active").get(0)!==e.closest(".ui-page").get(0))return;if(!e.height()||!f)return;d=e.find(".ui-focus"),d&&d.trigger("resize.scrollview"),setTimeout(function(){c._sy<e.height()-c._getViewHeight()&&c.scrollTo(0,e.height()-c._getViewHeight(),c.options.overshootDuration)},260),c._view_height=f}),a(b).bind("vmouseout",function(d){var f=!1;if(a(".ui-page-active").get(0)!==e.closest(".ui-page").get(0))return;if(!c._dragging)return;if(d.pageX<0||d.pageX>a(b).width())f=!0;if(d.pageY<0||d.pageY>a(b).height())f=!0;f&&(c._hideScrollBars(),c._hideOverflowIndicator(),c._disableTracking())}),this._softkeyboard=!1,this._softkeyboardHeight=0,b.addEventListener("softkeyboardchange",function(b){if(a(".ui-page-active").get(0)!==e.closest(".ui-page").get(0))return;c._softkeyboard=b.state==="on"?!0:!1,c._softkeyboardHeight=b.height}),e.closest(".ui-page").bind("pageshow",function(a){setTimeout(function(){c._view_height=c._getViewHeight(),c._set_scrollbar_size(),c._setScrollPosition(c._sx,c._sy),c._showScrollBars(2e3)},0)})},_add_scrollbar:function(){var a=this._$clip,b='<div class="ui-scrollbar ui-scrollbar-',c='"><div class="ui-scrollbar-track"><div class="ui-scrollbar-thumb"></div></div></div>';if(!this.options.showScrollBars)return;this._vTracker&&(a.append(b+"y"+c),this._$vScrollBar=a.children(".ui-scrollbar-y")),this._hTracker&&(a.append(b+"x"+c),this._$hScrollBar=a.children(".ui-scrollbar-x")),this._scrollbar_showed=!1},_add_scroll_jump:function(){var b=this._$clip,c=this,d,e;if(!this.options.scrollJump)return;this._vTracker&&(d=a('<div class="ui-scroll-jump-top-bg"><div data-role="button" data-inline="true" data-icon="scrolltop" data-style="box"></div></div>'),b.append(d).trigger("create"),d.bind("vclick",function(){c.scrollTo(0,0,c.options.overshootDuration)})),this._hTracker&&(e=a('<div class="ui-scroll-jump-left-bg"><div data-role="button" data-inline="true" data-icon="scrollleft" data-style="box"></div></div>'),b.append(e).trigger("create"),e.bind("vclick",function(){c.scrollTo(0,0,c.options.overshootDuration)}))},_add_overflow_indicator:function(){if(!this.options.overflowEnable)return;this._overflow_top=a('<div class="ui-overflow-indicator-top"></div>'),this._overflow_bottom=a('<div class="ui-overflow-indicator-bottom"></div>'),this._$clip.append(this._overflow_top),this._$clip.append(this._overflow_bottom),this._opacity_top="0.5",this._opacity_bottom="0.5",this._overflow_showed=!1},_set_scrollbar_size:function(){var a=this._$clip,b=this._$view,c=0,d=0,e=0,f=0,g;if(!this.options.showScrollBars)return;this._hTracker&&(c=a.width(),d=b.width(),this._maxX=c-d,this._maxX>0&&(this._maxX=0),this._$hScrollBar&&d&&(g=this._$hScrollBar.find(".ui-scrollbar-thumb"),g.css("width",c>=d?"0":(Math.floor(c/d*100)||1)+"%"))),this._vTracker&&(e=a.height(),f=this._getViewHeight(),this._maxY=e-f,this._maxY>0&&(this._maxY=0),this._$vScrollBar&&f&&(g=this._$vScrollBar.find(".ui-scrollbar-thumb"),g.css("height",e>=f?"0":(Math.floor(e/f*100)||1)+"%"),this._overflowAvail=!!g.height()))}}),a.extend(f.prototype,{start:function(a,b,c,d,e){var f=a<d||a>e?g.snapback:g.scrolling,i;this.state=b!==0?f:g.done,this.pos=a,this.speed=b,this.duration=this.state===g.snapback?this.options.snapbackDuration
-:c,this.minPos=d,this.maxPos=e,this.fromPos=this.state===g.snapback?this.pos:0,i=this.pos<this.minPos?this.minPos:this.maxPos,this.toPos=this.state===g.snapback?i:0,this.startTime=h()},reset:function(){this.state=g.done,this.pos=0,this.speed=0,this.minPos=0,this.maxPos=0,this.duration=0,this.remained=0},update:function(b){var c=this.state,d=h(),e=this.duration,f=d-this.startTime,i,j,k;return c===g.done?this.pos:(f=f>e?e:f,this.remained=e-f,c===g.scrolling||c===g.overshot?(i=this.speed*(1-a.easing[this.easing](f/e,f,0,1,e)),j=this.pos+i,k=c===g.scrolling&&(j<this.minPos||j>this.maxPos),k&&(j=j<this.minPos?this.minPos:this.maxPos),this.pos=j,c===g.overshot?(b||(this.state=g.done),f>=e&&(this.state=g.snapback,this.fromPos=this.pos,this.toPos=j<this.minPos?this.minPos:this.maxPos,this.duration=this.options.snapbackDuration,this.startTime=d,f=0)):c===g.scrolling&&(k&&b?(this.state=g.overshot,this.speed=i/2,this.duration=this.options.overshootDuration,this.startTime=d):f>=e&&(this.state=g.done))):c===g.snapback&&(f>=e?(this.pos=this.toPos,this.state=g.done):this.pos=this.fromPos+(this.toPos-this.fromPos)*a.easing[this.easing](f/e,f,0,1,e)),this.pos)},done:function(){return this.state===g.done},isMin:function(){return this.pos===this.minPos},isMax:function(){return this.pos===this.maxPos},isAvail:function(){return this.minPos!==this.maxPos},getRemained:function(){return this.remained},getPosition:function(){return this.pos}}),a(c).bind("pagecreate create",function(b){var c=a(b.target),e=c.find(".ui-content").jqmData("scroll");a.support.scrollview===d&&(a.support.scrollview=!0),a.support.scrollview===!0&&e===d&&(e="y"),e!=="y"&&(e="none"),c.find(".ui-content").attr("data-scroll",e),c.find(":jqmData(scroll)").not(".ui-scrollview-clip").each(function(){if(a(this).hasClass("ui-scrolllistview"))a(this).scrolllistview();else{var b=a(this).jqmData("scroll"),c=b&&b.search(/^[xy]/)!==-1?b:null,e=a(this).hasClass("ui-content"),f;if(b==="none")return;f={direction:c||d,overflowEnable:e,scrollMethod:a(this).jqmData("scroll-method")||d,scrollJump:a(this).jqmData("scroll-jump")||d},a(this).scrollview(f)}})}),a(c).bind("pageshow",function(b){var c=a(b.target),d=c.find(".ui-content").jqmData("scroll");d==="y"&&e(b.target)})}(jQuery,window,document),function(a,b,c){a.widget("tizen.datetimepicker",a.tizen.widgetex,{options:{type:null,format:null,date:null,initSelector:"input[type='date'], input[type='datetime'], input[type='time'], :jqmData(role='datetimepicker')"},_calendar:function(){return b.Globalize.culture().calendars.standard},_value:{attr:"data-"+(a.mobile.ns||"")+"date",signal:"date-changed"},_daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],_isLeapYear:function(a){return a%4?0:a%100?1:a%400?0:1},_makeTwoDigits:function(a){var b=a.toString(10);return a<10&&(b="0"+b),b},_setType:function(b){switch(b){case"datetime":case"date":case"time":this.options.type=b;break;default:this.options.type="datetime"}return this.element.attr("data-"+(a.mobile.ns?a.mobile.ns+"-":"")+"type",this.options.type),this.options.type},_setFormat:function(b){if(this.options.format==b)return;this.options.format=b,this.ui.children().remove();var c=this._parsePattern(b),d=document.createElement("div"),e,f,g,h,i=this;while(c.length>0){e=c.shift(),f='<span class="ui-datefield-%1" data-pat="'+e+'">%2</span>';switch(e){case"H":case"HH":case"h":case"hh":a(d).append(f.replace("%1","hour"));break;case"mm":case"m":this.options.type=="date"?a(d).append(f.replace("%1","month")):a(d).append(f.replace("%1","min"));break;case"ss":case"s":a(d).append(f.replace("%1","sec"));break;case"d":case"dd":a(d).append(f.replace("%1","day"));break;case"M":case"MM":case"MMM":case"MMMM":a(d).append(f.replace("%1","month"));break;case"yy":case"yyyy":a(d).append(f.replace("%1","year"));break;case"t":case"tt":h='<a href="#" class="ui-datefield-period" data-role="button" data-inline="true">period</a>',a(d).append(h);break;case"g":case"gg":a(d).append(f.replace("%1","era").replace("%2",this._calendar().eras.name));break;case"\t":a(d).append(f.replace("%1","tab").replace("%2",e));break;default:a(d).append(f.replace("%1","seperator").replace("%2",e))}}return this.ui.append(d),this.options.date&&this._setDate(this.options.date),this.ui.find(".ui-datefield-period").buttonMarkup().bind("vclick",function(a){i._switchAmPm(i)}),this.element.attr("data-"+(a.mobile.ns?a.mobile.ns+"-":"")+"format",this.options.format),this.options.format},_setDate:function(b){function i(){return b.getMonth()+1}typeof b=="string"&&(b=new Date(b));var c=a("span,a",this.ui),d,e,f,g,h;for(h=0;h<c.length;h++){f=a(c[h]),d=f.attr("class").match(/ui-datefield-([\w]*)/),d||(d="");switch(d[1]){case"hour":e=b.getHours;break;case"min":e=b.getMinutes;break;case"sec":e=b.getSeconds;break;case"year":e=b.getFullYear;break;case"month":e=i;break;case"day":e=b.getDate;break;case"period":e=b.getHours()<12?this._calendar().AM[0]:this._calendar().PM[0],g=f.find(".ui-btn-text"),g.length==0?f.text(e):g.text()!=e&&g.text(e),e=null;break;default:e=null}e&&this._updateField(f,e.call(b))}return this.options.date=b,this._setValue(b),this.element.attr("data-"+(a.mobile.ns?a.mobile.ns+"-":"")+"date",this.options.date),this.options.date},destroy:function(){this.ui&&this.ui.remove(),this.element&&this.element.show()},value:function(a){function b(a,b){return b._makeTwoDigits(a.getHours())+":"+b._makeTwoDigits(a.getMinutes())+":"+b._makeTwoDigits(a.getSeconds())}function c(a,b){return(a.getFullYear()%1e4+1e4).toString().substr(1)+"-"+b._makeTwoDigits(a.getMonth()+1)+"-"+b._makeTwoDigits(a.getDate())}var d=null;if(a)d=this._setDate(a);else switch(this.options.type){case"time":d=b(this.options.date,this);break;case"date":d=c(this.options.date,this);break;default:d=c(this.options.date,this)+"T"+b(this.options.date,this)}return d},setValue:function(a){return console.warn("setValue was deprecated. use datetimepicker('option', 'date', value) instead."),this.value(a)},getValue:function(){return console.warn("getValue() was deprecated. use datetimepicker('value') instead."),this.value()},_updateField:function(a,b){if(!a||a.length==0)return;b==0&&(b="0");var c=a.jqmData("pat"),d,e,f=this;switch(c){case"H":case"HH":case"h":case"hh":d=b,c.charAt(0)=="h"&&(d>12?d-=12:d==0&&(d=12)),d=this._makeTwoDigits(d),e=d;break;case"m":case"M":case"d":case"s":e=b;break;case"mm":case"dd":case"MM":case"ss":e=this._makeTwoDigits(b);break;case"MMM":e=this._calendar().months.namesAbbr[b-1];break;case"MMMM":e=this._calendar().months.names[b-1];break;case"yy":e=this._makeTwoDigits(b%100);break;case"yyyy":b<10?b="000"+b:b<100?b="00"+b:b<1e3&&(b="0"+b),e=b}a.text()!=e&&(a.hasClass("ui-datefield-selected")?(a.addClass("out"),this._new_value=e,a.animationComplete(function(){a.text(f._new_value),a.addClass("in").removeClass("out"),a.animationComplete(function(){a.removeClass("in").removeClass("ui-datefield-selected")})})):a.text(e))},_switchAmPm:function(a){if(this._calendar().AM!=null){var b=new Date(this.options.date),c,d=432e5;b.getHours()>11&&(d=-d),b.setTime(b.getTime()+d),this._setDate(b)}},_parsePattern:function(a){var b=/\/|\s|dd|d|MMMM|MMM|MM|M|yyyy|yy|y|hh|h|HH|H|mm|m|ss|s|tt|t|f|gg|g|\'[\w\W]*\'$|[\w\W]/g,c,d;c=a.match(b);for(d=0;d<c.length;d++)c[d].charAt(0)=="'"&&(c[d]=c[d].substr(1,c[d].length-2));return c},changeTypeFormat:function(a,b){console.warn('changeTypeFormat() was deprecated. use datetimepicker("option", "type"|"format", value) instead'),a&&this._setType(a),b&&this._setFormat(b)},_create:function(){var b=this;this.element.is("input")&&function(a){var b,c,d;b=a.element.get(0).getAttribute("type"),a.options.type=b,c=a.element.get(0).getAttribute("value"),c&&(a.options.date=new Date(c))}(this);if(!this.options.format)switch(this.options.type){case"datetime":this.options.format=this._calendar().patterns.d+"\t"+this._calendar().patterns.t;break;case"date":this.options.format=this._calendar().patterns.d;break;case"time":this.options.format=this._calendar().patterns.t}this.options.date||(this.options.date=new Date),this.element.hide(),this.ui=a('<div class="ui-datefield"></div>'),a(this.element).after(this.ui),this._popup_open=!1,this.ui.bind("vclick",function(a){b._showDataSelector(b,this,a.target)})},_populateDataSelector:function(a,c){var d,e,f,g,h=b.range,i,j,k,l;switch(a){case"hour":c=="H"||c=="HH"?(d=h(0,23),g=h(0,23),f=this.options.date.getHours()):(d=h(1,12),f=this.options.date.getHours()-1,f>=11?(f-=12,g=h(13,23),g.push(12)):(g=h(1,11),g.push(0)),f<0&&(f=11)),c.length==2&&(d=d.map(this._makeTwoDigits)),e=d.length;break;case"min":case"sec":d=h(0,59),c.length==2&&(d=d.map(this._makeTwoDigits)),g=h(0,59),f=a=="min"?this.options.date.getMinutes():this.options.date.getSeconds(),e=d.length;break;case"year":j=1900,k=2100,g=h(j,k),f=this.options.date.getFullYear()-j,d=h(j,k),e=d.length;break;case"month":switch(c.length){case 1:d=h(1,12);break;case 2:d=h(1,12).map(this._makeTwoDigits);break;case 3:d=this._calendar().months.namesAbbr.slice();break;case 4:d=this._calendar().months.names.slice()}d.length==13&&d[12]==""&&d.pop(),g=h(1,d.length),f=this.options.date.getMonth(),e=d.length;break;case"day":l=this._daysInMonth[this.options.date.getMonth()],l==28&&(l+=this._isLeapYear(this.options.date.getFullYear())),d=h(1,l),c.length==2&&(d=d.map(this._makeTwoDigits)),g=h(1,l),f=this.options.date.getDate()-1,e=l}return{values:d,data:g,numItems:e,current:f}},_showDataSelector:function(d,e,f){f=a(f);var g=f.attr("class"),h=g?g.match(/ui-datefield-([\w]*)/):c,i,j,k,l,m,n,o,p,q,r,s,t,u,v=10,w=this;if(!g)return;if(!h)return;if(this._popup_open)return;f.not(".ui-datefield-seperator").addClass("ui-datefield-selected"),i=f.jqmData("pat"),j=d._populateDataSelector.call(d,h[1],i),k=j.values,l=j.numItems,m=j.current,n=j.data;if(k){p="data-"+(a.mobile.ns?a.mobile.ns+"-":"")+'val="';for(u=0;u<k.length;u++)o+='<li><a class="ui-link" '+p+n[u]+'">'+k[u]+"</a></li>";q=a("<ul></ul>"),r=a('<div class="ui-datetimepicker-selector" data-transition="fade" data-fade="false"></div>'),r.append(q).appendTo(e),s=r.ctxpopup(),s.parents(".ui-popupwindow").addClass("ui-datetimepicker"),t=a(o),a(t[m]).addClass("current"),r.jqmData("list",t),r.circularview(),a(b).width()/2<f.offset().left&&(v=-10),s.popupwindow("open",f.offset().left+f.width()/2+v-b.pageXOffset,f.offset().top+f.height()-b.pageYOffset),this._popup_open=!0,r.bind("popupafterclose",function(c){d._reflow&&(a(b).unbind("resize",d._reflow),d._reflow=null),!f.hasClass("in")&&!f.hasClass("out")&&f.removeClass("ui-datefield-selected"),r.unbind("popupafterclose"),q.unbind("vclick"),a(d).unbind("update"),s.popupwindow("destroy"),r.remove(),w._popup_open=!1}),a(d).bind("update",function(a,b){var c=new Date(this.options.date),e,f=function(){c.setDate(1),c.setDate(c.getDate()-1)};switch(h[1]){case"min":c.setMinutes(b);break;case"hour":c.setHours(b);break;case"sec":c.setSeconds(b);break;case"year":e=c.getMonth(),c.setFullYear(b),c.getMonth()!=e&&f();break;case"month":c.setMonth(b-1),c.getMonth()==b&&f();break;case"day":c.setDate(b)}d._setDate(c),s.popupwindow("close")}),q.bind("click",function(b){if(a(b.target).is("a")){q.find(".current").removeClass("current"),a(b.target).parent().addClass("current");var c=a(b.target).jqmData("val");a(d).trigger("update",c)}}),r.circularview("centerTo",".current",500),r.bind("scrollend",function(c){d._reflow||(d._reflow=function(){r.circularview("reflow")},a(b).bind("resize",d._reflow))})}return e}}),a(document).bind("pagecreate create",function(b){a(a.tizen.datetimepicker.prototype.options.initSelector,b.target).not(":jqmData(role='none'), :jqmData(role='nojs')").datetimepicker()})}(jQuery,this),function(a,b){var c={};a.widget("tizen.extendablelist",a.mobile.widget,{options:{theme:"s",countTheme:"c",headerTheme:"b",dividerTheme:"b",splitIcon:"arrow-r",splitTheme:"b",inset:!1,id:"",extenditems:50,childSelector:" li",dbtable:"",template:"",loadmore:"tmp_load_more",scrollview:!1,initSelector:":jqmData(role='extendablelist')"},_stylerMouseUp:function(){a(this).addClass("ui-btn-up-s"),a(this).removeClass("ui-btn-down-s")},_stylerMouseDown:function(){a(this).addClass("ui-btn-down-s"),a(this).removeClass("ui-btn-up-s")},_stylerMouseOver:function(){a(this).toggleClass("ui-btn-hover-s")},_stylerMouseOut:function(){a(this).toggleClass("ui-btn-hover-s"),a(this).addClass("ui-btn-up-s"),a(this).removeClass("ui-btn-down-s")},_pushData:function(b){var c=this.options,d=this,e=0,f=a("#"+b),g=c.extenditems>d._numItemData-d._lastIndex?d._numItemData-d.lastIndex:c.extenditems,h;for(e=0;e<g;e++)h=f.tmpl(d._itemData(e)),a(c.id).append(a(h).attr("id","li_"+e)),a(c.id+">"+c.childSelector).addClass("ui-btn-up-s").bind("mouseup",d._stylerMouseUp).bind("mousedown",d._stylerMouseDown).bind("mouseover",d._stylerMouseOver).bind("mouseout",d._stylerMouseOut),d._lastIndex+=1;a(c.id).trigger("create")},_loadmore:function(b){var c=b.data,d=c.options,e=0,f=a("#"+d.template),g=d.extenditems>c._numItemData-c._lastIndex?c._numItemData-c._lastIndex:d.extenditems,h,i,j;a("#load_more_message").remove();for(e=0;e<g;e++)h=f.tmpl(c._itemData(c._lastIndex)),a(d.id).append(a(h).attr("id","li_"+c._lastIndex)),c._lastIndex+=1;c._numItemData>c._lastIndex&&(f=a("#"+d.loadmore),i=c._numItemData-c._lastIndex,j=d.extenditems<=i?d.extenditems:i,h=f.tmpl({NUM_MORE_ITEMS:j}),a(d.id).append(a(h).attr("id","load_more_message"))),a(d.id).trigger("create"),a(d.id).extendablelist("refresh")},recreate:function(a){this._create({itemData:function(b){return a[b]},numItemData:a.length})},_initList:function(b){var c=this,d=this.options,e,f,g,h;c._lastIndex<=0&&(c._pushData(d.template),c._numItemData>c._lastIndex?(e=a("#"+d.loadmore),f=c._numItemData-c._lastIndex,g=d.extenditems<=f?d.extenditems:f,h=e.tmpl({NUM_MORE_ITEMS:g}),a(d.id).append(a(h).attr("id","load_more_message")),a("#load_more_message").live("click",c,c._loadmore)):(a("#load_more_message").die(),a("#load_more_message").remove())),d.childSelector==" ul"&&a(d.id+" ul").swipelist(),a(d.id).trigger("create"),c.refresh(!0)},create:function(){var a=this.options;this._create.apply(this,arguments)},_create:function(b){var c=this,d=this.options,e=this.element,f;c.destroy(),a.extend(this,{_itemData:function(a){return null},_numItemData:0,_cacheItemData:function(a,b){},_lastIndex:0}),c.element.addClass(function(a,b){return b+" ui-listview ui-extendable-list-container"+(c.options.inset?" ui-listview-inset ui-corner-all ui-shadow ":"")}),d.id="#"+e.attr("id"),e.data("extenditems")&&(d.extenditems=parseInt(e.data("extenditems"),10)),a(d.id).bind("pagehide",function(b){a(d.id).empty()}),a(".ui-scrollview-clip").size()>0?d.scrollview=!0:d.scrollview=!1;if(b){if(!c._loadData(b))return}else{console.warn("WARNING: The data interface of extendable list is changed. \nOld data interface(data-dbtable) is still supported, but will be removed in next version. \nPlease fix your code soon!");if(!a(d.id).hasClass("elLoadSuccess")){console.warn("No elLoadSuccess class");return}f=e.jqmData("dbtable"),d.dbtable=window[f],d.dbtable||(d.dbtable={}),c._itemData=function(a){return d.dbtable[a]},c._numItemData=d.dbtable.length}e.data("template")&&(d.template=e.data("template"),e.data("swipelist")==1?d.childSelector=" ul":d.shildSelector=" li"),c._initList(b)},_loadData:function(a){var b=this;if(!a.itemData||typeof a.itemData!="function")return!1;b._itemData=a.itemData;if(!a.numItemData)return!1;if(typeof a.numItemData=="function")b._numItemData=a.numItemData();else{if(typeof a.numItemData!="number")return!1;b._numItemData=a.numItemData}return!0},destroy:function(){var b=this.options,c=0,d=0;a(b.id).empty(),a("#load_more_message").die()},_itemApply:function(b,c){var d=c.find(".ui-li-count");d.length&&c.addClass("ui-li-has-count"),d.addClass("ui-btn-up-"+(b.jqmData("counttheme")||this.options.countTheme)+" ui-btn-corner-all"),c.find("h1, h2, h3, h4, h5, h6").addClass("ui-li-heading").end().find("p, dl").addClass("ui-li-desc").end().find(">img:eq(0), .ui-link-inherit>img:eq(0)").addClass("ui-li-thumb").each(function(){c.addClass(a(this).is(".ui-li-icon")?"ui-li-has-icon":"ui-li-has-thumb")}).end().find(".ui-li-aside").each(function(){var b=a(this);b.prependTo(b.parent())})},_removeCorners:function(a,b){var c="ui-corner-top ui-corner-tr ui-corner-tl",d="ui-corner-bottom ui-corner-br ui-corner-bl";a=a.add(a.find(".ui-btn-inner, .ui-li-link-alt, .ui-li-thumb")),b==="top"?a.removeClass(c):b==="bottom"?a.removeClass(d):a.removeClass(c+" "+d)},_refreshCorners:function(a){var b,c,d,e;this.options.inset&&(b=this.element.children("li"),c=a?b.not(".ui-screen-hidden"):b.filter(":visible"),this._removeCorners(b),d=c.first().addClass("ui-corner-top"),d.add(d.find(".ui-btn-inner")).find(".ui-li-link-alt").addClass("ui-corner-tr").end().find(".ui-li-thumb").not(".ui-li-icon").addClass("ui-corner-tl"),e=c.last().addClass("ui-corner-bottom"),e.add(e.find(".ui-btn-inner")).find(".ui-li-link-alt").addClass("ui-corner-br").end().find(".ui-li-thumb").not(".ui-li-icon").addClass("ui-corner-bl"))},refresh:function(b){this.parentPage=this.element.closest(".ui-page"),this._createSubPages();var c=this.options,d=this.element,e=this,f=d.jqmData("dividertheme")||c.dividerTheme,g=d.jqmData("splittheme"),h=d.jqmData("spliticon"),i=d.children("li"),j=a.support.cssPseudoElement||!a.nodeName(d[0],"ol")?0:1,k,l,m,n,o,p,q,r,s,t;j&&d.find(".ui-li-dec").remove();for(s=0,t=i.length;s<t;s++){k=i.eq(s),l="ui-li";if(b||!k.hasClass("ui-li"))m=k.jqmData("theme")||c.theme,n=k.children("a"),n.length?(r=k.jqmData("icon"),k.buttonMarkup({wrapperEls:"div",shadow:!1,corners:!1,iconpos:"right",icon:!1,theme:m}),r!=0&&n.length==1&&k.addClass("ui-li-has-arrow"),n.first().addClass("ui-link-inherit"),n.length>1&&(l+=" ui-li-has-alt",o=n.last(),p=g||o.jqmData("theme")||c.splitTheme,o.appendTo(k).attr("title",o.getEncodedText()).addClass("ui-li-link-alt").empty().buttonMarkup({shadow:!1,corners:!1,theme:m,icon:!1,iconpos:!1}).find(".ui-btn-inner").append(a("<span />").buttonMarkup({shadow:!0,corners:!0,theme:p,iconpos:"notext",icon:h||o.jqmData("icon")||c.splitIcon})))):k.jqmData("role")==="list-divider"?(l+=" ui-li-divider ui-btn ui-bar-"+f,k.attr("role","heading"),j&&(j=1)):l+=" ui-li-static ui-body-"+m;j&&l.indexOf("ui-li-divider")<0&&(q=k.is(".ui-li-static:first")?k:k.find(".ui-link-inherit"),q.addClass("ui-li-jsnumbering").prepend("<span class='ui-li-dec'>"+j++ +". </span>")),k.add(k.children(".ui-btn-inner")).addClass(l),e._itemApply(d,k)}this._refreshCorners(b)},_idStringEscape:function(a){return a.replace(/\W/g,"-")},_createSubPages:function(){var b=this.element,d=b.closest(".ui-page"),e=d.jqmData("url"),f=e||d[0][a.expando],g=b.attr("id"),h=this.options,i="data-"+a.mobile.ns,j=this,k=d.find(":jqmData(role='footer')").jqmData("id"),l,m;typeof c[f]=="undefined"&&(c[f]=-1),g=g||++c[f],a(b.find("li>ul, li>ol").toArray().reverse()).each(function(c){var d=this,f=a(this),j=f.attr("id")||g+"-"+c,m=f.parent(),n,p=n.first().getEncodedText(),q=(e||"")+"&"+a.mobile.subPageUrlKey+"="+j,r=f.jqmData("theme")||h.theme,s=f.jqmData("counttheme")||b.jqmData("counttheme")||h.countTheme,t,u;n=a(f.prevAll().toArray().reverse()),n=n.length?n:a("<span>"+a.trim(m.contents()[0].nodeValue)+"</span>"),l=!0,t=f.detach().wrap("<div "+i+"role='page' "+i+"url='"+q+"' "+i+"theme='"+r+"' "+i+"count-theme='"+s+"'><div "+i+"role='content'></div></div>").parent().before("<div "+i+"role='header' "+i+"theme='"+h.headerTheme+"'><div class='ui-title'>"+p+"</div></div>").after(k?a("<div "+i+"role='footer' "+i+"id='"+k+"'>"):"").parent().appendTo(a.mobile.pageContainer),t.page(),u=m.find("a:first"),u.length||(u=a("<a/>").html(n||p).prependTo(m.empty())),u.attr("href","#"+q)}).extendablelist(),l&&d.is(":jqmData(external-page='true')")&&d.data("page").options.domCache===!1&&(m=function(b,c){var f=c.nextPage,g;c.nextPage&&(g=f.jqmData("url"),g.indexOf(e+"&"+a.mobile.subPageUrlKey)!==0&&(j.childPages().remove(),d.remove()))},d.unbind("pagehide.remove").bind("pagehide.remove",m))},childPages:function(){var b=this.parentPage.jqmData("url");return a(":jqmData(url^='"+b+"&"+a.mobile.subPageUrlKey+"')")}}),a(document).bind("pagecreate create",function(b){a(a.tizen.extendablelist.prototype.options.initSelector,b.target).extendablelist()})}(jQuery),function(a,b){a.widget("tizen.fastscroll",a.mobile.widget,{options:{initSelector:":jqmData(fastscroll)"},_create:function(){var b=this.element,c=this,d,e=b.closest(':jqmData(role="page")'),f;this.scrollview=b.closest(".ui-scrollview-clip"),this.shortcutsContainer=a('<div class="ui-fastscroll"/>'),this.shortcutsList=a("<ul></ul>"),this.scrollview.append(a('<div class="ui-fastscroll-popup"></div>')),d=this.scrollview.find(".ui-fastscroll-popup"),this.shortcutsContainer.append(this.shortcutsList),this.scrollview.append(this.shortcutsContainer),this.lastListItem=b.children().last(),this.scrollview.find(".ui-scrollbar").hide(),f=function(b){var e=a(b).position().top,f=c.lastListItem.outerHeight(!0)+c.lastListItem.position().top,g=c.scrollview.height(),h=f-g,i;e=e>h?h:e,e=Math.max(e,0),c.scrollview.scrollview("scrollTo",0,-e),i=c.scrollview.offset(),d.text(a(b).text()).css({marginLeft:-(d.width()/2),marginTop:-(d.height()/2)}).show()},this.shortcutsList.bind("touchstart mousedown vmousedown touchmove vmousemove vmouseover ",function(b){var d=a.mobile.tizen.targetRelativeCoordsFromEvent(b),e=c.shortcutsList.offset();b.target.tagName.toLowerCase()==="li"&&(d.x+=a(b.target).offset().left-e.left,d.y+=a(b.target).offset().top-e.top),c.shortcutsList.find("li").each(function(){var b=a(this);a(b).removeClass("ui-fastscroll-hover").removeClass("ui-fastscroll-hover-up").removeClass("ui-fastscroll-hover-down")}),c.shortcutsList.find("li").each(function(){var b=a(this),c=b.offset().left-e.left,g=b.offset().top-e.top,h=c+Math.abs(b.outerWidth(!0)),i=g+Math.abs(b.outerHeight(!0));return d.x>=c&&d.x<=h&&d.y>=g&&d.y<=i?(f(a(b.data("divider"))),a(b).addClass("ui-fastscroll-hover"),b.index()>0&&a(b).siblings().eq(b.index()-1).addClass("ui-fastscroll-hover-up"),a(b).siblings().eq(b.index()).addClass("ui-fastscroll-hover-down"),!1):!0}),b.preventDefault(),b.stopPropagation()}).bind("touchend mouseup vmouseup vmouseout",function(){d.hide()}),e&&!e.is(":visible")?e.bind("pageshow",function(){c.refresh()}):this.refresh(),b.bind("updatelayout",function(){c.refresh()})},refresh:function(){var b=this,c,d,e,f;this.shortcutsList.find("li").remove(),e=this.element.find(".ui-li-divider"),f=this.element.find("li").not(".ui-li-divider"),e=e.filter(":visible"),f=f.filter(":visible");if(e.length<2){this.shortcutsList.hide();return}this.shortcutsList.show(),this.lastListItem=f.last(),e.each(function(c,d){b.shortcutsList.append(a("<li>"+a(d).text()+"</li>").data("divider",d))}),c=e.first().position().top,this.shortcutsContainer.css("top",c),d=c+this.shortcutsContainer.outerHeight()+"px",this.scrollview.css("min-height",d)}}),a(document).bind("pagecreate create",function(b){a(a.tizen.fastscroll.prototype.options.initSelector,b.target).not(":jqmData(role='none'), :jqmData(role='nojs')").fastscroll()})}(jQuery),function(a,b,c){a.widget("tizen.gallery",a.mobile.widget,{options:{flicking:!1,duration:500},dragging:!1,moving:!1,max_width:0,max_height:0,org_x:0,org_time:null,cur_img:null,prev_img:null,next_img:null,images:[],images_hold:[],index:0,align_type:null,direction:1,container:null,_resize:function(a){var b=this.images[a],c=this.images[a].width(),d=this.images[a].height(),e=0,f,g=this.max_width-e,h=this.max_height-e;f=d/c,c>g&&(b.width(g),b.height(g*f)),d=b.height(),d>h&&(b.height(h),b.width(h/f))},_align:function(a,b){var c=this.images[a],d=0;if(!b)return;if(!b.length)return;this.align_type=="middle"?d=(this.max_height-c.height())/2:this.align_type=="bottom"?d=this.max_height-c.height():d=0,b.css("top",d+"px")},_attach:function(a,b){var d=this,e=function(){d._resize(a),d._align(a,b)},f=function(){if(d.images[a]===c)return;if(!d.images[a].height()){setTimeout(f,10);return}e()};if(!b)return;if(!b.length)return;if(a<0)return;if(!this.images.length)return;if(a>=this.images.length)return;b.css("display","block"),b.append(this.images[a]),f()},_detach:function(a,b){if(!b)return;if(!b.length)return;if(a<0)return;if(a>=this.images.length)return;b.css("display","none"),this.images[a].removeAttr("style"),this.images[a].detach()},_detach_all:function(){var a;for(a=0;a<this.images.length;a++)this.images[a].detach()},_drag:function(a){var b,c;if(!this.dragging)return;if(this.options.flicking===!1){b=this.org_x-a;if(b<0&&!this.prev_img.length)return;if(b>0&&!this.next_img.length)return}c=a-this.org_x,this.cur_img.css("left",c+"px"),this.next_img.length&&this.next_img.css("left",c+this.window_width+"px"),this.prev_img.length&&this.prev_img.css("left",c-this.window_width+"px")},_move:function(a){var b=this.org_x-a,c=0,d,e,f;if(b==0)return;b>0?c=b<this.max_width*.45?0:1:c=-b<this.max_width*.45?0:1,c||(d=Date.now()-this.org_time,Math.abs(b)/d>1&&(c=1)),c&&(b>0&&this.next_img.length?(this._detach(this.index-1,this.prev_img),this.prev_img=this.cur_img,this.cur_img=this.next_img,this.next_img=this.next_img.next(),this.index++,this.next_img.length&&(this.next_img.css("left",this.window_width+"px"),this._attach(this.index+1,this.next_img)),this.direction=1):b<0&&this.prev_img.length&&(this._detach(this.index+1,this.next_img),this.next_img=this.cur_img,this.cur_img=this.prev_img,this.prev_img=this.prev_img.prev(),this.index--,this.prev_img.length&&(this.prev_img.css("left",-this.window_width+"px"),this._attach(this.index-1,this.prev_img)),this.direction=-1)),e=this.options.duration,f=this,this.moving=!0,setTimeout(function(){f.moving=!1},e-50),this.cur_img.animate({left:0},e),this.next_img.length&&this.next_img.animate({left:this.window_width},e),this.prev_img.length&&this.prev_img.animate({left:-this.window_width},e)},_add_event:function(){var a=this,b;this.container.bind("vmousemove",function(b){b.preventDefault();if(a.moving)return;if(!a.dragging)return;a._drag(b.pageX)}),this.container.bind("vmousedown",function(b){b.preventDefault();if(a.moving)return;a.dragging=!0,a.org_x=b.pageX,a.org_time=Date.now()}),this.container.bind("vmouseup",function(b){if(a.moving)return;a.dragging=!1,a._move(b.pageX)}),this.container.bind("vmouseout",function(b){if(a.moving)return;if(!a.dragging)return;if(b.pageX<20||b.pageX>a.max_width-20)a._move(b.pageX),a.dragging=!1})},_del_event:function(){this.container.unbind("vmousemove"),this.container.unbind("vmousedown"),this.container.unbind("vmouseup"),this.container.unbind("vmouseout")},_show:function(){this.window_width=a(b).width(),this.max_width=this._get_width(),this.max_height=this._get_height(),this.container.css("height",this.max_height),this.cur_img=a("div").find(".ui-gallery-bg:eq("+this.index+")"),this.prev_img=this.cur_img.prev(),this.next_img=this.cur_img.next(),this._attach(this.index-1,this.prev_img),this._attach(this.index,this.cur_img),this._attach(this.index+1,this.next_img),this.prev_img.length&&this.prev_img.css("left",-this.window_width+"px"),this.cur_img.css("left","0px"),this.next_img.length&&this.next_img.css("left",this.window_width+"px")},show:function(){if(!this.images.length)return;this._show(),this._add_event()},_hide:function(){this._detach(this.index-1,this.prev_img),this._detach(this.index,this.cur_img),this._detach(this.index+1,this.next_img)},hide:function(){this._hide(),this._del_event()},_get_width:function(){return a(this.element).width()},_get_height:function(){var c=a(this.element).parentsUntil("ui-page"),d=c.children(".ui-content"),e=c.children(".ui-header").outerHeight()||0,f=c.children(".ui-footer").outerHeight()||0,g=parseFloat(d.css("padding-top"))+parseFloat(d.css("padding-bottom")),h=a(b).height()-e-f-g;return h},_create:function(){var c,d=this,e,f=0;a(this.element).wrapInner('<div class="ui-gallery"></div>'),a(this.element).find("img").wrap('<div class="ui-gallery-bg"></div>'),this.container=a(this.element).find(".ui-gallery"),c=a("div").find(".ui-gallery-bg:first");while(c.length)this.images[f]=c.find("img"),c=c.next(),f++;this._detach_all(),e=parseInt(a(this.element).jqmData("index"),10),e||(e=0),e<0&&(e=0),e>=this.images.length&&(e=this.images.length-1),this.index=e,this.align_type=a(this.element).jqmData("vertical-align"),a(b).bind("resize",function(){d.refresh()})},_update:function(){var b,c,d;while(this.images_hold.length)b=this.images_hold.shift(),c=a('<div class="ui-gallery-bg"></div>'),d=a('<img src="'+b+'"></div>'),c.append(d),this.container.append(c),this.images.push(d);this._detach_all()},refresh:function(a){return this._update(),this._hide(),a===c&&(a=this.index),a<0&&(a=0),a>=this.images.length&&(a=this.images.length-1),this.index=a,this._show(),this.index},add:function(a){this.images_hold.push(a)},remove:function(b){var d;b===c&&(b=this.index);if(b<0||b>=this.images.length)return;b==this.index?(d=this.cur_img,this.index==0?this.direction=1:this.index==this.images.length-1&&(this.direction=-1),this.direction<0?(this.cur_img=this.prev_img,this.prev_img=this.prev_img.prev(),this.prev_img.length&&(this.prev_img.css("left",-this.window_width),this._attach(b-2,this.prev_img)),this.index--):(this.cur_img=this.next_img,this.next_img=this.next_img.next(),this.next_img.length&&(this.next_img.css("left",this.window_width),this._attach(b+2,this.next_img))),this.cur_img.animate({left:0},this.options.duration)):b==this.index-1?(d=this.prev_img,this.prev_img=this.prev_img.prev(),this.prev_img.length&&(this.prev_img.css("left",-this.window_width),this._attach(b-1,this.prev_img)),this.index--):b==this.index+1?(d=this.next_img,this.next_img=this.next_img.next(),this.next_img.length&&(this.next_img.css("left",this.window_width),this._attach(b+1,this.next_img))):d=a("div").find(".ui-gallery-bg:eq("+b+")"),this.images.splice(b,1),d.detach()},empty:function(){this.images.splice(0,this.images.length),this.container.find(".ui-gallery-bg").detach()},length:function(){return this.images.length},value:function(a){if(a===c)return this.index;this.refresh(a)}}),a(document).bind("pagecreate create",function(b){a(b.target).find(":jqmData(role='gallery')").gallery()}),a(document).bind("pageshow",function(b){a(b.target).find(":jqmData(role='gallery')").gallery("show")}),a(document).bind("pagebeforehide",function(b){a(b.target).find(":jqmData(role='gallery')").gallery("hide")})}(jQuery,this),function(a,b,c){a.tizen.scrollview.prototype.options.handler=!1,a.tizen.scrollview.prototype.options.handlerTheme="s";var d=a.tizen.scrollview.prototype._setOption,e=function(d){var e=d,f='<div class="ui-handler ui-handler-direction-',g='"><div class="ui-handler-track"><div class="ui-handler-thumb"></div></div></div>',h=e.data("scrollview"),i=h.options,j=i.direction,k=a.mobile.getInheritedTheme(h,"s"),l=i.theme||k,m=h.options.direction==="x",n=h._$view,o=h._$clip,p=e.find(".ui-scrollbar"),q=null,r=null,s=0,t=0,u=0,v=0,w=0,x,y=a.support.touch,z=(y?"touchstart":"mousedown")+".handler",A=(y?"touchmove":"mousemove")+".handler",B=(y?"touchend":"mouseup")+".handler",C=(y?" touchleave":" mouseleave")+".handler",D=function(){t=m?o.width():o.height(),s=(m?n.width():n.height())-t,w=t-u-v*2},E=function(a){var b=Math.round((m?a.x:a.y)/s*w);r[0].style[m?"left":"top"]=b+"px"},F=function(){a(b).unbind(".handler"),e.moveData=null,n.trigger("scrollstop")};if(e.find(".ui-handler-thumb").length!==0||typeof j!="string")return;q=a([f,j,g].join("")).appendTo(e.addClass(" ui-handler-"+l)),r=e.find(".ui-handler-thumb").hide(),u=m?r.width():r.height(),v=m?parseInt(q.css("right"),10):parseInt(q.css("bottom"),10),a.extend(e,{moveData:null}),r.bind(z,{e:r[0]},function(c){h._stopMScroll();var d=c.data.e,f=y?c.originalEvent.targetTouches[0]:c;d.style.opacity=1,e.moveData={target:d,X:parseInt(d.style.left,10)||0,Y:parseInt(d.style.top,10)||0,pX:f.pageX,pY:f.pageY},D(),n.trigger("scrollstart"),y||c.preventDefault(),a(b).bind(A,function(a){var b=e.moveData,c=b.target,d=0,f=0,g=y?a.originalEvent.targetTouches[0]:a;d=m?b.X+g.pageX-b.pX:b.Y+g.pageY-b.pY,d<0&&(d=0),d>w&&(d=w),f=-Math.round(d/w*s),m?(h._setScrollPosition(f,0),c.style.left=d+"px"):(h._setScrollPosition(0,f),c.style.top=d+"px"),a.preventDefault()}).bind(B+C,function(a){F()})}),n.bind(B,function(a){F()}),e.bind("scrollstart",function(a){if(!h.enableHandler())return;D();if(s<0||t<u){p.is(":hidden")&&p.show();return}p.is(":visible")&&p.hide(),x&&(clearInterval(x),x=c),q.addClass("ui-handler-visible"),r.stop(!0,!0).fadeIn()}).bind("scrollupdate",function(a,b){if(!h.enableHandler()||s<0||t<u)return;E(h.getScrollPosition())}).bind("scrollstop",function(a){if(!h.enableHandler()||s<0||t<u)return;x=setInterval(function(){E(h.getScrollPosition()),h._gesture_timer||(clearInterval(x),x=c)},10),h._handlerTimer&&(clearTimeout(h._handlerTimer),h._handlerTimer=0),h._handlerTimer=setTimeout(function(){h._timerID===0&&e.moveData===null&&(r.stop(!0,!0).css("opacity"
-,1).fadeOut(function(){q.removeClass("ui-handler-visible")}),h._handlerTimer=0)},1e3)}).bind("mousewheel",function(a){q.removeClass("ui-handler-visible"),E(h.getScrollPosition())})};a.extend(a.tizen.scrollview.prototype,{enableHandler:function(a){if(typeof a=="undefined")return this.options.handler;this.options.handler=!!a;var b=this.element;this.options.handler?(b.find(".ui-handler").length===0&&e(b),b.find(".ui-scrollbar").hide(),b.find(".ui-handler").show()):(b.find(".ui-handler").removeClass("ui-handler-visible").hide(),b.find(".ui-scrollbar").show())},_setHandlerTheme:function(a){if(!a)return;var b="ui-handler-"+this.options.handlerTheme,c="ui-handler-"+a;this.element.removeClass(b).addClass(c),this.options.handlerTheme=a},_setOption:function(a,b){switch(a){case"handler":this.enableHandler(b);break;case"handlerTheme":this._setHandlerTheme(b);break;default:d.call(this,a,b)}},_handlerTimer:0}),a(b).delegate(":jqmData(scroll)","scrollviewcreate",function(){var b=a(this);if(b.attr("data-"+a.mobile.ns+"scroll")==="none"||b.attr("data-"+a.mobile.ns+"handler")!=="true")return;b.scrollview("enableHandler","true")})}(jQuery,document),function(a,b){a.widget("tizen.listdivider",a.mobile.widget,{options:{initSelector:":jqmData(role='list-divider')",folded:!1,listDividerLine:!0},_create:function(){var c=this.element,d=!0,e,f=!0,g=c.attr("data-style");c.data("line")===!1&&(this.options.listDividerLine=!1),c.data("folded")===!0&&(this.options.folded=!0);if(g==b||g==="normal"||g==="check")this.options.folded?c.buttonMarkup():c.wrapInner("<span class='ui-btn-text'></span>"),this.options.listDividerLine&&(e="<span class='ui-divider-normal-line'></span>",this.options.folded?a(e).appendTo(c.children(".ui-btn-inner")):a(e).appendTo(c));c.bind("vclick",function(a,b){})}}),a(document).bind("pagecreate create",function(b){a(a.tizen.listdivider.prototype.options.initSelector,b.target).listdivider()})}(jQuery),function(a,b,c,d){a.widget("tizen.multimediaview",a.mobile.widget,{options:{theme:null,controls:!0,fullScreen:!1,initSelector:"video, audio"},_create:function(){var b=this,c=b.element,d=c[0],e=b.options,f=a.mobile.getInheritedTheme(c,"s"),g=e.theme||f,h="multimediaview",i=null;a.extend(this,{role:null,isControlHide:!1,controlTimer:null,isVolumeHide:!0,isVertical:!0,backupView:null}),b.role=h,c.addClass("ui-multimediaview"),i=b._createControl(),i.find(".ui-button").each(function(b){a(this).buttonMarkup({corners:!0,theme:g,shadow:!0})}),c[0].nodeName==="VIDEO"&&i.addClass("ui-"+h+"-video"),i.hide(),c.wrap(["<div class='ui-",h,"-wrap ui-",h,"-",g,"'>"].join("")).after(i),e.controls&&c.attr("controls")&&c.removeAttr("controls"),b._addEvent()},_resize:function(){var a=this.element,b=a.parent(),c=b.find(".ui-multimediaview-control"),d=0,e=0,f=null;this._resizeFullscreen(this.options.fullScreen),d=a[0].nodeName==="VIDEO"?a.width():b.width(),e=a[0].nodeName==="VIDEO"?a.height():c.height(),f=a.offset(),this._resizeControl(f,d,e),this._updateSeekBar(),this._updateVolumeState()},_resizeControl:function(a,b,c){var d=this,e=d.element,f=e[0],g=e.parent().find(".ui-multimediaview-control"),h=g.find(".ui-button"),i=g.find(".ui-playpausebutton"),j=g.find(".ui-seekbar"),k=g.find(".ui-durationlabel"),l=g.find(".ui-timestamplabel"),m=g.find(".ui-volumecontrol"),n=m.find(".ui-volumebar"),o=b,p=g.outerHeight(!0),q=0,r=null;g&&(e[0].nodeName==="VIDEO"&&(r=g.offset(),r.left=a.left,r.top=a.top+c-p,g.offset(r)),g.width(o)),j&&(q=g.width()-h.outerWidth(!0)*h.length,q-=(parseInt(h.eq(0).css("margin-left"),10)+parseInt(h.eq(0).css("margin-right"),10))*h.length,d.isVolumeHide||(q-=m.outerWidth(!0)),j.width(q)),k&&!isNaN(f.duration)&&k.find("p").text(d._convertTimeFormat(f.duration)),f.autoplay&&f.paused===!1&&i.removeClass("ui-play-icon").addClass("ui-pause-icon"),j.width()<n.width()+l.width()+k.width()?k.hide():k.show()},_resizeFullscreen:function(b){var c=this,d=c.element,e=d.parent(),f=d.parent().find(".ui-multimediaview-control"),g=f.find(".ui-playpausebutton"),h=f.find(".ui-timestamplabel"),i=f.find(".ui-seekbar"),j=i.find(".ui-duration"),k=i.find(".ui-currenttime"),l=0,m=0;if(b)c.backupView||(c.backupView={width:d[0].style.getPropertyValue("width")||"",height:d[0].style.getPropertyValue("height")||"",position:d.css("position"),zindex:d.css("z-index")}),l=a("body")[0].clientWidth,m=a("body")[0].clientHeight,d.width(l).height(m-1),d.closest(".ui-multimediaview-wrap").height(m-1),d.addClass("ui-"+c.role+"-fullscreen"),d.offset({top:0,left:0});else{if(!c.backupView)return;d.removeClass("ui-"+c.role+"-fullscreen"),d.css({width:c.backupView.width,height:c.backupView.height,position:c.backupView.position,"z-index":c.backupView.zindex}),d.closest(".ui-multimediaview-wrap").css("height",""),c.backupView=null}e.show()},_addEvent:function(){var d=this,e=d.element,f=d.options,g=e[0],h=e.parent().find(".ui-multimediaview-control"),i=h.find(".ui-playpausebutton"),j=h.find(".ui-timestamplabel"),k=h.find(".ui-durationlabel"),l=h.find(".ui-volumebutton"),m=h.find(".ui-volumecontrol"),n=m.find(".ui-volumebar"),o=m.find(".ui-guide"),p=m.find(".ui-handler"),q=h.find(".ui-fullscreenbutton"),r=h.find(".ui-seekbar"),s=r.find(".ui-duration"),t=r.find(".ui-currenttime");a(b).unbind(".multimediaview").bind("pagechange.multimediaview",function(b){var c=a(b.target);c.find(e).length>0&&g.autoplay&&g.play(),f.controls&&(h.show(),d._resize())}).bind("pagebeforechange.multimediaview",function(a){g.played.length!==0&&(g.pause(),h.hide())}),a(c).unbind(".multimediaview").bind("resize.multimediaview orientationchange.multimediaview",function(b){if(!f.controls)return;var c=a(b.target),g=e.parents(".ui-scrollview-clip");g.each(function(b){a.data(this,"scrollview")&&a(this).scrollview("scrollTo",0,0)}),f.fullScreen?(a(".ui-footer").hide(),d._fitContentArea(c)):a(".ui-footer:visible").show(),d._resize()}),e.bind("loadedmetadata.multimediaview",function(a){isNaN(g.duration)||k.find("p").text(d._convertTimeFormat(g.duration)),d._resize()}).bind("timeupdate.multimediaview",function(a){d._updateSeekBar()}).bind("play.multimediaview",function(a){i.removeClass("ui-play-icon").addClass("ui-pause-icon")}).bind("pause.multimediaview",function(a){i.removeClass("ui-pause-icon").addClass("ui-play-icon")}).bind("ended.multimediaview",function(a){(typeof g.loop=="undefined"||g.loop==="")&&d.stop()}).bind("volumechange.multimediaview",function(a){g.volume<.1?(g.muted=!0,l.removeClass("ui-volume-icon").addClass("ui-mute-icon")):(g.muted=!1,l.removeClass("ui-mute-icon").addClass("ui-volume-icon")),d.isVolumeHide||d._updateVolumeState()}).bind("durationchange.multimediaview",function(a){isNaN(g.duration)||k.find("p").text(d._convertTimeFormat(g.duration)),d._resize()}).bind("error.multimediaview",function(a){switch(a.target.error.code){case a.target.error.MEDIA_ERR_ABORTED:c.alert("You aborted the video playback.");break;case a.target.error.MEDIA_ERR_NETWORK:c.alert("A network error caused the video download to fail part-way.");break;case a.target.error.MEDIA_ERR_DECODE:c.alert("The video playback was aborted due to a corruption problem or because the video used features your browser did not support.");break;case a.target.error.MEDIA_ERR_SRC_NOT_SUPPORTED:c.alert("The video could not be loaded, either because the server or network failed or because the format is not supported.");break;default:c.alert("An unknown error occurred.")}}).bind("vclick.multimediaview",function(a){if(!d.options.controls)return;h.fadeToggle("fast",function(){var a=h.offset();d.isControlHide=!d.isControlHide,d.options.mediatype=="video"&&d._startTimer()}),d._resize()}),i.bind("vclick.multimediaview",function(){d._endTimer(),g.paused?g.play():g.pause(),d.options.mediatype=="video"&&d._startTimer()}),q.bind("vclick.multimediaview",function(a){d.fullScreen(!d.options.fullScreen),h.fadeIn("fast"),d._endTimer(),a.preventDefault(),a.stopPropagation()}),r.bind("vmousedown.multimediaview",function(c){var e=c.clientX,f=g.duration,h=s.offset(),i=s.width(),j=(e-h.left)/i,k=f*j;if(!g.played.length)return;g.currentTime=k,d._endTimer(),c.preventDefault(),c.stopPropagation(),a(b).bind("vmousemove.multimediaview",function(a){var b=a.clientX,c=(b-h.left)/i;g.currentTime=f*c,a.preventDefault(),a.stopPropagation()}).bind("vmouseup.multimediaview",function(){a(b).unbind("vmousemove.multimediaview vmouseup.multimediaview"),g.paused?g.pause():g.play()})}),l.bind("vclick.multimediaview",function(){if(d.isVolumeHide){var a=d.element,b=g.volume;d.isVolumeHide=!1,d._resize(),m.fadeIn("fast"),d._updateVolumeState(),d._updateSeekBar()}else d.isVolumeHide=!0,m.fadeOut("fast",function(){d._resize()}),d._updateSeekBar()}),n.bind("vmousedown.multimediaview",function(c){var e=c.clientX,f=o.offset().left,g=o.width(),h=f+g,i=p.offset(),j=(e-f)/g,k=(e-f)/g;d._endTimer(),d._setVolume(k.toFixed(2)),c.preventDefault(),c.stopPropagation(),a(b).bind("vmousemove.multimediaview",function(a){var b=a.clientX,c=(b-f)/g;d._setVolume(c.toFixed(2)),a.preventDefault(),a.stopPropagation()}).bind("vmouseup.multimediaview",function(){a(b).unbind("vmousemove.multimediaview vmouseup.multimediaview"),d.options.mediatype=="video"&&d._startTimer()})})},_removeEvent:function(){var a=this,b=a.element,c=b.parent().find(".ui-multimediaview-control"),d=c.find(".ui-playpausebutton"),e=c.find(".ui-fullscreenbutton"),f=c.find(".ui-seekbar"),g=c.find(".ui-volumecontrol"),h=g.find(".ui-volumebar"),i=g.find(".ui-handler");b.unbind(".multimediaview"),d.unbind(".multimediaview"),e.unbind(".multimediaview"),f.unbind(".multimediaview"),h.unbind(".multimediaview"),i.unbind(".multimediaview")},_createControl:function(){var b=this,c=b.element,d=a("<span></span>").addClass("ui-"+b.role+"-control"),e=a("<span></span>").addClass("ui-playpausebutton ui-button"),f=a("<span></span>").addClass("ui-seekbar"),g=a("<span><p>00:00:00</p></span>").addClass("ui-timestamplabel"),h=a("<span><p>00:00:00</p></span>").addClass("ui-durationlabel"),i=a("<span></span>").addClass("ui-volumebutton ui-button"),j=a("<span></span>").addClass("ui-volumecontrol"),k=a("<div></div>").addClass("ui-volumebar"),l=a("<span></span>").addClass("ui-guide"),m=a("<span></span>").addClass("ui-value"),n=a("<span></span>").addClass("ui-handler"),o=a("<span></span>").addClass("ui-fullscreenbutton ui-button"),p=a("<span></span>").addClass("ui-duration"),q=a("<span></span>").addClass("ui-currenttime");return f.append(p).append(q).append(h).append(g),e.addClass("ui-play-icon"),i.addClass(c[0].muted?"ui-mute-icon":"ui-volume-icon"),k.append(l).append(m).append(n),j.append(k),d.append(e).append(f).append(j).append(i),b.element[0].nodeName==="VIDEO"&&(a(o).addClass("ui-fullscreen-on"),d.append(o)),j.hide(),d},_startTimer:function(a){this._endTimer(),a||(a=3e3);var b=this,c=b.element,d=c.parent().find(".ui-multimediaview-control"),e=d.find(".ui-volumecontrol");b.controlTimer=setTimeout(function(){b.isVolumeHide=!0,b.isControlHide=!0,b.controlTimer=null,e.hide(),d.fadeOut("fast")},a)},_endTimer:function(){this.controlTimer&&(clearTimeout(this.controlTimer),this.controlTimer=null)},_convertTimeFormat:function(a){var b=parseInt(a%60,10).toString(),c=parseInt(a/60%60,10).toString(),d=parseInt(a/3600,10).toString(),e=(d.length<2?"0"+d:d)+":"+(c.length<2?"0"+c:c)+":"+(b.length<2?"0"+b:b);return e},_updateSeekBar:function(a){var b=this,c=b.element,d=c[0].duration,e=c.parent().find(".ui-multimediaview-control"),f=e.find(".ui-seekbar"),g=f.find(".ui-duration"),h=f.find(".ui-currenttime"),i=e.find(".ui-timestamplabel"),j=g.offset(),k=g.width(),l=g.height(),m=0;typeof a=="undefined"&&(a=c[0].currentTime),m=parseInt(a/d*k,10),g.offset(j),h.offset(j).width(m),i.find("p").text(b._convertTimeFormat(a))},_updateVolumeState:function(){var a=this,b=a.element,c=b.parent().find(".ui-multimediaview-control"),d=c.find(".ui-volumecontrol"),e=c.find(".ui-volumebutton"),f=d.find(".ui-volumebar"),g=d.find(".ui-guide"),h=d.find(".ui-value"),i=d.find(".ui-handler"),j=i.width(),k=i.height(),l=g.height(),m=g.width(),n=0,o=0,p=0,q=null,r=b[0].volume;n=parseInt(g.offset().top,10),o=parseInt(g.offset().left,10),p=o,q=i.offset(),q.top=n-parseInt((k-l)/2,10),q.left=p+parseInt(m*r,10)-parseInt(j/2,10),i.offset(q),h.width(parseInt(m*r,10))},_setVolume:function(a){var b=this.element[0];if(a<0||a>1)return;b.volume=a},_fitContentArea:function(b,d){typeof d=="undefined"&&(d=c);var e=a(b),f=a(".ui-content:visible:first"),g=a(".ui-header:visible").outerHeight()||0,h=a(".ui-footer:visible").outerHeight()||0,i=parseFloat(f.css("padding-top")),j=parseFloat(f.css("padding-bottom")),k=d===c?c.innerHeight:a(d).height(),l=k-(g+h)-(i+j);f.offset({top:g+i}).height(l)},width:function(a){var b=this,c=arguments,d=b.element;if(c.length===0)return d.width();c.length===1&&(d.width(a),b._resize())},height:function(a){var b=this,c=b.element,d=arguments;if(d.length===0)return c.height();d.length===1&&(c.height(a),b._resize())},fullScreen:function(b){var c=this,d=c.element,e=d.parent().find(".ui-multimediaview-control"),f=e.find(".ui-fullscreenbutton"),g=arguments,h=c.options,i=a(".ui-page-active");if(g.length===0)return h.fullScreen;g.length===1&&(d.parents(".ui-content").scrollview("scrollTo",0,0),this.options.fullScreen=b,b?(i.children(".ui-header").hide(),i.children(".ui-footer").hide(),i.addClass("ui-fullscreen-page"),this._fitContentArea(i),f.removeClass("ui-fullscreen-on").addClass("ui-fullscreen-off")):(i.children(".ui-header").show(),i.children(".ui-footer").show(),i.removeClass("ui-fullscreen-page"),this._fitContentArea(i),f.removeClass("ui-fullscreen-off").addClass("ui-fullscreen-on")),c._resize())},refresh:function(){this._resize()}}),a(b).bind("pagecreate create",function(b){a.tizen.multimediaview.prototype.enhanceWithin(b.target)})}(jQuery,document,window),function(a,b){a.widget("tizen.notification",a.mobile.widget,{btn:null,text_bg:[],icon_img:[],interval:null,seconds:null,running:!1,_get_text:function(){var b=new Array(2);return this.type==="ticker"?(b[0]=a(this.text_bg[0]).text(),b[1]=a(this.text_bg[1]).text()):b[0]=a(this.text_bg[0]).text(),b},_set_text:function(b,c){var d=function(a,b){if(!b)return;a.text(b)};this.type==="ticker"?(d(a(this.text_bg[0]),b),d(a(this.text_bg[1]),c)):d(a(this.text_bg[0]),b)},text:function(a,b){if(a===undefined&&b===undefined)return this._get_text();this._set_text(a,b)},icon:function(b){if(b===undefined)return;this.icon_img.detach(),this.icon_img=a("<img src='"+b+"' class='ui-ticker-icon'>"),a(this.element).find(".ui-ticker").append(this.icon_img)},_refresh:function(){var b=this._get_container();a(b).addClass("fix").removeClass("show").removeClass("hide"),this._set_interval()},open:function(){var b=this._get_container();if(this.running){this._refresh();return}a(b).addClass("show").removeClass("hide").removeClass("fix"),this.running=!0,this.type==="popup"&&this._set_position(),this._set_interval()},close:function(){var b=this._get_container();if(!this.running)return;a(b).addClass("hide").removeClass("show").removeClass("fix"),this.running=!1,clearInterval(this.interval)},destroy:function(){var b=this._get_container();a(b).removeClass("show").removeClass("hide").removeClass("fix"),this._del_event(),this.running=!1},_get_container:function(){return this.type==="ticker"?a(this.element).find(".ui-ticker"):a(this.element).find(".ui-smallpopup")},_set_interval:function(){var a=this;clearInterval(this.interval),this.seconds!==undefined&&this.second!==0&&(this.interval=setInterval(function(){a.close()},this.seconds))},_add_event:function(){var a=this,b=this._get_container();this.type==="ticker"&&(b.find(".ui-ticker-btn").append(this.btn).trigger("create"),this.btn.bind("vmouseup",function(){a.close()})),b.bind("vmouseup",function(){a.close()})},_del_event:function(){var a=this._get_container();this.type==="ticker"&&this.btn.unbind("vmouseup"),a.unbind("vmouseup"),clearInterval(this.interval)},_set_position:function(){var b=this._get_container(),c=a(".ui-page-active").children(".ui-footer"),d=c.outerHeight()||0;b.css("bottom",d)},_create:function(){var c=this,d=a(this.element),e;this.btn=a('<div data-role="button" data-inline="true">Close</div>'),this.seconds=d.jqmData("interval"),this.type=d.jqmData("type")||"popup";if(this.type==="ticker"){d.wrapInner("<div class='ui-ticker'></div>"),d.find(".ui-ticker").append("<div class='ui-ticker-body'></div><div class='ui-ticker-btn'></div>"),this.text_bg=d.find("p");if(this.text_bg.length<2)d.find(".ui-ticker").append("<p></p><p></p>"),this.text_bg=d.find("p");else if(this.text_bg.length>2)for(e=2;e<this.text_bg.length;e++)a(this.text_bg[e]).css("display","none");a(this.text_bg[0]).addClass("ui-ticker-text1-bg"),a(this.text_bg[1]).addClass("ui-ticker-text2-bg"),this.icon_img=d.find("img");if(this.icon_img.length){a(this.icon_img).addClass("ui-ticker-icon");for(e=1;e<this.icon_img.length;e++)a(this.icon_img[e]).css("display","none")}}else{d.wrapInner("<div class='ui-smallpopup'></div>"),this.text_bg=d.find("p").addClass("ui-smallpopup-text-bg");if(this.text_bg.length<1)d.find(".ui-smallpopup").append("<p class='ui-smallpopup-text-bg'></p>"),this.text_bg=d.find("p");else if(this.text_bg.length>1)for(e=1;e<this.text_bg.length;e++)a(this.text_bg[e]).css("display","none");this._set_position()}this._add_event(),a(b).bind("resize",function(){if(!c.running)return;c._refresh(),c.type==="popup"&&c._set_position()})}}),a(document).bind("pagecreate create",function(b){a(b.target).find(":jqmData(role='notification')").notification()}),a(document).bind("pagebeforehide",function(b){a(b.target).find(":jqmData(role='notification')").notification("destroy")})}(jQuery,this),function(a,b){a.widget("mobile.pagelayout",a.mobile.widget,{options:{visibleOnPageShow:!0,disablePageZoom:!0,transition:"slide",fullscreen:!1,tapToggle:!0,tapToggleBlacklist:"a, input, select, textarea, .ui-header-fixed, .ui-footer-fixed",hideDuringFocus:"input, textarea, select",updatePagePadding:!0,trackPersistentToolbars:!0,supportBlacklist:function(){var a=window,c=navigator.userAgent,d=navigator.platform,e=c.match(/AppleWebKit\/([0-9]+)/),f=!!e&&e[1],g=c.match(/Fennec\/([0-9]+)/),h=!!g&&g[1],i=c.match(/Opera Mobi\/([0-9]+)/),j=!!i&&i[1];return(d.indexOf("iPhone")>-1||d.indexOf("iPad")>-1||d.indexOf("iPod")>-1)&&f&&f<534||a.operamini&&{}.toString.call(a.operamini)==="[object OperaMini]"||i&&j<7458||c.indexOf("Android")>-1&&f&&f<533||h&&h<6||window.palmGetResource!==b&&f&&f<534||c.indexOf("MeeGo")>-1&&c.indexOf("NokiaBrowser/8.5.0")>-1?!0:!1},initSelector:":jqmData(role='content')"},_create:function(){var a=this,b=a.options,c=a.element;if(b.supportBlacklist()){a.destroy();return}a._addFixedClass(),a._addTransitionClass(),a._bindPageEvents(),a._bindContentControlEvents()},_addFixedClass:function(){var a=this,b=a.options,c=a.element,d=c.siblings(":jqmData(role='header')"),e=c.siblings(":jqmData(role='footer')"),f=c.closest(".ui-page");d.addClass("ui-header-fixed"),e.addClass("ui-footer-fixed"),b.fullscreen?(d.addClass("ui-header-fullscreen"),e.addClass("ui-footer-fullscreen"),f.addClass("ui-page-header-fullscreen").addClass("ui-page-footer-fullscreen")):f.addClass("ui-page-header-fixed").addClass("ui-page-footer-fixed")},_addTransitionClass:function(){var a=this.options.transition;a&&a!=="none"&&(a==="slide"&&(a=this.element.is(".ui-header")?"slidedown":"slideup"),this.element.addClass(a))},setHeaderFooter:function(b){var c=a(b),d=c.find(":jqmData(role='header')").length?c.find(":jqmData(role='header')"):c.siblings(":jqmData(role='header')"),e=c.find(".ui-content"),f=c.find(":jqmData(role='footer')"),g=f.find(":jqmData(role='fieldcontain')");c.is(".ui-dialog")||(d.jqmData("position")=="fixed"||a.support.scrollview&&a.tizen.frameworkData.theme.match(/tizen/)?d.css("position","fixed").css("top","0px"):!a.support.scrollview&&d.jqmData("position")!="fixed"&&d.css("position","relative")),d.find("span.ui-title-text-sub").length&&d.addClass("ui-title-multiline"),g.find("div").is(".ui-controlgroup-label")&&g.find("div.ui-controlgroup-label").remove()},_bindPageEvents:function(){var b=this,c=b.options,d=b.element,e;d.closest(".ui-page").bind("pagebeforeshow",function(d){var e=this;c.disablePageZoom&&a.mobile.zoom.disable(!0),c.visibleOnPageShow||b.hide(!0),b.setHeaderFooter(e),b._setContentMinHeight(e)}).bind("webkitAnimationStart animationstart updatelayout",function(a,d){var e=this;c.updatePagePadding&&(b.updatePagePadding(e),b.updatePageLayout(!1,e))}).bind("pageshow",function(d){var e=this;b._setContentMinHeight(e),b.updatePagePadding(e),b._updateHeaderArea(e),c.updatePagePadding&&a(window).bind("throttledresize."+b.widgetName,function(){b.updatePagePadding(e),b.updatePageLayout(!1,e),b._updateHeaderArea(e),b._setContentMinHeight(e)})}).bind("pagebeforehide",function(d,e){c.disablePageZoom&&a.mobile.zoom.enable(!0),c.updatePagePadding&&a(window).unbind("throttledresize."+b.widgetName);if(c.trackPersistentToolbars){var f=a(".ui-footer-fixed:jqmData(id)",this),g=a(".ui-header-fixed:jqmData(id)",this),h=f.length&&e.nextPage&&a(".ui-footer-fixed:jqmData(id='"+f.jqmData("id")+"')",e.nextPage),i=g.length&&e.nextPage&&a(".ui-header-fixed:jqmData(id='"+g.jqmData("id")+"')",e.nextPage);h=h||a();if(h.length||i.length)h.add(i).appendTo(a.mobile.pageContainer),e.nextPage.one("pageshow",function(){h.add(i).appendTo(this)})}}),window.addEventListener("softkeyboardchange",function(c){var d=this;c.state=="on"?(e=a(".ui-page-active .ui-footer"),e.hide()):c.state=="off"&&e.show(),b.updatePagePadding(d),b.updatePageLayout(!0,d)})},_bindContentControlEvents:function(){var a=this,b=a.options,c=a.element;c.closest(".ui-page").bind("pagebeforeshow",function(a){})},_setContentMinHeight:function(b){var c=a(b),d=c.find(":jqmData(role='header')"),e=c.find(":jqmData(role='footer')"),f=c.find(":jqmData(role='content')"),g;g=window.innerHeight-d.height()-e.height(),f.css("min-height",g-parseFloat(f.css("padding-top"))-parseFloat(f.css("padding-bottom"))+"px")},_updateHeaderArea:function(b){var c=a(b),d=c.find(":jqmData(role='header')").length?c.find(":jqmData(role='header')"):c.siblings(":jqmData(role='header')"),e=d.children("a").length,f=d.children("img").length;c.is(".ui-dialog")||d.find("h1").css("width",window.innerWidth-d.children("a").width()*e-d.children("a").width()/4-d.children("img").width()*f*4)},_visible:!0,updatePagePadding:function(b){var c=this.element,d=c.siblings(".ui-header").length,e=c.siblings(".ui-footer").length;if(this.options.fullscreen)return;b=b||c.closest(".ui-page"),(c.siblings(".ui-header").jqmData("position")=="fixed"||a.support.scrollview)&&a(b).css("padding-top",d?c.siblings(".ui-header").outerHeight():0),a(b).css("padding-bottom",e?c.siblings(".ui-footer").outerHeight():0)},updatePageLayout:function(b,c){var d,e=a(c),f=e.find(":jqmData(role='header')"),g=e.find(":jqmData(role='content')"),h=0,i=0,j=0;e.length?d=e.find(":jqmData(role='footer')"):d=a(document).find(":jqmData(role='footer')").eq(0),i=d.css("display")=="none"?0:d.height(),j=f.css("display")=="none"?0:f.height(),i!=0&&d.css("bottom",0),h=window.innerHeight-i-j,a.support.scrollview&&g.height(h-parseFloat(g.css("padding-top"))-parseFloat(g.css("padding-bottom"))),b&&e.css("min-height",h).css("padding-top",j).css("padding-bottom",i)},show:function(a){},hide:function(a){},toggle:function(){this[this._visible?"hide":"show"]()},destroy:function(){this.element.removeClass("ui-header-fixed ui-footer-fixed ui-header-fullscreen ui-footer-fullscreen in out fade slidedown slideup ui-fixed-hidden"),this.element.closest(".ui-page").removeClass("ui-page-header-fixed ui-page-footer-fixed ui-page-header-fullscreen ui-page-footer-fullscreen")}}),a(document).bind("pagecreate create",function(b){a(b.target).jqmData("fullscreen")&&a(a.mobile.pagelayout.prototype.options.initSelector,b.target).not(":jqmData(fullscreen)").jqmData("fullscreen",!0),a.mobile.pagelayout.prototype.enhanceWithin(b.target)})}(jQuery),function(a,b){a.widget("tizen.popupwindow",a.tizen.widgetex,{options:{theme:null,overlayTheme:"s",style:"custom",disabled:!1,shadow:!0,corners:!0,fade:!1,opacity:.7,widthRatio:.8612,transition:a.mobile.defaultDialogTransition,initSelector:":jqmData(role='popupwindow')"},_htmlProto:{source:["<div><div>"," <div id='popupwindow-screen' class='ui-selectmenu-screen ui-screen-hidden ui-popupwindow-screen'></div>"," <div id='popupwindow-container' class='ui-popupwindow ui-popupwindow-padding ui-selectmenu-hidden ui-overlay-shadow ui-corner-all'></div>","</div>","</div>"].join(""),ui:{screen:"#popupwindow-screen",container:"#popupwindow-container"}},_setStyle:function(){var a=this.element,b=a.attr("data-style");b&&(this.options.style=b),a.addClass(this.options.style),a.find(":jqmData(role='title')").wrapAll("<div class='popup-title'></div>"),a.find(":jqmData(role='text')").wrapAll("<div class='popup-text'></div>"),a.find(":jqmData(role='button-bg')").wrapAll("<div class='popup-button-bg'></div>"),a.find(":jqmData(role='check-bg')").wrapAll("<div class='popup-check-bg'></div>"),a.find(":jqmData(role='scroller-bg')").addClass("popup-scroller-bg"),a.find(":jqmData(role='text-bottom-bg')").wrapAll("<div class='popup-text-bottom-bg'></div>"),a.find(":jqmData(role='text-left')").wrapAll("<div class='popup-text-left'></div>"),a.find(":jqmData(role='text-right')").wrapAll("<div class='popup-text-right'></div>"),a.find(":jqmData(role='progress-bg')").wrapAll("<div class='popup-progress-bg'></div>")},_create:function(){console.warn("popupwindow() was deprecated. use popup() instead.");var b=this.element.closest(":jqmData(role='page')"),c=this;b.length===0&&(b=a("body")),this._ui.placeholder=a("<div><!-- placeholder for "+this.element.attr("id")+" --></div>").css("display","none").insertBefore(this.element),b.append(this._ui.screen),this._ui.container.insertAfter(this._ui.screen),this._ui.container.append(this.element),this._setStyle(),this._isOpen=!1,this._ui.screen.bind("vclick",function(a){return c.close(),!1}),this.element.bind("vclick",function(b){a(b.target).is("ui-btn-ctxpopup-close")&&c.close()})},destroy:function(){this.element.insertBefore(this._ui.placeholder),this._ui.placeholder.remove(),this._ui.container.remove(),this._ui.screen.remove(),this.element.triggerHandler("destroyed"),a.Widget.prototype.destroy.call(this)},_placementCoords:function(b,c,d,e){var f=a(window).height(),g=a(window).width(),h=e/2,i=parseFloat(this._ui.container.css("max-width")),j=c,k=f-c,l,m;return j>e/2&&k>e/2?l=c-h:l=j>k?f-e-30:30,d<i?m=(g-d)/2:(m=b-d/2,m<10?m=10:m+d>g&&(m=g-d-10)),{x:m,y:l}},_setPosition:function(c,d){var e=b===c?a(window).width()/2:c,f=b===d?a(window).height()/2:d,g,h=this.element.data("ctxpopup"),i,j,k,l,m,n,o,p,q,r,s;h||(i=a(window).width()*this.options.widthRatio,this._ui.container.css("width",i),this._ui.container.outerWidth()>a(window).width()&&this._ui.container.css({"max-width":a(window).width()-30})),g=this._placementCoords(e,f,this._ui.container.outerWidth(),this._ui.container.outerHeight()),j=this._ui.container.innerHeight(),k=this._ui.container.innerWidth(),l=a(window).height(),m=a(window).width(),n=f,o=l-f,p=j/2,q=parseFloat(this._ui.container.css("max-width")),r=(l-j)/2,!q||k<q?s=(m-k)/2:(s=e-k/2,s<30?s=30:s+k>m&&(s=m-k-30)),h&&(r=g.y,s=g.x),this._ui.container.css({top:r,left:s}),this._ui.screen.css("height",l)},open:function(b,c,d){var e=this,f=0;if(this._isOpen||this.options.disabled)return;a(document).find("*").each(function(){var b=a(this),c=parseInt(b.css("z-index"),10);b.is(e._ui.container)||b.is(e._ui.screen)||isNaN(c)||(f=Math.max(f,c))}),this._ui.screen.css("height",a(window).height()),d?this._ui.screen.css("opacity",0).removeClass("ui-screen-hidden"):(this._ui.removeClass("ui-screen-hidden"),this.options.fade?this._ui.screen.animate({opacity:this.options.opacity},"fast"):this._ui.screen.css({opacity:this.options.opacity})),this._setPosition(b,c),this.element.trigger("popupbeforeposition"),this._ui.container.removeClass("ui-selectmenu-hidden").addClass("in").animationComplete(function(){e.element.trigger("popupafteropen")}),this._isOpen=!0,this._reflow||(this._reflow=function(){if(!e._isOpen)return;e._setPosition(b,c)},a(window).bind("resize",this._reflow))},close:function(){if(!this._isOpen)return;this._reflow&&(a(window).unbind("resize",this._reflow),this._reflow=null);var b=this,c=function(){b._ui.screen.addClass("ui-screen-hidden"),b._isOpen=!1};this._ui.container.removeClass("in").addClass("reverse out"),this.options.transition==="none"?(this._ui.container.addClass("ui-selectmenu-hidden").removeAttr("style"),this.element.trigger("popupafterclose")):this._ui.container.animationComplete(function(){b._ui.container.removeClass("reverse out").addClass("ui-selectmenu-hidden").removeAttr("style"),b.element.trigger("popupafterclose")}),this.options.fade?this._ui.screen.animate({opacity:0},"fast",c):c()},_realSetTheme:function(a,b){var c=(a.attr("class")||"").split(" "),d=!0,e=null,f;while(c.length>0){e=c.pop(),f=e.match(/^ui-body-([a-z])$/);if(f&&f.length>1){e=f[1];break}e=null}a.removeClass("ui-body-"+e),(b||"").match(/[a-z]/)&&a.addClass("ui-body-"+b)},_setTheme:function(b){this._realSetTheme(this.element,b),this.options.theme=b,this.element.attr("data-"+(a.mobile.ns||"")+"theme",b)},_setOverlayTheme:function(b){this._realSetTheme(this._ui.container,b),this.options.overlayTheme=b,this.element.attr("data-"+(a.mobile.ns||"")+"overlay-theme",b)},_setShadow:function(b){this.options.shadow=b,this.element.attr("data-"+(a.mobile.ns||"")+"shadow",b),this._ui.container[b?"addClass":"removeClass"]("ui-overlay-shadow")},_setCorners:function(b){this.options.corners=b,this.element.attr("data-"+(a.mobile.ns||"")+"corners",b),this._ui.container[b?"addClass":"removeClass"]("ui-corner-all")},_setFade:function(b){this.options.fade=b,this.element.attr("data-"+(a.mobile.ns||"")+"fade",b)},_setTransition:function(b){this._ui.container.removeClass(this.options.transition||"").addClass(b),this.options.transition=b,this.element.attr("data-"+(a.mobile.ns||"")+"transition",b)},_setDisabled:function(b){a.Widget.prototype._setOption.call(this,"disabled",b),b&&this.close()}}),a.tizen.popupwindow.bindPopupToButton=function(a,b){if(a.length===0||b.length===0)return;var c=function(c){return b.jqmData("overlay-theme-set")||b.popupwindow("option","overlayTheme",a.jqmData("theme")),b.popupwindow("open",a.offset().left+a.outerWidth()/2,a.offset().top+a.outerHeight()/2),!1};(b.popupwindow("option","overlayTheme")||"").match(/[a-z]/)&&b.jqmData("overlay-theme-set",!0),a.attr({"aria-haspopup":!0,"aria-owns":a.attr("href")}).removeAttr("href").bind("vclick",c),b.bind("destroyed",function(){a.unbind("vclick",c)})},a(document).bind("pagecreate create",function(b){a(a.tizen.popupwindow.prototype.options.initSelector,b.target).not(":jqmData(role='none'), :jqmData(role='nojs')").popupwindow(),a("a[href^='#']:jqmData(rel='popupwindow')",b.target).each(function(){a.tizen.popupwindow.bindPopupToButton(a(this),a(a(this).attr("href")))})})}(jQuery),function(a,b){a.widget("tizen.ctxpopup",a.tizen.widgetex,{options:a.extend({},a.tizen.popupwindow.prototype.options,{initSelector:":jqmData(show-arrow)"}),_htmlProto:{source:["<div><div id='outer' class='ui-ctxpopup'>"," <div id='top' class='ui-ctxpopup-row' data-role='triangle' data-location='top'></div>"," <div class='ui-ctxpopup-row'>"," <div id='left' class='ui-ctxpopup-cell' data-role='triangle' data-location='left'></div>"," <div id='container' class='ui-ctxpopup-cell'></div>"," <div id='right' class='ui-ctxpopup-cell' data-role='triangle' data-location='right'></div>"," </div>"," <div id='bottom' class='ui-ctxpopup-row' data-role='triangle' data-location='bottom'></div>","</div>","</div>"].join(""),ui:{outer:"#outer",container:"#container",arrow:{all:":jqmData(role='triangle')",l:"#left",t:"#top",r:"#right",b:"#bottom"}}},_create:function(){console.warn("ctxpopup() was deprecated. use popup() instead."),this.element.data("popupwindow")||this.element.popupwindow(),this.element.data("popupwindow")._ui.container.removeClass("ui-popupwindow-padding").append(this._ui.outer),this._ui.outer.trigger("create"),this._ui.container.addClass("ui-popupwindow-padding").append(this.element)},_setOption:function(b,c){a.tizen.popupwindow.prototype._setOption.apply(this.element.data("popupwindow"),arguments),this.options[b]=c}});var c=a.tizen.popupwindow.prototype.open,d=a.tizen.popupwindow.prototype._setOption,e=a.tizen.popupwindow.prototype._placementCoords;a.tizen.popupwindow.prototype._setOption=function(a,b){var c=this.element.data("ctxpopup"),e=!0,f;if(c){if("shadow"===a||"overlayTheme"===a||"corners"===a)f=this._ui.container,this._ui.container=c._ui.container,d.apply(this,arguments),this._ui.container=f,e=!1;c.options[a]=b}e&&d.apply(this,arguments)},a.tizen.popupwindow.prototype._placementCoords=function(c,d,f,g){function m(
-a,b,f){h._ui.arrow.all.hide(),h._ui.arrow[a].show();var g="b"===a||"t"===a,j=g?{point:"x",size:"cx",beg:"left",outerSize:"outerWidth",niceSize:"width",triangleSize:"height"}:{point:"y",size:"cy",beg:"top",outerSize:"outerHeight",niceSize:"height",triangleSize:"width"},k={cx:i._ui.container.width(),cy:i._ui.container.height()},l={cx:k.cx/2,cy:k.cy/2},m={x:c+l.cx*b,y:d+l.cy*f},n=e.call(i,m.x,m.y,k.cx,k.cy),o=h._ui.arrow[a].offset()[j.beg],p=h._ui.arrow[a][j.outerSize](!0),q=i.element.offset()[j.beg],r=i.element[j.outerSize](!0),s=h._ui.arrow[a][j.triangleSize](),t=Math.max(s+Math.max(0,q-o),Math.min(p-s-Math.max(0,o+p-(q+r)),p/2+m[j.point]-n[j.point]-l[j.size])),u={x:n.x+(g?t:0)+("r"===a?k.cx:0),y:n.y+(g?0:t)+("b"===a?k.cy:0)},v={actual:n,triangleOffset:t,absDiff:Math.abs(c-u.x)+Math.abs(d-u.y)};return h._ui.arrow[a].hide(),v}var h=this.element.data("ctxpopup"),i=this,j={},k,l;return h?(j={l:m("l",1,0),r:m("r",-1,0),t:m("t",0,1),b:m("b",0,-1)},a.each(j,function(a,c){if(k===b||c.absDiff<k)k=c.absDiff,l=a}),h._ui.arrow[l].show().triangle("option","offset",j[l].triangleOffset),j[l].actual):e.call(this,c,d,f,g)},a.tizen.popupwindow.prototype.open=function(b,d){var e=this.element.data("ctxpopup");e&&(this._setFade(!1),this._setShadow(!1),this._setCorners(!1),this._setOverlayTheme(null),this._setOption("overlayTheme",e.options.overlayTheme),e._ui.arrow.all.triangle("option","color",e._ui.container.css("background-color")),a(".ui-popupwindow").css("background","none")),c.call(this,b,d,!0)},a(document).bind("pagecreate create",function(b){var c=a(a.tizen.ctxpopup.prototype.options.initSelector,b.target);a.tizen.ctxpopup.prototype.enhanceWithin(b.target)})}(jQuery),function(a,b,c){a.widget("tizen.progress",a.mobile.widget,{options:{style:"circle",running:!1},show:function(){a(this.element).show()},hide:function(){a(this.element).hide()},_start:function(){this.init||(a(this.element).append(this.html),this.init=!0),this.show(),a(this.element).find(".ui-progress-"+this.options.style).addClass(this.runningClass)},_stop:function(){a(this.element).find(".ui-progress-"+this.options.style).removeClass(this.runningClass)},running:function(a){if(a===c)return this.options.running;this._setOption("running",a)},_setOption:function(a,c){if(a==="running"){if(typeof c!="boolean"){b.alert("running value MUST be boolean type!");return}this.options.running=c,this._refresh()}},_refresh:function(){this.options.running?this._start():this._stop()},_create:function(){var b=this,c=this.element,d=c.jqmData("style"),e,f;d?this.options.style=d:d=this.options.style,d=="circle"?(a(this.element).addClass("ui-progress-container-circle"),e='<div class="ui-progress-circle"></div>'):d==="pending"&&(a(this.element).addClass("ui-progressbar"),e='<div class="ui-progressbar-bg"><div class="ui-progress-pending"></div></div>'),this.html=a(e),f="ui-progress-"+d+"-running",a.extend(this,{init:!1,runningClass:f}),this._refresh()}}),a(document).bind("pagecreate create",function(b){a(b.target).find(":jqmData(role='progress')").progress()})}(jQuery,this),function(a,b,c){a.widget("tizen.progressbar",a.mobile.widget,{options:{value:0,max:100},min:0,_create:function(){this.element.addClass("ui-progressbar").attr({role:"progressbar","aria-valuemin":this.min,"aria-valuemax":this.options.max,"aria-valuenow":this._value()}),this.valueDiv=a("<div class='ui-progressbar-value'></div>").appendTo(this.element),this.valueDiv.wrap("<div class='ui-progressbar-bg'></div>"),this.oldValue=this._value(),this._refreshValue()},_destroy:function(){this.element.removeClass("ui-progressbar").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.valueDiv.remove()},value:function(a){return a===c?this._value():(this._setOption("value",a),this)},_setOption:function(a,b){a==="value"&&(this.options.value=b,this._refreshValue(),this._value()===this.options.max&&this.element.trigger("complete"))},_value:function(){var a=this.options.value;return typeof a!="number"&&(a=0),Math.min(this.options.max,Math.max(this.min,a))},_percentage:function(){return 100*this._value()/this.options.max},_refreshValue:function(){var a=this.value(),b=this._percentage();this.oldValue!==a&&(this.oldValue=a,this.element.trigger("change")),this.valueDiv.toggle(a>this.min).width(b.toFixed(0)+"%"),this.element.attr("aria-valuenow",a)}}),a(document).bind("pagecreate",function(b){a(b.target).find(":jqmData(role='progressbar')").progressbar()})}(jQuery,this),function(a,b){a.widget("tizen.searchbar",a.mobile.widget,{options:{theme:null,initSelector:"input[type='search'],:jqmData(type='search'), input[type='tizen-search'],:jqmData(type='tizen-search')"},_create:function(){function t(){setTimeout(function(){h.toggleClass("ui-input-clear-hidden",!c.val())},0)}function u(){g.addClass("ui-input-search-default").removeClass("ui-input-search-wide"),i.addClass("ui-btn-cancel-show").removeClass("ui-btn-cancel-hide")}function v(){g.addClass("ui-input-search-wide").removeClass("ui-input-search-default"),i.addClass("ui-btn-cancel-hide").removeClass("ui-btn-cancel-show"),t()}function w(){var b=a(c).jqmData("icon"),d=a("<div data-role='button' data-style='circle'></div>");d.appendTo(g.parent()).buttonMarkup({icon:b,corners:!0,shadow:!0}),d.addClass("ui-btn-search-front-icon")}var c=this.element,d=this.options,e=d.theme||a.mobile.getInheritedTheme(this.element,"c"),f=" ui-body-"+e,g,h,i,j,k,l,m,n,o,p,q,r=!1,s=!1;a("label[for='"+c.attr("id")+"']").addClass("ui-input-text"),typeof c[0].autocorrect!="undefined"&&!a.support.touchOverflow&&(c[0].setAttribute("autocorrect","off"),c[0].setAttribute("autocomplete","off")),g=c.wrap("<div class='ui-input-search ui-shadow-inset ui-corner-all ui-btn-shadow"+f+"'></div>").parent(),a(this.element).data("cancel-btn")===!0&&(r=!0,g.addClass("ui-input-search-default")),a(this.element).data("icon")!=b&&(s=!0,g.addClass("ui-search-bar-icon")),h=a("<a href='#' class='ui-input-clear' title='clear text'>clear text</a>").bind("click",function(a){if(c.attr("disabled")=="disabled")return!1;c.val("").focus().trigger("change"),h.addClass("ui-input-clear-hidden"),a.preventDefault()}).appendTo(g).buttonMarkup({icon:"deleteSearch",iconpos:"notext",corners:!0,shadow:!0}),t(),c.bind("paste cut keyup focus change blur",t),g.wrapAll("<div class='input-search-bar'></div>"),p=a("<div class='ui-image-search'></div>").appendTo(g),s&&w(),r&&(i=a("<div data-role='button' class='ui-input-cancel' title='clear text'>Cancel</div>").bind("click",function(a){if(c.attr("disabled")=="disabled")return!1;a.preventDefault(),a.stopPropagation(),c.val("").blur().trigger("change"),r&&v()}).appendTo(g.parent()).buttonMarkup({iconpos:"cancel",corners:!0,shadow:!0})),c.focus(function(){if(c.attr("disabled")=="disabled")return!1;r&&u(),g.addClass(a.mobile.focusClass)}).blur(function(){g.removeClass(a.mobile.focusClass)}),j=c.jqmData("default-text"),j!=b&&j.length>0&&(k="ui-input-default-text",l=j.replace(/\s/g,""),m=k+"-"+l,n=a("<style>."+m+":after"+"{content:"+"'"+j+"'"+"}"+"</style>"),a("html > head").append(n),o=a("<div></div>"),o.addClass(k),o.addClass(m),o.tap(function(a){c.blur(),c.focus()}),c.parent().append(o),c.focus(function(){c.parent().find("div.ui-input-default-text").addClass("ui-input-default-hidden")}).blur(function(){var a=c.val();a.length>0?c.parent().find("div.ui-input-default-text").addClass("ui-input-default-hidden"):c.parent().find("div.ui-input-default-text").removeClass("ui-input-default-hidden")})),c.attr("placeholder")||c.attr("placeholder","Search")},disable:function(){this.element.attr("disabled",!0),this.element.parent().addClass("ui-disabled"),a(this.element).blur(),this.element.parent().parent().find(".ui-input-cancel").addClass("ui-disabled")},enable:function(){this.element.attr("disabled",!1),this.element.parent().removeClass("ui-disabled"),this.element.parent().parent().find(".ui-input-cancel").removeClass("ui-disabled"),a(this.element).focus()}}),a(document).bind("pagecreate create",function(b){a.tizen.searchbar.prototype.enhanceWithin(b.target)})}(jQuery),function(a,b,c){a.widget("tizen.tizenslider",a.mobile.widget,{options:{popup:!0},popup:null,handle:null,handleText:null,_create:function(){this.currentValue=null,this.popupVisible=!1;var b=this,d=a(this.element),e,f,g,h,i,j,k,l,m,n,o;d.slider(),d.hide(),b.popup=a('<div class="ui-slider-popup"></div>'),g=d.jqmData("popup"),g!==c&&(b.options.popup=g==1),e=d.next(".ui-slider"),h=d.attr("data-icon"),e.wrap('<div class="ui-slider-container"></div>'),b.handle=e.find(".ui-slider-handle"),e.removeClass("ui-btn-corner-all"),e.find("*").removeClass("ui-btn-corner-all");switch(h){case"bright":case"volume":l=a('<div class="ui-slider-left-'+h+'"></div>'),m=a('<div class="ui-slider-right-'+h+'"></div>'),e.before(l),e.after(m),n=l.width()+16,o=m.width()+16;break;case"text":j=d.attr("data-text-left")===c?"":d.attr("data-text-left").substring(0,3),i=d.attr("data-text-right")===c?"":d.attr("data-text-right").substring(0,3),k=Math.max(j.length,i.length)+1,n=k+"rem",o=k+"rem",l=a('<div class="ui-slider-left-text" style="left:'+ -k+"rem; width:"+k+'rem;">'+'<span style="position:relative;top:0.4em;">'+j+"</span></div>"),m=a('<div class="ui-slider-right-text" style="right:'+ -k+"rem; width:"+k+'rem;">'+'<span style="position:relative;top:0.4em;">'+i+"</span></div>"),e.before(l),e.after(m)}h&&e.parent(".ui-slider-container").css({"margin-left":n,"margin-right":o}),e.append(a('<div class="ui-slider-handle-press"></div>')),b.handle_press=e.find(".ui-slider-handle-press"),b.handle_press.css("display","none"),e.before(b.popup),b.popup.hide(),b.handleText=e.find(".ui-btn-text"),b.updateSlider(),this.element.bind("change",function(){b.updateSlider()}),b.handle.bind("vmousedown",function(){b.showPopup()}),e.add(document).bind("vmouseup",function(){b.hidePopup()})},_handle_press_show:function(){this.handle_press.css("display","")},_handle_press_hide:function(){this.handle_press.css("display","none")},positionPopup:function(){var a=this.handle.offset();this.popup.offset({left:a.left+(this.handle.width()-this.popup.width())/2}),this.handle_press.offset({left:a.left,top:a.top})},updateSlider:function(){var a,b,c,d,e,f=function(a){var b=Math.abs(a),c;return b>999?c=4:b>99?c=3:b>9?c=2:c=1,a<0&&c++,c};this.handle.removeAttr("title"),e=this.element.val(),b=f(e);if(this.popupVisible){this.positionPopup();switch(b){case 1:case 2:a="1.5rem",d="0.15rem";break;case 3:a="1rem",d="0.5rem";break;default:a="0.8rem",d="0.5rem"}this.popup.css({"font-size":a,"padding-top":d})}if(e===this.currentValue)return;switch(b){case 1:a="0.95rem",c="0";break;case 2:a="0.85rem",c="-0.01rem";break;case 3:a="0.65rem",c="-0.05rem";break;default:a="0.45rem",c="-0.15rem"}a!=this.handleText.css("font-size")&&this.handleText.css({"font-size":a,top:c}),this.currentValue=e,this.handleText.text(e),this.popup.html(e),this.element.trigger("update",e)},showPopup:function(){if(!this.options.popup||this.popupVisible)return;this.popup.show(),this.popupVisible=!0,this._handle_press_show()},hidePopup:function(){if(!this.options.popup||!this.popupVisible)return;this.popup.hide(),this.popupVisible=!1,this._handle_press_hide()},_setOption:function(a,b){var c=b!==this.options[a];if(!c)return;switch(a){case"popup":this.options.popup=b,this.options.popup?this.updateSlider():this.hidePopup()}}}),a(document).bind("pagebeforecreate",function(d){a.data(b,"jqmSliderInitSelector")===c&&(a.data(b,"jqmSliderInitSelector",a.mobile.slider.prototype.options.initSelector),a.mobile.slider.prototype.options.initSelector=null)}),a(document).bind("pagecreate create",function(c){var d=a.data(b,"jqmSliderInitSelector");a(c.target).find(d).not("select").tizenslider(),a(c.target).find(d).filter("select").slider()})}(jQuery,this),function(a){a.widget("tizen.swipe",a.mobile.widget,{options:{theme:null},_create:function(){var a=this.element.jqmData("theme")||this.options.theme||this.element.parent().jqmData("theme")||"s";this.options.theme=a,this._isopen=!1,this.refresh()},refresh:function(){this._cleanupDom();var b=this,c,d,e,f,g;c="ui-body-"+this.options.theme,this.element.parent().hasClass("ui-listview")||this.element.parent().listview(),this.element.addClass("ui-swipe"),d=this.element.find(':jqmData(role="swipe-item-cover")'),f=this.element.find(':jqmData(role="swipe-item")'),this._covers=d,this._item=f,f.addClass("ui-swipe-item"),e=c,g=f.parent().attr("class").match(/ui\-body\-[a-z]|ui\-bar\-[a-z]/),d.each(function(){var c=a(this);g&&(e=g[0]),c.addClass("ui-swipe-item-cover"),c.addClass(e),c.has(".ui-swipe-item-cover-inner").length===0&&c.wrapInner(a("<span/>").addClass("ui-swipe-item-cover-inner"));if(!c.data("animateRight")||!c.data("animateLeft"))c.data("animateRight",function(){b._animateCover(c,110,f)}),c.data("animateLeft",function(){b._animateCover(c,0,f)});f.bind("swipeleft",c.data("animateLeft")),c.bind("swiperight",c.data("animateRight")),f.find(".ui-btn").bind("vclick",c.data("animateLeft"))})},_cleanupDom:function(){var a=this,b,c,d=b,e,f,g,h,i;b="ui-body-"+this.options.theme,this.element.removeClass("ui-swipe"),c=this.element.find(':jqmData(role="swipe-item-cover")'),e=this.element.find(':jqmData(role="swipe-item")'),e.removeClass("ui-swipe-item"),c.removeClass("ui-swipe-item-cover"),f=e.attr("class"),g=f&&f.match(/ui\-body\-[a-z]|ui\-bar\-[a-z]/),g&&(d=g[0]),c.removeClass(d),i=c.find(".ui-swipe-item-cover-inner"),i.children().unwrap(),h=i.text(),h&&(c.append(h),i.remove()),c.data("animateRight")&&c.data("animateLeft")&&(c.unbind("swiperight",c.data("animateRight")),e.unbind("swipeleft",c.data("animateLeft")),e.find(".ui-btn").unbind("vclick",c.data("animateLeft")),c.data("animateRight",null),c.data("animateLeft",null))},_animateCover:function(b,c,d){var e=this,f={easing:"linear",duration:"normal",queue:!0,complete:function(){b.trigger("animationend")}};a(this.element.parent()).find(":jqmData(role='swipe')").each(function(){this!==e.element.get(0)&&a(this).swipe("opened")&&a(this).swipe("close")}),c==110?this._isopen=!0:this._isopen=!1,b.stop(),b.clearQueue(),b.trigger("animationstart"),b.animate({left:c+"%"},f),c==0?d.animate({opacity:0},"slow"):d.animate({opacity:1},"slow")},destroy:function(){this._cleanupDom()},open:function(){var b=this;a(b._covers).each(function(){var c=a(this);b._animateCover(c,110,b._item)})},opened:function(){return this._isopen},close:function(){var b=this;a(b._covers).each(function(){var c=a(this);b._animateCover(c,0,b._item)})}}),a(document).bind("pagecreate",function(b){a(b.target).find(":jqmData(role='swipe')").swipe()})}(jQuery),function(a,b){a.widget("tizen.tabbar",a.mobile.widget,{options:{iconpos:"top",grid:null,defaultList:4,initSelector:":jqmData(role='tabbar')"},_create:function(){var c=this.element,d,e,f,g=a.mobile.listview.prototype.options.theme,h=window.innerWidth||a(window).width(),i=window.innerHeight||a(window).height(),j="<div class='ui-tabbar-divider ui-tabbar-divider-left'></div>",k="<div class='ui-tabbar-divider ui-tabbar-divider-right'></div>",l=!1,m=!1,n;n=h>i&&h-i,n?c.removeClass("ui-portrait-tabbar").addClass("ui-landscape-tabbar"):c.removeClass("ui-landscape-tabbar").addClass("ui-portrait-tabbar"),c.find("a").length&&(d=c.find("a"),f=d.filter(":jqmData(icon)").length?this.options.iconpos:b,e=d.html().length?!0:!1),c.parents(".ui-header").length&&c.parents(".ui-scrollview-view").length?(c.find("li").addClass("tabbar-scroll-li"),c.find("ul").addClass("tabbar-scroll-ul"),a(j).appendTo(c.parents(".ui-scrollview-clip")),a(k).appendTo(c.parents(".ui-scrollview-clip")),a(".ui-tabbar-divider-left").hide(),a(".ui-tabbar-divider-right").hide(),c.parents(".ui-scrollview-view").data("default-list")&&(this.options.defaultList=c.parents(".ui-scrollview-view").data("default-list")),c.find("li").css("width",window.innerWidth/this.options.defaultList+"px")):c.find("ul").children().length&&c.addClass("ui-navbar").find("ul").grid({grid:this.options.grid}),c.parents(".ui-footer").length&&c.find("li").addClass("ui-tab-btn-style"),c.siblings(".ui-title").length&&c.parents(".ui-header").addClass("ui-title-tabbar"),f||c.addClass("ui-tabbar-noicons"),e||c.addClass("ui-tabbar-notext"),e&&f&&c.parents(".ui-header").addClass("ui-title-tabbar-multiline"),c.find("a").length&&d.buttonMarkup({corners:!1,shadow:!1,iconpos:f}),c.find(".ui-state-persist").length&&c.addClass("ui-tabbar-persist"),c.delegate("a","vclick",function(b){d.not(".ui-state-persist").removeClass(a.mobile.activeBtnClass),a(this).addClass(a.mobile.activeBtnClass)}),c.addClass("ui-tabbar"),a(document).bind("pagebeforeshow",function(b,c){var d=a(b.target).find(":jqmData(role='footer')"),e=d.find(":jqmData(role='tabbar')"),f=e.siblings(":jqmData(icon='naviframe-more')"),g=e.siblings(".ui-btn-back");d.css("position","fixed").css("bottom",0).css("height",e.height()),f.length&&e.addClass("ui-tabbar-margin-more"),g.length&&e.addClass("ui-tabbar-margin-back"),l=!1}),a(window).bind("tabbar.scrollstart",function(b){a(b.target).find(".ui-tabbar").length&&(l=!0,m=!1)}),a(window).bind("tabbar.scrollstop",function(b){var d=a(b.target),e=c.find("li").eq(0),f=Math.abs(c.find("li").eq(0).offset().left),g=-1;m=!0,a(b.target).find(".ui-tabbar").length&&l==1&&(c.find("li").each(function(a){var b=c.find("li").eq(a).offset();Math.abs(b.left)<f&&(f=Math.abs(b.left),g=a,e=c.find("li").eq(a))}),d.length&&l==m&&g!=-1&&(l=!1,d.scrollview("scrollTo",-(window.innerWidth/a(b.target).find(".ui-tabbar").data("defaultList")*g),0,357))),a(".ui-tabbar-divider-left").hide(),a(".ui-tabbar-divider-right").hide()}),c.bind("touchstart vmousedown",function(b){var c=a(b.target).parents(".ui-scrollview-view");c.offset()&&(c.offset().left<0?a(".ui-tabbar-divider-left").show():a(".ui-tabbar-divider-left").hide(),c.width()-c.parents(".ui-scrollview-clip").width()==Math.abs(c.offset().left)?a(".ui-tabbar-divider-right").hide():a(".ui-tabbar-divider-right").show())}),this._bindTabbarEvents()},_bindTabbarEvents:function(){var b=this.element;a(window).bind("orientationchange",function(c,d){var e=window.innerWidth||a(window).width(),f=window.innerHeight||a(window).height(),g=e>f&&e-f;g?b.removeClass("ui-portrait-tabbar").addClass("ui-landscape-tabbar"):b.removeClass("ui-landscape-tabbar").addClass("ui-portrait-tabbar")})},_setDisabled:function(a,b){this.element.find("li").eq(b).attr("disabled",a),this.element.find("li").eq(b).attr("aria-disabled",a)},disable:function(a){this._setDisabled(!0,a),this.element.find("li").eq(a).addClass("ui-disabled")},enable:function(a){this._setDisabled(!1,a),this.element.find("li").eq(a).removeClass("ui-disabled")}}),a(document).bind("pagecreate create",function(b){a(a.tizen.tabbar.prototype.options.initSelector,b.target).tabbar()})}(jQuery),function(a,b,c,d){a.widget("tizen.tokentextarea",a.mobile.widget,{_focusStatus:null,_items:null,_viewWidth:0,_reservedWidth:0,_currentWidth:0,_fontSize:0,_anchorWidth:0,_labelWidth:0,_marginWidth:0,options:{label:"To : ",link:null,description:"+ {0}"},_create:function(){var b=this,d=this.element,e=d.jqmData("role"),f=this.options,g="ui-tokentextarea-link",h=a(c.createElement("input")),i=a(c.createElement("label")),j=a(c.createElement("a"));d.hide().empty().addClass("ui-"+e),a(i).text(f.label).addClass("ui-tokentextarea-label"),d.append(i),a(h).addClass("ui-tokentextarea-input ui-tokentextarea-input-visible ui-input-text ui-body-s"),d.append(h);if(f.link===null||a.trim(f.link).length<1||a(f.link).length===0)g+="-dim";a(j).attr("data-role","button").buttonMarkup({inline:!0,icon:"plus",style:"circle"}).attr("href",a.trim(f.link)).addClass("ui-tokentextarea-link-base").addClass(g),d.append(j),this._bindEvents(),b._focusStatus="init",d.show(),d.attr("tabindex",-1).focusin(function(a){b.focusIn()}),b._viewWidth=d.innerWidth(),b._reservedWidth+=b._calcBlockWidth(j),b._reservedWidth+=b._calcBlockWidth(i),b._fontSize=parseInt(a(j).css("font-size"),10),b._currentWidth=b._reservedWidth,b._modifyInputBoxWidth()},_bindEvents:function(){var b=this,d=b.element,e=b.options,f=d.find(".ui-tokentextarea-input"),g=d.find(".ui-tokentextarea-link-base"),h=!1;d.delegate("div","click",function(c){a(this).hasClass("ui-tokentextarea-sblock")&&b._removeTextBlock();var e=d.find("div.ui-tokentextarea-sblock");typeof e!="undefined"&&e.removeClass("ui-tokentextarea-sblock").addClass("ui-tokentextarea-block"),a(this).removeClass("ui-tokentextarea-block").addClass("ui-tokentextarea-sblock"),b._trigger("select")}),f.bind("keyup",function(c){var d=c.keyCode,e=a(f).val(),g=[],i;if(d===8)e.length===0&&b._validateTargetBlock();else if(d===13||d===186||d===188){if(e.length!==0){g=e.split(/[,;]/);for(i=0;i<g.length;i++)g[i].length!==0&&g[i].replace(/\s/g,"").length!==0&&b._addTextBlock(g[i])}f.val(""),h=!0}else b._unlockTextBlock();return!h}),g.click(function(){if(a(g).hasClass("ui-tokentextarea-link-dim"))return;a(f).removeClass("ui-tokentextarea-input-visible").addClass("ui-tokentextarea-input-invisible"),a.mobile.changePage(e.link,{transition:"slide",reverse:!1,changeHash:!1})}),a(c).bind("pagechange.mbe",function(c){if(d.innerWidth()===0)return;var e=d.find(".ui-tokentextarea-input");b._modifyInputBoxWidth(),a(f).removeClass("ui-tokentextarea-input-invisible").addClass("ui-tokentextarea-input-visible")}),d.bind("click",function(a){b._focusStatus==="focusOut"&&b.focusIn()})},_addTextBlock:function(b,d){if(arguments.length===0)return;if(!b)return;var e=this,f=e.element,g=b,h=d,i=null,j=null;e._viewWidth===0&&(e._viewWidth=f.innerWidth()),j=a(c.createElement("div")),j.text(g).addClass("ui-tokentextarea-block"),j.css({visibility:"hidden"}),i=f.find("div"),h!==null&&h<=i.length?a(i[h]).before(j):f.find(".ui-tokentextarea-input").before(j),j=e._ellipsisTextBlock(j),j.css({visibility:"visible"}),e._currentWidth+=e._calcBlockWidth(j),e._modifyInputBoxWidth(),e._trigger("add")},_removeTextBlock:function(){var a=this,b=this.element,c=b.find("div.ui-tokentextarea-sblock");c!==null&&c.length>0?(a._currentWidth-=a._calcBlockWidth(c),c.remove(),a._modifyInputBoxWidth(),this._trigger("remove")):b.find("div:last").removeClass("ui-tokentextarea-block").addClass("ui-tokentextarea-sblock")},_calcBlockWidth:function(b){return a(b).outerWidth(!0)},_unlockTextBlock:function(){var a=this.element,b=a.find("div.ui-tokentextarea-sblock");b&&b.removeClass("ui-tokentextarea-sblock").addClass("ui-tokentextarea-block")},_validateTargetBlock:function(){var a=this,b=a.element,c=b.find("div:last"),d=null;c.hasClass("ui-tokentextarea-sblock")?a._removeTextBlock():(d=b.find("div.ui-tokentextarea-sblock"),d.removeClass("ui-tokentextarea-sblock").addClass("ui-tokentextarea-block"),c.removeClass("ui-tokentextarea-block").addClass("ui-tokentextarea-sblock"))},_ellipsisTextBlock:function(b){var c=this,d=c.element,e=c._viewWidth-(c._labelWidth+c._anchorWidth)*2;return c._calcBlockWidth(b)>e&&a(b).width(e-c._marginWidth),b},_modifyInputBoxWidth:function(){var b=this,c=b.element,d=0,e=0,f=0,g=0,h=c.find("div"),i=0,j=0,k=10,l=c.find(".ui-tokentextarea-input");if(c.width()===0)return;b._labelWidth===0&&(b._labelWidth=c.find(".ui-tokentextarea-label").outerWidth(!0),b._anchorWidth=c.find(".ui-tokentextarea-link-base").outerWidth(!0),b._marginWidth=parseInt(a(l).css("margin-left"),10),b._marginWidth+=parseInt(a(l).css("margin-right"),10),b._viewWidth=c.innerWidth()),d=b._marginWidth,e=b._labelWidth,f=b._anchorWidth,g=b._viewWidth-e;for(j=0;j<h.length;j+=1)i=b._calcBlockWidth(h[j]),i>=g+f?i>=g?g=b._viewWidth-i:g=b._viewWidth:i>=g?g=b._viewWidth-i:g-=i;g-=d,g<f*2&&(g=b._viewWidth-d),a(l).width(g-f-k)},_stringFormat:function(a){var b=null,c=a,d=0;for(d=1;d<arguments.length;d+=1)b="{"+(d-1)+"}",c=c.replace(b,arguments[d]);return c},_resizeBlocks:function(){var b=this,c=b.element,d=c.find("div"),e=0;for(e=0;e<d.length;e+=1)a(d[e]).css("width","auto"),d[e]=b._ellipsisTextBlock(d[e])},focusIn:function(){if(this._focusStatus==="focusIn")return;var a=this.element;a.find("label").show(),a.find(".ui-tokentextarea-desclabel").remove(),a.find("div.ui-tokentextarea-sblock").removeClass("ui-tokentextarea-sblock").addClass("ui-tokentextarea-block"),a.find("div").show(),a.find(".ui-tokentextarea-input").removeClass("ui-tokentextarea-input-invisible").addClass("ui-tokentextarea-input-visible"),a.find("a").show(),this._modifyInputBoxWidth(),this._focusStatus="focusIn",a.removeClass("ui-tokentextarea-focusout").addClass("ui-tokentextarea-focusin")},focusOut:function(){if(this._focusStatus==="focusOut")return;var b=this,d=b.element,e=null,f="",g=0,h=10,i=d.find("label"),j=d.find("span"),k=d.find("div"),l=d.outerWidth(!0)-j.outerWidth(!0)-i.outerWidth(!0),m=0;d.find(".ui-tokentextarea-input").removeClass("ui-tokentextarea-input-visible").addClass("ui-tokentextarea-input-invisible"),d.find("a").hide(),k.hide(),l-=b._reservedWidth;for(g=0;g<k.length;g++){m=a(k[g]).outerWidth(!0);if(l-m<=0){h=g-1;break}a(k[g]).show(),l-=m}h!==k.length&&(f=b._stringFormat(b.options.description,k.length-h-1),e=a(c.createElement("label")),e.text(f),e.addClass("ui-tokentextarea-desclabel").addClass("ui-tokentextarea-desclabel"),a(k[h]).after(e)),this._focusStatus="focusOut",d.removeClass("ui-tokentextarea-focusin").addClass("ui-tokentextarea-focusout")},inputText:function(a){var b=this.element;return arguments.length===0?b.find(".ui-tokentextarea-input").val():(b.find(".ui-tokentextarea-input").val(a),a)},select:function(b){var c=this.element,d=null,e=null;if(this._focusStatus==="focusOut")return;return arguments.length===0?(d=c.find("div.ui-tokentextarea-sblock"),d?d.text():null):(this._unlockTextBlock(),e=c.find("div"),e.length>b&&(a(e[b]).removeClass("ui-tokentextarea-block").addClass("ui-tokentextarea-sblock"),this._trigger("select")),null)},add:function(a,b){if(this._focusStatus==="focusOut")return;this._addTextBlock(a,b)},remove:function(b){var c=this,d=this.element,e=d.find("div"),f=0;if(this._focusStatus==="focusOut")return;arguments.length===0?(e.remove(),this._trigger("clear")):isNaN(b)||(f=b<e.length?b:e.length-1,a(e[f]).remove(),this._trigger("remove")),c._modifyInputBoxWidth()},length:function(){return this.element.find("div").length},refresh:function(){var a=this,b=this.element;a._viewWidth=b.innerWidth(),a._resizeBlocks(),a._modifyInputBoxWidth()},destroy:function(){var a=this.element;a.find("label").remove(),a.find("div").undelegate("click").remove(),a.find("a").remove(),a.find(".ui-tokentextarea-input").unbind("keyup").remove(),this._trigger("destroy")}}),a(c).bind("pagecreate create",function(){a(":jqmData(role='tokentextarea')").tokentextarea()}),a(b).bind("resize",function(){a(":jqmData(role='tokentextarea')").tokentextarea("refresh")})}(jQuery,window,document),function(a,b){a.widget("tizen.triangle",a.tizen.widgetex,{options:{extraClass:"",offset:null,color:null,location:"top",initSelector:":jqmData(role='triangle')"},_create:function(){var b=a("<div></div>",{"class":"ui-triangle"});a.extend(this,{_triangle:b}),this.element.addClass("ui-triangle-container").append(b)},_doCSS:function(){var b=this.options.location||"top",c=a.inArray(b,["top","bottom"])===-1?"top":"left",d={"border-bottom-color":"top"===b?this.options.color:"transparent","border-top-color":"bottom"===b?this.options.color:"transparent","border-left-color":"right"===b?this.options.color:"transparent","border-right-color":"left"===b?this.options.color:"transparent"};d[c]=this.options.offset,this._triangle.removeAttr("style").css(d)},_setOffset:function(b){this.options.offset=b,this.element.attr("data-"+(a.mobile.ns||"")+"offset",b),this._doCSS()},_setExtraClass:function(b){this._triangle.addClass(b),this.options.extraClass=b,this.element.attr("data-"+(a.mobile.ns||"")+"extra-class",b)},_setColor:function(b){this.options.color=b,this.element.attr("data-"+(a.mobile.ns||"")+"color",b),this._doCSS()},_setLocation:function(b){this.element.removeClass("ui-triangle-container-"+this.options.location).addClass("ui-triangle-container-"+b),this._triangle.removeClass("ui-triangle-"+this.options.location).addClass("ui-triangle-"+b),this.options.location=b,this.element.attr("data-"+(a.mobile.ns||"")+"location",b),this._doCSS()}}),a(document).bind("pagecreate create",function(b){a(a.tizen.triangle.prototype.options.initSelector,b.target).not(":jqmData(role='none'), :jqmData(role='nojs')").triangle()})}(jQuery),function(a,b,c,d){function e(a,b){var c=a%b;return c<0&&(c=b+c),c}function f(b){this.options=a.extend({},b),this.easing="easeOutQuad",this.reset()}function h(){return Date.now()}var g={scrolling:0,done:1};a.extend(f.prototype,{start:function(a,b,c){this.state=b!==0?g.scrolling:g.done,this.pos=a,this.speed=b,this.duration=c,this.fromPos=0,this.toPos=0,this.startTime=h()},reset:function(){this.state=g.done,this.pos=0,this.speed=0,this.duration=0},update:function(){var b=this.state,c,d,e,f;return b==g.done?this.pos:(c=this.duration,d=h()-this.startTime,d=d>c?c:d,e=this.speed*(1-a.easing[this.easing](d/c,d,0,1,c)),f=this.pos+e,this.pos=f,d>=c&&(this.state=g.done),this.pos)},done:function(){return this.state==g.done},getPosition:function(){return this.pos}}),jQuery.widget("mobile.virtualgrid",jQuery.mobile.widget,{options:{template:"",direction:"y",rotation:!1},create:function(){this._create.apply(this,arguments)},_create:function(b){a.extend(this,{_$view:null,_$clip:null,_$rows:null,_tracker:null,_viewSize:0,_clipSize:0,_cellSize:d,_currentItemCount:0,_itemCount:1,_inheritedSize:null,_timerInterval:0,_timerID:0,_timerCB:null,_lastMove:null,_itemData:function(a){return null},_numItemData:0,_cacheItemData:function(a,b){},_totalRowCnt:0,_template:null,_maxViewSize:0,_modifyViewPos:0,_maxSize:0,_direction:!1,_didDrag:!0,_reservedPos:0,_scalableSize:0,_eventPos:0,_nextPos:0,_movePos:0,_lastY:0,_speedY:0,_lastX:0,_speedX:0,_rowsPerView:0,_fragment:null,_filterRatio:.9});var e=this,f=a(e.element),g=e.options,h=null;if(!b)return;if(!e._loadData(b))return;e._fragment=c.createDocumentFragment(),e._inheritedSize=e._getinheritedSize(e.element),e._direction=g.direction==="x"?!0:!1,e._$clip=a(e.element).addClass("ui-scrollview-clip").addClass("ui-virtualgrid-view"),h=a(c.createElement("div")).addClass("ui-scrollview-view"),e._clipSize=e._calculateClipSize(),e._$clip.append(h),e._$view=h,e._$clip.css("overflow","hidden"),e._$view.css("overflow","hidden"),e._scrollView=a.tizen.scrollview.prototype,e._initScrollView(),e._createTracker(),e._makePositioned(e._$clip),e._timerInterval=1e3/e.options.fps,e._timerID=0,e._timerCB=function(){e._handleMomentumScroll()},f.closest(".ui-content").addClass("ui-virtualgrid-content").css("overflow","hidden"),e._addBehaviors(),e._currentItemCount=0,e._createScrollBar(),e.refresh()},_loadData:function(a){var b=this;if(!a.itemData||typeof a.itemData!="function")return!1;b._itemData=a.itemData;if(!a.numItemData)return!1;if(typeof a.numItemData=="function")b._numItemData=a.numItemData();else{if(typeof a.numItemData!="number")return!1;b._numItemData=a.numItemData}return!0},_initLayout:function(){var a=this,b=a.options,c,d;for(c=-1;c<a._rowsPerView+1;c+=1)d=a._$rows[e(c,a._$rows.length)],a._$view.append(d);a._setElementTransform(-a._cellSize),a._replaceRow(a._$view.children().first(),a._totalRowCnt-1),b.rotation&&a._rowsPerView>=a._totalRowCnt&&a._replaceRow(a._$view.children().last(),0),a._setViewSize()},_setViewSize:function(){var a=this,b=0,c=0;a._direction?(c=a._cellSize*(a._rowsPerView+2),c=parseInt(c,10)+1,a._$view.width(c),a._viewSize=a._$view.width()):(a._$view.height(a._cellSize*(a._rowsPerView+2)),a._$clip.height(a._clipSize),a._viewSize=a._$view.height())},_getViewHeight:function(){var a=this;return a._$view.height()},refresh:function(){var b=this,c=b.options,d=0,e=0;b._template=a("#"+c.template);if(!b._template)return;d=b._calculateClipWidth(),e=b._calculateClipHeight(),b._$view.width(d).height(e),b._$clip.width(d).height(e),b._clipSize=b._calculateClipSize(),b._calculateColumnSize(),b._initPageProperty(),b._setScrollBarSize()},_initPageProperty:function(){var b=this,c=0,d,e=0,f=0,g=b._direction?"width":"height";e=b._calculateColumnCount(),f=parseInt(b._numItemData/e,10),b._totalRowCnt=b._numItemData%e===0?f:f+1,b._itemCount=e;if(b._cellSize<=0)return;c=b._clipSize/b._cellSize,c=Math.ceil(c),b._rowsPerView=parseInt(c,10),d=b._makeRows(c+2),a(b._$view).append(d.children()),b._$view.children().css(g,b._cellSize+"px"),b._$rows=b._$view.children().detach(),b._reservedPos=-b._cellSize,b._scalableSize=-b._cellSize,b._initLayout(),b._blockScroll=b._rowsPerView>b._totalRowCnt,b._maxSize=(b._totalRowCnt-b._rowsPerView)*b._cellSize,b._maxViewSize=b._rowsPerView*b._cellSize,b._modifyViewPos=-b._cellSize,b._clipSize<b._maxViewSize&&(b._modifyViewPos=-b._cellSize+(b._clipSize-b._maxViewSize))},_getinheritedSize:function(b){var c=a(b),d,e,f={ELEMENT_NODE:1,TEXT_NODE:3},g={isDefinedWidth:!1,isDefinedHeight:!1,width:0,height:0};while(c[0].nodeType===f.ELEMENT_NODE&&
-(g.isDefinedWidth===!1||g.isHeightDefined===!1))d=c[0].style.height,e=c[0].style.width,g.isDefinedHeight===!1&&d!==""&&(g.isDefinedHeight=!0,g.height=parseInt(d,10)),g.isDefinedWidth===!1&&e!==""&&(g.isDefinedWidth=!0,g.width=parseInt(e,10)),c=c.parent();return g},resize:function(){var a=this,b=null,c=0,d=0,e=0,f=0,g=0,h=0,i=0;d=a._calculateColumnCount(),d!=a._itemCount&&(e=parseInt(a._numItemData/d,10),a._totalRowCnt=a._numItemData%d===0?e:e+1,h=a._itemCount,a._itemCount=d,i=a._getClipPosition(),a._$view.hide(),f=a._replaceRows(d,h,a._totalRowCnt,i),a._maxSize=(a._totalRowCnt-a._rowsPerView)*a._cellSize,a._scalableSize+=-f*a._cellSize,a._reservedPos+=-f*a._cellSize,a._setScrollBarSize(),a._setScrollBarPosition(f),a._$view.show()),g=a._calculateClipSize(),g!==a._clipSize&&(c=g/a._cellSize,c=parseInt(Math.ceil(c),10),c>a._rowsPerView?a._increaseRow(c-a._rowsPerView):c<a._rowsPerView&&a._decreaseRow(a._rowsPerView-c),a._rowsPerView=c,a._clipSize=g,a._blockScroll=a._rowsPerView>a._totalRowCnt,a._maxSize=(a._totalRowCnt-a._rowsPerView)*a._cellSize,a._maxViewSize=a._rowsPerView*a._cellSize,a._clipSize<a._maxViewSize&&(a._modifyViewPos=-a._cellSize+(a._clipSize-a._maxViewSize)),a._direction?a._$clip.width(a._clipSize):a._$clip.height(a._clipSize),a._setScrollBarSize(),a._setScrollBarPosition(0),a._setViewSize())},_initScrollView:function(){var b=this;a.extend(b.options,b._scrollView.options),b.options.moveThreshold=10,b.options.showScrollBars=!1,b._getScrollHierarchy=b._scrollView._getScrollHierarchy,b._makePositioned=b._scrollView._makePositioned,b._set_scrollbar_size=b._scrollView._set_scrollbar_size,b._setStyleTransform=b._scrollView._setElementTransform,b._hideOverflowIndicator=b._scrollView._hideOverflowIndicator,b._showOverflowIndicator=b._scrollView._showOverflowIndicator,b._setGestureScroll=b._scrollView._setGestureScroll},_createTracker:function(){var a=this;a._tracker=new f(a.options),a._direction?(a._hTracker=a._tracker,a._$clip.width(a._clipSize)):(a._vTracker=a._tracker,a._$clip.height(a._clipSize))},_createScrollBar:function(){var b=this,c='<div class="ui-scrollbar ui-scrollbar-',d='"><div class="ui-scrollbar-track"><div class="ui-scrollbar-thumb"></div></div></div>';if(b.options.rotation)return;b._direction?(b._$clip.append(c+"x"+d),b._hScrollBar=a(b._$clip.children(".ui-scrollbar-x")),b._hScrollBar.find(".ui-scrollbar-thumb").addClass("ui-scrollbar-thumb-x")):(b._$clip.append(c+"y"+d),b._vScrollBar=a(b._$clip.children(".ui-scrollbar-y")),b._vScrollBar.find(".ui-scrollbar-thumb").addClass("ui-scrollbar-thumb-y"))},_setScrollBarSize:function(){var a=this,b=0,c=0,d,e,f;if(a.options.rotation)return;b=parseInt(a._maxViewSize/a._clipSize,10),a._direction?(d=a._hScrollBar.find(".ui-scrollbar-thumb"),e="width",c=d.width(),f="ui-scrollbar-thumb-x",a._hScrollBar.css("width",a._clipSize)):(d=a._vScrollBar.find(".ui-scrollbar-thumb"),e="height",f="ui-scrollbar-thumb-y",c=d.height(),a._vScrollBar.css("height",a._clipSize)),b>c?(d.removeClass(f),d.css(e,b)):b=c,a._itemScrollSize=parseFloat((a._clipSize-b)/(a._totalRowCnt-a._rowsPerView)),a._itemScrollSize=Math.round(a._itemScrollSize*100)/100},_setScrollBarPosition:function(a,b){var c=this,d=null,e="0px",f="0px";if(c.options.rotation)return;c._currentItemCount=c._currentItemCount+a,c._vScrollBar?(d=c._vScrollBar.find(".ui-scrollbar-thumb"),f=c._currentItemCount*c._itemScrollSize+"px"):(d=c._hScrollBar.find(".ui-scrollbar-thumb"),e=c._currentItemCount*c._itemScrollSize+"px"),c._setStyleTransform(d,e,f,b)},_hideScrollBars:function(){var a=this,b="ui-scrollbar-visible";if(a.options.rotation)return;a._vScrollBar?a._vScrollBar.removeClass(b):a._hScrollBar.removeClass(b)},_showScrollBars:function(){var a=this,b="ui-scrollbar-visible";if(a.options.rotation)return;a._vScrollBar?a._vScrollBar.addClass(b):a._hScrollBar.addClass(b)},centerTo:function(b){var c=this,d,e=0,f=0;if(!c.options.rotation)return;for(d=0;d<c._$rows.length;d++)if(a(c._$rows[d]).hasClass(b)){c._direction?e=-(d*c._cellSize-c._clipSize/2+c._cellSize*2):f=-(d*c._cellSize-c._clipSize/2+c._cellSize*2),c.scrollTo(e,f);return}},scrollTo:function(a,b,c){var d=this;d._direction?(d._sx=d._reservedPos,d._reservedPos=a):(d._sy=d._reservedPos,d._reservedPos=b),d._scrollView.scrollTo.apply(this,[a,b,c])},getScrollPosition:function(){return this.direction?{x:-this._ry,y:0}:{x:0,y:-this._ry}},_setScrollPosition:function(a,b){var c=this,d=c._scalableSize,f=c._direction?a:b,g=f-d,h=parseInt(g/c._cellSize,10),i=0,j=0,k=null;if(c._blockScroll)return;if(!c.options.rotation){if(g>0&&f>=-c._cellSize&&c._scalableSize>=-c._cellSize){c._stopMScroll(),c._scalableSize=-c._cellSize,c._setElementTransform(-c._cellSize);return}if(g<0&&c._scalableSize<=-(c._maxSize+c._cellSize)){c._stopMScroll(),c._scalableSize=-(c._maxSize+c._cellSize),c._setElementTransform(c._modifyViewPos);return}}if(h>0)for(i=0;i<h;i++)j=-parseInt(d/c._cellSize+i+3,10),k=c._$view.children().last().detach(),c._replaceRow(k,e(j,c._totalRowCnt)),c._$view.prepend(k),c._setScrollBarPosition(-1);else if(h<0)for(i=0;i>h;i--)j=c._rowsPerView-parseInt(d/c._cellSize+i,10),k=c._$view.children().first().detach(),c._replaceRow(k,e(j,c._totalRowCnt)),c._$view.append(k),c._setScrollBarPosition(1);c._scalableSize+=h*c._cellSize,c._setElementTransform(f-c._scalableSize-c._cellSize)},_setElementTransform:function(a){var b=this,c=0,d=0;b._direction?c=a+"px":d=a+"px",b._setStyleTransform(b._$view,c,d)},_handleMomentumScroll:function(){var a=this,b=a.options,c=!1,d=this._$view,e=0,f=0,g=a._tracker;g&&(g.update(),a._direction?e=g.getPosition():f=g.getPosition(),c=!g.done()),a._setScrollPosition(e,f),b.rotation?a._reservedPos=a._direction?e:f:(c=!g.done(),a._reservedPos=a._direction?e:f,a._reservedPos=a._reservedPos<=-(a._maxSize-a._modifyViewPos)?-(a._maxSize+a._cellSize):a._reservedPos,a._reservedPos=a._reservedPos>-a._cellSize?-a._cellSize:a._reservedPos),a._$clip.trigger(a.options.updateEventName,[{x:e,y:f}]),c?a._timerID=setTimeout(a._timerCB,a._timerInterval):a._stopMScroll()},_startMScroll:function(a,b){var c=this;c._direction?c._sx=c._reservedPos:c._sy=c._reservedPos,c._scrollView._startMScroll.apply(c,[a,b])},_stopMScroll:function(){this._scrollView._stopMScroll.apply(this)},_enableTracking:function(){a(c).bind(this._dragMoveEvt,this._dragMoveCB),a(c).bind(this._dragStopEvt,this._dragStopCB)},_disableTracking:function(){a(c).unbind(this._dragMoveEvt,this._dragMoveCB),a(c).unbind(this._dragStopEvt,this._dragStopCB)},_handleDragStart:function(a,b,c){var d=this;d._scrollView._handleDragStart.apply(this,[a,b,c]),d._eventPos=d._direction?b:c,d._nextPos=d._reservedPos},_handleDragMove:function(a,b,c){var d=this,e=b-d._lastX,f=c-d._lastY,g=0,i=0;return d._lastMove=h(),d._speedX=e,d._speedY=f,d._didDrag=!0,d._lastX=b,d._lastY=c,d._direction?(d._movePos=b-d._eventPos,g=d._nextPos+d._movePos):(d._movePos=c-d._eventPos,i=d._nextPos+d._movePos),d._showScrollBars(),d._setScrollPosition(g,i),!1},_handleDragStop:function(a){var b=this;return b._reservedPos=b._movePos?b._nextPos+b._movePos:b._reservedPos,b._scrollView._handleDragStop.apply(this,[a]),b._didDrag?!1:d},_addBehaviors:function(){var d=this;d.options.eventType==="mouse"?(d._dragStartEvt="mousedown",d._dragStartCB=function(a){return d._handleDragStart(a,a.clientX,a.clientY)},d._dragMoveEvt="mousemove",d._dragMoveCB=function(a){return d._handleDragMove(a,a.clientX,a.clientY)},d._dragStopEvt="mouseup",d._dragStopCB=function(a){return d._handleDragStop(a,a.clientX,a.clientY)},d._$view.bind("vclick",function(a){return!d._didDrag})):(d._dragStartEvt="touchstart",d._dragStartCB=function(a){var b=a.originalEvent.targetTouches[0];return d._handleDragStart(a,b.pageX,b.pageY)},d._dragMoveEvt="touchmove",d._dragMoveCB=function(a){var b=a.originalEvent.targetTouches[0];return d._handleDragMove(a,b.pageX,b.pageY)},d._dragStopEvt="touchend",d._dragStopCB=function(a){return d._handleDragStop(a)}),d._$view.bind(d._dragStartEvt,d._dragStartCB),d._$view.delegate(".virtualgrid-item","click",function(b){var c=a(this);c.trigger("select",this)}),a(b).bind("resize",function(b){var c=0,e=a(".ui-virtualgrid-view");e.length!==0&&(d._direction?(c=d._calculateClipHeight(),d._$view.height(c),d._$clip.height(c)):(c=d._calculateClipWidth(),d._$view.width(c),d._$clip.width(c)),d.resize())}),a(c).one("pageshow",function(c){var e=a(d.element).parents(".ui-page"),f=e.find(":jqmData(role='header')"),g=e.find(":jqmData(role='footer')"),h=e.find(":jqmData(role='content')"),i=g?g.height():0,j=f?f.height():0;e&&h&&(h.height(b.innerHeight-j-i).css("overflow","hidden"),h.addClass("ui-virtualgrid-content"))})},_calculateClipSize:function(){var a=this,b=0;return a._direction?b=a._calculateClipWidth():b=a._calculateClipHeight(),b},_calculateClipWidth:function(){var c=this,d=a(c.element),e=a(c.element).parent(),f=0,g=a(b).width();return c._inheritedSize.isDefinedWidth?c._inheritedSize.width:(e.hasClass("ui-content")?(f=parseInt(e.css("padding-left"),10),g-=f||0,f=parseInt(e.css("padding-right"),10),g-=f||0):g=d.width(),g)},_calculateClipHeight:function(){var c=this,d=a(c.element),e=a(c.element).parent(),f=null,g=null,h=0,i=a(b).height();return c._inheritedSize.isDefinedHeight?c._inheritedSize.height:(e.hasClass("ui-content")?(h=parseInt(e.css("padding-top"),10),i-=h||0,h=parseInt(e.css("padding-bottom"),10),i-=h||0,f=e.siblings(".ui-header"),g=e.siblings(".ui-footer"),f&&(f.outerHeight(!0)===null?i-=a(".ui-header").outerHeight()||0:i-=f.outerHeight(!0)),g&&(i-=g.outerHeight(!0))):i=d.height(),i)},_calculateColumnSize:function(){var a=this,b,c;b=a._makeRows(1),a._$view.append(b.children().first()),a._direction?(a._viewSize=a._$view.width(),c=a._$view.children().first().children().first(),a._cellSize=c.outerWidth(!0),a._cellOtherSize=c.outerHeight(!0)):(a._viewSize=a._$view.height(),c=a._$view.children().first().children().first(),a._cellSize=c.outerHeight(!0),a._cellOtherSize=c.outerWidth(!0)),b.remove(),a._$view.children().remove()},_calculateColumnCount:function(){var b=this,c=a(b.element),d=b._direction?c.innerHeight():c.innerWidth(),e=0;return b._direction?d-=parseInt(c.css("padding-top"),10)+parseInt(c.css("padding-bottom"),10):d-=parseInt(c.css("padding-left"),10)+parseInt(c.css("padding-right"),10),e=parseInt(d/b._cellOtherSize,10),e>0?e:1},_getClipPosition:function(){var a=this,b=null,c=null,d=-a._cellSize,e=a._$view.closest(".ui-scrollview-view");return e&&(b=e.css("-webkit-transform"),c=b.substr(7),c=c.substr(0,c.length-1),c=c.split(", "),d=Math.abs(c[5])),d},_makeRows:function(b){var c=this,d=c.options,e=0,f=null,g=null;g=a(c._createElement("div")),g.addClass("ui-scrollview-view");for(e=0;e<b;e+=1)f=c._makeRow(c._template,e),c._direction&&f.css("top",0).css("left",e*c._cellSize),g.append(f);return g},_makeRow:function(b,c){var d=this,e=d.options,f=c*d._itemCount,g=null,h=null,i=0,j=d._direction?"top":"left",k=d._direction?"ui-virtualgrid-wrapblock-x":"ui-virtualgrid-wrapblock-y",l=d._direction?"top":"left",m=a(d._createElement("div"));m.addClass(k).attr("row-index",c);for(i=0;i<d._itemCount;i++)g=d._makeHtmlData(b,f,i),g&&m.append(g),f+=1;return m},_makeHtmlData:function(b,c,d){var e=this,f=null,g=null,h=e._direction?"top":"left";return g=e._itemData(c),g&&(f=b.tmpl(g),a(f).css(h,d*e._cellOtherSize).addClass("virtualgrid-item")),f},_increaseRow:function(b){var c=this,d=c.options.rotation,e=null,f=0,g=0,h=0,i=c._scalableSize,j=0;f=parseInt(a(c._$view.children().first()).attr("row-index"),10)-1,g=parseInt(a(c._$view.children()[c._rowsPerView]).attr("row-index"),10)+1;for(j=1;j<=b;j++)g+j>=c._totalRowCnt?(e=c._makeRow(c._template,f),c._$view.prepend(e),f-=1):(e=c._makeRow(c._template,g+j),c._$view.append(e)),c._direction?e.width(c._cellSize):e.height(c._cellSize)},_decreaseRow:function(a){var b=this,c=0;for(c=0;c<a;c++)b._$view.children().last().remove()},_replaceRows:function(b,c,d,f){var g=this,h=g._$view.children(),i=0,j=0,k=0,l=1,m=g._filterRatio*g._cellSize+g._cellSize,n=0;m<f&&(l+=1),i=parseInt(a(h[l]).attr("row-index"),10),i===0?j=d-l:(j=Math.round(i*c/b),j+g._rowsPerView>=d&&(j=d-g._rowsPerView),k=i-j,j-=l);for(n=0;n<h.length;n+=1)g._replaceRow(h[n],e(j,g._totalRowCnt)),j++;return-k},_replaceRow:function(b,c){var d=this,e=d.options,f=null,g=null,h=b.attr?b:a(b),i=null,j=null,k=null,l=0,m=0,n=null;f=h.attr("row-index",c).children();if(f.length!==d._itemCount){h.children().remove(),n=a(d._makeRow(d._template,c)),h.append(n.children()),n.remove();return}m=c*d._itemCount;for(l=0;l<d._itemCount;l+=1)g=f.eq(l),i=d._itemData(m),g&&i?(k=d._template,j=k.tmpl(i),d._replace(g,j,!1),j.remove(),m++):g&&!i&&g.remove()},_createElement:function(a){var b=c.createElement(a);return this._fragment.appendChild(b),b},_replace:function(b,c,d){var e={ELEMENT_NODE:1,TEXT_NODE:3};a(b).find(".ui-li-text-main",".ui-li-text-sub","ui-btn-text").each(function(b){var d=a(this),f=a(c).find(".ui-li-text-main",".ui-li-text-sub","ui-btn-text").eq(b).text();a(d).contents().filter(function(){return this.nodeType==e.TEXT_NODE}).get(0).data=f}),a(b).find("img").each(function(b){var d=a(this),e=a(c).find("img").eq(b).attr("src");a(d).attr("src",e)}),a(b).removeData(),d&&a(b).data(d,a(c).data(d))}}),a(c).bind("pagecreate create",function(b){a(":jqmData(role='virtualgrid')").virtualgrid()})}(jQuery,window,document),function(a,b){var c={},d=0,e=1,f=-1;a.widget("tizen.virtuallistview",a.mobile.widget,{options:{theme:"s",countTheme:"s",headerTheme:"s",dividerTheme:"s",splitIcon:"arrow-r",splitTheme:"s",inset:!1,id:"",childSelector:" li",dbtable:"",template:"",dbkey:!1,scrollview:!1,row:100,page_buf:30,initSelector:":jqmData(role='virtuallistview')"},_stylerMouseUp:function(){a(this).addClass("ui-btn-up-s"),a(this).removeClass("ui-btn-down-s")},_stylerMouseDown:function(){a(this).addClass("ui-btn-down-s"),a(this).removeClass("ui-btn-up-s")},_stylerMouseOver:function(){a(this).toggleClass("ui-btn-hover-s")},_stylerMouseOut:function(){a(this).toggleClass("ui-btn-hover-s"),a(this).addClass("ui-btn-up-s"),a(this).removeClass("ui-btn-down-s")},_pushData:function(b){var c=this.options,d,e=a("#"+b),f=c.row>this._numItemData?this._numItemData:c.row,g;for(d=0;d<f;d++)g=e.tmpl(this._itemData(d)),a(c.id).append(a(g).attr("id",c.itemIDPrefix+d));a(c.id).trigger("create")},_reposition:function(b){var c,d=this,e,f;b.data?c=b.data:c=b,a(c.id+c.childSelector).size()>0&&(d._title_h=a(c.id+c.childSelector+":first").position().top,d._line_h=a(c.id+c.childSelector+":first").outerHeight(),d._container_w=a(c.id).innerWidth(),e=parseInt(a(c.id+c.childSelector).css("padding-left"),10)+parseInt(a(c.id+c.childSelector).css("padding-right"),10),a(c.id+">"+c.childSelector).addClass("position_absolute").addClass("ui-btn-up-s").bind("mouseup",d._stylerMouseUp).bind("mousedown",d._stylerMouseDown).bind("mouseover",d._stylerMouseOver).bind("mouseout",d._stylerMouseOut)),a(c.id+">"+c.childSelector).each(function(b){f=parseInt(a(this).css("margin-left"),10)+parseInt(a(this).css("margin-right"),10),a(this).css("top",d._title_h+d._line_h*b+"px").css("width",d._container_w-e-f)}),a(c.id).height(d._numItemData*d._line_h)},_resize:function(b){var c,d=this,e,f;b.data?c=b.data:c=b,d._container_w=a(c.id).innerWidth(),e=parseInt(a(c.id+c.childSelector).css("padding-left"),10)+parseInt(a(c.id+c.childSelector).css("padding-right"),10),a(c.id+c.childSelector).each(function(b){f=parseInt(a(this).css("margin-left"),10)+parseInt(a(this).css("margin-right"),10),a(this).css("width",d._container_w-e-f)})},_scrollmove:function(b){function j(){return d.scrollview?h.viewTop():i.viewTop()}function k(a){var b=!1;b&&console.log(">>virtualllist: "+a)}function l(b,c){function t(b,c,d){var e={ELEMENT_NODE:1,TEXT_NODE:3},f,g,h,i,j;a(c).find(".ui-li-text-main",".ui-li-text-sub",".ui-li-text-sub2","ui-btn-text").each(function(b){f=a(this),h=a(d).find(".ui-li-text-main",".ui-li-text-sub","ui-btn-text").eq(b).text(),a(f).contents().filter(function(){return this.nodeType==e.TEXT_NODE}).get(0).data=h}),a(c).find("img").each(function(b){var c=a(this);i=a(d).find("img").eq(b).attr("src"),a(c).attr("src",i)}),a(c).removeData()}function u(b,c,d){var e,f,g,h;return k(">> move item: "+c+" --> "+d),f=a("#"+b.options.itemIDPrefix+c),!f||!f.length?!1:(h=a("#"+b.options.template),h&&(g=h.tmpl(b._itemData(d)),t(b,f,g),g.remove()),f.css("top",d*b._line_h).attr("id",b.options.itemIDPrefix+d),!0)}var d,e,g,h=b._first_index,i=b._last_index,m,n,o,p,q=b.options.row,r,s;d=j(),r=Math.ceil(q/3),e=Math.floor(d/b._line_h)-r,g=e+q-1,e<0?(g+=-e,e=0):g>b._numItemData-1&&(e-=g-(b._numItemData-1),g=b._numItemData-1),m=e-h,k("cy="+d+", oti="+h+", obi="+i+", cti="+e+", cbi="+g+", dti="+m);if(0==m){b.timerStillCount+=1;if(b.timerStillCount<12){k("dti=0 "+b.timerStillCount+" times"),b.timerMoveID=setTimeout(l,f,b);return}k("dti=0 "+b.timerStillCount+" times. End timer."),b.timerStillCount=0,b.timerMoveID&&(clearTimeout(b.timerMoveID),b.timerMoveID=null)}else{b.timerStillCount=0,Math.abs(m)>=q?(n=h,o=i,p=m,k(">>> WHOLE CHANGE! delta="+p)):(m>0?(n=h,o=h+m-1,p=q):(n=i+m+1,o=i,p=-q),k(">>> partial change. delta="+p));for(s=n;s<=o;s++)u(b,s,s+p);b._first_index=e,b._last_index=g,b.timerMoveID=setTimeout(l,f,b)}return}var c=b.data,d=c.options,e=c._num_top_items,f=100,g,h,i;h={viewTop:function(){var b=a(d.id).parentsUntil(".ui-page").find(".ui-scrollview-view"),c=b.css("-webkit-transform"),e="0,0,0,0,0,0";return c&&(e=c.replace(/matrix\s*\((.*)\)/,"$1")),-parseInt(e.split(",")[5],10)}},i={viewTop:function(){return a(window).scrollTop()}},c.timerStillCount=0,c.timerMoveID&&(clearTimeout(c.timerMoveID),c.timerMoveID=null),l(c)},_recreate:function(b){var c=this,e=this.options;a(e.id).empty(),c._numItemData=b.length,c._direction=d,c._first_index=0,c._last_index=e.row-1,c._pushData(e.template),e.childSelector==" ul"&&a(e.id+" ul").swipelist(),a(e.id).virtuallistview(),c.refresh(!0),c._reposition(e)},_initList:function(){var b=this,c=this.options;b._pushData(c.template),a(c.id).parentsUntil(".ui-page").parent().one("pageshow",function(){setTimeout(function(){b._reposition(c)},0)}),a(document).bind("scrollstart.virtuallist scrollstop.vrituallist",b,b._scrollmove),a(window).bind("resize.virtuallist",b._resize),c.childSelector==" ul"&&a(c.id+" ul").swipelist(),b.refresh(!0)},create:function(){var a=this.options;this._create.apply(this,arguments),this._reposition(a)},_create:function(b){a.extend(this,{_itemData:function(a){return null},_numItemData:0,_cacheItemData:function(a,b){},_title_h:0,_container_w:0,_minimum_row:100,_direction:d,_first_index:0,_last_index:0,_num_top_items:0});var c=this,e=this.options,f=this.element,g=a('<div class="ui-virtuallist"/>'),h=a("<ul></ul>"),i=f.find(':jqmData(role="virtuallistview" )'),j=null,k=this,l,m;f.addClass(function(a,b){return b+" ui-listview ui-virtual-list-container"+(c.options.inset?" ui-listview-inset ui-corner-all ui-shadow ":"")}),e.itemIDPrefix=f.attr("id")+"_",e.id="#"+f.attr("id"),a(e.id).bind("pagehide",function(b){a(e.id).empty()}),a(".ui-scrollview-clip").size()>0?e.scrollview=!0:e.scrollview=!1,f.data("row")&&(e.row=f.data("row"),e.row<c._minimum_row&&(e.row=c._minimum_row),e.page_buf=parseInt(e.row/2,10));if(b){if(!b.itemData||typeof b.itemData!="function")return;c._itemData=b.itemData;if(!b.numItemData)return;if(typeof b.numItemData=="function")c._numItemData=b.numItemData();else{if(typeof b.numItemData!="number")return;c._numItemData=b.numItemData}}else{console.warn("WARNING: The data interface of virtuallist is changed. \nOld data interface(data-dbtable) is still supported, but will be removed in next version. \nPlease fix your code soon!");if(!a(e.id).hasClass("vlLoadSuccess"))return;l=f.jqmData("dbtable"),m=window[l],a(e.id).empty(),m||(m={}),c._itemData=function(a){return m[a]},c._numItemData=m.length}f.data("template")&&(e.template=f.data("template"),f.data("swipelist")==1?e.childSelector=" ul":e.childSelector=" li"),f.data("dbkey")&&(e.dbkey=f.data("dbkey")),c._first_index=0,c._last_index=e.row-1,c._initList()},destroy:function(){var b=this.options;a(document).unbind("scrollstop"),a(window).unbind("resize.virtuallist"),a(b.id).empty(),this.timerMoveID&&(clearTimeout(this.timerMoveID),this.timerMoveID=null)},_itemApply:function(b,c){var d=c.find(".ui-li-count");d.length&&c.addClass("ui-li-has-count"),d.addClass("ui-btn-up-"+(b.jqmData("counttheme")||this.options.countTheme)+" ui-btn-corner-all"),c.find("h1, h2, h3, h4, h5, h6").addClass("ui-li-heading").end().find("p, dl").addClass("ui-li-desc").end().find(">img:eq(0), .ui-link-inherit>img:eq(0)").addClass("ui-li-thumb").each(function(){c.addClass(a(this).is(".ui-li-icon")?"ui-li-has-icon":"ui-li-has-thumb")}).end().find(".ui-li-aside").each(function(){var b=a(this);b.prependTo(b.parent())})},_removeCorners:function(a,b){var c="ui-corner-top ui-corner-tr ui-corner-tl",d="ui-corner-bottom ui-corner-br ui-corner-bl";a=a.add(a.find(".ui-btn-inner, .ui-li-link-alt, .ui-li-thumb")),b==="top"?a.removeClass(c):b==="bottom"?a.removeClass(d):a.removeClass(c+" "+d)},_refreshCorners:function(a){var b,c,d,e;this.options.inset&&(b=this.element.children("li"),c=a?b.not(".ui-screen-hidden"):b.filter(":visible"),this._removeCorners(b),d=c.first().addClass("ui-corner-top"),d.add(d.find(".ui-btn-inner")).find(".ui-li-link-alt").addClass("ui-corner-tr").end().find(".ui-li-thumb").not(".ui-li-icon").addClass("ui-corner-tl"),e=c.last().addClass("ui-corner-bottom"),e.add(e.find(".ui-btn-inner")).find(".ui-li-link-alt").addClass("ui-corner-br").end().find(".ui-li-thumb").not(".ui-li-icon").addClass("ui-corner-bl"))},refresh:function(b){this.parentPage=this.element.closest(".ui-page"),this._createSubPages();var c=this.options,d=this.element,e=this,f=d.jqmData("dividertheme")||c.dividerTheme,g=d.jqmData("splittheme"),h=d.jqmData("spliticon"),i=d.children("li"),j=a.support.cssPseudoElement||!a.nodeName(d[0],"ol")?0:1,k,l,m,n,o,p,q,r,s,t,u;j&&d.find(".ui-li-dec").remove();for(s=0,t=i.length;s<t;s++){k=i.eq(s),l="ui-li";if(b||!k.hasClass("ui-li"))u=k.jqmData("theme")||c.theme,n=k.children("a"),n.length?(r=k.jqmData("icon"),k.buttonMarkup({wrapperEls:"div",shadow:!1,corners:!1,iconpos:"right",icon:!1,theme:u}),r!=0&&n.length==1&&k.addClass("ui-li-has-arrow"),n.first().addClass("ui-link-inherit"),n.length>1&&(l+=" ui-li-has-alt",o=n.last(),p=g||o.jqmData("theme")||c.splitTheme,o.appendTo(k).attr("title",o.getEncodedText()).addClass("ui-li-link-alt").empty().buttonMarkup({shadow:!1,corners:!1,theme:u,icon:!1,iconpos:!1}).find(".ui-btn-inner").append(a("<span />").buttonMarkup({shadow:!0,corners:!0,theme:p,iconpos:"notext",icon:h||o.jqmData("icon")||c.splitIcon})))):k.jqmData("role")==="list-divider"?(l+=" ui-li-divider ui-btn ui-bar-"+f,k.attr("role","heading"),j&&(j=1)):l+=" ui-li-static ui-body-"+u;j&&l.indexOf("ui-li-divider")<0&&(q=k.is(".ui-li-static:first")?k:k.find(".ui-link-inherit"),q.addClass("ui-li-jsnumbering").prepend("<span class='ui-li-dec'>"+j++ +". </span>")),k.add(k.children(".ui-btn-inner")).addClass(l),e._itemApply(d,k)}this._refreshCorners(b)},_idStringEscape:function(a){return a.replace(/\W/g,"-")},_createSubPages:function(){var b=this.element,d=b.closest(".ui-page"),e=d.jqmData("url"),f=e||d[0][a.expando],g=b.attr("id"),h=this.options,i="data-"+a.mobile.ns,j=this,k=d.find(":jqmData(role='footer')").jqmData("id"),l,m;typeof c[f]=="undefined"&&(c[f]=-1),g=g||++c[f],a(b.find("li>ul, li>ol").toArray().reverse()).each(function(c){var d=this,f=a(this),j=f.attr("id")||g+"-"+c,m=f.parent(),n,p=n.first().getEncodedText(),q=(e||"")+"&"+a.mobile.subPageUrlKey+"="+j,r=f.jqmData("theme")||h.theme,s=f.jqmData("counttheme")||b.jqmData("counttheme")||h.countTheme,t,u;n=a(f.prevAll().toArray().reverse()),n=n.length?n:a("<span>"+a.trim(m.contents()[0].nodeValue)+"</span>"),l=!0,t=f.detach().wrap("<div "+i+"role='page' "+i+"url='"+q+"' "+i+"theme='"+r+"' "+i+"count-theme='"+s+"'><div "+i+"role='content'></div></div>").parent().before("<div "+i+"role='header' "+i+"theme='"+h.headerTheme+"'><div class='ui-title'>"+p+"</div></div>").after(k?a("<div "+i+"role='footer' "+i+"id='"+k+"'>"):"").parent().appendTo(a.mobile.pageContainer),t.page(),u=m.find("a:first"),u.length||(u=a("<a/>").html(n||p).prependTo(m.empty())),u.attr("href","#"+q)}).virtuallistview(),l&&d.is(":jqmData(external-page='true')")&&d.data("page").options.domCache===!1&&(m=function(b,c){var f=c.nextPage,g;c.nextPage&&(g=f.jqmData("url"),g.indexOf(e+"&"+a.mobile.subPageUrlKey)!==0&&(j.childPages().remove(),d.remove()))},d.unbind("pagehide.remove").bind("pagehide.remove",m))},childPages:function(){var b=this.parentPage.jqmData("url");return a(":jqmData(url^='"+b+"&"+a.mobile.subPageUrlKey+"')")}}),a(document).bind("pagecreate create",function(b){a(a.tizen.virtuallistview.prototype.options.initSelector,b.target).virtuallistview()})}(jQuery),function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z;c=function(a){return new c.prototype.init(a)},typeof require!="undefined"&&typeof exports!="undefined"&&typeof module!="undefined"?module.exports=c:a.Globalize=c,c.cultures={},c.prototype={constructor:c,init:function(a){return this.cultures=c.cultures,this.cultureSelector=a,this}},c.prototype.init.prototype=c.prototype,c.cultures["default"]={name:"en",englishName:"English",nativeName:"English",isRTL:!1,language:"en",numberFormat:{pattern:["-n"],decimals:2,",":",",".":".",groupSizes:[3],"+":"+","-":"-",NaN:"NaN",negativeInfinity:"-Infinity",positiveInfinity:"Infinity",percent:{pattern:["-n %","n %"],decimals:2,groupSizes:[3],",":",",".":".",symbol:"%"},currency:{pattern:["($n)","$n"],decimals:2,groupSizes:[3],",":",",".":".",symbol:"$"}},calendars:{standard:{name:"Gregorian_USEnglish","/":"/",":":":",firstDay:0,days:{names:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],namesAbbr:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],namesShort:["Su","Mo","Tu","We","Th","Fr","Sa"]},months:{names:["January","February","March","April","May","June","July","August","September","October","November","December",""],namesAbbr:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""]},AM:["AM","am","AM"],PM:["PM","pm","PM"],eras:[{name:"A.D.",start:null,offset:0}],twoDigitYearMax:2029,patterns:{d:"M/d/yyyy",D:"dddd, MMMM dd, yyyy",t:"h:mm tt",T:"h:mm:ss tt",f:"dddd, MMMM dd, yyyy h:mm tt",F:"dddd, MMMM dd, yyyy h:mm:ss tt",M:"MMMM dd",Y:"yyyy MMMM",S:"yyyy'-'MM'-'dd'T'HH':'mm':'ss"}}},messages:{}},c.cultures["default"].calendar=c.cultures["default"].calendars.standard,c.cultures.en=c.cultures["default"],c.cultureSelector="en",d=/^0x[a-f0-9]+$/i,e=/^[+-]?infinity$/i,f=/^[+-]?\d*\.?\d*(e[+-]?\d+)?$/,g=/^\s+|\s+$/g,h=function(a,b){if(a.indexOf)return a.indexOf(b);for(var c=0,d=a.length;c<d;c++)if(a[c]===b)return c;return-1},i=function(a,b){return a.substr(a.length-b.length)===b},j=function(a){var c,d,e,f,g,h,i=arguments[0]||{},n=1,o=arguments.length,a=!1;typeof i=="boolean"&&(a=i,i=arguments[1]||{},n=2),typeof i!="object"&&!l(i)&&(i={});for(;n<o;n++)if((c=arguments[n])!=null)for(d in c){e=i[d],f=c[d];if(i===f)continue;a&&f&&(m(f)||(g=k(f)))?(g?(g=!1,h=e&&k(e)?e:[]):h=e&&m(e)?e:{},i[d]=j(a,h,f)):f!==b&&(i[d]=f)}return i},k=Array.isArray||function(a){return Object.prototype.toString.call(a)==="[object Array]"},l=function(a){return Object.prototype.toString.call(a)==="[object Function]"},m=function(a){return Object.prototype.toString.call(a)==="[object Object]"},n=function(a,b){return a.indexOf(b)===0},o=function(a){return(a+"").replace(g,"")},p=function(a){return isNaN(a)?NaN:Math[a<0?"ceil":"floor"](a)},q=function(a,b,c){var d;for(d=a.length;d<b;d+=1)a=c?"0"+a:a+"0";return a},r=function(a,b){var c=0,d=!1;for(var e=0,f=a.length;e<f;e++){var g=a.charAt(e);switch(g){case"'":d?b.push("'"):c++,d=!1;break;case"\\":d&&b.push("\\"),d=!d;break;default:b.push(g),d=!1}}return c},s=function(a,b){b=b||"F";var c,d=a.patterns,e=b.length;if(e===1){c=d[b];if(!c)throw"Invalid date format string '"+b+"'.";b=c}else e===2&&b.charAt(0)==="%"&&(b=b.charAt(1));return b},t=function(a,b,c){function y(a,b){var c,d=a+"";return b>1&&d.length<b?(c=l[b-2]+d,c.substr(c.length-b,b)):(c=d,c)}function z(){return m||n?m:(m=o.test(b),n=!0,m)}function A(a,b){if(u)return u[b];switch(b){case 0:return a.getFullYear();case 1:return a.getMonth();case 2:return a.getDate()}}var d=c.calendar,e=d.convert;if(!b||!b.length||b==="i"){var f;if(c&&c.name.length)if(e)f=t(a,d.patterns.F,c);else{var g=new Date(a.getTime()),h=w(a,d.eras);g.setFullYear(x(a,d,h)),f=g.toLocaleString()}else f=a.toString();return f}var i=d.eras,j=b==="s";b=s(d,b),f=[];var k,l=["0","00","000"],m,n,o=/([^d]|^)(d|dd)([^d]|$)/g,p=0,q=v(),u;!j&&e&&(u=e.fromGregorian(a));for(;;){var B=q.lastIndex,C=q.exec(b),D=b.slice(B,C?C.index:b.length);p+=r(D,f);if(!C)break;if(p%2){f.push(C[0]);continue}var E=C[0],F=E.length;switch(E){case"ddd":case"dddd":var G=F===3?d.days.namesAbbr:d.days.names;f.push(G[a.getDay()]);break;case"d":case"dd":m=!0,f.push(y(A(a,2),F));break;case"MMM":case"MMMM":var H=A(a,1);f.push(d.monthsGenitive&&z()?d.monthsGenitive[F===3?"namesAbbr":"names"][H]:d.months[F===3?"namesAbbr":"names"][H]);break;case"M":case"MM":f.push(y(A(a,1)+1,F));break;case"y":case"yy":case"yyyy":H=u?u[0]:x(a,d,w(a,i),j),F<4&&(H%=100),f.push(y(H,F));break;case"h":case"hh":k=a.getHours()%12,k===0&&(k=12),f.push(y(k,F));break;case"H":case"HH":f.push(y(a.getHours(),F));break;case"m":case"mm":f.push(y(a.getMinutes(),F));break;case"s":case"ss":f.push(y(a.getSeconds(),F));break;case"t":case"tt":H=a.getHours()<12?d.AM?d.AM[0]:" ":d.PM?d.PM[0]:" ",f.push(F===1?H.charAt(0):H);break;case"f":case"ff":case"fff":f.push(y(a.getMilliseconds(),3).substr(0,F));break;case"z":case"zz":k=a.getTimezoneOffset()/60,f.push((k<=0?"+":"-")+y(Math.floor(Math.abs(k)),F));break;case"zzz":k=a.getTimezoneOffset()/60,f.push((k<=0?"+":"-")+y(Math.floor(Math.abs(k)),2)+":"+y(Math.abs(a.getTimezoneOffset()%60),2));break;case"g":case"gg":d.eras&&f.push(d.eras[w(a,i)].name);break;case"/":f.push(d["/"]);break;default:throw"Invalid date format pattern '"+E+"'."}}return f.join("")},function(){var a;a=function(a,b,c){var d=c.groupSizes,e=d[0],f=1,g=Math.pow(10,b),h=Math.round(a*g)/g;isFinite(h)||(h=a),a=h;var i=a+"",j="",k=i.split(/e/i),l=k.length>1?parseInt(k[1],10):0;i=k[0],k=i.split("."),i=k[0],j=k.length>1?k[1]:"";var m;l>0?(j=q(j,l,!1),i+=j.slice(0,l),j=j.substr(l)):l<0&&(l=-l,i=q(i,l+1),j=i.slice(-l,i.length)+j,i=i.slice(0,-l)),b>0?j=c["."]+(j.length>b?j.slice(0,b):q(j,b)):j="";var n=i.length-1,o=c[","],p="";while(n>=0){if(e===0||e>n)return i.slice(0,n+1)+(p.length?o+p+j:j);p=i.slice(n-e+1,n+1)+(p.length?o+p:""),n-=e,f<d.length&&(e=d[f],f++)}return i.slice(0,n+1)+o+p+j},u=function(b,c,d){if(!isFinite(b))return b===Infinity?d.numberFormat.positiveInfinity:b===-Infinity?d.numberFormat.negativeInfinity:d.numberFormat.NaN;if(!c||c==="i")return d.name.length?b.toLocaleString():b.toString();c=c||"D";var e=d.numberFormat,f=Math.abs(b),g=-1,h;c.length>1&&(g=parseInt(c.slice(1),10));var i=c.charAt(0).toUpperCase(),j;switch(i){case"D":h="n",f=p(f),g!==-1&&(f=q(""+f,g,!0)),b<0&&(f="-"+f);break;case"N":j=e;case"C":j=j||e.currency;case"P":j=j||e.percent,h=b<0?j.pattern[0]:j.pattern[1]||"n",g===-1&&(g=j.decimals),f=a(f*(i==="P"?100:1),g,j);break;default:throw"Bad number format specifier: "+i}var k=/n|\$|-|%/g,l="";for(;;){var m=k.lastIndex,n=k.exec(h);l+=h.slice(m,n?n.index:h.length);if(!n)break;switch(n[0]){case"n":l+=f;break;case"$":l+=e.currency.symbol;break;case"-":/[1-9]/.test(f)&&(l+=e["-"]);break;case"%":l+=e.percent.symbol}}return l}}(),v=function(){return/\/|dddd|ddd|dd|d|MMMM|MMM|MM|M|yyyy|yy|y|hh|h|HH|H|mm|m|ss|s|tt|t|fff|ff|f|zzz|zz|z|gg|g/g},w=function(a,b){if(!b)return 0;var c,d=a.getTime();for(var e=0,f=b.length;e<f;e++){c=b[e].start;if(c===null||d>=c)return e}return 0},x=function(a,b,c,d){var e=a.getFullYear();return!d&&b.eras&&(e-=b.eras[c].offset),e},function(){var a,b,c,d,e,f,g;a=function(a,b){if(b<100){var c=new Date,d=w(c),e=x(c,a,d),f=a.twoDigitYearMax;f=typeof f=="string"?(new Date).getFullYear()%100+parseInt(f,10):f,b+=e-e%100,b>f&&(b-=100)}return b},b=function(a,b,c){var d,e=a.days,i=a._upperDays;return i||(a._upperDays=i=[g(e.names),g(e.namesAbbr),g(e.namesShort)]),b=f(b),c?(d=h(i[1],b),d===-1&&(d=h(i[2],b))):d=h(i[0],b),d},c=function(a,b,c){var d=a.months,e=a.monthsGenitive||a.months,i=a._upperMonths,j=a._upperMonthsGen;i||(a._upperMonths=i=[g(d.names),g(d.namesAbbr)],a._upperMonthsGen=j=[g(e.names),g(e.namesAbbr)]),b=f(b);var k=h(c?i[1]:i[0],b);return k<0&&(k=h(c?j[1]:j[0],b)),k},d=function(a,b){var c=a._parseRegExp;if(!c)a._parseRegExp=c={};else{var d=c[b];if(d)return d}var e=s(a,b).replace(/([\^\$\.\*\+\?\|\[\]\(\)\{\}])/g,"\\\\$1"),f=["^"],g=[],h=0,i=0,j=v(),k;while((k=j.exec(e))!==null){var l=e.slice(h,k.index);h=j.lastIndex,i+=r(l,f);if(i%2){f.push(k[0]);continue}var m=k[0],n=m.length,o;switch(
-m){case"dddd":case"ddd":case"MMMM":case"MMM":case"gg":case"g":o="(\\D+)";break;case"tt":case"t":o="(\\D*)";break;case"yyyy":case"fff":case"ff":case"f":o="(\\d{"+n+"})";break;case"dd":case"d":case"MM":case"M":case"yy":case"y":case"HH":case"H":case"hh":case"h":case"mm":case"m":case"ss":case"s":o="(\\d\\d?)";break;case"zzz":o="([+-]?\\d\\d?:\\d{2})";break;case"zz":case"z":o="([+-]?\\d\\d?)";break;case"/":o="(\\"+a["/"]+")";break;default:throw"Invalid date format pattern '"+m+"'."}o&&f.push(o),g.push(k[0])}r(e.slice(h),f),f.push("$");var p=f.join("").replace(/\s+/g,"\\s+"),q={regExp:p,groups:g};return c[b]=q},e=function(a,b,c){return a<b||a>c},f=function(a){return a.split("\u00a0").join(" ").toUpperCase()},g=function(a){var b=[];for(var c=0,d=a.length;c<d;c++)b[c]=f(a[c]);return b},y=function(f,g,h){f=o(f);var i=h.calendar,j=d(i,g),k=(new RegExp(j.regExp)).exec(f);if(k===null)return null;var l=j.groups,m=null,p=null,q=null,r=null,s=null,t=0,u,v=0,w=0,x=0,y=null,z=!1;for(var A=0,B=l.length;A<B;A++){var C=k[A+1];if(C){var D=l[A],E=D.length,F=parseInt(C,10);switch(D){case"dd":case"d":r=F;if(e(r,1,31))return null;break;case"MMM":case"MMMM":q=c(i,C,E===3);if(e(q,0,11))return null;break;case"M":case"MM":q=F-1;if(e(q,0,11))return null;break;case"y":case"yy":case"yyyy":p=E<4?a(i,F):F;if(e(p,0,9999))return null;break;case"h":case"hh":t=F,t===12&&(t=0);if(e(t,0,11))return null;break;case"H":case"HH":t=F;if(e(t,0,23))return null;break;case"m":case"mm":v=F;if(e(v,0,59))return null;break;case"s":case"ss":w=F;if(e(w,0,59))return null;break;case"tt":case"t":z=i.PM&&(C===i.PM[0]||C===i.PM[1]||C===i.PM[2]);if(!z&&(!i.AM||C!==i.AM[0]&&C!==i.AM[1]&&C!==i.AM[2]))return null;break;case"f":case"ff":case"fff":x=F*Math.pow(10,3-E);if(e(x,0,999))return null;break;case"ddd":case"dddd":s=b(i,C,E===3);if(e(s,0,6))return null;break;case"zzz":var G=C.split(/:/);if(G.length!==2)return null;u=parseInt(G[0],10);if(e(u,-12,13))return null;var H=parseInt(G[1],10);if(e(H,0,59))return null;y=u*60+(n(C,"-")?-H:H);break;case"z":case"zz":u=F;if(e(u,-12,13))return null;y=u*60;break;case"g":case"gg":var I=C;if(!I||!i.eras)return null;I=o(I.toLowerCase());for(var J=0,K=i.eras.length;J<K;J++)if(I===i.eras[J].name.toLowerCase()){m=J;break}if(m===null)return null}}}var L=new Date,M,N=i.convert;M=N?N.fromGregorian(L)[0]:L.getFullYear(),p===null?p=M:i.eras&&(p+=i.eras[m||0].offset),q===null&&(q=0),r===null&&(r=1);if(N){L=N.toGregorian(p,q,r);if(L===null)return null}else{L.setFullYear(p,q,r);if(L.getDate()!==r)return null;if(s!==null&&L.getDay()!==s)return null}z&&t<12&&(t+=12),L.setHours(t,v,w,x);if(y!==null){var O=L.getMinutes()-(y+L.getTimezoneOffset());L.setHours(L.getHours()+parseInt(O/60,10),O%60)}return L}}(),z=function(a,b,c){var d=b["-"],e=b["+"],f;switch(c){case"n -":d=" "+d,e=" "+e;case"n-":i(a,d)?f=["-",a.substr(0,a.length-d.length)]:i(a,e)&&(f=["+",a.substr(0,a.length-e.length)]);break;case"- n":d+=" ",e+=" ";case"-n":n(a,d)?f=["-",a.substr(d.length)]:n(a,e)&&(f=["+",a.substr(e.length)]);break;case"(n)":n(a,"(")&&i(a,")")&&(f=["-",a.substr(1,a.length-2)])}return f||["",a]},c.prototype.findClosestCulture=function(a){return c.findClosestCulture.call(this,a)},c.prototype.format=function(a,b,d){return c.format.call(this,a,b,d)},c.prototype.localize=function(a,b){return c.localize.call(this,a,b)},c.prototype.parseInt=function(a,b,d){return c.parseInt.call(this,a,b,d)},c.prototype.parseFloat=function(a,b,d){return c.parseFloat.call(this,a,b,d)},c.prototype.culture=function(a){return c.culture.call(this,a)},c.addCultureInfo=function(a,b,c){var d={},e=!1;typeof a!="string"?(c=a,a=this.culture().name,d=this.cultures[a]):typeof b!="string"?(c=b,e=this.cultures[a]==null,d=this.cultures[a]||this.cultures["default"]):(e=!0,d=this.cultures[b]),this.cultures[a]=j(!0,{},d,c),e&&(this.cultures[a].calendar=this.cultures[a].calendars.standard)},c.findClosestCulture=function(a){var b;if(!a)return this.findClosestCulture(this.cultureSelector)||this.cultures["default"];typeof a=="string"&&(a=a.split(","));if(k(a)){var c,d=this.cultures,e=a,f,g=e.length,h=[];for(f=0;f<g;f++){a=o(e[f]);var i,j=a.split(";");c=o(j[0]),j.length===1?i=1:(a=o(j[1]),a.indexOf("q=")===0?(a=a.substr(2),i=parseFloat(a),i=isNaN(i)?0:i):i=1),h.push({lang:c,pri:i})}h.sort(function(a,b){return a.pri<b.pri?1:-1});for(f=0;f<g;f++){c=h[f].lang,b=d[c];if(b)return b}for(f=0;f<g;f++){c=h[f].lang;do{var l=c.lastIndexOf("-");if(l===-1)break;c=c.substr(0,l),b=d[c];if(b)return b}while(1)}for(f=0;f<g;f++){c=h[f].lang;for(var m in d){var n=d[m];if(n.language==c)return n}}}else if(typeof a=="object")return a;return b||null},c.format=function(a,b,c){return culture=this.findClosestCulture(c),a instanceof Date?a=t(a,b,culture):typeof a=="number"&&(a=u(a,b,culture)),a},c.localize=function(a,b){return this.findClosestCulture(b).messages[a]||this.cultures["default"].messages[a]},c.parseDate=function(a,b,c){c=this.findClosestCulture(c);var d,e,f;if(b){typeof b=="string"&&(b=[b]);if(b.length)for(var g=0,h=b.length;g<h;g++){var i=b[g];if(i){d=y(a,i,c);if(d)break}}}else{f=c.calendar.patterns;for(e in f){d=y(a,f[e],c);if(d)break}}return d||null},c.parseInt=function(a,b,d){return p(c.parseFloat(a,b,d))},c.parseFloat=function(a,b,c){typeof b!="number"&&(c=b,b=10);var g=this.findClosestCulture(c),h=NaN,i=g.numberFormat;a.indexOf(g.numberFormat.currency.symbol)>-1&&(a=a.replace(g.numberFormat.currency.symbol,""),a=a.replace(g.numberFormat.currency["."],g.numberFormat["."])),a=o(a);if(e.test(a))h=parseFloat(a);else if(!b&&d.test(a))h=parseInt(a,16);else{var j=z(a,i,i.pattern[0]),k=j[0],l=j[1];k===""&&i.pattern[0]!=="(n)"&&(j=z(a,i,"(n)"),k=j[0],l=j[1]),k===""&&i.pattern[0]!=="-n"&&(j=z(a,i,"-n"),k=j[0],l=j[1]),k=k||"+";var m,n,p=l.indexOf("e");p<0&&(p=l.indexOf("E")),p<0?(n=l,m=null):(n=l.substr(0,p),m=l.substr(p+1));var q,r,s=i["."],t=n.indexOf(s);t<0?(q=n,r=null):(q=n.substr(0,t),r=n.substr(t+s.length));var u=i[","];q=q.split(u).join("");var v=u.replace(/\u00A0/g," ");u!==v&&(q=q.split(v).join(""));var w=k+q;r!==null&&(w+="."+r);if(m!==null){var x=z(m,i,"-n");w+="e"+(x[0]||"+")+x[1]}f.test(w)&&(h=parseFloat(w))}return h},c.culture=function(a){return typeof a!="undefined"&&(this.cultureSelector=a),this.findClosestCulture(a)||this.culture["default"]}}(this),function(a,b,c,d){function f(a,b){d==typeof a.tizen&&(a.tizen={}),a.tizen.frameworkData=b.frameworkData,a.tizen.loadCustomGlobalizeCulture=b.loadCustomGlobalizeCulture,a.tizen.loadTheme=b.loadTheme,a.tizen.__tizen__=b}var e={libFileName:"tizen-web-ui-fw(.min)?.js",frameworkData:{rootDir:"/usr/lib/tizen-web-ui-fw",version:"0.1",theme:"tizen-white",viewportWidth:"device-width",viewportScale:!1,defaultFontSize:22,minified:!1,debug:!1},log:{debug:function(a){e.frameworkData.debug&&console.log(a)},warn:function(a){console.warn(a)},error:function(a){console.error(a)},alert:function(a){c.alert(a)}},util:{loadScriptSync:function(b,c,d){a.ajax({url:b,dataType:"script",async:!1,crossDomain:!1,success:c,error:function(c,f,g){if(d)d(c,f,g);else{var h=[404],i="Error while loading "+b+"\n"+c.status+":"+c.statusText;-1==a.inArray(c.status,h)?e.log.alert(i):e.log.warn(i)}}})},isMobileBrowser:function(){var a=c.navigator.appVersion.indexOf("Mobile"),b=-1<a;return b}},css:{cacheBust:document.location.href.match(/debug=true/)?"?cacheBust="+(new Date).getTime():"",addElementToHead:function(b){var c=document.getElementsByTagName("head")[0];c&&a(c).prepend(b)},makeLink:function(a){var b=document.createElement("link");return b.setAttribute("rel","stylesheet"),b.setAttribute("href",a),b.setAttribute("name","tizen-theme"),b},load:function(a){var b=document.getElementsByTagName("head")[0],c=b.getElementsByTagName("link"),d,f=null;for(d=0;d<c.length;d++){if(c[d].getAttribute("rel")!="stylesheet")continue;if(c[d].getAttribute("name")=="tizen-theme"||c[d].getAttribute("href")==a){f=c[d];break}}f?f.getAttribute("href")==a?e.log.warn("Theme is already loaded. Skip theme loading in the framework."):f.setAttribute("href",a):this.addElementToHead(this.makeLink(a))}},getParams:function(){function j(){var a=navigator.theme?navigator.theme.split(":")[0]:null;return a&&(a=a.replace("-hd",""),a.match(/^tizen-/)||(a="tizen-"+a)),a}var a=document.getElementsByTagName("script"),b=null,c=!1,e,f,g,h,i;for(e in a){f=a[e],g=f.src?f.getAttribute("src"):d;if(g&&g.match(this.libFileName)){h=g.split(/[\/\\]/),i=-3,this.frameworkData.rootDir=(f.getAttribute("data-framework-root")||h.slice(0,h.length+i).join("/")||this.frameworkData.rootDir).replace(/^file:(\/\/)?/,""),this.frameworkData.version=f.getAttribute("data-framework-version")||h[h.length+i]||this.frameworkData.version,this.frameworkData.theme=f.getAttribute("data-framework-theme")||j()||this.frameworkData.theme,this.frameworkData.viewportWidth=f.getAttribute("data-framework-viewport-width")||this.frameworkData.viewportWidth,this.frameworkData.viewportScale="true"===f.getAttribute("data-framework-viewport-scale")?!0:this.frameworkData.viewportScale,this.frameworkData.minified=g.search(/\.min\.js$/)>-1?!0:!1,this.frameworkData.debug="true"===f.getAttribute("data-framework-debug")?!0:this.frameworkData.debug,c=!0;break}}return c},loadTheme:function(a){var b,c,d;a||(a=e.frameworkData.theme),b=[e.frameworkData.rootDir,e.frameworkData.version,"themes",a].join("/"),d=[b,"theme.js"].join("/"),e.frameworkData.minified?c=[b,"tizen-web-ui-fw-theme.min.css"].join("/"):c=[b,"tizen-web-ui-fw-theme.css"].join("/"),e.css.load(c),e.util.loadScriptSync(d)},loadGlobalizeCulture:function(b,d){function j(b){var d=b||a("html").attr("lang")||c.navigator.language.split(".")[0]||c.navigator.userLanguage||"en",e=null,f=d.lastIndexOf("-"),g=["Cyrl","Latn","Mong"];return f!=-1&&(e=d.substr(f+1),g.join("-").indexOf(e)<0&&(d=[d.substr(0,f),e.toUpperCase()].join("-"))),d=d=="en"?"en-US":d,d}function k(a){var b=a.lastIndexOf("-"),c;return b!=-1&&(c=a.substr(0,b)),c}function l(a,b){var c=null;return"string"!=typeof a?null:(b&&b[a]?c=b[a]:c=[f.frameworkData.rootDir,f.frameworkData.version,"js","cultures",["globalize.culture.",a,".js"].join("")].join("/"),c)}function m(a,b){e.log.error("Error "+b.status+": "+b.statusText+"::Culture file ("+a+") is failed to load.")}function n(b,c){function d(){e.log.debug("Culture file ("+b+") is loaded successfully.")}function f(a,d,e){c?c(a,d,e):m(b,a)}b?a.ajax({url:b,dataType:"script",cache:!0,async:!1,success:d,error:f}):(i={status:404,statusText:"Not Found"},f(i,null,null))}var f=this,g,h,i;return h=j(b),g=l(h,d),n(g,function(a,b,c){if(a.status==404){var e=k(h),f=l(e,d);n(f,null)}else m(g,a)}),h},setGlobalize:function(){var a=this.loadGlobalizeCulture();b.culture(a)},loadCustomGlobalizeCulture:function(a){e.loadGlobalizeCulture(null,a)},setViewport:function(b){var c=null,d,f;return a("meta[name=viewport]").each(function(){c=this;return}),c?(f=a(c).prop("content"),b=f.replace(/.*width=(device-width|\d+)\s*,?.*$/gi,"$1"),e.log.warn("Viewport is set to '"+b+"' in a meta tag. Framework skips viewport setting.")):(c=document.createElement("meta"),c&&(c.name="viewport",f=["width=",b,", user-scalable=no"].join(""),!!isNaN(b),c.content=f,e.log.debug(f),d=document.getElementsByTagName("head").item(0),d.insertBefore(c,d.firstChild))),b},scaleBaseFontSize:function(b,c){e.log.debug("themedefaultfont size: "+b+", ratio: "+c);var d=Math.round(b*c);a("html.ui-mobile").css({"font-size":d+"px"}),e.log.debug("html:font size is set to "+d),a(document).ready(function(){a(".ui-mobile").children("body").css({"font-size":d+"px"})})},setScaling:function(){var b=this.frameworkData.viewportWidth,c=this.frameworkData.defaultFontSize,d=1;a("body").attr("data-tizen-theme-default-font-size",c),this.frameworkData.viewportScale==1&&(b="screen-width"),"screen-width"==b&&(b=document.documentElement.clientWidth),b=this.setViewport(b),isNaN(b)||(d=parseFloat(b/this.frameworkData.defaultViewportWidth)),this.scaleBaseFontSize(c,d)}};f(a,e),e.getParams(),e.loadTheme(),e.setScaling(),e.setGlobalize(),a.mobile.autoInitializePage=!1,a(document).ready(function(){a.mobile.initializePage()})}(jQuery,window.Globalize,window),function(a){a.tizen.frameworkData.pkgVersion="0.2.15"}(jQuery);
\ No newline at end of file
+function range(a,b,c){var d=[],e,f,g,h=c||1,i=!1;!isNaN(a)&&!isNaN(b)?(e=a,f=b):isNaN(a)&&isNaN(b)?(i=!0,e=a.charCodeAt(0),f=b.charCodeAt(0)):(e=isNaN(a)?0:a,f=isNaN(b)?0:b),g=e>f?!1:!0;if(g)while(e<=f)d.push(i?String.fromCharCode(e):e),e+=h;else while(e>=f)d.push(i?String.fromCharCode(e):e),e-=h;return d}function ensureNS(ns){var nsAr=ns.split("."),nsSoFar="";for(var Nix in nsAr)nsSoFar=nsSoFar+(Nix>0?".":"")+nsAr[Nix],eval(nsSoFar+" = "+nsSoFar+" || {};")}(function(a,b,c,d){function e(c){var d=a(c),e=d.children(".ui-content"),f=d.children(".ui-header").outerHeight()||0,g=d.children(".ui-footer").outerHeight()||0,h=parseFloat(e.css("padding-top")),i=parseFloat(e.css("padding-bottom")),j=a(b).height();e.height(j-(f+g)-(h+i))}function f(b){this.options=a.extend({},b),this.easing="easeOutQuad",this.reset()}function h(){return Date.now()}var g={scrolling:0,overshot:1,snapback:2,done:3};jQuery.widget("tizen.scrollview",jQuery.mobile.widget,{options:{direction:null,timerInterval:10,scrollDuration:1e3,overshootDuration:250,snapbackDuration:500,moveThreshold:30,moveIntervalThreshold:150,scrollMethod:"translate",startEventName:"scrollstart",updateEventName:"scrollupdate",stopEventName:"scrollstop",eventType:a.support.touch?"touch":"mouse",showScrollBars:!0,overshootEnable:!1,outerScrollEnable:!1,overflowEnable:!0,scrollJump:!1},_getViewHeight:function(){return this._$view.height()},_getViewWidth:function(){return this._$view.width()},_makePositioned:function(a){a.css("position")==="static"&&a.css("position","relative")},_create:function(){var b,c=this;this._$clip=a(this.element).addClass("ui-scrollview-clip"),this._$clip.children(".ui-scrollview-view").length?this._$view=this._$clip.children(".ui-scrollview-view"):this._$view=this._$clip.wrapInner("<div></div>").children().addClass("ui-scrollview-view"),this.options.scrollMethod==="translate"&&this._$view.css("transform")===d&&(this.options.scrollMethod="position"),this._$clip.css("overflow","hidden"),this._makePositioned(this._$clip),this._makePositioned(this._$view),this._$view.css({left:0,top:0}),this._view_height=this._getViewHeight(),this._sx=0,this._sy=0,b=this.options.direction,this._hTracker=b!=="y"?new f(this.options):null,this._vTracker=b!=="x"?new f(this.options):null,this._timerInterval=this.options.timerInterval,this._timerID=0,this._timerCB=function(){c._handleMomentumScroll()},this._add_event(),this._add_scrollbar(),this._add_scroll_jump(),this._add_overflow_indicator()},_startMScroll:function(a,b){var c=!1,d=this.options.scrollDuration,e=this._hTracker,f=this._vTracker,g,h;this._$clip.trigger(this.options.startEventName);if(e){g=this._$clip.width(),h=this._getViewWidth();if((this._sx===0&&a>0||this._sx===-(h-g)&&a<0)&&h>g)return;e.start(this._sx,a,d,h>g?-(h-g):0,0),c=!e.done()}if(f){g=this._$clip.height(),h=this._getViewHeight();if((this._sy===0&&b>0||this._sy===-(h-g)&&b<0)&&h>g)return;f.start(this._sy,b,d,h>g?-(h-g):0,0),c=c||!f.done()}c?this._timerID=setTimeout(this._timerCB,this._timerInterval):this._stopMScroll()},_stopMScroll:function(){this._timerID&&(this._$clip.trigger(this.options.stopEventName),clearTimeout(this._timerID)),this._timerID=0,this._vTracker&&this._vTracker.reset(),this._hTracker&&this._hTracker.reset(),this._hideScrollBars(),this._hideOverflowIndicator()},_handleMomentumScroll:function(){var a=!1,b=0,c=0,d=0,e=this,f=function(a){setTimeout(function(){e._effect_dir=a,e._setEndEffect("in")},100),setTimeout(function(){e._setEndEffect("out")},350)},g=this._vTracker,h=this._hTracker;if(this._outerScrolling)return;g&&(g.update(this.options.overshootEnable),c=g.getPosition(),a=!g.done(),g.getRemained()>this.options.overshootDuration&&(d=this._getViewHeight()-this._$clip.height(),g.isAvail()?g.isMin()?(this._outerScroll(c-g.getRemained()/3,d),d>0&&f(1)):g.isMax()&&(this._outerScroll(g.getRemained()/3,d),d>0&&f(0)):this._speedY>0?this._outerScroll(g.getRemained()/3,d):this._outerScroll(c-g.getRemained()/3,d))),h&&(h.update(this.options.overshootEnable),b=h.getPosition(),a=a||!h.done()),this._setScrollPosition(b,c),this._$clip.trigger(this.options.updateEventName,[{x:b,y:c}]),a?this._timerID=setTimeout(this._timerCB,this._timerInterval):this._stopMScroll()},_setElementTransform:function(b,c,e,f){var g,h;!f||f===d?h="none":h="-webkit-transform "+f/1e3+"s ease-out",a.support.cssTransform3d?g="translate3d("+c+","+e+", 0px)":g="translate("+c+","+e+")",b.css({"-moz-transform":g,"-webkit-transform":g,"-ms-transform":g,"-o-transform":g,transform:g,"-webkit-transition":h})},_setEndEffect:function(a){var b=this._getViewHeight()-this._$clip.height();if(this._softkeyboard){this._effect_dir?this._outerScroll(-b-this._softkeyboardHeight,b):this._outerScroll(this._softkeyboardHeight,b);return}if(a==="in"){if(this._endEffect)return;this._endEffect=!0,this._setOverflowIndicator(this._effect_dir),this._showOverflowIndicator()}else if(a==="out"){if(!this._endEffect)return;this._endEffect=!1}else this._endEffect=!1,this._setOverflowIndicator(),this._showOverflowIndicator()},_setCalibration:function(a,b){if(this.options.overshootEnable){this._sx=a,this._sy=b;return}var c=this._$view,d=this._$clip,e=this._directionLock,f=0,g=0;e!=="y"&&this._hTracker&&(g=c.width()-d.width(),a>=0?this._sx=0:a<-g?this._sx=-g:this._sx=a,g<0&&(this._sx=0)),e!=="x"&&this._vTracker&&(f=this._getViewHeight()-d.height(),b>0?(this._sy=0,this._didDrag&&f>0&&(this._effect_dir=0,this._setEndEffect("in"))):b<-f?(this._sy=-f,this._didDrag&&f>0&&(this._effect_dir=1,this._setEndEffect("in"))):(this._endEffect&&this._sy!==b&&this._setEndEffect(),this._sy=b),f<0&&(this._sy=0))},_setScrollPosition:function(a,b,c){var d=this._$view,e=this.options.scrollMethod,f=this._$vScrollBar,g=this._$hScrollBar,h;this._setCalibration(a,b),a=this._sx,b=this._sy,e==="translate"?this._setElementTransform(d,a+"px",b+"px",c):d.css({left:a+"px",top:b+"px"}),f&&(h=f.find(".ui-scrollbar-thumb"),e==="translate"?this._setElementTransform(h,"0px",-b/this._getViewHeight()*h.parent().height()+"px",c):h.css("top",-b/this._getViewHeight()*100+"%")),g&&(h=g.find(".ui-scrollbar-thumb"),e==="translate"?this._setElementTransform(h,-a/d.width()*h.parent().width()+"px","0px",c):h.css("left",-a/d.width()*100+"%"))},_outerScroll:function(c,e){var f=this,g=a(b).scrollTop()-b.screenTop,i=0,j=this.options.snapbackDuration,k=h(),l;if(!this.options.outerScrollEnable)return;if(this._$clip.jqmData("scroll")!=="y")return;if(this._outerScrolling)return;if(c>0)i=b.screenTop?b.screenTop:-c;else{if(!(c<-e))return;i=-c-e}l=function(){var c=h()-k;c>=j?(b.scrollTo(0,g+i),f._outerScrolling=d,f._stopMScroll()):(ec=a.easing.easeOutQuad(c/j,c,0,1,j),b.scrollTo(0,g+i*ec),f._outerScrolling=setTimeout(l,f._timerInterval))},this._outerScrolling=setTimeout(l,f._timerInterval)},_scrollTo:function(b,c,d){var e=this,f=h(),g=a.easing.easeOutQuad,i=this._sx,j=this._sy,k=b-i,l=c-j,m;b=-b,c=-c,m=function(){var a=h()-f,n;a>=d?(e._timerID=0,e._setScrollPosition(b,c)):(n=g(a/d,a,0,1,d),e._setScrollPosition(i+k*n,j+l*n),e._timerID=setTimeout(m,e._timerInterval))},this._timerID=setTimeout(m,this._timerInterval)},scrollTo:function(a,b,c){this._stopMScroll(),this._didDrag=!1,!c||this.options.scrollMethod==="translate"?this._setScrollPosition(a,b,c):this._scrollTo(a,b,c)},getScrollPosition:function(){return{x:-this._sx,y:-this._sy}},skipDragging:function(a){this._skip_dragging=a},_getScrollHierarchy:function(){var b=[],c;return this._$clip.parents(".ui-scrollview-clip").each(function(){c=a(this).jqmData("scrollview"),c&&b.unshift(c)}),b},_getAncestorByDirection:function(a){var b=this._getScrollHierarchy(),c=b.length,d,e;while(0<c--){d=b[c],e=d.options.direction;if(!e||e===a)return d}return null},_handleDragStart:function(b,c,d){this._stopMScroll(),this._didDrag=!1,this._skip_dragging=!1;var e=a(b.target),f=this,g=this._$clip,h=this.options.direction;this._is_button=e.is(".ui-btn")||e.is(".ui-btn-text")||e.is(".ui-btn-inner")||e.is(".ui-btn-inner .ui-icon");if(e.parents(".ui-slider").length||e.is(".ui-slider")){this._skip_dragging=!0;return}e.is("textarea")&&e.bind("scroll",function(){f._skip_dragging=!0,e.unbind("scroll")}),this._is_inputbox=e.is(":input")||e.parents(":input").length>0,this._is_inputbox&&e.one("resize.scrollview",function(){d>g.height()&&f.scrollTo(-c,f._sy-d+g.height(),f.options.snapbackDuration)}),this.options.eventType==="mouse"&&!this._is_inputbox&&!this._is_button&&b.preventDefault(),this._lastX=c,this._lastY=d,this._startY=d,this._doSnapBackX=!1,this._doSnapBackY=!1,this._speedX=0,this._speedY=0,this._directionLock="",this._lastMove=0,this._enableTracking(),this._set_scrollbar_size()},_propagateDragMove:function(a,b,c,d,e){this._hideScrollBars(),this._hideOverflowIndicator(),this._disableTracking(),a._handleDragStart(b,c,d),a._directionLock=e,a._didDrag=this._didDrag},_handleDragMove:function(b,c,d){if(this._skip_dragging)return;if(!this._dragging)return;!this._is_inputbox&&!this._is_button&&b.preventDefault();var e=this.options.moveThreshold,f=c-this._lastX,g=d-this._lastY,i=this.options.direction,j=null,k,l,m,n,o,p,q;this._lastMove=h();if(!this._directionLock){k=Math.abs(f),l=Math.abs(g);if(k<e&&l<e)return!1;k<l&&k/l<.5?j="y":k>l&&l/k<.5&&(j="x");if(i&&j&&i!==j){m=this._getAncestorByDirection(j);if(m)return this._propagateDragMove(m,b,c,d,j),!1}this._directionLock=i||j||"none"}o=this._sx,p=this._sy,q=this._directionLock;if(q!=="y"&&this._hTracker){k=this._sx,this._speedX=f,o=k+f,this._doSnapBackX=!1,n=o>0||o<this._maxX;if(n&&q==="x"){m=this._getAncestorByDirection("x");if(m)return this._setScrollPosition(o>0?0:this._maxX,p),this._propagateDragMove(m,b,c,d,j),!1;o=k+f/2,this._doSnapBackX=!0}}if(q!=="x"&&this._vTracker){if(Math.abs(this._startY-d)<e&&q!=="xy")return;l=this._sy,this._speedY=g,p=l+g,this._doSnapBackY=!1,n=p>0||p<this._maxY;if(n&&q==="y"){m=this._getAncestorByDirection("y");if(m)return this._setScrollPosition(o,p>0?0:this._maxY),this._propagateDragMove(m,b,c,d,j),!1;p=l+g/2,this._doSnapBackY=!0}}this.options.overshootEnable===!1&&(this._doSnapBackX=!1,this._doSnapBackY=!1),this._lastX=c,this._lastY=d,this._setScrollPosition(o,p),this._didDrag===!1&&(this._didDrag=!0,this._showScrollBars(),this._showOverflowIndicator(),this._$clip.parents(".ui-scrollview-clip").each(function(){a(this).scrollview("skipDragging",!0)}))},_handleDragStop:function(a){var b=this;if(this._skip_dragging)return;var c=this._lastMove,d=h(),e=c&&d-c<=this.options.moveIntervalThreshold,f=this._hTracker&&this._speedX&&e?this._speedX:this._doSnapBackX?1:0,g=this._vTracker&&this._speedY&&e?this._speedY:this._doSnapBackY?1:0,i=this.options.direction,j,k;return f||g?this._setGestureScroll(f,g)||this._startMScroll(f,g):(this._hideScrollBars(),this._hideOverflowIndicator()),this._disableTracking(),this._endEffect&&setTimeout(function(){b._setEndEffect("out"),b._hideScrollBars(),b._hideOverflowIndicator()},300),!this._didDrag},_setGestureScroll:function(a,b){var c=this,e=function(){clearTimeout(c._gesture_timer),c._gesture_dir=0,c._gesture_timer=d},f={top:0,bottom:1,left:2,right:3};return!b&&!a?!1:(Math.abs(a)>Math.abs(b)?dir=a>0?f.left:f.right:dir=b>0?f.top:f.bottom,this._gesture_timer?this._gesture_dir!==dir?(e(),!1):!1:(this._gesture_dir=dir,this._gesture_timer=setTimeout(function(){e()},1e3),!1))},_enableTracking:function(){this._dragging=!0},_disableTracking:function(){this._dragging=!1},_showScrollBars:function(a){var b="ui-scrollbar-visible",c=this;if(!this.options.showScrollBars)return;if(this._scrollbar_showed)return;this._$vScrollBar&&this._$vScrollBar.addClass(b),this._$hScrollBar&&this._$hScrollBar.addClass(b),this._scrollbar_showed=!0,a&&setTimeout(function(){c._hideScrollBars()},a)},_hideScrollBars:function(){var a="ui-scrollbar-visible";if(!this.options.showScrollBars)return;if(!this._scrollbar_showed)return;this._$vScrollBar&&this._$vScrollBar.removeClass(a),this._$hScrollBar&&this._$hScrollBar.removeClass(a),this._scrollbar_showed=!1},_setOverflowIndicator:function(a){a===1?(this._opacity_top="0",this._opacity_bottom="0.8"):a===0?(this._opacity_top="0.8",this._opacity_bottom="0"):(this._opacity_top="0.5",this._opacity_bottom="0.5")},_showOverflowIndicator:function(){if(!this.options.overflowEnable||!this._overflowAvail||this._softkeyboard)return;this._overflow_top.animate({opacity:this._opacity_top},300),this._overflow_bottom.animate({opacity:this._opacity_bottom},300),this._overflow_showed=!0},_hideOverflowIndicator:function(){if(!this.options.overflowEnable||!this._overflowAvail||this._softkeyboard)return;if(this._overflow_showed===!1)return;this._overflow_top.animate({opacity:0},300),this._overflow_bottom.animate({opacity:0},300),this._overflow_showed=!1,this._setOverflowIndicator()},_add_event:function(){var c=this,e=this._$clip,f=this._$view;this.options.eventType==="mouse"?(this._dragEvt="mousedown mousemove mouseup click mousewheel",this._dragCB=function(a){switch(a.type){case"mousedown":return c._handleDragStart(a,a.clientX,a.clientY);case"mousemove":return c._handleDragMove(a,a.clientX,a.clientY);case"mouseup":return c._handleDragStop(a);case"click":return!c._didDrag;case"mousewheel":var b=c.getScrollPosition();c.scrollTo(-b.x,-(b.y-a.originalEvent.wheelDelta))}}):(this._dragEvt="touchstart touchmove touchend click",this._dragCB=function(a){var b=a.originalEvent.touches;switch(a.type){case"touchstart":if(b.length!=1)return;return c._handleDragStart(a,b[0].pageX,b[0].pageY);case"touchmove":if(b.length!=1)return;return c._handleDragMove(a,b[0].pageX,b[0].pageY);case"touchend":if(b.length!=0)return;return c._handleDragStop(a);case"click":return!c._didDrag}}),f.bind(this._dragEvt,this._dragCB),f.bind("keydown",function(f){var g,h,i=a(b).scrollTop()-b.screenTop,j;if(f.keyCode==9)return!1;g=e.find(".ui-focus");if(g===d)return;h=g.offset().top-i,j=e.offset().top+e.height()-g.height(),c._softkeyboard&&(j-=c._softkeyboardHeight),(h<e.offset().top||h>j)&&c.scrollTo(0,c._sy-(h-e.offset().top-g.height()));return}),f.bind("keyup",function(d){var f,g,h,j=a(b).scrollTop()-b.screenTop,k;if(d.keyCode!=9)return;f=a(this).find(":input");for(i=0;i<f.length;i++){if(!a(f[i]).hasClass("ui-focus"))continue;i+1==f.length?g=a(f[0]):g=a(f[i+1]),h=g.offset().top-j,k=e.offset().top+e.height()-g.height(),c._softkeyboard&&(k-=c._softkeyboardHeight),(h<0||h>k)&&c.scrollTo(0,c._sy-h+g.height()+e.offset().top,0),g.focus();break}return!1}),e.bind("updatelayout",function(a){var b,d,f=c._getViewHeight();if(!e.height()||!f){c.scrollTo(0,0,0);return}b=e.height()-f,d=f-c._view_height,c._view_height=f;if(d==0||d>e.height()/2)return;b>0?c.scrollTo(0,0,0):c._sy-b<=-d?c.scrollTo(0,c._sy,c.options.snapbackDuration):c._sy-b<=d+c.options.moveThreshold&&c.scrollTo(0,b,c.options.snapbackDuration)}),a(b).bind("resize",function(b){var d,f=c._getViewHeight();if(a(".ui-page-active").get(0)!==e.closest(".ui-page").get(0))return;if(!e.height()||!f)return;d=e.find(".ui-focus"),d&&d.trigger("resize.scrollview"),setTimeout(function(){c._sy<e.height()-c._getViewHeight()&&c.scrollTo(0,e.height()-c._getViewHeight(),c.options.overshootDuration)},260),c._view_height=f}),a(b).bind("vmouseout",function(d){var f=!1;if(a(".ui-page-active").get(0)!==e.closest(".ui-page").get(0))return;if(!c._dragging)return;if(d.pageX<0||d.pageX>a(b).width())f=!0;if(d.pageY<0||d.pageY>a(b).height())f=!0;f&&(c._hideScrollBars(),c._hideOverflowIndicator(),c._disableTracking())}),this._softkeyboard=!1,this._softkeyboardHeight=0,b.addEventListener("softkeyboardchange",function(d){if(a(".ui-page-active").get(0)!==e.closest(".ui-page").get(0))return;c._softkeyboard=d.state==="on"?!0:!1,c._softkeyboardHeight=parseInt(d.height)*(a(b).width()/b.screen.availWidth)}),e.closest(".ui-page").bind("pageshow",function(a){setTimeout(function(){c._view_height=c._getViewHeight(),c._set_scrollbar_size(),c._setScrollPosition(c._sx,c._sy),c._showScrollBars(2e3)},0)})},_add_scrollbar:function(){var a=this._$clip,b='<div class="ui-scrollbar ui-scrollbar-',c='"><div class="ui-scrollbar-track"><div class="ui-scrollbar-thumb"></div></div></div>';if(!this.options.showScrollBars)return;this._vTracker&&(a.append(b+"y"+c),this._$vScrollBar=a.children(".ui-scrollbar-y")),this._hTracker&&(a.append(b+"x"+c),this._$hScrollBar=a.children(".ui-scrollbar-x")),this._scrollbar_showed=!1},_add_scroll_jump:function(){var b=this._$clip,c=this,d,e;if(!this.options.scrollJump)return;this._vTracker&&(d=a('<div class="ui-scroll-jump-top-bg"><div data-role="button" data-inline="true" data-icon="scrolltop" data-style="box"></div></div>'),b.append(d).trigger("create"),d.bind("vclick",function(){c.scrollTo(0,0,c.options.overshootDuration)})),this._hTracker&&(e=a('<div class="ui-scroll-jump-left-bg"><div data-role="button" data-inline="true" data-icon="scrollleft" data-style="box"></div></div>'),b.append(e).trigger("create"),e.bind("vclick",function(){c.scrollTo(0,0,c.options.overshootDuration)}))},_add_overflow_indicator:function(){if(!this.options.overflowEnable)return;this._overflow_top=a('<div class="ui-overflow-indicator-top"></div>'),this._overflow_bottom=a('<div class="ui-overflow-indicator-bottom"></div>'),this._$clip.append(this._overflow_top),this._$clip.append(this._overflow_bottom),this._opacity_top="0.5",this._opacity_bottom="0.5",this._overflow_showed=!1},_set_scrollbar_size:function(){var a=this._$clip,b=this._$view,c=0,d=0,e=0,f=0,g;if(!this.options.showScrollBars)return;this._hTracker&&(c=a.width(),d=b.width(),this._maxX=c-d,this._maxX>0&&(this._maxX=0),this._$hScrollBar&&d&&(g=this._$hScrollBar.find(".ui-scrollbar-thumb"),g.css("width",c>=d?"0":(Math.floor(c/d*100)||1)+"%")));if(this._vTracker){e=a.height(),f=this._getViewHeight(),this._maxY=e-f;if(this._maxY>0||f===0)this._maxY=0;if(this._$vScrollBar&&f||f===0)g=this._$vScrollBar.find(".ui-scrollbar-thumb"),g.css("height",e>=f?"0":(Math.floor(e/f*100)||1)+"%"),this._overflowAvail=!!g.height()}}}),a.extend(f.prototype,{start:function(a,b,c,d,e){var f=a<d||a>e?g.snapback:g.scrolling,i;this.state=b!==0?f:g.done,this.pos=a,this.speed=b,this.duration=this.state===g.snapback?this.options.snapbackDuration:c,this.minPos=d,this.maxPos=e,this.fromPos=this.state===g.snapback?this.pos:0,i=this.pos<this.minPos?this.minPos:this.maxPos,this.toPos=this.state===g.snapback?i:0,this.startTime=h()},reset:function(){this.state=g.done,this.pos=0,this.speed=0,this.minPos=0,this.maxPos=0,this.duration=0,this.remained=0},update:function(b){var c=this.state,d=h(),e=this.duration,f=d-this.startTime,i,j,k;return c===g.done?this.pos:(f=f>e?e:f,this.remained=e-f,c===g.scrolling||c===g.overshot?(i=this.speed*(1-a.easing[this.easing](f/e,f,0,1,e)),j=this.pos+i,k=c===g.scrolling&&(j<this.minPos||j>this.maxPos),k&&(j=j<this.minPos?this.minPos:this.maxPos),this.pos=j,c===g.overshot?(b||(this.state=g.done),f>=e&&(this.state=g.snapback,this.fromPos=this.pos,this.toPos=j<this.minPos?this.minPos:this.maxPos,this.duration=this.options.snapbackDuration,this.startTime=d,f=0)):c===g.scrolling&&(k&&b?(this.state=g.overshot,this.speed=i/2,this.duration=this.options.overshootDuration,this.startTime=d):f>=e&&(this.state=g.done))):c===g.snapback&&(f>=e?(this.pos=this.toPos,this.state=g.done):this.pos=this.fromPos+(this.toPos-this.fromPos)*a.easing[this.easing](f/e,f,0,1,e)),this.pos)},done:function(){return this.state===g.done},isMin:function(){return this.pos===this.minPos},isMax:function(){return this.pos===this.maxPos},isAvail:function(){return this.minPos!==this.maxPos},getRemained:function(){return this.remained},getPosition:function(){return this.pos}}),a(c).bind("pagecreate create",function(b){var c=a(b.target),e=c.find(".ui-content").jqmData("scroll");a.support.scrollview===d&&(a.support.scrollview=!0),a.support.scrollview===!0&&e===d&&(e="y"),e!=="y"&&(e="none"),c.find(".ui-content").attr("data-scroll",e),c.find(":jqmData(scroll)").not(".ui-scrollview-clip").each(function(){if(a(this).hasClass("ui-scrolllistview"))a(this).scrolllistview();else{var b=a(this).jqmData("scroll"),c=b&&b.search(/^[xy]/)!==-1?b:null,e=a(this).hasClass("ui-content"),f;if(b==="none")return;f={direction:c||d,overflowEnable:e,scrollMethod:a(this).jqmData("scroll-method")||d,scrollJump:a(this).jqmData("scroll-jump")||d},a(this).scrollview(f)}})}),a(c).bind("pageshow",function(b){var c=a(b.target),d=c.find(".ui-content").jqmData("scroll");d==="y"&&e(b.target)})})(jQuery,window,document),function(a,b,c,d){function e(a,b){var c=a%b;return c<0&&(c=b+c),c}function f(a,b,c){var d="translate3d( "+b+","+c+", 0px)";a.css({"-ms-transform":d,"-o-transform":d,"-moz-transform":d,"-webkit-transform":d,transform:d})}function g(b){this.options=a.extend({},b),this.easing="easeOutQuad",this.reset()}function i(){return Date.now()}var h={scrolling:0,done:1};a.extend(g.prototype,{start:function(a,b,c){this.state=b!=0?h.scrolling:h.done,this.pos=a,this.speed=b,this.duration=c,this.fromPos=0,this.toPos=0,this.startTime=i()},reset:function(){this.state=h.done,this.pos=0,this.speed=0,this.duration=0},update:function(){var b=this.state,c,d,e,f;return b==h.done?this.pos:(c=this.duration,d=i()-this.startTime,d=d>c?c:d,e=this.speed*(1-a.easing[this.easing](d/c,d,0,1,c)),f=this.pos+e,this.pos=f,d>=c&&(this.state=h.done),this.pos)},done:function(){return this.state==h.done},getPosition:function(){return this.pos}}),jQuery.widget("mobile.circularview",jQuery.mobile.widget,{options:{fps:60,scrollDuration:2e3,moveThreshold:10,moveIntervalThreshold:150,startEventName:"scrollstart",updateEventName:"scrollupdate",stopEventName:"scrollstop",eventType:a.support.touch?"touch":"mouse",delayedClickSelector:"a, .ui-btn",delayedClickEnabled:!1},_makePositioned:function(a){a.css("position")=="static"&&a.css("position","relative")},_create:function(){var b=this;this._items=a(this.element).jqmData("list"),this._$clip=a(this.element).addClass("ui-scrollview-clip"),this._$clip.wrapInner('<div class="ui-scrollview-view"></div>'),this._$view=a(".ui-scrollview-view",this._$clip),this._$list=a("ul",this._$clip),this._$clip.css("overflow","hidden"),this._makePositioned(this._$clip),this._$view.css("overflow","hidden"),this._tracker=new g(this.options),this._timerInterval=1e3/this.options.fps,this._timerID=0,this._timerCB=function(){b._handleMomentumScroll()},this.refresh(),this._addBehaviors()},reflow:function(){var a=this.getScrollPosition();this.refresh(),this.scrollTo(a.x,a.y)},refresh:function(){var c;this._$clip.width(a(b).width()),this._clipWidth=this._$clip.width(),this._$list.empty(),this._$list.append(this._items[0]),this._itemWidth=a(this._items[0]).outerWidth(),a(this._items[0]).detach(),c=this._clipWidth/this._itemWidth,c=Math.ceil(c*10)/10,this._itemsPerView=parseInt(c,10);while(this._itemsPerView+1>this._items.length)a.merge(this._items,a(this._items).clone());this._rx=-this._itemWidth,this._sx=-this._itemWidth,this._setItems()},_startMScroll:function(a,b){this._stopMScroll();var c=!1,d=this.options.scrollDuration,e=this._tracker,f=this._clipWidth,g=this._viewWidth;this._$clip.trigger(this.options.startEventName),e.start(this._rx,a,d,g>f?-(g-f):0,0),c=!e.done(),c?this._timerID=setTimeout(this._timerCB,this._timerInterval):this._stopMScroll()},_stopMScroll:function(){this._timerID&&(this._$clip.trigger(this.options.stopEventName),clearTimeout(this._timerID)),this._timerID=0,this._tracker&&this._tracker.reset()},_handleMomentumScroll:function(){var a=!1,b=this._$view,c=0,d=0,e=this._tracker;e&&(e.update(),c=e.getPosition(),a=!e.done()),this._setScrollPosition(c,d),this._rx=c,this._$clip.trigger(this.options.updateEventName,[{x:c,y:d}]),a?this._timerID=setTimeout(this._timerCB,this._timerInterval):this._stopMScroll()},_setItems:function(){var a,b;for(a=-1;a<this._itemsPerView+1;a++)b=this._items[e(a,this._items.length)],this._$list.append(b);f(this._$view,this._sx+"px",0),this._$view.width(this._itemWidth*(this._itemsPerView+2)),this._viewWidth=this._$view.width()},_setScrollPosition:function(a,b){var c=this._sx,d=a-c,g=parseInt(d/this._itemWidth,10),h,i,j;if(g>0)for(h=0;h<g;h++)this._$list.children().last().detach(),i=-parseInt(c/this._itemWidth+h+3,10),j=this._items[e(i,this._items.length)],this._$list.prepend(j);else if(g<0)for(h=0;h>g;h--)this._$list.children().first().detach(),i=this._itemsPerView-parseInt(c/this._itemWidth+h,10),j=this._items[e(i,this._items.length)],this._$list.append(j);this._sx+=g*this._itemWidth,f(this._$view,a-this._sx-this._itemWidth+"px",0)},_enableTracking:function(){a(c).bind(this._dragMoveEvt,this._dragMoveCB),a(c).bind(this._dragStopEvt,this._dragStopCB)},_disableTracking:function(){a(c).unbind(this._dragMoveEvt,this._dragMoveCB),a(c).unbind(this._dragStopEvt,this._dragStopCB)},_getScrollHierarchy:function(){var b=[],c;return this._$clip.parents(".ui-scrollview-clip").each(function(){c=a(this).jqmData("circulaview"),c&&b.unshift(c)}),b},centerTo:function(b,c){var d,e;for(d=0;d<this._items.length;d++)if(a(this._items[d]).is(b)){e=-(d*this._itemWidth-this._clipWidth/2+this._itemWidth*1.5),this.scrollTo(e+this._itemWidth,0),this.scrollTo(e,0,c);return}},scrollTo:function(b,c,d){this._stopMScroll();if(!d){this._setScrollPosition(b,c),this._rx=b;return}var e=this,f=i(),g=a.easing.easeOutQuad,h=this._rx,j=0,k=b-h,l=0,m,n,o;this._rx=b,m=function(){n=i()-f,n>=d?(e._timerID=0,e._setScrollPosition(b,c),e._$clip.trigger("scrollend")):(o=g(n/d,n,0,1,d),e._setScrollPosition(h+k*o,j+l*o),e._timerID=setTimeout(m,e._timerInterval))},this._timerID=setTimeout(m,this._timerInterval)},getScrollPosition:function(){return{x:-this._rx,y:0}},_handleDragStart:function(b,c,d){a.each(this._getScrollHierarchy(),function(a,b){b._stopMScroll()}),this._stopMScroll(),this.options.delayedClickEnabled&&(this._$clickEle=a(b.target).closest(this.options.delayedClickSelector)),this._lastX=c,this._lastY=d,this._speedX=0,this._speedY=0,this._didDrag=!1,this._lastMove=0,this._enableTracking(),this._ox=c,this._nx=this._rx,(this.options.eventType=="mouse"||this.options.delayedClickEnabled)&&b.preventDefault(),b.stopPropagation()},_handleDragMove:function(a,b,c){this._lastMove=i();var d=b-this._lastX,e=c-this._lastY;return this._speedX=d,this._speedY=0,this._didDrag=!0,this._lastX=b,this._lastY=c,this._mx=b-this._ox,this._setScrollPosition(this._nx+this._mx,0),!1},_handleDragStop:function(a){var b=this._lastMove,c=i(),e=b&&c-b<=this.options.moveIntervalThreshold,f=this._tracker&&this._speedX&&e?this._speedX:0,g=0;return this._rx=this._mx?this._nx+this._mx:this._rx,f&&this._startMScroll(f,g),this._disableTracking(),!this._didDrag&&this.options.delayedClickEnabled&&this._$clickEle.length&&this._$clickEle.trigger("mousedown").trigger("mouseup").trigger("click"),this._didDrag&&(a.preventDefault(),a.stopPropagation()),this._didDrag?!1:d},_addBehaviors:function(){var a=this;this.options.eventType==="mouse"?(this._dragStartEvt="mousedown",this._dragStartCB=function(b){return a._handleDragStart(b,b.clientX,b.clientY)},this._dragMoveEvt="mousemove",this._dragMoveCB=function(b){return a._handleDragMove(b,b.clientX,b.clientY)},this._dragStopEvt="mouseup",this._dragStopCB=function(b){return a._handleDragStop(b)},this._$view.bind("vclick",function(b){return!a._didDrag})):(this._dragStartEvt="touchstart",this._dragStartCB=function(b){var c=b.originalEvent.targetTouches[0];return a._handleDragStart(b,c.pageX,c.pageY)},this._dragMoveEvt="touchmove",this._dragMoveCB=function(b){var c=b.originalEvent.targetTouches[0];return a._handleDragMove(b,c.pageX,c.pageY)},this._dragStopEvt="touchend",this._dragStopCB=function(b){return a._handleDragStop(b)}),this._$view.bind(this._dragStartEvt,this._dragStartCB)}}),a(c).bind("pagecreate create",function(b){a(a.mobile.circularview.prototype.options.initSelector,b.target).circularview()})}(jQuery,window,document),function(a,b,c){a.widget("tizen.gallery",a.mobile.widget,{options:{flicking:!1,duration:500},dragging:!1,moving:!1,max_width:0,max_height:0,org_x:0,org_time:null,cur_img:null,prev_img:null,next_img:null,images:[],images_hold:[],index:0,align_type:null,direction:1,container:null,_resize:function(a){var b=this.images[a],c=this.images[a].width(),d=this.images[a].height(),e=0,f,g=this.max_width-e,h=this.max_height-e;f=d/c,c>g&&(b.width(g),b.height(g*f)),d=b.height(),d>h&&(b.height(h),b.width(h/f))},_align:function(a,b){var c=this.images[a],d=0;if(!b)return;if(!b.length)return;this.align_type=="middle"?d=(this.max_height-c.height())/2:this.align_type=="bottom"?d=this.max_height-c.height():d=0,b.css("top",d+"px")},_attach:function(a,b){var d=this,e=function(){d._resize(a),d._align(a,b)},f=function(){if(d.images[a]===c)return;if(!d.images[a].height()){setTimeout(f,10);return}e()};if(!b)return;if(!b.length)return;if(a<0)return;if(!this.images.length)return;if(a>=this.images.length)return;b.css("display","block"),b.append(this.images[a]),f()},_detach:function(a,b){if(!b)return;if(!b.length)return;if(a<0)return;if(a>=this.images.length)return;b.css("display","none"),this.images[a].removeAttr("style"),this.images[a].detach()},_detach_all:function(){var a;for(a=0;a<this.images.length;a++)this.images[a].detach()},_drag:function(a){var b,c;if(!this.dragging)return;if(this.options.flicking===!1){b=this.org_x-a;if(b<0&&!this.prev_img.length)return;if(b>0&&!this.next_img.length)return}c=a-this.org_x,this._moveLeft(this.cur_img,c+"px"),this.next_img.length&&this._moveLeft(this.next_img,c+this.window_width+"px"),this.prev_img.length&&this._moveLeft(this.prev_img,c-this.window_width+"px")},_move:function(a){var b=this.org_x-a,c=0,d,e,f;if(b==0)return;b>0?c=b<this.max_width*.45?0:1:c=-b<this.max_width*.45?0:1,c||(d=Date.now()-this.org_time,Math.abs(b)/d>1&&(c=1)),c&&(b>0&&this.next_img.length?(this._detach(this.index-1,this.prev_img),this.prev_img=this.cur_img,this.cur_img=this.next_img,this.next_img=this.next_img.next(),this.index++,this.next_img.length&&(this._moveLeft(this.next_img,this.window_width+"px"),this._attach(this.index+1,this.next_img)),this.direction=1):b<0&&this.prev_img.length&&(this._detach(this.index+1,this.next_img),this.next_img=this.cur_img,this.cur_img=this.prev_img,this.prev_img=this.prev_img.prev(),this.index--,this.prev_img.length&&(this._moveLeft(this.prev_img,-this.window_width+"px"),this._attach(this.index-1,this.prev_img)),this.direction=-1)),e=this.options.duration,f=this,this.moving=!0,setTimeout(function(){f.moving=!1},e-25),this._moveLeft(this.cur_img,"0px",e),this.next_img.length&&this._moveLeft(this.next_img,this.window_width+"px",e),this.prev_img.length&&this._moveLeft(this.prev_img,-this.window_width+"px",e)},_add_event:function(){var a=this,b;this.container.bind("vmousemove",function(b){b.preventDefault();if(a.moving)return;if(!a.dragging)return;a._drag(b.pageX)}),this.container.bind("vmousedown",function(b){b.preventDefault();if(a.moving)return;a.dragging=!0,a.org_x=b.pageX,a.org_time=Date.now()}),this.container.bind("vmouseup",function(b){if(a.moving)return;a.dragging=!1,a._move(b.pageX)}),this.container.bind("vmouseout",function(b){if(a.moving)return;if(!a.dragging)return;if(b.pageX<20||b.pageX>a.max_width-20)a._move(b.pageX),a.dragging=!1})},_del_event:function(){this.container.unbind("vmousemove"),this.container.unbind("vmousedown"),this.container.unbind("vmouseup"),this.container.unbind("vmouseout")},_moveLeft:function(b,d,e){var f,g="",h=null;a.support.cssTransform3d?f="translate3d("+d+", 0px, 0px)":f="translate("+d+", 0px)";if(!e||e!==c)g="-webkit-transform "+e/1e3+"s ease";return h={"-moz-transform":f,"-webkit-transform":f,"-ms-transform":f,"-o-transform":f,transform:f},g!==""&&(h["-webkit-transition"]=g),b.css(h),b},_show:function(){this.window_width=a(b).width(),this.max_width=this._get_width(),this.max_height=this._get_height(),this.container.css("height",this.max_height),this.cur_img=a("div").find(".ui-gallery-bg:eq("+this.index+")"),this.prev_img=this.cur_img.prev(),this.next_img=this.cur_img.next(),this._attach(this.index-1,this.prev_img),this._attach(this.index,this.cur_img),this._attach(this.index+1,this.next_img),this.prev_img.length&&this._moveLeft(this.prev_img,-this.window_width+"px"),this._moveLeft(this.cur_img,"0px"),this.next_img.length&&this._moveLeft(this.next_img,this.window_width+"px")},show:function(){if(!this.images.length)return;this._show(),this._add_event()},_hide:function(){this._detach(this.index-1,this.prev_img),this._detach(this.index,this.cur_img),this._detach(this.index+1,this.next_img)},hide:function(){this._hide(),this._del_event()},_get_width:function(){return a(this.element).width()},_get_height:function(){var c=a(this.element).parentsUntil("ui-page"),d=c.children(".ui-content"),e=c.children(".ui-header").outerHeight()||0,f=c.children(".ui-footer").outerHeight()||0,g=parseFloat(d.css("padding-top"))+parseFloat(d.css("padding-bottom")),h=a(b).height()-e-f-g;return h},_create:function(){var c,d=this,e,f=0;a(this.element).wrapInner('<div class="ui-gallery"></div>'),
+a(this.element).find("img").wrap('<div class="ui-gallery-bg"></div>'),this.container=a(this.element).find(".ui-gallery"),c=a("div").find(".ui-gallery-bg:first");while(c.length)this.images[f]=c.find("img"),c=c.next(),f++;this._detach_all(),e=parseInt(a(this.element).jqmData("index"),10),e||(e=0),e<0&&(e=0),e>=this.images.length&&(e=this.images.length-1),this.index=e,this.align_type=a(this.element).jqmData("vertical-align"),a(b).bind("resize",function(){d.refresh()})},_update:function(){var b,c,d;while(this.images_hold.length)b=this.images_hold.shift(),c=a('<div class="ui-gallery-bg"></div>'),d=a('<img src="'+b+'"></div>'),c.append(d),this.container.append(c),this.images.push(d);this._detach_all()},refresh:function(a){return this._update(),this._hide(),a===c&&(a=this.index),a<0&&(a=0),a>=this.images.length&&(a=this.images.length-1),this.index=a,this._show(),this.index},add:function(a){this.images_hold.push(a)},remove:function(b){var d;b===c&&(b=this.index);if(b<0||b>=this.images.length)return;b==this.index?(d=this.cur_img,this.index==0?this.direction=1:this.index==this.images.length-1&&(this.direction=-1),this.direction<0?(this.cur_img=this.prev_img,this.prev_img=this.prev_img.prev(),this.prev_img.length&&(this._moveLeft(this.prev_img,-this.window_width),this._attach(b-2,this.prev_img)),this.index--):(this.cur_img=this.next_img,this.next_img=this.next_img.next(),this.next_img.length&&(this._moveLeft(this.next_img,this.window_width),this._attach(b+2,this.next_img))),this._moveLeft(this.cur_img,"0px",this.options.duration)):b==this.index-1?(d=this.prev_img,this.prev_img=this.prev_img.prev(),this.prev_img.length&&(this._moveLeft(this.prev_img,-this.window_width),this._attach(b-1,this.prev_img)),this.index--):b==this.index+1?(d=this.next_img,this.next_img=this.next_img.next(),this.next_img.length&&(this._moveLeft(this.next_img,this.window_width),this._attach(b+1,this.next_img))):d=a("div").find(".ui-gallery-bg:eq("+b+")"),this.images.splice(b,1),d.detach()},empty:function(){this.images.splice(0,this.images.length),this.container.find(".ui-gallery-bg").detach()},length:function(){return this.images.length},value:function(a){if(a===c)return this.index;this.refresh(a)}}),a(document).bind("pagecreate create",function(b){a(b.target).find(":jqmData(role='gallery')").gallery()}),a(document).bind("pageshow",function(b){a(b.target).find(":jqmData(role='gallery')").gallery("show")}),a(document).bind("pagebeforehide",function(b){a(b.target).find(":jqmData(role='gallery')").gallery("hide")})}(jQuery,this),function(a,b){var c={};a.widget("tizen.extendablelist",a.mobile.widget,{options:{theme:"s",countTheme:"c",headerTheme:"b",dividerTheme:"b",splitIcon:"arrow-r",splitTheme:"b",inset:!1,id:"",extenditems:50,childSelector:" li",dbtable:"",template:"",loadmore:"tmp_load_more",scrollview:!1,initSelector:":jqmData(role='extendablelist')"},_stylerMouseUp:function(){a(this).addClass("ui-btn-up-s"),a(this).removeClass("ui-btn-down-s")},_stylerMouseDown:function(){a(this).addClass("ui-btn-down-s"),a(this).removeClass("ui-btn-up-s")},_stylerMouseOver:function(){a(this).toggleClass("ui-btn-hover-s")},_stylerMouseOut:function(){a(this).toggleClass("ui-btn-hover-s"),a(this).addClass("ui-btn-up-s"),a(this).removeClass("ui-btn-down-s")},_pushData:function(b){var c=this.options,d=this,e=0,f=a("#"+b),g=c.extenditems>d._numItemData-d._lastIndex?d._numItemData-d.lastIndex:c.extenditems,h;for(e=0;e<g;e++)h=f.tmpl(d._itemData(e)),a(c.id).append(a(h).attr("id","li_"+e)),a(c.id+">"+c.childSelector).addClass("ui-btn-up-s").bind("mouseup",d._stylerMouseUp).bind("mousedown",d._stylerMouseDown).bind("mouseover",d._stylerMouseOver).bind("mouseout",d._stylerMouseOut),d._lastIndex+=1;a(c.id).trigger("create")},_loadmore:function(b){var c=b.data,d=c.options,e=0,f=a("#"+d.template),g=d.extenditems>c._numItemData-c._lastIndex?c._numItemData-c._lastIndex:d.extenditems,h,i,j;a("#load_more_message").remove();for(e=0;e<g;e++)h=f.tmpl(c._itemData(c._lastIndex)),a(d.id).append(a(h).attr("id","li_"+c._lastIndex)),c._lastIndex+=1;c._numItemData>c._lastIndex&&(f=a("#"+d.loadmore),i=c._numItemData-c._lastIndex,j=d.extenditems<=i?d.extenditems:i,h=f.tmpl({NUM_MORE_ITEMS:j}),a(d.id).append(a(h).attr("id","load_more_message").css("min-height","37px"))),a(d.id).trigger("create"),a(d.id).extendablelist("refresh")},recreate:function(a){this._create({itemData:function(b){return a[b]},numItemData:a.length})},_initList:function(b){var c=this,d=this.options,e,f,g,h;c._lastIndex<=0&&(c._pushData(d.template),c._numItemData>c._lastIndex?(e=a("#"+d.loadmore),f=c._numItemData-c._lastIndex,g=d.extenditems<=f?d.extenditems:f,h=e.tmpl({NUM_MORE_ITEMS:g}),a(d.id).append(a(h).attr("id","load_more_message").css("min-height","37px")),a("#load_more_message").live("click",c,c._loadmore)):(a("#load_more_message").die(),a("#load_more_message").remove())),d.childSelector==" ul"&&a(d.id+" ul").swipelist(),a(d.id).trigger("create"),c.refresh(!0)},create:function(){var a=this.options;this._create.apply(this,arguments)},_create:function(b){var c=this,d=this.options,e=this.element,f;c.destroy(),a.extend(this,{_itemData:function(a){return null},_numItemData:0,_cacheItemData:function(a,b){},_lastIndex:0}),c.element.addClass(function(a,b){return b+" ui-listview ui-extendable-list-container"+(c.options.inset?" ui-listview-inset ui-corner-all ui-shadow ":"")}),d.id="#"+e.attr("id"),e.data("extenditems")&&(d.extenditems=parseInt(e.data("extenditems"),10)),a(d.id).bind("pagehide",function(b){a(d.id).empty()}),a(".ui-scrollview-clip").size()>0?d.scrollview=!0:d.scrollview=!1;if(b){if(!c._loadData(b))return}else{console.warn("WARNING: The data interface of extendable list is changed. \nOld data interface(data-dbtable) is still supported, but will be removed in next version. \nPlease fix your code soon!");if(!a(d.id).hasClass("elLoadSuccess")){console.warn("No elLoadSuccess class");return}f=e.jqmData("dbtable"),d.dbtable=window[f],d.dbtable||(d.dbtable={}),c._itemData=function(a){return d.dbtable[a]},c._numItemData=d.dbtable.length}e.data("template")&&(d.template=e.data("template"),e.data("swipelist")==1?d.childSelector=" ul":d.shildSelector=" li"),c._initList(b)},_loadData:function(a){var b=this;if(!a.itemData||typeof a.itemData!="function")return!1;b._itemData=a.itemData;if(!a.numItemData)return!1;if(typeof a.numItemData=="function")b._numItemData=a.numItemData();else{if(typeof a.numItemData!="number")return!1;b._numItemData=a.numItemData}return!0},destroy:function(){var b=this.options,c=0,d=0;a(b.id).empty(),a("#load_more_message").die()},_itemApply:function(b,c){var d=c.find(".ui-li-count");d.length&&c.addClass("ui-li-has-count"),d.addClass("ui-btn-up-"+(b.jqmData("counttheme")||this.options.countTheme)+" ui-btn-corner-all"),c.find("h1, h2, h3, h4, h5, h6").addClass("ui-li-heading").end().find("p, dl").addClass("ui-li-desc").end().find(">img:eq(0), .ui-link-inherit>img:eq(0)").addClass("ui-li-thumb").each(function(){c.addClass(a(this).is(".ui-li-icon")?"ui-li-has-icon":"ui-li-has-thumb")}).end().find(".ui-li-aside").each(function(){var b=a(this);b.prependTo(b.parent())})},_removeCorners:function(a,b){var c="ui-corner-top ui-corner-tr ui-corner-tl",d="ui-corner-bottom ui-corner-br ui-corner-bl";a=a.add(a.find(".ui-btn-inner, .ui-li-link-alt, .ui-li-thumb")),b==="top"?a.removeClass(c):b==="bottom"?a.removeClass(d):a.removeClass(c+" "+d)},_refreshCorners:function(a){var b,c,d,e;this.options.inset&&(b=this.element.children("li"),c=a?b.not(".ui-screen-hidden"):b.filter(":visible"),this._removeCorners(b),d=c.first().addClass("ui-corner-top"),d.add(d.find(".ui-btn-inner")).find(".ui-li-link-alt").addClass("ui-corner-tr").end().find(".ui-li-thumb").not(".ui-li-icon").addClass("ui-corner-tl"),e=c.last().addClass("ui-corner-bottom"),e.add(e.find(".ui-btn-inner")).find(".ui-li-link-alt").addClass("ui-corner-br").end().find(".ui-li-thumb").not(".ui-li-icon").addClass("ui-corner-bl"))},refresh:function(b){this.parentPage=this.element.closest(".ui-page"),this._createSubPages();var c=this.options,d=this.element,e=this,f=d.jqmData("dividertheme")||c.dividerTheme,g=d.jqmData("splittheme"),h=d.jqmData("spliticon"),i=d.children("li"),j=a.support.cssPseudoElement||!a.nodeName(d[0],"ol")?0:1,k,l,m,n,o,p,q,r,s,t;j&&d.find(".ui-li-dec").remove();for(s=0,t=i.length;s<t;s++){k=i.eq(s),l="ui-li";if(b||!k.hasClass("ui-li"))m=k.jqmData("theme")||c.theme,n=k.children("a"),n.length?(r=k.jqmData("icon"),k.buttonMarkup({wrapperEls:"div",shadow:!1,corners:!1,iconpos:"right",icon:!1,theme:m}),r!=0&&n.length==1&&k.addClass("ui-li-has-arrow"),n.first().addClass("ui-link-inherit"),n.length>1&&(l+=" ui-li-has-alt",o=n.last(),p=g||o.jqmData("theme")||c.splitTheme,o.appendTo(k).attr("title",o.getEncodedText()).addClass("ui-li-link-alt").empty().buttonMarkup({shadow:!1,corners:!1,theme:m,icon:!1,iconpos:!1}).find(".ui-btn-inner").append(a("<span />").buttonMarkup({shadow:!0,corners:!0,theme:p,iconpos:"notext",icon:h||o.jqmData("icon")||c.splitIcon})))):k.jqmData("role")==="list-divider"?(l+=" ui-li-divider ui-btn ui-bar-"+f,k.attr("role","heading"),j&&(j=1)):l+=" ui-li-static ui-body-"+m;j&&l.indexOf("ui-li-divider")<0&&(q=k.is(".ui-li-static:first")?k:k.find(".ui-link-inherit"),q.addClass("ui-li-jsnumbering").prepend("<span class='ui-li-dec'>"+j++ +". </span>")),k.add(k.children(".ui-btn-inner")).addClass(l),e._itemApply(d,k)}this._refreshCorners(b)},_idStringEscape:function(a){return a.replace(/\W/g,"-")},_createSubPages:function(){var b=this.element,d=b.closest(".ui-page"),e=d.jqmData("url"),f=e||d[0][a.expando],g=b.attr("id"),h=this.options,i="data-"+a.mobile.ns,j=this,k=d.find(":jqmData(role='footer')").jqmData("id"),l,m;typeof c[f]=="undefined"&&(c[f]=-1),g=g||++c[f],a(b.find("li>ul, li>ol").toArray().reverse()).each(function(c){var d=this,f=a(this),j=f.attr("id")||g+"-"+c,m=f.parent(),n,p=n.first().getEncodedText(),q=(e||"")+"&"+a.mobile.subPageUrlKey+"="+j,r=f.jqmData("theme")||h.theme,s=f.jqmData("counttheme")||b.jqmData("counttheme")||h.countTheme,t,u;n=a(f.prevAll().toArray().reverse()),n=n.length?n:a("<span>"+a.trim(m.contents()[0].nodeValue)+"</span>"),l=!0,t=f.detach().wrap("<div "+i+"role='page' "+i+"url='"+q+"' "+i+"theme='"+r+"' "+i+"count-theme='"+s+"'><div "+i+"role='content'></div></div>").parent().before("<div "+i+"role='header' "+i+"theme='"+h.headerTheme+"'><div class='ui-title'>"+p+"</div></div>").after(k?a("<div "+i+"role='footer' "+i+"id='"+k+"'>"):"").parent().appendTo(a.mobile.pageContainer),t.page(),u=m.find("a:first"),u.length||(u=a("<a/>").html(n||p).prependTo(m.empty())),u.attr("href","#"+q)}).extendablelist(),l&&d.is(":jqmData(external-page='true')")&&d.data("page").options.domCache===!1&&(m=function(b,c){var f=c.nextPage,g;c.nextPage&&(g=f.jqmData("url"),g.indexOf(e+"&"+a.mobile.subPageUrlKey)!==0&&(j.childPages().remove(),d.remove()))},d.unbind("pagehide.remove").bind("pagehide.remove",m))},childPages:function(){var b=this.parentPage.jqmData("url");return a(":jqmData(url^='"+b+"&"+a.mobile.subPageUrlKey+"')")}}),a(document).bind("pagecreate create",function(b){a(a.tizen.extendablelist.prototype.options.initSelector,b.target).extendablelist()})}(jQuery),function(a,b){a.widget("tizen.fastscroll",a.mobile.widget,{options:{initSelector:":jqmData(fastscroll)"},_primaryLanguage:null,_secondLanguage:null,_create:function(){var b=this.element,c=this,d,e=b.closest(':jqmData(role="page")'),f;this.scrollview=b.closest(".ui-scrollview-clip"),this.shortcutsContainer=a('<div class="ui-fastscroll" aria-label="Fast scroll bar, double tap to fast scroll mode" tabindex="0"/>'),this.shortcutsList=a('<ul aria-hidden="true"></ul>'),this.scrollview.append(a('<div class="ui-fastscroll-popup"></div>')),d=this.scrollview.find(".ui-fastscroll-popup"),this.shortcutsContainer.append(this.shortcutsList),this.scrollview.append(this.shortcutsContainer),this.lastListItem=b.children().last(),this.scrollview.find(".ui-scrollbar").hide(),this.jumpToDivider=function(b){var d=a(b).position().top,e=c.lastListItem.outerHeight(!0)+c.lastListItem.position().top,f=c.scrollview.height(),g=e-f,h;d=d>g?g:d,d=Math.max(d,0),c.scrollview.scrollview("scrollTo",0,-d),h=c.scrollview.offset()},this.shortcutsList.bind("touchstart mousedown vmousedown touchmove vmousemove vmouseover",function(b){var d=a.mobile.tizen.targetRelativeCoordsFromEvent(b),e=c.shortcutsList.offset();b.target.tagName.toLowerCase()==="li"&&(d.x+=a(b.target).offset().left-e.left,d.y+=a(b.target).offset().top-e.top),b.target.tagName.toLowerCase()==="span"&&(d.x+=a(b.target).parent().offset().left-e.left,d.y+=a(b.target).parent().offset().top-e.top),c.shortcutsList.find("li").each(function(){var b=a(this);a(b).removeClass("ui-fastscroll-hover").removeClass("ui-fastscroll-hover-up").removeClass("ui-fastscroll-hover-down")}),c.shortcutsList.find("li").each(function(){var b=a(this),f=b.offset().left-e.left,g=b.offset().top-e.top,h=f+Math.abs(b.outerWidth(!0)),i=g+Math.abs(b.outerHeight(!0));return d.x>=f&&d.x<=h&&d.y>=g&&d.y<=i?(c._hitItem(b),!1):!0}),b.preventDefault(),b.stopPropagation()}).bind("touchend mouseup vmouseup vmouseout",function(){d.hide(),a(".ui-fastscroll-hover").removeClass("ui-fastscroll-hover"),a(".ui-fastscroll-hover-first-item").removeClass("ui-fastscroll-hover-first-item"),a(".ui-fastscroll-hover-up").removeClass("ui-fastscroll-hover-up"),a(".ui-fastscroll-hover-down").removeClass("ui-fastscroll-hover-down")}),e&&!e.is(":visible")?e.bind("pageshow",function(){c.refresh()}):c.refresh(),b.bind("updatelayout",function(){c.refresh()}),a(window).unbind(".fastscroll").bind("resize.fastscroll",function(a){c.refresh()})},_hitItem:function(b){var c=this,d=c.scrollview.find(".ui-fastscroll-popup");typeof b.data("divider")!="undefined"&&c.jumpToDivider(a(b.data("divider"))),b.text()!=="."?d.text(b.text()).css({marginLeft:-(d.width()/2),marginTop:-(d.height()/2),padding:d.css("paddingTop")}).width(d.height()).show():d.hide(),a(b).addClass("ui-fastscroll-hover"),b.index()===0&&a(b).addClass("ui-fastscroll-hover-first-item"),b.index()>0&&a(b).siblings().eq(b.index()-1).addClass("ui-fastscroll-hover-up"),a(b).siblings().eq(b.index()).addClass("ui-fastscroll-hover-down")},_focusItem:function(b){var c=this,d=c.scrollview.find(".ui-fastscroll-popup");b.focusin(function(a){c._hitItem(b)}).focusout(function(b){d.hide(),a(".ui-fastscroll-hover").removeClass("ui-fastscroll-hover"),a(".ui-fastscroll-hover-first-item").removeClass("ui-fastscroll-hover-first-item"),a(".ui-fastscroll-hover-up").removeClass("ui-fastscroll-hover-up"),a(".ui-fastscroll-hover-down").removeClass("ui-fastscroll-hover-down")})},_contentHeight:function(){var b=this,c=a(".ui-scrollview-clip"),d=null,e=null,f=0,g=a(window).height();return c.hasClass("ui-content")?(f=parseInt(c.css("padding-top"),10),g-=f||0,f=parseInt(c.css("padding-bottom"),10),g-=f||0,d=c.siblings(".ui-header:visible"),e=c.siblings(".ui-footer:visible"),d&&(d.outerHeight(!0)===null?g-=a(".ui-header").outerHeight()||0:g-=d.outerHeight(!0)),e&&(g-=e.outerHeight(!0))):g=c.height(),g},_omit:function(a,b){var c=parseInt((b-1)/2,10),d=a-b,e=[],f=[],g,h,i,j;if(b<3||a<=b)return;d>=c?(i=2,h=1,g=c):(i=b/(d+1),h=i,g=d);for(j=0;j<g;j++)e.push(parseInt(h,10)),h+=i;for(j=0;j<b;j++)f.push(1);for(j=0;j<d;j++)f[e[j%c]]++;return f},indexString:function(a){var b=this,c=[];if(typeof a==" undefined")return b._primaryLanguage+":"+b._secondLanguage;c=a.split(":"),b._primaryLanguage=c[0],c.length===2&&(b._secondLanguage=c[1])},refresh:function(){var b=this,c=b._primaryLanguage?b._primaryLanguage.replace(/,/g,""):null,d=b._secondLanguage?b._secondLanguage.replace(/,/g,""):null,e=b._contentHeight(),f=a('<li tabindex="0" aria-label="double to move Number list"><span aria-hidden="true">#</span><span aria-label="Number"/></li>'),g=0,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B;h=function(b,c){a(c).text()===w&&k.data("divider",c).bind("vclick",function(b){a(c).next().focus()})},b.shortcutsList.find("li").remove(),s=b.element.find(".ui-li-divider"),t=b.element.find("li").not(".ui-li-divider"),s=s.filter(":visible"),t=t.filter(":visible");if(s.length<2){b.shortcutsList.hide();return}b.shortcutsList.show(),b.lastListItem=t.last(),b.shortcutsList.append(f),b._focusItem(f);if(c!==null){q=parseInt(f.css("padding"),10),p=f.height()+q*2,n=parseInt(e/p-1,10),o=c.length,n=d?n-2:n;if(n<3){f.remove();return}r=b._omit(o,n);for(B=0;B<c.length;B++)w=c.charAt(B),k=a('<li tabindex="0" aria-label="double to move '+w+' list">'+w+"</li>"),b._focusItem(k),s.each(h),typeof r!="undefined"&&r[g]>1&&(k=a("<li>.</li>"),B+=r[g]-1),f.before(k),g++;if(d!==null){x=d.length-1,y=[],y.push(d.charAt(0)),y.push(d.charAt(x));for(B=0;B<y.length;B++)w=y[B],k=a('<li tabindex="0" aria-label="double to move '+w+' list">'+w+"</li>"),b._focusItem(k),s.each(h),f.before(k)}}else s.each(function(c,d){w=a(d).text(),k=a('<li tabindex="0" aria-label="double to move '+w+' list">'+w+"</li>"),k.data("divider",d),b._focusItem(k),f.before(k)});i=b.shortcutsContainer.outerHeight(),u=e-i,j=b.shortcutsList.children(),A=parseInt(u/j.length,10),v=u-j.length*A,u>0&&j.each(function(b,c){z=a(c).height()+A,v!==0&&(z+=1,v-=1),a(c).css({height:z,lineHeight:z+"px"})}),l=s.first().position().top,b.shortcutsContainer.css("top",l),m=l+b.shortcutsContainer.outerHeight()+"px",b.scrollview.css("min-height",m)}}),a(document).bind("pagecreate create",function(b){a(a.tizen.fastscroll.prototype.options.initSelector,b.target).not(":jqmData(role='none'), :jqmData(role='nojs')").fastscroll()})}(jQuery),function(a,b,c,d){a.widget("tizen.multimediaview",a.mobile.widget,{options:{theme:null,controls:!0,fullScreen:!1,initSelector:"video, audio"},_create:function(){var b=this,c=b.element,d=c[0],e=d.nodeName==="VIDEO",f=b.options,g=a.mobile.getInheritedTheme(c,"s"),h=f.theme||g,i=d.style.getPropertyValue("width")||"",j=a("<div class='ui-multimediaview-wrap ui-multimediaview-"+h+"'>"),k=null;a.extend(this,{role:null,controlTimer:null,isVolumeHide:!0,backupView:null,_reserveVolume:-1,_isVideo:e}),c.addClass("ui-multimediaview"),k=b._createControl(),k.hide(),k.find(".ui-button").each(function(b){a(this).buttonMarkup({corners:!0,theme:h,shadow:!0})}),c.wrap(j).after(k),e?k.addClass("ui-multimediaview-video"):(b.width(i),b.options.fullScreen=!1),f.controls&&c.attr("controls")&&c.removeAttr("controls"),b._addEvent()},_resize:function(){this._resizeFullscreen(this.options.fullScreen),this._resizeControl(),this._updateSeekBar(),this._updateVolumeState()},_resizeControl:function(){var a=this,b=a.element,c=b[0],d=a._isVideo,e=b.parent(".ui-multimediaview-wrap"),f=e.find(".ui-multimediaview-control"),g=f.find(".ui-button"),h=f.find(".ui-playpausebutton"),i=f.find(".ui-seekbar"),j=f.find(".ui-durationlabel"),k=f.find(".ui-timestamplabel"),l=f.find(".ui-volumecontrol"),m=l.find(".ui-volumebar"),n=d?b.width():e.width(),o=d?b.height():f.height(),p=b.offset(),q=f.height(),r=0,s=null;f&&(d&&(s=f.offset(),s.left=p.left,s.top=p.top+o-q,f.offset(s)),f.width(n)),i&&(r=f.width()-g.outerWidth(!0)*g.length,r-=(parseInt(g.eq(0).css("margin-left"),10)+parseInt(g.eq(0).css("margin-right"),10))*g.length,a.isVolumeHide||(r-=l.outerWidth(!0)),i.width(r)),j&&!isNaN(c.duration)&&j.find("p").text(a._convertTimeFormat(c.duration)),c.autoplay&&c.paused===!1&&h.removeClass("ui-play-icon").addClass("ui-pause-icon"),i.width()<m.width()+k.width()+j.width()?j.hide():j.show()},_resizeFullscreen:function(b){if(!this._isVideo)return;var c=this,d=c.element,e=d[0],f=d.parent(".ui-multimediaview-wrap"),g=f.find(".ui-multimediaview-control"),h=g.find(".ui-fullscreenbutton"),i=a(".ui-page-active"),j=g.find(".ui-playpausebutton"),k=g.find(".ui-timestamplabel"),l=g.find(".ui-seekbar"),m=l.find(".ui-duration"),n=l.find(".ui-currenttime"),o=a("body")[0],p=i.children(".ui-header"),q=i.children(".ui-footer"),r=0,s=0;if(b)c.backupView||(c.backupView={width:e.style.getPropertyValue("width")||"",height:e.style.getPropertyValue("height")||"",position:d.css("position"),zindex:d.css("z-index"),wrapHeight:f[0].style.getPropertyValue("height")||""}),r=o.clientWidth,s=o.clientHeight,p.hide(),q.hide(),d.parents().each(function(b){var c=a(this);c.addClass("ui-fullscreen-parents").siblings().addClass("ui-multimediaview-siblings-off")}),this._fitContentArea(i),h.removeClass("ui-fullscreen-on").addClass("ui-fullscreen-off"),d.width(r).height(s-1),f.height(s-1),d.offset({top:0,left:0}).addClass("ui-multimediaview-fullscreen");else{if(!c.backupView)return;p.show(),q.show(),d.parents().each(function(b){var c=a(this);c.removeClass("ui-fullscreen-parents").siblings().removeClass("ui-multimediaview-siblings-off")}),this._fitContentArea(i),h.removeClass("ui-fullscreen-off").addClass("ui-fullscreen-on"),f.css("height",c.backupView.wrapHeight),d.css({width:c.backupView.width,height:c.backupView.height,position:c.backupView.position,"z-index":c.backupView.zindex}).removeClass("ui-multimediaview-fullscreen"),c.backupView=null}},_addEvent:function(){var d=this,e=d.element,f=d.options,g=e[0],h=d._isVideo,i=e.parent(".ui-multimediaview-wrap").find(".ui-multimediaview-control"),j=i.find(".ui-playpausebutton"),k=i.find(".ui-timestamplabel"),l=i.find(".ui-durationlabel"),m=i.find(".ui-volumebutton"),n=i.find(".ui-volumecontrol"),o=n.find(".ui-volumebar"),p=n.find(".ui-guide"),q=n.find(".ui-handle"),r=i.find(".ui-fullscreenbutton"),s=i.find(".ui-seekbar"),t=s.find(".ui-duration"),u=s.find(".ui-currenttime"),v=a(b);v.unbind(".multimediaview").bind("pagechange.multimediaview",function(b){var c=a(b.target);c.find(e).length>0&&g.autoplay&&g.play(),f.controls&&d._resize()}).bind("pagebeforechange.multimediaview",function(a){f.fullScreen&&d.fullScreen(!f.fullScreen),g.played.length!==0&&g.pause()}),a(c).unbind(".multimediaview").bind("resize.multimediaview orientationchange.multimediaview",function(b){if(!f.controls)return;var c=a(b.target),g=e.parents(".ui-scrollview-clip");g.each(function(b){a.data(this,"scrollview")&&a(this).scrollview("scrollTo",0,0)}),f.fullScreen?(a(".ui-footer").hide(),d._fitContentArea(c)):a(".ui-footer:visible").show(),i.css("display")!=="none"&&d._resize()}),e.bind("loadedmetadata.multimediaview",function(a){isNaN(g.duration)||l.find("p").text(d._convertTimeFormat(g.duration)),d._resize()}).bind("timeupdate.multimediaview",function(a){d._updateSeekBar()}).bind("play.multimediaview",function(a){j.removeClass("ui-play-icon").addClass("ui-pause-icon")}).bind("pause.multimediaview",function(a){j.removeClass("ui-pause-icon").addClass("ui-play-icon")}).bind("ended.multimediaview",function(a){(typeof g.loop=="undefined"||g.loop==="")&&d.stop()}).bind("volumechange.multimediaview",function(a){g.muted&&g.volume>.1?(m.removeClass("ui-volume-icon").addClass("ui-mute-icon"),d._reserveVolume=g.volume,g.volume=0):d._reserveVolume!==-1&&!g.muted?(m.removeClass("ui-mute-icon").addClass("ui-volume-icon"),g.volume=d._reserveVolume,d._reserveVolume=-1):g.volume<.1?m.removeClass("ui-volume-icon").addClass("ui-mute-icon"):m.removeClass("ui-mute-icon").addClass("ui-volume-icon"),d.isVolumeHide||d._updateVolumeState()}).bind("durationchange.multimediaview",function(a){isNaN(g.duration)||l.find("p").text(d._convertTimeFormat(g.duration)),d._resize()}).bind("click.multimediaview",function(a){if(!d.options.controls)return;i.fadeToggle("fast"),d._resize()}).bind("multimediaviewinit",function(a){f.controls&&i.show(),d._resize()}),j.bind("click.multimediaview",function(){d._endTimer(),g.paused?g.play():g.pause(),h&&d._startTimer()}),r.bind("click.multimediaview",function(a){a.preventDefault(),d.fullScreen(!d.options.fullScreen),i.fadeIn("fast",function(){d._resize()}),d._endTimer(),a.stopPropagation()}),s.bind("vmousedown.multimediaview",function(a){var b=a.clientX,c=g.duration,e=t.offset(),f=t.width(),h=(b-e.left)/f,i=c*h;if(!g.played.length)return;g.currentTime=i,d._endTimer(),a.preventDefault(),v.bind("vmousemove.multimediaview",function(a){var b=a.clientX,d=(b-e.left)/f;g.currentTime=c*d,a.preventDefault()}).bind("vmouseup.multimediaview",function(){v.unbind("vmousemove.multimediaview vmouseup.multimediaview"),g.paused?g.pause():g.play()})}),m.bind("click.multimediaview",function(){if(d.isVolumeHide){var a=d.element,b=g.volume;d.isVolumeHide=!1,n.fadeIn("fast",function(){d._updateVolumeState(),d._updateSeekBar()}),d._resize()}else d.isVolumeHide=!0,n.fadeOut("fast",function(){d._resize()})}),o.bind("vmousedown.multimediaview",function(a){var b=a.clientX,c=p.offset().left,e=p.width(),f=c+e,g=q.offset(),h=(b-c)/e,i=(b-c)/e;d._endTimer(),d._setVolume(i.toFixed(2)),a.preventDefault(),v.bind("vmousemove.multimediaview",function(a){var b=a.clientX,f=(b-c)/e;d._setVolume(f.toFixed(2)),a.preventDefault()}).bind("vmouseup.multimediaview",function(){v.unbind("vmousemove.multimediaview vmouseup.multimediaview")})})},_removeEvent:function(){var a=this.element,b=a.parent(".ui-multimediaview-wrap").find(".ui-multimediaview-control"),c=b.find(".ui-playpausebutton"),d=b.find(".ui-fullscreenbutton"),e=b.find(".ui-seekbar"),f=b.find(".ui-volumecontrol"),g=f.find(".ui-volumebar"),h=f.find(".ui-handle");a.unbind(".multimediaview"),c.unbind(".multimediaview"),d.unbind(".multimediaview"),e.unbind(".multimediaview"),g.unbind(".multimediaview"),h.unbind(".multimediaview")},_createControl:function(){var b=this.element,c=b[0],d=a("<span></span>").addClass("ui-multimediaview-control"),e=a("<span></span>").addClass("ui-playpausebutton ui-button"),f=a("<span></span>").addClass("ui-seekbar ui-multimediaview-bar"),g=a("<span><p>00:00:00</p></span>").addClass("ui-timestamplabel"),h=a("<span><p>00:00:00</p></span>").addClass("ui-durationlabel"),i=a("<span></span>").addClass("ui-volumebutton ui-button"),j=a("<span></span>").addClass("ui-volumecontrol"),k=a("<div></div>").addClass("ui-volumebar ui-multimediaview-bar"),l=a("<span></span>").addClass("ui-guide ui-multimediaview-bar-bg"),m=a("<span></span>").addClass("ui-value ui-multimediaview-bar-highlight"),n=a("<span></span>").addClass("ui-handle"),o=a("<span></span>").addClass("ui-fullscreenbutton ui-button"),p=a("<span></span>").addClass("ui-duration ui-multimediaview-bar-bg"),q=a("<span></span>").addClass("ui-currenttime ui-multimediaview-bar-highlight");return f.append(p).append(q).append(h).append(g),e.addClass("ui-play-icon"),i.addClass(c.muted?"ui-mute-icon":"ui-volume-icon"),k.append(l).append(m).append(n),j.append(k),d.append(e).append(f).append(j).append(i),this._isVideo&&(a(o).addClass("ui-fullscreen-on"),d.append(o)),j.hide(),d},_startTimer:function(a){this._endTimer(),a||(a=3e3);var b=this,c=b.element,d=c.parent(".ui-multimediaview-wrap").find(".ui-multimediaview-control"),e=d.find(".ui-volumecontrol");b.controlTimer=setTimeout(function(){b.isVolumeHide=!0,b.controlTimer=null,e.hide(),d.fadeOut("fast")},a)},_endTimer:function(){this.controlTimer&&(clearTimeout(this.controlTimer),this.controlTimer=null)},_convertTimeFormat:function(b){if(!a.isNumeric(b))return"Playback Error";var c=parseInt(b%60,10).toString(),d=parseInt(b/60%60,10).toString(),e=parseInt(b/3600,10).toString(),f=(e.length<2?"0"+e:e)+":"+(d.length<2?"0"+d:d)+":"+(c.length<2?"0"+c:c);return f},_updateSeekBar:function(a){var b=this.element,c=b[0],d=c.duration,e=b.parent(".ui-multimediaview-wrap").find(".ui-multimediaview-control"),f=e.find(".ui-seekbar"),g=f.find(".ui-duration"),h=f.find(".ui-currenttime"),i=e.find(".ui-timestamplabel"),j=g.offset(),k=g.width(),l=g.height(),m=0;typeof a=="undefined"&&(a=c.currentTime),m=parseInt(a/d*k,10),g.offset(j),h.offset(j).width(m),i.find("p").text(this._convertTimeFormat(a))},_updateVolumeState:function(){var a=this.element,b=a.parent(".ui-multimediaview-wrap").find(".ui-multimediaview-control"),c=b.find(".ui-volumecontrol"),d=b.find(".ui-volumebutton"),e=c.find(".ui-volumebar"),f=c.find(".ui-guide"),g=c.find(".ui-value"),h=c.find(".ui-handle"),i=h.width(),j=h.height(),k=f.height(),l=f.width(),m=0,n=0,o=0,p=null,q=a[0].volume;m=parseInt(f.offset().top,10),n=parseInt(f.offset().left,10),o=n,p=h.offset(),p.top=m-parseInt((j-k)/2,10),p.left=o+parseInt(l*q,10)-parseInt(i/2,10),h.offset(p),g.offset(f.offset()).width(parseInt(l*q,10))},_setVolume:function(a){var b=this.element[0];if(a<0||a>1)return;b.volume=a},_fitContentArea:function(b,d){typeof d=="undefined"&&(d=c);var e=a(b),f=a(".ui-content:visible:first"),g=a(".ui-header:visible").outerHeight()||0,h=a(".ui-footer:visible").outerHeight()||0,i=parseFloat(f.css("padding-top")),j=parseFloat(f.css("padding-bottom")),k=d===c?c.innerHeight:a(d).height(),l=k-(g+h)-(i+j);f.offset({top:g+i}).height(l)},width:function(a){if(this.options.fullScreen)return;var b=this.element,c=b.parent(".ui-multimediaview-wrap");if(arguments.length===0)return b.width();this._isVideo||c.width(a),b.width(a),this._resize()},height:function(a){if(!this._isVideo||this.options.fullScreen)return;var b=this.element;if(arguments.length===0)return b.height();b.height(a),this._resize()},fullScreen:function(a){if(!this._isVideo)return;var b=this.element,c=this.options;if(arguments.length===0)return c.fullScreen;b.parents(".ui-scrollview-clip").scrollview("scrollTo",0,0),this.options.fullScreen=a,this._resize()},refresh:function(){this._resize()}}),a(b).bind("pagecreate create",function(b){a.tizen.multimediaview.prototype.enhanceWithin(b.target)})}(jQuery,document,window),function(a,b,c){a.mobile.defaultPageTransition="none",a.mobile.transitionHandlers.depth=a.mobile.transitionHandlers.simultaneous,a.mobile.transitionFallbacks.depth="fade",a.fn.buttonMarkup.defaults.corners=!1,a.mobile.buttonMarkup.hoverDelay=0}(jQuery,this),function(a,b){ensureNS("jQuery.mobile.tizen"),jQuery.extend(jQuery.mobile.tizen,{_widgetPrototypes:{},loadPrototype:function(c,d){function h(a){return a.replace(/\$\{FRAMEWORK_ROOT\}/g,g)}function i(a,b){var c;for(var d in a)typeof a[d]=="string"?(c=a[d],a[d]=b.find(a[d]),c.substring(0,1)==="#"&&a[d].removeAttr("id")):typeof a[d]=="object"&&(a[d]=i(a[d],b));return a}var e=b,f=a("script[data-framework-version][data-framework-root][data-framework-theme]"),g=f.attr("data-framework-root")+"/"+f.attr("data-framework-version")+"/";if(typeof c=="string"){e=a.mobile.tizen._widgetPrototypes[c];if(e===b){var j=g+"proto-html"+"/"+f.attr("data-framework-theme");a.ajax({url:j+"/"+c+".prototype.html",async:!1,dataType:"html"}).success(function(b,d,f){a.mobile.tizen._widgetPrototypes[c]=a("<div>").html(h(b)),e=a.mobile.tizen._widgetPrototypes[c].clone()})}}else c.key!==b&&(e=a.mobile.tizen._widgetPrototypes[c.key]),e===b?c.proto!==b&&(e=a("<div>").html(h(c.proto)),c.key!==b&&(a.mobile.tizen._widgetPrototypes[c.key]=e.clone())):e=e.clone();return e!=b&&d!=b&&(e=i(d,e)),e}})}(jQuery),ensureNS("jQuery.mobile.tizen.clrlib"),jQuery.extend(jQuery.mobile.tizen.clrlib,{nearestInt:function(a){var b=Math.floor(a);return a-b>.5?b+1:b},HTMLToRGB:function(a){return a="#"==a.charAt(0)?a.substring(1):a,[a.substring(0,2),a.substring(2,4),a.substring(4,6)].map(function(a){return parseInt(a,16)/255})},RGBToHTML:function(a){return"#"+a.map(function(a){var b=a*255,c=Math.floor(b);return b=b-c>.5?c+1:c,b=(b<16?"0":"")+(b&255).toString(16),b}).join("")},HSLToRGB:function(a){var b=a[0]/360,c=a[1],d=a[2];if(0===c)return[d,d,d];var e=d<.5?d*(1+c):d+c-d*c,f=2*d-e,g={r:b+1/3,g:b,b:b-1/3};return g.r=g.r<0?g.r+1:g.r>1?g.r-1:g.r,g.g=g.g<0?g.g+1:g.g>1?g.g-1:g.g,g.b=g.b<0?g.b+1:g.b>1?g.b-1:g.b,ret=[6*g.r<1?f+(e-f)*6*g.r:2*g.r<1?e:3*g.r<2?f+(e-f)*(2/3-g.r)*6:f,6*g.g<1?f+(e-f)*6*g.g:2*g.g<1?e:3*g.g<2?f+(e-f)*(2/3-g.g)*6:f,6*g.b<1?f+(e-f)*6*g.b:2*g.b<1?e:3*g.b<2?f+(e-f)*(2/3-g.b)*6:f],ret},HSVToRGB:function(a){return $.mobile.tizen.clrlib.HSLToRGB($.mobile.tizen.clrlib.HSVToHSL(a))},RGBToHSV:function(a){var b,c,d,e,f,g,h=a[0],i=a[1],j=a[2];return b=Math.min(h,Math.min(i,j)),c=Math.max(h,Math.max(i,j)),d=c-b,e=0,f=0,g=c,d>1e-5&&(f=d/c,h===c?e=(i-j)/d:i===c?e=2+(j-h)/d:e=4+(h-i)/d,e*=60,e<0&&(e+=360)),[e,f,g]},HSVToHSL:function(a){var b=a[2],c=a[1]*b,d=b-c,e=b+d,f=e/2,g=f<.5?e:2-b-d;return[a[0],0==g?0:c/g,f]},RGBToHSL:function(a){return $.mobile.tizen.clrlib.HSVToHSL($.mobile.tizen.clrlib.RGBToHSV(a))}}),function(a,b,c,d){function g(a){var c=b.FileError,d="";switch(a.code){case c.QUOTA_EXCEEDED_ERR:d="QUOTA_EXCEEDED_ERR";break;case c.NOT_FOUND_ERR:d="NOT_FOUND_ERR";break;case c.SECURITY_ERR:d="SECURITY_ERR";break;case c.INVALID_MODIFICATION_ERR:d="INVALID_MODIFICATION_ERR";break;case c.INVALID_STATE_ERR:d="INVALID_STATE_ERR";break;default:d="Unknown Error"}return d}function h(a){var b=a.replace(/\//gi,"_");return b}function i(a,b,c,d,e){var f=0,g=0,h=0,i=0,j=a/c,k=b/d,l=Math.max(j,k);return e?(f=c,g=d):(l>1?(f=a/l,g=b/l):(f=a,g=b),h=(c-f)/2,i=(d-g)/2),{w:f,h:g,x:h,y:i}}function j(a,b,c,d){var g,h;return e.width=b,e.height=c,g=i(a.width,a.height,b,c,d),f.fillStyle="#000000",f.fillRect(0,0,b,c),f.drawImage(a,g.x,g.y,g.w,g.h),h=e.toDataURL(),h}var e=c.createElement("canvas"),f=e.getContext
+("2d");a.imageloader={_grantedBytes:1048576,getThumbnail:function(a,b){function e(a){var c=g(a);b&&b(c==="NOT_FOUND_ERR"?c:null)}var c,d;c=h(a);try{d=localStorage.getItem(c),b&&b(d===null?"NOT_FOUND_ERR":d)}catch(f){b&&b(f.type==="non_object_property_load"?"NOT_FOUND_ERR":null)}},setThumbnail:function(a,b,c,d,e){function l(a){var c=g(a);b&&b(c==="NOT_FOUND_ERR"?c:null)}var f,i,k;c=c||128,d=d||128,e=e||!0,f=new Image,f.onload=function(){i=h(a),k=j(this,c,d,e);try{localStorage.setItem(i,k),b&&b(k)}catch(f){b&&b(f.type==="non_object_property_load"?"NOT_FOUND_ERR":null)}},f.src=a},removeThumbnail:function(a){function c(a){g(a)}var b;b=h(a);try{localStorage.removeItem(b)}catch(d){throw d}}}}(jQuery,window,document),function(a,b){a.widget("tizen.listdivider",a.mobile.widget,{options:{initSelector:":jqmData(role='list-divider')",folded:!1,listDividerLine:!0},_create:function(){var c=this.element,d=!0,e,f=!0,g=c.attr("data-style");c.data("line")===!1&&(this.options.listDividerLine=!1),c.data("folded")===!0&&(this.options.folded=!0);if(g==b||g==="normal"||g==="check")this.options.folded?c.buttonMarkup():c.wrapInner("<span class='ui-btn-text'></span>"),this.options.listDividerLine&&(e="<span class='ui-divider-normal-line'></span>",this.options.folded?a(e).appendTo(c.children(".ui-btn-inner")):a(e).appendTo(c));c.bind("vclick",function(a,b){})}}),a(document).bind("pagecreate create",function(b){a(a.tizen.listdivider.prototype.options.initSelector,b.target).listdivider()})}(jQuery),function(a,b){a.webgl={},a.webgl.shader={_vertexShader:null,_fragmentShader:null,deleteShaders:function(a){a.deleteShader(this._vertexShader),a.deleteShader(this._fragmentShader)},addShaderProgram:function(a,b,c,d){var e,f={},g={};return d?(f=this.loadShaderFile(b),g=this.loadShaderFile(c)):(f.source=b,g.source=c),this._vertexShader=this.getShader(a,a.VERTEX_SHADER,f),this._fragmentShader=this.getShader(a,a.FRAGMENT_SHADER,g),e=a.createProgram(),a.attachShader(e,this._vertexShader),a.attachShader(e,this._fragmentShader),a.linkProgram(e),a.getProgramParameter(e,a.LINK_STATUS)||window.alert("Could not initialize Shaders!"),e},loadShaderFile:function(b){var c=null;return a.ajax({async:!1,url:b,success:function(a){c={source:a}}}),c},getShader:function(a,b,c){var d;return!a||!b||!c?null:(d=a.createShader(b),a.shaderSource(d,c.source),a.compileShader(d),a.getShaderParameter(d,a.COMPILE_STATUS)?d:(window.alert(a.getShaderInfoLog(d)),a.deleteShader(d),null))}},a.webgl.buffer={attribBufferData:function(a,b){var c=a.createBuffer();return a.bindBuffer(a.ARRAY_BUFFER,c),a.bufferData(a.ARRAY_BUFFER,b,a.STATIC_DRAW),a.bindBuffer(a.ARRAY_BUFFER,null),c}}}(jQuery),function(a,b){a(document).bind("pagecreate create",function(b){a(":jqmData(role='label')",b.target).not(":jqmData(role='none'), :jqmData(role='nojs')").each(function(){a(this).addClass("jquery-mobile-ui-label").html(a("<span>",{"class":"jquery-mobile-ui-label-text"}).text(a(this).text()))})})}(jQuery),function(a,b,c){var d=Math.PI/2,e=.001,f={},g=b.vec3,h=function(a,b){var c=[b[0]-a[0],b[1]-a[1]],d=Math.sqrt(c[0]*c[0]+c[1]*c[1]);return d},i=function(a,b){var c=[b[0]-a[0],b[1]-a[1],b[2]-a[2]],d=Math.sqrt(c[0]*c[0]+c[1]*c[1]+c[2]*c[2]);return d};f.base=function(){},f.base.prototype={points:[],step:e,length:0,levels:[],init:function(a){},calculateLevel:function(a){},calculateTotalLength:function(){},getPosition:function(a){},getPercent:function(a,b){},getAngle:function(a){}},f.bezier2d=function(){},f.bezier2d.prototype=a.extend(!0,{},f.base.prototype,{init:function(a){this.points=a.points,this.step=a.step||e,this.length=this.calculateTotalLength(),this.levels=this.calculateLevel(a.maxLevel)||[]},calculateLevel:function(a){var b=this.length,c=b/a,d=[],e;if(!a)return null;for(e=0;e<a;e+=1)d[a-e]=this.getPercent(0,c*e);return d},calculateTotalLength:function(){var a=this.step,b=this.getPosition(0),c=b,d=0,e;for(e=a;e<=1;e+=a)b=this.getPosition(e),d+=h(c,b),c=b;return d},getPosition:function(a){var b=this.points,c=function(a,b,c,d,e){return Math.pow(1-e,3)*a+3*e*Math.pow(1-e,2)*b+3*Math.pow(e,2)*(1-e)*c+Math.pow(e,3)*d},d=[c(b[0][0],b[1][0],b[2][0],b[3][0],a),c(b[0][1],b[1][1],b[2][1],b[3][1],a)];return d},getPercent:function(a,b){var c=this.step,d=this.getPosition(a=a||0),e=d,f=a+b,g=0,i;for(i=a+c;i<=1;i+=c){d=this.getPosition(i),g+=h(e,d);if(g>=f)return i;e=d}return 1},getAngle:function(a){var b=this.points,c=function(a,b,c,d,e){return 3*e*e*(-a+3*b-3*c+d)+6*e*(a-2*b+c)+3*(-a+b)},e=c(b[0][0],b[1][0],b[2][0],b[3][0],a),f=c(b[0][1],b[1][1],b[2][1],b[3][1],a);return Math.atan2(e,f)-d}}),f.bspline=function(){},f.bspline.prototype=a.extend(!0,{},f.base.prototype,{_degree:3,_numberOfControls:0,_knotVectors:[],_numberOfKnots:0,init:function(a){this.points=a.points,this.step=a.step||e,this._numberOfPoints=this.points.length-1,this._numberOfKnots=this._numberOfPoints+this._degree+1;var b=1/(this._numberOfKnots-2*this._degree),c=b,d=0;while(d<=this._numberOfKnots)d<=this._degree?this._knotVectors.push(0):d<this._numberOfKnots-this._degree+1?(this._knotVectors.push(c),c+=b):this._knotVectors.push(1),d+=1;this.length=this.calculateTotalLength(),this.levels=this.calculateLevel(a.maxLevel)||[]},_Np:function(a,b,c){var d=this._knotVectors,e=0,f=0,g=0,h=function(a,b){return d[b]<=a&&a<d[b+1]?1:0};return c===1?(e=h(a,b),f=h(a,b+1)):(e=this._Np(a,b,c-1),f=this._Np(a,b+1,c-1)),g=d[b+c]-d[b],e*=g!==0?(a-d[b])/g:0,g=d[b+c+1]-d[b+1],f*=g!==0?(d[b+c+1]-a)/g:0,e+f},calculateLevel:function(a){var b=this.length,c=b/a,d=[],e;if(!a)return null;for(e=0;e<a;e+=1)d[a-e]=this.getPercent(0,c*e);return d},calculateTotalLength:function(){var a=this.step,b=this.getPosition(0),c=b,d=0,e;for(e=a;e<=1;e+=a)b=this.getPosition(e),d+=i(c,b),c=b;return d},getPosition:function(a){var b=[],c,d,e;a=a.toFixed(4);for(d=0;d<3;d+=1){e=0;for(c=0;c<=this._numberOfPoints;c+=1)e+=this.points[c][d]*this._Np(a,c,this._degree);b[d]=e}return b},getPercent:function(a,b){var c=this.step,d=this.getPosition(a=a||0),e=d,f=a+b,g=0,h;for(h=a+c;h<=1;h+=c){d=this.getPosition(h),g+=i(e,d);if(g>=f)return h;e=d}return 1},getAngle:function(a){var b=this.getPosition(a),c=this.getPosition(a+.001),d=g.normalize(g.direction(b,c)),e=g.dot(d,[1,0,0]);return Math.acos(e)+Math.PI}}),a.motionpath=function(a,b){var c=new f[a];return c.init(b),c}}(jQuery,window),function(a,b,c,d){a.widget("tizen.splitview",a.mobile.widget,{options:{fixed:!1,dividerVertical:!0,ratio:[],initSelector:":jqmData(role='splitview')"},_create:function(){var c=this,d=c.element,e=c.options,f=d.children(".ui-pane"),g=f.length,h=[],i=[],j=this.element.attr("data-ratio"),k=[0,0],l=null,m=0;if(g!==2){if(g<2)for(m=g;m<2;++m)c._addEmptyPanes();else f.slice(2).remove();f=d.children(".ui-pane"),g=f.length}h[0]=a("<a href='#' class='ui-spliter' aria-label='Drag scroll, double tap and move to adjust split area'></a>").insertAfter(f[0]),i[0]=a("<div class='ui-spliter-bar'></div>").appendTo(h[0]),a("<div class='ui-spliter-handle'></div>").appendTo(i[0]),a.extend(this,{moveTarget:null,moveData:{},spliters:h,spliterBars:i,panes:f,containerSize:k,touchStatus:!1,minPaneWidth:50,savedRatio:[]}),c._bindTouchEvents(),c._convertRatio(j,f.length),d.addClass("ui-splitview ui-direction-"+c._direction(e.dividerVertical)),d.parent().closest(".ui-splitview").length&&c._getContainerSize(d[0].style.width,d[0].style.height)&&c._layout(),a(b).bind("pagechange",function(a){d.parent().closest(".ui-splitview").length||c._getContainerSize(d[0].style.width,d[0].style.height)&&c._layout()}).resize(function(){l&&clearTimeout(l),l=setTimeout(function(){d.parent().closest(".ui-splitview").length||c._getContainerSize(d[0].style.width,d[0].style.height)&&c._layout()},250)})},_addEmptyPanes:function(){var b=this,c=b.element,d=b.options,e=c.children(".ui-pane"),f=a.support.scrollview?"data-scroll='y'":"",g=a("<div class='ui-pane' "+f+"></div>");f.length&&g.scrollview({direction:"y"}),e.length?e.last().after(g):c.append(g)},_direction:function(a){return a?"horizontal":"vertical"},_isStyleSpecified:function(a){return typeof a!="undefined"&&a.length},_getContainerSize:function(a,b){var c=this,d=c.element,e=c._isStyleSpecified(a),f=c._isStyleSpecified(b);return c.containerSize[0]=e?d.outerWidth(!0):c._parentWidth(),c.containerSize[1]=f?d.outerHeight(!0):c._parentHeight(),!c.containerSize[0]||!c.containerSize[1]?!1:!0},_parentWidth:function(){var c=this.element.parent();return!c&&typeof c=="undefined"&&!c.length?a(b).width():c.width()},_parentHeight:function(){var c=this.element.parent(),d="",e=!1,f=0;while(c&&typeof c!="undefined"&&c.length){if(typeof c[0].style!="undefined"){d=c[0].style.height,e=typeof d!="undefined"&&d.length;if(e){f=c.height();break}}c=c.parent()}return e||(f=a(b).height()),f},_convertRatio:function(b,c){var d=this,e=[],f=0,g=typeof b,h=null,i;for(i=0;i<c;++i)e.push(0);switch(g){case"number":c&&(e[0]=b);break;case"string":h=b.split(","),f=Math.min(h.length,c);for(i=0;i<f;++i)e[i]=parseFloat(h[i]);break;case"object":if(!a.isArray(b))break;f=Math.min(b.length,c);for(i=0;i<f;++i)g=typeof b[i],e[i]=g==="string"?parseFloat(b[i]):g==="number"?b[i]:0}d.options.ratio=e,d._adjustRatio(c)},_adjustRatio:function(a){var b=this,c=b.options.ratio,d=0,e=0,f=0,g=0,h=0,i;if(!a){b.options.ratio=[];return}for(i in c)d+=c[i];if(d!==1){e=1-d,f=e/a;for(i in c)f>=0?(c[i]+=f,e=Math.max(0,e-f)):(h+=f,g=Math.max(h,c[i]*-1),c[i]=Math.max(0,c[i]+g),e=Math.min(0,e-g),h-=g);if(e)if(e>0)c[c.length-1]+=e;else for(i=c.length-1;i>=0;--i){g=Math.max(e,c[i]*-1),c[i]=Math.max(0,c[i]+g),e=Math.min(0,e-g);if(!e)break}b.options.ratio=c}},_setOption:function(b,c){var d=this,e=d.options[b];if(e===c)return;a.Widget.prototype._setOption.apply(this,arguments);switch(b){case"fixed":d._fixed(c);break;case"dividerVertical":d._dividerVertical(c);break;case"ratio":d._ratio(c)}},_subtractDiffWidth:function(a,b){var c=this;return a<=c.minPaneWidth?{width:a,diff:b}:(a+=b,a>=c.minPaneWidth?{width:a,diff:0}:{width:c.minPaneWidth,diff:a-c.minPaneWidth})},_initRatio:function(b,c,d,e){var f=this,g=0,h=[],i=0,j=c.length,k,l;c.each(function(b){var c=a(this);h.push(d?c.width():c.height()),g+=h[b]}),i=e-g;if(!i)return h;if(i>0)h[b?0:j-1]+=i;else if(b)for(l=0;l<j;++l){k=f._subtractDiffWidth(h[l],i),h[l]=k.width,i=k.diff;if(!i)break}else for(l=j-1;l>=0;--l){i=f._subtractDiffWidth(h[l],i),h[l]=k.width,i=k.diff;if(!i)break}g=0;for(l in h)g+=h[l];for(l in f.options.ratio)f.options.ratio[l]=h[l]/g;return h},_horizontalBoundary:function(){var a=this,b=a.element;return b.outerWidth(!0)-b.width()},_verticalBoundary:function(){var a=this,b=a.element;return b.outerHeight(!0)-b.height()},_boundary:function(a){var c=this,d=c.element,e=b.getComputedStyle(d[0],null),f=parseFloat(e["margin"+a]),g=parseFloat(e["border"+a+"Width"]),h=parseFloat(e["padding"+a]);return{margin:f,border:g,padding:h}},_layout:function(b,c){var d=this,e=d.element,f=d.options,g=f.dividerVertical,h=d.panes,i=d.spliters,j=d.spliterBars,k=d.spliterBars.length?a(j[0]):null,l=k?g?k.outerWidth():k.outerHeight():0,m=k?g?k.outerWidth(!0)-k.outerWidth():k.outerHeight(!0)-k.outerHeight():0,n=h.length,o=0,p=l*(n-1),q=d.containerSize[0],r=d.containerSize[1],s=q-d._horizontalBoundary(),t=r-d._verticalBoundary(),u=g?t:s,v=g?s-p:t-p,w=[],x=0,y=null;typeof b=="undefined"&&(b=!1),b&&typeof c=="undefined"&&(c=!1),e.css({"min-width":s,"min-height":t}),b&&(w=d._initRatio(c,h,g,v)),o=v,h.each(function(c){var e=a(this),f=b?w[c]:Math.floor(v*d.options.ratio[c]),i=c?h.eq(c-1):null,j=0,k=0,m=0,p=0;o-=f,c===n-1&&(f=Math.max(Math.min(f,d.minPaneWidth),f+o)),x+=f,i?(j=parseInt(i.css(g?"left":"top"),10),j+=g?i.width():i.height(),j+=l):(p=d._boundary(g?"Left":"Top"),j=p.padding),k=g?f:u,m=g?u:f,e.css({width:k,height:m}),e.css(g?"left":"top",j)}),h.each(function(b){var c=a(this),e=g?c.width():c.height();d.options.ratio[b]=e/x}),a.each(i,function(b){var c=a(this),d=h.eq(b),e=c.children(".ui-spliter-bar"),f=e.children(".ui-spliter-handle"),i=0;g?(i=parseInt(d.css("left"),10)+d.width()-m,c.outerHeight(u).css("left",i)):(i=parseInt(d.css("top"),10)+d.height()-m,c.outerWidth(u).css("top",i)),typeof e!="undefined"&&e&&(g?e.outerHeight(u):e.outerWidth(u)),typeof f!="undefined"&&f&&(g?f.css("top",(u-l)/2):f.css("left",(u-l)/2))}),y=e.find(":jqmData(role='splitview'):first");if(!y.length)return;y=y.data("splitview"),y&&y._refresh()},_bindTouchEvents:function(){var b=this,c=b.element,d=b.panes,e=b.spliters;a.each(e,function(c){var d=a(this);b._bindSpliterTouchEvents(d)}),c.mouseleave(function(){b.touchStatus&&c.children(".ui-spliter").trigger("vmouseup")}),d.bind("vmousedown",function(){c.find(".ui-spliter").trigger("vmouseup")})},_bindSpliterTouchEvents:function(b){var d=this,e=d.element,f=d.options;b.bind("vmousedown",{e:b},function(b){if(d.options.fixed)return;var g=b.data.e,h=g.prev(),i=g.next(),j=h.find(":jqmData(role='splitview'):first"),k=i.find(":jqmData(role='splitview'):first"),l=f.dividerVertical,m=l?a(d.spliterBars[0]).outerWidth():a(d.spliterBars[0]).outerHeight();e.closest(".ui-page").find(".ui-spliter").trigger("vmouseup"),d.moveTarget=g,d.moveData={spliterWidth:m||0,prevPane:h,nextPane:i,splitviewInPrev:j,splitviewInNext:k,prevPanePos:parseInt(h.css(l?"left":"top"),10)||0,prevPaneWidth:parseInt(h.css(l?"width":"height"),10)||0,nextPanePos:parseInt(i.css(l?"left":"top"),10)||0,nextPaneWidth:parseInt(i.css(l?"width":"height"),10)||0,targetPos:parseInt(g.css(l?"left":"top"),10)||0,pagePos:l?b.pageX:b.pageY},g.addClass("ui-spliter-active"),a(c).bind("vmousemove.splitview",function(a){if(!d.touchStatus)return;d._drag(a),a.preventDefault(),a.stopPropagation()}).bind("vmouseup.splitview",function(a){if(!d.touchStatus)return;d._stop(a),a.preventDefault(),a.stopPropagation(),d.touchStatus=!1}),b.preventDefault(),b.stopPropagation(),d.touchStatus=!0})},_drag:function(a){if(!this.moveData||typeof this.moveData=="undefined")return;var b=this,c=b.element,d=b.options,e=d.dividerVertical,f=b.moveData,g=b.moveTarget,h=f.prevPane,i=f.nextPane,j=f.splitviewInPrev,k=f.splitviewInNext,l=f.spliterWidth,m=null,n=null,o=null,p=null,q=null,r=e?a.pageX:a.pageY,s=null;m=r-f.pagePos,m>0?m=Math.min(Math.max(f.nextPaneWidth-b.minPaneWidth,0),m):m=Math.max(Math.max(f.prevPaneWidth-b.minPaneWidth,0)*-1,m),o=f.nextPanePos+m,p=Math.max(f.prevPaneWidth+m,0),q=Math.max(f.nextPaneWidth-m,0),n=f.targetPos+m,g.css(e?{left:n}:{top:n}),h.css(e?{width:p}:{height:p}),i.css(e?{width:q,left:o}:{height:q,top:o}),j.length&&(s=j.data("splitview"),s._refresh(!0,!1)),k.length&&(s=k.data("splitview"),s._refresh(!0,!0))},_stop:function(b){if(!this.moveData||typeof this.moveData=="undefined")return;var d=this,e=d.element,f=d.options,g=d.panes,h=g.length,i=f.dividerVertical,j=d.moveData,k=d.moveTarget,l=j.prevPane,m=j.nextPane,n=j.splitviewInPrev,o=j.splitviewInNext,p=j.spliterWidth,q=p*(h-1),r=null,s=null,t=null,u=null,v=null,w=e.css("display"),x=d.containerSize[0],y=d.containerSize[1],z=x-d._horizontalBoundary(),A=y-d._verticalBoundary(),B=i?z-q:A-q,C=0;a(c).unbind("vmousemove.splitview vmouseup.splitview"),k.removeClass("ui-spliter-active"),g.each(function(b){var c=a(this),d=i?c.width():c.height();C+=d}),g.each(function(b){var c=a(this),e=i?c.width():c.height();d.options.ratio[b]=e/C}),d.moveData=null},_fixed:function(b){var c=this,d=c.spliters;a.each(d,function(c){var d=a(this);b?d.addClass("ui-fixed"):d.removeClass("ui-fixed")}),c._layout()},_dividerVertical:function(a){var b=this,c=b.element,d=a,e=null,f=null,g=null,h=null;e=c.children(".ui-pane"),f=c.children(".ui-spliter"),g=f.children(".ui-spliter-bar"),h=g.children(".ui-spliter-handle"),c.removeClass("ui-direction-vertical"),c.removeClass("ui-direction-horizontal"),c.addClass("ui-splitview ui-direction-"+b._direction(d)),e.css({left:"",top:"",width:"",height:""}),f.css({left:"",top:"",width:"",height:""}),g.css({width:"",height:""}),h.css({left:"",top:""}),b._getContainerSize(c[0].style.width,c[0].style.height)&&b._layout()},_ratio:function(a){var b=this,c=b.element,d=c.children(".ui-pane"),e=d.length;b._convertRatio(a,e),b._layout()},_refresh:function(a,b){var c=this,d=c.element;typeof a=="undefined"&&(a=!1),a&&typeof b=="undefined"&&(b=!1),c._getContainerSize(d[0].style.width,d[0].style.height)&&c._layout(a,b)},pane:function(a,b){if(typeof a!="string")return null;var c=this,d=c.element,e=d.children(a),f=null,g=null;if(!e.hasClass("ui-pane"))return null;if(typeof b=="undefined"||!b)return e.contents();if(e.hasClass("ui-scrollview-clip")){e.scrollview("scrollTo",0,0,0),f=e.children(".ui-scrollview-view");if(!f.length)return null}else f=e;g=b.parent();if(g.length&&g[0]===f[0])return;f.empty().append(b).trigger("create"),f.fadeIn("fast")},maximize:function(a){if(typeof a!="string")return;var b=this,c=b.element,d=b.panes,e=c.children(a);if(!e.hasClass("ui-pane"))return;b.savedRatio=b.options.ratio.slice(),b.options.ratio=[],d.each(function(a){b.options.ratio.push(this===e[0]?1:0)}),b._layout()},restore:function(){var a=this;if(a.savedRatio.length===0)return;a.options.ratio=a.savedRatio.slice(),a._adjustRatio(a.panes.length),a._layout()}}),a(c).bind("pagecreate create",function(b){a.tizen.splitview.prototype.enhanceWithin(b.target)})}(jQuery,window,document),ensureNS("jQuery.mobile.tizen"),function(){jQuery.extend(jQuery.mobile.tizen,{disableSelection:function(a){var b=this;return $(a).find("*").each(function(){$(this).get(0).tagName!=="INPUT"&&$(this).attr("type")!=="text"&&$(this).get(0).tagName!=="TEXTAREA"&&b.enableSelection(this,"none")}),!0},enableSelection:function(a,b){return $(a).each(function(){switch(b){case"text":case"auto":case"none":val=b;break;default:val="auto"}$(this).css({"user-select":val,"-moz-user-select":val,"-webkit-user-select":val,"-o-user-select":val,"-ms-transform":val})})},disableContextMenu:function(a){var b=this;$(a).find("*").each(function(){$(this).get(0).tagName!=="INPUT"&&$(this).attr("type")!=="text"&&$(this).get(0).tagName!=="TEXTAREA"&&b._disableContextMenu(this)})},_disableContextMenu:function(a){$(a).each(function(){$(this).bind("contextmenu",function(a){return!1})})},enableContextMenu:function(a){$(a).each(function(){$(this).unbind("contextmenu")})},documentRelativeCoordsFromEvent:function(a){var b=a?a:window.event,c={x:b.clientX,y:b.clientY},d={x:b.pageX,y:b.pageY},e=0,f=0;b.type.match(/^touch/)&&(d={x:b.originalEvent.targetTouches[0].pageX,y:b.originalEvent.targetTouches[0].pageY},c={x:b.originalEvent.targetTouches[0].clientX,y:b.originalEvent.targetTouches[0].clientY});if(d.x||d.y)e=d.x,f=d.y;else if(c.x||c.y)e=c.x+document.body.scrollLeft+document.documentElement.scrollLeft,f=c.y+document.body.scrollTop+document.documentElement.scrollTop;return{x:e,y:f}},targetRelativeCoordsFromEvent:function(a){var b={x:a.offsetX,y:a.offsetY};if(b.x===undefined||isNaN(b.x)||b.y===undefined||isNaN(b.y)){var c=$(a.target).offset();b=$.mobile.tizen.documentRelativeCoordsFromEvent(a),b.x-=c.left,b.y-=c.top}return b}})}(),function(a,b,c,d){function e(a,b){var c=a%b;return c<0&&(c=b+c),c}function f(b){this.options=a.extend({},b),this.easing="easeOutQuad",this.reset()}function l(){return Date.now()}var g={scrolling:0,done:1},h=0,i=1,j=-1,k=/src\s*=\s*[\"\'][\w\/.]+.[A-z]+[\"\']/;a.extend(f.prototype,{start:function(a,b,c){this.state=b!==0?g.scrolling:g.done,this.pos=a,this.speed=b,this.duration=c,this.fromPos=0,this.toPos=0,this.startTime=l()},reset:function(){this.state=g.done,this.pos=0,this.speed=0,this.duration=0},update:function(){var b=this.state,c,d,e,f;return b==g.done?this.pos:(c=this.duration,d=l()-this.startTime,d=d>c?c:d,e=this.speed*(1-a.easing[this.easing](d/c,d,0,1,c)),f=this.pos+e/2,this.pos=f,d>=c&&(this.state=g.done),this.pos)},done:function(){return this.state==g.done},getPosition:function(){return this.pos}}),jQuery.widget("mobile.virtualgrid",jQuery.mobile.widget,{options:{template:"",direction:"y",rotation:!1},create:function(){this._create.apply(this,arguments)},_create:function(b){a.extend(this,{_$view:null,_$clip:null,_$rows:null,_tracker:null,_viewSize:0,_clipSize:0,_cellSize:d,_currentItemCount:0,_itemCount:1,_inheritedSize:null,_timerInterval:0,_timerID:0,_timerCB:null,_lastMove:null,_itemData:function(a){return null},_numItemData:0,_cacheItemData:function(a,b){},_totalRowCnt:0,_templateText:null,_maxViewSize:0,_modifyViewPos:0,_maxSizeExceptClip:0,_maxSize:0,_direction:!1,_didDrag:!0,_reservedPos:0,_scalableSize:0,_eventPos:0,_nextPos:0,_movePos:0,_lastY:0,_speedY:0,_lastX:0,_speedX:0,_rowsPerView:0,_fragment:null,_filterRatio:.9,_overflowStartPos:0,_overflowDir:0,_overflowMaxDragDist:100});var e=this,f=a(e.element),g=e.options,h=null;if(!b)return;if(!e._loadData(b))return;e._fragment=c.createDocumentFragment(),e._inheritedSize=e._getinheritedSize(e.element),e._direction=g.direction==="x"?!0:!1,e._$clip=f.addClass("ui-scrollview-clip").addClass("ui-virtualgrid-view"),h=a(c.createElement("div")).addClass("ui-scrollview-view"),e._clipSize=e._calculateClipSize(),e._$clip.append(h),e._$view=h,e._$clip.css("overflow","hidden"),e._$view.css("overflow","hidden"),e._scrollView=a.tizen.scrollview.prototype,e._initScrollView(),e._createTracker(),e._makePositioned(e._$clip),e._timerInterval=1e3/e.options.fps,e._timerID=0,e._timerCB=function(){e._handleMomentumScroll()},f.closest(".ui-content").addClass("ui-virtualgrid-content").css("overflow","hidden"),e._addBehaviors(),e._currentItemCount=0,e._createOverflowArea(),e._createScrollBar(),e.refresh()},_loadData:function(a){var b=this;if(!a.itemData||typeof a.itemData!="function")return!1;b._itemData=a.itemData;if(!a.numItemData)return!1;if(typeof a.numItemData=="function")b._numItemData=a.numItemData();else{if(typeof a.numItemData!="number")return!1;b._numItemData=a.numItemData}return b._getObjectNames(b._itemData(0)),!0},_initLayout:function(){var a=this,b=a.options,c,d;for(c=-1;c<a._rowsPerView+1;c+=1)d=a._$rows[e(c,a._$rows.length)],a._$view.append(d);a._setElementTransform(-a._cellSize),a._replaceRow(a._$view[0].firstChild,a._totalRowCnt-1),b.rotation&&a._rowsPerView>=a._totalRowCnt&&a._replaceRow(a._$view[0].lastChild,0),a._setViewSize()},_setViewSize:function(){var a=this,b=0,c=0;a._direction?(c=a._cellSize*(a._rowsPerView+2),c=parseInt(c,10)+1,a._$view.width(c),a._viewSize=a._$view.width()):(a._$view.height(a._cellSize*(a._rowsPerView+2)),a._$clip.height(a._clipSize),a._viewSize=a._$view.height())},_getViewWidth:function(){var a=this;return a._maxSize},_getViewHeight:function(){var a=this;return a._maxSize},refresh:function(){var b=this,c=b.options,d=0,e=0,f=null;f=a("#"+c.template);if(!f)return;b._templateText=b._insertAriaAttrToTmpl(f.text()),d=b._calculateClipWidth(),e=b._calculateClipHeight(),b._$view.width(d).height(e),b._$clip.width(d).height(e),b._clipSize=b._calculateClipSize(),b._calculateColumnSize(),b._initPageProperty(),b._setScrollBarSize()},_initPageProperty:function(){var b=this,c=0,d,e=0,f=0,g=b._direction?"width":"height";e=b._calculateColumnCount(),f=parseInt(b._numItemData/e,10),b._totalRowCnt=b._numItemData%e===0?f:f+1,b._itemCount=e;if(b._cellSize<=0)return;c=b._clipSize/b._cellSize,c=Math.ceil(c),b._rowsPerView=parseInt(c,10),d=a(b._makeRows(c+2)),b._$view.append(d.children()),b._$view.children().css(g,b._cellSize+"px"),b._$rows=b._$view.children().detach(),b._reservedPos=-b._cellSize,b._scalableSize=-b._cellSize,b._initLayout(),b._blockScroll=b._rowsPerView>b._totalRowCnt,b._maxSizeExceptClip=(b._totalRowCnt-b._rowsPerView)*b._cellSize,b._maxSize=b._totalRowCnt*b._cellSize,b._maxViewSize=b._rowsPerView*b._cellSize,b._modifyViewPos=-b._cellSize,b._clipSize<b._maxViewSize&&(b._modifyViewPos=-b._cellSize+(b._clipSize-b._maxViewSize))},_getinheritedSize:function(b){var c=a(b),d,e,f={ELEMENT_NODE:1,TEXT_NODE:3},g={isDefinedWidth:!1,isDefinedHeight:!1,width:0,height:0};while(c[0].nodeType===f.ELEMENT_NODE&&(g.isDefinedWidth===!1||g.isHeightDefined===!1)){d=c[0].style.height,e=c[0].style.width,g.isDefinedHeight===!1&&d!==""&&(g.isDefinedHeight=!0,g.height=parseInt(d,10)),g.isDefinedWidth===!1&&e!==""&&(g.isDefinedWidth=!0,g.width=parseInt(e,10)),c=c.parent();if(c.hasClass("ui-content"))break}return g},resize:function(){var a=this,b=null,c=0,d=0,e=0,f=0,g=0,h=0,i=0;d=a._calculateColumnCount(),d!=a._itemCount&&(e=parseInt(a._numItemData/d,10),a._totalRowCnt=a._numItemData%d===0?e:e+1,h=a._itemCount,a._itemCount=d,i=a._getClipPosition(),a._$view.hide(),f=a._replaceRows(d,h,a._totalRowCnt,i),a._maxSizeExceptClip=(a._totalRowCnt-a._rowsPerView)*a._cellSize,a._maxSize=a._totalRowCnt*a._cellSize,a._scalableSize+=-f*a._cellSize,a._reservedPos+=-f*a._cellSize,a._setScrollBarSize(),a._setScrollBarPosition(f),a._$view.show()),g=a._calculateClipSize(),g!==a._clipSize&&(c=g/a._cellSize,c=parseInt(Math.ceil(c),10),c>a._rowsPerView?a._increaseRow(c-a._rowsPerView):c<a._rowsPerView&&a._decreaseRow(a._rowsPerView-c),a._rowsPerView=c,a._clipSize=g,a._blockScroll=a._rowsPerView>a._totalRowCnt,a._maxSizeExceptClip=(a._totalRowCnt-a._rowsPerView)*a._cellSize,a._maxSize=a._totalRowCnt*a._cellSize,a._maxViewSize=a._rowsPerView*a._cellSize,a._clipSize<a._maxViewSize&&(a._modifyViewPos=-a._cellSize+(a._clipSize-a._maxViewSize)),a._direction?a._$clip.width(a._clipSize):a._$clip.height(a._clipSize),a._setScrollBarSize(),a._setScrollBarPosition(0),a._setViewSize())},_initScrollView:function(){var b=this;a.extend(b.options,b._scrollView.options),b.options.moveThreshold=10,b.options.showScrollBars=!1,b._getScrollHierarchy=b._scrollView._getScrollHierarchy,b._makePositioned=b._scrollView._makePositioned,b._set_scrollbar_size=b._scrollView._set_scrollbar_size,b._setStyleTransform=b._scrollView._setElementTransform,b._hideOverflowIndicator=b._scrollView._hideOverflowIndicator,b._showOverflowIndicator=b._scrollView._showOverflowIndicator,b._setGestureScroll=b._scrollView._setGestureScroll},_createTracker:function(){var a=this;a._tracker=new f(a.options),a._direction?(a._hTracker=a._tracker,a._$clip.width(a._clipSize)):(a._vTracker=a._tracker,a._$clip.height(a._clipSize))},_createOverflowArea:function(){var b=this,c='<div class="ui-virtualgrid-overflow-indicator-',d='-top"></div>',e='-bottom"></div>';if(b.options.rotation)return;b._direction?(b._overflowTop=a(c+"x"+d),b._overflowBottom=a(c+"x"+e)):(b._overflowTop=a(c+"y"+d),b._overflowBottom=a(c+"y"+e)),b._$clip.append(b._overflowTop),b._$clip.append(b._overflowBottom),b._overflowDisplayed=!1},_hideVGOverflowIndicator:function(){if(this._overflowDisplayed===!1)return;this._overflowTop.animate({opacity:0},300),this._overflowBottom.animate({opacity:0},300),this._overflowDisplayed=!1},_createScrollBar:function(){var a=this,b='<div class="ui-scrollbar ui-scrollbar-',c='"><div class="ui-scrollbar-track"><div class="ui-scrollbar-thumb"></div></div></div>';if(a.options.rotation)return;a._direction?(a._$clip.append(b+"x"+c),a._hScrollBar=a._$clip.children(".ui-scrollbar-x"),a._hScrollBar.find(".ui-scrollbar-thumb").addClass("ui-scrollbar-thumb-x")):(a._$clip.append(b+"y"+c),a._vScrollBar=a._$clip.children(".ui-scrollbar-y"),a._vScrollBar.find(".ui-scrollbar-thumb").addClass("ui-scrollbar-thumb-y"))},_setScrollBarSize:function(){var a=this,b=0,c=0,d,e,f;if(a.options.rotation)return;b=parseInt(a._maxViewSize/a._clipSize,10),a._direction?(d=a._hScrollBar.find(".ui-scrollbar-thumb"),e="width",c=d.width(),f="ui-scrollbar-thumb-x",a._hScrollBar.css("width",a._clipSize)):(d=a._vScrollBar.find(".ui-scrollbar-thumb"),e="height",f="ui-scrollbar-thumb-y",c=d.height(),a._vScrollBar.css("height",a._clipSize)),b>c?(d.removeClass(f),d.css(e,b)):b=c,a._itemScrollSize=parseFloat((a._clipSize-b)/(a._totalRowCnt-a._rowsPerView)),a._itemScrollSize=Math.round(a._itemScrollSize*100)/100},_setScrollBarPosition:function(a,b){var c=this,d=null,e="0px",f="0px",g;if(c.options.rotation)return;c._currentItemCount=c._currentItemCount+a,c._vScrollBar?(d=c._vScrollBar.find(".ui-scrollbar-thumb"),f=c._currentItemCount*c._itemScrollSize+"px"):(d=c._hScrollBar.find(".ui-scrollbar-thumb"),e=c._currentItemCount*c._itemScrollSize+"px"),c._setStyleTransform(d,e,f,b)},_hideScrollBars:function(){var a=this,b="ui-scrollbar-visible";if(a.options.rotation)return;a._vScrollBar?a._vScrollBar.removeClass(b):a._hScrollBar.removeClass(b)},_showScrollBars:function(){var a=this,b="ui-scrollbar-visible";if(a.options.rotation)return;a._vScrollBar?a._vScrollBar.addClass(b):a._hScrollBar.addClass(b)},centerTo:function(b){var c=this,d,e=0,f=0;if(!c.options.rotation)return;for(d=0;d<c._$rows.length;d++)if(a(c._$rows[d]).hasClass(b)){c._direction?e=-(d*c._cellSize-c._clipSize/2+c._cellSize*2):f=-(d*c._cellSize-c._clipSize/2+c._cellSize*2),c.scrollTo(e,f);return}},scrollTo:function(a,b,c){var d=this;d._direction?(a-=d._cellSize,d._sx=d._reservedPos,d._reservedPos=a):(b-=d._cellSize,d._sy=d._reservedPos,d._reservedPos=b),d._scrollView.scrollTo.apply(this,[a,b,c])},getScrollPosition:function(){return this.direction?{x:-this._ry,y:0}:{x:0,y:-this._ry}},_setScrollPosition:function(a,b){var c=this,d=c._scalableSize,f=c._direction?a:b,g=f-d,k=parseInt(g/c._cellSize,10),l=0,m=0,n=0,o=c._rowsPerView+2,p=c._$view[0];if(c._blockScroll){g>0&&f>=-c._cellSize&&c._scalableSize>=-c._cellSize&&(c._overflowDir=i),g<0&&c._scalableSize<=-(c._maxSizeExceptClip+c._cellSize)&&(c._overflowDir=j);return}if(!c.options.rotation){if(g>0&&f>=-c._cellSize&&c._scalableSize>=-c._cellSize){c._stopMScroll(),c._scalableSize=-c._cellSize,c._setElementTransform(-c._cellSize),c._overflowDir===h&&(c._overflowDir=i);return}if(g<0&&c._scalableSize<=-(c._maxSizeExceptClip+c._cellSize)){c._stopMScroll(),c._scalableSize=-(c._maxSizeExceptClip+c._cellSize),c._setElementTransform(c._modifyViewPos),c._overflowDir===h&&(c._overflowDir=j);return}}n=Math.abs(k)<o?0:k>0?k-o:k+o;if(k>0)for(l=n;l<k;l++)m=-parseInt(d/c._cellSize+l+3,10),c._replaceRow(p.lastChild,e(m,c._totalRowCnt)),p.insertBefore(p.lastChild,p.firstChild);else if(k<0)for(l=n;l>k;l--)m=c._rowsPerView-parseInt(d/c._cellSize+l,10),c._replaceRow(p.firstChild,e(m,c._totalRowCnt)),p.insertBefore(p.firstChild,p.lastChild.nextSibling);c._setScrollBarPosition(-k),c._scalableSize+=k*c._cellSize,c._setElementTransform(f-c._scalableSize-c._cellSize)},_setElementTransform:function(a){var b=this,c=0,d=0;b._direction?c=a+"px":d=a+"px",b._setStyleTransform(b._$view,c,d)},_handleMomentumScroll:function(){var a=this,b=a.options,c=!1,d=this._$view,e=0,f=0,g=a._tracker;g&&(g.update(),a._direction?e=g.getPosition():f=g.getPosition(),c=!g.done()),a._setScrollPosition(e,f),b.rotation?a._reservedPos=a._direction?e:f:(c=!g.done(),a._reservedPos=a._direction?e:f,a._reservedPos=a._reservedPos<=-(a._maxSizeExceptClip-a._modifyViewPos)?-(a._maxSizeExceptClip+a._cellSize):a._reservedPos,a._reservedPos=a._reservedPos>-a._cellSize?-a._cellSize:a._reservedPos),a._$clip.trigger(a.options.updateEventName,[{x:e,y:f}]),c?a._timerID=setTimeout(a._timerCB,a._timerInterval):a._stopMScroll()},_startMScroll:function(a,b){var c=this;c._direction?c._sx=c._reservedPos:c._sy=c._reservedPos,c._scrollView._startMScroll.apply(c,[a,b])},_stopMScroll:function(){this._scrollView._stopMScroll.apply(this)},_enableTracking:function(){var a=this;a._$view.bind(a._dragMoveEvt,a._dragMoveCB),a._$view.bind(a._dragStopEvt,a._dragStopCB),a._scrollView._enableTracking.apply(a)},_disableTracking:function(){var a=this;a._$view.unbind(a._dragMoveEvt,a._dragMoveCB),a._$view.unbind(a._dragStopEvt,a._dragStopCB),a._scrollView._disableTracking.apply(a)},_handleDragStart:function(a,b,c){var d=this;d._scrollView._handleDragStart.apply(this,[a,b,c]),d._eventPos=d._direction?b:c,d._nextPos=d._reservedPos},_handleDragMove:function(a,b,c){var d=this,e=b-d._lastX,f=c-d._lastY,g=0,j=0,k=0,m=0,n=0,o=0,p=null;return d._lastMove=l(),d._speedX=e,d._speedY=f,d._didDrag=!0,d._lastX=b,d._lastY=c,d._direction?(d._movePos=b-d._eventPos,g=d._nextPos+d._movePos,o=b):(d._movePos=c-d._eventPos,j=d._nextPos+d._movePos,o=c),d._showScrollBars(),d._setScrollPosition(g,j),d._overflowDir!==h&&(p=d._overflowDir===i?d._overflowTop:d._overflowBottom,d._overflowDisplayed||(d._overflowDisplayed=!0,d._overflowStartPos=o),k=(o-d._overflowStartPos)*d._overflowDir,n=k<0?0:k>d._overflowMaxDragDist?1:k/d._overflowMaxDragDist,p.css("opacity",n)),!1},_handleDragStop:function(a){var b=this;return b._reservedPos=b._movePos?b._nextPos+b._movePos:b._reservedPos,b._scrollView._handleDragStop.apply(this,[a]),b._overflowDir!==h&&(b._overflowDir=h,b._hideVGOverflowIndicator()),b._didDrag?!1:d},_addBehaviors:function(){var d=this;d.options.eventType==="mouse"?(d._dragStartEvt="mousedown",d._dragStartCB=function(a){return d._handleDragStart(a,a.clientX,a.clientY)},d._dragMoveEvt="mousemove",d._dragMoveCB=function(a){return d._handleDragMove(a,a.clientX,a.clientY)},d._dragStopEvt="mouseup",d._dragStopCB=function(a){return d._handleDragStop(a,a.clientX,a.clientY)},d._$view.bind("vclick",function(a){return!d._didDrag})):(d._dragStartEvt="touchstart"
+,d._dragStartCB=function(a){var b=a.originalEvent.targetTouches[0];return d._handleDragStart(a,b.pageX,b.pageY)},d._dragMoveEvt="touchmove",d._dragMoveCB=function(a){var b=a.originalEvent.targetTouches[0];return d._handleDragMove(a,b.pageX,b.pageY)},d._dragStopEvt="touchend",d._dragStopCB=function(a){return d._handleDragStop(a)}),d._$view.bind(d._dragStartEvt,d._dragStartCB),d._$view.delegate(".virtualgrid-item","click",function(b){var c=a(this);c.trigger("select",this)}),a(b).bind("resize",function(b){var c=0,e=a(".ui-virtualgrid-view");e.length!==0&&(d._direction?(c=d._calculateClipHeight(),d._$view.height(c),d._$clip.height(c)):(c=d._calculateClipWidth(),d._$view.width(c),d._$clip.width(c)),d.resize())}),a(c).one("pageshow",function(c){var e=a(d.element).parents(".ui-page"),f=e.find(":jqmData(role='header')"),g=e.find(":jqmData(role='footer')"),h=e.find(":jqmData(role='content')"),i=g?g.height():0,j=f?f.height():0;e&&h&&(h.height(b.innerHeight-j-i).css("overflow","hidden"),h.addClass("ui-virtualgrid-content"))})},_calculateClipSize:function(){var a=this,b=0;return a._direction?b=a._calculateClipWidth():b=a._calculateClipHeight(),b},_calculateClipWidth:function(){var c=this,d=c._$clip.parent(),e=0,f=a(b).width();return c._inheritedSize.isDefinedWidth?c._inheritedSize.width:(d.hasClass("ui-content")?(e=parseInt(d.css("padding-left"),10),f-=e||0,e=parseInt(d.css("padding-right"),10),f-=e||0):f=c._$clip.width(),f)},_calculateClipHeight:function(){var c=this,d=c._$clip.parent(),e=null,f=null,g=0,h=a(b).height();return c._inheritedSize.isDefinedHeight?c._inheritedSize.height:(d.hasClass("ui-content")?(g=parseInt(d.css("padding-top"),10),h-=g||0,g=parseInt(d.css("padding-bottom"),10),h-=g||0,e=d.siblings(".ui-header"),f=d.siblings(".ui-footer"),e&&(e.outerHeight(!0)===null?h-=a(".ui-header").outerHeight()||0:h-=e.outerHeight(!0)),f&&(h-=f.outerHeight(!0))):h=c._$clip.height(),h)},_calculateColumnSize:function(){var b=this,c,d;c=a(b._makeRows(1)),b._$view.append(c.children().first()),b._direction?(b._viewSize=b._$view.width(),d=b._$view.children().first().children().first(),b._cellSize=d.outerWidth(!0),b._cellOtherSize=d.outerHeight(!0)):(b._viewSize=b._$view.height(),d=b._$view.children().first().children().first(),b._cellSize=d.outerHeight(!0),b._cellOtherSize=d.outerWidth(!0)),c.remove(),b._$view.children().remove()},_calculateColumnCount:function(){var a=this,b=a._$clip,c=a._direction?b.innerHeight():b.innerWidth(),d=0;return a._direction?c-=parseInt(b.css("padding-top"),10)+parseInt(b.css("padding-bottom"),10):c-=parseInt(b.css("padding-left"),10)+parseInt(b.css("padding-right"),10),d=parseInt(c/a._cellOtherSize,10),d>0?d:1},_getClipPosition:function(){var a=this,b=null,c=null,d=-a._cellSize,e=a._$view.closest(".ui-scrollview-view");return e&&(b=e.css("-webkit-transform"),c=b.substr(7),c=c.substr(0,c.length-1),c=c.split(", "),d=Math.abs(c[5])),d},_makeRows:function(a){var b=this,c=0,d=null,e=null;e=b._createElement("div"),e.setAttribute("class","ui-scrollview-view");for(c=0;c<a;c+=1)d=b._makeRow(c),b._direction&&(d.style.top=0,d.style.left=c*b._cellSize),e.appendChild(d);return e},_makeRow:function(a){var b=this,c=a*b._itemCount,d=0,e=b._direction?"ui-virtualgrid-wrapblock-x":"ui-virtualgrid-wrapblock-y",f=b._createElement("div"),g="",h=b._direction?"top":"left";for(d=0;d<b._itemCount;d++)g+=b._makeHtmlData(c,d,h),c+=1;return f.innerHTML=g,f.setAttribute("class",e),f.setAttribute("row-index",String(a)),b._fragment.appendChild(f),f},_makeHtmlData:function(a,b,c){var d=this,e="",f=null;return f=d._itemData(a),f&&(e=d._getConvertedTmplStr(f),e=d._insertPosToTmplStr(e,c,b*d._cellOtherSize)),e},_insertPosToTmplStr:function(a,b,c){var d=a.indexOf(">"),e=-1,f,g,h,i=!1,j=0,k,l=0;if(d===-1)return;f=a.slice(0,d),g=a.slice(d,a.length),e=f.indexOf("class");if(e!==-1){k=f.length;for(l=e+6;l<k;l++)if(f.charAt(l)==='"'||f.charAt(l)==="'"){if(i!==!1){j=l;break}i=!0}h=f.slice(0,j)+" virtualgrid-item"+f.slice(j,k)+g}else h=f+' class="virtualgrid-item"'+g;return isNaN(c)||(h=h.replace(">",' style="'+b+": "+String(c)+'px">')),h},_increaseRow:function(b){var c=this,d=c.options.rotation,e=null,f=0,g=0,h=0,i=c._scalableSize,j=0;f=parseInt(a(c._$view.children().first()).attr("row-index"),10)-1,g=parseInt(a(c._$view.children()[c._rowsPerView]).attr("row-index"),10)+1;for(j=1;j<=b;j++)g+j>=c._totalRowCnt?(e=a(c._makeRow(f)),c._$view.prepend(e),f-=1):(e=a(c._makeRow(g+j)),c._$view.append(e)),c._direction?e.width(c._cellSize):e.height(c._cellSize)},_decreaseRow:function(a){var b=this,c=0;for(c=0;c<a;c++)b._$view.children().last().remove()},_replaceRows:function(b,c,d,f){var g=this,h=g._$view.children(),i=0,j=0,k=0,l=1,m=g._filterRatio*g._cellSize+g._cellSize,n=0;m<f&&(l+=1),i=parseInt(a(h[l]).attr("row-index"),10),i===0?j=d-l:(j=Math.round(i*c/b),j+g._rowsPerView>=d&&(j=d-g._rowsPerView),k=i-j,j-=l);for(n=0;n<h.length;n+=1)g._replaceRow(h[n],e(j,g._totalRowCnt)),j++;return-k},_replaceRow:function(a,b){var c=this,d=null;while(a.hasChildNodes())a.removeChild(a.lastChild);d=c._makeRow(b);while(d.children.length)a.appendChild(d.children[0]);d.parentNode.removeChild(d)},_createElement:function(a){var b=c.createElement(a);return this._fragment.appendChild(b),b},_getObjectNames:function(a){var b=[],c="";for(c in a)b.push(c);this._properties=b},_getConvertedTmplStr:function(a){var b=this,c=b._properties,d=0,e,f="";if(!a)return;e=b._templateText;for(d=0;d<c.length;d++)e=b._strReplace(e,"${"+c[d]+"}",a[c[d]]);return e=b._changeImgSrcAriaAttrFromTmpl(e),e},_changeImgSrcAriaAttrFromTmpl:function(a){var b=this,c="",d,e="",f="",g,h,i,j;i=a,d=i.indexOf("$ARIA-IMG-SRC-ALT$");while(d!==-1)g="",e+=i.slice(0,d+19),f=i.slice(d+19,i.length),j=f.match(k),j&&(h=j[0].lastIndexOf("/"),h!==-1&&(g=j[0].slice(h+1,-1))),e=e.replace("$ARIA-IMG-SRC-ALT$",g),i=f,d=i.indexOf("$ARIA-IMG-SRC-ALT$"),c=e+f;return c===""&&(c=a),c},_insertAriaAttrToTmpl:function(a){var b="",c,d="",e="",f;f=a.replace("<div",'<div tabindex="0" aria-selected="true"'),c=f.indexOf("<img");if(c!==-1){while(c!==-1)d+=f.slice(0,c+4),e=f.slice(c+4,f.length),d+=' role="img" alt="$ARIA-IMG-SRC-ALT$"',f=e,c=f.indexOf("<img"),b=d+e;f=b,c=f.indexOf("<span"),d="";while(c!==-1)d+=f.slice(0,c+5),e=f.slice(c+5,f.length),d+=' aria-hidden="true" tabindex="-1"',f=e,c=f.indexOf("<span"),b=d+e}return b===""&&(b=a),b},_strReplace:function(a,b,c){var d=a,e=a.indexOf(b);while(e!==-1)d=d.replace(b,c),e=d.indexOf(b);return d}}),a(c).bind("pagecreate create",function(b){a(":jqmData(role='virtualgrid')").virtualgrid()})}(jQuery,window,document),function(a,b){var c={},d=0,e=1,f=-1;a.widget("tizen.virtuallistview",a.mobile.widget,{options:{theme:"s",countTheme:"s",headerTheme:"s",dividerTheme:"s",splitIcon:"arrow-r",splitTheme:"s",inset:!1,id:"",childSelector:" li",dbtable:"",template:"",dbkey:!1,scrollview:!1,row:100,page_buf:30,initSelector:":jqmData(role='virtuallistview')"},_stylerMouseUp:function(){a(this).addClass("ui-btn-up-s"),a(this).removeClass("ui-btn-down-s")},_stylerMouseDown:function(){a(this).addClass("ui-btn-down-s"),a(this).removeClass("ui-btn-up-s")},_stylerMouseOver:function(){a(this).toggleClass("ui-btn-hover-s")},_stylerMouseOut:function(){a(this).toggleClass("ui-btn-hover-s"),a(this).addClass("ui-btn-up-s"),a(this).removeClass("ui-btn-down-s")},_pushData:function(b){var c=this.options,d,e=a("#"+b),f=c.row>this._numItemData?this._numItemData:c.row,g;for(d=0;d<f;d++)g=e.tmpl(this._itemData(d)),a(c.id).append(a(g).attr("id",c.itemIDPrefix+d));a(c.id).trigger("create")},_reposition:function(b){var c,d=this,e,f;b.data?c=b.data:c=b,a(c.id+c.childSelector).size()>0&&(d._title_h=a(c.id+c.childSelector+":first").position().top,d._line_h=a(c.id+c.childSelector+":first").outerHeight(),d._container_w=a(c.id).innerWidth(),e=parseInt(a(c.id+c.childSelector).css("padding-left"),10)+parseInt(a(c.id+c.childSelector).css("padding-right"),10),a(c.id+">"+c.childSelector).addClass("position_absolute").addClass("ui-btn-up-s").bind("mouseup",d._stylerMouseUp).bind("mousedown",d._stylerMouseDown).bind("mouseover",d._stylerMouseOver).bind("mouseout",d._stylerMouseOut)),a(c.id+">"+c.childSelector).each(function(b){f=parseInt(a(this).css("margin-left"),10)+parseInt(a(this).css("margin-right"),10),a(this).css("top",d._title_h+d._line_h*b+"px").css("width",d._container_w-e-f)}),a(c.id).height(d._numItemData*d._line_h)},_resize:function(b){var c,d=this,e,f;b.data?c=b.data:c=b,d._container_w=a(c.id).innerWidth(),e=parseInt(a(c.id+c.childSelector).css("padding-left"),10)+parseInt(a(c.id+c.childSelector).css("padding-right"),10),a(c.id+c.childSelector).each(function(b){f=parseInt(a(this).css("margin-left"),10)+parseInt(a(this).css("margin-right"),10),a(this).css("width",d._container_w-e-f)})},_scrollmove:function(b){function j(){return d.scrollview?h.viewTop():i.viewTop()}function k(a){var b=!1;b&&console.log(">>virtualllist: "+a)}function l(b,c){function t(b,c,d){var e={ELEMENT_NODE:1,TEXT_NODE:3},f,g,h,i,j;a(c).find(".ui-li-text-main",".ui-li-text-sub",".ui-li-text-sub2","ui-btn-text").each(function(b){f=a(this),h=a(d).find(".ui-li-text-main",".ui-li-text-sub","ui-btn-text").eq(b).text(),a(f).contents().filter(function(){return this.nodeType==e.TEXT_NODE}).get(0).data=h}),a(c).find("img").each(function(b){var c=a(this);i=a(d).find("img").eq(b).attr("src"),a(c).attr("src",i)}),a(c).removeData()}function u(b,c,d){var e,f,g,h;return k(">> move item: "+c+" --> "+d),f=a("#"+b.options.itemIDPrefix+c),!f||!f.length?!1:(h=a("#"+b.options.template),h&&(g=h.tmpl(b._itemData(d)),t(b,f,g),g.remove()),f.css("top",d*b._line_h).attr("id",b.options.itemIDPrefix+d),!0)}var d,e,g,h=b._first_index,i=b._last_index,m,n,o,p,q=b.options.row,r,s;d=j(),r=Math.ceil(q/3),e=Math.floor(d/b._line_h)-r,g=e+q-1,e<0?(g+=-e,e=0):g>b._numItemData-1&&(e-=g-(b._numItemData-1),g=b._numItemData-1),m=e-h,k("cy="+d+", oti="+h+", obi="+i+", cti="+e+", cbi="+g+", dti="+m);if(0==m){b.timerStillCount+=1;if(b.timerStillCount<12){k("dti=0 "+b.timerStillCount+" times"),b.timerMoveID=setTimeout(l,f,b);return}k("dti=0 "+b.timerStillCount+" times. End timer."),b.timerStillCount=0,b.timerMoveID&&(clearTimeout(b.timerMoveID),b.timerMoveID=null)}else{b.timerStillCount=0,Math.abs(m)>=q?(n=h,o=i,p=m,k(">>> WHOLE CHANGE! delta="+p)):(m>0?(n=h,o=h+m-1,p=q):(n=i+m+1,o=i,p=-q),k(">>> partial change. delta="+p));for(s=n;s<=o;s++)u(b,s,s+p);b._first_index=e,b._last_index=g,b.timerMoveID=setTimeout(l,f,b)}return}var c=b.data,d=c.options,e=c._num_top_items,f=100,g,h,i;h={viewTop:function(){var b=a(d.id).parentsUntil(".ui-page").find(".ui-scrollview-view"),c=b.css("-webkit-transform"),e="0,0,0,0,0,0";return c&&(e=c.replace(/matrix\s*\((.*)\)/,"$1")),-parseInt(e.split(",")[5],10)}},i={viewTop:function(){return a(window).scrollTop()}},c.timerStillCount=0,c.timerMoveID&&(clearTimeout(c.timerMoveID),c.timerMoveID=null),l(c)},_recreate:function(b){var c=this,e=this.options;a(e.id).empty(),c._numItemData=b.length,c._direction=d,c._first_index=0,c._last_index=e.row-1,c._pushData(e.template),e.childSelector==" ul"&&a(e.id+" ul").swipelist(),a(e.id).virtuallistview(),c.refresh(!0),c._reposition(e)},_initList:function(){var b=this,c=this.options;b._pushData(c.template),a(c.id).parentsUntil(".ui-page").parent().one("pageshow",function(){setTimeout(function(){b._reposition(c)},0)}),a(document).bind("scrollstart.virtuallist scrollstop.vrituallist",b,b._scrollmove),a(window).bind("resize.virtuallist",b._resize),c.childSelector==" ul"&&a(c.id+" ul").swipelist(),b.refresh(!0)},create:function(){var a=this.options;this._create.apply(this,arguments),this._reposition(a)},_create:function(b){a.extend(this,{_itemData:function(a){return null},_numItemData:0,_cacheItemData:function(a,b){},_title_h:0,_container_w:0,_minimum_row:100,_direction:d,_first_index:0,_last_index:0,_num_top_items:0});var c=this,e=this.options,f=this.element,g=a('<div class="ui-virtuallist"/>'),h=a("<ul></ul>"),i=f.find(':jqmData(role="virtuallistview" )'),j=null,k=this,l,m;f.addClass(function(a,b){return b+" ui-listview ui-virtual-list-container"+(c.options.inset?" ui-listview-inset ui-corner-all ui-shadow ":"")}),e.itemIDPrefix=f.attr("id")+"_",e.id="#"+f.attr("id"),a(e.id).bind("pagehide",function(b){a(e.id).empty()}),a(".ui-scrollview-clip").size()>0?e.scrollview=!0:e.scrollview=!1,f.data("row")&&(e.row=f.data("row"),e.row<c._minimum_row&&(e.row=c._minimum_row),e.page_buf=parseInt(e.row/2,10));if(b){if(!b.itemData||typeof b.itemData!="function")return;c._itemData=b.itemData;if(!b.numItemData)return;if(typeof b.numItemData=="function")c._numItemData=b.numItemData();else{if(typeof b.numItemData!="number")return;c._numItemData=b.numItemData}}else{console.warn("WARNING: The data interface of virtuallist is changed. \nOld data interface(data-dbtable) is still supported, but will be removed in next version. \nPlease fix your code soon!");if(!a(e.id).hasClass("vlLoadSuccess"))return;l=f.jqmData("dbtable"),m=window[l],a(e.id).empty(),m||(m={}),c._itemData=function(a){return m[a]},c._numItemData=m.length}f.data("template")&&(e.template=f.data("template"),f.data("swipelist")==1?e.childSelector=" ul":e.childSelector=" li"),f.data("dbkey")&&(e.dbkey=f.data("dbkey")),c._first_index=0,c._last_index=e.row-1,c._initList()},destroy:function(){var b=this.options;a(document).unbind("scrollstop"),a(window).unbind("resize.virtuallist"),a(b.id).empty(),this.timerMoveID&&(clearTimeout(this.timerMoveID),this.timerMoveID=null)},_itemApply:function(b,c){var d=c.find(".ui-li-count");d.length&&c.addClass("ui-li-has-count"),d.addClass("ui-btn-up-"+(b.jqmData("counttheme")||this.options.countTheme)+" ui-btn-corner-all"),c.find("h1, h2, h3, h4, h5, h6").addClass("ui-li-heading").end().find("p, dl").addClass("ui-li-desc").end().find(">img:eq(0), .ui-link-inherit>img:eq(0)").addClass("ui-li-thumb").each(function(){c.addClass(a(this).is(".ui-li-icon")?"ui-li-has-icon":"ui-li-has-thumb")}).end().find(".ui-li-aside").each(function(){var b=a(this);b.prependTo(b.parent())})},_removeCorners:function(a,b){var c="ui-corner-top ui-corner-tr ui-corner-tl",d="ui-corner-bottom ui-corner-br ui-corner-bl";a=a.add(a.find(".ui-btn-inner, .ui-li-link-alt, .ui-li-thumb")),b==="top"?a.removeClass(c):b==="bottom"?a.removeClass(d):a.removeClass(c+" "+d)},_refreshCorners:function(a){var b,c,d,e;this.options.inset&&(b=this.element.children("li"),c=a?b.not(".ui-screen-hidden"):b.filter(":visible"),this._removeCorners(b),d=c.first().addClass("ui-corner-top"),d.add(d.find(".ui-btn-inner")).find(".ui-li-link-alt").addClass("ui-corner-tr").end().find(".ui-li-thumb").not(".ui-li-icon").addClass("ui-corner-tl"),e=c.last().addClass("ui-corner-bottom"),e.add(e.find(".ui-btn-inner")).find(".ui-li-link-alt").addClass("ui-corner-br").end().find(".ui-li-thumb").not(".ui-li-icon").addClass("ui-corner-bl"))},refresh:function(b){this.parentPage=this.element.closest(".ui-page"),this._createSubPages();var c=this.options,d=this.element,e=this,f=d.jqmData("dividertheme")||c.dividerTheme,g=d.jqmData("splittheme"),h=d.jqmData("spliticon"),i=d.children("li"),j=a.support.cssPseudoElement||!a.nodeName(d[0],"ol")?0:1,k,l,m,n,o,p,q,r,s,t,u;j&&d.find(".ui-li-dec").remove();for(s=0,t=i.length;s<t;s++){k=i.eq(s),l="ui-li";if(b||!k.hasClass("ui-li"))u=k.jqmData("theme")||c.theme,n=k.children("a"),n.length?(r=k.jqmData("icon"),k.buttonMarkup({wrapperEls:"div",shadow:!1,corners:!1,iconpos:"right",icon:!1,theme:u}),r!=0&&n.length==1&&k.addClass("ui-li-has-arrow"),n.first().addClass("ui-link-inherit"),n.length>1&&(l+=" ui-li-has-alt",o=n.last(),p=g||o.jqmData("theme")||c.splitTheme,o.appendTo(k).attr("title",o.getEncodedText()).addClass("ui-li-link-alt").empty().buttonMarkup({shadow:!1,corners:!1,theme:u,icon:!1,iconpos:!1}).find(".ui-btn-inner").append(a("<span />").buttonMarkup({shadow:!0,corners:!0,theme:p,iconpos:"notext",icon:h||o.jqmData("icon")||c.splitIcon})))):k.jqmData("role")==="list-divider"?(l+=" ui-li-divider ui-btn ui-bar-"+f,k.attr("role","heading"),j&&(j=1)):l+=" ui-li-static ui-body-"+u;j&&l.indexOf("ui-li-divider")<0&&(q=k.is(".ui-li-static:first")?k:k.find(".ui-link-inherit"),q.addClass("ui-li-jsnumbering").prepend("<span class='ui-li-dec'>"+j++ +". </span>")),k.add(k.children(".ui-btn-inner")).addClass(l),e._itemApply(d,k)}this._refreshCorners(b)},_idStringEscape:function(a){return a.replace(/\W/g,"-")},_createSubPages:function(){var b=this.element,d=b.closest(".ui-page"),e=d.jqmData("url"),f=e||d[0][a.expando],g=b.attr("id"),h=this.options,i="data-"+a.mobile.ns,j=this,k=d.find(":jqmData(role='footer')").jqmData("id"),l,m;typeof c[f]=="undefined"&&(c[f]=-1),g=g||++c[f],a(b.find("li>ul, li>ol").toArray().reverse()).each(function(c){var d=this,f=a(this),j=f.attr("id")||g+"-"+c,m=f.parent(),n,p=n.first().getEncodedText(),q=(e||"")+"&"+a.mobile.subPageUrlKey+"="+j,r=f.jqmData("theme")||h.theme,s=f.jqmData("counttheme")||b.jqmData("counttheme")||h.countTheme,t,u;n=a(f.prevAll().toArray().reverse()),n=n.length?n:a("<span>"+a.trim(m.contents()[0].nodeValue)+"</span>"),l=!0,t=f.detach().wrap("<div "+i+"role='page' "+i+"url='"+q+"' "+i+"theme='"+r+"' "+i+"count-theme='"+s+"'><div "+i+"role='content'></div></div>").parent().before("<div "+i+"role='header' "+i+"theme='"+h.headerTheme+"'><div class='ui-title'>"+p+"</div></div>").after(k?a("<div "+i+"role='footer' "+i+"id='"+k+"'>"):"").parent().appendTo(a.mobile.pageContainer),t.page(),u=m.find("a:first"),u.length||(u=a("<a/>").html(n||p).prependTo(m.empty())),u.attr("href","#"+q)}).virtuallistview(),l&&d.is(":jqmData(external-page='true')")&&d.data("page").options.domCache===!1&&(m=function(b,c){var f=c.nextPage,g;c.nextPage&&(g=f.jqmData("url"),g.indexOf(e+"&"+a.mobile.subPageUrlKey)!==0&&(j.childPages().remove(),d.remove()))},d.unbind("pagehide.remove").bind("pagehide.remove",m))},childPages:function(){var b=this.parentPage.jqmData("url");return a(":jqmData(url^='"+b+"&"+a.mobile.subPageUrlKey+"')")}}),a(document).bind("pagecreate create",function(b){a(a.tizen.virtuallistview.prototype.options.initSelector,b.target).virtuallistview()})}(jQuery),function(a,b,c){a.widget("tizen.progress",a.mobile.widget,{options:{style:"circle",running:!1},show:function(){a(this.element).show()},hide:function(){a(this.element).hide()},_start:function(){this.init||(a(this.element).append(this.html),this.init=!0),this.show(),a(this.element).find(".ui-progress-"+this.options.style).addClass(this.runningClass)},_stop:function(){a(this.element).find(".ui-progress-"+this.options.style).removeClass(this.runningClass)},running:function(a){if(a===c)return this.options.running;this._setOption("running",a)},_setOption:function(a,c){if(a==="running"){if(typeof c!="boolean"){b.alert("running value MUST be boolean type!");return}this.options.running=c,this._refresh()}},_refresh:function(){this.options.running?this._start():this._stop()},_create:function(){var b=this,c=this.element,d=c.jqmData("style"),e,f;d?this.options.style=d:d=this.options.style,d=="circle"?(a(this.element).addClass("ui-progress-container-circle"),e='<div class="ui-progress-circle"></div>'):d==="pending"&&(a(this.element).addClass("ui-progressbar"),e='<div class="ui-progressbar-bg"><div class="ui-progress-pending"></div></div>'),this.html=a(e),f="ui-progress-"+d+"-running",a.extend(this,{init:!1,runningClass:f}),d==="pending"&&(a(this.element).append(this.html),this.init=!0),this._refresh()}}),a(document).bind("pagecreate create",function(b){a(b.target).find(":jqmData(role='progress')").progress()})}(jQuery,this),function(a,b,c,d){a.widget("tizen.tokentextarea",a.mobile.widget,{_focusStatus:null,_items:null,_viewWidth:0,_reservedWidth:0,_currentWidth:0,_fontSize:0,_anchorWidth:0,_labelWidth:0,_marginWidth:0,options:{label:"To : ",link:null,description:"+ {0}"},_create:function(){var b=this,d=this.element,e=d.jqmData("role"),f=this.options,g="ui-tokentextarea-link",h=a(c.createElement("input")),i=a(c.createElement("span")),j=a(c.createElement("a"));d.hide().empty().addClass("ui-"+e),a(i).text(f.label).addClass("ui-tokentextarea-label").attr("tabindex",0),d.append(i),a(h).addClass("ui-tokentextarea-input ui-tokentextarea-input-visible ui-input-text ui-body-s").attr("role","textbox"),d.append(h);if(f.link===null||a.trim(f.link).length<1||a(f.link).length===0)g+="-dim";a(j).attr("data-role","button").buttonMarkup({inline:!0,icon:"plus",style:"circle"}).attr({href:a.trim(f.link),tabindex:0}).addClass("ui-tokentextarea-link-base").addClass(g).find("span.ui-btn-text").text("Add recipient"),d.append(j),this._bindEvents(),b._focusStatus="init",d.show(),b._viewWidth=d.innerWidth(),b._reservedWidth+=b._calcBlockWidth(j),b._reservedWidth+=b._calcBlockWidth(i),b._fontSize=parseInt(a(j).css("font-size"),10),b._currentWidth=b._reservedWidth,b._modifyInputBoxWidth()},_bindEvents:function(){var b=this,d=b.element,e=b.options,f=d.find(".ui-tokentextarea-input"),g=d.find(".ui-tokentextarea-link-base"),h=!1;d.delegate("div","click",function(c){a(this).hasClass("ui-tokentextarea-sblock")&&b._removeTextBlock();var e=d.find("div.ui-tokentextarea-sblock");typeof e!="undefined"&&e.removeClass("ui-tokentextarea-sblock").addClass("ui-tokentextarea-block"),a(this).removeClass("ui-tokentextarea-block").addClass("ui-tokentextarea-sblock"),d.trigger("select")}),f.bind("keyup",function(c){var d=c.keyCode,e=a(f).val(),g=[],i;if(d===8)e.length===0&&b._validateTargetBlock();else if(d===13||d===186||d===188){if(e.length!==0){g=e.split(/[,;]/);for(i=0;i<g.length;i++)g[i].length!==0&&g[i].replace(/\s/g,"").length!==0&&b._addTextBlock(g[i])}f.val(""),h=!0}else b._unlockTextBlock();return!h}),g.click(function(){if(a(g).hasClass("ui-tokentextarea-link-dim"))return;a(f).removeClass("ui-tokentextarea-input-visible").addClass("ui-tokentextarea-input-invisible"),a.mobile.changePage(e.link,{transition:"slide",reverse:!1,changeHash:!1})}),a(c).bind("pagechange.mbe",function(c){if(d.innerWidth()===0)return;b._modifyInputBoxWidth(),a(f).removeClass("ui-tokentextarea-input-invisible").addClass("ui-tokentextarea-input-visible")}),d.bind("click",function(a){b._focusStatus==="focusOut"&&b.focusIn()})},_addTextBlock:function(b,d){if(arguments.length===0)return;if(!b)return;var e=this,f=e.element,g=b,h=d,i=null,j=null;e._viewWidth===0&&(e._viewWidth=f.innerWidth()),j=a(c.createElement("div")),j.text(g).addClass("ui-tokentextarea-block").attr({"aria-label":"double tap to edit",tabindex:0}),j.css({visibility:"hidden"}),i=f.find("div"),h!==null&&h<=i.length?a(i[h]).before(j):f.find(".ui-tokentextarea-input").before(j),j=e._ellipsisTextBlock(j),j.css({visibility:"visible"}),e._modifyInputBoxWidth(),j.hide(),j.fadeIn("fast",function(){e._currentWidth+=e._calcBlockWidth(j),f.trigger("add")})},_removeTextBlock:function(){var a=this,b=this.element,c=b.find("div.ui-tokentextarea-sblock"),d=null,e=function(){};c!==null&&c.length>0?(a._currentWidth-=a._calcBlockWidth(c),c.fadeOut("fast",function(){c.remove(),a._modifyInputBoxWidth()}),this._eventRemoveCall=!0,b[0].remove&&(d=b[0].remove,b[0].remove=e),b.triggerHandler("remove"),d&&(b[0].remove=d),this._eventRemoveCall=!1):b.find("div:last").removeClass("ui-tokentextarea-block").addClass("ui-tokentextarea-sblock")},_calcBlockWidth:function(b){return a(b).outerWidth(!0)},_unlockTextBlock:function(){var a=this.element,b=a.find("div.ui-tokentextarea-sblock");b&&b.removeClass("ui-tokentextarea-sblock").addClass("ui-tokentextarea-block")},_validateTargetBlock:function(){var a=this,b=a.element,c=b.find("div:last"),d=null;c.hasClass("ui-tokentextarea-sblock")?a._removeTextBlock():(d=b.find("div.ui-tokentextarea-sblock"),d.removeClass("ui-tokentextarea-sblock").addClass("ui-tokentextarea-block"),c.removeClass("ui-tokentextarea-block").addClass("ui-tokentextarea-sblock"))},_ellipsisTextBlock:function(b){var c=this,d=c.element,e=c._viewWidth/2;return c._calcBlockWidth(b)>e&&a(b).width(e-c._marginWidth),b},_modifyInputBoxWidth:function(){var b=this,c=b.element,d=0,e=0,f=0,g=0,h=c.find("div"),i=0,j=0,k=10,l=c.find(".ui-tokentextarea-input");if(c.width()===0)return;b._labelWidth===0&&(b._labelWidth=c.find(".ui-tokentextarea-label").outerWidth(!0),b._anchorWidth=c.find(".ui-tokentextarea-link-base").outerWidth(!0),b._marginWidth=parseInt(a(l).css("margin-left"),10),b._marginWidth+=parseInt(a(l).css("margin-right"),10),b._viewWidth=c.innerWidth()),d=b._marginWidth,e=b._labelWidth,f=b._anchorWidth,g=b._viewWidth-e;for(j=0;j<h.length;j+=1)i=b._calcBlockWidth(h[j]),i>=g+f?i>=g?g=b._viewWidth-i:g=b._viewWidth:i>g?g=b._viewWidth-i:g-=i;g-=d,g<f*2&&(g=b._viewWidth-d),a(l).width(g-f-k)},_stringFormat:function(a){var b=null,c=a,d=0;for(d=1;d<arguments.length;d+=1)b="{"+(d-1)+"}",c=c.replace(b,arguments[d]);return c},_resizeBlocks:function(){var b=this,c=b.element,d=c.find("div"),e=0;for(e=0;e<d.length;e+=1)a(d[e]).css("width","auto"),d[e]=b._ellipsisTextBlock(d[e])},focusIn:function(){if(this._focusStatus==="focusIn")return;var a=this.element;a.find(".ui-tokentextarea-label").attr("tabindex",0).show(),a.find(".ui-tokentextarea-desclabel").remove(),a.find("div.ui-tokentextarea-sblock").removeClass("ui-tokentextarea-sblock").addClass("ui-tokentextarea-block"),a.find("div").attr({"aria-label":"double tap to edit",tabindex:0}).show(),a.find(".ui-tokentextarea-input").removeClass("ui-tokentextarea-input-invisible").addClass("ui-tokentextarea-input-visible").attr("tabindex",0),a.find("a").attr("tabindex",0).show(),this._modifyInputBoxWidth(),this._focusStatus="focusIn",a.removeClass("ui-tokentextarea-focusout").addClass("ui-tokentextarea-focusin").removeAttr("tabindex"),a.find(".ui-tokentextarea-input").focus()},focusOut:function(){if(this._focusStatus==="focusOut")return;var b=this,d=b.element,e=null,f=null,g=null,h="",i=0,j=10,k=d.find(".ui-tokentextarea-label"),l=d.find("span"),m=d.find("div"),n=d.outerWidth(!0)-l.outerWidth(!0)-k.outerWidth(!0),o=0;k.removeAttr("tabindex"),d.find(".ui-tokentextarea-input").removeClass("ui-tokentextarea-input-visible").addClass("ui-tokentextarea-input-invisible").removeAttr("tabindex"),d.find("a").removeAttr("tabindex").hide(),m.removeAttr("aria-label").removeAttr("tabindex").hide(),n-=b._reservedWidth;for(i=0;i<m.length;i++){o=a(m[i]).outerWidth(!0);if(n-o<=0){j=i-1;break}a(m[i]).show(),n-=o}j!==m.length&&(h=b._stringFormat(b.options.description,m.length-j-1),e=a(c.createElement("span")),e.addClass("ui-tokentextarea-desclabel").attr({"aria-label":"more, double tap to edit",tabindex:"-1"}),f=a(c.createElement("span")).text(h).attr("aria-hidden","true"),g=a(c.createElement("span")).text(m.length-j-1).attr("aria-label","and").css("visibility","hidden"),e.append(f),e.append(g),a(m[j]).after(e)),this._focusStatus="focusOut",d.removeClass("ui-tokentextarea-focusin").addClass("ui-tokentextarea-focusout").attr("tabindex",0)},inputText:function(a){var b=this.element;return arguments.length===0?b.find(".ui-tokentextarea-input").val():(b.find(".ui-tokentextarea-input").val(a),a)},select:function(b){var c=this.element,d=null,e=null;if(this._focusStatus==="focusOut")return;return arguments.length===0?(d=c.find("div.ui-tokentextarea-sblock"),d?d.text():null):(this._unlockTextBlock(),e=c.find("div"),e.length>b&&(a(e[b]).removeClass("ui-tokentextarea-block").addClass("ui-tokentextarea-sblock"),c.trigger("select")),null)},add:function(a,b){if(this._focusStatus==="focusOut")return;this._addTextBlock(a,b)},remove:function(b){var c=this,d=this.element,e=d.find("div"),f=0,g=null,h=function(){};if(this._focusStatus==="focusOut")return;arguments.length===0?e.fadeOut("fast",function(){e.remove(),c._modifyInputBoxWidth(),c._trigger("clear")}):isNaN(b)||(f=b<e.length?b:e.length-1,a(e[f]).fadeOut("fast",function(){a(e[f]).remove(),c._modifyInputBoxWidth()}),this._eventRemoveCall=!0,d[0].remove&&(g=d[0].remove,d[0].remove=h),d.triggerHandler("remove"),g&&(d[0].remove=g),this._eventRemoveCall=!1)},length:function(){return this.element.find("div").length},refresh:function(){var a=this,b=this.element;a._viewWidth=b.innerWidth(),a._resizeBlocks(),a._modifyInputBoxWidth()},destroy:function(){var a=this.element,b=null,c=function(){};if(this._eventRemoveCall)return;a.find(".ui-tokentextarea-label").remove(),a.find("div").undelegate("click").remove(),a.find("a").remove(),a.find(".ui-tokentextarea-input").unbind("keyup").remove(),this._eventRemoveCall=!0,a[0].remove&&(b=a[0].remove,a[0].remove=c),a.remove(),b&&(a[0].remove=b),this._eventRemoveCall=!1,this._trigger("destroy")}}),a(c).bind("pagecreate create",function(){a(":jqmData(role='tokentextarea')").tokentextarea()}),a(b).bind("resize",function(){a(":jqmData(role='tokentextarea')").tokentextarea("refresh")})}(jQuery,window,document),function(a,b){function c(){var b=a("script[data-framework-version][data-framework-root][data-framework-theme]");return b.attr("data-framework-root")+"/"+b.attr("data-framework-version")+"/themes/"+b.attr("data-framework-theme")+"/proto-html"}a.widget("tizen.widgetex",a.mobile.widget,{_createWidget:function(){a.tizen.widgetex.loadPrototype.call(this,this.namespace+"."+this.widgetName),a.mobile.widget.prototype._createWidget.apply(this,arguments)},_init:function(){if(this.element===b)return;var c=this.element.closest(".ui-page"),d=this,e={};c.is(":visible")?this._realize():c.bind("pageshow",function(){d._realize()}),a.extend(e,this.options),this.options={},this._setOptions(e)},_getCreateOptions:function(){if(this.element.is("input")&&this._value!==b){var c=this.element.attr("type")==="checkbox"||this.element.attr("type")==="radio"?this.element.is(":checked"):this.element.is("[value]")?this.element.attr("value"):b;c!=b&&this.element.attr(this._value.attr,c)}return a.mobile.widget.prototype._getCreateOptions.apply(this,arguments)},_setOption:function(c,d){var e="_set"+c.replace(/^[a-z]/,function(a){return a.toUpperCase()});this[e]!==b?this[e](d):a.mobile.widget.prototype._setOption.apply(this,arguments)},_setDisabled:function(b){a.Widget.prototype._setOption.call(this,"disabled",b),this.element.is("input")&&this.element.attr("disabled",b)},_setValue:function(b){a.tizen.widgetex.setValue(this,b)},_realize:function(){}}),a.tizen.widgetex.setValue=function(a,c){if(a._value!==b){var d=a._value.makeString?a._value.makeString(c):c,e;a.element.attr(a._value.attr,d),a._value.signal!==b&&a.element.triggerHandler(a._value.signal,c),a.element.is("input")&&(e=a.element.attr("type"),e==="checkbox"||e==="radio"?c?a.element.attr("checked",!0):a.element.removeAttr("checked"):a.element.attr("value",d),a.element.trigger("change"))}},a.tizen.widgetex.assignElements=function(b,c){var d={},e;for(e in c)typeof c[e]=="string"?(d[e]=b.find(c[e]),c[e].match(/^#/)&&d[e].removeAttr("id")):typeof c[e]=="object"&&(d[e]=a.tizen.widgetex.assignElements(b,c[e]));return d},a.tizen.widgetex.loadPrototype=function(d,e){var f=d.split("."),g,h,i,j=!1,k,l;f.length==2&&(g=f[0],h=f[1],a[g][h].prototype._htmlProto!==b&&(i=a[g][h].prototype._htmlProto.source,i===b&&(i=h,j=!0),typeof i=="string"?j?(d=i,l=c(),a.ajax({url:l+"/"+d+".prototype.html",async:!1,dataType:"html"}).success(function(b,c,d){i=a("<div></div>").html(b).jqmData("tizen.widgetex.ajax.fail",!1)}),i=a("<div></div>").text("Failed to load proto for widget "+g+"."+h+"!").css({background:"red",color:"blue",border:"1px solid black"}).jqmData("tizen.widgetex.ajax.fail",!0)):i=a(i).jqmData("tizen.widgetex.ajax.fail",!1):i.jqmData("tizen.widgetex.ajax.fail",!1),k=i,a[g][h].prototype._htmlProto.source=i,a[g][h].prototype._htmlProto.ui!==b&&a.extend(this,{_ui:a.tizen.widgetex.assignElements(k.clone(),a[g][h].prototype._htmlProto.ui)})))}}(jQuery),function(a,b,c){a.widget("tizen.tizenslider",a.mobile.widget,{options:{popup:!0},popup:null,handle:null,handleText:null,_create:function(){this.currentValue=null,this.popupVisible=!1;var b=this,d=a(this.element),e,f,g,h,i,j,k,l,m,n,o;d.slider(),d.hide(),b.popup=a('<div class="ui-slider-popup"></div>'),g=d.jqmData("popup"),g!==c&&(b.options.popup=g==1),e=d.next(".ui-slider"),h=d.attr("data-icon"),e.wrap('<div class="ui-slider-container"></div>'),b.handle=e.find(".ui-slider-handle"),e.removeClass("ui-btn-corner-all"),e.find("*").removeClass("ui-btn-corner-all");switch(h){case"bright":case"volume":l=a('<div class="ui-slider-left-'+h+'"></div>'),m=a('<div class="ui-slider-right-'+h+'"></div>'),e.before(l),e.after(m),n=l.width()+16,o=m.width()+16;break;case"text":j=d.attr("data-text-left")===c?"":d.attr("data-text-left").substring(0,3),i=d.attr("data-text-right")===c?"":d.attr("data-text-right").substring(0,3),k=Math.max(j.length,i.length)+1,n=k+"rem",o=k+"rem",l=a('<div class="ui-slider-left-text" style="left:'+ -k+"rem; width:"+k+'rem;">'+'<span style="position:relative;top:0.4em;">'+j+"</span></div>"),m=a('<div class="ui-slider-right-text" style="right:'+ -k+"rem; width:"+k+'rem;">'+'<span style="position:relative;top:0.4em;">'+i+"</span></div>"),e.before(l),e.after
+(m)}h&&e.parent(".ui-slider-container").css({"margin-left":n,"margin-right":o}),e.append(a('<div class="ui-slider-handle-press"></div>')),b.handle_press=e.find(".ui-slider-handle-press"),b.handle_press.css("display","none"),e.parents(".ui-page").append(b.popup),b.popup.hide(),b.handleText=e.find(".ui-btn-text"),b.updateSlider(),this.element.bind("change",function(){b.updateSlider()}),b.handle.bind("vmousedown",function(){b.showPopup()}),e.add(document).bind("vmouseup",function(){b.hidePopup()})},_handle_press_show:function(){this.handle_press.css("display","")},_handle_press_hide:function(){this.handle_press.css("display","none")},positionPopup:function(){var a=this.handle.offset();this.popup.offset({left:a.left+(this.handle.width()-this.popup.width())/2,top:a.top-this.popup.height()}),this.handle_press.offset({left:a.left,top:a.top})},updateSlider:function(){var a,b,c,d,e,f=function(a){var b=Math.abs(a),c;return b>999?c=4:b>99?c=3:b>9?c=2:c=1,a<0&&c++,c};this.handle.removeAttr("title"),e=this.element.val(),b=f(e);if(this.popupVisible){this.positionPopup();switch(b){case 1:case 2:a="1.5rem",d="0.15rem";break;case 3:a="1rem",d="0.5rem";break;default:a="0.8rem",d="0.5rem"}this.popup.css({"font-size":a,"padding-top":d})}if(e===this.currentValue)return;switch(b){case 1:a="0.95rem",c="0";break;case 2:a="0.85rem",c="-0.01rem";break;case 3:a="0.65rem",c="-0.05rem";break;default:a="0.45rem",c="-0.15rem"}a!=this.handleText.css("font-size")&&this.handleText.css({"font-size":a,top:c}),this.currentValue=e,this.handleText.text(e),this.popup.html(e),this.element.trigger("update",e)},showPopup:function(){if(!this.options.popup||this.popupVisible)return;this.popup.show(),this.popupVisible=!0,this._handle_press_show()},hidePopup:function(){if(!this.options.popup||!this.popupVisible)return;this.popup.hide(),this.popupVisible=!1,this._handle_press_hide()},_setOption:function(a,b){var c=b!==this.options[a];if(!c)return;switch(a){case"popup":this.options.popup=b,this.options.popup?this.updateSlider():this.hidePopup()}}}),a(document).bind("pagebeforecreate",function(d){a.data(b,"jqmSliderInitSelector")===c&&(a.data(b,"jqmSliderInitSelector",a.mobile.slider.prototype.options.initSelector),a.mobile.slider.prototype.options.initSelector=null)}),a(document).bind("pagecreate create",function(c){var d=a.data(b,"jqmSliderInitSelector");a(c.target).find(d).not("select").tizenslider(),a(c.target).find(d).filter("select").slider()})}(jQuery,this),function(a,b,c){a.widget("tizen.progressbar",a.mobile.widget,{options:{value:0,max:100},min:0,_create:function(){this.element.addClass("ui-progressbar").attr({role:"progressbar","aria-valuemin":this.min,"aria-valuemax":this.options.max,"aria-valuenow":this._value()}),this.valueDiv=a("<div class='ui-progressbar-value'></div>").appendTo(this.element),this.valueDiv.wrap("<div class='ui-progressbar-bg'></div>"),this.oldValue=this._value(),this._refreshValue()},_destroy:function(){this.element.removeClass("ui-progressbar").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.valueDiv.remove()},value:function(a){return a===c?this._value():(this._setOption("value",a),this)},_setOption:function(a,b){a==="value"&&(this.options.value=b,this._refreshValue(),this._value()===this.options.max&&this.element.trigger("complete"))},_value:function(){var a=this.options.value;return typeof a!="number"&&(a=0),Math.min(this.options.max,Math.max(this.min,a))},_percentage:function(){return 100*this._value()/this.options.max},_refreshValue:function(){var a=this.value(),b=this._percentage();this.oldValue!==a&&(this.oldValue=a,this.element.trigger("change")),this.valueDiv.toggle(a>this.min).width(b.toFixed(0)+"%"),this.element.attr("aria-valuenow",a)}}),a(document).bind("pagecreate",function(b){a(b.target).find(":jqmData(role='progressbar')").progressbar()})}(jQuery,this),function(a,b){a.widget("tizen.popupwindow",a.tizen.widgetex,{options:{theme:null,overlayTheme:"s",style:"custom",disabled:!1,shadow:!0,corners:!0,fade:!1,opacity:.7,widthRatio:.8612,transition:a.mobile.defaultDialogTransition,initSelector:":jqmData(role='popupwindow')"},_htmlProto:{source:["<div><div>"," <div id='popupwindow-screen' class='ui-selectmenu-screen ui-screen-hidden ui-popupwindow-screen'></div>"," <div id='popupwindow-container' class='ui-popupwindow ui-popupwindow-padding ui-selectmenu-hidden ui-overlay-shadow ui-corner-all'></div>","</div>","</div>"].join(""),ui:{screen:"#popupwindow-screen",container:"#popupwindow-container"}},_setStyle:function(){var a=this.element,b=a.attr("data-style");b&&(this.options.style=b),a.addClass(this.options.style),a.find(":jqmData(role='title')").wrapAll("<div class='popup-title'></div>"),a.find(":jqmData(role='text')").wrapAll("<div class='popup-text'></div>"),a.find(":jqmData(role='button-bg')").wrapAll("<div class='popup-button-bg'></div>"),a.find(":jqmData(role='check-bg')").wrapAll("<div class='popup-check-bg'></div>"),a.find(":jqmData(role='scroller-bg')").addClass("popup-scroller-bg"),a.find(":jqmData(role='text-bottom-bg')").wrapAll("<div class='popup-text-bottom-bg'></div>"),a.find(":jqmData(role='text-left')").wrapAll("<div class='popup-text-left'></div>"),a.find(":jqmData(role='text-right')").wrapAll("<div class='popup-text-right'></div>"),a.find(":jqmData(role='progress-bg')").wrapAll("<div class='popup-progress-bg'></div>")},_create:function(){console.warn("popupwindow() was deprecated. use popup() instead.");var b=this.element.closest(":jqmData(role='page')"),c=this;b.length===0&&(b=a("body")),this._ui.placeholder=a("<div><!-- placeholder for "+this.element.attr("id")+" --></div>").css("display","none").insertBefore(this.element),b.append(this._ui.screen),this._ui.container.insertAfter(this._ui.screen),this._ui.container.append(this.element),this._setStyle(),this._isOpen=!1,this._ui.screen.bind("vclick",function(a){return c.close(),!1}),this.element.bind("vclick",function(b){a(b.target).is("ui-btn-ctxpopup-close")&&c.close()})},destroy:function(){this.element.insertBefore(this._ui.placeholder),this._ui.placeholder.remove(),this._ui.container.remove(),this._ui.screen.remove(),this.element.triggerHandler("destroyed"),a.Widget.prototype.destroy.call(this)},_placementCoords:function(b,c,d,e){var f=a(window).height(),g=a(window).width(),h=e/2,i=parseFloat(this._ui.container.css("max-width")),j=c,k=f-c,l,m;return j>e/2&&k>e/2?l=c-h:l=j>k?f-e-30:30,d<i?m=(g-d)/2:(m=b-d/2,m<10?m=10:m+d>g&&(m=g-d-10)),{x:m,y:l}},_setPosition:function(c,d){var e=b===c?a(window).width()/2:c,f=b===d?a(window).height()/2:d,g,h=this.element.data("ctxpopup"),i,j,k,l,m,n,o,p,q,r,s;h||(i=a(window).width()*this.options.widthRatio,this._ui.container.css("width",i),this._ui.container.outerWidth()>a(window).width()&&this._ui.container.css({"max-width":a(window).width()-30})),g=this._placementCoords(e,f,this._ui.container.outerWidth(),this._ui.container.outerHeight()),j=this._ui.container.innerHeight(),k=this._ui.container.innerWidth(),l=a(window).height(),m=a(window).width(),n=f,o=l-f,p=j/2,q=parseFloat(this._ui.container.css("max-width")),r=(l-j)/2,!q||k<q?s=(m-k)/2:(s=e-k/2,s<30?s=30:s+k>m&&(s=m-k-30)),h&&(r=g.y,s=g.x),this._ui.container.css({top:r,left:s}),this._ui.screen.css("height",l)},open:function(b,c,d){var e=this,f=0;if(this._isOpen||this.options.disabled)return;a(document).find("*").each(function(){var b=a(this),c=parseInt(b.css("z-index"),10);b.is(e._ui.container)||b.is(e._ui.screen)||isNaN(c)||(f=Math.max(f,c))}),this._ui.screen.css("height",a(window).height()),d?this._ui.screen.css("opacity",0).removeClass("ui-screen-hidden"):(this._ui.removeClass("ui-screen-hidden"),this.options.fade?this._ui.screen.animate({opacity:this.options.opacity},"fast"):this._ui.screen.css({opacity:this.options.opacity})),this._setPosition(b,c),this.element.trigger("popupbeforeposition"),this._ui.container.removeClass("ui-selectmenu-hidden").addClass("in").animationComplete(function(){e.element.trigger("popupafteropen")}),this._isOpen=!0,this._reflow||(this._reflow=function(){if(!e._isOpen)return;e._setPosition(b,c)},a(window).bind("resize",this._reflow))},close:function(){if(!this._isOpen)return;this._reflow&&(a(window).unbind("resize",this._reflow),this._reflow=null);var b=this,c=function(){b._ui.screen.addClass("ui-screen-hidden"),b._isOpen=!1};this._ui.container.removeClass("in").addClass("reverse out"),this.options.transition==="none"?(this._ui.container.addClass("ui-selectmenu-hidden").removeAttr("style"),this.element.trigger("popupafterclose")):this._ui.container.animationComplete(function(){b._ui.container.removeClass("reverse out").addClass("ui-selectmenu-hidden").removeAttr("style"),b.element.trigger("popupafterclose")}),this.options.fade?this._ui.screen.animate({opacity:0},"fast",c):c()},_realSetTheme:function(a,b){var c=(a.attr("class")||"").split(" "),d=!0,e=null,f;while(c.length>0){e=c.pop(),f=e.match(/^ui-body-([a-z])$/);if(f&&f.length>1){e=f[1];break}e=null}a.removeClass("ui-body-"+e),(b||"").match(/[a-z]/)&&a.addClass("ui-body-"+b)},_setTheme:function(b){this._realSetTheme(this.element,b),this.options.theme=b,this.element.attr("data-"+(a.mobile.ns||"")+"theme",b)},_setOverlayTheme:function(b){this._realSetTheme(this._ui.container,b),this.options.overlayTheme=b,this.element.attr("data-"+(a.mobile.ns||"")+"overlay-theme",b)},_setShadow:function(b){this.options.shadow=b,this.element.attr("data-"+(a.mobile.ns||"")+"shadow",b),this._ui.container[b?"addClass":"removeClass"]("ui-overlay-shadow")},_setCorners:function(b){this.options.corners=b,this.element.attr("data-"+(a.mobile.ns||"")+"corners",b),this._ui.container[b?"addClass":"removeClass"]("ui-corner-all")},_setFade:function(b){this.options.fade=b,this.element.attr("data-"+(a.mobile.ns||"")+"fade",b)},_setTransition:function(b){this._ui.container.removeClass(this.options.transition||"").addClass(b),this.options.transition=b,this.element.attr("data-"+(a.mobile.ns||"")+"transition",b)},_setDisabled:function(b){a.Widget.prototype._setOption.call(this,"disabled",b),b&&this.close()}}),a.tizen.popupwindow.bindPopupToButton=function(a,b){if(a.length===0||b.length===0)return;var c=function(c){return b.jqmData("overlay-theme-set")||b.popupwindow("option","overlayTheme",a.jqmData("theme")),b.popupwindow("open",a.offset().left+a.outerWidth()/2,a.offset().top+a.outerHeight()/2),!1};(b.popupwindow("option","overlayTheme")||"").match(/[a-z]/)&&b.jqmData("overlay-theme-set",!0),a.attr({"aria-haspopup":!0,"aria-owns":a.attr("href")}).removeAttr("href").bind("vclick",c),b.bind("destroyed",function(){a.unbind("vclick",c)})},a(document).bind("pagecreate create",function(b){a(a.tizen.popupwindow.prototype.options.initSelector,b.target).not(":jqmData(role='none'), :jqmData(role='nojs')").popupwindow(),a("a[href^='#']:jqmData(rel='popupwindow')",b.target).each(function(){a.tizen.popupwindow.bindPopupToButton(a(this),a(a(this).attr("href")))})})}(jQuery),function(a,b,c,d){function f(a,b){a.tizen||(a.tizen={}),a.tizen.frameworkData=b.frameworkData,a.tizen.loadCustomGlobalizeCulture=b.loadCustomGlobalizeCulture,a.tizen.loadTheme=b.loadTheme,a.tizen.__tizen__=b}var e={libFileName:"tizen-web-ui-fw(.min)?.js",frameworkData:{rootDir:"/usr/lib/tizen-web-ui-fw",version:"0.1",theme:"tizen-white",viewportWidth:"device-width",viewportScale:!1,defaultFontSize:22,minified:!1,debug:!1},log:{debug:function(a){e.frameworkData.debug&&console.log(a)},warn:function(a){console.warn(a)},error:function(a){console.error(a)},alert:function(a){c.alert(a)}},util:{loadScriptSync:function(b,c,d){a.ajax({url:b,dataType:"script",async:!1,crossDomain:!1,success:c,error:function(c,f,g){if(d)d(c,f,g);else{var h=[404],i="Error while loading "+b+"\n"+c.status+":"+c.statusText;-1==a.inArray(c.status,h)?e.log.alert(i):e.log.warn(i)}}})},isMobileBrowser:function(){var a=c.navigator.appVersion.indexOf("Mobile"),b=-1<a;return b}},css:{cacheBust:document.location.href.match(/debug=true/)?"?cacheBust="+(new Date).getTime():"",addElementToHead:function(b){var c=document.getElementsByTagName("head")[0];c&&a(c).prepend(b)},makeLink:function(a){var b=document.createElement("link");return b.setAttribute("rel","stylesheet"),b.setAttribute("href",a),b.setAttribute("name","tizen-theme"),b},load:function(a){var b=document.getElementsByTagName("head")[0],c=b.getElementsByTagName("link"),d,f=null;for(d=0;d<c.length;d++){if(c[d].getAttribute("rel")!="stylesheet")continue;if(c[d].getAttribute("name")=="tizen-theme"||c[d].getAttribute("href")==a){f=c[d];break}}f?f.getAttribute("href")==a?e.log.warn("Theme is already loaded. Skip theme loading in the framework."):f.setAttribute("href",a):this.addElementToHead(this.makeLink(a))}},getParams:function(){function j(){var a=navigator.theme?navigator.theme.split(":")[0]:null;return a&&(a=a.replace("-hd",""),a.match(/^tizen-/)||(a="tizen-"+a)),a}var a=document.getElementsByTagName("script"),b=null,c=!1,e,f,g,h,i;for(e in a){f=a[e],g=f.src?f.getAttribute("src"):d;if(g&&g.match(this.libFileName)){h=g.split(/[\/\\]/),i=-3,this.frameworkData.rootDir=(f.getAttribute("data-framework-root")||h.slice(0,h.length+i).join("/")||this.frameworkData.rootDir).replace(/^file:(\/\/)?/,""),this.frameworkData.version=f.getAttribute("data-framework-version")||h[h.length+i]||this.frameworkData.version,this.frameworkData.theme=f.getAttribute("data-framework-theme")||j()||this.frameworkData.theme,this.frameworkData.viewportWidth=f.getAttribute("data-framework-viewport-width")||this.frameworkData.viewportWidth,this.frameworkData.viewportScale="true"===f.getAttribute("data-framework-viewport-scale")?!0:this.frameworkData.viewportScale,this.frameworkData.minified=g.search(/\.min\.js$/)>-1?!0:!1,this.frameworkData.debug="true"===f.getAttribute("data-framework-debug")?!0:this.frameworkData.debug,c=!0;break}}return c},loadTheme:function(a){var b,c,d;a||(a=e.frameworkData.theme),b=[e.frameworkData.rootDir,e.frameworkData.version,"themes",a].join("/"),d=[b,"theme.js"].join("/"),e.frameworkData.minified?c=[b,"tizen-web-ui-fw-theme.min.css"].join("/"):c=[b,"tizen-web-ui-fw-theme.css"].join("/"),e.css.load(c),e.util.loadScriptSync(d)},loadGlobalizeCulture:function(b,d){function j(b){var d=b||a("html").attr("lang")||c.navigator.language.split(".")[0]||c.navigator.userLanguage||"en",e=null,f=d.lastIndexOf("-"),g=["Cyrl","Latn","Mong"];return f!=-1&&(e=d.substr(f+1),g.join("-").indexOf(e)<0&&(d=[d.substr(0,f),e.toUpperCase()].join("-"))),d=d=="en"?"en-US":d,d}function k(a){var b=a.lastIndexOf("-"),c;return b!=-1&&(c=a.substr(0,b)),c}function l(a,b){var c=null;return"string"!=typeof a?null:(b&&b[a]?c=b[a]:c=[f.frameworkData.rootDir,f.frameworkData.version,"js","cultures",["globalize.culture.",a,".js"].join("")].join("/"),c)}function m(a,b){e.log.error("Error "+b.status+": "+b.statusText+"::Culture file ("+a+") is failed to load.")}function n(b,c){function d(){e.log.debug("Culture file ("+b+") is loaded successfully.")}function f(a,d,e){c?c(a,d,e):m(b,a)}b?a.ajax({url:b,dataType:"script",cache:!0,async:!1,success:d,error:f}):(i={status:404,statusText:"Not Found"},f(i,null,null))}var f=this,g,h,i;return h=j(b),g=l(h,d),n(g,function(a,b,c){if(a.status==404){var e=k(h),f=l(e,d);n(f,null)}else m(g,a)}),h},setGlobalize:function(){var a=this.loadGlobalizeCulture();b.culture(a)},loadCustomGlobalizeCulture:function(a){e.loadGlobalizeCulture(null,a)},setViewport:function(b){var c=null,d,f;return a("meta[name=viewport]").each(function(){c=this;return}),c?(f=a(c).prop("content"),b=f.replace(/.*width=(device-width|\d+)\s*,?.*$/gi,"$1"),e.log.warn("Viewport is set to '"+b+"' in a meta tag. Framework skips viewport setting.")):(c=document.createElement("meta"),c&&(c.name="viewport",f=["width=",b,", user-scalable=no"].join(""),!!isNaN(b),c.content=f,e.log.debug(f),d=document.getElementsByTagName("head").item(0),d.insertBefore(c,d.firstChild))),b},scaleBaseFontSize:function(b,c){e.log.debug("themedefaultfont size: "+b+", ratio: "+c);var d=Math.max(Math.floor(b*c),4);a("html.ui-mobile").css({"font-size":d+"px"}),e.log.debug("html:font size is set to "+d),a(document).ready(function(){a(".ui-mobile").children("body").css({"font-size":d+"px"})})},setScaling:function(){var b=this.frameworkData.viewportWidth,c=this.frameworkData.defaultFontSize,d=1;a("body").attr("data-tizen-theme-default-font-size",c);if(!e.util.isMobileBrowser())return;this.frameworkData.viewportScale==1&&(b="screen-width"),"screen-width"==b&&(b=document.documentElement.clientWidth),b=this.setViewport(b),isNaN(b)?document.documentElement.clientWidth<this.frameworkData.defaultViewportWidth&&(d=parseFloat(document.documentElement.clientWidth/this.frameworkData.defaultViewportWidth)):d=parseFloat(b/this.frameworkData.defaultViewportWidth),this.scaleBaseFontSize(c,d)}};f(a,e),e.getParams(),e.loadTheme(),e.setScaling(),e.setGlobalize(),a.mobile.autoInitializePage=!1,a(document).ready(function(){a.mobile.initializePage()})}(jQuery,window.Globalize,window),function(a,b,c,d){function m(){this.vertices=[-1,-1,0,1,-1,0,1,1,0,-1,1,0],this.textureCoords=[1,0,0,0,0,1,1,1],this.normalVectors=[0,0,1,0,0,1,0,0,1,0,0,1],this.texture=null,this.textureBuffer=null,this.textureBufferItemSize=0,this.mashOrder=[],this.mvMatrix=null,this.level=-1,this.targetLevel=0,this.drawable=!1,this.image=null,this.imageID=0}c.requestAnimationFrame=function(){return function(a){var b=c.setTimeout(a,1e3/60);return b}}(),c.cancelAnimationFrame=function(){return function(a){c.clearTimeout(a)}}();var e=c.vec3,f=c.mat3,g=c.mat4,h=typeof c.Float32Array!="undefined"?c.Float32Array:typeof c.WebGLFloatArray!="undefined"?c.WebGLFloatArray:Array,i=typeof c.Uint16Array!="undefined"?c.Uint16Array:Array,j=function(a){var b,d,e=["experimental-webgl","webkit-3d","webgl","moz-webgl"];for(d=0;d<e.length;d+=1)try{b=a.getContext(e[d]);if(b)break}catch(f){c.alert("Unfortunately, there's a WebGL compatibility problem. </br> You may want to check your system settings.");return}return b},k=["attribute vec3 aVertexPosition;","attribute vec2 aTextureCoord;","attribute vec3 aVertexNormal;","uniform mat4 uMoveMatrix;","uniform mat4 uPerspectiveMatrix;","uniform mat3 nNormalMatrix;","uniform vec3 uAmbientColor;","uniform vec3 uLightDirection;","uniform vec3 uDirectionColor;","uniform vec3 uLightDirection_first;","uniform vec3 uLightDirection_second;","varying vec2 vTextureCoord;","varying vec3 vLightWeight;","varying vec4 vFogWeight;","void main(void) {","\tvec4 v_Position = uMoveMatrix * vec4(aVertexPosition, 1.0);","\tgl_Position = uPerspectiveMatrix * v_Position;","\tvTextureCoord = aTextureCoord;","\tfloat fog = 1.0 - ((gl_Position.z + 1.5) / 60.0);","\tvFogWeight = clamp( vec4( fog, fog, fog, 1.0), 0.0, 1.0);","\tvec3 transNormalVector = nNormalMatrix * aVertexNormal;","\tfloat vLightWeightFirst = 0.0;","\tfloat vLightWeightSecond = max( dot(transNormalVector, uLightDirection_second), 0.0 );","\tvLightWeight = uAmbientColor + uDirectionColor * vLightWeightSecond;","}"].join("\n"),l=["precision mediump float;","varying vec2 vTextureCoord;","varying vec3 vLightWeight;","uniform sampler2D uSampler;","varying vec4 vFogWeight;","void main(void) {","\tvec4 TextureColor = (texture2D(uSampler, vec2(vTextureCoord.s, vTextureCoord.t))) * vFogWeight;","\tgl_FragColor = vec4(TextureColor.rgb * vLightWeight, TextureColor.a);","}"].join("\n");a.widget("tizen.gallery3d",a.mobile.widget,{options:{thumbnailCache:!1},_MAX_ITEM_COUNT:28,_ANIMATION_END:999,_DURATION_DEFAULT:300,_DURATION_FIRST:1600,_VIEWPORT_WIDTH:1024,_VIEWPORT_HEIGHT:456,_DIRECTION_LEFT:-1,_DIRECTION_RIGHT:1,_gl:null,_shaderProgram:null,_positionBuffer:null,_textureCoordBuffer:null,_normalVectorBuffer:null,_nodes:null,_pMatrix:null,_animationID:0,_dragInterval:0,_startTime:0,_sumTime:0,_lightsPositionStack:[[0,0,-1],[-0.2,0,.7]],_path:null,_swipeThresholdOfBasetimeGap:a.support.touch?30:70,_swipeThresholdOfSensitivity:a.support.touch?2:10,_canvas:null,_imageList:[],_maxDrawLength:0,_firstImageNumber:0,_lastImageNumber:0,_create:function(){var b=this,c=b.element,e=b.options;b._canvas=a("<canvas class='ui-gallery3d-canvas'></canvas>"),c.addClass("ui-gallery3d").append(b._canvas),b._addBehavier(),b._dragInterval=1e3/30,a.each(b.options,function(a,c){b.options[a]=d,b._setOption(a,c)})},_setOption:function(b,c){switch(b){case"thumbnailCache":typeof c=="string"?c=c==="true"?!0:!1:c=!!c,this._reset()}a.mobile.widget.prototype._setOption.call(this,b,c)},_init:function(b){var c=this,d=[[40,0,-48],[-12,0,-40],[24,0,-9],[-5,0,-5]],e;b=b||c._canvas;if(!b)return;c._gl=c._gl||c._initGL(b[0]);if(!c._gl)return;if(!c._imageList)return;c._shaderProgram=c._shaderProgram||c._initShader(c._gl);if(!c._shaderProgram)return;c._imageList.length>c._MAX_ITEM_COUNT&&(c._firstImageNumber=c._imageList.length-1,c._lastImageNumber=c._MAX_ITEM_COUNT-1),c._nodes=c._initBuffers(c._gl,c._shaderProgram),c._initTextures(c._gl,c._nodes),c._path=a.motionpath("bspline",{points:d,maxLevel:c._MAX_ITEM_COUNT});for(e=0;e<c._nodes.length;e+=1)c._path.levels[e]=c._path.levels[e+1]||0,c._nodes[e].level=e},_final:function(b){var c=this,d=c._gl;if(!d)return;b=b||c._canvas,a(c._nodes).each(function(a){var b=c._nodes[a];d.deleteTexture(b.texture),b.texture=null}),c._nodes=null,d.deleteBuffer(c._positionBuffer),c._positionBuffer=null,d.deleteBuffer(c._textureCoordBuffer),c._textureCoordBuffer=null,d.deleteBuffer(c._normalVectorBuffer),c._normalVectorBuffer=null,a.webgl.shader.deleteShaders(d),d.deleteProgram(c._shaderProgram),c._shaderProgram=null,c._gl=d=null},_addBehavier:function(){var d=this,e=d.element,f=d._canvas,g=a.support.touch?"touchstart":"mousedown",h=(a.support.touch?"touchmove":"mousemove")+".gallery3d",i=(a.support.touch?"touchend":"mouseup")+".gallery3d",j=(a.support.touch?"touchleave":"mouseout")+".gallery3d";a(b).unbind(".gallery3d").bind("pagechange.gallery3d",function(b){a(b.target).find(".ui-gallery3d").gallery3d("refresh")}).bind("pageremove.gallery3d",function(b){a(b.target).find(".ui-gallery3d").trigger("_destory")}),a(c).unbind(".gallery3d").bind("resize.gallery3d orientationchange.gallery3d",function(b){a(".ui-page-active").find(".ui-gallery3d").gallery3d("refresh")}).bind("unload.gallery3d",function(b){a(b.target).find(".ui-gallery3d").trigger("_destory")}),e.bind("_destory",function(a){d._final()}),f.bind("webglcontextlost",function(a){a.preventDefault()}).bind("webglcontextrestored",function(a){d._init()}).bind(g,function(b){var c=0,f=0,g=20,k=[g],l=[g],m=0,n=0,o=!1,p=0;b.preventDefault(),b.stopPropagation();if(d._imageList.length<=1)return;d._stop(),f=a.support.touch?b.originalEvent.changedTouches[0].pageX:b.pageX,p=a.now();for(c=0;c<g;c+=1)k[c]=f,l[c]=a.now();m+=1,e.bind(h,function(b){var c,e,h;b.preventDefault(),b.stopPropagation(),c=a.support.touch?b.originalEvent.changedTouches[0].pageX:b.pageX,e=f-c,k[m]=c,l[m]=a.now(),h=l[m]-p,m=(m+1)%g,Math.abs(e)>=10&&h>=d._dragInterval&&(o!==(e<0?d._DIRECTION_RIGHT:d._DIRECTION_LEFT)&&(n=0,o=e<0?d._DIRECTION_RIGHT:d._DIRECTION_LEFT),n+=Math.abs(e)/100,n>=1?(d._setPosition(d._ANIMATION_END,o),n=0):d._setPosition(n,o),d._drawScene(),f=c,p=a.now())}).bind(i,function(b){var h=0,i=-1,j=0,p=0,q=0,r=0,s=0,t=0,u=0,v=!0,w;b.preventDefault(),b.stopPropagation(),h=a.now()-d._swipeThresholdOfBasetimeGap,s=a.support.touch?b.originalEvent.changedTouches[0].pageX:b.pageX,u=f-s,f=0;for(c=0;c<g;c+=1){j=(m+c)%g;if(l[j]>h){i=j;break}}i<0&&(v=!1);if(v){p=i;for(c=0;c<g;c+=1){p=(p-1+g)%g;if(l[p]<l[i])break}if(c===g||h<l[p])v=!1}v&&(q=(h-l[p])/(l[i]-l[p]),r=(1-q)*k[p]+q*k[i],Math.abs(r-s)<d._swipeThresholdOfSensitivity&&(r=s),t=parseInt((s-r)/(a.now()-h),10)),v&&t?(w=t<0?d._DIRECTION_LEFT:d._DIRECTION_RIGHT,d._run(w,Math.abs(t),n)):o!==0&&n&&d._animate(null,d._DURATION_DEFAULT*(1-n),o,0,n),e.unbind(".gallery3d")}).bind(j,function(a){e.trigger(i)})})},_loadData:function(b,c){var d=this;a.ajax({async:!1,url:b,dataType:"json",success:function(b){d._imageList=a.extend([],b[c])}})},_initGL:function(a){var b=this,d;return d=j(a),d?(d.enable(d.BLEND),d.blendFunc(d.SRC_ALPHA,d.ONE_MINUS_SRC_ALPHA),d.enable(d.DEPTH_TEST),d.depthFunc(d.LEQUAL),a.width=b._VIEWPORT_WIDTH,a.height=b._VIEWPORT_HEIGHT,d.viewportWidth=a.width,d.viewportHeight=a.height,d.viewport(0,0,d.viewportWidth,d.viewportHeight),b._pMatrix=g.create(),g.perspective(40,d.viewportWidth/d.viewportHeight,.1,1e4,b._pMatrix),d.clearColor(0,0,0,1),d.clear(d.COLOR_BUFFER_BIT|d.DEPTH_BUFFER_BIT),d):(c.alert("There's no WebGL context available!!!"),null)},_initShader:function(b){var c=this,d;return d=a.webgl.shader.addShaderProgram(c._gl,k,l),b.useProgram(d),d.vertexPositionAttr=b.getAttribLocation(d,"aVertexPosition"),b.enableVertexAttribArray(d.vertexPositionAttr),d.textureCoordAttr=b.getAttribLocation(d,"aTextureCoord"),b.enableVertexAttribArray(d.textureCoordAttr),d.vertexNormalAttr=b.getAttribLocation(d,"aVertexNormal"),b.enableVertexAttribArray(d.vertexNormalAttr),d.perspectiveMU=b.getUniformLocation(d,"uPerspectiveMatrix"),d.transformMU=b.getUniformLocation(d,"uMoveMatrix"),d.sampleUniform=b.getUniformLocation(d,"uSampler"),d.normalMU=b.getUniformLocation(d,"nNormalMatrix"),d.ambientColorU=b.getUniformLocation(d,"uAmbientColor"),d.lightDirU_first=b.getUniformLocation(d,"uLightDirection_first"),d.lightDirU_second=b.getUniformLocation(d,"uLightDirection_second"),d.directionColorU=b.getUniformLocation(d,"uDirectionColor"),d},_initBuffers:function(b,c){var d=this,e=0,f=0,g=[],j=[],k=[],l=[],n=d._MAX_ITEM_COUNT;for(e=0;e<d._imageList.length+1;e+=1)l[e]=new m,a.merge(g,l[e].vertices),a.merge(j,l[e].textureCoords),a.merge(k,l[e].normalVectors),l[e].textureBuffer=b.createBuffer(),b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,l[e].textureBuffer),f=e*4,l[e].meshOrder=[f,f+1,f+2,f+2,f+3,f],b.bufferData(b.ELEMENT_ARRAY_BUFFER,new i(l[e].meshOrder),b.STATIC_DRAW),b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,null),l[e].textureBufferItemSize=6;return d._positionBuffer=a.webgl.buffer.attribBufferData(b,new h(g)),d._positionBuffer.itemSize=3,d._textureCoordBuffer=a.webgl.buffer.attribBufferData(b,new h(j)),d._textureCoordBuffer.itemSize=2,d._normalVectorBuffer=a.webgl.buffer.attribBufferData(b,new h(k)),d._normalVectorBuffer.itemSize=3,b.uniform3f(c.ambientColorU,.1,.1,.1),b.uniform3f(c.directionColorU,1,1,1),l},_initTextures:function(b,c){var d=this;a(c).each(function(a){var e=c[a],f;if(!d._imageList[a])return!1;f=d._imageList[a].src,e.texture=b.createTexture(),d._loadImage(f,a,a,b,c)})},_loadImage:function(b,c,d,e,f){var g=this,h=!1,i,j;e=e||g._gl,f=f||g._nodes,h=h||!1,j=f[c],j.image=j.image||new Image,a(j.image).one("load",function(a){g._bindTexture(e,j,this,h),j.imageID=d,g._animationID||g._setPosition(0,0)}),g.options.thumbnailCache?a.imageloader.getThumbnail(b,function(c){c==="NOT_FOUND_ERR"?a.imageloader.setThumbnail(b,function(a){a&&a.length>30?(j.image.src=a,h=!0):j.image.src=b}):c&&c.length>30?(j.image.src=c,h=!0):j.image.src=b}):j.image.src=b},_bindTexture:function(a,b,c,d){if(!b||!b.texture)return;a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!0),a.bindTexture(a.TEXTURE_2D,b.texture),a.texImage2D(a.TEXTURE_2D,0,a.RGBA,a.RGBA,a.UNSIGNED_BYTE,c),d?(a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,a.LINEAR),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,a.LINEAR_MIPMAP_NEAREST),a.generateMipmap(a.TEXTURE_2D)):(a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,a.LINEAR),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,a.LINEAR)),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,a.CLAMP_TO_EDGE),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,a.CLAMP_TO_EDGE),b.texture.loaded=!0,a.bindTexture(a.TEXTURE_2D,null)},_setPosition:function(a,b){var c=this,d=c._nodes,e=c._imageList,f=e.length,h=c._MAX_ITEM_COUNT,i=f>h?h:f,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=c._path,s=0;j=b>=0?i+1:i,d[k].level||(d[k].level=i);for(k=0;k<i;k+=1)d[k].mvMatrix||(d[k].mvMatrix=g.create()),b>0&&d[k].level>=i&&(d[k].level=0),o=r.levels[d[k].level],q=(d[k].level+j+b)%j,p=r.levels[q],f>h&&(b>0&&q===1&&c._firstImageNumber!==d[k].imageID?c._loadImage(e[c._firstImageNumber].src,k,c._firstImageNumber):b<0&&q===j-1&&c._lastImageNumber!==d[k].imageID&&c._loadImage(e[c._lastImageNumber].src,k,c._lastImageNumber)),g.identity(d[k].mvMatrix),g.translate(d[k].mvMatrix,[-2,-2,1]),g.rotate(d[k].mvMatrix,c._degreeToRadian(19),[1,0,0]),l=o+(p-o)*(a>1?1:a),a>=c._ANIMATION_END&&(d[k].level=q||i,l=r.levels[d[k].level]),a<c._ANIMATION_END&&b<=0&&d[k].level<1?d[k].drawable=!1:d[k].drawable=!0,a===c._ANIMATION_END&&d[k].level===1&&c.element.trigger("select",e[d[k].imageID],d[k].imageID),m=r.getPosition(l),n=r.getAngle(l),g.translate(d[k].mvMatrix,m),g.rotate(d[k].mvMatrix,n,[0,1,0]);f>h&&a>=c._ANIMATION_END&&(c._firstImageNumber=(c._firstImageNumber-b)%f,c._firstImageNumber<0&&(c._firstImageNumber=f-1),c._lastImageNumber=(c._lastImageNumber-b)%f,c._lastImageNumber<0&&(c._lastImageNumber=f-1)),c._drawScene()},_drawScene:function(){if(!this._gl||!this._shaderProgram)return;var a=this,b=a._gl,c=a._shaderProgram,d=a._nodes,e=d.length,f;b.clear(b.COLOR_BUFFER_BIT|b.DEPTH_BUFFER_BIT),b.bindBuffer(b.ARRAY_BUFFER,a._positionBuffer),b.vertexAttribPointer(c.vertexPositionAttr,a._positionBuffer.itemSize,b.FLOAT,!1,0,0),b.bindBuffer(b.ARRAY_BUFFER,a._textureCoordBuffer),b.vertexAttribPointer(c.textureCoordAttr,a._textureCoordBuffer.itemSize,b.FLOAT,!1,0,0),b.bindBuffer(b.ARRAY_BUFFER,a._normalVectorBuffer),b.vertexAttribPointer(c.vertexNormalAttr,a._normalVectorBuffer.itemSize,b.FLOAT,!1,0,0);for(f=0;f<e;f+=1)d[f].drawable&&a._drawElement(a._pMatrix,d[f])},_drawElement:function(a,b){var c=this,d=c._gl,h=c._shaderProgram,i=b.mvMatrix,j=b.texture,k=b.textureBuffer,l=b.textureBufferItemSize,m=c._lightsPositionStack,n,o;if(!i)return;d.activeTexture(d.TEXTURE0),j&&j.loaded&&d.bindTexture(d.TEXTURE_2D,j),d.uniform1i(h.sampleUniform,0),n=e.create(),e.normalize(m[0],n),e.scale(n,-8),d.uniform3fv(h.lightDirU_first,n),e.normalize(m[1],n),e.scale(n,-1),d.uniform3fv(h.lightDirU_second,n),d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,k),d.uniformMatrix4fv(h.perspectiveMU,!1,a),d.uniformMatrix4fv(h.transformMU,!1,i),o=f.create(),g.toInverseMat3(i,o),f.transpose(o),d.uniformMatrix3fv(h.normalMU,!1,o),d.drawElements(d.TRIANGLES,l,d.UNSIGNED_SHORT,0),d.bindBuffer(d.ARRAY_BUFFER,null),d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,null),d.bindTexture(d.TEXTURE_2D,null)},_animate:function(b,d,e,f,g,h){var i=this,j=a.now(),k,l=0;b=b||"linear",g=g||0,h=h||0;if(i._sumTime>=d){i._setPosition(i._ANIMATION_END,e),i._stop();return}if(i._startTime===0)i._startTime=j;else{i._sumTime=j-i._startTime,k=a.easing[b](i._sumTime/d,i._sumTime,g,f+1,d),l=parseInt(Math.abs(k),10);if(h!==l){i._setPosition(i._ANIMATION_END,e),h=l,f-h>=0?i._animate(b,d,e,f,g,h):i._stop();return}i._setPosition(k-h,e)}i._animationID=c.requestAnimationFrame(function(){i._animate(b,d,e,f,g,h)})},_run:function(a,b,c){var d=this,e=b||0,f=d._DURATION_DEFAULT*(e+1);if(d._imageList.length<=1)return;c=c||0,f=f>=0?f:0,d._animationID&&(d._setPosition(d._ANIMATION_END,a),d._stop()),d._animate("easeOutExpo",f,a,e,c)},_reset:function(){if(!this._canvas||!this._gl)return;this._final(),this._init(),this.refresh()},_stop:function(){this._animationID&&c.cancelAnimationFrame(this._animationID),this._animationID=0,this._startTime=0,this._sumTime=0},_degreeToRadian:function(a){return a*Math.PI/180},next:function(){this._run(this._DIRECTION_LEFT,0)},prev:function(){this._run(this._DIRECTION_RIGHT,0)},refresh:function(){var a=this.element,b=a.find("canvas.ui-gallery3d-canvas");b.width()!==a.width()&&b.width(a.width()),this._animationID||this._setPosition(0,0)},select:function(a){var b=this._nodes,c,d,e,f=null,g=0,h=0;a&&this._animationID&&this._stop();for(d in b)if(b[d].level===1){f=this._imageList[b[d].imageID],e=b[d].imageID;break}if(!a)return f;if(a<0&&a>=this._imageList.length)return;g=a-e,h=g>0?this._DIRECTION_LEFT:g<0?this._DIRECTION_RIGHT:0,h&&this._run(h,Math.abs(g)-1)},add:function(a,b){if(!a)return;typeof a=="string"&&(a={src:a}),b=b||0;if(typeof b!="number"&&b<0&&b>=this._imageList.length)return;this._imageList.splice(b,0,a),this._gl&&this._reset()},remove:function(a){a=a||0;if(typeof a!="number"&&a<0&&a>=this._imageList.length)return;this._imageList.splice(a,1),this._gl&&this._reset()},clearThumbnailCache:function(){if(!this._nodes||this._nodes.length<=0)return;var b,c;for(b=0;b<this._imageList.length;b+=1)c=this._imageList[b].src,a.imageloader.removeThumbnail(c)},empty:function(){this._imageList=[],this._reset()},length:function(){return this._imageList.length}}),a(b).bind("pagecreate create",function(b){a(":jqmData(role='gallery3d')").gallery3d()})}(jQuery,document,window),function(a,b){a.widget("tizen.notification",a.mobile.widget,{btn:null,text_bg:[],icon_img:[],interval:null,seconds:null,running:!1,_get_text:function(){var b=new Array(2);return this.type==="ticker"?(b[0]=a(this.text_bg[0]).text(),b[1]=a(this.text_bg[1]).text
+()):b[0]=a(this.text_bg[0]).text(),b},_set_text:function(b,c){var d=function(a,b){if(!b)return;a.text(b)};this.type==="ticker"?(d(a(this.text_bg[0]),b),d(a(this.text_bg[1]),c)):d(a(this.text_bg[0]),b)},text:function(a,b){if(a===undefined&&b===undefined)return this._get_text();this._set_text(a,b)},icon:function(b){if(b===undefined)return;this.icon_img.detach(),this.icon_img=a("<img src='"+b+"' class='ui-ticker-icon'>"),a(this.element).find(".ui-ticker").append(this.icon_img)},_refresh:function(){var b=this._get_container();a(b).addClass("fix").removeClass("show").removeClass("hide"),this._set_interval()},open:function(){var b=this._get_container();if(this.running){this._refresh();return}a(b).addClass("show").removeClass("hide").removeClass("fix"),this.running=!0,this.type==="popup"&&this._set_position(),this._set_interval()},close:function(){var b=this._get_container();if(!this.running)return;a(b).addClass("hide").removeClass("show").removeClass("fix"),this.running=!1,clearInterval(this.interval)},destroy:function(){var b=this._get_container();a(b).removeClass("show").removeClass("hide").removeClass("fix"),this._del_event(),this.running=!1},_get_container:function(){return this.type==="ticker"?a(this.element).find(".ui-ticker"):a(this.element).find(".ui-smallpopup")},_set_interval:function(){var a=this;clearInterval(this.interval),this.seconds!==undefined&&this.second!==0&&(this.interval=setInterval(function(){a.close()},this.seconds))},_add_event:function(){var a=this,b=this._get_container();this.type==="ticker"&&(b.find(".ui-ticker-btn").append(this.btn).trigger("create"),this.btn.bind("vmouseup",function(){a.close()})),b.bind("vmouseup",function(){a.close()})},_del_event:function(){var a=this._get_container();this.type==="ticker"&&this.btn.unbind("vmouseup"),a.unbind("vmouseup"),clearInterval(this.interval)},_set_position:function(){var b=this._get_container(),c=a(".ui-page-active").children(".ui-footer"),d=c.outerHeight()||0;b.css("bottom",d)},_create:function(){var c=this,d=a(this.element),e;this.btn=a('<div data-role="button" data-inline="true">Close</div>'),this.seconds=d.jqmData("interval"),this.type=d.jqmData("type")||"popup";if(this.type==="ticker"){d.wrapInner("<div class='ui-ticker'></div>"),d.find(".ui-ticker").append("<div class='ui-ticker-body'></div><div class='ui-ticker-btn'></div>"),this.text_bg=d.find("p");if(this.text_bg.length<2)d.find(".ui-ticker").append("<p></p><p></p>"),this.text_bg=d.find("p");else if(this.text_bg.length>2)for(e=2;e<this.text_bg.length;e++)a(this.text_bg[e]).css("display","none");a(this.text_bg[0]).addClass("ui-ticker-text1-bg"),a(this.text_bg[1]).addClass("ui-ticker-text2-bg"),this.icon_img=d.find("img");if(this.icon_img.length){a(this.icon_img).addClass("ui-ticker-icon");for(e=1;e<this.icon_img.length;e++)a(this.icon_img[e]).css("display","none")}}else{d.wrapInner("<div class='ui-smallpopup'></div>"),this.text_bg=d.find("p").addClass("ui-smallpopup-text-bg");if(this.text_bg.length<1)d.find(".ui-smallpopup").append("<p class='ui-smallpopup-text-bg'></p>"),this.text_bg=d.find("p");else if(this.text_bg.length>1)for(e=1;e<this.text_bg.length;e++)a(this.text_bg[e]).css("display","none");this._set_position()}this._add_event(),a(b).bind("resize",function(){if(!c.running)return;c._refresh(),c.type==="popup"&&c._set_position()})}}),a(document).bind("pagecreate create",function(b){a(b.target).find(":jqmData(role='notification')").notification()}),a(document).bind("pagebeforehide",function(b){a(b.target).find(":jqmData(role='notification')").notification("destroy")})}(jQuery,this),function(a){a.widget("tizen.swipe",a.mobile.widget,{options:{theme:null},_create:function(){var a=this.element.jqmData("theme")||this.options.theme||this.element.parent().jqmData("theme")||"s";this.options.theme=a,this._isopen=!1,this.refresh()},refresh:function(){this._cleanupDom();var b=this,c,d,e,f,g;c="ui-body-"+this.options.theme,this.element.parent().hasClass("ui-listview")||this.element.parent().listview(),this.element.addClass("ui-swipe"),d=this.element.find(':jqmData(role="swipe-item-cover")'),f=this.element.find(':jqmData(role="swipe-item")'),this._covers=d,this._item=f,f.addClass("ui-swipe-item"),e=c,g=f.parent().attr("class").match(/ui\-body\-[a-z]|ui\-bar\-[a-z]/),d.each(function(){var c=a(this);g&&(e=g[0]),c.addClass("ui-swipe-item-cover"),c.addClass(e),c.has(".ui-swipe-item-cover-inner").length===0&&c.wrapInner(a("<span/>").addClass("ui-swipe-item-cover-inner"));if(!c.data("animateRight")||!c.data("animateLeft"))c.data("animateRight",function(){b._animateCover(c,110,f)}),c.data("animateLeft",function(){b._animateCover(c,0,f)});f.bind("swipeleft",c.data("animateLeft")),c.bind("swiperight",c.data("animateRight")),f.find(".ui-btn").bind("vclick",c.data("animateLeft"))})},_cleanupDom:function(){var a=this,b,c,d=b,e,f,g,h,i;b="ui-body-"+this.options.theme,this.element.removeClass("ui-swipe"),c=this.element.find(':jqmData(role="swipe-item-cover")'),e=this.element.find(':jqmData(role="swipe-item")'),e.removeClass("ui-swipe-item"),c.removeClass("ui-swipe-item-cover"),f=e.attr("class"),g=f&&f.match(/ui\-body\-[a-z]|ui\-bar\-[a-z]/),g&&(d=g[0]),c.removeClass(d),i=c.find(".ui-swipe-item-cover-inner"),i.children().unwrap(),h=i.text(),h&&(c.append(h),i.remove()),c.data("animateRight")&&c.data("animateLeft")&&(c.unbind("swiperight",c.data("animateRight")),e.unbind("swipeleft",c.data("animateLeft")),e.find(".ui-btn").unbind("vclick",c.data("animateLeft")),c.data("animateRight",null),c.data("animateLeft",null))},_animateCover:function(b,c,d){var e=this,f={easing:"linear",duration:"normal",queue:!0,complete:function(){b.trigger("animationend")}};a(this.element.parent()).find(":jqmData(role='swipe')").each(function(){this!==e.element.get(0)&&a(this).swipe("opened")&&a(this).swipe("close")}),c==110?this._isopen=!0:this._isopen=!1,b.stop(),b.clearQueue(),b.trigger("animationstart"),b.animate({left:c+"%"},f),c==0?d.animate({opacity:0},"slow"):d.animate({opacity:1},"slow")},destroy:function(){this._cleanupDom()},open:function(){var b=this;a(b._covers).each(function(){var c=a(this);b._animateCover(c,110,b._item)})},opened:function(){return this._isopen},close:function(){var b=this;a(b._covers).each(function(){var c=a(this);b._animateCover(c,0,b._item)})}}),a(document).bind("pagecreate",function(b){a(b.target).find(":jqmData(role='swipe')").swipe()})}(jQuery),function(a,b,c){a.tizen.scrollview.prototype.options.handler=!1,a.tizen.scrollview.prototype.options.handlerTheme="s";var d=a.tizen.scrollview.prototype._setOption,e=function(d){var e=d,f='<div class="ui-handler ui-handler-direction-',g='"><div class="ui-handler-track"><div class="ui-handler-thumb"></div></div></div>',h=e.data("scrollview"),i=h.options,j=i.direction,k=a.mobile.getInheritedTheme(h,"s"),l=i.theme||k,m=h.options.direction==="x",n=h._$view,o=h._$clip,p=e.find(".ui-scrollbar"),q=null,r=null,s=0,t=0,u=0,v=0,w=0,x,y=a.support.touch,z=(y?"touchstart":"mousedown")+".handler",A=(y?"touchmove":"mousemove")+".handler",B=(y?"touchend":"mouseup")+".handler",C=(y?" touchleave":" mouseleave")+".handler",D=function(){t=m?o.width():o.height(),s=(m?n.width():n.height())-t,w=t-u-v*2},E=function(a){var b=Math.round((m?a.x:a.y)/s*w);r[0].style[m?"left":"top"]=b+"px"},F=function(){a(b).unbind(".handler"),e.moveData=null,n.trigger("scrollstop")};if(e.find(".ui-handler-thumb").length!==0||typeof j!="string")return;q=a([f,j,g].join("")).appendTo(e.addClass(" ui-handler-"+l)),r=e.find(".ui-handler-thumb").attr({tabindex:"0","aria-label":m?"Horizontal handler, double tap and move to scroll":"Verticalhandler, double tap and move to scroll"}).hide(),u=m?r.width():r.height(),v=m?parseInt(q.css("right"),10):parseInt(q.css("bottom"),10),a.extend(e,{moveData:null}),r.bind(z,{e:r[0]},function(c){h._stopMScroll();var d=c.data.e,f=y?c.originalEvent.targetTouches[0]:c;d.style.opacity=1,e.moveData={target:d,X:parseInt(d.style.left,10)||0,Y:parseInt(d.style.top,10)||0,pX:f.pageX,pY:f.pageY},D(),n.trigger("scrollstart"),y||c.preventDefault(),a(b).bind(A,function(a){var b=e.moveData,c=b.target,d=0,f=0,g=y?a.originalEvent.targetTouches[0]:a;d=m?b.X+g.pageX-b.pX:b.Y+g.pageY-b.pY,d<0&&(d=0),d>w&&(d=w),f=-Math.round(d/w*s),m?(h._setScrollPosition(f,0),c.style.left=d+"px"):(h._setScrollPosition(0,f),c.style.top=d+"px"),a.preventDefault()}).bind(B+C,function(a){F()})}),n.bind(B,function(a){F()}),e.bind("scrollstart",function(a){if(!h.enableHandler())return;D();if(s<0||t<u){p.is(":hidden")&&p.show();return}p.is(":visible")&&p.hide(),x&&(clearInterval(x),x=c),q.addClass("ui-handler-visible"),r.stop(!0,!0).fadeIn()}).bind("scrollupdate",function(a,b){if(!h.enableHandler()||s<0||t<u)return;E(h.getScrollPosition())}).bind("scrollstop",function(a){if(!h.enableHandler()||s<0||t<u)return;x=setInterval(function(){E(h.getScrollPosition()),h._gesture_timer||(clearInterval(x),x=c)},10),h._handlerTimer&&(clearTimeout(h._handlerTimer),h._handlerTimer=0),h._handlerTimer=setTimeout(function(){h._timerID===0&&e.moveData===null&&(r.stop(!0,!0).css("opacity",1).fadeOut(function(){q.removeClass("ui-handler-visible")}),h._handlerTimer=0)},1e3)}).bind("mousewheel",function(a){q.removeClass("ui-handler-visible"),E(h.getScrollPosition())})};a.extend(a.tizen.scrollview.prototype,{enableHandler:function(a){if(typeof a=="undefined")return this.options.handler;this.options.handler=!!a;var b=this.element;this.options.handler?(b.find(".ui-handler").length===0&&e(b),b.find(".ui-scrollbar").hide(),b.find(".ui-handler").show()):(b.find(".ui-handler").removeClass("ui-handler-visible").hide(),b.find(".ui-scrollbar").show())},_setHandlerTheme:function(a){if(!a)return;var b="ui-handler-"+this.options.handlerTheme,c="ui-handler-"+a;this.element.removeClass(b).addClass(c),this.options.handlerTheme=a},_setOption:function(a,b){switch(a){case"handler":this.enableHandler(b);break;case"handlerTheme":this._setHandlerTheme(b);break;default:d.call(this,a,b)}},_handlerTimer:0}),a(b).delegate(":jqmData(scroll)","scrollviewcreate",function(){var b=a(this);if(b.attr("data-"+a.mobile.ns+"scroll")==="none"||b.attr("data-"+a.mobile.ns+"handler")!=="true")return;b.scrollview("enableHandler","true")})}(jQuery,document),function(a,b){a.widget("mobile.pagelayout",a.mobile.widget,{options:{visibleOnPageShow:!0,disablePageZoom:!0,transition:"slide",fullscreen:!1,tapToggle:!0,tapToggleBlacklist:"a, input, select, textarea, .ui-header-fixed, .ui-footer-fixed",hideDuringFocus:"input, textarea, select",updatePagePadding:!0,supportBlacklist:function(){var a=window,c=navigator.userAgent,d=navigator.platform,e=c.match(/AppleWebKit\/([0-9]+)/),f=!!e&&e[1],g=c.match(/Fennec\/([0-9]+)/),h=!!g&&g[1],i=c.match(/Opera Mobi\/([0-9]+)/),j=!!i&&i[1];return(d.indexOf("iPhone")>-1||d.indexOf("iPad")>-1||d.indexOf("iPod")>-1)&&f&&f<534||a.operamini&&{}.toString.call(a.operamini)==="[object OperaMini]"||i&&j<7458||c.indexOf("Android")>-1&&f&&f<533||h&&h<6||window.palmGetResource!==b&&f&&f<534||c.indexOf("MeeGo")>-1&&c.indexOf("NokiaBrowser/8.5.0")>-1?!0:!1},initSelector:":jqmData(role='content')"},_create:function(){var a=this,b=a.options,c=a.element;if(b.supportBlacklist()){a.destroy();return}a._addFixedClass(),a._addTransitionClass(),a._bindPageEvents(),a._bindContentControlEvents()},_addFixedClass:function(){var a=this,b=a.options,c=a.element,d=c.siblings(":jqmData(role='header')"),e=c.siblings(":jqmData(role='footer')"),f=c.closest(".ui-page");d.addClass("ui-header-fixed"),e.addClass("ui-footer-fixed"),b.fullscreen?(d.addClass("ui-header-fullscreen"),e.addClass("ui-footer-fullscreen"),f.addClass("ui-page-header-fullscreen").addClass("ui-page-footer-fullscreen")):f.addClass("ui-page-header-fixed").addClass("ui-page-footer-fixed")},_addTransitionClass:function(){var a=this.options.transition;a&&a!=="none"&&(a==="slide"&&(a=this.element.is(".ui-header")?"slidedown":"slideup"),this.element.addClass(a))},setHeaderFooter:function(b){var c=a(b),d=c.find(":jqmData(role='header')").length?c.find(":jqmData(role='header')"):c.siblings(":jqmData(role='header')"),e=c.find(".ui-content"),f=c.find(":jqmData(role='footer')"),g=f.find(":jqmData(role='fieldcontain')"),h=f.find(".ui-controlgroup");c.is(".ui-dialog")||(d.jqmData("position")=="fixed"||a.support.scrollview&&a.tizen.frameworkData.theme.match(/tizen/)?d.css("position","fixed").css("top","0px"):!a.support.scrollview&&d.jqmData("position")!="fixed"&&d.css("position","relative")),d.find("span.ui-title-text-sub").length&&d.addClass("ui-title-multiline"),g.find("div").is(".ui-controlgroup-label")&&g.find("div.ui-controlgroup-label").remove();if(h.length){var i=100/h.find("a").length;h.find("a").each(function(a){h.find("a").eq(a).width(i+"%")})}},_bindPageEvents:function(){var b=this,c=b.options,d=b.element,e;d.closest(".ui-page").bind("pagebeforeshow",function(d){var e=this;c.disablePageZoom&&a.mobile.zoom.disable(!0),c.visibleOnPageShow||b.hide(!0),b.setHeaderFooter(e),b._setContentMinHeight(e)}).bind("webkitAnimationStart animationstart updatelayout",function(a,d){var e=this;c.updatePagePadding&&(b.updatePagePadding(e),b.updatePageLayout(e,d))}).bind("pageshow",function(d){var e=this;b._setContentMinHeight(e),b.updatePagePadding(e),b._updateHeaderArea(e),c.updatePagePadding&&a(window).bind("throttledresize."+b.widgetName,function(){b.updatePagePadding(e),b.updatePageLayout(e,!1),b._updateHeaderArea(e),b._setContentMinHeight(e)})}).bind("pagebeforehide",function(d,e){c.disablePageZoom&&a.mobile.zoom.enable(!0),c.updatePagePadding&&a(window).unbind("throttledresize."+b.widgetName)}),window.addEventListener("softkeyboardchange",function(b){var c=a("<div class='ui-btn-footer-down'></div>"),d=a(".ui-page-active"),e="footer";d.data("addBackBtn")&&(d.data("addBackBtn")=="header"?e="header":e="footer",b.state=="on"?(d.find(".ui-"+e+" .ui-btn-footer-down").length||(c.buttonMarkup({icon:"down"}).appendTo(d.find(".ui-"+e)),a(".ui-btn-footer-down").bind("vclick",function(){d.find("input").blur()})),a(".ui-page-active .ui-btn-back").remove()):b.state=="off"&&(d.page("addBackBtn",e),a(".ui-btn-footer-down").remove()))})},_bindContentControlEvents:function(){var a=this,b=a.options,c=a.element;c.closest(".ui-page").bind("pagebeforeshow",function(a){})},_setContentMinHeight:function(b){var c=a(b),d=c.find(":jqmData(role='header')"),e=c.find(":jqmData(role='footer')"),f=c.find(":jqmData(role='content')"),g;g=window.innerHeight-d.height()-e.height(),f.css("min-height",g-parseFloat(f.css("padding-top"))-parseFloat(f.css("padding-bottom"))+"px")},_updateHeaderArea:function(b){var c=a(b),d=c.find(":jqmData(role='header')").length?c.find(":jqmData(role='header')"):c.siblings(":jqmData(role='header')"),e=d.children("a").length,f=d.children("img").length;c.is(".ui-dialog")||d.find("h1").css("width",window.innerWidth-parseInt(d.find("h1").css("margin-left"),10)*2-d.children("a").width()*e-d.children("a").width()/4-d.children("img").width()*f*4)},_visible:!0,updatePagePadding:function(b){var c=this.element,d=c.siblings(".ui-header").length,e=c.siblings(".ui-footer").length;if(this.options.fullscreen)return;b=b||c.closest(".ui-page"),(c.siblings(".ui-header").jqmData("position")=="fixed"||a.support.scrollview)&&a(b).css("padding-top",d?c.siblings(".ui-header").outerHeight():0),a(b).css("padding-bottom",e?c.siblings(".ui-footer").outerHeight():0)},updatePageLayout:function(b,c){var d,e=a(b),f=e.find(":jqmData(role='header')"),g=e.find(":jqmData(role='content')"),h=0,i=0,j=0;e.length?d=e.find(":jqmData(role='footer')"):d=a(document).find(":jqmData(role='footer')").eq(0),i=d.css("display")=="none"||d.length==0?0:d.height(),j=f.css("display")=="none"||f.length==0?0:f.height(),i!=0&&d.css("bottom",0),h=window.innerHeight-i-j,a.support.scrollview&&g.height(h-parseFloat(g.css("padding-top"))-parseFloat(g.css("padding-bottom"))),c&&e.css("min-height",h).css("padding-top",j).css("padding-bottom",i)},show:function(a){},hide:function(a){},toggle:function(){this[this._visible?"hide":"show"]()},destroy:function(){this.element.removeClass("ui-header-fixed ui-footer-fixed ui-header-fullscreen ui-footer-fullscreen in out fade slidedown slideup ui-fixed-hidden"),this.element.closest(".ui-page").removeClass("ui-page-header-fixed ui-page-footer-fixed ui-page-header-fullscreen ui-page-footer-fullscreen")},refresh:function(){var b=a(".ui-page-active");this.setHeaderFooter(b),this._updateHeaderArea(b)}}),a(document).bind("pagecreate create",function(b){a(b.target).jqmData("fullscreen")&&a(a.mobile.pagelayout.prototype.options.initSelector,b.target).not(":jqmData(fullscreen)").jqmData("fullscreen",!0),a.mobile.pagelayout.prototype.enhanceWithin(b.target)})}(jQuery),function(a,b){a.widget("tizen.triangle",a.tizen.widgetex,{options:{extraClass:"",offset:null,color:null,location:"top",initSelector:":jqmData(role='triangle')"},_create:function(){var b=a("<div></div>",{"class":"ui-triangle"});a.extend(this,{_triangle:b}),this.element.addClass("ui-triangle-container").append(b)},_doCSS:function(){var b=this.options.location||"top",c=a.inArray(b,["top","bottom"])===-1?"top":"left",d={"border-bottom-color":"top"===b?this.options.color:"transparent","border-top-color":"bottom"===b?this.options.color:"transparent","border-left-color":"right"===b?this.options.color:"transparent","border-right-color":"left"===b?this.options.color:"transparent"};d[c]=this.options.offset,this._triangle.removeAttr("style").css(d)},_setOffset:function(b){this.options.offset=b,this.element.attr("data-"+(a.mobile.ns||"")+"offset",b),this._doCSS()},_setExtraClass:function(b){this._triangle.addClass(b),this.options.extraClass=b,this.element.attr("data-"+(a.mobile.ns||"")+"extra-class",b)},_setColor:function(b){this.options.color=b,this.element.attr("data-"+(a.mobile.ns||"")+"color",b),this._doCSS()},_setLocation:function(b){this.element.removeClass("ui-triangle-container-"+this.options.location).addClass("ui-triangle-container-"+b),this._triangle.removeClass("ui-triangle-"+this.options.location).addClass("ui-triangle-"+b),this.options.location=b,this.element.attr("data-"+(a.mobile.ns||"")+"location",b),this._doCSS()}}),a(document).bind("pagecreate create",function(b){a(a.tizen.triangle.prototype.options.initSelector,b.target).not(":jqmData(role='none'), :jqmData(role='nojs')").triangle()})}(jQuery),function(a,b){a.widget("tizen.tabbar",a.mobile.widget,{options:{iconpos:"top",grid:null,defaultList:4,initSelector:":jqmData(role='tabbar')"},_create:function(){var c=this.element,d,e,f,g=a.mobile.listview.prototype.options.theme,h=window.innerWidth||a(window).width(),i=window.innerHeight||a(window).height(),j="<div class='ui-tabbar-divider ui-tabbar-divider-left'></div>",k="<div class='ui-tabbar-divider ui-tabbar-divider-right'></div>",l;l=h>i&&h-i,l?c.removeClass("ui-portrait-tabbar").addClass("ui-landscape-tabbar"):c.removeClass("ui-landscape-tabbar").addClass("ui-portrait-tabbar"),c.find("a").length&&(d=c.find("a"),f=d.filter(":jqmData(icon)").length?this.options.iconpos:b,e=d.html().length?!0:!1),c.parents(".ui-header").length&&c.parents(".ui-scrollview-view").length?(c.find("li").addClass("tabbar-scroll-li"),c.find("ul").addClass("tabbar-scroll-ul"),a(j).appendTo(c.parents(".ui-scrollview-clip")),a(k).appendTo(c.parents(".ui-scrollview-clip")),a(".ui-tabbar-divider-left").hide(),a(".ui-tabbar-divider-right").hide(),c.parents(".ui-scrollview-view").data("default-list")&&(this.options.defaultList=c.parents(".ui-scrollview-view").data("default-list")),c.find("li").css("width",window.innerWidth/this.options.defaultList+"px")):c.find("ul").children().length&&c.addClass("ui-navbar").find("ul").grid({grid:this.options.grid}),c.parents(".ui-footer").length&&c.find("li").addClass("ui-tab-btn-style"),c.siblings(".ui-title").length&&c.parents(".ui-header").addClass("ui-title-tabbar"),f||c.addClass("ui-tabbar-noicons"),e||c.addClass("ui-tabbar-notext"),e&&f&&c.parents(".ui-header").addClass("ui-title-tabbar-multiline"),c.find("a").length&&d.buttonMarkup({corners:!1,shadow:!1,iconpos:f}),c.find(".ui-state-persist").length&&c.addClass("ui-tabbar-persist"),c.delegate("a","vclick",function(b){d.not(".ui-state-persist").removeClass(a.mobile.activeBtnClass),a(this).addClass(a.mobile.activeBtnClass)}),c.addClass("ui-tabbar"),a(document).bind("pagebeforeshow",function(b,c){var d=a(b.target).find(":jqmData(role='footer')"),e=d.find(":jqmData(role='tabbar')"),f=e.siblings(":jqmData(icon='naviframe-more')"),g=e.siblings(".ui-btn-back");d.css("position","fixed").css("bottom",0).css("height",e.height()),f.length&&e.addClass("ui-tabbar-margin-more"),g.length&&e.addClass("ui-tabbar-margin-back")}),c.bind("touchstart vmousedown",function(b){var c=a(b.target).parents(".ui-scrollview-view");c.offset()&&(c.offset().left<0?a(".ui-tabbar-divider-left").show():a(".ui-tabbar-divider-left").hide(),c.width()-c.parents(".ui-scrollview-clip").width()==Math.abs(c.offset().left)?a(".ui-tabbar-divider-right").hide():a(".ui-tabbar-divider-right").show())}),this._bindTabbarEvents(),this._initTabbarAnimation()},_initTabbarAnimation:function(){var b=!1,c=!1;a(document).bind("scrollstart.tabbar",function(d){a(d.target).find(".ui-tabbar").length&&(b=!0,c=!1)}),a(document).bind("scrollstop.tabbar",function(d){var e=a(d.target),f=a(d.target).find(".ui-tabbar"),g=a(d.target).find(".ui-tabbar li"),h=g.eq(0),i,j=-1;c=!0,f.length&&b==1&&(i=Math.abs(g.eq(0).offset().left),g.each(function(a){var b=g.eq(a).offset();Math.abs(b.left)<i&&(i=Math.abs(b.left),j=a,h=g.eq(a))}),e.length&&b==c&&j!=-1&&(b=!1,e.scrollview("scrollTo",-(window.innerWidth/f.data("defaultList")*j),0,357))),a(".ui-tabbar-divider-left").hide(),a(".ui-tabbar-divider-right").hide()})},_bindTabbarEvents:function(){var b=this.element;a(window).bind("orientationchange",function(c,d){var e=window.innerWidth||a(window).width(),f=window.innerHeight||a(window).height(),g=e>f&&e-f;g?b.removeClass("ui-portrait-tabbar").addClass("ui-landscape-tabbar"):b.removeClass("ui-landscape-tabbar").addClass("ui-portrait-tabbar")})},_setDisabled:function(a,b){this.element.find("li").eq(b).attr("disabled",a),this.element.find("li").eq(b).attr("aria-disabled",a)},disable:function(a){this._setDisabled(!0,a),this.element.find("li").eq(a).addClass("ui-disabled")},enable:function(a){this._setDisabled(!1,a),this.element.find("li").eq(a).removeClass("ui-disabled")}}),a(document).bind("pagecreate create",function(b){a(a.tizen.tabbar.prototype.options.initSelector,b.target).tabbar()})}(jQuery),function(a,b){a.widget("tizen.searchbar",a.mobile.widget,{options:{theme:null,initSelector:"input[type='search'],:jqmData(type='search'), input[type='tizen-search'],:jqmData(type='tizen-search')"},_create:function(){function t(){setTimeout(function(){h.toggleClass("ui-input-clear-hidden",!c.val())},0)}function u(){g.addClass("ui-input-search-default").removeClass("ui-input-search-wide"),i.addClass("ui-btn-cancel-show").removeClass("ui-btn-cancel-hide")}function v(){g.addClass("ui-input-search-wide").removeClass("ui-input-search-default"),i.addClass("ui-btn-cancel-hide").removeClass("ui-btn-cancel-show"),t()}function w(){var b=a(c).jqmData("icon"),d=a("<div data-role='button' data-style='circle'></div>");d.appendTo(g.parent()).buttonMarkup({icon:b,corners:!0,shadow:!0}),d.addClass("ui-btn-search-front-icon")}var c=this.element,d=this.options,e=d.theme||a.mobile.getInheritedTheme(this.element,"c"),f=" ui-body-"+e,g,h,i,j,k,l,m,n,o,p,q,r=!1,s=!1;a("label[for='"+c.attr("id")+"']").addClass("ui-input-text"),typeof c[0].autocorrect!="undefined"&&!a.support.touchOverflow&&(c[0].setAttribute("autocorrect","off"),c[0].setAttribute("autocomplete","off")),g=c.wrap("<div class='ui-input-search ui-shadow-inset ui-corner-all ui-btn-shadow"+f+"'></div>").parent(),a(this.element).data("cancel-btn")===!0&&(r=!0,g.addClass("ui-input-search-default")),a(this.element).data("icon")!=b&&(s=!0,g.addClass("ui-search-bar-icon")),h=a("<a href='#' class='ui-input-clear' title='clear text'>clear text</a>").bind("click",function(a){if(c.attr("disabled")=="disabled")return!1;c.val("").focus().trigger("change"),h.addClass("ui-input-clear-hidden"),a.preventDefault()}).appendTo(g).buttonMarkup({icon:"deleteSearch",iconpos:"notext",corners:!0,shadow:!0}),t(),c.bind("paste cut keyup focus change blur",t),g.wrapAll("<div class='input-search-bar'></div>"),p=a("<div class='ui-image-search'></div>").appendTo(g),s&&w(),r&&(i=a("<div data-role='button' class='ui-input-cancel' title='clear text'>Cancel</div>").bind("click",function(a){if(c.attr("disabled")=="disabled")return!1;a.preventDefault(),a.stopPropagation(),c.val("").blur().trigger("change"),r&&v()}).appendTo(g.parent()).buttonMarkup({iconpos:"cancel",corners:!0,shadow:!0})),c.focus(function(){if(c.attr("disabled")=="disabled")return!1;r&&u(),g.addClass(a.mobile.focusClass)}).blur(function(){g.removeClass(a.mobile.focusClass)}),j=c.jqmData("default-text"),j!=b&&j.length>0&&(k="ui-input-default-text",l=j.replace(/\s/g,""),m=k+"-"+l,n=a("<style>."+m+":after"+"{content:"+"'"+j+"'"+"}"+"</style>"),a("html > head").append(n),o=a("<div></div>"),o.addClass(k),o.addClass(m),o.tap(function(a){c.blur(),c.focus()}),c.parent().append(o),c.focus(function(){c.parent().find("div.ui-input-default-text").addClass("ui-input-default-hidden")}).blur(function(){var a=c.val();a.length>0?c.parent().find("div.ui-input-default-text").addClass("ui-input-default-hidden"):c.parent().find("div.ui-input-default-text").removeClass("ui-input-default-hidden")})),c.attr("placeholder")||c.attr("placeholder","Search")},disable:function(){this.element.attr("disabled",!0),this.element.parent().addClass("ui-disabled"),a(this.element).blur(),this.element.parent().parent().find(".ui-input-cancel").addClass("ui-disabled")},enable:function(){this.element.attr("disabled",!1),this.element.parent().removeClass("ui-disabled"),this.element.parent().parent().find(".ui-input-cancel").removeClass("ui-disabled"),a(this.element).focus()}}),a(document).bind("pagecreate create",function(b){a.tizen.searchbar.prototype.enhanceWithin(b.target)})}(jQuery),function(a,b){a.widget("tizen.ctxpopup",a.tizen.widgetex,{options:a.extend({},a.tizen.popupwindow.prototype.options,{initSelector:":jqmData(show-arrow)"}),_htmlProto:{source:["<div><div id='outer' class='ui-ctxpopup'>"," <div id='top' class='ui-ctxpopup-row' data-role='triangle' data-location='top'></div>"," <div class='ui-ctxpopup-row'>"," <div id='left' class='ui-ctxpopup-cell' data-role='triangle' data-location='left'></div>"," <div id='container' class='ui-ctxpopup-cell'></div>"," <div id='right' class='ui-ctxpopup-cell' data-role='triangle' data-location='right'></div>"," </div>"," <div id='bottom' class='ui-ctxpopup-row' data-role='triangle' data-location='bottom'></div>","</div>","</div>"].join(""),ui:{outer:"#outer",container:"#container",arrow:{all:":jqmData(role='triangle')",l:"#left",t:"#top",r:"#right",b:"#bottom"}}},_create:function(){console.warn("ctxpopup() was deprecated. use popup() instead."),this.element.data("popupwindow")||this.element.popupwindow(),this.element.data("popupwindow")._ui.container.removeClass("ui-popupwindow-padding").append(this._ui.outer),this._ui.outer.trigger("create"),this._ui.container.addClass("ui-popupwindow-padding").append(this.element)},_setOption:function(b,c){a.tizen.popupwindow.prototype._setOption.apply(this.element.data("popupwindow"),arguments),this.options[b]=c}});var c=a.tizen.popupwindow.prototype.open,d=a.tizen.popupwindow.prototype._setOption,e=a.tizen.popupwindow.prototype._placementCoords;a.tizen.popupwindow.prototype._setOption=function(a,b){var c=this.element.data("ctxpopup"),e=!0,f;if(c){if("shadow"===a||"overlayTheme"===a||"corners"===a)f=this._ui.container,this._ui.container=c._ui.container,d.apply(this,arguments),this._ui.container=f,e=!1;c.options[a]=b}e&&d.apply(this,arguments)},a.tizen.popupwindow.prototype._placementCoords=function(c,d,f,g){function m(a,b,f){h._ui.arrow.all.hide(),h._ui.arrow[a].show();var g="b"===a||"t"===a,j=g?{point:"x",size:"cx",beg:"left",outerSize:"outerWidth",niceSize:"width",triangleSize:"height"}:{point:"y",size:"cy",beg:"top",outerSize:"outerHeight",niceSize:"height",triangleSize:"width"},k={cx:i._ui.container.width(),cy:i._ui.container.height()},l={cx:k.cx/2,cy:k.cy/2},m={x:c+l.cx*b,y:d+l.cy*f},n=e.call(i,m.x,m.y,k.cx,k.cy),o=h._ui.arrow[a].offset()[j.beg],p=h._ui.arrow[a][j.outerSize](!0),q=i.element.offset()[j.beg],r=i.element[j.outerSize](!0),s=h._ui.arrow[a][j.triangleSize](),t=Math.max(s+Math.max(0,q-o),Math.min(p-s-Math.max(0,o+p-(q+r)),p/2+m[j.point]-n[j.point]-l[j.size])),u={x:n.x+(g?t:0)+("r"===a?k.cx:0),y:n.y+(g?0:t)+("b"===a?k.cy:0)},v={actual:n,triangleOffset:t,absDiff:Math.abs(c-u.x)+Math.abs(d-u.y)};return h._ui.arrow[a].hide(),v}var h=this.element.data("ctxpopup"),i=this,j={},k,l;return h?(j={l:m("l",1,0),r:m("r",-1,0),t:m("t",0,1),b:m("b",0,-1)},a.each(j,function(a,c){if(k===b||c.absDiff<k)k=c.absDiff,l=a}),h._ui.arrow[l].show().triangle("option","offset",j[l].triangleOffset),j[l].actual):e.call(this,c,d,f,g)},a.tizen.popupwindow.prototype.open=function(b,d){var e=this.element.data("ctxpopup");e&&(this._setFade(!1),this._setShadow(!1),this._setCorners(!1),this._setOverlayTheme(null),this._setOption("overlayTheme",e.options.overlayTheme),e._ui.arrow.all.triangle("option","color",e._ui.container.css("background-color")),a(".ui-popupwindow").css("background","none")),c.call(this,b,d,!0)},a(document).bind("pagecreate create",function(b){var c=a(a.tizen.ctxpopup.prototype.options.initSelector,b.target);a.tizen.ctxpopup.prototype.enhanceWithin(b.target)})}(jQuery),function(a,b,c){a.widget("tizen.datetimepicker",a.tizen.widgetex,{options:{type:null,format:null,date:null,initSelector:"input[type='date'], input[type='datetime'], input[type='time'], :jqmData(role='datetimepicker')"},_calendar:function(){return b.Globalize.culture().calendars.standard},_value:{attr:"data-"+(a.mobile.ns||"")+"date",signal:"date-changed"},_daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],_isLeapYear:function(a){return a%4?0:a%100?1:a%400?0:1},_makeTwoDigits:function(a){var b=a.toString(10);return a<10&&(b="0"+b),b},_setType:function(b){switch(b){case"datetime":case"date":case"time":this.options.type=b;break;default:this.options.type="datetime"}return this.element.attr("data-"+(a.mobile.ns?a.mobile.ns+"-":"")+"type",this.options.type),this.options.type},_setFormat:function(b){if(this.options.format==b)return;this.options.format=b,this.ui.children().remove();var c=this._parsePattern(b),d=document.createElement("div"),e,f,g,h,i=this;while(c.length>0){e=c.shift(),f='<span class="ui-datefield-%1" data-pat="'+e+'">%2</span>';switch(e){case"H":case"HH":case"h":case"hh":a(d).append(f.replace("%1","hour"));break;case"mm":case"m":this.options.type=="date"?a(d).append(f.replace("%1","month")):a(d).append(f.replace("%1","min"));break;case"ss":case"s":a(d).append(f.replace("%1","sec"));break;case"d":case"dd":a(d).append(f.replace("%1","day"));break;case"M":case"MM":case"MMM":case"MMMM":a(d).append(f.replace("%1","month"));break;case"yy":case"yyyy":a(d).append(f.replace("%1","year"));break;case"t":case"tt":h='<a href="#" class="ui-datefield-period" data-role="button" data-inline="true">period</a>',a(d).append(h);break;case"g":case"gg":a(d).append(f.replace("%1","era").replace("%2",this._calendar().eras.name));break;case"\t":a(d).append(f.replace("%1","tab").replace("%2",e));break;default:a(d).append(f.replace("%1","seperator").replace("%2",e))}}return this.ui.append(d),this.options.date&&this._setDate(this.options.date),this.ui.find(".ui-datefield-period").buttonMarkup().bind("vclick",function(a){i._switchAmPm(i)}),this.element.attr("data-"+(a.mobile.ns?a.mobile.ns+"-":"")+"format",this.options.format),this.options.format},_setDate:function(b){function i(){return b.getMonth()+1}typeof b=="string"&&(b=new Date(b));var c=a("span,a",this.ui),d,e,f,g,h;for(h=0;h<c.length;h++){f=a(c[h]),d=f.attr("class").match(/ui-datefield-([\w]*)/),d||(d="");switch(d[1]){case"hour":e=b.getHours;break;case"min":e=b.getMinutes;break;case"sec":e=b.getSeconds;break;case"year":e=b.getFullYear;break;case"month":e=i;break;case"day":e=b.getDate;break;case"period":e=b.getHours()<12?this._calendar().AM[0]:this._calendar().PM[0],g=f.find(".ui-btn-text"),g.length==0?f.text(e):g.text()!=e&&g.text(e),e=null;break;default:e=null}e&&this._updateField(f,e.call(b))}return this.options.date=b,this._setValue(b),this.element.attr("data-"+(a.mobile.ns?a.mobile.ns+"-":"")+"date",this.options.date),this.options.date},destroy:function(){this.ui&&this.ui.remove(),this.element&&this.element.show()},value:function(a){function b(a,b){return b._makeTwoDigits(a.getHours())+":"+b._makeTwoDigits(a.getMinutes())+":"+b._makeTwoDigits(a.getSeconds())}function c(a,b){return(a.getFullYear()%1e4+1e4).toString
+().substr(1)+"-"+b._makeTwoDigits(a.getMonth()+1)+"-"+b._makeTwoDigits(a.getDate())}var d=null;if(a)d=this._setDate(a);else switch(this.options.type){case"time":d=b(this.options.date,this);break;case"date":d=c(this.options.date,this);break;default:d=c(this.options.date,this)+"T"+b(this.options.date,this)}return d},setValue:function(a){return console.warn("setValue was deprecated. use datetimepicker('option', 'date', value) instead."),this.value(a)},getValue:function(){return console.warn("getValue() was deprecated. use datetimepicker('value') instead."),this.value()},_updateField:function(a,b){if(!a||a.length==0)return;b==0&&(b="0");var c=a.jqmData("pat"),d,e,f=this;switch(c){case"H":case"HH":case"h":case"hh":d=b,c.charAt(0)=="h"&&(d>12?d-=12:d==0&&(d=12)),d=this._makeTwoDigits(d),e=d;break;case"m":case"M":case"d":case"s":e=b;break;case"mm":case"dd":case"MM":case"ss":e=this._makeTwoDigits(b);break;case"MMM":e=this._calendar().months.namesAbbr[b-1];break;case"MMMM":e=this._calendar().months.names[b-1];break;case"yy":e=this._makeTwoDigits(b%100);break;case"yyyy":b<10?b="000"+b:b<100?b="00"+b:b<1e3&&(b="0"+b),e=b}a.text()!=e&&(a.hasClass("ui-datefield-selected")?(a.addClass("out"),this._new_value=e,a.animationComplete(function(){a.text(f._new_value),a.addClass("in").removeClass("out"),a.animationComplete(function(){a.removeClass("in").removeClass("ui-datefield-selected")})})):a.text(e))},_switchAmPm:function(a){if(this._calendar().AM!=null){var b=new Date(this.options.date),c,d=432e5;b.getHours()>11&&(d=-d),b.setTime(b.getTime()+d),this._setDate(b)}},_parsePattern:function(a){var b=/\/|\s|dd|d|MMMM|MMM|MM|M|yyyy|yy|y|hh|h|HH|H|mm|m|ss|s|tt|t|f|gg|g|\'[\w\W]*\'$|[\w\W]/g,c,d;c=a.match(b);for(d=0;d<c.length;d++)c[d].charAt(0)=="'"&&(c[d]=c[d].substr(1,c[d].length-2));return c},changeTypeFormat:function(a,b){console.warn('changeTypeFormat() was deprecated. use datetimepicker("option", "type"|"format", value) instead'),a&&this._setType(a),b&&this._setFormat(b)},_create:function(){var b=this;this.element.is("input")&&function(a){var b,c,d;b=a.element.get(0).getAttribute("type"),a.options.type=b,c=a.element.get(0).getAttribute("value"),c&&(a.options.date=new Date(c))}(this);if(!this.options.format)switch(this.options.type){case"datetime":this.options.format=this._calendar().patterns.d+"\t"+this._calendar().patterns.t;break;case"date":this.options.format=this._calendar().patterns.d;break;case"time":this.options.format=this._calendar().patterns.t}this.options.date||(this.options.date=new Date),this.element.hide(),this.ui=a('<div class="ui-datefield"></div>'),a(this.element).after(this.ui),this._popup_open=!1,this.ui.bind("vclick",function(a){b._showDataSelector(b,this,a.target)})},_populateDataSelector:function(a,c){var d,e,f,g,h=b.range,i,j,k,l;switch(a){case"hour":c=="H"||c=="HH"?(d=h(0,23),g=h(0,23),f=this.options.date.getHours()):(d=h(1,12),f=this.options.date.getHours()-1,f>=11?(f-=12,g=h(13,23),g.push(12)):(g=h(1,11),g.push(0)),f<0&&(f=11)),c.length==2&&(d=d.map(this._makeTwoDigits)),e=d.length;break;case"min":case"sec":d=h(0,59),c.length==2&&(d=d.map(this._makeTwoDigits)),g=h(0,59),f=a=="min"?this.options.date.getMinutes():this.options.date.getSeconds(),e=d.length;break;case"year":j=1900,k=2100,g=h(j,k),f=this.options.date.getFullYear()-j,d=h(j,k),e=d.length;break;case"month":switch(c.length){case 1:d=h(1,12);break;case 2:d=h(1,12).map(this._makeTwoDigits);break;case 3:d=this._calendar().months.namesAbbr.slice();break;case 4:d=this._calendar().months.names.slice()}d.length==13&&d[12]==""&&d.pop(),g=h(1,d.length),f=this.options.date.getMonth(),e=d.length;break;case"day":l=this._daysInMonth[this.options.date.getMonth()],l==28&&(l+=this._isLeapYear(this.options.date.getFullYear())),d=h(1,l),c.length==2&&(d=d.map(this._makeTwoDigits)),g=h(1,l),f=this.options.date.getDate()-1,e=l}return{values:d,data:g,numItems:e,current:f}},_showDataSelector:function(d,e,f){f=a(f);var g=f.attr("class"),h=g?g.match(/ui-datefield-([\w]*)/):c,i,j,k,l,m,n,o,p,q,r,s,t,u,v=10,w=this;if(!g)return;if(!h)return;if(this._popup_open)return;f.not(".ui-datefield-seperator").addClass("ui-datefield-selected"),i=f.jqmData("pat"),j=d._populateDataSelector.call(d,h[1],i),k=j.values,l=j.numItems,m=j.current,n=j.data;if(k){p="data-"+(a.mobile.ns?a.mobile.ns+"-":"")+'val="';for(u=0;u<k.length;u++)o+='<li><a class="ui-link" '+p+n[u]+'">'+k[u]+"</a></li>";q=a("<ul></ul>"),r=a('<div class="ui-datetimepicker-selector" data-transition="fade" data-fade="false"></div>'),r.append(q).appendTo(e),s=r.ctxpopup(),s.parents(".ui-popupwindow").addClass("ui-datetimepicker"),t=a(o),a(t[m]).addClass("current"),r.jqmData("list",t),r.circularview(),a(b).width()/2<f.offset().left&&(v=-10),s.popupwindow("open",f.offset().left+f.width()/2+v-b.pageXOffset,f.offset().top+f.height()-b.pageYOffset),this._popup_open=!0,r.bind("popupafterclose",function(c){d._reflow&&(a(b).unbind("resize",d._reflow),d._reflow=null),!f.hasClass("in")&&!f.hasClass("out")&&f.removeClass("ui-datefield-selected"),r.unbind("popupafterclose"),q.unbind("vclick"),a(d).unbind("update"),s.popupwindow("destroy"),r.remove(),w._popup_open=!1}),a(d).bind("update",function(a,b){var c=new Date(this.options.date),e,f=function(){c.setDate(1),c.setDate(c.getDate()-1)};switch(h[1]){case"min":c.setMinutes(b);break;case"hour":c.setHours(b);break;case"sec":c.setSeconds(b);break;case"year":e=c.getMonth(),c.setFullYear(b),c.getMonth()!=e&&f();break;case"month":c.setMonth(b-1),c.getMonth()==b&&f();break;case"day":c.setDate(b)}d._setDate(c),s.popupwindow("close")}),q.bind("click",function(b){if(a(b.target).is("a")){q.find(".current").removeClass("current"),a(b.target).parent().addClass("current");var c=a(b.target).jqmData("val");a(d).trigger("update",c)}}),r.circularview("centerTo",".current",500),r.bind("scrollend",function(c){d._reflow||(d._reflow=function(){r.circularview("reflow")},a(b).bind("resize",d._reflow))})}return e}}),a(document).bind("pagecreate create",function(b){a(a.tizen.datetimepicker.prototype.options.initSelector,b.target).not(":jqmData(role='none'), :jqmData(role='nojs')").datetimepicker()})}(jQuery,this),function(a){a.tizen.frameworkData.pkgVersion="0.2.20"}(jQuery);
\ No newline at end of file
+++ /dev/null
-.ui-popupwindow-padding {
- padding: 6px;
-}
-.ui-popupwindow {
- display: inline-block;
- position: absolute;
- padding: 0;
- z-index: 100 !important;
-}
-.ui-popupwindow-screen {
- background: #000000;
- opacity: 0;
- box-sizing: border-box;
- -moz-box-sizing: border-box;
-}
-/*
- * The settings in this file are part of the theme. They are not part of the structure of ctxpopup.
- * In the default theme, ui-body-* has a border width of 1px. So, to make the triangles cross this border, we set them in
- * by 1px.
- */
-
-.ui-ctxpopup-row .ui-triangle-top {
- top: 1px;
-}
-
-.ui-ctxpopup-row .ui-triangle-left {
- left: 1px;
-}
-
-.ui-ctxpopup-row .ui-triangle-right {
- right: 1px;
-}
-
-.ui-ctxpopup-row .ui-triangle-bottom {
- bottom: 1px;
-}
-.ui-ctxpopup {
- display: table;
-}
-.ui-ctxpopup .ui-ctxpopup-row {
- display: table-row;
-}
-.ui-ctxpopup .ui-ctxpopup-row .ui-ctxpopup-cell {
- display: table-cell;
-}
-.ui-triangle-container {
- position: relative;
-}
-.ui-triangle-container .ui-triangle {
- position: absolute;
- border-style: solid;
- border-color: transparent;
- border-width: 10px;
-}
-.ui-triangle-container .ui-triangle-top {
- top: 0px;
- border-top-width: 0px;
- border-left-color: transparent;
- border-right-color: transparent;
- margin-left: -10px;
-}
-.ui-triangle-container .ui-triangle-bottom {
- bottom: 0px;
- border-bottom-width: 0px;
- border-left-color: transparent;
- border-right-color: transparent;
- margin-left: -10px;
-}
-.ui-triangle-container .ui-triangle-left {
- left: 0px;
- margin-top: -10px;
- border-left-width: 0px;
- border-left-color: transparent;
- border-right-color: transparent;
-}
-.ui-triangle-container .ui-triangle-right {
- right: 0px;
- margin-top: -10px;
- border-right-width: 0px;
- border-left-color: transparent;
- border-right-color: transparent;
-}
-.ui-triangle-container-top {
- height: 10px;
- top: 0px;
- margin-top: -10px;
-}
-.ui-triangle-container-bottom {
- height: 10px;
- bottom: 0px;
- margin-bottom: -10px;
-}
-.ui-triangle-container-left {
- width: 10px;
-}
-.ui-triangle-container-right {
- width: 10px;
-}
+++ /dev/null
-.ui-popupwindow-padding{padding:6px}.ui-popupwindow{display:inline-block;position:absolute;padding:0;z-index:100!important}.ui-popupwindow-screen{background:#000;opacity:0;box-sizing:border-box;-moz-box-sizing:border-box}.ui-ctxpopup-row .ui-triangle-top{top:1px}.ui-ctxpopup-row .ui-triangle-left{left:1px}.ui-ctxpopup-row .ui-triangle-right{right:1px}.ui-ctxpopup-row .ui-triangle-bottom{bottom:1px}.ui-ctxpopup{display:table}.ui-ctxpopup .ui-ctxpopup-row{display:table-row}.ui-ctxpopup .ui-ctxpopup-row .ui-ctxpopup-cell{display:table-cell}.ui-triangle-container{position:relative}.ui-triangle-container .ui-triangle{position:absolute;border-style:solid;border-color:transparent;border-width:10px}.ui-triangle-container .ui-triangle-top{top:0;border-top-width:0;border-left-color:transparent;border-right-color:transparent;margin-left:-10px}.ui-triangle-container .ui-triangle-bottom{bottom:0;border-bottom-width:0;border-left-color:transparent;border-right-color:transparent;margin-left:-10px}.ui-triangle-container .ui-triangle-left{left:0;margin-top:-10px;border-left-width:0;border-left-color:transparent;border-right-color:transparent}.ui-triangle-container .ui-triangle-right{right:0;margin-top:-10px;border-right-width:0;border-left-color:transparent;border-right-color:transparent}.ui-triangle-container-top{height:10px;top:0;margin-top:-10px}.ui-triangle-container-bottom{height:10px;bottom:0;margin-bottom:-10px}.ui-triangle-container-left{width:10px}.ui-triangle-container-right{width:10px}
\ No newline at end of file
/***************************************************************************
Body
***************************************************************************/
+/* B011 : Main Background color */
+/* B012 : Main font color */
/***************************************************************************
Naviframe
***************************************************************************/
-/* #3b73b6 *//* title text */
+/* B042 : title text */
/* B052L4 : Title text button */
/* B052L5 : Title text button press */
/* B052L1P : Title text button press bg */
/***************************************************************************
Button(connected with other winset)
***************************************************************************/
-.LESSbutton_box_style {
- color: #363133;
-}
-.LESSbutton_up_style {
- background: #ebe8e3;
- background: -webkit-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -moz-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -o-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -ms-linear-gradient(top, #ebe8e3, #eae7e2);
-}
-.LESSbutton_box_style {
- background: #ebe8e3;
- background: -webkit-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -moz-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -o-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -ms-linear-gradient(top, #ebe8e3, #eae7e2);
- border: 1px solid;
- border-color: #dcdad3;
- -o-box-shadow: 0 0 1px 1px #ffffff;
- -ms-box-shadow: 0 0 1px 1px #ffffff;
- -moz-box-shadow: 0 0 1px 1px #ffffff;
- -webkit-box-shadow: 0 0 1px 1px #ffffff;
- box-shadow: 0 0 1px 1px #ffffff;
-}
-.LESSbutton_inner_box_style {
- background: #f7f5ee;
- background: -webkit-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -ms-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -o-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -moz-linear-gradient(top, #faf7f2, #f8f5f0);
- -o-box-shadow: none;
- -ms-box-shadow: none;
- -moz-box-shadow: none;
- -webkit-box-shadow: none;
- box-shadow: none;
-}
-.LESSbutton_inner_pressstyle {
- color: #f8f6ef;
-}
-.LESSbutton_text1_style {
- font-family: Helvetica, Arial, sans-serif;
- font-weight: normal;
- font-size: 1.0rem;
- font-style: normal;
- color: #000000;
-}
-.LESSbutton_hover_style {
- color: #363133;
-}
-.LESSbutton_down_style {
- background: #3b73b6;
- color: #f8f6ef;
-}
-.LESSbutton_edit_style {
- background: #c95858;
- background: -webkit-gradient(linear, left top, left bottom, from(#c95858), to(#a12828));
- background: -moz_linear-gradient(top, #c95858, #a12828);
-}
+
+
+
+
+
+
+
+
+
/***************************************************************************
contextual popup
***************************************************************************/
-/* #1A5274 */
/***************************************************************************
Scrollview
***************************************************************************/
Date Time picker
***************************************************************************/
/***************************************************************************
- DaySelector
-***************************************************************************/
-/* #00a8e7 */
-/* #f01402 */
-/* #f9f9f9 *//* #f9f9f9 */.LESSDayselectorButtonNormal {
- background: #7e9db2;
- background: -webkit-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -moz-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -ms-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -o-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: linear-gradient(top, #7e9db2 0%, #547990 100%);
-}
-.LESSDayaselectorButtonPress {
- background: #3b7796;
- background: -webkit-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -moz-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -ms-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -o-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: linear-gradient(top, #3b7796 0%, #2f5b75 100%);
-}
-/***************************************************************************
- OptionHeader
-***************************************************************************/
-/* #f9f9f9 */
-/***************************************************************************
SegmentControl
***************************************************************************/
-/* #F9F9F9*/
-/* #F9F9F9*/
-/***************************************************************************
- ControlGroup
-***************************************************************************/
-/* 00_divider_line.9.png */
+/* B052L4 : Title text button */
/***************************************************************************
Popup
***************************************************************************/
/* popup_title_bg.png */
/* maybe not use only popupwindow*/
-.LESSpopup_button_style {
- /* background: @color_popup_buttonbg;
- background: @color_popup_buttonbg_webkit;
- background: @color_popup_buttonbg_moz;
- background: @color_popup_buttonbg_ms;
- background: @color_popup_buttonbg_o;
- color: @color_popup_buttontext;*/
-}
-.LESSpopup_button_hover_style {
- background: #5e88a3;
-}
-.LESSpopup_button_press_style {
- background: #43a0d9;
- background: -webkit-gradient(linear, left top, left bottom, from(#43a0d9), to(#388bb9));
- background: -moz-linear-gradient(top, #43a0d9, #388bb9);
- background: -ms-linear-gradient(top, #43a0d9, #388bb9);
- background: -o-linear-gradient(top, #43a0d9, #388bb9);
-}
-/***************************************************************************
- Button
-***************************************************************************/
-.LESStoggleswitch_on_style {
- background: #2a7eac;
- background: -webkit-gradient(linear, left top, left bottom, from(#2174a7), to(#4ba5db));
- background: -moz-linear-gradient(top, #2174a7, #4ba5db);
- border-radius: 4px;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
-}
-.LESStoggleswitch_off_style {
- color: #cbcbcb;
- background: #97a1a7;
- background: -webkit-gradient(linear, left top, left bottom, from(#727272), to(#8d8d8d));
- background: -moz-linear-gradient(top, #727272, #8d8d8d);
- border-radius: 4px;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
-}
-.LESStoggleswitch_reed_style {
- background: #fdfdfd;
- background: -webkit-gradient(linear, left top, left bottom, from(#fdfdfd), to(#e7e7e7));
- background: -moz-linear-gradient(top, #fdfdfd, #e7e7e7);
- border-radius: 2px;
- -webkit-border-radius: 2px;
- -moz-border-radius: 2px;
-}
-.LESSbutton_editpress_style {
- background: #931818;
- background: -webkit-gradient(linear, left top, left bottom, from(#931818), to(#6e1717));
- background: -moz-linear-gradient(top, #931818, #6e1717);
-}
-.LESSbutton_edit_padding {
- padding: 0.5em 0.8em;
-}
+
+
/***************************************************************************
Tickernoti
***************************************************************************/
Smallpopup
***************************************************************************/
/***************************************************************************
- No Contents
-***************************************************************************/
-/***************************************************************************
Slider
***************************************************************************/
/***************************************************************************
/***************************************************************************
multimediaview
***************************************************************************/
-.LESSmultimediaview_bar_active_style {
- background-color: #4a84c9;
- background-image: -webkit-gradient(linear, left top, left bottom, from(#6289d9), to(#295b98));
- background-image: -moz-linear-gradient(top, #6289d9, #295b98);
- background-image: -o-linear-gradient(top, #6289d9, #295b98);
- background-image: -ms-linear-gradient(top, #6289d9, #295b98);
-}
-.LESSmultimediaview_bar_handle_style {
- background-color: #f9f9f9;
- background-image: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#e6e6e6));
- background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: -ms-linear-gradient(top, #ffffff, #e6e6e6);
-}
+
+
/***************************************************************************
tokentextarea
***************************************************************************/
/***************************************************************************
+ Splitview
***************************************************************************/
/***************************************************************************
Header / Footer
.ui-bar-s .ui-link-inherit {
color: #3b73b6;
}
-.ui-bar-s > .ui-btn.ui-btn-back {
+.ui-bar-s > .ui-btn.ui-btn-back,
+.ui-bar-s > .ui-btn.ui-btn-footer-down {
background: transparent;
position: absolute;
right: 0px;
}
-.ui-bar-s > .ui-btn.ui-btn-back .ui-icon-header-back-btn {
+.ui-bar-s > .ui-btn.ui-btn-back .ui-icon-header-back-btn,
+.ui-bar-s > .ui-btn.ui-btn-footer-down .ui-icon-header-back-btn {
+ top: 0.36363636363636365rem;
+ left: auto;
+ right: 0.5909090909090909rem;
+ margin-top: 0px;
+}
+.ui-bar-s > .ui-btn.ui-btn-footer-down {
+ border: none;
+ box-shadow: none;
+}
+.ui-bar-s > .ui-btn.ui-btn-footer-down .ui-icon {
top: 0.36363636363636365rem;
left: auto;
right: 0.5909090909090909rem;
/* temporary UX strange */
font-size: 1.2727272727272727rem;
+ font-weight: 500;
+ /* tizen font weight tuning */
+
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
text-align: left;
margin: 0.7272727272727273rem 0.36363636363636365rem 0.2272727272727273rem 0.36363636363636365rem;
}
+.ui-header.ui-bar-s > .ui-btn .ui-btn-inner.ui-btn-icon-only {
+ -o-box-sizing: border-box;
+ -ms-box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ -webkit-box-sizing: border-box;
+ box-sizing: border-box;
+ height: 100%;
+}
.ui-header.ui-bar-s > .ui-btn .ui-btn-inner.ui-btn-icon-only .ui-icon {
- left: 0px;
top: 0px;
- margin-top: 0px;
}
-.ui-header.ui-bar-s > .ui-btn.ui-btn-back {
+.ui-header.ui-bar-s > .ui-btn:not(.ui-btn-icon-notext) .ui-btn-inner.ui-btn-icon-only {
+ padding-left: 0px;
+}
+.ui-header.ui-bar-s > .ui-btn:not(.ui-btn-icon_only) {
+ width: 2.409090909090909rem;
+ height: 0.8181818181818182rem;
+ top: auto;
+ bottom: 0.4545454545454546rem;
+}
+.ui-header.ui-bar-s > .ui-btn:not(.ui-btn-icon_only) .ui-btn-inner {
+ padding: 0;
+}
+.ui-header.ui-bar-s > .ui-btn.ui-btn-back,
+.ui-header.ui-bar-s > .ui-btn.ui-btn-footer-down {
right: 0.5909090909090909rem;
}
+.ui-header.ui-bar-s > .ui-btn.ui-btn-back .ui-icon-header-back-btn,
+.ui-header.ui-bar-s > .ui-btn.ui-btn-footer-down .ui-icon-header-back-btn {
+ left: 0px;
+}
.ui-header.ui-bar-s img {
display: inline-block;
height: 0.7272727272727273rem;
-webkit-border-radius: 0px;
border-radius: 0px;
}
-.ui-header.ui-bar-s > .ui-btn:nth-child(2) {
- right: 0.5909090909090909rem;
+.ui-header.ui-bar-s .ui-btn-right-0 {
+ right: 0.5rem;
}
-.ui-header.ui-bar-s > .ui-btn:nth-child(3) {
+.ui-header.ui-bar-s .ui-btn-right-1 {
right: 2.5454545454545454rem;
}
-.ui-header.ui-bar-s > img + h1 + .ui-btn:nth-child(3) {
- right: 0.5909090909090909rem;
+.ui-header.ui-bar-s > .ui-btn:not(.ui-btn-icon_only):nth-child(2) {
+ right: 0.3181818181818182rem;
}
-.ui-header.ui-bar-s > img + h1 + .ui-btn:nth-child(3) + .ui-btn {
- right: 2.5454545454545454rem;
+.ui-header.ui-bar-s > .ui-btn:not(.ui-btn-icon_only):nth-child(3) {
+ right: 2.8181818181818183rem;
}
-.ui-header.ui-bar-s > img + h1 + span.ui-title-text-sub + .ui-btn:nth-child(4) {
- right: 0.5rem;
+.ui-header.ui-bar-s > img + h1 + .ui-btn:not(.ui-btn-icon_only):nth-child(3) {
+ right: 0.3181818181818182rem;
}
-.ui-header.ui-bar-s > img + h1 + span.ui-title-text-sub + .ui-btn:nth-child(4) + .ui-btn {
- right: 2.6363636363636362rem;
+.ui-header.ui-bar-s > img + h1 + .ui-btn:not(.ui-btn-icon_only):nth-child(3) + .ui-btn:not(.ui-btn-icon_only) {
+ right: 2.8181818181818183rem;
+}
+.ui-header.ui-bar-s > img + h1 + span.ui-title-text-sub + .ui-btn:not(.ui-btn-icon_only):nth-child(4) {
+ right: 0.3181818181818182rem;
+}
+.ui-header.ui-bar-s > img + h1 + span.ui-title-text-sub + .ui-btn:not(.ui-btn-icon_only):nth-child(4) + .ui-btn:not(.ui-btn-icon_only) {
+ right: 2.8181818181818183rem;
}
.ui-header.ui-bar-s > .ui-btn.ui-btn-down-s {
background: rgba(64, 147, 247, 0.1);
text-align: center;
bottom: 0px;
}
-.ui-footer.ui-bar-s > .ui-btn.ui-btn-back, .ui-footer.ui-bar-s > [data-icon="naviframe-more"] {
+.ui-footer.ui-bar-s > .ui-btn.ui-btn-back,
+.ui-footer.ui-bar-s > .ui-btn.ui-btn-footer-down,
+.ui-footer.ui-bar-s > [data-icon="naviframe-more"] {
background: transparent;
}
-.ui-footer.ui-bar-s > .ui-btn.ui-btn-back > .ui-btn-icon-only, .ui-footer.ui-bar-s > [data-icon="naviframe-more"] > .ui-btn-icon-only {
+.ui-footer.ui-bar-s > .ui-btn.ui-btn-back > .ui-btn-icon-only,
+.ui-footer.ui-bar-s > .ui-btn.ui-btn-footer-down > .ui-btn-icon-only,
+.ui-footer.ui-bar-s > [data-icon="naviframe-more"] > .ui-btn-icon-only {
width: 2.5454545454545454rem;
height: 2.2272727272727275rem;
padding: 0px;
margin-left: auto;
margin-right: auto;
margin-top: 0.2727272727272727rem;
- /* temp value */
-
margin-bottom: 0.2727272727272727rem;
/* temp value */
}
.ui-footer.ui-bar-s [data-role="controlgroup"] [data-role="button"] {
background: transparent;
- min-width: 3.5rem;
border-style: solid;
border-color: #c0c0c0;
border-top-width: 0px;
border-bottom-width: 0px;
border-left-width: 1px;
border-right-width: 1px;
- border-radius: 0px;
+ -o-border-radius: 0;
+ -ms-border-radius: 0;
+ -moz-border-radius: 0;
+ -webkit-border-radius: 0;
+ border-radius: 0;
box-shadow: none;
padding: 0px;
margin-left: -0.18181818181818182rem;
margin-right: -0.2272727272727273rem;
}
-.ui-footer.ui-bar-s [data-role="controlgroup"] [data-role="button"].ui-btn-down-s .ui-btn-inner, .ui-footer.ui-bar-s [data-role="controlgroup"] [data-role="button"] .ui-btn-active-s .ui-btn-inner {
+.ui-footer.ui-bar-s [data-role="controlgroup"] [data-role="button"].ui-btn-hover-s {
+ -o-border-radius: 0;
+ -ms-border-radius: 0;
+ -moz-border-radius: 0;
+ -webkit-border-radius: 0;
+ border-radius: 0;
+}
+.ui-footer.ui-bar-s [data-role="controlgroup"] [data-role="button"].ui-btn-down-s,
+.ui-footer.ui-bar-s [data-role="controlgroup"] [data-role="button"] .ui-btn-active-s {
+ -o-border-radius: 0;
+ -ms-border-radius: 0;
+ -moz-border-radius: 0;
+ -webkit-border-radius: 0;
+ border-radius: 0;
+}
+.ui-footer.ui-bar-s [data-role="controlgroup"] [data-role="button"].ui-btn-down-s .ui-btn-inner,
+.ui-footer.ui-bar-s [data-role="controlgroup"] [data-role="button"] .ui-btn-active-s .ui-btn-inner {
background: #f8f6ef;
}
-.ui-footer.ui-bar-s [data-role="controlgroup"] [data-role="button"].ui-btn-down-s .ui-btn-inner .ui-btn-text, .ui-footer.ui-bar-s [data-role="controlgroup"] [data-role="button"] .ui-btn-active-s .ui-btn-inner .ui-btn-text {
+.ui-footer.ui-bar-s [data-role="controlgroup"] [data-role="button"].ui-btn-down-s .ui-btn-inner .ui-btn-text,
+.ui-footer.ui-bar-s [data-role="controlgroup"] [data-role="button"] .ui-btn-active-s .ui-btn-inner .ui-btn-text {
color: #3b73b6;
}
.ui-footer.ui-bar-s [data-role="controlgroup"] [data-role="button"] > .ui-btn-inner {
+ -o-border-radius: 0;
+ -ms-border-radius: 0;
+ -moz-border-radius: 0;
+ -webkit-border-radius: 0;
+ border-radius: 0;
border: 0px solid;
box-shadow: none;
}
padding: 0.045454545454545456rem;
}
.ui-btn-box-s.ui-btn-up-s {
- color: #363133;
+ color: #3a3a3a;
background: #ebe8e3;
background: -webkit-linear-gradient(top, #ebe8e3, #eae7e2);
background: -moz-linear-gradient(top, #ebe8e3, #eae7e2);
-webkit-border-radius: 1.2rem;
border-radius: 1.2rem;
}
-.ui-ctxpopup .ui-btn-box-s.ui-btn-up-s, .ui-ctxpopup .ui-btn-box-s.ui-btn-hover-s {
+.ui-ctxpopup .ui-btn-box-s.ui-btn-up-s,
+.ui-ctxpopup .ui-btn-box-s.ui-btn-hover-s {
background: transparent !important;
border: none;
box-shadow: none;
.ui-btn-back.ui-btn-up-s,
.ui-btn-back.ui-btn-hover-s,
.ui-btn-back.ui-btn-down-s,
+.ui-btn-footer-down.ui-btn-up-s,
+.ui-btn-footer-down.ui-btn-hover-s,
+.ui-btn-footer-down.ui-btn-down-s,
.ui-popup-container .ui-btn-box-s {
font-weight: normal;
-o-border-radius: 0.9 rem;
border-radius: 0.9 rem;
}
.ui-btn-box-s.ui-btn-hover-s {
- color: #363133;
+ color: #3a3a3a;
font-family: Helvetica, Arial, sans-serif;
font-weight: normal;
font-size: 1.0rem;
background: #3b73b6;
color: #f8f6ef;
}
-.ui-btn-up-s, .ui-btn-hover-s, .ui-btn-down-s {
+.ui-btn-up-s,
+.ui-btn-hover-s,
+.ui-btn-down-s {
font-family: Helvetica, Arial, sans-serif;
text-decoration: none;
}
.ui-btn-active {
/* global-active */
- color: #363133;
+ color: #3a3a3a;
cursor: pointer;
text-decoration: none;
background: #3b73b6;
outline: none;
}
.ui-btn-active a.ui-link-inherit {
- color: #363133;
+ color: #3a3a3a;
}
/* button inner top highlight
-----------------------------------------------------------------------------------------------------------*/
/***************************************************************************
Icon (Naviframe)
***************************************************************************/
-.ui-header .ui-btn .ui-btn-icon-only .ui-icon, .ui-footer .ui-btn .ui-btn-icon-only .ui-icon {
+.ui-header .ui-btn .ui-btn-icon-only .ui-icon,
+.ui-footer .ui-btn .ui-btn-icon-only .ui-icon {
width: 1.4545454545454546rem;
height: 1.4545454545454546rem;
}
-.ui-btn-back .ui-btn-inner .ui-icon-header-back-btn {
+.ui-btn-back .ui-btn-inner .ui-icon-header-back-btn,
+.ui-btn-footer-down .ui-btn-inner .ui-icon {
width: 1.4545454545454546rem;
height: 1.4545454545454546rem;
background-repeat: no-repeat;
background-size: 100% 100%;
}
-.ui-btn-up-s {
- /* FIXME : check ux if it needs to be deprecated... */
+.ui-btn-up-s,
-}
-.ui-btn-up-s .ui-icon-header-back-btn {
+.ui-btn-up-s .ui-icon-header-back-btn,
+.ui-btn-hover-s .ui-icon-header-back-btn {
background-image: url(images/page/00_icon_Back.png);
}
-.ui-btn-up-s .ui-icon-naviframe-more {
+.ui-btn-up-s .ui-icon-naviframe-more,
+.ui-btn-hover-s .ui-icon-naviframe-more {
background-image: url(images/page/00_icon_more.png);
}
-.ui-btn-up-s .ui-icon-naviframe-cancel {
+.ui-btn-up-s .ui-icon-naviframe-cancel,
+.ui-btn-hover-s .ui-icon-naviframe-cancel {
background-image: url(images/00_icon_cancel.png);
}
-.ui-btn-up-s .ui-icon-naviframe-edit {
+.ui-btn-up-s .ui-icon-naviframe-edit,
+.ui-btn-hover-s .ui-icon-naviframe-edit {
background-image: url(images/page/00_icon_edit.png);
}
-.ui-btn-up-s .ui-icon-naviframe-plus {
+.ui-btn-up-s .ui-icon-naviframe-plus,
+.ui-btn-hover-s .ui-icon-naviframe-plus {
background-image: url(images/page/00_icon_plus.png);
}
-.ui-btn-down-s, .ui-btn-hover-s {
- /* FIXME: check ux if it needs to be deprecated.. */
-
+.ui-btn-up-s .ui-icon-down,
+.ui-btn-hover-s .ui-icon-down {
+ background-image: url(images/controls/button/00_button_down.png);
}
-.ui-btn-down-s .ui-icon-header-back-btn, .ui-btn-hover-s .ui-icon-header-back-btn {
+
+.ui-btn-down-s .ui-icon-header-back-btn {
background-image: url(images/page/00_icon_Back_press.png);
}
-.ui-btn-down-s .ui-icon-naviframe-more, .ui-btn-hover-s .ui-icon-naviframe-more {
+.ui-btn-down-s .ui-icon-naviframe-more {
background-image: url(images/page/00_icon_more_press.png);
}
-.ui-btn-down-s .ui-icon-naviframe-cancel, .ui-btn-hover-s .ui-icon-naviframe-cancel {
+.ui-btn-down-s .ui-icon-naviframe-cancel {
background-image: url(images/00_icon_cancel_press.png);
}
-.ui-btn-down-s .ui-icon-naviframe-edit, .ui-btn-hover-s .ui-icon-naviframe-edit {
+.ui-btn-down-s .ui-icon-naviframe-edit {
background-image: url(images/page/00_icon_edit_press.png);
}
-.ui-btn-down-s .ui-icon-naviframe-plus, .ui-btn-hover-s .ui-icon-naviframe-plus {
+.ui-btn-down-s .ui-icon-naviframe-plus {
background-image: url(images/page/00_icon_plus_press.png);
}
+.ui-btn-down-s .ui-icon-down {
+ background-image: url(images/controls/button/00_button_down_press.png);
+}
/* Interaction cues
-----------------------------------------------------------------------------------------------------------*/
.ui-disabled {
opacity: .3;
zoom: 1;
}
-.ui-disabled, .ui-disabled a {
+.ui-disabled,
+.ui-disabled a {
cursor: default !important;
pointer-events: none;
}
/***************************************************************************
Body
***************************************************************************/
+/* B011 : Main Background color */
+/* B012 : Main font color */
/***************************************************************************
Naviframe
***************************************************************************/
-/* #3b73b6 *//* title text */
+/* B042 : title text */
/* B052L4 : Title text button */
/* B052L5 : Title text button press */
/* B052L1P : Title text button press bg */
/***************************************************************************
Button(connected with other winset)
***************************************************************************/
-.LESSbutton_box_style {
- color: #363133;
-}
-.LESSbutton_up_style {
- background: #ebe8e3;
- background: -webkit-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -moz-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -o-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -ms-linear-gradient(top, #ebe8e3, #eae7e2);
-}
-.LESSbutton_box_style {
- background: #ebe8e3;
- background: -webkit-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -moz-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -o-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -ms-linear-gradient(top, #ebe8e3, #eae7e2);
- border: 1px solid;
- border-color: #dcdad3;
- -o-box-shadow: 0 0 1px 1px #ffffff;
- -ms-box-shadow: 0 0 1px 1px #ffffff;
- -moz-box-shadow: 0 0 1px 1px #ffffff;
- -webkit-box-shadow: 0 0 1px 1px #ffffff;
- box-shadow: 0 0 1px 1px #ffffff;
-}
-.LESSbutton_inner_box_style {
- background: #f7f5ee;
- background: -webkit-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -ms-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -o-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -moz-linear-gradient(top, #faf7f2, #f8f5f0);
- -o-box-shadow: none;
- -ms-box-shadow: none;
- -moz-box-shadow: none;
- -webkit-box-shadow: none;
- box-shadow: none;
-}
-.LESSbutton_inner_pressstyle {
- color: #f8f6ef;
-}
-.LESSbutton_text1_style {
- font-family: Helvetica, Arial, sans-serif;
- font-weight: normal;
- font-size: 1.0rem;
- font-style: normal;
- color: #000000;
-}
-.LESSbutton_hover_style {
- color: #363133;
-}
-.LESSbutton_down_style {
- background: #3b73b6;
- color: #f8f6ef;
-}
-.LESSbutton_edit_style {
- background: #c95858;
- background: -webkit-gradient(linear, left top, left bottom, from(#c95858), to(#a12828));
- background: -moz_linear-gradient(top, #c95858, #a12828);
-}
+
+
+
+
+
+
+
+
+
/***************************************************************************
contextual popup
***************************************************************************/
-/* #1A5274 */
/***************************************************************************
Scrollview
***************************************************************************/
Date Time picker
***************************************************************************/
/***************************************************************************
- DaySelector
-***************************************************************************/
-/* #00a8e7 */
-/* #f01402 */
-/* #f9f9f9 *//* #f9f9f9 */.LESSDayselectorButtonNormal {
- background: #7e9db2;
- background: -webkit-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -moz-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -ms-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -o-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: linear-gradient(top, #7e9db2 0%, #547990 100%);
-}
-.LESSDayaselectorButtonPress {
- background: #3b7796;
- background: -webkit-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -moz-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -ms-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -o-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: linear-gradient(top, #3b7796 0%, #2f5b75 100%);
-}
-/***************************************************************************
- OptionHeader
-***************************************************************************/
-/* #f9f9f9 */
-/***************************************************************************
SegmentControl
***************************************************************************/
-/* #F9F9F9*/
-/* #F9F9F9*/
-/***************************************************************************
- ControlGroup
-***************************************************************************/
-/* 00_divider_line.9.png */
+/* B052L4 : Title text button */
/***************************************************************************
Popup
***************************************************************************/
/* popup_title_bg.png */
/* maybe not use only popupwindow*/
-.LESSpopup_button_style {
- /* background: @color_popup_buttonbg;
- background: @color_popup_buttonbg_webkit;
- background: @color_popup_buttonbg_moz;
- background: @color_popup_buttonbg_ms;
- background: @color_popup_buttonbg_o;
- color: @color_popup_buttontext;*/
-}
-.LESSpopup_button_hover_style {
- background: #5e88a3;
-}
-.LESSpopup_button_press_style {
- background: #43a0d9;
- background: -webkit-gradient(linear, left top, left bottom, from(#43a0d9), to(#388bb9));
- background: -moz-linear-gradient(top, #43a0d9, #388bb9);
- background: -ms-linear-gradient(top, #43a0d9, #388bb9);
- background: -o-linear-gradient(top, #43a0d9, #388bb9);
-}
-/***************************************************************************
- Button
-***************************************************************************/
-.LESStoggleswitch_on_style {
- background: #2a7eac;
- background: -webkit-gradient(linear, left top, left bottom, from(#2174a7), to(#4ba5db));
- background: -moz-linear-gradient(top, #2174a7, #4ba5db);
- border-radius: 4px;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
-}
-.LESStoggleswitch_off_style {
- color: #cbcbcb;
- background: #97a1a7;
- background: -webkit-gradient(linear, left top, left bottom, from(#727272), to(#8d8d8d));
- background: -moz-linear-gradient(top, #727272, #8d8d8d);
- border-radius: 4px;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
-}
-.LESStoggleswitch_reed_style {
- background: #fdfdfd;
- background: -webkit-gradient(linear, left top, left bottom, from(#fdfdfd), to(#e7e7e7));
- background: -moz-linear-gradient(top, #fdfdfd, #e7e7e7);
- border-radius: 2px;
- -webkit-border-radius: 2px;
- -moz-border-radius: 2px;
-}
-.LESSbutton_editpress_style {
- background: #931818;
- background: -webkit-gradient(linear, left top, left bottom, from(#931818), to(#6e1717));
- background: -moz-linear-gradient(top, #931818, #6e1717);
-}
-.LESSbutton_edit_padding {
- padding: 0.5em 0.8em;
-}
+
+
/***************************************************************************
Tickernoti
***************************************************************************/
Smallpopup
***************************************************************************/
/***************************************************************************
- No Contents
-***************************************************************************/
-/***************************************************************************
Slider
***************************************************************************/
/***************************************************************************
/***************************************************************************
multimediaview
***************************************************************************/
-.LESSmultimediaview_bar_active_style {
- background-color: #4a84c9;
- background-image: -webkit-gradient(linear, left top, left bottom, from(#6289d9), to(#295b98));
- background-image: -moz-linear-gradient(top, #6289d9, #295b98);
- background-image: -o-linear-gradient(top, #6289d9, #295b98);
- background-image: -ms-linear-gradient(top, #6289d9, #295b98);
-}
-.LESSmultimediaview_bar_handle_style {
- background-color: #f9f9f9;
- background-image: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#e6e6e6));
- background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: -ms-linear-gradient(top, #ffffff, #e6e6e6);
-}
+
+
/***************************************************************************
tokentextarea
***************************************************************************/
/***************************************************************************
+ Splitview
***************************************************************************/
/************************/
/* some unsets - more probably needed */
-.ui-mobile, .ui-mobile body {
+.ui-mobile,
+.ui-mobile body {
height: 100%;
font-size: 22px;
}
-.ui-mobile fieldset, .ui-page {
+.ui-mobile fieldset,
+.ui-page {
padding: 0;
margin: 0;
}
-.ui-mobile a img, .ui-mobile fieldset {
+.ui-mobile a img,
+.ui-mobile fieldset {
border: 0;
}
/* responsive page widths */
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
/* "page" containers - full-screen views, one should always be in view post-pageload */
-.ui-mobile [data-role=page], .ui-mobile [data-role=dialog], .ui-page {
+.ui-mobile [data-role=page],
+.ui-mobile [data-role=dialog],
+.ui-page {
top: 0;
left: 0;
width: 100%;
- min-height: 100%;
position: absolute;
display: none;
border: 0;
.ui-page {
outline: none;
}
-.ui-mobile, .ui-mobile .ui-page {
+.ui-mobile,
+.ui-mobile .ui-page {
background: #f8f6ef;
color: #000000;
}
/* native overflow scrolling */
-.ui-page.ui-mobile-touch-overflow, .ui-mobile-touch-overflow.ui-native-fixed .ui-content {
+.ui-page.ui-mobile-touch-overflow,
+.ui-mobile-touch-overflow.ui-native-fixed .ui-content {
overflow: auto;
height: 100%;
-webkit-overflow-scrolling: touch;
-ms-overflow-scrolling: touch;
overflow-scrolling: touch;
}
-.ui-page.ui-mobile-touch-overflow, .ui-page.ui-mobile-touch-overflow * {
+.ui-page.ui-mobile-touch-overflow,
+.ui-page.ui-mobile-touch-overflow * {
/* some level of transform keeps elements from blinking out of visibility on iOS */
- transform: rotatey(0);
- -ms-transform: rotatey(0);
- -moz-transform: rotatey(0);
- -webkit-transform: rotatey(0);
- -o-transform: rotatey(0);
+ transform: rotateY(0);
+ -ms-transform: rotateY(0);
+ -moz-transform: rotateY(0);
+ -webkit-transform: rotateY(0);
+ -o-transform: rotateY(0);
}
.ui-page.ui-mobile-pre-transition {
display: block;
visibility: hidden;
}
/*headers, content panels*/
-.ui-bar, .ui-body {
+.ui-bar,
+.ui-body {
position: relative;
padding: .4em 15px;
overflow: hidden;
font-size: 16px;
display: inline-block;
}
-.ui-header, .ui-footer {
+.ui-header,
+.ui-footer {
display: block;
}
-.ui-page .ui-header, .ui-page .ui-footer {
+.ui-page .ui-header,
+.ui-page .ui-footer {
position: fixed;
/*position: relative;*/
z-index: 1000;
float: right;
top: .4em;
}
-.ui-header .ui-title, .ui-footer .ui-title {
+.ui-header .ui-title,
+.ui-footer .ui-title {
min-height: 1.1em;
text-align: center;
font-size: 16px;
padding: 0;
}
/* native fixed headers and footers */
-.ui-mobile-touch-overflow.ui-page.ui-native-fixed, .ui-mobile-touch-overflow.ui-page.ui-native-fullscreen {
+.ui-mobile-touch-overflow.ui-page.ui-native-fixed,
+.ui-mobile-touch-overflow.ui-page.ui-native-fullscreen {
overflow: visible;
}
-.ui-mobile-touch-overflow.ui-native-fixed .ui-header, .ui-mobile-touch-overflow.ui-native-fixed .ui-footer {
+.ui-mobile-touch-overflow.ui-native-fixed .ui-header,
+.ui-mobile-touch-overflow.ui-native-fixed .ui-footer {
position: fixed;
left: 0;
right: 0;
padding-top: 0;
padding-bottom: 0;
}
-.ui-mobile-touch-overflow.ui-native-fullscreen .ui-header, .ui-mobile-touch-overflow.ui-native-fullscreen .ui-footer {
+.ui-mobile-touch-overflow.ui-native-fullscreen .ui-header,
+.ui-mobile-touch-overflow.ui-native-fullscreen .ui-footer {
opacity: .9;
}
.ui-native-bars-hidden {
to { -moz-transform: translate3d(0, 100%, 0); }
}
+/* slide up + fade */
+
+.slideupfade.out {
+ -webkit-animation-name: fadeout;
+ -moz-animation-name: fadeout;
+ -webkit-animation-duration: 100ms;
+ -moz-animation-duration: 100ms;
+}
+
+.slideupfade.in {
+ -webkit-transform: translate3d(0, 0, 0);
+ -webkit-animation-name: slideupfadeinfrombottom;
+ -moz-transform: translate3d(0, 0, 0);
+ -moz-animation-name: slideupfadeinfrombottom;
+ -webkit-animation-duration: 250ms;
+ -moz-animation-duration: 250ms;
+}
+
+.slideupfade.in.reverse {
+ -webkit-animation-name: fadein;
+ -moz-animation-name: fadein;
+ -webkit-animation-duration: 150ms;
+ -moz-animation-duration: 150ms;
+}
+
+.slideupfade.out.reverse {
+ -webkit-transform: translate3d(0, 5%, 0);
+ -moz-transform: translate3d(0, 5%, 0);
+ -webkit-animation-name: slideupfadeouttobottom;
+ -moz-animation-name: slideupfadeouttobottom;
+ -webkit-animation-duration: 200ms;
+ -moz-animation-duration: 200ms;
+}
+
+@-webkit-keyframes slideupfadeinfrombottom {
+ from {
+ opacity: 0;
+ -webkit-transform: translate3d(0, 5%, 0);
+ }
+ to {
+ opacity: 1;
+ -webkit-transform: translate3d(0, 0, 0);
+ }
+}
+@-moz-keyframes slideupfadeinfrombottom {
+ from {
+ opacity: 0;
+ -moz-transform: translate3d(0, 5%, 0);
+ }
+ to {
+ opacity: 1;
+ -moz-transform: translate3d(0, 0, 0);
+ }
+}
+
+@-webkit-keyframes slideupfadeouttobottom {
+ from {
+ opacity: 1;
+ -webkit-transform: translate3d(0, 0, 0);
+ }
+ to {
+ opacity: 0;
+ -webkit-transform: translate3d(0, 5%, 0);
+ }
+}
+@-moz-keyframes slideupfadeouttobottom {
+ from {
+ opacity: 1;
+ -moz-transform: translate3d(0, 0, 0);
+ }
+ to {
+ opacity: 0;
+ -moz-transform: translate3d(0, 5%, 0);
+ }
+}
+
+/* slide down + fade */
+
+.slidedownfade.out {
+ -webkit-animation-name: fadeout;
+ -moz-animation-name: fadeout;
+ -webkit-animation-duration: 100ms;
+ -moz-animation-duration: 100ms;
+}
+
+.slidedownfade.in {
+ -webkit-transform: translate3d(0, 0, 0);
+ -webkit-animation-name: slidedownfadeinfromtop;
+ -moz-transform: translate3d(0, 0, 0);
+ -moz-animation-name: slidedownfadeinfromtop;
+ -webkit-animation-duration: 250ms;
+ -moz-animation-duration: 250ms;
+}
+
+.slidedownfade.in.reverse {
+ -webkit-animation-name: fadein;
+ -moz-animation-name: fadein;
+ -webkit-animation-duration: 150ms;
+ -moz-animation-duration: 150ms;
+}
+
+.slidedownfade.out.reverse {
+ -webkit-transform: translate3d(0, -5%, 0);
+ -moz-transform: translate3d(0, -5%, 0);
+ -webkit-animation-name: slidedownfadeouttotop;
+ -moz-animation-name: slidedownfadeouttotop;
+ -webkit-animation-duration: 200ms;
+ -moz-animation-duration: 200ms;
+}
+
+@-webkit-keyframes slidedownfadeinfromtop {
+ from {
+ opacity: 0;
+ -webkit-transform: translate3d(0, -5%, 0);
+ }
+ to {
+ opacity: 1;
+ -webkit-transform: translate3d(0, 0, 0);
+ }
+}
+@-moz-keyframes slidedownfadeinfromtop {
+ from {
+ opacity: 0;
+ -moz-transform: translate3d(0, -5%, 0);
+ }
+ to {
+ opacity: 1;
+ -moz-transform: translate3d(0, 0, 0);
+ }
+}
+
+@-webkit-keyframes slidedownfadeouttotop {
+ from {
+ opacity: 1;
+ -webkit-transform: translate3d(0, 0, 0);
+ }
+ to {
+ opacity: 0;
+ -webkit-transform: translate3d(0, -5%, 0);
+ }
+}
+@-moz-keyframes slidedownfadeouttotop {
+ from {
+ opacity: 1;
+ -moz-transform: translate3d(0, 0, 0);
+ }
+ to {
+ opacity: 0;
+ -moz-transform: translate3d(0, -5%, 0);
+ }
+}
+
/* slide fade */
.slidefade.out {
/***************************************************************************
Body
***************************************************************************/
+/* B011 : Main Background color */
+/* B012 : Main font color */
/***************************************************************************
Naviframe
***************************************************************************/
-/* #3b73b6 *//* title text */
+/* B042 : title text */
/* B052L4 : Title text button */
/* B052L5 : Title text button press */
/* B052L1P : Title text button press bg */
/***************************************************************************
Button(connected with other winset)
***************************************************************************/
-.LESSbutton_box_style {
- color: #363133;
-}
-.LESSbutton_up_style {
- background: #ebe8e3;
- background: -webkit-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -moz-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -o-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -ms-linear-gradient(top, #ebe8e3, #eae7e2);
-}
-.LESSbutton_box_style {
- background: #ebe8e3;
- background: -webkit-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -moz-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -o-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -ms-linear-gradient(top, #ebe8e3, #eae7e2);
- border: 1px solid;
- border-color: #dcdad3;
- -o-box-shadow: 0 0 1px 1px #ffffff;
- -ms-box-shadow: 0 0 1px 1px #ffffff;
- -moz-box-shadow: 0 0 1px 1px #ffffff;
- -webkit-box-shadow: 0 0 1px 1px #ffffff;
- box-shadow: 0 0 1px 1px #ffffff;
-}
-.LESSbutton_inner_box_style {
- background: #f7f5ee;
- background: -webkit-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -ms-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -o-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -moz-linear-gradient(top, #faf7f2, #f8f5f0);
- -o-box-shadow: none;
- -ms-box-shadow: none;
- -moz-box-shadow: none;
- -webkit-box-shadow: none;
- box-shadow: none;
-}
-.LESSbutton_inner_pressstyle {
- color: #f8f6ef;
-}
-.LESSbutton_text1_style {
- font-family: Helvetica, Arial, sans-serif;
- font-weight: normal;
- font-size: 1.0rem;
- font-style: normal;
- color: #000000;
-}
-.LESSbutton_hover_style {
- color: #363133;
-}
-.LESSbutton_down_style {
- background: #3b73b6;
- color: #f8f6ef;
-}
-.LESSbutton_edit_style {
- background: #c95858;
- background: -webkit-gradient(linear, left top, left bottom, from(#c95858), to(#a12828));
- background: -moz_linear-gradient(top, #c95858, #a12828);
-}
+
+
+
+
+
+
+
+
+
/***************************************************************************
contextual popup
***************************************************************************/
-/* #1A5274 */
/***************************************************************************
Scrollview
***************************************************************************/
Date Time picker
***************************************************************************/
/***************************************************************************
- DaySelector
-***************************************************************************/
-/* #00a8e7 */
-/* #f01402 */
-/* #f9f9f9 *//* #f9f9f9 */.LESSDayselectorButtonNormal {
- background: #7e9db2;
- background: -webkit-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -moz-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -ms-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -o-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: linear-gradient(top, #7e9db2 0%, #547990 100%);
-}
-.LESSDayaselectorButtonPress {
- background: #3b7796;
- background: -webkit-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -moz-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -ms-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -o-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: linear-gradient(top, #3b7796 0%, #2f5b75 100%);
-}
-/***************************************************************************
- OptionHeader
-***************************************************************************/
-/* #f9f9f9 */
-/***************************************************************************
SegmentControl
***************************************************************************/
-/* #F9F9F9*/
-/* #F9F9F9*/
-/***************************************************************************
- ControlGroup
-***************************************************************************/
-/* 00_divider_line.9.png */
+/* B052L4 : Title text button */
/***************************************************************************
Popup
***************************************************************************/
/* popup_title_bg.png */
/* maybe not use only popupwindow*/
-.LESSpopup_button_style {
- /* background: @color_popup_buttonbg;
- background: @color_popup_buttonbg_webkit;
- background: @color_popup_buttonbg_moz;
- background: @color_popup_buttonbg_ms;
- background: @color_popup_buttonbg_o;
- color: @color_popup_buttontext;*/
-}
-.LESSpopup_button_hover_style {
- background: #5e88a3;
-}
-.LESSpopup_button_press_style {
- background: #43a0d9;
- background: -webkit-gradient(linear, left top, left bottom, from(#43a0d9), to(#388bb9));
- background: -moz-linear-gradient(top, #43a0d9, #388bb9);
- background: -ms-linear-gradient(top, #43a0d9, #388bb9);
- background: -o-linear-gradient(top, #43a0d9, #388bb9);
-}
-/***************************************************************************
- Button
-***************************************************************************/
-.LESStoggleswitch_on_style {
- background: #2a7eac;
- background: -webkit-gradient(linear, left top, left bottom, from(#2174a7), to(#4ba5db));
- background: -moz-linear-gradient(top, #2174a7, #4ba5db);
- border-radius: 4px;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
-}
-.LESStoggleswitch_off_style {
- color: #cbcbcb;
- background: #97a1a7;
- background: -webkit-gradient(linear, left top, left bottom, from(#727272), to(#8d8d8d));
- background: -moz-linear-gradient(top, #727272, #8d8d8d);
- border-radius: 4px;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
-}
-.LESStoggleswitch_reed_style {
- background: #fdfdfd;
- background: -webkit-gradient(linear, left top, left bottom, from(#fdfdfd), to(#e7e7e7));
- background: -moz-linear-gradient(top, #fdfdfd, #e7e7e7);
- border-radius: 2px;
- -webkit-border-radius: 2px;
- -moz-border-radius: 2px;
-}
-.LESSbutton_editpress_style {
- background: #931818;
- background: -webkit-gradient(linear, left top, left bottom, from(#931818), to(#6e1717));
- background: -moz-linear-gradient(top, #931818, #6e1717);
-}
-.LESSbutton_edit_padding {
- padding: 0.5em 0.8em;
-}
+
+
/***************************************************************************
Tickernoti
***************************************************************************/
Smallpopup
***************************************************************************/
/***************************************************************************
- No Contents
-***************************************************************************/
-/***************************************************************************
Slider
***************************************************************************/
/***************************************************************************
/***************************************************************************
multimediaview
***************************************************************************/
-.LESSmultimediaview_bar_active_style {
- background-color: #4a84c9;
- background-image: -webkit-gradient(linear, left top, left bottom, from(#6289d9), to(#295b98));
- background-image: -moz-linear-gradient(top, #6289d9, #295b98);
- background-image: -o-linear-gradient(top, #6289d9, #295b98);
- background-image: -ms-linear-gradient(top, #6289d9, #295b98);
-}
-.LESSmultimediaview_bar_handle_style {
- background-color: #f9f9f9;
- background-image: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#e6e6e6));
- background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: -ms-linear-gradient(top, #ffffff, #e6e6e6);
-}
+
+
/***************************************************************************
tokentextarea
***************************************************************************/
/***************************************************************************
+ Splitview
***************************************************************************/
.ui-header,
.ui-footer,
border-left-width: 0;
border-right-width: 0;
}
-.ui-header-fixed, .ui-footer-fixed {
+.ui-header-fixed,
+.ui-footer-fixed {
z-index: 1000;
- -webkit-transform: translatez(0);
+ -webkit-transform: translateZ(0);
/* Force header/footer rendering to go through the same rendering pipeline as native page scrolling. */
}
-.ui-footer-duplicate, .ui-page-fullscreen .ui-fixed-inline {
+.ui-footer-duplicate,
+.ui-page-fullscreen .ui-fixed-inline {
display: none;
}
-.ui-page-fullscreen .ui-header, .ui-page-fullscreen .ui-footer {
+.ui-page-fullscreen .ui-header,
+.ui-page-fullscreen .ui-footer {
opacity: .9;
}
/*
/***************************************************************************
Body
***************************************************************************/
+/* B011 : Main Background color */
+/* B012 : Main font color */
/***************************************************************************
Naviframe
***************************************************************************/
-/* #3b73b6 *//* title text */
+/* B042 : title text */
/* B052L4 : Title text button */
/* B052L5 : Title text button press */
/* B052L1P : Title text button press bg */
/***************************************************************************
Button(connected with other winset)
***************************************************************************/
-.LESSbutton_box_style {
- color: #363133;
-}
-.LESSbutton_up_style {
- background: #ebe8e3;
- background: -webkit-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -moz-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -o-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -ms-linear-gradient(top, #ebe8e3, #eae7e2);
-}
-.LESSbutton_box_style {
- background: #ebe8e3;
- background: -webkit-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -moz-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -o-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -ms-linear-gradient(top, #ebe8e3, #eae7e2);
- border: 1px solid;
- border-color: #dcdad3;
- -o-box-shadow: 0 0 1px 1px #ffffff;
- -ms-box-shadow: 0 0 1px 1px #ffffff;
- -moz-box-shadow: 0 0 1px 1px #ffffff;
- -webkit-box-shadow: 0 0 1px 1px #ffffff;
- box-shadow: 0 0 1px 1px #ffffff;
-}
-.LESSbutton_inner_box_style {
- background: #f7f5ee;
- background: -webkit-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -ms-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -o-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -moz-linear-gradient(top, #faf7f2, #f8f5f0);
- -o-box-shadow: none;
- -ms-box-shadow: none;
- -moz-box-shadow: none;
- -webkit-box-shadow: none;
- box-shadow: none;
-}
-.LESSbutton_inner_pressstyle {
- color: #f8f6ef;
-}
-.LESSbutton_text1_style {
- font-family: Helvetica, Arial, sans-serif;
- font-weight: normal;
- font-size: 1.0rem;
- font-style: normal;
- color: #000000;
-}
-.LESSbutton_hover_style {
- color: #363133;
-}
-.LESSbutton_down_style {
- background: #3b73b6;
- color: #f8f6ef;
-}
-.LESSbutton_edit_style {
- background: #c95858;
- background: -webkit-gradient(linear, left top, left bottom, from(#c95858), to(#a12828));
- background: -moz_linear-gradient(top, #c95858, #a12828);
-}
-/***************************************************************************
- contextual popup
+
+
+
+
+
+
+
+
+
+/***************************************************************************
+ contextual popup
***************************************************************************/
-/* #1A5274 */
/***************************************************************************
Scrollview
***************************************************************************/
Date Time picker
***************************************************************************/
/***************************************************************************
- DaySelector
-***************************************************************************/
-/* #00a8e7 */
-/* #f01402 */
-/* #f9f9f9 *//* #f9f9f9 */.LESSDayselectorButtonNormal {
- background: #7e9db2;
- background: -webkit-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -moz-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -ms-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -o-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: linear-gradient(top, #7e9db2 0%, #547990 100%);
-}
-.LESSDayaselectorButtonPress {
- background: #3b7796;
- background: -webkit-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -moz-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -ms-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -o-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: linear-gradient(top, #3b7796 0%, #2f5b75 100%);
-}
-/***************************************************************************
- OptionHeader
-***************************************************************************/
-/* #f9f9f9 */
-/***************************************************************************
SegmentControl
***************************************************************************/
-/* #F9F9F9*/
-/* #F9F9F9*/
-/***************************************************************************
- ControlGroup
-***************************************************************************/
-/* 00_divider_line.9.png */
+/* B052L4 : Title text button */
/***************************************************************************
Popup
***************************************************************************/
/* popup_title_bg.png */
/* maybe not use only popupwindow*/
-.LESSpopup_button_style {
- /* background: @color_popup_buttonbg;
- background: @color_popup_buttonbg_webkit;
- background: @color_popup_buttonbg_moz;
- background: @color_popup_buttonbg_ms;
- background: @color_popup_buttonbg_o;
- color: @color_popup_buttontext;*/
-}
-.LESSpopup_button_hover_style {
- background: #5e88a3;
-}
-.LESSpopup_button_press_style {
- background: #43a0d9;
- background: -webkit-gradient(linear, left top, left bottom, from(#43a0d9), to(#388bb9));
- background: -moz-linear-gradient(top, #43a0d9, #388bb9);
- background: -ms-linear-gradient(top, #43a0d9, #388bb9);
- background: -o-linear-gradient(top, #43a0d9, #388bb9);
-}
-/***************************************************************************
- Button
-***************************************************************************/
-.LESStoggleswitch_on_style {
- background: #2a7eac;
- background: -webkit-gradient(linear, left top, left bottom, from(#2174a7), to(#4ba5db));
- background: -moz-linear-gradient(top, #2174a7, #4ba5db);
- border-radius: 4px;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
-}
-.LESStoggleswitch_off_style {
- color: #cbcbcb;
- background: #97a1a7;
- background: -webkit-gradient(linear, left top, left bottom, from(#727272), to(#8d8d8d));
- background: -moz-linear-gradient(top, #727272, #8d8d8d);
- border-radius: 4px;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
-}
-.LESStoggleswitch_reed_style {
- background: #fdfdfd;
- background: -webkit-gradient(linear, left top, left bottom, from(#fdfdfd), to(#e7e7e7));
- background: -moz-linear-gradient(top, #fdfdfd, #e7e7e7);
- border-radius: 2px;
- -webkit-border-radius: 2px;
- -moz-border-radius: 2px;
-}
-.LESSbutton_editpress_style {
- background: #931818;
- background: -webkit-gradient(linear, left top, left bottom, from(#931818), to(#6e1717));
- background: -moz-linear-gradient(top, #931818, #6e1717);
-}
-.LESSbutton_edit_padding {
- padding: 0.5em 0.8em;
-}
+
+
/***************************************************************************
Tickernoti
***************************************************************************/
Smallpopup
***************************************************************************/
/***************************************************************************
- No Contents
-***************************************************************************/
-/***************************************************************************
Slider
***************************************************************************/
/***************************************************************************
/***************************************************************************
multimediaview
***************************************************************************/
-.LESSmultimediaview_bar_active_style {
- background-color: #4a84c9;
- background-image: -webkit-gradient(linear, left top, left bottom, from(#6289d9), to(#295b98));
- background-image: -moz-linear-gradient(top, #6289d9, #295b98);
- background-image: -o-linear-gradient(top, #6289d9, #295b98);
- background-image: -ms-linear-gradient(top, #6289d9, #295b98);
-}
-.LESSmultimediaview_bar_handle_style {
- background-color: #f9f9f9;
- background-image: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#e6e6e6));
- background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: -ms-linear-gradient(top, #ffffff, #e6e6e6);
-}
+
+
/***************************************************************************
tokentextarea
***************************************************************************/
/***************************************************************************
+ Splitview
***************************************************************************/
/* Button colors are defined in config.less
vertical-align: middle;
}
/* wongi_1018 : For button align. */
-.ui-btn:focus, .ui-btn:active {
+.ui-btn:focus,
+.ui-btn:active {
outline: none;
}
-.ui-header .ui-btn, .ui-footer .ui-btn, .ui-bar .ui-btn {
+.ui-header .ui-btn,
+.ui-footer .ui-btn,
+.ui-bar .ui-btn {
display: inline-block;
font-size: 0.5909090909090909rem;
margin: 0;
position: relative;
zoom: 1;
}
-.ui-header .ui-btn-inner, .ui-footer .ui-btn-inner, .ui-bar .ui-btn-inner {
- padding: 0.7em 0 0.7em;
-}
-/* wongi_1024 : Button text middle align */
-.ui-header .ui-btn-inner.ui-btn-icon-only, .ui-footer .ui-btn-inner, .ui-bar .ui-btn-inner.ui-btn-icon-only {
- padding: 0.4em 0.36363636363636365rem 0.5em;
-}
-/* wongi_1024 : Button text middle align */
.ui-btn-icon-notext {
width: 1.6363636363636365rem;
height: 1.6363636363636365rem;
.ui-btn-icon-left .ui-btn-inner {
padding-left: 1.5rem;
}
-.ui-header .ui-btn-icon-left .ui-btn-inner, .ui-footer .ui-btn-icon-left .ui-btn-inner, .ui-bar .ui-btn-icon-left .ui-btn-inner {
+.ui-header .ui-btn-icon-left .ui-btn-inner,
+.ui-footer .ui-btn-icon-left .ui-btn-inner,
+.ui-bar .ui-btn-icon-left .ui-btn-inner {
padding-left: 1.2272727272727273rem;
}
.ui-btn-icon-right .ui-btn-inner {
padding-right: 1.5rem;
}
-.ui-header .ui-btn-icon-right .ui-btn-inner, .ui-footer .ui-btn-icon-right .ui-btn-inner, .ui-bar .ui-btn-icon-right .ui-btn-inner {
+.ui-header .ui-btn-icon-right .ui-btn-inner,
+.ui-footer .ui-btn-icon-right .ui-btn-inner,
+.ui-bar .ui-btn-icon-right .ui-btn-inner {
padding-right: 1.2272727272727273rem;
}
.ui-btn-icon-top .ui-btn-inner {
padding-top: 1.2272727272727273rem;
}
-.ui-header .ui-btn-icon-top .ui-btn-inner, .ui-footer .ui-btn-icon-top .ui-btn-inner, .ui-bar .ui-btn-icon-top .ui-btn-inner {
+.ui-header .ui-btn-icon-top .ui-btn-inner,
+.ui-footer .ui-btn-icon-top .ui-btn-inner,
+.ui-bar .ui-btn-icon-top .ui-btn-inner {
padding-top: 1.2272727272727273rem;
}
.ui-btn-icon-bottom .ui-btn-inner {
padding-bottom: 1.5rem;
}
-.ui-header .ui-btn-icon-bottom .ui-btn-inner, .ui-footer .ui-btn-icon-bottom .ui-btn-inner, .ui-bar .ui-btn-icon-bottom .ui-btn-inner {
+.ui-header .ui-btn-icon-bottom .ui-btn-inner,
+.ui-footer .ui-btn-icon-bottom .ui-btn-inner,
+.ui-bar .ui-btn-icon-bottom .ui-btn-inner {
padding-bottom: 1.2272727272727273rem;
}
/*btn icon positioning*/
.ui-btn-icon-notext .ui-icon {
display: block;
}
-.ui-btn-icon-left .ui-icon, .ui-btn-icon-right .ui-icon, .ui-btn-icon-circle .ui-icon {
+.ui-btn-icon-left .ui-icon,
+.ui-btn-icon-right .ui-icon,
+.ui-btn-icon-circle .ui-icon {
position: absolute;
/*top: 50%; margin-top: -9px;*/
}
/* wongi_1018 : do not use. No more use 18px default icons. */
-.ui-btn-icon-top .ui-icon, .ui-btn-icon-bottom .ui-icon {
+.ui-btn-icon-top .ui-icon,
+.ui-btn-icon-bottom .ui-icon {
position: absolute;
left: 50%;
margin-left: -9px;
.ui-btn-icon-bottom .ui-icon {
bottom: 0rem;
}
-.ui-header .ui-btn-icon-right .ui-icon, .ui-footer .ui-btn-icon-right .ui-icon, .ui-bar .ui-btn-icon-right .ui-icon {
+.ui-header .ui-btn-icon-right .ui-icon,
+.ui-footer .ui-btn-icon-right .ui-icon,
+.ui-bar .ui-btn-icon-right .ui-icon {
right: 0.18181818181818182rem;
}
-.ui-header .ui-btn-icon-top .ui-icon, .ui-footer .ui-btn-icon-top .ui-icon, .ui-bar .ui-btn-icon-top .ui-icon {
+.ui-header .ui-btn-icon-top .ui-icon,
+.ui-footer .ui-btn-icon-top .ui-icon,
+.ui-bar .ui-btn-icon-top .ui-icon {
top: 0.18181818181818182rem;
}
-.ui-header .ui-btn-icon-bottom .ui-icon, .ui-footer .ui-btn-icon-bottom .ui-icon, .ui-bar .ui-btn-icon-bottom .ui-icon {
+.ui-header .ui-btn-icon-bottom .ui-icon,
+.ui-footer .ui-btn-icon-bottom .ui-icon,
+.ui-bar .ui-btn-icon-bottom .ui-icon {
bottom: 0.18181818181818182rem;
}
/*hiding native button,inputs */
.ui-header .ui-btn.ui-btn-box-s.ui-btn-down-s:not(.ui-input-cancel):not(.ui-btn-search-front-icon) .ui-btn-inner,
.ui-btn.ui-btn-back.ui-btn-up-s .ui-btn-inner,
.ui-btn.ui-btn-back.ui-btn-hover-s .ui-btn-inner,
-.ui-btn.ui-btn-back.ui-btn-down-s .ui-btn-inner {
+.ui-btn.ui-btn-back.ui-btn-down-s .ui-btn-inner,
+.ui-btn.ui-btn-footer-down.ui-btn-up-s > .ui-btn-inner,
+.ui-btn.ui-btn-footer-down.ui-btn-hover-s > .ui-btn-inner,
+.ui-btn.ui-btn-footer-down.ui-btn-down-s > .ui-btn-inner {
background: transparent;
border: none;
box-shadow: none;
}
-.ui-btn-icon-top .ui-btn-inner.ui-btn-hastxt, .ui-li .ui-btn-icon-top .ui-btn-inner.ui-btn-hastxt {
+.ui-btn-icon-top .ui-btn-inner.ui-btn-hastxt,
+.ui-li .ui-btn-icon-top .ui-btn-inner.ui-btn-hastxt {
padding-top: 2.3636363636363638rem;
}
-.ui-btn-icon-bottom .ui-btn-inner.ui-btn-hastxt, .ui-li .ui-btn-icon-bottom .ui-btn-inner.ui-btn-hastxt {
+.ui-btn-icon-bottom .ui-btn-inner.ui-btn-hastxt,
+.ui-li .ui-btn-icon-bottom .ui-btn-inner.ui-btn-hastxt {
padding-bottom: 2.3636363636363638rem;
}
/* wongi_1017 : Icons */
padding-top: 1.4545454545454546rem;
}
.ui-icon {
- z-index: 10;
background-repeat: no-repeat;
vertical-align: middle;
background-position: 0% 0%;
.ui-btn-box.s .ui-icon {
position: absolute;
}
-.ui-btn-box-s.ui-btn-icon-left .ui-icon, .ui-btn-box-s.ui-btn-icon-right .ui-icon {
+.ui-btn-box-s.ui-btn-icon-left .ui-icon,
+.ui-btn-box-s.ui-btn-icon-right .ui-icon {
margin-top: -0.7272727272727273rem;
top: 50%;
}
-.ui-btn-box-s.ui-btn-icon-top .ui-icon, .ui-btn-box-s.ui-btn-icon-bottom .ui-icon {
+.ui-btn-box-s.ui-btn-icon-top .ui-icon,
+.ui-btn-box-s.ui-btn-icon-bottom .ui-icon {
margin-left: -0.7272727272727273rem;
left: 50%;
}
background-image: url(images/00_indexlist_icon_closed.png);
}
/* Pressed images */
-.ui-btn-down-s .ui-icon-bg, .ui-btn-down-s.ui-tizen-icon-bg {
+.ui-btn-down-s .ui-icon-bg,
+.ui-btn-down-s.ui-tizen-icon-bg {
/* Overlap original property */
width: 1.4545454545454546rem;
padding: 0.7272727272727273rem 0.7272727272727273rem;
}
.ui-btn-icon-only .ui-btn-text {
- left: -9999px;
- display: none;
+ display: block;
+ width: 0;
+ height: 0;
+ overflow: hidden;
}
.ui-btn.ui-btn-corner-all {
-o-border-radius: 1.2em ! important;
-webkit-border-radius: 1.2em ! important;
border-radius: 1.2em ! important;
}
-.ui-btn.ui-btn-icon-nobg, .ui-btn .ui-btn-icon-nobg {
+.ui-btn.ui-btn-icon-nobg,
+.ui-btn .ui-btn-icon-nobg {
background: transparent;
background-color: transparent;
border: none;
background: -moz_linear-gradient(top, #c95858, #a12828);
}
.ui-btn-box-s {
- color: #363133;
+ color: #3a3a3a;
background: #ebe8e3;
background: -webkit-linear-gradient(top, #ebe8e3, #eae7e2);
background: -moz-linear-gradient(top, #ebe8e3, #eae7e2);
/***************************************************************************
Body
***************************************************************************/
+/* B011 : Main Background color */
+/* B012 : Main font color */
/***************************************************************************
Naviframe
***************************************************************************/
-/* #3b73b6 *//* title text */
+/* B042 : title text */
/* B052L4 : Title text button */
/* B052L5 : Title text button press */
/* B052L1P : Title text button press bg */
/***************************************************************************
Button(connected with other winset)
***************************************************************************/
-.LESSbutton_box_style {
- color: #363133;
-}
-.LESSbutton_up_style {
- background: #ebe8e3;
- background: -webkit-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -moz-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -o-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -ms-linear-gradient(top, #ebe8e3, #eae7e2);
-}
-.LESSbutton_box_style {
- background: #ebe8e3;
- background: -webkit-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -moz-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -o-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -ms-linear-gradient(top, #ebe8e3, #eae7e2);
- border: 1px solid;
- border-color: #dcdad3;
- -o-box-shadow: 0 0 1px 1px #ffffff;
- -ms-box-shadow: 0 0 1px 1px #ffffff;
- -moz-box-shadow: 0 0 1px 1px #ffffff;
- -webkit-box-shadow: 0 0 1px 1px #ffffff;
- box-shadow: 0 0 1px 1px #ffffff;
-}
-.LESSbutton_inner_box_style {
- background: #f7f5ee;
- background: -webkit-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -ms-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -o-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -moz-linear-gradient(top, #faf7f2, #f8f5f0);
- -o-box-shadow: none;
- -ms-box-shadow: none;
- -moz-box-shadow: none;
- -webkit-box-shadow: none;
- box-shadow: none;
-}
-.LESSbutton_inner_pressstyle {
- color: #f8f6ef;
-}
-.LESSbutton_text1_style {
- font-family: Helvetica, Arial, sans-serif;
- font-weight: normal;
- font-size: 1.0rem;
- font-style: normal;
- color: #000000;
-}
-.LESSbutton_hover_style {
- color: #363133;
-}
-.LESSbutton_down_style {
- background: #3b73b6;
- color: #f8f6ef;
-}
-.LESSbutton_edit_style {
- background: #c95858;
- background: -webkit-gradient(linear, left top, left bottom, from(#c95858), to(#a12828));
- background: -moz_linear-gradient(top, #c95858, #a12828);
-}
+
+
+
+
+
+
+
+
+
/***************************************************************************
contextual popup
***************************************************************************/
-/* #1A5274 */
/***************************************************************************
Scrollview
***************************************************************************/
Date Time picker
***************************************************************************/
/***************************************************************************
- DaySelector
-***************************************************************************/
-/* #00a8e7 */
-/* #f01402 */
-/* #f9f9f9 *//* #f9f9f9 */.LESSDayselectorButtonNormal {
- background: #7e9db2;
- background: -webkit-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -moz-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -ms-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -o-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: linear-gradient(top, #7e9db2 0%, #547990 100%);
-}
-.LESSDayaselectorButtonPress {
- background: #3b7796;
- background: -webkit-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -moz-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -ms-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -o-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: linear-gradient(top, #3b7796 0%, #2f5b75 100%);
-}
-/***************************************************************************
- OptionHeader
-***************************************************************************/
-/* #f9f9f9 */
-/***************************************************************************
SegmentControl
***************************************************************************/
-/* #F9F9F9*/
-/* #F9F9F9*/
-/***************************************************************************
- ControlGroup
-***************************************************************************/
-/* 00_divider_line.9.png */
+/* B052L4 : Title text button */
/***************************************************************************
Popup
***************************************************************************/
/* popup_title_bg.png */
/* maybe not use only popupwindow*/
-.LESSpopup_button_style {
- /* background: @color_popup_buttonbg;
- background: @color_popup_buttonbg_webkit;
- background: @color_popup_buttonbg_moz;
- background: @color_popup_buttonbg_ms;
- background: @color_popup_buttonbg_o;
- color: @color_popup_buttontext;*/
-}
-.LESSpopup_button_hover_style {
- background: #5e88a3;
-}
-.LESSpopup_button_press_style {
- background: #43a0d9;
- background: -webkit-gradient(linear, left top, left bottom, from(#43a0d9), to(#388bb9));
- background: -moz-linear-gradient(top, #43a0d9, #388bb9);
- background: -ms-linear-gradient(top, #43a0d9, #388bb9);
- background: -o-linear-gradient(top, #43a0d9, #388bb9);
-}
-/***************************************************************************
- Button
-***************************************************************************/
-.LESStoggleswitch_on_style {
- background: #2a7eac;
- background: -webkit-gradient(linear, left top, left bottom, from(#2174a7), to(#4ba5db));
- background: -moz-linear-gradient(top, #2174a7, #4ba5db);
- border-radius: 4px;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
-}
-.LESStoggleswitch_off_style {
- color: #cbcbcb;
- background: #97a1a7;
- background: -webkit-gradient(linear, left top, left bottom, from(#727272), to(#8d8d8d));
- background: -moz-linear-gradient(top, #727272, #8d8d8d);
- border-radius: 4px;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
-}
-.LESStoggleswitch_reed_style {
- background: #fdfdfd;
- background: -webkit-gradient(linear, left top, left bottom, from(#fdfdfd), to(#e7e7e7));
- background: -moz-linear-gradient(top, #fdfdfd, #e7e7e7);
- border-radius: 2px;
- -webkit-border-radius: 2px;
- -moz-border-radius: 2px;
-}
-.LESSbutton_editpress_style {
- background: #931818;
- background: -webkit-gradient(linear, left top, left bottom, from(#931818), to(#6e1717));
- background: -moz-linear-gradient(top, #931818, #6e1717);
-}
-.LESSbutton_edit_padding {
- padding: 0.5em 0.8em;
-}
+
+
/***************************************************************************
Tickernoti
***************************************************************************/
Smallpopup
***************************************************************************/
/***************************************************************************
- No Contents
-***************************************************************************/
-/***************************************************************************
Slider
***************************************************************************/
/***************************************************************************
/***************************************************************************
multimediaview
***************************************************************************/
-.LESSmultimediaview_bar_active_style {
- background-color: #4a84c9;
- background-image: -webkit-gradient(linear, left top, left bottom, from(#6289d9), to(#295b98));
- background-image: -moz-linear-gradient(top, #6289d9, #295b98);
- background-image: -o-linear-gradient(top, #6289d9, #295b98);
- background-image: -ms-linear-gradient(top, #6289d9, #295b98);
-}
-.LESSmultimediaview_bar_handle_style {
- background-color: #f9f9f9;
- background-image: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#e6e6e6));
- background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: -ms-linear-gradient(top, #ffffff, #e6e6e6);
-}
+
+
/***************************************************************************
tokentextarea
***************************************************************************/
/***************************************************************************
+ Splitview
***************************************************************************/
.ui-collapsible-inset {
margin: .5em 0;
.ui-collapsible-set .ui-collapsible:not(.ui-collapsible-inset) .ui-collapsible-heading .ui-btn {
border-top-width: 1px;
}
+.ui-collapsible-heading,
+.ui-collapsible-content > li {
+ position: relative;
+}
.ui-collapsible-heading {
font-size: 1rem;
display: block;
.ui-collapsible-heading .ui-btn-text {
color: #000000;
}
-.ui-collapsible-heading .ui-btn-inner, .ui-collapsible-heading .ui-btn-icon-left .ui-btn-inner {
+.ui-collapsible-heading .ui-btn-inner,
+.ui-collapsible-heading .ui-btn-icon-left .ui-btn-inner {
padding-left: 40px;
}
.ui-collapsible-heading .ui-btn-icon-right .ui-btn-inner {
padding-left: 12px;
padding-right: 40px;
}
-.ui-collapsible-heading .ui-btn-icon-top .ui-btn-inner, .ui-collapsible-heading .ui-btn-icon-bottom .ui-btn-inner {
+.ui-collapsible-heading .ui-btn-icon-top .ui-btn-inner,
+.ui-collapsible-heading .ui-btn-icon-bottom .ui-btn-inner {
padding-right: 40px;
text-align: center;
}
border-left-width: 0;
border-right-width: 0;
border-top: none;
- /* Overrides ui-body-* */
-
background-image: none;
/* Overrides ui-body-* */
/***************************************************************************
Body
***************************************************************************/
+/* B011 : Main Background color */
+/* B012 : Main font color */
/***************************************************************************
Naviframe
***************************************************************************/
-/* #3b73b6 *//* title text */
+/* B042 : title text */
/* B052L4 : Title text button */
/* B052L5 : Title text button press */
/* B052L1P : Title text button press bg */
/***************************************************************************
Button(connected with other winset)
***************************************************************************/
-.LESSbutton_box_style {
- color: #363133;
-}
-.LESSbutton_up_style {
- background: #ebe8e3;
- background: -webkit-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -moz-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -o-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -ms-linear-gradient(top, #ebe8e3, #eae7e2);
-}
-.LESSbutton_box_style {
- background: #ebe8e3;
- background: -webkit-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -moz-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -o-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -ms-linear-gradient(top, #ebe8e3, #eae7e2);
- border: 1px solid;
- border-color: #dcdad3;
- -o-box-shadow: 0 0 1px 1px #ffffff;
- -ms-box-shadow: 0 0 1px 1px #ffffff;
- -moz-box-shadow: 0 0 1px 1px #ffffff;
- -webkit-box-shadow: 0 0 1px 1px #ffffff;
- box-shadow: 0 0 1px 1px #ffffff;
-}
-.LESSbutton_inner_box_style {
- background: #f7f5ee;
- background: -webkit-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -ms-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -o-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -moz-linear-gradient(top, #faf7f2, #f8f5f0);
- -o-box-shadow: none;
- -ms-box-shadow: none;
- -moz-box-shadow: none;
- -webkit-box-shadow: none;
- box-shadow: none;
-}
-.LESSbutton_inner_pressstyle {
- color: #f8f6ef;
-}
-.LESSbutton_text1_style {
- font-family: Helvetica, Arial, sans-serif;
- font-weight: normal;
- font-size: 1.0rem;
- font-style: normal;
- color: #000000;
-}
-.LESSbutton_hover_style {
- color: #363133;
-}
-.LESSbutton_down_style {
- background: #3b73b6;
- color: #f8f6ef;
-}
-.LESSbutton_edit_style {
- background: #c95858;
- background: -webkit-gradient(linear, left top, left bottom, from(#c95858), to(#a12828));
- background: -moz_linear-gradient(top, #c95858, #a12828);
-}
+
+
+
+
+
+
+
+
+
/***************************************************************************
contextual popup
***************************************************************************/
-/* #1A5274 */
/***************************************************************************
Scrollview
***************************************************************************/
Date Time picker
***************************************************************************/
/***************************************************************************
- DaySelector
-***************************************************************************/
-/* #00a8e7 */
-/* #f01402 */
-/* #f9f9f9 *//* #f9f9f9 */.LESSDayselectorButtonNormal {
- background: #7e9db2;
- background: -webkit-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -moz-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -ms-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -o-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: linear-gradient(top, #7e9db2 0%, #547990 100%);
-}
-.LESSDayaselectorButtonPress {
- background: #3b7796;
- background: -webkit-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -moz-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -ms-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -o-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: linear-gradient(top, #3b7796 0%, #2f5b75 100%);
-}
-/***************************************************************************
- OptionHeader
-***************************************************************************/
-/* #f9f9f9 */
-/***************************************************************************
SegmentControl
***************************************************************************/
-/* #F9F9F9*/
-/* #F9F9F9*/
-/***************************************************************************
- ControlGroup
-***************************************************************************/
-/* 00_divider_line.9.png */
+/* B052L4 : Title text button */
/***************************************************************************
Popup
***************************************************************************/
/* popup_title_bg.png */
/* maybe not use only popupwindow*/
-.LESSpopup_button_style {
- /* background: @color_popup_buttonbg;
- background: @color_popup_buttonbg_webkit;
- background: @color_popup_buttonbg_moz;
- background: @color_popup_buttonbg_ms;
- background: @color_popup_buttonbg_o;
- color: @color_popup_buttontext;*/
-}
-.LESSpopup_button_hover_style {
- background: #5e88a3;
-}
-.LESSpopup_button_press_style {
- background: #43a0d9;
- background: -webkit-gradient(linear, left top, left bottom, from(#43a0d9), to(#388bb9));
- background: -moz-linear-gradient(top, #43a0d9, #388bb9);
- background: -ms-linear-gradient(top, #43a0d9, #388bb9);
- background: -o-linear-gradient(top, #43a0d9, #388bb9);
-}
-/***************************************************************************
- Button
-***************************************************************************/
-.LESStoggleswitch_on_style {
- background: #2a7eac;
- background: -webkit-gradient(linear, left top, left bottom, from(#2174a7), to(#4ba5db));
- background: -moz-linear-gradient(top, #2174a7, #4ba5db);
- border-radius: 4px;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
-}
-.LESStoggleswitch_off_style {
- color: #cbcbcb;
- background: #97a1a7;
- background: -webkit-gradient(linear, left top, left bottom, from(#727272), to(#8d8d8d));
- background: -moz-linear-gradient(top, #727272, #8d8d8d);
- border-radius: 4px;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
-}
-.LESStoggleswitch_reed_style {
- background: #fdfdfd;
- background: -webkit-gradient(linear, left top, left bottom, from(#fdfdfd), to(#e7e7e7));
- background: -moz-linear-gradient(top, #fdfdfd, #e7e7e7);
- border-radius: 2px;
- -webkit-border-radius: 2px;
- -moz-border-radius: 2px;
-}
-.LESSbutton_editpress_style {
- background: #931818;
- background: -webkit-gradient(linear, left top, left bottom, from(#931818), to(#6e1717));
- background: -moz-linear-gradient(top, #931818, #6e1717);
-}
-.LESSbutton_edit_padding {
- padding: 0.5em 0.8em;
-}
+
+
/***************************************************************************
Tickernoti
***************************************************************************/
Smallpopup
***************************************************************************/
/***************************************************************************
- No Contents
-***************************************************************************/
-/***************************************************************************
Slider
***************************************************************************/
/***************************************************************************
/***************************************************************************
multimediaview
***************************************************************************/
-.LESSmultimediaview_bar_active_style {
- background-color: #4a84c9;
- background-image: -webkit-gradient(linear, left top, left bottom, from(#6289d9), to(#295b98));
- background-image: -moz-linear-gradient(top, #6289d9, #295b98);
- background-image: -o-linear-gradient(top, #6289d9, #295b98);
- background-image: -ms-linear-gradient(top, #6289d9, #295b98);
-}
-.LESSmultimediaview_bar_handle_style {
- background-color: #f9f9f9;
- background-image: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#e6e6e6));
- background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: -ms-linear-gradient(top, #ffffff, #e6e6e6);
-}
+
+
/***************************************************************************
tokentextarea
***************************************************************************/
/***************************************************************************
+ Splitview
***************************************************************************/
.ui-dialog {
min-height: 480px;
}
-.ui-dialog .ui-header, .ui-dialog .ui-content, .ui-dialog .ui-footer {
+.ui-dialog .ui-header,
+.ui-dialog .ui-content,
+.ui-dialog .ui-footer {
margin: 15px;
position: relative;
}
-.ui-dialog .ui-header, .ui-dialog .ui-footer {
+.ui-dialog .ui-header,
+.ui-dialog .ui-footer {
z-index: 10;
width: auto;
}
/***************************************************************************
Body
***************************************************************************/
+/* B011 : Main Background color */
+/* B012 : Main font color */
/***************************************************************************
Naviframe
***************************************************************************/
-/* #3b73b6 *//* title text */
+/* B042 : title text */
/* B052L4 : Title text button */
/* B052L5 : Title text button press */
/* B052L1P : Title text button press bg */
/***************************************************************************
Button(connected with other winset)
***************************************************************************/
-.LESSbutton_box_style {
- color: #363133;
-}
-.LESSbutton_up_style {
- background: #ebe8e3;
- background: -webkit-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -moz-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -o-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -ms-linear-gradient(top, #ebe8e3, #eae7e2);
-}
-.LESSbutton_box_style {
- background: #ebe8e3;
- background: -webkit-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -moz-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -o-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -ms-linear-gradient(top, #ebe8e3, #eae7e2);
- border: 1px solid;
- border-color: #dcdad3;
- -o-box-shadow: 0 0 1px 1px #ffffff;
- -ms-box-shadow: 0 0 1px 1px #ffffff;
- -moz-box-shadow: 0 0 1px 1px #ffffff;
- -webkit-box-shadow: 0 0 1px 1px #ffffff;
- box-shadow: 0 0 1px 1px #ffffff;
-}
-.LESSbutton_inner_box_style {
- background: #f7f5ee;
- background: -webkit-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -ms-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -o-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -moz-linear-gradient(top, #faf7f2, #f8f5f0);
- -o-box-shadow: none;
- -ms-box-shadow: none;
- -moz-box-shadow: none;
- -webkit-box-shadow: none;
- box-shadow: none;
-}
-.LESSbutton_inner_pressstyle {
- color: #f8f6ef;
-}
-.LESSbutton_text1_style {
- font-family: Helvetica, Arial, sans-serif;
- font-weight: normal;
- font-size: 1.0rem;
- font-style: normal;
- color: #000000;
-}
-.LESSbutton_hover_style {
- color: #363133;
-}
-.LESSbutton_down_style {
- background: #3b73b6;
- color: #f8f6ef;
-}
-.LESSbutton_edit_style {
- background: #c95858;
- background: -webkit-gradient(linear, left top, left bottom, from(#c95858), to(#a12828));
- background: -moz_linear-gradient(top, #c95858, #a12828);
-}
+
+
+
+
+
+
+
+
+
/***************************************************************************
contextual popup
***************************************************************************/
-/* #1A5274 */
/***************************************************************************
Scrollview
***************************************************************************/
Date Time picker
***************************************************************************/
/***************************************************************************
- DaySelector
-***************************************************************************/
-/* #00a8e7 */
-/* #f01402 */
-/* #f9f9f9 *//* #f9f9f9 */.LESSDayselectorButtonNormal {
- background: #7e9db2;
- background: -webkit-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -moz-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -ms-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -o-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: linear-gradient(top, #7e9db2 0%, #547990 100%);
-}
-.LESSDayaselectorButtonPress {
- background: #3b7796;
- background: -webkit-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -moz-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -ms-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -o-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: linear-gradient(top, #3b7796 0%, #2f5b75 100%);
-}
-/***************************************************************************
- OptionHeader
-***************************************************************************/
-/* #f9f9f9 */
-/***************************************************************************
SegmentControl
***************************************************************************/
-/* #F9F9F9*/
-/* #F9F9F9*/
-/***************************************************************************
- ControlGroup
-***************************************************************************/
-/* 00_divider_line.9.png */
+/* B052L4 : Title text button */
/***************************************************************************
Popup
***************************************************************************/
/* popup_title_bg.png */
/* maybe not use only popupwindow*/
-.LESSpopup_button_style {
- /* background: @color_popup_buttonbg;
- background: @color_popup_buttonbg_webkit;
- background: @color_popup_buttonbg_moz;
- background: @color_popup_buttonbg_ms;
- background: @color_popup_buttonbg_o;
- color: @color_popup_buttontext;*/
-}
-.LESSpopup_button_hover_style {
- background: #5e88a3;
-}
-.LESSpopup_button_press_style {
- background: #43a0d9;
- background: -webkit-gradient(linear, left top, left bottom, from(#43a0d9), to(#388bb9));
- background: -moz-linear-gradient(top, #43a0d9, #388bb9);
- background: -ms-linear-gradient(top, #43a0d9, #388bb9);
- background: -o-linear-gradient(top, #43a0d9, #388bb9);
-}
-/***************************************************************************
- Button
-***************************************************************************/
-.LESStoggleswitch_on_style {
- background: #2a7eac;
- background: -webkit-gradient(linear, left top, left bottom, from(#2174a7), to(#4ba5db));
- background: -moz-linear-gradient(top, #2174a7, #4ba5db);
- border-radius: 4px;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
-}
-.LESStoggleswitch_off_style {
- color: #cbcbcb;
- background: #97a1a7;
- background: -webkit-gradient(linear, left top, left bottom, from(#727272), to(#8d8d8d));
- background: -moz-linear-gradient(top, #727272, #8d8d8d);
- border-radius: 4px;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
-}
-.LESStoggleswitch_reed_style {
- background: #fdfdfd;
- background: -webkit-gradient(linear, left top, left bottom, from(#fdfdfd), to(#e7e7e7));
- background: -moz-linear-gradient(top, #fdfdfd, #e7e7e7);
- border-radius: 2px;
- -webkit-border-radius: 2px;
- -moz-border-radius: 2px;
-}
-.LESSbutton_editpress_style {
- background: #931818;
- background: -webkit-gradient(linear, left top, left bottom, from(#931818), to(#6e1717));
- background: -moz-linear-gradient(top, #931818, #6e1717);
-}
-.LESSbutton_edit_padding {
- padding: 0.5em 0.8em;
-}
+
+
/***************************************************************************
Tickernoti
***************************************************************************/
Smallpopup
***************************************************************************/
/***************************************************************************
- No Contents
-***************************************************************************/
-/***************************************************************************
Slider
***************************************************************************/
/***************************************************************************
/***************************************************************************
multimediaview
***************************************************************************/
-.LESSmultimediaview_bar_active_style {
- background-color: #4a84c9;
- background-image: -webkit-gradient(linear, left top, left bottom, from(#6289d9), to(#295b98));
- background-image: -moz-linear-gradient(top, #6289d9, #295b98);
- background-image: -o-linear-gradient(top, #6289d9, #295b98);
- background-image: -ms-linear-gradient(top, #6289d9, #295b98);
-}
-.LESSmultimediaview_bar_handle_style {
- background-color: #f9f9f9;
- background-image: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#e6e6e6));
- background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: -ms-linear-gradient(top, #ffffff, #e6e6e6);
-}
+
+
/***************************************************************************
tokentextarea
***************************************************************************/
/***************************************************************************
+ Splitview
***************************************************************************/
-.ui-checkbox .ui-btn-inner, .ui-radio .ui-btn-inner {
+.ui-checkbox .ui-btn-inner,
+.ui-radio .ui-btn-inner {
white-space: normal;
}
-.ui-checkbox, .ui-radio {
+.ui-checkbox,
+.ui-radio {
position: relative;
margin: 0;
}
-.ui-checkbox .ui-btn-corner-all, .ui-radio .ui-btn-corner-all {
+.ui-checkbox .ui-btn-corner-all,
+.ui-radio .ui-btn-corner-all {
-o-border-radius: 0;
-ms-border-radius: 0;
-moz-border-radius: 0;
-webkit-border-radius: 0;
border-radius: 0;
}
-.ui-checkbox .ui-btn-inner, .ui-radio .ui-btn-inner {
+.ui-checkbox .ui-btn-inner,
+.ui-radio .ui-btn-inner {
border-top: 0;
}
-.ui-checkbox .ui-btn-up-s, .ui-radio .ui-btn-up-s {
+.ui-checkbox .ui-btn-up-s,
+.ui-radio .ui-btn-up-s {
border: 0;
background: transparent;
font-weight: normal;
}
-.ui-checkbox .ui-btn-hover-s, .ui-radio .ui-btn-hover-s {
+.ui-checkbox .ui-btn-hover-s,
+.ui-radio .ui-btn-hover-s {
border: 0;
background: transparent;
font-weight: normal;
}
-.ui-checkbox .ui-btn-down-s, .ui-radio .ui-btn-down-s {
+.ui-checkbox .ui-btn-down-s,
+.ui-radio .ui-btn-down-s {
border: 0;
background: transparent;
font-weight: normal;
}
-.ui-checkbox input, .ui-radio input {
+.ui-checkbox input,
+.ui-radio input {
z-index: 1;
margin: 0px;
left: 0.4545454545454546rem;
position: absolute;
outline: 0 !important;
}
-.ui-checkbox > input, .ui-radio > input {
+.ui-checkbox > input,
+.ui-radio > input {
display: none;
}
-.ui-checkbox .ui-btn, .ui-radio .ui-btn {
+.ui-checkbox .ui-btn,
+.ui-radio .ui-btn {
z-index: 2;
height: 100%;
margin: 0;
text-align: left;
}
-.ui-checkbox .ui-btn.ui-btn-icon-left, .ui-radio .ui-btn.ui-btn-icon-left {
+.ui-checkbox .ui-btn.ui-btn-icon-left,
+.ui-radio .ui-btn.ui-btn-icon-left {
display: inline-block;
}
-.ui-checkbox .ui-btn.ui-btn-icon-left .ui-btn-inner, .ui-radio .ui-btn.ui-btn-icon-left .ui-btn-inner {
+.ui-checkbox .ui-btn.ui-btn-icon-left .ui-btn-inner,
+.ui-radio .ui-btn.ui-btn-icon-left .ui-btn-inner {
min-width: 1.8181818181818183rem;
display: inline-block;
line-height: 1.4545454545454546rem;
/* TODO : after button fixed, recheck! */
}
-.ui-checkbox .ui-btn.ui-btn-icon-left .ui-btn-inner .ui-btn-text, .ui-radio .ui-btn.ui-btn-icon-left .ui-btn-inner .ui-btn-text {
+.ui-checkbox .ui-btn.ui-btn-icon-left .ui-btn-inner .ui-btn-text,
+.ui-radio .ui-btn.ui-btn-icon-left .ui-btn-inner .ui-btn-text {
display: inline-block;
vertical-align: middle;
min-height: 1.4545454545454546rem;
}
-.ui-checkbox .ui-btn.ui-btn-icon-left .ui-btn-inner .ui-btn-text.ui-btn-text-padding-left, .ui-radio .ui-btn.ui-btn-icon-left .ui-btn-inner .ui-btn-text.ui-btn-text-padding-left {
+.ui-checkbox .ui-btn.ui-btn-icon-left .ui-btn-inner .ui-btn-text.ui-btn-text-padding-left,
+.ui-radio .ui-btn.ui-btn-icon-left .ui-btn-inner .ui-btn-text.ui-btn-text-padding-left {
padding-left: 1.0909090909090908rem;
}
-.ui-checkbox .ui-btn.ui-btn-icon-left .ui-btn-inner .ui-icon, .ui-radio .ui-btn.ui-btn-icon-left .ui-btn-inner .ui-icon {
+.ui-checkbox .ui-btn.ui-btn-icon-left .ui-btn-inner .ui-icon,
+.ui-radio .ui-btn.ui-btn-icon-left .ui-btn-inner .ui-icon {
position: absolute;
top: 50%;
width: 1.4545454545454546rem;
background-image: url(images/00_check_checking.png), url(images/00_check_bg_press.png);
background-repeat: no-repeat;
}
-.favorite .ui-icon-checkbox-off, .favorite .ui-icon-checkbox-off-press {
+.favorite .ui-icon-checkbox-off,
+.favorite .ui-icon-checkbox-off-press {
width: 1.4545454545454546rem;
height: 1.4545454545454546rem;
background-image: url(images/controls/00_icon_favorite_off.png);
}
-.favorite .ui-icon-checkbox-on, .favorite .ui-icon-checkbox-on-press {
+.favorite .ui-icon-checkbox-on,
+.favorite .ui-icon-checkbox-on-press {
width: 1.4545454545454546rem;
height: 1.4545454545454546rem;
background-image: url(images/controls/00_icon_favorite_on.png);
/***************************************************************************
Body
***************************************************************************/
+/* B011 : Main Background color */
+/* B012 : Main font color */
/***************************************************************************
Naviframe
***************************************************************************/
-/* #3b73b6 *//* title text */
+/* B042 : title text */
/* B052L4 : Title text button */
/* B052L5 : Title text button press */
/* B052L1P : Title text button press bg */
/***************************************************************************
Button(connected with other winset)
***************************************************************************/
-.LESSbutton_box_style {
- color: #363133;
-}
-.LESSbutton_up_style {
- background: #ebe8e3;
- background: -webkit-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -moz-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -o-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -ms-linear-gradient(top, #ebe8e3, #eae7e2);
-}
-.LESSbutton_box_style {
- background: #ebe8e3;
- background: -webkit-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -moz-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -o-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -ms-linear-gradient(top, #ebe8e3, #eae7e2);
- border: 1px solid;
- border-color: #dcdad3;
- -o-box-shadow: 0 0 1px 1px #ffffff;
- -ms-box-shadow: 0 0 1px 1px #ffffff;
- -moz-box-shadow: 0 0 1px 1px #ffffff;
- -webkit-box-shadow: 0 0 1px 1px #ffffff;
- box-shadow: 0 0 1px 1px #ffffff;
-}
-.LESSbutton_inner_box_style {
- background: #f7f5ee;
- background: -webkit-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -ms-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -o-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -moz-linear-gradient(top, #faf7f2, #f8f5f0);
- -o-box-shadow: none;
- -ms-box-shadow: none;
- -moz-box-shadow: none;
- -webkit-box-shadow: none;
- box-shadow: none;
-}
-.LESSbutton_inner_pressstyle {
- color: #f8f6ef;
-}
-.LESSbutton_text1_style {
- font-family: Helvetica, Arial, sans-serif;
- font-weight: normal;
- font-size: 1.0rem;
- font-style: normal;
- color: #000000;
-}
-.LESSbutton_hover_style {
- color: #363133;
-}
-.LESSbutton_down_style {
- background: #3b73b6;
- color: #f8f6ef;
-}
-.LESSbutton_edit_style {
- background: #c95858;
- background: -webkit-gradient(linear, left top, left bottom, from(#c95858), to(#a12828));
- background: -moz_linear-gradient(top, #c95858, #a12828);
-}
+
+
+
+
+
+
+
+
+
/***************************************************************************
contextual popup
***************************************************************************/
-/* #1A5274 */
/***************************************************************************
Scrollview
***************************************************************************/
Date Time picker
***************************************************************************/
/***************************************************************************
- DaySelector
-***************************************************************************/
-/* #00a8e7 */
-/* #f01402 */
-/* #f9f9f9 *//* #f9f9f9 */.LESSDayselectorButtonNormal {
- background: #7e9db2;
- background: -webkit-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -moz-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -ms-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -o-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: linear-gradient(top, #7e9db2 0%, #547990 100%);
-}
-.LESSDayaselectorButtonPress {
- background: #3b7796;
- background: -webkit-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -moz-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -ms-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -o-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: linear-gradient(top, #3b7796 0%, #2f5b75 100%);
-}
-/***************************************************************************
- OptionHeader
-***************************************************************************/
-/* #f9f9f9 */
-/***************************************************************************
SegmentControl
***************************************************************************/
-/* #F9F9F9*/
-/* #F9F9F9*/
-/***************************************************************************
- ControlGroup
-***************************************************************************/
-/* 00_divider_line.9.png */
+/* B052L4 : Title text button */
/***************************************************************************
Popup
***************************************************************************/
/* popup_title_bg.png */
/* maybe not use only popupwindow*/
-.LESSpopup_button_style {
- /* background: @color_popup_buttonbg;
- background: @color_popup_buttonbg_webkit;
- background: @color_popup_buttonbg_moz;
- background: @color_popup_buttonbg_ms;
- background: @color_popup_buttonbg_o;
- color: @color_popup_buttontext;*/
-}
-.LESSpopup_button_hover_style {
- background: #5e88a3;
-}
-.LESSpopup_button_press_style {
- background: #43a0d9;
- background: -webkit-gradient(linear, left top, left bottom, from(#43a0d9), to(#388bb9));
- background: -moz-linear-gradient(top, #43a0d9, #388bb9);
- background: -ms-linear-gradient(top, #43a0d9, #388bb9);
- background: -o-linear-gradient(top, #43a0d9, #388bb9);
-}
-/***************************************************************************
- Button
-***************************************************************************/
-.LESStoggleswitch_on_style {
- background: #2a7eac;
- background: -webkit-gradient(linear, left top, left bottom, from(#2174a7), to(#4ba5db));
- background: -moz-linear-gradient(top, #2174a7, #4ba5db);
- border-radius: 4px;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
-}
-.LESStoggleswitch_off_style {
- color: #cbcbcb;
- background: #97a1a7;
- background: -webkit-gradient(linear, left top, left bottom, from(#727272), to(#8d8d8d));
- background: -moz-linear-gradient(top, #727272, #8d8d8d);
- border-radius: 4px;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
-}
-.LESStoggleswitch_reed_style {
- background: #fdfdfd;
- background: -webkit-gradient(linear, left top, left bottom, from(#fdfdfd), to(#e7e7e7));
- background: -moz-linear-gradient(top, #fdfdfd, #e7e7e7);
- border-radius: 2px;
- -webkit-border-radius: 2px;
- -moz-border-radius: 2px;
-}
-.LESSbutton_editpress_style {
- background: #931818;
- background: -webkit-gradient(linear, left top, left bottom, from(#931818), to(#6e1717));
- background: -moz-linear-gradient(top, #931818, #6e1717);
-}
-.LESSbutton_edit_padding {
- padding: 0.5em 0.8em;
-}
+
+
/***************************************************************************
Tickernoti
***************************************************************************/
Smallpopup
***************************************************************************/
/***************************************************************************
- No Contents
-***************************************************************************/
-/***************************************************************************
Slider
***************************************************************************/
/***************************************************************************
/***************************************************************************
multimediaview
***************************************************************************/
-.LESSmultimediaview_bar_active_style {
- background-color: #4a84c9;
- background-image: -webkit-gradient(linear, left top, left bottom, from(#6289d9), to(#295b98));
- background-image: -moz-linear-gradient(top, #6289d9, #295b98);
- background-image: -o-linear-gradient(top, #6289d9, #295b98);
- background-image: -ms-linear-gradient(top, #6289d9, #295b98);
-}
-.LESSmultimediaview_bar_handle_style {
- background-color: #f9f9f9;
- background-image: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#e6e6e6));
- background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: -ms-linear-gradient(top, #ffffff, #e6e6e6);
-}
+
+
/***************************************************************************
tokentextarea
***************************************************************************/
/***************************************************************************
+ Splitview
***************************************************************************/
label.ui-input-text {
font-size: 1rem;
font-weight: normal;
margin: 0 0 .3em;
}
-input.ui-input-text, textarea.ui-input-text {
+input.ui-input-text,
+textarea.ui-input-text {
background-image: none;
padding: .4em;
line-height: 1.4;
background: transparent none;
outline: 0 !important;
}
-.ui-input-search .ui-btn-down-s, .ui-input-search .ui-btn-up-s, .ui-input-search .ui-btn-hover-s {
+.ui-input-search .ui-btn-down-s,
+.ui-input-search .ui-btn-up-s,
+.ui-input-search .ui-btn-hover-s {
border: none;
background: transparent none;
}
display: none;
}
/* code for label+inputbox : remove this code if webApp dev. controls input area */
-@media all and (min-width: 721*@unit_base) {
+@media all and (min-width: 721px) {
label.ui-input-text:not([data-type='search']) {
vertical-align: top;
display: inline-block;
margin: 0 2% 0 0;
}
- input.ui-input-text:not([data-type='search']), textarea.ui-input-text:not([data-type='search']) {
+ input.ui-input-text:not([data-type='search']),
+ textarea.ui-input-text:not([data-type='search']) {
width: 60%;
display: inline-block;
}
}
}
/* search bar */
-.ui-body-s > div > .ui-field-contain > .input-search-bar, .ui-body-s > .ui-field-contain > .input-search-bar {
+.ui-body-s > div > .ui-field-contain > .input-search-bar,
+.ui-body-s > .ui-field-contain > .input-search-bar {
margin: -2.1818181818181817rem -0.6818181818181819rem -1.4545454545454546rem -0.6818181818181819rem;
}
/* Need to confirm exact concept */
/***************************************************************************
Body
***************************************************************************/
+/* B011 : Main Background color */
+/* B012 : Main font color */
/***************************************************************************
Naviframe
***************************************************************************/
-/* #3b73b6 *//* title text */
+/* B042 : title text */
/* B052L4 : Title text button */
/* B052L5 : Title text button press */
/* B052L1P : Title text button press bg */
/***************************************************************************
Button(connected with other winset)
***************************************************************************/
-.LESSbutton_box_style {
- color: #363133;
-}
-.LESSbutton_up_style {
- background: #ebe8e3;
- background: -webkit-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -moz-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -o-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -ms-linear-gradient(top, #ebe8e3, #eae7e2);
-}
-.LESSbutton_box_style {
- background: #ebe8e3;
- background: -webkit-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -moz-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -o-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -ms-linear-gradient(top, #ebe8e3, #eae7e2);
- border: 1px solid;
- border-color: #dcdad3;
- -o-box-shadow: 0 0 1px 1px #ffffff;
- -ms-box-shadow: 0 0 1px 1px #ffffff;
- -moz-box-shadow: 0 0 1px 1px #ffffff;
- -webkit-box-shadow: 0 0 1px 1px #ffffff;
- box-shadow: 0 0 1px 1px #ffffff;
-}
-.LESSbutton_inner_box_style {
- background: #f7f5ee;
- background: -webkit-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -ms-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -o-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -moz-linear-gradient(top, #faf7f2, #f8f5f0);
- -o-box-shadow: none;
- -ms-box-shadow: none;
- -moz-box-shadow: none;
- -webkit-box-shadow: none;
- box-shadow: none;
-}
-.LESSbutton_inner_pressstyle {
- color: #f8f6ef;
-}
-.LESSbutton_text1_style {
- font-family: Helvetica, Arial, sans-serif;
- font-weight: normal;
- font-size: 1.0rem;
- font-style: normal;
- color: #000000;
-}
-.LESSbutton_hover_style {
- color: #363133;
-}
-.LESSbutton_down_style {
- background: #3b73b6;
- color: #f8f6ef;
-}
-.LESSbutton_edit_style {
- background: #c95858;
- background: -webkit-gradient(linear, left top, left bottom, from(#c95858), to(#a12828));
- background: -moz_linear-gradient(top, #c95858, #a12828);
-}
+
+
+
+
+
+
+
+
+
/***************************************************************************
contextual popup
***************************************************************************/
-/* #1A5274 */
/***************************************************************************
Scrollview
***************************************************************************/
Date Time picker
***************************************************************************/
/***************************************************************************
- DaySelector
-***************************************************************************/
-/* #00a8e7 */
-/* #f01402 */
-/* #f9f9f9 *//* #f9f9f9 */.LESSDayselectorButtonNormal {
- background: #7e9db2;
- background: -webkit-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -moz-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -ms-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -o-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: linear-gradient(top, #7e9db2 0%, #547990 100%);
-}
-.LESSDayaselectorButtonPress {
- background: #3b7796;
- background: -webkit-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -moz-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -ms-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -o-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: linear-gradient(top, #3b7796 0%, #2f5b75 100%);
-}
-/***************************************************************************
- OptionHeader
-***************************************************************************/
-/* #f9f9f9 */
-/***************************************************************************
SegmentControl
***************************************************************************/
-/* #F9F9F9*/
-/* #F9F9F9*/
-/***************************************************************************
- ControlGroup
-***************************************************************************/
-/* 00_divider_line.9.png */
+/* B052L4 : Title text button */
/***************************************************************************
Popup
***************************************************************************/
/* popup_title_bg.png */
/* maybe not use only popupwindow*/
-.LESSpopup_button_style {
- /* background: @color_popup_buttonbg;
- background: @color_popup_buttonbg_webkit;
- background: @color_popup_buttonbg_moz;
- background: @color_popup_buttonbg_ms;
- background: @color_popup_buttonbg_o;
- color: @color_popup_buttontext;*/
-}
-.LESSpopup_button_hover_style {
- background: #5e88a3;
-}
-.LESSpopup_button_press_style {
- background: #43a0d9;
- background: -webkit-gradient(linear, left top, left bottom, from(#43a0d9), to(#388bb9));
- background: -moz-linear-gradient(top, #43a0d9, #388bb9);
- background: -ms-linear-gradient(top, #43a0d9, #388bb9);
- background: -o-linear-gradient(top, #43a0d9, #388bb9);
-}
-/***************************************************************************
- Button
-***************************************************************************/
-.LESStoggleswitch_on_style {
- background: #2a7eac;
- background: -webkit-gradient(linear, left top, left bottom, from(#2174a7), to(#4ba5db));
- background: -moz-linear-gradient(top, #2174a7, #4ba5db);
- border-radius: 4px;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
-}
-.LESStoggleswitch_off_style {
- color: #cbcbcb;
- background: #97a1a7;
- background: -webkit-gradient(linear, left top, left bottom, from(#727272), to(#8d8d8d));
- background: -moz-linear-gradient(top, #727272, #8d8d8d);
- border-radius: 4px;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
-}
-.LESStoggleswitch_reed_style {
- background: #fdfdfd;
- background: -webkit-gradient(linear, left top, left bottom, from(#fdfdfd), to(#e7e7e7));
- background: -moz-linear-gradient(top, #fdfdfd, #e7e7e7);
- border-radius: 2px;
- -webkit-border-radius: 2px;
- -moz-border-radius: 2px;
-}
-.LESSbutton_editpress_style {
- background: #931818;
- background: -webkit-gradient(linear, left top, left bottom, from(#931818), to(#6e1717));
- background: -moz-linear-gradient(top, #931818, #6e1717);
-}
-.LESSbutton_edit_padding {
- padding: 0.5em 0.8em;
-}
+
+
/***************************************************************************
Tickernoti
***************************************************************************/
Smallpopup
***************************************************************************/
/***************************************************************************
- No Contents
-***************************************************************************/
-/***************************************************************************
Slider
***************************************************************************/
/***************************************************************************
/***************************************************************************
multimediaview
***************************************************************************/
-.LESSmultimediaview_bar_active_style {
- background-color: #4a84c9;
- background-image: -webkit-gradient(linear, left top, left bottom, from(#6289d9), to(#295b98));
- background-image: -moz-linear-gradient(top, #6289d9, #295b98);
- background-image: -o-linear-gradient(top, #6289d9, #295b98);
- background-image: -ms-linear-gradient(top, #6289d9, #295b98);
-}
-.LESSmultimediaview_bar_handle_style {
- background-color: #f9f9f9;
- background-image: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#e6e6e6));
- background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: -ms-linear-gradient(top, #ffffff, #e6e6e6);
-}
+
+
/***************************************************************************
tokentextarea
***************************************************************************/
/***************************************************************************
+ Splitview
***************************************************************************/
-.ui-controlgroup, fieldset.ui-controlgroup {
+.ui-controlgroup,
+fieldset.ui-controlgroup {
padding: 0;
margin: .5em 0 1em;
}
.ui-controlgroup .ui-btn-inner {
white-space: nowrap;
}
-.ui-controlgroup .ui-checkbox label label, .ui-controlgroup .ui-radio label {
+.ui-controlgroup .ui-checkbox label label,
+.ui-controlgroup .ui-radio label {
font-size: 1em;
}
.ui-controlgroup .ui-radio {
text-align: center;
white-space: nowrap;
}
-.ui-controlgroup .ui-radio-off, .ui-controlgroup .ui-radio-on {
+.ui-controlgroup .ui-radio-off,
+.ui-controlgroup .ui-radio-on {
width: 100%;
}
.ui-controlgroup .ui-radio-on .ui-btn-inner {
.ui-controlgroup .ui-corner-right {
border-right-width: 0px;
}
-.ui-controlgroup-vertical .ui-btn, .ui-controlgroup-vertical .ui-checkbox, .ui-controlgroup-vertical .ui-radio {
+.ui-controlgroup-vertical .ui-btn,
+.ui-controlgroup-vertical .ui-checkbox,
+.ui-controlgroup-vertical .ui-radio {
margin: 0;
border-bottom-width: 0;
}
margin-left: -0.18181818181818182rem;
margin-right: -0.13636363636363635rem;
}
-.ui-controlgroup-horizontal .ui-checkbox, .ui-controlgroup-horizontal .ui-radio {
+.ui-controlgroup-horizontal .ui-checkbox,
+.ui-controlgroup-horizontal .ui-radio {
float: left;
margin: 0 -1px 0 0;
}
box-shadow: none;
background: none;
}
-.ui-controlgroup-horizontal [data-role="button"].ui-btn-down-s .ui-btn-inner, .ui-controlgroup-horizontal [data-role="button"] .ui-btn-active-s .ui-btn-inner {
+.ui-controlgroup-horizontal [data-role="button"].ui-btn-down-s .ui-btn-inner,
+.ui-controlgroup-horizontal [data-role="button"] .ui-btn-active-s .ui-btn-inner {
background: #f8f6ef;
}
-.ui-controlgroup-horizontal [data-role="button"].ui-btn-down-s .ui-btn-inner .ui-btn-text, .ui-controlgroup-horizontal [data-role="button"] .ui-btn-active-s .ui-btn-inner .ui-btn-text {
+.ui-controlgroup-horizontal [data-role="button"].ui-btn-down-s .ui-btn-inner .ui-btn-text,
+.ui-controlgroup-horizontal [data-role="button"] .ui-btn-active-s .ui-btn-inner .ui-btn-text {
color: #3b73b6;
}
.ui-controlgroup-horizontal [data-role="button"].ui-btn-down-s .ui-btn-inner {
/***************************************************************************
Body
***************************************************************************/
+/* B011 : Main Background color */
+/* B012 : Main font color */
/***************************************************************************
Naviframe
***************************************************************************/
-/* #3b73b6 *//* title text */
+/* B042 : title text */
/* B052L4 : Title text button */
/* B052L5 : Title text button press */
/* B052L1P : Title text button press bg */
/***************************************************************************
Button(connected with other winset)
***************************************************************************/
-.LESSbutton_box_style {
- color: #363133;
-}
-.LESSbutton_up_style {
- background: #ebe8e3;
- background: -webkit-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -moz-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -o-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -ms-linear-gradient(top, #ebe8e3, #eae7e2);
-}
-.LESSbutton_box_style {
- background: #ebe8e3;
- background: -webkit-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -moz-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -o-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -ms-linear-gradient(top, #ebe8e3, #eae7e2);
- border: 1px solid;
- border-color: #dcdad3;
- -o-box-shadow: 0 0 1px 1px #ffffff;
- -ms-box-shadow: 0 0 1px 1px #ffffff;
- -moz-box-shadow: 0 0 1px 1px #ffffff;
- -webkit-box-shadow: 0 0 1px 1px #ffffff;
- box-shadow: 0 0 1px 1px #ffffff;
-}
-.LESSbutton_inner_box_style {
- background: #f7f5ee;
- background: -webkit-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -ms-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -o-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -moz-linear-gradient(top, #faf7f2, #f8f5f0);
- -o-box-shadow: none;
- -ms-box-shadow: none;
- -moz-box-shadow: none;
- -webkit-box-shadow: none;
- box-shadow: none;
-}
-.LESSbutton_inner_pressstyle {
- color: #f8f6ef;
-}
-.LESSbutton_text1_style {
- font-family: Helvetica, Arial, sans-serif;
- font-weight: normal;
- font-size: 1.0rem;
- font-style: normal;
- color: #000000;
-}
-.LESSbutton_hover_style {
- color: #363133;
-}
-.LESSbutton_down_style {
- background: #3b73b6;
- color: #f8f6ef;
-}
-.LESSbutton_edit_style {
- background: #c95858;
- background: -webkit-gradient(linear, left top, left bottom, from(#c95858), to(#a12828));
- background: -moz_linear-gradient(top, #c95858, #a12828);
-}
+
+
+
+
+
+
+
+
+
/***************************************************************************
contextual popup
***************************************************************************/
-/* #1A5274 */
/***************************************************************************
Scrollview
***************************************************************************/
Date Time picker
***************************************************************************/
/***************************************************************************
- DaySelector
-***************************************************************************/
-/* #00a8e7 */
-/* #f01402 */
-/* #f9f9f9 *//* #f9f9f9 */.LESSDayselectorButtonNormal {
- background: #7e9db2;
- background: -webkit-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -moz-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -ms-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -o-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: linear-gradient(top, #7e9db2 0%, #547990 100%);
-}
-.LESSDayaselectorButtonPress {
- background: #3b7796;
- background: -webkit-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -moz-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -ms-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -o-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: linear-gradient(top, #3b7796 0%, #2f5b75 100%);
-}
-/***************************************************************************
- OptionHeader
-***************************************************************************/
-/* #f9f9f9 */
-/***************************************************************************
SegmentControl
***************************************************************************/
-/* #F9F9F9*/
-/* #F9F9F9*/
-/***************************************************************************
- ControlGroup
-***************************************************************************/
-/* 00_divider_line.9.png */
+/* B052L4 : Title text button */
/***************************************************************************
Popup
***************************************************************************/
/* popup_title_bg.png */
/* maybe not use only popupwindow*/
-.LESSpopup_button_style {
- /* background: @color_popup_buttonbg;
- background: @color_popup_buttonbg_webkit;
- background: @color_popup_buttonbg_moz;
- background: @color_popup_buttonbg_ms;
- background: @color_popup_buttonbg_o;
- color: @color_popup_buttontext;*/
-}
-.LESSpopup_button_hover_style {
- background: #5e88a3;
-}
-.LESSpopup_button_press_style {
- background: #43a0d9;
- background: -webkit-gradient(linear, left top, left bottom, from(#43a0d9), to(#388bb9));
- background: -moz-linear-gradient(top, #43a0d9, #388bb9);
- background: -ms-linear-gradient(top, #43a0d9, #388bb9);
- background: -o-linear-gradient(top, #43a0d9, #388bb9);
-}
-/***************************************************************************
- Button
-***************************************************************************/
-.LESStoggleswitch_on_style {
- background: #2a7eac;
- background: -webkit-gradient(linear, left top, left bottom, from(#2174a7), to(#4ba5db));
- background: -moz-linear-gradient(top, #2174a7, #4ba5db);
- border-radius: 4px;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
-}
-.LESStoggleswitch_off_style {
- color: #cbcbcb;
- background: #97a1a7;
- background: -webkit-gradient(linear, left top, left bottom, from(#727272), to(#8d8d8d));
- background: -moz-linear-gradient(top, #727272, #8d8d8d);
- border-radius: 4px;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
-}
-.LESStoggleswitch_reed_style {
- background: #fdfdfd;
- background: -webkit-gradient(linear, left top, left bottom, from(#fdfdfd), to(#e7e7e7));
- background: -moz-linear-gradient(top, #fdfdfd, #e7e7e7);
- border-radius: 2px;
- -webkit-border-radius: 2px;
- -moz-border-radius: 2px;
-}
-.LESSbutton_editpress_style {
- background: #931818;
- background: -webkit-gradient(linear, left top, left bottom, from(#931818), to(#6e1717));
- background: -moz-linear-gradient(top, #931818, #6e1717);
-}
-.LESSbutton_edit_padding {
- padding: 0.5em 0.8em;
-}
+
+
/***************************************************************************
Tickernoti
***************************************************************************/
Smallpopup
***************************************************************************/
/***************************************************************************
- No Contents
-***************************************************************************/
-/***************************************************************************
Slider
***************************************************************************/
/***************************************************************************
/***************************************************************************
multimediaview
***************************************************************************/
-.LESSmultimediaview_bar_active_style {
- background-color: #4a84c9;
- background-image: -webkit-gradient(linear, left top, left bottom, from(#6289d9), to(#295b98));
- background-image: -moz-linear-gradient(top, #6289d9, #295b98);
- background-image: -o-linear-gradient(top, #6289d9, #295b98);
- background-image: -ms-linear-gradient(top, #6289d9, #295b98);
-}
-.LESSmultimediaview_bar_handle_style {
- background-color: #f9f9f9;
- background-image: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#e6e6e6));
- background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: -ms-linear-gradient(top, #ffffff, #e6e6e6);
-}
+
+
/***************************************************************************
tokentextarea
***************************************************************************/
/***************************************************************************
+ Splitview
***************************************************************************/
/************************/
.ui-listview {
.ui-listview .ui-li.ui-li-has-multiline:not(.ui-li-divider):not(.ui-li-static) {
min-height: 2.909090909090909rem;
}
-.ui-listview li.ui-btn-up-s, .ui-listview li.ui-btn-hover-s {
+.ui-listview li.ui-btn-up-s,
+.ui-listview li.ui-btn-hover-s {
background: none;
background-color: #f8f6ef;
color: #000000;
background-color: #5787c2;
color: #000000;
}
-.ui-listview li.ui-btn-up-s > .ui-li > .ui-btn-text > a.ui-link-inherit, .ui-listview li.ui-btn-hover-s > .ui-li > .ui-btn-text > a.ui-link-inherit {
+.ui-listview li.ui-btn-up-s > .ui-li > .ui-btn-text > a.ui-link-inherit,
+.ui-listview li.ui-btn-hover-s > .ui-li > .ui-btn-text > a.ui-link-inherit {
color: #000000;
}
.ui-listview li.ui-btn-down-s > .ui-li > .ui-btn-text > a.ui-link-inherit {
.ui-content .ui-listview-inset {
margin: 1em 0;
}
-.ui-listview, .ui-li, .ui-collapsible-heading {
+.ui-listview,
+.ui-li,
+.ui-collapsible-heading {
list-style: none;
padding: 0;
font-size: 1rem;
}
-.ui-li, .ui-collapsible-heading, .ui-li.ui-field-contain {
+.ui-li,
+.ui-collapsible-heading,
+.ui-li.ui-field-contain {
display: block;
margin: 0;
position: relative;
.ui-listview li .ui-li-color-bar {
position: absolute;
width: 0.13636363636363635rem;
- height: 2.9545454545454546rem;
+ height: 100%;
top: 0rem;
left: -0.5909090909090909rem;
background-color: #000000;
height: 2.3181818181818183rem;
margin-top: -1.1363636363636365rem;
}
-.ui-li.ui-li-has-multiline .ui-btn-inner a.ui-link-inherit, .ui-li.ui-li-has-multiline.ui-li-static {
+.ui-li.ui-li-has-multiline .ui-btn-inner a.ui-link-inherit,
+.ui-li.ui-li-has-multiline.ui-li-static {
padding-top: 0.3181818181818182rem;
padding-bottom: 1.2727272727272727rem;
}
border-left-style: solid;
border-left-color: rgba(0, 0, 0, 0.5);
}
-.ui-li-has-thumb:not(.ui-li-thumbnail-right) .ui-btn-inner a.ui-link-inherit, .ui-li-has-thumb:not(.ui-li-thumbnail-right).ui-li-static {
+.ui-li-has-thumb:not(.ui-li-thumbnail-right) .ui-btn-inner a.ui-link-inherit,
+.ui-li-has-thumb:not(.ui-li-thumbnail-right).ui-li-static {
padding-left: 2.0454545454545454rem;
}
.ui-li-has-thumb:not(.ui-li-thumbnail-right) .ui-li-text-sub {
.ui-li-has-radio.ui-li-static {
padding-left: 1.6363636363636365rem;
}
-.ui-li-has-checkbox .ui-li-text-sub, .ui-li-has-radio .ui-li-text-sub {
+.ui-li-has-checkbox .ui-li-text-sub,
+.ui-li-has-radio .ui-li-text-sub {
padding-left: 1.6363636363636365rem;
}
.ui-li-has-thumb.ui-li-has-checkbox .ui-btn-inner a.ui-link-inherit,
.ui-li-has-thumb.ui-li-has-radio.ui-li-static {
padding-left: 3.5454545454545454rem;
}
-.ui-li-has-thumb.ui-li-has-checkbox .ui-li-text-sub, .ui-li-has-thumb.ui-li-has-radio .ui-li-text-sub {
+.ui-li-has-thumb.ui-li-has-checkbox .ui-li-text-sub,
+.ui-li-has-thumb.ui-li-has-radio .ui-li-text-sub {
padding-left: 3.5454545454545454rem;
}
.ui-li.ui-li-has-right-circle-btn .ui-btn-inner a {
padding-right: 2.1818181818181817rem;
}
-.ui-li.ui-li-has-right-btn:not(.ui-swipelist-item) .ui-btn-inner a {
+.ui-li.ui-li-has-right-btn:not(.ui-swipe) .ui-btn-inner a {
padding-right: 3.590909090909091rem;
}
.ui-li.ui-li-thumbnail-right .ui-btn-inner a {
.ui-li.ui-li-static.ui-li-has-right-circle-btn {
padding-right: 2.1818181818181817rem;
}
-.ui-li.ui-li-static.ui-li-has-right-btn:not(.ui-swipelist-item) {
+.ui-li.ui-li-static.ui-li-has-right-btn:not(.ui-swipe) {
padding-right: 3.590909090909091rem;
}
.ui-li.ui-li-static.ui-li-thumbnail-right {
padding-right: 2.3636363636363638rem;
}
-.ui-li-has-icon .ui-btn-inner a.ui-link-inherit, .ui-li-has-icon.ui-li-static {
+.ui-li-has-icon .ui-btn-inner a.ui-link-inherit,
+.ui-li-has-icon.ui-li-static {
min-height: 20px;
padding-left: 40px;
}
-o-text-overflow: ellipsis;
overflow: hidden !important;
}
-.ui-li-thumb, .ui-li-icon {
+.ui-li-thumb,
+.ui-li-icon {
position: absolute;
left: 1px;
top: 0;
.ui-listview * .ui-btn-inner > .ui-btn > .ui-btn-inner {
border-top: 0px;
}
-.ui-li-sub, .ui-li-sub-setting {
+.ui-li-sub,
+.ui-li-sub-setting {
float: right;
text-align: right;
font-size: 0.7272727272727273rem;
.ui-li-has-multiline.ui-li-static.ui-li-has-right-btn.ui-li-has-thumb .ui-li-text-sub {
width: 64%;
}
-.ui-li-icon-sub-right, .ui-li-icon-sub {
+.ui-li-icon-sub-right,
+.ui-li-icon-sub {
position: absolute;
left: auto;
width: 0.7727272727272727rem;
border-style: solid;
border-color: #8e9aa3;
border-width: 1px;
+ border-top-width: 0px;
}
.ui-listview li.ui-li-dialogue > .ui-btn-inner {
margin-left: 0px;
.ui-listview li.ui-li-dialogue .ui-link-inherit > .ui-btn {
margin-right: 0px;
}
-.ui-listview li.ui-li-dialogue.ui-li-static .ui-li-text-sub, .ui-listview li.ui-li-dialogue.ui-li-static .ui-toggle-switch {
+.ui-listview li.ui-li-dialogue.ui-li-static .ui-li-text-sub,
+.ui-listview li.ui-li-dialogue.ui-li-static .ui-toggle-switch {
right: 0.4545454545454546rem;
}
-.ui-listview li.ui-li-dialogue.ui-li-static.ui-li-has-checkbox, .ui-listview li.ui-li-dialogue.ui-li-static.ui-li-has-radio {
+.ui-listview li.ui-li-dialogue.ui-li-static.ui-li-has-checkbox,
+.ui-listview li.ui-li-dialogue.ui-li-static.ui-li-has-radio {
padding-left: 1.6363636363636365rem;
}
-.ui-listview li.ui-li-dialogue.ui-li-static .ui-checkbox, .ui-listview li.ui-li-dialogue.ui-li-static .ui-radio {
+.ui-listview li.ui-li-dialogue.ui-li-static .ui-checkbox,
+.ui-listview li.ui-li-dialogue.ui-li-static .ui-radio {
left: 0px;
}
.ui-listview li.ui-li-dialogue.ui-li-has-multiline.ui-li-static .ui-li-text-sub {
.ui-listview li.ui-li-dialogue.ui-li-has-multiline.ui-li-static .ui-li-text-sub2 {
padding-right: 0.4545454545454546rem;
}
-.ui-listview li.ui-li-dialogue.ui-li-has-multiline.ui-li-static.ui-li-has-checkbox .ui-li-text-sub, .ui-listview li.ui-li-dialogue.ui-li-has-multiline.ui-li-static.ui-li-has-radio .ui-li-text-sub {
+.ui-listview li.ui-li-dialogue.ui-li-has-multiline.ui-li-static.ui-li-has-checkbox .ui-li-text-sub,
+.ui-listview li.ui-li-dialogue.ui-li-has-multiline.ui-li-static.ui-li-has-radio .ui-li-text-sub {
padding-left: 1.9090909090909092rem;
}
-.ui-listview > li.ui-li-dialogue.ui-body-s:not(.ui-li-expanded), .ui-listview > li.ui-li-dialogue.ui-btn-hover-up-s:not(.ui-btn-down-s):not(.ui-li-expanded), .ui-listview > li.ui-li-dialogue.ui-btn-up-s:not(.ui-li-expanded) {
+.ui-listview li.ui-li-divider + .ui-li-dialogue {
+ border-top-width: 1px;
+}
+.ui-listview > li.ui-li-dialogue.ui-body-s:not(.ui-li-expanded),
+.ui-listview > li.ui-li-dialogue.ui-btn-hover-up-s:not(.ui-btn-down-s):not(.ui-li-expanded),
+.ui-listview > li.ui-li-dialogue.ui-btn-up-s:not(.ui-li-expanded) {
background: #efede5;
}
.ui-listview > li.ui-li-dialogue.ui-li-expanded {
.ui-listview > .ui-li.ui-li-dialogue-edit.ui-li-has-right-btn {
padding-right: 5rem;
}
-.ui-listview .ui-li-static.ui-li-bubble-receive, .ui-listview .ui-li-static.ui-li-bubble-left {
+.ui-listview .ui-li-static.ui-li-bubble-receive,
+.ui-listview .ui-li-static.ui-li-bubble-left {
color: #ffffff;
}
-.ui-listview .ui-li-static.ui-li-bubble-receive > .ui-li-bubble-time, .ui-listview .ui-li-static.ui-li-bubble-left > .ui-li-bubble-time {
+.ui-listview .ui-li-static.ui-li-bubble-receive > .ui-li-bubble-time,
+.ui-listview .ui-li-static.ui-li-bubble-left > .ui-li-bubble-time {
color: #d30000;
}
-.ui-listview .ui-li-static.ui-li-bubble-sent, .ui-listview .ui-li-static.ui-li-bubble-right {
+.ui-listview .ui-li-static.ui-li-bubble-sent,
+.ui-listview .ui-li-static.ui-li-bubble-right {
color: #000000;
}
-.ui-listview .ui-li-static.ui-li-bubble-sent > .ui-li-bubble-time, .ui-listview .ui-li-static.ui-li-bubble-right > .ui-li-bubble-time {
+.ui-listview .ui-li-static.ui-li-bubble-sent > .ui-li-bubble-time,
+.ui-listview .ui-li-static.ui-li-bubble-right > .ui-li-bubble-time {
color: #39a6d7;
}
.ui-listview .ui-li-static.ui-li-bubble-sos {
.ui-listview .ui-li-bubble-sos {
display: inline-block;
background-clip: padding-box;
- max-width: 80%;
+ max-width: 100%;
word-wrap: break-word;
font-size: 0.8636363636363636rem;
}
min-width: 7.272727272727273rem;
min-height: 7.272727272727273rem;
}
-.ui-listview .ui-li-bubble-receive, .ui-listview .ui-li-bubble-left {
+.ui-listview .ui-li-bubble-receive,
+.ui-listview .ui-li-bubble-left {
margin-left: 0px;
- margin-right: auto;
+ margin-right: 1.6rem;
border-image-source: url(images/00_messagebubble_bg_receive.9.png);
border-image-slice: 57 14 21 48 fill;
border-image-width: auto;
padding: 9px 14px 21px 48px;
}
-.ui-listview .ui-li-bubble-receive > .ui-li-bubble-time, .ui-listview .ui-li-bubble-left > .ui-li-bubble-time {
+.ui-listview .ui-li-bubble-receive > .ui-li-bubble-time,
+.ui-listview .ui-li-bubble-left > .ui-li-bubble-time {
position: absolute;
display: inline-block;
bottom: 0.36363636363636365rem;
left: 100%;
font-size: 0.5rem;
}
-.ui-listview .ui-li-bubble-sent, .ui-listview .ui-li-bubble-right {
- margin-left: auto;
+.ui-listview .ui-li-bubble-sent,
+.ui-listview .ui-li-bubble-right {
+ margin-left: 1.6rem;
margin-right: 0px;
border-image-source: url(images/00_messagebubble_bg_sent.9.png);
border-image-slice: 55 47 20 13 fill;
border-image-width: auto;
padding: 9px 47px 20px 13px;
}
-.ui-listview .ui-li-bubble-sent > .ui-li-bubble-time, .ui-listview .ui-li-bubble-right > .ui-li-bubble-time {
+.ui-listview .ui-li-bubble-sent > .ui-li-bubble-time,
+.ui-listview .ui-li-bubble-right > .ui-li-bubble-time {
position: absolute;
display: inline-block;
bottom: 0.36363636363636365rem;
/***************************************************************************
Body
***************************************************************************/
+/* B011 : Main Background color */
+/* B012 : Main font color */
/***************************************************************************
Naviframe
***************************************************************************/
-/* #3b73b6 *//* title text */
+/* B042 : title text */
/* B052L4 : Title text button */
/* B052L5 : Title text button press */
/* B052L1P : Title text button press bg */
/***************************************************************************
Button(connected with other winset)
***************************************************************************/
-.LESSbutton_box_style {
- color: #363133;
-}
-.LESSbutton_up_style {
- background: #ebe8e3;
- background: -webkit-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -moz-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -o-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -ms-linear-gradient(top, #ebe8e3, #eae7e2);
-}
-.LESSbutton_box_style {
- background: #ebe8e3;
- background: -webkit-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -moz-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -o-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -ms-linear-gradient(top, #ebe8e3, #eae7e2);
- border: 1px solid;
- border-color: #dcdad3;
- -o-box-shadow: 0 0 1px 1px #ffffff;
- -ms-box-shadow: 0 0 1px 1px #ffffff;
- -moz-box-shadow: 0 0 1px 1px #ffffff;
- -webkit-box-shadow: 0 0 1px 1px #ffffff;
- box-shadow: 0 0 1px 1px #ffffff;
-}
-.LESSbutton_inner_box_style {
- background: #f7f5ee;
- background: -webkit-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -ms-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -o-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -moz-linear-gradient(top, #faf7f2, #f8f5f0);
- -o-box-shadow: none;
- -ms-box-shadow: none;
- -moz-box-shadow: none;
- -webkit-box-shadow: none;
- box-shadow: none;
-}
-.LESSbutton_inner_pressstyle {
- color: #f8f6ef;
-}
-.LESSbutton_text1_style {
- font-family: Helvetica, Arial, sans-serif;
- font-weight: normal;
- font-size: 1.0rem;
- font-style: normal;
- color: #000000;
-}
-.LESSbutton_hover_style {
- color: #363133;
-}
-.LESSbutton_down_style {
- background: #3b73b6;
- color: #f8f6ef;
-}
-.LESSbutton_edit_style {
- background: #c95858;
- background: -webkit-gradient(linear, left top, left bottom, from(#c95858), to(#a12828));
- background: -moz_linear-gradient(top, #c95858, #a12828);
-}
+
+
+
+
+
+
+
+
+
/***************************************************************************
contextual popup
***************************************************************************/
-/* #1A5274 */
/***************************************************************************
Scrollview
***************************************************************************/
Date Time picker
***************************************************************************/
/***************************************************************************
- DaySelector
-***************************************************************************/
-/* #00a8e7 */
-/* #f01402 */
-/* #f9f9f9 *//* #f9f9f9 */.LESSDayselectorButtonNormal {
- background: #7e9db2;
- background: -webkit-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -moz-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -ms-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -o-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: linear-gradient(top, #7e9db2 0%, #547990 100%);
-}
-.LESSDayaselectorButtonPress {
- background: #3b7796;
- background: -webkit-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -moz-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -ms-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -o-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: linear-gradient(top, #3b7796 0%, #2f5b75 100%);
-}
-/***************************************************************************
- OptionHeader
-***************************************************************************/
-/* #f9f9f9 */
-/***************************************************************************
SegmentControl
***************************************************************************/
-/* #F9F9F9*/
-/* #F9F9F9*/
-/***************************************************************************
- ControlGroup
-***************************************************************************/
-/* 00_divider_line.9.png */
+/* B052L4 : Title text button */
/***************************************************************************
Popup
***************************************************************************/
/* popup_title_bg.png */
/* maybe not use only popupwindow*/
-.LESSpopup_button_style {
- /* background: @color_popup_buttonbg;
- background: @color_popup_buttonbg_webkit;
- background: @color_popup_buttonbg_moz;
- background: @color_popup_buttonbg_ms;
- background: @color_popup_buttonbg_o;
- color: @color_popup_buttontext;*/
-}
-.LESSpopup_button_hover_style {
- background: #5e88a3;
-}
-.LESSpopup_button_press_style {
- background: #43a0d9;
- background: -webkit-gradient(linear, left top, left bottom, from(#43a0d9), to(#388bb9));
- background: -moz-linear-gradient(top, #43a0d9, #388bb9);
- background: -ms-linear-gradient(top, #43a0d9, #388bb9);
- background: -o-linear-gradient(top, #43a0d9, #388bb9);
-}
+
+
/***************************************************************************
- Button
-***************************************************************************/
-.LESStoggleswitch_on_style {
- background: #2a7eac;
- background: -webkit-gradient(linear, left top, left bottom, from(#2174a7), to(#4ba5db));
- background: -moz-linear-gradient(top, #2174a7, #4ba5db);
- border-radius: 4px;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
-}
-.LESStoggleswitch_off_style {
- color: #cbcbcb;
- background: #97a1a7;
- background: -webkit-gradient(linear, left top, left bottom, from(#727272), to(#8d8d8d));
- background: -moz-linear-gradient(top, #727272, #8d8d8d);
- border-radius: 4px;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
-}
-.LESStoggleswitch_reed_style {
- background: #fdfdfd;
- background: -webkit-gradient(linear, left top, left bottom, from(#fdfdfd), to(#e7e7e7));
- background: -moz-linear-gradient(top, #fdfdfd, #e7e7e7);
- border-radius: 2px;
- -webkit-border-radius: 2px;
- -moz-border-radius: 2px;
-}
-.LESSbutton_editpress_style {
- background: #931818;
- background: -webkit-gradient(linear, left top, left bottom, from(#931818), to(#6e1717));
- background: -moz-linear-gradient(top, #931818, #6e1717);
-}
-.LESSbutton_edit_padding {
- padding: 0.5em 0.8em;
-}
-/***************************************************************************
- Tickernoti
+ Tickernoti
***************************************************************************/
/***************************************************************************
Smallpopup
***************************************************************************/
/***************************************************************************
- No Contents
-***************************************************************************/
-/***************************************************************************
Slider
***************************************************************************/
/***************************************************************************
/***************************************************************************
multimediaview
***************************************************************************/
-.LESSmultimediaview_bar_active_style {
- background-color: #4a84c9;
- background-image: -webkit-gradient(linear, left top, left bottom, from(#6289d9), to(#295b98));
- background-image: -moz-linear-gradient(top, #6289d9, #295b98);
- background-image: -o-linear-gradient(top, #6289d9, #295b98);
- background-image: -ms-linear-gradient(top, #6289d9, #295b98);
-}
-.LESSmultimediaview_bar_handle_style {
- background-color: #f9f9f9;
- background-image: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#e6e6e6));
- background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: -ms-linear-gradient(top, #ffffff, #e6e6e6);
-}
+
+
/***************************************************************************
tokentextarea
***************************************************************************/
/***************************************************************************
+ Splitview
***************************************************************************/
.ui-controlgroup .ui-radio > .ui-btn {
background: #f8f6ef;
-webkit-border-radius: .3em ;
border-radius: .3em ;
}
-.ui-controlgroup .ui-radio-off.ui-btn-hover-s.ui-btn-down-s .ui-btn-inner, .ui-controlgroup .ui-radio-on .ui-btn-inner {
- color: #f9f9f9;
+.ui-controlgroup .ui-radio-off.ui-btn-hover-s.ui-btn-down-s .ui-btn-inner,
+.ui-controlgroup .ui-radio-on .ui-btn-inner {
+ color: #3b7796;
}
.ui-controlgroup .ui-radio-off .ui-btn-inner {
- color: #f9f9f9;
+ color: #3a3a3a;
}
.ui-controlgroup.ui-controlgroup-horizontal .ui-radio .ui-btn-down-s .ui-btn-inner {
background: -webkit-linear-gradient(top, #d2d2c8 0%, #f6f8ef 100%);
}
+/*
+* jQuery Mobile Framework
+* Copyright (c) jQuery Project
+* Dual licensed under the MIT (MIT-LICENSE.txt) or GPL (GPL-LICENSE.txt) licenses.
+*/
+/*** less definitions ***/
/****************************
* Tizen Common Less Header *
****************************/
/***************************************************************************
Body
***************************************************************************/
+/* B011 : Main Background color */
+/* B012 : Main font color */
/***************************************************************************
Naviframe
***************************************************************************/
-/* #3b73b6 *//* title text */
+/* B042 : title text */
/* B052L4 : Title text button */
/* B052L5 : Title text button press */
/* B052L1P : Title text button press bg */
/***************************************************************************
Button(connected with other winset)
***************************************************************************/
-.LESSbutton_box_style {
- color: #363133;
-}
-.LESSbutton_up_style {
- background: #ebe8e3;
- background: -webkit-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -moz-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -o-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -ms-linear-gradient(top, #ebe8e3, #eae7e2);
-}
-.LESSbutton_box_style {
- background: #ebe8e3;
- background: -webkit-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -moz-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -o-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -ms-linear-gradient(top, #ebe8e3, #eae7e2);
- border: 1px solid;
- border-color: #dcdad3;
- -o-box-shadow: 0 0 1px 1px #ffffff;
- -ms-box-shadow: 0 0 1px 1px #ffffff;
- -moz-box-shadow: 0 0 1px 1px #ffffff;
- -webkit-box-shadow: 0 0 1px 1px #ffffff;
- box-shadow: 0 0 1px 1px #ffffff;
-}
-.LESSbutton_inner_box_style {
- background: #f7f5ee;
- background: -webkit-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -ms-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -o-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -moz-linear-gradient(top, #faf7f2, #f8f5f0);
- -o-box-shadow: none;
- -ms-box-shadow: none;
- -moz-box-shadow: none;
- -webkit-box-shadow: none;
- box-shadow: none;
-}
-.LESSbutton_inner_pressstyle {
- color: #f8f6ef;
-}
-.LESSbutton_text1_style {
- font-family: Helvetica, Arial, sans-serif;
- font-weight: normal;
- font-size: 1.0rem;
- font-style: normal;
- color: #000000;
-}
-.LESSbutton_hover_style {
- color: #363133;
-}
-.LESSbutton_down_style {
- background: #3b73b6;
- color: #f8f6ef;
-}
-.LESSbutton_edit_style {
- background: #c95858;
- background: -webkit-gradient(linear, left top, left bottom, from(#c95858), to(#a12828));
- background: -moz_linear-gradient(top, #c95858, #a12828);
-}
+
+
+
+
+
+
+
+
+
/***************************************************************************
contextual popup
***************************************************************************/
-/* #1A5274 */
/***************************************************************************
Scrollview
***************************************************************************/
Date Time picker
***************************************************************************/
/***************************************************************************
- DaySelector
-***************************************************************************/
-/* #00a8e7 */
-/* #f01402 */
-/* #f9f9f9 *//* #f9f9f9 */.LESSDayselectorButtonNormal {
- background: #7e9db2;
- background: -webkit-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -moz-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -ms-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -o-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: linear-gradient(top, #7e9db2 0%, #547990 100%);
-}
-.LESSDayaselectorButtonPress {
- background: #3b7796;
- background: -webkit-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -moz-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -ms-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -o-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: linear-gradient(top, #3b7796 0%, #2f5b75 100%);
-}
-/***************************************************************************
- OptionHeader
-***************************************************************************/
-/* #f9f9f9 */
-/***************************************************************************
SegmentControl
***************************************************************************/
-/* #F9F9F9*/
-/* #F9F9F9*/
-/***************************************************************************
- ControlGroup
-***************************************************************************/
-/* 00_divider_line.9.png */
+/* B052L4 : Title text button */
/***************************************************************************
Popup
***************************************************************************/
/* popup_title_bg.png */
/* maybe not use only popupwindow*/
-.LESSpopup_button_style {
- /* background: @color_popup_buttonbg;
- background: @color_popup_buttonbg_webkit;
- background: @color_popup_buttonbg_moz;
- background: @color_popup_buttonbg_ms;
- background: @color_popup_buttonbg_o;
- color: @color_popup_buttontext;*/
-}
-.LESSpopup_button_hover_style {
- background: #5e88a3;
-}
-.LESSpopup_button_press_style {
- background: #43a0d9;
- background: -webkit-gradient(linear, left top, left bottom, from(#43a0d9), to(#388bb9));
- background: -moz-linear-gradient(top, #43a0d9, #388bb9);
- background: -ms-linear-gradient(top, #43a0d9, #388bb9);
- background: -o-linear-gradient(top, #43a0d9, #388bb9);
-}
-/***************************************************************************
- Button
-***************************************************************************/
-.LESStoggleswitch_on_style {
- background: #2a7eac;
- background: -webkit-gradient(linear, left top, left bottom, from(#2174a7), to(#4ba5db));
- background: -moz-linear-gradient(top, #2174a7, #4ba5db);
- border-radius: 4px;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
-}
-.LESStoggleswitch_off_style {
- color: #cbcbcb;
- background: #97a1a7;
- background: -webkit-gradient(linear, left top, left bottom, from(#727272), to(#8d8d8d));
- background: -moz-linear-gradient(top, #727272, #8d8d8d);
- border-radius: 4px;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
-}
-.LESStoggleswitch_reed_style {
- background: #fdfdfd;
- background: -webkit-gradient(linear, left top, left bottom, from(#fdfdfd), to(#e7e7e7));
- background: -moz-linear-gradient(top, #fdfdfd, #e7e7e7);
- border-radius: 2px;
- -webkit-border-radius: 2px;
- -moz-border-radius: 2px;
-}
-.LESSbutton_editpress_style {
- background: #931818;
- background: -webkit-gradient(linear, left top, left bottom, from(#931818), to(#6e1717));
- background: -moz-linear-gradient(top, #931818, #6e1717);
-}
-.LESSbutton_edit_padding {
- padding: 0.5em 0.8em;
-}
+
+
/***************************************************************************
Tickernoti
***************************************************************************/
Smallpopup
***************************************************************************/
/***************************************************************************
- No Contents
-***************************************************************************/
-/***************************************************************************
Slider
***************************************************************************/
/***************************************************************************
/***************************************************************************
multimediaview
***************************************************************************/
-.LESSmultimediaview_bar_active_style {
- background-color: #4a84c9;
- background-image: -webkit-gradient(linear, left top, left bottom, from(#6289d9), to(#295b98));
- background-image: -moz-linear-gradient(top, #6289d9, #295b98);
- background-image: -o-linear-gradient(top, #6289d9, #295b98);
- background-image: -ms-linear-gradient(top, #6289d9, #295b98);
-}
-.LESSmultimediaview_bar_handle_style {
- background-color: #f9f9f9;
- background-image: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#e6e6e6));
- background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: -ms-linear-gradient(top, #ffffff, #e6e6e6);
-}
+
+
/***************************************************************************
tokentextarea
***************************************************************************/
/***************************************************************************
+ Splitview
***************************************************************************/
-.ui-option-header {
- overflow: hidden;
- background: #1a5274;
-}
-.ui-option-header-1-row {
- height: 4.818181818181818rem;
- border: none;
-}
-.ui-option-header-2-row {
- height: 8.90909090909091rem;
- border: none;
-}
-.ui-option-header-row-1 {
- height: 4.818181818181818rem;
-}
-.ui-option-header-row-2 {
- height: 8.90909090909091rem;
- margin-top: -2px;
- padding: 0rem 0.2272727272727273rem 0.2727272727272727rem 0.2272727272727273rem;
-}
-.ui-option-header-row-2 div {
- margin-top: 0.2272727272727273rem;
- margin-bottom: 0.2272727272727273rem;
-}
-.ui-option-header .ui-btn {
- display: block;
- margin: 0.13636363636363635rem 0.2272727272727273rem 0.2272727272727273rem 0.2272727272727273rem;
-}
-.ui-option-header .ui-input-search .ui-btn {
- display: none;
-}
-.ui-option-header .ui-btn-text {
- line-height: 1.5454545454545454rem;
- font-weight: bold;
-}
-.ui-option-header .ui-btn-down-s.ui-btn-hover-s .ui-btn-inner, .ui-option-header .ui-btn-down-s .ui-btn-inner {
- background: -webkit-linear-gradient(top, #4aa4da 0%, #2b8ac3 100%);
-}
-.ui-option-header .ui-btn-hover-s .ui-btn-inner, .ui-option-header .ui-btn-up-s .ui-btn-inner {
- background: -webkit-linear-gradient(top, #38708d 0%, #245d80 100%);
-}
-.ui-option-header .ui-btn-inner {
- padding-top: 0.2727272727272727rem;
- padding-bottom: 0.2727272727272727rem;
- color: #f9f9f9;
-}
-.ui-option-header .ui-controlgroup-horizontal .ui-btn {
- display: inline-block !important;
- margin: -0.13636363636363635rem !important;
-}
-.ui-option-header .ui-controlgroup, .ui-option-header fieldset.ui-controlgroup {
- margin-bottom: 0px !important;
-}
-.ui-option-header .ui-controlgroup-horizontal .ui-corner-left {
- margin-left: 0.2272727272727273rem !important;
-}
-.ui-option-header .ui-controlgroup-horizontal .ui-corner-right {
- margin-right: 0.2272727272727273rem !important;
-}
-.ui-option-header-triangle-arrow {
- top: -0.5454545454545454rem;
- height: 0.4545454545454546rem;
- width: 100%;
- position: relative;
- margin-bottom: -0.4545454545454546rem;
-}
-.ui-header.ui-option-header-resizing .ui-option-header .ui-btn {
- background: transparent;
- border: none;
- width: 100%;
- top: 0.7272727272727273rem;
-}
-.ui-header.ui-option-header-resizing .ui-option-header .ui-btn .ui-btn-inner {
- width: 92%;
- padding: 0.66em 0px 0.66em;
- margin: 0px auto;
-}
-.ui-header.ui-option-header-resizing .ui-option-header .input-search-bar .ui-btn {
- width: 28%;
- /* 134 * @unit_base; */
-
-}
-/*
-.ui-triangle {
- color : @color_optionheader_Background;
-
+ul.ui-virtual-list-container > li.position_absolute {
position: absolute;
- bottom: 0px;
- border-style: solid;
-
- margin-left : -10 * @unit_base;
-
- border-left-width : 10 * @unit_base;
- border-top-width : 0 * @unit_base;
- border-right-width :10 * @unit_base;
- border-bottom-width : 10 * @unit_base;
- border-bottom-color : @color_optionheader_Background;
}
-*/
-.ui-triangle-image {
- background-image: url(images/00_winset_control_top_arrow.png);
- background-size: 100% 100%;
+ul.ui-virtual-list-container > ul.position_absolute {
position: absolute;
- width: 1.2727272727272727rem;
- height: 1.0909090909090908rem;
- left: 50%;
-}
-.ui-btn-up-s .ui-icon-optiontray, .ui-btn-hover-s .ui-icon-optiontray {
- background-size: 100% 100%;
- background-image: url(images/00_winset_more.png);
-}
-.ui-btn-down-s .ui-icon-optiontray {
- background-size: 100% 100%;
- background-image: url(images/00_winset_more_press.png);
-}
-.ui-header .ui-btn .ui-btn-icon-only {
- padding: 0 0 0 0;
- height: 100%;
-}
-.ui-header .ui-btn .ui-btn-icon-only .ui-icon-optiontray {
- width: 2.5454545454545454rem;
- height: 2.5454545454545454rem;
- left: 1.3636363636363638rem;
}
-/*
-* jQuery Mobile Framework
-* Copyright (c) jQuery Project
-* Dual licensed under the MIT (MIT-LICENSE.txt) or GPL (GPL-LICENSE.txt) licenses.
-*/
-/*** less definitions ***/
/****************************
* Tizen Common Less Header *
****************************/
/***************************************************************************
Body
***************************************************************************/
+/* B011 : Main Background color */
+/* B012 : Main font color */
/***************************************************************************
Naviframe
***************************************************************************/
-/* #3b73b6 *//* title text */
+/* B042 : title text */
/* B052L4 : Title text button */
/* B052L5 : Title text button press */
/* B052L1P : Title text button press bg */
/***************************************************************************
Button(connected with other winset)
***************************************************************************/
-.LESSbutton_box_style {
- color: #363133;
-}
-.LESSbutton_up_style {
- background: #ebe8e3;
- background: -webkit-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -moz-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -o-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -ms-linear-gradient(top, #ebe8e3, #eae7e2);
-}
-.LESSbutton_box_style {
- background: #ebe8e3;
- background: -webkit-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -moz-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -o-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -ms-linear-gradient(top, #ebe8e3, #eae7e2);
- border: 1px solid;
- border-color: #dcdad3;
- -o-box-shadow: 0 0 1px 1px #ffffff;
- -ms-box-shadow: 0 0 1px 1px #ffffff;
- -moz-box-shadow: 0 0 1px 1px #ffffff;
- -webkit-box-shadow: 0 0 1px 1px #ffffff;
- box-shadow: 0 0 1px 1px #ffffff;
-}
-.LESSbutton_inner_box_style {
- background: #f7f5ee;
- background: -webkit-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -ms-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -o-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -moz-linear-gradient(top, #faf7f2, #f8f5f0);
- -o-box-shadow: none;
- -ms-box-shadow: none;
- -moz-box-shadow: none;
- -webkit-box-shadow: none;
- box-shadow: none;
-}
-.LESSbutton_inner_pressstyle {
- color: #f8f6ef;
-}
-.LESSbutton_text1_style {
- font-family: Helvetica, Arial, sans-serif;
- font-weight: normal;
- font-size: 1.0rem;
- font-style: normal;
- color: #000000;
-}
-.LESSbutton_hover_style {
- color: #363133;
-}
-.LESSbutton_down_style {
- background: #3b73b6;
- color: #f8f6ef;
-}
-.LESSbutton_edit_style {
- background: #c95858;
- background: -webkit-gradient(linear, left top, left bottom, from(#c95858), to(#a12828));
- background: -moz_linear-gradient(top, #c95858, #a12828);
-}
+
+
+
+
+
+
+
+
+
/***************************************************************************
contextual popup
***************************************************************************/
-/* #1A5274 */
/***************************************************************************
Scrollview
***************************************************************************/
Date Time picker
***************************************************************************/
/***************************************************************************
- DaySelector
+ SegmentControl
***************************************************************************/
-/* #00a8e7 */
-/* #f01402 */
-/* #f9f9f9 *//* #f9f9f9 */.LESSDayselectorButtonNormal {
- background: #7e9db2;
- background: -webkit-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -moz-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -ms-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -o-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: linear-gradient(top, #7e9db2 0%, #547990 100%);
-}
-.LESSDayaselectorButtonPress {
- background: #3b7796;
- background: -webkit-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -moz-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -ms-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -o-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: linear-gradient(top, #3b7796 0%, #2f5b75 100%);
-}
-/***************************************************************************
- OptionHeader
-***************************************************************************/
-/* #f9f9f9 */
-/***************************************************************************
- SegmentControl
-***************************************************************************/
-/* #F9F9F9*/
-/* #F9F9F9*/
-/***************************************************************************
- ControlGroup
-***************************************************************************/
-/* 00_divider_line.9.png */
+/* B052L4 : Title text button */
/***************************************************************************
Popup
***************************************************************************/
/* popup_title_bg.png */
/* maybe not use only popupwindow*/
-.LESSpopup_button_style {
- /* background: @color_popup_buttonbg;
- background: @color_popup_buttonbg_webkit;
- background: @color_popup_buttonbg_moz;
- background: @color_popup_buttonbg_ms;
- background: @color_popup_buttonbg_o;
- color: @color_popup_buttontext;*/
-}
-.LESSpopup_button_hover_style {
- background: #5e88a3;
-}
-.LESSpopup_button_press_style {
- background: #43a0d9;
- background: -webkit-gradient(linear, left top, left bottom, from(#43a0d9), to(#388bb9));
- background: -moz-linear-gradient(top, #43a0d9, #388bb9);
- background: -ms-linear-gradient(top, #43a0d9, #388bb9);
- background: -o-linear-gradient(top, #43a0d9, #388bb9);
-}
-/***************************************************************************
- Button
-***************************************************************************/
-.LESStoggleswitch_on_style {
- background: #2a7eac;
- background: -webkit-gradient(linear, left top, left bottom, from(#2174a7), to(#4ba5db));
- background: -moz-linear-gradient(top, #2174a7, #4ba5db);
- border-radius: 4px;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
-}
-.LESStoggleswitch_off_style {
- color: #cbcbcb;
- background: #97a1a7;
- background: -webkit-gradient(linear, left top, left bottom, from(#727272), to(#8d8d8d));
- background: -moz-linear-gradient(top, #727272, #8d8d8d);
- border-radius: 4px;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
-}
-.LESStoggleswitch_reed_style {
- background: #fdfdfd;
- background: -webkit-gradient(linear, left top, left bottom, from(#fdfdfd), to(#e7e7e7));
- background: -moz-linear-gradient(top, #fdfdfd, #e7e7e7);
- border-radius: 2px;
- -webkit-border-radius: 2px;
- -moz-border-radius: 2px;
-}
-.LESSbutton_editpress_style {
- background: #931818;
- background: -webkit-gradient(linear, left top, left bottom, from(#931818), to(#6e1717));
- background: -moz-linear-gradient(top, #931818, #6e1717);
-}
-.LESSbutton_edit_padding {
- padding: 0.5em 0.8em;
-}
-/***************************************************************************
- Tickernoti
-***************************************************************************/
-/***************************************************************************
- Smallpopup
-***************************************************************************/
-/***************************************************************************
- No Contents
-***************************************************************************/
-/***************************************************************************
- Slider
-***************************************************************************/
-/***************************************************************************
- Progress
-***************************************************************************/
-/***************************************************************************
- Handler
-***************************************************************************/
-/***************************************************************************
- multimediaview
-***************************************************************************/
-.LESSmultimediaview_bar_active_style {
- background-color: #4a84c9;
- background-image: -webkit-gradient(linear, left top, left bottom, from(#6289d9), to(#295b98));
- background-image: -moz-linear-gradient(top, #6289d9, #295b98);
- background-image: -o-linear-gradient(top, #6289d9, #295b98);
- background-image: -ms-linear-gradient(top, #6289d9, #295b98);
-}
-.LESSmultimediaview_bar_handle_style {
- background-color: #f9f9f9;
- background-image: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#e6e6e6));
- background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: -ms-linear-gradient(top, #ffffff, #e6e6e6);
-}
-/***************************************************************************
- tokentextarea
-***************************************************************************/
-/***************************************************************************
-***************************************************************************/
-ul.ui-virtual-list-container > li.position_absolute {
- position: absolute;
-}
-ul.ui-virtual-list-container > ul.position_absolute {
- position: absolute;
-}
-/****************************
- * Tizen Common Less Header *
- ****************************/
-/*
- * Common definition for theme
- * 'config.less' in each theme must include this file.
- */
-/******************************
- z-index order collection
- ******************************/
-/******************************
- Global LESS mixin collection
- ******************************/
-/***************************************************************************
- Body
-***************************************************************************/
-/***************************************************************************
- Naviframe
-***************************************************************************/
-/* #3b73b6 *//* title text */
-/* B052L4 : Title text button */
-/* B052L5 : Title text button press */
-/* B052L1P : Title text button press bg */
-/* 00_divider_line.9.png */
-/***************************************************************************
- Tabbar
-***************************************************************************/
-/* B0514P1 : 00_tab_press_ef.9.png */
-/* B052L6P */
-/* B052L6 */
-/***************************************************************************
- List
-***************************************************************************/
-/* B0211 */
-/* B041 */
-/* B0221 */
-/* W021L1 */
-/* W021L2 */
-/***************************************************************************
- Shortcut Scroll
-***************************************************************************/
-/* B0723 : 00_fast_scroll_rollover_bg.9.png */
-/* B0721 : Rollover text */
-/* B0731 : 00_fast_scroll_popup_bg.png */
-/* B0732 : Scroll popup text */
-/***************************************************************************
- SearchBar(forms.textinput)
-***************************************************************************/
-/* Search default text */
-/* W301 : 00_search_edit_field_bg.png */
-/***************************************************************************
- Popup
-***************************************************************************/
-/* B061L1 : Popop info */
-/***************************************************************************
- Button(connected with other winset)
-***************************************************************************/
-.LESSbutton_box_style {
- color: #363133;
-}
-.LESSbutton_up_style {
- background: #ebe8e3;
- background: -webkit-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -moz-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -o-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -ms-linear-gradient(top, #ebe8e3, #eae7e2);
-}
-.LESSbutton_box_style {
- background: #ebe8e3;
- background: -webkit-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -moz-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -o-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -ms-linear-gradient(top, #ebe8e3, #eae7e2);
- border: 1px solid;
- border-color: #dcdad3;
- -o-box-shadow: 0 0 1px 1px #ffffff;
- -ms-box-shadow: 0 0 1px 1px #ffffff;
- -moz-box-shadow: 0 0 1px 1px #ffffff;
- -webkit-box-shadow: 0 0 1px 1px #ffffff;
- box-shadow: 0 0 1px 1px #ffffff;
-}
-.LESSbutton_inner_box_style {
- background: #f7f5ee;
- background: -webkit-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -ms-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -o-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -moz-linear-gradient(top, #faf7f2, #f8f5f0);
- -o-box-shadow: none;
- -ms-box-shadow: none;
- -moz-box-shadow: none;
- -webkit-box-shadow: none;
- box-shadow: none;
-}
-.LESSbutton_inner_pressstyle {
- color: #f8f6ef;
-}
-.LESSbutton_text1_style {
- font-family: Helvetica, Arial, sans-serif;
- font-weight: normal;
- font-size: 1.0rem;
- font-style: normal;
- color: #000000;
-}
-.LESSbutton_hover_style {
- color: #363133;
-}
-.LESSbutton_down_style {
- background: #3b73b6;
- color: #f8f6ef;
-}
-.LESSbutton_edit_style {
- background: #c95858;
- background: -webkit-gradient(linear, left top, left bottom, from(#c95858), to(#a12828));
- background: -moz_linear-gradient(top, #c95858, #a12828);
-}
-/***************************************************************************
- contextual popup
-***************************************************************************/
-/* #1A5274 */
-/***************************************************************************
- Scrollview
-***************************************************************************/
-/***************************************************************************
- Date Time picker
-***************************************************************************/
-/***************************************************************************
- DaySelector
-***************************************************************************/
-/* #00a8e7 */
-/* #f01402 */
-/* #f9f9f9 *//* #f9f9f9 */.LESSDayselectorButtonNormal {
- background: #7e9db2;
- background: -webkit-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -moz-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -ms-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -o-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: linear-gradient(top, #7e9db2 0%, #547990 100%);
-}
-.LESSDayaselectorButtonPress {
- background: #3b7796;
- background: -webkit-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -moz-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -ms-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -o-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: linear-gradient(top, #3b7796 0%, #2f5b75 100%);
-}
-/***************************************************************************
- OptionHeader
-***************************************************************************/
-/* #f9f9f9 */
-/***************************************************************************
- SegmentControl
-***************************************************************************/
-/* #F9F9F9*/
-/* #F9F9F9*/
-/***************************************************************************
- ControlGroup
-***************************************************************************/
-/* 00_divider_line.9.png */
-/***************************************************************************
- Popup
-***************************************************************************/
-/* popup_title_bg.png */
-/* maybe not use only popupwindow*/
-.LESSpopup_button_style {
- /* background: @color_popup_buttonbg;
- background: @color_popup_buttonbg_webkit;
- background: @color_popup_buttonbg_moz;
- background: @color_popup_buttonbg_ms;
- background: @color_popup_buttonbg_o;
- color: @color_popup_buttontext;*/
-}
-.LESSpopup_button_hover_style {
- background: #5e88a3;
-}
-.LESSpopup_button_press_style {
- background: #43a0d9;
- background: -webkit-gradient(linear, left top, left bottom, from(#43a0d9), to(#388bb9));
- background: -moz-linear-gradient(top, #43a0d9, #388bb9);
- background: -ms-linear-gradient(top, #43a0d9, #388bb9);
- background: -o-linear-gradient(top, #43a0d9, #388bb9);
-}
-/***************************************************************************
- Button
-***************************************************************************/
-.LESStoggleswitch_on_style {
- background: #2a7eac;
- background: -webkit-gradient(linear, left top, left bottom, from(#2174a7), to(#4ba5db));
- background: -moz-linear-gradient(top, #2174a7, #4ba5db);
- border-radius: 4px;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
-}
-.LESStoggleswitch_off_style {
- color: #cbcbcb;
- background: #97a1a7;
- background: -webkit-gradient(linear, left top, left bottom, from(#727272), to(#8d8d8d));
- background: -moz-linear-gradient(top, #727272, #8d8d8d);
- border-radius: 4px;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
-}
-.LESStoggleswitch_reed_style {
- background: #fdfdfd;
- background: -webkit-gradient(linear, left top, left bottom, from(#fdfdfd), to(#e7e7e7));
- background: -moz-linear-gradient(top, #fdfdfd, #e7e7e7);
- border-radius: 2px;
- -webkit-border-radius: 2px;
- -moz-border-radius: 2px;
-}
-.LESSbutton_editpress_style {
- background: #931818;
- background: -webkit-gradient(linear, left top, left bottom, from(#931818), to(#6e1717));
- background: -moz-linear-gradient(top, #931818, #6e1717);
-}
-.LESSbutton_edit_padding {
- padding: 0.5em 0.8em;
-}
+
/***************************************************************************
Tickernoti
***************************************************************************/
Smallpopup
***************************************************************************/
/***************************************************************************
- No Contents
-***************************************************************************/
-/***************************************************************************
Slider
***************************************************************************/
/***************************************************************************
/***************************************************************************
multimediaview
***************************************************************************/
-.LESSmultimediaview_bar_active_style {
- background-color: #4a84c9;
- background-image: -webkit-gradient(linear, left top, left bottom, from(#6289d9), to(#295b98));
- background-image: -moz-linear-gradient(top, #6289d9, #295b98);
- background-image: -o-linear-gradient(top, #6289d9, #295b98);
- background-image: -ms-linear-gradient(top, #6289d9, #295b98);
-}
-.LESSmultimediaview_bar_handle_style {
- background-color: #f9f9f9;
- background-image: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#e6e6e6));
- background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: -ms-linear-gradient(top, #ffffff, #e6e6e6);
-}
+
+
/***************************************************************************
tokentextarea
***************************************************************************/
/***************************************************************************
+ Splitview
***************************************************************************/
.ui-scrollview-clip {
position: relative;
/***************************************************************************
Body
***************************************************************************/
+/* B011 : Main Background color */
+/* B012 : Main font color */
/***************************************************************************
Naviframe
***************************************************************************/
-/* #3b73b6 *//* title text */
+/* B042 : title text */
/* B052L4 : Title text button */
/* B052L5 : Title text button press */
/* B052L1P : Title text button press bg */
/***************************************************************************
Button(connected with other winset)
***************************************************************************/
-.LESSbutton_box_style {
- color: #363133;
-}
-.LESSbutton_up_style {
- background: #ebe8e3;
- background: -webkit-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -moz-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -o-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -ms-linear-gradient(top, #ebe8e3, #eae7e2);
-}
-.LESSbutton_box_style {
- background: #ebe8e3;
- background: -webkit-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -moz-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -o-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -ms-linear-gradient(top, #ebe8e3, #eae7e2);
- border: 1px solid;
- border-color: #dcdad3;
- -o-box-shadow: 0 0 1px 1px #ffffff;
- -ms-box-shadow: 0 0 1px 1px #ffffff;
- -moz-box-shadow: 0 0 1px 1px #ffffff;
- -webkit-box-shadow: 0 0 1px 1px #ffffff;
- box-shadow: 0 0 1px 1px #ffffff;
-}
-.LESSbutton_inner_box_style {
- background: #f7f5ee;
- background: -webkit-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -ms-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -o-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -moz-linear-gradient(top, #faf7f2, #f8f5f0);
- -o-box-shadow: none;
- -ms-box-shadow: none;
- -moz-box-shadow: none;
- -webkit-box-shadow: none;
- box-shadow: none;
-}
-.LESSbutton_inner_pressstyle {
- color: #f8f6ef;
-}
-.LESSbutton_text1_style {
- font-family: Helvetica, Arial, sans-serif;
- font-weight: normal;
- font-size: 1.0rem;
- font-style: normal;
- color: #000000;
-}
-.LESSbutton_hover_style {
- color: #363133;
-}
-.LESSbutton_down_style {
- background: #3b73b6;
- color: #f8f6ef;
-}
-.LESSbutton_edit_style {
- background: #c95858;
- background: -webkit-gradient(linear, left top, left bottom, from(#c95858), to(#a12828));
- background: -moz_linear-gradient(top, #c95858, #a12828);
-}
+
+
+
+
+
+
+
+
+
/***************************************************************************
contextual popup
***************************************************************************/
-/* #1A5274 */
/***************************************************************************
Scrollview
***************************************************************************/
Date Time picker
***************************************************************************/
/***************************************************************************
- DaySelector
-***************************************************************************/
-/* #00a8e7 */
-/* #f01402 */
-/* #f9f9f9 *//* #f9f9f9 */.LESSDayselectorButtonNormal {
- background: #7e9db2;
- background: -webkit-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -moz-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -ms-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -o-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: linear-gradient(top, #7e9db2 0%, #547990 100%);
-}
-.LESSDayaselectorButtonPress {
- background: #3b7796;
- background: -webkit-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -moz-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -ms-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -o-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: linear-gradient(top, #3b7796 0%, #2f5b75 100%);
-}
-/***************************************************************************
- OptionHeader
-***************************************************************************/
-/* #f9f9f9 */
-/***************************************************************************
SegmentControl
***************************************************************************/
-/* #F9F9F9*/
-/* #F9F9F9*/
-/***************************************************************************
- ControlGroup
-***************************************************************************/
-/* 00_divider_line.9.png */
+/* B052L4 : Title text button */
/***************************************************************************
Popup
***************************************************************************/
/* popup_title_bg.png */
/* maybe not use only popupwindow*/
-.LESSpopup_button_style {
- /* background: @color_popup_buttonbg;
- background: @color_popup_buttonbg_webkit;
- background: @color_popup_buttonbg_moz;
- background: @color_popup_buttonbg_ms;
- background: @color_popup_buttonbg_o;
- color: @color_popup_buttontext;*/
-}
-.LESSpopup_button_hover_style {
- background: #5e88a3;
-}
-.LESSpopup_button_press_style {
- background: #43a0d9;
- background: -webkit-gradient(linear, left top, left bottom, from(#43a0d9), to(#388bb9));
- background: -moz-linear-gradient(top, #43a0d9, #388bb9);
- background: -ms-linear-gradient(top, #43a0d9, #388bb9);
- background: -o-linear-gradient(top, #43a0d9, #388bb9);
-}
-/***************************************************************************
- Button
-***************************************************************************/
-.LESStoggleswitch_on_style {
- background: #2a7eac;
- background: -webkit-gradient(linear, left top, left bottom, from(#2174a7), to(#4ba5db));
- background: -moz-linear-gradient(top, #2174a7, #4ba5db);
- border-radius: 4px;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
-}
-.LESStoggleswitch_off_style {
- color: #cbcbcb;
- background: #97a1a7;
- background: -webkit-gradient(linear, left top, left bottom, from(#727272), to(#8d8d8d));
- background: -moz-linear-gradient(top, #727272, #8d8d8d);
- border-radius: 4px;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
-}
-.LESStoggleswitch_reed_style {
- background: #fdfdfd;
- background: -webkit-gradient(linear, left top, left bottom, from(#fdfdfd), to(#e7e7e7));
- background: -moz-linear-gradient(top, #fdfdfd, #e7e7e7);
- border-radius: 2px;
- -webkit-border-radius: 2px;
- -moz-border-radius: 2px;
-}
-.LESSbutton_editpress_style {
- background: #931818;
- background: -webkit-gradient(linear, left top, left bottom, from(#931818), to(#6e1717));
- background: -moz-linear-gradient(top, #931818, #6e1717);
-}
-.LESSbutton_edit_padding {
- padding: 0.5em 0.8em;
-}
+
+
/***************************************************************************
Tickernoti
***************************************************************************/
Smallpopup
***************************************************************************/
/***************************************************************************
- No Contents
-***************************************************************************/
-/***************************************************************************
Slider
***************************************************************************/
/***************************************************************************
/***************************************************************************
multimediaview
***************************************************************************/
-.LESSmultimediaview_bar_active_style {
- background-color: #4a84c9;
- background-image: -webkit-gradient(linear, left top, left bottom, from(#6289d9), to(#295b98));
- background-image: -moz-linear-gradient(top, #6289d9, #295b98);
- background-image: -o-linear-gradient(top, #6289d9, #295b98);
- background-image: -ms-linear-gradient(top, #6289d9, #295b98);
-}
-.LESSmultimediaview_bar_handle_style {
- background-color: #f9f9f9;
- background-image: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#e6e6e6));
- background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: -ms-linear-gradient(top, #ffffff, #e6e6e6);
-}
+
+
/***************************************************************************
tokentextarea
***************************************************************************/
/***************************************************************************
+ Splitview
***************************************************************************/
@-webkit-keyframes ui-datetime-in {
from {
- -webkit-transform: translatey(0.6363636363636364rem) scale(0.9);
+ -webkit-transform: translateY(0.6363636363636364rem) scale(0.9);
}
to {
- -webkit-transform: translatey(0) scale(1);
+ -webkit-transform: translateY(0) scale(1);
}
}
@-webkit-keyframes ui-datetime-out {
from {
opacity: 0.8;
- -webkit-transform: translatey(0) scale(0.6);
+ -webkit-transform: translateY(0) scale(0.6);
}
to {
opacity: 0;
- -webkit-transform: translatey(-0.6363636363636364rem) scale(0.6);
+ -webkit-transform: translateY(-0.6363636363636364rem) scale(0.6);
}
}
.ui-datefield .ui-datefield-seperator {
min-width: 0.4545454545454546rem;
text-align: center;
}
-.ui-datefield .date, .ui-datefield .time, .ui-datefield .ui-datefield-tab {
+.ui-datefield .date,
+.ui-datefield .time,
+.ui-datefield .ui-datefield-tab {
display: inline-block;
}
.ui-datefield .ui-datefield-tab {
}
.ui-datetimepicker-selector ul li a.ui-link {
text-decoration: none;
- color: rgba(249, 249, 249, 0.4);
+ color: rgba(255, 255, 255, 0.7);
}
.ui-datetimepicker-selector ul li a.ui-link:hover {
- color: rgba(249, 249, 249, 0.4);
+ color: rgba(255, 255, 255, 0.7);
}
.ui-datetimepicker-selector ul li.current a.ui-link {
- color: #f9f9f9;
+ color: #ffffff;
}
.ui-datetimepicker {
left: 0 !important;
/***************************************************************************
Body
***************************************************************************/
+/* B011 : Main Background color */
+/* B012 : Main font color */
/***************************************************************************
Naviframe
***************************************************************************/
-/* #3b73b6 *//* title text */
+/* B042 : title text */
/* B052L4 : Title text button */
/* B052L5 : Title text button press */
/* B052L1P : Title text button press bg */
/***************************************************************************
Button(connected with other winset)
***************************************************************************/
-.LESSbutton_box_style {
- color: #363133;
-}
-.LESSbutton_up_style {
- background: #ebe8e3;
- background: -webkit-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -moz-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -o-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -ms-linear-gradient(top, #ebe8e3, #eae7e2);
-}
-.LESSbutton_box_style {
- background: #ebe8e3;
- background: -webkit-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -moz-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -o-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -ms-linear-gradient(top, #ebe8e3, #eae7e2);
- border: 1px solid;
- border-color: #dcdad3;
- -o-box-shadow: 0 0 1px 1px #ffffff;
- -ms-box-shadow: 0 0 1px 1px #ffffff;
- -moz-box-shadow: 0 0 1px 1px #ffffff;
- -webkit-box-shadow: 0 0 1px 1px #ffffff;
- box-shadow: 0 0 1px 1px #ffffff;
-}
-.LESSbutton_inner_box_style {
- background: #f7f5ee;
- background: -webkit-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -ms-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -o-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -moz-linear-gradient(top, #faf7f2, #f8f5f0);
- -o-box-shadow: none;
- -ms-box-shadow: none;
- -moz-box-shadow: none;
- -webkit-box-shadow: none;
- box-shadow: none;
-}
-.LESSbutton_inner_pressstyle {
- color: #f8f6ef;
-}
-.LESSbutton_text1_style {
- font-family: Helvetica, Arial, sans-serif;
- font-weight: normal;
- font-size: 1.0rem;
- font-style: normal;
- color: #000000;
-}
-.LESSbutton_hover_style {
- color: #363133;
-}
-.LESSbutton_down_style {
- background: #3b73b6;
- color: #f8f6ef;
-}
-.LESSbutton_edit_style {
- background: #c95858;
- background: -webkit-gradient(linear, left top, left bottom, from(#c95858), to(#a12828));
- background: -moz_linear-gradient(top, #c95858, #a12828);
-}
+
+
+
+
+
+
+
+
+
/***************************************************************************
contextual popup
***************************************************************************/
-/* #1A5274 */
/***************************************************************************
Scrollview
***************************************************************************/
Date Time picker
***************************************************************************/
/***************************************************************************
- DaySelector
-***************************************************************************/
-/* #00a8e7 */
-/* #f01402 */
-/* #f9f9f9 *//* #f9f9f9 */.LESSDayselectorButtonNormal {
- background: #7e9db2;
- background: -webkit-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -moz-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -ms-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -o-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: linear-gradient(top, #7e9db2 0%, #547990 100%);
-}
-.LESSDayaselectorButtonPress {
- background: #3b7796;
- background: -webkit-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -moz-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -ms-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -o-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: linear-gradient(top, #3b7796 0%, #2f5b75 100%);
-}
-/***************************************************************************
- OptionHeader
-***************************************************************************/
-/* #f9f9f9 */
-/***************************************************************************
SegmentControl
***************************************************************************/
-/* #F9F9F9*/
-/* #F9F9F9*/
-/***************************************************************************
- ControlGroup
-***************************************************************************/
-/* 00_divider_line.9.png */
+/* B052L4 : Title text button */
/***************************************************************************
Popup
***************************************************************************/
/* popup_title_bg.png */
/* maybe not use only popupwindow*/
-.LESSpopup_button_style {
- /* background: @color_popup_buttonbg;
- background: @color_popup_buttonbg_webkit;
- background: @color_popup_buttonbg_moz;
- background: @color_popup_buttonbg_ms;
- background: @color_popup_buttonbg_o;
- color: @color_popup_buttontext;*/
-}
-.LESSpopup_button_hover_style {
- background: #5e88a3;
-}
-.LESSpopup_button_press_style {
- background: #43a0d9;
- background: -webkit-gradient(linear, left top, left bottom, from(#43a0d9), to(#388bb9));
- background: -moz-linear-gradient(top, #43a0d9, #388bb9);
- background: -ms-linear-gradient(top, #43a0d9, #388bb9);
- background: -o-linear-gradient(top, #43a0d9, #388bb9);
-}
-/***************************************************************************
- Button
-***************************************************************************/
-.LESStoggleswitch_on_style {
- background: #2a7eac;
- background: -webkit-gradient(linear, left top, left bottom, from(#2174a7), to(#4ba5db));
- background: -moz-linear-gradient(top, #2174a7, #4ba5db);
- border-radius: 4px;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
-}
-.LESStoggleswitch_off_style {
- color: #cbcbcb;
- background: #97a1a7;
- background: -webkit-gradient(linear, left top, left bottom, from(#727272), to(#8d8d8d));
- background: -moz-linear-gradient(top, #727272, #8d8d8d);
- border-radius: 4px;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
-}
-.LESStoggleswitch_reed_style {
- background: #fdfdfd;
- background: -webkit-gradient(linear, left top, left bottom, from(#fdfdfd), to(#e7e7e7));
- background: -moz-linear-gradient(top, #fdfdfd, #e7e7e7);
- border-radius: 2px;
- -webkit-border-radius: 2px;
- -moz-border-radius: 2px;
-}
-.LESSbutton_editpress_style {
- background: #931818;
- background: -webkit-gradient(linear, left top, left bottom, from(#931818), to(#6e1717));
- background: -moz-linear-gradient(top, #931818, #6e1717);
-}
-.LESSbutton_edit_padding {
- padding: 0.5em 0.8em;
-}
+
+
/***************************************************************************
Tickernoti
***************************************************************************/
Smallpopup
***************************************************************************/
/***************************************************************************
- No Contents
-***************************************************************************/
-/***************************************************************************
Slider
***************************************************************************/
/***************************************************************************
/***************************************************************************
multimediaview
***************************************************************************/
-.LESSmultimediaview_bar_active_style {
- background-color: #4a84c9;
- background-image: -webkit-gradient(linear, left top, left bottom, from(#6289d9), to(#295b98));
- background-image: -moz-linear-gradient(top, #6289d9, #295b98);
- background-image: -o-linear-gradient(top, #6289d9, #295b98);
- background-image: -ms-linear-gradient(top, #6289d9, #295b98);
-}
-.LESSmultimediaview_bar_handle_style {
- background-color: #f9f9f9;
- background-image: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#e6e6e6));
- background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: -ms-linear-gradient(top, #ffffff, #e6e6e6);
-}
+
+
/***************************************************************************
tokentextarea
***************************************************************************/
/***************************************************************************
+ Splitview
***************************************************************************/
/* Resource color mapping table
}
.ui-popupwindow .popup-text {
width: 100%;
- color: black;
+ color: #000000;
font-size: 1.0909090909090908rem;
background: #f8f6ef;
}
width: 100%;
height: 100%;
}
-.ui-popupwindow .ui-btn {
- /* background: @color_popup_buttonbg;
- background: @color_popup_buttonbg_webkit;
- background: @color_popup_buttonbg_moz;
- background: @color_popup_buttonbg_ms;
- background: @color_popup_buttonbg_o;
- color: @color_popup_buttontext;*/
-}
.ui-popupwindow .ui-btn.ui-btn-hover-s {
background: #5e88a3;
}
/***************************************************************************
Body
***************************************************************************/
+/* B011 : Main Background color */
+/* B012 : Main font color */
/***************************************************************************
Naviframe
***************************************************************************/
-/* #3b73b6 *//* title text */
+/* B042 : title text */
/* B052L4 : Title text button */
/* B052L5 : Title text button press */
/* B052L1P : Title text button press bg */
/***************************************************************************
Button(connected with other winset)
***************************************************************************/
-.LESSbutton_box_style {
- color: #363133;
-}
-.LESSbutton_up_style {
- background: #ebe8e3;
- background: -webkit-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -moz-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -o-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -ms-linear-gradient(top, #ebe8e3, #eae7e2);
-}
-.LESSbutton_box_style {
- background: #ebe8e3;
- background: -webkit-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -moz-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -o-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -ms-linear-gradient(top, #ebe8e3, #eae7e2);
- border: 1px solid;
- border-color: #dcdad3;
- -o-box-shadow: 0 0 1px 1px #ffffff;
- -ms-box-shadow: 0 0 1px 1px #ffffff;
- -moz-box-shadow: 0 0 1px 1px #ffffff;
- -webkit-box-shadow: 0 0 1px 1px #ffffff;
- box-shadow: 0 0 1px 1px #ffffff;
-}
-.LESSbutton_inner_box_style {
- background: #f7f5ee;
- background: -webkit-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -ms-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -o-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -moz-linear-gradient(top, #faf7f2, #f8f5f0);
- -o-box-shadow: none;
- -ms-box-shadow: none;
- -moz-box-shadow: none;
- -webkit-box-shadow: none;
- box-shadow: none;
-}
-.LESSbutton_inner_pressstyle {
- color: #f8f6ef;
-}
-.LESSbutton_text1_style {
- font-family: Helvetica, Arial, sans-serif;
- font-weight: normal;
- font-size: 1.0rem;
- font-style: normal;
- color: #000000;
-}
-.LESSbutton_hover_style {
- color: #363133;
-}
-.LESSbutton_down_style {
- background: #3b73b6;
- color: #f8f6ef;
-}
-.LESSbutton_edit_style {
- background: #c95858;
- background: -webkit-gradient(linear, left top, left bottom, from(#c95858), to(#a12828));
- background: -moz_linear-gradient(top, #c95858, #a12828);
-}
+
+
+
+
+
+
+
+
+
/***************************************************************************
contextual popup
***************************************************************************/
-/* #1A5274 */
/***************************************************************************
Scrollview
***************************************************************************/
Date Time picker
***************************************************************************/
/***************************************************************************
- DaySelector
-***************************************************************************/
-/* #00a8e7 */
-/* #f01402 */
-/* #f9f9f9 *//* #f9f9f9 */.LESSDayselectorButtonNormal {
- background: #7e9db2;
- background: -webkit-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -moz-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -ms-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -o-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: linear-gradient(top, #7e9db2 0%, #547990 100%);
-}
-.LESSDayaselectorButtonPress {
- background: #3b7796;
- background: -webkit-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -moz-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -ms-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -o-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: linear-gradient(top, #3b7796 0%, #2f5b75 100%);
-}
-/***************************************************************************
- OptionHeader
-***************************************************************************/
-/* #f9f9f9 */
-/***************************************************************************
SegmentControl
***************************************************************************/
-/* #F9F9F9*/
-/* #F9F9F9*/
-/***************************************************************************
- ControlGroup
-***************************************************************************/
-/* 00_divider_line.9.png */
+/* B052L4 : Title text button */
/***************************************************************************
Popup
***************************************************************************/
/* popup_title_bg.png */
/* maybe not use only popupwindow*/
-.LESSpopup_button_style {
- /* background: @color_popup_buttonbg;
- background: @color_popup_buttonbg_webkit;
- background: @color_popup_buttonbg_moz;
- background: @color_popup_buttonbg_ms;
- background: @color_popup_buttonbg_o;
- color: @color_popup_buttontext;*/
-}
-.LESSpopup_button_hover_style {
- background: #5e88a3;
-}
-.LESSpopup_button_press_style {
- background: #43a0d9;
- background: -webkit-gradient(linear, left top, left bottom, from(#43a0d9), to(#388bb9));
- background: -moz-linear-gradient(top, #43a0d9, #388bb9);
- background: -ms-linear-gradient(top, #43a0d9, #388bb9);
- background: -o-linear-gradient(top, #43a0d9, #388bb9);
-}
-/***************************************************************************
- Button
-***************************************************************************/
-.LESStoggleswitch_on_style {
- background: #2a7eac;
- background: -webkit-gradient(linear, left top, left bottom, from(#2174a7), to(#4ba5db));
- background: -moz-linear-gradient(top, #2174a7, #4ba5db);
- border-radius: 4px;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
-}
-.LESStoggleswitch_off_style {
- color: #cbcbcb;
- background: #97a1a7;
- background: -webkit-gradient(linear, left top, left bottom, from(#727272), to(#8d8d8d));
- background: -moz-linear-gradient(top, #727272, #8d8d8d);
- border-radius: 4px;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
-}
-.LESStoggleswitch_reed_style {
- background: #fdfdfd;
- background: -webkit-gradient(linear, left top, left bottom, from(#fdfdfd), to(#e7e7e7));
- background: -moz-linear-gradient(top, #fdfdfd, #e7e7e7);
- border-radius: 2px;
- -webkit-border-radius: 2px;
- -moz-border-radius: 2px;
-}
-.LESSbutton_editpress_style {
- background: #931818;
- background: -webkit-gradient(linear, left top, left bottom, from(#931818), to(#6e1717));
- background: -moz-linear-gradient(top, #931818, #6e1717);
-}
-.LESSbutton_edit_padding {
- padding: 0.5em 0.8em;
-}
+
+
/***************************************************************************
Tickernoti
***************************************************************************/
Smallpopup
***************************************************************************/
/***************************************************************************
- No Contents
-***************************************************************************/
-/***************************************************************************
Slider
***************************************************************************/
/***************************************************************************
/***************************************************************************
multimediaview
***************************************************************************/
-.LESSmultimediaview_bar_active_style {
- background-color: #4a84c9;
- background-image: -webkit-gradient(linear, left top, left bottom, from(#6289d9), to(#295b98));
- background-image: -moz-linear-gradient(top, #6289d9, #295b98);
- background-image: -o-linear-gradient(top, #6289d9, #295b98);
- background-image: -ms-linear-gradient(top, #6289d9, #295b98);
-}
-.LESSmultimediaview_bar_handle_style {
- background-color: #f9f9f9;
- background-image: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#e6e6e6));
- background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: -ms-linear-gradient(top, #ffffff, #e6e6e6);
-}
+
+
/***************************************************************************
tokentextarea
***************************************************************************/
/***************************************************************************
+ Splitview
***************************************************************************/
.ui-ctxpopup {
display: table;
-webkit-border-radius: 0.3em;
border-radius: 0.3em;
}
-.ui-ctxpopup .ui-listview li.ui-btn-up-s, .ui-ctxpopup .ui-listview li.ui-btn-hover-s {
+.ui-ctxpopup .ui-listview li.ui-btn-up-s,
+.ui-ctxpopup .ui-listview li.ui-btn-hover-s {
background: transparent;
}
-.ui-ctxpopup .ui-listview li.ui-btn-down-s {
- background: rgba(26, 82, 116, 0.3);
-}
.ui-ctxpopup .ui-listview li:last-child {
border-bottom-left-radius: 0.3em;
border-bottom-right-radius: 0.3em;
margin-left: 0;
margin-right: 0;
}
-.ui-ctxpopup .ui-listview > .ui-li:first-child, .ui-ctxpopup .ui-listview > .ui-li:last-child {
+.ui-ctxpopup .ui-listview > .ui-li:first-child,
+.ui-ctxpopup .ui-listview > .ui-li:last-child {
border-top-width: 0px;
}
.ui-ctxpopup .ui-listview > .ui-li .ui-btn-inner {
padding-left: 0.4545454545454546rem;
padding-right: 0.4545454545454546rem;
}
-.ui-ctxpopup .ui-listview li.ui-btn-up-s > .ui-li > .ui-btn-text > a.ui-link-inherit, .ui-ctxpopup .ui-listview li.ui-btn-hover-s > .ui-li > .ui-btn-text > a.ui-link-inherit, .ui-ctxpopup .ui-listview li.ui-btn-down-s > .ui-li > .ui-btn-text > a.ui-link-inherit {
+.ui-ctxpopup .ui-listview li.ui-btn-up-s > .ui-li > .ui-btn-text > a.ui-link-inherit,
+.ui-ctxpopup .ui-listview li.ui-btn-hover-s > .ui-li > .ui-btn-text > a.ui-link-inherit,
+.ui-ctxpopup .ui-listview li.ui-btn-down-s > .ui-li > .ui-btn-text > a.ui-link-inherit {
color: #ffffff;
}
.ui-ctxpopup .ui-listview > .ui-li:last-child {
}
.ui-ctxpopup .horizontal {
color: #ffffff;
- max-width: 29.454545454545457rem;
}
.ui-ctxpopup .horizontal .icon .ui-btn {
padding: 0;
margin: 0;
}
.ui-ctxpopup .horizontal li {
- line-height: 2.909090909090909rem;
- min-height: 2.909090909090909rem;
- min-width: 4.363636363636363rem;
+ line-height: 1.4545454545454546rem;
+ min-height: 1.4545454545454546rem;
+ min-width: 2.1818181818181817rem;
float: left;
display: inline-block;
- border-left: 1px solid #5b5b5b;
- border-right: 1px solid #2d2d2d;
+ border-right: 1px solid #5b5b5b;
text-align: center;
}
.ui-ctxpopup .horizontal li:first-of-type {
border-top-left-radius: 0.3em;
border-bottom-left-radius: 0.3em;
+ border-top-right-radius: 0px ! important;
border-left: none;
}
.ui-ctxpopup .horizontal li:last-of-type {
border-right: none;
margin-right: 0;
}
-.ui-ctxpopup .horizontal li:active, .ui-ctxpopup .horizontal td:active {
+.ui-ctxpopup .horizontal .ui-li:first-child,
+.ui-ctxpopup .horizontal .ui-li:last-child {
+ border-left-width: 0px;
+}
+.ui-ctxpopup .horizontal li:active,
+.ui-ctxpopup .horizontal td:active {
background: #3b73b6;
}
.ui-ctxpopup .button table .ui-btn {
/***************************************************************************
Body
***************************************************************************/
+/* B011 : Main Background color */
+/* B012 : Main font color */
/***************************************************************************
Naviframe
***************************************************************************/
-/* #3b73b6 *//* title text */
+/* B042 : title text */
/* B052L4 : Title text button */
/* B052L5 : Title text button press */
/* B052L1P : Title text button press bg */
/***************************************************************************
Button(connected with other winset)
***************************************************************************/
-.LESSbutton_box_style {
- color: #363133;
-}
-.LESSbutton_up_style {
- background: #ebe8e3;
- background: -webkit-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -moz-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -o-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -ms-linear-gradient(top, #ebe8e3, #eae7e2);
-}
-.LESSbutton_box_style {
- background: #ebe8e3;
- background: -webkit-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -moz-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -o-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -ms-linear-gradient(top, #ebe8e3, #eae7e2);
- border: 1px solid;
- border-color: #dcdad3;
- -o-box-shadow: 0 0 1px 1px #ffffff;
- -ms-box-shadow: 0 0 1px 1px #ffffff;
- -moz-box-shadow: 0 0 1px 1px #ffffff;
- -webkit-box-shadow: 0 0 1px 1px #ffffff;
- box-shadow: 0 0 1px 1px #ffffff;
-}
-.LESSbutton_inner_box_style {
- background: #f7f5ee;
- background: -webkit-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -ms-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -o-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -moz-linear-gradient(top, #faf7f2, #f8f5f0);
- -o-box-shadow: none;
- -ms-box-shadow: none;
- -moz-box-shadow: none;
- -webkit-box-shadow: none;
- box-shadow: none;
-}
-.LESSbutton_inner_pressstyle {
- color: #f8f6ef;
-}
-.LESSbutton_text1_style {
- font-family: Helvetica, Arial, sans-serif;
- font-weight: normal;
- font-size: 1.0rem;
- font-style: normal;
- color: #000000;
-}
-.LESSbutton_hover_style {
- color: #363133;
-}
-.LESSbutton_down_style {
- background: #3b73b6;
- color: #f8f6ef;
-}
-.LESSbutton_edit_style {
- background: #c95858;
- background: -webkit-gradient(linear, left top, left bottom, from(#c95858), to(#a12828));
- background: -moz_linear-gradient(top, #c95858, #a12828);
-}
+
+
+
+
+
+
+
+
+
/***************************************************************************
contextual popup
***************************************************************************/
-/* #1A5274 */
/***************************************************************************
Scrollview
***************************************************************************/
Date Time picker
***************************************************************************/
/***************************************************************************
- DaySelector
-***************************************************************************/
-/* #00a8e7 */
-/* #f01402 */
-/* #f9f9f9 *//* #f9f9f9 */.LESSDayselectorButtonNormal {
- background: #7e9db2;
- background: -webkit-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -moz-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -ms-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -o-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: linear-gradient(top, #7e9db2 0%, #547990 100%);
-}
-.LESSDayaselectorButtonPress {
- background: #3b7796;
- background: -webkit-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -moz-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -ms-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -o-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: linear-gradient(top, #3b7796 0%, #2f5b75 100%);
-}
-/***************************************************************************
- OptionHeader
-***************************************************************************/
-/* #f9f9f9 */
-/***************************************************************************
SegmentControl
***************************************************************************/
-/* #F9F9F9*/
-/* #F9F9F9*/
-/***************************************************************************
- ControlGroup
-***************************************************************************/
-/* 00_divider_line.9.png */
+/* B052L4 : Title text button */
/***************************************************************************
Popup
***************************************************************************/
/* popup_title_bg.png */
/* maybe not use only popupwindow*/
-.LESSpopup_button_style {
- /* background: @color_popup_buttonbg;
- background: @color_popup_buttonbg_webkit;
- background: @color_popup_buttonbg_moz;
- background: @color_popup_buttonbg_ms;
- background: @color_popup_buttonbg_o;
- color: @color_popup_buttontext;*/
-}
-.LESSpopup_button_hover_style {
- background: #5e88a3;
-}
-.LESSpopup_button_press_style {
- background: #43a0d9;
- background: -webkit-gradient(linear, left top, left bottom, from(#43a0d9), to(#388bb9));
- background: -moz-linear-gradient(top, #43a0d9, #388bb9);
- background: -ms-linear-gradient(top, #43a0d9, #388bb9);
- background: -o-linear-gradient(top, #43a0d9, #388bb9);
-}
-/***************************************************************************
- Button
-***************************************************************************/
-.LESStoggleswitch_on_style {
- background: #2a7eac;
- background: -webkit-gradient(linear, left top, left bottom, from(#2174a7), to(#4ba5db));
- background: -moz-linear-gradient(top, #2174a7, #4ba5db);
- border-radius: 4px;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
-}
-.LESStoggleswitch_off_style {
- color: #cbcbcb;
- background: #97a1a7;
- background: -webkit-gradient(linear, left top, left bottom, from(#727272), to(#8d8d8d));
- background: -moz-linear-gradient(top, #727272, #8d8d8d);
- border-radius: 4px;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
-}
-.LESStoggleswitch_reed_style {
- background: #fdfdfd;
- background: -webkit-gradient(linear, left top, left bottom, from(#fdfdfd), to(#e7e7e7));
- background: -moz-linear-gradient(top, #fdfdfd, #e7e7e7);
- border-radius: 2px;
- -webkit-border-radius: 2px;
- -moz-border-radius: 2px;
-}
-.LESSbutton_editpress_style {
- background: #931818;
- background: -webkit-gradient(linear, left top, left bottom, from(#931818), to(#6e1717));
- background: -moz-linear-gradient(top, #931818, #6e1717);
-}
-.LESSbutton_edit_padding {
- padding: 0.5em 0.8em;
-}
+
+
/***************************************************************************
Tickernoti
***************************************************************************/
Smallpopup
***************************************************************************/
/***************************************************************************
- No Contents
-***************************************************************************/
-/***************************************************************************
Slider
***************************************************************************/
/***************************************************************************
/***************************************************************************
multimediaview
***************************************************************************/
-.LESSmultimediaview_bar_active_style {
- background-color: #4a84c9;
- background-image: -webkit-gradient(linear, left top, left bottom, from(#6289d9), to(#295b98));
- background-image: -moz-linear-gradient(top, #6289d9, #295b98);
- background-image: -o-linear-gradient(top, #6289d9, #295b98);
- background-image: -ms-linear-gradient(top, #6289d9, #295b98);
-}
-.LESSmultimediaview_bar_handle_style {
- background-color: #f9f9f9;
- background-image: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#e6e6e6));
- background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: -ms-linear-gradient(top, #ffffff, #e6e6e6);
-}
+
+
/***************************************************************************
tokentextarea
***************************************************************************/
/***************************************************************************
+ Splitview
***************************************************************************/
@-webkit-keyframes ui-scale-animation {
from {
- -webkit-transform: scalex(0);
+ -webkit-transform: scaleX(0);
}
to {
- -webkit-transform: scalex(1);
+ -webkit-transform: scaleX(1);
}
}
.ui-progressbar-value {
}
.ui-progressbar {
position: relative;
+ margin-top: 0.8181818181818182rem;
+ margin-bottom: 0.8181818181818182rem;
margin-left: 0.9545454545454546rem;
margin-right: 0.9545454545454546rem;
height: 0.8181818181818182rem;
background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #f6f3ef), color-stop(1, #cac8c4));
- -o-box-shadow: 1px 1px 0px white;
- -ms-box-shadow: 1px 1px 0px white;
- -moz-box-shadow: 1px 1px 0px white;
- -webkit-box-shadow: 1px 1px 0px white;
- box-shadow: 1px 1px 0px white;
+ -o-box-shadow: 1px 1px 0px #ffffff;
+ -ms-box-shadow: 1px 1px 0px #ffffff;
+ -moz-box-shadow: 1px 1px 0px #ffffff;
+ -webkit-box-shadow: 1px 1px 0px #ffffff;
+ box-shadow: 1px 1px 0px #ffffff;
-o-border-radius: 0.4545454545454546rem;
-ms-border-radius: 0.4545454545454546rem;
-moz-border-radius: 0.4545454545454546rem;
/***************************************************************************
Body
***************************************************************************/
+/* B011 : Main Background color */
+/* B012 : Main font color */
/***************************************************************************
Naviframe
***************************************************************************/
-/* #3b73b6 *//* title text */
+/* B042 : title text */
/* B052L4 : Title text button */
/* B052L5 : Title text button press */
/* B052L1P : Title text button press bg */
/***************************************************************************
Button(connected with other winset)
***************************************************************************/
-.LESSbutton_box_style {
- color: #363133;
-}
-.LESSbutton_up_style {
- background: #ebe8e3;
- background: -webkit-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -moz-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -o-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -ms-linear-gradient(top, #ebe8e3, #eae7e2);
-}
-.LESSbutton_box_style {
- background: #ebe8e3;
- background: -webkit-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -moz-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -o-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -ms-linear-gradient(top, #ebe8e3, #eae7e2);
- border: 1px solid;
- border-color: #dcdad3;
- -o-box-shadow: 0 0 1px 1px #ffffff;
- -ms-box-shadow: 0 0 1px 1px #ffffff;
- -moz-box-shadow: 0 0 1px 1px #ffffff;
- -webkit-box-shadow: 0 0 1px 1px #ffffff;
- box-shadow: 0 0 1px 1px #ffffff;
-}
-.LESSbutton_inner_box_style {
- background: #f7f5ee;
- background: -webkit-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -ms-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -o-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -moz-linear-gradient(top, #faf7f2, #f8f5f0);
- -o-box-shadow: none;
- -ms-box-shadow: none;
- -moz-box-shadow: none;
- -webkit-box-shadow: none;
- box-shadow: none;
-}
-.LESSbutton_inner_pressstyle {
- color: #f8f6ef;
-}
-.LESSbutton_text1_style {
- font-family: Helvetica, Arial, sans-serif;
- font-weight: normal;
- font-size: 1.0rem;
- font-style: normal;
- color: #000000;
-}
-.LESSbutton_hover_style {
- color: #363133;
-}
-.LESSbutton_down_style {
- background: #3b73b6;
- color: #f8f6ef;
-}
-.LESSbutton_edit_style {
- background: #c95858;
- background: -webkit-gradient(linear, left top, left bottom, from(#c95858), to(#a12828));
- background: -moz_linear-gradient(top, #c95858, #a12828);
-}
+
+
+
+
+
+
+
+
+
/***************************************************************************
contextual popup
***************************************************************************/
-/* #1A5274 */
/***************************************************************************
Scrollview
***************************************************************************/
Date Time picker
***************************************************************************/
/***************************************************************************
- DaySelector
-***************************************************************************/
-/* #00a8e7 */
-/* #f01402 */
-/* #f9f9f9 *//* #f9f9f9 */.LESSDayselectorButtonNormal {
- background: #7e9db2;
- background: -webkit-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -moz-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -ms-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -o-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: linear-gradient(top, #7e9db2 0%, #547990 100%);
-}
-.LESSDayaselectorButtonPress {
- background: #3b7796;
- background: -webkit-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -moz-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -ms-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -o-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: linear-gradient(top, #3b7796 0%, #2f5b75 100%);
-}
-/***************************************************************************
- OptionHeader
-***************************************************************************/
-/* #f9f9f9 */
-/***************************************************************************
SegmentControl
***************************************************************************/
-/* #F9F9F9*/
-/* #F9F9F9*/
-/***************************************************************************
- ControlGroup
-***************************************************************************/
-/* 00_divider_line.9.png */
+/* B052L4 : Title text button */
/***************************************************************************
Popup
***************************************************************************/
/* popup_title_bg.png */
/* maybe not use only popupwindow*/
-.LESSpopup_button_style {
- /* background: @color_popup_buttonbg;
- background: @color_popup_buttonbg_webkit;
- background: @color_popup_buttonbg_moz;
- background: @color_popup_buttonbg_ms;
- background: @color_popup_buttonbg_o;
- color: @color_popup_buttontext;*/
-}
-.LESSpopup_button_hover_style {
- background: #5e88a3;
-}
-.LESSpopup_button_press_style {
- background: #43a0d9;
- background: -webkit-gradient(linear, left top, left bottom, from(#43a0d9), to(#388bb9));
- background: -moz-linear-gradient(top, #43a0d9, #388bb9);
- background: -ms-linear-gradient(top, #43a0d9, #388bb9);
- background: -o-linear-gradient(top, #43a0d9, #388bb9);
-}
-/***************************************************************************
- Button
-***************************************************************************/
-.LESStoggleswitch_on_style {
- background: #2a7eac;
- background: -webkit-gradient(linear, left top, left bottom, from(#2174a7), to(#4ba5db));
- background: -moz-linear-gradient(top, #2174a7, #4ba5db);
- border-radius: 4px;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
-}
-.LESStoggleswitch_off_style {
- color: #cbcbcb;
- background: #97a1a7;
- background: -webkit-gradient(linear, left top, left bottom, from(#727272), to(#8d8d8d));
- background: -moz-linear-gradient(top, #727272, #8d8d8d);
- border-radius: 4px;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
-}
-.LESStoggleswitch_reed_style {
- background: #fdfdfd;
- background: -webkit-gradient(linear, left top, left bottom, from(#fdfdfd), to(#e7e7e7));
- background: -moz-linear-gradient(top, #fdfdfd, #e7e7e7);
- border-radius: 2px;
- -webkit-border-radius: 2px;
- -moz-border-radius: 2px;
-}
-.LESSbutton_editpress_style {
- background: #931818;
- background: -webkit-gradient(linear, left top, left bottom, from(#931818), to(#6e1717));
- background: -moz-linear-gradient(top, #931818, #6e1717);
-}
-.LESSbutton_edit_padding {
- padding: 0.5em 0.8em;
-}
+
+
/***************************************************************************
Tickernoti
***************************************************************************/
Smallpopup
***************************************************************************/
/***************************************************************************
- No Contents
-***************************************************************************/
-/***************************************************************************
Slider
***************************************************************************/
/***************************************************************************
/***************************************************************************
multimediaview
***************************************************************************/
-.LESSmultimediaview_bar_active_style {
- background-color: #4a84c9;
- background-image: -webkit-gradient(linear, left top, left bottom, from(#6289d9), to(#295b98));
- background-image: -moz-linear-gradient(top, #6289d9, #295b98);
- background-image: -o-linear-gradient(top, #6289d9, #295b98);
- background-image: -ms-linear-gradient(top, #6289d9, #295b98);
-}
-.LESSmultimediaview_bar_handle_style {
- background-color: #f9f9f9;
- background-image: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#e6e6e6));
- background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: -ms-linear-gradient(top, #ffffff, #e6e6e6);
-}
+
+
/***************************************************************************
tokentextarea
***************************************************************************/
/***************************************************************************
+ Splitview
***************************************************************************/
/* Progress - circle style */
@-webkit-keyframes ui-rotate-animation {
/* Progress - pending style */
@-webkit-keyframes ui-move-animation {
from {
- -webkit-transform: translatey(-0.6363636363636364rem);
+ -webkit-transform: translateY(-0.6363636363636364rem);
}
to {
- -webkit-transform: translatey(0);
+ -webkit-transform: translateY(0);
}
}
.ui-progress-pending {
/***************************************************************************
Body
***************************************************************************/
+/* B011 : Main Background color */
+/* B012 : Main font color */
/***************************************************************************
Naviframe
***************************************************************************/
-/* #3b73b6 *//* title text */
+/* B042 : title text */
/* B052L4 : Title text button */
/* B052L5 : Title text button press */
/* B052L1P : Title text button press bg */
/***************************************************************************
Button(connected with other winset)
***************************************************************************/
-.LESSbutton_box_style {
- color: #363133;
-}
-.LESSbutton_up_style {
- background: #ebe8e3;
- background: -webkit-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -moz-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -o-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -ms-linear-gradient(top, #ebe8e3, #eae7e2);
-}
-.LESSbutton_box_style {
- background: #ebe8e3;
- background: -webkit-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -moz-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -o-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -ms-linear-gradient(top, #ebe8e3, #eae7e2);
- border: 1px solid;
- border-color: #dcdad3;
- -o-box-shadow: 0 0 1px 1px #ffffff;
- -ms-box-shadow: 0 0 1px 1px #ffffff;
- -moz-box-shadow: 0 0 1px 1px #ffffff;
- -webkit-box-shadow: 0 0 1px 1px #ffffff;
- box-shadow: 0 0 1px 1px #ffffff;
-}
-.LESSbutton_inner_box_style {
- background: #f7f5ee;
- background: -webkit-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -ms-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -o-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -moz-linear-gradient(top, #faf7f2, #f8f5f0);
- -o-box-shadow: none;
- -ms-box-shadow: none;
- -moz-box-shadow: none;
- -webkit-box-shadow: none;
- box-shadow: none;
-}
-.LESSbutton_inner_pressstyle {
- color: #f8f6ef;
-}
-.LESSbutton_text1_style {
- font-family: Helvetica, Arial, sans-serif;
- font-weight: normal;
- font-size: 1.0rem;
- font-style: normal;
- color: #000000;
-}
-.LESSbutton_hover_style {
- color: #363133;
-}
-.LESSbutton_down_style {
- background: #3b73b6;
- color: #f8f6ef;
-}
-.LESSbutton_edit_style {
- background: #c95858;
- background: -webkit-gradient(linear, left top, left bottom, from(#c95858), to(#a12828));
- background: -moz_linear-gradient(top, #c95858, #a12828);
-}
+
+
+
+
+
+
+
+
+
/***************************************************************************
contextual popup
***************************************************************************/
-/* #1A5274 */
/***************************************************************************
Scrollview
***************************************************************************/
Date Time picker
***************************************************************************/
/***************************************************************************
- DaySelector
-***************************************************************************/
-/* #00a8e7 */
-/* #f01402 */
-/* #f9f9f9 *//* #f9f9f9 */.LESSDayselectorButtonNormal {
- background: #7e9db2;
- background: -webkit-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -moz-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -ms-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -o-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: linear-gradient(top, #7e9db2 0%, #547990 100%);
-}
-.LESSDayaselectorButtonPress {
- background: #3b7796;
- background: -webkit-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -moz-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -ms-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -o-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: linear-gradient(top, #3b7796 0%, #2f5b75 100%);
-}
-/***************************************************************************
- OptionHeader
-***************************************************************************/
-/* #f9f9f9 */
-/***************************************************************************
SegmentControl
***************************************************************************/
-/* #F9F9F9*/
-/* #F9F9F9*/
-/***************************************************************************
- ControlGroup
-***************************************************************************/
-/* 00_divider_line.9.png */
+/* B052L4 : Title text button */
/***************************************************************************
Popup
***************************************************************************/
/* popup_title_bg.png */
/* maybe not use only popupwindow*/
-.LESSpopup_button_style {
- /* background: @color_popup_buttonbg;
- background: @color_popup_buttonbg_webkit;
- background: @color_popup_buttonbg_moz;
- background: @color_popup_buttonbg_ms;
- background: @color_popup_buttonbg_o;
- color: @color_popup_buttontext;*/
-}
-.LESSpopup_button_hover_style {
- background: #5e88a3;
-}
-.LESSpopup_button_press_style {
- background: #43a0d9;
- background: -webkit-gradient(linear, left top, left bottom, from(#43a0d9), to(#388bb9));
- background: -moz-linear-gradient(top, #43a0d9, #388bb9);
- background: -ms-linear-gradient(top, #43a0d9, #388bb9);
- background: -o-linear-gradient(top, #43a0d9, #388bb9);
-}
-/***************************************************************************
- Button
-***************************************************************************/
-.LESStoggleswitch_on_style {
- background: #2a7eac;
- background: -webkit-gradient(linear, left top, left bottom, from(#2174a7), to(#4ba5db));
- background: -moz-linear-gradient(top, #2174a7, #4ba5db);
- border-radius: 4px;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
-}
-.LESStoggleswitch_off_style {
- color: #cbcbcb;
- background: #97a1a7;
- background: -webkit-gradient(linear, left top, left bottom, from(#727272), to(#8d8d8d));
- background: -moz-linear-gradient(top, #727272, #8d8d8d);
- border-radius: 4px;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
-}
-.LESStoggleswitch_reed_style {
- background: #fdfdfd;
- background: -webkit-gradient(linear, left top, left bottom, from(#fdfdfd), to(#e7e7e7));
- background: -moz-linear-gradient(top, #fdfdfd, #e7e7e7);
- border-radius: 2px;
- -webkit-border-radius: 2px;
- -moz-border-radius: 2px;
-}
-.LESSbutton_editpress_style {
- background: #931818;
- background: -webkit-gradient(linear, left top, left bottom, from(#931818), to(#6e1717));
- background: -moz-linear-gradient(top, #931818, #6e1717);
-}
-.LESSbutton_edit_padding {
- padding: 0.5em 0.8em;
-}
+
+
/***************************************************************************
Tickernoti
***************************************************************************/
Smallpopup
***************************************************************************/
/***************************************************************************
- No Contents
-***************************************************************************/
-/***************************************************************************
Slider
***************************************************************************/
/***************************************************************************
/***************************************************************************
multimediaview
***************************************************************************/
-.LESSmultimediaview_bar_active_style {
- background-color: #4a84c9;
- background-image: -webkit-gradient(linear, left top, left bottom, from(#6289d9), to(#295b98));
- background-image: -moz-linear-gradient(top, #6289d9, #295b98);
- background-image: -o-linear-gradient(top, #6289d9, #295b98);
- background-image: -ms-linear-gradient(top, #6289d9, #295b98);
-}
-.LESSmultimediaview_bar_handle_style {
- background-color: #f9f9f9;
- background-image: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#e6e6e6));
- background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: -ms-linear-gradient(top, #ffffff, #e6e6e6);
-}
+
+
/***************************************************************************
tokentextarea
***************************************************************************/
/***************************************************************************
+ Splitview
***************************************************************************/
label.ui-slider {
display: block;
margin-top: 0.8181818181818182rem;
margin-bottom: 0.8181818181818182rem;
background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #f6f3ef), color-stop(1, #cac8c4));
- -o-box-shadow: 1px 1px 0px white;
- -ms-box-shadow: 1px 1px 0px white;
- -moz-box-shadow: 1px 1px 0px white;
- -webkit-box-shadow: 1px 1px 0px white;
- box-shadow: 1px 1px 0px white;
+ -o-box-shadow: 1px 1px 0px #ffffff;
+ -ms-box-shadow: 1px 1px 0px #ffffff;
+ -moz-box-shadow: 1px 1px 0px #ffffff;
+ -webkit-box-shadow: 1px 1px 0px #ffffff;
+ box-shadow: 1px 1px 0px #ffffff;
-o-border-radius: 0.4545454545454546rem;
-ms-border-radius: 0.4545454545454546rem;
-moz-border-radius: 0.4545454545454546rem;
margin-top: 0;
margin-bottom: 0;
}
-.ui-slider-left-volume, .ui-slider-left-bright {
+.ui-slider-left-volume,
+.ui-slider-left-bright {
position: absolute;
vertical-align: middle;
top: -0.5rem;
-webkit-background-size: 1.6818181818181819rem 1.6818181818181819rem;
background-size: 1.6818181818181819rem 1.6818181818181819rem;
}
-.ui-slider-right-volume, .ui-slider-right-bright {
+.ui-slider-right-volume,
+.ui-slider-right-bright {
position: absolute;
top: -0.5rem;
right: -2.272727272727273rem;
}
.ui-slider-popup {
position: absolute !important;
- z-index: 100;
+ z-index: 1200;
width: 2.0454545454545454rem;
height: 2.4545454545454546rem;
- top: -2.7272727272727275rem;
padding-top: 0.1rem;
color: #f9f9f9;
text-align: center;
/***************************************************************************
Body
***************************************************************************/
+/* B011 : Main Background color */
+/* B012 : Main font color */
/***************************************************************************
Naviframe
***************************************************************************/
-/* #3b73b6 *//* title text */
+/* B042 : title text */
/* B052L4 : Title text button */
/* B052L5 : Title text button press */
/* B052L1P : Title text button press bg */
/***************************************************************************
Button(connected with other winset)
***************************************************************************/
-.LESSbutton_box_style {
- color: #363133;
-}
-.LESSbutton_up_style {
- background: #ebe8e3;
- background: -webkit-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -moz-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -o-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -ms-linear-gradient(top, #ebe8e3, #eae7e2);
-}
-.LESSbutton_box_style {
- background: #ebe8e3;
- background: -webkit-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -moz-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -o-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -ms-linear-gradient(top, #ebe8e3, #eae7e2);
- border: 1px solid;
- border-color: #dcdad3;
- -o-box-shadow: 0 0 1px 1px #ffffff;
- -ms-box-shadow: 0 0 1px 1px #ffffff;
- -moz-box-shadow: 0 0 1px 1px #ffffff;
- -webkit-box-shadow: 0 0 1px 1px #ffffff;
- box-shadow: 0 0 1px 1px #ffffff;
-}
-.LESSbutton_inner_box_style {
- background: #f7f5ee;
- background: -webkit-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -ms-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -o-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -moz-linear-gradient(top, #faf7f2, #f8f5f0);
- -o-box-shadow: none;
- -ms-box-shadow: none;
- -moz-box-shadow: none;
- -webkit-box-shadow: none;
- box-shadow: none;
-}
-.LESSbutton_inner_pressstyle {
- color: #f8f6ef;
-}
-.LESSbutton_text1_style {
- font-family: Helvetica, Arial, sans-serif;
- font-weight: normal;
- font-size: 1.0rem;
- font-style: normal;
- color: #000000;
-}
-.LESSbutton_hover_style {
- color: #363133;
-}
-.LESSbutton_down_style {
- background: #3b73b6;
- color: #f8f6ef;
-}
-.LESSbutton_edit_style {
- background: #c95858;
- background: -webkit-gradient(linear, left top, left bottom, from(#c95858), to(#a12828));
- background: -moz_linear-gradient(top, #c95858, #a12828);
-}
+
+
+
+
+
+
+
+
+
/***************************************************************************
contextual popup
***************************************************************************/
-/* #1A5274 */
/***************************************************************************
Scrollview
***************************************************************************/
Date Time picker
***************************************************************************/
/***************************************************************************
- DaySelector
-***************************************************************************/
-/* #00a8e7 */
-/* #f01402 */
-/* #f9f9f9 *//* #f9f9f9 */.LESSDayselectorButtonNormal {
- background: #7e9db2;
- background: -webkit-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -moz-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -ms-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -o-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: linear-gradient(top, #7e9db2 0%, #547990 100%);
-}
-.LESSDayaselectorButtonPress {
- background: #3b7796;
- background: -webkit-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -moz-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -ms-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -o-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: linear-gradient(top, #3b7796 0%, #2f5b75 100%);
-}
-/***************************************************************************
- OptionHeader
-***************************************************************************/
-/* #f9f9f9 */
-/***************************************************************************
SegmentControl
***************************************************************************/
-/* #F9F9F9*/
-/* #F9F9F9*/
-/***************************************************************************
- ControlGroup
-***************************************************************************/
-/* 00_divider_line.9.png */
+/* B052L4 : Title text button */
/***************************************************************************
Popup
***************************************************************************/
/* popup_title_bg.png */
/* maybe not use only popupwindow*/
-.LESSpopup_button_style {
- /* background: @color_popup_buttonbg;
- background: @color_popup_buttonbg_webkit;
- background: @color_popup_buttonbg_moz;
- background: @color_popup_buttonbg_ms;
- background: @color_popup_buttonbg_o;
- color: @color_popup_buttontext;*/
-}
-.LESSpopup_button_hover_style {
- background: #5e88a3;
-}
-.LESSpopup_button_press_style {
- background: #43a0d9;
- background: -webkit-gradient(linear, left top, left bottom, from(#43a0d9), to(#388bb9));
- background: -moz-linear-gradient(top, #43a0d9, #388bb9);
- background: -ms-linear-gradient(top, #43a0d9, #388bb9);
- background: -o-linear-gradient(top, #43a0d9, #388bb9);
-}
-/***************************************************************************
- Button
-***************************************************************************/
-.LESStoggleswitch_on_style {
- background: #2a7eac;
- background: -webkit-gradient(linear, left top, left bottom, from(#2174a7), to(#4ba5db));
- background: -moz-linear-gradient(top, #2174a7, #4ba5db);
- border-radius: 4px;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
-}
-.LESStoggleswitch_off_style {
- color: #cbcbcb;
- background: #97a1a7;
- background: -webkit-gradient(linear, left top, left bottom, from(#727272), to(#8d8d8d));
- background: -moz-linear-gradient(top, #727272, #8d8d8d);
- border-radius: 4px;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
-}
-.LESStoggleswitch_reed_style {
- background: #fdfdfd;
- background: -webkit-gradient(linear, left top, left bottom, from(#fdfdfd), to(#e7e7e7));
- background: -moz-linear-gradient(top, #fdfdfd, #e7e7e7);
- border-radius: 2px;
- -webkit-border-radius: 2px;
- -moz-border-radius: 2px;
-}
-.LESSbutton_editpress_style {
- background: #931818;
- background: -webkit-gradient(linear, left top, left bottom, from(#931818), to(#6e1717));
- background: -moz-linear-gradient(top, #931818, #6e1717);
-}
-.LESSbutton_edit_padding {
- padding: 0.5em 0.8em;
-}
+
+
/***************************************************************************
Tickernoti
***************************************************************************/
Smallpopup
***************************************************************************/
/***************************************************************************
- No Contents
-***************************************************************************/
-/***************************************************************************
Slider
***************************************************************************/
/***************************************************************************
/***************************************************************************
multimediaview
***************************************************************************/
-.LESSmultimediaview_bar_active_style {
- background-color: #4a84c9;
- background-image: -webkit-gradient(linear, left top, left bottom, from(#6289d9), to(#295b98));
- background-image: -moz-linear-gradient(top, #6289d9, #295b98);
- background-image: -o-linear-gradient(top, #6289d9, #295b98);
- background-image: -ms-linear-gradient(top, #6289d9, #295b98);
-}
-.LESSmultimediaview_bar_handle_style {
- background-color: #f9f9f9;
- background-image: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#e6e6e6));
- background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: -ms-linear-gradient(top, #ffffff, #e6e6e6);
-}
+
+
/***************************************************************************
tokentextarea
***************************************************************************/
/***************************************************************************
+ Splitview
***************************************************************************/
.ui-gallery {
position: relative;
/***************************************************************************
Body
***************************************************************************/
+/* B011 : Main Background color */
+/* B012 : Main font color */
/***************************************************************************
Naviframe
***************************************************************************/
-/* #3b73b6 *//* title text */
+/* B042 : title text */
/* B052L4 : Title text button */
/* B052L5 : Title text button press */
/* B052L1P : Title text button press bg */
/***************************************************************************
Button(connected with other winset)
***************************************************************************/
-.LESSbutton_box_style {
- color: #363133;
-}
-.LESSbutton_up_style {
- background: #ebe8e3;
- background: -webkit-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -moz-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -o-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -ms-linear-gradient(top, #ebe8e3, #eae7e2);
-}
-.LESSbutton_box_style {
- background: #ebe8e3;
- background: -webkit-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -moz-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -o-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -ms-linear-gradient(top, #ebe8e3, #eae7e2);
- border: 1px solid;
- border-color: #dcdad3;
- -o-box-shadow: 0 0 1px 1px #ffffff;
- -ms-box-shadow: 0 0 1px 1px #ffffff;
- -moz-box-shadow: 0 0 1px 1px #ffffff;
- -webkit-box-shadow: 0 0 1px 1px #ffffff;
- box-shadow: 0 0 1px 1px #ffffff;
-}
-.LESSbutton_inner_box_style {
- background: #f7f5ee;
- background: -webkit-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -ms-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -o-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -moz-linear-gradient(top, #faf7f2, #f8f5f0);
- -o-box-shadow: none;
- -ms-box-shadow: none;
- -moz-box-shadow: none;
- -webkit-box-shadow: none;
- box-shadow: none;
-}
-.LESSbutton_inner_pressstyle {
- color: #f8f6ef;
-}
-.LESSbutton_text1_style {
- font-family: Helvetica, Arial, sans-serif;
- font-weight: normal;
- font-size: 1.0rem;
- font-style: normal;
- color: #000000;
-}
-.LESSbutton_hover_style {
- color: #363133;
-}
-.LESSbutton_down_style {
- background: #3b73b6;
- color: #f8f6ef;
-}
-.LESSbutton_edit_style {
- background: #c95858;
- background: -webkit-gradient(linear, left top, left bottom, from(#c95858), to(#a12828));
- background: -moz_linear-gradient(top, #c95858, #a12828);
-}
+
+
+
+
+
+
+
+
+
/***************************************************************************
contextual popup
***************************************************************************/
-/* #1A5274 */
/***************************************************************************
Scrollview
***************************************************************************/
Date Time picker
***************************************************************************/
/***************************************************************************
- DaySelector
-***************************************************************************/
-/* #00a8e7 */
-/* #f01402 */
-/* #f9f9f9 *//* #f9f9f9 */.LESSDayselectorButtonNormal {
- background: #7e9db2;
- background: -webkit-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -moz-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -ms-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -o-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: linear-gradient(top, #7e9db2 0%, #547990 100%);
-}
-.LESSDayaselectorButtonPress {
- background: #3b7796;
- background: -webkit-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -moz-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -ms-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -o-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: linear-gradient(top, #3b7796 0%, #2f5b75 100%);
-}
-/***************************************************************************
- OptionHeader
-***************************************************************************/
-/* #f9f9f9 */
-/***************************************************************************
SegmentControl
***************************************************************************/
-/* #F9F9F9*/
-/* #F9F9F9*/
-/***************************************************************************
- ControlGroup
-***************************************************************************/
-/* 00_divider_line.9.png */
+/* B052L4 : Title text button */
/***************************************************************************
Popup
***************************************************************************/
/* popup_title_bg.png */
/* maybe not use only popupwindow*/
-.LESSpopup_button_style {
- /* background: @color_popup_buttonbg;
- background: @color_popup_buttonbg_webkit;
- background: @color_popup_buttonbg_moz;
- background: @color_popup_buttonbg_ms;
- background: @color_popup_buttonbg_o;
- color: @color_popup_buttontext;*/
-}
-.LESSpopup_button_hover_style {
- background: #5e88a3;
-}
-.LESSpopup_button_press_style {
- background: #43a0d9;
- background: -webkit-gradient(linear, left top, left bottom, from(#43a0d9), to(#388bb9));
- background: -moz-linear-gradient(top, #43a0d9, #388bb9);
- background: -ms-linear-gradient(top, #43a0d9, #388bb9);
- background: -o-linear-gradient(top, #43a0d9, #388bb9);
-}
-/***************************************************************************
- Button
-***************************************************************************/
-.LESStoggleswitch_on_style {
- background: #2a7eac;
- background: -webkit-gradient(linear, left top, left bottom, from(#2174a7), to(#4ba5db));
- background: -moz-linear-gradient(top, #2174a7, #4ba5db);
- border-radius: 4px;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
-}
-.LESStoggleswitch_off_style {
- color: #cbcbcb;
- background: #97a1a7;
- background: -webkit-gradient(linear, left top, left bottom, from(#727272), to(#8d8d8d));
- background: -moz-linear-gradient(top, #727272, #8d8d8d);
- border-radius: 4px;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
-}
-.LESStoggleswitch_reed_style {
- background: #fdfdfd;
- background: -webkit-gradient(linear, left top, left bottom, from(#fdfdfd), to(#e7e7e7));
- background: -moz-linear-gradient(top, #fdfdfd, #e7e7e7);
- border-radius: 2px;
- -webkit-border-radius: 2px;
- -moz-border-radius: 2px;
-}
-.LESSbutton_editpress_style {
- background: #931818;
- background: -webkit-gradient(linear, left top, left bottom, from(#931818), to(#6e1717));
- background: -moz-linear-gradient(top, #931818, #6e1717);
-}
-.LESSbutton_edit_padding {
- padding: 0.5em 0.8em;
-}
+
+
/***************************************************************************
Tickernoti
***************************************************************************/
Smallpopup
***************************************************************************/
/***************************************************************************
- No Contents
-***************************************************************************/
-/***************************************************************************
Slider
***************************************************************************/
/***************************************************************************
/***************************************************************************
multimediaview
***************************************************************************/
-.LESSmultimediaview_bar_active_style {
- background-color: #4a84c9;
- background-image: -webkit-gradient(linear, left top, left bottom, from(#6289d9), to(#295b98));
- background-image: -moz-linear-gradient(top, #6289d9, #295b98);
- background-image: -o-linear-gradient(top, #6289d9, #295b98);
- background-image: -ms-linear-gradient(top, #6289d9, #295b98);
-}
-.LESSmultimediaview_bar_handle_style {
- background-color: #f9f9f9;
- background-image: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#e6e6e6));
- background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: -ms-linear-gradient(top, #ffffff, #e6e6e6);
-}
+
+
/***************************************************************************
tokentextarea
***************************************************************************/
/***************************************************************************
+ Splitview
***************************************************************************/
/* tickernoti */
@-webkit-keyframes ui-ticker-show {
from {
opacity: 0;
- -webkit-transform: translatey(-2.272727272727273rem);
+ -webkit-transform: translateY(-2.272727272727273rem);
top: -2.272727272727273rem;
}
to {
opacity: 1;
- -webkit-transform: translatey(0);
+ -webkit-transform: translateY(0);
top: 0;
}
}
@-webkit-keyframes ui-ticker-hide {
from {
opacity: 1;
- -webkit-transform: translatey(0);
+ -webkit-transform: translateY(0);
top: 0;
}
to {
opacity: 0;
- -webkit-transform: translatey(-2.272727272727273rem);
+ -webkit-transform: translateY(-2.272727272727273rem);
top: -2.272727272727273rem;
}
}
}
.ui-ticker.hide {
display: block;
- -ms-animation: ui-ticker-hide 0.8s 1 ease;
-o-animation: ui-ticker-hide 0.8s 1 ease;
-ms-animation: ui-ticker-hide 0.8s 1 ease;
-webkit-animation: ui-ticker-hide 0.8s 1 ease;
@-webkit-keyframes ui-smallpopup-show {
from {
opacity: 0;
- -webkit-transform: scaley(0);
+ -webkit-transform: scaleY(0);
}
to {
opacity: 1;
- -webkit-transform: scaley(1);
+ -webkit-transform: scaleY(1);
}
}
@-webkit-keyframes ui-smallpopup-hide {
from {
opacity: 1;
left: 0;
- -webkit-transform: scaley(1);
+ -webkit-transform: scaleY(1);
}
to {
opacity: 0;
left: 0;
- -webkit-transform: scaley(0);
+ -webkit-transform: scaleY(0);
}
}
.ui-smallpopup {
/***************************************************************************
Body
***************************************************************************/
+/* B011 : Main Background color */
+/* B012 : Main font color */
/***************************************************************************
Naviframe
***************************************************************************/
-/* #3b73b6 *//* title text */
+/* B042 : title text */
/* B052L4 : Title text button */
/* B052L5 : Title text button press */
/* B052L1P : Title text button press bg */
/***************************************************************************
Button(connected with other winset)
***************************************************************************/
-.LESSbutton_box_style {
- color: #363133;
-}
-.LESSbutton_up_style {
- background: #ebe8e3;
- background: -webkit-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -moz-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -o-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -ms-linear-gradient(top, #ebe8e3, #eae7e2);
-}
-.LESSbutton_box_style {
- background: #ebe8e3;
- background: -webkit-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -moz-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -o-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -ms-linear-gradient(top, #ebe8e3, #eae7e2);
- border: 1px solid;
- border-color: #dcdad3;
- -o-box-shadow: 0 0 1px 1px #ffffff;
- -ms-box-shadow: 0 0 1px 1px #ffffff;
- -moz-box-shadow: 0 0 1px 1px #ffffff;
- -webkit-box-shadow: 0 0 1px 1px #ffffff;
- box-shadow: 0 0 1px 1px #ffffff;
-}
-.LESSbutton_inner_box_style {
- background: #f7f5ee;
- background: -webkit-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -ms-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -o-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -moz-linear-gradient(top, #faf7f2, #f8f5f0);
- -o-box-shadow: none;
- -ms-box-shadow: none;
- -moz-box-shadow: none;
- -webkit-box-shadow: none;
- box-shadow: none;
-}
-.LESSbutton_inner_pressstyle {
- color: #f8f6ef;
-}
-.LESSbutton_text1_style {
- font-family: Helvetica, Arial, sans-serif;
- font-weight: normal;
- font-size: 1.0rem;
- font-style: normal;
- color: #000000;
-}
-.LESSbutton_hover_style {
- color: #363133;
-}
-.LESSbutton_down_style {
- background: #3b73b6;
- color: #f8f6ef;
-}
-.LESSbutton_edit_style {
- background: #c95858;
- background: -webkit-gradient(linear, left top, left bottom, from(#c95858), to(#a12828));
- background: -moz_linear-gradient(top, #c95858, #a12828);
-}
+
+
+
+
+
+
+
+
+
/***************************************************************************
contextual popup
***************************************************************************/
-/* #1A5274 */
/***************************************************************************
Scrollview
***************************************************************************/
Date Time picker
***************************************************************************/
/***************************************************************************
- DaySelector
-***************************************************************************/
-/* #00a8e7 */
-/* #f01402 */
-/* #f9f9f9 *//* #f9f9f9 */.LESSDayselectorButtonNormal {
- background: #7e9db2;
- background: -webkit-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -moz-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -ms-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -o-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: linear-gradient(top, #7e9db2 0%, #547990 100%);
-}
-.LESSDayaselectorButtonPress {
- background: #3b7796;
- background: -webkit-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -moz-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -ms-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -o-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: linear-gradient(top, #3b7796 0%, #2f5b75 100%);
-}
-/***************************************************************************
- OptionHeader
-***************************************************************************/
-/* #f9f9f9 */
-/***************************************************************************
SegmentControl
***************************************************************************/
-/* #F9F9F9*/
-/* #F9F9F9*/
-/***************************************************************************
- ControlGroup
-***************************************************************************/
-/* 00_divider_line.9.png */
+/* B052L4 : Title text button */
/***************************************************************************
Popup
***************************************************************************/
/* popup_title_bg.png */
/* maybe not use only popupwindow*/
-.LESSpopup_button_style {
- /* background: @color_popup_buttonbg;
- background: @color_popup_buttonbg_webkit;
- background: @color_popup_buttonbg_moz;
- background: @color_popup_buttonbg_ms;
- background: @color_popup_buttonbg_o;
- color: @color_popup_buttontext;*/
-}
-.LESSpopup_button_hover_style {
- background: #5e88a3;
-}
-.LESSpopup_button_press_style {
- background: #43a0d9;
- background: -webkit-gradient(linear, left top, left bottom, from(#43a0d9), to(#388bb9));
- background: -moz-linear-gradient(top, #43a0d9, #388bb9);
- background: -ms-linear-gradient(top, #43a0d9, #388bb9);
- background: -o-linear-gradient(top, #43a0d9, #388bb9);
-}
-/***************************************************************************
- Button
-***************************************************************************/
-.LESStoggleswitch_on_style {
- background: #2a7eac;
- background: -webkit-gradient(linear, left top, left bottom, from(#2174a7), to(#4ba5db));
- background: -moz-linear-gradient(top, #2174a7, #4ba5db);
- border-radius: 4px;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
-}
-.LESStoggleswitch_off_style {
- color: #cbcbcb;
- background: #97a1a7;
- background: -webkit-gradient(linear, left top, left bottom, from(#727272), to(#8d8d8d));
- background: -moz-linear-gradient(top, #727272, #8d8d8d);
- border-radius: 4px;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
-}
-.LESStoggleswitch_reed_style {
- background: #fdfdfd;
- background: -webkit-gradient(linear, left top, left bottom, from(#fdfdfd), to(#e7e7e7));
- background: -moz-linear-gradient(top, #fdfdfd, #e7e7e7);
- border-radius: 2px;
- -webkit-border-radius: 2px;
- -moz-border-radius: 2px;
-}
-.LESSbutton_editpress_style {
- background: #931818;
- background: -webkit-gradient(linear, left top, left bottom, from(#931818), to(#6e1717));
- background: -moz-linear-gradient(top, #931818, #6e1717);
-}
-.LESSbutton_edit_padding {
- padding: 0.5em 0.8em;
-}
+
+
/***************************************************************************
Tickernoti
***************************************************************************/
Smallpopup
***************************************************************************/
/***************************************************************************
- No Contents
-***************************************************************************/
-/***************************************************************************
Slider
***************************************************************************/
/***************************************************************************
/***************************************************************************
multimediaview
***************************************************************************/
-.LESSmultimediaview_bar_active_style {
- background-color: #4a84c9;
- background-image: -webkit-gradient(linear, left top, left bottom, from(#6289d9), to(#295b98));
- background-image: -moz-linear-gradient(top, #6289d9, #295b98);
- background-image: -o-linear-gradient(top, #6289d9, #295b98);
- background-image: -ms-linear-gradient(top, #6289d9, #295b98);
-}
-.LESSmultimediaview_bar_handle_style {
- background-color: #f9f9f9;
- background-image: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#e6e6e6));
- background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: -ms-linear-gradient(top, #ffffff, #e6e6e6);
-}
+
+
/***************************************************************************
tokentextarea
***************************************************************************/
/***************************************************************************
+ Splitview
***************************************************************************/
.ui-swipe {
list-style-type: none;
/***************************************************************************
Body
***************************************************************************/
+/* B011 : Main Background color */
+/* B012 : Main font color */
/***************************************************************************
Naviframe
***************************************************************************/
-/* #3b73b6 *//* title text */
+/* B042 : title text */
/* B052L4 : Title text button */
/* B052L5 : Title text button press */
/* B052L1P : Title text button press bg */
/***************************************************************************
Button(connected with other winset)
***************************************************************************/
-.LESSbutton_box_style {
- color: #363133;
-}
-.LESSbutton_up_style {
- background: #ebe8e3;
- background: -webkit-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -moz-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -o-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -ms-linear-gradient(top, #ebe8e3, #eae7e2);
-}
-.LESSbutton_box_style {
- background: #ebe8e3;
- background: -webkit-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -moz-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -o-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -ms-linear-gradient(top, #ebe8e3, #eae7e2);
- border: 1px solid;
- border-color: #dcdad3;
- -o-box-shadow: 0 0 1px 1px #ffffff;
- -ms-box-shadow: 0 0 1px 1px #ffffff;
- -moz-box-shadow: 0 0 1px 1px #ffffff;
- -webkit-box-shadow: 0 0 1px 1px #ffffff;
- box-shadow: 0 0 1px 1px #ffffff;
-}
-.LESSbutton_inner_box_style {
- background: #f7f5ee;
- background: -webkit-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -ms-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -o-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -moz-linear-gradient(top, #faf7f2, #f8f5f0);
- -o-box-shadow: none;
- -ms-box-shadow: none;
- -moz-box-shadow: none;
- -webkit-box-shadow: none;
- box-shadow: none;
-}
-.LESSbutton_inner_pressstyle {
- color: #f8f6ef;
-}
-.LESSbutton_text1_style {
- font-family: Helvetica, Arial, sans-serif;
- font-weight: normal;
- font-size: 1.0rem;
- font-style: normal;
- color: #000000;
-}
-.LESSbutton_hover_style {
- color: #363133;
-}
-.LESSbutton_down_style {
- background: #3b73b6;
- color: #f8f6ef;
-}
-.LESSbutton_edit_style {
- background: #c95858;
- background: -webkit-gradient(linear, left top, left bottom, from(#c95858), to(#a12828));
- background: -moz_linear-gradient(top, #c95858, #a12828);
-}
+
+
+
+
+
+
+
+
+
/***************************************************************************
contextual popup
***************************************************************************/
-/* #1A5274 */
/***************************************************************************
Scrollview
***************************************************************************/
Date Time picker
***************************************************************************/
/***************************************************************************
- DaySelector
-***************************************************************************/
-/* #00a8e7 */
-/* #f01402 */
-/* #f9f9f9 *//* #f9f9f9 */.LESSDayselectorButtonNormal {
- background: #7e9db2;
- background: -webkit-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -moz-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -ms-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -o-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: linear-gradient(top, #7e9db2 0%, #547990 100%);
-}
-.LESSDayaselectorButtonPress {
- background: #3b7796;
- background: -webkit-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -moz-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -ms-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -o-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: linear-gradient(top, #3b7796 0%, #2f5b75 100%);
-}
-/***************************************************************************
- OptionHeader
-***************************************************************************/
-/* #f9f9f9 */
-/***************************************************************************
SegmentControl
***************************************************************************/
-/* #F9F9F9*/
-/* #F9F9F9*/
-/***************************************************************************
- ControlGroup
-***************************************************************************/
-/* 00_divider_line.9.png */
+/* B052L4 : Title text button */
/***************************************************************************
Popup
***************************************************************************/
/* popup_title_bg.png */
/* maybe not use only popupwindow*/
-.LESSpopup_button_style {
- /* background: @color_popup_buttonbg;
- background: @color_popup_buttonbg_webkit;
- background: @color_popup_buttonbg_moz;
- background: @color_popup_buttonbg_ms;
- background: @color_popup_buttonbg_o;
- color: @color_popup_buttontext;*/
-}
-.LESSpopup_button_hover_style {
- background: #5e88a3;
-}
-.LESSpopup_button_press_style {
- background: #43a0d9;
- background: -webkit-gradient(linear, left top, left bottom, from(#43a0d9), to(#388bb9));
- background: -moz-linear-gradient(top, #43a0d9, #388bb9);
- background: -ms-linear-gradient(top, #43a0d9, #388bb9);
- background: -o-linear-gradient(top, #43a0d9, #388bb9);
-}
-/***************************************************************************
- Button
-***************************************************************************/
-.LESStoggleswitch_on_style {
- background: #2a7eac;
- background: -webkit-gradient(linear, left top, left bottom, from(#2174a7), to(#4ba5db));
- background: -moz-linear-gradient(top, #2174a7, #4ba5db);
- border-radius: 4px;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
-}
-.LESStoggleswitch_off_style {
- color: #cbcbcb;
- background: #97a1a7;
- background: -webkit-gradient(linear, left top, left bottom, from(#727272), to(#8d8d8d));
- background: -moz-linear-gradient(top, #727272, #8d8d8d);
- border-radius: 4px;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
-}
-.LESStoggleswitch_reed_style {
- background: #fdfdfd;
- background: -webkit-gradient(linear, left top, left bottom, from(#fdfdfd), to(#e7e7e7));
- background: -moz-linear-gradient(top, #fdfdfd, #e7e7e7);
- border-radius: 2px;
- -webkit-border-radius: 2px;
- -moz-border-radius: 2px;
-}
-.LESSbutton_editpress_style {
- background: #931818;
- background: -webkit-gradient(linear, left top, left bottom, from(#931818), to(#6e1717));
- background: -moz-linear-gradient(top, #931818, #6e1717);
-}
-.LESSbutton_edit_padding {
- padding: 0.5em 0.8em;
-}
+
+
/***************************************************************************
Tickernoti
***************************************************************************/
Smallpopup
***************************************************************************/
/***************************************************************************
- No Contents
-***************************************************************************/
-/***************************************************************************
Slider
***************************************************************************/
/***************************************************************************
/***************************************************************************
multimediaview
***************************************************************************/
-.LESSmultimediaview_bar_active_style {
- background-color: #4a84c9;
- background-image: -webkit-gradient(linear, left top, left bottom, from(#6289d9), to(#295b98));
- background-image: -moz-linear-gradient(top, #6289d9, #295b98);
- background-image: -o-linear-gradient(top, #6289d9, #295b98);
- background-image: -ms-linear-gradient(top, #6289d9, #295b98);
-}
-.LESSmultimediaview_bar_handle_style {
- background-color: #f9f9f9;
- background-image: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#e6e6e6));
- background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: -ms-linear-gradient(top, #ffffff, #e6e6e6);
-}
+
+
/***************************************************************************
tokentextarea
***************************************************************************/
/***************************************************************************
+ Splitview
***************************************************************************/
.ui-fastscroll {
position: absolute;
padding-right: 0.08em;
opacity: 1;
}
-.ui-fastscroll ul {
- list-style-type: none;
- margin: 0;
- padding: 0;
-}
-.ui-fastscroll li {
- cursor: pointer;
- color: #a09f9a;
- padding: 0.09090909090909091rem 0.09090909090909091rem 0.09090909090909091rem 0.09090909090909091rem;
- text-align: center;
- font-size: 0.7272727272727273rem;
- font-weight: bold;
- border-left-width: 0.13636363636363635rem;
- border-left-color: #3b73b6;
- border-left-style: solid;
-}
-.ui-fastscroll2 {
- position: absolute;
- right: 0rem;
- -ms-user-select: none;
- -o-user-select: none;
- -moz-user-select: none;
- -webkit-user-select: none;
- user-select: none;
- margin: 0;
- padding-right: 0.08em;
- opacity: 1;
-}
-.ui-fastscroll2 ul {
- list-style-type: none;
- margin: 0;
- padding: 0;
-}
-.ui-fastscroll2 li {
- cursor: pointer;
- color: #a09f9a;
- padding: 0.09090909090909091rem 0.09090909090909091rem 0.09090909090909091rem 0.09090909090909091rem;
- text-align: right;
-}
-.ui-fastscroll-bg {
- position: absolute;
- right: 0rem;
- background-color: #e6e3d8;
- width: 1.1363636363636365rem;
- z-index: 10;
- top: 0;
-}
-.ui-fastscroll-popup {
- position: absolute;
- background: #3b73b6;
- color: #ffffff;
- padding: 0.4545454545454546rem 1.3636363636363638rem;
- -ms-box-shadow: 0.36363636363636365rem 0.4545454545454546rem 0rem rgba(199, 199, 199, 0.5);
- -o-box-shadow: 0.36363636363636365rem 0.4545454545454546rem 0rem rgba(199, 199, 199, 0.5);
- -moz-box-shadow: 0.36363636363636365rem 0.4545454545454546rem 0rem rgba(199, 199, 199, 0.5);
- -webkit-box-shadow: 0.36363636363636365rem 0.4545454545454546rem 0rem rgba(199, 199, 199, 0.5);
- box-shadow: 0.36363636363636365rem 0.4545454545454546rem 0rem rgba(199, 199, 199, 0.5);
- text-align: center;
- font-size: 3.409090909090909rem;
- font-weight: bold;
- display: none;
- box-sizing: border-box;
- left: 50%;
- top: 50%;
-}
-li.ui-fastscroll-hover {
- color: #3b73b6;
-}
-li.ui-fastscroll-hover, li.ui-fastscroll-hover-up, li.ui-fastscroll-hover-down {
- background: #f8f6ef;
- border-style: solid;
- border-color: #3b73b6;
- border-width: 0px;
- border-right-width: 0.13636363636363635rem;
- border-left-width: 1px;
- border-left-color: #f8f6ef;
-}
-li.ui-fastscroll-hover-up {
- border-top-width: 0.13636363636363635rem;
-}
-li.ui-fastscroll-hover-down {
- border-bottom-width: 0.13636363636363635rem;
-}
-/****************************
- * Tizen Common Less Header *
- ****************************/
-/*
- * Common definition for theme
- * 'config.less' in each theme must include this file.
- */
-/******************************
- z-index order collection
- ******************************/
-/******************************
- Global LESS mixin collection
- ******************************/
-/***************************************************************************
- Body
-***************************************************************************/
-/***************************************************************************
- Naviframe
-***************************************************************************/
-/* #3b73b6 *//* title text */
-/* B052L4 : Title text button */
-/* B052L5 : Title text button press */
-/* B052L1P : Title text button press bg */
-/* 00_divider_line.9.png */
-/***************************************************************************
- Tabbar
-***************************************************************************/
-/* B0514P1 : 00_tab_press_ef.9.png */
-/* B052L6P */
-/* B052L6 */
-/***************************************************************************
- List
-***************************************************************************/
-/* B0211 */
-/* B041 */
-/* B0221 */
-/* W021L1 */
-/* W021L2 */
-/***************************************************************************
- Shortcut Scroll
-***************************************************************************/
-/* B0723 : 00_fast_scroll_rollover_bg.9.png */
-/* B0721 : Rollover text */
-/* B0731 : 00_fast_scroll_popup_bg.png */
-/* B0732 : Scroll popup text */
-/***************************************************************************
- SearchBar(forms.textinput)
-***************************************************************************/
-/* Search default text */
-/* W301 : 00_search_edit_field_bg.png */
-/***************************************************************************
- Popup
-***************************************************************************/
-/* B061L1 : Popop info */
-/***************************************************************************
- Button(connected with other winset)
-***************************************************************************/
-.LESSbutton_box_style {
- color: #363133;
-}
-.LESSbutton_up_style {
- background: #ebe8e3;
- background: -webkit-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -moz-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -o-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -ms-linear-gradient(top, #ebe8e3, #eae7e2);
-}
-.LESSbutton_box_style {
- background: #ebe8e3;
- background: -webkit-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -moz-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -o-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -ms-linear-gradient(top, #ebe8e3, #eae7e2);
- border: 1px solid;
- border-color: #dcdad3;
- -o-box-shadow: 0 0 1px 1px #ffffff;
- -ms-box-shadow: 0 0 1px 1px #ffffff;
- -moz-box-shadow: 0 0 1px 1px #ffffff;
- -webkit-box-shadow: 0 0 1px 1px #ffffff;
- box-shadow: 0 0 1px 1px #ffffff;
-}
-.LESSbutton_inner_box_style {
- background: #f7f5ee;
- background: -webkit-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -ms-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -o-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -moz-linear-gradient(top, #faf7f2, #f8f5f0);
- -o-box-shadow: none;
- -ms-box-shadow: none;
- -moz-box-shadow: none;
- -webkit-box-shadow: none;
- box-shadow: none;
-}
-.LESSbutton_inner_pressstyle {
- color: #f8f6ef;
-}
-.LESSbutton_text1_style {
- font-family: Helvetica, Arial, sans-serif;
- font-weight: normal;
- font-size: 1.0rem;
- font-style: normal;
- color: #000000;
-}
-.LESSbutton_hover_style {
- color: #363133;
-}
-.LESSbutton_down_style {
- background: #3b73b6;
- color: #f8f6ef;
-}
-.LESSbutton_edit_style {
- background: #c95858;
- background: -webkit-gradient(linear, left top, left bottom, from(#c95858), to(#a12828));
- background: -moz_linear-gradient(top, #c95858, #a12828);
-}
-/***************************************************************************
- contextual popup
-***************************************************************************/
-/* #1A5274 */
-/***************************************************************************
- Scrollview
-***************************************************************************/
-/***************************************************************************
- Date Time picker
-***************************************************************************/
-/***************************************************************************
- DaySelector
-***************************************************************************/
-/* #00a8e7 */
-/* #f01402 */
-/* #f9f9f9 *//* #f9f9f9 */.LESSDayselectorButtonNormal {
- background: #7e9db2;
- background: -webkit-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -moz-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -ms-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -o-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: linear-gradient(top, #7e9db2 0%, #547990 100%);
-}
-.LESSDayaselectorButtonPress {
- background: #3b7796;
- background: -webkit-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -moz-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -ms-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -o-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: linear-gradient(top, #3b7796 0%, #2f5b75 100%);
-}
-/***************************************************************************
- OptionHeader
-***************************************************************************/
-/* #f9f9f9 */
-/***************************************************************************
- SegmentControl
-***************************************************************************/
-/* #F9F9F9*/
-/* #F9F9F9*/
-/***************************************************************************
- ControlGroup
-***************************************************************************/
-/* 00_divider_line.9.png */
-/***************************************************************************
- Popup
-***************************************************************************/
-/* popup_title_bg.png */
-/* maybe not use only popupwindow*/
-.LESSpopup_button_style {
- /* background: @color_popup_buttonbg;
- background: @color_popup_buttonbg_webkit;
- background: @color_popup_buttonbg_moz;
- background: @color_popup_buttonbg_ms;
- background: @color_popup_buttonbg_o;
- color: @color_popup_buttontext;*/
-
-}
-.LESSpopup_button_hover_style {
- background: #5e88a3;
-}
-.LESSpopup_button_press_style {
- background: #43a0d9;
- background: -webkit-gradient(linear, left top, left bottom, from(#43a0d9), to(#388bb9));
- background: -moz-linear-gradient(top, #43a0d9, #388bb9);
- background: -ms-linear-gradient(top, #43a0d9, #388bb9);
- background: -o-linear-gradient(top, #43a0d9, #388bb9);
-}
-/***************************************************************************
- Button
-***************************************************************************/
-.LESStoggleswitch_on_style {
- background: #2a7eac;
- background: -webkit-gradient(linear, left top, left bottom, from(#2174a7), to(#4ba5db));
- background: -moz-linear-gradient(top, #2174a7, #4ba5db);
- border-radius: 4px;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
-}
-.LESStoggleswitch_off_style {
- color: #cbcbcb;
- background: #97a1a7;
- background: -webkit-gradient(linear, left top, left bottom, from(#727272), to(#8d8d8d));
- background: -moz-linear-gradient(top, #727272, #8d8d8d);
- border-radius: 4px;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
-}
-.LESStoggleswitch_reed_style {
- background: #fdfdfd;
- background: -webkit-gradient(linear, left top, left bottom, from(#fdfdfd), to(#e7e7e7));
- background: -moz-linear-gradient(top, #fdfdfd, #e7e7e7);
- border-radius: 2px;
- -webkit-border-radius: 2px;
- -moz-border-radius: 2px;
-}
-.LESSbutton_editpress_style {
- background: #931818;
- background: -webkit-gradient(linear, left top, left bottom, from(#931818), to(#6e1717));
- background: -moz-linear-gradient(top, #931818, #6e1717);
-}
-.LESSbutton_edit_padding {
- padding: 0.5em 0.8em;
-}
-/***************************************************************************
- Tickernoti
-***************************************************************************/
-/***************************************************************************
- Smallpopup
-***************************************************************************/
-/***************************************************************************
- No Contents
-***************************************************************************/
-/***************************************************************************
- Slider
-***************************************************************************/
-/***************************************************************************
- Progress
-***************************************************************************/
-/***************************************************************************
- Handler
-***************************************************************************/
-/***************************************************************************
- multimediaview
-***************************************************************************/
-.LESSmultimediaview_bar_active_style {
- background-color: #4a84c9;
- background-image: -webkit-gradient(linear, left top, left bottom, from(#6289d9), to(#295b98));
- background-image: -moz-linear-gradient(top, #6289d9, #295b98);
- background-image: -o-linear-gradient(top, #6289d9, #295b98);
- background-image: -ms-linear-gradient(top, #6289d9, #295b98);
-}
-.LESSmultimediaview_bar_handle_style {
- background-color: #f9f9f9;
- background-image: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#e6e6e6));
- background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: -ms-linear-gradient(top, #ffffff, #e6e6e6);
-}
-/***************************************************************************
- tokentextarea
-***************************************************************************/
-/***************************************************************************
-***************************************************************************/
-/* dayselector CSS */
-.ui-dayselector label {
- height: 2.5454545454545454rem;
- width: 2.909090909090909rem;
-}
-.ui-dayselector {
- display: inline-block;
-}
-.ui-dayselector .ui-btn {
- border-color: #1a5274;
- border-style: solid;
- border-width: 0.045454545454545456rem;
+.ui-fastscroll ul {
+ list-style-type: none;
+ margin: 0;
+ padding: 0;
}
-.ui-dayselector .ui-btn .ui-btn-inner {
+.ui-fastscroll li {
+ cursor: pointer;
+ color: #a09f9a;
+ padding: 0.09090909090909091rem 0.09090909090909091rem 0.09090909090909091rem 0.09090909090909091rem;
text-align: center;
- padding: 0.4em 0px;
-}
-.ui-dayselector .ui-checkbox-off {
- background: #7e9db2;
- background: -webkit-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -moz-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -ms-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -o-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: linear-gradient(top, #7e9db2 0%, #547990 100%);
-}
-.ui-dayselector .ui-checkbox-off .ui-btn-text {
- color: #f9f9f9;
-}
-.ui-dayselector .ui-checkbox-off.ui-btn-down-s.ui-btn-hover-s {
- background: #3b7796;
- background: -webkit-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -moz-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -ms-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -o-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: linear-gradient(top, #3b7796 0%, #2f5b75 100%);
-}
-.ui-dayselector .ui-checkbox-on {
- background: #3b7796;
- background: -webkit-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -moz-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -ms-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -o-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: linear-gradient(top, #3b7796 0%, #2f5b75 100%);
-}
-.ui-dayselector .ui-checkbox-on .ui-btn-text {
- color: #f9f9f9;
-}
-.ui-dayselector .ui-checkbox-on.ui-btn-down-s.ui-btn-hover-s {
- background: #7e9db2;
- background: -webkit-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -moz-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -ms-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -o-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: linear-gradient(top, #7e9db2 0%, #547990 100%);
+ vertical-align: middle;
+ font-size: 0.7272727272727273rem;
+ font-weight: bold;
+ border-left-width: 0.13636363636363635rem;
+ border-left-color: #3b73b6;
+ border-left-style: solid;
+ border-top-width: 0.13636363636363635rem;
+ border-top-color: #e6e3d8;
}
-.ui-dayselector .ui-dayselector-label-6 .ui-btn-text {
- color: #00a8e7;
+.ui-fastscroll2 {
+ position: absolute;
+ right: 0rem;
+ -ms-user-select: none;
+ -o-user-select: none;
+ -moz-user-select: none;
+ -webkit-user-select: none;
+ user-select: none;
+ margin: 0;
+ padding-right: 0.08em;
+ opacity: 1;
}
-.ui-dayselector .ui-dayselector-label-6.ui-checkbox-on .ui-btn-text {
- color: #f9f9f9;
+.ui-fastscroll2 ul {
+ list-style-type: none;
+ margin: 0;
+ padding: 0;
}
-.ui-dayselector .ui-dayselector-label-0 .ui-btn-text {
- color: #f01402;
+.ui-fastscroll2 li {
+ cursor: pointer;
+ color: #a09f9a;
+ padding: 0.09090909090909091rem 0.09090909090909091rem 0.09090909090909091rem 0.09090909090909091rem;
+ text-align: right;
}
-.ui-dayselector .ui-checkbox {
- height: 2.0454545454545454rem;
+.ui-fastscroll-bg {
+ position: absolute;
+ right: 0rem;
+ background-color: #e6e3d8;
+ width: 1.1363636363636365rem;
+ z-index: 10;
+ top: 0;
}
-.ui-dayselector .ui-checkbox .ui-btn {
- width: 2.1363636363636362rem;
+.ui-fastscroll-popup {
+ position: absolute;
+ background: #3b73b6;
+ color: #ffffff;
+ padding: 0.4545454545454546rem 1.3636363636363638rem;
+ -ms-box-shadow: 0.36363636363636365rem 0.4545454545454546rem 0rem rgba(199, 199, 199, 0.5);
+ -o-box-shadow: 0.36363636363636365rem 0.4545454545454546rem 0rem rgba(199, 199, 199, 0.5);
+ -moz-box-shadow: 0.36363636363636365rem 0.4545454545454546rem 0rem rgba(199, 199, 199, 0.5);
+ -webkit-box-shadow: 0.36363636363636365rem 0.4545454545454546rem 0rem rgba(199, 199, 199, 0.5);
+ box-shadow: 0.36363636363636365rem 0.4545454545454546rem 0rem rgba(199, 199, 199, 0.5);
+ text-align: center;
+ font-size: 3.409090909090909rem;
+ font-weight: bold;
+ display: none;
+ box-sizing: border-box;
+ left: 50%;
+ top: 50%;
}
-.ui-dayselector .ui-checkbox .ui-btn.ui-corner-left {
- border-top-left-radius: 0.2272727272727273rem;
- border-bottom-left-radius: 0.2272727272727273rem;
+li.ui-fastscroll-hover {
+ color: #3b73b6;
}
-.ui-dayselector .ui-checkbox .ui-btn.ui-corner-right {
- border-top-right-radius: 0.2272727272727273rem;
- border-bottom-right-radius: 0.2272727272727273rem;
+li.ui-fastscroll-hover,
+li.ui-fastscroll-hover-up,
+li.ui-fastscroll-hover-down {
+ background: #f8f6ef;
+ border-style: solid;
+ border-color: #3b73b6;
+ border-width: 0px;
+ border-right-width: 0.13636363636363635rem;
+ border-left-width: 1px;
+ border-left-color: #f8f6ef;
}
-.ui-dayselector .todons-dayselector-disabled .ui-dayselector-label-6 {
- color: #121212;
+li.ui-fastscroll-hover {
+ padding-top: 0.045454545454545456rem;
+ padding-bottom: 0.045454545454545456rem;
}
-.ui-dayselector .todons-dayselector-disabled .ui-dayselector-label-0 {
- color: #363636;
+li.ui-fastscroll-hover-first-item {
+ padding-top: 0.09090909090909091rem;
}
-.ui-dayselector.ui-controlgroup-vertical .ui-checkbox .ui-btn {
- width: 2.909090909090909rem;
+li.ui-fastscroll-hover-up {
+ border-top-width: 0.13636363636363635rem;
+ padding-top: 0px;
}
-.ui-dayselector.ui-controlgroup-vertical .ui-checkbox .ui-btn .ui-btn-text {
- margin-left: 0.09090909090909091rem;
+li.ui-fastscroll-hover-down {
+ border-bottom-width: 0.13636363636363635rem;
+ padding-bottom: 0px;
}
/****************************
* Tizen Common Less Header *
/***************************************************************************
Body
***************************************************************************/
+/* B011 : Main Background color */
+/* B012 : Main font color */
/***************************************************************************
Naviframe
***************************************************************************/
-/* #3b73b6 *//* title text */
+/* B042 : title text */
/* B052L4 : Title text button */
/* B052L5 : Title text button press */
/* B052L1P : Title text button press bg */
/***************************************************************************
Button(connected with other winset)
***************************************************************************/
-.LESSbutton_box_style {
- color: #363133;
-}
-.LESSbutton_up_style {
- background: #ebe8e3;
- background: -webkit-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -moz-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -o-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -ms-linear-gradient(top, #ebe8e3, #eae7e2);
-}
-.LESSbutton_box_style {
- background: #ebe8e3;
- background: -webkit-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -moz-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -o-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -ms-linear-gradient(top, #ebe8e3, #eae7e2);
- border: 1px solid;
- border-color: #dcdad3;
- -o-box-shadow: 0 0 1px 1px #ffffff;
- -ms-box-shadow: 0 0 1px 1px #ffffff;
- -moz-box-shadow: 0 0 1px 1px #ffffff;
- -webkit-box-shadow: 0 0 1px 1px #ffffff;
- box-shadow: 0 0 1px 1px #ffffff;
-}
-.LESSbutton_inner_box_style {
- background: #f7f5ee;
- background: -webkit-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -ms-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -o-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -moz-linear-gradient(top, #faf7f2, #f8f5f0);
- -o-box-shadow: none;
- -ms-box-shadow: none;
- -moz-box-shadow: none;
- -webkit-box-shadow: none;
- box-shadow: none;
-}
-.LESSbutton_inner_pressstyle {
- color: #f8f6ef;
-}
-.LESSbutton_text1_style {
- font-family: Helvetica, Arial, sans-serif;
- font-weight: normal;
- font-size: 1.0rem;
- font-style: normal;
- color: #000000;
-}
-.LESSbutton_hover_style {
- color: #363133;
-}
-.LESSbutton_down_style {
- background: #3b73b6;
- color: #f8f6ef;
-}
-.LESSbutton_edit_style {
- background: #c95858;
- background: -webkit-gradient(linear, left top, left bottom, from(#c95858), to(#a12828));
- background: -moz_linear-gradient(top, #c95858, #a12828);
-}
+
+
+
+
+
+
+
+
+
/***************************************************************************
contextual popup
***************************************************************************/
-/* #1A5274 */
/***************************************************************************
Scrollview
***************************************************************************/
Date Time picker
***************************************************************************/
/***************************************************************************
- DaySelector
-***************************************************************************/
-/* #00a8e7 */
-/* #f01402 */
-/* #f9f9f9 *//* #f9f9f9 */.LESSDayselectorButtonNormal {
- background: #7e9db2;
- background: -webkit-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -moz-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -ms-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -o-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: linear-gradient(top, #7e9db2 0%, #547990 100%);
-}
-.LESSDayaselectorButtonPress {
- background: #3b7796;
- background: -webkit-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -moz-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -ms-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -o-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: linear-gradient(top, #3b7796 0%, #2f5b75 100%);
-}
-/***************************************************************************
- OptionHeader
-***************************************************************************/
-/* #f9f9f9 */
-/***************************************************************************
SegmentControl
***************************************************************************/
-/* #F9F9F9*/
-/* #F9F9F9*/
-/***************************************************************************
- ControlGroup
-***************************************************************************/
-/* 00_divider_line.9.png */
+/* B052L4 : Title text button */
/***************************************************************************
Popup
***************************************************************************/
/* popup_title_bg.png */
/* maybe not use only popupwindow*/
-.LESSpopup_button_style {
- /* background: @color_popup_buttonbg;
- background: @color_popup_buttonbg_webkit;
- background: @color_popup_buttonbg_moz;
- background: @color_popup_buttonbg_ms;
- background: @color_popup_buttonbg_o;
- color: @color_popup_buttontext;*/
-}
-.LESSpopup_button_hover_style {
- background: #5e88a3;
-}
-.LESSpopup_button_press_style {
- background: #43a0d9;
- background: -webkit-gradient(linear, left top, left bottom, from(#43a0d9), to(#388bb9));
- background: -moz-linear-gradient(top, #43a0d9, #388bb9);
- background: -ms-linear-gradient(top, #43a0d9, #388bb9);
- background: -o-linear-gradient(top, #43a0d9, #388bb9);
-}
-/***************************************************************************
- Button
-***************************************************************************/
-.LESStoggleswitch_on_style {
- background: #2a7eac;
- background: -webkit-gradient(linear, left top, left bottom, from(#2174a7), to(#4ba5db));
- background: -moz-linear-gradient(top, #2174a7, #4ba5db);
- border-radius: 4px;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
-}
-.LESStoggleswitch_off_style {
- color: #cbcbcb;
- background: #97a1a7;
- background: -webkit-gradient(linear, left top, left bottom, from(#727272), to(#8d8d8d));
- background: -moz-linear-gradient(top, #727272, #8d8d8d);
- border-radius: 4px;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
-}
-.LESStoggleswitch_reed_style {
- background: #fdfdfd;
- background: -webkit-gradient(linear, left top, left bottom, from(#fdfdfd), to(#e7e7e7));
- background: -moz-linear-gradient(top, #fdfdfd, #e7e7e7);
- border-radius: 2px;
- -webkit-border-radius: 2px;
- -moz-border-radius: 2px;
-}
-.LESSbutton_editpress_style {
- background: #931818;
- background: -webkit-gradient(linear, left top, left bottom, from(#931818), to(#6e1717));
- background: -moz-linear-gradient(top, #931818, #6e1717);
-}
-.LESSbutton_edit_padding {
- padding: 0.5em 0.8em;
-}
+
+
/***************************************************************************
Tickernoti
***************************************************************************/
Smallpopup
***************************************************************************/
/***************************************************************************
- No Contents
-***************************************************************************/
-/***************************************************************************
Slider
***************************************************************************/
/***************************************************************************
/***************************************************************************
multimediaview
***************************************************************************/
-.LESSmultimediaview_bar_active_style {
- background-color: #4a84c9;
- background-image: -webkit-gradient(linear, left top, left bottom, from(#6289d9), to(#295b98));
- background-image: -moz-linear-gradient(top, #6289d9, #295b98);
- background-image: -o-linear-gradient(top, #6289d9, #295b98);
- background-image: -ms-linear-gradient(top, #6289d9, #295b98);
-}
-.LESSmultimediaview_bar_handle_style {
- background-color: #f9f9f9;
- background-image: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#e6e6e6));
- background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: -ms-linear-gradient(top, #ffffff, #e6e6e6);
-}
+
+
/***************************************************************************
tokentextarea
***************************************************************************/
/***************************************************************************
+ Splitview
***************************************************************************/
div.ui-slider.ui-toggle-switch {
width: 3rem;
position: absolute;
width: 3rem;
height: 1.590909090909091rem;
- background-size: cover;
- -ms-background-size: cover;
- -webkit-background-size: cover;
- -o-background-size: cover;
- -moz-background-size: cover;
+ background-size: 100% 100%;
+ background-repeat: no-repeat;
+ background-color: transparent;
}
div.ui-slider.ui-toggle-switch .ui-slider-label.ui-slider-label-a {
- background: url(images/00_button_on.png) no-repeat;
+ background-image: url(images/00_button_on.png);
}
div.ui-slider.ui-toggle-switch .ui-slider-label.ui-slider-label-b {
- background: url(images/00_button_off.png) no-repeat;
+ background-image: url(images/00_button_off.png);
}
div.ui-slider.ui-toggle-switch .ui-slider-inneroffset a {
background: none;
/***************************************************************************
Body
***************************************************************************/
+/* B011 : Main Background color */
+/* B012 : Main font color */
/***************************************************************************
Naviframe
***************************************************************************/
-/* #3b73b6 *//* title text */
+/* B042 : title text */
/* B052L4 : Title text button */
/* B052L5 : Title text button press */
/* B052L1P : Title text button press bg */
/* B0211 */
/* B041 */
/* B0221 */
-/* W021L1 */
-/* W021L2 */
-/***************************************************************************
- Shortcut Scroll
-***************************************************************************/
-/* B0723 : 00_fast_scroll_rollover_bg.9.png */
-/* B0721 : Rollover text */
-/* B0731 : 00_fast_scroll_popup_bg.png */
-/* B0732 : Scroll popup text */
-/***************************************************************************
- SearchBar(forms.textinput)
-***************************************************************************/
-/* Search default text */
-/* W301 : 00_search_edit_field_bg.png */
-/***************************************************************************
- Popup
-***************************************************************************/
-/* B061L1 : Popop info */
-/***************************************************************************
- Button(connected with other winset)
-***************************************************************************/
-.LESSbutton_box_style {
- color: #363133;
-}
-.LESSbutton_up_style {
- background: #ebe8e3;
- background: -webkit-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -moz-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -o-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -ms-linear-gradient(top, #ebe8e3, #eae7e2);
-}
-.LESSbutton_box_style {
- background: #ebe8e3;
- background: -webkit-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -moz-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -o-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -ms-linear-gradient(top, #ebe8e3, #eae7e2);
- border: 1px solid;
- border-color: #dcdad3;
- -o-box-shadow: 0 0 1px 1px #ffffff;
- -ms-box-shadow: 0 0 1px 1px #ffffff;
- -moz-box-shadow: 0 0 1px 1px #ffffff;
- -webkit-box-shadow: 0 0 1px 1px #ffffff;
- box-shadow: 0 0 1px 1px #ffffff;
-}
-.LESSbutton_inner_box_style {
- background: #f7f5ee;
- background: -webkit-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -ms-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -o-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -moz-linear-gradient(top, #faf7f2, #f8f5f0);
- -o-box-shadow: none;
- -ms-box-shadow: none;
- -moz-box-shadow: none;
- -webkit-box-shadow: none;
- box-shadow: none;
-}
-.LESSbutton_inner_pressstyle {
- color: #f8f6ef;
-}
-.LESSbutton_text1_style {
- font-family: Helvetica, Arial, sans-serif;
- font-weight: normal;
- font-size: 1.0rem;
- font-style: normal;
- color: #000000;
-}
-.LESSbutton_hover_style {
- color: #363133;
-}
-.LESSbutton_down_style {
- background: #3b73b6;
- color: #f8f6ef;
-}
-.LESSbutton_edit_style {
- background: #c95858;
- background: -webkit-gradient(linear, left top, left bottom, from(#c95858), to(#a12828));
- background: -moz_linear-gradient(top, #c95858, #a12828);
-}
+/* W021L1 */
+/* W021L2 */
/***************************************************************************
- contextual popup
+ Shortcut Scroll
***************************************************************************/
-/* #1A5274 */
+/* B0723 : 00_fast_scroll_rollover_bg.9.png */
+/* B0721 : Rollover text */
+/* B0731 : 00_fast_scroll_popup_bg.png */
+/* B0732 : Scroll popup text */
/***************************************************************************
- Scrollview
+ SearchBar(forms.textinput)
***************************************************************************/
+/* Search default text */
+/* W301 : 00_search_edit_field_bg.png */
/***************************************************************************
- Date Time picker
+ Popup
***************************************************************************/
+/* B061L1 : Popop info */
/***************************************************************************
- DaySelector
+ Button(connected with other winset)
***************************************************************************/
-/* #00a8e7 */
-/* #f01402 */
-/* #f9f9f9 *//* #f9f9f9 */.LESSDayselectorButtonNormal {
- background: #7e9db2;
- background: -webkit-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -moz-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -ms-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -o-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: linear-gradient(top, #7e9db2 0%, #547990 100%);
-}
-.LESSDayaselectorButtonPress {
- background: #3b7796;
- background: -webkit-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -moz-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -ms-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -o-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: linear-gradient(top, #3b7796 0%, #2f5b75 100%);
-}
+
+
+
+
+
+
+
+
+
/***************************************************************************
- OptionHeader
+ contextual popup
***************************************************************************/
-/* #f9f9f9 */
/***************************************************************************
- SegmentControl
+ Scrollview
***************************************************************************/
-/* #F9F9F9*/
-/* #F9F9F9*/
/***************************************************************************
- ControlGroup
+ Date Time picker
***************************************************************************/
-/* 00_divider_line.9.png */
+/***************************************************************************
+ SegmentControl
+***************************************************************************/
+/* B052L4 : Title text button */
/***************************************************************************
Popup
***************************************************************************/
/* popup_title_bg.png */
/* maybe not use only popupwindow*/
-.LESSpopup_button_style {
- /* background: @color_popup_buttonbg;
- background: @color_popup_buttonbg_webkit;
- background: @color_popup_buttonbg_moz;
- background: @color_popup_buttonbg_ms;
- background: @color_popup_buttonbg_o;
- color: @color_popup_buttontext;*/
-}
-.LESSpopup_button_hover_style {
- background: #5e88a3;
-}
-.LESSpopup_button_press_style {
- background: #43a0d9;
- background: -webkit-gradient(linear, left top, left bottom, from(#43a0d9), to(#388bb9));
- background: -moz-linear-gradient(top, #43a0d9, #388bb9);
- background: -ms-linear-gradient(top, #43a0d9, #388bb9);
- background: -o-linear-gradient(top, #43a0d9, #388bb9);
-}
-/***************************************************************************
- Button
-***************************************************************************/
-.LESStoggleswitch_on_style {
- background: #2a7eac;
- background: -webkit-gradient(linear, left top, left bottom, from(#2174a7), to(#4ba5db));
- background: -moz-linear-gradient(top, #2174a7, #4ba5db);
- border-radius: 4px;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
-}
-.LESStoggleswitch_off_style {
- color: #cbcbcb;
- background: #97a1a7;
- background: -webkit-gradient(linear, left top, left bottom, from(#727272), to(#8d8d8d));
- background: -moz-linear-gradient(top, #727272, #8d8d8d);
- border-radius: 4px;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
-}
-.LESStoggleswitch_reed_style {
- background: #fdfdfd;
- background: -webkit-gradient(linear, left top, left bottom, from(#fdfdfd), to(#e7e7e7));
- background: -moz-linear-gradient(top, #fdfdfd, #e7e7e7);
- border-radius: 2px;
- -webkit-border-radius: 2px;
- -moz-border-radius: 2px;
-}
-.LESSbutton_editpress_style {
- background: #931818;
- background: -webkit-gradient(linear, left top, left bottom, from(#931818), to(#6e1717));
- background: -moz-linear-gradient(top, #931818, #6e1717);
-}
-.LESSbutton_edit_padding {
- padding: 0.5em 0.8em;
-}
+
+
/***************************************************************************
Tickernoti
***************************************************************************/
Smallpopup
***************************************************************************/
/***************************************************************************
- No Contents
-***************************************************************************/
-/***************************************************************************
Slider
***************************************************************************/
/***************************************************************************
/***************************************************************************
multimediaview
***************************************************************************/
-.LESSmultimediaview_bar_active_style {
- background-color: #4a84c9;
- background-image: -webkit-gradient(linear, left top, left bottom, from(#6289d9), to(#295b98));
- background-image: -moz-linear-gradient(top, #6289d9, #295b98);
- background-image: -o-linear-gradient(top, #6289d9, #295b98);
- background-image: -ms-linear-gradient(top, #6289d9, #295b98);
-}
-.LESSmultimediaview_bar_handle_style {
- background-color: #f9f9f9;
- background-image: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#e6e6e6));
- background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: -ms-linear-gradient(top, #ffffff, #e6e6e6);
-}
+
+
/***************************************************************************
tokentextarea
***************************************************************************/
/***************************************************************************
+ Splitview
***************************************************************************/
.ui-tokentextarea {
display: table;
outline: none;
+ position: relative;
}
.ui-tokentextarea .ui-tokentextarea-label {
display: inline-block;
- text-align: center;
position: relative;
- margin-left: .3em;
- margin-right: .3em;
- padding: .6em 0em;
+ margin-left: 5px;
+ margin-right: 5px;
+ padding: 10px 0px;
color: #666666;
font-weight: bold;
text-align: center;
position: relative;
border: 0 !important;
padding: 0 !important;
- margin: .5em;
+ margin: 8px;
color: #222222;
text-align: left;
font-size: 1em;
text-align: center;
cursor: pointer;
position: relative;
- margin-left: .3em;
- margin-right: .3em;
- margin-bottom: .3em;
- margin-top: .3em;
- padding: .2em .5em;
+ margin-left: 5px;
+ margin-right: 5px;
+ margin-bottom: 5px;
+ margin-top: 5px;
+ padding: 3px 8px;
font-size: 1em;
text-shadow: 0 0.1em 0.1em rgba(0, 0, 0, 0.3);
-ms-border-radius: .2em;
background-image: url(./images/00_contacts_button_header.png);
background-size: contain;
background-repeat: no-repeat;
- padding-left: .7em;
+ padding-left: 11px;
}
div.ui-tokentextarea-sblock {
background-color: #365984;
background-image: url(./images/00_contacts_button_header_press.png);
background-size: contain;
background-repeat: no-repeat;
- padding-left: .7em;
+ padding-left: 11px;
}
.ui-tokentextarea .ui-tokentextarea-desclabel {
display: inline-block;
text-align: left;
font-size: 1em;
}
-.ui-tokentextarea-focus-button {
- background-image: url(./images/00_button_expand_opened.png);
+.ui-tokentextarea-link-base {
+ position: absolute;
+ right: 0em;
+ bottom: .2em;
}
/****************************
* Tizen Common Less Header *
/***************************************************************************
Body
***************************************************************************/
+/* B011 : Main Background color */
+/* B012 : Main font color */
/***************************************************************************
Naviframe
***************************************************************************/
-/* #3b73b6 *//* title text */
+/* B042 : title text */
/* B052L4 : Title text button */
/* B052L5 : Title text button press */
/* B052L1P : Title text button press bg */
/***************************************************************************
Button(connected with other winset)
***************************************************************************/
-.LESSbutton_box_style {
- color: #363133;
-}
-.LESSbutton_up_style {
- background: #ebe8e3;
- background: -webkit-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -moz-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -o-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -ms-linear-gradient(top, #ebe8e3, #eae7e2);
-}
-.LESSbutton_box_style {
- background: #ebe8e3;
- background: -webkit-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -moz-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -o-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -ms-linear-gradient(top, #ebe8e3, #eae7e2);
- border: 1px solid;
- border-color: #dcdad3;
- -o-box-shadow: 0 0 1px 1px #ffffff;
- -ms-box-shadow: 0 0 1px 1px #ffffff;
- -moz-box-shadow: 0 0 1px 1px #ffffff;
- -webkit-box-shadow: 0 0 1px 1px #ffffff;
- box-shadow: 0 0 1px 1px #ffffff;
-}
-.LESSbutton_inner_box_style {
- background: #f7f5ee;
- background: -webkit-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -ms-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -o-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -moz-linear-gradient(top, #faf7f2, #f8f5f0);
- -o-box-shadow: none;
- -ms-box-shadow: none;
- -moz-box-shadow: none;
- -webkit-box-shadow: none;
- box-shadow: none;
-}
-.LESSbutton_inner_pressstyle {
- color: #f8f6ef;
-}
-.LESSbutton_text1_style {
- font-family: Helvetica, Arial, sans-serif;
- font-weight: normal;
- font-size: 1.0rem;
- font-style: normal;
- color: #000000;
-}
-.LESSbutton_hover_style {
- color: #363133;
-}
-.LESSbutton_down_style {
- background: #3b73b6;
- color: #f8f6ef;
-}
-.LESSbutton_edit_style {
- background: #c95858;
- background: -webkit-gradient(linear, left top, left bottom, from(#c95858), to(#a12828));
- background: -moz_linear-gradient(top, #c95858, #a12828);
-}
+
+
+
+
+
+
+
+
+
/***************************************************************************
contextual popup
***************************************************************************/
-/* #1A5274 */
/***************************************************************************
Scrollview
***************************************************************************/
Date Time picker
***************************************************************************/
/***************************************************************************
- DaySelector
-***************************************************************************/
-/* #00a8e7 */
-/* #f01402 */
-/* #f9f9f9 *//* #f9f9f9 */.LESSDayselectorButtonNormal {
- background: #7e9db2;
- background: -webkit-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -moz-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -ms-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -o-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: linear-gradient(top, #7e9db2 0%, #547990 100%);
-}
-.LESSDayaselectorButtonPress {
- background: #3b7796;
- background: -webkit-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -moz-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -ms-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -o-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: linear-gradient(top, #3b7796 0%, #2f5b75 100%);
-}
-/***************************************************************************
- OptionHeader
-***************************************************************************/
-/* #f9f9f9 */
-/***************************************************************************
SegmentControl
***************************************************************************/
-/* #F9F9F9*/
-/* #F9F9F9*/
-/***************************************************************************
- ControlGroup
-***************************************************************************/
-/* 00_divider_line.9.png */
+/* B052L4 : Title text button */
/***************************************************************************
Popup
***************************************************************************/
/* popup_title_bg.png */
/* maybe not use only popupwindow*/
-.LESSpopup_button_style {
- /* background: @color_popup_buttonbg;
- background: @color_popup_buttonbg_webkit;
- background: @color_popup_buttonbg_moz;
- background: @color_popup_buttonbg_ms;
- background: @color_popup_buttonbg_o;
- color: @color_popup_buttontext;*/
-}
-.LESSpopup_button_hover_style {
- background: #5e88a3;
-}
-.LESSpopup_button_press_style {
- background: #43a0d9;
- background: -webkit-gradient(linear, left top, left bottom, from(#43a0d9), to(#388bb9));
- background: -moz-linear-gradient(top, #43a0d9, #388bb9);
- background: -ms-linear-gradient(top, #43a0d9, #388bb9);
- background: -o-linear-gradient(top, #43a0d9, #388bb9);
-}
-/***************************************************************************
- Button
-***************************************************************************/
-.LESStoggleswitch_on_style {
- background: #2a7eac;
- background: -webkit-gradient(linear, left top, left bottom, from(#2174a7), to(#4ba5db));
- background: -moz-linear-gradient(top, #2174a7, #4ba5db);
- border-radius: 4px;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
-}
-.LESStoggleswitch_off_style {
- color: #cbcbcb;
- background: #97a1a7;
- background: -webkit-gradient(linear, left top, left bottom, from(#727272), to(#8d8d8d));
- background: -moz-linear-gradient(top, #727272, #8d8d8d);
- border-radius: 4px;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
-}
-.LESStoggleswitch_reed_style {
- background: #fdfdfd;
- background: -webkit-gradient(linear, left top, left bottom, from(#fdfdfd), to(#e7e7e7));
- background: -moz-linear-gradient(top, #fdfdfd, #e7e7e7);
- border-radius: 2px;
- -webkit-border-radius: 2px;
- -moz-border-radius: 2px;
-}
-.LESSbutton_editpress_style {
- background: #931818;
- background: -webkit-gradient(linear, left top, left bottom, from(#931818), to(#6e1717));
- background: -moz-linear-gradient(top, #931818, #6e1717);
-}
-.LESSbutton_edit_padding {
- padding: 0.5em 0.8em;
-}
+
+
/***************************************************************************
Tickernoti
***************************************************************************/
Smallpopup
***************************************************************************/
/***************************************************************************
- No Contents
-***************************************************************************/
-/***************************************************************************
Slider
***************************************************************************/
/***************************************************************************
/***************************************************************************
multimediaview
***************************************************************************/
-.LESSmultimediaview_bar_active_style {
- background-color: #4a84c9;
- background-image: -webkit-gradient(linear, left top, left bottom, from(#6289d9), to(#295b98));
- background-image: -moz-linear-gradient(top, #6289d9, #295b98);
- background-image: -o-linear-gradient(top, #6289d9, #295b98);
- background-image: -ms-linear-gradient(top, #6289d9, #295b98);
-}
-.LESSmultimediaview_bar_handle_style {
- background-color: #f9f9f9;
- background-image: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#e6e6e6));
- background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: -ms-linear-gradient(top, #ffffff, #e6e6e6);
-}
+
+
/***************************************************************************
tokentextarea
***************************************************************************/
/***************************************************************************
+ Splitview
***************************************************************************/
.ui-handler {
position: absolute;
/***************************************************************************
Body
***************************************************************************/
+/* B011 : Main Background color */
+/* B012 : Main font color */
/***************************************************************************
Naviframe
***************************************************************************/
-/* #3b73b6 *//* title text */
+/* B042 : title text */
/* B052L4 : Title text button */
/* B052L5 : Title text button press */
/* B052L1P : Title text button press bg */
/***************************************************************************
Button(connected with other winset)
***************************************************************************/
-.LESSbutton_box_style {
- color: #363133;
-}
-.LESSbutton_up_style {
- background: #ebe8e3;
- background: -webkit-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -moz-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -o-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -ms-linear-gradient(top, #ebe8e3, #eae7e2);
-}
-.LESSbutton_box_style {
- background: #ebe8e3;
- background: -webkit-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -moz-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -o-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -ms-linear-gradient(top, #ebe8e3, #eae7e2);
- border: 1px solid;
- border-color: #dcdad3;
- -o-box-shadow: 0 0 1px 1px #ffffff;
- -ms-box-shadow: 0 0 1px 1px #ffffff;
- -moz-box-shadow: 0 0 1px 1px #ffffff;
- -webkit-box-shadow: 0 0 1px 1px #ffffff;
- box-shadow: 0 0 1px 1px #ffffff;
-}
-.LESSbutton_inner_box_style {
- background: #f7f5ee;
- background: -webkit-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -ms-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -o-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -moz-linear-gradient(top, #faf7f2, #f8f5f0);
- -o-box-shadow: none;
- -ms-box-shadow: none;
- -moz-box-shadow: none;
- -webkit-box-shadow: none;
- box-shadow: none;
-}
-.LESSbutton_inner_pressstyle {
- color: #f8f6ef;
-}
-.LESSbutton_text1_style {
- font-family: Helvetica, Arial, sans-serif;
- font-weight: normal;
- font-size: 1.0rem;
- font-style: normal;
- color: #000000;
-}
-.LESSbutton_hover_style {
- color: #363133;
-}
-.LESSbutton_down_style {
- background: #3b73b6;
- color: #f8f6ef;
-}
-.LESSbutton_edit_style {
- background: #c95858;
- background: -webkit-gradient(linear, left top, left bottom, from(#c95858), to(#a12828));
- background: -moz_linear-gradient(top, #c95858, #a12828);
-}
+
+
+
+
+
+
+
+
+
/***************************************************************************
contextual popup
***************************************************************************/
-/* #1A5274 */
/***************************************************************************
Scrollview
***************************************************************************/
Date Time picker
***************************************************************************/
/***************************************************************************
- DaySelector
-***************************************************************************/
-/* #00a8e7 */
-/* #f01402 */
-/* #f9f9f9 *//* #f9f9f9 */.LESSDayselectorButtonNormal {
- background: #7e9db2;
- background: -webkit-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -moz-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -ms-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -o-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: linear-gradient(top, #7e9db2 0%, #547990 100%);
-}
-.LESSDayaselectorButtonPress {
- background: #3b7796;
- background: -webkit-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -moz-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -ms-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -o-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: linear-gradient(top, #3b7796 0%, #2f5b75 100%);
-}
-/***************************************************************************
- OptionHeader
-***************************************************************************/
-/* #f9f9f9 */
-/***************************************************************************
SegmentControl
***************************************************************************/
-/* #F9F9F9*/
-/* #F9F9F9*/
-/***************************************************************************
- ControlGroup
-***************************************************************************/
-/* 00_divider_line.9.png */
+/* B052L4 : Title text button */
/***************************************************************************
Popup
***************************************************************************/
/* popup_title_bg.png */
/* maybe not use only popupwindow*/
-.LESSpopup_button_style {
- /* background: @color_popup_buttonbg;
- background: @color_popup_buttonbg_webkit;
- background: @color_popup_buttonbg_moz;
- background: @color_popup_buttonbg_ms;
- background: @color_popup_buttonbg_o;
- color: @color_popup_buttontext;*/
-}
-.LESSpopup_button_hover_style {
- background: #5e88a3;
-}
-.LESSpopup_button_press_style {
- background: #43a0d9;
- background: -webkit-gradient(linear, left top, left bottom, from(#43a0d9), to(#388bb9));
- background: -moz-linear-gradient(top, #43a0d9, #388bb9);
- background: -ms-linear-gradient(top, #43a0d9, #388bb9);
- background: -o-linear-gradient(top, #43a0d9, #388bb9);
-}
-/***************************************************************************
- Button
-***************************************************************************/
-.LESStoggleswitch_on_style {
- background: #2a7eac;
- background: -webkit-gradient(linear, left top, left bottom, from(#2174a7), to(#4ba5db));
- background: -moz-linear-gradient(top, #2174a7, #4ba5db);
- border-radius: 4px;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
-}
-.LESStoggleswitch_off_style {
- color: #cbcbcb;
- background: #97a1a7;
- background: -webkit-gradient(linear, left top, left bottom, from(#727272), to(#8d8d8d));
- background: -moz-linear-gradient(top, #727272, #8d8d8d);
- border-radius: 4px;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
-}
-.LESStoggleswitch_reed_style {
- background: #fdfdfd;
- background: -webkit-gradient(linear, left top, left bottom, from(#fdfdfd), to(#e7e7e7));
- background: -moz-linear-gradient(top, #fdfdfd, #e7e7e7);
- border-radius: 2px;
- -webkit-border-radius: 2px;
- -moz-border-radius: 2px;
-}
-.LESSbutton_editpress_style {
- background: #931818;
- background: -webkit-gradient(linear, left top, left bottom, from(#931818), to(#6e1717));
- background: -moz-linear-gradient(top, #931818, #6e1717);
-}
-.LESSbutton_edit_padding {
- padding: 0.5em 0.8em;
-}
+
+
/***************************************************************************
Tickernoti
***************************************************************************/
Smallpopup
***************************************************************************/
/***************************************************************************
- No Contents
-***************************************************************************/
-/***************************************************************************
Slider
***************************************************************************/
/***************************************************************************
/***************************************************************************
multimediaview
***************************************************************************/
-.LESSmultimediaview_bar_active_style {
- background-color: #4a84c9;
- background-image: -webkit-gradient(linear, left top, left bottom, from(#6289d9), to(#295b98));
- background-image: -moz-linear-gradient(top, #6289d9, #295b98);
- background-image: -o-linear-gradient(top, #6289d9, #295b98);
- background-image: -ms-linear-gradient(top, #6289d9, #295b98);
-}
-.LESSmultimediaview_bar_handle_style {
- background-color: #f9f9f9;
- background-image: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#e6e6e6));
- background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: -ms-linear-gradient(top, #ffffff, #e6e6e6);
-}
+
+
/***************************************************************************
tokentextarea
***************************************************************************/
/***************************************************************************
+ Splitview
***************************************************************************/
.ui-virtualgrid {
overflow: hidden;
.ui-scrollbar-thumb-y {
height: 1.5rem !important;
}
+.ui-virtualgrid-overflow-indicator-x-top {
+ position: absolute;
+ display: block;
+ left: 0;
+ top: 0;
+ width: 0.4545454545454546rem;
+ height: 100%;
+ opacity: 0;
+ background: -webkit-gradient(linear, right top, left top, color-stop(0, rgba(128, 128, 128, 0)), color-stop(1, #808080));
+ pointer-events: none;
+}
+.ui-virtualgrid-overflow-indicator-x-bottom {
+ position: absolute;
+ display: block;
+ right: 0;
+ bottom: 0;
+ width: 0.4545454545454546rem;
+ height: 100%;
+ opacity: 0;
+ background: -webkit-gradient(linear, right top, left top, color-stop(0, #808080), color-stop(1, rgba(128, 128, 128, 0)));
+ pointer-events: none;
+}
+.ui-virtualgrid-overflow-indicator-y-top {
+ position: absolute;
+ display: block;
+ top: 0;
+ width: 100%;
+ height: 0.4545454545454546rem;
+ opacity: 0;
+ background: -webkit-gradient(linear, left bottom, left top, color-stop(0, rgba(128, 128, 128, 0)), color-stop(1, #808080));
+ pointer-events: none;
+}
+.ui-virtualgrid-overflow-indicator-y-bottom {
+ position: absolute;
+ display: block;
+ bottom: 0;
+ width: 100%;
+ height: 0.4545454545454546rem;
+ opacity: 0;
+ background: -webkit-gradient(linear, left bottom, left top, color-stop(0, #808080), color-stop(1, rgba(128, 128, 128, 0)));
+ pointer-events: none;
+}
+/*
+ * padding here set to zero - otherwise the list scrolls underneith the top heading and can be seen above it
+ */
+.ui-content.ui-virtualgrid-content {
+ padding: 0;
+}
/****************************
* Tizen Common Less Header *
****************************/
/***************************************************************************
Body
***************************************************************************/
+/* B011 : Main Background color */
+/* B012 : Main font color */
/***************************************************************************
Naviframe
***************************************************************************/
-/* #3b73b6 *//* title text */
+/* B042 : title text */
/* B052L4 : Title text button */
/* B052L5 : Title text button press */
/* B052L1P : Title text button press bg */
/***************************************************************************
Button(connected with other winset)
***************************************************************************/
-.LESSbutton_box_style {
- color: #363133;
-}
-.LESSbutton_up_style {
- background: #ebe8e3;
- background: -webkit-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -moz-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -o-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -ms-linear-gradient(top, #ebe8e3, #eae7e2);
-}
-.LESSbutton_box_style {
- background: #ebe8e3;
- background: -webkit-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -moz-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -o-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -ms-linear-gradient(top, #ebe8e3, #eae7e2);
- border: 1px solid;
- border-color: #dcdad3;
- -o-box-shadow: 0 0 1px 1px #ffffff;
- -ms-box-shadow: 0 0 1px 1px #ffffff;
- -moz-box-shadow: 0 0 1px 1px #ffffff;
- -webkit-box-shadow: 0 0 1px 1px #ffffff;
- box-shadow: 0 0 1px 1px #ffffff;
-}
-.LESSbutton_inner_box_style {
- background: #f7f5ee;
- background: -webkit-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -ms-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -o-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -moz-linear-gradient(top, #faf7f2, #f8f5f0);
- -o-box-shadow: none;
- -ms-box-shadow: none;
- -moz-box-shadow: none;
- -webkit-box-shadow: none;
- box-shadow: none;
-}
-.LESSbutton_inner_pressstyle {
- color: #f8f6ef;
-}
-.LESSbutton_text1_style {
- font-family: Helvetica, Arial, sans-serif;
- font-weight: normal;
- font-size: 1.0rem;
- font-style: normal;
- color: #000000;
-}
-.LESSbutton_hover_style {
- color: #363133;
-}
-.LESSbutton_down_style {
- background: #3b73b6;
- color: #f8f6ef;
-}
-.LESSbutton_edit_style {
- background: #c95858;
- background: -webkit-gradient(linear, left top, left bottom, from(#c95858), to(#a12828));
- background: -moz_linear-gradient(top, #c95858, #a12828);
-}
+
+
+
+
+
+
+
+
+
/***************************************************************************
contextual popup
***************************************************************************/
-/* #1A5274 */
/***************************************************************************
Scrollview
***************************************************************************/
Date Time picker
***************************************************************************/
/***************************************************************************
- DaySelector
-***************************************************************************/
-/* #00a8e7 */
-/* #f01402 */
-/* #f9f9f9 *//* #f9f9f9 */.LESSDayselectorButtonNormal {
- background: #7e9db2;
- background: -webkit-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -moz-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -ms-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -o-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: linear-gradient(top, #7e9db2 0%, #547990 100%);
-}
-.LESSDayaselectorButtonPress {
- background: #3b7796;
- background: -webkit-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -moz-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -ms-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -o-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: linear-gradient(top, #3b7796 0%, #2f5b75 100%);
-}
-/***************************************************************************
- OptionHeader
-***************************************************************************/
-/* #f9f9f9 */
-/***************************************************************************
SegmentControl
***************************************************************************/
-/* #F9F9F9*/
-/* #F9F9F9*/
-/***************************************************************************
- ControlGroup
-***************************************************************************/
-/* 00_divider_line.9.png */
+/* B052L4 : Title text button */
/***************************************************************************
Popup
***************************************************************************/
/* popup_title_bg.png */
/* maybe not use only popupwindow*/
-.LESSpopup_button_style {
- /* background: @color_popup_buttonbg;
- background: @color_popup_buttonbg_webkit;
- background: @color_popup_buttonbg_moz;
- background: @color_popup_buttonbg_ms;
- background: @color_popup_buttonbg_o;
- color: @color_popup_buttontext;*/
-}
-.LESSpopup_button_hover_style {
- background: #5e88a3;
-}
-.LESSpopup_button_press_style {
- background: #43a0d9;
- background: -webkit-gradient(linear, left top, left bottom, from(#43a0d9), to(#388bb9));
- background: -moz-linear-gradient(top, #43a0d9, #388bb9);
- background: -ms-linear-gradient(top, #43a0d9, #388bb9);
- background: -o-linear-gradient(top, #43a0d9, #388bb9);
-}
-/***************************************************************************
- Button
-***************************************************************************/
-.LESStoggleswitch_on_style {
- background: #2a7eac;
- background: -webkit-gradient(linear, left top, left bottom, from(#2174a7), to(#4ba5db));
- background: -moz-linear-gradient(top, #2174a7, #4ba5db);
- border-radius: 4px;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
-}
-.LESStoggleswitch_off_style {
- color: #cbcbcb;
- background: #97a1a7;
- background: -webkit-gradient(linear, left top, left bottom, from(#727272), to(#8d8d8d));
- background: -moz-linear-gradient(top, #727272, #8d8d8d);
- border-radius: 4px;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
-}
-.LESStoggleswitch_reed_style {
- background: #fdfdfd;
- background: -webkit-gradient(linear, left top, left bottom, from(#fdfdfd), to(#e7e7e7));
- background: -moz-linear-gradient(top, #fdfdfd, #e7e7e7);
- border-radius: 2px;
- -webkit-border-radius: 2px;
- -moz-border-radius: 2px;
-}
-.LESSbutton_editpress_style {
- background: #931818;
- background: -webkit-gradient(linear, left top, left bottom, from(#931818), to(#6e1717));
- background: -moz-linear-gradient(top, #931818, #6e1717);
-}
-.LESSbutton_edit_padding {
- padding: 0.5em 0.8em;
-}
+
+
/***************************************************************************
Tickernoti
***************************************************************************/
Smallpopup
***************************************************************************/
/***************************************************************************
- No Contents
-***************************************************************************/
-/***************************************************************************
Slider
***************************************************************************/
/***************************************************************************
/***************************************************************************
multimediaview
***************************************************************************/
-.LESSmultimediaview_bar_active_style {
- background-color: #4a84c9;
- background-image: -webkit-gradient(linear, left top, left bottom, from(#6289d9), to(#295b98));
- background-image: -moz-linear-gradient(top, #6289d9, #295b98);
- background-image: -o-linear-gradient(top, #6289d9, #295b98);
- background-image: -ms-linear-gradient(top, #6289d9, #295b98);
-}
-.LESSmultimediaview_bar_handle_style {
- background-color: #f9f9f9;
- background-image: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#e6e6e6));
- background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: -ms-linear-gradient(top, #ffffff, #e6e6e6);
-}
+
+
/***************************************************************************
tokentextarea
***************************************************************************/
/***************************************************************************
+ Splitview
***************************************************************************/
.ui-multimediaview {
background-color: #f9f9f9;
overflow: hidden;
}
.ui-multimediaview-wrap {
- position: relative;
width: 100%;
- margin-top: 0.7272727272727273rem;
- margin-bottom: 0.7272727272727273rem;
padding: 0;
- border: 0;
+ position: relative;
}
.ui-multimediaview-fullscreen {
position: absolute !important;
- z-index: 1100 !important;
+ z-index: 1001;
+}
+.ui-multimediaview-siblings-off {
+ display: none !important;
}
.ui-multimediaview-control span {
display: inline-block;
}
+.ui-multimediaview-video {
+ position: absolute;
+}
.ui-multimediaview-control {
- position: relative;
display: block;
- z-index: 1101 !important;
+ z-index: 1002;
padding: 0;
margin: 0;
outline: 0;
border: 0;
height: 1.9090909090909092rem;
+ text-align: left;
+ overflow: hidden;
}
.ui-multimediaview-control span.ui-button {
background-position: center center;
line-height: 0.6363636363636364rem;
text-align: right;
}
-.ui-multimediaview-control .ui-seekbar {
- margin-top: 0.26136363636363635rem;
- padding-left: 0.09090909090909091rem;
- padding-right: 0.09090909090909091rem;
- height: 0.36363636363636365rem;
+.ui-multimediaview-bar {
+ margin-top: 0.22272727272727275rem;
float: left;
}
-.ui-multimediaview-control .ui-seekbar .ui-duration {
- margin: 0;
- padding: 0;
- width: 100%;
+.ui-multimediaview-bar-bg {
height: 0.36363636363636365rem;
border-radius: 1.5em;
}
-.ui-multimediaview-control .ui-seekbar .ui-currenttime {
- margin: 0;
- padding: 0;
+.ui-multimediaview-bar-highlight {
height: 0.36363636363636365rem;
position: absolute;
border-radius: 1.5em;
}
+.ui-multimediaview-control .ui-seekbar {
+ margin-left: 0.09090909090909091rem;
+}
+.ui-multimediaview-control .ui-seekbar .ui-duration {
+ width: 100%;
+}
.ui-multimediaview-control .ui-volumecontrol {
width: 5rem;
height: 100%;
float: left;
}
.ui-multimediaview-control .ui-volumecontrol .ui-volumebar {
- height: 100%;
- padding-top: 0.7954545454545455rem;
- padding-left: 0.9090909090909092rem;
- display: block;
+ margin-left: 0.6818181818181819rem;
}
.ui-multimediaview-control .ui-volumecontrol .ui-volumebar .ui-guide {
- width: 3.6363636363636367rem;
- height: 0.36363636363636365rem;
- position: absolute;
- border-radius: 1.5em;
-}
-.ui-multimediaview-control .ui-volumecontrol .ui-volumebar .ui-value {
- margin: 0;
- padding: 0;
- height: 0.36363636363636365rem;
- position: absolute;
- border-radius: 1.5em;
+ width: 3.8636363636363638rem;
}
-.ui-multimediaview-control .ui-volumecontrol .ui-volumebar .ui-handler {
+.ui-multimediaview-control .ui-volumecontrol .ui-volumebar .ui-handle {
margin: 0;
padding: 0;
width: 0.6818181818181819rem;
height: 0.6818181818181819rem;
- position: absolute;
border-style: solid;
border-width: 1px;
border-radius: 1.5em;
}
-.ui-fullscreen-page {
+.ui-fullscreen-parents {
padding: 0 !important;
+ margin: 0 !important;
+ width: 100% !important;
+ height: 100% !important;
}
/* S
-----------------------------------------------------------------------------------------------------------*/
background-image: -o-linear-gradient(top, #6289d9, #295b98);
background-image: -ms-linear-gradient(top, #6289d9, #295b98);
}
-.ui-multimediaview-s .ui-volumebar .ui-handler {
+.ui-multimediaview-s .ui-volumebar .ui-handle {
background-color: #f9f9f9;
background-image: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#e6e6e6));
background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
/***************************************************************************
Body
***************************************************************************/
+/* B011 : Main Background color */
+/* B012 : Main font color */
/***************************************************************************
Naviframe
***************************************************************************/
-/* #3b73b6 *//* title text */
+/* B042 : title text */
/* B052L4 : Title text button */
/* B052L5 : Title text button press */
/* B052L1P : Title text button press bg */
/***************************************************************************
Button(connected with other winset)
***************************************************************************/
-.LESSbutton_box_style {
- color: #363133;
-}
-.LESSbutton_up_style {
- background: #ebe8e3;
- background: -webkit-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -moz-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -o-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -ms-linear-gradient(top, #ebe8e3, #eae7e2);
-}
-.LESSbutton_box_style {
- background: #ebe8e3;
- background: -webkit-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -moz-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -o-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -ms-linear-gradient(top, #ebe8e3, #eae7e2);
- border: 1px solid;
- border-color: #dcdad3;
- -o-box-shadow: 0 0 1px 1px #ffffff;
- -ms-box-shadow: 0 0 1px 1px #ffffff;
- -moz-box-shadow: 0 0 1px 1px #ffffff;
- -webkit-box-shadow: 0 0 1px 1px #ffffff;
- box-shadow: 0 0 1px 1px #ffffff;
-}
-.LESSbutton_inner_box_style {
- background: #f7f5ee;
- background: -webkit-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -ms-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -o-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -moz-linear-gradient(top, #faf7f2, #f8f5f0);
- -o-box-shadow: none;
- -ms-box-shadow: none;
- -moz-box-shadow: none;
- -webkit-box-shadow: none;
- box-shadow: none;
-}
-.LESSbutton_inner_pressstyle {
- color: #f8f6ef;
-}
-.LESSbutton_text1_style {
- font-family: Helvetica, Arial, sans-serif;
- font-weight: normal;
- font-size: 1.0rem;
- font-style: normal;
- color: #000000;
-}
-.LESSbutton_hover_style {
- color: #363133;
-}
-.LESSbutton_down_style {
- background: #3b73b6;
- color: #f8f6ef;
-}
-.LESSbutton_edit_style {
- background: #c95858;
- background: -webkit-gradient(linear, left top, left bottom, from(#c95858), to(#a12828));
- background: -moz_linear-gradient(top, #c95858, #a12828);
-}
+
+
+
+
+
+
+
+
+
/***************************************************************************
contextual popup
***************************************************************************/
-/* #1A5274 */
-/***************************************************************************
- Scrollview
-***************************************************************************/
-/***************************************************************************
- Date Time picker
-***************************************************************************/
/***************************************************************************
- DaySelector
+ Scrollview
***************************************************************************/
-/* #00a8e7 */
-/* #f01402 */
-/* #f9f9f9 *//* #f9f9f9 */.LESSDayselectorButtonNormal {
- background: #7e9db2;
- background: -webkit-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -moz-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -ms-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -o-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: linear-gradient(top, #7e9db2 0%, #547990 100%);
-}
-.LESSDayaselectorButtonPress {
- background: #3b7796;
- background: -webkit-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -moz-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -ms-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -o-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: linear-gradient(top, #3b7796 0%, #2f5b75 100%);
-}
/***************************************************************************
- OptionHeader
+ Date Time picker
***************************************************************************/
-/* #f9f9f9 */
/***************************************************************************
SegmentControl
***************************************************************************/
-/* #F9F9F9*/
-/* #F9F9F9*/
-/***************************************************************************
- ControlGroup
-***************************************************************************/
-/* 00_divider_line.9.png */
+/* B052L4 : Title text button */
/***************************************************************************
Popup
***************************************************************************/
/* popup_title_bg.png */
/* maybe not use only popupwindow*/
-.LESSpopup_button_style {
- /* background: @color_popup_buttonbg;
- background: @color_popup_buttonbg_webkit;
- background: @color_popup_buttonbg_moz;
- background: @color_popup_buttonbg_ms;
- background: @color_popup_buttonbg_o;
- color: @color_popup_buttontext;*/
-}
-.LESSpopup_button_hover_style {
- background: #5e88a3;
-}
-.LESSpopup_button_press_style {
- background: #43a0d9;
- background: -webkit-gradient(linear, left top, left bottom, from(#43a0d9), to(#388bb9));
- background: -moz-linear-gradient(top, #43a0d9, #388bb9);
- background: -ms-linear-gradient(top, #43a0d9, #388bb9);
- background: -o-linear-gradient(top, #43a0d9, #388bb9);
-}
-/***************************************************************************
- Button
-***************************************************************************/
-.LESStoggleswitch_on_style {
- background: #2a7eac;
- background: -webkit-gradient(linear, left top, left bottom, from(#2174a7), to(#4ba5db));
- background: -moz-linear-gradient(top, #2174a7, #4ba5db);
- border-radius: 4px;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
-}
-.LESStoggleswitch_off_style {
- color: #cbcbcb;
- background: #97a1a7;
- background: -webkit-gradient(linear, left top, left bottom, from(#727272), to(#8d8d8d));
- background: -moz-linear-gradient(top, #727272, #8d8d8d);
- border-radius: 4px;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
-}
-.LESStoggleswitch_reed_style {
- background: #fdfdfd;
- background: -webkit-gradient(linear, left top, left bottom, from(#fdfdfd), to(#e7e7e7));
- background: -moz-linear-gradient(top, #fdfdfd, #e7e7e7);
- border-radius: 2px;
- -webkit-border-radius: 2px;
- -moz-border-radius: 2px;
-}
-.LESSbutton_editpress_style {
- background: #931818;
- background: -webkit-gradient(linear, left top, left bottom, from(#931818), to(#6e1717));
- background: -moz-linear-gradient(top, #931818, #6e1717);
-}
-.LESSbutton_edit_padding {
- padding: 0.5em 0.8em;
-}
+
+
/***************************************************************************
Tickernoti
***************************************************************************/
Smallpopup
***************************************************************************/
/***************************************************************************
- No Contents
-***************************************************************************/
-/***************************************************************************
Slider
***************************************************************************/
/***************************************************************************
/***************************************************************************
multimediaview
***************************************************************************/
-.LESSmultimediaview_bar_active_style {
- background-color: #4a84c9;
- background-image: -webkit-gradient(linear, left top, left bottom, from(#6289d9), to(#295b98));
- background-image: -moz-linear-gradient(top, #6289d9, #295b98);
- background-image: -o-linear-gradient(top, #6289d9, #295b98);
- background-image: -ms-linear-gradient(top, #6289d9, #295b98);
-}
-.LESSmultimediaview_bar_handle_style {
- background-color: #f9f9f9;
- background-image: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#e6e6e6));
- background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: -ms-linear-gradient(top, #ffffff, #e6e6e6);
-}
+
+
/***************************************************************************
tokentextarea
***************************************************************************/
/***************************************************************************
+ Splitview
***************************************************************************/
.ui-popup-screen {
background: #000000;
height: 100%;
z-index: 1200;
}
+.ui-overlay-dim {
+ opacity: 0.7;
+}
.ui-popup-scroller-bg {
width: 100%;
}
padding: 3px 2px 2px 2px;
background: #f8f6ef;
width: 100%;
+ word-wrap: break-word;
}
-.ui-popup-container .ui-popup > .ui-popup-title, .ui-popup-container .ui-popup > .ui-popup-text, .ui-popup-container .ui-popup > .ui-popup-button-bg {
+.ui-popup-container .ui-popup > .ui-popup-title,
+.ui-popup-container .ui-popup > .ui-popup-text,
+.ui-popup-container .ui-popup > .ui-popup-button-bg {
width: 100%;
}
.ui-popup-container .ui-popup-title {
.ui-popup-container .ui-popup-text {
margin-top: 1rem;
margin-bottom: 1rem;
- color: black;
+ color: #000000;
font-size: 0.9090909090909092rem;
background: #f8f6ef;
text-align: center;
}
-.ui-popup-container .ui-popup-text .ui-li .ui-radio label, .ui-popup-container .ui-popup-text .ui-li .ui-checkbox label {
+.ui-popup-container .ui-popup-text .ui-li .ui-radio label,
+.ui-popup-container .ui-popup-text .ui-li .ui-checkbox label {
background: transparent;
}
+.ui-popup-container .ui-popup-text input {
+ display: inline-block;
+}
.ui-popup-container .ui-popup-button-bg {
font-size: 1.4545454545454546rem;
height: 1.6818181818181819rem;
padding-left: 0.9090909090909092rem;
padding-right: 0.9090909090909092rem;
}
-.ui-popup-container .center_basic_3btn .ui-btn, .ui-popup-container .center_title_3btn .ui-btn {
+.ui-popup-container .center_basic_3btn .ui-btn,
+.ui-popup-container .center_title_3btn .ui-btn {
max-width: 3.6363636363636367rem;
height: 1.6818181818181819rem;
margin-top: 0rem;
vertical-align: middle;
}
.ui-popup-container .center_checkbox .ui-popup-button-bg .ui-btn {
- width: 5.909090909090909rem;
+ width: 5rem;
height: 1.6818181818181819rem;
margin-top: 0rem;
margin-bottom: 0rem;
vertical-align: middle;
}
.ui-popup-container .center_liststyle_2btn .ui-popup-button-bg .ui-btn {
- width: 5.909090909090909rem;
+ width: 5rem;
height: 1.6818181818181819rem;
margin-top: 0rem;
margin-bottom: 0rem;
padding-left: 0.9090909090909092rem;
padding-right: 0.9090909090909092rem;
}
+.ui-popup-container .center_title_2btn .ui-popup-button-bg {
+ padding-top: 0.5rem;
+ padding-bottom: 0.5rem;
+ vertical-align: middle;
+}
.ui-popup-container .center_title_2btn .ui-popup-button-bg .ui-btn {
- width: 5.909090909090909rem;
+ width: 5.454545454545455rem;
+ height: 1.6818181818181819rem;
+ margin-top: 0rem;
+ margin-bottom: 0rem;
+ margin-left: 0.2272727272727273rem;
+ margin-right: 0.2272727272727273rem;
+ display: inline-block;
+}
+.ui-popup-container .center_title_2btn .ui-popup-button-bg .ui-btn .ui-btn-inner {
+ padding-top: 0.2272727272727273rem;
+ padding-bottom: 0.2272727272727273rem;
+ padding-left: 0.9090909090909092rem;
+ padding-right: 0.9090909090909092rem;
}
.ui-popup-container .center_liststyle_3btn .ui-popup-scroller-bg {
width: 100%;
/***************************************************************************
Body
***************************************************************************/
+/* B011 : Main Background color */
+/* B012 : Main font color */
/***************************************************************************
Naviframe
***************************************************************************/
-/* #3b73b6 *//* title text */
+/* B042 : title text */
/* B052L4 : Title text button */
/* B052L5 : Title text button press */
/* B052L1P : Title text button press bg */
/***************************************************************************
Button(connected with other winset)
***************************************************************************/
-.LESSbutton_box_style {
- color: #363133;
-}
-.LESSbutton_up_style {
- background: #ebe8e3;
- background: -webkit-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -moz-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -o-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -ms-linear-gradient(top, #ebe8e3, #eae7e2);
-}
-.LESSbutton_box_style {
- background: #ebe8e3;
- background: -webkit-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -moz-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -o-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -ms-linear-gradient(top, #ebe8e3, #eae7e2);
- border: 1px solid;
- border-color: #dcdad3;
- -o-box-shadow: 0 0 1px 1px #ffffff;
- -ms-box-shadow: 0 0 1px 1px #ffffff;
- -moz-box-shadow: 0 0 1px 1px #ffffff;
- -webkit-box-shadow: 0 0 1px 1px #ffffff;
- box-shadow: 0 0 1px 1px #ffffff;
-}
-.LESSbutton_inner_box_style {
- background: #f7f5ee;
- background: -webkit-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -ms-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -o-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -moz-linear-gradient(top, #faf7f2, #f8f5f0);
- -o-box-shadow: none;
- -ms-box-shadow: none;
- -moz-box-shadow: none;
- -webkit-box-shadow: none;
- box-shadow: none;
-}
-.LESSbutton_inner_pressstyle {
- color: #f8f6ef;
-}
-.LESSbutton_text1_style {
- font-family: Helvetica, Arial, sans-serif;
- font-weight: normal;
- font-size: 1.0rem;
- font-style: normal;
- color: #000000;
-}
-.LESSbutton_hover_style {
- color: #363133;
-}
-.LESSbutton_down_style {
- background: #3b73b6;
- color: #f8f6ef;
-}
-.LESSbutton_edit_style {
- background: #c95858;
- background: -webkit-gradient(linear, left top, left bottom, from(#c95858), to(#a12828));
- background: -moz_linear-gradient(top, #c95858, #a12828);
-}
+
+
+
+
+
+
+
+
+
/***************************************************************************
contextual popup
***************************************************************************/
-/* #1A5274 */
/***************************************************************************
Scrollview
***************************************************************************/
Date Time picker
***************************************************************************/
/***************************************************************************
- DaySelector
-***************************************************************************/
-/* #00a8e7 */
-/* #f01402 */
-/* #f9f9f9 *//* #f9f9f9 */.LESSDayselectorButtonNormal {
- background: #7e9db2;
- background: -webkit-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -moz-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -ms-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -o-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: linear-gradient(top, #7e9db2 0%, #547990 100%);
-}
-.LESSDayaselectorButtonPress {
- background: #3b7796;
- background: -webkit-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -moz-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -ms-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -o-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: linear-gradient(top, #3b7796 0%, #2f5b75 100%);
-}
-/***************************************************************************
- OptionHeader
-***************************************************************************/
-/* #f9f9f9 */
-/***************************************************************************
SegmentControl
***************************************************************************/
-/* #F9F9F9*/
-/* #F9F9F9*/
-/***************************************************************************
- ControlGroup
-***************************************************************************/
-/* 00_divider_line.9.png */
+/* B052L4 : Title text button */
/***************************************************************************
Popup
***************************************************************************/
/* popup_title_bg.png */
/* maybe not use only popupwindow*/
-.LESSpopup_button_style {
- /* background: @color_popup_buttonbg;
- background: @color_popup_buttonbg_webkit;
- background: @color_popup_buttonbg_moz;
- background: @color_popup_buttonbg_ms;
- background: @color_popup_buttonbg_o;
- color: @color_popup_buttontext;*/
-}
-.LESSpopup_button_hover_style {
- background: #5e88a3;
-}
-.LESSpopup_button_press_style {
- background: #43a0d9;
- background: -webkit-gradient(linear, left top, left bottom, from(#43a0d9), to(#388bb9));
- background: -moz-linear-gradient(top, #43a0d9, #388bb9);
- background: -ms-linear-gradient(top, #43a0d9, #388bb9);
- background: -o-linear-gradient(top, #43a0d9, #388bb9);
-}
-/***************************************************************************
- Button
-***************************************************************************/
-.LESStoggleswitch_on_style {
- background: #2a7eac;
- background: -webkit-gradient(linear, left top, left bottom, from(#2174a7), to(#4ba5db));
- background: -moz-linear-gradient(top, #2174a7, #4ba5db);
- border-radius: 4px;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
-}
-.LESStoggleswitch_off_style {
- color: #cbcbcb;
- background: #97a1a7;
- background: -webkit-gradient(linear, left top, left bottom, from(#727272), to(#8d8d8d));
- background: -moz-linear-gradient(top, #727272, #8d8d8d);
- border-radius: 4px;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
-}
-.LESStoggleswitch_reed_style {
- background: #fdfdfd;
- background: -webkit-gradient(linear, left top, left bottom, from(#fdfdfd), to(#e7e7e7));
- background: -moz-linear-gradient(top, #fdfdfd, #e7e7e7);
- border-radius: 2px;
- -webkit-border-radius: 2px;
- -moz-border-radius: 2px;
-}
-.LESSbutton_editpress_style {
- background: #931818;
- background: -webkit-gradient(linear, left top, left bottom, from(#931818), to(#6e1717));
- background: -moz-linear-gradient(top, #931818, #6e1717);
-}
-.LESSbutton_edit_padding {
- padding: 0.5em 0.8em;
-}
+
+
/***************************************************************************
Tickernoti
***************************************************************************/
Smallpopup
***************************************************************************/
/***************************************************************************
- No Contents
-***************************************************************************/
-/***************************************************************************
Slider
***************************************************************************/
/***************************************************************************
/***************************************************************************
multimediaview
***************************************************************************/
-.LESSmultimediaview_bar_active_style {
- background-color: #4a84c9;
- background-image: -webkit-gradient(linear, left top, left bottom, from(#6289d9), to(#295b98));
- background-image: -moz-linear-gradient(top, #6289d9, #295b98);
- background-image: -o-linear-gradient(top, #6289d9, #295b98);
- background-image: -ms-linear-gradient(top, #6289d9, #295b98);
-}
-.LESSmultimediaview_bar_handle_style {
- background-color: #f9f9f9;
- background-image: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#e6e6e6));
- background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: -ms-linear-gradient(top, #ffffff, #e6e6e6);
-}
+
+
/***************************************************************************
tokentextarea
***************************************************************************/
/***************************************************************************
+ Splitview
***************************************************************************/
/* text-ellipsis
* elements using this class needs following constraints;
******************************/
/******************************
Global LESS mixin collection
- ******************************/
-/***************************************************************************
- Body
-***************************************************************************/
-/***************************************************************************
- Naviframe
-***************************************************************************/
-/* #3b73b6 *//* title text */
-/* B052L4 : Title text button */
-/* B052L5 : Title text button press */
-/* B052L1P : Title text button press bg */
-/* 00_divider_line.9.png */
-/***************************************************************************
- Tabbar
-***************************************************************************/
-/* B0514P1 : 00_tab_press_ef.9.png */
-/* B052L6P */
-/* B052L6 */
-/***************************************************************************
- List
-***************************************************************************/
-/* B0211 */
-/* B041 */
-/* B0221 */
-/* W021L1 */
-/* W021L2 */
-/***************************************************************************
- Shortcut Scroll
-***************************************************************************/
-/* B0723 : 00_fast_scroll_rollover_bg.9.png */
-/* B0721 : Rollover text */
-/* B0731 : 00_fast_scroll_popup_bg.png */
-/* B0732 : Scroll popup text */
-/***************************************************************************
- SearchBar(forms.textinput)
-***************************************************************************/
-/* Search default text */
-/* W301 : 00_search_edit_field_bg.png */
-/***************************************************************************
- Popup
-***************************************************************************/
-/* B061L1 : Popop info */
-/***************************************************************************
- Button(connected with other winset)
-***************************************************************************/
-.LESSbutton_box_style {
- color: #363133;
-}
-.LESSbutton_up_style {
- background: #ebe8e3;
- background: -webkit-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -moz-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -o-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -ms-linear-gradient(top, #ebe8e3, #eae7e2);
-}
-.LESSbutton_box_style {
- background: #ebe8e3;
- background: -webkit-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -moz-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -o-linear-gradient(top, #ebe8e3, #eae7e2);
- background: -ms-linear-gradient(top, #ebe8e3, #eae7e2);
- border: 1px solid;
- border-color: #dcdad3;
- -o-box-shadow: 0 0 1px 1px #ffffff;
- -ms-box-shadow: 0 0 1px 1px #ffffff;
- -moz-box-shadow: 0 0 1px 1px #ffffff;
- -webkit-box-shadow: 0 0 1px 1px #ffffff;
- box-shadow: 0 0 1px 1px #ffffff;
-}
-.LESSbutton_inner_box_style {
- background: #f7f5ee;
- background: -webkit-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -ms-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -o-linear-gradient(top, #faf7f2, #f8f5f0);
- background: -moz-linear-gradient(top, #faf7f2, #f8f5f0);
- -o-box-shadow: none;
- -ms-box-shadow: none;
- -moz-box-shadow: none;
- -webkit-box-shadow: none;
- box-shadow: none;
-}
-.LESSbutton_inner_pressstyle {
- color: #f8f6ef;
-}
-.LESSbutton_text1_style {
- font-family: Helvetica, Arial, sans-serif;
- font-weight: normal;
- font-size: 1.0rem;
- font-style: normal;
- color: #000000;
-}
-.LESSbutton_hover_style {
- color: #363133;
-}
-.LESSbutton_down_style {
- background: #3b73b6;
- color: #f8f6ef;
-}
-.LESSbutton_edit_style {
- background: #c95858;
- background: -webkit-gradient(linear, left top, left bottom, from(#c95858), to(#a12828));
- background: -moz_linear-gradient(top, #c95858, #a12828);
-}
+ ******************************/
/***************************************************************************
- contextual popup
+ Body
***************************************************************************/
-/* #1A5274 */
+/* B011 : Main Background color */
+/* B012 : Main font color */
/***************************************************************************
- Scrollview
+ Naviframe
***************************************************************************/
+/* B042 : title text */
+/* B052L4 : Title text button */
+/* B052L5 : Title text button press */
+/* B052L1P : Title text button press bg */
+/* 00_divider_line.9.png */
/***************************************************************************
- Date Time picker
+ Tabbar
***************************************************************************/
+/* B0514P1 : 00_tab_press_ef.9.png */
+/* B052L6P */
+/* B052L6 */
/***************************************************************************
- DaySelector
+ List
***************************************************************************/
-/* #00a8e7 */
-/* #f01402 */
-/* #f9f9f9 *//* #f9f9f9 */.LESSDayselectorButtonNormal {
- background: #7e9db2;
- background: -webkit-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -moz-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -ms-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: -o-linear-gradient(top, #7e9db2 0%, #547990 100%);
- background: linear-gradient(top, #7e9db2 0%, #547990 100%);
-}
-.LESSDayaselectorButtonPress {
- background: #3b7796;
- background: -webkit-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -moz-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -ms-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: -o-linear-gradient(top, #3b7796 0%, #2f5b75 100%);
- background: linear-gradient(top, #3b7796 0%, #2f5b75 100%);
-}
+/* B0211 */
+/* B041 */
+/* B0221 */
+/* W021L1 */
+/* W021L2 */
/***************************************************************************
- OptionHeader
+ Shortcut Scroll
***************************************************************************/
-/* #f9f9f9 */
+/* B0723 : 00_fast_scroll_rollover_bg.9.png */
+/* B0721 : Rollover text */
+/* B0731 : 00_fast_scroll_popup_bg.png */
+/* B0732 : Scroll popup text */
/***************************************************************************
- SegmentControl
+ SearchBar(forms.textinput)
+***************************************************************************/
+/* Search default text */
+/* W301 : 00_search_edit_field_bg.png */
+/***************************************************************************
+ Popup
***************************************************************************/
-/* #F9F9F9*/
-/* #F9F9F9*/
+/* B061L1 : Popop info */
/***************************************************************************
- ControlGroup
+ Button(connected with other winset)
***************************************************************************/
-/* 00_divider_line.9.png */
+
+
+
+
+
+
+
+
+
+/***************************************************************************
+ contextual popup
+***************************************************************************/
+/***************************************************************************
+ Scrollview
+***************************************************************************/
+/***************************************************************************
+ Date Time picker
+***************************************************************************/
+/***************************************************************************
+ SegmentControl
+***************************************************************************/
+/* B052L4 : Title text button */
/***************************************************************************
Popup
***************************************************************************/
/* popup_title_bg.png */
/* maybe not use only popupwindow*/
-.LESSpopup_button_style {
- /* background: @color_popup_buttonbg;
- background: @color_popup_buttonbg_webkit;
- background: @color_popup_buttonbg_moz;
- background: @color_popup_buttonbg_ms;
- background: @color_popup_buttonbg_o;
- color: @color_popup_buttontext;*/
-}
-.LESSpopup_button_hover_style {
- background: #5e88a3;
-}
-.LESSpopup_button_press_style {
- background: #43a0d9;
- background: -webkit-gradient(linear, left top, left bottom, from(#43a0d9), to(#388bb9));
- background: -moz-linear-gradient(top, #43a0d9, #388bb9);
- background: -ms-linear-gradient(top, #43a0d9, #388bb9);
- background: -o-linear-gradient(top, #43a0d9, #388bb9);
-}
-/***************************************************************************
- Button
-***************************************************************************/
-.LESStoggleswitch_on_style {
- background: #2a7eac;
- background: -webkit-gradient(linear, left top, left bottom, from(#2174a7), to(#4ba5db));
- background: -moz-linear-gradient(top, #2174a7, #4ba5db);
- border-radius: 4px;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
-}
-.LESStoggleswitch_off_style {
- color: #cbcbcb;
- background: #97a1a7;
- background: -webkit-gradient(linear, left top, left bottom, from(#727272), to(#8d8d8d));
- background: -moz-linear-gradient(top, #727272, #8d8d8d);
- border-radius: 4px;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
-}
-.LESStoggleswitch_reed_style {
- background: #fdfdfd;
- background: -webkit-gradient(linear, left top, left bottom, from(#fdfdfd), to(#e7e7e7));
- background: -moz-linear-gradient(top, #fdfdfd, #e7e7e7);
- border-radius: 2px;
- -webkit-border-radius: 2px;
- -moz-border-radius: 2px;
-}
-.LESSbutton_editpress_style {
- background: #931818;
- background: -webkit-gradient(linear, left top, left bottom, from(#931818), to(#6e1717));
- background: -moz-linear-gradient(top, #931818, #6e1717);
-}
-.LESSbutton_edit_padding {
- padding: 0.5em 0.8em;
-}
+
+
/***************************************************************************
Tickernoti
***************************************************************************/
Smallpopup
***************************************************************************/
/***************************************************************************
- No Contents
-***************************************************************************/
-/***************************************************************************
Slider
***************************************************************************/
/***************************************************************************
/***************************************************************************
multimediaview
***************************************************************************/
-.LESSmultimediaview_bar_active_style {
- background-color: #4a84c9;
- background-image: -webkit-gradient(linear, left top, left bottom, from(#6289d9), to(#295b98));
- background-image: -moz-linear-gradient(top, #6289d9, #295b98);
- background-image: -o-linear-gradient(top, #6289d9, #295b98);
- background-image: -ms-linear-gradient(top, #6289d9, #295b98);
-}
-.LESSmultimediaview_bar_handle_style {
- background-color: #f9f9f9;
- background-image: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#e6e6e6));
- background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
- background-image: -ms-linear-gradient(top, #ffffff, #e6e6e6);
-}
+
+
/***************************************************************************
tokentextarea
***************************************************************************/
/***************************************************************************
+ Splitview
***************************************************************************/
/***************************************************************************
Tabbar
background: #f8f6ef;
z-index: 1000;
}
-.ui-tabbar.ui-portrait-tabbar {
- /* portrait style */
-}
-.ui-tabbar.ui-landscape-tabbar {
- /* landscape style */
-}
.ui-tabbar a.ui-btn {
background: #f8f6ef;
color: #999999;
.ui-tabbar.ui-tabbar-persist a.ui-btn {
background: #f8f6ef;
}
-.ui-tabbar.ui-tabbar-persist a.ui-state-persist, .ui-tabbar.ui-tabbar-persist a.ui-state-persist.ui-btn-active, .ui-tabbar.ui-tabbar-persist a.ui-btn-show-style {
+.ui-tabbar.ui-tabbar-persist a.ui-state-persist,
+.ui-tabbar.ui-tabbar-persist a.ui-state-persist.ui-btn-active,
+.ui-tabbar.ui-tabbar-persist a.ui-btn-show-style {
color: #3b73b6;
}
.ui-tabbar.ui-tabbar-persist a.ui-btn-hover-s.ui-btn-down-s:not(.ui-state-persist) {
.ui-tabbar:not(.ui-tabbar-persist) a.ui-btn {
background: #f8f6ef;
}
-.ui-tabbar:not(.ui-tabbar-persist) a.ui-btn-active, .ui-tabbar:not(.ui-tabbar-persist) .ui-btn-show-style {
+.ui-tabbar:not(.ui-tabbar-persist) a.ui-btn-active,
+.ui-tabbar:not(.ui-tabbar-persist) .ui-btn-show-style {
color: #3b73b6;
}
.ui-tabbar:not(.ui-tabbar-persist) a.ui-btn.ui-btn-hover-s.ui-btn-down-s {
padding-top: 0.3181818181818182rem;
padding-bottom: 0.2272727272727273rem;
}
-.ui-header.ui-bar-s.ui-title-tabbar .ui-tabbar.ui-portrait-tabbar {
- /* portrait style */
-}
-.ui-header.ui-bar-s.ui-title-tabbar .ui-tabbar.ui-landscape-tabbar {
- /* landscape style */
-}
.ui-header.ui-bar-s.ui-title-tabbar-multiline .ui-tabbar a.ui-btn {
padding-top: 0.5rem;
padding-bottom: 0.4545454545454546rem;
left: 0px;
border-top-right-radius: 0.4545454545454546rem;
border-bottom-right-radius: 0.4545454545454546rem;
- background: -webkit-linear-gradient(left, #00009b 0%, #f6f8ef 100%);
+ background: -webkit-linear-gradient(left, #999999 0%, #f6f8ef 100%);
}
.ui-tabbar-divider-right {
right: 0px;
border-top-left-radius: 0.4545454545454546rem;
border-bottom-left-radius: 0.4545454545454546rem;
- background: -webkit-linear-gradient(right, #00009b 0%, #f6f8ef 100%);
+ background: -webkit-linear-gradient(right, #999999 0%, #f6f8ef 100%);
+}
+/****************************
+ * Tizen Common Less Header *
+ ****************************/
+/*
+ * Common definition for theme
+ * 'config.less' in each theme must include this file.
+ */
+/******************************
+ z-index order collection
+ ******************************/
+/******************************
+ Global LESS mixin collection
+ ******************************/
+/***************************************************************************
+ Body
+***************************************************************************/
+/* B011 : Main Background color */
+/* B012 : Main font color */
+/***************************************************************************
+ Naviframe
+***************************************************************************/
+/* B042 : title text */
+/* B052L4 : Title text button */
+/* B052L5 : Title text button press */
+/* B052L1P : Title text button press bg */
+/* 00_divider_line.9.png */
+/***************************************************************************
+ Tabbar
+***************************************************************************/
+/* B0514P1 : 00_tab_press_ef.9.png */
+/* B052L6P */
+/* B052L6 */
+/***************************************************************************
+ List
+***************************************************************************/
+/* B0211 */
+/* B041 */
+/* B0221 */
+/* W021L1 */
+/* W021L2 */
+/***************************************************************************
+ Shortcut Scroll
+***************************************************************************/
+/* B0723 : 00_fast_scroll_rollover_bg.9.png */
+/* B0721 : Rollover text */
+/* B0731 : 00_fast_scroll_popup_bg.png */
+/* B0732 : Scroll popup text */
+/***************************************************************************
+ SearchBar(forms.textinput)
+***************************************************************************/
+/* Search default text */
+/* W301 : 00_search_edit_field_bg.png */
+/***************************************************************************
+ Popup
+***************************************************************************/
+/* B061L1 : Popop info */
+/***************************************************************************
+ Button(connected with other winset)
+***************************************************************************/
+
+
+
+
+
+
+
+
+
+/***************************************************************************
+ contextual popup
+***************************************************************************/
+/***************************************************************************
+ Scrollview
+***************************************************************************/
+/***************************************************************************
+ Date Time picker
+***************************************************************************/
+/***************************************************************************
+ SegmentControl
+***************************************************************************/
+/* B052L4 : Title text button */
+/***************************************************************************
+ Popup
+***************************************************************************/
+/* popup_title_bg.png */
+/* maybe not use only popupwindow*/
+
+
+
+/***************************************************************************
+ Tickernoti
+***************************************************************************/
+/***************************************************************************
+ Smallpopup
+***************************************************************************/
+/***************************************************************************
+ Slider
+***************************************************************************/
+/***************************************************************************
+ Progress
+***************************************************************************/
+/***************************************************************************
+ Handler
+***************************************************************************/
+/***************************************************************************
+ multimediaview
+***************************************************************************/
+
+
+/***************************************************************************
+ tokentextarea
+***************************************************************************/
+/***************************************************************************
+ Splitview
+***************************************************************************/
+.ui-splitview {
+ margin: 0;
+ padding: 0;
+ position: relative;
+}
+.ui-splitview .ui-pane {
+ position: absolute;
+ overflow: hidden;
+ border: 0;
+ margin: 0;
+ padding: 0;
+}
+.ui-splitview .ui-pane .ui-listview {
+ margin: 0;
+ padding: 0;
+}
+.ui-splitview .ui-spliter {
+ position: absolute;
+ z-index: 100;
+ display: block;
+ margin: 0;
+ padding: 0;
+}
+.ui-splitview .ui-spliter-bar {
+ background-color: #b3b3b3;
+ border-color: black;
+ border-style: solid;
+}
+.ui-splitview .ui-spliter-handle {
+ margin: 0;
+ padding: 0;
+ cursor: move;
+ display: block;
+ text-align: center;
+ cursor: pointer;
+ position: relative;
+ background-position: center center;
+ background-repeat: no-repeat;
+ background-size: 100% 100%;
+}
+.ui-direction-horizontal > .ui-spliter {
+ width: 60px;
+}
+.ui-direction-vertical > .ui-spliter {
+ height: 60px;
+}
+.ui-direction-horizontal > .ui-spliter > .ui-spliter-bar {
+ width: 13px;
+ margin: 0 0 0 25px;
+ border-width: 1px 1px 1px 0;
+}
+.ui-direction-vertical > .ui-spliter > .ui-spliter-bar {
+ height: 13px;
+ margin: 25px 0 0 0;
+ border-width: 0 1px 1px 1px;
+}
+.ui-spliter-active > .ui-spliter-bar {
+ background-color: #5787c2;
+}
+.ui-direction-horizontal > .ui-spliter > .ui-spliter-bar > .ui-spliter-handle {
+ width: 13px;
+ height: 26px;
+ background-image: url(./images/00_splite_handler_v.png);
+}
+.ui-direction-vertical > .ui-spliter > .ui-spliter-bar > .ui-spliter-handle {
+ width: 26px;
+ height: 13px;
+ background-image: url(./images/00_splite_handler_h.png);
+}
+.ui-direction-horizontal > .ui-fixed {
+ width: 0px;
+}
+.ui-direction-horizontal > .ui-fixed > .ui-spliter-bar {
+ width: 5px;
+}
+.ui-direction-vertical > .ui-fixed {
+ height: 0px;
+}
+.ui-direction-vertical > .ui-fixed > .ui-spliter-bar {
+ height: 5px;
+}
+.ui-fixed .ui-spliter-handle {
+ display: none;
}
-.LESSbutton_box_style{color:#363133}.LESSbutton_up_style{background:#ebe8e3;background:-webkit-linear-gradient(top, #ebe8e3, #eae7e2);background:-moz-linear-gradient(top, #ebe8e3, #eae7e2);background:-o-linear-gradient(top, #ebe8e3, #eae7e2);background:-ms-linear-gradient(top, #ebe8e3, #eae7e2)}.LESSbutton_box_style{background:#ebe8e3;background:-webkit-linear-gradient(top, #ebe8e3, #eae7e2);background:-moz-linear-gradient(top, #ebe8e3, #eae7e2);background:-o-linear-gradient(top, #ebe8e3, #eae7e2);background:-ms-linear-gradient(top, #ebe8e3, #eae7e2);border:1px solid;border-color:#dcdad3;-o-box-shadow:0 0 1px 1px #fff;-ms-box-shadow:0 0 1px 1px #fff;-moz-box-shadow:0 0 1px 1px #fff;-webkit-box-shadow:0 0 1px 1px #fff;box-shadow:0 0 1px 1px #fff}.LESSbutton_inner_box_style{background:#f7f5ee;background:-webkit-linear-gradient(top, #faf7f2, #f8f5f0);background:-ms-linear-gradient(top, #faf7f2, #f8f5f0);background:-o-linear-gradient(top, #faf7f2, #f8f5f0);background:-moz-linear-gradient(top, #faf7f2, #f8f5f0);-o-box-shadow:none;-ms-box-shadow:none;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none}.LESSbutton_inner_pressstyle{color:#f8f6ef}.LESSbutton_text1_style{font-family:Helvetica,Arial,sans-serif;font-weight:400;font-size:1.0rem;font-style:normal;color:#000}.LESSbutton_hover_style{color:#363133}.LESSbutton_down_style{background:#3b73b6;color:#f8f6ef}.LESSbutton_edit_style{background:#c95858;background:-webkit-gradient(linear,left top,left bottom,from( #c95858),to( #a12828));background:-moz_linear-gradient(top, #c95858, #a12828)}.LESSDayselectorButtonNormal{background:#7e9db2;background:-webkit-linear-gradient(top, #7e9db2 0, #547990 100%);background:-moz-linear-gradient(top, #7e9db2 0, #547990 100%);background:-ms-linear-gradient(top, #7e9db2 0, #547990 100%);background:-o-linear-gradient(top, #7e9db2 0, #547990 100%);background:linear-gradient(top, #7e9db2 0, #547990 100%)}.LESSDayaselectorButtonPress{background:#3b7796;background:-webkit-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-moz-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-ms-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-o-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:linear-gradient(top, #3b7796 0, #2f5b75 100%)}.LESSpopup_button_style{}.LESSpopup_button_hover_style{background:#5e88a3}.LESSpopup_button_press_style{background:#43a0d9;background:-webkit-gradient(linear,left top,left bottom,from( #43a0d9),to( #388bb9));background:-moz-linear-gradient(top, #43a0d9, #388bb9);background:-ms-linear-gradient(top, #43a0d9, #388bb9);background:-o-linear-gradient(top, #43a0d9, #388bb9)}.LESStoggleswitch_on_style{background:#2a7eac;background:-webkit-gradient(linear,left top,left bottom,from( #2174a7),to( #4ba5db));background:-moz-linear-gradient(top, #2174a7, #4ba5db);border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px}.LESStoggleswitch_off_style{color:#cbcbcb;background:#97a1a7;background:-webkit-gradient(linear,left top,left bottom,from( #727272),to( #8d8d8d));background:-moz-linear-gradient(top, #727272, #8d8d8d);border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px}.LESStoggleswitch_reed_style{background:#fdfdfd;background:-webkit-gradient(linear,left top,left bottom,from( #fdfdfd),to( #e7e7e7));background:-moz-linear-gradient(top, #fdfdfd, #e7e7e7);border-radius:2px;-webkit-border-radius:2px;-moz-border-radius:2px}.LESSbutton_editpress_style{background:#931818;background:-webkit-gradient(linear,left top,left bottom,from( #931818),to( #6e1717));background:-moz-linear-gradient(top, #931818, #6e1717)}.LESSbutton_edit_padding{padding:.5em .8em}.LESSmultimediaview_bar_active_style{background-color:#4a84c9;background-image:-webkit-gradient(linear,left top,left bottom,from( #6289d9),to( #295b98));background-image:-moz-linear-gradient(top, #6289d9, #295b98);background-image:-o-linear-gradient(top, #6289d9, #295b98);background-image:-ms-linear-gradient(top, #6289d9, #295b98)}.LESSmultimediaview_bar_handle_style{background-color:#f9f9f9;background-image:-webkit-gradient(linear,left top,left bottom,from( #fff),to( #e6e6e6));background-image:-moz-linear-gradient(top, #fff, #e6e6e6);background-image:-o-linear-gradient(top, #fff, #e6e6e6);background-image:-ms-linear-gradient(top, #fff, #e6e6e6)}.ui-bar-s{border:0;background:#f8f6ef;color:#3b73b6;font-family:Helvetica,Arial,sans-serif;font-weight:700;font-size:1.2727272727272727rem}.ui-bar-s .ui-link-inherit{color:#3b73b6}.ui-bar-s>.ui-btn.ui-btn-back{background:transparent;position:absolute;right:0}.ui-bar-s>.ui-btn.ui-btn-back .ui-icon-header-back-btn{top:.36363636363636365rem;left:auto;right:.5909090909090909rem;margin-top:0}.ui-header.ui-bar-s{position:fixed;top:0;min-height:2.5rem}.ui-header.ui-bar-s .ui-title{display:inline-block;color:#3b73b6;min-height:1.2727272727272727rem;max-height:1.5454545454545454rem;font-size:1.2727272727272727rem;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;outline:0!important;text-align:left;margin:.7272727272727273rem .36363636363636365rem .2272727272727273rem .36363636363636365rem}.ui-header.ui-bar-s>.ui-btn .ui-btn-inner.ui-btn-icon-only .ui-icon{left:0;top:0;margin-top:0}.ui-header.ui-bar-s>.ui-btn.ui-btn-back{right:.5909090909090909rem}.ui-header.ui-bar-s img{display:inline-block;height:.7272727272727273rem;width:.7272727272727273rem;margin-left:.36363636363636365rem}.ui-header.ui-bar-s .ui-title-text-sub{position:absolute;top:1.6363636363636365rem;left:.36363636363636365rem;font-size:.5454545454545454rem}.ui-header.ui-bar-s .ui-title-text-sub img{height:.7272727272727273rem;width:.7272727272727273rem;margin-left:.36363636363636365rem}.ui-header.ui-bar-s>.ui-btn{position:absolute;top:.7272727272727273rem;margin-top:0;height:1.5454545454545454rem;width:1.5454545454545454rem;background:transparent;color:#3a3a3a}.ui-header.ui-bar-s.ui-title-tabbar>.ui-btn{top:.36363636363636365rem}.ui-header.ui-bar-s>.ui-btn.ui-btn-icon_only{-o-border-radius:0;-ms-border-radius:0;-moz-border-radius:0;-webkit-border-radius:0;border-radius:0}.ui-header.ui-bar-s>.ui-btn:nth-child(2){right:.5909090909090909rem}.ui-header.ui-bar-s>.ui-btn:nth-child(3){right:2.5454545454545454rem}.ui-header.ui-bar-s>img+h1+.ui-btn:nth-child(3){right:.5909090909090909rem}.ui-header.ui-bar-s>img+h1+.ui-btn:nth-child(3)+.ui-btn{right:2.5454545454545454rem}.ui-header.ui-bar-s>img+h1+span.ui-title-text-sub+.ui-btn:nth-child(4){right:.5rem}.ui-header.ui-bar-s>img+h1+span.ui-title-text-sub+.ui-btn:nth-child(4)+.ui-btn{right:2.6363636363636362rem}.ui-header.ui-bar-s>.ui-btn.ui-btn-down-s{background:rgba(64,147,247,.1);color:#3b73b6}.ui-header.ui-bar-s.ui-title-multiline .ui-title{min-height:1.0909090909090908rem;max-height:1.0909090909090908rem;font-size:1rem;margin:.4090909090909091rem .36363636363636365rem 1rem .36363636363636365rem}.ui-footer.ui-bar-s{height:2.2272727272727275rem;text-align:center;bottom:0}.ui-footer.ui-bar-s>.ui-btn.ui-btn-back,.ui-footer.ui-bar-s>[data-icon="naviframe-more"]{background:transparent}.ui-footer.ui-bar-s>.ui-btn.ui-btn-back>.ui-btn-icon-only,.ui-footer.ui-bar-s>[data-icon="naviframe-more"]>.ui-btn-icon-only{width:2.5454545454545454rem;height:2.2272727272727275rem;padding:0;-webkit-box-shadow:none}.ui-footer.ui-bar-s [data-icon="naviframe-more"]{position:absolute;left:0rem;top:0rem;box-shadow:none;border-width:0}.ui-footer.ui-bar-s [data-icon="naviframe-more"] .ui-icon-naviframe-more{left:.5909090909090909rem;top:.36363636363636365rem;margin-top:0}.ui-footer.ui-bar-s [data-icon="naviframe-more"] .ui-btn-inner{border:0;background:transparent;box-shadow:none}.ui-footer.ui-bar-s>[data-role="button"]{font-size:.6818181818181819rem;font-weight:700;color:#999}.ui-footer.ui-bar-s [data-role="controlgroup"]{margin-left:auto;margin-right:auto;margin-top:.2727272727272727rem;margin-bottom:.2727272727272727rem;padding-left:2.6363636363636362rem;padding-right:2.6363636363636362rem}.ui-footer.ui-bar-s [data-role="controlgroup"] [data-role="button"]{background:transparent;min-width:3.5rem;border-style:solid;border-color:#c0c0c0;border-top-width:0;border-bottom-width:0;border-left-width:1px;border-right-width:1px;border-radius:0;box-shadow:none;padding:0;margin-left:-.18181818181818182rem;margin-right:-.2272727272727273rem}.ui-footer.ui-bar-s [data-role="controlgroup"] [data-role="button"].ui-btn-down-s .ui-btn-inner,.ui-footer.ui-bar-s [data-role="controlgroup"] [data-role="button"] .ui-btn-active-s .ui-btn-inner{background:#f8f6ef}.ui-footer.ui-bar-s [data-role="controlgroup"] [data-role="button"].ui-btn-down-s .ui-btn-inner .ui-btn-text,.ui-footer.ui-bar-s [data-role="controlgroup"] [data-role="button"] .ui-btn-active-s .ui-btn-inner .ui-btn-text{color:#3b73b6}.ui-footer.ui-bar-s [data-role="controlgroup"] [data-role="button"]>.ui-btn-inner{border:0 solid;box-shadow:none}.ui-footer.ui-bar-s [data-role="controlgroup"] [data-role="button"] .ui-btn-text{font-size:.7727272727272727rem;color:#3a3a3a}.ui-footer.ui-bar-s [data-role="controlgroup"] [data-role="button"].ui-corner-right{border-right-width:0}.ui-footer.ui-bar-s [data-role="controlgroup"] [data-role="button"].ui-corner-left{border-left-width:0}.ui-footer.ui-bar-s>[data-role="button"]:not([data-icon="naviframe-more"]){top:.2727272727272727rem}.ui-footer.ui-bar-s>p{margin-top:.36363636363636365rem;margin-bottom:.36363636363636365rem}.ui-footer.ui-bar-s>h1,.ui-footer.ui-bar-s h2,.ui-footer.ui-bar-s h3,.ui-footer.ui-bar-s h4,.ui-footer.ui-bar-s h5,.ui-footer.ui-bar-s h6{display:inline-block}.ui-content{position:relative;top:0}.ui-body-s{border:1px solid #2a2a2a;background:#f8f6ef;color:#000;font-weight:400;font-family:Helvetica,Arial,sans-serif}.ui-body-s .ui-link-inherit{color:#fff}.ui-body-s .ui-link{color:#2489CE;font-weight:700}.ui-body-s .ui-link:hover{color:#2489CE}.ui-body-s .ui-link:active{color:#2489CE}.ui-body-s .ui-link:visited{color:#2489CE}.ui-btn-box-s{padding:.045454545454545456rem}.ui-btn-box-s.ui-btn-up-s{color:#363133;background:#ebe8e3;background:-webkit-linear-gradient(top, #ebe8e3, #eae7e2);background:-moz-linear-gradient(top, #ebe8e3, #eae7e2);background:-o-linear-gradient(top, #ebe8e3, #eae7e2);background:-ms-linear-gradient(top, #ebe8e3, #eae7e2);border:1px solid;border-color:#dcdad3;-o-box-shadow:0 0 1px 1px #fff;-ms-box-shadow:0 0 1px 1px #fff;-moz-box-shadow:0 0 1px 1px #fff;-webkit-box-shadow:0 0 1px 1px #fff;box-shadow:0 0 1px 1px #fff;-o-border-radius:.3rem;-ms-border-radius:.3rem;-moz-border-radius:.3rem;-webkit-border-radius:.3rem;border-radius:.3rem;font-family:Helvetica,Arial,sans-serif;font-weight:400;font-size:1.0rem;font-style:normal;color:#000}.ui-btn.ui-btn-corner-all .ui-btn-box-s.ui-btn-up-s{-o-border-radius:1.2rem;-ms-border-radius:1.2rem;-moz-border-radius:1.2rem;-webkit-border-radius:1.2rem;border-radius:1.2rem}.ui-btn-box-s .ui-btn-inner{border:1px solid;border-color:#c7c5be;-o-border-radius:.3rem;-ms-border-radius:.3rem;-moz-border-radius:.3rem;-webkit-border-radius:.3rem;border-radius:.3rem;-o-box-sizing:border-box;-ms-box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;background:#f7f5ee;background:-webkit-linear-gradient(top, #faf7f2, #f8f5f0);background:-ms-linear-gradient(top, #faf7f2, #f8f5f0);background:-o-linear-gradient(top, #faf7f2, #f8f5f0);background:-moz-linear-gradient(top, #faf7f2, #f8f5f0);-o-box-shadow:none;-ms-box-shadow:none;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none;height:100%}.ui-btn.ui-btn-corner-all.ui-btn-box-s .ui-btn-inner{-o-border-radius:1.2rem;-ms-border-radius:1.2rem;-moz-border-radius:1.2rem;-webkit-border-radius:1.2rem;border-radius:1.2rem}.ui-ctxpopup .ui-btn-box-s.ui-btn-up-s,.ui-ctxpopup .ui-btn-box-s.ui-btn-hover-s{background:transparent!important;border:0;box-shadow:none;padding:0;color:#fff!important}.ui-ctxpopup .ui-btn-box-s.ui-btn-down-s{background:#3b73b6!important;border:0;box-shadow:none;padding:0;color:#fff!important;-o-border-radius:0;-ms-border-radius:0;-moz-border-radius:0;-webkit-border-radius:0;border-radius:0}.ui-ctxpopup .ui-btn-box-s .ui-btn-inner{background:transparent ! important;box-shadow:none;border:0}.ui-ctxpopup .ui-btn-down-s{background:#3b73b6!important}.ui-header .ui-btn-box-s,.ui-footer .ui-btn-box-s,.ui-btn-back.ui-btn-up-s,.ui-btn-back.ui-btn-hover-s,.ui-btn-back.ui-btn-down-s,.ui-popup-container .ui-btn-box-s{font-weight:400;-o-border-radius:.9 rem;-ms-border-radius:.9 rem;-moz-border-radius:.9 rem;-webkit-border-radius:.9 rem;border-radius:.9 rem}.ui-btn-box-s.ui-btn-hover-s{color:#363133;font-family:Helvetica,Arial,sans-serif;font-weight:400;font-size:1.0rem;font-style:normal;color:#000;-o-border-radius:.3em ! important;-ms-border-radius:.3em ! important;-moz-border-radius:.3em ! important;-webkit-border-radius:.3em ! important;border-radius:.3em ! important}.ui-btn-box-s.ui-btn-hover-s.ui-btn-corner-circle{-o-border-radius:1em ! important;-ms-border-radius:1em ! important;-moz-border-radius:1em ! important;-webkit-border-radius:1em ! important;border-radius:1em ! important}.ui-btn-box-s.ui-btn-hover-s.ui-btn-corner-all{-o-border-radius:1.2em ! important;-ms-border-radius:1.2em ! important;-moz-border-radius:1.2em ! important;-webkit-border-radius:1.2em ! important;border-radius:1.2em ! important}.ui-btn-box-s.ui-btn-hover-s.ui-btn-round{-o-border-radius:1.2em ! important;-ms-border-radius:1.2em ! important;-moz-border-radius:1.2em ! important;-webkit-border-radius:1.2em ! important;border-radius:1.2em ! important}.ui-btn-box-s.ui-btn-down-s .ui-btn-inner{background:#3b73b6;color:#f8f6ef}.ui-btn-up-s,.ui-btn-hover-s,.ui-btn-down-s{font-family:Helvetica,Arial,sans-serif;text-decoration:none}a.ui-link-inherit{text-decoration:none!important}.ui-btn-active{color:#363133;cursor:pointer;text-decoration:none;background:#3b73b6;outline:0}.ui-btn-active a.ui-link-inherit{color:#363133}.ui-corner-tl{-moz-border-radius-topleft:.3em;-webkit-border-top-left-radius:.3em;border-top-left-radius:.3em}.ui-corner-tr{-moz-border-radius-topright:.3em;-webkit-border-top-right-radius:.3em;border-top-right-radius:.3em}.ui-corner-bl{-moz-border-radius-bottomleft:.3em;-webkit-border-bottom-left-radius:.3em;border-bottom-left-radius:.3em}.ui-corner-br{-moz-border-radius-bottomright:.3em;-webkit-border-bottom-right-radius:.3em;border-bottom-right-radius:.3em}.ui-corner-top{-moz-border-radius-topleft:.3em;-webkit-border-top-left-radius:.3em;border-top-left-radius:.3em;-moz-border-radius-topright:.3em;-webkit-border-top-right-radius:.3em;border-top-right-radius:.3em}.ui-corner-bottom{-moz-border-radius-bottomleft:.3em;-webkit-border-bottom-left-radius:.3em;border-bottom-left-radius:.3em;-moz-border-radius-bottomright:.3em;-webkit-border-bottom-right-radius:.3em;border-bottom-right-radius:.3em}.ui-corner-right{-moz-border-radius-topright:.3em;-webkit-border-top-right-radius:.3em;border-top-right-radius:.3em;-moz-border-radius-bottomright:.3em;-webkit-border-bottom-right-radius:.3em;border-bottom-right-radius:.3em}.ui-corner-left{-moz-border-radius-topleft:.3em;-webkit-border-top-left-radius:.3em;border-top-left-radius:.3em;-moz-border-radius-bottomleft:.3em;-webkit-border-bottom-left-radius:.3em;border-bottom-left-radius:.3em}.ui-corner-none{-o-border-radius:0;-ms-border-radius:0;-moz-border-radius:0;-webkit-border-radius:0;border-radius:0}.ui-header .ui-btn .ui-btn-icon-only .ui-icon,.ui-footer .ui-btn .ui-btn-icon-only .ui-icon{width:1.4545454545454546rem;height:1.4545454545454546rem}.ui-btn-back .ui-btn-inner .ui-icon-header-back-btn{width:1.4545454545454546rem;height:1.4545454545454546rem;background-repeat:no-repeat;background-size:100% 100%}.ui-btn-up-s{}.ui-btn-up-s .ui-icon-header-back-btn{background-image:url(images/page/00_icon_Back.png)}.ui-btn-up-s .ui-icon-naviframe-more{background-image:url(images/page/00_icon_more.png)}.ui-btn-up-s .ui-icon-naviframe-cancel{background-image:url(images/00_icon_cancel.png)}.ui-btn-up-s .ui-icon-naviframe-edit{background-image:url(images/page/00_icon_edit.png)}.ui-btn-up-s .ui-icon-naviframe-plus{background-image:url(images/page/00_icon_plus.png)}.ui-btn-down-s,.ui-btn-hover-s{}.ui-btn-down-s .ui-icon-header-back-btn,.ui-btn-hover-s .ui-icon-header-back-btn{background-image:url(images/page/00_icon_Back_press.png)}.ui-btn-down-s .ui-icon-naviframe-more,.ui-btn-hover-s .ui-icon-naviframe-more{background-image:url(images/page/00_icon_more_press.png)}.ui-btn-down-s .ui-icon-naviframe-cancel,.ui-btn-hover-s .ui-icon-naviframe-cancel{background-image:url(images/00_icon_cancel_press.png)}.ui-btn-down-s .ui-icon-naviframe-edit,.ui-btn-hover-s .ui-icon-naviframe-edit{background-image:url(images/page/00_icon_edit_press.png)}.ui-btn-down-s .ui-icon-naviframe-plus,.ui-btn-hover-s .ui-icon-naviframe-plus{background-image:url(images/page/00_icon_plus_press.png)}.ui-disabled{filter:alpha(opacity=30);opacity:.3;zoom:1}.ui-disabled,.ui-disabled a{cursor:default!important;pointer-events:none}.LESSbutton_box_style{color:#363133}.LESSbutton_up_style{background:#ebe8e3;background:-webkit-linear-gradient(top, #ebe8e3, #eae7e2);background:-moz-linear-gradient(top, #ebe8e3, #eae7e2);background:-o-linear-gradient(top, #ebe8e3, #eae7e2);background:-ms-linear-gradient(top, #ebe8e3, #eae7e2)}.LESSbutton_box_style{background:#ebe8e3;background:-webkit-linear-gradient(top, #ebe8e3, #eae7e2);background:-moz-linear-gradient(top, #ebe8e3, #eae7e2);background:-o-linear-gradient(top, #ebe8e3, #eae7e2);background:-ms-linear-gradient(top, #ebe8e3, #eae7e2);border:1px solid;border-color:#dcdad3;-o-box-shadow:0 0 1px 1px #fff;-ms-box-shadow:0 0 1px 1px #fff;-moz-box-shadow:0 0 1px 1px #fff;-webkit-box-shadow:0 0 1px 1px #fff;box-shadow:0 0 1px 1px #fff}.LESSbutton_inner_box_style{background:#f7f5ee;background:-webkit-linear-gradient(top, #faf7f2, #f8f5f0);background:-ms-linear-gradient(top, #faf7f2, #f8f5f0);background:-o-linear-gradient(top, #faf7f2, #f8f5f0);background:-moz-linear-gradient(top, #faf7f2, #f8f5f0);-o-box-shadow:none;-ms-box-shadow:none;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none}.LESSbutton_inner_pressstyle{color:#f8f6ef}.LESSbutton_text1_style{font-family:Helvetica,Arial,sans-serif;font-weight:400;font-size:1.0rem;font-style:normal;color:#000}.LESSbutton_hover_style{color:#363133}.LESSbutton_down_style{background:#3b73b6;color:#f8f6ef}.LESSbutton_edit_style{background:#c95858;background:-webkit-gradient(linear,left top,left bottom,from( #c95858),to( #a12828));background:-moz_linear-gradient(top, #c95858, #a12828)}.LESSDayselectorButtonNormal{background:#7e9db2;background:-webkit-linear-gradient(top, #7e9db2 0, #547990 100%);background:-moz-linear-gradient(top, #7e9db2 0, #547990 100%);background:-ms-linear-gradient(top, #7e9db2 0, #547990 100%);background:-o-linear-gradient(top, #7e9db2 0, #547990 100%);background:linear-gradient(top, #7e9db2 0, #547990 100%)}.LESSDayaselectorButtonPress{background:#3b7796;background:-webkit-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-moz-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-ms-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-o-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:linear-gradient(top, #3b7796 0, #2f5b75 100%)}.LESSpopup_button_style{}.LESSpopup_button_hover_style{background:#5e88a3}.LESSpopup_button_press_style{background:#43a0d9;background:-webkit-gradient(linear,left top,left bottom,from( #43a0d9),to( #388bb9));background:-moz-linear-gradient(top, #43a0d9, #388bb9);background:-ms-linear-gradient(top, #43a0d9, #388bb9);background:-o-linear-gradient(top, #43a0d9, #388bb9)}.LESStoggleswitch_on_style{background:#2a7eac;background:-webkit-gradient(linear,left top,left bottom,from( #2174a7),to( #4ba5db));background:-moz-linear-gradient(top, #2174a7, #4ba5db);border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px}.LESStoggleswitch_off_style{color:#cbcbcb;background:#97a1a7;background:-webkit-gradient(linear,left top,left bottom,from( #727272),to( #8d8d8d));background:-moz-linear-gradient(top, #727272, #8d8d8d);border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px}.LESStoggleswitch_reed_style{background:#fdfdfd;background:-webkit-gradient(linear,left top,left bottom,from( #fdfdfd),to( #e7e7e7));background:-moz-linear-gradient(top, #fdfdfd, #e7e7e7);border-radius:2px;-webkit-border-radius:2px;-moz-border-radius:2px}.LESSbutton_editpress_style{background:#931818;background:-webkit-gradient(linear,left top,left bottom,from( #931818),to( #6e1717));background:-moz-linear-gradient(top, #931818, #6e1717)}.LESSbutton_edit_padding{padding:.5em .8em}.LESSmultimediaview_bar_active_style{background-color:#4a84c9;background-image:-webkit-gradient(linear,left top,left bottom,from( #6289d9),to( #295b98));background-image:-moz-linear-gradient(top, #6289d9, #295b98);background-image:-o-linear-gradient(top, #6289d9, #295b98);background-image:-ms-linear-gradient(top, #6289d9, #295b98)}.LESSmultimediaview_bar_handle_style{background-color:#f9f9f9;background-image:-webkit-gradient(linear,left top,left bottom,from( #fff),to( #e6e6e6));background-image:-moz-linear-gradient(top, #fff, #e6e6e6);background-image:-o-linear-gradient(top, #fff, #e6e6e6);background-image:-ms-linear-gradient(top, #fff, #e6e6e6)}.ui-mobile,.ui-mobile body{height:100%;font-size:22px}.ui-mobile fieldset,.ui-page{padding:0;margin:0}.ui-mobile a img,.ui-mobile fieldset{border:0}.ui-mobile-viewport{margin:0;overflow-x:hidden;-webkit-tap-highlight-color:rgba(0,0,0,0)}.ui-mobile [data-role=page],.ui-mobile [data-role=dialog],.ui-page{top:0;left:0;width:100%;min-height:100%;position:absolute;display:none;border:0}.ui-mobile .ui-page-active{display:block;overflow:visible}.ui-page{outline:0}.ui-mobile,.ui-mobile .ui-page{background:#f8f6ef;color:#000}.ui-page.ui-mobile-touch-overflow,.ui-mobile-touch-overflow.ui-native-fixed .ui-content{overflow:auto;height:100%;-webkit-overflow-scrolling:touch;-moz-overflow-scrolling:touch;-o-overflow-scrolling:touch;-ms-overflow-scrolling:touch;overflow-scrolling:touch}.ui-page.ui-mobile-touch-overflow,.ui-page.ui-mobile-touch-overflow *{transform:rotatey(0);-ms-transform:rotatey(0);-moz-transform:rotatey(0);-webkit-transform:rotatey(0);-o-transform:rotatey(0)}.ui-page.ui-mobile-pre-transition{display:block}.ui-loading .ui-mobile-viewport{overflow:hidden!important}.ui-loading .ui-loader{display:block}.ui-loading .ui-page{overflow:hidden}.ui-loader{display:none;position:absolute;opacity:.85;z-index:100;left:50%;width:200px;margin-left:-130px;margin-top:-35px;padding:10px 30px}.ui-loader h1{font-size:1.4545454545454546rem;text-align:center}.ui-loader .ui-icon{position:static;display:block;opacity:.9;margin:0 auto;width:35px;height:35px;background-color:transparent}.ui-blocker{width:100%;height:100%;z-index:2147483647}.ui-mobile-rendering>*{visibility:hidden}.ui-bar,.ui-body{position:relative;padding:.4em 15px;overflow:hidden;display:block;clear:both}.ui-bar{font-size:16px;margin:0}.ui-bar h1,.ui-bar h2,.ui-bar h3,.ui-bar h4,.ui-bar h5,.ui-bar h6{margin:0;padding:0;font-size:16px;display:inline-block}.ui-header,.ui-footer{display:block}.ui-page .ui-header,.ui-page .ui-footer{position:fixed;z-index:1000}.ui-header .ui-btn-left{top:.4em;float:left}.ui-header .ui-btn-right{float:right;top:.4em}.ui-header .ui-title,.ui-footer .ui-title{min-height:1.1em;text-align:center;font-size:16px;display:block;margin:.6em 90px .8em;padding:0;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;outline:0!important}.ui-content{border-width:0;overflow:visible;overflow-x:hidden;padding:15px}.ui-page-fullscreen .ui-content{padding:0}.ui-mobile-touch-overflow.ui-page.ui-native-fixed,.ui-mobile-touch-overflow.ui-page.ui-native-fullscreen{overflow:visible}.ui-mobile-touch-overflow.ui-native-fixed .ui-header,.ui-mobile-touch-overflow.ui-native-fixed .ui-footer{position:fixed;left:0;right:0;top:0;z-index:200}.ui-mobile-touch-overflow.ui-page.ui-native-fixed .ui-footer{top:auto;bottom:0}.ui-mobile-touch-overflow.ui-native-fixed .ui-content{padding-top:2.5em;padding-bottom:3em;top:0;bottom:0;height:auto;position:absolute}.ui-mobile-touch-overflow.ui-native-fullscreen .ui-content{padding-top:0;padding-bottom:0}.ui-mobile-touch-overflow.ui-native-fullscreen .ui-header,.ui-mobile-touch-overflow.ui-native-fullscreen .ui-footer{opacity:.9}.ui-native-bars-hidden{display:none}.ui-icon{width:18px;height:18px}.ui-fullscreen img{max-width:100%}.ui-nojs{position:absolute;left:-9999px}.ui-mobile-viewport-transitioning,.ui-mobile-viewport-transitioning .ui-page{width:100%;height:100%;overflow:hidden}.in{-ms-animation-timing-function:ease-out;-ms-animation-duration:350ms;-o-animation-timing-function:ease-out;-o-animation-duration:350ms;-webkit-animation-timing-function:ease-out;-webkit-animation-duration:350ms;-moz-animation-timing-function:ease-out;-moz-animation-duration:350ms}.out{-ms-animation-timing-function:ease-in;-ms-animation-duration:225ms;-o-animation-timing-function:ease-in;-o-animation-duration:225;-webkit-animation-timing-function:ease-in;-webkit-animation-duration:225ms;-moz-animation-timing-function:ease-in;-moz-animation-duration:225}@-webkit-keyframes fadein{from{ opacity:0}to{opacity:1}}@-moz-keyframes fadein{from{ opacity:0}to{opacity:1}}@-webkit-keyframes fadeout{from{ opacity:1}to{opacity:0}}@-moz-keyframes fadeout{from{ opacity:1}to{opacity:0}}.fade.out{opacity:0;-ms-animation-duration:125ms;-ms-animation-name:fadeout;-o-animation-duration:125ms;-o-animation-name:fadeout;-webkit-animation-duration:125ms;-webkit-animation-name:fadeout;-moz-animation-duration:125ms;-moz-animation-name:fadeout}.fade.in{opacity:1;-ms-animation-duration:225ms;-ms-animation-name:fadein;-o-animation-duration:225ms;-o-animation-name:fadein;-webkit-animation-duration:225ms;-webkit-animation-name:fadein;-moz-animation-duration:225ms;-moz-animation-name:fadein}.viewport-flip{-ms-perspective:1000;-o-perspective:1000;-webkit-perspective:1000;-moz-perspective:1000;position:absolute}.flip{-webkit-backface-visibility:hidden;-webkit-transform:translate3d(0,0,0);-moz-backface-visibility:hidden;-moz-transform:translate3d(0,0,0)}.flip.out{-webkit-transform:rotateY(-90deg) scale(.9);-webkit-animation-name:flipouttoleft;-webkit-animation-duration:175ms;-moz-transform:rotateY(-90deg) scale(.9);-moz-animation-name:flipouttoleft;-moz-animation-duration:175ms}.flip.in{-webkit-animation-name:flipintoright;-webkit-animation-duration:225ms;-moz-animation-name:flipintoright;-moz-animation-duration:225ms}.flip.out.reverse{-webkit-transform:rotateY(90deg) scale(.9);-webkit-animation-name:flipouttoright;-moz-transform:rotateY(90deg) scale(.9);-moz-animation-name:flipouttoright}.flip.in.reverse{-webkit-animation-name:flipintoleft;-moz-animation-name:flipintoleft}@-webkit-keyframes flipouttoleft{from{ -webkit-transform:rotateY(0)}to{-webkit-transform:rotateY(-90deg) scale(.9)}}@-moz-keyframes flipouttoleft{from{ -moz-transform:rotateY(0)}to{-moz-transform:rotateY(-90deg) scale(.9)}}@-webkit-keyframes flipouttoright{from{ -webkit-transform:rotateY(0)}to{-webkit-transform:rotateY(90deg) scale(.9)}}@-moz-keyframes flipouttoright{from{ -moz-transform:rotateY(0)}to{-moz-transform:rotateY(90deg) scale(.9)}}@-webkit-keyframes flipintoleft{from{ -webkit-transform:rotateY(-90deg) scale(.9)}to{-webkit-transform:rotateY(0)}}@-moz-keyframes flipintoleft{from{ -moz-transform:rotateY(-90deg) scale(.9)}to{-moz-transform:rotateY(0)}}@-webkit-keyframes flipintoright{from{ -webkit-transform:rotateY(90deg) scale(.9)}to{-webkit-transform:rotateY(0)}}@-moz-keyframes flipintoright{from{ -moz-transform:rotateY(90deg) scale(.9)}to{-moz-transform:rotateY(0)}}.flow{-webkit-transform-origin:50% 30%;-moz-transform-origin:50% 30%;-webkit-box-shadow:0 0 20px rgba(0,0,0,.4);-moz-box-shadow:0 0 20px rgba(0,0,0,.4)}.ui-dialog.flow{-webkit-transform-origin:none;-moz-transform-origin:none;-webkit-box-shadow:none;-moz-box-shadow:none}.flow.out{-webkit-transform:translate3d(-100%,0,0) scale(.7);-webkit-animation-name:flowouttoleft;-webkit-animation-timing-function:ease;-webkit-animation-duration:350ms;-moz-transform:translate3d(-100%,0,0) scale(.7);-moz-animation-name:flowouttoleft;-moz-animation-timing-function:ease;-moz-animation-duration:350ms}.flow.in{-webkit-transform:translate3d(0,0,0) scale(1);-webkit-animation-name:flowinfromright;-webkit-animation-timing-function:ease;-webkit-animation-duration:350ms;-moz-transform:translate3d(0,0,0) scale(1);-moz-animation-name:flowinfromright;-moz-animation-timing-function:ease;-moz-animation-duration:350ms}.flow.out.reverse{-webkit-transform:translate3d(100%,0,0);-webkit-animation-name:flowouttoright;-moz-transform:translate3d(100%,0,0);-moz-animation-name:flowouttoright}.flow.in.reverse{-webkit-animation-name:flowinfromleft;-moz-animation-name:flowinfromleft}@-webkit-keyframes flowouttoleft{0%{ -webkit-transform:translate3d(0,0,0) scale(1)}60%,70%{-webkit-transform:translate3d(0,0,0) scale(.7)}100%{-webkit-transform:translate3d(-100%,0,0) scale(.7)}}@-moz-keyframes flowouttoleft{0%{ -moz-transform:translate3d(0,0,0) scale(1)}60%,70%{-moz-transform:translate3d(0,0,0) scale(.7)}100%{-moz-transform:translateX(-100%) scale(.7)}}@-webkit-keyframes flowouttoright{0%{ -webkit-transform:translate3d(0,0,0) scale(1)}60%,70%{-webkit-transform:translate3d(0,0,0) scale(.7)}100%{-webkit-transform:translate3d(100%,0,0) scale(.7)}}@-moz-keyframes flowouttoright{0%{ -moz-transform:translate3d(0,0,0) scale(1)}60%,70%{-moz-transform:translate3d(0,0,0) scale(.7)}100%{-moz-transform:translate3d(100%,0,0) scale(.7)}}@-webkit-keyframes flowinfromleft{0%{ -webkit-transform:translate3d(-100%,0,0) scale(.7)}30%,40%{-webkit-transform:translate3d(0,0,0) scale(.7)}100%{-webkit-transform:translate3d(0,0,0) scale(1)}}@-moz-keyframes flowinfromleft{0%{ -moz-transform:translate3d(-100%,0,0) scale(.7)}30%,40%{-moz-transform:translate3d(0,0,0) scale(.7)}100%{-moz-transform:translate3d(0,0,0) scale(1)}}@-webkit-keyframes flowinfromright{0%{ -webkit-transform:translate3d(100%,0,0) scale(.7)}30%,40%{-webkit-transform:translate3d(0,0,0) scale(.7)}100%{-webkit-transform:translate3d(0,0,0) scale(1)}}@-moz-keyframes flowinfromright{0%{ -moz-transform:translate3d(100%,0,0) scale(.7)}30%,40%{-moz-transform:translate3d(0,0,0) scale(.7)}100%{-moz-transform:translate3d(0,0,0) scale(1)}}.pop{-webkit-transform-origin:50% 50%;-moz-transform-origin:50% 50%}.pop.in{-webkit-transform:scale(1);-moz-transform:scale(1);opacity:1;-webkit-animation-name:popin;-moz-animation-name:popin;-webkit-animation-duration:350ms;-moz-animation-duration:350ms}.pop.out{-webkit-animation-name:fadeout;-moz-animation-name:fadeout;opacity:0;-webkit-animation-duration:100ms;-moz-animation-duration:100ms}.pop.in.reverse{-webkit-animation-name:fadein;-moz-animation-name:fadein}.pop.out.reverse{-webkit-transform:scale(.8);-moz-transform:scale(.8);-webkit-animation-name:popout;-moz-animation-name:popout}@-webkit-keyframes popin{from{ -webkit-transform:scale(.8);opacity:0}to{-webkit-transform:scale(1);opacity:1}}@-moz-keyframes popin{from{ -moz-transform:scale(.8);opacity:0}to{-moz-transform:scale(1);opacity:1}}@-webkit-keyframes popout{from{ -webkit-transform:scale(1);opacity:1}to{-webkit-transform:scale(.8);opacity:0}}@-moz-keyframes popout{from{ -moz-transform:scale(1);opacity:1}to{-moz-transform:scale(.8);opacity:0}}@-webkit-keyframes slideinfromright{from{ -webkit-transform:translate3d(100%,0,0)}to{-webkit-transform:translate3d(0,0,0)}}@-moz-keyframes slideinfromright{from{ -moz-transform:translate3d(100%,0,0)}to{-moz-transform:translate3d(0,0,0)}}@-webkit-keyframes slideinfromleft{from{ -webkit-transform:translate3d(-100%,0,0)}to{-webkit-transform:translate3d(0,0,0)}}@-moz-keyframes slideinfromleft{from{ -moz-transform:translate3d(-100%,0,0)}to{-moz-transform:translate3d(0,0,0)}}@-webkit-keyframes slideouttoleft{from{ -webkit-transform:translate3d(0,0,0)}to{-webkit-transform:translate3d(-100%,0,0)}}@-moz-keyframes slideouttoleft{from{ -moz-transform:translate3d(0,0,0)}to{-moz-transform:translate3d(-100%,0,0)}}@-webkit-keyframes slideouttoright{from{ -webkit-transform:translate3d(0,0,0)}to{-webkit-transform:translate3d(100%,0,0)}}@-moz-keyframes slideouttoright{from{ -moz-transform:translate3d(0,0,0)}to{-moz-transform:translate3d(100%,0,0)}}.slide.out,.slide.in{-webkit-animation-timing-function:ease-out;-webkit-animation-duration:350ms;-moz-animation-timing-function:ease-out;-moz-animation-duration:350ms}.slide.out{-webkit-transform:translate3d(-100%,0,0);-webkit-animation-name:slideouttoleft;-moz-transform:translate3d(-100%,0,0);-moz-animation-name:slideouttoleft}.slide.in{-webkit-transform:translate3d(0,0,0);-webkit-animation-name:slideinfromright;-moz-transform:translate3d(0,0,0);-moz-animation-name:slideinfromright}.slide.out.reverse{-webkit-transform:translate3d(100%,0,0);-webkit-animation-name:slideouttoright;-moz-transform:translate3d(100%,0,0);-moz-animation-name:slideouttoright}.slide.in.reverse{-webkit-transform:translate3d(0,0,0);-webkit-animation-name:slideinfromleft;-moz-transform:translate3d(0,0,0);-moz-animation-name:slideinfromleft}.slidedown.out{-webkit-animation-name:fadeout;-moz-animation-name:fadeout;-webkit-animation-duration:100ms;-moz-animation-duration:100ms}.slidedown.in{-webkit-transform:translate3d(0,0,0);-webkit-animation-name:slideinfromtop;-moz-transform:translate3d(0,0,0);-moz-animation-name:slideinfromtop;-webkit-animation-duration:250ms;-moz-animation-duration:250ms}.slidedown.in.reverse{-webkit-animation-name:fadein;-moz-animation-name:fadein;-webkit-animation-duration:150ms;-moz-animation-duration:150ms}.slidedown.out.reverse{-webkit-transform:translate3d(0,-100%,0);-moz-transform:translate3d(0,-100%,0);-webkit-animation-name:slideouttotop;-moz-animation-name:slideouttotop;-webkit-animation-duration:200ms;-moz-animation-duration:200ms}@-webkit-keyframes slideinfromtop{from{ -webkit-transform:translate3d(0,-100%,0)}to{-webkit-transform:translate3d(0,0,0)}}@-moz-keyframes slideinfromtop{from{ -moz-transform:translate3d(0,-100%,0)}to{-moz-transform:translate3d(0,0,0)}}@-webkit-keyframes slideouttotop{from{ -webkit-transform:translate3d(0,0,0)}to{-webkit-transform:translate3d(0,-100%,0)}}@-moz-keyframes slideouttotop{from{ -moz-transform:translate3d(0,0,0)}to{-moz-transform:translate3d(0,-100%,0)}}.slideup.out{-webkit-animation-name:fadeout;-moz-animation-name:fadeout;-webkit-animation-duration:100ms;-moz-animation-duration:100ms}.slideup.in{-webkit-transform:translate3d(0,0,0);-webkit-animation-name:slideinfrombottom;-moz-transform:translate3d(0,0,0);-moz-animation-name:slideinfrombottom;-webkit-animation-duration:250ms;-moz-animation-duration:250ms}.slideup.in.reverse{-webkit-animation-name:fadein;-moz-animation-name:fadein;-webkit-animation-duration:150ms;-moz-animation-duration:150ms}.slideup.out.reverse{-webkit-transform:translate3d(0,100%,0);-moz-transform:translate3d(0,100%,0);-webkit-animation-name:slideouttobottom;-moz-animation-name:slideouttobottom;-webkit-animation-duration:200ms;-moz-animation-duration:200ms}@-webkit-keyframes slideinfrombottom{from{ -webkit-transform:translate3d(0,100%,0)}to{-webkit-transform:translate3d(0,0,0)}}@-moz-keyframes slideinfrombottom{from{ -moz-transform:translate3d(0,100%,0)}to{-moz-transform:translate3d(0,0,0)}}@-webkit-keyframes slideouttobottom{from{ -webkit-transform:translate3d(0,0,0)}to{-webkit-transform:translate3d(0,100%,0)}}@-moz-keyframes slideouttobottom{from{ -moz-transform:translate3d(0,0,0)}to{-moz-transform:translate3d(0,100%,0)}}.slidefade.out{-webkit-transform:translate3d(-100%,0,0);-webkit-animation-name:slideouttoleft;-moz-transform:translate3d(-100%,0,0);-moz-animation-name:slideouttoleft;-webkit-animation-duration:225ms;-moz-animation-duration:225ms}.slidefade.in{-webkit-transform:translate3d(0,0,0);-webkit-animation-name:fadein;-moz-transform:translate3d(0,0,0);-moz-animation-name:fadein;-webkit-animation-duration:200ms;-moz-animation-duration:200ms}.slidefade.out.reverse{-webkit-transform:translate3d(100%,0,0);-webkit-animation-name:slideouttoright;-moz-transform:translate3d(100%,0,0);-moz-animation-name:slideouttoright;-webkit-animation-duration:200ms;-moz-animation-duration:200ms}.slidefade.in.reverse{-webkit-transform:translate3d(0,0,0);-webkit-animation-name:fadein;-moz-transform:translate3d(0,0,0);-moz-animation-name:fadein;-webkit-animation-duration:200ms;-moz-animation-duration:200ms}.viewport-turn{-webkit-perspective:1000;-moz-perspective:1000;position:absolute}.turn{-webkit-backface-visibility:hidden;-webkit-transform:translate3d(0,0,0);-webkit-transform-origin:0;-moz-backface-visibility:hidden;-moz-transform:translate3d(0,0,0);-moz-transform-origin:0}.turn.out{-webkit-transform:rotateY(-90deg) scale(.9);-webkit-animation-name:flipouttoleft;-moz-transform:rotateY(-90deg) scale(.9);-moz-animation-name:flipouttoleft;-webkit-animation-duration:125ms;-moz-animation-duration:125ms}.turn.in{-webkit-animation-name:flipintoright;-moz-animation-name:flipintoright;-webkit-animation-duration:250ms;-moz-animation-duration:250ms}.turn.out.reverse{-webkit-transform:rotateY(90deg) scale(.9);-webkit-animation-name:flipouttoright;-moz-transform:rotateY(90deg) scale(.9);-moz-animation-name:flipouttoright}.turn.in.reverse{-webkit-animation-name:flipintoleft;-moz-animation-name:flipintoleft}@-webkit-keyframes flipouttoleft{from{ -webkit-transform:rotateY(0)}to{-webkit-transform:rotateY(-90deg) scale(.9)}}@-moz-keyframes flipouttoleft{from{ -moz-transform:rotateY(0)}to{-moz-transform:rotateY(-90deg) scale(.9)}}@-webkit-keyframes flipouttoright{from{ -webkit-transform:rotateY(0)}to{-webkit-transform:rotateY(90deg) scale(.9)}}@-moz-keyframes flipouttoright{from{ -moz-transform:rotateY(0)}to{-moz-transform:rotateY(90deg) scale(.9)}}@-webkit-keyframes flipintoleft{from{ -webkit-transform:rotateY(-90deg) scale(.9)}to{-webkit-transform:rotateY(0)}}@-moz-keyframes flipintoleft{from{ -moz-transform:rotateY(-90deg) scale(.9)}to{-moz-transform:rotateY(0)}}@-webkit-keyframes flipintoright{from{ -webkit-transform:rotateY(90deg) scale(.9)}to{-webkit-transform:rotateY(0)}}@-moz-keyframes flipintoright{from{ -moz-transform:rotateY(90deg) scale(.9)}to{-moz-transform:rotateY(0)}}.depth{-webkit-transform-origin:50% 50%;-moz-transform-origin:50% 50%}.depth.out{-webkit-animation-name:depthout;-moz-animation-name:depthout;opacity:0;-webkit-animation-duration:250ms;-moz-animation-duration:250ms;-webkit-animation-timing-function:ease;-moz-animation-timing-function:ease}.depth.in{-webkit-transform:scale(1);-moz-transform:scale(1);opacity:1;-webkit-animation-name:depthin;-moz-animation-name:depthin;-webkit-animation-duration:350ms;-moz-animation-duration:350ms;-webkit-animation-timing-function:ease;-moz-animation-timing-function:ease}.depth.in.reverse{-webkit-animation-name:depthinreverse;-moz-animation-name:depthinreverse}.depth.out.reverse{-webkit-transform:scale(.9);-moz-transform:scale(.9);-webkit-animation-name:depthoutreverse;-moz-animation-name:depthoutreverse}@-webkit-keyframes depthout{from{ -webkit-transform:scale(1);opacity:1}to{-webkit-transform:scale(1.1);opacity:0}}@-moz-keyframes depthout{from{ -moz-transform:scale(1);opacity:1}to{-moz-transform:scale(1.1);opacity:0}}@-webkit-keyframes depthin{0%{ -webkit-transform:scale(.9);opacity:0}30%{-webkit-transform:scale(.9);opacity:0}100%{-webkit-transform:scale(1);opacity:1}}@-moz-keyframes depthin{0%{ -moz-transform:scale(.9);opacity:0}30%{-moz-transform:scale(.9);opacity:0}100%{-moz-transform:scale(1);opacity:1}}@-webkit-keyframes depthinreverse{0%{ -webkit-transform:scale(1.1);opacity:0}30%{-webkit-transform:scale(1.1);opacity:0}100%{-webkit-transform:scale(1);opacity:1}}@-moz-keyframes depthinreverse{0%{ -moz-transform:scale(1.1);opacity:0}30%{-moz-transform:scale(1.1);opacity:0}100%{-moz-transform:scale(1);opacity:1}}@-webkit-keyframes depthoutreverse{from{ -webkit-transform:scale(1);opacity:1}to{-webkit-transform:scale(.9);opacity:0}}@-moz-keyframes depthoutreverse{from{ -moz-transform:scale(1);opacity:1}to{-moz-transform:scale(.9);opacity:0}}.ui-grid-a,.ui-grid-b,.ui-grid-c,.ui-grid-d{overflow:hidden}.ui-block-a,.ui-block-b,.ui-block-c,.ui-block-d,.ui-block-e{margin:0;padding:0;border:0;float:left;min-height:1px}.ui-grid-solo .ui-block-a{width:100%;float:none}.ui-grid-a .ui-block-a,.ui-grid-a .ui-block-b{width:50%}.ui-grid-a .ui-block-a{clear:left}.ui-grid-b .ui-block-a,.ui-grid-b .ui-block-b,.ui-grid-b .ui-block-c{width:33.333%}.ui-grid-b .ui-block-a{clear:left}.ui-grid-c .ui-block-a,.ui-grid-c .ui-block-b,.ui-grid-c .ui-block-c,.ui-grid-c .ui-block-d{width:25%}.ui-grid-c .ui-block-a{clear:left}.ui-grid-d .ui-block-a,.ui-grid-d .ui-block-b,.ui-grid-d .ui-block-c,.ui-grid-d .ui-block-d,.ui-grid-d .ui-block-e{width:20%}.ui-grid-d .ui-block-a{clear:left}.LESSbutton_box_style{color:#363133}.LESSbutton_up_style{background:#ebe8e3;background:-webkit-linear-gradient(top, #ebe8e3, #eae7e2);background:-moz-linear-gradient(top, #ebe8e3, #eae7e2);background:-o-linear-gradient(top, #ebe8e3, #eae7e2);background:-ms-linear-gradient(top, #ebe8e3, #eae7e2)}.LESSbutton_box_style{background:#ebe8e3;background:-webkit-linear-gradient(top, #ebe8e3, #eae7e2);background:-moz-linear-gradient(top, #ebe8e3, #eae7e2);background:-o-linear-gradient(top, #ebe8e3, #eae7e2);background:-ms-linear-gradient(top, #ebe8e3, #eae7e2);border:1px solid;border-color:#dcdad3;-o-box-shadow:0 0 1px 1px #fff;-ms-box-shadow:0 0 1px 1px #fff;-moz-box-shadow:0 0 1px 1px #fff;-webkit-box-shadow:0 0 1px 1px #fff;box-shadow:0 0 1px 1px #fff}.LESSbutton_inner_box_style{background:#f7f5ee;background:-webkit-linear-gradient(top, #faf7f2, #f8f5f0);background:-ms-linear-gradient(top, #faf7f2, #f8f5f0);background:-o-linear-gradient(top, #faf7f2, #f8f5f0);background:-moz-linear-gradient(top, #faf7f2, #f8f5f0);-o-box-shadow:none;-ms-box-shadow:none;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none}.LESSbutton_inner_pressstyle{color:#f8f6ef}.LESSbutton_text1_style{font-family:Helvetica,Arial,sans-serif;font-weight:400;font-size:1.0rem;font-style:normal;color:#000}.LESSbutton_hover_style{color:#363133}.LESSbutton_down_style{background:#3b73b6;color:#f8f6ef}.LESSbutton_edit_style{background:#c95858;background:-webkit-gradient(linear,left top,left bottom,from( #c95858),to( #a12828));background:-moz_linear-gradient(top, #c95858, #a12828)}.LESSDayselectorButtonNormal{background:#7e9db2;background:-webkit-linear-gradient(top, #7e9db2 0, #547990 100%);background:-moz-linear-gradient(top, #7e9db2 0, #547990 100%);background:-ms-linear-gradient(top, #7e9db2 0, #547990 100%);background:-o-linear-gradient(top, #7e9db2 0, #547990 100%);background:linear-gradient(top, #7e9db2 0, #547990 100%)}.LESSDayaselectorButtonPress{background:#3b7796;background:-webkit-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-moz-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-ms-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-o-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:linear-gradient(top, #3b7796 0, #2f5b75 100%)}.LESSpopup_button_style{}.LESSpopup_button_hover_style{background:#5e88a3}.LESSpopup_button_press_style{background:#43a0d9;background:-webkit-gradient(linear,left top,left bottom,from( #43a0d9),to( #388bb9));background:-moz-linear-gradient(top, #43a0d9, #388bb9);background:-ms-linear-gradient(top, #43a0d9, #388bb9);background:-o-linear-gradient(top, #43a0d9, #388bb9)}.LESStoggleswitch_on_style{background:#2a7eac;background:-webkit-gradient(linear,left top,left bottom,from( #2174a7),to( #4ba5db));background:-moz-linear-gradient(top, #2174a7, #4ba5db);border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px}.LESStoggleswitch_off_style{color:#cbcbcb;background:#97a1a7;background:-webkit-gradient(linear,left top,left bottom,from( #727272),to( #8d8d8d));background:-moz-linear-gradient(top, #727272, #8d8d8d);border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px}.LESStoggleswitch_reed_style{background:#fdfdfd;background:-webkit-gradient(linear,left top,left bottom,from( #fdfdfd),to( #e7e7e7));background:-moz-linear-gradient(top, #fdfdfd, #e7e7e7);border-radius:2px;-webkit-border-radius:2px;-moz-border-radius:2px}.LESSbutton_editpress_style{background:#931818;background:-webkit-gradient(linear,left top,left bottom,from( #931818),to( #6e1717));background:-moz-linear-gradient(top, #931818, #6e1717)}.LESSbutton_edit_padding{padding:.5em .8em}.LESSmultimediaview_bar_active_style{background-color:#4a84c9;background-image:-webkit-gradient(linear,left top,left bottom,from( #6289d9),to( #295b98));background-image:-moz-linear-gradient(top, #6289d9, #295b98);background-image:-o-linear-gradient(top, #6289d9, #295b98);background-image:-ms-linear-gradient(top, #6289d9, #295b98)}.LESSmultimediaview_bar_handle_style{background-color:#f9f9f9;background-image:-webkit-gradient(linear,left top,left bottom,from( #fff),to( #e6e6e6));background-image:-moz-linear-gradient(top, #fff, #e6e6e6);background-image:-o-linear-gradient(top, #fff, #e6e6e6);background-image:-ms-linear-gradient(top, #fff, #e6e6e6)}.ui-header,.ui-footer,.ui-page-fullscreen .ui-header,.ui-page-fullscreen .ui-footer{position:absolute;overflow:hidden;width:100%;border-left-width:0;border-right-width:0}.ui-header-fixed,.ui-footer-fixed{z-index:1000;-webkit-transform:translatez(0)}.ui-footer-duplicate,.ui-page-fullscreen .ui-fixed-inline{display:none}.ui-page-fullscreen .ui-header,.ui-page-fullscreen .ui-footer{opacity:.9}.ui-navbar{overflow:hidden}.ui-navbar ul,.ui-navbar-expanded ul{list-style:none;padding:0;margin:0;position:relative;display:block;border:0}.ui-navbar-collapsed ul{float:left;width:75%;margin-right:-2px}.ui-navbar-collapsed .ui-navbar-toggle{float:left;width:25%}.ui-navbar li.ui-navbar-truncate{position:absolute;left:-9999px;top:-9999px}.ui-navbar li .ui-btn,.ui-navbar .ui-navbar-toggle .ui-btn{display:block;font-size:12px;text-align:center;margin:0;border-right-width:0}.ui-navbar li .ui-btn{margin-right:-1px}.ui-navbar li .ui-btn:last-child{margin-right:0}.ui-header .ui-navbar li .ui-btn,.ui-header .ui-navbar .ui-navbar-toggle .ui-btn,.ui-footer .ui-navbar li .ui-btn,.ui-footer .ui-navbar .ui-navbar-toggle .ui-btn{border-top-width:0;border-bottom-width:0}.ui-navbar .ui-btn-inner{padding-left:2px;padding-right:2px}.ui-navbar-noicons li .ui-btn .ui-btn-inner,.ui-navbar-noicons .ui-navbar-toggle .ui-btn-inner{padding-top:.8em;padding-bottom:.9em}.ui-navbar-expanded .ui-btn{margin:0;font-size:14px}.ui-navbar-expanded .ui-btn-inner{padding-left:5px;padding-right:5px}.ui-navbar-expanded .ui-btn-icon-top .ui-btn-inner{padding:45px 5px 15px;text-align:center}.ui-navbar-expanded .ui-btn-icon-top .ui-icon{top:15px}.ui-navbar-expanded .ui-btn-icon-bottom .ui-btn-inner{padding:15px 5px 45px;text-align:center}.ui-navbar-expanded .ui-btn-icon-bottom .ui-icon{bottom:15px}.ui-navbar-expanded li .ui-btn .ui-btn-inner{min-height:2.5em}.ui-navbar-expanded .ui-navbar-noicons .ui-btn .ui-btn-inner{padding-top:1.8em;padding-bottom:1.9em}.LESSbutton_box_style{color:#363133}.LESSbutton_up_style{background:#ebe8e3;background:-webkit-linear-gradient(top, #ebe8e3, #eae7e2);background:-moz-linear-gradient(top, #ebe8e3, #eae7e2);background:-o-linear-gradient(top, #ebe8e3, #eae7e2);background:-ms-linear-gradient(top, #ebe8e3, #eae7e2)}.LESSbutton_box_style{background:#ebe8e3;background:-webkit-linear-gradient(top, #ebe8e3, #eae7e2);background:-moz-linear-gradient(top, #ebe8e3, #eae7e2);background:-o-linear-gradient(top, #ebe8e3, #eae7e2);background:-ms-linear-gradient(top, #ebe8e3, #eae7e2);border:1px solid;border-color:#dcdad3;-o-box-shadow:0 0 1px 1px #fff;-ms-box-shadow:0 0 1px 1px #fff;-moz-box-shadow:0 0 1px 1px #fff;-webkit-box-shadow:0 0 1px 1px #fff;box-shadow:0 0 1px 1px #fff}.LESSbutton_inner_box_style{background:#f7f5ee;background:-webkit-linear-gradient(top, #faf7f2, #f8f5f0);background:-ms-linear-gradient(top, #faf7f2, #f8f5f0);background:-o-linear-gradient(top, #faf7f2, #f8f5f0);background:-moz-linear-gradient(top, #faf7f2, #f8f5f0);-o-box-shadow:none;-ms-box-shadow:none;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none}.LESSbutton_inner_pressstyle{color:#f8f6ef}.LESSbutton_text1_style{font-family:Helvetica,Arial,sans-serif;font-weight:400;font-size:1.0rem;font-style:normal;color:#000}.LESSbutton_hover_style{color:#363133}.LESSbutton_down_style{background:#3b73b6;color:#f8f6ef}.LESSbutton_edit_style{background:#c95858;background:-webkit-gradient(linear,left top,left bottom,from( #c95858),to( #a12828));background:-moz_linear-gradient(top, #c95858, #a12828)}.LESSDayselectorButtonNormal{background:#7e9db2;background:-webkit-linear-gradient(top, #7e9db2 0, #547990 100%);background:-moz-linear-gradient(top, #7e9db2 0, #547990 100%);background:-ms-linear-gradient(top, #7e9db2 0, #547990 100%);background:-o-linear-gradient(top, #7e9db2 0, #547990 100%);background:linear-gradient(top, #7e9db2 0, #547990 100%)}.LESSDayaselectorButtonPress{background:#3b7796;background:-webkit-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-moz-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-ms-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-o-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:linear-gradient(top, #3b7796 0, #2f5b75 100%)}.LESSpopup_button_style{}.LESSpopup_button_hover_style{background:#5e88a3}.LESSpopup_button_press_style{background:#43a0d9;background:-webkit-gradient(linear,left top,left bottom,from( #43a0d9),to( #388bb9));background:-moz-linear-gradient(top, #43a0d9, #388bb9);background:-ms-linear-gradient(top, #43a0d9, #388bb9);background:-o-linear-gradient(top, #43a0d9, #388bb9)}.LESStoggleswitch_on_style{background:#2a7eac;background:-webkit-gradient(linear,left top,left bottom,from( #2174a7),to( #4ba5db));background:-moz-linear-gradient(top, #2174a7, #4ba5db);border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px}.LESStoggleswitch_off_style{color:#cbcbcb;background:#97a1a7;background:-webkit-gradient(linear,left top,left bottom,from( #727272),to( #8d8d8d));background:-moz-linear-gradient(top, #727272, #8d8d8d);border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px}.LESStoggleswitch_reed_style{background:#fdfdfd;background:-webkit-gradient(linear,left top,left bottom,from( #fdfdfd),to( #e7e7e7));background:-moz-linear-gradient(top, #fdfdfd, #e7e7e7);border-radius:2px;-webkit-border-radius:2px;-moz-border-radius:2px}.LESSbutton_editpress_style{background:#931818;background:-webkit-gradient(linear,left top,left bottom,from( #931818),to( #6e1717));background:-moz-linear-gradient(top, #931818, #6e1717)}.LESSbutton_edit_padding{padding:.5em .8em}.LESSmultimediaview_bar_active_style{background-color:#4a84c9;background-image:-webkit-gradient(linear,left top,left bottom,from( #6289d9),to( #295b98));background-image:-moz-linear-gradient(top, #6289d9, #295b98);background-image:-o-linear-gradient(top, #6289d9, #295b98);background-image:-ms-linear-gradient(top, #6289d9, #295b98)}.LESSmultimediaview_bar_handle_style{background-color:#f9f9f9;background-image:-webkit-gradient(linear,left top,left bottom,from( #fff),to( #e6e6e6));background-image:-moz-linear-gradient(top, #fff, #e6e6e6);background-image:-o-linear-gradient(top, #fff, #e6e6e6);background-image:-ms-linear-gradient(top, #fff, #e6e6e6)}.ui-btn{display:block;text-align:center;cursor:pointer;position:relative;vertical-align:middle}.ui-btn:focus,.ui-btn:active{outline:0}.ui-header .ui-btn,.ui-footer .ui-btn,.ui-bar .ui-btn{display:inline-block;font-size:.5909090909090909rem;margin:0}.ui-btn-inline{display:inline-block}.ui-btn-inner{padding:.5em .4090909090909091rem;display:block;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;position:relative;zoom:1}.ui-header .ui-btn-inner,.ui-footer .ui-btn-inner,.ui-bar .ui-btn-inner{padding:.7em 0 .7em}.ui-header .ui-btn-inner.ui-btn-icon-only,.ui-footer .ui-btn-inner,.ui-bar .ui-btn-inner.ui-btn-icon-only{padding:.4em .36363636363636365rem .5em}.ui-btn-icon-notext{width:1.6363636363636365rem;height:1.6363636363636365rem}.ui-btn-icon-notext .ui-btn-inner{padding:.09090909090909091rem .045454545454545456rem .09090909090909091rem .13636363636363635rem}.ui-btn-icon-notext .ui-btn-inner .ui-icon{margin-left:-.7272727272727273rem;margin-top:-.7272727272727273rem}.ui-btn-icon-notext .ui-btn-text{position:absolute;left:-45.409090909090914rem}.ui-btn-icon-left .ui-btn-inner{padding-left:1.5rem}.ui-header .ui-btn-icon-left .ui-btn-inner,.ui-footer .ui-btn-icon-left .ui-btn-inner,.ui-bar .ui-btn-icon-left .ui-btn-inner{padding-left:1.2272727272727273rem}.ui-btn-icon-right .ui-btn-inner{padding-right:1.5rem}.ui-header .ui-btn-icon-right .ui-btn-inner,.ui-footer .ui-btn-icon-right .ui-btn-inner,.ui-bar .ui-btn-icon-right .ui-btn-inner{padding-right:1.2272727272727273rem}.ui-btn-icon-top .ui-btn-inner{padding-top:1.2272727272727273rem}.ui-header .ui-btn-icon-top .ui-btn-inner,.ui-footer .ui-btn-icon-top .ui-btn-inner,.ui-bar .ui-btn-icon-top .ui-btn-inner{padding-top:1.2272727272727273rem}.ui-btn-icon-bottom .ui-btn-inner{padding-bottom:1.5rem}.ui-header .ui-btn-icon-bottom .ui-btn-inner,.ui-footer .ui-btn-icon-bottom .ui-btn-inner,.ui-bar .ui-btn-icon-bottom .ui-btn-inner{padding-bottom:1.2272727272727273rem}.ui-btn-icon-notext .ui-icon{display:block}.ui-btn-icon-left .ui-icon,.ui-btn-icon-right .ui-icon,.ui-btn-icon-circle .ui-icon{position:absolute}.ui-btn-icon-top .ui-icon,.ui-btn-icon-bottom .ui-icon{position:absolute;left:50%;margin-left:-9px}.ui-btn-icon-left .ui-icon{left:0rem}.ui-btn-icon-circle .ui-icon{left:0rem}.ui-btn-icon-right .ui-icon{right:.4545454545454546rem}.ui-btn-icon-top .ui-icon{top:0rem;margin-top:0}.ui-btn-icon-bottom .ui-icon{bottom:0rem}.ui-header .ui-btn-icon-right .ui-icon,.ui-footer .ui-btn-icon-right .ui-icon,.ui-bar .ui-btn-icon-right .ui-icon{right:.18181818181818182rem}.ui-header .ui-btn-icon-top .ui-icon,.ui-footer .ui-btn-icon-top .ui-icon,.ui-bar .ui-btn-icon-top .ui-icon{top:.18181818181818182rem}.ui-header .ui-btn-icon-bottom .ui-icon,.ui-footer .ui-btn-icon-bottom .ui-icon,.ui-bar .ui-btn-icon-bottom .ui-icon{bottom:.18181818181818182rem}.ui-btn-hidden{position:absolute;top:0;left:0;width:100%;height:100%;-webkit-appearance:button;opacity:.1;cursor:pointer;background:transparent;font-size:.045454545454545456rem;border:0;line-height:45.409090909090914rem}.ui-btn-text{margin-left:auto;margin-right:auto;padding:0 1px}.ui-li .ui-btn.ui-btn-icon_only{top:50%;margin-top:-.7272727272727273rem}.ui-li .ui-btn .ui-btn-inner.ui-btn-hastxt{padding:.2em .5em}.ui-btn-icon-nobg.ui-btn-down-s .ui-btn-inner{background:transparent ! important}.ui-btn.ui-btn-box-s.ui-btn-down-s .ui-btn-inner{color:#f8f6ef}.ui-header .ui-btn-box-s:not(.ui-input-cancel):not(.ui-btn-search-front-icon),.ui-header .ui-btn-box-s:not(.ui-input-cancel):not(.ui-btn-search-front-icon) .ui-btn-inner,.ui-header .ui-btn.ui-btn-box-s.ui-btn-down-s:not(.ui-input-cancel):not(.ui-btn-search-front-icon) .ui-btn-inner,.ui-btn.ui-btn-back.ui-btn-up-s .ui-btn-inner,.ui-btn.ui-btn-back.ui-btn-hover-s .ui-btn-inner,.ui-btn.ui-btn-back.ui-btn-down-s .ui-btn-inner{background:transparent;border:0;box-shadow:none}.ui-btn-icon-top .ui-btn-inner.ui-btn-hastxt,.ui-li .ui-btn-icon-top .ui-btn-inner.ui-btn-hastxt{padding-top:2.3636363636363638rem}.ui-btn-icon-bottom .ui-btn-inner.ui-btn-hastxt,.ui-li .ui-btn-icon-bottom .ui-btn-inner.ui-btn-hastxt{padding-bottom:2.3636363636363638rem}.ui-btn .ui-icon{width:1.4545454545454546rem;height:1.4545454545454546rem}.ui-btn.ui-btn-edit .ui-icon{width:3.3636363636363638rem;height:3.3636363636363638rem}.ui-btn .ui-btn-text.ui-btn-text-padding-left{padding-left:2rem}.ui-btn .ui-btn-text.ui-btn-text-padding-right{padding-right:2.1818181818181817rem}.ui-btn .ui-btn-text.ui-btn-text-padding-top{padding-top:1.4545454545454546rem}.ui-icon{z-index:10;background-repeat:no-repeat;vertical-align:middle;background-position:0 0;background-size:100%}.ui-btn-box.s .ui-icon{position:absolute}.ui-btn-box-s.ui-btn-icon-left .ui-icon,.ui-btn-box-s.ui-btn-icon-right .ui-icon{margin-top:-.7272727272727273rem;top:50%}.ui-btn-box-s.ui-btn-icon-top .ui-icon,.ui-btn-box-s.ui-btn-icon-bottom .ui-icon{margin-left:-.7272727272727273rem;left:50%}.tizen-icon-common{width:1.4545454545454546rem;height:1.4545454545454546rem}.tizen-smallicon-common{width:.9090909090909092rem ! important;height:.9090909090909092rem ! important;top:50% ! important;left:50% ! important;margin-top:-.4545454545454546rem ! important;margin-left:-.4545454545454546rem ! important}.ui-icon-bg{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/00_btn_circle_bg_normal.png);z-index:0}.ui-icon-arrow-l{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/button/00_button_left.png)}.ui-icon-arrow-r{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/button/00_button_right.png)}.ui-icon-arrow-u{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/button/00_button_expand_opened.png)}.ui-icon-arrow-d{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/button/00_button_expand_closed.png)}.ui-icon-delete{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/button/00_button_expand_cancel.png)}.ui-icon-plus{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/button/00_button_plus.png)}.ui-icon-minus{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/button/00_button_expand_minus.png)}.ui-icon-check{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/button/00_button_check.png)}.ui-icon-gear{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/button/00_button_gear.png)}.ui-icon-refresh{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/button/00_button_refresh.png)}.ui-icon-forward{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/button/00_button_expand_send.png)}.ui-icon-back{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/button/00_button_back.png)}.ui-icon-grid{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/button/00_button_grid.png)}.ui-icon-star{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/button/00_button_star.png)}.ui-icon-alert{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/button/00_button_warning.png)}.ui-icon-info{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/button/00_button_info.png)}.ui-icon-home{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/button/00_button_home.png)}.ui-icon-search{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/button/00_button_search.png)}.ui-icon-call{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/button/00_button_call.png)}.ui-icon-rename{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/button/00_button_rename.png)}.ui-icon-scrolltop{width:.9090909090909092rem ! important;height:.9090909090909092rem ! important;top:50% ! important;left:50% ! important;margin-top:-.4545454545454546rem ! important;margin-left:-.4545454545454546rem ! important;background-image:url(images/controls/button/00_icon_jump.png)}.ui-icon-scrollleft{width:.9090909090909092rem ! important;height:.9090909090909092rem ! important;top:50% ! important;left:50% ! important;margin-top:-.4545454545454546rem ! important;margin-left:-.4545454545454546rem ! important;background-image:url(images/controls/button/00_icon_jump_left.png)}.ui-icon-expandable-divider-opened{width:1.9090909090909092rem;height:1.9090909090909092rem;position:absolute;right:1.2727272727272727rem;top:0rem;background-repeat:no-repeat;background-size:100% 100%;background-image:url(images/00_indexlist_icon_opened.png)}.ui-icon-expandable-divider-closed{width:1.9090909090909092rem;height:1.9090909090909092rem;position:absolute;right:1.2727272727272727rem;top:0rem;background-repeat:no-repeat;background-size:100% 100%;background-image:url(images/00_indexlist_icon_closed.png)}.ui-btn-down-s .ui-icon-bg,.ui-btn-down-s.ui-tizen-icon-bg{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/00_btn_circle_bg_press.png);z-index:0}.ui-btn-down-s .ui-icon-arrow-l{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/button/00_button_left_press.png)}.ui-btn-down-s .ui-icon-arrow-r{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/button/00_button_right_press.png)}.ui-btn-down-s .ui-icon-arrow-u{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/button/00_button_expand_opened_press.png)}.ui-btn-down-s .ui-icon-arrow-d{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/button/00_button_expand_closed_press.png)}.ui-btn-down-s .ui-icon-delete{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/button/00_button_expand_cancel_press.png)}.ui-btn-down-s .ui-icon-plus{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/button/00_button_plus_press.png)}.ui-btn-down-s .ui-icon-minus{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/button/00_button_expand_minus_press.png)}.ui-btn-down-s .ui-icon-check{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/button/00_button_check_press.png)}.ui-btn-down-s .ui-icon-gear{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/button/00_button_gear_press.png)}.ui-btn-down-s .ui-icon-refresh{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/button/00_button_refresh_press.png)}.ui-btn-down-s .ui-icon-forward{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/button/00_button_expand_send_press.png)}.ui-btn-down-s .ui-icon-back{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/button/00_button_back_press.png)}.ui-btn-down-s .ui-icon-grid{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/button/00_button_grid_press.png)}.ui-btn-down-s .ui-icon-star{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/button/00_button_star_press.png)}.ui-btn-down-s .ui-icon-alert{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/button/00_button_warning_press.png)}.ui-btn-down-s .ui-icon-info{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/button/00_button_info_press.png)}.ui-btn-down-s .ui-icon-home{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/button/00_button_home_press.png)}.ui-btn-down-s .ui-icon-search{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/button/00_button_search_press.png)}.ui-btn-down-s .ui-icon-call{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/button/00_button_call_press.png)}.ui-btn-down-s .ui-icon-rename{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/button/00_button_rename_press.png)}.ui-btn-down-s .ui-icon-scrolltop{width:.9090909090909092rem ! important;height:.9090909090909092rem ! important;top:50% ! important;left:50% ! important;margin-top:-.4545454545454546rem ! important;margin-left:-.4545454545454546rem ! important;background-image:url(images/controls/button/00_icon_jump_press.png)}.ui-btn-down-s .ui-icon-scrollleft{width:.9090909090909092rem ! important;height:.9090909090909092rem ! important;top:50% ! important;left:50% ! important;margin-top:-.4545454545454546rem ! important;margin-left:-.4545454545454546rem ! important;background-image:url(images/controls/button/00_icon_jump_left_press.png)}.ui-btn-inner.ui-btn-icon-only{padding:.7272727272727273rem .7272727272727273rem}.ui-btn-icon-only .ui-btn-text{left:-9999px;display:none}.ui-btn.ui-btn-corner-all{-o-border-radius:1.2em ! important;-ms-border-radius:1.2em ! important;-moz-border-radius:1.2em ! important;-webkit-border-radius:1.2em ! important;border-radius:1.2em ! important}.ui-btn.ui-btn-icon-nobg{box-shadow:none}.ui-btn-corner-circle{-o-border-radius:1em ! important;-ms-border-radius:1em ! important;-moz-border-radius:1em ! important;-webkit-border-radius:1em ! important;border-radius:1em ! important}.ui-btn-round{-o-border-radius:1.2em ! important;-ms-border-radius:1.2em ! important;-moz-border-radius:1.2em ! important;-webkit-border-radius:1.2em ! important;border-radius:1.2em ! important}.ui-btn-round .ui-btn-inner{-o-border-radius:1.2em ! important;-ms-border-radius:1.2em ! important;-moz-border-radius:1.2em ! important;-webkit-border-radius:1.2em ! important;border-radius:1.2em ! important}.ui-btn.ui-btn-icon-nobg,.ui-btn .ui-btn-icon-nobg{background:transparent;background-color:transparent;border:0}.ui-btn.ui-btn-edit .ui-btn-text{color:#f9f9f9}.ui-btn.ui-btn-edit .ui-btn-inner{background:#c95858;background:-webkit-gradient(linear,left top,left bottom,from( #c95858),to( #a12828));background:-moz_linear-gradient(top, #c95858, #a12828)}.ui-btn-box-s{color:#363133;background:#ebe8e3;background:-webkit-linear-gradient(top, #ebe8e3, #eae7e2);background:-moz-linear-gradient(top, #ebe8e3, #eae7e2);background:-o-linear-gradient(top, #ebe8e3, #eae7e2);background:-ms-linear-gradient(top, #ebe8e3, #eae7e2);border:1px solid;border-color:#dcdad3;-o-box-shadow:0 0 1px 1px #fff;-ms-box-shadow:0 0 1px 1px #fff;-moz-box-shadow:0 0 1px 1px #fff;-webkit-box-shadow:0 0 1px 1px #fff;box-shadow:0 0 1px 1px #fff}.LESSbutton_box_style{color:#363133}.LESSbutton_up_style{background:#ebe8e3;background:-webkit-linear-gradient(top, #ebe8e3, #eae7e2);background:-moz-linear-gradient(top, #ebe8e3, #eae7e2);background:-o-linear-gradient(top, #ebe8e3, #eae7e2);background:-ms-linear-gradient(top, #ebe8e3, #eae7e2)}.LESSbutton_box_style{background:#ebe8e3;background:-webkit-linear-gradient(top, #ebe8e3, #eae7e2);background:-moz-linear-gradient(top, #ebe8e3, #eae7e2);background:-o-linear-gradient(top, #ebe8e3, #eae7e2);background:-ms-linear-gradient(top, #ebe8e3, #eae7e2);border:1px solid;border-color:#dcdad3;-o-box-shadow:0 0 1px 1px #fff;-ms-box-shadow:0 0 1px 1px #fff;-moz-box-shadow:0 0 1px 1px #fff;-webkit-box-shadow:0 0 1px 1px #fff;box-shadow:0 0 1px 1px #fff}.LESSbutton_inner_box_style{background:#f7f5ee;background:-webkit-linear-gradient(top, #faf7f2, #f8f5f0);background:-ms-linear-gradient(top, #faf7f2, #f8f5f0);background:-o-linear-gradient(top, #faf7f2, #f8f5f0);background:-moz-linear-gradient(top, #faf7f2, #f8f5f0);-o-box-shadow:none;-ms-box-shadow:none;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none}.LESSbutton_inner_pressstyle{color:#f8f6ef}.LESSbutton_text1_style{font-family:Helvetica,Arial,sans-serif;font-weight:400;font-size:1.0rem;font-style:normal;color:#000}.LESSbutton_hover_style{color:#363133}.LESSbutton_down_style{background:#3b73b6;color:#f8f6ef}.LESSbutton_edit_style{background:#c95858;background:-webkit-gradient(linear,left top,left bottom,from( #c95858),to( #a12828));background:-moz_linear-gradient(top, #c95858, #a12828)}.LESSDayselectorButtonNormal{background:#7e9db2;background:-webkit-linear-gradient(top, #7e9db2 0, #547990 100%);background:-moz-linear-gradient(top, #7e9db2 0, #547990 100%);background:-ms-linear-gradient(top, #7e9db2 0, #547990 100%);background:-o-linear-gradient(top, #7e9db2 0, #547990 100%);background:linear-gradient(top, #7e9db2 0, #547990 100%)}.LESSDayaselectorButtonPress{background:#3b7796;background:-webkit-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-moz-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-ms-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-o-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:linear-gradient(top, #3b7796 0, #2f5b75 100%)}.LESSpopup_button_style{}.LESSpopup_button_hover_style{background:#5e88a3}.LESSpopup_button_press_style{background:#43a0d9;background:-webkit-gradient(linear,left top,left bottom,from( #43a0d9),to( #388bb9));background:-moz-linear-gradient(top, #43a0d9, #388bb9);background:-ms-linear-gradient(top, #43a0d9, #388bb9);background:-o-linear-gradient(top, #43a0d9, #388bb9)}.LESStoggleswitch_on_style{background:#2a7eac;background:-webkit-gradient(linear,left top,left bottom,from( #2174a7),to( #4ba5db));background:-moz-linear-gradient(top, #2174a7, #4ba5db);border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px}.LESStoggleswitch_off_style{color:#cbcbcb;background:#97a1a7;background:-webkit-gradient(linear,left top,left bottom,from( #727272),to( #8d8d8d));background:-moz-linear-gradient(top, #727272, #8d8d8d);border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px}.LESStoggleswitch_reed_style{background:#fdfdfd;background:-webkit-gradient(linear,left top,left bottom,from( #fdfdfd),to( #e7e7e7));background:-moz-linear-gradient(top, #fdfdfd, #e7e7e7);border-radius:2px;-webkit-border-radius:2px;-moz-border-radius:2px}.LESSbutton_editpress_style{background:#931818;background:-webkit-gradient(linear,left top,left bottom,from( #931818),to( #6e1717));background:-moz-linear-gradient(top, #931818, #6e1717)}.LESSbutton_edit_padding{padding:.5em .8em}.LESSmultimediaview_bar_active_style{background-color:#4a84c9;background-image:-webkit-gradient(linear,left top,left bottom,from( #6289d9),to( #295b98));background-image:-moz-linear-gradient(top, #6289d9, #295b98);background-image:-o-linear-gradient(top, #6289d9, #295b98);background-image:-ms-linear-gradient(top, #6289d9, #295b98)}.LESSmultimediaview_bar_handle_style{background-color:#f9f9f9;background-image:-webkit-gradient(linear,left top,left bottom,from( #fff),to( #e6e6e6));background-image:-moz-linear-gradient(top, #fff, #e6e6e6);background-image:-o-linear-gradient(top, #fff, #e6e6e6);background-image:-ms-linear-gradient(top, #fff, #e6e6e6)}.ui-collapsible-inset{margin:.5em 0}.ui-collapsible-inset .ui-collapsible-heading{margin:0}.ui-collapsible-inset .ui-collapsible-heading .ui-btn{border-right-width:1px;border-left-width:1px}.ui-collapsible-collapsed+.ui-collapsible:not(.ui-collapsible-inset) .ui-collapsible-heading .ui-btn{border-top-width:0}.ui-collapsible-set .ui-collapsible:not(.ui-collapsible-inset) .ui-collapsible-heading .ui-btn{border-top-width:1px}.ui-collapsible-heading{font-size:1rem;display:block;margin:0 -15px;padding:0;position:relative}.ui-collapsible-heading .ui-btn{text-align:left;margin:0;border-left-width:0;border-right-width:0}.ui-collapsible-heading .ui-btn-text{color:#000}.ui-collapsible-heading .ui-btn-inner,.ui-collapsible-heading .ui-btn-icon-left .ui-btn-inner{padding-left:40px}.ui-collapsible-heading .ui-btn-icon-right .ui-btn-inner{padding-left:12px;padding-right:40px}.ui-collapsible-heading .ui-btn-icon-top .ui-btn-inner,.ui-collapsible-heading .ui-btn-icon-bottom .ui-btn-inner{padding-right:40px;text-align:center}.ui-collapsible-heading .ui-btn-inner>.ui-icon-arrow-d{-webkit-transition:all .33s ease;-moz-transition:all .33s ease;-ms-transition:all .33s ease;-o-transition:all .33s ease;transition:all .33s ease;-webkit-transform:rotate(180deg);-moz-transform:rotate(180deg);-ms-transform:rotate(180deg);-o-transform:rotate(180deg);transform:rotate(180deg)}.ui-collapsible-heading .ui-btn-inner>.ui-icon-arrow-u{background-image:url(images/controls/button/00_button_expand_closed.png);-webkit-transition:all .33s ease;-moz-transition:all .33s ease;-ms-transition:all .33s ease;-o-transition:all .33s ease;transition:all .33s ease;-webkit-transform:rotate(0deg);-moz-transform:rotate(0deg);-ms-transform:rotate(0deg);-o-transform:rotate(0deg);transform:rotate(0deg)}.ui-collapsible-heading .ui-btn span.ui-btn{position:absolute;left:6px;top:50%;margin:-12px 0 0 0;width:20px;height:20px;padding:1px 0 1px 2px;text-indent:-9999px}.ui-collapsible-heading .ui-btn span.ui-btn .ui-btn-inner{padding:10px 0}.ui-collapsible-heading .ui-btn span.ui-btn .ui-icon{left:0;margin-top:-10px}.ui-collapsible-heading-status{position:absolute;top:-9999px;left:0}.ui-collapsible-content{display:block;margin:0 -15px;padding:0 15px;border-left-width:0;border-right-width:0;border-top:0;background-image:none;visibility:visible;overflow:auto;-webkit-transition:all .5s ease;-moz-transition:all .5s ease;-ms-transition:all .5s ease;-o-transition:all .5s ease;transition:all .5s ease}.ui-collapsible-inset .ui-collapsible-content{margin:0;border-right-width:1px;border-left-width:1px}.ui-collapsible-content-collapsed{overflow:hidden;max-height:0!important;visibility:hidden}.ui-collapsible-set{margin:.5em 0}.ui-collapsible-set .ui-collapsible{margin:-1px 0 0}.ui-collapsible-set .ui-collapsible:first-child{margin-top:0}.LESSbutton_box_style{color:#363133}.LESSbutton_up_style{background:#ebe8e3;background:-webkit-linear-gradient(top, #ebe8e3, #eae7e2);background:-moz-linear-gradient(top, #ebe8e3, #eae7e2);background:-o-linear-gradient(top, #ebe8e3, #eae7e2);background:-ms-linear-gradient(top, #ebe8e3, #eae7e2)}.LESSbutton_box_style{background:#ebe8e3;background:-webkit-linear-gradient(top, #ebe8e3, #eae7e2);background:-moz-linear-gradient(top, #ebe8e3, #eae7e2);background:-o-linear-gradient(top, #ebe8e3, #eae7e2);background:-ms-linear-gradient(top, #ebe8e3, #eae7e2);border:1px solid;border-color:#dcdad3;-o-box-shadow:0 0 1px 1px #fff;-ms-box-shadow:0 0 1px 1px #fff;-moz-box-shadow:0 0 1px 1px #fff;-webkit-box-shadow:0 0 1px 1px #fff;box-shadow:0 0 1px 1px #fff}.LESSbutton_inner_box_style{background:#f7f5ee;background:-webkit-linear-gradient(top, #faf7f2, #f8f5f0);background:-ms-linear-gradient(top, #faf7f2, #f8f5f0);background:-o-linear-gradient(top, #faf7f2, #f8f5f0);background:-moz-linear-gradient(top, #faf7f2, #f8f5f0);-o-box-shadow:none;-ms-box-shadow:none;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none}.LESSbutton_inner_pressstyle{color:#f8f6ef}.LESSbutton_text1_style{font-family:Helvetica,Arial,sans-serif;font-weight:400;font-size:1.0rem;font-style:normal;color:#000}.LESSbutton_hover_style{color:#363133}.LESSbutton_down_style{background:#3b73b6;color:#f8f6ef}.LESSbutton_edit_style{background:#c95858;background:-webkit-gradient(linear,left top,left bottom,from( #c95858),to( #a12828));background:-moz_linear-gradient(top, #c95858, #a12828)}.LESSDayselectorButtonNormal{background:#7e9db2;background:-webkit-linear-gradient(top, #7e9db2 0, #547990 100%);background:-moz-linear-gradient(top, #7e9db2 0, #547990 100%);background:-ms-linear-gradient(top, #7e9db2 0, #547990 100%);background:-o-linear-gradient(top, #7e9db2 0, #547990 100%);background:linear-gradient(top, #7e9db2 0, #547990 100%)}.LESSDayaselectorButtonPress{background:#3b7796;background:-webkit-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-moz-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-ms-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-o-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:linear-gradient(top, #3b7796 0, #2f5b75 100%)}.LESSpopup_button_style{}.LESSpopup_button_hover_style{background:#5e88a3}.LESSpopup_button_press_style{background:#43a0d9;background:-webkit-gradient(linear,left top,left bottom,from( #43a0d9),to( #388bb9));background:-moz-linear-gradient(top, #43a0d9, #388bb9);background:-ms-linear-gradient(top, #43a0d9, #388bb9);background:-o-linear-gradient(top, #43a0d9, #388bb9)}.LESStoggleswitch_on_style{background:#2a7eac;background:-webkit-gradient(linear,left top,left bottom,from( #2174a7),to( #4ba5db));background:-moz-linear-gradient(top, #2174a7, #4ba5db);border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px}.LESStoggleswitch_off_style{color:#cbcbcb;background:#97a1a7;background:-webkit-gradient(linear,left top,left bottom,from( #727272),to( #8d8d8d));background:-moz-linear-gradient(top, #727272, #8d8d8d);border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px}.LESStoggleswitch_reed_style{background:#fdfdfd;background:-webkit-gradient(linear,left top,left bottom,from( #fdfdfd),to( #e7e7e7));background:-moz-linear-gradient(top, #fdfdfd, #e7e7e7);border-radius:2px;-webkit-border-radius:2px;-moz-border-radius:2px}.LESSbutton_editpress_style{background:#931818;background:-webkit-gradient(linear,left top,left bottom,from( #931818),to( #6e1717));background:-moz-linear-gradient(top, #931818, #6e1717)}.LESSbutton_edit_padding{padding:.5em .8em}.LESSmultimediaview_bar_active_style{background-color:#4a84c9;background-image:-webkit-gradient(linear,left top,left bottom,from( #6289d9),to( #295b98));background-image:-moz-linear-gradient(top, #6289d9, #295b98);background-image:-o-linear-gradient(top, #6289d9, #295b98);background-image:-ms-linear-gradient(top, #6289d9, #295b98)}.LESSmultimediaview_bar_handle_style{background-color:#f9f9f9;background-image:-webkit-gradient(linear,left top,left bottom,from( #fff),to( #e6e6e6));background-image:-moz-linear-gradient(top, #fff, #e6e6e6);background-image:-o-linear-gradient(top, #fff, #e6e6e6);background-image:-ms-linear-gradient(top, #fff, #e6e6e6)}.ui-dialog{min-height:480px}.ui-dialog .ui-header,.ui-dialog .ui-content,.ui-dialog .ui-footer{margin:15px;position:relative}.ui-dialog .ui-header,.ui-dialog .ui-footer{z-index:10;width:auto}.ui-dialog .ui-header .ui-btn-left{width:0;border-width:0}.ui-dialog .center_info{display:-moz-box;display:-webkit-box;display:box;-ms-box-orient:vertical;-moz-box-orient:vertical;-o-box-orient:vertical;-webkit-box-orient:vertical;box-orient:vertical;-ms-box-align:center;-moz-box-align:center;-o-box-align:center;-webkit-box-align:center;box-align:center;-ms-box-pack:center;-moz-box-pack:center;-o-box-pack:center;-webkit-box-pack:center;box-pack:center}.ui-dialog .center_info .popup-text{font-size:42px;background:#213c49;width:100%}.ui-dialog .center_info .popup-text p{text-align:center;padding:22px 16px}.LESSbutton_box_style{color:#363133}.LESSbutton_up_style{background:#ebe8e3;background:-webkit-linear-gradient(top, #ebe8e3, #eae7e2);background:-moz-linear-gradient(top, #ebe8e3, #eae7e2);background:-o-linear-gradient(top, #ebe8e3, #eae7e2);background:-ms-linear-gradient(top, #ebe8e3, #eae7e2)}.LESSbutton_box_style{background:#ebe8e3;background:-webkit-linear-gradient(top, #ebe8e3, #eae7e2);background:-moz-linear-gradient(top, #ebe8e3, #eae7e2);background:-o-linear-gradient(top, #ebe8e3, #eae7e2);background:-ms-linear-gradient(top, #ebe8e3, #eae7e2);border:1px solid;border-color:#dcdad3;-o-box-shadow:0 0 1px 1px #fff;-ms-box-shadow:0 0 1px 1px #fff;-moz-box-shadow:0 0 1px 1px #fff;-webkit-box-shadow:0 0 1px 1px #fff;box-shadow:0 0 1px 1px #fff}.LESSbutton_inner_box_style{background:#f7f5ee;background:-webkit-linear-gradient(top, #faf7f2, #f8f5f0);background:-ms-linear-gradient(top, #faf7f2, #f8f5f0);background:-o-linear-gradient(top, #faf7f2, #f8f5f0);background:-moz-linear-gradient(top, #faf7f2, #f8f5f0);-o-box-shadow:none;-ms-box-shadow:none;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none}.LESSbutton_inner_pressstyle{color:#f8f6ef}.LESSbutton_text1_style{font-family:Helvetica,Arial,sans-serif;font-weight:400;font-size:1.0rem;font-style:normal;color:#000}.LESSbutton_hover_style{color:#363133}.LESSbutton_down_style{background:#3b73b6;color:#f8f6ef}.LESSbutton_edit_style{background:#c95858;background:-webkit-gradient(linear,left top,left bottom,from( #c95858),to( #a12828));background:-moz_linear-gradient(top, #c95858, #a12828)}.LESSDayselectorButtonNormal{background:#7e9db2;background:-webkit-linear-gradient(top, #7e9db2 0, #547990 100%);background:-moz-linear-gradient(top, #7e9db2 0, #547990 100%);background:-ms-linear-gradient(top, #7e9db2 0, #547990 100%);background:-o-linear-gradient(top, #7e9db2 0, #547990 100%);background:linear-gradient(top, #7e9db2 0, #547990 100%)}.LESSDayaselectorButtonPress{background:#3b7796;background:-webkit-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-moz-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-ms-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-o-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:linear-gradient(top, #3b7796 0, #2f5b75 100%)}.LESSpopup_button_style{}.LESSpopup_button_hover_style{background:#5e88a3}.LESSpopup_button_press_style{background:#43a0d9;background:-webkit-gradient(linear,left top,left bottom,from( #43a0d9),to( #388bb9));background:-moz-linear-gradient(top, #43a0d9, #388bb9);background:-ms-linear-gradient(top, #43a0d9, #388bb9);background:-o-linear-gradient(top, #43a0d9, #388bb9)}.LESStoggleswitch_on_style{background:#2a7eac;background:-webkit-gradient(linear,left top,left bottom,from( #2174a7),to( #4ba5db));background:-moz-linear-gradient(top, #2174a7, #4ba5db);border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px}.LESStoggleswitch_off_style{color:#cbcbcb;background:#97a1a7;background:-webkit-gradient(linear,left top,left bottom,from( #727272),to( #8d8d8d));background:-moz-linear-gradient(top, #727272, #8d8d8d);border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px}.LESStoggleswitch_reed_style{background:#fdfdfd;background:-webkit-gradient(linear,left top,left bottom,from( #fdfdfd),to( #e7e7e7));background:-moz-linear-gradient(top, #fdfdfd, #e7e7e7);border-radius:2px;-webkit-border-radius:2px;-moz-border-radius:2px}.LESSbutton_editpress_style{background:#931818;background:-webkit-gradient(linear,left top,left bottom,from( #931818),to( #6e1717));background:-moz-linear-gradient(top, #931818, #6e1717)}.LESSbutton_edit_padding{padding:.5em .8em}.LESSmultimediaview_bar_active_style{background-color:#4a84c9;background-image:-webkit-gradient(linear,left top,left bottom,from( #6289d9),to( #295b98));background-image:-moz-linear-gradient(top, #6289d9, #295b98);background-image:-o-linear-gradient(top, #6289d9, #295b98);background-image:-ms-linear-gradient(top, #6289d9, #295b98)}.LESSmultimediaview_bar_handle_style{background-color:#f9f9f9;background-image:-webkit-gradient(linear,left top,left bottom,from( #fff),to( #e6e6e6));background-image:-moz-linear-gradient(top, #fff, #e6e6e6);background-image:-o-linear-gradient(top, #fff, #e6e6e6);background-image:-ms-linear-gradient(top, #fff, #e6e6e6)}.ui-checkbox .ui-btn-inner,.ui-radio .ui-btn-inner{white-space:normal}.ui-checkbox,.ui-radio{position:relative;margin:0}.ui-checkbox .ui-btn-corner-all,.ui-radio .ui-btn-corner-all{-o-border-radius:0;-ms-border-radius:0;-moz-border-radius:0;-webkit-border-radius:0;border-radius:0}.ui-checkbox .ui-btn-inner,.ui-radio .ui-btn-inner{border-top:0}.ui-checkbox .ui-btn-up-s,.ui-radio .ui-btn-up-s{border:0;background:transparent;font-weight:400}.ui-checkbox .ui-btn-hover-s,.ui-radio .ui-btn-hover-s{border:0;background:transparent;font-weight:400}.ui-checkbox .ui-btn-down-s,.ui-radio .ui-btn-down-s{border:0;background:transparent;font-weight:400}.ui-checkbox input,.ui-radio input{z-index:1;margin:0;left:.4545454545454546rem;position:absolute;outline:0!important}.ui-checkbox>input,.ui-radio>input{display:none}.ui-checkbox .ui-btn,.ui-radio .ui-btn{z-index:2;height:100%;margin:0;text-align:left}.ui-checkbox .ui-btn.ui-btn-icon-left,.ui-radio .ui-btn.ui-btn-icon-left{display:inline-block}.ui-checkbox .ui-btn.ui-btn-icon-left .ui-btn-inner,.ui-radio .ui-btn.ui-btn-icon-left .ui-btn-inner{min-width:1.8181818181818183rem;display:inline-block;line-height:1.4545454545454546rem;padding:0 .7272727272727273rem 0 .7272727272727273rem}.ui-checkbox .ui-btn.ui-btn-icon-left .ui-btn-inner .ui-btn-text,.ui-radio .ui-btn.ui-btn-icon-left .ui-btn-inner .ui-btn-text{display:inline-block;vertical-align:middle;min-height:1.4545454545454546rem}.ui-checkbox .ui-btn.ui-btn-icon-left .ui-btn-inner .ui-btn-text.ui-btn-text-padding-left,.ui-radio .ui-btn.ui-btn-icon-left .ui-btn-inner .ui-btn-text.ui-btn-text-padding-left{padding-left:1.0909090909090908rem}.ui-checkbox .ui-btn.ui-btn-icon-left .ui-btn-inner .ui-icon,.ui-radio .ui-btn.ui-btn-icon-left .ui-btn-inner .ui-icon{position:absolute;top:50%;width:1.4545454545454546rem;height:1.4545454545454546rem;margin-top:-.7272727272727273rem}.ui-checkbox.favorite input{position:absolute;left:-10000px;height:100%;outline:0!important}.ui-checkbox.favorite .ui-btn.ui-btn-icon-left{display:block}.ui-checkbox.favorite .ui-btn.ui-btn-icon-left .ui-btn-inner{display:inline-block;line-height:1.4545454545454546rem;padding:0 0 0 .7272727272727273rem}.ui-checkbox.favorite .ui-btn.ui-btn-icon-left .ui-btn-inner .ui-btn-text{display:inline-block;vertical-align:middle}.ui-checkbox.favorite .ui-btn.ui-btn-icon-left .ui-btn-inner .ui-btn-text.ui-btn-text-padding-left{padding-left:1.0909090909090908rem}.ui-checkbox.favorite .ui-btn.ui-btn-icon-left .ui-btn-inner .ui-icon{position:absolute;top:50%;width:1.4545454545454546rem;height:1.4545454545454546rem;margin-top:-.7272727272727273rem}.ui-icon-checkbox-off,.ui-icon-checkbox-on,.favorite .ui-icon-checkbox-off,.favorite .ui-icon-checkbox-on,.ui-icon-checkbox-on-press,.ui-icon-checkbox-off-press,.ui-icon-radio-off,.ui-icon-radio-on,.ui-icon-radio-on-press,.ui-icon-radio-off-press{background-size:100% 100%;background-color:transparent}.ui-icon-checkbox-off{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/00_check_bg.png)}.ui-icon-checkbox-on{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/00_check_checking.png),url(images/00_check_bg.png);background-repeat:no-repeat}.ui-icon-checkbox-off-press{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/00_check_bg_press.png)}.ui-icon-checkbox-on-press{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/00_check_checking.png),url(images/00_check_bg_press.png);background-repeat:no-repeat}.favorite .ui-icon-checkbox-off,.favorite .ui-icon-checkbox-off-press{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/00_icon_favorite_off.png)}.favorite .ui-icon-checkbox-on,.favorite .ui-icon-checkbox-on-press{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/00_icon_favorite_on.png)}.ui-icon-radio-off{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/00_button_radio.png)}.ui-icon-radio-on{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/00_button_radio_select.png),url(images/00_button_radio.png)}.ui-icon-radio-on-press{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/00_button_radio.png)}.ui-icon-radio-off-press{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/00_button_radio.png)}.ui-field-contain{padding:1.5em 0;margin:0;border-bottom-width:1px;overflow:visible}.ui-field-contain:first-child{border-top-width:0}@media all{.ui-field-contain{ border-width:0;padding:0;margin:.8em 0}}.ui-select{display:block;position:relative}.ui-select select{position:absolute;left:-9999px;top:-9999px}.ui-select .ui-btn{overflow:hidden}.ui-select .ui-btn select{cursor:pointer;-webkit-appearance:button;left:0;top:0;width:100%;min-height:1.5em;min-height:100%;height:3em;max-height:100%;opacity:0;-ms-filter:"alpha(Opacity=0)";filter:alpha(opacity=0);z-index:2}@-moz-document url-prefix(){.ui-select .ui-btn select{ opacity:.0001}}.ui-select .ui-btn select.ui-select-nativeonly{opacity:1;text-indent:0}.ui-select .ui-btn-icon-right .ui-btn-inner{padding-right:45px}.ui-select .ui-btn-icon-right .ui-icon{right:15px}label.ui-select{font-size:16px;line-height:1.4;font-weight:400;margin:0 0 .3em;display:block}.ui-select .ui-btn-text,.ui-selectmenu .ui-btn-text{display:block;min-height:1em}.ui-select .ui-btn-text{text-overflow:ellipsis;overflow:hidden}.ui-selectmenu{position:absolute;padding:0;z-index:100!important;width:80%;max-width:350px;padding:6px}.ui-selectmenu .ui-listview{margin:0}.ui-selectmenu .ui-btn.ui-li-divider{cursor:default}.ui-selectmenu-hidden{top:-9999px;left:-9999px}.ui-selectmenu-screen{position:absolute;top:0;left:0;width:100%;height:100%;z-index:99}.ui-screen-hidden,.ui-selectmenu-list .ui-li .ui-icon{display:none}.ui-selectmenu-list .ui-li .ui-icon{display:block}.ui-li.ui-selectmenu-placeholder{display:none}.ui-selectmenu .ui-header .ui-title{margin:.6em 46px .8em}@media all and (min-width: 450px){label.ui-select{ vertical-align:top;display:inline-block;width:20%;margin:0 2% 0 0}.ui-select{width:60%;display:inline-block}}.ui-selectmenu .ui-header h1:after{content:'.';visibility:hidden}.LESSbutton_box_style{color:#363133}.LESSbutton_up_style{background:#ebe8e3;background:-webkit-linear-gradient(top, #ebe8e3, #eae7e2);background:-moz-linear-gradient(top, #ebe8e3, #eae7e2);background:-o-linear-gradient(top, #ebe8e3, #eae7e2);background:-ms-linear-gradient(top, #ebe8e3, #eae7e2)}.LESSbutton_box_style{background:#ebe8e3;background:-webkit-linear-gradient(top, #ebe8e3, #eae7e2);background:-moz-linear-gradient(top, #ebe8e3, #eae7e2);background:-o-linear-gradient(top, #ebe8e3, #eae7e2);background:-ms-linear-gradient(top, #ebe8e3, #eae7e2);border:1px solid;border-color:#dcdad3;-o-box-shadow:0 0 1px 1px #fff;-ms-box-shadow:0 0 1px 1px #fff;-moz-box-shadow:0 0 1px 1px #fff;-webkit-box-shadow:0 0 1px 1px #fff;box-shadow:0 0 1px 1px #fff}.LESSbutton_inner_box_style{background:#f7f5ee;background:-webkit-linear-gradient(top, #faf7f2, #f8f5f0);background:-ms-linear-gradient(top, #faf7f2, #f8f5f0);background:-o-linear-gradient(top, #faf7f2, #f8f5f0);background:-moz-linear-gradient(top, #faf7f2, #f8f5f0);-o-box-shadow:none;-ms-box-shadow:none;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none}.LESSbutton_inner_pressstyle{color:#f8f6ef}.LESSbutton_text1_style{font-family:Helvetica,Arial,sans-serif;font-weight:400;font-size:1.0rem;font-style:normal;color:#000}.LESSbutton_hover_style{color:#363133}.LESSbutton_down_style{background:#3b73b6;color:#f8f6ef}.LESSbutton_edit_style{background:#c95858;background:-webkit-gradient(linear,left top,left bottom,from( #c95858),to( #a12828));background:-moz_linear-gradient(top, #c95858, #a12828)}.LESSDayselectorButtonNormal{background:#7e9db2;background:-webkit-linear-gradient(top, #7e9db2 0, #547990 100%);background:-moz-linear-gradient(top, #7e9db2 0, #547990 100%);background:-ms-linear-gradient(top, #7e9db2 0, #547990 100%);background:-o-linear-gradient(top, #7e9db2 0, #547990 100%);background:linear-gradient(top, #7e9db2 0, #547990 100%)}.LESSDayaselectorButtonPress{background:#3b7796;background:-webkit-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-moz-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-ms-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-o-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:linear-gradient(top, #3b7796 0, #2f5b75 100%)}.LESSpopup_button_style{}.LESSpopup_button_hover_style{background:#5e88a3}.LESSpopup_button_press_style{background:#43a0d9;background:-webkit-gradient(linear,left top,left bottom,from( #43a0d9),to( #388bb9));background:-moz-linear-gradient(top, #43a0d9, #388bb9);background:-ms-linear-gradient(top, #43a0d9, #388bb9);background:-o-linear-gradient(top, #43a0d9, #388bb9)}.LESStoggleswitch_on_style{background:#2a7eac;background:-webkit-gradient(linear,left top,left bottom,from( #2174a7),to( #4ba5db));background:-moz-linear-gradient(top, #2174a7, #4ba5db);border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px}.LESStoggleswitch_off_style{color:#cbcbcb;background:#97a1a7;background:-webkit-gradient(linear,left top,left bottom,from( #727272),to( #8d8d8d));background:-moz-linear-gradient(top, #727272, #8d8d8d);border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px}.LESStoggleswitch_reed_style{background:#fdfdfd;background:-webkit-gradient(linear,left top,left bottom,from( #fdfdfd),to( #e7e7e7));background:-moz-linear-gradient(top, #fdfdfd, #e7e7e7);border-radius:2px;-webkit-border-radius:2px;-moz-border-radius:2px}.LESSbutton_editpress_style{background:#931818;background:-webkit-gradient(linear,left top,left bottom,from( #931818),to( #6e1717));background:-moz-linear-gradient(top, #931818, #6e1717)}.LESSbutton_edit_padding{padding:.5em .8em}.LESSmultimediaview_bar_active_style{background-color:#4a84c9;background-image:-webkit-gradient(linear,left top,left bottom,from( #6289d9),to( #295b98));background-image:-moz-linear-gradient(top, #6289d9, #295b98);background-image:-o-linear-gradient(top, #6289d9, #295b98);background-image:-ms-linear-gradient(top, #6289d9, #295b98)}.LESSmultimediaview_bar_handle_style{background-color:#f9f9f9;background-image:-webkit-gradient(linear,left top,left bottom,from( #fff),to( #e6e6e6));background-image:-moz-linear-gradient(top, #fff, #e6e6e6);background-image:-o-linear-gradient(top, #fff, #e6e6e6);background-image:-ms-linear-gradient(top, #fff, #e6e6e6)}label.ui-input-text{font-size:1rem;line-height:1.2;display:block;font-weight:400;margin:0 0 .3em}input.ui-input-text,textarea.ui-input-text{background-image:none;padding:.4em;line-height:1.4;font-size:.7272727272727273rem;display:block}input.ui-input-text{appearance:none;-webkit-appearance:none}textarea.ui-input-text{height:2.272727272727273rem;resize:none;-webkit-transition:height 200ms linear;-moz-transition:height 200ms linear;-o-transition:height 200ms linear;-ms-transition:height 200ms linear;transition:height 200ms linear}.ui-input-search{position:relative;padding-right:1.6363636363636365rem;padding-left:1.6363636363636365rem;border:1px solid #999;-webkit-box-shadow:inset .09090909090909091rem .09090909090909091rem .09090909090909091rem #999;-moz-box-shadow:inset .09090909090909091rem .09090909090909091rem .09090909090909091rem #999;-o-box-shadow:inset .09090909090909091rem .09090909090909091rem .09090909090909091rem #999;-ms-box-shadow:inset .09090909090909091rem .09090909090909091rem .09090909090909091rem #999;box-shadow:inset .09090909090909091rem .09090909090909091rem .09090909090909091rem #999}.ui-input-search input.ui-input-text{width:100%;border:0;background:transparent none;outline:0!important}.ui-input-search .ui-btn-down-s,.ui-input-search .ui-btn-up-s,.ui-input-search .ui-btn-hover-s{border:0;background:transparent none}.ui-input-search .ui-btn-icon-notext.ui-input-clear{width:1.6363636363636365rem;height:1.5rem}.ui-input-search .ui-btn-icon-notext.ui-input-clear .ui-btn-inner{padding:.2727272727272727rem}.ui-input-search .ui-btn-inner .ui-icon-deleteSearch{width:1rem;height:1rem;margin-top:0;margin-left:0}.ui-input-search .ui-input-clear{position:absolute;right:0;top:0;vertical-align:middle}.ui-input-search .ui-input-clear-hidden{display:none}@media all and (min-width: 721*@unit_base){label.ui-input-text:not([data-type='search']){ vertical-align:top;display:inline-block;margin:0 2% 0 0}input.ui-input-text:not([data-type='search']),textarea.ui-input-text:not([data-type='search']){width:60%;display:inline-block}.ui-input-search input.ui-input-text:not([data-type='search']){width:85%}}.ui-body-s>div>.ui-field-contain>.input-search-bar,.ui-body-s>.ui-field-contain>.input-search-bar{margin:-2.1818181818181817rem -.6818181818181819rem -1.4545454545454546rem -.6818181818181819rem}.input-search-bar{position:relative;background-color:#f8f6ef;padding:.5909090909090909rem;vertical-align:middle}.input-search-bar .ui-corner-all{-o-border-radius:.3em;-ms-border-radius:.3em;-moz-border-radius:.3em;-webkit-border-radius:.3em;border-radius:.3em}.input-search-bar .ui-input-search{font-size:.7272727272727273rem;display:block;position:relative;background-color:#fff}.input-search-bar .ui-input-search .ui-input-text{height:1.5rem;padding:0;margin-right:1.7272727272727273rem}.input-search-bar .ui-input-search .ui-image-search{position:absolute;top:0;left:0;width:1rem;height:1rem;margin:.2727272727272727rem}.input-search-bar .ui-input-search-default{margin-right:3.409090909090909rem;-webkit-transition:all 400ms linear;-moz-transition:all 400ms linear;-o-transition:all 400ms linear;-ms-transition:all 400ms linear;transition:all 400ms linear}.input-search-bar .ui-input-search-wide{margin-right:0rem;-webkit-transition:all 400ms linear;-moz-transition:all 400ms linear;-o-transition:all 400ms linear;-ms-transition:all 400ms linear;transition:all 400ms linear}.input-search-bar .ui-btn-icon-cancel.ui-input-cancel{display:inline-block;position:absolute;top:.13636363636363635rem;right:0rem;height:1.5rem;margin-right:.4545454545454546rem;vertical-align:middle;padding:0;border-color:none;width:3.090909090909091rem;-webkit-transition:all 400ms linear;-moz-transition:all 400ms linear;-o-transition:all 400ms linear;-ms-transition:all 400ms linear;transition:all 400ms linear}.input-search-bar .ui-btn-icon-cancel.ui-input-cancel .ui-btn-inner{padding-top:.2727272727272727rem;padding-bottom:.2727272727272727rem}.input-search-bar .ui-btn-icon-cancel.ui-input-cancel .ui-btn-inner .ui-btn-text{font-size:.6818181818181819rem}.input-search-bar .ui-btn-icon-cancel.ui-input-cancel.ui-btn-cancel-hide{right:-3.409090909090909rem;visibility:hidden}.input-search-bar .ui-btn-icon-cancel.ui-input-cancel.ui-btn-cancel-show{right:0;visibility:visible}.input-search-bar .ui-search-bar-icon{margin-left:1.9090909090909092rem}.input-search-bar .ui-btn.ui-btn-search-front-icon{position:absolute;width:1.590909090909091rem;height:1.590909090909091rem;top:.09090909090909091rem;border-radius:3rem}.input-search-bar .ui-btn.ui-btn-search-front-icon>.ui-btn-inner.ui-btn-icon-only{border-radius:3rem}.ui-header .input-search-bar{padding-top:.18181818181818182rem;padding-bottom:.18181818181818182rem}.ui-image-search{background-image:url(images/controls/00_search_icon.png);background-repeat:no-repeat;background-size:100% 100%}.ui-icon-deleteSearch{background-image:url(images/controls/00_field_btn_clear.png);background-repeat:no-repeat;background-size:100% 100%}.LESSbutton_box_style{color:#363133}.LESSbutton_up_style{background:#ebe8e3;background:-webkit-linear-gradient(top, #ebe8e3, #eae7e2);background:-moz-linear-gradient(top, #ebe8e3, #eae7e2);background:-o-linear-gradient(top, #ebe8e3, #eae7e2);background:-ms-linear-gradient(top, #ebe8e3, #eae7e2)}.LESSbutton_box_style{background:#ebe8e3;background:-webkit-linear-gradient(top, #ebe8e3, #eae7e2);background:-moz-linear-gradient(top, #ebe8e3, #eae7e2);background:-o-linear-gradient(top, #ebe8e3, #eae7e2);background:-ms-linear-gradient(top, #ebe8e3, #eae7e2);border:1px solid;border-color:#dcdad3;-o-box-shadow:0 0 1px 1px #fff;-ms-box-shadow:0 0 1px 1px #fff;-moz-box-shadow:0 0 1px 1px #fff;-webkit-box-shadow:0 0 1px 1px #fff;box-shadow:0 0 1px 1px #fff}.LESSbutton_inner_box_style{background:#f7f5ee;background:-webkit-linear-gradient(top, #faf7f2, #f8f5f0);background:-ms-linear-gradient(top, #faf7f2, #f8f5f0);background:-o-linear-gradient(top, #faf7f2, #f8f5f0);background:-moz-linear-gradient(top, #faf7f2, #f8f5f0);-o-box-shadow:none;-ms-box-shadow:none;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none}.LESSbutton_inner_pressstyle{color:#f8f6ef}.LESSbutton_text1_style{font-family:Helvetica,Arial,sans-serif;font-weight:400;font-size:1.0rem;font-style:normal;color:#000}.LESSbutton_hover_style{color:#363133}.LESSbutton_down_style{background:#3b73b6;color:#f8f6ef}.LESSbutton_edit_style{background:#c95858;background:-webkit-gradient(linear,left top,left bottom,from( #c95858),to( #a12828));background:-moz_linear-gradient(top, #c95858, #a12828)}.LESSDayselectorButtonNormal{background:#7e9db2;background:-webkit-linear-gradient(top, #7e9db2 0, #547990 100%);background:-moz-linear-gradient(top, #7e9db2 0, #547990 100%);background:-ms-linear-gradient(top, #7e9db2 0, #547990 100%);background:-o-linear-gradient(top, #7e9db2 0, #547990 100%);background:linear-gradient(top, #7e9db2 0, #547990 100%)}.LESSDayaselectorButtonPress{background:#3b7796;background:-webkit-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-moz-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-ms-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-o-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:linear-gradient(top, #3b7796 0, #2f5b75 100%)}.LESSpopup_button_style{}.LESSpopup_button_hover_style{background:#5e88a3}.LESSpopup_button_press_style{background:#43a0d9;background:-webkit-gradient(linear,left top,left bottom,from( #43a0d9),to( #388bb9));background:-moz-linear-gradient(top, #43a0d9, #388bb9);background:-ms-linear-gradient(top, #43a0d9, #388bb9);background:-o-linear-gradient(top, #43a0d9, #388bb9)}.LESStoggleswitch_on_style{background:#2a7eac;background:-webkit-gradient(linear,left top,left bottom,from( #2174a7),to( #4ba5db));background:-moz-linear-gradient(top, #2174a7, #4ba5db);border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px}.LESStoggleswitch_off_style{color:#cbcbcb;background:#97a1a7;background:-webkit-gradient(linear,left top,left bottom,from( #727272),to( #8d8d8d));background:-moz-linear-gradient(top, #727272, #8d8d8d);border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px}.LESStoggleswitch_reed_style{background:#fdfdfd;background:-webkit-gradient(linear,left top,left bottom,from( #fdfdfd),to( #e7e7e7));background:-moz-linear-gradient(top, #fdfdfd, #e7e7e7);border-radius:2px;-webkit-border-radius:2px;-moz-border-radius:2px}.LESSbutton_editpress_style{background:#931818;background:-webkit-gradient(linear,left top,left bottom,from( #931818),to( #6e1717));background:-moz-linear-gradient(top, #931818, #6e1717)}.LESSbutton_edit_padding{padding:.5em .8em}.LESSmultimediaview_bar_active_style{background-color:#4a84c9;background-image:-webkit-gradient(linear,left top,left bottom,from( #6289d9),to( #295b98));background-image:-moz-linear-gradient(top, #6289d9, #295b98);background-image:-o-linear-gradient(top, #6289d9, #295b98);background-image:-ms-linear-gradient(top, #6289d9, #295b98)}.LESSmultimediaview_bar_handle_style{background-color:#f9f9f9;background-image:-webkit-gradient(linear,left top,left bottom,from( #fff),to( #e6e6e6));background-image:-moz-linear-gradient(top, #fff, #e6e6e6);background-image:-o-linear-gradient(top, #fff, #e6e6e6);background-image:-ms-linear-gradient(top, #fff, #e6e6e6)}.ui-controlgroup,fieldset.ui-controlgroup{padding:0;margin:.5em 0 1em}.ui-bar .ui-controlgroup{margin:0 .3em}.ui-controlgroup-label{font-size:1em;line-height:1.4;font-weight:400;margin:0 0 .3em}.ui-controlgroup-controls{display:block}.ui-controlgroup li{list-style:none}.ui-controlgroup .ui-btn-inner{white-space:nowrap}.ui-controlgroup .ui-checkbox label label,.ui-controlgroup .ui-radio label{font-size:1em}.ui-controlgroup .ui-radio{width:25%;overflow:hidden}.ui-controlgroup .ui-radio label{text-align:center;white-space:nowrap}.ui-controlgroup .ui-radio-off,.ui-controlgroup .ui-radio-on{width:100%}.ui-controlgroup .ui-radio-on .ui-btn-inner{background:#f8f6ef}.ui-controlgroup .ui-radio-on .ui-btn-inner .ui-btn-text{color:#3b73b6}.ui-controlgroup .ui-corner-left{border-left-width:0}.ui-controlgroup .ui-corner-right{border-right-width:0}.ui-controlgroup-vertical .ui-btn,.ui-controlgroup-vertical .ui-checkbox,.ui-controlgroup-vertical .ui-radio{margin:0;border-bottom-width:0}.ui-controlgroup-vertical .ui-controlgroup-last{border-bottom-width:1px}.ui-controlgroup-vertical .ui-radio{width:100%}.ui-controlgroup-vertical .ui-radio label{text-align:left}.ui-controlgroup-vertical .ui-radio label .ui-btn-inner{margin-left:.7272727272727273rem;margin-right:.7272727272727273rem}.ui-controlgroup-horizontal{padding:0}.ui-controlgroup-horizontal .ui-btn{display:inline-block;margin-left:-.18181818181818182rem;margin-right:-.13636363636363635rem}.ui-controlgroup-horizontal .ui-checkbox,.ui-controlgroup-horizontal .ui-radio{float:left;margin:0 -1px 0 0}.ui-controlgroup-horizontal .ui-controlgroup-last{margin-right:0}.ui-controlgroup-horizontal [data-role="button"]{border-top:0;border-bottom:0;border-radius:0;box-shadow:none;background:0}.ui-controlgroup-horizontal [data-role="button"].ui-btn-down-s .ui-btn-inner,.ui-controlgroup-horizontal [data-role="button"] .ui-btn-active-s .ui-btn-inner{background:#f8f6ef}.ui-controlgroup-horizontal [data-role="button"].ui-btn-down-s .ui-btn-inner .ui-btn-text,.ui-controlgroup-horizontal [data-role="button"] .ui-btn-active-s .ui-btn-inner .ui-btn-text{color:#3b73b6}.ui-controlgroup-horizontal [data-role="button"].ui-btn-down-s .ui-btn-inner{background:-webkit-linear-gradient(top, #d2d2c8 0, #f6f8ef 100%)}.ui-controlgroup-horizontal [data-role="button"]>.ui-btn-inner{border:0 solid;box-shadow:none;padding-top:.2272727272727273rem;padding-bottom:.2272727272727273rem;padding-left:.4545454545454546rem;padding-right:.4545454545454546rem}.ui-controlgroup-horizontal label>span.ui-btn-inner{padding-top:.13636363636363635rem;padding-bottom:.13636363636363635rem}.LESSbutton_box_style{color:#363133}.LESSbutton_up_style{background:#ebe8e3;background:-webkit-linear-gradient(top, #ebe8e3, #eae7e2);background:-moz-linear-gradient(top, #ebe8e3, #eae7e2);background:-o-linear-gradient(top, #ebe8e3, #eae7e2);background:-ms-linear-gradient(top, #ebe8e3, #eae7e2)}.LESSbutton_box_style{background:#ebe8e3;background:-webkit-linear-gradient(top, #ebe8e3, #eae7e2);background:-moz-linear-gradient(top, #ebe8e3, #eae7e2);background:-o-linear-gradient(top, #ebe8e3, #eae7e2);background:-ms-linear-gradient(top, #ebe8e3, #eae7e2);border:1px solid;border-color:#dcdad3;-o-box-shadow:0 0 1px 1px #fff;-ms-box-shadow:0 0 1px 1px #fff;-moz-box-shadow:0 0 1px 1px #fff;-webkit-box-shadow:0 0 1px 1px #fff;box-shadow:0 0 1px 1px #fff}.LESSbutton_inner_box_style{background:#f7f5ee;background:-webkit-linear-gradient(top, #faf7f2, #f8f5f0);background:-ms-linear-gradient(top, #faf7f2, #f8f5f0);background:-o-linear-gradient(top, #faf7f2, #f8f5f0);background:-moz-linear-gradient(top, #faf7f2, #f8f5f0);-o-box-shadow:none;-ms-box-shadow:none;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none}.LESSbutton_inner_pressstyle{color:#f8f6ef}.LESSbutton_text1_style{font-family:Helvetica,Arial,sans-serif;font-weight:400;font-size:1.0rem;font-style:normal;color:#000}.LESSbutton_hover_style{color:#363133}.LESSbutton_down_style{background:#3b73b6;color:#f8f6ef}.LESSbutton_edit_style{background:#c95858;background:-webkit-gradient(linear,left top,left bottom,from( #c95858),to( #a12828));background:-moz_linear-gradient(top, #c95858, #a12828)}.LESSDayselectorButtonNormal{background:#7e9db2;background:-webkit-linear-gradient(top, #7e9db2 0, #547990 100%);background:-moz-linear-gradient(top, #7e9db2 0, #547990 100%);background:-ms-linear-gradient(top, #7e9db2 0, #547990 100%);background:-o-linear-gradient(top, #7e9db2 0, #547990 100%);background:linear-gradient(top, #7e9db2 0, #547990 100%)}.LESSDayaselectorButtonPress{background:#3b7796;background:-webkit-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-moz-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-ms-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-o-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:linear-gradient(top, #3b7796 0, #2f5b75 100%)}.LESSpopup_button_style{}.LESSpopup_button_hover_style{background:#5e88a3}.LESSpopup_button_press_style{background:#43a0d9;background:-webkit-gradient(linear,left top,left bottom,from( #43a0d9),to( #388bb9));background:-moz-linear-gradient(top, #43a0d9, #388bb9);background:-ms-linear-gradient(top, #43a0d9, #388bb9);background:-o-linear-gradient(top, #43a0d9, #388bb9)}.LESStoggleswitch_on_style{background:#2a7eac;background:-webkit-gradient(linear,left top,left bottom,from( #2174a7),to( #4ba5db));background:-moz-linear-gradient(top, #2174a7, #4ba5db);border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px}.LESStoggleswitch_off_style{color:#cbcbcb;background:#97a1a7;background:-webkit-gradient(linear,left top,left bottom,from( #727272),to( #8d8d8d));background:-moz-linear-gradient(top, #727272, #8d8d8d);border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px}.LESStoggleswitch_reed_style{background:#fdfdfd;background:-webkit-gradient(linear,left top,left bottom,from( #fdfdfd),to( #e7e7e7));background:-moz-linear-gradient(top, #fdfdfd, #e7e7e7);border-radius:2px;-webkit-border-radius:2px;-moz-border-radius:2px}.LESSbutton_editpress_style{background:#931818;background:-webkit-gradient(linear,left top,left bottom,from( #931818),to( #6e1717));background:-moz-linear-gradient(top, #931818, #6e1717)}.LESSbutton_edit_padding{padding:.5em .8em}.LESSmultimediaview_bar_active_style{background-color:#4a84c9;background-image:-webkit-gradient(linear,left top,left bottom,from( #6289d9),to( #295b98));background-image:-moz-linear-gradient(top, #6289d9, #295b98);background-image:-o-linear-gradient(top, #6289d9, #295b98);background-image:-ms-linear-gradient(top, #6289d9, #295b98)}.LESSmultimediaview_bar_handle_style{background-color:#f9f9f9;background-image:-webkit-gradient(linear,left top,left bottom,from( #fff),to( #e6e6e6));background-image:-moz-linear-gradient(top, #fff, #e6e6e6);background-image:-o-linear-gradient(top, #fff, #e6e6e6);background-image:-ms-linear-gradient(top, #fff, #e6e6e6)}.ui-listview{margin:0;counter-reset:listnumbering;border-top-color:rgba(211,209,203,.5)}.ui-listview li.ui-btn>.ui-btn-hastxt>.ui-btn-text.ui-btn-text-padding-right{padding-right:0rem}.ui-listview .ui-li{border-left-width:0;border-right-width:0;border-top-width:0}.ui-listview .ui-li>.ui-btn-inner{border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgba(211,209,203,.5);margin-left:.5909090909090909rem;margin-right:.5909090909090909rem}.ui-listview .ui-li-static{background-color:#f8f6ef;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgba(211,209,203,.5);margin-left:.5909090909090909rem;margin-right:.5909090909090909rem}.ui-listview .ui-li:not(.ui-li-divider):not(.ui-li-static){min-height:2.5rem}.ui-listview .ui-li.ui-li-has-multiline:not(.ui-li-divider):not(.ui-li-static){min-height:2.909090909090909rem}.ui-listview li.ui-btn-up-s,.ui-listview li.ui-btn-hover-s{background:0;background-color:#f8f6ef;color:#000}.ui-listview li.ui-btn-down-s{background:0;background-color:#5787c2;color:#000}.ui-listview li.ui-btn-up-s>.ui-li>.ui-btn-text>a.ui-link-inherit,.ui-listview li.ui-btn-hover-s>.ui-li>.ui-btn-text>a.ui-link-inherit{color:#000}.ui-listview li.ui-btn-down-s>.ui-li>.ui-btn-text>a.ui-link-inherit{color:#f9f9f9}.ui-content .ui-listview{margin-left:-.36363636363636365rem;margin-right:-.36363636363636365rem;padding-bottom:1px}.ui-content .ui-listview .ui-listview{margin:0}.ui-content .ui-listview-inset{margin:1em 0}.ui-listview,.ui-li,.ui-collapsible-heading{list-style:none;padding:0;font-size:1rem}.ui-li,.ui-collapsible-heading,.ui-li.ui-field-contain{display:block;margin:0;position:relative;overflow:visible;text-align:left}.ui-li .ui-btn{top:50%;margin-top:-.8em}.ui-li h3,.ui-collapsible-heading h3,.ui-collapsible>.ui-collapsible-content h3,.ui-listview li h3{margin-top:0;margin-bottom:0;font-size:1rem;font-weight:400}.ui-li form,.ui-collapsible-heading form,.ui-collapsible>.ui-collapsible-content form,.ui-listview li form{display:inline-block}.ui-li .ui-btn-text,.ui-collapsible-heading .ui-btn-text,.ui-collapsible>.ui-collapsible-content .ui-btn-text,.ui-listview li .ui-btn-text{position:relative}.ui-li .ui-btn-text a.ui-link-inherit,.ui-collapsible-heading .ui-btn-text a.ui-link-inherit,.ui-collapsible>.ui-collapsible-content .ui-btn-text a.ui-link-inherit,.ui-listview li .ui-btn-text a.ui-link-inherit{white-space:nowrap;text-overflow:ellipsis;-o-text-overflow:ellipsis;overflow:hidden!important}.ui-li:last-child,.ui-collapsible-heading:last-child,.ui-collapsible>.ui-collapsible-content:last-child,.ui-listview li:last-child,.ui-li.ui-field-contain:last-child,.ui-collapsible-heading.ui-field-contain:last-child,.ui-collapsible>.ui-collapsible-content.ui-field-contain:last-child,.ui-listview li.ui-field-contain:last-child{border-bottom-width:1px}.ui-li>.ui-btn-inner,.ui-collapsible-heading>.ui-btn-inner,.ui-collapsible>.ui-collapsible-content>.ui-btn-inner,.ui-listview li>.ui-btn-inner,.ui-li.ui-collapsible-heading>.ui-collapsible-heading-toggle,.ui-collapsible-heading.ui-collapsible-heading>.ui-collapsible-heading-toggle,.ui-collapsible>.ui-collapsible-content.ui-collapsible-heading>.ui-collapsible-heading-toggle,.ui-listview li.ui-collapsible-heading>.ui-collapsible-heading-toggle{display:block;position:relative;padding:0;border-width:0}.ui-li>.ui-btn-inner.ui-btn-hastxt,.ui-collapsible-heading>.ui-btn-inner.ui-btn-hastxt,.ui-collapsible>.ui-collapsible-content>.ui-btn-inner.ui-btn-hastxt,.ui-listview li>.ui-btn-inner.ui-btn-hastxt{padding:0 0}.ui-li .ui-btn-inner a.ui-link-inherit,.ui-collapsible-heading .ui-btn-inner a.ui-link-inherit,.ui-collapsible>.ui-collapsible-content .ui-btn-inner a.ui-link-inherit,.ui-listview li .ui-btn-inner a.ui-link-inherit,.ui-li .ui-collapsible-heading-toggle>.ui-btn-inner,.ui-collapsible-heading .ui-collapsible-heading-toggle>.ui-btn-inner,.ui-collapsible>.ui-collapsible-content .ui-collapsible-heading-toggle>.ui-btn-inner,.ui-listview li .ui-collapsible-heading-toggle>.ui-btn-inner,.ui-li>li,.ui-collapsible-heading>li,.ui-collapsible>.ui-collapsible-content>li,.ui-listview li>li,.ui-li.ui-li-static,.ui-collapsible-heading.ui-li-static,.ui-collapsible>.ui-collapsible-content.ui-li-static,.ui-listview li.ui-li-static{padding-top:.6818181818181819rem;padding-bottom:.6818181818181819rem;display:block;white-space:normal;border-left-width:0;border-right-width:0}.ui-li .ui-btn-inner a.ui-link-inherit,.ui-collapsible-heading .ui-btn-inner a.ui-link-inherit,.ui-collapsible>.ui-collapsible-content .ui-btn-inner a.ui-link-inherit,.ui-listview li .ui-btn-inner a.ui-link-inherit,.ui-li .ui-collapsible-heading-toggle,.ui-collapsible-heading .ui-collapsible-heading-toggle,.ui-collapsible>.ui-collapsible-content .ui-collapsible-heading-toggle,.ui-listview li .ui-collapsible-heading-toggle{white-space:normal;overflow:visible!important}.ui-li .ui-toggle-switch:last-child,.ui-collapsible-heading .ui-toggle-switch:last-child,.ui-collapsible>.ui-collapsible-content .ui-toggle-switch:last-child,.ui-listview li .ui-toggle-switch:last-child{top:50%;margin-top:-.7727272727272727rem;display:inline-block;position:absolute;right:0}.ui-li [data-role="button"]:last-child,.ui-collapsible-heading [data-role="button"]:last-child,.ui-collapsible>.ui-collapsible-content [data-role="button"]:last-child,.ui-listview li [data-role="button"]:last-child{position:absolute;right:0}.ui-li .ui-radio:first-child,.ui-collapsible-heading .ui-radio:first-child,.ui-collapsible>.ui-collapsible-content .ui-radio:first-child,.ui-listview li .ui-radio:first-child,.ui-li .ui-checkbox:first-child,.ui-collapsible-heading .ui-checkbox:first-child,.ui-collapsible>.ui-collapsible-content .ui-checkbox:first-child,.ui-listview li .ui-checkbox:first-child{position:absolute;top:50%;margin-top:-.6818181818181819rem;left:-.18181818181818182rem;width:1.3636363636363638rem;height:1.3636363636363638rem}.ui-li .ui-radio:first-child .ui-btn-inner,.ui-collapsible-heading .ui-radio:first-child .ui-btn-inner,.ui-collapsible>.ui-collapsible-content .ui-radio:first-child .ui-btn-inner,.ui-listview li .ui-radio:first-child .ui-btn-inner,.ui-li .ui-checkbox:first-child .ui-btn-inner,.ui-collapsible-heading .ui-checkbox:first-child .ui-btn-inner,.ui-collapsible>.ui-collapsible-content .ui-checkbox:first-child .ui-btn-inner,.ui-listview li .ui-checkbox:first-child .ui-btn-inner{line-height:.9090909090909092rem;color:transparent}.ui-li .ui-radio:first-child .ui-btn-inner .ui-icon,.ui-collapsible-heading .ui-radio:first-child .ui-btn-inner .ui-icon,.ui-collapsible>.ui-collapsible-content .ui-radio:first-child .ui-btn-inner .ui-icon,.ui-listview li .ui-radio:first-child .ui-btn-inner .ui-icon,.ui-li .ui-checkbox:first-child .ui-btn-inner .ui-icon,.ui-collapsible-heading .ui-checkbox:first-child .ui-btn-inner .ui-icon,.ui-collapsible>.ui-collapsible-content .ui-checkbox:first-child .ui-btn-inner .ui-icon,.ui-listview li .ui-checkbox:first-child .ui-btn-inner .ui-icon{left:.2272727272727273rem}.ui-li .ui-radio:first-child label.ui-btn-icon_only,.ui-collapsible-heading .ui-radio:first-child label.ui-btn-icon_only,.ui-collapsible>.ui-collapsible-content .ui-radio:first-child label.ui-btn-icon_only,.ui-listview li .ui-radio:first-child label.ui-btn-icon_only,.ui-li .ui-checkbox:first-child label.ui-btn-icon_only,.ui-collapsible-heading .ui-checkbox:first-child label.ui-btn-icon_only,.ui-collapsible>.ui-collapsible-content .ui-checkbox:first-child label.ui-btn-icon_only,.ui-listview li .ui-checkbox:first-child label.ui-btn-icon_only{top:0;margin-top:0}.ui-li img.ui-li-bigicon,.ui-collapsible-heading img.ui-li-bigicon,.ui-collapsible>.ui-collapsible-content img.ui-li-bigicon,.ui-listview li img.ui-li-bigicon{position:absolute;width:1.590909090909091rem;height:1.590909090909091rem;top:50%;margin-top:-.8181818181818182rem}.ui-li img.ui-li-bigicon:first-child,.ui-collapsible-heading img.ui-li-bigicon:first-child,.ui-collapsible>.ui-collapsible-content img.ui-li-bigicon:first-child,.ui-listview li img.ui-li-bigicon:first-child{left:0}.ui-li img.ui-li-bigicon:nth-child(2),.ui-collapsible-heading img.ui-li-bigicon:nth-child(2),.ui-collapsible>.ui-collapsible-content img.ui-li-bigicon:nth-child(2),.ui-listview li img.ui-li-bigicon:nth-child(2){left:1.6363636363636365rem}.ui-li img.ui-li-bigicon:last-child,.ui-collapsible-heading img.ui-li-bigicon:last-child,.ui-collapsible>.ui-collapsible-content img.ui-li-bigicon:last-child,.ui-listview li img.ui-li-bigicon:last-child{right:.7272727272727273rem}.ui-li .ui-li-color-bar+img.ui-li-bigicon:nth-child(2),.ui-collapsible-heading .ui-li-color-bar+img.ui-li-bigicon:nth-child(2),.ui-collapsible>.ui-collapsible-content .ui-li-color-bar+img.ui-li-bigicon:nth-child(2),.ui-listview li .ui-li-color-bar+img.ui-li-bigicon:nth-child(2){left:0}.ui-li .ui-li-color-bar,.ui-collapsible-heading .ui-li-color-bar,.ui-collapsible>.ui-collapsible-content .ui-li-color-bar,.ui-listview li .ui-li-color-bar{position:absolute;width:.13636363636363635rem;height:2.9545454545454546rem;top:0rem;left:-.5909090909090909rem;background-color:#000}li.ui-li-thumbnail-right img.ui-li-bigicon.ui-li-thumb{left:auto;right:0;width:2.3181818181818183rem;height:2.3181818181818183rem;margin-top:-1.1363636363636365rem}.ui-li.ui-li-has-multiline .ui-btn-inner a.ui-link-inherit,.ui-li.ui-li-has-multiline.ui-li-static{padding-top:.3181818181818182rem;padding-bottom:1.2727272727272727rem}.ui-li.ui-li-has-multiline a{white-space:normal;overflow:visible!important;padding-right:.7272727272727273rem}.ui-li.ui-li-text-ellipsis .ui-btn-inner a.ui-link-inherit{white-space:nowrap;text-overflow:ellipsis;-o-text-overflow:ellipsis;overflow:hidden!important}.ui-li.ui-li-text-ellipsis a{white-space:nowrap;text-overflow:ellipsis;-o-text-overflow:ellipsis;overflow:hidden!important}.ui-li.ui-li-text-ellipsis.ui-li-static{white-space:nowrap;text-overflow:ellipsis;-o-text-overflow:ellipsis;overflow:hidden!important}.ui-li>input{border-style:none;border-width:0;outline-color:#f8f6ef;font-size:1.0454545454545454rem;line-height:1;padding-top:0;padding-bottom:0}.ui-listview li.ui-li-divider{background:#f8f6ef;color:#3b73b6;border-bottom-width:0;border-top-width:0;cursor:default;counter-reset:listnumbering;font-weight:700;height:1.7272727272727273rem;font-size:.7272727272727273rem}.ui-listview li.ui-li-divider>.ui-btn-inner>.ui-btn-text{font-size:.7272727272727273rem}.ui-listview li.ui-li-divider.ui-btn{top:0;margin-top:0rem;border-radius:0;font-size:.7272727272727273rem}.ui-listview li.ui-li-divider.ui-btn .ui-btn-inner.ui-btn-hastxt{height:100%;padding-left:0}.ui-listview li.ui-li-divider.ui-btn .ui-btn-inner.ui-btn-hastxt .ui-btn-text{position:absolute;top:.2272727272727273rem;height:.8181818181818182rem;padding-right:.4545454545454546rem}.ui-listview li.ui-li-divider:not(.ui-btn){margin-left:.5454545454545454rem;margin-right:.5454545454545454rem}.ui-listview li.ui-li-divider>.ui-btn-text{position:absolute;top:.2272727272727273rem;height:.8181818181818182rem;padding-right:.4545454545454546rem}.ui-listview li.ui-li-divider[data-style="dialogue"]{height:.9090909090909092rem;padding:0;padding-top:.9090909090909092rem;padding-bottom:0rem;padding-left:.4545454545454546rem;margin-left:.18181818181818182rem;margin-right:.18181818181818182rem;font-size:.7272727272727273rem;font-weight:700;color:#3b73b6;background:#f8f6ef}.ui-listview li.ui-li-divider[data-style="check"]{height:1.7272727272727273rem;padding-top:0;padding-bottom:0;padding-left:0}.ui-listview li.ui-li-divider[data-style="check"] label{top:0;margin:0}.ui-listview li.ui-li-divider[data-style="check"] label .ui-btn-inner{z-index:5;position:absolute;width:1.4545454545454546rem;height:1.4545454545454546rem;background:#f8f6ef;padding:0}.ui-listview li.ui-li-divider[data-style="check"] .ui-btn-text{padding-left:1.6818181818181819rem}.ui-listview li.ui-li-divider .ui-divider-normal-line{display:inline-block;position:absolute;top:1.0454545454545454rem;width:100%;height:.09090909090909091rem;background:#3b73b6}.ui-listview li.ui-li-divider.ui-btn-down-s{background:#3b73b6;color:#f8f6ef}.ui-listview li.ui-li-divider.ui-btn-down-s .ui-divider-normal-line{background:#f8f6ef}.ui-listview li.ui-li-divider.ui-btn-down-s label>.ui-btn-inner{background:#3b73b6}.ui-listview li.ui-li-divider+li.ui-li-dialogue{border-top-left-radius:3px;border-top-right-radius:3px}.ui-divider-expand-div{position:absolute;width:4.454545454545455rem;height:1.9090909090909092rem;top:.4545454545454546rem;right:0;border-left-width:1px;border-left-style:solid;border-left-color:rgba(0,0,0,.5)}.ui-li-has-thumb:not(.ui-li-thumbnail-right) .ui-btn-inner a.ui-link-inherit,.ui-li-has-thumb:not(.ui-li-thumbnail-right).ui-li-static{padding-left:2.0454545454545454rem}.ui-li-has-thumb:not(.ui-li-thumbnail-right) .ui-li-text-sub{padding-left:2.0454545454545454rem;padding-right:0}.ui-li-has-checkbox .ui-btn-inner a.ui-link-inherit,.ui-li-has-radio .ui-btn-inner a.ui-link-inherit,.ui-li-has-checkbox.ui-li-static,.ui-li-has-radio.ui-li-static{padding-left:1.6363636363636365rem}.ui-li-has-checkbox .ui-li-text-sub,.ui-li-has-radio .ui-li-text-sub{padding-left:1.6363636363636365rem}.ui-li-has-thumb.ui-li-has-checkbox .ui-btn-inner a.ui-link-inherit,.ui-li-has-thumb.ui-li-has-radio .ui-btn-inner a.ui-link-inherit,.ui-li-has-thumb.ui-li-has-checkbox.ui-li-static,.ui-li-has-thumb.ui-li-has-radio.ui-li-static{padding-left:3.5454545454545454rem}.ui-li-has-thumb.ui-li-has-checkbox .ui-li-text-sub,.ui-li-has-thumb.ui-li-has-radio .ui-li-text-sub{padding-left:3.5454545454545454rem}.ui-li.ui-li-has-right-circle-btn .ui-btn-inner a{padding-right:2.1818181818181817rem}.ui-li.ui-li-has-right-btn:not(.ui-swipelist-item) .ui-btn-inner a{padding-right:3.590909090909091rem}.ui-li.ui-li-thumbnail-right .ui-btn-inner a{padding-right:2.3636363636363638rem}.ui-li.ui-li-static.ui-li-has-right-circle-btn{padding-right:2.1818181818181817rem}.ui-li.ui-li-static.ui-li-has-right-btn:not(.ui-swipelist-item){padding-right:3.590909090909091rem}.ui-li.ui-li-static.ui-li-thumbnail-right{padding-right:2.3636363636363638rem}.ui-li-has-icon .ui-btn-inner a.ui-link-inherit,.ui-li-has-icon.ui-li-static{min-height:20px;padding-left:40px}.ui-li-has-icon .ui-li-text-sub{padding-left:40px}.ui-li-heading{font-size:16px;font-weight:700;display:block;margin:.6em 0;white-space:nowrap;text-overflow:ellipsis;-o-text-overflow:ellipsis;overflow:hidden!important}.ui-li-thumb,.ui-li-icon{position:absolute;left:1px;top:0;max-height:3.272727272727273rem;max-width:3.272727272727273rem}.ui-listview * .ui-btn-inner>.ui-btn>.ui-btn-inner{border-top:0}.ui-li-sub,.ui-li-sub-setting{float:right;text-align:right;font-size:.7272727272727273rem;margin:.3em 0}.ui-li-text-sub{float:right;text-align:right;font-size:.7272727272727273rem;color:#646464;position:absolute;right:0;top:.9090909090909092rem;width:95%;white-space:nowrap;text-overflow:ellipsis;-o-text-overflow:ellipsis;overflow:hidden!important}.ui-li-text-sub>img{position:relative;width:.7727272727272727rem;height:.7727272727272727rem;margin:0 .36363636363636365rem 0 .36363636363636365rem}.ui-li-text-sub2{float:right;text-align:right;font-size:.7272727272727273rem;color:#646464;position:absolute;right:0;top:.7272727272727273rem;width:60%;white-space:nowrap;text-overflow:ellipsis;-o-text-overflow:ellipsis;overflow:hidden!important}.ui-li-text-sub2>img{width:.7727272727272727rem;height:.7727272727272727rem;margin:0 0 0 .36363636363636365rem}.ui-li-has-multiline .ui-li-text-sub{position:absolute;text-align:left;right:auto;left:0;top:1.590909090909091rem;margin-top:0;width:90%;white-space:nowrap;text-overflow:ellipsis;-o-text-overflow:ellipsis;overflow:hidden!important}.ui-li-has-multiline.ui-li-has-right-btn .ui-btn-inner a .ui-li-text-sub{width:74%}.ui-li-has-multiline.ui-li-has-right-btn.ui-li-has-thumb .ui-btn-inner a .ui-li-text-sub{width:64%}.ui-li-has-multiline.ui-li-static.ui-li-has-right-btn .ui-li-text-sub{width:74%}.ui-li-has-multiline.ui-li-static.ui-li-has-right-btn.ui-li-has-thumb .ui-li-text-sub{width:64%}.ui-li-icon-sub-right,.ui-li-icon-sub{position:absolute;left:auto;width:.7727272727272727rem;height:.7727272727272727rem;margin:0 0}.ui-li-icon-sub-right{right:.36363636363636365rem}.ui-listview li.ui-li-dialogue{margin-left:.18181818181818182rem;margin-right:.18181818181818182rem;padding-left:.4545454545454546rem;padding-right:.4545454545454546rem;border-style:solid;border-color:#8e9aa3;border-width:1px}.ui-listview li.ui-li-dialogue>.ui-btn-inner{margin-left:0;margin-right:0;border-bottom-width:0}.ui-listview li.ui-li-dialogue:first-child{border-top-width:1px;border-top-left-radius:3px;border-top-right-radius:3px}.ui-listview li.ui-li-dialogue:last-child{border-bottom-left-radius:3px;border-bottom-right-radius:3px}.ui-listview li.ui-li-dialogue>img{margin-left:.2727272727272727rem}.ui-listview li.ui-li-dialogue [data-role="button"]:last-child{margin-right:.4545454545454546rem}.ui-listview li.ui-li-dialogue .ui-link-inherit>.ui-btn{margin-right:0}.ui-listview li.ui-li-dialogue.ui-li-static .ui-li-text-sub,.ui-listview li.ui-li-dialogue.ui-li-static .ui-toggle-switch{right:.4545454545454546rem}.ui-listview li.ui-li-dialogue.ui-li-static.ui-li-has-checkbox,.ui-listview li.ui-li-dialogue.ui-li-static.ui-li-has-radio{padding-left:1.6363636363636365rem}.ui-listview li.ui-li-dialogue.ui-li-static .ui-checkbox,.ui-listview li.ui-li-dialogue.ui-li-static .ui-radio{left:0}.ui-listview li.ui-li-dialogue.ui-li-has-multiline.ui-li-static .ui-li-text-sub{padding-left:.4545454545454546rem}.ui-listview li.ui-li-dialogue.ui-li-has-multiline.ui-li-static .ui-li-text-sub2{padding-right:.4545454545454546rem}.ui-listview li.ui-li-dialogue.ui-li-has-multiline.ui-li-static.ui-li-has-checkbox .ui-li-text-sub,.ui-listview li.ui-li-dialogue.ui-li-has-multiline.ui-li-static.ui-li-has-radio .ui-li-text-sub{padding-left:1.9090909090909092rem}.ui-listview>li.ui-li-dialogue.ui-body-s:not(.ui-li-expanded),.ui-listview>li.ui-li-dialogue.ui-btn-hover-up-s:not(.ui-btn-down-s):not(.ui-li-expanded),.ui-listview>li.ui-li-dialogue.ui-btn-up-s:not(.ui-li-expanded){background:#efede5}.ui-listview>li.ui-li-dialogue.ui-li-expanded{padding-left:1.1818181818181819rem;background:#dcdad3}.ui-listview>li.ui-li-dialogue.ui-li-divider{height:1.4545454545454546rem;padding:0}.ui-listview>li.ui-li-group-title{padding-top:1.4545454545454546rem}.ui-listview>li.ui-li-group-title span{padding-left:.7272727272727273rem}.ui-listview>li.ui-li-dialogue-divider{padding-top:.9090909090909092rem;padding-bottom:0rem;padding-left:.4545454545454546rem;margin-left:.18181818181818182rem;margin-right:.18181818181818182rem;background:#efede5;font-size:.7272727272727273rem;font-weight:700;color:#3b73b6}.ui-listview li.ui-li-dialogue-edit{padding-left:5.2727272727272725rem;padding-top:.5454545454545454rem;padding-bottom:.5454545454545454rem}.ui-listview li.ui-li-dialogue-edit .ui-edit-title{position:absolute;left:.4545454545454546rem;width:4.136363636363637rem;padding-right:.36363636363636365rem;display:inline-block;top:50%;margin-top:-.5909090909090909rem;border-right-color:#b9b8b2;border-right-width:1px;border-right-style:solid}.ui-listview li.ui-li-dialogue-edit input{font-size:1rem;background:transparent;outline-color:transparent;width:100%;padding-left:0;padding-right:0}.ui-listview>.ui-li.ui-li-dialogue-edit.ui-li-has-right-btn{padding-right:5rem}.ui-listview .ui-li-static.ui-li-bubble-receive,.ui-listview .ui-li-static.ui-li-bubble-left{color:#fff}.ui-listview .ui-li-static.ui-li-bubble-receive>.ui-li-bubble-time,.ui-listview .ui-li-static.ui-li-bubble-left>.ui-li-bubble-time{color:#d30000}.ui-listview .ui-li-static.ui-li-bubble-sent,.ui-listview .ui-li-static.ui-li-bubble-right{color:#000}.ui-listview .ui-li-static.ui-li-bubble-sent>.ui-li-bubble-time,.ui-listview .ui-li-static.ui-li-bubble-right>.ui-li-bubble-time{color:#39a6d7}.ui-listview .ui-li-static.ui-li-bubble-sos{color:#e94949}.ui-listview .ui-li-static.ui-li-bubble-sos>.ui-li-bubble-time{color:#d30000}.ui-listview .ui-li-static.ui-li-bubble-date{background-color:rgba(225,225,225,0);color:#686868;font-style:italic}.ui-listview span.ui-li-bubble-time{font-weight:700}.ui-listview .ui-li-bubble-receive,.ui-listview .ui-li-bubble-left,.ui-listview .ui-li-bubble-sent,.ui-listview .ui-li-bubble-right,.ui-listview .ui-li-bubble-sos{display:inline-block;background-clip:padding-box;max-width:80%;word-wrap:break-word;font-size:.8636363636363636rem}.ui-listview .ui-li-bubble-receive p,.ui-listview .ui-li-bubble-left p,.ui-listview .ui-li-bubble-sent p,.ui-listview .ui-li-bubble-right p,.ui-listview .ui-li-bubble-sos p,.ui-listview .ui-li-bubble-receive span,.ui-listview .ui-li-bubble-left span,.ui-listview .ui-li-bubble-sent span,.ui-listview .ui-li-bubble-right span,.ui-listview .ui-li-bubble-sos span{font-size:.8636363636363636rem}.ui-listview .ui-li-bubble-receive img,.ui-listview .ui-li-bubble-left img,.ui-listview .ui-li-bubble-sent img,.ui-listview .ui-li-bubble-right img,.ui-listview .ui-li-bubble-sos img{position:relative;min-width:7.272727272727273rem;min-height:7.272727272727273rem}.ui-listview .ui-li-bubble-receive,.ui-listview .ui-li-bubble-left{margin-left:0;margin-right:auto;border-image-source:url(images/00_messagebubble_bg_receive.9.png);border-image-slice:57 14 21 48 fill;border-image-width:auto;padding:9px 14px 21px 48px}.ui-listview .ui-li-bubble-receive>.ui-li-bubble-time,.ui-listview .ui-li-bubble-left>.ui-li-bubble-time{position:absolute;display:inline-block;bottom:.36363636363636365rem;left:100%;font-size:.5rem}.ui-listview .ui-li-bubble-sent,.ui-listview .ui-li-bubble-right{margin-left:auto;margin-right:0;border-image-source:url(images/00_messagebubble_bg_sent.9.png);border-image-slice:55 47 20 13 fill;border-image-width:auto;padding:9px 47px 20px 13px}.ui-listview .ui-li-bubble-sent>.ui-li-bubble-time,.ui-listview .ui-li-bubble-right>.ui-li-bubble-time{position:absolute;display:inline-block;bottom:.36363636363636365rem;right:100%;font-size:.5rem}.ui-listview .ui-li-bubble-date{float:left;width:100%;height:1.0909090909090908rem;background-image:url(images/00_messagebubble_date_bg.png);background-repeat:repeat-x;background-position:center center;font-size:.7272727272727273rem;margin:.9090909090909092rem .2727272727272727rem;border:0 none red;padding:0 0;padding-top:.5em;text-align:center}.ui-listview .ui-li-bubble-date *{display:inline-block;background-color:#f8f6ef;padding-left:.5em;padding-right:.5em}@-webkit-keyframes addliitem{from{ -webkit-transform:scale(0.5);-moz-transform:scale(0.5);opacity:0}to{-webkit-transform:scale(1);-moz-transform:scale(1);opacity:1}}.addli{-webkit-animation-name:addliitem;-moz-animation-name:addliitem;-webkit-animation-duration:.5s;-moz-animation-duration:.5s;-webkit-transition-timing-function:linear;-moz-transition-timing-function:linear}@-webkit-keyframes removeliitem{from{ -webkit-transform:scale(1);-moz-transform:scale(1);opacity:1}to{-webkit-transform:scale(0.5);-moz-transform:scale(0.5);opacity:0}}.removeli{-webkit-animation-name:removeliitem;-moz-animation-name:removeliitem;-webkit-animation-duration:.5s;-moz-animation-duration:.5s;-webkit-transition-timing-function:linear;-moz-transition-timing-function:linear}.LESSbutton_box_style{color:#363133}.LESSbutton_up_style{background:#ebe8e3;background:-webkit-linear-gradient(top, #ebe8e3, #eae7e2);background:-moz-linear-gradient(top, #ebe8e3, #eae7e2);background:-o-linear-gradient(top, #ebe8e3, #eae7e2);background:-ms-linear-gradient(top, #ebe8e3, #eae7e2)}.LESSbutton_box_style{background:#ebe8e3;background:-webkit-linear-gradient(top, #ebe8e3, #eae7e2);background:-moz-linear-gradient(top, #ebe8e3, #eae7e2);background:-o-linear-gradient(top, #ebe8e3, #eae7e2);background:-ms-linear-gradient(top, #ebe8e3, #eae7e2);border:1px solid;border-color:#dcdad3;-o-box-shadow:0 0 1px 1px #fff;-ms-box-shadow:0 0 1px 1px #fff;-moz-box-shadow:0 0 1px 1px #fff;-webkit-box-shadow:0 0 1px 1px #fff;box-shadow:0 0 1px 1px #fff}.LESSbutton_inner_box_style{background:#f7f5ee;background:-webkit-linear-gradient(top, #faf7f2, #f8f5f0);background:-ms-linear-gradient(top, #faf7f2, #f8f5f0);background:-o-linear-gradient(top, #faf7f2, #f8f5f0);background:-moz-linear-gradient(top, #faf7f2, #f8f5f0);-o-box-shadow:none;-ms-box-shadow:none;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none}.LESSbutton_inner_pressstyle{color:#f8f6ef}.LESSbutton_text1_style{font-family:Helvetica,Arial,sans-serif;font-weight:400;font-size:1.0rem;font-style:normal;color:#000}.LESSbutton_hover_style{color:#363133}.LESSbutton_down_style{background:#3b73b6;color:#f8f6ef}.LESSbutton_edit_style{background:#c95858;background:-webkit-gradient(linear,left top,left bottom,from( #c95858),to( #a12828));background:-moz_linear-gradient(top, #c95858, #a12828)}.LESSDayselectorButtonNormal{background:#7e9db2;background:-webkit-linear-gradient(top, #7e9db2 0, #547990 100%);background:-moz-linear-gradient(top, #7e9db2 0, #547990 100%);background:-ms-linear-gradient(top, #7e9db2 0, #547990 100%);background:-o-linear-gradient(top, #7e9db2 0, #547990 100%);background:linear-gradient(top, #7e9db2 0, #547990 100%)}.LESSDayaselectorButtonPress{background:#3b7796;background:-webkit-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-moz-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-ms-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-o-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:linear-gradient(top, #3b7796 0, #2f5b75 100%)}.LESSpopup_button_style{}.LESSpopup_button_hover_style{background:#5e88a3}.LESSpopup_button_press_style{background:#43a0d9;background:-webkit-gradient(linear,left top,left bottom,from( #43a0d9),to( #388bb9));background:-moz-linear-gradient(top, #43a0d9, #388bb9);background:-ms-linear-gradient(top, #43a0d9, #388bb9);background:-o-linear-gradient(top, #43a0d9, #388bb9)}.LESStoggleswitch_on_style{background:#2a7eac;background:-webkit-gradient(linear,left top,left bottom,from( #2174a7),to( #4ba5db));background:-moz-linear-gradient(top, #2174a7, #4ba5db);border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px}.LESStoggleswitch_off_style{color:#cbcbcb;background:#97a1a7;background:-webkit-gradient(linear,left top,left bottom,from( #727272),to( #8d8d8d));background:-moz-linear-gradient(top, #727272, #8d8d8d);border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px}.LESStoggleswitch_reed_style{background:#fdfdfd;background:-webkit-gradient(linear,left top,left bottom,from( #fdfdfd),to( #e7e7e7));background:-moz-linear-gradient(top, #fdfdfd, #e7e7e7);border-radius:2px;-webkit-border-radius:2px;-moz-border-radius:2px}.LESSbutton_editpress_style{background:#931818;background:-webkit-gradient(linear,left top,left bottom,from( #931818),to( #6e1717));background:-moz-linear-gradient(top, #931818, #6e1717)}.LESSbutton_edit_padding{padding:.5em .8em}.LESSmultimediaview_bar_active_style{background-color:#4a84c9;background-image:-webkit-gradient(linear,left top,left bottom,from( #6289d9),to( #295b98));background-image:-moz-linear-gradient(top, #6289d9, #295b98);background-image:-o-linear-gradient(top, #6289d9, #295b98);background-image:-ms-linear-gradient(top, #6289d9, #295b98)}.LESSmultimediaview_bar_handle_style{background-color:#f9f9f9;background-image:-webkit-gradient(linear,left top,left bottom,from( #fff),to( #e6e6e6));background-image:-moz-linear-gradient(top, #fff, #e6e6e6);background-image:-o-linear-gradient(top, #fff, #e6e6e6);background-image:-ms-linear-gradient(top, #fff, #e6e6e6)}.ui-controlgroup .ui-radio>.ui-btn{background:#f8f6ef}.ui-controlgroup .ui-btn-text{font-size:.7727272727272727rem;font-weight:700;color:#3a3a3a}.ui-controlgroup .ui-btn-inner .ui-corner-left .ui-controlgroup-first{-o-border-radius:.3em;-ms-border-radius:.3em;-moz-border-radius:.3em;-webkit-border-radius:.3em;border-radius:.3em}.ui-controlgroup .ui-btn-inner .ui-corner-right .ui-controlgroup-last{-o-border-radius:.3em;-ms-border-radius:.3em;-moz-border-radius:.3em;-webkit-border-radius:.3em;border-radius:.3em}.ui-controlgroup .ui-radio-off.ui-btn-hover-s.ui-btn-down-s .ui-btn-inner,.ui-controlgroup .ui-radio-on .ui-btn-inner{color:#f9f9f9}.ui-controlgroup .ui-radio-off .ui-btn-inner{color:#f9f9f9}.ui-controlgroup.ui-controlgroup-horizontal .ui-radio .ui-btn-down-s .ui-btn-inner{background:-webkit-linear-gradient(top, #d2d2c8 0, #f6f8ef 100%)}.LESSbutton_box_style{color:#363133}.LESSbutton_up_style{background:#ebe8e3;background:-webkit-linear-gradient(top, #ebe8e3, #eae7e2);background:-moz-linear-gradient(top, #ebe8e3, #eae7e2);background:-o-linear-gradient(top, #ebe8e3, #eae7e2);background:-ms-linear-gradient(top, #ebe8e3, #eae7e2)}.LESSbutton_box_style{background:#ebe8e3;background:-webkit-linear-gradient(top, #ebe8e3, #eae7e2);background:-moz-linear-gradient(top, #ebe8e3, #eae7e2);background:-o-linear-gradient(top, #ebe8e3, #eae7e2);background:-ms-linear-gradient(top, #ebe8e3, #eae7e2);border:1px solid;border-color:#dcdad3;-o-box-shadow:0 0 1px 1px #fff;-ms-box-shadow:0 0 1px 1px #fff;-moz-box-shadow:0 0 1px 1px #fff;-webkit-box-shadow:0 0 1px 1px #fff;box-shadow:0 0 1px 1px #fff}.LESSbutton_inner_box_style{background:#f7f5ee;background:-webkit-linear-gradient(top, #faf7f2, #f8f5f0);background:-ms-linear-gradient(top, #faf7f2, #f8f5f0);background:-o-linear-gradient(top, #faf7f2, #f8f5f0);background:-moz-linear-gradient(top, #faf7f2, #f8f5f0);-o-box-shadow:none;-ms-box-shadow:none;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none}.LESSbutton_inner_pressstyle{color:#f8f6ef}.LESSbutton_text1_style{font-family:Helvetica,Arial,sans-serif;font-weight:400;font-size:1.0rem;font-style:normal;color:#000}.LESSbutton_hover_style{color:#363133}.LESSbutton_down_style{background:#3b73b6;color:#f8f6ef}.LESSbutton_edit_style{background:#c95858;background:-webkit-gradient(linear,left top,left bottom,from( #c95858),to( #a12828));background:-moz_linear-gradient(top, #c95858, #a12828)}.LESSDayselectorButtonNormal{background:#7e9db2;background:-webkit-linear-gradient(top, #7e9db2 0, #547990 100%);background:-moz-linear-gradient(top, #7e9db2 0, #547990 100%);background:-ms-linear-gradient(top, #7e9db2 0, #547990 100%);background:-o-linear-gradient(top, #7e9db2 0, #547990 100%);background:linear-gradient(top, #7e9db2 0, #547990 100%)}.LESSDayaselectorButtonPress{background:#3b7796;background:-webkit-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-moz-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-ms-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-o-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:linear-gradient(top, #3b7796 0, #2f5b75 100%)}.LESSpopup_button_style{}.LESSpopup_button_hover_style{background:#5e88a3}.LESSpopup_button_press_style{background:#43a0d9;background:-webkit-gradient(linear,left top,left bottom,from( #43a0d9),to( #388bb9));background:-moz-linear-gradient(top, #43a0d9, #388bb9);background:-ms-linear-gradient(top, #43a0d9, #388bb9);background:-o-linear-gradient(top, #43a0d9, #388bb9)}.LESStoggleswitch_on_style{background:#2a7eac;background:-webkit-gradient(linear,left top,left bottom,from( #2174a7),to( #4ba5db));background:-moz-linear-gradient(top, #2174a7, #4ba5db);border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px}.LESStoggleswitch_off_style{color:#cbcbcb;background:#97a1a7;background:-webkit-gradient(linear,left top,left bottom,from( #727272),to( #8d8d8d));background:-moz-linear-gradient(top, #727272, #8d8d8d);border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px}.LESStoggleswitch_reed_style{background:#fdfdfd;background:-webkit-gradient(linear,left top,left bottom,from( #fdfdfd),to( #e7e7e7));background:-moz-linear-gradient(top, #fdfdfd, #e7e7e7);border-radius:2px;-webkit-border-radius:2px;-moz-border-radius:2px}.LESSbutton_editpress_style{background:#931818;background:-webkit-gradient(linear,left top,left bottom,from( #931818),to( #6e1717));background:-moz-linear-gradient(top, #931818, #6e1717)}.LESSbutton_edit_padding{padding:.5em .8em}.LESSmultimediaview_bar_active_style{background-color:#4a84c9;background-image:-webkit-gradient(linear,left top,left bottom,from( #6289d9),to( #295b98));background-image:-moz-linear-gradient(top, #6289d9, #295b98);background-image:-o-linear-gradient(top, #6289d9, #295b98);background-image:-ms-linear-gradient(top, #6289d9, #295b98)}.LESSmultimediaview_bar_handle_style{background-color:#f9f9f9;background-image:-webkit-gradient(linear,left top,left bottom,from( #fff),to( #e6e6e6));background-image:-moz-linear-gradient(top, #fff, #e6e6e6);background-image:-o-linear-gradient(top, #fff, #e6e6e6);background-image:-ms-linear-gradient(top, #fff, #e6e6e6)}.ui-option-header{overflow:hidden;background:#1a5274}.ui-option-header-1-row{height:4.818181818181818rem;border:0}.ui-option-header-2-row{height:8.90909090909091rem;border:0}.ui-option-header-row-1{height:4.818181818181818rem}.ui-option-header-row-2{height:8.90909090909091rem;margin-top:-2px;padding:0rem .2272727272727273rem .2727272727272727rem .2272727272727273rem}.ui-option-header-row-2 div{margin-top:.2272727272727273rem;margin-bottom:.2272727272727273rem}.ui-option-header .ui-btn{display:block;margin:.13636363636363635rem .2272727272727273rem .2272727272727273rem .2272727272727273rem}.ui-option-header .ui-input-search .ui-btn{display:none}.ui-option-header .ui-btn-text{line-height:1.5454545454545454rem;font-weight:700}.ui-option-header .ui-btn-down-s.ui-btn-hover-s .ui-btn-inner,.ui-option-header .ui-btn-down-s .ui-btn-inner{background:-webkit-linear-gradient(top, #4aa4da 0, #2b8ac3 100%)}.ui-option-header .ui-btn-hover-s .ui-btn-inner,.ui-option-header .ui-btn-up-s .ui-btn-inner{background:-webkit-linear-gradient(top, #38708d 0, #245d80 100%)}.ui-option-header .ui-btn-inner{padding-top:.2727272727272727rem;padding-bottom:.2727272727272727rem;color:#f9f9f9}.ui-option-header .ui-controlgroup-horizontal .ui-btn{display:inline-block!important;margin:-.13636363636363635rem!important}.ui-option-header .ui-controlgroup,.ui-option-header fieldset.ui-controlgroup{margin-bottom:0!important}.ui-option-header .ui-controlgroup-horizontal .ui-corner-left{margin-left:.2272727272727273rem!important}.ui-option-header .ui-controlgroup-horizontal .ui-corner-right{margin-right:.2272727272727273rem!important}.ui-option-header-triangle-arrow{top:-.5454545454545454rem;height:.4545454545454546rem;width:100%;position:relative;margin-bottom:-.4545454545454546rem}.ui-header.ui-option-header-resizing .ui-option-header .ui-btn{background:transparent;border:0;width:100%;top:.7272727272727273rem}.ui-header.ui-option-header-resizing .ui-option-header .ui-btn .ui-btn-inner{width:92%;padding:.66em 0 .66em;margin:0 auto}.ui-header.ui-option-header-resizing .ui-option-header .input-search-bar .ui-btn{width:28%}.ui-triangle-image{background-image:url(images/00_winset_control_top_arrow.png);background-size:100% 100%;position:absolute;width:1.2727272727272727rem;height:1.0909090909090908rem;left:50%}.ui-btn-up-s .ui-icon-optiontray,.ui-btn-hover-s .ui-icon-optiontray{background-size:100% 100%;background-image:url(images/00_winset_more.png)}.ui-btn-down-s .ui-icon-optiontray{background-size:100% 100%;background-image:url(images/00_winset_more_press.png)}.ui-header .ui-btn .ui-btn-icon-only{padding:0;height:100%}.ui-header .ui-btn .ui-btn-icon-only .ui-icon-optiontray{width:2.5454545454545454rem;height:2.5454545454545454rem;left:1.3636363636363638rem}.LESSbutton_box_style{color:#363133}.LESSbutton_up_style{background:#ebe8e3;background:-webkit-linear-gradient(top, #ebe8e3, #eae7e2);background:-moz-linear-gradient(top, #ebe8e3, #eae7e2);background:-o-linear-gradient(top, #ebe8e3, #eae7e2);background:-ms-linear-gradient(top, #ebe8e3, #eae7e2)}.LESSbutton_box_style{background:#ebe8e3;background:-webkit-linear-gradient(top, #ebe8e3, #eae7e2);background:-moz-linear-gradient(top, #ebe8e3, #eae7e2);background:-o-linear-gradient(top, #ebe8e3, #eae7e2);background:-ms-linear-gradient(top, #ebe8e3, #eae7e2);border:1px solid;border-color:#dcdad3;-o-box-shadow:0 0 1px 1px #fff;-ms-box-shadow:0 0 1px 1px #fff;-moz-box-shadow:0 0 1px 1px #fff;-webkit-box-shadow:0 0 1px 1px #fff;box-shadow:0 0 1px 1px #fff}.LESSbutton_inner_box_style{background:#f7f5ee;background:-webkit-linear-gradient(top, #faf7f2, #f8f5f0);background:-ms-linear-gradient(top, #faf7f2, #f8f5f0);background:-o-linear-gradient(top, #faf7f2, #f8f5f0);background:-moz-linear-gradient(top, #faf7f2, #f8f5f0);-o-box-shadow:none;-ms-box-shadow:none;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none}.LESSbutton_inner_pressstyle{color:#f8f6ef}.LESSbutton_text1_style{font-family:Helvetica,Arial,sans-serif;font-weight:400;font-size:1.0rem;font-style:normal;color:#000}.LESSbutton_hover_style{color:#363133}.LESSbutton_down_style{background:#3b73b6;color:#f8f6ef}.LESSbutton_edit_style{background:#c95858;background:-webkit-gradient(linear,left top,left bottom,from( #c95858),to( #a12828));background:-moz_linear-gradient(top, #c95858, #a12828)}.LESSDayselectorButtonNormal{background:#7e9db2;background:-webkit-linear-gradient(top, #7e9db2 0, #547990 100%);background:-moz-linear-gradient(top, #7e9db2 0, #547990 100%);background:-ms-linear-gradient(top, #7e9db2 0, #547990 100%);background:-o-linear-gradient(top, #7e9db2 0, #547990 100%);background:linear-gradient(top, #7e9db2 0, #547990 100%)}.LESSDayaselectorButtonPress{background:#3b7796;background:-webkit-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-moz-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-ms-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-o-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:linear-gradient(top, #3b7796 0, #2f5b75 100%)}.LESSpopup_button_style{}.LESSpopup_button_hover_style{background:#5e88a3}.LESSpopup_button_press_style{background:#43a0d9;background:-webkit-gradient(linear,left top,left bottom,from( #43a0d9),to( #388bb9));background:-moz-linear-gradient(top, #43a0d9, #388bb9);background:-ms-linear-gradient(top, #43a0d9, #388bb9);background:-o-linear-gradient(top, #43a0d9, #388bb9)}.LESStoggleswitch_on_style{background:#2a7eac;background:-webkit-gradient(linear,left top,left bottom,from( #2174a7),to( #4ba5db));background:-moz-linear-gradient(top, #2174a7, #4ba5db);border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px}.LESStoggleswitch_off_style{color:#cbcbcb;background:#97a1a7;background:-webkit-gradient(linear,left top,left bottom,from( #727272),to( #8d8d8d));background:-moz-linear-gradient(top, #727272, #8d8d8d);border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px}.LESStoggleswitch_reed_style{background:#fdfdfd;background:-webkit-gradient(linear,left top,left bottom,from( #fdfdfd),to( #e7e7e7));background:-moz-linear-gradient(top, #fdfdfd, #e7e7e7);border-radius:2px;-webkit-border-radius:2px;-moz-border-radius:2px}.LESSbutton_editpress_style{background:#931818;background:-webkit-gradient(linear,left top,left bottom,from( #931818),to( #6e1717));background:-moz-linear-gradient(top, #931818, #6e1717)}.LESSbutton_edit_padding{padding:.5em .8em}.LESSmultimediaview_bar_active_style{background-color:#4a84c9;background-image:-webkit-gradient(linear,left top,left bottom,from( #6289d9),to( #295b98));background-image:-moz-linear-gradient(top, #6289d9, #295b98);background-image:-o-linear-gradient(top, #6289d9, #295b98);background-image:-ms-linear-gradient(top, #6289d9, #295b98)}.LESSmultimediaview_bar_handle_style{background-color:#f9f9f9;background-image:-webkit-gradient(linear,left top,left bottom,from( #fff),to( #e6e6e6));background-image:-moz-linear-gradient(top, #fff, #e6e6e6);background-image:-o-linear-gradient(top, #fff, #e6e6e6);background-image:-ms-linear-gradient(top, #fff, #e6e6e6)}ul.ui-virtual-list-container>li.position_absolute{position:absolute}ul.ui-virtual-list-container>ul.position_absolute{position:absolute}.LESSbutton_box_style{color:#363133}.LESSbutton_up_style{background:#ebe8e3;background:-webkit-linear-gradient(top, #ebe8e3, #eae7e2);background:-moz-linear-gradient(top, #ebe8e3, #eae7e2);background:-o-linear-gradient(top, #ebe8e3, #eae7e2);background:-ms-linear-gradient(top, #ebe8e3, #eae7e2)}.LESSbutton_box_style{background:#ebe8e3;background:-webkit-linear-gradient(top, #ebe8e3, #eae7e2);background:-moz-linear-gradient(top, #ebe8e3, #eae7e2);background:-o-linear-gradient(top, #ebe8e3, #eae7e2);background:-ms-linear-gradient(top, #ebe8e3, #eae7e2);border:1px solid;border-color:#dcdad3;-o-box-shadow:0 0 1px 1px #fff;-ms-box-shadow:0 0 1px 1px #fff;-moz-box-shadow:0 0 1px 1px #fff;-webkit-box-shadow:0 0 1px 1px #fff;box-shadow:0 0 1px 1px #fff}.LESSbutton_inner_box_style{background:#f7f5ee;background:-webkit-linear-gradient(top, #faf7f2, #f8f5f0);background:-ms-linear-gradient(top, #faf7f2, #f8f5f0);background:-o-linear-gradient(top, #faf7f2, #f8f5f0);background:-moz-linear-gradient(top, #faf7f2, #f8f5f0);-o-box-shadow:none;-ms-box-shadow:none;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none}.LESSbutton_inner_pressstyle{color:#f8f6ef}.LESSbutton_text1_style{font-family:Helvetica,Arial,sans-serif;font-weight:400;font-size:1.0rem;font-style:normal;color:#000}.LESSbutton_hover_style{color:#363133}.LESSbutton_down_style{background:#3b73b6;color:#f8f6ef}.LESSbutton_edit_style{background:#c95858;background:-webkit-gradient(linear,left top,left bottom,from( #c95858),to( #a12828));background:-moz_linear-gradient(top, #c95858, #a12828)}.LESSDayselectorButtonNormal{background:#7e9db2;background:-webkit-linear-gradient(top, #7e9db2 0, #547990 100%);background:-moz-linear-gradient(top, #7e9db2 0, #547990 100%);background:-ms-linear-gradient(top, #7e9db2 0, #547990 100%);background:-o-linear-gradient(top, #7e9db2 0, #547990 100%);background:linear-gradient(top, #7e9db2 0, #547990 100%)}.LESSDayaselectorButtonPress{background:#3b7796;background:-webkit-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-moz-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-ms-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-o-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:linear-gradient(top, #3b7796 0, #2f5b75 100%)}.LESSpopup_button_style{}.LESSpopup_button_hover_style{background:#5e88a3}.LESSpopup_button_press_style{background:#43a0d9;background:-webkit-gradient(linear,left top,left bottom,from( #43a0d9),to( #388bb9));background:-moz-linear-gradient(top, #43a0d9, #388bb9);background:-ms-linear-gradient(top, #43a0d9, #388bb9);background:-o-linear-gradient(top, #43a0d9, #388bb9)}.LESStoggleswitch_on_style{background:#2a7eac;background:-webkit-gradient(linear,left top,left bottom,from( #2174a7),to( #4ba5db));background:-moz-linear-gradient(top, #2174a7, #4ba5db);border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px}.LESStoggleswitch_off_style{color:#cbcbcb;background:#97a1a7;background:-webkit-gradient(linear,left top,left bottom,from( #727272),to( #8d8d8d));background:-moz-linear-gradient(top, #727272, #8d8d8d);border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px}.LESStoggleswitch_reed_style{background:#fdfdfd;background:-webkit-gradient(linear,left top,left bottom,from( #fdfdfd),to( #e7e7e7));background:-moz-linear-gradient(top, #fdfdfd, #e7e7e7);border-radius:2px;-webkit-border-radius:2px;-moz-border-radius:2px}.LESSbutton_editpress_style{background:#931818;background:-webkit-gradient(linear,left top,left bottom,from( #931818),to( #6e1717));background:-moz-linear-gradient(top, #931818, #6e1717)}.LESSbutton_edit_padding{padding:.5em .8em}.LESSmultimediaview_bar_active_style{background-color:#4a84c9;background-image:-webkit-gradient(linear,left top,left bottom,from( #6289d9),to( #295b98));background-image:-moz-linear-gradient(top, #6289d9, #295b98);background-image:-o-linear-gradient(top, #6289d9, #295b98);background-image:-ms-linear-gradient(top, #6289d9, #295b98)}.LESSmultimediaview_bar_handle_style{background-color:#f9f9f9;background-image:-webkit-gradient(linear,left top,left bottom,from( #fff),to( #e6e6e6));background-image:-moz-linear-gradient(top, #fff, #e6e6e6);background-image:-o-linear-gradient(top, #fff, #e6e6e6);background-image:-ms-linear-gradient(top, #fff, #e6e6e6)}.ui-scrollview-clip{position:relative}.ui-scrollview-view{overflow:visible;overflow-x:hidden}.ui-scrolllistview .ui-li-divider{z-index:10}.ui-scrollbar{position:absolute;overflow:hidden;opacity:0}.ui-scrollbar-visible{opacity:1}.ui-scrollbar-y{top:.09090909090909091rem;right:.09090909090909091rem;bottom:.09090909090909091rem;width:.36363636363636365rem}.ui-scrollbar-x{right:.09090909090909091rem;bottom:.09090909090909091rem;left:.09090909090909091rem;height:.36363636363636365rem}.ui-scrollbar-track{position:relative;width:100%;height:100%}.ui-scrollbar-thumb{position:absolute;top:0;left:0;background-color:#c6c4be}.ui-scrollbar-y .ui-scrollbar-thumb{width:.2272727272727273rem;height:100%;-o-border-radius:.09090909090909091rem;-ms-border-radius:.09090909090909091rem;-moz-border-radius:.09090909090909091rem;-webkit-border-radius:.09090909090909091rem;border-radius:.09090909090909091rem;-o-box-shadow:.045454545454545456rem .045454545454545456rem .09090909090909091rem #94928c;-ms-box-shadow:.045454545454545456rem .045454545454545456rem .09090909090909091rem #94928c;-moz-box-shadow:.045454545454545456rem .045454545454545456rem .09090909090909091rem #94928c;-webkit-box-shadow:.045454545454545456rem .045454545454545456rem .09090909090909091rem #94928c;box-shadow:.045454545454545456rem .045454545454545456rem .09090909090909091rem #94928c}.ui-scrollbar-x .ui-scrollbar-thumb{width:100%;height:.2272727272727273rem;-o-border-radius:.09090909090909091rem;-ms-border-radius:.09090909090909091rem;-moz-border-radius:.09090909090909091rem;-webkit-border-radius:.09090909090909091rem;border-radius:.09090909090909091rem}.ui-scroll-jump-top-bg{position:absolute;top:.4090909090909091rem;right:.5909090909090909rem;width:1.6818181818181819rem;height:1.6818181818181819rem}.ui-scroll-jump-left-bg{position:absolute;bottom:.4090909090909091rem;left:.5909090909090909rem;width:1.6818181818181819rem;height:1.6818181818181819rem}.ui-overflow-indicator-top{position:absolute;display:block;top:0;width:100%;height:.4545454545454546rem;opacity:0;background:-webkit-gradient(linear,left bottom,left top,color-stop(0, #fff),color-stop(1, #808080))}.ui-overflow-indicator-bottom{position:absolute;display:block;bottom:0;width:100%;height:.4545454545454546rem;opacity:0;background:-webkit-gradient(linear,left bottom,left top,color-stop(0, #808080),color-stop(1, #fff))}.ui-content.ui-scrollview-clip{padding:0}.ui-content.ui-scrollview-clip>div.ui-scrollview-view{margin:0;padding-left:.36363636363636365rem;padding-right:.36363636363636365rem}.ui-content.ui-scrollview-clip>.ui-listview.ui-scrollview-view{margin:0}.LESSbutton_box_style{color:#363133}.LESSbutton_up_style{background:#ebe8e3;background:-webkit-linear-gradient(top, #ebe8e3, #eae7e2);background:-moz-linear-gradient(top, #ebe8e3, #eae7e2);background:-o-linear-gradient(top, #ebe8e3, #eae7e2);background:-ms-linear-gradient(top, #ebe8e3, #eae7e2)}.LESSbutton_box_style{background:#ebe8e3;background:-webkit-linear-gradient(top, #ebe8e3, #eae7e2);background:-moz-linear-gradient(top, #ebe8e3, #eae7e2);background:-o-linear-gradient(top, #ebe8e3, #eae7e2);background:-ms-linear-gradient(top, #ebe8e3, #eae7e2);border:1px solid;border-color:#dcdad3;-o-box-shadow:0 0 1px 1px #fff;-ms-box-shadow:0 0 1px 1px #fff;-moz-box-shadow:0 0 1px 1px #fff;-webkit-box-shadow:0 0 1px 1px #fff;box-shadow:0 0 1px 1px #fff}.LESSbutton_inner_box_style{background:#f7f5ee;background:-webkit-linear-gradient(top, #faf7f2, #f8f5f0);background:-ms-linear-gradient(top, #faf7f2, #f8f5f0);background:-o-linear-gradient(top, #faf7f2, #f8f5f0);background:-moz-linear-gradient(top, #faf7f2, #f8f5f0);-o-box-shadow:none;-ms-box-shadow:none;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none}.LESSbutton_inner_pressstyle{color:#f8f6ef}.LESSbutton_text1_style{font-family:Helvetica,Arial,sans-serif;font-weight:400;font-size:1.0rem;font-style:normal;color:#000}.LESSbutton_hover_style{color:#363133}.LESSbutton_down_style{background:#3b73b6;color:#f8f6ef}.LESSbutton_edit_style{background:#c95858;background:-webkit-gradient(linear,left top,left bottom,from( #c95858),to( #a12828));background:-moz_linear-gradient(top, #c95858, #a12828)}.LESSDayselectorButtonNormal{background:#7e9db2;background:-webkit-linear-gradient(top, #7e9db2 0, #547990 100%);background:-moz-linear-gradient(top, #7e9db2 0, #547990 100%);background:-ms-linear-gradient(top, #7e9db2 0, #547990 100%);background:-o-linear-gradient(top, #7e9db2 0, #547990 100%);background:linear-gradient(top, #7e9db2 0, #547990 100%)}.LESSDayaselectorButtonPress{background:#3b7796;background:-webkit-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-moz-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-ms-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-o-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:linear-gradient(top, #3b7796 0, #2f5b75 100%)}.LESSpopup_button_style{}.LESSpopup_button_hover_style{background:#5e88a3}.LESSpopup_button_press_style{background:#43a0d9;background:-webkit-gradient(linear,left top,left bottom,from( #43a0d9),to( #388bb9));background:-moz-linear-gradient(top, #43a0d9, #388bb9);background:-ms-linear-gradient(top, #43a0d9, #388bb9);background:-o-linear-gradient(top, #43a0d9, #388bb9)}.LESStoggleswitch_on_style{background:#2a7eac;background:-webkit-gradient(linear,left top,left bottom,from( #2174a7),to( #4ba5db));background:-moz-linear-gradient(top, #2174a7, #4ba5db);border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px}.LESStoggleswitch_off_style{color:#cbcbcb;background:#97a1a7;background:-webkit-gradient(linear,left top,left bottom,from( #727272),to( #8d8d8d));background:-moz-linear-gradient(top, #727272, #8d8d8d);border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px}.LESStoggleswitch_reed_style{background:#fdfdfd;background:-webkit-gradient(linear,left top,left bottom,from( #fdfdfd),to( #e7e7e7));background:-moz-linear-gradient(top, #fdfdfd, #e7e7e7);border-radius:2px;-webkit-border-radius:2px;-moz-border-radius:2px}.LESSbutton_editpress_style{background:#931818;background:-webkit-gradient(linear,left top,left bottom,from( #931818),to( #6e1717));background:-moz-linear-gradient(top, #931818, #6e1717)}.LESSbutton_edit_padding{padding:.5em .8em}.LESSmultimediaview_bar_active_style{background-color:#4a84c9;background-image:-webkit-gradient(linear,left top,left bottom,from( #6289d9),to( #295b98));background-image:-moz-linear-gradient(top, #6289d9, #295b98);background-image:-o-linear-gradient(top, #6289d9, #295b98);background-image:-ms-linear-gradient(top, #6289d9, #295b98)}.LESSmultimediaview_bar_handle_style{background-color:#f9f9f9;background-image:-webkit-gradient(linear,left top,left bottom,from( #fff),to( #e6e6e6));background-image:-moz-linear-gradient(top, #fff, #e6e6e6);background-image:-o-linear-gradient(top, #fff, #e6e6e6);background-image:-ms-linear-gradient(top, #fff, #e6e6e6)}@-webkit-keyframes ui-datetime-in{from{ -webkit-transform:translatey(0.6363636363636364rem) scale(0.9)}to{-webkit-transform:translatey(0) scale(1)}}@-webkit-keyframes ui-datetime-out{from{ opacity:.8;-webkit-transform:translatey(0) scale(0.6)}to{opacity:0;-webkit-transform:translatey(-.6363636363636364rem) scale(0.6)}}.ui-datefield .ui-datefield-seperator{display:inline-block;min-width:.4545454545454546rem;text-align:center}.ui-datefield .date,.ui-datefield .time,.ui-datefield .ui-datefield-tab{display:inline-block}.ui-datefield .ui-datefield-tab{min-width:.9090909090909092rem}.ui-datefield .ui-btn-box-s .ui-btn-inner.ui-btn-hastxt{padding:.1em .5em}.ui-datefield .ui-datefield-selected{display:inline-block;color:#3b73b6}.ui-datefield .ui-datefield-selected.in{-ms-animation:ui-datetime-in .3s 1 ease;-o-animation:ui-datetime-in .3s 1 ease;-moz-animation:ui-datetime-in .3s 1 ease;-webkit-animation:ui-datetime-in .3s 1 ease}.ui-datefield .ui-datefield-selected.out{-ms-animation:ui-datetime-out .3s 1 ease;-o-animation:ui-datetime-out .3s 1 ease;-moz-animation:ui-datetime-out .3s 1 ease;-webkit-animation:ui-datetime-out .3s 1 ease}.ui-datetime{margin:0;height:1.6363636363636365rem}.ui-datetime-text-main{position:relative;font-size:1rem;top:0;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;padding-top:.3em}.ui-datetime-text-main .ui-datefield-period.ui-btn{margin-top:-.3em;height:1.2727272727272727rem;right:auto;position:relative ! important}.ui-datetime-text-sub{top:.6818181818181819rem ! important;color:#3b73b6 ! important;background:transparent ! important;font-size:.7272727272727273rem ! important}.ui-datetimepicker-selector ul{padding:0;display:inline;list-style:none;vertical-align:middle;margin:0}.ui-datetimepicker-selector ul li{font-size:1rem;float:left;padding:.6818181818181819rem .18181818181818182rem 0 .18181818181818182rem;max-width:5.454545454545455rem;min-width:2.7272727272727275rem}.ui-datetimepicker-selector ul li a.ui-link{text-decoration:none;color:rgba(249,249,249,.4)}.ui-datetimepicker-selector ul li a.ui-link:hover{color:rgba(249,249,249,.4)}.ui-datetimepicker-selector ul li.current a.ui-link{color:#f9f9f9}.ui-datetimepicker{left:0!important;padding:0}.ui-datetimepicker .ui-popupwindow-padding{background:#3b73b6!important;border-radius:0!important;-ms-border-radius:0!important;-o-border-radius:0!important;-moz-border-radius:0!important;-webkit-border-radius:0!important;box-shadow:0 0 12px rgba(0,0,0,.6)!important;border-width:0!important;text-align:center!important}.ui-datetimepicker .ui-popupwindow-padding div{height:2.409090909090909rem}.LESSbutton_box_style{color:#363133}.LESSbutton_up_style{background:#ebe8e3;background:-webkit-linear-gradient(top, #ebe8e3, #eae7e2);background:-moz-linear-gradient(top, #ebe8e3, #eae7e2);background:-o-linear-gradient(top, #ebe8e3, #eae7e2);background:-ms-linear-gradient(top, #ebe8e3, #eae7e2)}.LESSbutton_box_style{background:#ebe8e3;background:-webkit-linear-gradient(top, #ebe8e3, #eae7e2);background:-moz-linear-gradient(top, #ebe8e3, #eae7e2);background:-o-linear-gradient(top, #ebe8e3, #eae7e2);background:-ms-linear-gradient(top, #ebe8e3, #eae7e2);border:1px solid;border-color:#dcdad3;-o-box-shadow:0 0 1px 1px #fff;-ms-box-shadow:0 0 1px 1px #fff;-moz-box-shadow:0 0 1px 1px #fff;-webkit-box-shadow:0 0 1px 1px #fff;box-shadow:0 0 1px 1px #fff}.LESSbutton_inner_box_style{background:#f7f5ee;background:-webkit-linear-gradient(top, #faf7f2, #f8f5f0);background:-ms-linear-gradient(top, #faf7f2, #f8f5f0);background:-o-linear-gradient(top, #faf7f2, #f8f5f0);background:-moz-linear-gradient(top, #faf7f2, #f8f5f0);-o-box-shadow:none;-ms-box-shadow:none;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none}.LESSbutton_inner_pressstyle{color:#f8f6ef}.LESSbutton_text1_style{font-family:Helvetica,Arial,sans-serif;font-weight:400;font-size:1.0rem;font-style:normal;color:#000}.LESSbutton_hover_style{color:#363133}.LESSbutton_down_style{background:#3b73b6;color:#f8f6ef}.LESSbutton_edit_style{background:#c95858;background:-webkit-gradient(linear,left top,left bottom,from( #c95858),to( #a12828));background:-moz_linear-gradient(top, #c95858, #a12828)}.LESSDayselectorButtonNormal{background:#7e9db2;background:-webkit-linear-gradient(top, #7e9db2 0, #547990 100%);background:-moz-linear-gradient(top, #7e9db2 0, #547990 100%);background:-ms-linear-gradient(top, #7e9db2 0, #547990 100%);background:-o-linear-gradient(top, #7e9db2 0, #547990 100%);background:linear-gradient(top, #7e9db2 0, #547990 100%)}.LESSDayaselectorButtonPress{background:#3b7796;background:-webkit-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-moz-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-ms-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-o-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:linear-gradient(top, #3b7796 0, #2f5b75 100%)}.LESSpopup_button_style{}.LESSpopup_button_hover_style{background:#5e88a3}.LESSpopup_button_press_style{background:#43a0d9;background:-webkit-gradient(linear,left top,left bottom,from( #43a0d9),to( #388bb9));background:-moz-linear-gradient(top, #43a0d9, #388bb9);background:-ms-linear-gradient(top, #43a0d9, #388bb9);background:-o-linear-gradient(top, #43a0d9, #388bb9)}.LESStoggleswitch_on_style{background:#2a7eac;background:-webkit-gradient(linear,left top,left bottom,from( #2174a7),to( #4ba5db));background:-moz-linear-gradient(top, #2174a7, #4ba5db);border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px}.LESStoggleswitch_off_style{color:#cbcbcb;background:#97a1a7;background:-webkit-gradient(linear,left top,left bottom,from( #727272),to( #8d8d8d));background:-moz-linear-gradient(top, #727272, #8d8d8d);border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px}.LESStoggleswitch_reed_style{background:#fdfdfd;background:-webkit-gradient(linear,left top,left bottom,from( #fdfdfd),to( #e7e7e7));background:-moz-linear-gradient(top, #fdfdfd, #e7e7e7);border-radius:2px;-webkit-border-radius:2px;-moz-border-radius:2px}.LESSbutton_editpress_style{background:#931818;background:-webkit-gradient(linear,left top,left bottom,from( #931818),to( #6e1717));background:-moz-linear-gradient(top, #931818, #6e1717)}.LESSbutton_edit_padding{padding:.5em .8em}.LESSmultimediaview_bar_active_style{background-color:#4a84c9;background-image:-webkit-gradient(linear,left top,left bottom,from( #6289d9),to( #295b98));background-image:-moz-linear-gradient(top, #6289d9, #295b98);background-image:-o-linear-gradient(top, #6289d9, #295b98);background-image:-ms-linear-gradient(top, #6289d9, #295b98)}.LESSmultimediaview_bar_handle_style{background-color:#f9f9f9;background-image:-webkit-gradient(linear,left top,left bottom,from( #fff),to( #e6e6e6));background-image:-moz-linear-gradient(top, #fff, #e6e6e6);background-image:-o-linear-gradient(top, #fff, #e6e6e6);background-image:-ms-linear-gradient(top, #fff, #e6e6e6)}.ui-popupwindow-screen{background:#000;opacity:0;position:absolute;top:0;left:0;width:100%;height:100%;z-index:1200}.ui-popupwindow{position:absolute;z-index:1201!important;color:#f8f6ef;background:#f8f6ef}.ui-popupwindow .popup-title{width:100%;height:100%;font-size:1.0909090909090908rem;background:#5093b6}.ui-popupwindow .popup-title p{margin:0rem 0rem;padding:.5909090909090909rem 0rem}.ui-popupwindow .popup-text{width:100%;color:#000;font-size:1.0909090909090908rem;background:#f8f6ef}.ui-popupwindow .popup-text p{text-align:center;padding:1rem .7272727272727273rem}.ui-popupwindow .center_info{display:-moz-box;display:-webkit-box;display:box;-ms-box-orient:vertical;-moz-box-orient:vertical;-o-box-orient:vertical;-webkit-box-orient:vertical;box-orient:vertical;-ms-box-align:center;-moz-box-align:center;-o-box-align:center;-webkit-box-align:center;box-align:center;-ms-box-pack:center;-moz-box-pack:center;-o-box-pack:center;-webkit-box-pack:center;box-pack:center}.ui-popupwindow .center_title{display:-moz-box;display:-webkit-box;display:box;-ms-box-orient:vertical;-moz-box-orient:vertical;-o-box-orient:vertical;-webkit-box-orient:vertical;box-orient:vertical;-ms-box-align:center;-moz-box-align:center;-o-box-align:center;-webkit-box-align:center;box-align:center;-ms-box-pack:center;-moz-box-pack:center;-o-box-pack:center;-webkit-box-pack:center;box-pack:center;text-align:center}.ui-popupwindow .center_basic_1btn{display:-moz-box;display:-webkit-box;display:box;-ms-box-orient:vertical;-moz-box-orient:vertical;-o-box-orient:vertical;-webkit-box-orient:vertical;box-orient:vertical;-ms-box-align:center;-moz-box-align:center;-o-box-align:center;-webkit-box-align:center;box-align:center;-ms-box-pack:center;-moz-box-pack:center;-o-box-pack:center;-webkit-box-pack:center;box-pack:center;text-align:center}.ui-popupwindow .center_basic_1btn .popup-button-bg{font-size:1.4545454545454546rem;background:#f8f6ef;width:100%;padding-top:.5rem;padding-bottom:.5rem;vertical-align:middle}.ui-popupwindow .center_basic_1btn .popup-button-bg .ui-btn{width:18.272727272727273rem;height:3.3636363636363638rem;margin:auto}.ui-popupwindow .center_basic_2btn{display:-moz-box;display:-webkit-box;display:box;-ms-box-orient:vertical;-moz-box-orient:vertical;-o-box-orient:vertical;-webkit-box-orient:vertical;box-orient:vertical;-ms-box-align:center;-moz-box-align:center;-o-box-align:center;-webkit-box-align:center;box-align:center;-ms-box-pack:center;-moz-box-pack:center;-o-box-pack:center;-webkit-box-pack:center;box-pack:center;text-align:center}.ui-popupwindow .center_basic_2btn .popup-button-bg{font-size:1.4545454545454546rem;background:#f8f6ef;width:100%;padding-top:.5rem;padding-bottom:.5rem;vertical-align:middle}.ui-popupwindow .center_basic_2btn .popup-button-bg .ui-btn{width:12.454545454545455rem;height:3.3636363636363638rem;margin-top:0rem;margin-bottom:0rem;margin-left:.2272727272727273rem;margin-right:.2272727272727273rem;display:inline-block}.ui-popupwindow .center_basic_3btn{display:-moz-box;display:-webkit-box;display:box;-ms-box-orient:vertical;-moz-box-orient:vertical;-o-box-orient:vertical;-webkit-box-orient:vertical;box-orient:vertical;-ms-box-align:center;-moz-box-align:center;-o-box-align:center;-webkit-box-align:center;box-align:center;-ms-box-pack:center;-moz-box-pack:center;-o-box-pack:center;-webkit-box-pack:center;box-pack:center;text-align:center}.ui-popupwindow .center_basic_3btn .popup-button-bg{font-size:1.4545454545454546rem;background:#f8f6ef;width:100%;padding-top:.5rem;padding-bottom:.5rem;vertical-align:middle}.ui-popupwindow .center_basic_3btn .popup-button-bg .ui-btn{width:8.454545454545455rem;height:3.3636363636363638rem;margin-top:0rem;margin-bottom:0rem;margin-left:.2272727272727273rem;margin-right:.2272727272727273rem;display:inline-block}.ui-popupwindow .center_title_1btn{display:-moz-box;display:-webkit-box;display:box;-ms-box-orient:vertical;-moz-box-orient:vertical;-o-box-orient:vertical;-webkit-box-orient:vertical;box-orient:vertical;-ms-box-align:center;-moz-box-align:center;-o-box-align:center;-webkit-box-align:center;box-align:center;-ms-box-pack:center;-moz-box-pack:center;-o-box-pack:center;-webkit-box-pack:center;box-pack:center;text-align:center}.ui-popupwindow .center_title_1btn .popup-button-bg{font-size:1.4545454545454546rem;background:#f8f6ef;width:100%;padding-top:.5rem;padding-bottom:.5rem;vertical-align:middle}.ui-popupwindow .center_title_1btn .popup-button-bg .ui-btn{width:18.272727272727273rem;height:3.3636363636363638rem;margin:auto}.ui-popupwindow .center_title_2btn{display:-moz-box;display:-webkit-box;display:box;-ms-box-orient:vertical;-moz-box-orient:vertical;-o-box-orient:vertical;-webkit-box-orient:vertical;box-orient:vertical;-ms-box-align:center;-moz-box-align:center;-o-box-align:center;-webkit-box-align:center;box-align:center;-ms-box-pack:center;-moz-box-pack:center;-o-box-pack:center;-webkit-box-pack:center;box-pack:center;text-align:center}.ui-popupwindow .center_title_2btn .popup-button-bg{font-size:1.4545454545454546rem;background:#f8f6ef;width:100%;padding-top:.5rem;padding-bottom:.5rem;vertical-align:middle}.ui-popupwindow .center_title_2btn .popup-button-bg .ui-btn{width:12.454545454545455rem;height:3.3636363636363638rem;margin-top:0rem;margin-bottom:0rem;margin-left:.2272727272727273rem;margin-right:.2272727272727273rem;display:inline-block}.ui-popupwindow .center_title_3btn{display:-moz-box;display:-webkit-box;display:box;-ms-box-orient:vertical;-moz-box-orient:vertical;-o-box-orient:vertical;-webkit-box-orient:vertical;box-orient:vertical;-ms-box-align:center;-moz-box-align:center;-o-box-align:center;-webkit-box-align:center;box-align:center;-ms-box-pack:center;-moz-box-pack:center;-o-box-pack:center;-webkit-box-pack:center;box-pack:center;text-align:center}.ui-popupwindow .center_title_3btn .popup-button-bg{font-size:1.4545454545454546rem;background:#f8f6ef;width:100%;padding-top:.5rem;padding-bottom:.5rem;vertical-align:middle}.ui-popupwindow .center_title_3btn .popup-button-bg .ui-btn{width:8.454545454545455rem;height:3.3636363636363638rem;margin-top:0rem;margin-bottom:0rem;margin-left:.2272727272727273rem;margin-right:.2272727272727273rem;display:inline-block}.ui-popupwindow .center_button_vertical{display:-moz-box;display:-webkit-box;display:box;-ms-box-orient:vertical;-moz-box-orient:vertical;-o-box-orient:vertical;-webkit-box-orient:vertical;box-orient:vertical;-ms-box-align:center;-moz-box-align:center;-o-box-align:center;-webkit-box-align:center;box-align:center;-ms-box-pack:center;-moz-box-pack:center;-o-box-pack:center;-webkit-box-pack:center;box-pack:center;text-align:center}.ui-popupwindow .center_button_vertical .popup-button-bg{font-size:1.4545454545454546rem;background:#f8f6ef;width:100%;padding-top:1px;padding-bottom:.7272727272727273rem;vertical-align:middle}.ui-popupwindow .center_button_vertical .popup-button-bg .ui-btn{width:16.181818181818183rem;height:3.3636363636363638rem;margin-top:.7272727272727273rem;margin-bottom:0rem;margin-left:auto;margin-right:auto}.ui-popupwindow .center_checkbox{display:-moz-box;display:-webkit-box;display:box;-ms-box-orient:vertical;-moz-box-orient:vertical;-o-box-orient:vertical;-webkit-box-orient:vertical;box-orient:vertical;-ms-box-align:center;-moz-box-align:center;-o-box-align:center;-webkit-box-align:center;box-align:center;-ms-box-pack:center;-moz-box-pack:center;-o-box-pack:center;-webkit-box-pack:center;box-pack:center;text-align:center}.ui-popupwindow .center_checkbox .popup-check-bg{font-size:1.0909090909090908rem;background:#f8f6ef;width:100%;padding-top:0rem;padding-bottom:1rem;vertical-align:middle}.ui-popupwindow .center_checkbox .popup-check-bg .ui-checkbox .ui-btn{text-align:center;background:#f8f6ef;border:0rem}.ui-popupwindow .center_checkbox .popup-check-bg .ui-checkbox .ui-btn .ui-btn-inner{border:0rem}.ui-popupwindow .center_checkbox .popup-button-bg{font-size:1.4545454545454546rem;background:#f8f6ef;width:100%;padding-top:.5rem;padding-bottom:.5rem;vertical-align:middle}.ui-popupwindow .center_checkbox .popup-button-bg .ui-btn{width:12.454545454545455rem;height:3.3636363636363638rem;margin-top:0rem;margin-bottom:0rem;margin-left:.2272727272727273rem;margin-right:.2272727272727273rem;display:inline-block}.ui-popupwindow .center_liststyle_1btn{display:-moz-box;display:-webkit-box;display:box;-ms-box-orient:vertical;-moz-box-orient:vertical;-o-box-orient:vertical;-webkit-box-orient:vertical;box-orient:vertical;-ms-box-align:center;-moz-box-align:center;-o-box-align:center;-webkit-box-align:center;box-align:center;-ms-box-pack:center;-moz-box-pack:center;-o-box-pack:center;-webkit-box-pack:center;box-pack:center;text-align:center}.ui-popupwindow .center_liststyle_1btn .popup-scroller-bg{width:100%;overflow:hidden;background:#f8f6ef;height:23.272727272727273rem}.ui-popupwindow .center_liststyle_1btn .popup-button-bg{font-size:1.4545454545454546rem;background:#f8f6ef;width:100%;padding-top:.5rem;padding-bottom:.5rem;vertical-align:middle}.ui-popupwindow .center_liststyle_1btn .popup-button-bg .ui-btn{width:18.272727272727273rem;height:3.3636363636363638rem;margin:auto}.ui-popupwindow .center_liststyle_2btn{display:-moz-box;display:-webkit-box;display:box;-ms-box-orient:vertical;-moz-box-orient:vertical;-o-box-orient:vertical;-webkit-box-orient:vertical;box-orient:vertical;-ms-box-align:center;-moz-box-align:center;-o-box-align:center;-webkit-box-align:center;box-align:center;-ms-box-pack:center;-moz-box-pack:center;-o-box-pack:center;-webkit-box-pack:center;box-pack:center;text-align:center}.ui-popupwindow .center_liststyle_2btn .popup-scroller-bg{width:100%;overflow:hidden;background:#f8f6ef;height:23.272727272727273rem}.ui-popupwindow .center_liststyle_2btn .popup-button-bg{font-size:1.4545454545454546rem;background:#f8f6ef;width:100%;padding-top:.5rem;padding-bottom:.5rem;vertical-align:middle}.ui-popupwindow .center_liststyle_2btn .popup-button-bg .ui-btn{width:12.454545454545455rem;height:3.3636363636363638rem;margin-top:0rem;margin-bottom:0rem;margin-left:.2272727272727273rem;margin-right:.2272727272727273rem;display:inline-block}.ui-popupwindow .center_liststyle_3btn{display:-moz-box;display:-webkit-box;display:box;-ms-box-orient:vertical;-moz-box-orient:vertical;-o-box-orient:vertical;-webkit-box-orient:vertical;box-orient:vertical;-ms-box-align:center;-moz-box-align:center;-o-box-align:center;-webkit-box-align:center;box-align:center;-ms-box-pack:center;-moz-box-pack:center;-o-box-pack:center;-webkit-box-pack:center;box-pack:center;text-align:center}.ui-popupwindow .center_liststyle_3btn .popup-scroller-bg{width:100%;overflow:hidden;background:#f8f6ef;height:23.272727272727273rem}.ui-popupwindow .center_liststyle_3btn .popup-button-bg{font-size:1.4545454545454546rem;background:#f8f6ef;width:100%;padding-top:.5rem;padding-bottom:.5rem;vertical-align:middle}.ui-popupwindow .center_liststyle_3btn .popup-button-bg .ui-btn{width:8.454545454545455rem;height:3.3636363636363638rem;margin-top:0rem;margin-bottom:0rem;margin-left:.2272727272727273rem;margin-right:.2272727272727273rem;display:inline-block}.ui-popupwindow .center_progressbar{display:-moz-box;display:-webkit-box;display:box;-ms-box-orient:vertical;-moz-box-orient:vertical;-o-box-orient:vertical;-webkit-box-orient:vertical;box-orient:vertical;-ms-box-align:center;-moz-box-align:center;-o-box-align:center;-webkit-box-align:center;box-align:center;-ms-box-pack:center;-moz-box-pack:center;-o-box-pack:center;-webkit-box-pack:center;box-pack:center;text-align:center}.ui-popupwindow .center_progressbar .popup-text{font-size:1.1818181818181819rem;font-color:#999;background:#f8f6ef;width:100%;height:3.181818181818182rem}.ui-popupwindow .center_progressbar .popup-text p{height:100%;text-align:center;padding:1rem .7272727272727273rem 0rem .7272727272727273rem}.ui-popupwindow .center_progressbar .popup-text-bottom-bg{font-size:1.1818181818181819rem;font-color:#999;background:#f8f6ef;width:100%;vertical-align:middle}.ui-popupwindow .center_progressbar .popup-text-bottom-bg .text-left{width:40%;height:2.1818181818181817rem;padding:0rem .7272727272727273rem 0rem .7272727272727273rem;text-align:left;display:inline-block}.ui-popupwindow .center_progressbar .popup-text-bottom-bg .text-right{width:40%;height:2.1818181818181817rem;padding:0rem .7272727272727273rem 0rem .7272727272727273rem;text-align:right;display:inline-block}.ui-popupwindow .center_progressbar .popup-button-bg{font-size:1.4545454545454546rem;background:#f8f6ef;width:100%;padding-top:.5rem;padding-bottom:.5rem;vertical-align:middle}.ui-popupwindow .center_progressbar .popup-button-bg .ui-btn{width:18.272727272727273rem;height:3.3636363636363638rem;margin:auto}.ui-popupwindow .center_progressbar .popup-progress-bg{background:#f8f6ef;width:100%;height:100%}.ui-popupwindow .centertext_progressbar{display:-moz-box;display:-webkit-box;display:box;-ms-box-orient:vertical;-moz-box-orient:vertical;-o-box-orient:vertical;-webkit-box-orient:vertical;box-orient:vertical;-ms-box-align:center;-moz-box-align:center;-o-box-align:center;-webkit-box-align:center;box-align:center;-ms-box-pack:center;-moz-box-pack:center;-o-box-pack:center;-webkit-box-pack:center;box-pack:center;text-align:center}.ui-popupwindow .centertext_progressbar .popup-text{font-size:1.1818181818181819rem;font-color:#999;background:#f8f6ef;width:100%;padding-top:1rem;padding-bottom:.7272727272727273rem}.ui-popupwindow .centertext_progressbar .popup-text p{text-align:center}.ui-popupwindow .centertext_progressbar .popup-text-bottom-bg{font-size:1.1818181818181819rem;font-color:#999;background:#f8f6ef;width:100%;vertical-align:middle}.ui-popupwindow .centertext_progressbar .popup-text-bottom-bg .text-left{width:40%;height:1.8181818181818183rem;padding:.7272727272727273rem .7272727272727273rem 1rem .7272727272727273rem;text-align:left;display:inline-block}.ui-popupwindow .centertext_progressbar .popup-text-bottom-bg .text-right{width:40%;height:1.8181818181818183rem;padding:.7272727272727273rem .7272727272727273rem 1rem .7272727272727273rem;text-align:right;display:inline-block}.ui-popupwindow .centertext_progressbar .popup-button-bg{font-size:1.4545454545454546rem;background:#f8f6ef;width:100%;padding-top:.5rem;padding-bottom:.5rem;vertical-align:middle}.ui-popupwindow .centertext_progressbar .popup-button-bg .ui-btn{width:18.272727272727273rem;height:3.3636363636363638rem;margin:auto}.ui-popupwindow .centertext_progressbar .popup-progress-bg{background:#f8f6ef;width:100%;height:100%}.ui-popupwindow .ui-btn{}.ui-popupwindow .ui-btn.ui-btn-hover-s{background:#5e88a3}.ui-popupwindow .ui-btn.ui-btn-down-s{background:#43a0d9;background:-webkit-gradient(linear,left top,left bottom,from( #43a0d9),to( #388bb9));background:-moz-linear-gradient(top, #43a0d9, #388bb9);background:-ms-linear-gradient(top, #43a0d9, #388bb9);background:-o-linear-gradient(top, #43a0d9, #388bb9)}.ui-popupwindow>.ui-volumecontrol{display:table;margin:auto;background:rgba(0,0,0,.666667);width:18.90909090909091rem;height:30.727272727272727rem;padding-top:1rem}.ui-popupwindow>.ui-volumecontrol h1{font-size:1.0909090909090908rem;display:table;margin:auto;color:#c0c0c0}.ui-popupwindow>.ui-volumecontrol .ui-volumecontrol-icon{display:table;width:100%;height:5.818181818181818rem;padding-top:.9545454545454546rem;padding-bottom:.9545454545454546rem;padding-left:7.5rem;padding-right:7.5rem}.ui-popupwindow>.ui-volumecontrol .ui-volumecontrol-indicator{display:table;width:100%;height:19.09090909090909rem;padding-left:3.090909090909091rem;padding-right:3.090909090909091rem}.ui-popupwindow>.ui-volumecontrol .ui-corner-all{-o-border-radius:.3em!important;-ms-border-radius:.3em!important;-moz-border-radius:.3em!important;-webkit-border-radius:.3em!important;border-radius:.3em!important}.ui-popupwindow-corner-all{-o-border-radius:0!important;-ms-border-radius:0!important;-moz-border-radius:0!important;-webkit-border-radius:0!important;border-radius:0!important}.LESSbutton_box_style{color:#363133}.LESSbutton_up_style{background:#ebe8e3;background:-webkit-linear-gradient(top, #ebe8e3, #eae7e2);background:-moz-linear-gradient(top, #ebe8e3, #eae7e2);background:-o-linear-gradient(top, #ebe8e3, #eae7e2);background:-ms-linear-gradient(top, #ebe8e3, #eae7e2)}.LESSbutton_box_style{background:#ebe8e3;background:-webkit-linear-gradient(top, #ebe8e3, #eae7e2);background:-moz-linear-gradient(top, #ebe8e3, #eae7e2);background:-o-linear-gradient(top, #ebe8e3, #eae7e2);background:-ms-linear-gradient(top, #ebe8e3, #eae7e2);border:1px solid;border-color:#dcdad3;-o-box-shadow:0 0 1px 1px #fff;-ms-box-shadow:0 0 1px 1px #fff;-moz-box-shadow:0 0 1px 1px #fff;-webkit-box-shadow:0 0 1px 1px #fff;box-shadow:0 0 1px 1px #fff}.LESSbutton_inner_box_style{background:#f7f5ee;background:-webkit-linear-gradient(top, #faf7f2, #f8f5f0);background:-ms-linear-gradient(top, #faf7f2, #f8f5f0);background:-o-linear-gradient(top, #faf7f2, #f8f5f0);background:-moz-linear-gradient(top, #faf7f2, #f8f5f0);-o-box-shadow:none;-ms-box-shadow:none;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none}.LESSbutton_inner_pressstyle{color:#f8f6ef}.LESSbutton_text1_style{font-family:Helvetica,Arial,sans-serif;font-weight:400;font-size:1.0rem;font-style:normal;color:#000}.LESSbutton_hover_style{color:#363133}.LESSbutton_down_style{background:#3b73b6;color:#f8f6ef}.LESSbutton_edit_style{background:#c95858;background:-webkit-gradient(linear,left top,left bottom,from( #c95858),to( #a12828));background:-moz_linear-gradient(top, #c95858, #a12828)}.LESSDayselectorButtonNormal{background:#7e9db2;background:-webkit-linear-gradient(top, #7e9db2 0, #547990 100%);background:-moz-linear-gradient(top, #7e9db2 0, #547990 100%);background:-ms-linear-gradient(top, #7e9db2 0, #547990 100%);background:-o-linear-gradient(top, #7e9db2 0, #547990 100%);background:linear-gradient(top, #7e9db2 0, #547990 100%)}.LESSDayaselectorButtonPress{background:#3b7796;background:-webkit-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-moz-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-ms-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-o-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:linear-gradient(top, #3b7796 0, #2f5b75 100%)}.LESSpopup_button_style{}.LESSpopup_button_hover_style{background:#5e88a3}.LESSpopup_button_press_style{background:#43a0d9;background:-webkit-gradient(linear,left top,left bottom,from( #43a0d9),to( #388bb9));background:-moz-linear-gradient(top, #43a0d9, #388bb9);background:-ms-linear-gradient(top, #43a0d9, #388bb9);background:-o-linear-gradient(top, #43a0d9, #388bb9)}.LESStoggleswitch_on_style{background:#2a7eac;background:-webkit-gradient(linear,left top,left bottom,from( #2174a7),to( #4ba5db));background:-moz-linear-gradient(top, #2174a7, #4ba5db);border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px}.LESStoggleswitch_off_style{color:#cbcbcb;background:#97a1a7;background:-webkit-gradient(linear,left top,left bottom,from( #727272),to( #8d8d8d));background:-moz-linear-gradient(top, #727272, #8d8d8d);border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px}.LESStoggleswitch_reed_style{background:#fdfdfd;background:-webkit-gradient(linear,left top,left bottom,from( #fdfdfd),to( #e7e7e7));background:-moz-linear-gradient(top, #fdfdfd, #e7e7e7);border-radius:2px;-webkit-border-radius:2px;-moz-border-radius:2px}.LESSbutton_editpress_style{background:#931818;background:-webkit-gradient(linear,left top,left bottom,from( #931818),to( #6e1717));background:-moz-linear-gradient(top, #931818, #6e1717)}.LESSbutton_edit_padding{padding:.5em .8em}.LESSmultimediaview_bar_active_style{background-color:#4a84c9;background-image:-webkit-gradient(linear,left top,left bottom,from( #6289d9),to( #295b98));background-image:-moz-linear-gradient(top, #6289d9, #295b98);background-image:-o-linear-gradient(top, #6289d9, #295b98);background-image:-ms-linear-gradient(top, #6289d9, #295b98)}.LESSmultimediaview_bar_handle_style{background-color:#f9f9f9;background-image:-webkit-gradient(linear,left top,left bottom,from( #fff),to( #e6e6e6));background-image:-moz-linear-gradient(top, #fff, #e6e6e6);background-image:-o-linear-gradient(top, #fff, #e6e6e6);background-image:-ms-linear-gradient(top, #fff, #e6e6e6)}.ui-ctxpopup{display:table}.ui-ctxpopup .ui-ctxpopup-row .ui-triangle-top{top:2px}.ui-ctxpopup .ui-ctxpopup-row .ui-triangle-left{left:2px}.ui-ctxpopup .ui-ctxpopup-row .ui-triangle-right{right:2px}.ui-ctxpopup .ui-ctxpopup-row .ui-triangle-bottom{bottom:2px}.ui-ctxpopup .ui-ctxpopup-row{display:table-row}.ui-ctxpopup .ui-ctxpopup-row .ui-ctxpopup-cell{display:table-cell}.ui-ctxpopup .ui-ctxpopup-row .ui-popupwindow-padding{background:#444;border:0;-ms-box-shadow:0rem 0rem .5454545454545454rem rgba(0,0,0,.6);-o-box-shadow:0rem 0rem .5454545454545454rem rgba(0,0,0,.6);-moz-box-shadow:0rem 0rem .5454545454545454rem rgba(0,0,0,.6);-webkit-box-shadow:0rem 0rem .5454545454545454rem rgba(0,0,0,.6);box-shadow:0rem 0rem .5454545454545454rem rgba(0,0,0,.6);-o-border-radius:.3em;-ms-border-radius:.3em;-moz-border-radius:.3em;-webkit-border-radius:.3em;border-radius:.3em}.ui-ctxpopup .ui-listview li.ui-btn-up-s,.ui-ctxpopup .ui-listview li.ui-btn-hover-s{background:transparent}.ui-ctxpopup .ui-listview li.ui-btn-down-s{background:rgba(26,82,116,.3)}.ui-ctxpopup .ui-listview li:last-child{border-bottom-left-radius:.3em;border-bottom-right-radius:.3em}.ui-ctxpopup .ui-listview li:first-child{border-top-left-radius:.3em;border-top-right-radius:.3em}.ui-ctxpopup .ui-listview{max-width:28.181818181818183rem;border:0}.ui-ctxpopup .ui-listview>.ui-li{color:#fff;border-bottom-color:#2d2d2d;border-top-width:1px;border-top-color:#5b5b5b;margin-left:0;margin-right:0}.ui-ctxpopup .ui-listview>.ui-li:first-child,.ui-ctxpopup .ui-listview>.ui-li:last-child{border-top-width:0}.ui-ctxpopup .ui-listview>.ui-li .ui-btn-inner{margin:0;padding-left:.4545454545454546rem;padding-right:.4545454545454546rem}.ui-ctxpopup .ui-listview li.ui-btn-up-s>.ui-li>.ui-btn-text>a.ui-link-inherit,.ui-ctxpopup .ui-listview li.ui-btn-hover-s>.ui-li>.ui-btn-text>a.ui-link-inherit,.ui-ctxpopup .ui-listview li.ui-btn-down-s>.ui-li>.ui-btn-text>a.ui-link-inherit{color:#fff}.ui-ctxpopup .ui-listview>.ui-li:last-child{border:0}.ui-ctxpopup .horizontal{color:#fff;max-width:29.454545454545457rem}.ui-ctxpopup .horizontal .icon .ui-btn{padding:0;background:transparent ! important}.ui-ctxpopup .horizontal .icon .ui-btn .ui-btn-icon-only{width:4.363636363636363rem;height:2.909090909090909rem;padding:0}.ui-ctxpopup .horizontal .icon .ui-btn .ui-icon{top:0;height:inherit;width:inherit;margin:0;background-position:center;-ms-background-size:2.1818181818181817rem 2.1818181818181817rem;-moz-background-size:2.1818181818181817rem 2.1818181818181817rem;-o-background-size:2.1818181818181817rem 2.1818181818181817rem;-webkit-background-size:2.1818181818181817rem 2.1818181818181817rem;background-size:2.1818181818181817rem 2.1818181818181817rem}.ui-ctxpopup .horizontal .text{padding:0 .4545454545454546rem;min-width:2.1818181818181817rem}.ui-ctxpopup .horizontal a.ui-link{color:#fff;text-decoration:none}.ui-ctxpopup .horizontal ul{padding:0;display:inline-block;list-style:none;vertical-align:middle;margin:0}.ui-ctxpopup .horizontal li{line-height:2.909090909090909rem;min-height:2.909090909090909rem;min-width:4.363636363636363rem;float:left;display:inline-block;border-left:1px solid #5b5b5b;border-right:1px solid #2d2d2d;text-align:center}.ui-ctxpopup .horizontal li:first-of-type{border-top-left-radius:.3em;border-bottom-left-radius:.3em;border-left:0}.ui-ctxpopup .horizontal li:last-of-type{border-top-right-radius:.3em;border-bottom-right-radius:.3em;border-right:0;margin-right:0}.ui-ctxpopup .horizontal li:active,.ui-ctxpopup .horizontal td:active{background:#3b73b6}.ui-ctxpopup .button table .ui-btn{margin:0rem;padding:0;height:2.5454545454545454rem;width:6rem}.ui-arrow{border-style:solid;border-width:10px;width:0;height:0;position:absolute}.ui-arrow.top{border-color:transparent transparent #444 transparent}.ui-arrow.left{border-color:transparent transparent transparent #444}.ui-arrow.right{border-color:transparent #444 transparent transparent}.ui-arrow.bottom{border-color:#444 transparent transparent transparent}.ui-ctxpopup-container{z-index:1200;display:inline-bloack;position:absolute;padding:0;outline:0}.ui-ctxpopup-container .ui-popup{border:0;background:#444;-o-border-radius:.3em;-ms-border-radius:.3em;-moz-border-radius:.3em;-webkit-border-radius:.3em;border-radius:.3em}.ui-ctxpopup-container .ui-listview li:first-child{border-top-left-radius:.3em;border-top-right-radius:.3em}.poptop{-webkit-transform-origin:0 0;-moz-transform-origin:0 0}.poptop.in{-webkit-transform:scale(1);-moz-transform:scale(1);opacity:1;-webkit-animation-name:scalepopin;-moz-animation-name:scalepopin;-webkit-animation-duration:350ms;-moz-animation-duration:350ms}.poptop.out{-webkit-animation-name:fadeout;-moz-animation-name:fadeout;opacity:0;-webkit-animation-duration:100ms;-moz-animation-duration:100ms}.poptop.in.reverse{-webkit-animation-name:fadein;-moz-animation-name:fadein}.poptop.out.reverse{-webkit-transform:scale(0.8);-moz-transform:scale(0.8);-webkit-animation-name:scalepopout;-moz-animation-name:scalepopout}@-webkit-keyframes scalepopin{from{ -webkit-transform:scale(0.8);opacity:0}to{-webkit-transform:scale(1);opacity:1}}.popbottom{-webkit-transform-origin:0 100%;-moz-transform-origin:0 100%}.popbottom.in{-webkit-transform:scale(1);-moz-transform:scale(1);opacity:1;-webkit-animation-name:scalepopin;-moz-animation-name:scalepopin;-webkit-animation-duration:350ms;-moz-animation-duration:350ms}.popbottom.out{-webkit-animation-name:fadeout;-moz-animation-name:fadeout;opacity:0;-webkit-animation-duration:100ms;-moz-animation-duration:100ms}.popbottom.in.reverse{-webkit-animation-name:fadein;-moz-animation-name:fadein}.popbottom.out.reverse{-webkit-transform:scale(0.8);-moz-transform:scale(0.8);-webkit-animation-name:scalepopout;-moz-animation-name:scalepopout}@-moz-keyframes scalepopin{from{ -moz-transform:scale(0.8);opacity:0}to{-moz-transform:scale(1);opacity:1}}@-webkit-keyframes scalepopout{from{ -webkit-transform:scale(1);opacity:1}to{-webkit-transform:scale(0.8);opacity:0}}@-moz-keyframes scalepopout{from{ -moz-transform:scale(1);opacity:1}to{-moz-transform:scale(0.8);opacity:0}}.LESSbutton_box_style{color:#363133}.LESSbutton_up_style{background:#ebe8e3;background:-webkit-linear-gradient(top, #ebe8e3, #eae7e2);background:-moz-linear-gradient(top, #ebe8e3, #eae7e2);background:-o-linear-gradient(top, #ebe8e3, #eae7e2);background:-ms-linear-gradient(top, #ebe8e3, #eae7e2)}.LESSbutton_box_style{background:#ebe8e3;background:-webkit-linear-gradient(top, #ebe8e3, #eae7e2);background:-moz-linear-gradient(top, #ebe8e3, #eae7e2);background:-o-linear-gradient(top, #ebe8e3, #eae7e2);background:-ms-linear-gradient(top, #ebe8e3, #eae7e2);border:1px solid;border-color:#dcdad3;-o-box-shadow:0 0 1px 1px #fff;-ms-box-shadow:0 0 1px 1px #fff;-moz-box-shadow:0 0 1px 1px #fff;-webkit-box-shadow:0 0 1px 1px #fff;box-shadow:0 0 1px 1px #fff}.LESSbutton_inner_box_style{background:#f7f5ee;background:-webkit-linear-gradient(top, #faf7f2, #f8f5f0);background:-ms-linear-gradient(top, #faf7f2, #f8f5f0);background:-o-linear-gradient(top, #faf7f2, #f8f5f0);background:-moz-linear-gradient(top, #faf7f2, #f8f5f0);-o-box-shadow:none;-ms-box-shadow:none;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none}.LESSbutton_inner_pressstyle{color:#f8f6ef}.LESSbutton_text1_style{font-family:Helvetica,Arial,sans-serif;font-weight:400;font-size:1.0rem;font-style:normal;color:#000}.LESSbutton_hover_style{color:#363133}.LESSbutton_down_style{background:#3b73b6;color:#f8f6ef}.LESSbutton_edit_style{background:#c95858;background:-webkit-gradient(linear,left top,left bottom,from( #c95858),to( #a12828));background:-moz_linear-gradient(top, #c95858, #a12828)}.LESSDayselectorButtonNormal{background:#7e9db2;background:-webkit-linear-gradient(top, #7e9db2 0, #547990 100%);background:-moz-linear-gradient(top, #7e9db2 0, #547990 100%);background:-ms-linear-gradient(top, #7e9db2 0, #547990 100%);background:-o-linear-gradient(top, #7e9db2 0, #547990 100%);background:linear-gradient(top, #7e9db2 0, #547990 100%)}.LESSDayaselectorButtonPress{background:#3b7796;background:-webkit-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-moz-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-ms-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-o-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:linear-gradient(top, #3b7796 0, #2f5b75 100%)}.LESSpopup_button_style{}.LESSpopup_button_hover_style{background:#5e88a3}.LESSpopup_button_press_style{background:#43a0d9;background:-webkit-gradient(linear,left top,left bottom,from( #43a0d9),to( #388bb9));background:-moz-linear-gradient(top, #43a0d9, #388bb9);background:-ms-linear-gradient(top, #43a0d9, #388bb9);background:-o-linear-gradient(top, #43a0d9, #388bb9)}.LESStoggleswitch_on_style{background:#2a7eac;background:-webkit-gradient(linear,left top,left bottom,from( #2174a7),to( #4ba5db));background:-moz-linear-gradient(top, #2174a7, #4ba5db);border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px}.LESStoggleswitch_off_style{color:#cbcbcb;background:#97a1a7;background:-webkit-gradient(linear,left top,left bottom,from( #727272),to( #8d8d8d));background:-moz-linear-gradient(top, #727272, #8d8d8d);border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px}.LESStoggleswitch_reed_style{background:#fdfdfd;background:-webkit-gradient(linear,left top,left bottom,from( #fdfdfd),to( #e7e7e7));background:-moz-linear-gradient(top, #fdfdfd, #e7e7e7);border-radius:2px;-webkit-border-radius:2px;-moz-border-radius:2px}.LESSbutton_editpress_style{background:#931818;background:-webkit-gradient(linear,left top,left bottom,from( #931818),to( #6e1717));background:-moz-linear-gradient(top, #931818, #6e1717)}.LESSbutton_edit_padding{padding:.5em .8em}.LESSmultimediaview_bar_active_style{background-color:#4a84c9;background-image:-webkit-gradient(linear,left top,left bottom,from( #6289d9),to( #295b98));background-image:-moz-linear-gradient(top, #6289d9, #295b98);background-image:-o-linear-gradient(top, #6289d9, #295b98);background-image:-ms-linear-gradient(top, #6289d9, #295b98)}.LESSmultimediaview_bar_handle_style{background-color:#f9f9f9;background-image:-webkit-gradient(linear,left top,left bottom,from( #fff),to( #e6e6e6));background-image:-moz-linear-gradient(top, #fff, #e6e6e6);background-image:-o-linear-gradient(top, #fff, #e6e6e6);background-image:-ms-linear-gradient(top, #fff, #e6e6e6)}@-webkit-keyframes ui-scale-animation{from{ -webkit-transform:scalex(0)}to{-webkit-transform:scalex(1)}}.ui-progressbar-value{height:100%;background-image:-webkit-gradient(linear,left bottom,left top,color-stop(0, #3677c3),color-stop(1, #96b8e0));-o-border-radius:.4545454545454546rem;-ms-border-radius:.4545454545454546rem;-moz-border-radius:.4545454545454546rem;-webkit-border-radius:.4545454545454546rem;border-radius:.4545454545454546rem;-o-box-shadow:-1px -1px 1px #b3c8e2;-ms-box-shadow:-1px -1px 1px #b3c8e2;-moz-box-shadow:-1px -1px 1px #b3c8e2;-webkit-box-shadow:-1px -1px 1px #b3c8e2;box-shadow:-1px -1px 1px #b3c8e2}.ui-progressbar-bg{position:relative;overflow:hidden;top:.2272727272727273rem;height:.3181818181818182rem;margin-left:.2272727272727273rem;margin-right:.2272727272727273rem;-o-border-radius:.4545454545454546rem;-ms-border-radius:.4545454545454546rem;-moz-border-radius:.4545454545454546rem;-webkit-border-radius:.4545454545454546rem;border-radius:.4545454545454546rem;border:1px;border-style:solid;border-color:#a3a09e;-o-box-shadow:1px -1px 1px #a3a09e;-ms-box-shadow:1px -1px 1px #a3a09e;-moz-box-shadow:1px -1px 1px #a3a09e;-webkit-box-shadow:1px -1px 1px #a3a09e;box-shadow:1px -1px 1px #a3a09e;background-color:#cac8c4}.ui-progressbar{position:relative;margin-left:.9545454545454546rem;margin-right:.9545454545454546rem;height:.8181818181818182rem;background-image:-webkit-gradient(linear,left bottom,left top,color-stop(0, #f6f3ef),color-stop(1, #cac8c4));-o-box-shadow:1px 1px 0 white;-ms-box-shadow:1px 1px 0 white;-moz-box-shadow:1px 1px 0 white;-webkit-box-shadow:1px 1px 0 white;box-shadow:1px 1px 0 white;-o-border-radius:.4545454545454546rem;-ms-border-radius:.4545454545454546rem;-moz-border-radius:.4545454545454546rem;-webkit-border-radius:.4545454545454546rem;border-radius:.4545454545454546rem}.LESSbutton_box_style{color:#363133}.LESSbutton_up_style{background:#ebe8e3;background:-webkit-linear-gradient(top, #ebe8e3, #eae7e2);background:-moz-linear-gradient(top, #ebe8e3, #eae7e2);background:-o-linear-gradient(top, #ebe8e3, #eae7e2);background:-ms-linear-gradient(top, #ebe8e3, #eae7e2)}.LESSbutton_box_style{background:#ebe8e3;background:-webkit-linear-gradient(top, #ebe8e3, #eae7e2);background:-moz-linear-gradient(top, #ebe8e3, #eae7e2);background:-o-linear-gradient(top, #ebe8e3, #eae7e2);background:-ms-linear-gradient(top, #ebe8e3, #eae7e2);border:1px solid;border-color:#dcdad3;-o-box-shadow:0 0 1px 1px #fff;-ms-box-shadow:0 0 1px 1px #fff;-moz-box-shadow:0 0 1px 1px #fff;-webkit-box-shadow:0 0 1px 1px #fff;box-shadow:0 0 1px 1px #fff}.LESSbutton_inner_box_style{background:#f7f5ee;background:-webkit-linear-gradient(top, #faf7f2, #f8f5f0);background:-ms-linear-gradient(top, #faf7f2, #f8f5f0);background:-o-linear-gradient(top, #faf7f2, #f8f5f0);background:-moz-linear-gradient(top, #faf7f2, #f8f5f0);-o-box-shadow:none;-ms-box-shadow:none;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none}.LESSbutton_inner_pressstyle{color:#f8f6ef}.LESSbutton_text1_style{font-family:Helvetica,Arial,sans-serif;font-weight:400;font-size:1.0rem;font-style:normal;color:#000}.LESSbutton_hover_style{color:#363133}.LESSbutton_down_style{background:#3b73b6;color:#f8f6ef}.LESSbutton_edit_style{background:#c95858;background:-webkit-gradient(linear,left top,left bottom,from( #c95858),to( #a12828));background:-moz_linear-gradient(top, #c95858, #a12828)}.LESSDayselectorButtonNormal{background:#7e9db2;background:-webkit-linear-gradient(top, #7e9db2 0, #547990 100%);background:-moz-linear-gradient(top, #7e9db2 0, #547990 100%);background:-ms-linear-gradient(top, #7e9db2 0, #547990 100%);background:-o-linear-gradient(top, #7e9db2 0, #547990 100%);background:linear-gradient(top, #7e9db2 0, #547990 100%)}.LESSDayaselectorButtonPress{background:#3b7796;background:-webkit-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-moz-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-ms-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-o-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:linear-gradient(top, #3b7796 0, #2f5b75 100%)}.LESSpopup_button_style{}.LESSpopup_button_hover_style{background:#5e88a3}.LESSpopup_button_press_style{background:#43a0d9;background:-webkit-gradient(linear,left top,left bottom,from( #43a0d9),to( #388bb9));background:-moz-linear-gradient(top, #43a0d9, #388bb9);background:-ms-linear-gradient(top, #43a0d9, #388bb9);background:-o-linear-gradient(top, #43a0d9, #388bb9)}.LESStoggleswitch_on_style{background:#2a7eac;background:-webkit-gradient(linear,left top,left bottom,from( #2174a7),to( #4ba5db));background:-moz-linear-gradient(top, #2174a7, #4ba5db);border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px}.LESStoggleswitch_off_style{color:#cbcbcb;background:#97a1a7;background:-webkit-gradient(linear,left top,left bottom,from( #727272),to( #8d8d8d));background:-moz-linear-gradient(top, #727272, #8d8d8d);border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px}.LESStoggleswitch_reed_style{background:#fdfdfd;background:-webkit-gradient(linear,left top,left bottom,from( #fdfdfd),to( #e7e7e7));background:-moz-linear-gradient(top, #fdfdfd, #e7e7e7);border-radius:2px;-webkit-border-radius:2px;-moz-border-radius:2px}.LESSbutton_editpress_style{background:#931818;background:-webkit-gradient(linear,left top,left bottom,from( #931818),to( #6e1717));background:-moz-linear-gradient(top, #931818, #6e1717)}.LESSbutton_edit_padding{padding:.5em .8em}.LESSmultimediaview_bar_active_style{background-color:#4a84c9;background-image:-webkit-gradient(linear,left top,left bottom,from( #6289d9),to( #295b98));background-image:-moz-linear-gradient(top, #6289d9, #295b98);background-image:-o-linear-gradient(top, #6289d9, #295b98);background-image:-ms-linear-gradient(top, #6289d9, #295b98)}.LESSmultimediaview_bar_handle_style{background-color:#f9f9f9;background-image:-webkit-gradient(linear,left top,left bottom,from( #fff),to( #e6e6e6));background-image:-moz-linear-gradient(top, #fff, #e6e6e6);background-image:-o-linear-gradient(top, #fff, #e6e6e6);background-image:-ms-linear-gradient(top, #fff, #e6e6e6)}@-webkit-keyframes ui-rotate-animation{from{ -webkit-transform:rotate(0deg)}to{-webkit-transform:rotate(360deg)}}.ui-progress-container-circle{position:absolute}.ui-li .ui-progress-container-circle{top:22%}.ui-progress-circle{position:relative;top:0;height:1.4545454545454546rem;width:1.4545454545454546rem;background:url(images/00_list_process_01.png) no-repeat;-ms-background-size:1.4545454545454546rem 1.4545454545454546rem;-moz-background-size:1.4545454545454546rem 1.4545454545454546rem;-o-background-size:1.4545454545454546rem 1.4545454545454546rem;-webkit-background-size:1.4545454545454546rem 1.4545454545454546rem;background-size:1.4545454545454546rem 1.4545454545454546rem}.ui-progress-circle-running{-webkit-animation:ui-rotate-animation 1s infinite linear}@-webkit-keyframes ui-move-animation{from{ -webkit-transform:translatey(-.6363636363636364rem)}to{-webkit-transform:translatey(0)}}.ui-progress-pending{position:relative;top:0;width:100%;height:.9545454545454546rem;padding-top:0;padding-bottom:0;background:-webkit-gradient(linear,left top,right bottom,color-stop(0%,rgba(0,0,0,0)),color-stop(25%,rgba(0,0,0,0)),color-stop(25%, #3677c3),color-stop(50%, #3677c3),color-stop(50%,rgba(0,0,0,0)),color-stop(75%,rgba(0,0,0,0)),color-stop(75%, #3677c3));background-color:#cac8c4;-ms-background-size:.6363636363636364rem .6363636363636364rem;-moz-background-size:.6363636363636364rem .6363636363636364rem;-o-background-size:.6363636363636364rem .6363636363636364rem;-webkit-background-size:.6363636363636364rem .6363636363636364rem;background-size:.6363636363636364rem .6363636363636364rem}.ui-progress-pending-running{-webkit-animation:ui-move-animation .5s infinite linear}.LESSbutton_box_style{color:#363133}.LESSbutton_up_style{background:#ebe8e3;background:-webkit-linear-gradient(top, #ebe8e3, #eae7e2);background:-moz-linear-gradient(top, #ebe8e3, #eae7e2);background:-o-linear-gradient(top, #ebe8e3, #eae7e2);background:-ms-linear-gradient(top, #ebe8e3, #eae7e2)}.LESSbutton_box_style{background:#ebe8e3;background:-webkit-linear-gradient(top, #ebe8e3, #eae7e2);background:-moz-linear-gradient(top, #ebe8e3, #eae7e2);background:-o-linear-gradient(top, #ebe8e3, #eae7e2);background:-ms-linear-gradient(top, #ebe8e3, #eae7e2);border:1px solid;border-color:#dcdad3;-o-box-shadow:0 0 1px 1px #fff;-ms-box-shadow:0 0 1px 1px #fff;-moz-box-shadow:0 0 1px 1px #fff;-webkit-box-shadow:0 0 1px 1px #fff;box-shadow:0 0 1px 1px #fff}.LESSbutton_inner_box_style{background:#f7f5ee;background:-webkit-linear-gradient(top, #faf7f2, #f8f5f0);background:-ms-linear-gradient(top, #faf7f2, #f8f5f0);background:-o-linear-gradient(top, #faf7f2, #f8f5f0);background:-moz-linear-gradient(top, #faf7f2, #f8f5f0);-o-box-shadow:none;-ms-box-shadow:none;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none}.LESSbutton_inner_pressstyle{color:#f8f6ef}.LESSbutton_text1_style{font-family:Helvetica,Arial,sans-serif;font-weight:400;font-size:1.0rem;font-style:normal;color:#000}.LESSbutton_hover_style{color:#363133}.LESSbutton_down_style{background:#3b73b6;color:#f8f6ef}.LESSbutton_edit_style{background:#c95858;background:-webkit-gradient(linear,left top,left bottom,from( #c95858),to( #a12828));background:-moz_linear-gradient(top, #c95858, #a12828)}.LESSDayselectorButtonNormal{background:#7e9db2;background:-webkit-linear-gradient(top, #7e9db2 0, #547990 100%);background:-moz-linear-gradient(top, #7e9db2 0, #547990 100%);background:-ms-linear-gradient(top, #7e9db2 0, #547990 100%);background:-o-linear-gradient(top, #7e9db2 0, #547990 100%);background:linear-gradient(top, #7e9db2 0, #547990 100%)}.LESSDayaselectorButtonPress{background:#3b7796;background:-webkit-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-moz-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-ms-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-o-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:linear-gradient(top, #3b7796 0, #2f5b75 100%)}.LESSpopup_button_style{}.LESSpopup_button_hover_style{background:#5e88a3}.LESSpopup_button_press_style{background:#43a0d9;background:-webkit-gradient(linear,left top,left bottom,from( #43a0d9),to( #388bb9));background:-moz-linear-gradient(top, #43a0d9, #388bb9);background:-ms-linear-gradient(top, #43a0d9, #388bb9);background:-o-linear-gradient(top, #43a0d9, #388bb9)}.LESStoggleswitch_on_style{background:#2a7eac;background:-webkit-gradient(linear,left top,left bottom,from( #2174a7),to( #4ba5db));background:-moz-linear-gradient(top, #2174a7, #4ba5db);border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px}.LESStoggleswitch_off_style{color:#cbcbcb;background:#97a1a7;background:-webkit-gradient(linear,left top,left bottom,from( #727272),to( #8d8d8d));background:-moz-linear-gradient(top, #727272, #8d8d8d);border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px}.LESStoggleswitch_reed_style{background:#fdfdfd;background:-webkit-gradient(linear,left top,left bottom,from( #fdfdfd),to( #e7e7e7));background:-moz-linear-gradient(top, #fdfdfd, #e7e7e7);border-radius:2px;-webkit-border-radius:2px;-moz-border-radius:2px}.LESSbutton_editpress_style{background:#931818;background:-webkit-gradient(linear,left top,left bottom,from( #931818),to( #6e1717));background:-moz-linear-gradient(top, #931818, #6e1717)}.LESSbutton_edit_padding{padding:.5em .8em}.LESSmultimediaview_bar_active_style{background-color:#4a84c9;background-image:-webkit-gradient(linear,left top,left bottom,from( #6289d9),to( #295b98));background-image:-moz-linear-gradient(top, #6289d9, #295b98);background-image:-o-linear-gradient(top, #6289d9, #295b98);background-image:-ms-linear-gradient(top, #6289d9, #295b98)}.LESSmultimediaview_bar_handle_style{background-color:#f9f9f9;background-image:-webkit-gradient(linear,left top,left bottom,from( #fff),to( #e6e6e6));background-image:-moz-linear-gradient(top, #fff, #e6e6e6);background-image:-o-linear-gradient(top, #fff, #e6e6e6);background-image:-ms-linear-gradient(top, #fff, #e6e6e6)}label.ui-slider{display:block}select.ui-slider-switch{display:none}.ui-slider-container{position:relative;vertical-align:middle;height:.8181818181818182rem;margin-left:.7272727272727273rem;margin-right:.7272727272727273rem;margin-top:.8181818181818182rem;margin-bottom:.8181818181818182rem;background-image:-webkit-gradient(linear,left bottom,left top,color-stop(0, #f6f3ef),color-stop(1, #cac8c4));-o-box-shadow:1px 1px 0 white;-ms-box-shadow:1px 1px 0 white;-moz-box-shadow:1px 1px 0 white;-webkit-box-shadow:1px 1px 0 white;box-shadow:1px 1px 0 white;-o-border-radius:.4545454545454546rem;-ms-border-radius:.4545454545454546rem;-moz-border-radius:.4545454545454546rem;-webkit-border-radius:.4545454545454546rem;border-radius:.4545454545454546rem}.ui-li>.ui-slider-container{margin-top:0;margin-bottom:0}.ui-slider-left-volume,.ui-slider-left-bright{position:absolute;vertical-align:middle;top:-.5rem;left:-2.272727272727273rem;height:1.6818181818181819rem;width:1.6818181818181819rem;background:url(images/controls/00_slider_button_brightness_01.png) no-repeat;-ms-background-size:1.6818181818181819rem 1.6818181818181819rem;-moz-background-size:1.6818181818181819rem 1.6818181818181819rem;-o-background-size:1.6818181818181819rem 1.6818181818181819rem;-webkit-background-size:1.6818181818181819rem 1.6818181818181819rem;background-size:1.6818181818181819rem 1.6818181818181819rem}.ui-slider-left-volume{background:url(images/controls/00_slider_button_volume_01.png) no-repeat;-ms-background-size:1.6818181818181819rem 1.6818181818181819rem;-moz-background-size:1.6818181818181819rem 1.6818181818181819rem;-o-background-size:1.6818181818181819rem 1.6818181818181819rem;-webkit-background-size:1.6818181818181819rem 1.6818181818181819rem;background-size:1.6818181818181819rem 1.6818181818181819rem}.ui-slider-right-volume,.ui-slider-right-bright{position:absolute;top:-.5rem;right:-2.272727272727273rem;height:1.6818181818181819rem;width:1.6818181818181819rem;vertical-align:middle;background:url(images/controls/00_slider_button_brightness_02.png) no-repeat;-ms-background-size:1.6818181818181819rem 1.6818181818181819rem;-moz-background-size:1.6818181818181819rem 1.6818181818181819rem;-o-background-size:1.6818181818181819rem 1.6818181818181819rem;-webkit-background-size:1.6818181818181819rem 1.6818181818181819rem;background-size:1.6818181818181819rem 1.6818181818181819rem}.ui-slider-right-volume{background:url(images/controls/00_slider_button_volume_02.png) no-repeat;-ms-background-size:1.6818181818181819rem 1.6818181818181819rem;-moz-background-size:1.6818181818181819rem 1.6818181818181819rem;-o-background-size:1.6818181818181819rem 1.6818181818181819rem;-webkit-background-size:1.6818181818181819rem 1.6818181818181819rem;background-size:1.6818181818181819rem 1.6818181818181819rem}.ui-slider-left-text{position:absolute;top:-.5rem;height:1.6818181818181819rem;text-align:center;color:#646464}.ui-slider-right-text{position:absolute;top:-.5rem;height:1.6818181818181819rem;text-align:center;color:#646464}div.ui-slider:not(.ui-toggle-switch){position:relative;top:.2272727272727273rem;height:.3181818181818182rem;margin-left:.2272727272727273rem;margin-right:.2272727272727273rem;-o-border-radius:.4545454545454546rem;-ms-border-radius:.4545454545454546rem;-moz-border-radius:.4545454545454546rem;-webkit-border-radius:.4545454545454546rem;border-radius:.4545454545454546rem;border:1px;border-style:solid;border-color:#a3a09e;-o-box-shadow:1px -1px 1px #a3a09e;-ms-box-shadow:1px -1px 1px #a3a09e;-moz-box-shadow:1px -1px 1px #a3a09e;-webkit-box-shadow:1px -1px 1px #a3a09e;box-shadow:1px -1px 1px #a3a09e;background-color:#cac8c4}div.ui-slider:not(.ui-toggle-switch) .ui-btn{top:-.75rem;margin-top:0}div.ui-slider:not(.ui-toggle-switch) .ui-btn-inner{padding:.3rem 0 0 0}div.ui-slider:not(.ui-toggle-switch) .ui-btn-text{color:#3b73b6}a.ui-slider-handle{position:relative;z-index:10;width:1.6363636363636365rem;height:1.6363636363636365rem;margin-left:-.8636363636363636rem;color:#3b73b6;font-size:.95rem;background:url(images/controls/00_slider_handle.png) no-repeat;-ms-background-size:1.6363636363636365rem 1.6363636363636365rem;-moz-background-size:1.6363636363636365rem 1.6363636363636365rem;-o-background-size:1.6363636363636365rem 1.6363636363636365rem;-webkit-background-size:1.6363636363636365rem 1.6363636363636365rem;background-size:1.6363636363636365rem 1.6363636363636365rem}.ui-slider-popup{position:absolute!important;z-index:100;width:2.0454545454545454rem;height:2.4545454545454546rem;top:-2.7272727272727275rem;padding-top:.1rem;color:#f9f9f9;text-align:center;font-size:1.5rem;background:url(images/controls/00_slider_popup_bg.png) no-repeat;-ms-background-size:2.0454545454545454rem 2.4545454545454546rem;-moz-background-size:2.0454545454545454rem 2.4545454545454546rem;-o-background-size:2.0454545454545454rem 2.4545454545454546rem;-webkit-background-size:2.0454545454545454rem 2.4545454545454546rem;background-size:2.0454545454545454rem 2.4545454545454546rem}.ui-slider-bg{position:absolute;height:.3181818181818182rem;width:0;background-image:-webkit-gradient(linear,left bottom,left top,color-stop(0, #3677c3),color-stop(1, #96b8e0));-o-border-radius:.4545454545454546rem;-ms-border-radius:.4545454545454546rem;-moz-border-radius:.4545454545454546rem;-webkit-border-radius:.4545454545454546rem;border-radius:.4545454545454546rem;-o-box-shadow:-1px -1px 1px #b3c8e2;-ms-box-shadow:-1px -1px 1px #b3c8e2;-moz-box-shadow:-1px -1px 1px #b3c8e2;-webkit-box-shadow:-1px -1px 1px #b3c8e2;box-shadow:-1px -1px 1px #b3c8e2}.ui-slider-handle-press{position:absolute;z-index:15;width:1.6818181818181819rem;height:1.6818181818181819rem;background:url(images/controls/00_slider_handle_press.png) no-repeat;-ms-background-size:1.6363636363636365rem 1.6363636363636365rem;-moz-background-size:1.6363636363636365rem 1.6363636363636365rem;-o-background-size:1.6363636363636365rem 1.6363636363636365rem;-webkit-background-size:1.6363636363636365rem 1.6363636363636365rem;background-size:1.6363636363636365rem 1.6363636363636365rem}.LESSbutton_box_style{color:#363133}.LESSbutton_up_style{background:#ebe8e3;background:-webkit-linear-gradient(top, #ebe8e3, #eae7e2);background:-moz-linear-gradient(top, #ebe8e3, #eae7e2);background:-o-linear-gradient(top, #ebe8e3, #eae7e2);background:-ms-linear-gradient(top, #ebe8e3, #eae7e2)}.LESSbutton_box_style{background:#ebe8e3;background:-webkit-linear-gradient(top, #ebe8e3, #eae7e2);background:-moz-linear-gradient(top, #ebe8e3, #eae7e2);background:-o-linear-gradient(top, #ebe8e3, #eae7e2);background:-ms-linear-gradient(top, #ebe8e3, #eae7e2);border:1px solid;border-color:#dcdad3;-o-box-shadow:0 0 1px 1px #fff;-ms-box-shadow:0 0 1px 1px #fff;-moz-box-shadow:0 0 1px 1px #fff;-webkit-box-shadow:0 0 1px 1px #fff;box-shadow:0 0 1px 1px #fff}.LESSbutton_inner_box_style{background:#f7f5ee;background:-webkit-linear-gradient(top, #faf7f2, #f8f5f0);background:-ms-linear-gradient(top, #faf7f2, #f8f5f0);background:-o-linear-gradient(top, #faf7f2, #f8f5f0);background:-moz-linear-gradient(top, #faf7f2, #f8f5f0);-o-box-shadow:none;-ms-box-shadow:none;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none}.LESSbutton_inner_pressstyle{color:#f8f6ef}.LESSbutton_text1_style{font-family:Helvetica,Arial,sans-serif;font-weight:400;font-size:1.0rem;font-style:normal;color:#000}.LESSbutton_hover_style{color:#363133}.LESSbutton_down_style{background:#3b73b6;color:#f8f6ef}.LESSbutton_edit_style{background:#c95858;background:-webkit-gradient(linear,left top,left bottom,from( #c95858),to( #a12828));background:-moz_linear-gradient(top, #c95858, #a12828)}.LESSDayselectorButtonNormal{background:#7e9db2;background:-webkit-linear-gradient(top, #7e9db2 0, #547990 100%);background:-moz-linear-gradient(top, #7e9db2 0, #547990 100%);background:-ms-linear-gradient(top, #7e9db2 0, #547990 100%);background:-o-linear-gradient(top, #7e9db2 0, #547990 100%);background:linear-gradient(top, #7e9db2 0, #547990 100%)}.LESSDayaselectorButtonPress{background:#3b7796;background:-webkit-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-moz-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-ms-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-o-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:linear-gradient(top, #3b7796 0, #2f5b75 100%)}.LESSpopup_button_style{}.LESSpopup_button_hover_style{background:#5e88a3}.LESSpopup_button_press_style{background:#43a0d9;background:-webkit-gradient(linear,left top,left bottom,from( #43a0d9),to( #388bb9));background:-moz-linear-gradient(top, #43a0d9, #388bb9);background:-ms-linear-gradient(top, #43a0d9, #388bb9);background:-o-linear-gradient(top, #43a0d9, #388bb9)}.LESStoggleswitch_on_style{background:#2a7eac;background:-webkit-gradient(linear,left top,left bottom,from( #2174a7),to( #4ba5db));background:-moz-linear-gradient(top, #2174a7, #4ba5db);border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px}.LESStoggleswitch_off_style{color:#cbcbcb;background:#97a1a7;background:-webkit-gradient(linear,left top,left bottom,from( #727272),to( #8d8d8d));background:-moz-linear-gradient(top, #727272, #8d8d8d);border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px}.LESStoggleswitch_reed_style{background:#fdfdfd;background:-webkit-gradient(linear,left top,left bottom,from( #fdfdfd),to( #e7e7e7));background:-moz-linear-gradient(top, #fdfdfd, #e7e7e7);border-radius:2px;-webkit-border-radius:2px;-moz-border-radius:2px}.LESSbutton_editpress_style{background:#931818;background:-webkit-gradient(linear,left top,left bottom,from( #931818),to( #6e1717));background:-moz-linear-gradient(top, #931818, #6e1717)}.LESSbutton_edit_padding{padding:.5em .8em}.LESSmultimediaview_bar_active_style{background-color:#4a84c9;background-image:-webkit-gradient(linear,left top,left bottom,from( #6289d9),to( #295b98));background-image:-moz-linear-gradient(top, #6289d9, #295b98);background-image:-o-linear-gradient(top, #6289d9, #295b98);background-image:-ms-linear-gradient(top, #6289d9, #295b98)}.LESSmultimediaview_bar_handle_style{background-color:#f9f9f9;background-image:-webkit-gradient(linear,left top,left bottom,from( #fff),to( #e6e6e6));background-image:-moz-linear-gradient(top, #fff, #e6e6e6);background-image:-o-linear-gradient(top, #fff, #e6e6e6);background-image:-ms-linear-gradient(top, #fff, #e6e6e6)}.ui-gallery{position:relative;width:100%}.ui-gallery-bg{display:none;position:absolute;text-align:center;width:100%}.LESSbutton_box_style{color:#363133}.LESSbutton_up_style{background:#ebe8e3;background:-webkit-linear-gradient(top, #ebe8e3, #eae7e2);background:-moz-linear-gradient(top, #ebe8e3, #eae7e2);background:-o-linear-gradient(top, #ebe8e3, #eae7e2);background:-ms-linear-gradient(top, #ebe8e3, #eae7e2)}.LESSbutton_box_style{background:#ebe8e3;background:-webkit-linear-gradient(top, #ebe8e3, #eae7e2);background:-moz-linear-gradient(top, #ebe8e3, #eae7e2);background:-o-linear-gradient(top, #ebe8e3, #eae7e2);background:-ms-linear-gradient(top, #ebe8e3, #eae7e2);border:1px solid;border-color:#dcdad3;-o-box-shadow:0 0 1px 1px #fff;-ms-box-shadow:0 0 1px 1px #fff;-moz-box-shadow:0 0 1px 1px #fff;-webkit-box-shadow:0 0 1px 1px #fff;box-shadow:0 0 1px 1px #fff}.LESSbutton_inner_box_style{background:#f7f5ee;background:-webkit-linear-gradient(top, #faf7f2, #f8f5f0);background:-ms-linear-gradient(top, #faf7f2, #f8f5f0);background:-o-linear-gradient(top, #faf7f2, #f8f5f0);background:-moz-linear-gradient(top, #faf7f2, #f8f5f0);-o-box-shadow:none;-ms-box-shadow:none;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none}.LESSbutton_inner_pressstyle{color:#f8f6ef}.LESSbutton_text1_style{font-family:Helvetica,Arial,sans-serif;font-weight:400;font-size:1.0rem;font-style:normal;color:#000}.LESSbutton_hover_style{color:#363133}.LESSbutton_down_style{background:#3b73b6;color:#f8f6ef}.LESSbutton_edit_style{background:#c95858;background:-webkit-gradient(linear,left top,left bottom,from( #c95858),to( #a12828));background:-moz_linear-gradient(top, #c95858, #a12828)}.LESSDayselectorButtonNormal{background:#7e9db2;background:-webkit-linear-gradient(top, #7e9db2 0, #547990 100%);background:-moz-linear-gradient(top, #7e9db2 0, #547990 100%);background:-ms-linear-gradient(top, #7e9db2 0, #547990 100%);background:-o-linear-gradient(top, #7e9db2 0, #547990 100%);background:linear-gradient(top, #7e9db2 0, #547990 100%)}.LESSDayaselectorButtonPress{background:#3b7796;background:-webkit-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-moz-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-ms-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-o-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:linear-gradient(top, #3b7796 0, #2f5b75 100%)}.LESSpopup_button_style{}.LESSpopup_button_hover_style{background:#5e88a3}.LESSpopup_button_press_style{background:#43a0d9;background:-webkit-gradient(linear,left top,left bottom,from( #43a0d9),to( #388bb9));background:-moz-linear-gradient(top, #43a0d9, #388bb9);background:-ms-linear-gradient(top, #43a0d9, #388bb9);background:-o-linear-gradient(top, #43a0d9, #388bb9)}.LESStoggleswitch_on_style{background:#2a7eac;background:-webkit-gradient(linear,left top,left bottom,from( #2174a7),to( #4ba5db));background:-moz-linear-gradient(top, #2174a7, #4ba5db);border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px}.LESStoggleswitch_off_style{color:#cbcbcb;background:#97a1a7;background:-webkit-gradient(linear,left top,left bottom,from( #727272),to( #8d8d8d));background:-moz-linear-gradient(top, #727272, #8d8d8d);border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px}.LESStoggleswitch_reed_style{background:#fdfdfd;background:-webkit-gradient(linear,left top,left bottom,from( #fdfdfd),to( #e7e7e7));background:-moz-linear-gradient(top, #fdfdfd, #e7e7e7);border-radius:2px;-webkit-border-radius:2px;-moz-border-radius:2px}.LESSbutton_editpress_style{background:#931818;background:-webkit-gradient(linear,left top,left bottom,from( #931818),to( #6e1717));background:-moz-linear-gradient(top, #931818, #6e1717)}.LESSbutton_edit_padding{padding:.5em .8em}.LESSmultimediaview_bar_active_style{background-color:#4a84c9;background-image:-webkit-gradient(linear,left top,left bottom,from( #6289d9),to( #295b98));background-image:-moz-linear-gradient(top, #6289d9, #295b98);background-image:-o-linear-gradient(top, #6289d9, #295b98);background-image:-ms-linear-gradient(top, #6289d9, #295b98)}.LESSmultimediaview_bar_handle_style{background-color:#f9f9f9;background-image:-webkit-gradient(linear,left top,left bottom,from( #fff),to( #e6e6e6));background-image:-moz-linear-gradient(top, #fff, #e6e6e6);background-image:-o-linear-gradient(top, #fff, #e6e6e6);background-image:-ms-linear-gradient(top, #fff, #e6e6e6)}@-webkit-keyframes ui-ticker-show{from{ opacity:0;-webkit-transform:translatey(-2.272727272727273rem);top:-2.272727272727273rem}to{opacity:1;-webkit-transform:translatey(0);top:0}}@-webkit-keyframes ui-ticker-hide{from{ opacity:1;-webkit-transform:translatey(0);top:0}to{opacity:0;-webkit-transform:translatey(-2.272727272727273rem);top:-2.272727272727273rem}}.ui-ticker{position:fixed;display:none;left:0;width:100%;height:2.272727272727273rem;z-index:2147483547;background:#444}.ui-ticker.fix{display:block;top:0}.ui-ticker.show{display:block;-ms-animation:ui-ticker-show .8s 1 ease;-o-animation:ui-ticker-show .8s 1 ease;-moz-animation:ui-ticker-show .8s 1 ease;-webkit-animation:ui-ticker-show .8s 1 ease;top:0}.ui-ticker.hide{display:block;-ms-animation:ui-ticker-hide .8s 1 ease;-o-animation:ui-ticker-hide .8s 1 ease;-ms-animation:ui-ticker-hide .8s 1 ease;-webkit-animation:ui-ticker-hide .8s 1 ease;top:-2.272727272727273rem}.ui-ticker-btn{position:relative;margin-top:.4545454545454546rem;margin-left:.36363636363636365rem;margin-right:.36363636363636365rem;vertical-align:middle;float:right}.ui-ticker-btn .ui-btn-inner{padding:.15rem 0 0 0;height:1.2727272727272727rem;width:3.5rem;font-size:.81rem;color:#fff;background:#404040;border:1px;border-color:#323232;box-shadow:0 0 1px 1px #323232}.ui-ticker-btn .ui-btn-box-s.ui-btn-up-s{background:#404040;box-shadow:0 0 1px 1px #323232;border-color:#323232}.ui-ticker-btn .ui-btn-box-s.ui-btn-hover-s{background:#404040;box-shadow:0 0 1px 1px #323232;border-color:#323232}.ui-ticker-icon{position:absolute;top:0;height:1.4545454545454546rem;width:1.4545454545454546rem;margin-top:.4090909090909091rem;margin-bottom:.4090909090909091rem;margin-left:.36363636363636365rem;margin-right:.36363636363636365rem;vertical-align:middle}.ui-ticker-text1-bg{position:absolute;top:0;height:.8181818181818182rem;left:2.1818181818181817rem;margin-top:.36363636363636365rem;font-size:.68rem;color:#fff}.ui-ticker-text2-bg{position:absolute;top:0;height:.7272727272727273rem;left:2.1818181818181817rem;margin-top:1.1818181818181819rem;font-size:.54rem;color:#fff}@-webkit-keyframes ui-smallpopup-show{from{ opacity:0;-webkit-transform:scaley(0)}to{opacity:1;-webkit-transform:scaley(1)}}@-webkit-keyframes ui-smallpopup-hide{from{ opacity:1;left:0;-webkit-transform:scaley(1)}to{opacity:0;left:0;-webkit-transform:scaley(0)}}.ui-smallpopup{position:fixed;display:none;left:0;width:100%;z-index:1100;background:#444;vertical-align:middle;font-size:.72rem;word-break:break-all}.ui-smallpopup.fix{display:block}.ui-smallpopup.show{display:block;-moz-animation:ui-smallpopup-show .5s 1 ease;-ms-animation:ui-smallpopup-show .5s 1 ease;-o-animation:ui-smallpopup-show .5s 1 ease;-webkit-animation:ui-smallpopup-show .5s 1 ease}.ui-smallpopup.hide{display:block;left:-100%;-moz-animation:ui-smallpopup-hide .5s 1 ease;-ms-animation:ui-smallpopup-hide .5s 1 ease;-o-animation:ui-smallpopup-hide .5s 1 ease;-webkit-animation:ui-smallpopup-hide .5s 1 ease}.ui-smallpopup-text-bg{position:relative;margin-top:.18181818181818182rem;margin-bottom:.18181818181818182rem;margin-left:.36363636363636365rem;margin-right:.36363636363636365rem;color:#fff}.LESSbutton_box_style{color:#363133}.LESSbutton_up_style{background:#ebe8e3;background:-webkit-linear-gradient(top, #ebe8e3, #eae7e2);background:-moz-linear-gradient(top, #ebe8e3, #eae7e2);background:-o-linear-gradient(top, #ebe8e3, #eae7e2);background:-ms-linear-gradient(top, #ebe8e3, #eae7e2)}.LESSbutton_box_style{background:#ebe8e3;background:-webkit-linear-gradient(top, #ebe8e3, #eae7e2);background:-moz-linear-gradient(top, #ebe8e3, #eae7e2);background:-o-linear-gradient(top, #ebe8e3, #eae7e2);background:-ms-linear-gradient(top, #ebe8e3, #eae7e2);border:1px solid;border-color:#dcdad3;-o-box-shadow:0 0 1px 1px #fff;-ms-box-shadow:0 0 1px 1px #fff;-moz-box-shadow:0 0 1px 1px #fff;-webkit-box-shadow:0 0 1px 1px #fff;box-shadow:0 0 1px 1px #fff}.LESSbutton_inner_box_style{background:#f7f5ee;background:-webkit-linear-gradient(top, #faf7f2, #f8f5f0);background:-ms-linear-gradient(top, #faf7f2, #f8f5f0);background:-o-linear-gradient(top, #faf7f2, #f8f5f0);background:-moz-linear-gradient(top, #faf7f2, #f8f5f0);-o-box-shadow:none;-ms-box-shadow:none;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none}.LESSbutton_inner_pressstyle{color:#f8f6ef}.LESSbutton_text1_style{font-family:Helvetica,Arial,sans-serif;font-weight:400;font-size:1.0rem;font-style:normal;color:#000}.LESSbutton_hover_style{color:#363133}.LESSbutton_down_style{background:#3b73b6;color:#f8f6ef}.LESSbutton_edit_style{background:#c95858;background:-webkit-gradient(linear,left top,left bottom,from( #c95858),to( #a12828));background:-moz_linear-gradient(top, #c95858, #a12828)}.LESSDayselectorButtonNormal{background:#7e9db2;background:-webkit-linear-gradient(top, #7e9db2 0, #547990 100%);background:-moz-linear-gradient(top, #7e9db2 0, #547990 100%);background:-ms-linear-gradient(top, #7e9db2 0, #547990 100%);background:-o-linear-gradient(top, #7e9db2 0, #547990 100%);background:linear-gradient(top, #7e9db2 0, #547990 100%)}.LESSDayaselectorButtonPress{background:#3b7796;background:-webkit-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-moz-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-ms-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-o-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:linear-gradient(top, #3b7796 0, #2f5b75 100%)}.LESSpopup_button_style{}.LESSpopup_button_hover_style{background:#5e88a3}.LESSpopup_button_press_style{background:#43a0d9;background:-webkit-gradient(linear,left top,left bottom,from( #43a0d9),to( #388bb9));background:-moz-linear-gradient(top, #43a0d9, #388bb9);background:-ms-linear-gradient(top, #43a0d9, #388bb9);background:-o-linear-gradient(top, #43a0d9, #388bb9)}.LESStoggleswitch_on_style{background:#2a7eac;background:-webkit-gradient(linear,left top,left bottom,from( #2174a7),to( #4ba5db));background:-moz-linear-gradient(top, #2174a7, #4ba5db);border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px}.LESStoggleswitch_off_style{color:#cbcbcb;background:#97a1a7;background:-webkit-gradient(linear,left top,left bottom,from( #727272),to( #8d8d8d));background:-moz-linear-gradient(top, #727272, #8d8d8d);border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px}.LESStoggleswitch_reed_style{background:#fdfdfd;background:-webkit-gradient(linear,left top,left bottom,from( #fdfdfd),to( #e7e7e7));background:-moz-linear-gradient(top, #fdfdfd, #e7e7e7);border-radius:2px;-webkit-border-radius:2px;-moz-border-radius:2px}.LESSbutton_editpress_style{background:#931818;background:-webkit-gradient(linear,left top,left bottom,from( #931818),to( #6e1717));background:-moz-linear-gradient(top, #931818, #6e1717)}.LESSbutton_edit_padding{padding:.5em .8em}.LESSmultimediaview_bar_active_style{background-color:#4a84c9;background-image:-webkit-gradient(linear,left top,left bottom,from( #6289d9),to( #295b98));background-image:-moz-linear-gradient(top, #6289d9, #295b98);background-image:-o-linear-gradient(top, #6289d9, #295b98);background-image:-ms-linear-gradient(top, #6289d9, #295b98)}.LESSmultimediaview_bar_handle_style{background-color:#f9f9f9;background-image:-webkit-gradient(linear,left top,left bottom,from( #fff),to( #e6e6e6));background-image:-moz-linear-gradient(top, #fff, #e6e6e6);background-image:-o-linear-gradient(top, #fff, #e6e6e6);background-image:-ms-linear-gradient(top, #fff, #e6e6e6)}.ui-swipe{list-style-type:none}.ui-swipe-item{height:1.1818181818181819rem;-ms-user-select:none;-o-user-select:none;-moz-user-select:none;-webkit-user-select:none;-user-select:none;opacity:0;text-align:center}.ui-swipe-item .ui-btn{margin-top:-1.5em ! important;position:relative ! important}.ui-swipe-item p{margin:0}.ui-swipe-item-cover{position:absolute;border:0;top:0;left:0;width:100%;height:100%;z-index:100}.ui-swipe-item-cover .ui-swipe-item-cover-inner{position:absolute;padding-top:.6818181818181819rem;padding-bottom:.6818181818181819rem;padding-left:.36363636363636365rem;width:100%;text-align:left}.ui-swipe-item-cover .ui-swipe-item-cover-inner .ui-li-text-sub{position:absolute;padding-right:.7272727272727273rem}.ui-swipe-item-cover p{margin:0}.LESSbutton_box_style{color:#363133}.LESSbutton_up_style{background:#ebe8e3;background:-webkit-linear-gradient(top, #ebe8e3, #eae7e2);background:-moz-linear-gradient(top, #ebe8e3, #eae7e2);background:-o-linear-gradient(top, #ebe8e3, #eae7e2);background:-ms-linear-gradient(top, #ebe8e3, #eae7e2)}.LESSbutton_box_style{background:#ebe8e3;background:-webkit-linear-gradient(top, #ebe8e3, #eae7e2);background:-moz-linear-gradient(top, #ebe8e3, #eae7e2);background:-o-linear-gradient(top, #ebe8e3, #eae7e2);background:-ms-linear-gradient(top, #ebe8e3, #eae7e2);border:1px solid;border-color:#dcdad3;-o-box-shadow:0 0 1px 1px #fff;-ms-box-shadow:0 0 1px 1px #fff;-moz-box-shadow:0 0 1px 1px #fff;-webkit-box-shadow:0 0 1px 1px #fff;box-shadow:0 0 1px 1px #fff}.LESSbutton_inner_box_style{background:#f7f5ee;background:-webkit-linear-gradient(top, #faf7f2, #f8f5f0);background:-ms-linear-gradient(top, #faf7f2, #f8f5f0);background:-o-linear-gradient(top, #faf7f2, #f8f5f0);background:-moz-linear-gradient(top, #faf7f2, #f8f5f0);-o-box-shadow:none;-ms-box-shadow:none;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none}.LESSbutton_inner_pressstyle{color:#f8f6ef}.LESSbutton_text1_style{font-family:Helvetica,Arial,sans-serif;font-weight:400;font-size:1.0rem;font-style:normal;color:#000}.LESSbutton_hover_style{color:#363133}.LESSbutton_down_style{background:#3b73b6;color:#f8f6ef}.LESSbutton_edit_style{background:#c95858;background:-webkit-gradient(linear,left top,left bottom,from( #c95858),to( #a12828));background:-moz_linear-gradient(top, #c95858, #a12828)}.LESSDayselectorButtonNormal{background:#7e9db2;background:-webkit-linear-gradient(top, #7e9db2 0, #547990 100%);background:-moz-linear-gradient(top, #7e9db2 0, #547990 100%);background:-ms-linear-gradient(top, #7e9db2 0, #547990 100%);background:-o-linear-gradient(top, #7e9db2 0, #547990 100%);background:linear-gradient(top, #7e9db2 0, #547990 100%)}.LESSDayaselectorButtonPress{background:#3b7796;background:-webkit-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-moz-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-ms-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-o-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:linear-gradient(top, #3b7796 0, #2f5b75 100%)}.LESSpopup_button_style{}.LESSpopup_button_hover_style{background:#5e88a3}.LESSpopup_button_press_style{background:#43a0d9;background:-webkit-gradient(linear,left top,left bottom,from( #43a0d9),to( #388bb9));background:-moz-linear-gradient(top, #43a0d9, #388bb9);background:-ms-linear-gradient(top, #43a0d9, #388bb9);background:-o-linear-gradient(top, #43a0d9, #388bb9)}.LESStoggleswitch_on_style{background:#2a7eac;background:-webkit-gradient(linear,left top,left bottom,from( #2174a7),to( #4ba5db));background:-moz-linear-gradient(top, #2174a7, #4ba5db);border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px}.LESStoggleswitch_off_style{color:#cbcbcb;background:#97a1a7;background:-webkit-gradient(linear,left top,left bottom,from( #727272),to( #8d8d8d));background:-moz-linear-gradient(top, #727272, #8d8d8d);border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px}.LESStoggleswitch_reed_style{background:#fdfdfd;background:-webkit-gradient(linear,left top,left bottom,from( #fdfdfd),to( #e7e7e7));background:-moz-linear-gradient(top, #fdfdfd, #e7e7e7);border-radius:2px;-webkit-border-radius:2px;-moz-border-radius:2px}.LESSbutton_editpress_style{background:#931818;background:-webkit-gradient(linear,left top,left bottom,from( #931818),to( #6e1717));background:-moz-linear-gradient(top, #931818, #6e1717)}.LESSbutton_edit_padding{padding:.5em .8em}.LESSmultimediaview_bar_active_style{background-color:#4a84c9;background-image:-webkit-gradient(linear,left top,left bottom,from( #6289d9),to( #295b98));background-image:-moz-linear-gradient(top, #6289d9, #295b98);background-image:-o-linear-gradient(top, #6289d9, #295b98);background-image:-ms-linear-gradient(top, #6289d9, #295b98)}.LESSmultimediaview_bar_handle_style{background-color:#f9f9f9;background-image:-webkit-gradient(linear,left top,left bottom,from( #fff),to( #e6e6e6));background-image:-moz-linear-gradient(top, #fff, #e6e6e6);background-image:-o-linear-gradient(top, #fff, #e6e6e6);background-image:-ms-linear-gradient(top, #fff, #e6e6e6)}.ui-fastscroll{position:absolute;right:0rem;background-color:#e6e3d8;width:1.1363636363636365rem;-ms-user-select:none;-o-user-select:none;-moz-user-select:none;-webkit-user-select:none;user-select:none;margin:0;padding-right:.08em;opacity:1}.ui-fastscroll ul{list-style-type:none;margin:0;padding:0}.ui-fastscroll li{cursor:pointer;color:#a09f9a;padding:.09090909090909091rem .09090909090909091rem .09090909090909091rem .09090909090909091rem;text-align:center;font-size:.7272727272727273rem;font-weight:700;border-left-width:.13636363636363635rem;border-left-color:#3b73b6;border-left-style:solid}.ui-fastscroll2{position:absolute;right:0rem;-ms-user-select:none;-o-user-select:none;-moz-user-select:none;-webkit-user-select:none;user-select:none;margin:0;padding-right:.08em;opacity:1}.ui-fastscroll2 ul{list-style-type:none;margin:0;padding:0}.ui-fastscroll2 li{cursor:pointer;color:#a09f9a;padding:.09090909090909091rem .09090909090909091rem .09090909090909091rem .09090909090909091rem;text-align:right}.ui-fastscroll-bg{position:absolute;right:0rem;background-color:#e6e3d8;width:1.1363636363636365rem;z-index:10;top:0}.ui-fastscroll-popup{position:absolute;background:#3b73b6;color:#fff;padding:.4545454545454546rem 1.3636363636363638rem;-ms-box-shadow:.36363636363636365rem .4545454545454546rem 0rem rgba(199,199,199,.5);-o-box-shadow:.36363636363636365rem .4545454545454546rem 0rem rgba(199,199,199,.5);-moz-box-shadow:.36363636363636365rem .4545454545454546rem 0rem rgba(199,199,199,.5);-webkit-box-shadow:.36363636363636365rem .4545454545454546rem 0rem rgba(199,199,199,.5);box-shadow:.36363636363636365rem .4545454545454546rem 0rem rgba(199,199,199,.5);text-align:center;font-size:3.409090909090909rem;font-weight:700;display:none;box-sizing:border-box;left:50%;top:50%}li.ui-fastscroll-hover{color:#3b73b6}li.ui-fastscroll-hover,li.ui-fastscroll-hover-up,li.ui-fastscroll-hover-down{background:#f8f6ef;border-style:solid;border-color:#3b73b6;border-width:0;border-right-width:.13636363636363635rem;border-left-width:1px;border-left-color:#f8f6ef}li.ui-fastscroll-hover-up{border-top-width:.13636363636363635rem}li.ui-fastscroll-hover-down{border-bottom-width:.13636363636363635rem}.LESSbutton_box_style{color:#363133}.LESSbutton_up_style{background:#ebe8e3;background:-webkit-linear-gradient(top, #ebe8e3, #eae7e2);background:-moz-linear-gradient(top, #ebe8e3, #eae7e2);background:-o-linear-gradient(top, #ebe8e3, #eae7e2);background:-ms-linear-gradient(top, #ebe8e3, #eae7e2)}.LESSbutton_box_style{background:#ebe8e3;background:-webkit-linear-gradient(top, #ebe8e3, #eae7e2);background:-moz-linear-gradient(top, #ebe8e3, #eae7e2);background:-o-linear-gradient(top, #ebe8e3, #eae7e2);background:-ms-linear-gradient(top, #ebe8e3, #eae7e2);border:1px solid;border-color:#dcdad3;-o-box-shadow:0 0 1px 1px #fff;-ms-box-shadow:0 0 1px 1px #fff;-moz-box-shadow:0 0 1px 1px #fff;-webkit-box-shadow:0 0 1px 1px #fff;box-shadow:0 0 1px 1px #fff}.LESSbutton_inner_box_style{background:#f7f5ee;background:-webkit-linear-gradient(top, #faf7f2, #f8f5f0);background:-ms-linear-gradient(top, #faf7f2, #f8f5f0);background:-o-linear-gradient(top, #faf7f2, #f8f5f0);background:-moz-linear-gradient(top, #faf7f2, #f8f5f0);-o-box-shadow:none;-ms-box-shadow:none;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none}.LESSbutton_inner_pressstyle{color:#f8f6ef}.LESSbutton_text1_style{font-family:Helvetica,Arial,sans-serif;font-weight:400;font-size:1.0rem;font-style:normal;color:#000}.LESSbutton_hover_style{color:#363133}.LESSbutton_down_style{background:#3b73b6;color:#f8f6ef}.LESSbutton_edit_style{background:#c95858;background:-webkit-gradient(linear,left top,left bottom,from( #c95858),to( #a12828));background:-moz_linear-gradient(top, #c95858, #a12828)}.LESSDayselectorButtonNormal{background:#7e9db2;background:-webkit-linear-gradient(top, #7e9db2 0, #547990 100%);background:-moz-linear-gradient(top, #7e9db2 0, #547990 100%);background:-ms-linear-gradient(top, #7e9db2 0, #547990 100%);background:-o-linear-gradient(top, #7e9db2 0, #547990 100%);background:linear-gradient(top, #7e9db2 0, #547990 100%)}.LESSDayaselectorButtonPress{background:#3b7796;background:-webkit-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-moz-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-ms-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-o-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:linear-gradient(top, #3b7796 0, #2f5b75 100%)}.LESSpopup_button_style{}.LESSpopup_button_hover_style{background:#5e88a3}.LESSpopup_button_press_style{background:#43a0d9;background:-webkit-gradient(linear,left top,left bottom,from( #43a0d9),to( #388bb9));background:-moz-linear-gradient(top, #43a0d9, #388bb9);background:-ms-linear-gradient(top, #43a0d9, #388bb9);background:-o-linear-gradient(top, #43a0d9, #388bb9)}.LESStoggleswitch_on_style{background:#2a7eac;background:-webkit-gradient(linear,left top,left bottom,from( #2174a7),to( #4ba5db));background:-moz-linear-gradient(top, #2174a7, #4ba5db);border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px}.LESStoggleswitch_off_style{color:#cbcbcb;background:#97a1a7;background:-webkit-gradient(linear,left top,left bottom,from( #727272),to( #8d8d8d));background:-moz-linear-gradient(top, #727272, #8d8d8d);border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px}.LESStoggleswitch_reed_style{background:#fdfdfd;background:-webkit-gradient(linear,left top,left bottom,from( #fdfdfd),to( #e7e7e7));background:-moz-linear-gradient(top, #fdfdfd, #e7e7e7);border-radius:2px;-webkit-border-radius:2px;-moz-border-radius:2px}.LESSbutton_editpress_style{background:#931818;background:-webkit-gradient(linear,left top,left bottom,from( #931818),to( #6e1717));background:-moz-linear-gradient(top, #931818, #6e1717)}.LESSbutton_edit_padding{padding:.5em .8em}.LESSmultimediaview_bar_active_style{background-color:#4a84c9;background-image:-webkit-gradient(linear,left top,left bottom,from( #6289d9),to( #295b98));background-image:-moz-linear-gradient(top, #6289d9, #295b98);background-image:-o-linear-gradient(top, #6289d9, #295b98);background-image:-ms-linear-gradient(top, #6289d9, #295b98)}.LESSmultimediaview_bar_handle_style{background-color:#f9f9f9;background-image:-webkit-gradient(linear,left top,left bottom,from( #fff),to( #e6e6e6));background-image:-moz-linear-gradient(top, #fff, #e6e6e6);background-image:-o-linear-gradient(top, #fff, #e6e6e6);background-image:-ms-linear-gradient(top, #fff, #e6e6e6)}.ui-dayselector label{height:2.5454545454545454rem;width:2.909090909090909rem}.ui-dayselector{display:inline-block}.ui-dayselector .ui-btn{border-color:#1a5274;border-style:solid;border-width:.045454545454545456rem}.ui-dayselector .ui-btn .ui-btn-inner{text-align:center;padding:.4em 0}.ui-dayselector .ui-checkbox-off{background:#7e9db2;background:-webkit-linear-gradient(top, #7e9db2 0, #547990 100%);background:-moz-linear-gradient(top, #7e9db2 0, #547990 100%);background:-ms-linear-gradient(top, #7e9db2 0, #547990 100%);background:-o-linear-gradient(top, #7e9db2 0, #547990 100%);background:linear-gradient(top, #7e9db2 0, #547990 100%)}.ui-dayselector .ui-checkbox-off .ui-btn-text{color:#f9f9f9}.ui-dayselector .ui-checkbox-off.ui-btn-down-s.ui-btn-hover-s{background:#3b7796;background:-webkit-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-moz-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-ms-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-o-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:linear-gradient(top, #3b7796 0, #2f5b75 100%)}.ui-dayselector .ui-checkbox-on{background:#3b7796;background:-webkit-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-moz-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-ms-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-o-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:linear-gradient(top, #3b7796 0, #2f5b75 100%)}.ui-dayselector .ui-checkbox-on .ui-btn-text{color:#f9f9f9}.ui-dayselector .ui-checkbox-on.ui-btn-down-s.ui-btn-hover-s{background:#7e9db2;background:-webkit-linear-gradient(top, #7e9db2 0, #547990 100%);background:-moz-linear-gradient(top, #7e9db2 0, #547990 100%);background:-ms-linear-gradient(top, #7e9db2 0, #547990 100%);background:-o-linear-gradient(top, #7e9db2 0, #547990 100%);background:linear-gradient(top, #7e9db2 0, #547990 100%)}.ui-dayselector .ui-dayselector-label-6 .ui-btn-text{color:#00a8e7}.ui-dayselector .ui-dayselector-label-6.ui-checkbox-on .ui-btn-text{color:#f9f9f9}.ui-dayselector .ui-dayselector-label-0 .ui-btn-text{color:#f01402}.ui-dayselector .ui-checkbox{height:2.0454545454545454rem}.ui-dayselector .ui-checkbox .ui-btn{width:2.1363636363636362rem}.ui-dayselector .ui-checkbox .ui-btn.ui-corner-left{border-top-left-radius:.2272727272727273rem;border-bottom-left-radius:.2272727272727273rem}.ui-dayselector .ui-checkbox .ui-btn.ui-corner-right{border-top-right-radius:.2272727272727273rem;border-bottom-right-radius:.2272727272727273rem}.ui-dayselector .todons-dayselector-disabled .ui-dayselector-label-6{color:#121212}.ui-dayselector .todons-dayselector-disabled .ui-dayselector-label-0{color:#363636}.ui-dayselector.ui-controlgroup-vertical .ui-checkbox .ui-btn{width:2.909090909090909rem}.ui-dayselector.ui-controlgroup-vertical .ui-checkbox .ui-btn .ui-btn-text{margin-left:.09090909090909091rem}.LESSbutton_box_style{color:#363133}.LESSbutton_up_style{background:#ebe8e3;background:-webkit-linear-gradient(top, #ebe8e3, #eae7e2);background:-moz-linear-gradient(top, #ebe8e3, #eae7e2);background:-o-linear-gradient(top, #ebe8e3, #eae7e2);background:-ms-linear-gradient(top, #ebe8e3, #eae7e2)}.LESSbutton_box_style{background:#ebe8e3;background:-webkit-linear-gradient(top, #ebe8e3, #eae7e2);background:-moz-linear-gradient(top, #ebe8e3, #eae7e2);background:-o-linear-gradient(top, #ebe8e3, #eae7e2);background:-ms-linear-gradient(top, #ebe8e3, #eae7e2);border:1px solid;border-color:#dcdad3;-o-box-shadow:0 0 1px 1px #fff;-ms-box-shadow:0 0 1px 1px #fff;-moz-box-shadow:0 0 1px 1px #fff;-webkit-box-shadow:0 0 1px 1px #fff;box-shadow:0 0 1px 1px #fff}.LESSbutton_inner_box_style{background:#f7f5ee;background:-webkit-linear-gradient(top, #faf7f2, #f8f5f0);background:-ms-linear-gradient(top, #faf7f2, #f8f5f0);background:-o-linear-gradient(top, #faf7f2, #f8f5f0);background:-moz-linear-gradient(top, #faf7f2, #f8f5f0);-o-box-shadow:none;-ms-box-shadow:none;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none}.LESSbutton_inner_pressstyle{color:#f8f6ef}.LESSbutton_text1_style{font-family:Helvetica,Arial,sans-serif;font-weight:400;font-size:1.0rem;font-style:normal;color:#000}.LESSbutton_hover_style{color:#363133}.LESSbutton_down_style{background:#3b73b6;color:#f8f6ef}.LESSbutton_edit_style{background:#c95858;background:-webkit-gradient(linear,left top,left bottom,from( #c95858),to( #a12828));background:-moz_linear-gradient(top, #c95858, #a12828)}.LESSDayselectorButtonNormal{background:#7e9db2;background:-webkit-linear-gradient(top, #7e9db2 0, #547990 100%);background:-moz-linear-gradient(top, #7e9db2 0, #547990 100%);background:-ms-linear-gradient(top, #7e9db2 0, #547990 100%);background:-o-linear-gradient(top, #7e9db2 0, #547990 100%);background:linear-gradient(top, #7e9db2 0, #547990 100%)}.LESSDayaselectorButtonPress{background:#3b7796;background:-webkit-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-moz-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-ms-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-o-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:linear-gradient(top, #3b7796 0, #2f5b75 100%)}.LESSpopup_button_style{}.LESSpopup_button_hover_style{background:#5e88a3}.LESSpopup_button_press_style{background:#43a0d9;background:-webkit-gradient(linear,left top,left bottom,from( #43a0d9),to( #388bb9));background:-moz-linear-gradient(top, #43a0d9, #388bb9);background:-ms-linear-gradient(top, #43a0d9, #388bb9);background:-o-linear-gradient(top, #43a0d9, #388bb9)}.LESStoggleswitch_on_style{background:#2a7eac;background:-webkit-gradient(linear,left top,left bottom,from( #2174a7),to( #4ba5db));background:-moz-linear-gradient(top, #2174a7, #4ba5db);border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px}.LESStoggleswitch_off_style{color:#cbcbcb;background:#97a1a7;background:-webkit-gradient(linear,left top,left bottom,from( #727272),to( #8d8d8d));background:-moz-linear-gradient(top, #727272, #8d8d8d);border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px}.LESStoggleswitch_reed_style{background:#fdfdfd;background:-webkit-gradient(linear,left top,left bottom,from( #fdfdfd),to( #e7e7e7));background:-moz-linear-gradient(top, #fdfdfd, #e7e7e7);border-radius:2px;-webkit-border-radius:2px;-moz-border-radius:2px}.LESSbutton_editpress_style{background:#931818;background:-webkit-gradient(linear,left top,left bottom,from( #931818),to( #6e1717));background:-moz-linear-gradient(top, #931818, #6e1717)}.LESSbutton_edit_padding{padding:.5em .8em}.LESSmultimediaview_bar_active_style{background-color:#4a84c9;background-image:-webkit-gradient(linear,left top,left bottom,from( #6289d9),to( #295b98));background-image:-moz-linear-gradient(top, #6289d9, #295b98);background-image:-o-linear-gradient(top, #6289d9, #295b98);background-image:-ms-linear-gradient(top, #6289d9, #295b98)}.LESSmultimediaview_bar_handle_style{background-color:#f9f9f9;background-image:-webkit-gradient(linear,left top,left bottom,from( #fff),to( #e6e6e6));background-image:-moz-linear-gradient(top, #fff, #e6e6e6);background-image:-o-linear-gradient(top, #fff, #e6e6e6);background-image:-ms-linear-gradient(top, #fff, #e6e6e6)}div.ui-slider.ui-toggle-switch{width:3rem;height:1.590909090909091rem;background-color:transparent;margin-top:.2272727272727273rem;margin-bottom:.2272727272727273rem}div.ui-slider.ui-toggle-switch .ui-slider-label{position:absolute;width:3rem;height:1.590909090909091rem;background-size:cover;-ms-background-size:cover;-webkit-background-size:cover;-o-background-size:cover;-moz-background-size:cover}div.ui-slider.ui-toggle-switch .ui-slider-label.ui-slider-label-a{background:url(images/00_button_on.png) no-repeat}div.ui-slider.ui-toggle-switch .ui-slider-label.ui-slider-label-b{background:url(images/00_button_off.png) no-repeat}div.ui-slider.ui-toggle-switch .ui-slider-inneroffset a{background:0}.ui-slider-switch:not(.ui-toggle-switch){width:4.181818181818182rem}div.ui-slider.ui-slider-switch:not(.ui-toggle-switch){position:relative;margin-top:.2272727272727273rem;margin-bottom:.2272727272727273rem;height:1.4545454545454546rem;top:0;margin:.2272727272727273rem;border-radius:.6818181818181819rem}div.ui-slider.ui-slider-switch:not(.ui-toggle-switch) .ui-slider-inneroffset{position:relative;margin:-1px .7272727272727273rem;z-index:1}div.ui-slider.ui-slider-switch:not(.ui-toggle-switch) a.ui-slider-handle{position:absolute;background:#fff;top:50%;margin:1px 0 0 -.6818181818181819rem;border-radius:.6818181818181819rem;border:2px solid gray;width:1.2727272727272727rem;height:1.2727272727272727rem}div.ui-slider.ui-slider-switch:not(.ui-toggle-switch) a.ui-slider-handle-snapping{-webkit-transition:left 70ms linear}div.ui-slider.ui-slider-switch:not(.ui-toggle-switch) span{position:absolute;overflow:hidden;text-align:center;height:1.4545454545454546rem;font-weight:700;font-size:.7272727272727273rem;border-radius:.6818181818181819rem;white-space:nowrap;line-height:2}div.ui-slider.ui-slider-switch:not(.ui-toggle-switch) span.ui-slider-label-a{left:0;color:#fff;z-index:1;text-indent:-1.5em}div.ui-slider.ui-slider-switch:not(.ui-toggle-switch) span.ui-slider-label-b{right:0;color:#000;z-index:0;text-indent:1.5em}.ui-slider-switch .ui-slider-handle .ui-btn-inner{padding:0}.ui-triangle-container{position:relative}.ui-triangle-container .ui-triangle{position:absolute;border-style:solid;border-color:transparent;border-width:10px}.ui-triangle-container .ui-triangle-top{top:0;border-top-width:0;border-left-color:transparent;border-right-color:transparent;margin-left:-10px}.ui-triangle-container .ui-triangle-bottom{bottom:0;border-bottom-width:0;border-left-color:transparent;border-right-color:transparent;margin-left:-10px}.ui-triangle-container .ui-triangle-left{left:0;margin-top:-10px;border-left-width:0;border-left-color:transparent;border-right-color:transparent}.ui-triangle-container .ui-triangle-right{right:0;margin-top:-10px;border-right-width:0;border-left-color:transparent;border-right-color:transparent}.ui-triangle-container-top{height:10px;top:0;margin-top:-10px}.ui-triangle-container-bottom{height:10px;bottom:0;margin-bottom:-10px}.ui-triangle-container-left{width:10px}.ui-triangle-container-right{width:10px}.LESSbutton_box_style{color:#363133}.LESSbutton_up_style{background:#ebe8e3;background:-webkit-linear-gradient(top, #ebe8e3, #eae7e2);background:-moz-linear-gradient(top, #ebe8e3, #eae7e2);background:-o-linear-gradient(top, #ebe8e3, #eae7e2);background:-ms-linear-gradient(top, #ebe8e3, #eae7e2)}.LESSbutton_box_style{background:#ebe8e3;background:-webkit-linear-gradient(top, #ebe8e3, #eae7e2);background:-moz-linear-gradient(top, #ebe8e3, #eae7e2);background:-o-linear-gradient(top, #ebe8e3, #eae7e2);background:-ms-linear-gradient(top, #ebe8e3, #eae7e2);border:1px solid;border-color:#dcdad3;-o-box-shadow:0 0 1px 1px #fff;-ms-box-shadow:0 0 1px 1px #fff;-moz-box-shadow:0 0 1px 1px #fff;-webkit-box-shadow:0 0 1px 1px #fff;box-shadow:0 0 1px 1px #fff}.LESSbutton_inner_box_style{background:#f7f5ee;background:-webkit-linear-gradient(top, #faf7f2, #f8f5f0);background:-ms-linear-gradient(top, #faf7f2, #f8f5f0);background:-o-linear-gradient(top, #faf7f2, #f8f5f0);background:-moz-linear-gradient(top, #faf7f2, #f8f5f0);-o-box-shadow:none;-ms-box-shadow:none;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none}.LESSbutton_inner_pressstyle{color:#f8f6ef}.LESSbutton_text1_style{font-family:Helvetica,Arial,sans-serif;font-weight:400;font-size:1.0rem;font-style:normal;color:#000}.LESSbutton_hover_style{color:#363133}.LESSbutton_down_style{background:#3b73b6;color:#f8f6ef}.LESSbutton_edit_style{background:#c95858;background:-webkit-gradient(linear,left top,left bottom,from( #c95858),to( #a12828));background:-moz_linear-gradient(top, #c95858, #a12828)}.LESSDayselectorButtonNormal{background:#7e9db2;background:-webkit-linear-gradient(top, #7e9db2 0, #547990 100%);background:-moz-linear-gradient(top, #7e9db2 0, #547990 100%);background:-ms-linear-gradient(top, #7e9db2 0, #547990 100%);background:-o-linear-gradient(top, #7e9db2 0, #547990 100%);background:linear-gradient(top, #7e9db2 0, #547990 100%)}.LESSDayaselectorButtonPress{background:#3b7796;background:-webkit-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-moz-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-ms-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-o-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:linear-gradient(top, #3b7796 0, #2f5b75 100%)}.LESSpopup_button_style{}.LESSpopup_button_hover_style{background:#5e88a3}.LESSpopup_button_press_style{background:#43a0d9;background:-webkit-gradient(linear,left top,left bottom,from( #43a0d9),to( #388bb9));background:-moz-linear-gradient(top, #43a0d9, #388bb9);background:-ms-linear-gradient(top, #43a0d9, #388bb9);background:-o-linear-gradient(top, #43a0d9, #388bb9)}.LESStoggleswitch_on_style{background:#2a7eac;background:-webkit-gradient(linear,left top,left bottom,from( #2174a7),to( #4ba5db));background:-moz-linear-gradient(top, #2174a7, #4ba5db);border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px}.LESStoggleswitch_off_style{color:#cbcbcb;background:#97a1a7;background:-webkit-gradient(linear,left top,left bottom,from( #727272),to( #8d8d8d));background:-moz-linear-gradient(top, #727272, #8d8d8d);border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px}.LESStoggleswitch_reed_style{background:#fdfdfd;background:-webkit-gradient(linear,left top,left bottom,from( #fdfdfd),to( #e7e7e7));background:-moz-linear-gradient(top, #fdfdfd, #e7e7e7);border-radius:2px;-webkit-border-radius:2px;-moz-border-radius:2px}.LESSbutton_editpress_style{background:#931818;background:-webkit-gradient(linear,left top,left bottom,from( #931818),to( #6e1717));background:-moz-linear-gradient(top, #931818, #6e1717)}.LESSbutton_edit_padding{padding:.5em .8em}.LESSmultimediaview_bar_active_style{background-color:#4a84c9;background-image:-webkit-gradient(linear,left top,left bottom,from( #6289d9),to( #295b98));background-image:-moz-linear-gradient(top, #6289d9, #295b98);background-image:-o-linear-gradient(top, #6289d9, #295b98);background-image:-ms-linear-gradient(top, #6289d9, #295b98)}.LESSmultimediaview_bar_handle_style{background-color:#f9f9f9;background-image:-webkit-gradient(linear,left top,left bottom,from( #fff),to( #e6e6e6));background-image:-moz-linear-gradient(top, #fff, #e6e6e6);background-image:-o-linear-gradient(top, #fff, #e6e6e6);background-image:-ms-linear-gradient(top, #fff, #e6e6e6)}.ui-tokentextarea{display:table;outline:0}.ui-tokentextarea .ui-tokentextarea-label{display:inline-block;text-align:center;position:relative;margin-left:.3em;margin-right:.3em;padding:.6em 0;color:#666;font-weight:700;text-align:center;font-size:1em}.ui-tokentextarea-input{outline:0;position:relative;border:0!important;padding:0!important;margin:.5em;color:#222;text-align:left;font-size:1em}.ui-tokentextarea-input-visible{display:inline-block!important}.ui-tokentextarea-input-invisible{display:none!important}.ui-tokentextarea div{display:inline-block;text-align:center;cursor:pointer;position:relative;margin-left:.3em;margin-right:.3em;margin-bottom:.3em;margin-top:.3em;padding:.2em .5em;font-size:1em;text-shadow:0 .1em .1em rgba(0,0,0,.3);-ms-border-radius:.2em;-o-border-radius:.2em;-webkit-border-radius:.2em;-moz-border-radius:.2em;border-radius:.2em;-o-box-shadow:0 .1em .1em rgba(0,0,0,.2);-ms-box-shadow:0 .1em .1em rgba(0,0,0,.2);-moz-box-shadow:0 .1em .1em rgba(0,0,0,.2);-webkit-box-shadow:0 .1em .1em rgba(0,0,0,.2);box-shadow:0 .1em .1em rgba(0,0,0,.2);color:#fff;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}div.ui-tokentextarea-block{background-color:#5f8abd;background-image:url(./images/00_contacts_button_header.png);background-size:contain;background-repeat:no-repeat;padding-left:.7em}div.ui-tokentextarea-sblock{background-color:#365984;background-image:url(./images/00_contacts_button_header_press.png);background-size:contain;background-repeat:no-repeat;padding-left:.7em}.ui-tokentextarea .ui-tokentextarea-desclabel{display:inline-block;outline:0;position:relative;border:0;color:#666;text-align:left;font-size:1em}.ui-tokentextarea-focus-button{background-image:url(./images/00_button_expand_opened.png)}.LESSbutton_box_style{color:#363133}.LESSbutton_up_style{background:#ebe8e3;background:-webkit-linear-gradient(top, #ebe8e3, #eae7e2);background:-moz-linear-gradient(top, #ebe8e3, #eae7e2);background:-o-linear-gradient(top, #ebe8e3, #eae7e2);background:-ms-linear-gradient(top, #ebe8e3, #eae7e2)}.LESSbutton_box_style{background:#ebe8e3;background:-webkit-linear-gradient(top, #ebe8e3, #eae7e2);background:-moz-linear-gradient(top, #ebe8e3, #eae7e2);background:-o-linear-gradient(top, #ebe8e3, #eae7e2);background:-ms-linear-gradient(top, #ebe8e3, #eae7e2);border:1px solid;border-color:#dcdad3;-o-box-shadow:0 0 1px 1px #fff;-ms-box-shadow:0 0 1px 1px #fff;-moz-box-shadow:0 0 1px 1px #fff;-webkit-box-shadow:0 0 1px 1px #fff;box-shadow:0 0 1px 1px #fff}.LESSbutton_inner_box_style{background:#f7f5ee;background:-webkit-linear-gradient(top, #faf7f2, #f8f5f0);background:-ms-linear-gradient(top, #faf7f2, #f8f5f0);background:-o-linear-gradient(top, #faf7f2, #f8f5f0);background:-moz-linear-gradient(top, #faf7f2, #f8f5f0);-o-box-shadow:none;-ms-box-shadow:none;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none}.LESSbutton_inner_pressstyle{color:#f8f6ef}.LESSbutton_text1_style{font-family:Helvetica,Arial,sans-serif;font-weight:400;font-size:1.0rem;font-style:normal;color:#000}.LESSbutton_hover_style{color:#363133}.LESSbutton_down_style{background:#3b73b6;color:#f8f6ef}.LESSbutton_edit_style{background:#c95858;background:-webkit-gradient(linear,left top,left bottom,from( #c95858),to( #a12828));background:-moz_linear-gradient(top, #c95858, #a12828)}.LESSDayselectorButtonNormal{background:#7e9db2;background:-webkit-linear-gradient(top, #7e9db2 0, #547990 100%);background:-moz-linear-gradient(top, #7e9db2 0, #547990 100%);background:-ms-linear-gradient(top, #7e9db2 0, #547990 100%);background:-o-linear-gradient(top, #7e9db2 0, #547990 100%);background:linear-gradient(top, #7e9db2 0, #547990 100%)}.LESSDayaselectorButtonPress{background:#3b7796;background:-webkit-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-moz-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-ms-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-o-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:linear-gradient(top, #3b7796 0, #2f5b75 100%)}.LESSpopup_button_style{}.LESSpopup_button_hover_style{background:#5e88a3}.LESSpopup_button_press_style{background:#43a0d9;background:-webkit-gradient(linear,left top,left bottom,from( #43a0d9),to( #388bb9));background:-moz-linear-gradient(top, #43a0d9, #388bb9);background:-ms-linear-gradient(top, #43a0d9, #388bb9);background:-o-linear-gradient(top, #43a0d9, #388bb9)}.LESStoggleswitch_on_style{background:#2a7eac;background:-webkit-gradient(linear,left top,left bottom,from( #2174a7),to( #4ba5db));background:-moz-linear-gradient(top, #2174a7, #4ba5db);border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px}.LESStoggleswitch_off_style{color:#cbcbcb;background:#97a1a7;background:-webkit-gradient(linear,left top,left bottom,from( #727272),to( #8d8d8d));background:-moz-linear-gradient(top, #727272, #8d8d8d);border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px}.LESStoggleswitch_reed_style{background:#fdfdfd;background:-webkit-gradient(linear,left top,left bottom,from( #fdfdfd),to( #e7e7e7));background:-moz-linear-gradient(top, #fdfdfd, #e7e7e7);border-radius:2px;-webkit-border-radius:2px;-moz-border-radius:2px}.LESSbutton_editpress_style{background:#931818;background:-webkit-gradient(linear,left top,left bottom,from( #931818),to( #6e1717));background:-moz-linear-gradient(top, #931818, #6e1717)}.LESSbutton_edit_padding{padding:.5em .8em}.LESSmultimediaview_bar_active_style{background-color:#4a84c9;background-image:-webkit-gradient(linear,left top,left bottom,from( #6289d9),to( #295b98));background-image:-moz-linear-gradient(top, #6289d9, #295b98);background-image:-o-linear-gradient(top, #6289d9, #295b98);background-image:-ms-linear-gradient(top, #6289d9, #295b98)}.LESSmultimediaview_bar_handle_style{background-color:#f9f9f9;background-image:-webkit-gradient(linear,left top,left bottom,from( #fff),to( #e6e6e6));background-image:-moz-linear-gradient(top, #fff, #e6e6e6);background-image:-o-linear-gradient(top, #fff, #e6e6e6);background-image:-ms-linear-gradient(top, #fff, #e6e6e6)}.ui-handler{position:absolute;overflow:hidden;opacity:0}.ui-handler-visible{opacity:1}.ui-handler-direction-y{top:.2272727272727273rem;right:.2272727272727273rem;bottom:.2272727272727273rem;width:1.0909090909090908rem}.ui-handler-direction-x{right:.2272727272727273rem;bottom:.2272727272727273rem;left:.2272727272727273rem;height:1.0909090909090908rem}.ui-handler-track{position:relative;width:100%;height:100%}.ui-handler-thumb{position:absolute;top:0;left:0;background-position:center;background-repeat:no-repeat;-o-border-radius:.11363636363636365rem;-ms-border-radius:.11363636363636365rem;-moz-border-radius:.11363636363636365rem;-webkit-border-radius:.11363636363636365rem;border-radius:.11363636363636365rem}.ui-handler-direction-y .ui-handler-thumb{width:1.0909090909090908rem;height:4.863636363636364rem;background-size:1.0909090909090908rem .9090909090909092rem}.ui-handler-direction-x .ui-handler-thumb{width:4.863636363636364rem;height:1.0909090909090908rem;background-size:.9090909090909092rem 1.0909090909090908rem}.ui-handler-s .ui-handler-thumb{background-color:rgba(150,150,150,.5)}.ui-handler-s .ui-handler-direction-y .ui-handler-thumb{background-image:url("images/00_scroll_bar_handler.png")}.ui-handler-s .ui-handler-direction-x .ui-handler-thumb{background-image:url("images/00_scroll_bar_handler_hor.png")}.LESSbutton_box_style{color:#363133}.LESSbutton_up_style{background:#ebe8e3;background:-webkit-linear-gradient(top, #ebe8e3, #eae7e2);background:-moz-linear-gradient(top, #ebe8e3, #eae7e2);background:-o-linear-gradient(top, #ebe8e3, #eae7e2);background:-ms-linear-gradient(top, #ebe8e3, #eae7e2)}.LESSbutton_box_style{background:#ebe8e3;background:-webkit-linear-gradient(top, #ebe8e3, #eae7e2);background:-moz-linear-gradient(top, #ebe8e3, #eae7e2);background:-o-linear-gradient(top, #ebe8e3, #eae7e2);background:-ms-linear-gradient(top, #ebe8e3, #eae7e2);border:1px solid;border-color:#dcdad3;-o-box-shadow:0 0 1px 1px #fff;-ms-box-shadow:0 0 1px 1px #fff;-moz-box-shadow:0 0 1px 1px #fff;-webkit-box-shadow:0 0 1px 1px #fff;box-shadow:0 0 1px 1px #fff}.LESSbutton_inner_box_style{background:#f7f5ee;background:-webkit-linear-gradient(top, #faf7f2, #f8f5f0);background:-ms-linear-gradient(top, #faf7f2, #f8f5f0);background:-o-linear-gradient(top, #faf7f2, #f8f5f0);background:-moz-linear-gradient(top, #faf7f2, #f8f5f0);-o-box-shadow:none;-ms-box-shadow:none;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none}.LESSbutton_inner_pressstyle{color:#f8f6ef}.LESSbutton_text1_style{font-family:Helvetica,Arial,sans-serif;font-weight:400;font-size:1.0rem;font-style:normal;color:#000}.LESSbutton_hover_style{color:#363133}.LESSbutton_down_style{background:#3b73b6;color:#f8f6ef}.LESSbutton_edit_style{background:#c95858;background:-webkit-gradient(linear,left top,left bottom,from( #c95858),to( #a12828));background:-moz_linear-gradient(top, #c95858, #a12828)}.LESSDayselectorButtonNormal{background:#7e9db2;background:-webkit-linear-gradient(top, #7e9db2 0, #547990 100%);background:-moz-linear-gradient(top, #7e9db2 0, #547990 100%);background:-ms-linear-gradient(top, #7e9db2 0, #547990 100%);background:-o-linear-gradient(top, #7e9db2 0, #547990 100%);background:linear-gradient(top, #7e9db2 0, #547990 100%)}.LESSDayaselectorButtonPress{background:#3b7796;background:-webkit-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-moz-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-ms-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-o-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:linear-gradient(top, #3b7796 0, #2f5b75 100%)}.LESSpopup_button_style{}.LESSpopup_button_hover_style{background:#5e88a3}.LESSpopup_button_press_style{background:#43a0d9;background:-webkit-gradient(linear,left top,left bottom,from( #43a0d9),to( #388bb9));background:-moz-linear-gradient(top, #43a0d9, #388bb9);background:-ms-linear-gradient(top, #43a0d9, #388bb9);background:-o-linear-gradient(top, #43a0d9, #388bb9)}.LESStoggleswitch_on_style{background:#2a7eac;background:-webkit-gradient(linear,left top,left bottom,from( #2174a7),to( #4ba5db));background:-moz-linear-gradient(top, #2174a7, #4ba5db);border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px}.LESStoggleswitch_off_style{color:#cbcbcb;background:#97a1a7;background:-webkit-gradient(linear,left top,left bottom,from( #727272),to( #8d8d8d));background:-moz-linear-gradient(top, #727272, #8d8d8d);border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px}.LESStoggleswitch_reed_style{background:#fdfdfd;background:-webkit-gradient(linear,left top,left bottom,from( #fdfdfd),to( #e7e7e7));background:-moz-linear-gradient(top, #fdfdfd, #e7e7e7);border-radius:2px;-webkit-border-radius:2px;-moz-border-radius:2px}.LESSbutton_editpress_style{background:#931818;background:-webkit-gradient(linear,left top,left bottom,from( #931818),to( #6e1717));background:-moz-linear-gradient(top, #931818, #6e1717)}.LESSbutton_edit_padding{padding:.5em .8em}.LESSmultimediaview_bar_active_style{background-color:#4a84c9;background-image:-webkit-gradient(linear,left top,left bottom,from( #6289d9),to( #295b98));background-image:-moz-linear-gradient(top, #6289d9, #295b98);background-image:-o-linear-gradient(top, #6289d9, #295b98);background-image:-ms-linear-gradient(top, #6289d9, #295b98)}.LESSmultimediaview_bar_handle_style{background-color:#f9f9f9;background-image:-webkit-gradient(linear,left top,left bottom,from( #fff),to( #e6e6e6));background-image:-moz-linear-gradient(top, #fff, #e6e6e6);background-image:-o-linear-gradient(top, #fff, #e6e6e6);background-image:-ms-linear-gradient(top, #fff, #e6e6e6)}.ui-virtualgrid{overflow:hidden;position:absolute}.ui-virtualgrid-wrapblock{position:absolute;left:0}.ui-virtualgrid-wrapblock-x{float:left;overflow:hidden}.ui-scrollbar-thumb-x{width:1.5rem!important}.ui-scrollbar-thumb-y{height:1.5rem!important}.LESSbutton_box_style{color:#363133}.LESSbutton_up_style{background:#ebe8e3;background:-webkit-linear-gradient(top, #ebe8e3, #eae7e2);background:-moz-linear-gradient(top, #ebe8e3, #eae7e2);background:-o-linear-gradient(top, #ebe8e3, #eae7e2);background:-ms-linear-gradient(top, #ebe8e3, #eae7e2)}.LESSbutton_box_style{background:#ebe8e3;background:-webkit-linear-gradient(top, #ebe8e3, #eae7e2);background:-moz-linear-gradient(top, #ebe8e3, #eae7e2);background:-o-linear-gradient(top, #ebe8e3, #eae7e2);background:-ms-linear-gradient(top, #ebe8e3, #eae7e2);border:1px solid;border-color:#dcdad3;-o-box-shadow:0 0 1px 1px #fff;-ms-box-shadow:0 0 1px 1px #fff;-moz-box-shadow:0 0 1px 1px #fff;-webkit-box-shadow:0 0 1px 1px #fff;box-shadow:0 0 1px 1px #fff}.LESSbutton_inner_box_style{background:#f7f5ee;background:-webkit-linear-gradient(top, #faf7f2, #f8f5f0);background:-ms-linear-gradient(top, #faf7f2, #f8f5f0);background:-o-linear-gradient(top, #faf7f2, #f8f5f0);background:-moz-linear-gradient(top, #faf7f2, #f8f5f0);-o-box-shadow:none;-ms-box-shadow:none;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none}.LESSbutton_inner_pressstyle{color:#f8f6ef}.LESSbutton_text1_style{font-family:Helvetica,Arial,sans-serif;font-weight:400;font-size:1.0rem;font-style:normal;color:#000}.LESSbutton_hover_style{color:#363133}.LESSbutton_down_style{background:#3b73b6;color:#f8f6ef}.LESSbutton_edit_style{background:#c95858;background:-webkit-gradient(linear,left top,left bottom,from( #c95858),to( #a12828));background:-moz_linear-gradient(top, #c95858, #a12828)}.LESSDayselectorButtonNormal{background:#7e9db2;background:-webkit-linear-gradient(top, #7e9db2 0, #547990 100%);background:-moz-linear-gradient(top, #7e9db2 0, #547990 100%);background:-ms-linear-gradient(top, #7e9db2 0, #547990 100%);background:-o-linear-gradient(top, #7e9db2 0, #547990 100%);background:linear-gradient(top, #7e9db2 0, #547990 100%)}.LESSDayaselectorButtonPress{background:#3b7796;background:-webkit-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-moz-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-ms-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-o-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:linear-gradient(top, #3b7796 0, #2f5b75 100%)}.LESSpopup_button_style{}.LESSpopup_button_hover_style{background:#5e88a3}.LESSpopup_button_press_style{background:#43a0d9;background:-webkit-gradient(linear,left top,left bottom,from( #43a0d9),to( #388bb9));background:-moz-linear-gradient(top, #43a0d9, #388bb9);background:-ms-linear-gradient(top, #43a0d9, #388bb9);background:-o-linear-gradient(top, #43a0d9, #388bb9)}.LESStoggleswitch_on_style{background:#2a7eac;background:-webkit-gradient(linear,left top,left bottom,from( #2174a7),to( #4ba5db));background:-moz-linear-gradient(top, #2174a7, #4ba5db);border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px}.LESStoggleswitch_off_style{color:#cbcbcb;background:#97a1a7;background:-webkit-gradient(linear,left top,left bottom,from( #727272),to( #8d8d8d));background:-moz-linear-gradient(top, #727272, #8d8d8d);border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px}.LESStoggleswitch_reed_style{background:#fdfdfd;background:-webkit-gradient(linear,left top,left bottom,from( #fdfdfd),to( #e7e7e7));background:-moz-linear-gradient(top, #fdfdfd, #e7e7e7);border-radius:2px;-webkit-border-radius:2px;-moz-border-radius:2px}.LESSbutton_editpress_style{background:#931818;background:-webkit-gradient(linear,left top,left bottom,from( #931818),to( #6e1717));background:-moz-linear-gradient(top, #931818, #6e1717)}.LESSbutton_edit_padding{padding:.5em .8em}.LESSmultimediaview_bar_active_style{background-color:#4a84c9;background-image:-webkit-gradient(linear,left top,left bottom,from( #6289d9),to( #295b98));background-image:-moz-linear-gradient(top, #6289d9, #295b98);background-image:-o-linear-gradient(top, #6289d9, #295b98);background-image:-ms-linear-gradient(top, #6289d9, #295b98)}.LESSmultimediaview_bar_handle_style{background-color:#f9f9f9;background-image:-webkit-gradient(linear,left top,left bottom,from( #fff),to( #e6e6e6));background-image:-moz-linear-gradient(top, #fff, #e6e6e6);background-image:-o-linear-gradient(top, #fff, #e6e6e6);background-image:-ms-linear-gradient(top, #fff, #e6e6e6)}.ui-multimediaview{background-color:#f9f9f9;overflow:hidden}.ui-multimediaview-wrap{position:relative;width:100%;margin-top:.7272727272727273rem;margin-bottom:.7272727272727273rem;padding:0;border:0}.ui-multimediaview-fullscreen{position:absolute!important;z-index:1100!important}.ui-multimediaview-control span{display:inline-block}.ui-multimediaview-control{position:relative;display:block;z-index:1101!important;padding:0;margin:0;outline:0;border:0;height:1.9090909090909092rem}.ui-multimediaview-control span.ui-button{background-position:center center;background-size:80%;background-repeat:no-repeat;width:1.6818181818181819rem;height:1.6818181818181819rem;margin:.09090909090909091rem}.ui-multimediaview-control .ui-playpausebutton{float:left}.ui-multimediaview-control .ui-timestamplabel{text-align:center;float:left}.ui-multimediaview-control .ui-timestamplabel p{margin-top:-.22272727272727275rem;margin-left:.09090909090909091rem;padding:0;text-align:center;font-size:.5rem;line-height:.6363636363636364rem;text-align:left}.ui-multimediaview-control .ui-durationlabel{text-align:center;float:right}.ui-multimediaview-control .ui-durationlabel p{margin-top:-.22272727272727275rem;margin-right:.09090909090909091rem;padding:0;text-align:center;font-size:.5rem;line-height:.6363636363636364rem;text-align:right}.ui-multimediaview-control .ui-seekbar{margin-top:.26136363636363635rem;padding-left:.09090909090909091rem;padding-right:.09090909090909091rem;height:.36363636363636365rem;float:left}.ui-multimediaview-control .ui-seekbar .ui-duration{margin:0;padding:0;width:100%;height:.36363636363636365rem;border-radius:1.5em}.ui-multimediaview-control .ui-seekbar .ui-currenttime{margin:0;padding:0;height:.36363636363636365rem;position:absolute;border-radius:1.5em}.ui-multimediaview-control .ui-volumecontrol{width:5rem;height:100%;float:left}.ui-multimediaview-control .ui-volumecontrol .ui-volumebar{height:100%;padding-top:.7954545454545455rem;padding-left:.9090909090909092rem;display:block}.ui-multimediaview-control .ui-volumecontrol .ui-volumebar .ui-guide{width:3.6363636363636367rem;height:.36363636363636365rem;position:absolute;border-radius:1.5em}.ui-multimediaview-control .ui-volumecontrol .ui-volumebar .ui-value{margin:0;padding:0;height:.36363636363636365rem;position:absolute;border-radius:1.5em}.ui-multimediaview-control .ui-volumecontrol .ui-volumebar .ui-handler{margin:0;padding:0;width:.6818181818181819rem;height:.6818181818181819rem;position:absolute;border-style:solid;border-width:1px;border-radius:1.5em}.ui-fullscreen-page{padding:0!important}.ui-multimediaview-s .ui-multimediaview-video{background-color:rgba(248,246,239,.5)}.ui-multimediaview-s .ui-timestamplabel{color:#4a84c9}.ui-multimediaview-s .ui-durationlabel{color:#808080}.ui-multimediaview-s span.ui-button{background-color:#f8f6ef}.ui-multimediaview-s span.ui-play-icon{background-image:url(./images/00_button_play.png)}.ui-multimediaview-s span.ui-pause-icon{background-image:url(./images/00_button_pause.png)}.ui-multimediaview-s span.ui-volume-icon{background-image:url(./images/controls/00_slider_button_volume_02.png)}.ui-multimediaview-s span.ui-mute-icon{background-image:url(./images/controls/00_slider_button_volume_01.png)}.ui-multimediaview-s span.ui-fullscreen-on{background-image:url(./images/00_button_fullscreen_on.png)}.ui-multimediaview-s span.ui-fullscreen-off{background-image:url(./images/00_button_fullscreen_off.png)}.ui-multimediaview-s .ui-seekbar .ui-duration{background-color:#cbc8c5}.ui-multimediaview-s .ui-seekbar .ui-currenttime{background-color:#4a84c9;background-image:-webkit-gradient(linear,left top,left bottom,from( #6289d9),to( #295b98));background-image:-moz-linear-gradient(top, #6289d9, #295b98);background-image:-o-linear-gradient(top, #6289d9, #295b98);background-image:-ms-linear-gradient(top, #6289d9, #295b98)}.ui-multimediaview-s .ui-volumebar .ui-guide{background-color:#cbc8c5}.ui-multimediaview-s .ui-volumebar .ui-value{background-color:#4a84c9;background-image:-webkit-gradient(linear,left top,left bottom,from( #6289d9),to( #295b98));background-image:-moz-linear-gradient(top, #6289d9, #295b98);background-image:-o-linear-gradient(top, #6289d9, #295b98);background-image:-ms-linear-gradient(top, #6289d9, #295b98)}.ui-multimediaview-s .ui-volumebar .ui-handler{background-color:#f9f9f9;background-image:-webkit-gradient(linear,left top,left bottom,from( #fff),to( #e6e6e6));background-image:-moz-linear-gradient(top, #fff, #e6e6e6);background-image:-o-linear-gradient(top, #fff, #e6e6e6);background-image:-ms-linear-gradient(top, #fff, #e6e6e6);border-color:#bab9b4}.ui-popup-screen{top:0;left:0;width:100%;height:100%;border:0;position:absolute;filter:Alpha(Opacity=50);opacity:0}.ui-popup-screen-background-hack{background-color:#000;filter:Alpha(Opacity=0)}@-webkit-keyframes popup-fadein{from{ opacity:0}to{opacity:.5}}@-moz-keyframes popup-fadein{from{ opacity:0}to{opacity:.5}}@-webkit-keyframes popup-fadeout{from{ opacity:.5}to{opacity:0}}@-moz-keyframes popup-fadeout{from{ opacity:.5}to{opacity:0}}.ui-popup-screen.fade.in{opacity:.5;-webkit-animation-name:popup-fadein;-moz-animation-name:popup-fadein}.ui-popup-screen.fade.out{opacity:0;-webkit-animation-name:popup-fadeout;-moz-animation-name:popup-fadeout}.ui-popup.ui-content,.ui-popup .ui-content{overflow:visible}.ui-popup>img{width:auto;height:auto;max-width:100%;max-height:100%;vertical-align:middle}.ui-popup iframe{vertical-align:middle}@media all and (min-width: 450px){.ui-popup .ui-field-contain label.ui-submit,.ui-popup .ui-field-contain .ui-controlgroup-label,.ui-popup .ui-field-contain label.ui-select,.ui-popup .ui-field-contain label.ui-input-text{ font-size:16px;line-height:1.4;display:block;font-weight:400;margin:0 0 .3em}.ui-popup .ui-field-contain .ui-btn.ui-submit,.ui-popup .ui-field-contain .ui-controlgroup-controls,.ui-popup .ui-field-contain .ui-select,.ui-popup .ui-field-contain input.ui-input-text,.ui-popup .ui-field-contain textarea.ui-input-text,.ui-popup .ui-field-contain .ui-input-search{width:100%;display:block}}.ui-popup>.ui-btn-left,.ui-popup>.ui-btn-right{position:absolute;top:-9px;margin:0;z-index:1101}.ui-popup>.ui-btn-left{left:-9px}.ui-popup>.ui-btn-right{right:-9px}.LESSbutton_box_style{color:#363133}.LESSbutton_up_style{background:#ebe8e3;background:-webkit-linear-gradient(top, #ebe8e3, #eae7e2);background:-moz-linear-gradient(top, #ebe8e3, #eae7e2);background:-o-linear-gradient(top, #ebe8e3, #eae7e2);background:-ms-linear-gradient(top, #ebe8e3, #eae7e2)}.LESSbutton_box_style{background:#ebe8e3;background:-webkit-linear-gradient(top, #ebe8e3, #eae7e2);background:-moz-linear-gradient(top, #ebe8e3, #eae7e2);background:-o-linear-gradient(top, #ebe8e3, #eae7e2);background:-ms-linear-gradient(top, #ebe8e3, #eae7e2);border:1px solid;border-color:#dcdad3;-o-box-shadow:0 0 1px 1px #fff;-ms-box-shadow:0 0 1px 1px #fff;-moz-box-shadow:0 0 1px 1px #fff;-webkit-box-shadow:0 0 1px 1px #fff;box-shadow:0 0 1px 1px #fff}.LESSbutton_inner_box_style{background:#f7f5ee;background:-webkit-linear-gradient(top, #faf7f2, #f8f5f0);background:-ms-linear-gradient(top, #faf7f2, #f8f5f0);background:-o-linear-gradient(top, #faf7f2, #f8f5f0);background:-moz-linear-gradient(top, #faf7f2, #f8f5f0);-o-box-shadow:none;-ms-box-shadow:none;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none}.LESSbutton_inner_pressstyle{color:#f8f6ef}.LESSbutton_text1_style{font-family:Helvetica,Arial,sans-serif;font-weight:400;font-size:1.0rem;font-style:normal;color:#000}.LESSbutton_hover_style{color:#363133}.LESSbutton_down_style{background:#3b73b6;color:#f8f6ef}.LESSbutton_edit_style{background:#c95858;background:-webkit-gradient(linear,left top,left bottom,from( #c95858),to( #a12828));background:-moz_linear-gradient(top, #c95858, #a12828)}.LESSDayselectorButtonNormal{background:#7e9db2;background:-webkit-linear-gradient(top, #7e9db2 0, #547990 100%);background:-moz-linear-gradient(top, #7e9db2 0, #547990 100%);background:-ms-linear-gradient(top, #7e9db2 0, #547990 100%);background:-o-linear-gradient(top, #7e9db2 0, #547990 100%);background:linear-gradient(top, #7e9db2 0, #547990 100%)}.LESSDayaselectorButtonPress{background:#3b7796;background:-webkit-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-moz-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-ms-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-o-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:linear-gradient(top, #3b7796 0, #2f5b75 100%)}.LESSpopup_button_style{}.LESSpopup_button_hover_style{background:#5e88a3}.LESSpopup_button_press_style{background:#43a0d9;background:-webkit-gradient(linear,left top,left bottom,from( #43a0d9),to( #388bb9));background:-moz-linear-gradient(top, #43a0d9, #388bb9);background:-ms-linear-gradient(top, #43a0d9, #388bb9);background:-o-linear-gradient(top, #43a0d9, #388bb9)}.LESStoggleswitch_on_style{background:#2a7eac;background:-webkit-gradient(linear,left top,left bottom,from( #2174a7),to( #4ba5db));background:-moz-linear-gradient(top, #2174a7, #4ba5db);border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px}.LESStoggleswitch_off_style{color:#cbcbcb;background:#97a1a7;background:-webkit-gradient(linear,left top,left bottom,from( #727272),to( #8d8d8d));background:-moz-linear-gradient(top, #727272, #8d8d8d);border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px}.LESStoggleswitch_reed_style{background:#fdfdfd;background:-webkit-gradient(linear,left top,left bottom,from( #fdfdfd),to( #e7e7e7));background:-moz-linear-gradient(top, #fdfdfd, #e7e7e7);border-radius:2px;-webkit-border-radius:2px;-moz-border-radius:2px}.LESSbutton_editpress_style{background:#931818;background:-webkit-gradient(linear,left top,left bottom,from( #931818),to( #6e1717));background:-moz-linear-gradient(top, #931818, #6e1717)}.LESSbutton_edit_padding{padding:.5em .8em}.LESSmultimediaview_bar_active_style{background-color:#4a84c9;background-image:-webkit-gradient(linear,left top,left bottom,from( #6289d9),to( #295b98));background-image:-moz-linear-gradient(top, #6289d9, #295b98);background-image:-o-linear-gradient(top, #6289d9, #295b98);background-image:-ms-linear-gradient(top, #6289d9, #295b98)}.LESSmultimediaview_bar_handle_style{background-color:#f9f9f9;background-image:-webkit-gradient(linear,left top,left bottom,from( #fff),to( #e6e6e6));background-image:-moz-linear-gradient(top, #fff, #e6e6e6);background-image:-o-linear-gradient(top, #fff, #e6e6e6);background-image:-ms-linear-gradient(top, #fff, #e6e6e6)}.ui-popup-screen{background:#000;opacity:0;position:absolute;top:0;left:0;width:100%;height:100%;z-index:1200}.ui-popup-scroller-bg{width:100%}.ui-popup-container{position:absolute;width:86.12%;z-index:1201!important;background:#f8f6ef;text-align:center;outline-color:#f8f6ef;display:-moz-box;display:-webkit-box;display:box;-ms-box-orient:vertical;-moz-box-orient:vertical;-o-box-orient:vertical;-webkit-box-orient:vertical;box-orient:vertical;-ms-box-align:center;-moz-box-align:center;-o-box-align:center;-webkit-box-align:center;box-align:center;-ms-box-pack:center;-moz-box-pack:center;-o-box-pack:center;-webkit-box-pack:center;box-pack:center}.ui-popup-container .ui-popup{padding:3px 2px 2px 2px;background:#f8f6ef;width:100%}.ui-popup-container .ui-popup>.ui-popup-title,.ui-popup-container .ui-popup>.ui-popup-text,.ui-popup-container .ui-popup>.ui-popup-button-bg{width:100%}.ui-popup-container .ui-popup-title{width:100%;height:1.8181818181818183rem;text-align:left;color:#3b73b6;font-size:1.0909090909090908rem;font-weight:700}.ui-popup-container .ui-popup-title h1{font-size:1.0909090909090908rem;font-weight:700;color:#3b73b6;margin:0;padding-top:.4545454545454546rem;padding-left:.7272727272727273rem}.ui-popup-container .ui-popup-text{margin-top:1rem;margin-bottom:1rem;color:#000;font-size:.9090909090909092rem;background:#f8f6ef;text-align:center}.ui-popup-container .ui-popup-text .ui-li .ui-radio label,.ui-popup-container .ui-popup-text .ui-li .ui-checkbox label{background:transparent}.ui-popup-container .ui-popup-button-bg{font-size:1.4545454545454546rem;height:1.6818181818181819rem;padding-top:.4545454545454546rem;padding-bottom:.4545454545454546rem;width:100%;vertical-align:middle}.ui-popup-container .ui-popup-button-bg>.ui-btn{display:inline-block;margin:auto;height:1.6818181818181819rem}.ui-popup-container .ui-popup-button-bg .ui-btn-inner{padding-top:.2272727272727273rem;padding-bottom:.2272727272727273rem;padding-left:.9090909090909092rem;padding-right:.9090909090909092rem}.ui-popup-container .center_basic_3btn .ui-btn,.ui-popup-container .center_title_3btn .ui-btn{max-width:3.6363636363636367rem;height:1.6818181818181819rem;margin-top:0rem;margin-bottom:0rem;margin-left:.2272727272727273rem;margin-right:.2272727272727273rem;display:inline-block}.ui-popup-container .center_button_vertical .ui-popup-button-bg{display:block;height:auto}.ui-popup-container .center_button_vertical .ui-popup-button-bg>.ui-btn{display:block;width:9.090909090909092rem}.ui-popup-container .center_checkbox .ui-popup-check-bg{font-size:.9090909090909092rem;background:#f8f6ef;width:100%;padding-top:0rem;padding-bottom:1rem;vertical-align:middle}.ui-popup-container .center_checkbox .ui-popup-check-bg .ui-checkbox .ui-btn{text-align:center;background:#f8f6ef;border:0rem}.ui-popup-container .center_checkbox .ui-popup-check-bg .ui-checkbox .ui-btn .ui-btn-inner{border:0rem}.ui-popup-container .center_checkbox .ui-popup-button-bg{font-size:1.4545454545454546rem;background:#f8f6ef;width:100%;padding-top:.5rem;padding-bottom:.5rem;vertical-align:middle}.ui-popup-container .center_checkbox .ui-popup-button-bg .ui-btn{width:5.909090909090909rem;height:1.6818181818181819rem;margin-top:0rem;margin-bottom:0rem;margin-left:.2272727272727273rem;margin-right:.2272727272727273rem;display:inline-block}.ui-popup-container .center_liststyle_1btn .ui-popup-scroller-bg{width:100%;overflow:hidden;background:#f8f6ef;height:11.636363636363637rem}.ui-popup-container .center_liststyle_1btn .ui-popup-button-bg{padding-top:.5rem;padding-bottom:.5rem;vertical-align:middle}.ui-popup-container .center_liststyle_2btn .ui-popup-scroller-bg{width:100%;overflow:hidden;background:#f8f6ef;height:11.636363636363637rem}.ui-popup-container .center_liststyle_2btn .ui-popup-button-bg{padding-top:.5rem;padding-bottom:.5rem;vertical-align:middle}.ui-popup-container .center_liststyle_2btn .ui-popup-button-bg .ui-btn{width:5.909090909090909rem;height:1.6818181818181819rem;margin-top:0rem;margin-bottom:0rem;margin-left:.2272727272727273rem;margin-right:.2272727272727273rem;display:inline-block}.ui-popup-container .center_liststyle_2btn .ui-popup-button-bg .ui-btn .ui-btn-inner{padding-top:.2272727272727273rem;padding-bottom:.2272727272727273rem;padding-left:.9090909090909092rem;padding-right:.9090909090909092rem}.ui-popup-container .center_title_2btn .ui-popup-button-bg .ui-btn{width:5.909090909090909rem}.ui-popup-container .center_liststyle_3btn .ui-popup-scroller-bg{width:100%;overflow:hidden;background:#f8f6ef;height:11.636363636363637rem}.ui-popup-container .center_liststyle_3btn .ui-popup-button-bg{padding-top:.5rem;padding-bottom:.5rem;vertical-align:middle}.ui-popup-container .center_liststyle_3btn .ui-popup-button-bg .ui-btn{max-width:3.6363636363636367rem;height:1.6818181818181819rem;margin-top:0rem;margin-bottom:0rem;margin-left:.2272727272727273rem;margin-right:.2272727272727273rem;display:inline-block}.ui-popup-container .center_progressbar{text-align:center}.ui-popup-container .center_progressbar .ui-popup-text{font-size:1.1818181818181819rem;font-color:#999;background:#f8f6ef;width:100%;height:3.181818181818182rem}.ui-popup-container .center_progressbar .ui-popup-text p{height:100%;text-align:center;padding:1rem .7272727272727273rem 0rem .7272727272727273rem}.ui-popup-container .center_progressbar .ui-popup-text-bottom-bg{font-size:1.1818181818181819rem;font-color:#999;background:#f8f6ef;width:100%;vertical-align:middle}.ui-popup-container .center_progressbar .ui-popup-text-bottom-bg .text-left{width:40%;height:2.1818181818181817rem;padding:0rem .7272727272727273rem 0rem .7272727272727273rem;text-align:left;display:inline-block}.ui-popup-container .center_progressbar .ui-popup-text-bottom-bg .text-right{width:40%;height:2.1818181818181817rem;padding:0rem .7272727272727273rem 0rem .7272727272727273rem;text-align:right;display:inline-block}.ui-popup-container .center_progressbar .ui-popup-button-bg{font-size:1.4545454545454546rem;background:#f8f6ef;width:100%;padding-top:.5rem;padding-bottom:.5rem;vertical-align:middle}.ui-popup-container .center_progressbar .ui-popup-button-bg .ui-btn{width:9.136363636363637rem;height:1.6818181818181819rem;margin:auto}.ui-popup-container .center_progressbar .ui-popup-progress-bg{background:#f8f6ef;width:100%;height:100%}.ui-popup-container .centertext_progressbar{text-align:center}.ui-popup-container .centertext_progressbar .ui-popup-text{font-size:1.1818181818181819rem;font-color:#999;background:#f8f6ef;width:100%;padding-top:1rem;padding-bottom:.7272727272727273rem}.ui-popup-container .centertext_progressbar .ui-popup-text p{text-align:center}.ui-popup-container .centertext_progressbar .ui-popup-text-bottom-bg{font-size:1.1818181818181819rem;font-color:#999;background:#f8f6ef;width:100%;vertical-align:middle}.ui-popup-container .centertext_progressbar .ui-popup-text-bottom-bg .text-left{width:40%;height:1.8181818181818183rem;padding:.7272727272727273rem .7272727272727273rem 1rem .7272727272727273rem;text-align:left;display:inline-block}.ui-popup-container .centertext_progressbar .ui-popup-text-bottom-bg .text-right{width:40%;height:1.8181818181818183rem;padding:.7272727272727273rem .7272727272727273rem 1rem .7272727272727273rem;text-align:right;display:inline-block}.ui-popup-container .centertext_progressbar .ui-popup-button-bg{font-size:1.4545454545454546rem;background:#f8f6ef;width:100%;padding-top:.5rem;padding-bottom:.5rem;vertical-align:middle}.ui-popup-container .centertext_progressbar .ui-popup-button-bg .ui-btn{width:18.272727272727273rem;height:1.6818181818181819rem;margin:auto}.ui-popup-container .centertext_progressbar .ui-popup-progress-bg{background:#f8f6ef;width:100%;height:100%}.LESSbutton_box_style{color:#363133}.LESSbutton_up_style{background:#ebe8e3;background:-webkit-linear-gradient(top, #ebe8e3, #eae7e2);background:-moz-linear-gradient(top, #ebe8e3, #eae7e2);background:-o-linear-gradient(top, #ebe8e3, #eae7e2);background:-ms-linear-gradient(top, #ebe8e3, #eae7e2)}.LESSbutton_box_style{background:#ebe8e3;background:-webkit-linear-gradient(top, #ebe8e3, #eae7e2);background:-moz-linear-gradient(top, #ebe8e3, #eae7e2);background:-o-linear-gradient(top, #ebe8e3, #eae7e2);background:-ms-linear-gradient(top, #ebe8e3, #eae7e2);border:1px solid;border-color:#dcdad3;-o-box-shadow:0 0 1px 1px #fff;-ms-box-shadow:0 0 1px 1px #fff;-moz-box-shadow:0 0 1px 1px #fff;-webkit-box-shadow:0 0 1px 1px #fff;box-shadow:0 0 1px 1px #fff}.LESSbutton_inner_box_style{background:#f7f5ee;background:-webkit-linear-gradient(top, #faf7f2, #f8f5f0);background:-ms-linear-gradient(top, #faf7f2, #f8f5f0);background:-o-linear-gradient(top, #faf7f2, #f8f5f0);background:-moz-linear-gradient(top, #faf7f2, #f8f5f0);-o-box-shadow:none;-ms-box-shadow:none;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none}.LESSbutton_inner_pressstyle{color:#f8f6ef}.LESSbutton_text1_style{font-family:Helvetica,Arial,sans-serif;font-weight:400;font-size:1.0rem;font-style:normal;color:#000}.LESSbutton_hover_style{color:#363133}.LESSbutton_down_style{background:#3b73b6;color:#f8f6ef}.LESSbutton_edit_style{background:#c95858;background:-webkit-gradient(linear,left top,left bottom,from( #c95858),to( #a12828));background:-moz_linear-gradient(top, #c95858, #a12828)}.LESSDayselectorButtonNormal{background:#7e9db2;background:-webkit-linear-gradient(top, #7e9db2 0, #547990 100%);background:-moz-linear-gradient(top, #7e9db2 0, #547990 100%);background:-ms-linear-gradient(top, #7e9db2 0, #547990 100%);background:-o-linear-gradient(top, #7e9db2 0, #547990 100%);background:linear-gradient(top, #7e9db2 0, #547990 100%)}.LESSDayaselectorButtonPress{background:#3b7796;background:-webkit-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-moz-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-ms-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-o-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:linear-gradient(top, #3b7796 0, #2f5b75 100%)}.LESSpopup_button_style{}.LESSpopup_button_hover_style{background:#5e88a3}.LESSpopup_button_press_style{background:#43a0d9;background:-webkit-gradient(linear,left top,left bottom,from( #43a0d9),to( #388bb9));background:-moz-linear-gradient(top, #43a0d9, #388bb9);background:-ms-linear-gradient(top, #43a0d9, #388bb9);background:-o-linear-gradient(top, #43a0d9, #388bb9)}.LESStoggleswitch_on_style{background:#2a7eac;background:-webkit-gradient(linear,left top,left bottom,from( #2174a7),to( #4ba5db));background:-moz-linear-gradient(top, #2174a7, #4ba5db);border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px}.LESStoggleswitch_off_style{color:#cbcbcb;background:#97a1a7;background:-webkit-gradient(linear,left top,left bottom,from( #727272),to( #8d8d8d));background:-moz-linear-gradient(top, #727272, #8d8d8d);border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px}.LESStoggleswitch_reed_style{background:#fdfdfd;background:-webkit-gradient(linear,left top,left bottom,from( #fdfdfd),to( #e7e7e7));background:-moz-linear-gradient(top, #fdfdfd, #e7e7e7);border-radius:2px;-webkit-border-radius:2px;-moz-border-radius:2px}.LESSbutton_editpress_style{background:#931818;background:-webkit-gradient(linear,left top,left bottom,from( #931818),to( #6e1717));background:-moz-linear-gradient(top, #931818, #6e1717)}.LESSbutton_edit_padding{padding:.5em .8em}.LESSmultimediaview_bar_active_style{background-color:#4a84c9;background-image:-webkit-gradient(linear,left top,left bottom,from( #6289d9),to( #295b98));background-image:-moz-linear-gradient(top, #6289d9, #295b98);background-image:-o-linear-gradient(top, #6289d9, #295b98);background-image:-ms-linear-gradient(top, #6289d9, #295b98)}.LESSmultimediaview_bar_handle_style{background-color:#f9f9f9;background-image:-webkit-gradient(linear,left top,left bottom,from( #fff),to( #e6e6e6));background-image:-moz-linear-gradient(top, #fff, #e6e6e6);background-image:-o-linear-gradient(top, #fff, #e6e6e6);background-image:-ms-linear-gradient(top, #fff, #e6e6e6)}.ui-text-ellipsis{white-space:nowrap;text-overflow:ellipsis;-o-text-overflow:ellipsis;overflow:hidden!important}.LESSbutton_box_style{color:#363133}.LESSbutton_up_style{background:#ebe8e3;background:-webkit-linear-gradient(top, #ebe8e3, #eae7e2);background:-moz-linear-gradient(top, #ebe8e3, #eae7e2);background:-o-linear-gradient(top, #ebe8e3, #eae7e2);background:-ms-linear-gradient(top, #ebe8e3, #eae7e2)}.LESSbutton_box_style{background:#ebe8e3;background:-webkit-linear-gradient(top, #ebe8e3, #eae7e2);background:-moz-linear-gradient(top, #ebe8e3, #eae7e2);background:-o-linear-gradient(top, #ebe8e3, #eae7e2);background:-ms-linear-gradient(top, #ebe8e3, #eae7e2);border:1px solid;border-color:#dcdad3;-o-box-shadow:0 0 1px 1px #fff;-ms-box-shadow:0 0 1px 1px #fff;-moz-box-shadow:0 0 1px 1px #fff;-webkit-box-shadow:0 0 1px 1px #fff;box-shadow:0 0 1px 1px #fff}.LESSbutton_inner_box_style{background:#f7f5ee;background:-webkit-linear-gradient(top, #faf7f2, #f8f5f0);background:-ms-linear-gradient(top, #faf7f2, #f8f5f0);background:-o-linear-gradient(top, #faf7f2, #f8f5f0);background:-moz-linear-gradient(top, #faf7f2, #f8f5f0);-o-box-shadow:none;-ms-box-shadow:none;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none}.LESSbutton_inner_pressstyle{color:#f8f6ef}.LESSbutton_text1_style{font-family:Helvetica,Arial,sans-serif;font-weight:400;font-size:1.0rem;font-style:normal;color:#000}.LESSbutton_hover_style{color:#363133}.LESSbutton_down_style{background:#3b73b6;color:#f8f6ef}.LESSbutton_edit_style{background:#c95858;background:-webkit-gradient(linear,left top,left bottom,from( #c95858),to( #a12828));background:-moz_linear-gradient(top, #c95858, #a12828)}.LESSDayselectorButtonNormal{background:#7e9db2;background:-webkit-linear-gradient(top, #7e9db2 0, #547990 100%);background:-moz-linear-gradient(top, #7e9db2 0, #547990 100%);background:-ms-linear-gradient(top, #7e9db2 0, #547990 100%);background:-o-linear-gradient(top, #7e9db2 0, #547990 100%);background:linear-gradient(top, #7e9db2 0, #547990 100%)}.LESSDayaselectorButtonPress{background:#3b7796;background:-webkit-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-moz-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-ms-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:-o-linear-gradient(top, #3b7796 0, #2f5b75 100%);background:linear-gradient(top, #3b7796 0, #2f5b75 100%)}.LESSpopup_button_style{}.LESSpopup_button_hover_style{background:#5e88a3}.LESSpopup_button_press_style{background:#43a0d9;background:-webkit-gradient(linear,left top,left bottom,from( #43a0d9),to( #388bb9));background:-moz-linear-gradient(top, #43a0d9, #388bb9);background:-ms-linear-gradient(top, #43a0d9, #388bb9);background:-o-linear-gradient(top, #43a0d9, #388bb9)}.LESStoggleswitch_on_style{background:#2a7eac;background:-webkit-gradient(linear,left top,left bottom,from( #2174a7),to( #4ba5db));background:-moz-linear-gradient(top, #2174a7, #4ba5db);border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px}.LESStoggleswitch_off_style{color:#cbcbcb;background:#97a1a7;background:-webkit-gradient(linear,left top,left bottom,from( #727272),to( #8d8d8d));background:-moz-linear-gradient(top, #727272, #8d8d8d);border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px}.LESStoggleswitch_reed_style{background:#fdfdfd;background:-webkit-gradient(linear,left top,left bottom,from( #fdfdfd),to( #e7e7e7));background:-moz-linear-gradient(top, #fdfdfd, #e7e7e7);border-radius:2px;-webkit-border-radius:2px;-moz-border-radius:2px}.LESSbutton_editpress_style{background:#931818;background:-webkit-gradient(linear,left top,left bottom,from( #931818),to( #6e1717));background:-moz-linear-gradient(top, #931818, #6e1717)}.LESSbutton_edit_padding{padding:.5em .8em}.LESSmultimediaview_bar_active_style{background-color:#4a84c9;background-image:-webkit-gradient(linear,left top,left bottom,from( #6289d9),to( #295b98));background-image:-moz-linear-gradient(top, #6289d9, #295b98);background-image:-o-linear-gradient(top, #6289d9, #295b98);background-image:-ms-linear-gradient(top, #6289d9, #295b98)}.LESSmultimediaview_bar_handle_style{background-color:#f9f9f9;background-image:-webkit-gradient(linear,left top,left bottom,from( #fff),to( #e6e6e6));background-image:-moz-linear-gradient(top, #fff, #e6e6e6);background-image:-o-linear-gradient(top, #fff, #e6e6e6);background-image:-ms-linear-gradient(top, #fff, #e6e6e6)}.ui-tabbar{background:#f8f6ef;z-index:1000}.ui-tabbar.ui-portrait-tabbar{}.ui-tabbar.ui-landscape-tabbar{}.ui-tabbar a.ui-btn{background:#f8f6ef;color:#999;padding-top:.8636363636363636rem;padding-bottom:.8636363636363636rem}.ui-tabbar a.ui-btn .ui-btn-inner{padding-top:0;padding-bottom:0;border-left:1px solid;border-color:#c0c0c0;border-radius:0;-0-border-radius:0;-ms-border-radius:0;-webkit-border-radius:0}.ui-tabbar a.ui-btn .ui-icon{width:1.4545454545454546rem;height:1.4545454545454546rem;background-repeat:no-repeat;background-size:100% 100%}.ui-tabbar.ui-tabbar-persist a.ui-btn{background:#f8f6ef}.ui-tabbar.ui-tabbar-persist a.ui-state-persist,.ui-tabbar.ui-tabbar-persist a.ui-state-persist.ui-btn-active,.ui-tabbar.ui-tabbar-persist a.ui-btn-show-style{color:#3b73b6}.ui-tabbar.ui-tabbar-persist a.ui-btn-hover-s.ui-btn-down-s:not(.ui-state-persist){color:#3b73b6;background:-webkit-linear-gradient(top, #d2d2c8 0, #f6f8ef 100%)}.ui-tabbar:not(.ui-tabbar-persist) a.ui-btn{background:#f8f6ef}.ui-tabbar:not(.ui-tabbar-persist) a.ui-btn-active,.ui-tabbar:not(.ui-tabbar-persist) .ui-btn-show-style{color:#3b73b6}.ui-tabbar:not(.ui-tabbar-persist) a.ui-btn.ui-btn-hover-s.ui-btn-down-s{color:#3b73b6;background:-webkit-linear-gradient(top, #d2d2c8 0, #f6f8ef 100%)}.ui-tabbar .ui-btn-inner{font-size:.6818181818181819rem;font-weight:700}.ui-tabbar .ui-btn-inner .ui-icon{top:.4545454545454546rem;left:50%;margin-left:-.7272727272727273rem}.ui-tabbar.ui-tabbar-notext a.ui-btn{padding-top:.5rem;padding-bottom:.4545454545454546rem}.ui-tabbar.ui-tabbar-notext .ui-btn-inner{height:1.5454545454545454rem}.ui-tabbar.ui-tabbar-notext .ui-btn-inner .ui-icon{top:0}.ui-header.ui-bar-s.ui-title-tabbar .ui-title{font-size:1rem;margin-top:.36363636363636365rem;margin-bottom:0rem}.ui-header.ui-bar-s.ui-title-tabbar .ui-tabbar.ui-tabbar-noicons a.ui-btn{padding-top:.6818181818181819rem;padding-bottom:.5909090909090909rem}.ui-header.ui-bar-s.ui-title-tabbar .ui-tabbar.ui-tabbar-notext a.ui-btn{padding-top:.3181818181818182rem;padding-bottom:.2272727272727273rem}.ui-header.ui-bar-s.ui-title-tabbar .ui-tabbar.ui-portrait-tabbar{}.ui-header.ui-bar-s.ui-title-tabbar .ui-tabbar.ui-landscape-tabbar{}.ui-header.ui-bar-s.ui-title-tabbar-multiline .ui-tabbar a.ui-btn{padding-top:.5rem;padding-bottom:.4545454545454546rem}.ui-header.ui-bar-s.ui-title-tabbar-multiline .ui-tabbar a.ui-btn .ui-btn-inner{height:2.4545454545454546rem}.ui-header.ui-bar-s.ui-title-tabbar-multiline .ui-tabbar a.ui-btn .ui-btn-inner .ui-btn-text{padding-top:0;line-height:3.8636363636363638rem}.ui-header.ui-bar-s.ui-title-tabbar-multiline .ui-tabbar a.ui-btn .ui-btn-inner .ui-icon{top:0}.ui-header.ui-bar-s li:first-child .ui-btn-inner{border-left-width:0}.ui-footer.ui-bar-s .ui-tabbar{height:2.2272727272727275rem;margin-left:auto;margin-right:auto}.ui-footer.ui-bar-s .ui-tabbar a.ui-btn{padding-top:.7272727272727273rem;padding-bottom:.7272727272727273rem}.ui-footer.ui-bar-s .ui-tabbar .ui-btn-inner .ui-icon{top:0}.ui-footer.ui-bar-s .ui-tabbar.ui-tabbar-notext a.ui-btn{padding-top:.36363636363636365rem;padding-bottom:.3181818181818182rem}.ui-footer.ui-bar-s .ui-tabbar li:first-child .ui-btn-inner{border-left-width:0}.ui-footer.ui-bar-s .ui-tabbar.ui-tabbar-margin-back{margin-right:2.5454545454545454rem}.ui-footer.ui-bar-s .ui-tabbar.ui-tabbar-margin-more{margin-left:2.5454545454545454rem}.ui-footer.ui-bar-s .ui-btn-back~.ui-tabbar li:last-child .ui-btn-inner{border-right:1px solid;border-right-color:#c0c0c0}.ui-footer.ui-bar-s [data-icon="naviframe-more"]~.ui-tabbar li:first-child .ui-btn-inner{border-left:1px solid;border-left-color:#c0c0c0}.ui-tabbar-s.ui-navbar-noicons{font-size:1rem}.ui-tabbar .tabbar-scroll-ul{margin-top:0;margin-bottom:0;padding-left:0}.ui-tabbar .tabbar-scroll-ul .tabbar-scroll-li{position:relative;display:inline-block;margin-left:-.36363636363636365rem}.ui-tabbar .tabbar-scroll-ul .tabbar-scroll-li a{width:100%}.ui-tabbar .tabbar-scroll-ul li.tabbar-scroll-li:first-child{margin-left:0}.ui-tabbar-divider{position:absolute;top:0;width:.4545454545454546rem;height:2.5rem;background:-webkit-linear-gradient(left, #00009b 0, #f6f8ef 100%)}.ui-tabbar-divider-left{left:0;border-top-right-radius:.4545454545454546rem;border-bottom-right-radius:.4545454545454546rem;background:-webkit-linear-gradient(left, #00009b 0, #f6f8ef 100%)}.ui-tabbar-divider-right{right:0;border-top-left-radius:.4545454545454546rem;border-bottom-left-radius:.4545454545454546rem;background:-webkit-linear-gradient(right, #00009b 0, #f6f8ef 100%)}
\ No newline at end of file
+.ui-bar-s{border:0;background:#f8f6ef;color:#3b73b6;font-family:Helvetica,Arial,sans-serif;font-weight:700;font-size:1.2727272727272727rem}.ui-bar-s .ui-link-inherit{color:#3b73b6}.ui-bar-s>.ui-btn.ui-btn-back,.ui-bar-s>.ui-btn.ui-btn-footer-down{background:transparent;position:absolute;right:0}.ui-bar-s>.ui-btn.ui-btn-back .ui-icon-header-back-btn,.ui-bar-s>.ui-btn.ui-btn-footer-down .ui-icon-header-back-btn{top:.36363636363636365rem;left:auto;right:.5909090909090909rem;margin-top:0}.ui-bar-s>.ui-btn.ui-btn-footer-down{border:0;box-shadow:none}.ui-bar-s>.ui-btn.ui-btn-footer-down .ui-icon{top:.36363636363636365rem;left:auto;right:.5909090909090909rem;margin-top:0}.ui-header.ui-bar-s{position:fixed;top:0;min-height:2.5rem}.ui-header.ui-bar-s .ui-title{display:inline-block;color:#3b73b6;min-height:1.2727272727272727rem;max-height:1.5454545454545454rem;font-size:1.2727272727272727rem;font-weight:500;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;outline:0!important;text-align:left;margin:.7272727272727273rem .36363636363636365rem .2272727272727273rem .36363636363636365rem}.ui-header.ui-bar-s>.ui-btn .ui-btn-inner.ui-btn-icon-only{-o-box-sizing:border-box;-ms-box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;height:100%}.ui-header.ui-bar-s>.ui-btn .ui-btn-inner.ui-btn-icon-only .ui-icon{top:0}.ui-header.ui-bar-s>.ui-btn:not(.ui-btn-icon-notext) .ui-btn-inner.ui-btn-icon-only{padding-left:0}.ui-header.ui-bar-s>.ui-btn:not(.ui-btn-icon_only){width:2.409090909090909rem;height:.8181818181818182rem;top:auto;bottom:.4545454545454546rem}.ui-header.ui-bar-s>.ui-btn:not(.ui-btn-icon_only) .ui-btn-inner{padding:0}.ui-header.ui-bar-s>.ui-btn.ui-btn-back,.ui-header.ui-bar-s>.ui-btn.ui-btn-footer-down{right:.5909090909090909rem}.ui-header.ui-bar-s>.ui-btn.ui-btn-back .ui-icon-header-back-btn,.ui-header.ui-bar-s>.ui-btn.ui-btn-footer-down .ui-icon-header-back-btn{left:0}.ui-header.ui-bar-s img{display:inline-block;height:.7272727272727273rem;width:.7272727272727273rem;margin-left:.36363636363636365rem}.ui-header.ui-bar-s .ui-title-text-sub{position:absolute;top:1.6363636363636365rem;left:.36363636363636365rem;font-size:.5454545454545454rem}.ui-header.ui-bar-s .ui-title-text-sub img{height:.7272727272727273rem;width:.7272727272727273rem;margin-left:.36363636363636365rem}.ui-header.ui-bar-s>.ui-btn{position:absolute;top:.7272727272727273rem;margin-top:0;height:1.5454545454545454rem;width:1.5454545454545454rem;background:transparent;color:#3a3a3a}.ui-header.ui-bar-s.ui-title-tabbar>.ui-btn{top:.36363636363636365rem}.ui-header.ui-bar-s>.ui-btn.ui-btn-icon_only{-o-border-radius:0;-ms-border-radius:0;-moz-border-radius:0;-webkit-border-radius:0;border-radius:0}.ui-header.ui-bar-s .ui-btn-right-0{right:.5rem}.ui-header.ui-bar-s .ui-btn-right-1{right:2.5454545454545454rem}.ui-header.ui-bar-s>.ui-btn:not(.ui-btn-icon_only):nth-child(2){right:.3181818181818182rem}.ui-header.ui-bar-s>.ui-btn:not(.ui-btn-icon_only):nth-child(3){right:2.8181818181818183rem}.ui-header.ui-bar-s>img+h1+.ui-btn:not(.ui-btn-icon_only):nth-child(3){right:.3181818181818182rem}.ui-header.ui-bar-s>img+h1+.ui-btn:not(.ui-btn-icon_only):nth-child(3)+.ui-btn:not(.ui-btn-icon_only){right:2.8181818181818183rem}.ui-header.ui-bar-s>img+h1+span.ui-title-text-sub+.ui-btn:not(.ui-btn-icon_only):nth-child(4){right:.3181818181818182rem}.ui-header.ui-bar-s>img+h1+span.ui-title-text-sub+.ui-btn:not(.ui-btn-icon_only):nth-child(4)+.ui-btn:not(.ui-btn-icon_only){right:2.8181818181818183rem}.ui-header.ui-bar-s>.ui-btn.ui-btn-down-s{background:rgba(64,147,247,.1);color:#3b73b6}.ui-header.ui-bar-s.ui-title-multiline .ui-title{min-height:1.0909090909090908rem;max-height:1.0909090909090908rem;font-size:1rem;margin:.4090909090909091rem .36363636363636365rem 1rem .36363636363636365rem}.ui-footer.ui-bar-s{height:2.2272727272727275rem;text-align:center;bottom:0}.ui-footer.ui-bar-s>.ui-btn.ui-btn-back,.ui-footer.ui-bar-s>.ui-btn.ui-btn-footer-down,.ui-footer.ui-bar-s>[data-icon="naviframe-more"]{background:transparent}.ui-footer.ui-bar-s>.ui-btn.ui-btn-back>.ui-btn-icon-only,.ui-footer.ui-bar-s>.ui-btn.ui-btn-footer-down>.ui-btn-icon-only,.ui-footer.ui-bar-s>[data-icon="naviframe-more"]>.ui-btn-icon-only{width:2.5454545454545454rem;height:2.2272727272727275rem;padding:0;-webkit-box-shadow:none}.ui-footer.ui-bar-s [data-icon="naviframe-more"]{position:absolute;left:0rem;top:0rem;box-shadow:none;border-width:0}.ui-footer.ui-bar-s [data-icon="naviframe-more"] .ui-icon-naviframe-more{left:.5909090909090909rem;top:.36363636363636365rem;margin-top:0}.ui-footer.ui-bar-s [data-icon="naviframe-more"] .ui-btn-inner{border:0;background:transparent;box-shadow:none}.ui-footer.ui-bar-s>[data-role="button"]{font-size:.6818181818181819rem;font-weight:700;color:#999}.ui-footer.ui-bar-s [data-role="controlgroup"]{margin-left:auto;margin-right:auto;margin-top:.2727272727272727rem;margin-bottom:.2727272727272727rem;padding-left:2.6363636363636362rem;padding-right:2.6363636363636362rem}.ui-footer.ui-bar-s [data-role="controlgroup"] [data-role="button"]{background:transparent;border-style:solid;border-color:#c0c0c0;border-top-width:0;border-bottom-width:0;border-left-width:1px;border-right-width:1px;-o-border-radius:0;-ms-border-radius:0;-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;box-shadow:none;padding:0;margin-left:-.18181818181818182rem;margin-right:-.2272727272727273rem}.ui-footer.ui-bar-s [data-role="controlgroup"] [data-role="button"].ui-btn-hover-s{-o-border-radius:0;-ms-border-radius:0;-moz-border-radius:0;-webkit-border-radius:0;border-radius:0}.ui-footer.ui-bar-s [data-role="controlgroup"] [data-role="button"].ui-btn-down-s,.ui-footer.ui-bar-s [data-role="controlgroup"] [data-role="button"] .ui-btn-active-s{-o-border-radius:0;-ms-border-radius:0;-moz-border-radius:0;-webkit-border-radius:0;border-radius:0}.ui-footer.ui-bar-s [data-role="controlgroup"] [data-role="button"].ui-btn-down-s .ui-btn-inner,.ui-footer.ui-bar-s [data-role="controlgroup"] [data-role="button"] .ui-btn-active-s .ui-btn-inner{background:#f8f6ef}.ui-footer.ui-bar-s [data-role="controlgroup"] [data-role="button"].ui-btn-down-s .ui-btn-inner .ui-btn-text,.ui-footer.ui-bar-s [data-role="controlgroup"] [data-role="button"] .ui-btn-active-s .ui-btn-inner .ui-btn-text{color:#3b73b6}.ui-footer.ui-bar-s [data-role="controlgroup"] [data-role="button"]>.ui-btn-inner{-o-border-radius:0;-ms-border-radius:0;-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border:0 solid;box-shadow:none}.ui-footer.ui-bar-s [data-role="controlgroup"] [data-role="button"] .ui-btn-text{font-size:.7727272727272727rem;color:#3a3a3a}.ui-footer.ui-bar-s [data-role="controlgroup"] [data-role="button"].ui-corner-right{border-right-width:0}.ui-footer.ui-bar-s [data-role="controlgroup"] [data-role="button"].ui-corner-left{border-left-width:0}.ui-footer.ui-bar-s>[data-role="button"]:not([data-icon="naviframe-more"]){top:.2727272727272727rem}.ui-footer.ui-bar-s>p{margin-top:.36363636363636365rem;margin-bottom:.36363636363636365rem}.ui-footer.ui-bar-s>h1,.ui-footer.ui-bar-s h2,.ui-footer.ui-bar-s h3,.ui-footer.ui-bar-s h4,.ui-footer.ui-bar-s h5,.ui-footer.ui-bar-s h6{display:inline-block}.ui-content{position:relative;top:0}.ui-body-s{border:1px solid #2a2a2a;background:#f8f6ef;color:#000;font-weight:400;font-family:Helvetica,Arial,sans-serif}.ui-body-s .ui-link-inherit{color:#fff}.ui-body-s .ui-link{color:#2489CE;font-weight:700}.ui-body-s .ui-link:hover{color:#2489CE}.ui-body-s .ui-link:active{color:#2489CE}.ui-body-s .ui-link:visited{color:#2489CE}.ui-btn-box-s{padding:.045454545454545456rem}.ui-btn-box-s.ui-btn-up-s{color:#3a3a3a;background:#ebe8e3;background:-webkit-linear-gradient(top, #ebe8e3, #eae7e2);background:-moz-linear-gradient(top, #ebe8e3, #eae7e2);background:-o-linear-gradient(top, #ebe8e3, #eae7e2);background:-ms-linear-gradient(top, #ebe8e3, #eae7e2);border:1px solid;border-color:#dcdad3;-o-box-shadow:0 0 1px 1px #fff;-ms-box-shadow:0 0 1px 1px #fff;-moz-box-shadow:0 0 1px 1px #fff;-webkit-box-shadow:0 0 1px 1px #fff;box-shadow:0 0 1px 1px #fff;-o-border-radius:.3rem;-ms-border-radius:.3rem;-moz-border-radius:.3rem;-webkit-border-radius:.3rem;border-radius:.3rem;font-family:Helvetica,Arial,sans-serif;font-weight:400;font-size:1.0rem;font-style:normal;color:#000}.ui-btn.ui-btn-corner-all .ui-btn-box-s.ui-btn-up-s{-o-border-radius:1.2rem;-ms-border-radius:1.2rem;-moz-border-radius:1.2rem;-webkit-border-radius:1.2rem;border-radius:1.2rem}.ui-btn-box-s .ui-btn-inner{border:1px solid;border-color:#c7c5be;-o-border-radius:.3rem;-ms-border-radius:.3rem;-moz-border-radius:.3rem;-webkit-border-radius:.3rem;border-radius:.3rem;-o-box-sizing:border-box;-ms-box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;background:#f7f5ee;background:-webkit-linear-gradient(top, #faf7f2, #f8f5f0);background:-ms-linear-gradient(top, #faf7f2, #f8f5f0);background:-o-linear-gradient(top, #faf7f2, #f8f5f0);background:-moz-linear-gradient(top, #faf7f2, #f8f5f0);-o-box-shadow:none;-ms-box-shadow:none;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none;height:100%}.ui-btn.ui-btn-corner-all.ui-btn-box-s .ui-btn-inner{-o-border-radius:1.2rem;-ms-border-radius:1.2rem;-moz-border-radius:1.2rem;-webkit-border-radius:1.2rem;border-radius:1.2rem}.ui-ctxpopup .ui-btn-box-s.ui-btn-up-s,.ui-ctxpopup .ui-btn-box-s.ui-btn-hover-s{background:transparent!important;border:0;box-shadow:none;padding:0;color:#fff!important}.ui-ctxpopup .ui-btn-box-s.ui-btn-down-s{background:#3b73b6!important;border:0;box-shadow:none;padding:0;color:#fff!important;-o-border-radius:0;-ms-border-radius:0;-moz-border-radius:0;-webkit-border-radius:0;border-radius:0}.ui-ctxpopup .ui-btn-box-s .ui-btn-inner{background:transparent ! important;box-shadow:none;border:0}.ui-ctxpopup .ui-btn-down-s{background:#3b73b6!important}.ui-header .ui-btn-box-s,.ui-footer .ui-btn-box-s,.ui-btn-back.ui-btn-up-s,.ui-btn-back.ui-btn-hover-s,.ui-btn-back.ui-btn-down-s,.ui-btn-footer-down.ui-btn-up-s,.ui-btn-footer-down.ui-btn-hover-s,.ui-btn-footer-down.ui-btn-down-s,.ui-popup-container .ui-btn-box-s{font-weight:400;-o-border-radius:.9 rem;-ms-border-radius:.9 rem;-moz-border-radius:.9 rem;-webkit-border-radius:.9 rem;border-radius:.9 rem}.ui-btn-box-s.ui-btn-hover-s{color:#3a3a3a;font-family:Helvetica,Arial,sans-serif;font-weight:400;font-size:1.0rem;font-style:normal;color:#000;-o-border-radius:.3em ! important;-ms-border-radius:.3em ! important;-moz-border-radius:.3em ! important;-webkit-border-radius:.3em ! important;border-radius:.3em ! important}.ui-btn-box-s.ui-btn-hover-s.ui-btn-corner-circle{-o-border-radius:1em ! important;-ms-border-radius:1em ! important;-moz-border-radius:1em ! important;-webkit-border-radius:1em ! important;border-radius:1em ! important}.ui-btn-box-s.ui-btn-hover-s.ui-btn-corner-all{-o-border-radius:1.2em ! important;-ms-border-radius:1.2em ! important;-moz-border-radius:1.2em ! important;-webkit-border-radius:1.2em ! important;border-radius:1.2em ! important}.ui-btn-box-s.ui-btn-hover-s.ui-btn-round{-o-border-radius:1.2em ! important;-ms-border-radius:1.2em ! important;-moz-border-radius:1.2em ! important;-webkit-border-radius:1.2em ! important;border-radius:1.2em ! important}.ui-btn-box-s.ui-btn-down-s .ui-btn-inner{background:#3b73b6;color:#f8f6ef}.ui-btn-up-s,.ui-btn-hover-s,.ui-btn-down-s{font-family:Helvetica,Arial,sans-serif;text-decoration:none}a.ui-link-inherit{text-decoration:none!important}.ui-btn-active{color:#3a3a3a;cursor:pointer;text-decoration:none;background:#3b73b6;outline:0}.ui-btn-active a.ui-link-inherit{color:#3a3a3a}.ui-corner-tl{-moz-border-radius-topleft:.3em;-webkit-border-top-left-radius:.3em;border-top-left-radius:.3em}.ui-corner-tr{-moz-border-radius-topright:.3em;-webkit-border-top-right-radius:.3em;border-top-right-radius:.3em}.ui-corner-bl{-moz-border-radius-bottomleft:.3em;-webkit-border-bottom-left-radius:.3em;border-bottom-left-radius:.3em}.ui-corner-br{-moz-border-radius-bottomright:.3em;-webkit-border-bottom-right-radius:.3em;border-bottom-right-radius:.3em}.ui-corner-top{-moz-border-radius-topleft:.3em;-webkit-border-top-left-radius:.3em;border-top-left-radius:.3em;-moz-border-radius-topright:.3em;-webkit-border-top-right-radius:.3em;border-top-right-radius:.3em}.ui-corner-bottom{-moz-border-radius-bottomleft:.3em;-webkit-border-bottom-left-radius:.3em;border-bottom-left-radius:.3em;-moz-border-radius-bottomright:.3em;-webkit-border-bottom-right-radius:.3em;border-bottom-right-radius:.3em}.ui-corner-right{-moz-border-radius-topright:.3em;-webkit-border-top-right-radius:.3em;border-top-right-radius:.3em;-moz-border-radius-bottomright:.3em;-webkit-border-bottom-right-radius:.3em;border-bottom-right-radius:.3em}.ui-corner-left{-moz-border-radius-topleft:.3em;-webkit-border-top-left-radius:.3em;border-top-left-radius:.3em;-moz-border-radius-bottomleft:.3em;-webkit-border-bottom-left-radius:.3em;border-bottom-left-radius:.3em}.ui-corner-none{-o-border-radius:0;-ms-border-radius:0;-moz-border-radius:0;-webkit-border-radius:0;border-radius:0}.ui-header .ui-btn .ui-btn-icon-only .ui-icon,.ui-footer .ui-btn .ui-btn-icon-only .ui-icon{width:1.4545454545454546rem;height:1.4545454545454546rem}.ui-btn-back .ui-btn-inner .ui-icon-header-back-btn,.ui-btn-footer-down .ui-btn-inner .ui-icon{width:1.4545454545454546rem;height:1.4545454545454546rem;background-repeat:no-repeat;background-size:100% 100%}.ui-btn-up-s,.ui-btn-up-s .ui-icon-header-back-btn,.ui-btn-hover-s .ui-icon-header-back-btn{background-image:url(images/page/00_icon_Back.png)}.ui-btn-up-s .ui-icon-naviframe-more,.ui-btn-hover-s .ui-icon-naviframe-more{background-image:url(images/page/00_icon_more.png)}.ui-btn-up-s .ui-icon-naviframe-cancel,.ui-btn-hover-s .ui-icon-naviframe-cancel{background-image:url(images/00_icon_cancel.png)}.ui-btn-up-s .ui-icon-naviframe-edit,.ui-btn-hover-s .ui-icon-naviframe-edit{background-image:url(images/page/00_icon_edit.png)}.ui-btn-up-s .ui-icon-naviframe-plus,.ui-btn-hover-s .ui-icon-naviframe-plus{background-image:url(images/page/00_icon_plus.png)}.ui-btn-up-s .ui-icon-down,.ui-btn-hover-s .ui-icon-down{background-image:url(images/controls/button/00_button_down.png)}.ui-btn-down-s .ui-icon-header-back-btn{background-image:url(images/page/00_icon_Back_press.png)}.ui-btn-down-s .ui-icon-naviframe-more{background-image:url(images/page/00_icon_more_press.png)}.ui-btn-down-s .ui-icon-naviframe-cancel{background-image:url(images/00_icon_cancel_press.png)}.ui-btn-down-s .ui-icon-naviframe-edit{background-image:url(images/page/00_icon_edit_press.png)}.ui-btn-down-s .ui-icon-naviframe-plus{background-image:url(images/page/00_icon_plus_press.png)}.ui-btn-down-s .ui-icon-down{background-image:url(images/controls/button/00_button_down_press.png)}.ui-disabled{filter:alpha(opacity=30);opacity:.3;zoom:1}.ui-disabled,.ui-disabled a{cursor:default!important;pointer-events:none}.ui-mobile,.ui-mobile body{height:100%;font-size:22px}.ui-mobile fieldset,.ui-page{padding:0;margin:0}.ui-mobile a img,.ui-mobile fieldset{border:0}.ui-mobile-viewport{margin:0;overflow-x:hidden;-webkit-tap-highlight-color:rgba(0,0,0,0)}.ui-mobile [data-role=page],.ui-mobile [data-role=dialog],.ui-page{top:0;left:0;width:100%;position:absolute;display:none;border:0}.ui-mobile .ui-page-active{display:block;overflow:visible}.ui-page{outline:0}.ui-mobile,.ui-mobile .ui-page{background:#f8f6ef;color:#000}.ui-page.ui-mobile-touch-overflow,.ui-mobile-touch-overflow.ui-native-fixed .ui-content{overflow:auto;height:100%;-webkit-overflow-scrolling:touch;-moz-overflow-scrolling:touch;-o-overflow-scrolling:touch;-ms-overflow-scrolling:touch;overflow-scrolling:touch}.ui-page.ui-mobile-touch-overflow,.ui-page.ui-mobile-touch-overflow *{transform:rotateY(0);-ms-transform:rotateY(0);-moz-transform:rotateY(0);-webkit-transform:rotateY(0);-o-transform:rotateY(0)}.ui-page.ui-mobile-pre-transition{display:block}.ui-loading .ui-mobile-viewport{overflow:hidden!important}.ui-loading .ui-loader{display:block}.ui-loading .ui-page{overflow:hidden}.ui-loader{display:none;position:absolute;opacity:.85;z-index:100;left:50%;width:200px;margin-left:-130px;margin-top:-35px;padding:10px 30px}.ui-loader h1{font-size:1.4545454545454546rem;text-align:center}.ui-loader .ui-icon{position:static;display:block;opacity:.9;margin:0 auto;width:35px;height:35px;background-color:transparent}.ui-blocker{width:100%;height:100%;z-index:2147483647}.ui-mobile-rendering>*{visibility:hidden}.ui-bar,.ui-body{position:relative;padding:.4em 15px;overflow:hidden;display:block;clear:both}.ui-bar{font-size:16px;margin:0}.ui-bar h1,.ui-bar h2,.ui-bar h3,.ui-bar h4,.ui-bar h5,.ui-bar h6{margin:0;padding:0;font-size:16px;display:inline-block}.ui-header,.ui-footer{display:block}.ui-page .ui-header,.ui-page .ui-footer{position:fixed;z-index:1000}.ui-header .ui-btn-left{top:.4em;float:left}.ui-header .ui-btn-right{float:right;top:.4em}.ui-header .ui-title,.ui-footer .ui-title{min-height:1.1em;text-align:center;font-size:16px;display:block;margin:.6em 90px .8em;padding:0;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;outline:0!important}.ui-content{border-width:0;overflow:visible;overflow-x:hidden;padding:15px}.ui-page-fullscreen .ui-content{padding:0}.ui-mobile-touch-overflow.ui-page.ui-native-fixed,.ui-mobile-touch-overflow.ui-page.ui-native-fullscreen{overflow:visible}.ui-mobile-touch-overflow.ui-native-fixed .ui-header,.ui-mobile-touch-overflow.ui-native-fixed .ui-footer{position:fixed;left:0;right:0;top:0;z-index:200}.ui-mobile-touch-overflow.ui-page.ui-native-fixed .ui-footer{top:auto;bottom:0}.ui-mobile-touch-overflow.ui-native-fixed .ui-content{padding-top:2.5em;padding-bottom:3em;top:0;bottom:0;height:auto;position:absolute}.ui-mobile-touch-overflow.ui-native-fullscreen .ui-content{padding-top:0;padding-bottom:0}.ui-mobile-touch-overflow.ui-native-fullscreen .ui-header,.ui-mobile-touch-overflow.ui-native-fullscreen .ui-footer{opacity:.9}.ui-native-bars-hidden{display:none}.ui-icon{width:18px;height:18px}.ui-fullscreen img{max-width:100%}.ui-nojs{position:absolute;left:-9999px}.ui-mobile-viewport-transitioning,.ui-mobile-viewport-transitioning .ui-page{width:100%;height:100%;overflow:hidden}.in{-ms-animation-timing-function:ease-out;-ms-animation-duration:350ms;-o-animation-timing-function:ease-out;-o-animation-duration:350ms;-webkit-animation-timing-function:ease-out;-webkit-animation-duration:350ms;-moz-animation-timing-function:ease-out;-moz-animation-duration:350ms}.out{-ms-animation-timing-function:ease-in;-ms-animation-duration:225ms;-o-animation-timing-function:ease-in;-o-animation-duration:225;-webkit-animation-timing-function:ease-in;-webkit-animation-duration:225ms;-moz-animation-timing-function:ease-in;-moz-animation-duration:225}@-webkit-keyframes fadein{from{ opacity:0}to{opacity:1}}@-moz-keyframes fadein{from{ opacity:0}to{opacity:1}}@-webkit-keyframes fadeout{from{ opacity:1}to{opacity:0}}@-moz-keyframes fadeout{from{ opacity:1}to{opacity:0}}.fade.out{opacity:0;-ms-animation-duration:125ms;-ms-animation-name:fadeout;-o-animation-duration:125ms;-o-animation-name:fadeout;-webkit-animation-duration:125ms;-webkit-animation-name:fadeout;-moz-animation-duration:125ms;-moz-animation-name:fadeout}.fade.in{opacity:1;-ms-animation-duration:225ms;-ms-animation-name:fadein;-o-animation-duration:225ms;-o-animation-name:fadein;-webkit-animation-duration:225ms;-webkit-animation-name:fadein;-moz-animation-duration:225ms;-moz-animation-name:fadein}.viewport-flip{-ms-perspective:1000;-o-perspective:1000;-webkit-perspective:1000;-moz-perspective:1000;position:absolute}.flip{-webkit-backface-visibility:hidden;-webkit-transform:translate3d(0,0,0);-moz-backface-visibility:hidden;-moz-transform:translate3d(0,0,0)}.flip.out{-webkit-transform:rotateY(-90deg) scale(.9);-webkit-animation-name:flipouttoleft;-webkit-animation-duration:175ms;-moz-transform:rotateY(-90deg) scale(.9);-moz-animation-name:flipouttoleft;-moz-animation-duration:175ms}.flip.in{-webkit-animation-name:flipintoright;-webkit-animation-duration:225ms;-moz-animation-name:flipintoright;-moz-animation-duration:225ms}.flip.out.reverse{-webkit-transform:rotateY(90deg) scale(.9);-webkit-animation-name:flipouttoright;-moz-transform:rotateY(90deg) scale(.9);-moz-animation-name:flipouttoright}.flip.in.reverse{-webkit-animation-name:flipintoleft;-moz-animation-name:flipintoleft}@-webkit-keyframes flipouttoleft{from{ -webkit-transform:rotateY(0)}to{-webkit-transform:rotateY(-90deg) scale(.9)}}@-moz-keyframes flipouttoleft{from{ -moz-transform:rotateY(0)}to{-moz-transform:rotateY(-90deg) scale(.9)}}@-webkit-keyframes flipouttoright{from{ -webkit-transform:rotateY(0)}to{-webkit-transform:rotateY(90deg) scale(.9)}}@-moz-keyframes flipouttoright{from{ -moz-transform:rotateY(0)}to{-moz-transform:rotateY(90deg) scale(.9)}}@-webkit-keyframes flipintoleft{from{ -webkit-transform:rotateY(-90deg) scale(.9)}to{-webkit-transform:rotateY(0)}}@-moz-keyframes flipintoleft{from{ -moz-transform:rotateY(-90deg) scale(.9)}to{-moz-transform:rotateY(0)}}@-webkit-keyframes flipintoright{from{ -webkit-transform:rotateY(90deg) scale(.9)}to{-webkit-transform:rotateY(0)}}@-moz-keyframes flipintoright{from{ -moz-transform:rotateY(90deg) scale(.9)}to{-moz-transform:rotateY(0)}}.flow{-webkit-transform-origin:50% 30%;-moz-transform-origin:50% 30%;-webkit-box-shadow:0 0 20px rgba(0,0,0,.4);-moz-box-shadow:0 0 20px rgba(0,0,0,.4)}.ui-dialog.flow{-webkit-transform-origin:none;-moz-transform-origin:none;-webkit-box-shadow:none;-moz-box-shadow:none}.flow.out{-webkit-transform:translate3d(-100%,0,0) scale(.7);-webkit-animation-name:flowouttoleft;-webkit-animation-timing-function:ease;-webkit-animation-duration:350ms;-moz-transform:translate3d(-100%,0,0) scale(.7);-moz-animation-name:flowouttoleft;-moz-animation-timing-function:ease;-moz-animation-duration:350ms}.flow.in{-webkit-transform:translate3d(0,0,0) scale(1);-webkit-animation-name:flowinfromright;-webkit-animation-timing-function:ease;-webkit-animation-duration:350ms;-moz-transform:translate3d(0,0,0) scale(1);-moz-animation-name:flowinfromright;-moz-animation-timing-function:ease;-moz-animation-duration:350ms}.flow.out.reverse{-webkit-transform:translate3d(100%,0,0);-webkit-animation-name:flowouttoright;-moz-transform:translate3d(100%,0,0);-moz-animation-name:flowouttoright}.flow.in.reverse{-webkit-animation-name:flowinfromleft;-moz-animation-name:flowinfromleft}@-webkit-keyframes flowouttoleft{0%{ -webkit-transform:translate3d(0,0,0) scale(1)}60%,70%{-webkit-transform:translate3d(0,0,0) scale(.7)}100%{-webkit-transform:translate3d(-100%,0,0) scale(.7)}}@-moz-keyframes flowouttoleft{0%{ -moz-transform:translate3d(0,0,0) scale(1)}60%,70%{-moz-transform:translate3d(0,0,0) scale(.7)}100%{-moz-transform:translateX(-100%) scale(.7)}}@-webkit-keyframes flowouttoright{0%{ -webkit-transform:translate3d(0,0,0) scale(1)}60%,70%{-webkit-transform:translate3d(0,0,0) scale(.7)}100%{-webkit-transform:translate3d(100%,0,0) scale(.7)}}@-moz-keyframes flowouttoright{0%{ -moz-transform:translate3d(0,0,0) scale(1)}60%,70%{-moz-transform:translate3d(0,0,0) scale(.7)}100%{-moz-transform:translate3d(100%,0,0) scale(.7)}}@-webkit-keyframes flowinfromleft{0%{ -webkit-transform:translate3d(-100%,0,0) scale(.7)}30%,40%{-webkit-transform:translate3d(0,0,0) scale(.7)}100%{-webkit-transform:translate3d(0,0,0) scale(1)}}@-moz-keyframes flowinfromleft{0%{ -moz-transform:translate3d(-100%,0,0) scale(.7)}30%,40%{-moz-transform:translate3d(0,0,0) scale(.7)}100%{-moz-transform:translate3d(0,0,0) scale(1)}}@-webkit-keyframes flowinfromright{0%{ -webkit-transform:translate3d(100%,0,0) scale(.7)}30%,40%{-webkit-transform:translate3d(0,0,0) scale(.7)}100%{-webkit-transform:translate3d(0,0,0) scale(1)}}@-moz-keyframes flowinfromright{0%{ -moz-transform:translate3d(100%,0,0) scale(.7)}30%,40%{-moz-transform:translate3d(0,0,0) scale(.7)}100%{-moz-transform:translate3d(0,0,0) scale(1)}}.pop{-webkit-transform-origin:50% 50%;-moz-transform-origin:50% 50%}.pop.in{-webkit-transform:scale(1);-moz-transform:scale(1);opacity:1;-webkit-animation-name:popin;-moz-animation-name:popin;-webkit-animation-duration:350ms;-moz-animation-duration:350ms}.pop.out{-webkit-animation-name:fadeout;-moz-animation-name:fadeout;opacity:0;-webkit-animation-duration:100ms;-moz-animation-duration:100ms}.pop.in.reverse{-webkit-animation-name:fadein;-moz-animation-name:fadein}.pop.out.reverse{-webkit-transform:scale(.8);-moz-transform:scale(.8);-webkit-animation-name:popout;-moz-animation-name:popout}@-webkit-keyframes popin{from{ -webkit-transform:scale(.8);opacity:0}to{-webkit-transform:scale(1);opacity:1}}@-moz-keyframes popin{from{ -moz-transform:scale(.8);opacity:0}to{-moz-transform:scale(1);opacity:1}}@-webkit-keyframes popout{from{ -webkit-transform:scale(1);opacity:1}to{-webkit-transform:scale(.8);opacity:0}}@-moz-keyframes popout{from{ -moz-transform:scale(1);opacity:1}to{-moz-transform:scale(.8);opacity:0}}@-webkit-keyframes slideinfromright{from{ -webkit-transform:translate3d(100%,0,0)}to{-webkit-transform:translate3d(0,0,0)}}@-moz-keyframes slideinfromright{from{ -moz-transform:translate3d(100%,0,0)}to{-moz-transform:translate3d(0,0,0)}}@-webkit-keyframes slideinfromleft{from{ -webkit-transform:translate3d(-100%,0,0)}to{-webkit-transform:translate3d(0,0,0)}}@-moz-keyframes slideinfromleft{from{ -moz-transform:translate3d(-100%,0,0)}to{-moz-transform:translate3d(0,0,0)}}@-webkit-keyframes slideouttoleft{from{ -webkit-transform:translate3d(0,0,0)}to{-webkit-transform:translate3d(-100%,0,0)}}@-moz-keyframes slideouttoleft{from{ -moz-transform:translate3d(0,0,0)}to{-moz-transform:translate3d(-100%,0,0)}}@-webkit-keyframes slideouttoright{from{ -webkit-transform:translate3d(0,0,0)}to{-webkit-transform:translate3d(100%,0,0)}}@-moz-keyframes slideouttoright{from{ -moz-transform:translate3d(0,0,0)}to{-moz-transform:translate3d(100%,0,0)}}.slide.out,.slide.in{-webkit-animation-timing-function:ease-out;-webkit-animation-duration:350ms;-moz-animation-timing-function:ease-out;-moz-animation-duration:350ms}.slide.out{-webkit-transform:translate3d(-100%,0,0);-webkit-animation-name:slideouttoleft;-moz-transform:translate3d(-100%,0,0);-moz-animation-name:slideouttoleft}.slide.in{-webkit-transform:translate3d(0,0,0);-webkit-animation-name:slideinfromright;-moz-transform:translate3d(0,0,0);-moz-animation-name:slideinfromright}.slide.out.reverse{-webkit-transform:translate3d(100%,0,0);-webkit-animation-name:slideouttoright;-moz-transform:translate3d(100%,0,0);-moz-animation-name:slideouttoright}.slide.in.reverse{-webkit-transform:translate3d(0,0,0);-webkit-animation-name:slideinfromleft;-moz-transform:translate3d(0,0,0);-moz-animation-name:slideinfromleft}.slidedown.out{-webkit-animation-name:fadeout;-moz-animation-name:fadeout;-webkit-animation-duration:100ms;-moz-animation-duration:100ms}.slidedown.in{-webkit-transform:translate3d(0,0,0);-webkit-animation-name:slideinfromtop;-moz-transform:translate3d(0,0,0);-moz-animation-name:slideinfromtop;-webkit-animation-duration:250ms;-moz-animation-duration:250ms}.slidedown.in.reverse{-webkit-animation-name:fadein;-moz-animation-name:fadein;-webkit-animation-duration:150ms;-moz-animation-duration:150ms}.slidedown.out.reverse{-webkit-transform:translate3d(0,-100%,0);-moz-transform:translate3d(0,-100%,0);-webkit-animation-name:slideouttotop;-moz-animation-name:slideouttotop;-webkit-animation-duration:200ms;-moz-animation-duration:200ms}@-webkit-keyframes slideinfromtop{from{ -webkit-transform:translate3d(0,-100%,0)}to{-webkit-transform:translate3d(0,0,0)}}@-moz-keyframes slideinfromtop{from{ -moz-transform:translate3d(0,-100%,0)}to{-moz-transform:translate3d(0,0,0)}}@-webkit-keyframes slideouttotop{from{ -webkit-transform:translate3d(0,0,0)}to{-webkit-transform:translate3d(0,-100%,0)}}@-moz-keyframes slideouttotop{from{ -moz-transform:translate3d(0,0,0)}to{-moz-transform:translate3d(0,-100%,0)}}.slideup.out{-webkit-animation-name:fadeout;-moz-animation-name:fadeout;-webkit-animation-duration:100ms;-moz-animation-duration:100ms}.slideup.in{-webkit-transform:translate3d(0,0,0);-webkit-animation-name:slideinfrombottom;-moz-transform:translate3d(0,0,0);-moz-animation-name:slideinfrombottom;-webkit-animation-duration:250ms;-moz-animation-duration:250ms}.slideup.in.reverse{-webkit-animation-name:fadein;-moz-animation-name:fadein;-webkit-animation-duration:150ms;-moz-animation-duration:150ms}.slideup.out.reverse{-webkit-transform:translate3d(0,100%,0);-moz-transform:translate3d(0,100%,0);-webkit-animation-name:slideouttobottom;-moz-animation-name:slideouttobottom;-webkit-animation-duration:200ms;-moz-animation-duration:200ms}@-webkit-keyframes slideinfrombottom{from{ -webkit-transform:translate3d(0,100%,0)}to{-webkit-transform:translate3d(0,0,0)}}@-moz-keyframes slideinfrombottom{from{ -moz-transform:translate3d(0,100%,0)}to{-moz-transform:translate3d(0,0,0)}}@-webkit-keyframes slideouttobottom{from{ -webkit-transform:translate3d(0,0,0)}to{-webkit-transform:translate3d(0,100%,0)}}@-moz-keyframes slideouttobottom{from{ -moz-transform:translate3d(0,0,0)}to{-moz-transform:translate3d(0,100%,0)}}.slideupfade.out{-webkit-animation-name:fadeout;-moz-animation-name:fadeout;-webkit-animation-duration:100ms;-moz-animation-duration:100ms}.slideupfade.in{-webkit-transform:translate3d(0,0,0);-webkit-animation-name:slideupfadeinfrombottom;-moz-transform:translate3d(0,0,0);-moz-animation-name:slideupfadeinfrombottom;-webkit-animation-duration:250ms;-moz-animation-duration:250ms}.slideupfade.in.reverse{-webkit-animation-name:fadein;-moz-animation-name:fadein;-webkit-animation-duration:150ms;-moz-animation-duration:150ms}.slideupfade.out.reverse{-webkit-transform:translate3d(0,5%,0);-moz-transform:translate3d(0,5%,0);-webkit-animation-name:slideupfadeouttobottom;-moz-animation-name:slideupfadeouttobottom;-webkit-animation-duration:200ms;-moz-animation-duration:200ms}@-webkit-keyframes slideupfadeinfrombottom{from{ opacity:0;-webkit-transform:translate3d(0,5%,0)}to{opacity:1;-webkit-transform:translate3d(0,0,0)}}@-moz-keyframes slideupfadeinfrombottom{from{ opacity:0;-moz-transform:translate3d(0,5%,0)}to{opacity:1;-moz-transform:translate3d(0,0,0)}}@-webkit-keyframes slideupfadeouttobottom{from{ opacity:1;-webkit-transform:translate3d(0,0,0)}to{opacity:0;-webkit-transform:translate3d(0,5%,0)}}@-moz-keyframes slideupfadeouttobottom{from{ opacity:1;-moz-transform:translate3d(0,0,0)}to{opacity:0;-moz-transform:translate3d(0,5%,0)}}.slidedownfade.out{-webkit-animation-name:fadeout;-moz-animation-name:fadeout;-webkit-animation-duration:100ms;-moz-animation-duration:100ms}.slidedownfade.in{-webkit-transform:translate3d(0,0,0);-webkit-animation-name:slidedownfadeinfromtop;-moz-transform:translate3d(0,0,0);-moz-animation-name:slidedownfadeinfromtop;-webkit-animation-duration:250ms;-moz-animation-duration:250ms}.slidedownfade.in.reverse{-webkit-animation-name:fadein;-moz-animation-name:fadein;-webkit-animation-duration:150ms;-moz-animation-duration:150ms}.slidedownfade.out.reverse{-webkit-transform:translate3d(0,-5%,0);-moz-transform:translate3d(0,-5%,0);-webkit-animation-name:slidedownfadeouttotop;-moz-animation-name:slidedownfadeouttotop;-webkit-animation-duration:200ms;-moz-animation-duration:200ms}@-webkit-keyframes slidedownfadeinfromtop{from{ opacity:0;-webkit-transform:translate3d(0,-5%,0)}to{opacity:1;-webkit-transform:translate3d(0,0,0)}}@-moz-keyframes slidedownfadeinfromtop{from{ opacity:0;-moz-transform:translate3d(0,-5%,0)}to{opacity:1;-moz-transform:translate3d(0,0,0)}}@-webkit-keyframes slidedownfadeouttotop{from{ opacity:1;-webkit-transform:translate3d(0,0,0)}to{opacity:0;-webkit-transform:translate3d(0,-5%,0)}}@-moz-keyframes slidedownfadeouttotop{from{ opacity:1;-moz-transform:translate3d(0,0,0)}to{opacity:0;-moz-transform:translate3d(0,-5%,0)}}.slidefade.out{-webkit-transform:translate3d(-100%,0,0);-webkit-animation-name:slideouttoleft;-moz-transform:translate3d(-100%,0,0);-moz-animation-name:slideouttoleft;-webkit-animation-duration:225ms;-moz-animation-duration:225ms}.slidefade.in{-webkit-transform:translate3d(0,0,0);-webkit-animation-name:fadein;-moz-transform:translate3d(0,0,0);-moz-animation-name:fadein;-webkit-animation-duration:200ms;-moz-animation-duration:200ms}.slidefade.out.reverse{-webkit-transform:translate3d(100%,0,0);-webkit-animation-name:slideouttoright;-moz-transform:translate3d(100%,0,0);-moz-animation-name:slideouttoright;-webkit-animation-duration:200ms;-moz-animation-duration:200ms}.slidefade.in.reverse{-webkit-transform:translate3d(0,0,0);-webkit-animation-name:fadein;-moz-transform:translate3d(0,0,0);-moz-animation-name:fadein;-webkit-animation-duration:200ms;-moz-animation-duration:200ms}.viewport-turn{-webkit-perspective:1000;-moz-perspective:1000;position:absolute}.turn{-webkit-backface-visibility:hidden;-webkit-transform:translate3d(0,0,0);-webkit-transform-origin:0;-moz-backface-visibility:hidden;-moz-transform:translate3d(0,0,0);-moz-transform-origin:0}.turn.out{-webkit-transform:rotateY(-90deg) scale(.9);-webkit-animation-name:flipouttoleft;-moz-transform:rotateY(-90deg) scale(.9);-moz-animation-name:flipouttoleft;-webkit-animation-duration:125ms;-moz-animation-duration:125ms}.turn.in{-webkit-animation-name:flipintoright;-moz-animation-name:flipintoright;-webkit-animation-duration:250ms;-moz-animation-duration:250ms}.turn.out.reverse{-webkit-transform:rotateY(90deg) scale(.9);-webkit-animation-name:flipouttoright;-moz-transform:rotateY(90deg) scale(.9);-moz-animation-name:flipouttoright}.turn.in.reverse{-webkit-animation-name:flipintoleft;-moz-animation-name:flipintoleft}@-webkit-keyframes flipouttoleft{from{ -webkit-transform:rotateY(0)}to{-webkit-transform:rotateY(-90deg) scale(.9)}}@-moz-keyframes flipouttoleft{from{ -moz-transform:rotateY(0)}to{-moz-transform:rotateY(-90deg) scale(.9)}}@-webkit-keyframes flipouttoright{from{ -webkit-transform:rotateY(0)}to{-webkit-transform:rotateY(90deg) scale(.9)}}@-moz-keyframes flipouttoright{from{ -moz-transform:rotateY(0)}to{-moz-transform:rotateY(90deg) scale(.9)}}@-webkit-keyframes flipintoleft{from{ -webkit-transform:rotateY(-90deg) scale(.9)}to{-webkit-transform:rotateY(0)}}@-moz-keyframes flipintoleft{from{ -moz-transform:rotateY(-90deg) scale(.9)}to{-moz-transform:rotateY(0)}}@-webkit-keyframes flipintoright{from{ -webkit-transform:rotateY(90deg) scale(.9)}to{-webkit-transform:rotateY(0)}}@-moz-keyframes flipintoright{from{ -moz-transform:rotateY(90deg) scale(.9)}to{-moz-transform:rotateY(0)}}.depth{-webkit-transform-origin:50% 50%;-moz-transform-origin:50% 50%}.depth.out{-webkit-animation-name:depthout;-moz-animation-name:depthout;opacity:0;-webkit-animation-duration:250ms;-moz-animation-duration:250ms;-webkit-animation-timing-function:ease;-moz-animation-timing-function:ease}.depth.in{-webkit-transform:scale(1);-moz-transform:scale(1);opacity:1;-webkit-animation-name:depthin;-moz-animation-name:depthin;-webkit-animation-duration:350ms;-moz-animation-duration:350ms;-webkit-animation-timing-function:ease;-moz-animation-timing-function:ease}.depth.in.reverse{-webkit-animation-name:depthinreverse;-moz-animation-name:depthinreverse}.depth.out.reverse{-webkit-transform:scale(.9);-moz-transform:scale(.9);-webkit-animation-name:depthoutreverse;-moz-animation-name:depthoutreverse}@-webkit-keyframes depthout{from{ -webkit-transform:scale(1);opacity:1}to{-webkit-transform:scale(1.1);opacity:0}}@-moz-keyframes depthout{from{ -moz-transform:scale(1);opacity:1}to{-moz-transform:scale(1.1);opacity:0}}@-webkit-keyframes depthin{0%{ -webkit-transform:scale(.9);opacity:0}30%{-webkit-transform:scale(.9);opacity:0}100%{-webkit-transform:scale(1);opacity:1}}@-moz-keyframes depthin{0%{ -moz-transform:scale(.9);opacity:0}30%{-moz-transform:scale(.9);opacity:0}100%{-moz-transform:scale(1);opacity:1}}@-webkit-keyframes depthinreverse{0%{ -webkit-transform:scale(1.1);opacity:0}30%{-webkit-transform:scale(1.1);opacity:0}100%{-webkit-transform:scale(1);opacity:1}}@-moz-keyframes depthinreverse{0%{ -moz-transform:scale(1.1);opacity:0}30%{-moz-transform:scale(1.1);opacity:0}100%{-moz-transform:scale(1);opacity:1}}@-webkit-keyframes depthoutreverse{from{ -webkit-transform:scale(1);opacity:1}to{-webkit-transform:scale(.9);opacity:0}}@-moz-keyframes depthoutreverse{from{ -moz-transform:scale(1);opacity:1}to{-moz-transform:scale(.9);opacity:0}}.ui-grid-a,.ui-grid-b,.ui-grid-c,.ui-grid-d{overflow:hidden}.ui-block-a,.ui-block-b,.ui-block-c,.ui-block-d,.ui-block-e{margin:0;padding:0;border:0;float:left;min-height:1px}.ui-grid-solo .ui-block-a{width:100%;float:none}.ui-grid-a .ui-block-a,.ui-grid-a .ui-block-b{width:50%}.ui-grid-a .ui-block-a{clear:left}.ui-grid-b .ui-block-a,.ui-grid-b .ui-block-b,.ui-grid-b .ui-block-c{width:33.333%}.ui-grid-b .ui-block-a{clear:left}.ui-grid-c .ui-block-a,.ui-grid-c .ui-block-b,.ui-grid-c .ui-block-c,.ui-grid-c .ui-block-d{width:25%}.ui-grid-c .ui-block-a{clear:left}.ui-grid-d .ui-block-a,.ui-grid-d .ui-block-b,.ui-grid-d .ui-block-c,.ui-grid-d .ui-block-d,.ui-grid-d .ui-block-e{width:20%}.ui-grid-d .ui-block-a{clear:left}.ui-header,.ui-footer,.ui-page-fullscreen .ui-header,.ui-page-fullscreen .ui-footer{position:absolute;overflow:hidden;width:100%;border-left-width:0;border-right-width:0}.ui-header-fixed,.ui-footer-fixed{z-index:1000;-webkit-transform:translateZ(0)}.ui-footer-duplicate,.ui-page-fullscreen .ui-fixed-inline{display:none}.ui-page-fullscreen .ui-header,.ui-page-fullscreen .ui-footer{opacity:.9}.ui-navbar{overflow:hidden}.ui-navbar ul,.ui-navbar-expanded ul{list-style:none;padding:0;margin:0;position:relative;display:block;border:0}.ui-navbar-collapsed ul{float:left;width:75%;margin-right:-2px}.ui-navbar-collapsed .ui-navbar-toggle{float:left;width:25%}.ui-navbar li.ui-navbar-truncate{position:absolute;left:-9999px;top:-9999px}.ui-navbar li .ui-btn,.ui-navbar .ui-navbar-toggle .ui-btn{display:block;font-size:12px;text-align:center;margin:0;border-right-width:0}.ui-navbar li .ui-btn{margin-right:-1px}.ui-navbar li .ui-btn:last-child{margin-right:0}.ui-header .ui-navbar li .ui-btn,.ui-header .ui-navbar .ui-navbar-toggle .ui-btn,.ui-footer .ui-navbar li .ui-btn,.ui-footer .ui-navbar .ui-navbar-toggle .ui-btn{border-top-width:0;border-bottom-width:0}.ui-navbar .ui-btn-inner{padding-left:2px;padding-right:2px}.ui-navbar-noicons li .ui-btn .ui-btn-inner,.ui-navbar-noicons .ui-navbar-toggle .ui-btn-inner{padding-top:.8em;padding-bottom:.9em}.ui-navbar-expanded .ui-btn{margin:0;font-size:14px}.ui-navbar-expanded .ui-btn-inner{padding-left:5px;padding-right:5px}.ui-navbar-expanded .ui-btn-icon-top .ui-btn-inner{padding:45px 5px 15px;text-align:center}.ui-navbar-expanded .ui-btn-icon-top .ui-icon{top:15px}.ui-navbar-expanded .ui-btn-icon-bottom .ui-btn-inner{padding:15px 5px 45px;text-align:center}.ui-navbar-expanded .ui-btn-icon-bottom .ui-icon{bottom:15px}.ui-navbar-expanded li .ui-btn .ui-btn-inner{min-height:2.5em}.ui-navbar-expanded .ui-navbar-noicons .ui-btn .ui-btn-inner{padding-top:1.8em;padding-bottom:1.9em}.ui-btn{display:block;text-align:center;cursor:pointer;position:relative;vertical-align:middle}.ui-btn:focus,.ui-btn:active{outline:0}.ui-header .ui-btn,.ui-footer .ui-btn,.ui-bar .ui-btn{display:inline-block;font-size:.5909090909090909rem;margin:0}.ui-btn-inline{display:inline-block}.ui-btn-inner{padding:.5em .4090909090909091rem;display:block;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;position:relative;zoom:1}.ui-btn-icon-notext{width:1.6363636363636365rem;height:1.6363636363636365rem}.ui-btn-icon-notext .ui-btn-inner{padding:.09090909090909091rem .045454545454545456rem .09090909090909091rem .13636363636363635rem}.ui-btn-icon-notext .ui-btn-inner .ui-icon{margin-left:-.7272727272727273rem;margin-top:-.7272727272727273rem}.ui-btn-icon-notext .ui-btn-text{position:absolute;left:-45.409090909090914rem}.ui-btn-icon-left .ui-btn-inner{padding-left:1.5rem}.ui-header .ui-btn-icon-left .ui-btn-inner,.ui-footer .ui-btn-icon-left .ui-btn-inner,.ui-bar .ui-btn-icon-left .ui-btn-inner{padding-left:1.2272727272727273rem}.ui-btn-icon-right .ui-btn-inner{padding-right:1.5rem}.ui-header .ui-btn-icon-right .ui-btn-inner,.ui-footer .ui-btn-icon-right .ui-btn-inner,.ui-bar .ui-btn-icon-right .ui-btn-inner{padding-right:1.2272727272727273rem}.ui-btn-icon-top .ui-btn-inner{padding-top:1.2272727272727273rem}.ui-header .ui-btn-icon-top .ui-btn-inner,.ui-footer .ui-btn-icon-top .ui-btn-inner,.ui-bar .ui-btn-icon-top .ui-btn-inner{padding-top:1.2272727272727273rem}.ui-btn-icon-bottom .ui-btn-inner{padding-bottom:1.5rem}.ui-header .ui-btn-icon-bottom .ui-btn-inner,.ui-footer .ui-btn-icon-bottom .ui-btn-inner,.ui-bar .ui-btn-icon-bottom .ui-btn-inner{padding-bottom:1.2272727272727273rem}.ui-btn-icon-notext .ui-icon{display:block}.ui-btn-icon-left .ui-icon,.ui-btn-icon-right .ui-icon,.ui-btn-icon-circle .ui-icon{position:absolute}.ui-btn-icon-top .ui-icon,.ui-btn-icon-bottom .ui-icon{position:absolute;left:50%;margin-left:-9px}.ui-btn-icon-left .ui-icon{left:0rem}.ui-btn-icon-circle .ui-icon{left:0rem}.ui-btn-icon-right .ui-icon{right:.4545454545454546rem}.ui-btn-icon-top .ui-icon{top:0rem;margin-top:0}.ui-btn-icon-bottom .ui-icon{bottom:0rem}.ui-header .ui-btn-icon-right .ui-icon,.ui-footer .ui-btn-icon-right .ui-icon,.ui-bar .ui-btn-icon-right .ui-icon{right:.18181818181818182rem}.ui-header .ui-btn-icon-top .ui-icon,.ui-footer .ui-btn-icon-top .ui-icon,.ui-bar .ui-btn-icon-top .ui-icon{top:.18181818181818182rem}.ui-header .ui-btn-icon-bottom .ui-icon,.ui-footer .ui-btn-icon-bottom .ui-icon,.ui-bar .ui-btn-icon-bottom .ui-icon{bottom:.18181818181818182rem}.ui-btn-hidden{position:absolute;top:0;left:0;width:100%;height:100%;-webkit-appearance:button;opacity:.1;cursor:pointer;background:transparent;font-size:.045454545454545456rem;border:0;line-height:45.409090909090914rem}.ui-btn-text{margin-left:auto;margin-right:auto;padding:0 1px}.ui-li .ui-btn.ui-btn-icon_only{top:50%;margin-top:-.7272727272727273rem}.ui-li .ui-btn .ui-btn-inner.ui-btn-hastxt{padding:.2em .5em}.ui-btn-icon-nobg.ui-btn-down-s .ui-btn-inner{background:transparent ! important}.ui-btn.ui-btn-box-s.ui-btn-down-s .ui-btn-inner{color:#f8f6ef}.ui-header .ui-btn-box-s:not(.ui-input-cancel):not(.ui-btn-search-front-icon),.ui-header .ui-btn-box-s:not(.ui-input-cancel):not(.ui-btn-search-front-icon) .ui-btn-inner,.ui-header .ui-btn.ui-btn-box-s.ui-btn-down-s:not(.ui-input-cancel):not(.ui-btn-search-front-icon) .ui-btn-inner,.ui-btn.ui-btn-back.ui-btn-up-s .ui-btn-inner,.ui-btn.ui-btn-back.ui-btn-hover-s .ui-btn-inner,.ui-btn.ui-btn-back.ui-btn-down-s .ui-btn-inner,.ui-btn.ui-btn-footer-down.ui-btn-up-s>.ui-btn-inner,.ui-btn.ui-btn-footer-down.ui-btn-hover-s>.ui-btn-inner,.ui-btn.ui-btn-footer-down.ui-btn-down-s>.ui-btn-inner{background:transparent;border:0;box-shadow:none}.ui-btn-icon-top .ui-btn-inner.ui-btn-hastxt,.ui-li .ui-btn-icon-top .ui-btn-inner.ui-btn-hastxt{padding-top:2.3636363636363638rem}.ui-btn-icon-bottom .ui-btn-inner.ui-btn-hastxt,.ui-li .ui-btn-icon-bottom .ui-btn-inner.ui-btn-hastxt{padding-bottom:2.3636363636363638rem}.ui-btn .ui-icon{width:1.4545454545454546rem;height:1.4545454545454546rem}.ui-btn.ui-btn-edit .ui-icon{width:3.3636363636363638rem;height:3.3636363636363638rem}.ui-btn .ui-btn-text.ui-btn-text-padding-left{padding-left:2rem}.ui-btn .ui-btn-text.ui-btn-text-padding-right{padding-right:2.1818181818181817rem}.ui-btn .ui-btn-text.ui-btn-text-padding-top{padding-top:1.4545454545454546rem}.ui-icon{background-repeat:no-repeat;vertical-align:middle;background-position:0 0;background-size:100%}.ui-btn-box.s .ui-icon{position:absolute}.ui-btn-box-s.ui-btn-icon-left .ui-icon,.ui-btn-box-s.ui-btn-icon-right .ui-icon{margin-top:-.7272727272727273rem;top:50%}.ui-btn-box-s.ui-btn-icon-top .ui-icon,.ui-btn-box-s.ui-btn-icon-bottom .ui-icon{margin-left:-.7272727272727273rem;left:50%}.tizen-icon-common{width:1.4545454545454546rem;height:1.4545454545454546rem}.tizen-smallicon-common{width:.9090909090909092rem ! important;height:.9090909090909092rem ! important;top:50% ! important;left:50% ! important;margin-top:-.4545454545454546rem ! important;margin-left:-.4545454545454546rem ! important}.ui-icon-bg{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/00_btn_circle_bg_normal.png);z-index:0}.ui-icon-arrow-l{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/button/00_button_left.png)}.ui-icon-arrow-r{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/button/00_button_right.png)}.ui-icon-arrow-u{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/button/00_button_expand_opened.png)}.ui-icon-arrow-d{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/button/00_button_expand_closed.png)}.ui-icon-delete{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/button/00_button_expand_cancel.png)}.ui-icon-plus{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/button/00_button_plus.png)}.ui-icon-minus{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/button/00_button_expand_minus.png)}.ui-icon-check{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/button/00_button_check.png)}.ui-icon-gear{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/button/00_button_gear.png)}.ui-icon-refresh{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/button/00_button_refresh.png)}.ui-icon-forward{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/button/00_button_expand_send.png)}.ui-icon-back{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/button/00_button_back.png)}.ui-icon-grid{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/button/00_button_grid.png)}.ui-icon-star{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/button/00_button_star.png)}.ui-icon-alert{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/button/00_button_warning.png)}.ui-icon-info{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/button/00_button_info.png)}.ui-icon-home{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/button/00_button_home.png)}.ui-icon-search{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/button/00_button_search.png)}.ui-icon-call{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/button/00_button_call.png)}.ui-icon-rename{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/button/00_button_rename.png)}.ui-icon-scrolltop{width:.9090909090909092rem ! important;height:.9090909090909092rem ! important;top:50% ! important;left:50% ! important;margin-top:-.4545454545454546rem ! important;margin-left:-.4545454545454546rem ! important;background-image:url(images/controls/button/00_icon_jump.png)}.ui-icon-scrollleft{width:.9090909090909092rem ! important;height:.9090909090909092rem ! important;top:50% ! important;left:50% ! important;margin-top:-.4545454545454546rem ! important;margin-left:-.4545454545454546rem ! important;background-image:url(images/controls/button/00_icon_jump_left.png)}.ui-icon-expandable-divider-opened{width:1.9090909090909092rem;height:1.9090909090909092rem;position:absolute;right:1.2727272727272727rem;top:0rem;background-repeat:no-repeat;background-size:100% 100%;background-image:url(images/00_indexlist_icon_opened.png)}.ui-icon-expandable-divider-closed{width:1.9090909090909092rem;height:1.9090909090909092rem;position:absolute;right:1.2727272727272727rem;top:0rem;background-repeat:no-repeat;background-size:100% 100%;background-image:url(images/00_indexlist_icon_closed.png)}.ui-btn-down-s .ui-icon-bg,.ui-btn-down-s.ui-tizen-icon-bg{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/00_btn_circle_bg_press.png);z-index:0}.ui-btn-down-s .ui-icon-arrow-l{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/button/00_button_left_press.png)}.ui-btn-down-s .ui-icon-arrow-r{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/button/00_button_right_press.png)}.ui-btn-down-s .ui-icon-arrow-u{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/button/00_button_expand_opened_press.png)}.ui-btn-down-s .ui-icon-arrow-d{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/button/00_button_expand_closed_press.png)}.ui-btn-down-s .ui-icon-delete{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/button/00_button_expand_cancel_press.png)}.ui-btn-down-s .ui-icon-plus{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/button/00_button_plus_press.png)}.ui-btn-down-s .ui-icon-minus{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/button/00_button_expand_minus_press.png)}.ui-btn-down-s .ui-icon-check{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/button/00_button_check_press.png)}.ui-btn-down-s .ui-icon-gear{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/button/00_button_gear_press.png)}.ui-btn-down-s .ui-icon-refresh{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/button/00_button_refresh_press.png)}.ui-btn-down-s .ui-icon-forward{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/button/00_button_expand_send_press.png)}.ui-btn-down-s .ui-icon-back{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/button/00_button_back_press.png)}.ui-btn-down-s .ui-icon-grid{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/button/00_button_grid_press.png)}.ui-btn-down-s .ui-icon-star{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/button/00_button_star_press.png)}.ui-btn-down-s .ui-icon-alert{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/button/00_button_warning_press.png)}.ui-btn-down-s .ui-icon-info{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/button/00_button_info_press.png)}.ui-btn-down-s .ui-icon-home{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/button/00_button_home_press.png)}.ui-btn-down-s .ui-icon-search{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/button/00_button_search_press.png)}.ui-btn-down-s .ui-icon-call{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/button/00_button_call_press.png)}.ui-btn-down-s .ui-icon-rename{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/button/00_button_rename_press.png)}.ui-btn-down-s .ui-icon-scrolltop{width:.9090909090909092rem ! important;height:.9090909090909092rem ! important;top:50% ! important;left:50% ! important;margin-top:-.4545454545454546rem ! important;margin-left:-.4545454545454546rem ! important;background-image:url(images/controls/button/00_icon_jump_press.png)}.ui-btn-down-s .ui-icon-scrollleft{width:.9090909090909092rem ! important;height:.9090909090909092rem ! important;top:50% ! important;left:50% ! important;margin-top:-.4545454545454546rem ! important;margin-left:-.4545454545454546rem ! important;background-image:url(images/controls/button/00_icon_jump_left_press.png)}.ui-btn-inner.ui-btn-icon-only{padding:.7272727272727273rem .7272727272727273rem}.ui-btn-icon-only .ui-btn-text{display:block;width:0;height:0;overflow:hidden}.ui-btn.ui-btn-corner-all{-o-border-radius:1.2em ! important;-ms-border-radius:1.2em ! important;-moz-border-radius:1.2em ! important;-webkit-border-radius:1.2em ! important;border-radius:1.2em ! important}.ui-btn.ui-btn-icon-nobg{box-shadow:none}.ui-btn-corner-circle{-o-border-radius:1em ! important;-ms-border-radius:1em ! important;-moz-border-radius:1em ! important;-webkit-border-radius:1em ! important;border-radius:1em ! important}.ui-btn-round{-o-border-radius:1.2em ! important;-ms-border-radius:1.2em ! important;-moz-border-radius:1.2em ! important;-webkit-border-radius:1.2em ! important;border-radius:1.2em ! important}.ui-btn-round .ui-btn-inner{-o-border-radius:1.2em ! important;-ms-border-radius:1.2em ! important;-moz-border-radius:1.2em ! important;-webkit-border-radius:1.2em ! important;border-radius:1.2em ! important}.ui-btn.ui-btn-icon-nobg,.ui-btn .ui-btn-icon-nobg{background:transparent;background-color:transparent;border:0}.ui-btn.ui-btn-edit .ui-btn-text{color:#f9f9f9}.ui-btn.ui-btn-edit .ui-btn-inner{background:#c95858;background:-webkit-gradient(linear,left top,left bottom,from( #c95858),to( #a12828));background:-moz_linear-gradient(top, #c95858, #a12828)}.ui-btn-box-s{color:#3a3a3a;background:#ebe8e3;background:-webkit-linear-gradient(top, #ebe8e3, #eae7e2);background:-moz-linear-gradient(top, #ebe8e3, #eae7e2);background:-o-linear-gradient(top, #ebe8e3, #eae7e2);background:-ms-linear-gradient(top, #ebe8e3, #eae7e2);border:1px solid;border-color:#dcdad3;-o-box-shadow:0 0 1px 1px #fff;-ms-box-shadow:0 0 1px 1px #fff;-moz-box-shadow:0 0 1px 1px #fff;-webkit-box-shadow:0 0 1px 1px #fff;box-shadow:0 0 1px 1px #fff}.ui-collapsible-inset{margin:.5em 0}.ui-collapsible-inset .ui-collapsible-heading{margin:0}.ui-collapsible-inset .ui-collapsible-heading .ui-btn{border-right-width:1px;border-left-width:1px}.ui-collapsible-collapsed+.ui-collapsible:not(.ui-collapsible-inset) .ui-collapsible-heading .ui-btn{border-top-width:0}.ui-collapsible-set .ui-collapsible:not(.ui-collapsible-inset) .ui-collapsible-heading .ui-btn{border-top-width:1px}.ui-collapsible-heading,.ui-collapsible-content>li{position:relative}.ui-collapsible-heading{font-size:1rem;display:block;margin:0 -15px;padding:0;position:relative}.ui-collapsible-heading .ui-btn{text-align:left;margin:0;border-left-width:0;border-right-width:0}.ui-collapsible-heading .ui-btn-text{color:#000}.ui-collapsible-heading .ui-btn-inner,.ui-collapsible-heading .ui-btn-icon-left .ui-btn-inner{padding-left:40px}.ui-collapsible-heading .ui-btn-icon-right .ui-btn-inner{padding-left:12px;padding-right:40px}.ui-collapsible-heading .ui-btn-icon-top .ui-btn-inner,.ui-collapsible-heading .ui-btn-icon-bottom .ui-btn-inner{padding-right:40px;text-align:center}.ui-collapsible-heading .ui-btn-inner>.ui-icon-arrow-d{-webkit-transition:all .33s ease;-moz-transition:all .33s ease;-ms-transition:all .33s ease;-o-transition:all .33s ease;transition:all .33s ease;-webkit-transform:rotate(180deg);-moz-transform:rotate(180deg);-ms-transform:rotate(180deg);-o-transform:rotate(180deg);transform:rotate(180deg)}.ui-collapsible-heading .ui-btn-inner>.ui-icon-arrow-u{background-image:url(images/controls/button/00_button_expand_closed.png);-webkit-transition:all .33s ease;-moz-transition:all .33s ease;-ms-transition:all .33s ease;-o-transition:all .33s ease;transition:all .33s ease;-webkit-transform:rotate(0deg);-moz-transform:rotate(0deg);-ms-transform:rotate(0deg);-o-transform:rotate(0deg);transform:rotate(0deg)}.ui-collapsible-heading .ui-btn span.ui-btn{position:absolute;left:6px;top:50%;margin:-12px 0 0 0;width:20px;height:20px;padding:1px 0 1px 2px;text-indent:-9999px}.ui-collapsible-heading .ui-btn span.ui-btn .ui-btn-inner{padding:10px 0}.ui-collapsible-heading .ui-btn span.ui-btn .ui-icon{left:0;margin-top:-10px}.ui-collapsible-heading-status{position:absolute;top:-9999px;left:0}.ui-collapsible-content{display:block;margin:0 -15px;padding:0 15px;border-left-width:0;border-right-width:0;border-top:0;background-image:none;visibility:visible;overflow:auto;-webkit-transition:all .5s ease;-moz-transition:all .5s ease;-ms-transition:all .5s ease;-o-transition:all .5s ease;transition:all .5s ease}.ui-collapsible-inset .ui-collapsible-content{margin:0;border-right-width:1px;border-left-width:1px}.ui-collapsible-content-collapsed{overflow:hidden;max-height:0!important;visibility:hidden}.ui-collapsible-set{margin:.5em 0}.ui-collapsible-set .ui-collapsible{margin:-1px 0 0}.ui-collapsible-set .ui-collapsible:first-child{margin-top:0}.ui-dialog{min-height:480px}.ui-dialog .ui-header,.ui-dialog .ui-content,.ui-dialog .ui-footer{margin:15px;position:relative}.ui-dialog .ui-header,.ui-dialog .ui-footer{z-index:10;width:auto}.ui-dialog .ui-header .ui-btn-left{width:0;border-width:0}.ui-dialog .center_info{display:-moz-box;display:-webkit-box;display:box;-ms-box-orient:vertical;-moz-box-orient:vertical;-o-box-orient:vertical;-webkit-box-orient:vertical;box-orient:vertical;-ms-box-align:center;-moz-box-align:center;-o-box-align:center;-webkit-box-align:center;box-align:center;-ms-box-pack:center;-moz-box-pack:center;-o-box-pack:center;-webkit-box-pack:center;box-pack:center}.ui-dialog .center_info .popup-text{font-size:42px;background:#213c49;width:100%}.ui-dialog .center_info .popup-text p{text-align:center;padding:22px 16px}.ui-checkbox .ui-btn-inner,.ui-radio .ui-btn-inner{white-space:normal}.ui-checkbox,.ui-radio{position:relative;margin:0}.ui-checkbox .ui-btn-corner-all,.ui-radio .ui-btn-corner-all{-o-border-radius:0;-ms-border-radius:0;-moz-border-radius:0;-webkit-border-radius:0;border-radius:0}.ui-checkbox .ui-btn-inner,.ui-radio .ui-btn-inner{border-top:0}.ui-checkbox .ui-btn-up-s,.ui-radio .ui-btn-up-s{border:0;background:transparent;font-weight:400}.ui-checkbox .ui-btn-hover-s,.ui-radio .ui-btn-hover-s{border:0;background:transparent;font-weight:400}.ui-checkbox .ui-btn-down-s,.ui-radio .ui-btn-down-s{border:0;background:transparent;font-weight:400}.ui-checkbox input,.ui-radio input{z-index:1;margin:0;left:.4545454545454546rem;position:absolute;outline:0!important}.ui-checkbox>input,.ui-radio>input{display:none}.ui-checkbox .ui-btn,.ui-radio .ui-btn{z-index:2;height:100%;margin:0;text-align:left}.ui-checkbox .ui-btn.ui-btn-icon-left,.ui-radio .ui-btn.ui-btn-icon-left{display:inline-block}.ui-checkbox .ui-btn.ui-btn-icon-left .ui-btn-inner,.ui-radio .ui-btn.ui-btn-icon-left .ui-btn-inner{min-width:1.8181818181818183rem;display:inline-block;line-height:1.4545454545454546rem;padding:0 .7272727272727273rem 0 .7272727272727273rem}.ui-checkbox .ui-btn.ui-btn-icon-left .ui-btn-inner .ui-btn-text,.ui-radio .ui-btn.ui-btn-icon-left .ui-btn-inner .ui-btn-text{display:inline-block;vertical-align:middle;min-height:1.4545454545454546rem}.ui-checkbox .ui-btn.ui-btn-icon-left .ui-btn-inner .ui-btn-text.ui-btn-text-padding-left,.ui-radio .ui-btn.ui-btn-icon-left .ui-btn-inner .ui-btn-text.ui-btn-text-padding-left{padding-left:1.0909090909090908rem}.ui-checkbox .ui-btn.ui-btn-icon-left .ui-btn-inner .ui-icon,.ui-radio .ui-btn.ui-btn-icon-left .ui-btn-inner .ui-icon{position:absolute;top:50%;width:1.4545454545454546rem;height:1.4545454545454546rem;margin-top:-.7272727272727273rem}.ui-checkbox.favorite input{position:absolute;left:-10000px;height:100%;outline:0!important}.ui-checkbox.favorite .ui-btn.ui-btn-icon-left{display:block}.ui-checkbox.favorite .ui-btn.ui-btn-icon-left .ui-btn-inner{display:inline-block;line-height:1.4545454545454546rem;padding:0 0 0 .7272727272727273rem}.ui-checkbox.favorite .ui-btn.ui-btn-icon-left .ui-btn-inner .ui-btn-text{display:inline-block;vertical-align:middle}.ui-checkbox.favorite .ui-btn.ui-btn-icon-left .ui-btn-inner .ui-btn-text.ui-btn-text-padding-left{padding-left:1.0909090909090908rem}.ui-checkbox.favorite .ui-btn.ui-btn-icon-left .ui-btn-inner .ui-icon{position:absolute;top:50%;width:1.4545454545454546rem;height:1.4545454545454546rem;margin-top:-.7272727272727273rem}.ui-icon-checkbox-off,.ui-icon-checkbox-on,.favorite .ui-icon-checkbox-off,.favorite .ui-icon-checkbox-on,.ui-icon-checkbox-on-press,.ui-icon-checkbox-off-press,.ui-icon-radio-off,.ui-icon-radio-on,.ui-icon-radio-on-press,.ui-icon-radio-off-press{background-size:100% 100%;background-color:transparent}.ui-icon-checkbox-off{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/00_check_bg.png)}.ui-icon-checkbox-on{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/00_check_checking.png),url(images/00_check_bg.png);background-repeat:no-repeat}.ui-icon-checkbox-off-press{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/00_check_bg_press.png)}.ui-icon-checkbox-on-press{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/00_check_checking.png),url(images/00_check_bg_press.png);background-repeat:no-repeat}.favorite .ui-icon-checkbox-off,.favorite .ui-icon-checkbox-off-press{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/00_icon_favorite_off.png)}.favorite .ui-icon-checkbox-on,.favorite .ui-icon-checkbox-on-press{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/controls/00_icon_favorite_on.png)}.ui-icon-radio-off{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/00_button_radio.png)}.ui-icon-radio-on{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/00_button_radio_select.png),url(images/00_button_radio.png)}.ui-icon-radio-on-press{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/00_button_radio.png)}.ui-icon-radio-off-press{width:1.4545454545454546rem;height:1.4545454545454546rem;background-image:url(images/00_button_radio.png)}.ui-field-contain{padding:1.5em 0;margin:0;border-bottom-width:1px;overflow:visible}.ui-field-contain:first-child{border-top-width:0}@media all{.ui-field-contain{ border-width:0;padding:0;margin:.8em 0}}.ui-select{display:block;position:relative}.ui-select select{position:absolute;left:-9999px;top:-9999px}.ui-select .ui-btn{overflow:hidden}.ui-select .ui-btn select{cursor:pointer;-webkit-appearance:button;left:0;top:0;width:100%;min-height:1.5em;min-height:100%;height:3em;max-height:100%;opacity:0;-ms-filter:"alpha(Opacity=0)";filter:alpha(opacity=0);z-index:2}@-moz-document url-prefix(){.ui-select .ui-btn select{ opacity:.0001}}.ui-select .ui-btn select.ui-select-nativeonly{opacity:1;text-indent:0}.ui-select .ui-btn-icon-right .ui-btn-inner{padding-right:45px}.ui-select .ui-btn-icon-right .ui-icon{right:15px}label.ui-select{font-size:16px;line-height:1.4;font-weight:400;margin:0 0 .3em;display:block}.ui-select .ui-btn-text,.ui-selectmenu .ui-btn-text{display:block;min-height:1em}.ui-select .ui-btn-text{text-overflow:ellipsis;overflow:hidden}.ui-selectmenu{position:absolute;padding:0;z-index:100!important;width:80%;max-width:350px;padding:6px}.ui-selectmenu .ui-listview{margin:0}.ui-selectmenu .ui-btn.ui-li-divider{cursor:default}.ui-selectmenu-hidden{top:-9999px;left:-9999px}.ui-selectmenu-screen{position:absolute;top:0;left:0;width:100%;height:100%;z-index:99}.ui-screen-hidden,.ui-selectmenu-list .ui-li .ui-icon{display:none}.ui-selectmenu-list .ui-li .ui-icon{display:block}.ui-li.ui-selectmenu-placeholder{display:none}.ui-selectmenu .ui-header .ui-title{margin:.6em 46px .8em}@media all and (min-width: 450px){label.ui-select{ vertical-align:top;display:inline-block;width:20%;margin:0 2% 0 0}.ui-select{width:60%;display:inline-block}}.ui-selectmenu .ui-header h1:after{content:'.';visibility:hidden}label.ui-input-text{font-size:1rem;line-height:1.2;display:block;font-weight:400;margin:0 0 .3em}input.ui-input-text,textarea.ui-input-text{background-image:none;padding:.4em;line-height:1.4;font-size:.7272727272727273rem;display:block}input.ui-input-text{appearance:none;-webkit-appearance:none}textarea.ui-input-text{height:2.272727272727273rem;resize:none;-webkit-transition:height 200ms linear;-moz-transition:height 200ms linear;-o-transition:height 200ms linear;-ms-transition:height 200ms linear;transition:height 200ms linear}.ui-input-search{position:relative;padding-right:1.6363636363636365rem;padding-left:1.6363636363636365rem;border:1px solid #999;-webkit-box-shadow:inset .09090909090909091rem .09090909090909091rem .09090909090909091rem #999;-moz-box-shadow:inset .09090909090909091rem .09090909090909091rem .09090909090909091rem #999;-o-box-shadow:inset .09090909090909091rem .09090909090909091rem .09090909090909091rem #999;-ms-box-shadow:inset .09090909090909091rem .09090909090909091rem .09090909090909091rem #999;box-shadow:inset .09090909090909091rem .09090909090909091rem .09090909090909091rem #999}.ui-input-search input.ui-input-text{width:100%;border:0;background:transparent none;outline:0!important}.ui-input-search .ui-btn-down-s,.ui-input-search .ui-btn-up-s,.ui-input-search .ui-btn-hover-s{border:0;background:transparent none}.ui-input-search .ui-btn-icon-notext.ui-input-clear{width:1.6363636363636365rem;height:1.5rem}.ui-input-search .ui-btn-icon-notext.ui-input-clear .ui-btn-inner{padding:.2727272727272727rem}.ui-input-search .ui-btn-inner .ui-icon-deleteSearch{width:1rem;height:1rem;margin-top:0;margin-left:0}.ui-input-search .ui-input-clear{position:absolute;right:0;top:0;vertical-align:middle}.ui-input-search .ui-input-clear-hidden{display:none}@media all and (min-width: 721px){label.ui-input-text:not([data-type='search']){ vertical-align:top;display:inline-block;margin:0 2% 0 0}input.ui-input-text:not([data-type='search']),textarea.ui-input-text:not([data-type='search']){width:60%;display:inline-block}.ui-input-search input.ui-input-text:not([data-type='search']){width:85%}}.ui-body-s>div>.ui-field-contain>.input-search-bar,.ui-body-s>.ui-field-contain>.input-search-bar{margin:-2.1818181818181817rem -.6818181818181819rem -1.4545454545454546rem -.6818181818181819rem}.input-search-bar{position:relative;background-color:#f8f6ef;padding:.5909090909090909rem;vertical-align:middle}.input-search-bar .ui-corner-all{-o-border-radius:.3em;-ms-border-radius:.3em;-moz-border-radius:.3em;-webkit-border-radius:.3em;border-radius:.3em}.input-search-bar .ui-input-search{font-size:.7272727272727273rem;display:block;position:relative;background-color:#fff}.input-search-bar .ui-input-search .ui-input-text{height:1.5rem;padding:0;margin-right:1.7272727272727273rem}.input-search-bar .ui-input-search .ui-image-search{position:absolute;top:0;left:0;width:1rem;height:1rem;margin:.2727272727272727rem}.input-search-bar .ui-input-search-default{margin-right:3.409090909090909rem;-webkit-transition:all 400ms linear;-moz-transition:all 400ms linear;-o-transition:all 400ms linear;-ms-transition:all 400ms linear;transition:all 400ms linear}.input-search-bar .ui-input-search-wide{margin-right:0rem;-webkit-transition:all 400ms linear;-moz-transition:all 400ms linear;-o-transition:all 400ms linear;-ms-transition:all 400ms linear;transition:all 400ms linear}.input-search-bar .ui-btn-icon-cancel.ui-input-cancel{display:inline-block;position:absolute;top:.13636363636363635rem;right:0rem;height:1.5rem;margin-right:.4545454545454546rem;vertical-align:middle;padding:0;border-color:none;width:3.090909090909091rem;-webkit-transition:all 400ms linear;-moz-transition:all 400ms linear;-o-transition:all 400ms linear;-ms-transition:all 400ms linear;transition:all 400ms linear}.input-search-bar .ui-btn-icon-cancel.ui-input-cancel .ui-btn-inner{padding-top:.2727272727272727rem;padding-bottom:.2727272727272727rem}.input-search-bar .ui-btn-icon-cancel.ui-input-cancel .ui-btn-inner .ui-btn-text{font-size:.6818181818181819rem}.input-search-bar .ui-btn-icon-cancel.ui-input-cancel.ui-btn-cancel-hide{right:-3.409090909090909rem;visibility:hidden}.input-search-bar .ui-btn-icon-cancel.ui-input-cancel.ui-btn-cancel-show{right:0;visibility:visible}.input-search-bar .ui-search-bar-icon{margin-left:1.9090909090909092rem}.input-search-bar .ui-btn.ui-btn-search-front-icon{position:absolute;width:1.590909090909091rem;height:1.590909090909091rem;top:.09090909090909091rem;border-radius:3rem}.input-search-bar .ui-btn.ui-btn-search-front-icon>.ui-btn-inner.ui-btn-icon-only{border-radius:3rem}.ui-header .input-search-bar{padding-top:.18181818181818182rem;padding-bottom:.18181818181818182rem}.ui-image-search{background-image:url(images/controls/00_search_icon.png);background-repeat:no-repeat;background-size:100% 100%}.ui-icon-deleteSearch{background-image:url(images/controls/00_field_btn_clear.png);background-repeat:no-repeat;background-size:100% 100%}.ui-controlgroup,fieldset.ui-controlgroup{padding:0;margin:.5em 0 1em}.ui-bar .ui-controlgroup{margin:0 .3em}.ui-controlgroup-label{font-size:1em;line-height:1.4;font-weight:400;margin:0 0 .3em}.ui-controlgroup-controls{display:block}.ui-controlgroup li{list-style:none}.ui-controlgroup .ui-btn-inner{white-space:nowrap}.ui-controlgroup .ui-checkbox label label,.ui-controlgroup .ui-radio label{font-size:1em}.ui-controlgroup .ui-radio{width:25%;overflow:hidden}.ui-controlgroup .ui-radio label{text-align:center;white-space:nowrap}.ui-controlgroup .ui-radio-off,.ui-controlgroup .ui-radio-on{width:100%}.ui-controlgroup .ui-radio-on .ui-btn-inner{background:#f8f6ef}.ui-controlgroup .ui-radio-on .ui-btn-inner .ui-btn-text{color:#3b73b6}.ui-controlgroup .ui-corner-left{border-left-width:0}.ui-controlgroup .ui-corner-right{border-right-width:0}.ui-controlgroup-vertical .ui-btn,.ui-controlgroup-vertical .ui-checkbox,.ui-controlgroup-vertical .ui-radio{margin:0;border-bottom-width:0}.ui-controlgroup-vertical .ui-controlgroup-last{border-bottom-width:1px}.ui-controlgroup-vertical .ui-radio{width:100%}.ui-controlgroup-vertical .ui-radio label{text-align:left}.ui-controlgroup-vertical .ui-radio label .ui-btn-inner{margin-left:.7272727272727273rem;margin-right:.7272727272727273rem}.ui-controlgroup-horizontal{padding:0}.ui-controlgroup-horizontal .ui-btn{display:inline-block;margin-left:-.18181818181818182rem;margin-right:-.13636363636363635rem}.ui-controlgroup-horizontal .ui-checkbox,.ui-controlgroup-horizontal .ui-radio{float:left;margin:0 -1px 0 0}.ui-controlgroup-horizontal .ui-controlgroup-last{margin-right:0}.ui-controlgroup-horizontal [data-role="button"]{border-top:0;border-bottom:0;border-radius:0;box-shadow:none;background:0}.ui-controlgroup-horizontal [data-role="button"].ui-btn-down-s .ui-btn-inner,.ui-controlgroup-horizontal [data-role="button"] .ui-btn-active-s .ui-btn-inner{background:#f8f6ef}.ui-controlgroup-horizontal [data-role="button"].ui-btn-down-s .ui-btn-inner .ui-btn-text,.ui-controlgroup-horizontal [data-role="button"] .ui-btn-active-s .ui-btn-inner .ui-btn-text{color:#3b73b6}.ui-controlgroup-horizontal [data-role="button"].ui-btn-down-s .ui-btn-inner{background:-webkit-linear-gradient(top, #d2d2c8 0, #f6f8ef 100%)}.ui-controlgroup-horizontal [data-role="button"]>.ui-btn-inner{border:0 solid;box-shadow:none;padding-top:.2272727272727273rem;padding-bottom:.2272727272727273rem;padding-left:.4545454545454546rem;padding-right:.4545454545454546rem}.ui-controlgroup-horizontal label>span.ui-btn-inner{padding-top:.13636363636363635rem;padding-bottom:.13636363636363635rem}.ui-listview{margin:0;counter-reset:listnumbering;border-top-color:rgba(211,209,203,.5)}.ui-listview li.ui-btn>.ui-btn-hastxt>.ui-btn-text.ui-btn-text-padding-right{padding-right:0rem}.ui-listview .ui-li{border-left-width:0;border-right-width:0;border-top-width:0}.ui-listview .ui-li>.ui-btn-inner{border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgba(211,209,203,.5);margin-left:.5909090909090909rem;margin-right:.5909090909090909rem}.ui-listview .ui-li-static{background-color:#f8f6ef;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgba(211,209,203,.5);margin-left:.5909090909090909rem;margin-right:.5909090909090909rem}.ui-listview .ui-li:not(.ui-li-divider):not(.ui-li-static){min-height:2.5rem}.ui-listview .ui-li.ui-li-has-multiline:not(.ui-li-divider):not(.ui-li-static){min-height:2.909090909090909rem}.ui-listview li.ui-btn-up-s,.ui-listview li.ui-btn-hover-s{background:0;background-color:#f8f6ef;color:#000}.ui-listview li.ui-btn-down-s{background:0;background-color:#5787c2;color:#000}.ui-listview li.ui-btn-up-s>.ui-li>.ui-btn-text>a.ui-link-inherit,.ui-listview li.ui-btn-hover-s>.ui-li>.ui-btn-text>a.ui-link-inherit{color:#000}.ui-listview li.ui-btn-down-s>.ui-li>.ui-btn-text>a.ui-link-inherit{color:#f9f9f9}.ui-content .ui-listview{margin-left:-.36363636363636365rem;margin-right:-.36363636363636365rem;padding-bottom:1px}.ui-content .ui-listview .ui-listview{margin:0}.ui-content .ui-listview-inset{margin:1em 0}.ui-listview,.ui-li,.ui-collapsible-heading{list-style:none;padding:0;font-size:1rem}.ui-li,.ui-collapsible-heading,.ui-li.ui-field-contain{display:block;margin:0;position:relative;overflow:visible;text-align:left}.ui-li .ui-btn{top:50%;margin-top:-.8em}.ui-li h3,.ui-collapsible-heading h3,.ui-collapsible>.ui-collapsible-content h3,.ui-listview li h3{margin-top:0;margin-bottom:0;font-size:1rem;font-weight:400}.ui-li form,.ui-collapsible-heading form,.ui-collapsible>.ui-collapsible-content form,.ui-listview li form{display:inline-block}.ui-li .ui-btn-text,.ui-collapsible-heading .ui-btn-text,.ui-collapsible>.ui-collapsible-content .ui-btn-text,.ui-listview li .ui-btn-text{position:relative}.ui-li .ui-btn-text a.ui-link-inherit,.ui-collapsible-heading .ui-btn-text a.ui-link-inherit,.ui-collapsible>.ui-collapsible-content .ui-btn-text a.ui-link-inherit,.ui-listview li .ui-btn-text a.ui-link-inherit{white-space:nowrap;text-overflow:ellipsis;-o-text-overflow:ellipsis;overflow:hidden!important}.ui-li:last-child,.ui-collapsible-heading:last-child,.ui-collapsible>.ui-collapsible-content:last-child,.ui-listview li:last-child,.ui-li.ui-field-contain:last-child,.ui-collapsible-heading.ui-field-contain:last-child,.ui-collapsible>.ui-collapsible-content.ui-field-contain:last-child,.ui-listview li.ui-field-contain:last-child{border-bottom-width:1px}.ui-li>.ui-btn-inner,.ui-collapsible-heading>.ui-btn-inner,.ui-collapsible>.ui-collapsible-content>.ui-btn-inner,.ui-listview li>.ui-btn-inner,.ui-li.ui-collapsible-heading>.ui-collapsible-heading-toggle,.ui-collapsible-heading.ui-collapsible-heading>.ui-collapsible-heading-toggle,.ui-collapsible>.ui-collapsible-content.ui-collapsible-heading>.ui-collapsible-heading-toggle,.ui-listview li.ui-collapsible-heading>.ui-collapsible-heading-toggle{display:block;position:relative;padding:0;border-width:0}.ui-li>.ui-btn-inner.ui-btn-hastxt,.ui-collapsible-heading>.ui-btn-inner.ui-btn-hastxt,.ui-collapsible>.ui-collapsible-content>.ui-btn-inner.ui-btn-hastxt,.ui-listview li>.ui-btn-inner.ui-btn-hastxt{padding:0 0}.ui-li .ui-btn-inner a.ui-link-inherit,.ui-collapsible-heading .ui-btn-inner a.ui-link-inherit,.ui-collapsible>.ui-collapsible-content .ui-btn-inner a.ui-link-inherit,.ui-listview li .ui-btn-inner a.ui-link-inherit,.ui-li .ui-collapsible-heading-toggle>.ui-btn-inner,.ui-collapsible-heading .ui-collapsible-heading-toggle>.ui-btn-inner,.ui-collapsible>.ui-collapsible-content .ui-collapsible-heading-toggle>.ui-btn-inner,.ui-listview li .ui-collapsible-heading-toggle>.ui-btn-inner,.ui-li>li,.ui-collapsible-heading>li,.ui-collapsible>.ui-collapsible-content>li,.ui-listview li>li,.ui-li.ui-li-static,.ui-collapsible-heading.ui-li-static,.ui-collapsible>.ui-collapsible-content.ui-li-static,.ui-listview li.ui-li-static{padding-top:.6818181818181819rem;padding-bottom:.6818181818181819rem;display:block;white-space:normal;border-left-width:0;border-right-width:0}.ui-li .ui-btn-inner a.ui-link-inherit,.ui-collapsible-heading .ui-btn-inner a.ui-link-inherit,.ui-collapsible>.ui-collapsible-content .ui-btn-inner a.ui-link-inherit,.ui-listview li .ui-btn-inner a.ui-link-inherit,.ui-li .ui-collapsible-heading-toggle,.ui-collapsible-heading .ui-collapsible-heading-toggle,.ui-collapsible>.ui-collapsible-content .ui-collapsible-heading-toggle,.ui-listview li .ui-collapsible-heading-toggle{white-space:normal;overflow:visible!important}.ui-li .ui-toggle-switch:last-child,.ui-collapsible-heading .ui-toggle-switch:last-child,.ui-collapsible>.ui-collapsible-content .ui-toggle-switch:last-child,.ui-listview li .ui-toggle-switch:last-child{top:50%;margin-top:-.7727272727272727rem;display:inline-block;position:absolute;right:0}.ui-li [data-role="button"]:last-child,.ui-collapsible-heading [data-role="button"]:last-child,.ui-collapsible>.ui-collapsible-content [data-role="button"]:last-child,.ui-listview li [data-role="button"]:last-child{position:absolute;right:0}.ui-li .ui-radio:first-child,.ui-collapsible-heading .ui-radio:first-child,.ui-collapsible>.ui-collapsible-content .ui-radio:first-child,.ui-listview li .ui-radio:first-child,.ui-li .ui-checkbox:first-child,.ui-collapsible-heading .ui-checkbox:first-child,.ui-collapsible>.ui-collapsible-content .ui-checkbox:first-child,.ui-listview li .ui-checkbox:first-child{position:absolute;top:50%;margin-top:-.6818181818181819rem;left:-.18181818181818182rem;width:1.3636363636363638rem;height:1.3636363636363638rem}.ui-li .ui-radio:first-child .ui-btn-inner,.ui-collapsible-heading .ui-radio:first-child .ui-btn-inner,.ui-collapsible>.ui-collapsible-content .ui-radio:first-child .ui-btn-inner,.ui-listview li .ui-radio:first-child .ui-btn-inner,.ui-li .ui-checkbox:first-child .ui-btn-inner,.ui-collapsible-heading .ui-checkbox:first-child .ui-btn-inner,.ui-collapsible>.ui-collapsible-content .ui-checkbox:first-child .ui-btn-inner,.ui-listview li .ui-checkbox:first-child .ui-btn-inner{line-height:.9090909090909092rem;color:transparent}.ui-li .ui-radio:first-child .ui-btn-inner .ui-icon,.ui-collapsible-heading .ui-radio:first-child .ui-btn-inner .ui-icon,.ui-collapsible>.ui-collapsible-content .ui-radio:first-child .ui-btn-inner .ui-icon,.ui-listview li .ui-radio:first-child .ui-btn-inner .ui-icon,.ui-li .ui-checkbox:first-child .ui-btn-inner .ui-icon,.ui-collapsible-heading .ui-checkbox:first-child .ui-btn-inner .ui-icon,.ui-collapsible>.ui-collapsible-content .ui-checkbox:first-child .ui-btn-inner .ui-icon,.ui-listview li .ui-checkbox:first-child .ui-btn-inner .ui-icon{left:.2272727272727273rem}.ui-li .ui-radio:first-child label.ui-btn-icon_only,.ui-collapsible-heading .ui-radio:first-child label.ui-btn-icon_only,.ui-collapsible>.ui-collapsible-content .ui-radio:first-child label.ui-btn-icon_only,.ui-listview li .ui-radio:first-child label.ui-btn-icon_only,.ui-li .ui-checkbox:first-child label.ui-btn-icon_only,.ui-collapsible-heading .ui-checkbox:first-child label.ui-btn-icon_only,.ui-collapsible>.ui-collapsible-content .ui-checkbox:first-child label.ui-btn-icon_only,.ui-listview li .ui-checkbox:first-child label.ui-btn-icon_only{top:0;margin-top:0}.ui-li img.ui-li-bigicon,.ui-collapsible-heading img.ui-li-bigicon,.ui-collapsible>.ui-collapsible-content img.ui-li-bigicon,.ui-listview li img.ui-li-bigicon{position:absolute;width:1.590909090909091rem;height:1.590909090909091rem;top:50%;margin-top:-.8181818181818182rem}.ui-li img.ui-li-bigicon:first-child,.ui-collapsible-heading img.ui-li-bigicon:first-child,.ui-collapsible>.ui-collapsible-content img.ui-li-bigicon:first-child,.ui-listview li img.ui-li-bigicon:first-child{left:0}.ui-li img.ui-li-bigicon:nth-child(2),.ui-collapsible-heading img.ui-li-bigicon:nth-child(2),.ui-collapsible>.ui-collapsible-content img.ui-li-bigicon:nth-child(2),.ui-listview li img.ui-li-bigicon:nth-child(2){left:1.6363636363636365rem}.ui-li img.ui-li-bigicon:last-child,.ui-collapsible-heading img.ui-li-bigicon:last-child,.ui-collapsible>.ui-collapsible-content img.ui-li-bigicon:last-child,.ui-listview li img.ui-li-bigicon:last-child{right:.7272727272727273rem}.ui-li .ui-li-color-bar+img.ui-li-bigicon:nth-child(2),.ui-collapsible-heading .ui-li-color-bar+img.ui-li-bigicon:nth-child(2),.ui-collapsible>.ui-collapsible-content .ui-li-color-bar+img.ui-li-bigicon:nth-child(2),.ui-listview li .ui-li-color-bar+img.ui-li-bigicon:nth-child(2){left:0}.ui-li .ui-li-color-bar,.ui-collapsible-heading .ui-li-color-bar,.ui-collapsible>.ui-collapsible-content .ui-li-color-bar,.ui-listview li .ui-li-color-bar{position:absolute;width:.13636363636363635rem;height:100%;top:0rem;left:-.5909090909090909rem;background-color:#000}li.ui-li-thumbnail-right img.ui-li-bigicon.ui-li-thumb{left:auto;right:0;width:2.3181818181818183rem;height:2.3181818181818183rem;margin-top:-1.1363636363636365rem}.ui-li.ui-li-has-multiline .ui-btn-inner a.ui-link-inherit,.ui-li.ui-li-has-multiline.ui-li-static{padding-top:.3181818181818182rem;padding-bottom:1.2727272727272727rem}.ui-li.ui-li-has-multiline a{white-space:normal;overflow:visible!important;padding-right:.7272727272727273rem}.ui-li.ui-li-text-ellipsis .ui-btn-inner a.ui-link-inherit{white-space:nowrap;text-overflow:ellipsis;-o-text-overflow:ellipsis;overflow:hidden!important}.ui-li.ui-li-text-ellipsis a{white-space:nowrap;text-overflow:ellipsis;-o-text-overflow:ellipsis;overflow:hidden!important}.ui-li.ui-li-text-ellipsis.ui-li-static{white-space:nowrap;text-overflow:ellipsis;-o-text-overflow:ellipsis;overflow:hidden!important}.ui-li>input{border-style:none;border-width:0;outline-color:#f8f6ef;font-size:1.0454545454545454rem;line-height:1;padding-top:0;padding-bottom:0}.ui-listview li.ui-li-divider{background:#f8f6ef;color:#3b73b6;border-bottom-width:0;border-top-width:0;cursor:default;counter-reset:listnumbering;font-weight:700;height:1.7272727272727273rem;font-size:.7272727272727273rem}.ui-listview li.ui-li-divider>.ui-btn-inner>.ui-btn-text{font-size:.7272727272727273rem}.ui-listview li.ui-li-divider.ui-btn{top:0;margin-top:0rem;border-radius:0;font-size:.7272727272727273rem}.ui-listview li.ui-li-divider.ui-btn .ui-btn-inner.ui-btn-hastxt{height:100%;padding-left:0}.ui-listview li.ui-li-divider.ui-btn .ui-btn-inner.ui-btn-hastxt .ui-btn-text{position:absolute;top:.2272727272727273rem;height:.8181818181818182rem;padding-right:.4545454545454546rem}.ui-listview li.ui-li-divider:not(.ui-btn){margin-left:.5454545454545454rem;margin-right:.5454545454545454rem}.ui-listview li.ui-li-divider>.ui-btn-text{position:absolute;top:.2272727272727273rem;height:.8181818181818182rem;padding-right:.4545454545454546rem}.ui-listview li.ui-li-divider[data-style="dialogue"]{height:.9090909090909092rem;padding:0;padding-top:.9090909090909092rem;padding-bottom:0rem;padding-left:.4545454545454546rem;margin-left:.18181818181818182rem;margin-right:.18181818181818182rem;font-size:.7272727272727273rem;font-weight:700;color:#3b73b6;background:#f8f6ef}.ui-listview li.ui-li-divider[data-style="check"]{height:1.7272727272727273rem;padding-top:0;padding-bottom:0;padding-left:0}.ui-listview li.ui-li-divider[data-style="check"] label{top:0;margin:0}.ui-listview li.ui-li-divider[data-style="check"] label .ui-btn-inner{z-index:5;position:absolute;width:1.4545454545454546rem;height:1.4545454545454546rem;background:#f8f6ef;padding:0}.ui-listview li.ui-li-divider[data-style="check"] .ui-btn-text{padding-left:1.6818181818181819rem}.ui-listview li.ui-li-divider .ui-divider-normal-line{display:inline-block;position:absolute;top:1.0454545454545454rem;width:100%;height:.09090909090909091rem;background:#3b73b6}.ui-listview li.ui-li-divider.ui-btn-down-s{background:#3b73b6;color:#f8f6ef}.ui-listview li.ui-li-divider.ui-btn-down-s .ui-divider-normal-line{background:#f8f6ef}.ui-listview li.ui-li-divider.ui-btn-down-s label>.ui-btn-inner{background:#3b73b6}.ui-listview li.ui-li-divider+li.ui-li-dialogue{border-top-left-radius:3px;border-top-right-radius:3px}.ui-divider-expand-div{position:absolute;width:4.454545454545455rem;height:1.9090909090909092rem;top:.4545454545454546rem;right:0;border-left-width:1px;border-left-style:solid;border-left-color:rgba(0,0,0,.5)}.ui-li-has-thumb:not(.ui-li-thumbnail-right) .ui-btn-inner a.ui-link-inherit,.ui-li-has-thumb:not(.ui-li-thumbnail-right).ui-li-static{padding-left:2.0454545454545454rem}.ui-li-has-thumb:not(.ui-li-thumbnail-right) .ui-li-text-sub{padding-left:2.0454545454545454rem;padding-right:0}.ui-li-has-checkbox .ui-btn-inner a.ui-link-inherit,.ui-li-has-radio .ui-btn-inner a.ui-link-inherit,.ui-li-has-checkbox.ui-li-static,.ui-li-has-radio.ui-li-static{padding-left:1.6363636363636365rem}.ui-li-has-checkbox .ui-li-text-sub,.ui-li-has-radio .ui-li-text-sub{padding-left:1.6363636363636365rem}.ui-li-has-thumb.ui-li-has-checkbox .ui-btn-inner a.ui-link-inherit,.ui-li-has-thumb.ui-li-has-radio .ui-btn-inner a.ui-link-inherit,.ui-li-has-thumb.ui-li-has-checkbox.ui-li-static,.ui-li-has-thumb.ui-li-has-radio.ui-li-static{padding-left:3.5454545454545454rem}.ui-li-has-thumb.ui-li-has-checkbox .ui-li-text-sub,.ui-li-has-thumb.ui-li-has-radio .ui-li-text-sub{padding-left:3.5454545454545454rem}.ui-li.ui-li-has-right-circle-btn .ui-btn-inner a{padding-right:2.1818181818181817rem}.ui-li.ui-li-has-right-btn:not(.ui-swipe) .ui-btn-inner a{padding-right:3.590909090909091rem}.ui-li.ui-li-thumbnail-right .ui-btn-inner a{padding-right:2.3636363636363638rem}.ui-li.ui-li-static.ui-li-has-right-circle-btn{padding-right:2.1818181818181817rem}.ui-li.ui-li-static.ui-li-has-right-btn:not(.ui-swipe){padding-right:3.590909090909091rem}.ui-li.ui-li-static.ui-li-thumbnail-right{padding-right:2.3636363636363638rem}.ui-li-has-icon .ui-btn-inner a.ui-link-inherit,.ui-li-has-icon.ui-li-static{min-height:20px;padding-left:40px}.ui-li-has-icon .ui-li-text-sub{padding-left:40px}.ui-li-heading{font-size:16px;font-weight:700;display:block;margin:.6em 0;white-space:nowrap;text-overflow:ellipsis;-o-text-overflow:ellipsis;overflow:hidden!important}.ui-li-thumb,.ui-li-icon{position:absolute;left:1px;top:0;max-height:3.272727272727273rem;max-width:3.272727272727273rem}.ui-listview * .ui-btn-inner>.ui-btn>.ui-btn-inner{border-top:0}.ui-li-sub,.ui-li-sub-setting{float:right;text-align:right;font-size:.7272727272727273rem;margin:.3em 0}.ui-li-text-sub{float:right;text-align:right;font-size:.7272727272727273rem;color:#646464;position:absolute;right:0;top:.9090909090909092rem;width:95%;white-space:nowrap;text-overflow:ellipsis;-o-text-overflow:ellipsis;overflow:hidden!important}.ui-li-text-sub>img{position:relative;width:.7727272727272727rem;height:.7727272727272727rem;margin:0 .36363636363636365rem 0 .36363636363636365rem}.ui-li-text-sub2{float:right;text-align:right;font-size:.7272727272727273rem;color:#646464;position:absolute;right:0;top:.7272727272727273rem;width:60%;white-space:nowrap;text-overflow:ellipsis;-o-text-overflow:ellipsis;overflow:hidden!important}.ui-li-text-sub2>img{width:.7727272727272727rem;height:.7727272727272727rem;margin:0 0 0 .36363636363636365rem}.ui-li-has-multiline .ui-li-text-sub{position:absolute;text-align:left;right:auto;left:0;top:1.590909090909091rem;margin-top:0;width:90%;white-space:nowrap;text-overflow:ellipsis;-o-text-overflow:ellipsis;overflow:hidden!important}.ui-li-has-multiline.ui-li-has-right-btn .ui-btn-inner a .ui-li-text-sub{width:74%}.ui-li-has-multiline.ui-li-has-right-btn.ui-li-has-thumb .ui-btn-inner a .ui-li-text-sub{width:64%}.ui-li-has-multiline.ui-li-static.ui-li-has-right-btn .ui-li-text-sub{width:74%}.ui-li-has-multiline.ui-li-static.ui-li-has-right-btn.ui-li-has-thumb .ui-li-text-sub{width:64%}.ui-li-icon-sub-right,.ui-li-icon-sub{position:absolute;left:auto;width:.7727272727272727rem;height:.7727272727272727rem;margin:0 0}.ui-li-icon-sub-right{right:.36363636363636365rem}.ui-listview li.ui-li-dialogue{margin-left:.18181818181818182rem;margin-right:.18181818181818182rem;padding-left:.4545454545454546rem;padding-right:.4545454545454546rem;border-style:solid;border-color:#8e9aa3;border-width:1px;border-top-width:0}.ui-listview li.ui-li-dialogue>.ui-btn-inner{margin-left:0;margin-right:0;border-bottom-width:0}.ui-listview li.ui-li-dialogue:first-child{border-top-width:1px;border-top-left-radius:3px;border-top-right-radius:3px}.ui-listview li.ui-li-dialogue:last-child{border-bottom-left-radius:3px;border-bottom-right-radius:3px}.ui-listview li.ui-li-dialogue>img{margin-left:.2727272727272727rem}.ui-listview li.ui-li-dialogue [data-role="button"]:last-child{margin-right:.4545454545454546rem}.ui-listview li.ui-li-dialogue .ui-link-inherit>.ui-btn{margin-right:0}.ui-listview li.ui-li-dialogue.ui-li-static .ui-li-text-sub,.ui-listview li.ui-li-dialogue.ui-li-static .ui-toggle-switch{right:.4545454545454546rem}.ui-listview li.ui-li-dialogue.ui-li-static.ui-li-has-checkbox,.ui-listview li.ui-li-dialogue.ui-li-static.ui-li-has-radio{padding-left:1.6363636363636365rem}.ui-listview li.ui-li-dialogue.ui-li-static .ui-checkbox,.ui-listview li.ui-li-dialogue.ui-li-static .ui-radio{left:0}.ui-listview li.ui-li-dialogue.ui-li-has-multiline.ui-li-static .ui-li-text-sub{padding-left:.4545454545454546rem}.ui-listview li.ui-li-dialogue.ui-li-has-multiline.ui-li-static .ui-li-text-sub2{padding-right:.4545454545454546rem}.ui-listview li.ui-li-dialogue.ui-li-has-multiline.ui-li-static.ui-li-has-checkbox .ui-li-text-sub,.ui-listview li.ui-li-dialogue.ui-li-has-multiline.ui-li-static.ui-li-has-radio .ui-li-text-sub{padding-left:1.9090909090909092rem}.ui-listview li.ui-li-divider+.ui-li-dialogue{border-top-width:1px}.ui-listview>li.ui-li-dialogue.ui-body-s:not(.ui-li-expanded),.ui-listview>li.ui-li-dialogue.ui-btn-hover-up-s:not(.ui-btn-down-s):not(.ui-li-expanded),.ui-listview>li.ui-li-dialogue.ui-btn-up-s:not(.ui-li-expanded){background:#efede5}.ui-listview>li.ui-li-dialogue.ui-li-expanded{padding-left:1.1818181818181819rem;background:#dcdad3}.ui-listview>li.ui-li-dialogue.ui-li-divider{height:1.4545454545454546rem;padding:0}.ui-listview>li.ui-li-group-title{padding-top:1.4545454545454546rem}.ui-listview>li.ui-li-group-title span{padding-left:.7272727272727273rem}.ui-listview>li.ui-li-dialogue-divider{padding-top:.9090909090909092rem;padding-bottom:0rem;padding-left:.4545454545454546rem;margin-left:.18181818181818182rem;margin-right:.18181818181818182rem;background:#efede5;font-size:.7272727272727273rem;font-weight:700;color:#3b73b6}.ui-listview li.ui-li-dialogue-edit{padding-left:5.2727272727272725rem;padding-top:.5454545454545454rem;padding-bottom:.5454545454545454rem}.ui-listview li.ui-li-dialogue-edit .ui-edit-title{position:absolute;left:.4545454545454546rem;width:4.136363636363637rem;padding-right:.36363636363636365rem;display:inline-block;top:50%;margin-top:-.5909090909090909rem;border-right-color:#b9b8b2;border-right-width:1px;border-right-style:solid}.ui-listview li.ui-li-dialogue-edit input{font-size:1rem;background:transparent;outline-color:transparent;width:100%;padding-left:0;padding-right:0}.ui-listview>.ui-li.ui-li-dialogue-edit.ui-li-has-right-btn{padding-right:5rem}.ui-listview .ui-li-static.ui-li-bubble-receive,.ui-listview .ui-li-static.ui-li-bubble-left{color:#fff}.ui-listview .ui-li-static.ui-li-bubble-receive>.ui-li-bubble-time,.ui-listview .ui-li-static.ui-li-bubble-left>.ui-li-bubble-time{color:#d30000}.ui-listview .ui-li-static.ui-li-bubble-sent,.ui-listview .ui-li-static.ui-li-bubble-right{color:#000}.ui-listview .ui-li-static.ui-li-bubble-sent>.ui-li-bubble-time,.ui-listview .ui-li-static.ui-li-bubble-right>.ui-li-bubble-time{color:#39a6d7}.ui-listview .ui-li-static.ui-li-bubble-sos{color:#e94949}.ui-listview .ui-li-static.ui-li-bubble-sos>.ui-li-bubble-time{color:#d30000}.ui-listview .ui-li-static.ui-li-bubble-date{background-color:rgba(225,225,225,0);color:#686868;font-style:italic}.ui-listview span.ui-li-bubble-time{font-weight:700}.ui-listview .ui-li-bubble-receive,.ui-listview .ui-li-bubble-left,.ui-listview .ui-li-bubble-sent,.ui-listview .ui-li-bubble-right,.ui-listview .ui-li-bubble-sos{display:inline-block;background-clip:padding-box;max-width:100%;word-wrap:break-word;font-size:.8636363636363636rem}.ui-listview .ui-li-bubble-receive p,.ui-listview .ui-li-bubble-left p,.ui-listview .ui-li-bubble-sent p,.ui-listview .ui-li-bubble-right p,.ui-listview .ui-li-bubble-sos p,.ui-listview .ui-li-bubble-receive span,.ui-listview .ui-li-bubble-left span,.ui-listview .ui-li-bubble-sent span,.ui-listview .ui-li-bubble-right span,.ui-listview .ui-li-bubble-sos span{font-size:.8636363636363636rem}.ui-listview .ui-li-bubble-receive img,.ui-listview .ui-li-bubble-left img,.ui-listview .ui-li-bubble-sent img,.ui-listview .ui-li-bubble-right img,.ui-listview .ui-li-bubble-sos img{position:relative;min-width:7.272727272727273rem;min-height:7.272727272727273rem}.ui-listview .ui-li-bubble-receive,.ui-listview .ui-li-bubble-left{margin-left:0;margin-right:1.6rem;border-image-source:url(images/00_messagebubble_bg_receive.9.png);border-image-slice:57 14 21 48 fill;border-image-width:auto;padding:9px 14px 21px 48px}.ui-listview .ui-li-bubble-receive>.ui-li-bubble-time,.ui-listview .ui-li-bubble-left>.ui-li-bubble-time{position:absolute;display:inline-block;bottom:.36363636363636365rem;left:100%;font-size:.5rem}.ui-listview .ui-li-bubble-sent,.ui-listview .ui-li-bubble-right{margin-left:1.6rem;margin-right:0;border-image-source:url(images/00_messagebubble_bg_sent.9.png);border-image-slice:55 47 20 13 fill;border-image-width:auto;padding:9px 47px 20px 13px}.ui-listview .ui-li-bubble-sent>.ui-li-bubble-time,.ui-listview .ui-li-bubble-right>.ui-li-bubble-time{position:absolute;display:inline-block;bottom:.36363636363636365rem;right:100%;font-size:.5rem}.ui-listview .ui-li-bubble-date{float:left;width:100%;height:1.0909090909090908rem;background-image:url(images/00_messagebubble_date_bg.png);background-repeat:repeat-x;background-position:center center;font-size:.7272727272727273rem;margin:.9090909090909092rem .2727272727272727rem;border:0 none red;padding:0 0;padding-top:.5em;text-align:center}.ui-listview .ui-li-bubble-date *{display:inline-block;background-color:#f8f6ef;padding-left:.5em;padding-right:.5em}@-webkit-keyframes addliitem{from{ -webkit-transform:scale(0.5);-moz-transform:scale(0.5);opacity:0}to{-webkit-transform:scale(1);-moz-transform:scale(1);opacity:1}}.addli{-webkit-animation-name:addliitem;-moz-animation-name:addliitem;-webkit-animation-duration:.5s;-moz-animation-duration:.5s;-webkit-transition-timing-function:linear;-moz-transition-timing-function:linear}@-webkit-keyframes removeliitem{from{ -webkit-transform:scale(1);-moz-transform:scale(1);opacity:1}to{-webkit-transform:scale(0.5);-moz-transform:scale(0.5);opacity:0}}.removeli{-webkit-animation-name:removeliitem;-moz-animation-name:removeliitem;-webkit-animation-duration:.5s;-moz-animation-duration:.5s;-webkit-transition-timing-function:linear;-moz-transition-timing-function:linear}.ui-controlgroup .ui-radio>.ui-btn{background:#f8f6ef}.ui-controlgroup .ui-btn-text{font-size:.7727272727272727rem;font-weight:700;color:#3a3a3a}.ui-controlgroup .ui-btn-inner .ui-corner-left .ui-controlgroup-first{-o-border-radius:.3em;-ms-border-radius:.3em;-moz-border-radius:.3em;-webkit-border-radius:.3em;border-radius:.3em}.ui-controlgroup .ui-btn-inner .ui-corner-right .ui-controlgroup-last{-o-border-radius:.3em;-ms-border-radius:.3em;-moz-border-radius:.3em;-webkit-border-radius:.3em;border-radius:.3em}.ui-controlgroup .ui-radio-off.ui-btn-hover-s.ui-btn-down-s .ui-btn-inner,.ui-controlgroup .ui-radio-on .ui-btn-inner{color:#3b7796}.ui-controlgroup .ui-radio-off .ui-btn-inner{color:#3a3a3a}.ui-controlgroup.ui-controlgroup-horizontal .ui-radio .ui-btn-down-s .ui-btn-inner{background:-webkit-linear-gradient(top, #d2d2c8 0, #f6f8ef 100%)}ul.ui-virtual-list-container>li.position_absolute{position:absolute}ul.ui-virtual-list-container>ul.position_absolute{position:absolute}.ui-scrollview-clip{position:relative}.ui-scrollview-view{overflow:visible;overflow-x:hidden}.ui-scrolllistview .ui-li-divider{z-index:10}.ui-scrollbar{position:absolute;overflow:hidden;opacity:0}.ui-scrollbar-visible{opacity:1}.ui-scrollbar-y{top:.09090909090909091rem;right:.09090909090909091rem;bottom:.09090909090909091rem;width:.36363636363636365rem}.ui-scrollbar-x{right:.09090909090909091rem;bottom:.09090909090909091rem;left:.09090909090909091rem;height:.36363636363636365rem}.ui-scrollbar-track{position:relative;width:100%;height:100%}.ui-scrollbar-thumb{position:absolute;top:0;left:0;background-color:#c6c4be}.ui-scrollbar-y .ui-scrollbar-thumb{width:.2272727272727273rem;height:100%;-o-border-radius:.09090909090909091rem;-ms-border-radius:.09090909090909091rem;-moz-border-radius:.09090909090909091rem;-webkit-border-radius:.09090909090909091rem;border-radius:.09090909090909091rem;-o-box-shadow:.045454545454545456rem .045454545454545456rem .09090909090909091rem #94928c;-ms-box-shadow:.045454545454545456rem .045454545454545456rem .09090909090909091rem #94928c;-moz-box-shadow:.045454545454545456rem .045454545454545456rem .09090909090909091rem #94928c;-webkit-box-shadow:.045454545454545456rem .045454545454545456rem .09090909090909091rem #94928c;box-shadow:.045454545454545456rem .045454545454545456rem .09090909090909091rem #94928c}.ui-scrollbar-x .ui-scrollbar-thumb{width:100%;height:.2272727272727273rem;-o-border-radius:.09090909090909091rem;-ms-border-radius:.09090909090909091rem;-moz-border-radius:.09090909090909091rem;-webkit-border-radius:.09090909090909091rem;border-radius:.09090909090909091rem}.ui-scroll-jump-top-bg{position:absolute;top:.4090909090909091rem;right:.5909090909090909rem;width:1.6818181818181819rem;height:1.6818181818181819rem}.ui-scroll-jump-left-bg{position:absolute;bottom:.4090909090909091rem;left:.5909090909090909rem;width:1.6818181818181819rem;height:1.6818181818181819rem}.ui-overflow-indicator-top{position:absolute;display:block;top:0;width:100%;height:.4545454545454546rem;opacity:0;background:-webkit-gradient(linear,left bottom,left top,color-stop(0, #fff),color-stop(1, #808080))}.ui-overflow-indicator-bottom{position:absolute;display:block;bottom:0;width:100%;height:.4545454545454546rem;opacity:0;background:-webkit-gradient(linear,left bottom,left top,color-stop(0, #808080),color-stop(1, #fff))}.ui-content.ui-scrollview-clip{padding:0}.ui-content.ui-scrollview-clip>div.ui-scrollview-view{margin:0;padding-left:.36363636363636365rem;padding-right:.36363636363636365rem}.ui-content.ui-scrollview-clip>.ui-listview.ui-scrollview-view{margin:0}@-webkit-keyframes ui-datetime-in{from{ -webkit-transform:translateY(0.6363636363636364rem) scale(0.9)}to{-webkit-transform:translateY(0) scale(1)}}@-webkit-keyframes ui-datetime-out{from{ opacity:.8;-webkit-transform:translateY(0) scale(0.6)}to{opacity:0;-webkit-transform:translateY(-.6363636363636364rem) scale(0.6)}}.ui-datefield .ui-datefield-seperator{display:inline-block;min-width:.4545454545454546rem;text-align:center}.ui-datefield .date,.ui-datefield .time,.ui-datefield .ui-datefield-tab{display:inline-block}.ui-datefield .ui-datefield-tab{min-width:.9090909090909092rem}.ui-datefield .ui-btn-box-s .ui-btn-inner.ui-btn-hastxt{padding:.1em .5em}.ui-datefield .ui-datefield-selected{display:inline-block;color:#3b73b6}.ui-datefield .ui-datefield-selected.in{-ms-animation:ui-datetime-in .3s 1 ease;-o-animation:ui-datetime-in .3s 1 ease;-moz-animation:ui-datetime-in .3s 1 ease;-webkit-animation:ui-datetime-in .3s 1 ease}.ui-datefield .ui-datefield-selected.out{-ms-animation:ui-datetime-out .3s 1 ease;-o-animation:ui-datetime-out .3s 1 ease;-moz-animation:ui-datetime-out .3s 1 ease;-webkit-animation:ui-datetime-out .3s 1 ease}.ui-datetime{margin:0;height:1.6363636363636365rem}.ui-datetime-text-main{position:relative;font-size:1rem;top:0;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;padding-top:.3em}.ui-datetime-text-main .ui-datefield-period.ui-btn{margin-top:-.3em;height:1.2727272727272727rem;right:auto;position:relative ! important}.ui-datetime-text-sub{top:.6818181818181819rem ! important;color:#3b73b6 ! important;background:transparent ! important;font-size:.7272727272727273rem ! important}.ui-datetimepicker-selector ul{padding:0;display:inline;list-style:none;vertical-align:middle;margin:0}.ui-datetimepicker-selector ul li{font-size:1rem;float:left;padding:.6818181818181819rem .18181818181818182rem 0 .18181818181818182rem;max-width:5.454545454545455rem;min-width:2.7272727272727275rem}.ui-datetimepicker-selector ul li a.ui-link{text-decoration:none;color:rgba(255,255,255,.7)}.ui-datetimepicker-selector ul li a.ui-link:hover{color:rgba(255,255,255,.7)}.ui-datetimepicker-selector ul li.current a.ui-link{color:#fff}.ui-datetimepicker{left:0!important;padding:0}.ui-datetimepicker .ui-popupwindow-padding{background:#3b73b6!important;border-radius:0!important;-ms-border-radius:0!important;-o-border-radius:0!important;-moz-border-radius:0!important;-webkit-border-radius:0!important;box-shadow:0 0 12px rgba(0,0,0,.6)!important;border-width:0!important;text-align:center!important}.ui-datetimepicker .ui-popupwindow-padding div{height:2.409090909090909rem}.ui-popupwindow-screen{background:#000;opacity:0;position:absolute;top:0;left:0;width:100%;height:100%;z-index:1200}.ui-popupwindow{position:absolute;z-index:1201!important;color:#f8f6ef;background:#f8f6ef}.ui-popupwindow .popup-title{width:100%;height:100%;font-size:1.0909090909090908rem;background:#5093b6}.ui-popupwindow .popup-title p{margin:0rem 0rem;padding:.5909090909090909rem 0rem}.ui-popupwindow .popup-text{width:100%;color:#000;font-size:1.0909090909090908rem;background:#f8f6ef}.ui-popupwindow .popup-text p{text-align:center;padding:1rem .7272727272727273rem}.ui-popupwindow .center_info{display:-moz-box;display:-webkit-box;display:box;-ms-box-orient:vertical;-moz-box-orient:vertical;-o-box-orient:vertical;-webkit-box-orient:vertical;box-orient:vertical;-ms-box-align:center;-moz-box-align:center;-o-box-align:center;-webkit-box-align:center;box-align:center;-ms-box-pack:center;-moz-box-pack:center;-o-box-pack:center;-webkit-box-pack:center;box-pack:center}.ui-popupwindow .center_title{display:-moz-box;display:-webkit-box;display:box;-ms-box-orient:vertical;-moz-box-orient:vertical;-o-box-orient:vertical;-webkit-box-orient:vertical;box-orient:vertical;-ms-box-align:center;-moz-box-align:center;-o-box-align:center;-webkit-box-align:center;box-align:center;-ms-box-pack:center;-moz-box-pack:center;-o-box-pack:center;-webkit-box-pack:center;box-pack:center;text-align:center}.ui-popupwindow .center_basic_1btn{display:-moz-box;display:-webkit-box;display:box;-ms-box-orient:vertical;-moz-box-orient:vertical;-o-box-orient:vertical;-webkit-box-orient:vertical;box-orient:vertical;-ms-box-align:center;-moz-box-align:center;-o-box-align:center;-webkit-box-align:center;box-align:center;-ms-box-pack:center;-moz-box-pack:center;-o-box-pack:center;-webkit-box-pack:center;box-pack:center;text-align:center}.ui-popupwindow .center_basic_1btn .popup-button-bg{font-size:1.4545454545454546rem;background:#f8f6ef;width:100%;padding-top:.5rem;padding-bottom:.5rem;vertical-align:middle}.ui-popupwindow .center_basic_1btn .popup-button-bg .ui-btn{width:18.272727272727273rem;height:3.3636363636363638rem;margin:auto}.ui-popupwindow .center_basic_2btn{display:-moz-box;display:-webkit-box;display:box;-ms-box-orient:vertical;-moz-box-orient:vertical;-o-box-orient:vertical;-webkit-box-orient:vertical;box-orient:vertical;-ms-box-align:center;-moz-box-align:center;-o-box-align:center;-webkit-box-align:center;box-align:center;-ms-box-pack:center;-moz-box-pack:center;-o-box-pack:center;-webkit-box-pack:center;box-pack:center;text-align:center}.ui-popupwindow .center_basic_2btn .popup-button-bg{font-size:1.4545454545454546rem;background:#f8f6ef;width:100%;padding-top:.5rem;padding-bottom:.5rem;vertical-align:middle}.ui-popupwindow .center_basic_2btn .popup-button-bg .ui-btn{width:12.454545454545455rem;height:3.3636363636363638rem;margin-top:0rem;margin-bottom:0rem;margin-left:.2272727272727273rem;margin-right:.2272727272727273rem;display:inline-block}.ui-popupwindow .center_basic_3btn{display:-moz-box;display:-webkit-box;display:box;-ms-box-orient:vertical;-moz-box-orient:vertical;-o-box-orient:vertical;-webkit-box-orient:vertical;box-orient:vertical;-ms-box-align:center;-moz-box-align:center;-o-box-align:center;-webkit-box-align:center;box-align:center;-ms-box-pack:center;-moz-box-pack:center;-o-box-pack:center;-webkit-box-pack:center;box-pack:center;text-align:center}.ui-popupwindow .center_basic_3btn .popup-button-bg{font-size:1.4545454545454546rem;background:#f8f6ef;width:100%;padding-top:.5rem;padding-bottom:.5rem;vertical-align:middle}.ui-popupwindow .center_basic_3btn .popup-button-bg .ui-btn{width:8.454545454545455rem;height:3.3636363636363638rem;margin-top:0rem;margin-bottom:0rem;margin-left:.2272727272727273rem;margin-right:.2272727272727273rem;display:inline-block}.ui-popupwindow .center_title_1btn{display:-moz-box;display:-webkit-box;display:box;-ms-box-orient:vertical;-moz-box-orient:vertical;-o-box-orient:vertical;-webkit-box-orient:vertical;box-orient:vertical;-ms-box-align:center;-moz-box-align:center;-o-box-align:center;-webkit-box-align:center;box-align:center;-ms-box-pack:center;-moz-box-pack:center;-o-box-pack:center;-webkit-box-pack:center;box-pack:center;text-align:center}.ui-popupwindow .center_title_1btn .popup-button-bg{font-size:1.4545454545454546rem;background:#f8f6ef;width:100%;padding-top:.5rem;padding-bottom:.5rem;vertical-align:middle}.ui-popupwindow .center_title_1btn .popup-button-bg .ui-btn{width:18.272727272727273rem;height:3.3636363636363638rem;margin:auto}.ui-popupwindow .center_title_2btn{display:-moz-box;display:-webkit-box;display:box;-ms-box-orient:vertical;-moz-box-orient:vertical;-o-box-orient:vertical;-webkit-box-orient:vertical;box-orient:vertical;-ms-box-align:center;-moz-box-align:center;-o-box-align:center;-webkit-box-align:center;box-align:center;-ms-box-pack:center;-moz-box-pack:center;-o-box-pack:center;-webkit-box-pack:center;box-pack:center;text-align:center}.ui-popupwindow .center_title_2btn .popup-button-bg{font-size:1.4545454545454546rem;background:#f8f6ef;width:100%;padding-top:.5rem;padding-bottom:.5rem;vertical-align:middle}.ui-popupwindow .center_title_2btn .popup-button-bg .ui-btn{width:12.454545454545455rem;height:3.3636363636363638rem;margin-top:0rem;margin-bottom:0rem;margin-left:.2272727272727273rem;margin-right:.2272727272727273rem;display:inline-block}.ui-popupwindow .center_title_3btn{display:-moz-box;display:-webkit-box;display:box;-ms-box-orient:vertical;-moz-box-orient:vertical;-o-box-orient:vertical;-webkit-box-orient:vertical;box-orient:vertical;-ms-box-align:center;-moz-box-align:center;-o-box-align:center;-webkit-box-align:center;box-align:center;-ms-box-pack:center;-moz-box-pack:center;-o-box-pack:center;-webkit-box-pack:center;box-pack:center;text-align:center}.ui-popupwindow .center_title_3btn .popup-button-bg{font-size:1.4545454545454546rem;background:#f8f6ef;width:100%;padding-top:.5rem;padding-bottom:.5rem;vertical-align:middle}.ui-popupwindow .center_title_3btn .popup-button-bg .ui-btn{width:8.454545454545455rem;height:3.3636363636363638rem;margin-top:0rem;margin-bottom:0rem;margin-left:.2272727272727273rem;margin-right:.2272727272727273rem;display:inline-block}.ui-popupwindow .center_button_vertical{display:-moz-box;display:-webkit-box;display:box;-ms-box-orient:vertical;-moz-box-orient:vertical;-o-box-orient:vertical;-webkit-box-orient:vertical;box-orient:vertical;-ms-box-align:center;-moz-box-align:center;-o-box-align:center;-webkit-box-align:center;box-align:center;-ms-box-pack:center;-moz-box-pack:center;-o-box-pack:center;-webkit-box-pack:center;box-pack:center;text-align:center}.ui-popupwindow .center_button_vertical .popup-button-bg{font-size:1.4545454545454546rem;background:#f8f6ef;width:100%;padding-top:1px;padding-bottom:.7272727272727273rem;vertical-align:middle}.ui-popupwindow .center_button_vertical .popup-button-bg .ui-btn{width:16.181818181818183rem;height:3.3636363636363638rem;margin-top:.7272727272727273rem;margin-bottom:0rem;margin-left:auto;margin-right:auto}.ui-popupwindow .center_checkbox{display:-moz-box;display:-webkit-box;display:box;-ms-box-orient:vertical;-moz-box-orient:vertical;-o-box-orient:vertical;-webkit-box-orient:vertical;box-orient:vertical;-ms-box-align:center;-moz-box-align:center;-o-box-align:center;-webkit-box-align:center;box-align:center;-ms-box-pack:center;-moz-box-pack:center;-o-box-pack:center;-webkit-box-pack:center;box-pack:center;text-align:center}.ui-popupwindow .center_checkbox .popup-check-bg{font-size:1.0909090909090908rem;background:#f8f6ef;width:100%;padding-top:0rem;padding-bottom:1rem;vertical-align:middle}.ui-popupwindow .center_checkbox .popup-check-bg .ui-checkbox .ui-btn{text-align:center;background:#f8f6ef;border:0rem}.ui-popupwindow .center_checkbox .popup-check-bg .ui-checkbox .ui-btn .ui-btn-inner{border:0rem}.ui-popupwindow .center_checkbox .popup-button-bg{font-size:1.4545454545454546rem;background:#f8f6ef;width:100%;padding-top:.5rem;padding-bottom:.5rem;vertical-align:middle}.ui-popupwindow .center_checkbox .popup-button-bg .ui-btn{width:12.454545454545455rem;height:3.3636363636363638rem;margin-top:0rem;margin-bottom:0rem;margin-left:.2272727272727273rem;margin-right:.2272727272727273rem;display:inline-block}.ui-popupwindow .center_liststyle_1btn{display:-moz-box;display:-webkit-box;display:box;-ms-box-orient:vertical;-moz-box-orient:vertical;-o-box-orient:vertical;-webkit-box-orient:vertical;box-orient:vertical;-ms-box-align:center;-moz-box-align:center;-o-box-align:center;-webkit-box-align:center;box-align:center;-ms-box-pack:center;-moz-box-pack:center;-o-box-pack:center;-webkit-box-pack:center;box-pack:center;text-align:center}.ui-popupwindow .center_liststyle_1btn .popup-scroller-bg{width:100%;overflow:hidden;background:#f8f6ef;height:23.272727272727273rem}.ui-popupwindow .center_liststyle_1btn .popup-button-bg{font-size:1.4545454545454546rem;background:#f8f6ef;width:100%;padding-top:.5rem;padding-bottom:.5rem;vertical-align:middle}.ui-popupwindow .center_liststyle_1btn .popup-button-bg .ui-btn{width:18.272727272727273rem;height:3.3636363636363638rem;margin:auto}.ui-popupwindow .center_liststyle_2btn{display:-moz-box;display:-webkit-box;display:box;-ms-box-orient:vertical;-moz-box-orient:vertical;-o-box-orient:vertical;-webkit-box-orient:vertical;box-orient:vertical;-ms-box-align:center;-moz-box-align:center;-o-box-align:center;-webkit-box-align:center;box-align:center;-ms-box-pack:center;-moz-box-pack:center;-o-box-pack:center;-webkit-box-pack:center;box-pack:center;text-align:center}.ui-popupwindow .center_liststyle_2btn .popup-scroller-bg{width:100%;overflow:hidden;background:#f8f6ef;height:23.272727272727273rem}.ui-popupwindow .center_liststyle_2btn .popup-button-bg{font-size:1.4545454545454546rem;background:#f8f6ef;width:100%;padding-top:.5rem;padding-bottom:.5rem;vertical-align:middle}.ui-popupwindow .center_liststyle_2btn .popup-button-bg .ui-btn{width:12.454545454545455rem;height:3.3636363636363638rem;margin-top:0rem;margin-bottom:0rem;margin-left:.2272727272727273rem;margin-right:.2272727272727273rem;display:inline-block}.ui-popupwindow .center_liststyle_3btn{display:-moz-box;display:-webkit-box;display:box;-ms-box-orient:vertical;-moz-box-orient:vertical;-o-box-orient:vertical;-webkit-box-orient:vertical;box-orient:vertical;-ms-box-align:center;-moz-box-align:center;-o-box-align:center;-webkit-box-align:center;box-align:center;-ms-box-pack:center;-moz-box-pack:center;-o-box-pack:center;-webkit-box-pack:center;box-pack:center;text-align:center}.ui-popupwindow .center_liststyle_3btn .popup-scroller-bg{width:100%;overflow:hidden;background:#f8f6ef;height:23.272727272727273rem}.ui-popupwindow .center_liststyle_3btn .popup-button-bg{font-size:1.4545454545454546rem;background:#f8f6ef;width:100%;padding-top:.5rem;padding-bottom:.5rem;vertical-align:middle}.ui-popupwindow .center_liststyle_3btn .popup-button-bg .ui-btn{width:8.454545454545455rem;height:3.3636363636363638rem;margin-top:0rem;margin-bottom:0rem;margin-left:.2272727272727273rem;margin-right:.2272727272727273rem;display:inline-block}.ui-popupwindow .center_progressbar{display:-moz-box;display:-webkit-box;display:box;-ms-box-orient:vertical;-moz-box-orient:vertical;-o-box-orient:vertical;-webkit-box-orient:vertical;box-orient:vertical;-ms-box-align:center;-moz-box-align:center;-o-box-align:center;-webkit-box-align:center;box-align:center;-ms-box-pack:center;-moz-box-pack:center;-o-box-pack:center;-webkit-box-pack:center;box-pack:center;text-align:center}.ui-popupwindow .center_progressbar .popup-text{font-size:1.1818181818181819rem;font-color:#999;background:#f8f6ef;width:100%;height:3.181818181818182rem}.ui-popupwindow .center_progressbar .popup-text p{height:100%;text-align:center;padding:1rem .7272727272727273rem 0rem .7272727272727273rem}.ui-popupwindow .center_progressbar .popup-text-bottom-bg{font-size:1.1818181818181819rem;font-color:#999;background:#f8f6ef;width:100%;vertical-align:middle}.ui-popupwindow .center_progressbar .popup-text-bottom-bg .text-left{width:40%;height:2.1818181818181817rem;padding:0rem .7272727272727273rem 0rem .7272727272727273rem;text-align:left;display:inline-block}.ui-popupwindow .center_progressbar .popup-text-bottom-bg .text-right{width:40%;height:2.1818181818181817rem;padding:0rem .7272727272727273rem 0rem .7272727272727273rem;text-align:right;display:inline-block}.ui-popupwindow .center_progressbar .popup-button-bg{font-size:1.4545454545454546rem;background:#f8f6ef;width:100%;padding-top:.5rem;padding-bottom:.5rem;vertical-align:middle}.ui-popupwindow .center_progressbar .popup-button-bg .ui-btn{width:18.272727272727273rem;height:3.3636363636363638rem;margin:auto}.ui-popupwindow .center_progressbar .popup-progress-bg{background:#f8f6ef;width:100%;height:100%}.ui-popupwindow .centertext_progressbar{display:-moz-box;display:-webkit-box;display:box;-ms-box-orient:vertical;-moz-box-orient:vertical;-o-box-orient:vertical;-webkit-box-orient:vertical;box-orient:vertical;-ms-box-align:center;-moz-box-align:center;-o-box-align:center;-webkit-box-align:center;box-align:center;-ms-box-pack:center;-moz-box-pack:center;-o-box-pack:center;-webkit-box-pack:center;box-pack:center;text-align:center}.ui-popupwindow .centertext_progressbar .popup-text{font-size:1.1818181818181819rem;font-color:#999;background:#f8f6ef;width:100%;padding-top:1rem;padding-bottom:.7272727272727273rem}.ui-popupwindow .centertext_progressbar .popup-text p{text-align:center}.ui-popupwindow .centertext_progressbar .popup-text-bottom-bg{font-size:1.1818181818181819rem;font-color:#999;background:#f8f6ef;width:100%;vertical-align:middle}.ui-popupwindow .centertext_progressbar .popup-text-bottom-bg .text-left{width:40%;height:1.8181818181818183rem;padding:.7272727272727273rem .7272727272727273rem 1rem .7272727272727273rem;text-align:left;display:inline-block}.ui-popupwindow .centertext_progressbar .popup-text-bottom-bg .text-right{width:40%;height:1.8181818181818183rem;padding:.7272727272727273rem .7272727272727273rem 1rem .7272727272727273rem;text-align:right;display:inline-block}.ui-popupwindow .centertext_progressbar .popup-button-bg{font-size:1.4545454545454546rem;background:#f8f6ef;width:100%;padding-top:.5rem;padding-bottom:.5rem;vertical-align:middle}.ui-popupwindow .centertext_progressbar .popup-button-bg .ui-btn{width:18.272727272727273rem;height:3.3636363636363638rem;margin:auto}.ui-popupwindow .centertext_progressbar .popup-progress-bg{background:#f8f6ef;width:100%;height:100%}.ui-popupwindow .ui-btn.ui-btn-hover-s{background:#5e88a3}.ui-popupwindow .ui-btn.ui-btn-down-s{background:#43a0d9;background:-webkit-gradient(linear,left top,left bottom,from( #43a0d9),to( #388bb9));background:-moz-linear-gradient(top, #43a0d9, #388bb9);background:-ms-linear-gradient(top, #43a0d9, #388bb9);background:-o-linear-gradient(top, #43a0d9, #388bb9)}.ui-popupwindow>.ui-volumecontrol{display:table;margin:auto;background:rgba(0,0,0,.666667);width:18.90909090909091rem;height:30.727272727272727rem;padding-top:1rem}.ui-popupwindow>.ui-volumecontrol h1{font-size:1.0909090909090908rem;display:table;margin:auto;color:#c0c0c0}.ui-popupwindow>.ui-volumecontrol .ui-volumecontrol-icon{display:table;width:100%;height:5.818181818181818rem;padding-top:.9545454545454546rem;padding-bottom:.9545454545454546rem;padding-left:7.5rem;padding-right:7.5rem}.ui-popupwindow>.ui-volumecontrol .ui-volumecontrol-indicator{display:table;width:100%;height:19.09090909090909rem;padding-left:3.090909090909091rem;padding-right:3.090909090909091rem}.ui-popupwindow>.ui-volumecontrol .ui-corner-all{-o-border-radius:.3em!important;-ms-border-radius:.3em!important;-moz-border-radius:.3em!important;-webkit-border-radius:.3em!important;border-radius:.3em!important}.ui-popupwindow-corner-all{-o-border-radius:0!important;-ms-border-radius:0!important;-moz-border-radius:0!important;-webkit-border-radius:0!important;border-radius:0!important}.ui-ctxpopup{display:table}.ui-ctxpopup .ui-ctxpopup-row .ui-triangle-top{top:2px}.ui-ctxpopup .ui-ctxpopup-row .ui-triangle-left{left:2px}.ui-ctxpopup .ui-ctxpopup-row .ui-triangle-right{right:2px}.ui-ctxpopup .ui-ctxpopup-row .ui-triangle-bottom{bottom:2px}.ui-ctxpopup .ui-ctxpopup-row{display:table-row}.ui-ctxpopup .ui-ctxpopup-row .ui-ctxpopup-cell{display:table-cell}.ui-ctxpopup .ui-ctxpopup-row .ui-popupwindow-padding{background:#444;border:0;-ms-box-shadow:0rem 0rem .5454545454545454rem rgba(0,0,0,.6);-o-box-shadow:0rem 0rem .5454545454545454rem rgba(0,0,0,.6);-moz-box-shadow:0rem 0rem .5454545454545454rem rgba(0,0,0,.6);-webkit-box-shadow:0rem 0rem .5454545454545454rem rgba(0,0,0,.6);box-shadow:0rem 0rem .5454545454545454rem rgba(0,0,0,.6);-o-border-radius:.3em;-ms-border-radius:.3em;-moz-border-radius:.3em;-webkit-border-radius:.3em;border-radius:.3em}.ui-ctxpopup .ui-listview li.ui-btn-up-s,.ui-ctxpopup .ui-listview li.ui-btn-hover-s{background:transparent}.ui-ctxpopup .ui-listview li:last-child{border-bottom-left-radius:.3em;border-bottom-right-radius:.3em}.ui-ctxpopup .ui-listview li:first-child{border-top-left-radius:.3em;border-top-right-radius:.3em}.ui-ctxpopup .ui-listview{max-width:28.181818181818183rem;border:0}.ui-ctxpopup .ui-listview>.ui-li{color:#fff;border-bottom-color:#2d2d2d;border-top-width:1px;border-top-color:#5b5b5b;margin-left:0;margin-right:0}.ui-ctxpopup .ui-listview>.ui-li:first-child,.ui-ctxpopup .ui-listview>.ui-li:last-child{border-top-width:0}.ui-ctxpopup .ui-listview>.ui-li .ui-btn-inner{margin:0;padding-left:.4545454545454546rem;padding-right:.4545454545454546rem}.ui-ctxpopup .ui-listview li.ui-btn-up-s>.ui-li>.ui-btn-text>a.ui-link-inherit,.ui-ctxpopup .ui-listview li.ui-btn-hover-s>.ui-li>.ui-btn-text>a.ui-link-inherit,.ui-ctxpopup .ui-listview li.ui-btn-down-s>.ui-li>.ui-btn-text>a.ui-link-inherit{color:#fff}.ui-ctxpopup .ui-listview>.ui-li:last-child{border:0}.ui-ctxpopup .horizontal{color:#fff}.ui-ctxpopup .horizontal .icon .ui-btn{padding:0;background:transparent ! important}.ui-ctxpopup .horizontal .icon .ui-btn .ui-btn-icon-only{width:4.363636363636363rem;height:2.909090909090909rem;padding:0}.ui-ctxpopup .horizontal .icon .ui-btn .ui-icon{top:0;height:inherit;width:inherit;margin:0;background-position:center;-ms-background-size:2.1818181818181817rem 2.1818181818181817rem;-moz-background-size:2.1818181818181817rem 2.1818181818181817rem;-o-background-size:2.1818181818181817rem 2.1818181818181817rem;-webkit-background-size:2.1818181818181817rem 2.1818181818181817rem;background-size:2.1818181818181817rem 2.1818181818181817rem}.ui-ctxpopup .horizontal .text{padding:0 .4545454545454546rem;min-width:2.1818181818181817rem}.ui-ctxpopup .horizontal a.ui-link{color:#fff;text-decoration:none}.ui-ctxpopup .horizontal ul{padding:0;display:inline-block;list-style:none;vertical-align:middle;margin:0}.ui-ctxpopup .horizontal li{line-height:1.4545454545454546rem;min-height:1.4545454545454546rem;min-width:2.1818181818181817rem;float:left;display:inline-block;border-right:1px solid #5b5b5b;text-align:center}.ui-ctxpopup .horizontal li:first-of-type{border-top-left-radius:.3em;border-bottom-left-radius:.3em;border-top-right-radius:0 ! important;border-left:0}.ui-ctxpopup .horizontal li:last-of-type{border-top-right-radius:.3em;border-bottom-right-radius:.3em;border-right:0;margin-right:0}.ui-ctxpopup .horizontal .ui-li:first-child,.ui-ctxpopup .horizontal .ui-li:last-child{border-left-width:0}.ui-ctxpopup .horizontal li:active,.ui-ctxpopup .horizontal td:active{background:#3b73b6}.ui-ctxpopup .button table .ui-btn{margin:0rem;padding:0;height:2.5454545454545454rem;width:6rem}.ui-arrow{border-style:solid;border-width:10px;width:0;height:0;position:absolute}.ui-arrow.top{border-color:transparent transparent #444 transparent}.ui-arrow.left{border-color:transparent transparent transparent #444}.ui-arrow.right{border-color:transparent #444 transparent transparent}.ui-arrow.bottom{border-color:#444 transparent transparent transparent}.ui-ctxpopup-container{z-index:1200;display:inline-bloack;position:absolute;padding:0;outline:0}.ui-ctxpopup-container .ui-popup{border:0;background:#444;-o-border-radius:.3em;-ms-border-radius:.3em;-moz-border-radius:.3em;-webkit-border-radius:.3em;border-radius:.3em}.ui-ctxpopup-container .ui-listview li:first-child{border-top-left-radius:.3em;border-top-right-radius:.3em}.poptop{-webkit-transform-origin:0 0;-moz-transform-origin:0 0}.poptop.in{-webkit-transform:scale(1);-moz-transform:scale(1);opacity:1;-webkit-animation-name:scalepopin;-moz-animation-name:scalepopin;-webkit-animation-duration:350ms;-moz-animation-duration:350ms}.poptop.out{-webkit-animation-name:fadeout;-moz-animation-name:fadeout;opacity:0;-webkit-animation-duration:100ms;-moz-animation-duration:100ms}.poptop.in.reverse{-webkit-animation-name:fadein;-moz-animation-name:fadein}.poptop.out.reverse{-webkit-transform:scale(0.8);-moz-transform:scale(0.8);-webkit-animation-name:scalepopout;-moz-animation-name:scalepopout}@-webkit-keyframes scalepopin{from{ -webkit-transform:scale(0.8);opacity:0}to{-webkit-transform:scale(1);opacity:1}}.popbottom{-webkit-transform-origin:0 100%;-moz-transform-origin:0 100%}.popbottom.in{-webkit-transform:scale(1);-moz-transform:scale(1);opacity:1;-webkit-animation-name:scalepopin;-moz-animation-name:scalepopin;-webkit-animation-duration:350ms;-moz-animation-duration:350ms}.popbottom.out{-webkit-animation-name:fadeout;-moz-animation-name:fadeout;opacity:0;-webkit-animation-duration:100ms;-moz-animation-duration:100ms}.popbottom.in.reverse{-webkit-animation-name:fadein;-moz-animation-name:fadein}.popbottom.out.reverse{-webkit-transform:scale(0.8);-moz-transform:scale(0.8);-webkit-animation-name:scalepopout;-moz-animation-name:scalepopout}@-moz-keyframes scalepopin{from{ -moz-transform:scale(0.8);opacity:0}to{-moz-transform:scale(1);opacity:1}}@-webkit-keyframes scalepopout{from{ -webkit-transform:scale(1);opacity:1}to{-webkit-transform:scale(0.8);opacity:0}}@-moz-keyframes scalepopout{from{ -moz-transform:scale(1);opacity:1}to{-moz-transform:scale(0.8);opacity:0}}@-webkit-keyframes ui-scale-animation{from{ -webkit-transform:scaleX(0)}to{-webkit-transform:scaleX(1)}}.ui-progressbar-value{height:100%;background-image:-webkit-gradient(linear,left bottom,left top,color-stop(0, #3677c3),color-stop(1, #96b8e0));-o-border-radius:.4545454545454546rem;-ms-border-radius:.4545454545454546rem;-moz-border-radius:.4545454545454546rem;-webkit-border-radius:.4545454545454546rem;border-radius:.4545454545454546rem;-o-box-shadow:-1px -1px 1px #b3c8e2;-ms-box-shadow:-1px -1px 1px #b3c8e2;-moz-box-shadow:-1px -1px 1px #b3c8e2;-webkit-box-shadow:-1px -1px 1px #b3c8e2;box-shadow:-1px -1px 1px #b3c8e2}.ui-progressbar-bg{position:relative;overflow:hidden;top:.2272727272727273rem;height:.3181818181818182rem;margin-left:.2272727272727273rem;margin-right:.2272727272727273rem;-o-border-radius:.4545454545454546rem;-ms-border-radius:.4545454545454546rem;-moz-border-radius:.4545454545454546rem;-webkit-border-radius:.4545454545454546rem;border-radius:.4545454545454546rem;border:1px;border-style:solid;border-color:#a3a09e;-o-box-shadow:1px -1px 1px #a3a09e;-ms-box-shadow:1px -1px 1px #a3a09e;-moz-box-shadow:1px -1px 1px #a3a09e;-webkit-box-shadow:1px -1px 1px #a3a09e;box-shadow:1px -1px 1px #a3a09e;background-color:#cac8c4}.ui-progressbar{position:relative;margin-top:.8181818181818182rem;margin-bottom:.8181818181818182rem;margin-left:.9545454545454546rem;margin-right:.9545454545454546rem;height:.8181818181818182rem;background-image:-webkit-gradient(linear,left bottom,left top,color-stop(0, #f6f3ef),color-stop(1, #cac8c4));-o-box-shadow:1px 1px 0 #fff;-ms-box-shadow:1px 1px 0 #fff;-moz-box-shadow:1px 1px 0 #fff;-webkit-box-shadow:1px 1px 0 #fff;box-shadow:1px 1px 0 #fff;-o-border-radius:.4545454545454546rem;-ms-border-radius:.4545454545454546rem;-moz-border-radius:.4545454545454546rem;-webkit-border-radius:.4545454545454546rem;border-radius:.4545454545454546rem}@-webkit-keyframes ui-rotate-animation{from{ -webkit-transform:rotate(0deg)}to{-webkit-transform:rotate(360deg)}}.ui-progress-container-circle{position:absolute}.ui-li .ui-progress-container-circle{top:22%}.ui-progress-circle{position:relative;top:0;height:1.4545454545454546rem;width:1.4545454545454546rem;background:url(images/00_list_process_01.png) no-repeat;-ms-background-size:1.4545454545454546rem 1.4545454545454546rem;-moz-background-size:1.4545454545454546rem 1.4545454545454546rem;-o-background-size:1.4545454545454546rem 1.4545454545454546rem;-webkit-background-size:1.4545454545454546rem 1.4545454545454546rem;background-size:1.4545454545454546rem 1.4545454545454546rem}.ui-progress-circle-running{-webkit-animation:ui-rotate-animation 1s infinite linear}@-webkit-keyframes ui-move-animation{from{ -webkit-transform:translateY(-.6363636363636364rem)}to{-webkit-transform:translateY(0)}}.ui-progress-pending{position:relative;top:0;width:100%;height:.9545454545454546rem;padding-top:0;padding-bottom:0;background:-webkit-gradient(linear,left top,right bottom,color-stop(0%,rgba(0,0,0,0)),color-stop(25%,rgba(0,0,0,0)),color-stop(25%, #3677c3),color-stop(50%, #3677c3),color-stop(50%,rgba(0,0,0,0)),color-stop(75%,rgba(0,0,0,0)),color-stop(75%, #3677c3));background-color:#cac8c4;-ms-background-size:.6363636363636364rem .6363636363636364rem;-moz-background-size:.6363636363636364rem .6363636363636364rem;-o-background-size:.6363636363636364rem .6363636363636364rem;-webkit-background-size:.6363636363636364rem .6363636363636364rem;background-size:.6363636363636364rem .6363636363636364rem}.ui-progress-pending-running{-webkit-animation:ui-move-animation .5s infinite linear}label.ui-slider{display:block}select.ui-slider-switch{display:none}.ui-slider-container{position:relative;vertical-align:middle;height:.8181818181818182rem;margin-left:.7272727272727273rem;margin-right:.7272727272727273rem;margin-top:.8181818181818182rem;margin-bottom:.8181818181818182rem;background-image:-webkit-gradient(linear,left bottom,left top,color-stop(0, #f6f3ef),color-stop(1, #cac8c4));-o-box-shadow:1px 1px 0 #fff;-ms-box-shadow:1px 1px 0 #fff;-moz-box-shadow:1px 1px 0 #fff;-webkit-box-shadow:1px 1px 0 #fff;box-shadow:1px 1px 0 #fff;-o-border-radius:.4545454545454546rem;-ms-border-radius:.4545454545454546rem;-moz-border-radius:.4545454545454546rem;-webkit-border-radius:.4545454545454546rem;border-radius:.4545454545454546rem}.ui-li>.ui-slider-container{margin-top:0;margin-bottom:0}.ui-slider-left-volume,.ui-slider-left-bright{position:absolute;vertical-align:middle;top:-.5rem;left:-2.272727272727273rem;height:1.6818181818181819rem;width:1.6818181818181819rem;background:url(images/controls/00_slider_button_brightness_01.png) no-repeat;-ms-background-size:1.6818181818181819rem 1.6818181818181819rem;-moz-background-size:1.6818181818181819rem 1.6818181818181819rem;-o-background-size:1.6818181818181819rem 1.6818181818181819rem;-webkit-background-size:1.6818181818181819rem 1.6818181818181819rem;background-size:1.6818181818181819rem 1.6818181818181819rem}.ui-slider-left-volume{background:url(images/controls/00_slider_button_volume_01.png) no-repeat;-ms-background-size:1.6818181818181819rem 1.6818181818181819rem;-moz-background-size:1.6818181818181819rem 1.6818181818181819rem;-o-background-size:1.6818181818181819rem 1.6818181818181819rem;-webkit-background-size:1.6818181818181819rem 1.6818181818181819rem;background-size:1.6818181818181819rem 1.6818181818181819rem}.ui-slider-right-volume,.ui-slider-right-bright{position:absolute;top:-.5rem;right:-2.272727272727273rem;height:1.6818181818181819rem;width:1.6818181818181819rem;vertical-align:middle;background:url(images/controls/00_slider_button_brightness_02.png) no-repeat;-ms-background-size:1.6818181818181819rem 1.6818181818181819rem;-moz-background-size:1.6818181818181819rem 1.6818181818181819rem;-o-background-size:1.6818181818181819rem 1.6818181818181819rem;-webkit-background-size:1.6818181818181819rem 1.6818181818181819rem;background-size:1.6818181818181819rem 1.6818181818181819rem}.ui-slider-right-volume{background:url(images/controls/00_slider_button_volume_02.png) no-repeat;-ms-background-size:1.6818181818181819rem 1.6818181818181819rem;-moz-background-size:1.6818181818181819rem 1.6818181818181819rem;-o-background-size:1.6818181818181819rem 1.6818181818181819rem;-webkit-background-size:1.6818181818181819rem 1.6818181818181819rem;background-size:1.6818181818181819rem 1.6818181818181819rem}.ui-slider-left-text{position:absolute;top:-.5rem;height:1.6818181818181819rem;text-align:center;color:#646464}.ui-slider-right-text{position:absolute;top:-.5rem;height:1.6818181818181819rem;text-align:center;color:#646464}div.ui-slider:not(.ui-toggle-switch){position:relative;top:.2272727272727273rem;height:.3181818181818182rem;margin-left:.2272727272727273rem;margin-right:.2272727272727273rem;-o-border-radius:.4545454545454546rem;-ms-border-radius:.4545454545454546rem;-moz-border-radius:.4545454545454546rem;-webkit-border-radius:.4545454545454546rem;border-radius:.4545454545454546rem;border:1px;border-style:solid;border-color:#a3a09e;-o-box-shadow:1px -1px 1px #a3a09e;-ms-box-shadow:1px -1px 1px #a3a09e;-moz-box-shadow:1px -1px 1px #a3a09e;-webkit-box-shadow:1px -1px 1px #a3a09e;box-shadow:1px -1px 1px #a3a09e;background-color:#cac8c4}div.ui-slider:not(.ui-toggle-switch) .ui-btn{top:-.75rem;margin-top:0}div.ui-slider:not(.ui-toggle-switch) .ui-btn-inner{padding:.3rem 0 0 0}div.ui-slider:not(.ui-toggle-switch) .ui-btn-text{color:#3b73b6}a.ui-slider-handle{position:relative;z-index:10;width:1.6363636363636365rem;height:1.6363636363636365rem;margin-left:-.8636363636363636rem;color:#3b73b6;font-size:.95rem;background:url(images/controls/00_slider_handle.png) no-repeat;-ms-background-size:1.6363636363636365rem 1.6363636363636365rem;-moz-background-size:1.6363636363636365rem 1.6363636363636365rem;-o-background-size:1.6363636363636365rem 1.6363636363636365rem;-webkit-background-size:1.6363636363636365rem 1.6363636363636365rem;background-size:1.6363636363636365rem 1.6363636363636365rem}.ui-slider-popup{position:absolute!important;z-index:1200;width:2.0454545454545454rem;height:2.4545454545454546rem;padding-top:.1rem;color:#f9f9f9;text-align:center;font-size:1.5rem;background:url(images/controls/00_slider_popup_bg.png) no-repeat;-ms-background-size:2.0454545454545454rem 2.4545454545454546rem;-moz-background-size:2.0454545454545454rem 2.4545454545454546rem;-o-background-size:2.0454545454545454rem 2.4545454545454546rem;-webkit-background-size:2.0454545454545454rem 2.4545454545454546rem;background-size:2.0454545454545454rem 2.4545454545454546rem}.ui-slider-bg{position:absolute;height:.3181818181818182rem;width:0;background-image:-webkit-gradient(linear,left bottom,left top,color-stop(0, #3677c3),color-stop(1, #96b8e0));-o-border-radius:.4545454545454546rem;-ms-border-radius:.4545454545454546rem;-moz-border-radius:.4545454545454546rem;-webkit-border-radius:.4545454545454546rem;border-radius:.4545454545454546rem;-o-box-shadow:-1px -1px 1px #b3c8e2;-ms-box-shadow:-1px -1px 1px #b3c8e2;-moz-box-shadow:-1px -1px 1px #b3c8e2;-webkit-box-shadow:-1px -1px 1px #b3c8e2;box-shadow:-1px -1px 1px #b3c8e2}.ui-slider-handle-press{position:absolute;z-index:15;width:1.6818181818181819rem;height:1.6818181818181819rem;background:url(images/controls/00_slider_handle_press.png) no-repeat;-ms-background-size:1.6363636363636365rem 1.6363636363636365rem;-moz-background-size:1.6363636363636365rem 1.6363636363636365rem;-o-background-size:1.6363636363636365rem 1.6363636363636365rem;-webkit-background-size:1.6363636363636365rem 1.6363636363636365rem;background-size:1.6363636363636365rem 1.6363636363636365rem}.ui-gallery{position:relative;width:100%}.ui-gallery-bg{display:none;position:absolute;text-align:center;width:100%}@-webkit-keyframes ui-ticker-show{from{ opacity:0;-webkit-transform:translateY(-2.272727272727273rem);top:-2.272727272727273rem}to{opacity:1;-webkit-transform:translateY(0);top:0}}@-webkit-keyframes ui-ticker-hide{from{ opacity:1;-webkit-transform:translateY(0);top:0}to{opacity:0;-webkit-transform:translateY(-2.272727272727273rem);top:-2.272727272727273rem}}.ui-ticker{position:fixed;display:none;left:0;width:100%;height:2.272727272727273rem;z-index:2147483547;background:#444}.ui-ticker.fix{display:block;top:0}.ui-ticker.show{display:block;-ms-animation:ui-ticker-show .8s 1 ease;-o-animation:ui-ticker-show .8s 1 ease;-moz-animation:ui-ticker-show .8s 1 ease;-webkit-animation:ui-ticker-show .8s 1 ease;top:0}.ui-ticker.hide{display:block;-o-animation:ui-ticker-hide .8s 1 ease;-ms-animation:ui-ticker-hide .8s 1 ease;-webkit-animation:ui-ticker-hide .8s 1 ease;top:-2.272727272727273rem}.ui-ticker-btn{position:relative;margin-top:.4545454545454546rem;margin-left:.36363636363636365rem;margin-right:.36363636363636365rem;vertical-align:middle;float:right}.ui-ticker-btn .ui-btn-inner{padding:.15rem 0 0 0;height:1.2727272727272727rem;width:3.5rem;font-size:.81rem;color:#fff;background:#404040;border:1px;border-color:#323232;box-shadow:0 0 1px 1px #323232}.ui-ticker-btn .ui-btn-box-s.ui-btn-up-s{background:#404040;box-shadow:0 0 1px 1px #323232;border-color:#323232}.ui-ticker-btn .ui-btn-box-s.ui-btn-hover-s{background:#404040;box-shadow:0 0 1px 1px #323232;border-color:#323232}.ui-ticker-icon{position:absolute;top:0;height:1.4545454545454546rem;width:1.4545454545454546rem;margin-top:.4090909090909091rem;margin-bottom:.4090909090909091rem;margin-left:.36363636363636365rem;margin-right:.36363636363636365rem;vertical-align:middle}.ui-ticker-text1-bg{position:absolute;top:0;height:.8181818181818182rem;left:2.1818181818181817rem;margin-top:.36363636363636365rem;font-size:.68rem;color:#fff}.ui-ticker-text2-bg{position:absolute;top:0;height:.7272727272727273rem;left:2.1818181818181817rem;margin-top:1.1818181818181819rem;font-size:.54rem;color:#fff}@-webkit-keyframes ui-smallpopup-show{from{ opacity:0;-webkit-transform:scaleY(0)}to{opacity:1;-webkit-transform:scaleY(1)}}@-webkit-keyframes ui-smallpopup-hide{from{ opacity:1;left:0;-webkit-transform:scaleY(1)}to{opacity:0;left:0;-webkit-transform:scaleY(0)}}.ui-smallpopup{position:fixed;display:none;left:0;width:100%;z-index:1100;background:#444;vertical-align:middle;font-size:.72rem;word-break:break-all}.ui-smallpopup.fix{display:block}.ui-smallpopup.show{display:block;-moz-animation:ui-smallpopup-show .5s 1 ease;-ms-animation:ui-smallpopup-show .5s 1 ease;-o-animation:ui-smallpopup-show .5s 1 ease;-webkit-animation:ui-smallpopup-show .5s 1 ease}.ui-smallpopup.hide{display:block;left:-100%;-moz-animation:ui-smallpopup-hide .5s 1 ease;-ms-animation:ui-smallpopup-hide .5s 1 ease;-o-animation:ui-smallpopup-hide .5s 1 ease;-webkit-animation:ui-smallpopup-hide .5s 1 ease}.ui-smallpopup-text-bg{position:relative;margin-top:.18181818181818182rem;margin-bottom:.18181818181818182rem;margin-left:.36363636363636365rem;margin-right:.36363636363636365rem;color:#fff}.ui-swipe{list-style-type:none}.ui-swipe-item{height:1.1818181818181819rem;-ms-user-select:none;-o-user-select:none;-moz-user-select:none;-webkit-user-select:none;-user-select:none;opacity:0;text-align:center}.ui-swipe-item .ui-btn{margin-top:-1.5em ! important;position:relative ! important}.ui-swipe-item p{margin:0}.ui-swipe-item-cover{position:absolute;border:0;top:0;left:0;width:100%;height:100%;z-index:100}.ui-swipe-item-cover .ui-swipe-item-cover-inner{position:absolute;padding-top:.6818181818181819rem;padding-bottom:.6818181818181819rem;padding-left:.36363636363636365rem;width:100%;text-align:left}.ui-swipe-item-cover .ui-swipe-item-cover-inner .ui-li-text-sub{position:absolute;padding-right:.7272727272727273rem}.ui-swipe-item-cover p{margin:0}.ui-fastscroll{position:absolute;right:0rem;background-color:#e6e3d8;width:1.1363636363636365rem;-ms-user-select:none;-o-user-select:none;-moz-user-select:none;-webkit-user-select:none;user-select:none;margin:0;padding-right:.08em;opacity:1}.ui-fastscroll ul{list-style-type:none;margin:0;padding:0}.ui-fastscroll li{cursor:pointer;color:#a09f9a;padding:.09090909090909091rem .09090909090909091rem .09090909090909091rem .09090909090909091rem;text-align:center;vertical-align:middle;font-size:.7272727272727273rem;font-weight:700;border-left-width:.13636363636363635rem;border-left-color:#3b73b6;border-left-style:solid;border-top-width:.13636363636363635rem;border-top-color:#e6e3d8}.ui-fastscroll2{position:absolute;right:0rem;-ms-user-select:none;-o-user-select:none;-moz-user-select:none;-webkit-user-select:none;user-select:none;margin:0;padding-right:.08em;opacity:1}.ui-fastscroll2 ul{list-style-type:none;margin:0;padding:0}.ui-fastscroll2 li{cursor:pointer;color:#a09f9a;padding:.09090909090909091rem .09090909090909091rem .09090909090909091rem .09090909090909091rem;text-align:right}.ui-fastscroll-bg{position:absolute;right:0rem;background-color:#e6e3d8;width:1.1363636363636365rem;z-index:10;top:0}.ui-fastscroll-popup{position:absolute;background:#3b73b6;color:#fff;padding:.4545454545454546rem 1.3636363636363638rem;-ms-box-shadow:.36363636363636365rem .4545454545454546rem 0rem rgba(199,199,199,.5);-o-box-shadow:.36363636363636365rem .4545454545454546rem 0rem rgba(199,199,199,.5);-moz-box-shadow:.36363636363636365rem .4545454545454546rem 0rem rgba(199,199,199,.5);-webkit-box-shadow:.36363636363636365rem .4545454545454546rem 0rem rgba(199,199,199,.5);box-shadow:.36363636363636365rem .4545454545454546rem 0rem rgba(199,199,199,.5);text-align:center;font-size:3.409090909090909rem;font-weight:700;display:none;box-sizing:border-box;left:50%;top:50%}li.ui-fastscroll-hover{color:#3b73b6}li.ui-fastscroll-hover,li.ui-fastscroll-hover-up,li.ui-fastscroll-hover-down{background:#f8f6ef;border-style:solid;border-color:#3b73b6;border-width:0;border-right-width:.13636363636363635rem;border-left-width:1px;border-left-color:#f8f6ef}li.ui-fastscroll-hover{padding-top:.045454545454545456rem;padding-bottom:.045454545454545456rem}li.ui-fastscroll-hover-first-item{padding-top:.09090909090909091rem}li.ui-fastscroll-hover-up{border-top-width:.13636363636363635rem;padding-top:0}li.ui-fastscroll-hover-down{border-bottom-width:.13636363636363635rem;padding-bottom:0}div.ui-slider.ui-toggle-switch{width:3rem;height:1.590909090909091rem;background-color:transparent;margin-top:.2272727272727273rem;margin-bottom:.2272727272727273rem}div.ui-slider.ui-toggle-switch .ui-slider-label{position:absolute;width:3rem;height:1.590909090909091rem;background-size:100% 100%;background-repeat:no-repeat;background-color:transparent}div.ui-slider.ui-toggle-switch .ui-slider-label.ui-slider-label-a{background-image:url(images/00_button_on.png)}div.ui-slider.ui-toggle-switch .ui-slider-label.ui-slider-label-b{background-image:url(images/00_button_off.png)}div.ui-slider.ui-toggle-switch .ui-slider-inneroffset a{background:0}.ui-slider-switch:not(.ui-toggle-switch){width:4.181818181818182rem}div.ui-slider.ui-slider-switch:not(.ui-toggle-switch){position:relative;margin-top:.2272727272727273rem;margin-bottom:.2272727272727273rem;height:1.4545454545454546rem;top:0;margin:.2272727272727273rem;border-radius:.6818181818181819rem}div.ui-slider.ui-slider-switch:not(.ui-toggle-switch) .ui-slider-inneroffset{position:relative;margin:-1px .7272727272727273rem;z-index:1}div.ui-slider.ui-slider-switch:not(.ui-toggle-switch) a.ui-slider-handle{position:absolute;background:#fff;top:50%;margin:1px 0 0 -.6818181818181819rem;border-radius:.6818181818181819rem;border:2px solid gray;width:1.2727272727272727rem;height:1.2727272727272727rem}div.ui-slider.ui-slider-switch:not(.ui-toggle-switch) a.ui-slider-handle-snapping{-webkit-transition:left 70ms linear}div.ui-slider.ui-slider-switch:not(.ui-toggle-switch) span{position:absolute;overflow:hidden;text-align:center;height:1.4545454545454546rem;font-weight:700;font-size:.7272727272727273rem;border-radius:.6818181818181819rem;white-space:nowrap;line-height:2}div.ui-slider.ui-slider-switch:not(.ui-toggle-switch) span.ui-slider-label-a{left:0;color:#fff;z-index:1;text-indent:-1.5em}div.ui-slider.ui-slider-switch:not(.ui-toggle-switch) span.ui-slider-label-b{right:0;color:#000;z-index:0;text-indent:1.5em}.ui-slider-switch .ui-slider-handle .ui-btn-inner{padding:0}.ui-triangle-container{position:relative}.ui-triangle-container .ui-triangle{position:absolute;border-style:solid;border-color:transparent;border-width:10px}.ui-triangle-container .ui-triangle-top{top:0;border-top-width:0;border-left-color:transparent;border-right-color:transparent;margin-left:-10px}.ui-triangle-container .ui-triangle-bottom{bottom:0;border-bottom-width:0;border-left-color:transparent;border-right-color:transparent;margin-left:-10px}.ui-triangle-container .ui-triangle-left{left:0;margin-top:-10px;border-left-width:0;border-left-color:transparent;border-right-color:transparent}.ui-triangle-container .ui-triangle-right{right:0;margin-top:-10px;border-right-width:0;border-left-color:transparent;border-right-color:transparent}.ui-triangle-container-top{height:10px;top:0;margin-top:-10px}.ui-triangle-container-bottom{height:10px;bottom:0;margin-bottom:-10px}.ui-triangle-container-left{width:10px}.ui-triangle-container-right{width:10px}.ui-tokentextarea{display:table;outline:0;position:relative}.ui-tokentextarea .ui-tokentextarea-label{display:inline-block;position:relative;margin-left:5px;margin-right:5px;padding:10px 0;color:#666;font-weight:700;text-align:center;font-size:1em}.ui-tokentextarea-input{outline:0;position:relative;border:0!important;padding:0!important;margin:8px;color:#222;text-align:left;font-size:1em}.ui-tokentextarea-input-visible{display:inline-block!important}.ui-tokentextarea-input-invisible{display:none!important}.ui-tokentextarea div{display:inline-block;text-align:center;cursor:pointer;position:relative;margin-left:5px;margin-right:5px;margin-bottom:5px;margin-top:5px;padding:3px 8px;font-size:1em;text-shadow:0 .1em .1em rgba(0,0,0,.3);-ms-border-radius:.2em;-o-border-radius:.2em;-webkit-border-radius:.2em;-moz-border-radius:.2em;border-radius:.2em;-o-box-shadow:0 .1em .1em rgba(0,0,0,.2);-ms-box-shadow:0 .1em .1em rgba(0,0,0,.2);-moz-box-shadow:0 .1em .1em rgba(0,0,0,.2);-webkit-box-shadow:0 .1em .1em rgba(0,0,0,.2);box-shadow:0 .1em .1em rgba(0,0,0,.2);color:#fff;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}div.ui-tokentextarea-block{background-color:#5f8abd;background-image:url(./images/00_contacts_button_header.png);background-size:contain;background-repeat:no-repeat;padding-left:11px}div.ui-tokentextarea-sblock{background-color:#365984;background-image:url(./images/00_contacts_button_header_press.png);background-size:contain;background-repeat:no-repeat;padding-left:11px}.ui-tokentextarea .ui-tokentextarea-desclabel{display:inline-block;outline:0;position:relative;border:0;color:#666;text-align:left;font-size:1em}.ui-tokentextarea-link-base{position:absolute;right:0;bottom:.2em}.ui-handler{position:absolute;overflow:hidden;opacity:0}.ui-handler-visible{opacity:1}.ui-handler-direction-y{top:.2272727272727273rem;right:.2272727272727273rem;bottom:.2272727272727273rem;width:1.0909090909090908rem}.ui-handler-direction-x{right:.2272727272727273rem;bottom:.2272727272727273rem;left:.2272727272727273rem;height:1.0909090909090908rem}.ui-handler-track{position:relative;width:100%;height:100%}.ui-handler-thumb{position:absolute;top:0;left:0;background-position:center;background-repeat:no-repeat;-o-border-radius:.11363636363636365rem;-ms-border-radius:.11363636363636365rem;-moz-border-radius:.11363636363636365rem;-webkit-border-radius:.11363636363636365rem;border-radius:.11363636363636365rem}.ui-handler-direction-y .ui-handler-thumb{width:1.0909090909090908rem;height:4.863636363636364rem;background-size:1.0909090909090908rem .9090909090909092rem}.ui-handler-direction-x .ui-handler-thumb{width:4.863636363636364rem;height:1.0909090909090908rem;background-size:.9090909090909092rem 1.0909090909090908rem}.ui-handler-s .ui-handler-thumb{background-color:rgba(150,150,150,.5)}.ui-handler-s .ui-handler-direction-y .ui-handler-thumb{background-image:url("images/00_scroll_bar_handler.png")}.ui-handler-s .ui-handler-direction-x .ui-handler-thumb{background-image:url("images/00_scroll_bar_handler_hor.png")}.ui-virtualgrid{overflow:hidden;position:absolute}.ui-virtualgrid-wrapblock{position:absolute;left:0}.ui-virtualgrid-wrapblock-x{float:left;overflow:hidden}.ui-scrollbar-thumb-x{width:1.5rem!important}.ui-scrollbar-thumb-y{height:1.5rem!important}.ui-virtualgrid-overflow-indicator-x-top{position:absolute;display:block;left:0;top:0;width:.4545454545454546rem;height:100%;opacity:0;background:-webkit-gradient(linear,right top,left top,color-stop(0,rgba(128,128,128,0)),color-stop(1, #808080));pointer-events:none}.ui-virtualgrid-overflow-indicator-x-bottom{position:absolute;display:block;right:0;bottom:0;width:.4545454545454546rem;height:100%;opacity:0;background:-webkit-gradient(linear,right top,left top,color-stop(0, #808080),color-stop(1,rgba(128,128,128,0)));pointer-events:none}.ui-virtualgrid-overflow-indicator-y-top{position:absolute;display:block;top:0;width:100%;height:.4545454545454546rem;opacity:0;background:-webkit-gradient(linear,left bottom,left top,color-stop(0,rgba(128,128,128,0)),color-stop(1, #808080));pointer-events:none}.ui-virtualgrid-overflow-indicator-y-bottom{position:absolute;display:block;bottom:0;width:100%;height:.4545454545454546rem;opacity:0;background:-webkit-gradient(linear,left bottom,left top,color-stop(0, #808080),color-stop(1,rgba(128,128,128,0)));pointer-events:none}.ui-content.ui-virtualgrid-content{padding:0}.ui-multimediaview{background-color:#f9f9f9;overflow:hidden}.ui-multimediaview-wrap{width:100%;padding:0;position:relative}.ui-multimediaview-fullscreen{position:absolute!important;z-index:1001}.ui-multimediaview-siblings-off{display:none!important}.ui-multimediaview-control span{display:inline-block}.ui-multimediaview-video{position:absolute}.ui-multimediaview-control{display:block;z-index:1002;padding:0;margin:0;outline:0;border:0;height:1.9090909090909092rem;text-align:left;overflow:hidden}.ui-multimediaview-control span.ui-button{background-position:center center;background-size:80%;background-repeat:no-repeat;width:1.6818181818181819rem;height:1.6818181818181819rem;margin:.09090909090909091rem}.ui-multimediaview-control .ui-playpausebutton{float:left}.ui-multimediaview-control .ui-timestamplabel{text-align:center;float:left}.ui-multimediaview-control .ui-timestamplabel p{margin-top:-.22272727272727275rem;margin-left:.09090909090909091rem;padding:0;text-align:center;font-size:.5rem;line-height:.6363636363636364rem;text-align:left}.ui-multimediaview-control .ui-durationlabel{text-align:center;float:right}.ui-multimediaview-control .ui-durationlabel p{margin-top:-.22272727272727275rem;margin-right:.09090909090909091rem;padding:0;text-align:center;font-size:.5rem;line-height:.6363636363636364rem;text-align:right}.ui-multimediaview-bar{margin-top:.22272727272727275rem;float:left}.ui-multimediaview-bar-bg{height:.36363636363636365rem;border-radius:1.5em}.ui-multimediaview-bar-highlight{height:.36363636363636365rem;position:absolute;border-radius:1.5em}.ui-multimediaview-control .ui-seekbar{margin-left:.09090909090909091rem}.ui-multimediaview-control .ui-seekbar .ui-duration{width:100%}.ui-multimediaview-control .ui-volumecontrol{width:5rem;height:100%;float:left}.ui-multimediaview-control .ui-volumecontrol .ui-volumebar{margin-left:.6818181818181819rem}.ui-multimediaview-control .ui-volumecontrol .ui-volumebar .ui-guide{width:3.8636363636363638rem}.ui-multimediaview-control .ui-volumecontrol .ui-volumebar .ui-handle{margin:0;padding:0;width:.6818181818181819rem;height:.6818181818181819rem;border-style:solid;border-width:1px;border-radius:1.5em}.ui-fullscreen-parents{padding:0!important;margin:0!important;width:100%!important;height:100%!important}.ui-multimediaview-s .ui-multimediaview-video{background-color:rgba(248,246,239,.5)}.ui-multimediaview-s .ui-timestamplabel{color:#4a84c9}.ui-multimediaview-s .ui-durationlabel{color:#808080}.ui-multimediaview-s span.ui-button{background-color:#f8f6ef}.ui-multimediaview-s span.ui-play-icon{background-image:url(./images/00_button_play.png)}.ui-multimediaview-s span.ui-pause-icon{background-image:url(./images/00_button_pause.png)}.ui-multimediaview-s span.ui-volume-icon{background-image:url(./images/controls/00_slider_button_volume_02.png)}.ui-multimediaview-s span.ui-mute-icon{background-image:url(./images/controls/00_slider_button_volume_01.png)}.ui-multimediaview-s span.ui-fullscreen-on{background-image:url(./images/00_button_fullscreen_on.png)}.ui-multimediaview-s span.ui-fullscreen-off{background-image:url(./images/00_button_fullscreen_off.png)}.ui-multimediaview-s .ui-seekbar .ui-duration{background-color:#cbc8c5}.ui-multimediaview-s .ui-seekbar .ui-currenttime{background-color:#4a84c9;background-image:-webkit-gradient(linear,left top,left bottom,from( #6289d9),to( #295b98));background-image:-moz-linear-gradient(top, #6289d9, #295b98);background-image:-o-linear-gradient(top, #6289d9, #295b98);background-image:-ms-linear-gradient(top, #6289d9, #295b98)}.ui-multimediaview-s .ui-volumebar .ui-guide{background-color:#cbc8c5}.ui-multimediaview-s .ui-volumebar .ui-value{background-color:#4a84c9;background-image:-webkit-gradient(linear,left top,left bottom,from( #6289d9),to( #295b98));background-image:-moz-linear-gradient(top, #6289d9, #295b98);background-image:-o-linear-gradient(top, #6289d9, #295b98);background-image:-ms-linear-gradient(top, #6289d9, #295b98)}.ui-multimediaview-s .ui-volumebar .ui-handle{background-color:#f9f9f9;background-image:-webkit-gradient(linear,left top,left bottom,from( #fff),to( #e6e6e6));background-image:-moz-linear-gradient(top, #fff, #e6e6e6);background-image:-o-linear-gradient(top, #fff, #e6e6e6);background-image:-ms-linear-gradient(top, #fff, #e6e6e6);border-color:#bab9b4}.ui-popup-screen{top:0;left:0;width:100%;height:100%;border:0;position:absolute;filter:Alpha(Opacity=50);opacity:0}.ui-popup-screen-background-hack{background-color:#000;filter:Alpha(Opacity=0)}@-webkit-keyframes popup-fadein{from{ opacity:0}to{opacity:.5}}@-moz-keyframes popup-fadein{from{ opacity:0}to{opacity:.5}}@-webkit-keyframes popup-fadeout{from{ opacity:.5}to{opacity:0}}@-moz-keyframes popup-fadeout{from{ opacity:.5}to{opacity:0}}.ui-popup-screen.fade.in{opacity:.5;-webkit-animation-name:popup-fadein;-moz-animation-name:popup-fadein}.ui-popup-screen.fade.out{opacity:0;-webkit-animation-name:popup-fadeout;-moz-animation-name:popup-fadeout}.ui-popup.ui-content,.ui-popup .ui-content{overflow:visible}.ui-popup>img{width:auto;height:auto;max-width:100%;max-height:100%;vertical-align:middle}.ui-popup iframe{vertical-align:middle}@media all and (min-width: 450px){.ui-popup .ui-field-contain label.ui-submit,.ui-popup .ui-field-contain .ui-controlgroup-label,.ui-popup .ui-field-contain label.ui-select,.ui-popup .ui-field-contain label.ui-input-text{ font-size:16px;line-height:1.4;display:block;font-weight:400;margin:0 0 .3em}.ui-popup .ui-field-contain .ui-btn.ui-submit,.ui-popup .ui-field-contain .ui-controlgroup-controls,.ui-popup .ui-field-contain .ui-select,.ui-popup .ui-field-contain input.ui-input-text,.ui-popup .ui-field-contain textarea.ui-input-text,.ui-popup .ui-field-contain .ui-input-search{width:100%;display:block}}.ui-popup>.ui-btn-left,.ui-popup>.ui-btn-right{position:absolute;top:-9px;margin:0;z-index:1101}.ui-popup>.ui-btn-left{left:-9px}.ui-popup>.ui-btn-right{right:-9px}.ui-popup-screen{background:#000;opacity:0;position:absolute;top:0;left:0;width:100%;height:100%;z-index:1200}.ui-overlay-dim{opacity:.7}.ui-popup-scroller-bg{width:100%}.ui-popup-container{position:absolute;width:86.12%;z-index:1201!important;background:#f8f6ef;text-align:center;outline-color:#f8f6ef;display:-moz-box;display:-webkit-box;display:box;-ms-box-orient:vertical;-moz-box-orient:vertical;-o-box-orient:vertical;-webkit-box-orient:vertical;box-orient:vertical;-ms-box-align:center;-moz-box-align:center;-o-box-align:center;-webkit-box-align:center;box-align:center;-ms-box-pack:center;-moz-box-pack:center;-o-box-pack:center;-webkit-box-pack:center;box-pack:center}.ui-popup-container .ui-popup{padding:3px 2px 2px 2px;background:#f8f6ef;width:100%;word-wrap:break-word}.ui-popup-container .ui-popup>.ui-popup-title,.ui-popup-container .ui-popup>.ui-popup-text,.ui-popup-container .ui-popup>.ui-popup-button-bg{width:100%}.ui-popup-container .ui-popup-title{width:100%;height:1.8181818181818183rem;text-align:left;color:#3b73b6;font-size:1.0909090909090908rem;font-weight:700}.ui-popup-container .ui-popup-title h1{font-size:1.0909090909090908rem;font-weight:700;color:#3b73b6;margin:0;padding-top:.4545454545454546rem;padding-left:.7272727272727273rem}.ui-popup-container .ui-popup-text{margin-top:1rem;margin-bottom:1rem;color:#000;font-size:.9090909090909092rem;background:#f8f6ef;text-align:center}.ui-popup-container .ui-popup-text .ui-li .ui-radio label,.ui-popup-container .ui-popup-text .ui-li .ui-checkbox label{background:transparent}.ui-popup-container .ui-popup-text input{display:inline-block}.ui-popup-container .ui-popup-button-bg{font-size:1.4545454545454546rem;height:1.6818181818181819rem;padding-top:.4545454545454546rem;padding-bottom:.4545454545454546rem;width:100%;vertical-align:middle}.ui-popup-container .ui-popup-button-bg>.ui-btn{display:inline-block;margin:auto;height:1.6818181818181819rem}.ui-popup-container .ui-popup-button-bg .ui-btn-inner{padding-top:.2272727272727273rem;padding-bottom:.2272727272727273rem;padding-left:.9090909090909092rem;padding-right:.9090909090909092rem}.ui-popup-container .center_basic_3btn .ui-btn,.ui-popup-container .center_title_3btn .ui-btn{max-width:3.6363636363636367rem;height:1.6818181818181819rem;margin-top:0rem;margin-bottom:0rem;margin-left:.2272727272727273rem;margin-right:.2272727272727273rem;display:inline-block}.ui-popup-container .center_button_vertical .ui-popup-button-bg{display:block;height:auto}.ui-popup-container .center_button_vertical .ui-popup-button-bg>.ui-btn{display:block;width:9.090909090909092rem}.ui-popup-container .center_checkbox .ui-popup-check-bg{font-size:.9090909090909092rem;background:#f8f6ef;width:100%;padding-top:0rem;padding-bottom:1rem;vertical-align:middle}.ui-popup-container .center_checkbox .ui-popup-check-bg .ui-checkbox .ui-btn{text-align:center;background:#f8f6ef;border:0rem}.ui-popup-container .center_checkbox .ui-popup-check-bg .ui-checkbox .ui-btn .ui-btn-inner{border:0rem}.ui-popup-container .center_checkbox .ui-popup-button-bg{font-size:1.4545454545454546rem;background:#f8f6ef;width:100%;padding-top:.5rem;padding-bottom:.5rem;vertical-align:middle}.ui-popup-container .center_checkbox .ui-popup-button-bg .ui-btn{width:5rem;height:1.6818181818181819rem;margin-top:0rem;margin-bottom:0rem;margin-left:.2272727272727273rem;margin-right:.2272727272727273rem;display:inline-block}.ui-popup-container .center_liststyle_1btn .ui-popup-scroller-bg{width:100%;overflow:hidden;background:#f8f6ef;height:11.636363636363637rem}.ui-popup-container .center_liststyle_1btn .ui-popup-button-bg{padding-top:.5rem;padding-bottom:.5rem;vertical-align:middle}.ui-popup-container .center_liststyle_2btn .ui-popup-scroller-bg{width:100%;overflow:hidden;background:#f8f6ef;height:11.636363636363637rem}.ui-popup-container .center_liststyle_2btn .ui-popup-button-bg{padding-top:.5rem;padding-bottom:.5rem;vertical-align:middle}.ui-popup-container .center_liststyle_2btn .ui-popup-button-bg .ui-btn{width:5rem;height:1.6818181818181819rem;margin-top:0rem;margin-bottom:0rem;margin-left:.2272727272727273rem;margin-right:.2272727272727273rem;display:inline-block}.ui-popup-container .center_liststyle_2btn .ui-popup-button-bg .ui-btn .ui-btn-inner{padding-top:.2272727272727273rem;padding-bottom:.2272727272727273rem;padding-left:.9090909090909092rem;padding-right:.9090909090909092rem}.ui-popup-container .center_title_2btn .ui-popup-button-bg{padding-top:.5rem;padding-bottom:.5rem;vertical-align:middle}.ui-popup-container .center_title_2btn .ui-popup-button-bg .ui-btn{width:5.454545454545455rem;height:1.6818181818181819rem;margin-top:0rem;margin-bottom:0rem;margin-left:.2272727272727273rem;margin-right:.2272727272727273rem;display:inline-block}.ui-popup-container .center_title_2btn .ui-popup-button-bg .ui-btn .ui-btn-inner{padding-top:.2272727272727273rem;padding-bottom:.2272727272727273rem;padding-left:.9090909090909092rem;padding-right:.9090909090909092rem}.ui-popup-container .center_liststyle_3btn .ui-popup-scroller-bg{width:100%;overflow:hidden;background:#f8f6ef;height:11.636363636363637rem}.ui-popup-container .center_liststyle_3btn .ui-popup-button-bg{padding-top:.5rem;padding-bottom:.5rem;vertical-align:middle}.ui-popup-container .center_liststyle_3btn .ui-popup-button-bg .ui-btn{max-width:3.6363636363636367rem;height:1.6818181818181819rem;margin-top:0rem;margin-bottom:0rem;margin-left:.2272727272727273rem;margin-right:.2272727272727273rem;display:inline-block}.ui-popup-container .center_progressbar{text-align:center}.ui-popup-container .center_progressbar .ui-popup-text{font-size:1.1818181818181819rem;font-color:#999;background:#f8f6ef;width:100%;height:3.181818181818182rem}.ui-popup-container .center_progressbar .ui-popup-text p{height:100%;text-align:center;padding:1rem .7272727272727273rem 0rem .7272727272727273rem}.ui-popup-container .center_progressbar .ui-popup-text-bottom-bg{font-size:1.1818181818181819rem;font-color:#999;background:#f8f6ef;width:100%;vertical-align:middle}.ui-popup-container .center_progressbar .ui-popup-text-bottom-bg .text-left{width:40%;height:2.1818181818181817rem;padding:0rem .7272727272727273rem 0rem .7272727272727273rem;text-align:left;display:inline-block}.ui-popup-container .center_progressbar .ui-popup-text-bottom-bg .text-right{width:40%;height:2.1818181818181817rem;padding:0rem .7272727272727273rem 0rem .7272727272727273rem;text-align:right;display:inline-block}.ui-popup-container .center_progressbar .ui-popup-button-bg{font-size:1.4545454545454546rem;background:#f8f6ef;width:100%;padding-top:.5rem;padding-bottom:.5rem;vertical-align:middle}.ui-popup-container .center_progressbar .ui-popup-button-bg .ui-btn{width:9.136363636363637rem;height:1.6818181818181819rem;margin:auto}.ui-popup-container .center_progressbar .ui-popup-progress-bg{background:#f8f6ef;width:100%;height:100%}.ui-popup-container .centertext_progressbar{text-align:center}.ui-popup-container .centertext_progressbar .ui-popup-text{font-size:1.1818181818181819rem;font-color:#999;background:#f8f6ef;width:100%;padding-top:1rem;padding-bottom:.7272727272727273rem}.ui-popup-container .centertext_progressbar .ui-popup-text p{text-align:center}.ui-popup-container .centertext_progressbar .ui-popup-text-bottom-bg{font-size:1.1818181818181819rem;font-color:#999;background:#f8f6ef;width:100%;vertical-align:middle}.ui-popup-container .centertext_progressbar .ui-popup-text-bottom-bg .text-left{width:40%;height:1.8181818181818183rem;padding:.7272727272727273rem .7272727272727273rem 1rem .7272727272727273rem;text-align:left;display:inline-block}.ui-popup-container .centertext_progressbar .ui-popup-text-bottom-bg .text-right{width:40%;height:1.8181818181818183rem;padding:.7272727272727273rem .7272727272727273rem 1rem .7272727272727273rem;text-align:right;display:inline-block}.ui-popup-container .centertext_progressbar .ui-popup-button-bg{font-size:1.4545454545454546rem;background:#f8f6ef;width:100%;padding-top:.5rem;padding-bottom:.5rem;vertical-align:middle}.ui-popup-container .centertext_progressbar .ui-popup-button-bg .ui-btn{width:18.272727272727273rem;height:1.6818181818181819rem;margin:auto}.ui-popup-container .centertext_progressbar .ui-popup-progress-bg{background:#f8f6ef;width:100%;height:100%}.ui-text-ellipsis{white-space:nowrap;text-overflow:ellipsis;-o-text-overflow:ellipsis;overflow:hidden!important}.ui-tabbar{background:#f8f6ef;z-index:1000}.ui-tabbar a.ui-btn{background:#f8f6ef;color:#999;padding-top:.8636363636363636rem;padding-bottom:.8636363636363636rem}.ui-tabbar a.ui-btn .ui-btn-inner{padding-top:0;padding-bottom:0;border-left:1px solid;border-color:#c0c0c0;border-radius:0;-0-border-radius:0;-ms-border-radius:0;-webkit-border-radius:0}.ui-tabbar a.ui-btn .ui-icon{width:1.4545454545454546rem;height:1.4545454545454546rem;background-repeat:no-repeat;background-size:100% 100%}.ui-tabbar.ui-tabbar-persist a.ui-btn{background:#f8f6ef}.ui-tabbar.ui-tabbar-persist a.ui-state-persist,.ui-tabbar.ui-tabbar-persist a.ui-state-persist.ui-btn-active,.ui-tabbar.ui-tabbar-persist a.ui-btn-show-style{color:#3b73b6}.ui-tabbar.ui-tabbar-persist a.ui-btn-hover-s.ui-btn-down-s:not(.ui-state-persist){color:#3b73b6;background:-webkit-linear-gradient(top, #d2d2c8 0, #f6f8ef 100%)}.ui-tabbar:not(.ui-tabbar-persist) a.ui-btn{background:#f8f6ef}.ui-tabbar:not(.ui-tabbar-persist) a.ui-btn-active,.ui-tabbar:not(.ui-tabbar-persist) .ui-btn-show-style{color:#3b73b6}.ui-tabbar:not(.ui-tabbar-persist) a.ui-btn.ui-btn-hover-s.ui-btn-down-s{color:#3b73b6;background:-webkit-linear-gradient(top, #d2d2c8 0, #f6f8ef 100%)}.ui-tabbar .ui-btn-inner{font-size:.6818181818181819rem;font-weight:700}.ui-tabbar .ui-btn-inner .ui-icon{top:.4545454545454546rem;left:50%;margin-left:-.7272727272727273rem}.ui-tabbar.ui-tabbar-notext a.ui-btn{padding-top:.5rem;padding-bottom:.4545454545454546rem}.ui-tabbar.ui-tabbar-notext .ui-btn-inner{height:1.5454545454545454rem}.ui-tabbar.ui-tabbar-notext .ui-btn-inner .ui-icon{top:0}.ui-header.ui-bar-s.ui-title-tabbar .ui-title{font-size:1rem;margin-top:.36363636363636365rem;margin-bottom:0rem}.ui-header.ui-bar-s.ui-title-tabbar .ui-tabbar.ui-tabbar-noicons a.ui-btn{padding-top:.6818181818181819rem;padding-bottom:.5909090909090909rem}.ui-header.ui-bar-s.ui-title-tabbar .ui-tabbar.ui-tabbar-notext a.ui-btn{padding-top:.3181818181818182rem;padding-bottom:.2272727272727273rem}.ui-header.ui-bar-s.ui-title-tabbar-multiline .ui-tabbar a.ui-btn{padding-top:.5rem;padding-bottom:.4545454545454546rem}.ui-header.ui-bar-s.ui-title-tabbar-multiline .ui-tabbar a.ui-btn .ui-btn-inner{height:2.4545454545454546rem}.ui-header.ui-bar-s.ui-title-tabbar-multiline .ui-tabbar a.ui-btn .ui-btn-inner .ui-btn-text{padding-top:0;line-height:3.8636363636363638rem}.ui-header.ui-bar-s.ui-title-tabbar-multiline .ui-tabbar a.ui-btn .ui-btn-inner .ui-icon{top:0}.ui-header.ui-bar-s li:first-child .ui-btn-inner{border-left-width:0}.ui-footer.ui-bar-s .ui-tabbar{height:2.2272727272727275rem;margin-left:auto;margin-right:auto}.ui-footer.ui-bar-s .ui-tabbar a.ui-btn{padding-top:.7272727272727273rem;padding-bottom:.7272727272727273rem}.ui-footer.ui-bar-s .ui-tabbar .ui-btn-inner .ui-icon{top:0}.ui-footer.ui-bar-s .ui-tabbar.ui-tabbar-notext a.ui-btn{padding-top:.36363636363636365rem;padding-bottom:.3181818181818182rem}.ui-footer.ui-bar-s .ui-tabbar li:first-child .ui-btn-inner{border-left-width:0}.ui-footer.ui-bar-s .ui-tabbar.ui-tabbar-margin-back{margin-right:2.5454545454545454rem}.ui-footer.ui-bar-s .ui-tabbar.ui-tabbar-margin-more{margin-left:2.5454545454545454rem}.ui-footer.ui-bar-s .ui-btn-back~.ui-tabbar li:last-child .ui-btn-inner{border-right:1px solid;border-right-color:#c0c0c0}.ui-footer.ui-bar-s [data-icon="naviframe-more"]~.ui-tabbar li:first-child .ui-btn-inner{border-left:1px solid;border-left-color:#c0c0c0}.ui-tabbar-s.ui-navbar-noicons{font-size:1rem}.ui-tabbar .tabbar-scroll-ul{margin-top:0;margin-bottom:0;padding-left:0}.ui-tabbar .tabbar-scroll-ul .tabbar-scroll-li{position:relative;display:inline-block;margin-left:-.36363636363636365rem}.ui-tabbar .tabbar-scroll-ul .tabbar-scroll-li a{width:100%}.ui-tabbar .tabbar-scroll-ul li.tabbar-scroll-li:first-child{margin-left:0}.ui-tabbar-divider{position:absolute;top:0;width:.4545454545454546rem;height:2.5rem;background:-webkit-linear-gradient(left, #00009b 0, #f6f8ef 100%)}.ui-tabbar-divider-left{left:0;border-top-right-radius:.4545454545454546rem;border-bottom-right-radius:.4545454545454546rem;background:-webkit-linear-gradient(left, #999 0, #f6f8ef 100%)}.ui-tabbar-divider-right{right:0;border-top-left-radius:.4545454545454546rem;border-bottom-left-radius:.4545454545454546rem;background:-webkit-linear-gradient(right, #999 0, #f6f8ef 100%)}.ui-splitview{margin:0;padding:0;position:relative}.ui-splitview .ui-pane{position:absolute;overflow:hidden;border:0;margin:0;padding:0}.ui-splitview .ui-pane .ui-listview{margin:0;padding:0}.ui-splitview .ui-spliter{position:absolute;z-index:100;display:block;margin:0;padding:0}.ui-splitview .ui-spliter-bar{background-color:#b3b3b3;border-color:#000;border-style:solid}.ui-splitview .ui-spliter-handle{margin:0;padding:0;cursor:move;display:block;text-align:center;cursor:pointer;position:relative;background-position:center center;background-repeat:no-repeat;background-size:100% 100%}.ui-direction-horizontal>.ui-spliter{width:60px}.ui-direction-vertical>.ui-spliter{height:60px}.ui-direction-horizontal>.ui-spliter>.ui-spliter-bar{width:13px;margin:0 0 0 25px;border-width:1px 1px 1px 0}.ui-direction-vertical>.ui-spliter>.ui-spliter-bar{height:13px;margin:25px 0 0 0;border-width:0 1px 1px 1px}.ui-spliter-active>.ui-spliter-bar{background-color:#5787c2}.ui-direction-horizontal>.ui-spliter>.ui-spliter-bar>.ui-spliter-handle{width:13px;height:26px;background-image:url(./images/00_splite_handler_v.png)}.ui-direction-vertical>.ui-spliter>.ui-spliter-bar>.ui-spliter-handle{width:26px;height:13px;background-image:url(./images/00_splite_handler_h.png)}.ui-direction-horizontal>.ui-fixed{width:0}.ui-direction-horizontal>.ui-fixed>.ui-spliter-bar{width:5px}.ui-direction-vertical>.ui-fixed{height:0}.ui-direction-vertical>.ui-fixed>.ui-spliter-bar{height:5px}.ui-fixed .ui-spliter-handle{display:none}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
-<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets" id="http://yourdomain/$${WidgetID}" version="1.0.0" viewmodes="maximized">
- <tizen:application id="$@{APPLICATIONID()}" required_version="1.0"/>
+<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets" id="http://yourdomain/$${WidgetID|"WidgetID"}" version="1.0.0" viewmodes="maximized">
+ <tizen:application id="$@{APPID=APPLICATIONID()}.$${WidgetID|"WidgetID"}" package="$${APPID}" required_version="1.0"/>
<content src="$${ContentSRC|"index.html"}"/>
$$if{TizenWebUIFWProject}
- <tizen:privilege name="http://tizen.org/privilege/tizen"/>
- <tizen:privilege name="http://tizen.org/privilege/application.kill"/>
+ <tizen:privilege name="http://tizen.org/privilege/application.launch"/>
$$endif
<icon src="$${IconSRC|"icon.png"}"/>
- <name>$${WidgetID}</name>
+ <name>$${WidgetID|"WidgetID"}</name>
</widget>
clear: both;
}
-article > section video {
- width: 480px;
- height: 200px;
-}
-
-article > section div.no-html5-video,
-article > section div#no-canvas {
- width: 480px;
- height: 40px;
- border: 1px solid #993333;
- text-align: center;
- color: #993333;
- font-size: 13px;
- font-style: italic;
- background-color: #F7E9E9;
-}
-
-article > section div#no-canvas {
- display: none;
-}
-
-article > section form {
- border: 1px solid #888;
- -moz-border-radius: 10px;
- -webkit-border-radius: 10px;
- border-radius: 10px;
- -moz-box-shadow: 10px 10px 5px #888;
- -webkit-box-shadow: 10px 10px 5px #888;
- box-shadow: 10px 10px 5px #888;
- background-color: #eee;
- padding: 10px;
- margin-bottom: 30px;
-}
-
-article > section label {
- font-weight: bold;
- font-size: 13px;
-}
-
-article > section input {
- margin-bottom: 3px;
- font-size: 13px;
-}
-
footer p {
text-align: center;
font-size: 12px;
"$$elseif{key2} \n" +
"$$else \n" +
"$$endif \n" +
- "$@{function()} \n";
+ "$@{function()} \n" +
+ "$@{app=function()} \n";
/**
* Test {@link FreemarkerTemplateTransformer#translateTransform(String contents)}
String result = transfer.translateFunction(source);
assertFalse(result.contains("$@{function()}"));
assertTrue(result.contains("${function()}"));
+ assertFalse(result.contains("$@{app=function()}"));
+ assertTrue(result.contains("<#assign app=\"${function()}\">${app}"));
}
/**
<tizen:application id="$@{APPLICATIONID()}" required_version="1.0"/>
<content src="$${ContentSRC|"index.html"}"/>
$$if{TizenWebUIFWProject}
- <tizen:privilege name="http://tizen.org/privilege/tizen"/>
- <tizen:privilege name="http://tizen.org/privilege/application.kill"/>
+ <tizen:privilege name="http://tizen.org/api/application"/>
+ <tizen:privilege name="http://tizen.org/api/tizen"/>
$$endif
<icon src="$${IconSRC|"icon.png"}"/>
<name>$${WidgetID}</name>
assertTrue(result.contains("<content src=\"index.html\"/>"));
assertTrue(result.contains("<icon src=\"icon.png\"/>"));
assertTrue(result.contains("<name>MyWidget</name>"));
- assertFalse(result.contains("<tizen:privilege name=\"http://tizen.org/privilege/api/tizen\"/>"));
+ assertFalse(result.contains("<feature name=\"http://tizen.org/api/application\"/>"));
+ assertFalse(result.contains("<feature name=\"http://tizen.org/api/tizen\"/>"));
}
{
assertTrue(result.contains("<content src=\"index.html\"/>"));
assertTrue(result.contains("<icon src=\"icon.png\"/>"));
assertTrue(result.contains("<name>MyWidget</name>"));
- assertFalse(result.contains("<tizen:privilege name=\"http://tizen.org/privilege/api/tizen\"/>"));
+ assertTrue(result.contains("<tizen:privilege name=\"http://tizen.org/api/application\"/>"));
+ assertTrue(result.contains("<tizen:privilege name=\"http://tizen.org/api/tizen\"/>"));
}
}
InputStreamReader streamReader = null;
// get FileTemplate contents.
try {
- in = fileTemplate.open();
+ in = fileTemplate.open();
streamReader = new InputStreamReader( in, fileTemplate.getEncoding());
bufferedReader = new BufferedReader(streamReader, 8192);
StringBuilder text = new StringBuilder();
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry exported="true" kind="lib" path="lib/commons-logging-1.1.1.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/commons-collections-3.2.1.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/commons-pool-1.6.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/commons-lang3-3.1.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/commons-io-2.4.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/freemarker.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/log4j-1.2.17.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/slf4j-api-1.6.4.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/slf4j-log4j12-1.6.4.jar"/>
- <classpathentry exported="true" kind="lib" path="test/lib/junit-4.10.jar" sourcepath="test/lib/junit-4.10-src.jar"/>
- <classpathentry exported="true" kind="lib" path="test/lib/mockito-all-1.9.0.jar"/>
- <classpathentry kind="lib" path="test/lib/asm-4.0.jar"/>
- <classpathentry kind="lib" path="test/lib/asm-tree-4.0.jar"/>
- <classpathentry exported="true" kind="lib" path="test/lib/powermock-mockito-1.4.12-full.jar"/>
- <classpathentry exported="true" kind="lib" path="test/lib/javassist-3.16.1-GA.jar"/>
- <classpathentry kind="lib" path="lib/ant.jar"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="src" path="test/src"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>\r
+<classpath>\r
+ <classpathentry exported="true" kind="lib" path="lib/commons-logging-1.1.1.jar"/>\r
+ <classpathentry exported="true" kind="lib" path="lib/commons-collections-3.2.1.jar"/>\r
+ <classpathentry exported="true" kind="lib" path="lib/commons-pool-1.6.jar"/>\r
+ <classpathentry exported="true" kind="lib" path="lib/commons-lang3-3.1.jar"/>\r
+ <classpathentry exported="true" kind="lib" path="lib/commons-io-2.4.jar"/>\r
+ <classpathentry exported="true" kind="lib" path="lib/freemarker.jar"/>\r
+ <classpathentry exported="true" kind="lib" path="lib/log4j-1.2.17.jar"/>\r
+ <classpathentry exported="true" kind="lib" path="lib/slf4j-api-1.6.4.jar"/>\r
+ <classpathentry exported="true" kind="lib" path="lib/slf4j-log4j12-1.6.4.jar"/>\r
+ <classpathentry exported="true" kind="lib" path="test/lib/junit-4.10.jar" sourcepath="test/lib/junit-4.10-src.jar"/>\r
+ <classpathentry kind="lib" path="test/lib/asm-4.0.jar"/>\r
+ <classpathentry kind="lib" path="test/lib/asm-tree-4.0.jar"/>\r
+ <classpathentry exported="true" kind="lib" path="test/lib/javassist-3.16.1-GA.jar"/>\r
+ <classpathentry kind="lib" path="lib/ant.jar"/>\r
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>\r
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>\r
+ <classpathentry kind="src" path="src"/>\r
+ <classpathentry kind="src" path="test/src"/>\r
+ <classpathentry exported="true" kind="lib" path="test/lib/powermock-mockito-1.5-full.jar"/>\r
+ <classpathentry exported="true" kind="lib" path="test/lib/mockito-all-1.9.5.jar"/>\r
+ <classpathentry kind="output" path="bin"/>\r
+</classpath>\r
Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name
Bundle-SymbolicName: org.tizen.common;singleton:=true
-Bundle-Version: 1.0.0.qualifier
+Bundle-Version: 2.0.0.qualifier
Bundle-Vendor: %Bundle-Vendor
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.mockito.exceptions,
org.mockito.exceptions.base,
org.mockito.exceptions.misusing,
+ org.mockito.exceptions.stacktrace,
org.mockito.exceptions.verification,
org.mockito.exceptions.verification.junit,
org.mockito.internal,
org.mockito.internal.configuration,
org.mockito.internal.configuration.injection,
org.mockito.internal.configuration.injection.filter,
+ org.mockito.internal.configuration.injection.scanner,
org.mockito.internal.creation,
org.mockito.internal.creation.cglib,
org.mockito.internal.creation.jmock,
+ org.mockito.internal.creation.settings,
org.mockito.internal.debugging,
org.mockito.internal.exceptions,
- org.mockito.internal.exceptions.base,
+ org.mockito.internal.exceptions.stacktrace,
org.mockito.internal.exceptions.util,
+ org.mockito.internal.handler,
org.mockito.internal.invocation,
org.mockito.internal.invocation.finder,
org.mockito.internal.invocation.realmethod,
+ org.mockito.internal.junit,
org.mockito.internal.listeners,
org.mockito.internal.matchers,
org.mockito.internal.matchers.apachecommons,
org.mockito.internal.stubbing.answers,
org.mockito.internal.stubbing.defaultanswers,
org.mockito.internal.util,
+ org.mockito.internal.util.collections,
org.mockito.internal.util.junit,
org.mockito.internal.util.reflection,
org.mockito.internal.verification,
org.mockito.internal.verification.checkers,
org.mockito.invocation,
org.mockito.listeners,
+ org.mockito.mock,
+ org.mockito.plugins,
org.mockito.runners,
org.mockito.stubbing,
org.mockito.stubbing.answers,
org.powermock.api.mockito.internal,
org.powermock.api.mockito.internal.configuration,
org.powermock.api.mockito.internal.expectation,
- org.powermock.api.mockito.internal.invocationcontrol,
+ org.powermock.api.mockito.internal.invocation,
org.powermock.api.mockito.internal.mockcreation,
+ org.powermock.api.mockito.internal.mockmaker,
org.powermock.api.mockito.internal.verification,
org.powermock.api.mockito.mockpolicies,
org.powermock.api.mockito.powermocklistener,
org.tizen.common.file.filter,
org.tizen.common.rds,
org.tizen.common.rds.ui.preference,
+ org.tizen.common.sdb.command,
+ org.tizen.common.sdb.command.message,
org.tizen.common.ui,
org.tizen.common.ui.dialog,
org.tizen.common.ui.page.preference,
name="%page.name">\r
<enabledWhen>\r
<adapt\r
- type="org.eclipse.core.resources.IResource">\r
- <test\r
- property="org.eclipse.core.resources.IProject">\r
- </test>\r
+ type="org.eclipse.core.resources.IProject">\r
</adapt>\r
</enabledWhen>\r
</page>\r
name="%RDS.name">\r
<enabledWhen>\r
<adapt\r
- type="org.eclipse.core.resources.IResource">\r
- <test\r
- property="org.eclipse.core.resources.IProject">\r
- </test>\r
+ type="org.eclipse.core.resources.IProject">\r
</adapt>\r
</enabledWhen>\r
</page>\r
--- /dev/null
+/*
+ * Common
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Hyeongseok Heo <hyeongseok.heo@samsung.com>
+ * BonYong Lee <bonyong.lee@samsung.com>
+ * Kangho Kim <kh5325.kim@samsung.com>
+ *
+ * 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.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.common;
+
+import org.tizen.common.util.Assert;
+
+/**
+ * Architecture enumerator for easily management
+ */
+public enum Architecture {
+ i386( Group.x86 ),
+ i486( Group.x86 ),
+ i586( Group.x86 ),
+ i686( Group.x86 ),
+ ia32( Group.x86 ),
+
+ armel( Group.arm ),
+ armv7a( Group.arm, "ARMv7-a" ),
+ armv7l( Group.arm );
+
+ // kinds of group
+ public enum Group {
+ x86, arm, unknown;
+ }
+
+ protected Object[] attributes;
+
+
+ // Constructor
+ private Architecture(Object ... attributes) {
+ Assert.notNull( attributes );
+ this.attributes = attributes;
+ }
+
+ /**
+ * Architecture group getter
+ *
+ * @return If have no group, return the unknown group.
+ */
+ public Group getGroup() {
+ for ( Object attribute : this.attributes ) {
+ if ( attribute instanceof Group ) {
+ return (Group) attribute;
+ }
+ }
+
+ return Group.unknown;
+ }
+
+ /**
+ * Architecture detail name getter
+ *
+ * @return If have a custom name, return it. otherwise, return a default name.
+ */
+ public String getName() {
+ for ( Object attribute : this.attributes ) {
+ if ( attribute instanceof String ) {
+ return (String) attribute;
+ }
+ }
+
+ return this.name();
+ }
+
+ /**
+ * Architecture group getter by name
+ *
+ * @param arch architecture name
+ * @return If cannot find the architecture, return the unknown group. otherwise, return its group.
+ */
+ public static Group getGroup(String arch) {
+ Architecture result = Architecture.valueOf( arch );
+ return ( result != null ) ? result.getGroup() : Group.unknown;
+ }
+}
* @return a project type\r
*/\r
TizenProjectType getTizenProjectType();\r
+\r
+ /**\r
+ * Returns a current build architecture.\r
+ *\r
+ * Return <code>null</code> if no values.\r
+ *\r
+ * @return a build architecture\r
+ */\r
+ String getBuildArchitecture();\r
}
\ No newline at end of file
--- /dev/null
+/*
+ * Common
+ *
+ * Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Changhyun Lee <changhyun1.lee@samsung.com>
+ * Hyeongseok Heo <hyeongseok.heo@samsung.com>
+ * Kangho Kim <kh5325.kim@samsung.com>
+ *
+ * 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.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.common;
+
+/**
+ * The original source is org.tizen.nativecpp.misc.core.ScreenDensity
+ */
+public enum ScreenDensity {
+
+ XHIGH("xhigh", "Xhigh Density", 108), HIGH("high", "High Density", 90);
+
+ private final String fName;
+ private final String fDisplayName;
+ private final int fIconSize;
+
+ private ScreenDensity(String value, String display, int size) {
+ fName = value;
+ fDisplayName = display;
+ fIconSize = size;
+ }
+
+ public int getIconSize() {
+ return fIconSize;
+ }
+
+ public String getName() {
+ return fName;
+ }
+
+ public String getDisplayName() {
+ return fDisplayName;
+ }
+
+ public String getIconDirectory() {
+ return "screen-density-" + fName;
+ }
+
+ public static ScreenDensity getEnumFromDisplayName(String disName) {
+ for (ScreenDensity sd : values()) {
+ if (sd.getDisplayName().equals(disName)) {
+ return sd;
+ }
+ }
+ return null;
+ }
+
+ public static ScreenDensity getEnum(String name) {
+ for (ScreenDensity sd : values()) {
+ if (sd.getName().equals(name)) {
+ return sd;
+ }
+ }
+ return null;
+ }
+
+}
private static final String HELP_COMMON = "org.tizen.ide.common.";
public static final String HELP_COMMON_CONNECTION_EXPLORER_CONTEXT = HELP_COMMON + "connection_explorer_context";
public static final String HELP_COMMON_LOG_CONTEXT = HELP_COMMON + "log_context";
+ public static final String HELP_COMMON_CERTIFICATE_GENERTOR_CONTEXT = HELP_COMMON + "certificate_generator_context";
private static final String HELP_NATIVE = "org.tizen.ide.native.";
public static final String HELP_NATIVE_CODECOVERAGE_CONTEXT = HELP_NATIVE + "codecoverage_context";
public static final String HELP_NATIVE_UNITTEST_CONTEXT = HELP_NATIVE + "unittest_context";
public static final String HELP_NATIVE_MANIFEST_CONTEXT = HELP_NATIVE + "manifest_context";
public static final String HELP_NATIVE_PROJECT_WIZARD_CONTEXT = HELP_NATIVE + "project_wizard_context";
+ public static final String HELP_NATIVE_PROJECT_WIZARD_SETTINGS_CONTEXT = HELP_NATIVE + "project_wizard_settings_context";
+ public static final String HELP_NATIVE_SMART_LAUNCH_CONTEXT = HELP_NATIVE + "smart_launch_context";
private static final String HELP_WEB = "org.tizen.ide.web.";
public static final String HELP_WEB_WIDGET_CONFIGURATION_EDITOR_CONTEXT = HELP_WEB + "widget_configuration_editor_context";
public static final String HELP_WEB_SIMULATOR_PREFERENCES_CONTEXT = HELP_WEB + "simulator_preferences_context";
public static final String HELP_WEB_NEW_PROJECT_WIZARD_CONTEXT = HELP_WEB + "new_project_wizard_context";
public static final String HELP_WEB_USER_TEMPLATE_CONTEXT = HELP_WEB + "user_template_context";
-
+ public static final String HELP_WEB_PROJECT_BUILD_PROPERTIES_CONTEXT = HELP_WEB + "project_build_properties_context";
}
package org.tizen.common;
import org.tizen.common.util.OSChecker;
+import org.tizen.sdblib.IDevice;
/**
* All constant definitions related Tizen Platform such as Emulator or Device.
public static final String PKGTYPE_DEB = "DEB";
// Definitions for debugging
- public static final String PUBICL_PLATFORM_CORE_PATH = "/opt/bs/core";
- public static final String PRIVATE_PLATFORM_CORE_PATH = "/opt/share/hidden_storage/SLP_debug";
+ public static final String DEBUG_COREFILE_PATH;
+ public static final String DEBUG_COREFILE_EXTENSION;
+ public static final String DEBUG_COREFILE_EXTRACT_COMMAND;
+ public static final String DEBUG_COREFILE_EXTRACT_TEMP_PATH;
+
public static final String GDBSERVER_CMD;
public static final String GDBSERVER_PLATFORM_CMD;
public static final String ATTACH_OPTION = " --attach ";
public static final String HOST_GDBSERVER_PATH = "/usr/bin/gdbserver";
// Definitions for installing
+ /**
+ * @deprecated APP_INSTALL_PATH is deprecated. Use {@link IDevice#getAppInstallPath()}.
+ */
public static final String APP_INSTALL_PATH;
public static final String APP_ICON_INSTALL_PATH;
+
+ /**
+ * @deprecated TEMPORARY_PKG_PATH is deprecated. Use {@link #getAppTmpDirectory(IDevice)}.
+ */
public static final String TEMPORARY_PKG_PATH;
- public static final String PKG_TOOL = "pkgcmd";
- public static final String PKG_TOOL_LIST_COMMAND = PKG_TOOL + " -l | grep %s";
- public static final String PKG_TOOL_REMOVE_COMMAND = PKG_TOOL + " -q -u -t %s -n %s";
- public static final String PKG_TOOL_INSTALL_COMMAND = PKG_TOOL + " -q -i -t %s -p %s";
- public static final String PKG_TOOL_RUNNING_CHECK_COMMAND = PKG_TOOL + " -C -t %s -n %s";
- public static final String PKG_TOOL_TERMINATE_COMMAND = PKG_TOOL + " -k -t %s -n %s";
- public static final String PKG_TOOL_INSTALL_PATH_COMMAND = PKG_TOOL + " -a";
+ public static final String TEMPORARY_DIR_PATH;
+ public static final String PKG_TOOL;
+ public static final String PKG_TOOL_LIST_COMMAND;
+ public static final String PKG_TOOL_REMOVE_COMMAND;
+ public static final String PKG_TOOL_INSTALL_COMMAND;
+ public static final String PKG_TOOL_RUNNING_CHECK_COMMAND;
+ public static final String PKG_TOOL_TERMINATE_COMMAND;
+
+ // Definitions for RDS
+ public static final String RDS_PUSH_DIRECTORY_COMMAND = "mkdir -p -m 755 \"%s\""+ TizenPlatformConstants.CMD_SUFFIX;
+ public static final String RDS_CHANGE_OWNER_COMMAND = "chown -R app:app \"%s\"" + TizenPlatformConstants.CMD_SUFFIX;
// Definitions for launching
- public static final String LAUNCH_CMD = "launch_app %s";
+ public static final String LAUNCH_CMD;
public static final String LAUNCH_CMD_SUCCESS = "... successfully launched";
public static final String LAUNCH_CMD_FAILURE = "... launch failed";
public static final String ELM_SCALE_GETTER = TizenPlatformConstants.TOOLS_TARGET_PATH + "/elm_scale_getter/get_elm_scale ";//FIXME : have to be removed
- // Definitions for ondemand install
+ // Definitions for on-demand install
public static final String CONTROL_EXTENSION = ".control";
public static final String TOOLS_TARGET_PATH;
+ // Definitions for signing
+ /**
+ * Whether or not to sign a package - "Run As" menu (default)
+ */
+ public static final boolean SIGNING_DEFAULT;
+ /**
+ * Whether or not to sign a package - "Build Package" menu
+ */
+ public static final boolean SIGNING_BUILD_PACKAGE;
+
// Definitions for others
public static final String CODE_COVERAGE_BUILD_OPTION = "-fprofile-arcs -ftest-coverage";
public static final String CODE_COVERAGE_LAUNCH_OPTION = " __AUL_SDK__ CODE_COVERAGE";
public static final String PROCESS_GET_PROCESS_ID_COMMAND = "ps -ef | grep '%s' | grep -v grep | awk '{print $2}'";
public static final String PROCESS_SIGKILL_COMMAND = "kill -9 %s";
public static final String PKG_TOOL_RUNNUNG_CHECK_COMMAND_RUNNING= "is Running";
- public static final String PKG_TOOL_INSTALL_PATH_COMMAND_RESULT = "Tizen Application Installation Path:";
// Constants have a potential for change
static {
TOOLS_TARGET_PATH = "/home/developer/sdk_tools";
GDBSERVER_CMD = TizenPlatformConstants.TOOLS_TARGET_PATH + "/gdbserver/gdbserver";
GDBSERVER_PLATFORM_CMD = TizenPlatformConstants.TOOLS_TARGET_PATH + "/gdbserver-platform/gdbserver";
- APP_INSTALL_PATH = "/opt/apps";
+ APP_INSTALL_PATH = "/opt/usr/apps";
+ TEMPORARY_PKG_PATH = "/opt/usr/apps/tmp/";
APP_ICON_INSTALL_PATH = "shared/res";
- TEMPORARY_PKG_PATH = "/opt/apps/PKGS/";
+ TEMPORARY_DIR_PATH = "/tmp";
+ DEBUG_COREFILE_PATH = "/opt/usr/share/crash/dump";
+ DEBUG_COREFILE_EXTENSION = "coredump";
+ DEBUG_COREFILE_EXTRACT_COMMAND = "tar -xvf %s -C %s --wildcards --no-anchored '%s'";
+ DEBUG_COREFILE_EXTRACT_TEMP_PATH = "/tmp";
+
+ SIGNING_DEFAULT = true;
+ SIGNING_BUILD_PACKAGE = true;
+
+ // Should be absolute path
+ PKG_TOOL = "/usr/bin/pkgcmd";
+ PKG_TOOL_LIST_COMMAND = PKG_TOOL + " -l | grep %s";
+ PKG_TOOL_REMOVE_COMMAND = PKG_TOOL + " -q -u -t %s -n %s";
+ PKG_TOOL_INSTALL_COMMAND = PKG_TOOL + " -q -i -t %s -p %s";
+ PKG_TOOL_RUNNING_CHECK_COMMAND = PKG_TOOL + " -C -t %s -n %s";
+ PKG_TOOL_TERMINATE_COMMAND = PKG_TOOL + " -k -t %s -n %s";
+
+ // Should be absolute path
+ LAUNCH_CMD = "/usr/bin/launch_app %s";
+ }
+
+ /**
+ * Returns temporary directory that has a developer permission.
+ */
+ public static String getAppTmpDirectory(IDevice device) {
+ return device.getAppInstallPath() + TEMPORARY_DIR_PATH;
}
}
*/
package org.tizen.common;
+
/**
* Represents that TIZEN supports the given project types.
*/
public enum TizenProjectType {
- TIZEN_C_UI_APPLICATION,
- TIZEN_C_SERVICE_APPLICATION,
- TIZEN_C_SHAREDLIBRARY,
- TIZEN_C_STATICLIBRARY,
- TIZEN_CPP_UI_APPLICATION,
- TIZEN_CPP_SERVICE_APPLICATION,
- TIZEN_CPP_SHAREDLIBRARY,
- TIZEN_CPP_STATICLIBRARY,
- TIZEN_PLATFORM_PROJECT;
+ TIZEN_C_UI_APPLICATION(true, false, false),
+ TIZEN_C_SERVICE_APPLICATION(false, false, false),
+ TIZEN_C_SHAREDLIBRARY(false, false, false),
+ TIZEN_C_STATICLIBRARY(false, false, false),
+ TIZEN_CPP_UI_APPLICATION(true, true, true),
+ TIZEN_CPP_SERVICE_APPLICATION(false, false, true),
+ TIZEN_CPP_SHAREDLIBRARY(false, false, false),
+ TIZEN_CPP_STATICLIBRARY(false, false, false),
+ TIZEN_PLATFORM_PROJECT(false, false, false);
+
+ private boolean isNeededIconValidation;
+ private boolean isRootPrj;
+ private boolean isRefPrj;
+
+ private TizenProjectType(boolean isNeededIconValidation, boolean isRootPrj, boolean isRefPrj) {
+ this.isNeededIconValidation = isNeededIconValidation;
+ this.isRootPrj = isRootPrj;
+ this.isRefPrj = isRefPrj;
+ }
+
+ public boolean isNeededIconValidation() {
+ return isNeededIconValidation;
+ }
+
+ /**
+ * Returns whether this project can be root project of multi app project.
+ * @return {@code true} if this project can be root project. {@code false} if not.
+ */
+ public boolean isRootProject() {
+ return isRootPrj;
+ }
+
+ /**
+ * Returns whether this project can be referenced project of multi app project.
+ * @return {@code true} if this project can be referenced project. {@code false} if not.
+ */
+ public boolean isReferencedProject() {
+ return isRefPrj;
+ }
}
private static String sdkInstallPath;
private static final String DIR_PLATFORMS = "platforms";
- private static final String DIR_PLATFORMS_VER = "tizen2.0";
+ private static final String DIR_PLATFORMS_VER;
private static final String DIR_SAMPLES = "samples";
private static final String DIR_SNIPPETS = "snippets";
private static final String DIR_ON_DEMAND = "on-demand";
private static final String DIR_TOOLS = "tools";
private static final String DIR_LIBRARY = "library";
private static final String DIR_SDK_DATA = "tizen-sdk-data";
+ private static final String DIR_CHECKER = "checker";
private final static String SDKSUFFIX = DIR_SDK_DATA + File.separatorChar + "tizensdkpath";
// public static final String REGISTRY_APP_DATA_OF_SHELL_FOLDER = "AppData";
private static final String REGISTRY_LOCAL_APP_DATA_OF_SHELL_FOLDER = "\"Local AppData\"";
// Value Column
- private static final String REG_SZ = "REG_SZ";
+ private static final String REG_VALUE = "REG_SZ";
static {
+ DIR_PLATFORMS_VER = "tizen2.1";
+
// FIXME : don't need the following lines if using environment variable
if (OSChecker.isWindows()) {
- defaultHomePath = getRegistryValue(REGISTRY_PATH_OF_SHELL_FOLDER,REGISTRY_LOCAL_APP_DATA_OF_SHELL_FOLDER) ;
+ defaultHomePath = getRegistryValue(REGISTRY_PATH_OF_SHELL_FOLDER, REGISTRY_LOCAL_APP_DATA_OF_SHELL_FOLDER) ;
} else if (OSChecker.isLinux() == true || OSChecker.isUnix() == true || OSChecker.isMAC() == true) {
defaultHomePath = System.getProperty("user.home");
} else {
//This is temporary code to get platform version path(only for one).
//TODO: Should change to return string array type for various platform version paths.
- public static String getPlatformVersionPath()
- {
+ public static String getPlatformVersionPath() {
String path = null;
String platformPath = getSDKPath() + File.separator + DIR_PLATFORMS;
File platforms = new File(platformPath);
- if(platforms.isDirectory())
- {
+ if (platforms.isDirectory()) {
// platforms.listFiles[0] can cause undetermined result like platforms/tmp.ini/sample
path = platformPath + File.separator + DIR_PLATFORMS_VER;
}
}
//TODO: Should change to get string array type for various platform version paths.
- public static String getSamplesPath()
- {
+ public static String getSamplesPath() {
return getPlatformVersionPath() + File.separator + DIR_SAMPLES;
}
//TODO: Should change to get string array type for various platform version paths.
- public static String getSnippetsPath()
- {
+ public static String getSnippetsPath() {
return getPlatformVersionPath() + File.separator + DIR_SNIPPETS;
}
//TODO: Should change to get string array type for various platform version paths.
- public static String getOnDemandPath()
- {
+ public static String getOnDemandPath() {
return getPlatformVersionPath() + File.separator + DIR_ON_DEMAND;
}
public static String getSDBPath() {
String toolsPath = getToolsPath();
- if (OSChecker.isWindows())
- {
+ if (OSChecker.isWindows()) {
return toolsPath + File.separator + "sdb.exe";
}
- else
- {
+ else {
return toolsPath + File.separator + "sdb";
}
}
return defaultHomePath;
}
+ /**
+ * Provides checker dir path.
+ * @return String checker dir path
+ */
+ public static String getCheckerPath() {
+ return getToolsPath() + File.separator + DIR_CHECKER;
+ }
+
public static String getUserDataPath() {
return getUserHomePath() + File.separator + DIR_SDK_DATA;
}
boolean status = true;
if (HostUtil.exists(sdkPath)) {
String[] fileContent = HostUtil.getContents(sdkPath).split("=");
- if (HostUtil.exists(fileContent[1]))
- {
+ if (HostUtil.exists(fileContent[1])) {
sdkInstallPath = fileContent[1];
}
else {
System.exit(0);
}
}
+
private static String getRegistryValue(String node, String key) {
- if (!OSChecker.isWindows())
- {
+ if (!OSChecker.isWindows()) {
return null;
}
String line = null;
while ((line = br.readLine()) != null) {
- int index = line.indexOf(REG_SZ);
+ int index = line.indexOf(REG_VALUE);
if (index >= 0) {
- value = line.substring(index + REG_SZ.length()).trim();
+ value = line.substring(index + REG_VALUE.length()).trim();
}
}
} catch (IOException e) {
public class CommandCancelException extends RuntimeException {
- private static final long serialVersionUID = 1L;
+ private static final long serialVersionUID = -3303351863981251390L;
+ public CommandCancelException() {
+ super();
+ }
+
+ public CommandCancelException(String msg) {
+ super(msg);
+ }
+
+ public CommandCancelException(Throwable t) {
+ super(t);
+ }
+
+ public CommandCancelException(String msg, Throwable t) {
+ super(msg, t);
+ }
+
}
import static org.tizen.common.core.command.Policy.NONEXIST_IN_FILE;
import static org.tizen.common.core.command.Policy.EXIST_FILE_WHEN_COPY;
import static org.tizen.common.core.command.Policy.EXCEPTION_UNHANDLED;
-import java.io.File;
import org.tizen.common.Factory;
import org.tizen.common.core.command.policy.AbstractPolicy;
import org.tizen.common.core.command.policy.FilePolicy;
import org.tizen.common.core.command.policy.MessagePolicy;
import org.tizen.common.core.command.policy.OptionPolicy;
import org.tizen.common.core.command.policy.PolicyRegistry;
+import org.tizen.common.core.command.policy.SimplePolicy;
import org.tizen.common.core.command.policy.UncaughtExceptionHandlingPolicy;
-import org.tizen.common.core.command.prompter.RunableOption;
-import org.tizen.common.file.StandardFileHandler;
+import org.tizen.common.core.command.prompter.FileHandlingOption;
/**
* <p>
@Override
public <T> T adapt(Class<T> clazz) {
if(clazz.isAssignableFrom(OptionPolicy.class)) {
-
- RunableOption overwrite = new RunableOption("overwrite") {
-
- private StandardFileHandler handler = new StandardFileHandler();
-
- @Override
- public void runWithArgument(Object... args) throws Exception {
- if(args.length != 2) {
- throw new IllegalArgumentException("argument length is wrong");
- }
-
- if(!(args[0] instanceof File && args[1] instanceof File)) {
- throw new IllegalArgumentException("argument type is wrong");
- }
-
- File sourceFile = ((File)args[0]);
- File targetFile = ((File)args[1]);
-
- handler.copyFile(sourceFile.getPath(), targetFile.getPath());
- }
-
- @Override
- public boolean isDefault() {
- return false;
- }
- };
-
- RunableOption ignore = new RunableOption("ignore") {
-
- @Override
- public boolean isDefault() {
- return true;
- }
-
- @Override
- protected void runWithArgument(Object... args) throws Exception{
- }
- };
-
- RunableOption overwriteAll = new RunableOption("overwriteAll") {
-
- private StandardFileHandler handler = new StandardFileHandler();
-
- @Override
- public boolean isDefault() {
- return false;
- }
-
- @Override
- protected void runWithArgument(Object... args) throws Exception {
- super.setAllFlag(true);
-
- if(args.length != 2) {
- throw new IllegalArgumentException("argument length is wrong");
- }
-
- if(!(args[0] instanceof File && args[1] instanceof File)) {
- throw new IllegalArgumentException("argument type is wrong");
- }
-
- File sourceFile = ((File)args[0]);
- File targetFile = ((File)args[1]);
-
- handler.copyFile(sourceFile.getPath(), targetFile.getPath());
- }
- };
-
- RunableOption ignoreAll = new RunableOption("ignoreAll") {
-
- @Override
- public boolean isDefault() {
- return false;
- }
-
- @Override
- protected void runWithArgument(Object... args) throws Exception{
- super.setAllFlag(true);
- }
- };
-
- RunableOption cancel = new RunableOption("cancel") {
-
- @Override
- public boolean isDefault() {
- return false;
- }
-
- @Override
- protected void runWithArgument(Object... args) throws Exception{
- }
- };
-
- return (T)(new OptionPolicy(overwrite, ignore, overwriteAll, ignoreAll, cancel));
+ return (T)(new OptionPolicy(FileHandlingOption.OVERWRITE, FileHandlingOption.IGNORE, FileHandlingOption.OVERWRITE_ALL, FileHandlingOption.IGNORE_ALL, FileHandlingOption.CANCEL));
}
return super.adapt(clazz);
}
});
registry.register( new EclipsePolicy(EXIST_OUT_FILE));
registry.register( new EclipsePolicy( NONEXIST_IN_FILE ) );
+ registry.register( new SimplePolicy( Policy.PRINTOUT_RESULT_SIGNING ) );
+ registry.register( new EclipsePolicy( Policy.NONEXIST_IN_PROJECT ) );
return registry;
}
import java.util.List;
import java.util.Stack;
-import org.tizen.common.core.command.AbstractCommand;
-import org.tizen.common.core.command.CommandCancelException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.tizen.common.core.command.ExecutionContext;
import org.tizen.common.core.command.Executor;
import org.tizen.common.core.command.Policy;
import org.tizen.common.core.command.policy.OptionPolicy;
+import org.tizen.common.core.command.prompter.FileHandlingOption;
import org.tizen.common.core.command.prompter.Option;
-import org.tizen.common.core.command.prompter.RunableOption;
-import org.tizen.common.file.StandardFileHandler;
-import org.tizen.common.util.log.Logger;
+import org.tizen.common.core.command.prompter.RunnableOption;
+import org.tizen.common.file.FileHandler;
/**
* <p>
*/
protected List<String> sourcePathList;
+ private FileHandlingOption selectedAllFlagOption;
+
+ private static Logger logger = LoggerFactory.getLogger(DirectoryCopyHandlingCommand.class);
+
public DirectoryCopyHandlingCommand(List<String> sourcePathList, List<String> targetPathList) throws IllegalArgumentException{
if(sourcePathList.size() != targetPathList.size()) {
throw new IllegalArgumentException("Lenghs of sourcePathList and target paths are not same");
@Override
public void run(Executor executor, ExecutionContext context)
throws Exception {
- StandardFileHandler handler = new StandardFileHandler();
+ FileHandler handler = context.getFileHandler();
Policy policy = context.getPolicy(Policy.EXIST_FILE_WHEN_COPY);
OptionPolicy optionPolicy = policy.adapt( OptionPolicy.class );
Option[] options = optionPolicy.getOptions();
for(Option option: options) {
- if(!(option instanceof RunableOption)) {
- throw new IllegalArgumentException("Option " + option.getName() + " is not RunnableOption");
+ if(!(option instanceof FileHandlingOption)) {
+ throw new IllegalArgumentException(String.format("Option %s is not a FileHandlingOption", option.getName()));
}
+
+ ((FileHandlingOption)option).setHandler(handler);
}
+
for(int i =0; i< sourcePathList.size(); i++) {
String sourcePath = sourcePathList.get(i);
String targetPath = targetPathList.get(i);
}
else if(sourceFile.isFile()) {
if(targetFile.exists()) {
- boolean selectionDone = false;
- RunableOption resultOption = null;
+ RunnableOption resultOption = null;
- for (Option option : options) {
- if(((RunableOption)option).isAllFlag()) {
- resultOption = (RunableOption)option;
- selectionDone = true;
- break;
- }
+ if(selectedAllFlagOption == null) {
+ resultOption = (RunnableOption)context.getPrompter().interact(targetFile.getCanonicalPath() + " already exists", options);
}
-
- if(!selectionDone) {
- resultOption = (RunableOption)context.getPrompter().interact(targetFile.getCanonicalPath() + " already exist", options);
+ else {
+ resultOption = selectedAllFlagOption;
}
- if(AbstractCommand.COMMAND_CANCEL.equals(resultOption.getName())) {
- throw new CommandCancelException();
+
+ if(resultOption.isAllFlag()) {
+ selectedAllFlagOption = (FileHandlingOption) resultOption;
}
resultOption.setArgument(sourceFile, targetFile);
}
}
else {
- Logger.error(sourceFile + " is not file or directory");
+ logger.warn(String.format("%s is not a file or directory", sourceFile));
}
}
}
package org.tizen.common.core.command.prompter;
import static org.tizen.common.util.StringUtil.hasText;
+import static org.tizen.common.util.StringUtil.isEmpty;
+import static org.tizen.common.util.StringUtil.trim;
import org.tizen.common.util.Assert;
ChoiceOption
extends AbstractOption
{
+
+ /**
+ * short name of this option for using in CLI.
+ */
+ protected String shortName;
+
/**
* Constructor with choice name
*
final boolean bPermitAbbreviation
)
{
- super( name, bDefault, bPermitAbbreviation );
+ this( name, bDefault, bPermitAbbreviation, name.substring(0,1) );
Assert.isTrue( hasText( name ) );
}
+
+ /**
+ * Constructor with choice name, default flag and abbreviation flag, shortOption
+ *
+ * @param name choice name
+ * @param bDefault default flag
+ * @param bPermitAbbreviation abbreviation flag
+ * @param shortName short option
+ */
+ public ChoiceOption(
+ final String name,
+ boolean bDefault,
+ boolean bPermitAbbreviation,
+ String shortName) {
+ super(name, bDefault, bPermitAbbreviation);
+ this.shortName = shortName;
+ }
+
+ /**
+ * Constructor with choice name, shortName
+ *
+ * @param name choice name
+ * @param shortName short option
+ */
+ public ChoiceOption(
+ final String name,
+ String shortName) {
+ this(name);
+ this.shortName = shortName;
+ }
+
+ public void setShortName(String shortName) {
+ this.shortName = shortName;
+ }
+
+ public String getShortName() {
+ return shortName;
+ }
+
+ @Override
+ public
+ boolean
+ isMatch(
+ final String value
+ )
+ {
+ if ( name.equalsIgnoreCase( trim( value ) ) )
+ {
+ return true;
+ }
+
+ if ( isEmpty( value ) )
+ {
+ return false;
+ }
+
+ if(shortName.equals(trim(value))) {
+ return true;
+ }
+
+ return false;
+
+ }
}
--- /dev/null
+/*
+ * Common
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Ho Namkoong <ho.namkoong@samsung.com>
+ *
+ * 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.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.common.core.command.prompter;
+
+import java.io.File;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.tizen.common.core.command.CommandCancelException;
+import org.tizen.common.file.FileHandler;
+
+public abstract class FileHandlingOption extends RunnableOption {
+
+ protected FileHandler handler;
+ private static Logger logger = LoggerFactory.getLogger(FileHandlingOption.class);
+
+ public FileHandlingOption(String name, String shortName) {
+ super(name, shortName);
+ }
+
+ /**
+ * Sets a file handler which will be execute command when this option is selected.
+ * Because context cannot be gotten when policy is registered, file handler must be set before context is option is selected
+ *
+ * @param handler file handler
+ */
+ public void setHandler(FileHandler handler) {
+ this.handler = handler;
+ }
+
+ /**
+ * Overwrites existing file.
+ */
+ public static final FileHandlingOption OVERWRITE;
+
+ /**
+ * Ignores copying file.
+ */
+ public static final FileHandlingOption IGNORE;
+
+ /**
+ * Ovewrites all the files.
+ */
+ public static final FileHandlingOption OVERWRITE_ALL;
+
+ /**
+ * Ignores all the files.
+ */
+ public static final FileHandlingOption IGNORE_ALL;
+
+ /**
+ * Cancels the operation.
+ */
+ public static final FileHandlingOption CANCEL;
+
+ static {
+ OVERWRITE = new FileHandlingOption("Overwrite", "o") {
+
+ @Override
+ public boolean isDefault() {
+ return false;
+ }
+
+ @Override
+ protected void runWithArgument(Object... args) throws Exception {
+ if(args.length != 2) {
+ throw new IllegalArgumentException("argument length is wrong");
+ }
+
+ if(!(args[0] instanceof File && args[1] instanceof File)) {
+ throw new IllegalArgumentException("argument type is wrong");
+ }
+
+ File sourceFile = ((File)args[0]);
+ File targetFile = ((File)args[1]);
+
+ handler.copyFile(sourceFile.getPath(), targetFile.getPath());
+ }
+ };
+
+ IGNORE = new FileHandlingOption("Ignore", "i") {
+
+ @Override
+ public boolean isDefault() {
+ return true;
+ }
+
+ @Override
+ protected void runWithArgument(Object... args) throws Exception {
+ //do nothing
+ logger.trace("do nothing");
+ }
+ };
+
+ OVERWRITE_ALL = new FileHandlingOption("Overwrite All", "oa") {
+ @Override
+ public boolean isDefault() {
+ return false;
+ }
+
+ @Override
+ protected void runWithArgument(Object... args) throws Exception {
+
+ if(args.length != 2) {
+ throw new IllegalArgumentException("argument length is wrong");
+ }
+
+ if(!(args[0] instanceof File && args[1] instanceof File)) {
+ throw new IllegalArgumentException("argument type is wrong");
+ }
+
+ File sourceFile = ((File)args[0]);
+ File targetFile = ((File)args[1]);
+
+ handler.copyFile(sourceFile.getPath(), targetFile.getPath());
+ }
+
+ @Override
+ public boolean isAllFlag() {
+ return true;
+ }
+ };
+
+ IGNORE_ALL = new FileHandlingOption("Ignore All", "ia") {
+
+ @Override
+ public boolean isDefault() {
+ return false;
+ }
+
+ @Override
+ protected void runWithArgument(Object... args) throws Exception {
+ //do nothing
+ logger.trace("do nothing");
+ }
+
+ @Override
+ public boolean isAllFlag() {
+ return true;
+ }
+ };
+
+ CANCEL = new FileHandlingOption("Cancel", "c") {
+
+ @Override
+ public boolean isDefault() {
+ return false;
+ }
+
+ @Override
+ protected void runWithArgument(Object... args) throws Exception {
+ throw new CommandCancelException();
+ }
+ };
+
+ }
+}
package org.tizen.common.core.command.prompter;
-public abstract class RunableOption implements Option{
+public abstract class RunnableOption extends ChoiceOption{
/**
* Arguments which will be used in run.
private boolean allFlag = false;
/**
- * name of this option
+ * Constructor with name
+ *
+ * @param name name of this operation
*/
- private String name;
+ public RunnableOption(String name) {
+ this(name, new Object());
+ }
/**
- * Constructor with name
+ * Constructor with name and short name
*
* @param name name of this operation
+ * @param args short name
*/
- public RunableOption(String name) {
- this.name = name;
- this.args = null;
+ public RunnableOption(String name, String shortName) {
+ super(name, shortName);
+ this.shortName = shortName;
}
/**
* Constructor with name and arguments
*
* @param name name of this operation
- * @param args arguments of this operation
+ * @param args arguments of this operation to be used in run
*/
- public RunableOption(String name, Object... args) {
- this.name = name;
+ public RunnableOption(String name, Object... args) {
+ super(name);
this.args = args;
}
return allFlag;
}
- /**
- * return name
- *
- * @return return name of this operation
- */
- @Override
- public String getName() {
- return name;
- }
+ protected abstract void runWithArgument(Object... args) throws Exception;
/**
- * Check if name of this operation and value are matched.
- *
- * @arg value value which is compared with name of this operation
- * @return return true if matched, else return false.
+ * Run the process of this option.
+ *
+ * @throws Exception
*/
- @Override
- public boolean isMatch(String value) {
- if(this.getName().equals(value)) {
- return true;
- }
- return false;
- }
-
- protected abstract void runWithArgument(Object... args) throws Exception;
-
public void run() throws Exception {
this.runWithArgument(args);
}
if ( FilePolicy.OVERWRITE.equals( filePolicy ) )
{
logger.debug( "No operation" );
- // No op
}
else
{ // It is default to stop process
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
+import org.tizen.common.util.FileUtil;
import org.tizen.common.util.FilenameUtil;
import org.tizen.common.util.ObjectUtil;
@Override
public void copyFile(String source, String target) throws IOException {
- throw new UnsupportedOperationException();
+ FileUtil.copyTo(source, target);
+
+ final Path targetPath = new Path( target );
+ try {
+ getWorkspace().getFileForLocation( targetPath ).refreshLocal( -1, new NullProgressMonitor() );
+ } catch ( final CoreException e )
+ {
+ throw new IOException( e );
+ }
}
@Override
public void removeFile(String path) throws IOException {
- throw new UnsupportedOperationException();
+ final IResource file = getResource( path );
+
+ if ( file.getType() != IResource.FILE )
+ {
+ throw new IOException();
+ }
+
+ try {
+ file.delete( true, null );
+ } catch (CoreException e) {
+ throw new IOException( e );
+ }
}
@Override
{
return file.isAccessible();
}
+ else if ( Attribute.NAME.equals( name ) )
+ {
+ return file.getName();
+ }
else if ( Attribute.WRITABLE.equals( name ) )
{
return file.isAccessible();
*/
public final static String TYPE_DELETE = "delete";
/**
- * Type constant which identifies installed status resources.
+ * Type constant which identifies installed status resources. This constant is used for directory installation like {@code manifest.xml}.
*/
public final static String TYPE_INSTALL = "install";
private String name;
output = new DataOutputStream(new SafeFileOutputStream(strLocalFile, strLocalFile + ".temp"));
treeWriter.writeTree(tree, subTreePath, ElementTreeWriter.D_INFINITE, output);
- } catch ( final IOException e ) {
+ } catch (IOException e) {
return "";
} finally {
IOUtil.tryClose(output);
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
-import java.util.HashMap;
+import java.util.HashSet;
import java.util.List;
-import java.util.Map;
+import java.util.Set;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.osgi.util.NLS;
import org.tizen.common.CommonPlugin;
import org.tizen.common.TizenPlatformConstants;
+import org.tizen.common.sdb.command.SdbCommand;
+import org.tizen.common.sdb.command.message.PkgcmdErrorType;
import org.tizen.common.ui.view.console.ConsoleManager;
import org.tizen.common.util.ISdbCommandHelper;
+import org.tizen.common.util.StringUtil;
import org.tizen.common.util.log.Logger;
import org.tizen.sdblib.IDevice;
import org.tizen.sdblib.SyncService;
protected IDevice device;
protected RdsDeltaDetector deltaDetector;
protected ISdbCommandHelper tizenCommand;
+ // ignoreList has a high priority better than interestList
+ protected List<DeltaResourceInfo> ignoreList = new ArrayList<DeltaResourceInfo>();
protected List<DeltaResourceInfo> interestList = new ArrayList<DeltaResourceInfo>();
private SyncService syncService;
private final static String[] needAppOwnerArray = new String[] {"/data", "/shared/data", "/shared/trusted", "/setting"};
+ // deltaInfoList should be set only once.
+ private List<DeltaResourceInfo> deltaInfoList = null;
+ // strDeltaInfoFile should be set when deltaInfoList is set.
+ private String strDeltaInfoFile = "";
/**
* Prints progress information.
public void setInterestList( List<DeltaResourceInfo> list) {
interestList = list;
}
+
+ public void setIgnoreList( List<DeltaResourceInfo> list) {
+ ignoreList = list;
+ }
protected void partialInstall( List<DeltaResourceInfo> deltaInfoList ) throws CoreException {
boolean isNeededInstall = false;
String strRemotePath = null;
String command = null;
boolean isInteresting = false;
+ boolean isIgnore = false;
+ Set<String> needAppOwnerSet = new HashSet<String>();
for ( DeltaResourceInfo node : deltaInfoList ) {
isInteresting = false;
+ isIgnore = false;
+
+ for ( DeltaResourceInfo ignore : ignoreList ) {
+ if ( node.getFullPath().startsWith(strProjectPath + ignore.getFullPath()) ) {
+ isIgnore = true;
+ break;
+ }
+ }
+ if ( isIgnore ) {
+ continue;
+ }
+
for ( DeltaResourceInfo interest : interestList ) {
if ( node.getFullPath().startsWith(strProjectPath + interest.getFullPath()) ) {
isInteresting = true;
if ( !isInteresting ) {
continue;
}
+
if ( DeltaResourceInfo.TYPE_MODIFY.equals(node.getType()) ) {
try {
command = RdsDeployer.makeRdsLog(NLS.bind(RdsMessages.RDS_PUSH_LOG, node.getFullPath(), strRemotePath));
if ( new File(node.getFullPath()).isDirectory() ) {
- tizenCommand.runCommand( "mkdir -p -m 755 \"" + strRemotePath + "\""+ TizenPlatformConstants.CMD_SUFFIX , true, TizenPlatformConstants.CMD_SUCCESS);
+ tizenCommand.runCommand( String.format(TizenPlatformConstants.RDS_PUSH_DIRECTORY_COMMAND, strRemotePath), true, TizenPlatformConstants.CMD_SUCCESS);
}
else {
SyncResult result = getSyncService().pushFile(node.getFullPath(), strRemotePath, SyncService.getNullProgressMonitor());
}
printInfo( command );
- // TODO: It should be replaced to 'pkg_cmd'
+ // TODO: The code is removed, if 'pkgcmd' is used to change owner.
for ( String needAppOwnerPath : needAppOwnerArray) {
String needAppOwnerFullPath = strAppInstallPath + needAppOwnerPath;
if ( strRemotePath.startsWith( needAppOwnerFullPath ) ) {
- tizenCommand.runCommand( "chown -R app:app \"" + needAppOwnerFullPath + "\"" + TizenPlatformConstants.CMD_SUFFIX , true, TizenPlatformConstants.CMD_SUCCESS);
+ needAppOwnerSet.add(needAppOwnerFullPath);
break;
}
}
}
}
+ // TODO: It should be replaced to 'pkgcmd'
+ for ( String needAppOwnerPath : needAppOwnerSet ) {
+ try {
+ tizenCommand.runCommand( String.format(TizenPlatformConstants.RDS_CHANGE_OWNER_COMMAND, needAppOwnerPath) , true, TizenPlatformConstants.CMD_SUCCESS);
+ } catch (Exception e) {
+ newCoreException(RdsDeployer.makeRdsLog(RdsMessages.RDS_PUSH_ERROR), e);
+ }
+ }
+
if ( isNeededInstall ) {
postInstall();
}
}
+
+ public List<DeltaResourceInfo> getInterestDelta( List<DeltaResourceInfo> deltaInfoList ) {
+ List<DeltaResourceInfo> delta = new ArrayList<DeltaResourceInfo>();
+ boolean isIgnore = false;
+ String strProjectPath = project.getLocation().toString();
+ String strRemotePath = "";
+
+ for ( DeltaResourceInfo node : deltaInfoList ) {
+ isIgnore = false;
+
+ for ( DeltaResourceInfo ignore : ignoreList ) {
+ if ( node.getFullPath().startsWith(strProjectPath + ignore.getFullPath()) ) {
+ isIgnore = true;
+ break;
+ }
+ }
+ if ( isIgnore ) {
+ continue;
+ }
+
+ for ( DeltaResourceInfo interest : interestList ) {
+ if ( node.getFullPath().startsWith(strProjectPath + interest.getFullPath()) ) {
+ if ( interest.getRemotePath() == null ) {
+ strRemotePath = node.getFullPath().replaceFirst(strProjectPath, "");
+ }
+ else {
+ strRemotePath = node.getFullPath().replaceFirst(strProjectPath + interest.getFullPath(), interest.getRemotePath());
+ }
+ delta.add(new DeltaResourceInfo(node.getFullPath(), new String(strRemotePath) ));
+ break;
+ }
+ }
+ }
+
+ return delta;
+ }
+
+ public void cleanDeltaInfo() {
+ deltaInfoList = null;
+ strDeltaInfoFile = null;
+ }
- protected List<DeltaResourceInfo> getDelta() {
- return deltaDetector.getDelta(null, null);
+ public List<DeltaResourceInfo> getDelta() {
+ if ( deltaInfoList == null) {
+ deltaInfoList = deltaDetector.getDelta(null, null);
+ strDeltaInfoFile = deltaDetector.makeDeltaFile(null,null);
+ }
+ return deltaInfoList;
+ }
+
+ public String getDeltaInfoFile() {
+ getDelta();
+ return strDeltaInfoFile;
}
protected void postInstall() throws CoreException {
- String installCommand = String.format(TizenPlatformConstants.PKG_TOOL_INSTALL_COMMAND, pkgType.toLowerCase(), strAppInstallPath) + TizenPlatformConstants.CMD_SUFFIX;
+ SdbCommand sdbCommand = new SdbCommand(device, console);
try {
- tizenCommand.runCommand(installCommand, true, TizenPlatformConstants.CMD_SUCCESS);
+ String installCommand = String.format(TizenPlatformConstants.PKG_TOOL_INSTALL_COMMAND, pkgType.toLowerCase(), strAppInstallPath);
+ sdbCommand.runCommand(installCommand, new PkgcmdErrorType());
} catch (Exception e) {
newCoreException(RdsDeployer.makeRdsLog(RdsMessages.CANNOT_INSTALL), e);
}
public void pushResInfoFile() {
String appInstallPath = getAppInstallPath();
+
+ getDelta();
- String strResInfoFile = deltaDetector.makeDeltaFile(null,null);
String strRemotePath = appInstallPath + RdsDeltaDetector.STR_TREE_DIRECTORY + RdsDeltaDetector.STR_TREE_FILE;
try {
- getSyncService().pushFile(strResInfoFile, strRemotePath, SyncService.getNullProgressMonitor());
+ getSyncService().pushFile(strDeltaInfoFile, strRemotePath, SyncService.getNullProgressMonitor());
} catch (Exception e) {
Logger.error(RdsDeployer.makeRdsLog(RdsMessages.RDS_RES_INFO_PUSH_ERROR), e);
}
--- /dev/null
+/*
+* Common
+*
+* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+*
+* Contact:
+* Kangho Kim <kh5325.kim@samsung.com>
+* Gun Kim <gune.kim@samsung.com>
+*
+* 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.
+*
+* Contributors:
+* - S-Core Co., Ltd
+*
+*/
+
+package org.tizen.common.sdb.command;
+
+import java.io.File;
+import java.io.IOException;
+
+import org.tizen.common.TizenPlatformConstants;
+import org.tizen.common.sdb.command.message.CommandErrorException;
+import org.tizen.common.sdb.command.message.CommandErrorType;
+import org.tizen.common.ui.view.console.ConsoleManager;
+import org.tizen.common.util.StringUtil;
+import org.tizen.sdblib.IDevice;
+import org.tizen.sdblib.MultiLineReceiver;
+import org.tizen.sdblib.SdbCommandRejectedException;
+import org.tizen.sdblib.ShellCommandUnresponsiveException;
+import org.tizen.sdblib.TimeoutException;
+
+
+public class SdbCommand {
+ public static final int DEFAULT_TIMEOUT = 60000;
+ private IDevice device = null;
+ private ConsoleManager console = null;
+ private String endLine = "";
+ private String commandOutput = "";
+
+ public SdbCommand(IDevice device) {
+ this(device, null);
+ }
+
+ public SdbCommand(IDevice device, ConsoleManager console) {
+ this.device = device;
+ this.console = console;
+ }
+
+ public void runCommand(String command ) throws Exception {
+ if (console != null) {
+ console.println("$ " + command);
+ }
+
+ CommandOuputReceiver receiver = new CommandOuputReceiver();
+
+ device.executeShellCommand(command, receiver);
+
+ this.endLine = receiver.getEndLine();
+ this.commandOutput = receiver.getCommandOutput();
+ }
+
+ public CommandErrorType runCommand(String command, CommandErrorType messages ) throws CommandErrorException, TimeoutException, SdbCommandRejectedException, ShellCommandUnresponsiveException, IOException {
+ return runCommand(command, messages, DEFAULT_TIMEOUT);
+ }
+
+ public CommandErrorType runCommand(String command, CommandErrorType errorMessages, int timeout ) throws CommandErrorException, TimeoutException, SdbCommandRejectedException, ShellCommandUnresponsiveException, IOException{
+ if (console != null) {
+ console.println("$ " + command);
+ }
+
+ CommandOuputReceiver receiver = new CommandOuputReceiver();
+ device.executeShellCommand( makeCommandWithExitcode(command), receiver, timeout);
+
+ String endLine = receiver.getEndLine();
+ int exitcode = parseExitcode(endLine);
+
+ errorMessages.findErrorType(exitcode, command);
+ errorMessages.setCommandOutput(receiver.getCommandOutput());
+ errorMessages.makeException();
+
+ return errorMessages;
+ }
+
+ public String getEndLine() {
+ return endLine;
+ }
+
+ public String getCommandOutput() {
+ return commandOutput;
+ }
+
+ private int parseExitcode(String line) {
+ int exitcode = -1;
+ if ( line.startsWith(TizenPlatformConstants.CMD_RESULT_PREFIX) ) {
+ exitcode = Integer.parseInt( StringUtil.getOnlyNumerics(line));
+ }
+ return exitcode;
+ }
+
+ private String makeCommandWithExitcode(String command) {
+ return command + TizenPlatformConstants.CMD_SUFFIX;
+ }
+
+ private final class CommandOuputReceiver extends MultiLineReceiver {
+ private StringBuilder commandOutput = new StringBuilder(256);
+ private String endLine = null;
+
+ public CommandOuputReceiver() {
+ super();
+ setTrimLine(false);
+ }
+
+ @Override
+ public void processNewLines(String[] lines) {
+ for( String line: lines ) {
+ if (console != null) {
+ console.println(line);
+ }
+ commandOutput.append(line);
+ commandOutput.append(File.separatorChar);
+ }
+ endLine = lines[lines.length - 1];
+ }
+
+ public String getCommandOutput() {
+ return commandOutput.toString();
+ }
+
+ public String getEndLine() {
+ return endLine;
+ }
+ }
+}
--- /dev/null
+/*
+* Common
+*
+* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+*
+* Contact:
+* Kangho Kim <kh5325.kim@samsung.com>
+* Gun Kim <gune.kim@samsung.com>
+*
+* 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.
+*
+* Contributors:
+* - S-Core Co., Ltd
+*
+*/
+
+package org.tizen.common.sdb.command.message;
+
+public class CommandErrorException extends Exception{
+
+ private static final long serialVersionUID = 1L;
+
+
+ public CommandErrorException() {
+ super();
+ }
+
+ public CommandErrorException(String msg) {
+ super(msg);
+ }
+
+ public CommandErrorException(String msg, Throwable t) {
+ super(msg, t);
+ }
+
+ public CommandErrorException(Throwable t) {
+ super(t);
+ }
+}
--- /dev/null
+/*
+* Common
+*
+* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+*
+* Contact:
+* Kangho Kim <kh5325.kim@samsung.com>
+* Gun Kim <gune.kim@samsung.com>
+*
+* 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.
+*
+* Contributors:
+* - S-Core Co., Ltd
+*
+*/
+
+package org.tizen.common.sdb.command.message;
+
+public interface CommandErrorType {
+ public boolean findErrorType(int exitCode, String command);
+ public String getMessage();
+ public int getExitCode();
+ public void setCommand(String command);
+ public void setCommandOutput(String commandOutput);
+ public void makeException() throws CommandErrorException;
+}
--- /dev/null
+/*
+* Common
+*
+* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+*
+* Contact:
+* Kangho Kim <kh5325.kim@samsung.com>
+* Gun Kim <gune.kim@samsung.com>
+*
+* 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.
+*
+* Contributors:
+* - S-Core Co., Ltd
+*
+*/
+
+package org.tizen.common.sdb.command.message;
+
+import org.eclipse.osgi.util.NLS;
+
+public class PkgcmdErrorMessages {
+ static {
+ NLS.initializeMessages(PkgcmdErrorMessages.class.getName(), PkgcmdErrorMessages.class);
+ }
+
+
+ public static String MESSAGE_FORMAT;
+ public static String ERROR_PACKAGE_NOT_FOUND;
+ public static String ERROR_PACKAGE_INVALID;
+ public static String ERROR_PACKAGE_LOWER_VARSION;
+ public static String ERROR_PACKAGE_EXECUTABLE_NOT_FOUND;
+ public static String ERROR_MANIFEST_NOT_FOUND;
+ public static String ERROR_MANIFEST_INVALID;
+ public static String ERROR_CONFIG_NOT_FOUND;
+ public static String ERROR_CONFIG_INVALID;
+ public static String ERROR_SIGNATURE_NOT_FOUND;
+ public static String ERROR_SIGNATURE_INVALID;
+ public static String ERROR_SIGNATURE_VERIFICATION_FAILED;
+ public static String ERROR_ROOT_CERTIFICATE_NOT_FOUND;
+ public static String ERROR_CERTIFICATE_INVALID;
+ public static String ERROR_CERTIFICATE_CHAIN_VERIFICATION_FAILED;
+ public static String ERROR_CERTIFICATE_EXPIRED;
+ public static String ERROR_INVALID_PRIVILEGE;
+ public static String ERROR_MENU_ICON_NOT_FOUND;
+ public static String ERROR_FATAL_ERROR;
+ public static String ERROR_OUT_OF_STORAGE;
+ public static String ERROR_OUT_OF_MEMORY;
+ public static String ERROR_UNKNOWN;
+
+}
--- /dev/null
+MESSAGE_FORMAT=\nError code: %s\nError message: %s\nCommand: %s\nManagement: %s\n
+
+ERROR_PACKAGE_NOT_FOUND=Check package components in Project Explorer.
+ERROR_PACKAGE_INVALID=Check package components in Project Explorer.
+ERROR_PACKAGE_LOWER_VARSION=RDS does not support installation for the lower version. If you want to install the lower version, please turn off RDS.
+ERROR_PACKAGE_EXECUTABLE_NOT_FOUND=Check "Right Click" in Project Explorer > Build Configurations.
+ERROR_MANIFEST_NOT_FOUND=Check manifest.xml in Project Explorer.
+ERROR_MANIFEST_INVALID=Check manifest.xml in manifest editor.
+ERROR_CONFIG_NOT_FOUND=Check config.xml in Project Explorer.
+ERROR_CONFIG_INVALID=Check manifest.xml in config editor.
+ERROR_SIGNATURE_NOT_FOUND=Check author certificates in Preferences > Tizen SDK > Secure Profiles > Profile items.
+ERROR_SIGNATURE_INVALID=Check author certificates in Preferences > Tizen SDK > Secure Profiles > Profile items.
+ERROR_SIGNATURE_VERIFICATION_FAILED=Check whether the package is modified illegally.
+ERROR_ROOT_CERTIFICATE_NOT_FOUND=Insert root certificate into device or emulator.
+ERROR_CERTIFICATE_INVALID=Check author certificates in Preferences > Tizen SDK > Secure Profiles > Profile items.
+ERROR_CERTIFICATE_CHAIN_VERIFICATION_FAILED=Check author certificates in Preferences > Tizen SDK > Secure Profiles > Profile items.
+ERROR_CERTIFICATE_EXPIRED=Check the system time in device or emulator.
+ERROR_INVALID_PRIVILEGE=Check privilege strings in manifest editor > Privileges > Privileges.
+ERROR_MENU_ICON_NOT_FOUND=Select a menu icon in manifest editor > Basic tab > Icon > MainMenu.
+ERROR_FATAL_ERROR=Installation or uninstallation is not working temporarily.
+ERROR_OUT_OF_STORAGE=Guarantee storage for installation in device or emulator.
+ERROR_OUT_OF_MEMORY=Restart device or emulator.
+ERROR_UNKNOWN=\nUnknown error\n\nSee the error log for more details.
\ No newline at end of file
--- /dev/null
+/*
+* Common
+*
+* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+*
+* Contact:
+* Kangho Kim <kh5325.kim@samsung.com>
+* Gun Kim <gune.kim@samsung.com>
+*
+* 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.
+*
+* Contributors:
+* - S-Core Co., Ltd
+*
+*/
+
+package org.tizen.common.sdb.command.message;
+
+
+public class PkgcmdErrorType implements CommandErrorType {
+ private final static String ERROR_MESSAGE_TEMPLATE = "error message: ";
+
+ private ErrorMessageType errorType;
+ private String errorMessage = "";
+ private String command;
+ private String commandOutput;
+
+ @Override
+ public boolean findErrorType(int exitCode, String command) {
+ errorType = ErrorMessageType.getErrorType(exitCode);
+
+ if ( errorType == null ) {
+ return false;
+ }
+ else {
+ this.command = command;
+ return true;
+ }
+ }
+
+ @Override
+ public String getMessage() {
+ if (errorType == null ) {
+ return null;
+ }
+ else {
+ return String.format(PkgcmdErrorMessages.MESSAGE_FORMAT, errorType.name(), errorMessage, command, errorType.getManagement() );
+ }
+ }
+
+ @Override
+ public int getExitCode() {
+ if (errorType == null ) {
+ return -1;
+ }
+ return errorType.getExitCode();
+ }
+
+ @Override
+ public void setCommand(String command) {
+ this.command = command;
+ }
+
+ @Override
+ public void setCommandOutput(String commandOutput) {
+ this.commandOutput = commandOutput;
+ if ( this.commandOutput == null ) {
+ this.errorMessage = "";
+ }
+ else {
+ this.errorMessage = parseErrorMessage();
+ }
+ }
+
+ @Override
+ public void makeException() throws CommandErrorException{
+ if (errorType == null ) {
+ throw new CommandErrorException(PkgcmdErrorMessages.ERROR_UNKNOWN);
+ }
+ else if (!ErrorMessageType.SUCCESS.equals(errorType)) {
+ throw new CommandErrorException(getMessage());
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getMessage();
+ }
+
+ private String parseErrorMessage( ) {
+ int startIdx = commandOutput.indexOf(ERROR_MESSAGE_TEMPLATE);
+ int endIdx = commandOutput.indexOf("\n", startIdx);
+
+ if ( startIdx == -1 || endIdx == -1) {
+ return "";
+ }
+ else {
+ return commandOutput.substring(startIdx, endIdx);
+ }
+ }
+
+ enum ErrorMessageType {
+ SUCCESS(0, null),
+ PACKAGE_NOT_FOUND(1, PkgcmdErrorMessages.ERROR_PACKAGE_NOT_FOUND),
+ PACKAGE_INVALID(2, PkgcmdErrorMessages.ERROR_PACKAGE_INVALID),
+ PACKAGE_LOWER_VERSION(3, PkgcmdErrorMessages.ERROR_PACKAGE_LOWER_VARSION),
+ PACKAGE_EXECUTABLE_NOT_FOUND(4, PkgcmdErrorMessages.ERROR_PACKAGE_EXECUTABLE_NOT_FOUND),
+ MANIFEST_NOT_FOUND(11, PkgcmdErrorMessages.ERROR_MANIFEST_NOT_FOUND),
+ MANIFEST_INVALID(12, PkgcmdErrorMessages.ERROR_MANIFEST_INVALID),
+ CONFIG_NOT_FOUND(13, PkgcmdErrorMessages.ERROR_CONFIG_NOT_FOUND),
+ CONFIG_INVALID(14, PkgcmdErrorMessages.ERROR_CONFIG_INVALID),
+ SIGNATURE_NOT_FOUND(21, PkgcmdErrorMessages.ERROR_SIGNATURE_NOT_FOUND),
+ SIGNATURE_INVALID(22, PkgcmdErrorMessages.ERROR_SIGNATURE_INVALID),
+ SIGNATURE_VERIFICATION_FAILED(23, PkgcmdErrorMessages.ERROR_SIGNATURE_VERIFICATION_FAILED),
+ ROOT_CERTIFICATE_NOT_FOUND(31, PkgcmdErrorMessages.ERROR_ROOT_CERTIFICATE_NOT_FOUND),
+ CERTIFICATE_INVALID(32, PkgcmdErrorMessages.ERROR_CERTIFICATE_INVALID),
+ CERTIFICATE_CHAIN_VERIFICATION_FAILED(33, PkgcmdErrorMessages.ERROR_CERTIFICATE_CHAIN_VERIFICATION_FAILED),
+ CERTIFICATE_EXPIRED(34, PkgcmdErrorMessages.ERROR_CERTIFICATE_EXPIRED),
+ INVALID_PRIVILEGE(41, PkgcmdErrorMessages.ERROR_INVALID_PRIVILEGE),
+ MENU_ICON_NOT_FOUND(51, PkgcmdErrorMessages.ERROR_MENU_ICON_NOT_FOUND),
+ FATAL_ERROR(61, PkgcmdErrorMessages.ERROR_FATAL_ERROR),
+ OUT_OF_STORAGE(62, PkgcmdErrorMessages.ERROR_OUT_OF_STORAGE),
+ OUT_OF_MEMORY(63, PkgcmdErrorMessages.ERROR_OUT_OF_MEMORY);
+
+ private int exitCode;
+ private String management;
+
+ private ErrorMessageType(int exitCode, String management) {
+ this.exitCode = exitCode;
+ this.management = management;
+ }
+
+ public String getManagement() {
+ return management;
+ }
+
+ public String toString() {
+ return name();
+ }
+
+ public int getExitCode() {
+ return exitCode;
+ }
+
+ public static ErrorMessageType getErrorType(int exitCode) {
+ for ( ErrorMessageType message : ErrorMessageType.values() ) {
+ if ( message.getExitCode() == exitCode ) {
+ return message;
+ }
+ }
+ // unknown exitcode
+ return null;
+ }
+ }
+}
\ No newline at end of file
/*
- * Web IDE - launch
+ * Common
*
* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
*
--- /dev/null
+/*\r
+* Common\r
+*\r
+* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.\r
+*\r
+* Contact: \r
+* Ho Namkoong <ho.namkoong@samsung.com>\r
+* \r
+* Licensed under the Apache License, Version 2.0 (the "License");\r
+* you may not use this file except in compliance with the License.\r
+* You may obtain a copy of the License at\r
+*\r
+* http://www.apache.org/licenses/LICENSE-2.0\r
+*\r
+* Unless required by applicable law or agreed to in writing, software\r
+* distributed under the License is distributed on an "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+* See the License for the specific language governing permissions and\r
+* limitations under the License.\r
+*\r
+* Contributors:\r
+* - S-Core Co., Ltd\r
+*\r
+*/\r
+\r
+package org.tizen.common.ui;\r
+\r
+import java.net.MalformedURLException;\r
+import java.net.URL;\r
+\r
+import org.eclipse.jface.window.DefaultToolTip;\r
+import org.eclipse.swt.SWT;\r
+import org.eclipse.swt.events.SelectionAdapter;\r
+import org.eclipse.swt.events.SelectionEvent;\r
+import org.eclipse.swt.events.SelectionListener;\r
+import org.eclipse.swt.graphics.Color;\r
+import org.eclipse.swt.graphics.Cursor;\r
+import org.eclipse.swt.graphics.Font;\r
+import org.eclipse.swt.graphics.Point;\r
+import org.eclipse.swt.layout.GridData;\r
+import org.eclipse.swt.layout.GridLayout;\r
+import org.eclipse.swt.widgets.Composite;\r
+import org.eclipse.swt.widgets.Control;\r
+import org.eclipse.swt.widgets.Event;\r
+import org.eclipse.swt.widgets.Label;\r
+import org.eclipse.swt.widgets.Link;\r
+import org.eclipse.swt.widgets.Listener;\r
+import org.eclipse.swt.widgets.Shell;\r
+import org.eclipse.ui.PlatformUI;\r
+import org.slf4j.Logger;\r
+import org.slf4j.LoggerFactory;\r
+import org.tizen.common.util.OpenBrowserUtil;\r
+import org.tizen.common.util.StringUtil;\r
+\r
+public class HelpToolTip extends DefaultToolTip {\r
+ final Logger logger = LoggerFactory.getLogger(HelpToolTip.class);\r
+\r
+ private Cursor helpCursor;\r
+ private TooltipShowListener showListener;\r
+ private TooltipHideListener hideListener;\r
+ private Composite composite;\r
+ private Control tooltipControl;\r
+ private int popupDelay;\r
+ private boolean showOnMouseDown;\r
+ private boolean focusOnHover;\r
+ private SelectionListener linkListener;\r
+\r
+ public HelpToolTip(Composite c) {\r
+ this(c, true, false);\r
+ }\r
+\r
+ public HelpToolTip(Composite c, boolean showOnMouseDown, boolean hideOnMouseDown) {\r
+ super(HelpToolTip.createHelpIcon(c), NO_RECREATE, false);\r
+ tooltipControl = (Control) getToolTipArea(null);\r
+ helpCursor = new Cursor(tooltipControl.getShell().getDisplay(), SWT.CURSOR_HAND);\r
+ tooltipControl.setCursor(helpCursor);\r
+ showListener = new TooltipShowListener();\r
+ hideListener = new TooltipHideListener();\r
+ linkListener = new TooltipSelectionListener();\r
+ tooltipControl.addListener(SWT.MouseDown, showListener);\r
+\r
+ setPopupDelay(1000);\r
+ setShowOnMouseDown(showOnMouseDown);\r
+ setHideOnMouseDown(hideOnMouseDown);\r
+ }\r
+\r
+ @Override\r
+ public void deactivate() {\r
+ super.deactivate();\r
+ if (tooltipControl != null)\r
+ tooltipControl.removeListener(SWT.MouseDown, showListener);\r
+ }\r
+\r
+ @Override\r
+ public void activate() {\r
+ super.activate();\r
+ setShowOnMouseDown(showOnMouseDown);\r
+ }\r
+\r
+ @Override\r
+ protected final Composite createToolTipContentArea(Event event, Composite parent) {\r
+ composite = doCreateToolTipContentArea(event, parent);\r
+ tooltipControl.removeListener(SWT.MouseDown, showListener);\r
+ if (composite != null)\r
+ tooltipControl.addListener(SWT.MouseExit, hideListener);\r
+ return composite;\r
+ }\r
+\r
+ protected Composite doCreateToolTipContentArea(Event event, Composite parent) {\r
+ String text = getText(event);\r
+ Color fgColor = getForegroundColor(event);\r
+ Color bgColor = getBackgroundColor(event);\r
+ Font font = getFont(event);\r
+ SelectionListener listener = getLinkListener(event);\r
+ Composite composite = new Composite(parent, 0);\r
+ composite.setLayout(new GridLayout());\r
+ Control label;\r
+\r
+ if (listener != null) {\r
+ setFocusOnHover(true);\r
+ label = new Link(composite, getStyle(event) | 0x40);\r
+ ((Link) label).addSelectionListener(listener);\r
+ if (text != null)\r
+ ((Link) label).setText(text);\r
+ } else {\r
+ label = new Label(composite, getStyle(event) | 0x40);\r
+ if (text != null)\r
+ ((Label) label).setText(text);\r
+ }\r
+\r
+ if (label.computeSize(-1, -1).x > 350) {\r
+ GridData gd = new GridData();\r
+ gd.widthHint = 350;\r
+ label.setLayoutData(gd);\r
+ }\r
+ if (fgColor != null)\r
+ label.setForeground(fgColor);\r
+ if (bgColor != null) {\r
+ composite.setBackground(bgColor);\r
+ label.setBackground(bgColor);\r
+ }\r
+ if (font != null)\r
+ label.setFont(font);\r
+\r
+ return composite;\r
+ }\r
+\r
+ protected void afterHideToolTip(Event event) {\r
+ tooltipControl.removeListener(SWT.MouseDown, showListener);\r
+ if (showOnMouseDown)\r
+ tooltipControl.addListener(SWT.MouseDown, showListener);\r
+ tooltipControl.removeListener(SWT.MouseExit, hideListener);\r
+\r
+ super.afterHideToolTip(event);\r
+ }\r
+\r
+ public void setPopupDelay(int popupDelay) {\r
+ this.popupDelay = popupDelay;\r
+ super.setPopupDelay(popupDelay);\r
+ }\r
+\r
+ protected SelectionListener getLinkListener(Event event) {\r
+ return linkListener;\r
+ }\r
+\r
+ public void setShowOnMouseDown(boolean showOnMouseDown) {\r
+ this.showOnMouseDown = showOnMouseDown;\r
+ if (tooltipControl != null) {\r
+ tooltipControl.removeListener(SWT.MouseDown, showListener);\r
+ if (showOnMouseDown)\r
+ tooltipControl.addListener(SWT.MouseDown, showListener);\r
+ }\r
+ }\r
+\r
+ public boolean isShowOnMouseDown() {\r
+ return showOnMouseDown;\r
+ }\r
+\r
+ public void setFocusOnHover(boolean focusOnHover) {\r
+ this.focusOnHover = focusOnHover;\r
+ }\r
+\r
+ public boolean isFocusOnHover() {\r
+ return focusOnHover;\r
+ }\r
+\r
+ private static Label createHelpIcon(Composite c) {\r
+ Label helpIcon = new Label(c, SWT.NONE);\r
+ helpIcon.setImage(PlatformUI.getWorkbench().getSharedImages().getImage("IMG_LCL_LINKTO_HELP"));\r
+ return helpIcon;\r
+ }\r
+\r
+ public void dispose() {\r
+ if (helpCursor != null)\r
+ helpCursor.dispose();\r
+ }\r
+\r
+ class TooltipShowListener implements Listener {\r
+ @Override\r
+ public void handleEvent(Event event) {\r
+ switch (event.type) {\r
+ case SWT.MouseDown :\r
+ hide();\r
+ setPopupDelay(0);\r
+ Point cursorAbsLocation = tooltipControl.getDisplay().getCursorLocation();\r
+ Point containerAbsLocation = tooltipControl.getParent().toDisplay(tooltipControl.getLocation());\r
+ int relativeX = cursorAbsLocation.x - containerAbsLocation.x;\r
+ int relativeY = cursorAbsLocation.y - containerAbsLocation.y;\r
+ show(new Point(relativeX, relativeY));\r
+ setPopupDelay(popupDelay);\r
+\r
+ break;\r
+ }\r
+ }\r
+ }\r
+\r
+ class TooltipHideListener implements Listener {\r
+ @Override\r
+ public void handleEvent(Event event) {\r
+ if (composite.isDisposed())\r
+ return;\r
+\r
+ Shell shell = composite.getShell();\r
+ switch (event.type) {\r
+ case SWT.MouseUp :\r
+ case SWT.MouseMove :\r
+ case SWT.MouseEnter :\r
+ break;\r
+ case SWT.MouseDown :\r
+ if (isHideOnMouseDown())\r
+ hide();\r
+\r
+ break;\r
+ case SWT.MouseExit :\r
+ if (!shell.getBounds().contains(composite.getDisplay().getCursorLocation())) {\r
+ hide();\r
+ break;\r
+ }\r
+ if (focusOnHover) {\r
+ shell.setActive();\r
+ composite.setFocus();\r
+ }\r
+\r
+ break;\r
+ }\r
+ }\r
+ }\r
+\r
+ class TooltipSelectionListener extends SelectionAdapter {\r
+ public void widgetSelected(SelectionEvent e) {\r
+ hide();\r
+ String link = e.text.toLowerCase();\r
+ if (link == null)\r
+ return;\r
+ if (link.startsWith("http://"))\r
+ try {\r
+ OpenBrowserUtil.openExternal(new URL(e.text), tooltipControl.getDisplay());\r
+ } catch (MalformedURLException e1) {\r
+ logger.error(e1.getMessage());\r
+ }\r
+ else if (link.startsWith("help://")) {\r
+ // help://org.tizen.native.appprogramming/html/ide_sdk_tools/project_settings.htm -> /org.tizen.native.appprogramming/html/ide_sdk_tools/project_settings.htm\r
+ PlatformUI.getWorkbench().getHelpSystem().displayHelpResource("/" + StringUtil.removeStart(link, "help://"));\r
+ }\r
+ }\r
+ }\r
+}\r
--- /dev/null
+/*
+ * Common
+ *
+ * Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Changhyun Lee <changhyun1.lee@samsung.com>
+ * Hyeongseok Heo <hyeongseok.heo@samsung.com>
+ * Kangho Kim <kh5325.kim@samsung.com>
+ *
+ * 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.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+package org.tizen.common.ui.dialog;
+
+import java.awt.AlphaComposite;
+import java.awt.Graphics2D;
+import java.awt.image.BufferedImage;
+import java.io.File;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.ImageData;
+import org.eclipse.swt.graphics.ImageLoader;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.dialogs.SelectionStatusDialog;
+import org.tizen.common.CommonPlugin;
+import org.tizen.common.ScreenDensity;
+import org.tizen.common.util.ImageUtil;
+import org.tizen.common.util.log.Logger;
+
+/**
+ * The original source is org.tizen.nativecpp.misc.editor.UiNewIconDialog
+ */
+public class NewIconDialog extends SelectionStatusDialog {
+
+ public static final String ICON_FILE_NAME = "icon.png";
+ public static final String[] ICON_FILTER_EXTENSIONS = { "*.png;*.gif;*.jpg" };
+ public static final String MASK_IMAGE_PATH = "/icons/mask.png";
+ public static final String EFFECT_IMAGE_PATH = "/icons/effect.png";
+ public static final int ICON_SIZE = ScreenDensity.XHIGH.getIconSize(); // WebApp icon is always XHIGH(108x108)
+
+ private Text fText;
+ private Button fBrowseBtn;
+ private String fPath;
+ private Label fPreviewImage, fPreviewLabel;
+ private Button fApplyEffectCheck;
+ private IProject fProject; // need to refresh file tree
+ private Label lblNewLabel;
+ private Label lblImageFile;
+ private BufferedImage fMaskImage, fEffectImage, fIconImage;
+
+ public NewIconDialog(Shell parentShell, IProject project) {
+ super(parentShell);
+ setTitle("Add Icon");
+ fProject = project;
+
+ setStatusLineAboveButtons(true);
+ }
+
+ public String getPath() {
+ return fPath;
+ }
+
+ @Override
+ protected Control createDialogArea(Composite parent) {
+ Composite grid = new Composite(parent, SWT.NONE);
+ grid.setLayout(new GridLayout(4, false));
+ GridData gd = new GridData(GridData.FILL_BOTH);
+ // gd.widthHint = 400;
+ grid.setLayoutData(gd);
+ applyDialogFont(grid);
+
+ lblImageFile = new Label(grid, SWT.NONE);
+ lblImageFile.setText("Image File:");
+ lblImageFile.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
+
+ fText = new Text(grid, SWT.BORDER);
+ fText.addModifyListener(new ModifyListener() {
+ @Override
+ public void modifyText(ModifyEvent e) {
+ validate();
+ }
+ });
+ fText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
+
+ fBrowseBtn = new Button(grid, SWT.PUSH);
+ fBrowseBtn.setText("Browse...");
+ fBrowseBtn.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ super.widgetSelected(e);
+ handleBrowse();
+ }
+ });
+ fBrowseBtn.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
+
+ fPreviewLabel = new Label(grid, SWT.NONE);
+ fPreviewLabel.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false, false, 1, 1));
+ fPreviewLabel.setText(String.format("Preview(%1$dx%2$d)", ICON_SIZE, ICON_SIZE));
+
+ lblNewLabel = new Label(grid, SWT.NONE);
+ lblNewLabel.setLayoutData(new GridData(SWT.RIGHT, SWT.TOP, false, false, 1, 1));
+ lblNewLabel.setText("Option:");
+
+ fApplyEffectCheck = new Button(grid, SWT.CHECK);
+ fApplyEffectCheck.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false, 1, 1));
+ fApplyEffectCheck.setText("Apply shadow effect");
+ fApplyEffectCheck.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ validate();
+ super.widgetSelected(e);
+ }
+ });
+ new Label(grid, SWT.NONE);
+
+ fPreviewImage = new Label(grid, SWT.BORDER);
+ gd = new GridData(SWT.RIGHT, SWT.FILL, false, false, 1, 2);
+ gd.widthHint = 120;
+ gd.heightHint = 120;
+ fPreviewImage.setLayoutData(gd);
+
+ setHelpAvailable(false);
+ validate();
+
+ return grid;
+ }
+
+ private void validate() {
+ computeResult();
+ IStatus status = null;
+
+ File file = new File(fPath);
+
+ if (fPath.length() < 3 || file.isDirectory()) {
+ status = new Status(IStatus.ERROR, CommonPlugin.PLUGIN_ID, "Enter a path");
+ } else if (!file.exists()) {
+ status = new Status(IStatus.ERROR, CommonPlugin.PLUGIN_ID, fPath + " does not exist");
+ } else {
+ status = new Status(IStatus.OK, CommonPlugin.PLUGIN_ID, null);
+ }
+
+ updateStatus(status);
+
+ if (status.isOK()) {
+ updatePreview();
+ }
+ }
+
+ @Override
+ protected void okPressed() {
+ IFile destFile = fProject.getFile(ICON_FILE_NAME);
+ String destFilePath = destFile.getLocation().toString();
+
+ if (destFile.exists()) {
+ MessageDialog dlg = new MessageDialog(getShell(),
+ "File Already Exists",
+ null,
+ destFile.getProjectRelativePath().toOSString() + " already exists.\nWould you like to replace it?",
+ MessageDialog.QUESTION,
+ new String[] { "Yes", "No" },
+ 0
+ );
+
+ if (dlg.open() == 1) {
+ return;
+ } else {
+ try {
+ if (! fPath.equals(destFilePath)) {
+ destFile.delete(true, null);
+ }
+ } catch (CoreException e) {
+ Logger.log(e);
+ }
+ }
+ }
+
+ try {
+ Image image = fPreviewImage.getImage();
+ ImageLoader loader = new ImageLoader();
+ loader.data = new ImageData[] { image.getImageData() };
+ loader.save(destFilePath, SWT.IMAGE_PNG);
+ destFile.getParent().refreshLocal(1, null);
+ } catch (CoreException e1) {
+ Logger.log(e1);
+ }
+
+ super.okPressed(); // widget will be disposed
+ }
+
+ @Override
+ protected void computeResult() {
+ fPath = fText.getText();
+ }
+
+ protected void updatePreview() {
+ Image image = null;
+ BufferedImage srcImage = ImageUtil.getAWTImage(fPath, false);
+ fIconImage = ImageUtil.getScaledImage(srcImage, ICON_SIZE, ICON_SIZE);
+
+ if (fMaskImage == null) {
+ fMaskImage = ImageUtil.getAWTImage(MASK_IMAGE_PATH, true);
+ }
+ if (fEffectImage == null) {
+ fEffectImage = ImageUtil.getAWTImage(EFFECT_IMAGE_PATH, true);
+ }
+
+ BufferedImage tempImage = new BufferedImage(fMaskImage.getWidth(), fMaskImage.getHeight(), BufferedImage.TYPE_INT_ARGB);
+ Graphics2D graph = tempImage.createGraphics();
+ graph.drawImage(fMaskImage, 0, 0, null);
+ graph.setComposite(AlphaComposite.SrcAtop);
+ graph.drawImage(fIconImage, 0, 0, null);
+ // shadow effect
+ if (fEffectImage != null && fApplyEffectCheck.getSelection()) {
+ graph.drawImage(fEffectImage, 0, 0, null);
+ }
+ graph.dispose();
+
+ image = ImageUtil.convertImageToSWT(getShell().getDisplay(), tempImage);
+ fPreviewImage.setImage(image);
+ }
+
+ public void handleBrowse() {
+ FileDialog dialog = new FileDialog(Display.getDefault().getActiveShell(), SWT.OPEN);
+ dialog.setFilterExtensions(ICON_FILTER_EXTENSIONS);
+ String src = dialog.open();
+ if (src == null) {
+ return;
+ }
+ fText.setText(src);
+ }
+
+}
--- /dev/null
+/*
+ * Common
+ *
+ * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Hyunsik Noh <hyunsik.noh@samsung.com>
+ *
+ * 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.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+package org.tizen.common.ui.dialog;
+
+import org.eclipse.jface.dialogs.ProgressIndicator;
+import org.eclipse.jface.dialogs.ProgressMonitorDialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+
+public class TransferProgressMonitorDialog extends ProgressMonitorDialog {
+
+ private Label fromLabel;
+ private Label toLabel;
+ private Label sizeLabel;
+
+ private String titleStr = "Progress Information";
+
+ public TransferProgressMonitorDialog(Shell parent) {
+ super(parent);
+ }
+
+ public TransferProgressMonitorDialog(Shell parent, String title) {
+ super(parent);
+ if(title != null)
+ {
+ titleStr = title;
+ }
+ }
+
+ /*
+ * (non-Javadoc) Method declared on Dialog.
+ * Create Dialog has 3 label(source , destination, Transfered size)
+ */
+ protected Control createDialogArea(Composite parent) {
+ setMessage(titleStr, false);
+ createMessageArea(parent);
+ // Only set for backwards compatibility
+ taskLabel = messageLabel;
+ // progress indicator
+ progressIndicator = new ProgressIndicator(parent);
+ GridData gd = new GridData();
+ gd.heightHint = convertVerticalDLUsToPixels(9);
+ gd.horizontalAlignment = GridData.FILL;
+ gd.grabExcessHorizontalSpace = true;
+ gd.horizontalSpan = 2;
+ progressIndicator.setLayoutData(gd);
+ // label showing current task
+ fromLabel = new Label(parent, SWT.LEFT | SWT.WRAP);
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+
+ gd.horizontalSpan = 3;
+ fromLabel.setLayoutData(gd);
+ fromLabel.setFont(parent.getFont());
+
+ toLabel = new Label(parent, SWT.LEFT | SWT.WRAP);
+ toLabel.setLayoutData(gd);
+ toLabel.setFont(parent.getFont());
+
+ sizeLabel = new Label(parent, SWT.LEFT | SWT.WRAP);
+ sizeLabel.setLayoutData(gd);
+ sizeLabel.setFont(parent.getFont());
+ return parent;
+ }
+
+ public Label getFromLabel() {
+ return fromLabel;
+ }
+
+ public Label getToLabel() {
+ return toLabel;
+ }
+
+ public Label getSizeLabel() {
+ return sizeLabel;
+ }
+
+ /**
+ * Set the message in the message label.
+ *
+ * @param messageString
+ * The string for the new message.
+ * @param force
+ * If force is true then always set the message text.
+ */
+ private void setMessage(String messageString, boolean force) {
+ // must not set null text in a label
+ message = messageString == null ? "" : messageString; //$NON-NLS-1$
+ if (messageLabel == null || messageLabel.isDisposed()) {
+ return;
+ }
+ if (force || messageLabel.isVisible()) {
+ messageLabel.setToolTipText(message);
+ messageLabel.setText(shortenText(message, messageLabel));
+ }
+ }
+
+}
DirectoryFieldEditor mDirectoryField = new DirectoryFieldEditor(KEY_SDKLOCATION,
Messages.LABEL_LOCATION, formatComposite);
addField(mDirectoryField);
+
+ mDirectoryField.setEnabled(false, formatComposite);
}
private void createUpdateSettingPreferences(Composite parent)
protected static int retValue = 0;
private final static Object lockQuestion = new Object();
public static int openQuestionDialog(String message) {
- return openQuestionDialog( new Shell(), "Question", message );
+ return openQuestionDialog(new Shell(), "Question", message);
}
public static int openQuestionDialog(final Shell shell, final String title, final String message) {
- synchronized ( lockQuestion ) {
+ synchronized (lockQuestion) {
final String msg = message;
- SWTUtil.syncExec( new Runnable() {
+ SWTUtil.syncExec(new Runnable() {
public void run() {
- MessageBox dialog = new MessageBox( shell, SWT.YES | SWT.NO | SWT.ICON_QUESTION );
+ MessageBox dialog = new MessageBox(shell, SWT.YES | SWT.NO | SWT.ICON_QUESTION);
dialog.setText( title );
- dialog.setMessage( msg );
+ dialog.setMessage(msg);
retValue = dialog.open();
}
- } );
+ });
return retValue;
}
* @author Jihoon Song {@literal <jihoon80.song@samsung.com>} (S-Core)
*/
public static String getFileExtension(String fullName) {
- if (fullName == null) {
- return null;
- }
-
- int k = fullName.lastIndexOf(".");
-
- return (k != -1) ? fullName.substring(k + 1, fullName.length()) : null;
+ return StringUtil.getLastStringAfter(fullName, ".");
}
/**
return (k != -1) ? fullName.substring(0, k) : fullName;
}
+
+ /**
+ * Returns file name from path
+ *
+ * @param path
+ * @return
+ */
+ public static String getFileNameFromPath(String path) {
+ String result = StringUtil.getLastStringAfter(path, "/");
+
+ if(result == null) {
+ result = StringUtil.getLastStringAfter(path, "\\");
+ }
+
+ if(result == null) {
+ result = path;
+ }
+
+ return result;
+ }
/**
* delete file and its children.
redirect( input, contents );
return trim( contents.toString() );
} catch( final IOException e) {
- logger.warn( "Exception occurred: ", e );
+ logger.info( "Exception occurred:", e );
return null;
}finally{
tryClose( input, contents );
try {
proc= runtime.exec(fullCommand);
i = proc.waitFor();
- } catch (IOException e) {
- logger.warn( "Exception occurred: ", e );
+ } catch ( IOException e) {
+ logger.info( "Exception occurred:", e );
return false;
- }
- catch (InterruptedException e)
+ } catch (InterruptedException e)
{
- logger.warn( "Exception occurred: ", e );
+ logger.info( "Exception occurred:", e );
+ return false;
} finally{
logger.info( "HostUtil execute - exit value : {}", i );
if(proc!=null)
StreamGobbler gb2 = new StreamGobbler(p.getErrorStream());
gb1.start();
gb2.start();
- }catch(IOException e){
- logger.warn( "Exception occurred: ", e );
+ }catch( final IOException e ) {
+ logger.info( "Exception occurred:", e );
return false;
} catch (InterruptedException e)
{
- logger.warn( "Exception occurred: ", e );
+ logger.info( "Exception occurred:", e );
return false;
}
return i == 0;
gb2 = new StreamGobbler(p.getErrorStream());
gb1.start();
gb2.start();
- }catch(IOException e){
- logger.warn( "Exception occurred: ", e );
+ }catch( final IOException e ) {
+ logger.info( "Exception occurred:", e );
return false;
}finally{
logger.debug( "Output Stream :{}", gb1.getResult() );
contents.append(line);
contents.append(LINE_SEPARATOR);
}
- } catch (IOException e) {
- logger.warn( "Exception occurred: ", e );
+ } catch ( IOException e ) {
+ logger.info( "Exception occurred:", e );
return null;
} finally{
tryClose( input );
* Show output messages while executes the command on console view
* @param command - Command to execute.
* @param viewName - View name showing messages while executes the command.
- *
* @throws IOException
* @throws InterruptedException
*/
- public static void executeWithConsole(String command, String viewName) throws IOException, InterruptedException
- {
+ public static void executeWithConsole(String command, String viewName) throws IOException, InterruptedException {
BufferedReader input = null;
String line = null;
output = new BufferedWriter(new FileWriter(file));
output.write(contents);
return true;
- } catch (IOException e) {
- logger.warn( "Exception occurred: ", e );
+ } catch ( IOException e) {
+ logger.info( "Exception occurred:", e );
return false;
}finally{
tryClose( output );
/**
* @deprecated Use {@link FileUtil#copyTo(String, String)} instead.
- *
* @throws IOException
*/
@Deprecated
- public static boolean copyFile(String src, String des) throws IOException {
+ public static boolean copyFile(String src, String des) throws IOException {
boolean canExecute = false;
File srcFile=new File(src);
File desFile=null;
*/
package org.tizen.common.util;
+import java.awt.Graphics;
+import java.awt.image.BufferedImage;
+import java.awt.image.DirectColorModel;
+import java.awt.image.IndexColorModel;
+import java.awt.image.WritableRaster;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
import java.net.URL;
+import javax.imageio.ImageIO;
+
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Plugin;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.ImageData;
+import org.eclipse.swt.graphics.PaletteData;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.swt.widgets.Display;
import org.osgi.framework.Bundle;
import org.tizen.common.SurrogateWithArgument;
-
+import org.tizen.common.util.log.Logger;
public class ImageUtil {
- public static class PlatformSurrogate {
- public Bundle getBundle(String pluginID) {
- return Platform.getBundle(pluginID);
- }
- }
-
- public static class PluginSurrogate {
- public Bundle getBundle(Plugin plugin) {
- return plugin.getBundle();
- }
- }
+ public static class PlatformSurrogate {
+ public Bundle getBundle(String pluginID) {
+ return Platform.getBundle(pluginID);
+ }
+ }
+
+ public static class PluginSurrogate {
+ public Bundle getBundle(Plugin plugin) {
+ return plugin.getBundle();
+ }
+ }
public static final String[] supportedImageExtension = {
"*.gif;*.png;*.jpeg;*.jpg;*.tiff;*.tif;*.ico;*.bmp;*.rle", // all supported format in SWT //$NON-NLS-1$
"*.bmp", // Windows Bitmap //$NON-NLS-1$
"*.rle" // Windows Bitmap with run-length encoding //$NON-NLS-1$
};
-
- /**
- * load image descriptor from <code>bundle</code> with <code>filePath</code>
- *
- * @param bundle {@link Bundle}
- * @param filePath image file path
- *
- * @return loaded {@link ImageDescriptor}
- */
- protected static
- ImageDescriptor
- getImageDescriptor(
- final Bundle bundle,
- final String filePath
- )
- {
- final URL url = bundle.getEntry( filePath );
- return ImageDescriptor.createFromURL( url );
- }
-
- protected static SurrogateWithArgument<Bundle, String> platformSurrogate = new SurrogateWithArgument<Bundle, String>() {
- public Bundle getAdapter( final String pluginId )
- {
- return Platform.getBundle( pluginId );
- }
- };
- protected static SurrogateWithArgument<Bundle, Plugin> pluginSurrogate = new SurrogateWithArgument<Bundle, Plugin>() {
- public Bundle getAdapter(Plugin plugin) {
- return plugin.getBundle();
- }
- };
-
- // get ImageDescriptor from Plugin ID (ID -> ImageDescriptor)
- public static ImageDescriptor getImageDescriptor(String pluginID, String filePath) {
- return getImageDescriptor( platformSurrogate.getAdapter(pluginID), filePath );
- }
-
- // get ImageDescriptor from Activator Plugin (Activator -> ImageDescriptor)
- public static ImageDescriptor getImageDescriptor(Plugin plugin, String filePath) {
- return getImageDescriptor( pluginSurrogate.getAdapter(plugin), filePath );
- }
-
- // get Image from ImageDescriptor (ImageDescriptor -> Image)
- public static Image getImage(ImageDescriptor descriptor) {
- return (descriptor != null) ? descriptor.createImage() : null;
- }
-
- // get ImageData from ImageDescriptor (ImageDescriptor -> ImageData)
- public static ImageData getImageData(ImageDescriptor descriptor) {
- return (descriptor != null) ? descriptor.getImageData() : null;
- }
-
- // get Image from Activator Plugin (Activator -> ImageDescriptor -> Image)
- public static Image getImage(Plugin plugin, String filePath) {
- ImageDescriptor descriptor = getImageDescriptor(plugin, filePath);
- return getImage(descriptor);
- }
-
- // get ImageData from Activator Plugin (Activator -> ImageDescriptor -> ImageData)
- public static ImageData getImageData(Plugin plugin, String filePath) {
- ImageDescriptor descriptor = getImageDescriptor(plugin, filePath);
- return getImageData(descriptor);
- }
-
- // get Image from Plugin ID (ID -> ImageDescriptor -> Image)
- public static Image getImage(String pluginID, String filePath) {
- ImageDescriptor descriptor = getImageDescriptor(pluginID, filePath);
- return getImage(descriptor);
- }
-
- // get Image from Plugin ID (ID -> ImageDescriptor -> ImageData)
- public static ImageData getImageData(String pluginID, String filePath) {
- ImageDescriptor descriptor = getImageDescriptor(pluginID, filePath);
- return getImageData(descriptor);
- }
+
+ /**
+ * load image descriptor from <code>bundle</code> with <code>filePath</code>
+ *
+ * @param bundle {@link Bundle}
+ * @param filePath image file path
+ *
+ * @return loaded {@link ImageDescriptor}
+ */
+ protected static
+ ImageDescriptor
+ getImageDescriptor(
+ final Bundle bundle,
+ final String filePath
+ )
+ {
+ final URL url = bundle.getEntry( filePath );
+ return ImageDescriptor.createFromURL( url );
+ }
+
+ protected static SurrogateWithArgument<Bundle, String> platformSurrogate = new SurrogateWithArgument<Bundle, String>() {
+ public Bundle getAdapter( final String pluginId )
+ {
+ return Platform.getBundle( pluginId );
+ }
+ };
+
+ protected static SurrogateWithArgument<Bundle, Plugin> pluginSurrogate = new SurrogateWithArgument<Bundle, Plugin>() {
+ public Bundle getAdapter(Plugin plugin) {
+ return plugin.getBundle();
+ }
+ };
+
+ // get ImageDescriptor from Plugin ID (ID -> ImageDescriptor)
+ public static ImageDescriptor getImageDescriptor(String pluginID, String filePath) {
+ return getImageDescriptor( platformSurrogate.getAdapter(pluginID), filePath );
+ }
+
+ // get ImageDescriptor from Activator Plugin (Activator -> ImageDescriptor)
+ public static ImageDescriptor getImageDescriptor(Plugin plugin, String filePath) {
+ return getImageDescriptor( pluginSurrogate.getAdapter(plugin), filePath );
+ }
+
+ // get Image from ImageDescriptor (ImageDescriptor -> Image)
+ public static Image getImage(ImageDescriptor descriptor) {
+ return (descriptor != null) ? descriptor.createImage() : null;
+ }
+
+ // get ImageData from ImageDescriptor (ImageDescriptor -> ImageData)
+ public static ImageData getImageData(ImageDescriptor descriptor) {
+ return (descriptor != null) ? descriptor.getImageData() : null;
+ }
+
+ // get Image from Activator Plugin (Activator -> ImageDescriptor -> Image)
+ public static Image getImage(Plugin plugin, String filePath) {
+ ImageDescriptor descriptor = getImageDescriptor(plugin, filePath);
+ return getImage(descriptor);
+ }
+
+ // get ImageData from Activator Plugin (Activator -> ImageDescriptor -> ImageData)
+ public static ImageData getImageData(Plugin plugin, String filePath) {
+ ImageDescriptor descriptor = getImageDescriptor(plugin, filePath);
+ return getImageData(descriptor);
+ }
+
+ // get Image from Plugin ID (ID -> ImageDescriptor -> Image)
+ public static Image getImage(String pluginID, String filePath) {
+ ImageDescriptor descriptor = getImageDescriptor(pluginID, filePath);
+ return getImage(descriptor);
+ }
+
+ // get Image from Plugin ID (ID -> ImageDescriptor -> ImageData)
+ public static ImageData getImageData(String pluginID, String filePath) {
+ ImageDescriptor descriptor = getImageDescriptor(pluginID, filePath);
+ return getImageData(descriptor);
+ }
+
+ public static BufferedImage getScaledImage(BufferedImage src, int width, int height) {
+ java.awt.Image scaledImage = src.getScaledInstance(width, height, java.awt.Image.SCALE_SMOOTH);
+ BufferedImage bi = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
+ Graphics g = bi.getGraphics();
+ g.drawImage(scaledImage, 0, 0, null);
+ g.dispose();
+ return bi;
+ }
+
+ /*
+ * The original source is org.tizen.nativecpp.misc.utils.ImageUtil
+ */
+ public static BufferedImage getAWTImage(String path, boolean isRelativePath) {
+ BufferedImage image = null;
+ InputStream is = null;
+
+ try {
+ if (isRelativePath) {
+ is = ImageUtil.class.getResourceAsStream(path);
+ if (is != null) {
+ image = ImageIO.read(is);
+ }
+ } else {
+ image = ImageIO.read(new File(path));
+ }
+ } catch (Exception e) {
+ Logger.log(e);
+ } finally {
+ IOUtil.tryClose(is);
+ }
+
+ if (image == null) {
+ image = new BufferedImage(1, 1, BufferedImage.TYPE_INT_ARGB);
+ }
+
+ return image;
+ }
+
+ public static Image getSWTImage(Display display, String relativePath) {
+ Image image = null;
+ InputStream is = ImageUtil.class.getResourceAsStream(relativePath);
+
+ try {
+ image = new Image(Display.getDefault(), is);
+ } catch (RuntimeException ex) {
+ Logger.log(ex);
+ } finally {
+ IOUtil.tryClose(is);
+ }
+
+ if (image == null) {
+ image = new Image(display, 1, 1);
+ }
+ return image;
+ }
+
+ public static Image convertImageToSWT(Display display, BufferedImage bImage) {
+ int width = bImage.getWidth();
+ int height = bImage.getHeight();
+
+ // we need alpha
+ BufferedImage bufferedImage = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
+ Graphics graphics = bufferedImage.getGraphics();
+ graphics.drawImage(bImage, 0, 0, null);
+ graphics.dispose();
+
+ if (bufferedImage.getColorModel() instanceof DirectColorModel) {
+ DirectColorModel colorModel = (DirectColorModel) bufferedImage.getColorModel();
+ PaletteData palette = new PaletteData(colorModel.getRedMask(), colorModel.getGreenMask(), colorModel.getBlueMask());
+ ImageData data = new ImageData(bufferedImage.getWidth(), bufferedImage.getHeight(), colorModel.getPixelSize(), palette);
+ for (int y = 0; y < data.height; y++) {
+ for (int x = 0; x < data.width; x++) {
+ int rgb = bufferedImage.getRGB(x, y);
+ int pixel = palette.getPixel(new RGB((rgb >> 16) & 0xFF, (rgb >> 8) & 0xFF, rgb & 0xFF));
+ data.setPixel(x, y, pixel);
+ if (colorModel.hasAlpha()) {
+ data.setAlpha(x, y, (rgb >> 24) & 0xFF);
+ }
+ }
+ }
+ return new Image(display, data);
+
+ } else if (bufferedImage.getColorModel() instanceof IndexColorModel) {
+ IndexColorModel colorModel = (IndexColorModel) bufferedImage.getColorModel();
+ int size = colorModel.getMapSize();
+ byte[] reds = new byte[size];
+ byte[] greens = new byte[size];
+ byte[] blues = new byte[size];
+ colorModel.getReds(reds);
+ colorModel.getGreens(greens);
+ colorModel.getBlues(blues);
+ RGB[] rgbs = new RGB[size];
+ for (int i = 0; i < rgbs.length; i++) {
+ rgbs[i] = new RGB(reds[i] & 0xFF, greens[i] & 0xFF, blues[i] & 0xFF);
+ }
+ PaletteData palette = new PaletteData(rgbs);
+ ImageData data = new ImageData(bufferedImage.getWidth(), bufferedImage.getHeight(), colorModel.getPixelSize(), palette);
+ data.transparentPixel = colorModel.getTransparentPixel();
+ WritableRaster raster = bufferedImage.getRaster();
+ int[] pixelArray = new int[1];
+ for (int y = 0; y < data.height; y++) {
+ for (int x = 0; x < data.width; x++) {
+ raster.getPixel(x, y, pixelArray);
+ data.setPixel(x, y, pixelArray[0]);
+ }
+ }
+ return new Image(display, data);
+ }
+
+ return null;
+ }
+
}
try
{
return Integer.decode( trimmed );
- } catch ( final NumberFormatException e )
+ }
+ catch ( final NumberFormatException e )
{
return defaultValue;
}
try
{
return Long.decode( trimmed );
- } catch ( final NumberFormatException e )
+ }
+ catch ( final NumberFormatException e )
{
return defaultValue;
}
{
return Double.valueOf( trimmed );
}
- catch( final NumberFormatException e )
+ catch ( final NumberFormatException e )
{
return defaultValue;
}
public abstract class PropertyUtil {
protected static final Logger logger = LoggerFactory.getLogger( PropertyUtil.class );
+
public static Properties loadProperties(String fileName) {
Properties props = new Properties();
BufferedReader reader = null;
props.setProperty(key, value);
}
//props.load(reader);
- }
- catch ( final IOException e )
- {
- logger.info( "Exception Occurred:", e );
+ } catch (Exception e) {
+ e.printStackTrace();
} finally {
tryClose( reader );
}
Properties props = new Properties();
try {
props.load(inputStream);
- } catch ( final IOException e ) {
+ }
+ catch ( final IOException e ) {
logger.info( "Ignore exception" );
- } finally {
+ }
+ finally
+ {
tryClose( inputStream );
}
return props;
public static boolean storeProperties(OutputStream outputStream, Properties props) {
try {
props.store(outputStream, null);
- } catch (IOException e) {
+ return true;
+ }
+ catch ( final IOException e )
+ {
logger.info( "Ignore exception" );
return false;
- } finally {
+ }
+ finally
+ {
tryClose( outputStream );
}
- return true;
}
public static boolean storeProperties(String fileName, Properties props) {
BufferedWriter writer = null;
- try
- {
+ try {
writer = new BufferedWriter(new FileWriter(fileName));
props.store(writer, null);
+ return true;
}
- catch ( IOException e )
+ catch ( final IOException e )
{
logger.info( "Ignore exception" );
return false;
- } finally {
+ }
+ finally
+ {
tryClose( writer );
}
- return true;
}
}
import org.eclipse.swt.events.PaintListener;
import org.eclipse.swt.events.VerifyEvent;
import org.eclipse.swt.events.VerifyListener;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.FontData;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Spinner;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.widgets.Tree;
@SuppressWarnings("restriction")
public class SWTUtil {
-
- private SWTUtil() {}
- // 2012-04-25
- @Deprecated
+ private SWTUtil() {}
+
+ // 2012-04-25
+ @Deprecated
public static final String HTML_EXTENSIONS[] = { "html", "htm", "shtml", "shtm", "xhtml"};
-
- protected static final Collection<?> HTML_EXTENSIONS2 =
- Collections.unmodifiableCollection( new HashSet<Object>( Arrays.asList( HTML_EXTENSIONS ) ) );
+ protected static final Collection<?> HTML_EXTENSIONS2 =
+ Collections.unmodifiableCollection( new HashSet<Object>( Arrays.asList( HTML_EXTENSIONS ) ) );
+
/**
* return {@link Display} in context
*
*/
public static Display getDisplay()
{
- Display dp = Display.getCurrent();
- if ( null != dp )
- {
- return dp;
- }
-
- return Display.getDefault();
+ Display dp = Display.getCurrent();
+ if ( null != dp )
+ {
+ return dp;
+ }
+
+ return Display.getDefault();
}
-
+
/**
* <p>
* Return active {@link Shell} in context
*/
public static Shell getActiveShell()
{
- final Display dp = getDisplay();
- if ( null == dp )
- {
- return null;
- }
-
- return dp.getActiveShell();
+ final Display dp = getDisplay();
+ if ( null == dp )
+ {
+ return null;
+ }
+
+ return dp.getActiveShell();
}
-
+
/**
* execute {@link Cabinet#run()} and reeturn the result
*
return runnable.getData();
}
-
+
/**
* execute {@link Runnable} in SWT thread synchronously
*
*/
public static void syncExec( final Runnable runnable )
{
- syncExec( getDisplay(), runnable );
+ syncExec( getDisplay(), runnable );
}
-
+
/**
* execute {@link Runnable} in SWT thread synchronously
*
*/
public static void syncExec( final Display dp, final Runnable runnable )
{
- dp.syncExec( runnable );
+ dp.syncExec( runnable );
}
-
+
/**
* execute {@link Runnable} in SWT thread asynchronously
*
*/
public static void asyncExec( final Runnable runnable )
{
- asyncExec( getDisplay(), runnable );
+ asyncExec( getDisplay(), runnable );
}
-
+
/**
* execute {@link Runnable} in SWT thread asynchronously
*
*/
public static void asyncExec( final Display dp, final Runnable runnable )
{
- dp.asyncExec( runnable );
+ dp.asyncExec( runnable );
}
-
+
/**
* dispose {@link Widget}s
*
*/
public static void tryDispose( final Widget... disposables )
{
- if ( null == disposables )
- {
- return ;
- }
-
- for ( final Widget disposable : disposables )
- {
- if ( null == disposable || disposable.isDisposed() )
- {
- continue;
- }
-
- disposable.dispose();
- }
+ if ( null == disposables )
+ {
+ return ;
+ }
+
+ for ( final Widget disposable : disposables )
+ {
+ if ( null == disposable || disposable.isDisposed() )
+ {
+ continue;
+ }
+
+ disposable.dispose();
+ }
}
/**
return sc;
}
-
+
/**
* Get current active page.
*
if ( null == window )
{
- return null;
+ return null;
}
return window.getActivePage();
}
return page.getActiveEditor();
}
-
+
/**
* Get editor of file extension.
*
return projectPath;
}
-
+
public static void addTableToolTipListener(Table table, TableToolTipListener listener) {
listener.setTable(table);
table.addListener(SWT.MouseMove, listener);
table.addListener(SWT.Dispose, listener);
table.addListener(SWT.MouseHover, listener);
}
-
+
/**
* Expands tree and its sub treeitems.
*
Stack<TreeItem> treeStack = new Stack<TreeItem>();
treeStack.add(treeItem);
TreeItem selectedItem = null;
-
+
do {
selectedItem = treeStack.pop();
selectedItem.setExpanded(true);
-
+
if(selectedItem.getItems() != null && selectedItem.getItemCount() != 0) {
for (TreeItem childItem : selectedItem.getItems()) {
treeStack.add(childItem);
}
c.setLayoutData(gd);
}
-
+
/**
* Make error dialog which prints stack trace of the throwable
*
ErrorDialog.openError(shell, "Error Dialog", msg, ms);
}
-
+
public static Composite createCompositeEx(Composite parent, int numColumns, int layoutMode) {
Composite composite = new Composite(parent, SWT.NULL);
composite.setFont(parent.getFont());
gd.horizontalSpan = columnSpan;
label.setLayoutData(gd);
}
-
+
/**
* Returns a width hint for a button control.
* @param button the button
int widthHint= converter.convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH);
return Math.max(widthHint, button.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x);
}
-
+
/**
* make background image of child control transient.
* Actually, it just copy parent image and paint it to the child background.
final Object lock = new Object();
final AtomicBoolean finished = new AtomicBoolean(false);
parent.addPaintListener(new PaintListener() {
-
+
class PairControl {
-
+
PairControl(Composite parent, Control child) {
this.parent = parent;
this.child = child;
Composite parent;
Control child;
}
-
+
@Override
public void paintControl(PaintEvent e) {
if(finished.get()) {
finished.set(true);
parent.removePaintListener(this);
if(parent.getBackgroundImage() != null) {
-
+
Stack<PairControl> childStack = new Stack<PairControl>();
-
+
for(Control childControl: parent.getChildren()) {
childStack.add(new PairControl(parent, childControl));
}
-
+
while(!childStack.isEmpty()) {
PairControl pair = childStack.pop();
Control childControl = pair.child;
Composite parentComposite = pair.parent;
Image parentImage = parentComposite.getBackgroundImage();
Point childLoc = childControl.getLocation();
-
+
if(childControl instanceof Composite) {
Composite childComposite = ((Composite)childControl);
for(Control grandChildControl: childComposite.getChildren()) {
}
}
Point childSize = childControl.getSize();
- Image childImage = new Image(SWTUtil.getDisplay(), childSize.x, childSize.y);
- GC gc = new GC(parentImage);
- gc.copyArea(childImage, childLoc.x, childLoc.y);
- gc.dispose();
- childControl.setBackgroundImage(childImage);
+ if(childSize.x > 0 && childSize.y > 0) {
+ Image childImage = new Image(SWTUtil.getDisplay(), childSize.x, childSize.y);
+ GC gc = new GC(parentImage);
+ gc.copyArea(childImage, childLoc.x, childLoc.y);
+ gc.dispose();
+ childControl.setBackgroundImage(childImage);
+ }
}
}
}
}
}
+ /**
+ * Constructs a new instance of Combo class given its parent, label, tooltip and combo items.
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param label the new text
+ * @param tooltip the new text
+ * @param contents the list of strings for the combo box
+ *
+ * @return Combo
+ *
+ * @author Changhyun Lee {@literal <changhyun1.lee@samsung.com>} (S-Core)
+ */
+ public static Combo createCombo(Composite parent, String label, String tooltip, String[] contents) {
+ return createCombo(parent, label, tooltip, contents, 0);
+ }
+
+ /**
+ * Constructs a new instance of Combo class given its parent, label, tooltip, combo items and selectedIndex.
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param label the new text
+ * @param tooltip the new text
+ * @param contents the list of strings for the combo box
+ * @param selectedIndex the index of the item to select
+ *
+ * @return Combo
+ *
+ * @author Changhyun Lee {@literal <changhyun1.lee@samsung.com>} (S-Core)
+ */
+ public static Combo createCombo( Composite parent, String label, String tooltip, String[] contents, int selectedIndex) {
+ Label l = new Label(parent, SWT.NONE);
+ l.setText(label);
+ l.setToolTipText(tooltip);
+ l.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, false));
+
+ Combo combo = new Combo(parent, SWT.READ_ONLY);
+ //Flowing piece of code prevents cutting combo box in Windows Vista/7
+ //It decreases font size by one, because with the current size combo
+ //box is to large and cut.
+ FontData[] fontData = combo.getFont().getFontData();
+ for (int i = 0; i < fontData.length; i++) {
+ fontData[i].setHeight(fontData[i].getHeight() - 1);
+ }
+
+ Font font = new Font(combo.getDisplay(), fontData);
+ combo.setFont(font);
+
+ for (int i = 0; i < contents.length ; i++) {
+ combo.add(contents[i]);
+ }
+ combo.select(selectedIndex);
+ return combo;
+ }
+
+ /**
+ * Constructs a new instance of Combo class given its parent, label, tooltip, enum values and selectedIndex.
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param label the new text
+ * @param tooltip the new text
+ * @param contents the values of enum
+ * @param selectedIndex the index of the item to select
+ *
+ * @return Combo
+ *
+ * @author Changhyun Lee {@literal <changhyun1.lee@samsung.com>} (S-Core)
+ */
+ public static <E extends Enum<E>> Combo createEnumCombo( Composite parent, String label, String tooltip, E[] values, int selectedIndex) {
+ String contents[] = StringUtil.enumNameToStringArray(values);
+ for (int i = 0; i < contents.length; i++) {
+ contents[i] = contents[i].toLowerCase();
+ }
+ return createCombo(parent, label, tooltip, contents, selectedIndex);
+ }
+
+ /**
+ * Constructs a new instance of Spinner class given its parent, label and tooltip.
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param label the new text
+ * @param tooltip the new text
+ *
+ * @return Spinner
+ *
+ * @author Changhyun Lee {@literal <changhyun1.lee@samsung.com>} (S-Core)
+ */
+ public static Spinner createSpinner(Composite parent, String label, String tooltip) {
+ Label l = new Label(parent, SWT.NONE);
+ l.setText(label);
+ l.setToolTipText(tooltip);
+ l.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, false));
+
+ Spinner s = new Spinner(parent, SWT.BORDER);
+ return s;
+ }
+
+ /**
+ * Constructs a new instance of Spinner class given its parent, label and tooltip.
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param label the new text
+ * @param tooltip the new text
+ * @param minimum the new minimum, which must be less than or equal to the current maximum
+ * @param maximum the new maximum, which must be greater than or equal to the current minimum
+ *
+ * @return Spinner
+ *
+ * @author Changhyun Lee {@literal <changhyun1.lee@samsung.com>} (S-Core)
+ */
+ public static Spinner createSpinner(Composite parent, String label, String tooltip, int minimum, int maximum) {
+ Spinner s = createSpinner(parent, label, tooltip);
+ s.setMinimum(minimum);
+ s.setMaximum(maximum);
+ return s;
+ }
+
+ /**
+ * Constructs a new instance of Text class given its parent, label, tooltip, horazontalSpan and verticalSpan.
+ * @param parent a composite control which will be the parent of the new instance (cannot be null)
+ * @param label the new text
+ * @param tooltip the new text
+ * @param horazontalSpan the number of column cells that the control will take up
+ * @param verticalSpan the number of row cells that the control will take up
+ *
+ * @return Text
+ *
+ * @author Changhyun Lee {@literal <changhyun1.lee@samsung.com>} (S-Core)
+ */
+ public static Text createText(Composite parent, String label, String tooltip, int horizontalSpan, int verticalSpan) {
+ Label l = new Label(parent, SWT.NONE);
+ l.setText(label);
+ l.setToolTipText(tooltip);
+ l.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, false));
+
+ Text t = new Text(parent, SWT.BORDER);
+ t.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, horizontalSpan, verticalSpan));
+ return t;
+ }
+
}
return false;
}
}
+
+ /**
+ * Returns string with first letter converted to upper case.
+ * @param str
+ * @return
+ */
+ public static String convertFirstLetterUpperCase(String str) {
+ if (isEmpty(str))
+ return null;
+
+ char[] str_array = str.toCharArray();
+ str_array[0] = Character.toUpperCase(str_array[0]);
+ str = new String(str_array);
+ return str;
+ }
+
+ /**
+ * Returns last string after <code>lastIndexStr</code> from <code>input</code>.
+ * For example, if <code>input</code> is "HOME/File", and <code>lastIndexStr</code> is "/" then, it returns File.
+ *
+ * @param input input string
+ * @param lastIndexStr string indicates last string
+ * @return
+ */
+ public static String getLastStringAfter(String input, String lastIndexStr) {
+ if (input == null) {
+ return null;
+ }
+
+ int k = input.lastIndexOf(lastIndexStr);
+
+ return (k != -1) ? input.substring(k + 1, input.length()) : null;
+ }
}
*/
public class ValidationUtil {
+ // IRI(RFC 3987: Internationalized Resource Identifiers)
+ private static final String REGEX_IRI = "([a-z]([a-z]|\\d|\\+|-|\\.)*):(\\/\\/(((([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])" +
+ "|(%[\\da-f]{2})|[!\\$&'\\(\\)\\*\\+,;=]|:)*@)?((\\[(|(v[\\da-f]{1,}\\." +
+ "(([a-z]|\\d|-|\\.|_|~)|[!\\$&'\\(\\)\\*\\+,;=]|:)+))\\])|" +
+ "((\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])\\.(\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])\\.(\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])\\." +
+ "(\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5]))|" +
+ "(([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(%[\\da-f]{2})|[!\\$&'\\(\\)\\*\\+,;=])*)(:\\d*)?)" +
+ "(\\/(([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(%[\\da-f]{2})|[!\\$&'\\(\\)\\*\\+,;=]|:|@)*)*|" +
+ "(\\/((([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(%[\\da-f]{2})|[!\\$&'\\(\\)\\*\\+,;=]|:|@)+" +
+ "(\\/(([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(%[\\da-f]{2})|[!\\$&'\\(\\)\\*\\+,;=]|:|@)*)*)?)|" +
+ "((([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(%[\\da-f]{2})|[!\\$&'\\(\\)\\*\\+,;=]|:|@)+" +
+ "(\\/(([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(%[\\da-f]{2})|[!\\$&'\\(\\)\\*\\+,;=]|:|@)*)*)|" +
+ "((([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(%[\\da-f]{2})|[!\\$&'\\(\\)\\*\\+,;=]|:|@)){0})" +
+ "(\\?((([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(%[\\da-f]{2})|[!\\$&'\\(\\)\\*\\+,;=]|:|@)|[\\uE000-\\uF8FF]|\\/|\\?)*)?" +
+ "(\\#((([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(%[\\da-f]{2})|[!\\$&'\\(\\)\\*\\+,;=]|:|@)|\\/|\\?)*)?";
+
+ private static final String REGEX_EMAIL = "[A-Za-z0-9!#$%&\'*+/=?^_`{|}~-]+(?:\\.[A-Za-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?\\.)+[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])??"; //$NON-NLS-1$
+ private static final String REGEX_URL = "\\b(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]"; //$NON-NLS-1$
+ private static final String REGEX_VERSION = "^\\d+\\.\\d+\\.\\d+$"; //$NON-NLS-1$
+
/**
- * Check for Email address. RFC 2822 (simplified)Matches a normal email address. Does not check the top-level domain.
+ * Checking for Email address. RFC 2822 (simplified)Matches a normal email address. Does not check the top-level domain.
*
* @param value email string
*
- * @return if value is valied email
+ * @return {@code true} if value is valid email
*/
public static boolean checkForEmail(String value) {
- String regex = "[A-Za-z0-9!#$%&\'*+/=?^_`{|}~-]+(?:\\.[A-Za-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?\\.)+[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])??"; //$NON-NLS-1$
- Pattern pattern = Pattern.compile(regex);
+ Pattern pattern = Pattern.compile(REGEX_EMAIL);
+ Matcher matcher = pattern.matcher(value);
+
+ return matcher.matches();
+ }
+
+ /**
+ * Checking for IRI(RFC 3987: Internationalized Resource Identifiers) string.
+ *
+ * @param value IRI string
+ *
+ * @return {@code true} if value is valid IRI
+ *
+ * @link RFC 3987: http://www.ietf.org/rfc/rfc3987<br>
+ * Online validation: http://projects.scottsplayground.com/iri/demo/
+ */
+ public static boolean checkForIRI(String value) {
+ Pattern pattern = Pattern.compile(REGEX_IRI, Pattern.CASE_INSENSITIVE);
Matcher matcher = pattern.matcher(value);
return matcher.matches();
}
/**
- * Check for URL string.
+ * Checking for URL string.
*
* @param value url string
*
- * @return if value is valied url
+ * @return {@code true} if value is valid url
*/
public static boolean checkForURL(String value) {
- String regex = "\\b(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]"; //$NON-NLS-1$
- Pattern pattern = Pattern.compile(regex);
+ Pattern pattern = Pattern.compile(REGEX_URL);
Matcher matcher = pattern.matcher(value);
return matcher.matches();
}
/**
- * Check for File extension.
+ * Checking for File extension.
*
* @param value file name
- * @param extensions valied file extensions
+ * @param extensions valid file extensions
*
- * @return if value is valied file
+ * @return {@code true} if value is valid file
*/
public static boolean checkForFileExtension(String value, String[] extensions) {
if (StringUtil.isEmpty(value) || extensions == null) {
}
/**
- * Check for version. The version should be (x.y.z) formate where 0<=x<=35, 0<=y<=35, 0<=z<=1295.
+ * Checking for version. The version should be (x.y.z) formate where 0<=x<=35, 0<=y<=35, 0<=z<=1295.
*
* @param version
- * @return if version is valied
+ * @return {@code true} if version is valid version
*/
public static boolean checkForVersion(String version) {
if (version == null) {
}
String strVersion = version.trim();
- if (strVersion.isEmpty() || !strVersion.matches("^\\d+\\.\\d+\\.\\d+$") || strVersion.equals("0.0.0")) {
+ if (strVersion.isEmpty() || !strVersion.matches(REGEX_VERSION) || strVersion.equals("0.0.0")) {
return false;
}
</layout>
</appender>
- <logger name="org.tizen.common.util">
- <level value="info" />
- </logger>
-
<logger name="org.tizen.common.verrari.util">
<level value="info" />
</logger>
command.setFilter( null );
fail();
}
- catch ( NullPointerException e )
+ catch ( final IllegalArgumentException e )
{
// Then
}
factory.create( null );
fail();
}
- catch ( NullPointerException e )
+ catch ( final IllegalArgumentException e )
{
}
import java.util.Iterator;
import org.junit.Test;
+import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
*/
public class ArrayUtilTest
{
+ protected Logger logger = LoggerFactory.getLogger( getClass() );
+
public static int arrayIndex = 0;
public static boolean successTest = true;
true
};
-
for ( Object[] input : inputArray ) {
for ( Object arg : inputAddArg ) {
Object[] actualData = null;
assertArrayEquals( new String[] { "c" }, ArrayUtil.remove( new String[] { "a", "b", "c" }, -1, 2 ) );
final Object[][] inputArray = new Object[][]{
+ null,
new String[]{"hello", "test", "java", "c", "c++", "junit", "time"},
new Integer[]{10, 20, 30, 40, 50, 60, 70, 80, 90},
{10, 20, 30, 40, 50, 60, 70, 80, 90, 100},
new Object[]{null, "hello", 10},
new Object[]{null, null, null},
new Object[]{ }
+
};
try
}
catch( final IllegalArgumentException e )
{
- LoggerFactory.getLogger( getClass() ).info( "Test case successfult" );
+ logger.info( "Test case successfult" );
}
-
+
for ( Object[] input : inputArray ) {
for ( int i = -1 ; i < 10 ; i++ ) {
- for( int j = i ; j < 10 ; j++ ) {
+ for( int j = -1 ; j < 10 ; j++ ) {
int deleteCount = 0;
+ Object[] actualData = null;
try {
- Object[] actualData = ArrayUtil.remove( input, i, j);
+ logger.trace( "{}: {}, {}", new Object[] { ObjectUtil.toString( input ), i, j } );
+ actualData = ArrayUtil.remove( input, i, j);
i = Math.max( 0, i );
if( j <= i) {
assertArrayEquals(input , actualData);
}
}
catch ( IllegalArgumentException e ) {
- if ( i >= j ) {
+ if ( null == input || i >= j ) {
continue;
}
else {
+ e.printStackTrace();
fail("Failed remove(Object[], int, int) test");
}
}
try {
CollectionUtil.mergeArrayIntoCollection( TEST_CASES[0], null );
fail( "mergeArrayIntoCollection must throw exception" );
- } catch ( IllegalArgumentException e) {
+ } catch ( IllegalArgumentException e )
+ {
LoggerFactory.getLogger( getClass() ).info( "Test case successful" );
}
try {
CollectionUtil.swap( objectArray, 0, 5 );
fail( "swap must throw exception" );
- } catch (Exception e) {
+ } catch ( final ArrayIndexOutOfBoundsException e) {
LoggerFactory.getLogger( getClass() ).info( "Test case successful" );
}
try {
CollectionUtil.swap( objectArray, -1, 0 );
fail( "swap must throw exception" );
- } catch (Exception e) {
+ } catch ( final ArrayIndexOutOfBoundsException e) {
LoggerFactory.getLogger( getClass() ).info( "Test case successful" );
}
try {
CollectionUtil.swap( null, 0, 1 );
fail( "swap must throw exception" );
- } catch (Exception e) {
+ } catch ( final NullPointerException e) {
LoggerFactory.getLogger( getClass() ).info( "Test case successful" );
}
}
public static final String TEST_RESOURCE_DEST = "test/_test_files";
public static final String TEST_RESOURCE_SRC = "test/test_files";
- /**
- * Test {@link FileUtil#getFileExtension(String)}
- *
- * @throws Exception in case of failure in test
- *
- * @see {@link FileUtil#getFileExtension(String)}
- */
- @Test
- public void test_getFileExtension() throws Exception {
- final Object[][] TEST_CASES = new Object[][] {
- new Object[] { "aaaa.exe", "exe" },
- new Object[] { "index.html", "html" },
- new Object[] { "index.test.html", "html" },
- new Object[] { "index..html", "html" },
- new Object[] { ".profile", "profile" },
- new Object[] { "ReadMe ", null },
- new Object[] { "ReadMe", null },
- new Object[] { "ReadMe. ", " " },
- new Object[] { "ReadMe. test", " test" }
- };
-
- int i = 0;
- for ( final Object[] TEST_CASE : TEST_CASES )
- {
- final String fileName = (String) TEST_CASE[0];
- final String expected = (String) TEST_CASE[1];
- final String result = FileUtil.getFileExtension( fileName );
-
- assertEquals( ++i + "th Test case :<" + fileName + ", " + expected + ">", expected, result );
- }
- }
+ /**
+ * Test {@link FileUtil#getFileExtension(String)}
+ *
+ * @throws Exception in case of failure in test
+ *
+ * @see {@link FileUtil#getFileExtension(String)}
+ */
+ @Test
+ public void test_getFileExtension() throws Exception {
+ final Object[][] TEST_CASES = new Object[][] {
+ new Object[] { "aaaa.exe", "exe" },
+ new Object[] { "index.html", "html" },
+ new Object[] { "index.test.html", "html" },
+ new Object[] { "index..html", "html" },
+ new Object[] { ".profile", "profile" },
+ new Object[] { "ReadMe ", null },
+ new Object[] { "ReadMe", null },
+ new Object[] { "ReadMe. ", " " },
+ new Object[] { "ReadMe. test", " test" }
+ };
+
+ int i = 0;
+ for ( final Object[] TEST_CASE : TEST_CASES )
+ {
+ final String fileName = (String) TEST_CASE[0];
+ final String expected = (String) TEST_CASE[1];
+ final String result = FileUtil.getFileExtension( fileName );
+
+ assertEquals( ++i + "th Test case :<" + fileName + ", " + expected + ">", expected, result );
+ }
+ }
+
+ /**
+ * Test case for {@link FileUtil#getFileNameFromPath(String)}
+ *
+ * @throws Exception
+ */
+ public void test_getFileNameFromPath() throws Exception {
+ final String[][] testCases = {
+ {"ASDFwew/jkl/wer23/gfdgfdg", "gfdgfdg"},
+ {"wekljf\\hgrfg\\wefwv1.aaa", "wefwv1.aaa"},
+ {null, null},
+ {"ggg.sss", "ggg.sss"}
+ };
+
+ for(String[] testCase: testCases) {
+ String result = FileUtil.getFileNameFromPath(testCase[0]);
+ assertEquals(testCase[1], result);
+ }
+ }
/**
* Test {@link FileUtil#readTextStream(InputStream input, String encoding)}
@Test
public void test_findFiles() throws Exception{
final Object [][] TEST_CASE = new Object[][] {
- new Object[] {"",""},
+ new Object[] {"",""},
};
}
*/
package org.tizen.common.util;
+import static org.powermock.api.mockito.PowerMockito.whenNew;
+
+import java.io.FileReader;
+import java.io.IOException;
+
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.powermock.api.mockito.PowerMockito;
+import org.powermock.core.classloader.annotations.PrepareForTest;
+import org.powermock.modules.junit4.PowerMockRunner;
+@RunWith( PowerMockRunner.class )
+@PrepareForTest( { HostUtil.class } )
public class HostUtilTest {
private String packageName = HostUtilTest.class.getPackage().getName().replace('.', '/');
*
* @see HostUtil#getContents( String)
*/
+ @SuppressWarnings("unchecked")
@Test
public void test_getContents() throws Exception {
+ FileReader file = PowerMockito.mock( FileReader.class );
+ whenNew( FileReader.class ).withParameterTypes( String.class ).withArguments( fullPath ).thenReturn( file );
Assert.notNull(HostUtil.getContents(fullPath));
- Assert.isNull(HostUtil.getContents(null));
+
+ whenNew( FileReader.class ).withParameterTypes( String.class ).withArguments( "nullPath" ).thenThrow( IOException.class );
Assert.isNull(HostUtil.getContents("nullPath"));
}
);
}
}
+
+ /**
+ * Test case for {@link StringUtil#getLastStringAfter(String, String)}
+ *
+ * @throws Exception
+ */
+ public void test_getLastStringAfter() throws Exception {
+ String[][] testCases = {
+ {"ASDF|||JKL", "|||", "JKL"},
+ {"THISTHOSETHAT", "H", "AT"},
+ {"P|||AAA|||BBB", "|||", "BBB"},
+ {"WEF", null, null},
+ {"ALL", "", "ALL"},
+ {null, "S", null}
+ };
+
+ for(String[] testCase: testCases) {
+ String result = StringUtil.getLastStringAfter(testCase[0], testCase[1]);
+ assertEquals(result, testCase[2]);
+ }
+ }
/**
* Test {@link StringUtil#getLastSegment(String, String)}
}
/**
+ * Test {@link ValidationUtil#test_checkForIRI(String value)}
+ *
+ * @throws Exception in case of failure in test
+ *
+ * @see {@link ValidationUtil#test_checkForIRI(String value)}
+ */
+ @Test
+ public void test_checkForIRI() throws Exception {
+ final String[] validedIRIs = {"http://tizen.org",
+ "http://www.tizen.org",
+ "http://tizen.org/",
+ "http://tizen.org/id",
+ "http://myapp",
+ "http://example.org/about/mother.fr",
+ "http://example.org/contact.nl",
+ "http://example.org/contact?lang=nl",
+ "http://example.org/nl/contact",
+ "http://example.org/nl/Contact",
+ "http://example.org/nl/CONTACT",
+ "cxd:dsf",
+ "ftp://fds",
+ "irc://fdf"
+ };
+ for (String url : validedIRIs) {
+ assertTrue(ValidationUtil.checkForIRI(url));
+ }
+ }
+
+ /**
* Test {@link ValidationUtil#checkForURL(String value)}
*
* @throws Exception in case of failure in test
-* 1.0.141
-- Added filter for hide RDS Properties page
-== kh5325.kim <kh5325.kim@samsung.com> 2013-02-14
-* 1.0.140
-- Modified Provider
-== kh5325.kim <kh5325.kim@samsung.com> 2013-02-14
-* 1.0.139
-- In the case of RDS, the partial directories's permision was changed to "app:app".
-== gune.kim <gune.kim@samsung.com> 2013-02-06 15:18
-* 1.0.138
-- Updated Tizen Web UI FW to 0.2.15
-== kh5325.kim <kh5325.kim@samsung.com> 2013-01-29
-* 1.0.137
-- updated dialogutil
-== jihoon80.song <jihoon80.song@samsung.com> 2013-01-28 18:22
-* 1.0.136
-- Update tizen-web-ui-fw 0.2.14
-== changhyun1.lee <changhyun1.lee@samsung.com> 2013-01-26 22:57
-* 1.0.135
-- Fixed RDS directory installation
-== kh5325.kim <kh5325.kim@samsung.com> 2013-01-26
-* 1.0.134
-- updated Tizen Web UI FW to 0.2.13
-- add to check exit return value when installing a package in rds mode
-== kh5325.kim <kh5325.kim@samsung.com> 2013-01-25
-* 1.0.133
-- revert previous fix
-== hyunsik.noh <hyunsik.noh@samsung.com> 2013-01-24 17:39
-* 1.0.132
-- [sdblib] Fix condition for monitor loop to against blocking
-== hyunsik.noh <hyunsik.noh@samsung.com> 2013-01-24 16:32
-* 1.0.131
-- remove invalid character for log file name on windows
-== hyunsik.noh <hyunsik.noh@samsung.com> 2013-01-23 20:13
-* 1.0.130
-- updated tizen web ui fw to 0.2.11
-== jihoon80.song <jihoon80.song@samsung.com> 2013-01-23 16:42
-* 1.0.129
-- .
-== hyunsik.noh <hyunsik.noh@samsung.com> 2013-01-21 21:01
-* 1.0.128
-- fix. save file load
-== j0.kim <j0.kim@samsung.com> 2013-01-21 17:57
-* 1.0.127
-- Fixed an issue that the progress bar is shown at the top while in Emulator.
-== kh5325.kim <kh5325.kim@samsung.com> 2013-01-18
-* 1.0.126
-- updated Tizen Web UI FW to 0.2.9
-== jihoon80.song <jihoon80.song@samsung.com> 2013-01-18 10:46
-* 1.0.125
-- Update templateFix bug: signing cannot be done with plain text
-== ho.namkoong <ho.namkoong@samsung.com> 2013-01-16
-* 1.0.124
-- Update templateFix bug: signing cannot be done with plain text
-== ho.namkoong <ho.namkoong@samsung.com> 2013-01-16
-* 1.0.123
-- Update template
-== changhyun1.lee <changhyun1.lee@samsung.com> 2013-01-14 12:13
+* 2.1.12
+- Added context help ids and HelpToolTip
+== donghyuk yang <donghyuk.yang@samsung.com> 2013-04-02
+* 2.1.11
+- updated tizen web ui fw to 0.2.20
+- Absolute path for pkgcmd and launch_app
+== kh5325.kim <kh5325.kim@samsung.com> 2013-03-30
+* 2.1.10
+- Support Privilege List in Add-on SDK
+== changhyun1.lee <changhyun1.lee@samsung.com> 2013-03-25 17:13
+* 2.1.9
+- Merged the latest changes
+== kh5325.kim <kh5325.kim@samsung.com> 2013-03-24
+* 2.1.8
+- Rollback Singing Module
+== changhyun1.lee <changhyun1.lee@samsung.com> 2013-03-20 00:24
+* 2.1.7
+- fixed NPE for incremental sign without include option
+== jihoon80.song <jihoon80.song@samsung.com> 2013-03-19 22:12
+* 2.1.6
+- make sign at launch
+== ho.namkoong <ho.namkoong@samsung.com> 2013-03-19
+* 2.1.5
+- fixed NoClassDefFoundError for sign module
+== jihoon80.song <jihoon80.song@samsung.com> 2013-03-16 20:30
+* 2.1.4
+- Added AppTrayIcon Feature
+== changhyun1.lee <changhyun1.lee@samsung.com> 2013-03-16 17:34
+* 2.1.3
+- Fixed jquery mobile singepage templatge
+== changhyun1.lee <changhyun1.lee@samsung.com> 2013-03-15 19:16
+* 2.1.2
+- Version up for Tizen 2.1
+== donghee.yang <donghee.yang@samsung.com> 2013-03-15
+* 2.1.1
+- added incremental sign model
+== kh5325.kim <kh5325.kim@samsung.com> 2013-03-08
+* 2.1.0
+- 2.1.0 Package
+== kh5325.kim <kh5325.kim@samsung.com> 2013-03-08
+* 2.0.19
+- added a missing method
+== jihoon80.song <jihoon80.song@samsung.com> 2013-03-07 21:55
+* 2.0.18
+- package version up
+== changhyun1.lee <changhyun1.lee@samsung.com> 2013-03-07 21:11
+* 2.0.17
+- Update basic template
+== changhyun1.lee <changhyun1.lee@samsung.com> 2013-03-07 15:16
+* 2.0.16
+- Update privilege
+== changhyun1.lee <changhyun1.lee@samsung.com> 2013-03-05 17:01
+* 2.0.15
+- Added Licence infomation
+== changhyun1.lee <changhyun1.lee@samsung.com> 2013-03-01 19:04
+* 2.0.14
+- package version up
+== taeyoung2.son <taeyoung2.son@samsung.com> 2013-02-27 18:26
+* 2.0.13
+- Added SWTUtil
+== changhyun1.lee <changhyun1.lee@samsung.com> 2013-02-26 16:54
+* 2.0.12
+- Merged the latest changes
+== kh5325.kim <kh5325.kim@samsung.com> 2013-02-22
+* 2.0.11
+- Fixed CLI application id, package attribute
+== changhyun1.lee <changhyun1.lee@samsung.com> 2013-02-19 19:49
+* 2.0.10
+- Merge the latest changes
+== ho.namkoong <ho.namkoong@samsung.com> 2013-02-18
+* 2.0.9
+- Fixed ID Validation
+== changhyun1.lee <changhyun1.lee@samsung.com> 2013-02-14 10:52
+* 2.0.8
+- Added CheckForIRI function
+== changhyun1.lee <changhyun1.lee@samsung.com> 2013-02-12 22:29
+* 2.0.7
+- added TizenProjectType#isNeededIconValidation().
+== gune.kim <gune.kim@samsung.com> 2013-02-05 11:36
+* 2.0.6
+- Merged the latest changes
+== kh5325.kim <kh5325.kim@samsung.com> 2013-01-28
+* 2.0.5
+- Merged the latest changes
+== kh5325.kim <kh5325.kim@samsung.com> 2013-01-19
+* 2.0.4
+- Fix bug: plain text cannot be used in signing
+== ho.namkoong <ho.namkoong@samsung.com> 2013-01-15
+* 2.0.3
+- Fix bug: plain text cannot be used in signing
+== ho.namkoong <ho.namkoong@samsung.com> 2013-01-15
+* 2.0.2
+- Fix bug: plain text cannot be used in signing
+== ho.namkoong <ho.namkoong@samsung.com> 2013-01-15
+* 2.0.1
+- Merged the latest changes
+== kh5325.kim <kh5325.kim@samsung.com> 2013-01-14
* 2.0.0
- Tizen 2.0 release
== kh5325.kim <kh5325.kim@samsung.com> 2013-01-11
-* 1.0.122
+* 1.0.121
- modified SDB's start demon
== gyeongseok.seo <gyeongseok.seo@samsung.com> 2013-01-09
-* 1.0.121
-- Changed on-demand install path to developer
-== mariah <kh5325.kim@samsung.com> 2013-01-09
* 1.0.120
-- modified local port checker
+- Changed on-demand install path to developer
+- modified local port checker
== gyeongseok.seo <gyeongseok.seo@samsung.com> 2013-01-08
* 1.0.119
-- Merged the latest changes
-== mariah <kh5325.kim@samsung.com> 2013-01-04
+- fixed ClassNotFoundException for Web CLI
+== jihoon80.song <jihoon80.song@samsung.com> 2013-01-04 19:49
* 1.0.118
- Remove RDS's "web not support note" in preference page and project properties page
-== gyeongseok.seo <gyeongseok.seo@samsung.com> 2013-01-04
+== gyeongseok.seo <gyeongseok.seo@samsung.com> 2012-01-04
* 1.0.117
-- Change on-demand installation path.
-== gune.kim <gune.kim@samsung.com> 2013-01-03
-* 1.0.116
- Merged the latest changes
== changhyun1.lee <changhyun1.lee@samsung.com> 2013-01-02
-* 1.0.115
+* 1.0.116
- Add ziputil class
== gyeongseok.seo <gyeongseok.seo@samsung.com> 2012-12-28
-* 1.0.114
+* 1.0.115
- updated sign module for applying UNICODE patch
-== jihoon.song <jihoon80.song@samsung.com> 2012-12-28
+== jihoon80.song <jihoon80.song@samsung.com> 2012-12-28 16:47
+* 1.0.114
+- modified constants initial
+== gune.kim <gune.kim@samsung.com> 2012-12-27
* 1.0.113
- modified RDS mode check logic RdsPreferencePage#isWebRdsMode() added
== gyeongseok.seo <gyeongseok.seo@samsung.com> 2012-12-27
* 1.0.112
- Remove eclipse dependency from TizenSigner
-== ho.namkoong <ho.namkoong@samsung.com> 2012-12-22
+== changhyun1.lee <changhyun1.lee@samsung.com> 2012-12-26
* 1.0.111
-- update tizenwebuifw template
-== changhyun1.lee <changhyun1.lee@samsung.com> 2012-12-21 20:07
-* 1.0.110
-- Add Fatal log level for log view
-- modified parse the "rpm" file
-== gune.kim <gune.kim@samsung.com> 2012-12-21 17:22
-* 1.0.109
-- fixed sonar error
-== changhyun1.lee <changhyun1.lee@samsung.com> 2012-12-19 14:09
+- update tizen web ui fw template
+== changhyun1.lee <changhyun1.lee@samsung.com> 2012-12-21 20:45
+* 1.0.108
+- modifed OnDemandInstall#copyPackage() using sdblib
+== mariah <kh5325.kim@samsung.com> 2012-12-18
* 1.0.107
-- Modified OnDemandInstall#copyPackage() using sdblib.
-== gune.kim <gune.kim@samsung.com> 2012-12-18 12:58
+- modifed OnDemandInstall#copyPackage() using sdblib
+== mariah <kh5325.kim@samsung.com> 2012-12-18
* 1.0.106
- sync from staging
== changhyun1.lee <changhyun1.lee@samsung.com> 2012-12-12 15:15
-Version:1.0.141
+Version:2.1.12
Source:common-eplugin
Maintainer:kangho kim <kh5325.kim@samsung.com>, yoonki park <yoonki.park@samsung.com>, hyunsik non <hyunsik.noh@samsung.com>, taeyoung son <taeyoung2.son@samsung.com>, gune Kim <gune.kim@samsung.com>, ho namkoong <ho.namkoong@samsung.com>, hyeongseok heo <hyeong-seok.heo@samsung.com>, gyeongseok seo <gyeongseok.seo@samsung.com>, jihoon song <jihoon80.song@samsung.com>, changhyun lee <changhyun1.lee@samsung.com>, bonyong lee <bonyong.lee@samsung.com>