From 505db2b041569eae269e703a9baba18caa178421 Mon Sep 17 00:00:00 2001 From: AMIT SHEKHAR Date: Thu, 2 Feb 2017 08:55:17 +0530 Subject: [PATCH 01/50] Add dataType --- .../main/java/com/sample/MainActivity.java | 14 +++++++++++- .../com/amitshekhar/server/ClientServer.java | 22 ++++++++++++++++++- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/sample/MainActivity.java b/app/src/main/java/com/sample/MainActivity.java index cb3327a..cf9bd44 100644 --- a/app/src/main/java/com/sample/MainActivity.java +++ b/app/src/main/java/com/sample/MainActivity.java @@ -28,6 +28,9 @@ import com.sample.database.ContactDBHelper; +import java.util.HashSet; +import java.util.Set; + public class MainActivity extends AppCompatActivity { @SuppressLint("CommitPrefEdits") @@ -38,13 +41,22 @@ protected void onCreate(Bundle savedInstanceState) { setContentView(R.layout.activity_main); + Set stringSet = new HashSet<>(); + stringSet.add("SetOne"); + stringSet.add("SetTwo"); + stringSet.add("SetThree"); + SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); SharedPreferences prefsOne = getSharedPreferences("countPrefOne", Context.MODE_PRIVATE); SharedPreferences prefsTwo = getSharedPreferences("countPrefTwo", Context.MODE_PRIVATE); sharedPreferences.edit().putString("testOne", "one").commit(); - sharedPreferences.edit().putString("testTwo", "two").commit(); + sharedPreferences.edit().putInt("testTwo", 2).commit(); + sharedPreferences.edit().putLong("testThree", 100000L).commit(); + sharedPreferences.edit().putFloat("testFour", 3.01F).commit(); + sharedPreferences.edit().putBoolean("testFive", true).commit(); + sharedPreferences.edit().putStringSet("testSix", stringSet).commit(); prefsOne.edit().putString("testOneNew", "one").commit(); diff --git a/debug-db/src/main/java/com/amitshekhar/server/ClientServer.java b/debug-db/src/main/java/com/amitshekhar/server/ClientServer.java index 55c26af..99d5c40 100644 --- a/debug-db/src/main/java/com/amitshekhar/server/ClientServer.java +++ b/debug-db/src/main/java/com/amitshekhar/server/ClientServer.java @@ -53,6 +53,7 @@ import java.util.Collections; import java.util.List; import java.util.Map; +import java.util.Set; public class ClientServer implements Runnable { @@ -497,12 +498,31 @@ public Response getAllPrefData(String tag) { response.isSuccessful = true; response.columns.add("Key"); response.columns.add("Value"); + response.columns.add("dataType"); SharedPreferences preferences = mContext.getSharedPreferences(tag, Context.MODE_PRIVATE); Map allEntries = preferences.getAll(); for (Map.Entry entry : allEntries.entrySet()) { List row = new ArrayList<>(); row.add(entry.getKey()); - row.add(entry.getValue() != null ? entry.getValue().toString() : ""); + if (entry.getValue() != null) { + row.add(entry.getValue().toString()); + if (entry.getValue() instanceof String) { + row.add("string"); + } else if (entry.getValue() instanceof Integer) { + row.add("int"); + } else if (entry.getValue() instanceof Long) { + row.add("long"); + } else if (entry.getValue() instanceof Float) { + row.add("float"); + } else if (entry.getValue() instanceof Boolean) { + row.add("boolean"); + } else if (entry.getValue() instanceof Set) { + row.add("stringSet"); + } + } else { + row.add(""); + row.add("unknown"); + } response.rows.add(row); } return response; From 638c2d222209a1e417505ea402f2cb2a702486de Mon Sep 17 00:00:00 2001 From: AMIT SHEKHAR Date: Sat, 4 Feb 2017 00:14:11 +0530 Subject: [PATCH 02/50] Add TableData Model --- .../java/com/amitshekhar/model/TableData.java | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 debug-db/src/main/java/com/amitshekhar/model/TableData.java diff --git a/debug-db/src/main/java/com/amitshekhar/model/TableData.java b/debug-db/src/main/java/com/amitshekhar/model/TableData.java new file mode 100644 index 0000000..eaf1d93 --- /dev/null +++ b/debug-db/src/main/java/com/amitshekhar/model/TableData.java @@ -0,0 +1,40 @@ +/* + * + * * Copyright (C) 2016 Amit Shekhar + * * Copyright (C) 2011 Android Open Source Project + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * http://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package com.amitshekhar.model; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by amitshekhar on 04/02/17. + */ + +public class TableData { + + public List tableInfos = new ArrayList<>(); + public boolean isSuccessful; + public List rows = new ArrayList<>(); + + public static class TableInfo { + public String dataType; + public String title; + public boolean isPrimary; + } +} From b6585bc7989e5651155b7549fecf2c7c39100dcd Mon Sep 17 00:00:00 2001 From: AMIT SHEKHAR Date: Sat, 4 Feb 2017 00:21:15 +0530 Subject: [PATCH 03/50] Add RowData Model --- .../java/com/amitshekhar/model/RowData.java | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 debug-db/src/main/java/com/amitshekhar/model/RowData.java diff --git a/debug-db/src/main/java/com/amitshekhar/model/RowData.java b/debug-db/src/main/java/com/amitshekhar/model/RowData.java new file mode 100644 index 0000000..2868675 --- /dev/null +++ b/debug-db/src/main/java/com/amitshekhar/model/RowData.java @@ -0,0 +1,33 @@ +/* + * + * * Copyright (C) 2016 Amit Shekhar + * * Copyright (C) 2011 Android Open Source Project + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * http://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package com.amitshekhar.model; + +/** + * Created by amitshekhar on 04/02/17. + */ + +public class RowData { + + public String title; + public boolean isPrimary; + public String dataType; + public String value; + +} From 986cc5dcbbbac9c79a8ec843e3d9f62a18a7a315 Mon Sep 17 00:00:00 2001 From: AMIT SHEKHAR Date: Sat, 4 Feb 2017 02:29:15 +0530 Subject: [PATCH 04/50] Add Different Models --- .../{RowData.java => RowDataRequest.java} | 2 +- ...{TableData.java => TableDataResponse.java} | 9 ++--- .../amitshekhar/model/UpdateRowResponse.java | 30 ++++++++++++++++ .../java/com/amitshekhar/utils/Constants.java | 4 +++ .../java/com/amitshekhar/utils/DataType.java | 36 +++++++++++++++++++ 5 files changed, 76 insertions(+), 5 deletions(-) rename debug-db/src/main/java/com/amitshekhar/model/{RowData.java => RowDataRequest.java} (96%) rename debug-db/src/main/java/com/amitshekhar/model/{TableData.java => TableDataResponse.java} (85%) create mode 100644 debug-db/src/main/java/com/amitshekhar/model/UpdateRowResponse.java create mode 100644 debug-db/src/main/java/com/amitshekhar/utils/DataType.java diff --git a/debug-db/src/main/java/com/amitshekhar/model/RowData.java b/debug-db/src/main/java/com/amitshekhar/model/RowDataRequest.java similarity index 96% rename from debug-db/src/main/java/com/amitshekhar/model/RowData.java rename to debug-db/src/main/java/com/amitshekhar/model/RowDataRequest.java index 2868675..7040542 100644 --- a/debug-db/src/main/java/com/amitshekhar/model/RowData.java +++ b/debug-db/src/main/java/com/amitshekhar/model/RowDataRequest.java @@ -23,7 +23,7 @@ * Created by amitshekhar on 04/02/17. */ -public class RowData { +public class RowDataRequest { public String title; public boolean isPrimary; diff --git a/debug-db/src/main/java/com/amitshekhar/model/TableData.java b/debug-db/src/main/java/com/amitshekhar/model/TableDataResponse.java similarity index 85% rename from debug-db/src/main/java/com/amitshekhar/model/TableData.java rename to debug-db/src/main/java/com/amitshekhar/model/TableDataResponse.java index eaf1d93..d1fb655 100644 --- a/debug-db/src/main/java/com/amitshekhar/model/TableData.java +++ b/debug-db/src/main/java/com/amitshekhar/model/TableDataResponse.java @@ -19,18 +19,19 @@ package com.amitshekhar.model; -import java.util.ArrayList; import java.util.List; /** * Created by amitshekhar on 04/02/17. */ -public class TableData { +public class TableDataResponse { - public List tableInfos = new ArrayList<>(); + public List tableInfos; public boolean isSuccessful; - public List rows = new ArrayList<>(); + public List rows; + public String errorMessage; + public boolean isEditable; public static class TableInfo { public String dataType; diff --git a/debug-db/src/main/java/com/amitshekhar/model/UpdateRowResponse.java b/debug-db/src/main/java/com/amitshekhar/model/UpdateRowResponse.java new file mode 100644 index 0000000..41adcca --- /dev/null +++ b/debug-db/src/main/java/com/amitshekhar/model/UpdateRowResponse.java @@ -0,0 +1,30 @@ +/* + * + * * Copyright (C) 2016 Amit Shekhar + * * Copyright (C) 2011 Android Open Source Project + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * http://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package com.amitshekhar.model; + +/** + * Created by amitshekhar on 04/02/17. + */ + +public class UpdateRowResponse { + + public boolean isSuccessful; + +} diff --git a/debug-db/src/main/java/com/amitshekhar/utils/Constants.java b/debug-db/src/main/java/com/amitshekhar/utils/Constants.java index 3496e4a..39b3827 100644 --- a/debug-db/src/main/java/com/amitshekhar/utils/Constants.java +++ b/debug-db/src/main/java/com/amitshekhar/utils/Constants.java @@ -30,4 +30,8 @@ private Constants() { } public static final String APP_SHARED_PREFERENCES = "APP_SHARED_PREFERENCES"; + public static final String PK = "pk"; + public static final String TYPE = "type"; + public static final String NAME = "name"; + } diff --git a/debug-db/src/main/java/com/amitshekhar/utils/DataType.java b/debug-db/src/main/java/com/amitshekhar/utils/DataType.java new file mode 100644 index 0000000..cf613a3 --- /dev/null +++ b/debug-db/src/main/java/com/amitshekhar/utils/DataType.java @@ -0,0 +1,36 @@ +/* + * + * * Copyright (C) 2016 Amit Shekhar + * * Copyright (C) 2011 Android Open Source Project + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * http://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package com.amitshekhar.utils; + +/** + * Created by amitshekhar on 04/02/17. + */ + +public class DataType { + + private DataType() { + // This class in not publicly instantiable + } + + public static final String INTEGER = "integer"; + public static final String REAL = "real"; + public static final String TEXT = "text"; + +} From 57cff369ffa941f87873a3e33b59d115a48f4251 Mon Sep 17 00:00:00 2001 From: AMIT SHEKHAR Date: Sat, 4 Feb 2017 02:29:49 +0530 Subject: [PATCH 05/50] Implement QueryExecutor --- .../com/amitshekhar/utils/QueryExecutor.java | 226 ++++++++++++++++++ 1 file changed, 226 insertions(+) create mode 100644 debug-db/src/main/java/com/amitshekhar/utils/QueryExecutor.java diff --git a/debug-db/src/main/java/com/amitshekhar/utils/QueryExecutor.java b/debug-db/src/main/java/com/amitshekhar/utils/QueryExecutor.java new file mode 100644 index 0000000..727e685 --- /dev/null +++ b/debug-db/src/main/java/com/amitshekhar/utils/QueryExecutor.java @@ -0,0 +1,226 @@ +/* + * + * * Copyright (C) 2016 Amit Shekhar + * * Copyright (C) 2011 Android Open Source Project + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * http://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package com.amitshekhar.utils; + +import android.content.ContentValues; +import android.database.Cursor; +import android.database.sqlite.SQLiteDatabase; + +import com.amitshekhar.model.RowDataRequest; +import com.amitshekhar.model.TableDataResponse; +import com.amitshekhar.model.TableDataResponse.TableInfo; +import com.amitshekhar.model.UpdateRowResponse; +import com.google.gson.Gson; +import com.google.gson.reflect.TypeToken; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by amitshekhar on 04/02/17. + */ + +public class QueryExecutor { + + public static final Gson gson = new Gson(); + + private QueryExecutor() { + // This class in not publicly instantiable + } + + public static TableDataResponse getTableData(SQLiteDatabase db, String selectQuery, String tableName) { + + TableDataResponse tableData = new TableDataResponse(); + + // TODO : Handle JOIN query + + if (tableName == null) { + tableName = getTableName(selectQuery); + } + + if (tableName != null) { + final String pragmaQuery = "PRAGMA table_info(+" + tableName + ")"; + tableData.tableInfos = getTableInfo(db, pragmaQuery); + } + + tableData.isEditable = tableName != null && tableData.tableInfos != null; + + Cursor cursor; + try { + cursor = db.rawQuery(selectQuery, null); + } catch (Exception e) { + e.printStackTrace(); + tableData.isSuccessful = false; + tableData.errorMessage = e.getMessage(); + return tableData; + } + + if (cursor != null) { + cursor.moveToFirst(); + tableData.isSuccessful = true; + + if (cursor.getCount() > 0) { + do { + List row = new ArrayList<>(); + for (int i = 0; i < cursor.getColumnCount(); i++) { + switch (cursor.getType(i)) { + case Cursor.FIELD_TYPE_BLOB: + row.add(cursor.getBlob(i)); + break; + case Cursor.FIELD_TYPE_FLOAT: + row.add(cursor.getFloat(i)); + break; + case Cursor.FIELD_TYPE_INTEGER: + row.add(cursor.getLong(i)); + break; + case Cursor.FIELD_TYPE_STRING: + row.add(cursor.getString(i)); + break; + default: + row.add(""); + } + } + tableData.rows.add(row); + + } while (cursor.moveToNext()); + } + cursor.close(); + return tableData; + } else { + tableData.isSuccessful = false; + tableData.errorMessage = "Cursor is null"; + return tableData; + } + + } + + public static List getTableInfo(SQLiteDatabase db, String pragmaQuery) { + + Cursor cursor; + try { + cursor = db.rawQuery(pragmaQuery, null); + } catch (Exception e) { + e.printStackTrace(); + return null; + } + + if (cursor != null) { + + List tableInfoList = new ArrayList<>(); + + cursor.moveToFirst(); + + if (cursor.getCount() > 0) { + do { + TableInfo tableInfo = new TableInfo(); + + for (int i = 0; i < cursor.getColumnCount(); i++) { + + final String columnName = cursor.getColumnName(i); + + if ("pk".equals(columnName)) { + + } else if ("type".equals(columnName)) + + switch (columnName) { + case Constants.PK: + tableInfo.isPrimary = cursor.getInt(i) == 1; + break; + case Constants.TYPE: + tableInfo.dataType = cursor.getString(i); + break; + case Constants.NAME: + tableInfo.title = cursor.getString(i); + break; + default: + } + } + tableInfoList.add(tableInfo); + + } while (cursor.moveToNext()); + } + cursor.close(); + return tableInfoList; + } + return null; + } + + public static UpdateRowResponse updateRow(SQLiteDatabase db, String tableName, String data) { + + UpdateRowResponse updateRowResponse = new UpdateRowResponse(); + + if (data == null) { + updateRowResponse.isSuccessful = false; + return updateRowResponse; + } + + List rowDataRequests = gson.fromJson(data, new TypeToken>() { + }.getType()); + + if (rowDataRequests != null) { + ContentValues contentValues = new ContentValues(); + + String whereClause = null; + List whereArgsList = new ArrayList<>(); + + for (RowDataRequest rowDataRequest : rowDataRequests) { + if (rowDataRequest.isPrimary) { + if (whereClause == null) { + whereClause = rowDataRequest.title + "=? "; + } else { + whereClause = "and " + rowDataRequest.title + "=? "; + } + whereArgsList.add(rowDataRequest.value); + } else { + switch (rowDataRequest.dataType) { + case DataType.INTEGER: + contentValues.put(rowDataRequest.title, Integer.valueOf(rowDataRequest.value)); + break; + case DataType.REAL: + contentValues.put(rowDataRequest.title, Double.valueOf(rowDataRequest.value)); + break; + case DataType.TEXT: + contentValues.put(rowDataRequest.title, rowDataRequest.value); + break; + default: + } + } + } + + String[] whereArgs = new String[whereArgsList.size()]; + + for (int i = 0; i < whereArgsList.size(); i++) { + whereArgs[i] = whereArgsList.get(i); + } + + db.update(tableName, contentValues, whereClause, whereArgs); + updateRowResponse.isSuccessful = true; + return updateRowResponse; + + } else { + updateRowResponse.isSuccessful = false; + return updateRowResponse; + } + } + + public static String getTableName(String selectQuery) { + return null; + } +} From 312dd2456e99db88ac4b2fe819dd26cce996d068 Mon Sep 17 00:00:00 2001 From: AMIT SHEKHAR Date: Sat, 4 Feb 2017 02:31:15 +0530 Subject: [PATCH 06/50] Remove unused from QueryExecutor --- .../com/amitshekhar/utils/QueryExecutor.java | 29 +++++++++---------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/debug-db/src/main/java/com/amitshekhar/utils/QueryExecutor.java b/debug-db/src/main/java/com/amitshekhar/utils/QueryExecutor.java index 727e685..08d34e9 100644 --- a/debug-db/src/main/java/com/amitshekhar/utils/QueryExecutor.java +++ b/debug-db/src/main/java/com/amitshekhar/utils/QueryExecutor.java @@ -135,22 +135,19 @@ public static List getTableInfo(SQLiteDatabase db, String pragmaQuery final String columnName = cursor.getColumnName(i); - if ("pk".equals(columnName)) { - - } else if ("type".equals(columnName)) - - switch (columnName) { - case Constants.PK: - tableInfo.isPrimary = cursor.getInt(i) == 1; - break; - case Constants.TYPE: - tableInfo.dataType = cursor.getString(i); - break; - case Constants.NAME: - tableInfo.title = cursor.getString(i); - break; - default: - } + switch (columnName) { + case Constants.PK: + tableInfo.isPrimary = cursor.getInt(i) == 1; + break; + case Constants.TYPE: + tableInfo.dataType = cursor.getString(i); + break; + case Constants.NAME: + tableInfo.title = cursor.getString(i); + break; + default: + } + } tableInfoList.add(tableInfo); From 5565aa3eb173b639d962292650a0254f894268d8 Mon Sep 17 00:00:00 2001 From: AMIT SHEKHAR Date: Sat, 4 Feb 2017 09:25:04 +0530 Subject: [PATCH 07/50] Correct Syntax of Pragma query --- .../src/main/java/com/amitshekhar/utils/QueryExecutor.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/debug-db/src/main/java/com/amitshekhar/utils/QueryExecutor.java b/debug-db/src/main/java/com/amitshekhar/utils/QueryExecutor.java index 08d34e9..0be674a 100644 --- a/debug-db/src/main/java/com/amitshekhar/utils/QueryExecutor.java +++ b/debug-db/src/main/java/com/amitshekhar/utils/QueryExecutor.java @@ -56,7 +56,7 @@ public static TableDataResponse getTableData(SQLiteDatabase db, String selectQue } if (tableName != null) { - final String pragmaQuery = "PRAGMA table_info(+" + tableName + ")"; + final String pragmaQuery = "PRAGMA table_info(" + tableName + ")"; tableData.tableInfos = getTableInfo(db, pragmaQuery); } @@ -75,8 +75,9 @@ public static TableDataResponse getTableData(SQLiteDatabase db, String selectQue if (cursor != null) { cursor.moveToFirst(); tableData.isSuccessful = true; - + tableData.rows = new ArrayList<>(); if (cursor.getCount() > 0) { + do { List row = new ArrayList<>(); for (int i = 0; i < cursor.getColumnCount(); i++) { From 21dc05d2408d859556d9e758b6e411c9538e27cd Mon Sep 17 00:00:00 2001 From: Raj Engla Date: Sun, 5 Feb 2017 07:24:12 +0530 Subject: [PATCH 08/50] add style for selected database and table --- debug-db/src/main/assets/app.js | 20 +++++++++++++++++++- debug-db/src/main/assets/custom.css | 6 ++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/debug-db/src/main/assets/app.js b/debug-db/src/main/assets/app.js index 0b3297e..8b2314f 100644 --- a/debug-db/src/main/assets/app.js +++ b/debug-db/src/main/assets/app.js @@ -5,6 +5,23 @@ $( document ).ready(function() { queryFunction(); } }); + //update currently selected database + $( document ).on( "click", "#db-list .list-group-item", function() { + $("#db-list .list-group-item").each(function() { + $(this).removeClass('selected'); + }); + $(this).addClass('selected'); + }); + + //update currently table database + $( document ).on( "click", "#table-list .list-group-item", function() { + $("#table-list .list-group-item").each(function() { + $(this).removeClass('selected'); + }); + $(this).addClass('selected'); + }); + + }); var isDatabaseSelected = true; @@ -93,7 +110,8 @@ function openDatabaseAndGetTableList(db) { } $('#table-list').empty() for(var count = 0; count < tableList.length; count++){ - $("#table-list").append("" +tableList[count] + ""); + var tableName = tableList[count]; + $("#table-list").append("" +tableName + ""); } }}); diff --git a/debug-db/src/main/assets/custom.css b/debug-db/src/main/assets/custom.css index e2dd045..c7cacaf 100644 --- a/debug-db/src/main/assets/custom.css +++ b/debug-db/src/main/assets/custom.css @@ -13,3 +13,9 @@ .list-group-item { word-break: break-all; } + +.list-group-item.selected { + background: #dff0d8 !important; + color: #3c763d !important; + font-weight: bold; +} \ No newline at end of file From ada09ba5b39acb86e40710d61e88e7d58fd39030 Mon Sep 17 00:00:00 2001 From: Raj Engla Date: Sun, 5 Feb 2017 08:10:50 +0530 Subject: [PATCH 09/50] return same type of response on different type of data request MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - for all data retrieval requests preference data retrieval and raw select query return same type of response - add new datatype “boolean” to for pref values --- debug-db/src/main/assets/app.js | 16 ++- .../amitshekhar/model/TableDataResponse.java | 6 +- .../com/amitshekhar/server/ClientServer.java | 129 +++++++++++------- .../java/com/amitshekhar/utils/DataType.java | 1 + .../com/amitshekhar/utils/QueryExecutor.java | 23 ++-- 5 files changed, 114 insertions(+), 61 deletions(-) diff --git a/debug-db/src/main/assets/app.js b/debug-db/src/main/assets/app.js index 8b2314f..4cea032 100644 --- a/debug-db/src/main/assets/app.js +++ b/debug-db/src/main/assets/app.js @@ -122,9 +122,19 @@ function inflateData(result){ if(result.isSuccessful){ showSuccessInfo(); - var columnHeader = result.columns.map(function(columnName) { - return {"title": columnName}; - }); + var columnHeader = result.tableInfos; + + // set function to return cell data for different usages like set, display, filter, search etc.. + for(var i = 0; i < columnHeader.length; i++) { + columnHeader[i]['targets'] = i; + columnHeader[i]['data'] = function(row, type, val, meta) { + var dataType = row[meta.col].dataType; + if (type == "sort" && dataType == "boolean") { + return row[meta.col].value ? 1 : 0; + } + return row[meta.col].value; + } + } var columnData = result.rows; var tableId = "#db-data"; if ($.fn.DataTable.isDataTable(tableId) ) { diff --git a/debug-db/src/main/java/com/amitshekhar/model/TableDataResponse.java b/debug-db/src/main/java/com/amitshekhar/model/TableDataResponse.java index d1fb655..dd658a7 100644 --- a/debug-db/src/main/java/com/amitshekhar/model/TableDataResponse.java +++ b/debug-db/src/main/java/com/amitshekhar/model/TableDataResponse.java @@ -34,8 +34,12 @@ public class TableDataResponse { public boolean isEditable; public static class TableInfo { - public String dataType; public String title; public boolean isPrimary; } + public static class ColumnData { + public String dataType; + public Object value; + } + } diff --git a/debug-db/src/main/java/com/amitshekhar/server/ClientServer.java b/debug-db/src/main/java/com/amitshekhar/server/ClientServer.java index 99d5c40..fe0be60 100644 --- a/debug-db/src/main/java/com/amitshekhar/server/ClientServer.java +++ b/debug-db/src/main/java/com/amitshekhar/server/ClientServer.java @@ -33,8 +33,12 @@ import android.util.Log; import com.amitshekhar.model.Response; +import com.amitshekhar.model.TableDataResponse; +import com.amitshekhar.model.TableDataResponse.ColumnData; import com.amitshekhar.utils.Constants; +import com.amitshekhar.utils.DataType; import com.amitshekhar.utils.PrefUtils; +import com.amitshekhar.utils.QueryExecutor; import com.google.gson.Gson; import java.io.BufferedReader; @@ -49,6 +53,7 @@ import java.net.ServerSocket; import java.net.Socket; import java.net.SocketException; +import java.net.URLDecoder; import java.util.ArrayList; import java.util.Collections; import java.util.List; @@ -177,19 +182,19 @@ private void handle(Socket socket) throws IOException { byte[] bytes; if (route.startsWith("getAllDataFromTheTable")) { - String query = null; + String tableName = null; if (route.contains("?tableName=")) { - query = route.substring(route.indexOf("=") + 1, route.length()); + tableName = route.substring(route.indexOf("=") + 1, route.length()); } - Response response; + TableDataResponse response = null; if (isDbOpenned) { - String sql = "SELECT * FROM " + query; - response = query(sql); + String sql = "SELECT * FROM " + tableName; + response = QueryExecutor.getTableData(mDatabase,sql,tableName); } else { - response = getAllPrefData(query); + response = getAllPrefData(tableName); } String data = mGson.toJson(response); @@ -200,9 +205,6 @@ private void handle(Socket socket) throws IOException { if (route.contains("?query=")) { query = route.substring(route.indexOf("=") + 1, route.length()); } - - Response response; - try { query = java.net.URLDecoder.decode(query, "UTF-8"); } catch (Exception e) { @@ -211,13 +213,15 @@ private void handle(Socket socket) throws IOException { String first = query.split(" ")[0].toLowerCase(); + String data = ""; if (first.equals("select")) { - response = query(query); + TableDataResponse response = query(query); + data = mGson.toJson(response); } else { - response = exec(query); + Response response = exec(query); + data = mGson.toJson(response); } - String data = mGson.toJson(response); bytes = data.getBytes(); } else if (route.startsWith("getDbList")) { @@ -392,49 +396,60 @@ private Response exec(String sql) { return response; } - private Response query(String sql) { + private TableDataResponse query(String sql) { Cursor cursor; try { cursor = mDatabase.rawQuery(sql, null); } catch (Exception e) { e.printStackTrace(); - Response msg = new Response(); - msg.isSuccessful = false; - msg.error = e.getMessage(); - return msg; + TableDataResponse errorResponse = new TableDataResponse(); + errorResponse.isSuccessful = false; + errorResponse.errorMessage = e.getMessage(); + return errorResponse; } if (cursor != null) { cursor.moveToFirst(); - Response response = new Response(); + TableDataResponse response = new TableDataResponse(); response.isSuccessful = true; - List columns = new ArrayList<>(); + + response.tableInfos = new ArrayList<>(); for (int i = 0; i < cursor.getColumnCount(); i++) { - String name = cursor.getColumnName(i); - columns.add(name); + TableDataResponse.TableInfo tableInfo = new TableDataResponse.TableInfo(); + tableInfo.title = cursor.getColumnName(i); + tableInfo.isPrimary = false; + + response.tableInfos.add(tableInfo); } - response.columns = columns; + response.rows = new ArrayList<>(); if (cursor.getCount() > 0) { do { - List row = new ArrayList<>(); + List row = new ArrayList<>(); for (int i = 0; i < cursor.getColumnCount(); i++) { + ColumnData columnData = new ColumnData(); switch (cursor.getType(i)) { case Cursor.FIELD_TYPE_BLOB: - row.add(cursor.getBlob(i)); + columnData.dataType = DataType.TEXT; + columnData.value = cursor.getBlob(i); break; case Cursor.FIELD_TYPE_FLOAT: - row.add(cursor.getFloat(i)); + columnData.dataType = DataType.REAL; + columnData.value = cursor.getFloat(i); break; case Cursor.FIELD_TYPE_INTEGER: - row.add(cursor.getLong(i)); + columnData.dataType = DataType.INTEGER; + columnData.value = cursor.getLong(i); break; case Cursor.FIELD_TYPE_STRING: - row.add(cursor.getString(i)); + columnData.dataType = DataType.TEXT; + columnData.value = cursor.getString(i); break; default: - row.add(""); + columnData.dataType = DataType.TEXT; + columnData.value = cursor.getString(i); } + row.add(columnData); } response.rows.add(row); @@ -443,10 +458,10 @@ private Response query(String sql) { cursor.close(); return response; } else { - Response response = new Response(); - response.isSuccessful = false; - response.error = "Cursor is null"; - return response; + TableDataResponse errorResponse = new TableDataResponse(); + errorResponse.isSuccessful = false; + errorResponse.errorMessage = "Cursor is null"; + return errorResponse; } } @@ -493,36 +508,54 @@ public Response getAllPrefTableName() { return response; } - public Response getAllPrefData(String tag) { - Response response = new Response(); + public TableDataResponse getAllPrefData(String tag) { + TableDataResponse response = new TableDataResponse(); response.isSuccessful = true; - response.columns.add("Key"); - response.columns.add("Value"); - response.columns.add("dataType"); + + TableDataResponse.TableInfo keyInfo = new TableDataResponse.TableInfo(); + keyInfo.isPrimary = true; + keyInfo.title = "Key"; + + TableDataResponse.TableInfo valueInfo = new TableDataResponse.TableInfo(); + valueInfo.isPrimary = false; + valueInfo.title = "Value"; + + response.tableInfos = new ArrayList<>(); + response.tableInfos.add(keyInfo); + response.tableInfos.add(valueInfo); + + response.rows = new ArrayList<>(); + SharedPreferences preferences = mContext.getSharedPreferences(tag, Context.MODE_PRIVATE); Map allEntries = preferences.getAll(); for (Map.Entry entry : allEntries.entrySet()) { - List row = new ArrayList<>(); - row.add(entry.getKey()); + List row = new ArrayList<>(); + ColumnData keyColumnData = new ColumnData(); + keyColumnData.dataType = DataType.TEXT; + keyColumnData.value = entry.getKey(); + + row.add(keyColumnData); + + ColumnData valueColumnData = new ColumnData(); + valueColumnData.value = entry.getValue().toString(); if (entry.getValue() != null) { - row.add(entry.getValue().toString()); if (entry.getValue() instanceof String) { - row.add("string"); + valueColumnData.dataType = DataType.TEXT; } else if (entry.getValue() instanceof Integer) { - row.add("int"); + valueColumnData.dataType = DataType.INTEGER; } else if (entry.getValue() instanceof Long) { - row.add("long"); + valueColumnData.dataType = DataType.INTEGER; } else if (entry.getValue() instanceof Float) { - row.add("float"); + valueColumnData.dataType = DataType.REAL; } else if (entry.getValue() instanceof Boolean) { - row.add("boolean"); + valueColumnData.dataType = DataType.BOOLEAN; } else if (entry.getValue() instanceof Set) { - row.add("stringSet"); + valueColumnData.dataType = DataType.TEXT; } } else { - row.add(""); - row.add("unknown"); + valueColumnData.dataType = DataType.TEXT; } + row.add(valueColumnData); response.rows.add(row); } return response; diff --git a/debug-db/src/main/java/com/amitshekhar/utils/DataType.java b/debug-db/src/main/java/com/amitshekhar/utils/DataType.java index cf613a3..ef19cba 100644 --- a/debug-db/src/main/java/com/amitshekhar/utils/DataType.java +++ b/debug-db/src/main/java/com/amitshekhar/utils/DataType.java @@ -29,6 +29,7 @@ private DataType() { // This class in not publicly instantiable } + public static final String BOOLEAN = "boolean"; public static final String INTEGER = "integer"; public static final String REAL = "real"; public static final String TEXT = "text"; diff --git a/debug-db/src/main/java/com/amitshekhar/utils/QueryExecutor.java b/debug-db/src/main/java/com/amitshekhar/utils/QueryExecutor.java index 0be674a..d56b60a 100644 --- a/debug-db/src/main/java/com/amitshekhar/utils/QueryExecutor.java +++ b/debug-db/src/main/java/com/amitshekhar/utils/QueryExecutor.java @@ -27,6 +27,7 @@ import com.amitshekhar.model.TableDataResponse; import com.amitshekhar.model.TableDataResponse.TableInfo; import com.amitshekhar.model.UpdateRowResponse; +import com.amitshekhar.model.TableDataResponse.ColumnData; import com.google.gson.Gson; import com.google.gson.reflect.TypeToken; @@ -79,24 +80,31 @@ public static TableDataResponse getTableData(SQLiteDatabase db, String selectQue if (cursor.getCount() > 0) { do { - List row = new ArrayList<>(); + List row = new ArrayList<>(); for (int i = 0; i < cursor.getColumnCount(); i++) { + ColumnData columnData = new ColumnData(); switch (cursor.getType(i)) { case Cursor.FIELD_TYPE_BLOB: - row.add(cursor.getBlob(i)); + columnData.dataType = DataType.TEXT; + columnData.value = cursor.getBlob(i); break; case Cursor.FIELD_TYPE_FLOAT: - row.add(cursor.getFloat(i)); + columnData.dataType = DataType.REAL; + columnData.value = cursor.getFloat(i); break; case Cursor.FIELD_TYPE_INTEGER: - row.add(cursor.getLong(i)); + columnData.dataType = DataType.INTEGER; + columnData.value = cursor.getLong(i); break; case Cursor.FIELD_TYPE_STRING: - row.add(cursor.getString(i)); + columnData.dataType = DataType.TEXT; + columnData.value = cursor.getString(i); break; default: - row.add(""); + columnData.dataType = DataType.TEXT; + columnData.value = cursor.getString(i); } + row.add(columnData); } tableData.rows.add(row); @@ -140,9 +148,6 @@ public static List getTableInfo(SQLiteDatabase db, String pragmaQuery case Constants.PK: tableInfo.isPrimary = cursor.getInt(i) == 1; break; - case Constants.TYPE: - tableInfo.dataType = cursor.getString(i); - break; case Constants.NAME: tableInfo.title = cursor.getString(i); break; From 5b2ee76a108b4424b5ea3d2e5c01073e579fd24f Mon Sep 17 00:00:00 2001 From: Raj Engla Date: Sun, 5 Feb 2017 08:21:48 +0530 Subject: [PATCH 10/50] support for database row update added --- debug-db/src/main/assets/app.js | 63 +- .../main/assets/dataTables.altEditor.free.js | 588 ++++++++++++++++++ debug-db/src/main/assets/index.html | 10 + .../com/amitshekhar/server/ClientServer.java | 11 + .../com/amitshekhar/utils/QueryExecutor.java | 2 +- 5 files changed, 671 insertions(+), 3 deletions(-) create mode 100644 debug-db/src/main/assets/dataTables.altEditor.free.js diff --git a/debug-db/src/main/assets/app.js b/debug-db/src/main/assets/app.js index 4cea032..25eefe0 100644 --- a/debug-db/src/main/assets/app.js +++ b/debug-db/src/main/assets/app.js @@ -146,14 +146,38 @@ function inflateData(result){ $(tableId).dataTable({ "data": columnData, - "columns": columnHeader, + "columnDefs": columnHeader, 'bPaginate': true, 'searching': true, 'bFilter': true, 'bInfo': true, "bSort" : true, "scrollX": true, - "iDisplayLength": 10 + "iDisplayLength": 10, + "dom": "Bfrtip", + select: 'single', + responsive: true, + altEditor: true, // Enable altEditor + buttons: [ + { + extend: 'selected', // Bind to Selected row + text: 'Edit', + name: 'edit' // do not change name + } + ] + }) + + //attach row-updated listener + $(tableId).on('update-row.dt', function (e, updatedRowData, callback) { + var updatedRowDataArray = JSON.parse(updatedRowData); + //add value for each column + var data = columnHeader; + for(var i = 0; i < data.length; i++) { + data[i].value = updatedRowDataArray[i].value; + data[i].dataType = updatedRowDataArray[i].dataType; + } + //send update table data request to server + updateTableData(data, callback); }); // hack to fix alignment issue when scrollX is enabled $(".dataTables_scrollHeadInner").css({"width":"100%"}); @@ -164,6 +188,41 @@ function inflateData(result){ } +//send update database request to server +function updateTableData(updatedData, callback) { + //get currently selected element + var selectedTableElement = $("#table-list .list-group-item.selected"); + + var filteredUpdatedData = updatedData.map(function(columnData){ + return { + title: columnData.title, + isPrimary: columnData.isPrimary, + value: columnData.value, + dataType: columnData.dataType + } + }); + //build request parameters + var requestParameters = {}; + requestParameters.dbName = selectedTableElement.attr('data-db-name'); + requestParameters.tableName = selectedTableElement.attr('data-table-name');; + requestParameters.updatedData = encodeURIComponent(JSON.stringify(filteredUpdatedData)); + + //execute request + $.ajax({ + url: "updateTableData", + type: 'GET', + data: requestParameters, + success: function(response) { + console.log("Data updated successfully"); + callback(true); + }, + error: function(xhr, status, error) { + console.log("Data updated failed"); + callback(false); + } + }) +} + function showSuccessInfo(){ $("#success-info").show(); $("#error-info").hide(); diff --git a/debug-db/src/main/assets/dataTables.altEditor.free.js b/debug-db/src/main/assets/dataTables.altEditor.free.js new file mode 100644 index 0000000..891aef9 --- /dev/null +++ b/debug-db/src/main/assets/dataTables.altEditor.free.js @@ -0,0 +1,588 @@ +/*! Datatables altEditor 1.0 + */ +/** + * @summary altEditor + * @description Lightweight editor for DataTables + * @version 1.0 + * @file dataTables.editor.lite.js + * @author kingkode (www.kingkode.com) + * @contact www.kingkode.com/contact + * @copyright Copyright 2016 Kingkode + * + * This source file is free software, available under the following license: + * MIT license - http://datatables.net/license/mit + * + * This source file is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details. + * + * For details please refer to: http://www.kingkode.com + */ +(function(factory) { + if (typeof define === 'function' && define.amd) { + // AMD + define(['jquery', 'datatables.net'], function($) { + return factory($, window, document); + }); + } else if (typeof exports === 'object') { + // CommonJS + module.exports = function(root, $) { + if (!root) { + root = window; + } + + if (!$ || !$.fn.dataTable) { + $ = require('datatables.net')(root, $).$; + } + + return factory($, root, root.document); + }; + } else { + // Browser + factory(jQuery, window, document); + } +}(function($, window, document, undefined) { + 'use strict'; + var DataTable = $.fn.dataTable; + + + var _instance = 0; + + /** + * altEditor provides modal editing of records for Datatables + * + * @class altEditor + * @constructor + * @param {object} oTD DataTables settings object + * @param {object} oConfig Configuration object for altEditor + */ + var altEditor = function(dt, opts) { + if (!DataTable.versionCheck || !DataTable.versionCheck('1.10.8')) { + throw ("Warning: altEditor requires DataTables 1.10.8 or greater"); + } + + // User and defaults configuration object + this.c = $.extend(true, {}, + DataTable.defaults.altEditor, + altEditor.defaults, + opts + ); + + /** + * @namespace Settings object which contains customisable information for altEditor instance + */ + this.s = { + /** @type {DataTable.Api} DataTables' API instance */ + dt: new DataTable.Api(dt), + + /** @type {String} Unique namespace for events attached to the document */ + namespace: '.altEditor' + (_instance++) + }; + + + /** + * @namespace Common and useful DOM elements for the class instance + */ + this.dom = { + /** @type {jQuery} altEditor handle */ + modal: $('
'), + }; + + + /* Constructor logic */ + this._constructor(); + } + + + + $.extend(altEditor.prototype, { + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Constructor + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + + /** + * Initialise the RowReorder instance + * + * @private + */ + _constructor: function() { + // console.log('altEditor Enabled') + var that = this; + var dt = this.s.dt; + + this._setup(); + + dt.on('destroy.altEditor', function() { + dt.off('.altEditor'); + $(dt.table().body()).off(that.s.namespace); + $(document.body).off(that.s.namespace); + }); + }, + + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Private methods + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + + /** + * Setup dom and bind button actions + * + * @private + */ + _setup: function() { + // console.log('Setup'); + + var that = this; + var dt = this.s.dt; + + // add modal + $('body').append('\ + '); + + + // add Edit Button + if (this.s.dt.button('edit:name')) { + this.s.dt.button('edit:name').action(function(e, dt, node, config) { + var rows = dt.rows({ + selected: true + }).count(); + + that._openEditModal(); + }); + + $(document).on('click', '#editRowBtn', function(e) { + e.preventDefault(); + e.stopPropagation(); + that._editRowData(); + }); + + } + + // add Delete Button + if (this.s.dt.button('delete:name')) { + this.s.dt.button('delete:name').action(function(e, dt, node, config) { + var rows = dt.rows({ + selected: true + }).count(); + + that._openDeleteModal(); + }); + + $(document).on('click', '#deleteRowBtn', function(e) { + e.preventDefault(); + e.stopPropagation(); + that._deleteRow(); + }); + } + + // add Add Button + if (this.s.dt.button('add:name')) { + this.s.dt.button('add:name').action(function(e, dt, node, config) { + var rows = dt.rows({ + selected: true + }).count(); + + that._openAddModal(); + }); + + $(document).on('click', '#addRowBtn', function(e) { + e.preventDefault(); + e.stopPropagation(); + that._addRowData(); + }); + } + + }, + + /** + * Emit an event on the DataTable for listeners + * + * @param {string} name Event name + * @param {array} args Event arguments + * @private + */ + _emitEvent: function(name, args) { + this.s.dt.iterator('table', function(ctx, i) { + $(ctx.nTable).triggerHandler(name + '.dt', args); + }); + }, + + /** + * Open Edit Modal for selected row + * + * @private + */ + _openEditModal: function() { + var that = this; + var dt = this.s.dt; + + var columnDefs = []; + + for (var i = 0; i < dt.context[0].aoColumns.length; i++) { + columnDefs.push({ + title: dt.context[0].aoColumns[i].sTitle, + dataType: dt.context[0].aoColumns[i].dataType, + isPrimary: dt.context[0].aoColumns[i].isPrimary, + }) + } + + var adata = dt.rows({ + selected: true + }); + + + var data = ""; + + data += "
"; + + for (var j in columnDefs) { + var cellData = adata.data()[0][j]; + var inputSectionHTML = "
__INPUT_HTML__
"; + + var inputHTML = "
"; + + var option1Checked = ""; + var option2Checked = "checked"; + if (cellData.dataType == "boolean") { + if(cellData.value) { + option1Checked = "checked"; + option2Checked = ""; + } + inputHTML = "
" + } + //set input type + var inputType = "text"; + var inputReadOnlyAttribute = ""; + switch (cellData.dataType) { + case 'integer': + inputType = "number"; + break; + case 'real': + inputType = "number"; + break; + case 'boolean': + inputType = "checkbox"; + break; + } + //set input to read-only if it is a primary key + if (columnDefs[j].isPrimary) { + inputReadOnlyAttribute = "readonly" + } + + //append input html + inputSectionHTML = inputSectionHTML.replace(/__INPUT_HTML__/g, inputHTML); + inputSectionHTML = inputSectionHTML.replace(/__INPUT_READ_ONLY_ATTRIBUTE__/g, inputReadOnlyAttribute); + inputSectionHTML = inputSectionHTML.replace(/__INPUT_TYPE__/g, inputType); + inputSectionHTML = inputSectionHTML.replace(/__INPUT_DATA_TYPE__/g, cellData.dataType); + inputSectionHTML = inputSectionHTML.replace(/__INPUT_VALUE__/g, cellData.value); + inputSectionHTML = inputSectionHTML.replace(/__INPUT_NAME__/g, columnDefs[j].title); + inputSectionHTML = inputSectionHTML.replace(/__OPTION_1_CHECKED__/g, option1Checked); + inputSectionHTML = inputSectionHTML.replace(/__OPTION_2_CHECKED__/g, option2Checked); + data += inputSectionHTML; + } + data += "
"; + + + $('#altEditor-modal').on('show.bs.modal', function() { + $('#altEditor-modal').find('.modal-title').html('Edit Record'); + $('#altEditor-modal').find('.modal-body').html('
' + data + '
'); + $('#altEditor-modal').find('.modal-footer').html("\ + "); + }); + + $('#altEditor-modal').modal('show'); + $('#altEditor-modal input[0]').focus(); + + }, + + _editRowData: function() { + var that = this; + var dt = this.s.dt; + + var data = []; + + $('form[name="altEditor-form"] input').each(function(i) { + var addToList = true; + var value = $(this).val(); + if($(this).attr('type') == "radio" && $(this).prop('checked') == false) { + addToList = false; + } + value = $(this).attr('type') == "radio" ? $(this).val() == "1" : value; + if (addToList){ + data.push({ + "value": value, + "dataType": $(this).attr('data-type') + }); + } + }); + var editButtonCurrentText = $("#editRowBtn").text(); + $("#editRowBtn").addClass('disabled'); + $("#editRowBtn").text("Saving.."); + that._emitEvent("update-row", [ + JSON.stringify(data), + function(isUpdated) { + //remove existing alert elements + $('#altEditor-modal .modal-body .alert').remove(); + + //set error message and other properties based on whether update is successfull or not + var alertAdditionClasses = "alert-success"; + var alertMessage = "This record has been updated"; + var alertHeading = "Success"; + if (!isUpdated) { + alertAdditionClasses = "alert-danger"; + alertMessage = "Error occured while updating this record"; + alertHeading = "Error"; + } + + //create alert element html and append it to modal + var messageHTML = '\ + \ + '; + messageHTML = messageHTML.replace(/__ALERT_ADDITION_CLASSES__/g, alertAdditionClasses); + messageHTML = messageHTML.replace(/__ALERT_HEADING__/g, alertHeading); + messageHTML = messageHTML.replace(/__ALERT_MESSAGE__/g, alertMessage); + $('#altEditor-modal .modal-body').append(messageHTML); + + //update datatable, if update is successfull + if (isUpdated) { + dt.row({ + selected: true + }).data(data); + } + $("#editRowBtn").removeClass('disabled'); + $("#editRowBtn").text(editButtonCurrentText); + } + ]); + }, + + + /** + * Open Delete Modal for selected row + * + * @private + */ + _openDeleteModal: function() { + var that = this; + var dt = this.s.dt; + + var columnDefs = []; + + for (var i = 0; i < dt.context[0].aoColumns.length; i++) { + columnDefs.push({ + title: dt.context[0].aoColumns[i].sTitle + }) + } + + var adata = dt.rows({ + selected: true + }); + + var data = ""; + + data += "
"; + for (var i in columnDefs) { + + data += "
" + adata.data()[0][i] + "
"; + + } + data += "
"; + + $('#altEditor-modal').on('show.bs.modal', function() { + $('#altEditor-modal').find('.modal-title').html('Delete Record'); + $('#altEditor-modal').find('.modal-body').html('
' + data + '
'); + $('#altEditor-modal').find('.modal-footer').html("\ + "); + }); + + $('#altEditor-modal').modal('show'); + $('#altEditor-modal input[0]').focus(); + + }, + + _deleteRow: function() { + var that = this; + var dt = this.s.dt; + + $('#altEditor-modal .modal-body .alert').remove(); + + var message = ''; + + $('#altEditor-modal .modal-body').append(message); + + dt.row({ + selected: true + }).remove(); + + dt.draw(); + + }, + + + /** + * Open Add Modal for selected row + * + * @private + */ + _openAddModal: function() { + var that = this; + var dt = this.s.dt; + + var columnDefs = []; + + for (var i = 0; i < dt.context[0].aoColumns.length; i++) { + columnDefs.push({ + title: dt.context[0].aoColumns[i].sTitle + }) + } + + + var data = ""; + + data += "
"; + + for (var j in columnDefs) { + data += "
"; + + } + data += "
"; + + + $('#altEditor-modal').on('show.bs.modal', function() { + $('#altEditor-modal').find('.modal-title').html('Add Record'); + $('#altEditor-modal').find('.modal-body').html('
' + data + '
'); + $('#altEditor-modal').find('.modal-footer').html("\ + "); + }); + + $('#altEditor-modal').modal('show'); + $('#altEditor-modal input[0]').focus(); + }, + + _addRowData: function() { + console.log('add row') + var that = this; + var dt = this.s.dt; + + var data = []; + + $('form[name="altEditor-form"] input').each(function(i) { + data.push($(this).val()); + }); + + $('#altEditor-modal .modal-body .alert').remove(); + + var message = ''; + + $('#altEditor-modal .modal-body').append(message); + + dt.row.add(data).draw(false); + + }, + + _getExecutionLocationFolder: function() { + var fileName = "dataTables.altEditor.js"; + var scriptList = $("script[src]"); + var jsFileObject = $.grep(scriptList, function(el) { + + if (el.src.indexOf(fileName) !== -1) { + return el; + } + }); + var jsFilePath = jsFileObject[0].src; + var jsFileDirectory = jsFilePath.substring(0, jsFilePath.lastIndexOf("/") + 1); + return jsFileDirectory; + } + }); + + + + /** + * altEditor version + * + * @static + * @type String + */ + altEditor.version = '1.0'; + + + /** + * altEditor defaults + * + * @namespace + */ + altEditor.defaults = { + /** @type {Boolean} Ask user what they want to do, even for a single option */ + alwaysAsk: false, + + /** @type {string|null} What will trigger a focus */ + focus: null, // focus, click, hover + + /** @type {column-selector} Columns to provide auto fill for */ + columns: '', // all + + /** @type {boolean|null} Update the cells after a drag */ + update: null, // false is editor given, true otherwise + + /** @type {DataTable.Editor} Editor instance for automatic submission */ + editor: null + }; + + + /** + * Classes used by altEditor that are configurable + * + * @namespace + */ + altEditor.classes = { + /** @type {String} Class used by the selection button */ + btn: 'btn' + }; + + + // Attach a listener to the document which listens for DataTables initialisation + // events so we can automatically initialise + $(document).on('preInit.dt.altEditor', function(e, settings, json) { + if (e.namespace !== 'dt') { + return; + } + + var init = settings.oInit.altEditor; + var defaults = DataTable.defaults.altEditor; + + if (init || defaults) { + var opts = $.extend({}, init, defaults); + + if (init !== false) { + new altEditor(settings, opts); + } + } + }); + + + // Alias for access + DataTable.altEditor = altEditor; + + return altEditor; +})); \ No newline at end of file diff --git a/debug-db/src/main/assets/index.html b/debug-db/src/main/assets/index.html index a2593c0..4e6cd3b 100644 --- a/debug-db/src/main/assets/index.html +++ b/debug-db/src/main/assets/index.html @@ -27,10 +27,20 @@ + + + + + + + + + + diff --git a/debug-db/src/main/java/com/amitshekhar/server/ClientServer.java b/debug-db/src/main/java/com/amitshekhar/server/ClientServer.java index fe0be60..76f66cd 100644 --- a/debug-db/src/main/java/com/amitshekhar/server/ClientServer.java +++ b/debug-db/src/main/java/com/amitshekhar/server/ClientServer.java @@ -29,12 +29,14 @@ import android.content.res.AssetManager; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; +import android.net.Uri; import android.text.TextUtils; import android.util.Log; import com.amitshekhar.model.Response; import com.amitshekhar.model.TableDataResponse; import com.amitshekhar.model.TableDataResponse.ColumnData; +import com.amitshekhar.model.UpdateRowResponse; import com.amitshekhar.utils.Constants; import com.amitshekhar.utils.DataType; import com.amitshekhar.utils.PrefUtils; @@ -250,6 +252,15 @@ private void handle(Socket socket) throws IOException { bytes = data.getBytes(); } else if (route.startsWith("downloadDb")) { bytes = getDatabaseFile(); + } else if (route.startsWith("updateTableData")) { + + Uri uri = Uri.parse(URLDecoder.decode(route, "UTF-8")); + String tableName = uri.getQueryParameter("tableName"); + String updatedData = uri.getQueryParameter("updatedData"); + + UpdateRowResponse response = QueryExecutor.updateRow(mDatabase, tableName, updatedData); + String data = mGson.toJson(response); + bytes = data.getBytes(); } else { bytes = loadContent(route); } diff --git a/debug-db/src/main/java/com/amitshekhar/utils/QueryExecutor.java b/debug-db/src/main/java/com/amitshekhar/utils/QueryExecutor.java index d56b60a..8bcc546 100644 --- a/debug-db/src/main/java/com/amitshekhar/utils/QueryExecutor.java +++ b/debug-db/src/main/java/com/amitshekhar/utils/QueryExecutor.java @@ -194,7 +194,7 @@ public static UpdateRowResponse updateRow(SQLiteDatabase db, String tableName, S } else { switch (rowDataRequest.dataType) { case DataType.INTEGER: - contentValues.put(rowDataRequest.title, Integer.valueOf(rowDataRequest.value)); + contentValues.put(rowDataRequest.title, Long.valueOf(rowDataRequest.value)); break; case DataType.REAL: contentValues.put(rowDataRequest.title, Double.valueOf(rowDataRequest.value)); From d11b725be543acf31ea582d8636ca12f28642b3a Mon Sep 17 00:00:00 2001 From: AMIT SHEKHAR Date: Sun, 5 Feb 2017 12:30:14 +0530 Subject: [PATCH 11/50] Correct spell --- debug-db/src/main/assets/dataTables.altEditor.free.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debug-db/src/main/assets/dataTables.altEditor.free.js b/debug-db/src/main/assets/dataTables.altEditor.free.js index 891aef9..af02dc6 100644 --- a/debug-db/src/main/assets/dataTables.altEditor.free.js +++ b/debug-db/src/main/assets/dataTables.altEditor.free.js @@ -345,7 +345,7 @@ var alertHeading = "Success"; if (!isUpdated) { alertAdditionClasses = "alert-danger"; - alertMessage = "Error occured while updating this record"; + alertMessage = "Error occurred while updating this record"; alertHeading = "Error"; } From 93e6a66ecc8f67f651d887a364d0a4442be479f3 Mon Sep 17 00:00:00 2001 From: AMIT SHEKHAR Date: Mon, 6 Feb 2017 14:20:06 +0530 Subject: [PATCH 12/50] Modification : Standard code for finding all databases --- .../com/amitshekhar/server/ClientServer.java | 23 ++++----- .../utils/DatabaseFileProvider.java | 48 +++++++++++++++++++ 2 files changed, 57 insertions(+), 14 deletions(-) create mode 100644 debug-db/src/main/java/com/amitshekhar/utils/DatabaseFileProvider.java diff --git a/debug-db/src/main/java/com/amitshekhar/server/ClientServer.java b/debug-db/src/main/java/com/amitshekhar/server/ClientServer.java index 76f66cd..8309ff6 100644 --- a/debug-db/src/main/java/com/amitshekhar/server/ClientServer.java +++ b/debug-db/src/main/java/com/amitshekhar/server/ClientServer.java @@ -39,6 +39,7 @@ import com.amitshekhar.model.UpdateRowResponse; import com.amitshekhar.utils.Constants; import com.amitshekhar.utils.DataType; +import com.amitshekhar.utils.DatabaseFileProvider; import com.amitshekhar.utils.PrefUtils; import com.amitshekhar.utils.QueryExecutor; import com.google.gson.Gson; @@ -57,7 +58,7 @@ import java.net.SocketException; import java.net.URLDecoder; import java.util.ArrayList; -import java.util.Collections; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Set; @@ -89,9 +90,9 @@ public class ClientServer implements Runnable { private Context mContext; private SQLiteDatabase mDatabase; - private File mDatabaseDir; private Gson mGson; private boolean isDbOpenned; + HashMap databaseFiles; /** * Hold the selected database name @@ -106,7 +107,6 @@ public ClientServer(Context context, int port) { mAssets = context.getResources().getAssets(); mContext = context; mGson = new Gson(); - getDatabaseDir(); } /** @@ -194,7 +194,7 @@ private void handle(Socket socket) throws IOException { if (isDbOpenned) { String sql = "SELECT * FROM " + tableName; - response = QueryExecutor.getTableData(mDatabase,sql,tableName); + response = QueryExecutor.getTableData(mDatabase, sql, tableName); } else { response = getAllPrefData(tableName); } @@ -356,7 +356,7 @@ private byte[] getDatabaseFile() { return null; } - File file = new File(mDatabaseDir, mSelectedDatabase); + File file = databaseFiles.get(mSelectedDatabase); byte[] byteArray = null; try { @@ -377,11 +377,6 @@ private byte[] getDatabaseFile() { return byteArray; } - private void getDatabaseDir() { - File root = mContext.getFilesDir().getParentFile(); - File dbRoot = new File(root, "/databases"); - mDatabaseDir = dbRoot; - } private void openDatabase(String database) { mDatabase = mContext.openOrCreateDatabase(database, 0, null); @@ -477,11 +472,11 @@ private TableDataResponse query(String sql) { } public Response getDBList() { + databaseFiles = DatabaseFileProvider.getDatabaseFiles(mContext); Response response = new Response(); - if (mDatabaseDir != null && mDatabaseDir.list() != null) { - String[] list = mDatabaseDir.list(); - if (list != null) { - Collections.addAll(response.rows, list); + if (databaseFiles != null) { + for (HashMap.Entry entry : databaseFiles.entrySet()) { + response.rows.add(entry.getKey()); } } response.rows.add(Constants.APP_SHARED_PREFERENCES); diff --git a/debug-db/src/main/java/com/amitshekhar/utils/DatabaseFileProvider.java b/debug-db/src/main/java/com/amitshekhar/utils/DatabaseFileProvider.java new file mode 100644 index 0000000..ddf1159 --- /dev/null +++ b/debug-db/src/main/java/com/amitshekhar/utils/DatabaseFileProvider.java @@ -0,0 +1,48 @@ +/* + * + * * Copyright (C) 2016 Amit Shekhar + * * Copyright (C) 2011 Android Open Source Project + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * http://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package com.amitshekhar.utils; + +import android.content.Context; + +import java.io.File; +import java.util.HashMap; + +/** + * Created by amitshekhar on 06/02/17. + */ + +public class DatabaseFileProvider { + + private DatabaseFileProvider() { + // This class in not publicly instantiable + } + + public static HashMap getDatabaseFiles(Context context) { + HashMap databaseFiles = new HashMap<>(); + try { + for (String databaseName : context.databaseList()) { + databaseFiles.put(databaseName, context.getDatabasePath(databaseName)); + } + } catch (Exception e) { + e.printStackTrace(); + } + return databaseFiles; + } +} From b76f691c49d3c2a3250686065241917f4569afce Mon Sep 17 00:00:00 2001 From: AMIT SHEKHAR Date: Mon, 6 Feb 2017 14:57:59 +0530 Subject: [PATCH 13/50] Add one more database for debugging and change dataType from float to double --- .../main/java/com/sample/MainActivity.java | 11 ++ .../java/com/sample/database/CarDBHelper.java | 128 ++++++++++++++++++ .../com/sample/database/ContactDBHelper.java | 8 +- .../com/amitshekhar/server/ClientServer.java | 10 +- .../com/amitshekhar/utils/QueryExecutor.java | 2 +- 5 files changed, 149 insertions(+), 10 deletions(-) create mode 100644 app/src/main/java/com/sample/database/CarDBHelper.java diff --git a/app/src/main/java/com/sample/MainActivity.java b/app/src/main/java/com/sample/MainActivity.java index cf9bd44..5f2ffc3 100644 --- a/app/src/main/java/com/sample/MainActivity.java +++ b/app/src/main/java/com/sample/MainActivity.java @@ -26,6 +26,7 @@ import android.preference.PreferenceManager; import android.support.v7.app.AppCompatActivity; +import com.sample.database.CarDBHelper; import com.sample.database.ContactDBHelper; import java.util.HashSet; @@ -73,5 +74,15 @@ protected void onCreate(Bundle savedInstanceState) { contactDBHelper.insertContact(name, phone, email, street, place); } } + + CarDBHelper carDBHelper = new CarDBHelper(getApplicationContext()); + if (carDBHelper.count() == 0) { + for (int i = 0; i < 50; i++) { + String name = "name_" + i; + String color = "RED"; + float mileage = i + 10.45f; + carDBHelper.insertCar(name, color, mileage); + } + } } } diff --git a/app/src/main/java/com/sample/database/CarDBHelper.java b/app/src/main/java/com/sample/database/CarDBHelper.java new file mode 100644 index 0000000..ff14954 --- /dev/null +++ b/app/src/main/java/com/sample/database/CarDBHelper.java @@ -0,0 +1,128 @@ +/* + * + * * Copyright (C) 2016 Amit Shekhar + * * Copyright (C) 2011 Android Open Source Project + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * http://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package com.sample.database; + +import android.content.ContentValues; +import android.content.Context; +import android.database.Cursor; +import android.database.DatabaseUtils; +import android.database.sqlite.SQLiteDatabase; +import android.database.sqlite.SQLiteOpenHelper; + +import java.util.ArrayList; + +/** + * Created by amitshekhar on 06/02/17. + */ + +public class CarDBHelper extends SQLiteOpenHelper { + + public static final String DATABASE_NAME = "Car.db"; + public static final String CARS_TABLE_NAME = "cars"; + public static final String CARS_COLUMN_ID = "id"; + public static final String CARS_COLUMN_NAME = "name"; + public static final String CARS_COLUMN_COLOR = "color"; + public static final String CCARS_COLUMN_MILEAGE = "mileage"; + + public CarDBHelper(Context context) { + super(context, DATABASE_NAME, null, 1); + } + + @Override + public void onCreate(SQLiteDatabase db) { + // TODO Auto-generated method stub + db.execSQL( + "create table cars " + + "(id integer primary key, name text, color text, mileage real)" + ); + } + + @Override + public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { + // TODO Auto-generated method stub + db.execSQL("DROP TABLE IF EXISTS cars"); + onCreate(db); + } + + public boolean insertCar(String name, String color, float mileage) { + SQLiteDatabase db = this.getWritableDatabase(); + ContentValues contentValues = new ContentValues(); + contentValues.put("name", name); + contentValues.put("color", color); + contentValues.put("mileage", mileage); + db.insert("cars", null, contentValues); + return true; + } + + public Cursor getData(int id) { + SQLiteDatabase db = this.getReadableDatabase(); + Cursor res = db.rawQuery("select * from cars where id=" + id + "", null); + return res; + } + + public int numberOfRows() { + SQLiteDatabase db = this.getReadableDatabase(); + int numRows = (int) DatabaseUtils.queryNumEntries(db, CARS_TABLE_NAME); + return numRows; + } + + public boolean updateCar(Integer id, String name, String color, float mileage) { + SQLiteDatabase db = this.getWritableDatabase(); + ContentValues contentValues = new ContentValues(); + contentValues.put("name", name); + contentValues.put("color", color); + contentValues.put("mileage", mileage); + db.update("cars", contentValues, "id = ? ", new String[]{Integer.toString(id)}); + return true; + } + + public Integer deleteCar(Integer id) { + SQLiteDatabase db = this.getWritableDatabase(); + return db.delete("cars", + "id = ? ", + new String[]{Integer.toString(id)}); + } + + public ArrayList getAllCars() { + ArrayList arrayList = new ArrayList<>(); + + //hp = new HashMap(); + SQLiteDatabase db = this.getReadableDatabase(); + Cursor res = db.rawQuery("select * from cars", null); + res.moveToFirst(); + + while (res.isAfterLast() == false) { + arrayList.add(res.getString(res.getColumnIndex(CARS_COLUMN_NAME))); + res.moveToNext(); + } + return arrayList; + } + + public int count() { + SQLiteDatabase db = getReadableDatabase(); + Cursor cursor = db.rawQuery("select * from cars", null); + if (cursor != null && cursor.getCount() > 0) { + cursor.moveToFirst(); + return cursor.getInt(0); + } else { + return 0; + } + } +} \ No newline at end of file diff --git a/app/src/main/java/com/sample/database/ContactDBHelper.java b/app/src/main/java/com/sample/database/ContactDBHelper.java index 22108e7..1a8fe4f 100644 --- a/app/src/main/java/com/sample/database/ContactDBHelper.java +++ b/app/src/main/java/com/sample/database/ContactDBHelper.java @@ -53,7 +53,7 @@ public void onCreate(SQLiteDatabase db) { // TODO Auto-generated method stub db.execSQL( "create table contacts " + - "(id integer primary key, name text,phone text,email text, street text,place text, createdAt integer)" + "(id integer primary key, name text, phone text, email text, street text, place text, createdAt integer)" ); } @@ -109,7 +109,7 @@ public Integer deleteContact(Integer id) { } public ArrayList getAllCotacts() { - ArrayList array_list = new ArrayList(); + ArrayList arrayList = new ArrayList<>(); //hp = new HashMap(); SQLiteDatabase db = this.getReadableDatabase(); @@ -117,10 +117,10 @@ public ArrayList getAllCotacts() { res.moveToFirst(); while (res.isAfterLast() == false) { - array_list.add(res.getString(res.getColumnIndex(CONTACTS_COLUMN_NAME))); + arrayList.add(res.getString(res.getColumnIndex(CONTACTS_COLUMN_NAME))); res.moveToNext(); } - return array_list; + return arrayList; } public int count() { diff --git a/debug-db/src/main/java/com/amitshekhar/server/ClientServer.java b/debug-db/src/main/java/com/amitshekhar/server/ClientServer.java index 8309ff6..33122cd 100644 --- a/debug-db/src/main/java/com/amitshekhar/server/ClientServer.java +++ b/debug-db/src/main/java/com/amitshekhar/server/ClientServer.java @@ -91,7 +91,7 @@ public class ClientServer implements Runnable { private Context mContext; private SQLiteDatabase mDatabase; private Gson mGson; - private boolean isDbOpenned; + private boolean isDbOpened; HashMap databaseFiles; /** @@ -192,7 +192,7 @@ private void handle(Socket socket) throws IOException { TableDataResponse response = null; - if (isDbOpenned) { + if (isDbOpened) { String sql = "SELECT * FROM " + tableName; response = QueryExecutor.getTableData(mDatabase, sql, tableName); } else { @@ -380,12 +380,12 @@ private byte[] getDatabaseFile() { private void openDatabase(String database) { mDatabase = mContext.openOrCreateDatabase(database, 0, null); - isDbOpenned = true; + isDbOpened = true; } private void closeDatabase() { mDatabase = null; - isDbOpenned = false; + isDbOpened = false; } private Response exec(String sql) { @@ -441,7 +441,7 @@ private TableDataResponse query(String sql) { break; case Cursor.FIELD_TYPE_FLOAT: columnData.dataType = DataType.REAL; - columnData.value = cursor.getFloat(i); + columnData.value = cursor.getDouble(i); break; case Cursor.FIELD_TYPE_INTEGER: columnData.dataType = DataType.INTEGER; diff --git a/debug-db/src/main/java/com/amitshekhar/utils/QueryExecutor.java b/debug-db/src/main/java/com/amitshekhar/utils/QueryExecutor.java index 8bcc546..5ec5f2e 100644 --- a/debug-db/src/main/java/com/amitshekhar/utils/QueryExecutor.java +++ b/debug-db/src/main/java/com/amitshekhar/utils/QueryExecutor.java @@ -90,7 +90,7 @@ public static TableDataResponse getTableData(SQLiteDatabase db, String selectQue break; case Cursor.FIELD_TYPE_FLOAT: columnData.dataType = DataType.REAL; - columnData.value = cursor.getFloat(i); + columnData.value = cursor.getDouble(i); break; case Cursor.FIELD_TYPE_INTEGER: columnData.dataType = DataType.INTEGER; From 45e540cd36ce27ee8b20f302d20349a3e1983b45 Mon Sep 17 00:00:00 2001 From: AMIT SHEKHAR Date: Mon, 6 Feb 2017 15:12:20 +0530 Subject: [PATCH 14/50] Code refactor : Add PrefHelper and DatabaseHelper --- .../com/amitshekhar/server/ClientServer.java | 99 +------------ ...QueryExecutor.java => DatabaseHelper.java} | 39 +++-- .../com/amitshekhar/utils/PrefHelper.java | 137 ++++++++++++++++++ .../java/com/amitshekhar/utils/PrefUtils.java | 60 -------- 4 files changed, 173 insertions(+), 162 deletions(-) rename debug-db/src/main/java/com/amitshekhar/utils/{QueryExecutor.java => DatabaseHelper.java} (86%) create mode 100644 debug-db/src/main/java/com/amitshekhar/utils/PrefHelper.java delete mode 100644 debug-db/src/main/java/com/amitshekhar/utils/PrefUtils.java diff --git a/debug-db/src/main/java/com/amitshekhar/server/ClientServer.java b/debug-db/src/main/java/com/amitshekhar/server/ClientServer.java index 33122cd..98052fc 100644 --- a/debug-db/src/main/java/com/amitshekhar/server/ClientServer.java +++ b/debug-db/src/main/java/com/amitshekhar/server/ClientServer.java @@ -25,7 +25,6 @@ import android.content.Context; -import android.content.SharedPreferences; import android.content.res.AssetManager; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; @@ -40,8 +39,8 @@ import com.amitshekhar.utils.Constants; import com.amitshekhar.utils.DataType; import com.amitshekhar.utils.DatabaseFileProvider; -import com.amitshekhar.utils.PrefUtils; -import com.amitshekhar.utils.QueryExecutor; +import com.amitshekhar.utils.DatabaseHelper; +import com.amitshekhar.utils.PrefHelper; import com.google.gson.Gson; import java.io.BufferedReader; @@ -60,8 +59,6 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; -import java.util.Map; -import java.util.Set; public class ClientServer implements Runnable { @@ -194,9 +191,9 @@ private void handle(Socket socket) throws IOException { if (isDbOpened) { String sql = "SELECT * FROM " + tableName; - response = QueryExecutor.getTableData(mDatabase, sql, tableName); + response = DatabaseHelper.getTableData(mDatabase, sql, tableName); } else { - response = getAllPrefData(tableName); + response = PrefHelper.getAllPrefData(mContext, tableName); } String data = mGson.toJson(response); @@ -239,12 +236,12 @@ private void handle(Socket socket) throws IOException { Response response; if (Constants.APP_SHARED_PREFERENCES.equals(database)) { - response = getAllPrefTableName(); + response = PrefHelper.getAllPrefTableName(mContext); closeDatabase(); mSelectedDatabase = null; } else { openDatabase(database); - response = getAllTableName(); + response = DatabaseHelper.getAllTableName(mDatabase); mSelectedDatabase = database; } @@ -258,7 +255,7 @@ private void handle(Socket socket) throws IOException { String tableName = uri.getQueryParameter("tableName"); String updatedData = uri.getQueryParameter("updatedData"); - UpdateRowResponse response = QueryExecutor.updateRow(mDatabase, tableName, updatedData); + UpdateRowResponse response = DatabaseHelper.updateRow(mDatabase, tableName, updatedData); String data = mGson.toJson(response); bytes = data.getBytes(); } else { @@ -484,87 +481,5 @@ public Response getDBList() { return response; } - public Response getAllTableName() { - Response response = new Response(); - Cursor c = mDatabase.rawQuery("SELECT name FROM sqlite_master WHERE type='table'", null); - if (c.moveToFirst()) { - while (!c.isAfterLast()) { - response.rows.add(c.getString(0)); - c.moveToNext(); - } - } - c.close(); - response.isSuccessful = true; - try { - response.dbVersion = mDatabase.getVersion(); - } catch (Exception ignore) { - - } - return response; - } - - public Response getAllPrefTableName() { - Response response = new Response(); - List prefTags = PrefUtils.getSharedPreferenceTags(mContext); - - for (String tag : prefTags) { - response.rows.add(tag); - } - response.isSuccessful = true; - return response; - } - - public TableDataResponse getAllPrefData(String tag) { - TableDataResponse response = new TableDataResponse(); - response.isSuccessful = true; - - TableDataResponse.TableInfo keyInfo = new TableDataResponse.TableInfo(); - keyInfo.isPrimary = true; - keyInfo.title = "Key"; - - TableDataResponse.TableInfo valueInfo = new TableDataResponse.TableInfo(); - valueInfo.isPrimary = false; - valueInfo.title = "Value"; - - response.tableInfos = new ArrayList<>(); - response.tableInfos.add(keyInfo); - response.tableInfos.add(valueInfo); - - response.rows = new ArrayList<>(); - - SharedPreferences preferences = mContext.getSharedPreferences(tag, Context.MODE_PRIVATE); - Map allEntries = preferences.getAll(); - for (Map.Entry entry : allEntries.entrySet()) { - List row = new ArrayList<>(); - ColumnData keyColumnData = new ColumnData(); - keyColumnData.dataType = DataType.TEXT; - keyColumnData.value = entry.getKey(); - - row.add(keyColumnData); - - ColumnData valueColumnData = new ColumnData(); - valueColumnData.value = entry.getValue().toString(); - if (entry.getValue() != null) { - if (entry.getValue() instanceof String) { - valueColumnData.dataType = DataType.TEXT; - } else if (entry.getValue() instanceof Integer) { - valueColumnData.dataType = DataType.INTEGER; - } else if (entry.getValue() instanceof Long) { - valueColumnData.dataType = DataType.INTEGER; - } else if (entry.getValue() instanceof Float) { - valueColumnData.dataType = DataType.REAL; - } else if (entry.getValue() instanceof Boolean) { - valueColumnData.dataType = DataType.BOOLEAN; - } else if (entry.getValue() instanceof Set) { - valueColumnData.dataType = DataType.TEXT; - } - } else { - valueColumnData.dataType = DataType.TEXT; - } - row.add(valueColumnData); - response.rows.add(row); - } - return response; - } } diff --git a/debug-db/src/main/java/com/amitshekhar/utils/QueryExecutor.java b/debug-db/src/main/java/com/amitshekhar/utils/DatabaseHelper.java similarity index 86% rename from debug-db/src/main/java/com/amitshekhar/utils/QueryExecutor.java rename to debug-db/src/main/java/com/amitshekhar/utils/DatabaseHelper.java index 5ec5f2e..64f0ee4 100644 --- a/debug-db/src/main/java/com/amitshekhar/utils/QueryExecutor.java +++ b/debug-db/src/main/java/com/amitshekhar/utils/DatabaseHelper.java @@ -23,11 +23,10 @@ import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; +import com.amitshekhar.model.Response; import com.amitshekhar.model.RowDataRequest; import com.amitshekhar.model.TableDataResponse; -import com.amitshekhar.model.TableDataResponse.TableInfo; import com.amitshekhar.model.UpdateRowResponse; -import com.amitshekhar.model.TableDataResponse.ColumnData; import com.google.gson.Gson; import com.google.gson.reflect.TypeToken; @@ -35,17 +34,36 @@ import java.util.List; /** - * Created by amitshekhar on 04/02/17. + * Created by amitshekhar on 06/02/17. */ -public class QueryExecutor { +public class DatabaseHelper { public static final Gson gson = new Gson(); - private QueryExecutor() { + private DatabaseHelper() { // This class in not publicly instantiable } + public static Response getAllTableName(SQLiteDatabase database) { + Response response = new Response(); + Cursor c = database.rawQuery("SELECT name FROM sqlite_master WHERE type='table'", null); + if (c.moveToFirst()) { + while (!c.isAfterLast()) { + response.rows.add(c.getString(0)); + c.moveToNext(); + } + } + c.close(); + response.isSuccessful = true; + try { + response.dbVersion = database.getVersion(); + } catch (Exception ignore) { + + } + return response; + } + public static TableDataResponse getTableData(SQLiteDatabase db, String selectQuery, String tableName) { TableDataResponse tableData = new TableDataResponse(); @@ -80,9 +98,9 @@ public static TableDataResponse getTableData(SQLiteDatabase db, String selectQue if (cursor.getCount() > 0) { do { - List row = new ArrayList<>(); + List row = new ArrayList<>(); for (int i = 0; i < cursor.getColumnCount(); i++) { - ColumnData columnData = new ColumnData(); + TableDataResponse.ColumnData columnData = new TableDataResponse.ColumnData(); switch (cursor.getType(i)) { case Cursor.FIELD_TYPE_BLOB: columnData.dataType = DataType.TEXT; @@ -120,7 +138,7 @@ public static TableDataResponse getTableData(SQLiteDatabase db, String selectQue } - public static List getTableInfo(SQLiteDatabase db, String pragmaQuery) { + public static List getTableInfo(SQLiteDatabase db, String pragmaQuery) { Cursor cursor; try { @@ -132,13 +150,13 @@ public static List getTableInfo(SQLiteDatabase db, String pragmaQuery if (cursor != null) { - List tableInfoList = new ArrayList<>(); + List tableInfoList = new ArrayList<>(); cursor.moveToFirst(); if (cursor.getCount() > 0) { do { - TableInfo tableInfo = new TableInfo(); + TableDataResponse.TableInfo tableInfo = new TableDataResponse.TableInfo(); for (int i = 0; i < cursor.getColumnCount(); i++) { @@ -226,4 +244,5 @@ public static UpdateRowResponse updateRow(SQLiteDatabase db, String tableName, S public static String getTableName(String selectQuery) { return null; } + } diff --git a/debug-db/src/main/java/com/amitshekhar/utils/PrefHelper.java b/debug-db/src/main/java/com/amitshekhar/utils/PrefHelper.java new file mode 100644 index 0000000..3fbe3b2 --- /dev/null +++ b/debug-db/src/main/java/com/amitshekhar/utils/PrefHelper.java @@ -0,0 +1,137 @@ +/* + * + * * Copyright (C) 2016 Amit Shekhar + * * Copyright (C) 2011 Android Open Source Project + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * http://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package com.amitshekhar.utils; + +import android.content.Context; +import android.content.SharedPreferences; + +import com.amitshekhar.model.Response; +import com.amitshekhar.model.TableDataResponse; + +import java.io.File; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * Created by amitshekhar on 06/02/17. + */ + +public class PrefHelper { + + private static final String PREFS_SUFFIX = ".xml"; + + private PrefHelper() { + // This class in not publicly instantiable + } + + public static List getSharedPreferenceTags(Context context) { + + ArrayList tags = new ArrayList<>(); + + String rootPath = context.getApplicationInfo().dataDir + "/shared_prefs"; + File root = new File(rootPath); + if (root.exists()) { + for (File file : root.listFiles()) { + String fileName = file.getName(); + if (fileName.endsWith(PREFS_SUFFIX)) { + tags.add(fileName.substring(0, fileName.length() - PREFS_SUFFIX.length())); + } + } + } + + Collections.sort(tags); + + return tags; + } + + public static Response getAllPrefTableName(Context context) { + + Response response = new Response(); + + List prefTags = getSharedPreferenceTags(context); + + for (String tag : prefTags) { + response.rows.add(tag); + } + + response.isSuccessful = true; + + return response; + } + + public static TableDataResponse getAllPrefData(Context context, String tag) { + + TableDataResponse response = new TableDataResponse(); + response.isSuccessful = true; + + TableDataResponse.TableInfo keyInfo = new TableDataResponse.TableInfo(); + keyInfo.isPrimary = true; + keyInfo.title = "Key"; + + TableDataResponse.TableInfo valueInfo = new TableDataResponse.TableInfo(); + valueInfo.isPrimary = false; + valueInfo.title = "Value"; + + response.tableInfos = new ArrayList<>(); + response.tableInfos.add(keyInfo); + response.tableInfos.add(valueInfo); + + response.rows = new ArrayList<>(); + + SharedPreferences preferences = context.getSharedPreferences(tag, Context.MODE_PRIVATE); + Map allEntries = preferences.getAll(); + for (Map.Entry entry : allEntries.entrySet()) { + List row = new ArrayList<>(); + TableDataResponse.ColumnData keyColumnData = new TableDataResponse.ColumnData(); + keyColumnData.dataType = DataType.TEXT; + keyColumnData.value = entry.getKey(); + + row.add(keyColumnData); + + TableDataResponse.ColumnData valueColumnData = new TableDataResponse.ColumnData(); + valueColumnData.value = entry.getValue().toString(); + if (entry.getValue() != null) { + if (entry.getValue() instanceof String) { + valueColumnData.dataType = DataType.TEXT; + } else if (entry.getValue() instanceof Integer) { + valueColumnData.dataType = DataType.INTEGER; + } else if (entry.getValue() instanceof Long) { + valueColumnData.dataType = DataType.INTEGER; + } else if (entry.getValue() instanceof Float) { + valueColumnData.dataType = DataType.REAL; + } else if (entry.getValue() instanceof Boolean) { + valueColumnData.dataType = DataType.BOOLEAN; + } else if (entry.getValue() instanceof Set) { + valueColumnData.dataType = DataType.TEXT; + } + } else { + valueColumnData.dataType = DataType.TEXT; + } + row.add(valueColumnData); + response.rows.add(row); + } + + return response; + + } +} diff --git a/debug-db/src/main/java/com/amitshekhar/utils/PrefUtils.java b/debug-db/src/main/java/com/amitshekhar/utils/PrefUtils.java deleted file mode 100644 index 70b2153..0000000 --- a/debug-db/src/main/java/com/amitshekhar/utils/PrefUtils.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * - * * Copyright (C) 2016 Amit Shekhar - * * Copyright (C) 2011 Android Open Source Project - * * - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * http://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * - */ - -package com.amitshekhar.utils; - -import android.content.Context; - -import java.io.File; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -/** - * Created by amitshekhar on 16/11/16. - */ - -public final class PrefUtils { - - private static final String PREFS_SUFFIX = ".xml"; - - private PrefUtils() { - // This class in not publicly instantiable - } - - public static List getSharedPreferenceTags(Context context) { - - ArrayList tags = new ArrayList<>(); - - String rootPath = context.getApplicationInfo().dataDir + "/shared_prefs"; - File root = new File(rootPath); - if (root.exists()) { - for (File file : root.listFiles()) { - String fileName = file.getName(); - if (fileName.endsWith(PREFS_SUFFIX)) { - tags.add(fileName.substring(0, fileName.length() - PREFS_SUFFIX.length())); - } - } - } - - Collections.sort(tags); - - return tags; - } -} From e3c915c9446a2c59a5633a2eb692ad87a8b7fce3 Mon Sep 17 00:00:00 2001 From: AMIT SHEKHAR Date: Mon, 6 Feb 2017 15:21:39 +0530 Subject: [PATCH 15/50] Add converter for blob to string --- .../com/amitshekhar/server/ClientServer.java | 3 +- .../com/amitshekhar/utils/ConverterUtils.java | 60 +++++++++++++++++++ .../com/amitshekhar/utils/DatabaseHelper.java | 2 +- 3 files changed, 63 insertions(+), 2 deletions(-) create mode 100644 debug-db/src/main/java/com/amitshekhar/utils/ConverterUtils.java diff --git a/debug-db/src/main/java/com/amitshekhar/server/ClientServer.java b/debug-db/src/main/java/com/amitshekhar/server/ClientServer.java index 98052fc..361bce0 100644 --- a/debug-db/src/main/java/com/amitshekhar/server/ClientServer.java +++ b/debug-db/src/main/java/com/amitshekhar/server/ClientServer.java @@ -37,6 +37,7 @@ import com.amitshekhar.model.TableDataResponse.ColumnData; import com.amitshekhar.model.UpdateRowResponse; import com.amitshekhar.utils.Constants; +import com.amitshekhar.utils.ConverterUtils; import com.amitshekhar.utils.DataType; import com.amitshekhar.utils.DatabaseFileProvider; import com.amitshekhar.utils.DatabaseHelper; @@ -434,7 +435,7 @@ private TableDataResponse query(String sql) { switch (cursor.getType(i)) { case Cursor.FIELD_TYPE_BLOB: columnData.dataType = DataType.TEXT; - columnData.value = cursor.getBlob(i); + columnData.value = ConverterUtils.blobToString(cursor.getBlob(i)); break; case Cursor.FIELD_TYPE_FLOAT: columnData.dataType = DataType.REAL; diff --git a/debug-db/src/main/java/com/amitshekhar/utils/ConverterUtils.java b/debug-db/src/main/java/com/amitshekhar/utils/ConverterUtils.java new file mode 100644 index 0000000..1a0aab7 --- /dev/null +++ b/debug-db/src/main/java/com/amitshekhar/utils/ConverterUtils.java @@ -0,0 +1,60 @@ +/* + * + * * Copyright (C) 2016 Amit Shekhar + * * Copyright (C) 2011 Android Open Source Project + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * http://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package com.amitshekhar.utils; + +import java.io.UnsupportedEncodingException; + +/** + * Created by amitshekhar on 06/02/17. + */ + +public class ConverterUtils { + + private static final int MAX_BLOB_LENGTH = 512; + + private static final String UNKNOWN_BLOB_LABEL = "{blob}"; + + private ConverterUtils() { + // This class in not publicly instantiable + } + + public static String blobToString(byte[] blob) { + if (blob.length <= MAX_BLOB_LENGTH) { + if (fastIsAscii(blob)) { + try { + return new String(blob, "US-ASCII"); + } catch (UnsupportedEncodingException ignored) { + + } + } + } + return UNKNOWN_BLOB_LABEL; + } + + public static boolean fastIsAscii(byte[] blob) { + for (byte b : blob) { + if ((b & ~0x7f) != 0) { + return false; + } + } + return true; + } + +} diff --git a/debug-db/src/main/java/com/amitshekhar/utils/DatabaseHelper.java b/debug-db/src/main/java/com/amitshekhar/utils/DatabaseHelper.java index 64f0ee4..25a2519 100644 --- a/debug-db/src/main/java/com/amitshekhar/utils/DatabaseHelper.java +++ b/debug-db/src/main/java/com/amitshekhar/utils/DatabaseHelper.java @@ -104,7 +104,7 @@ public static TableDataResponse getTableData(SQLiteDatabase db, String selectQue switch (cursor.getType(i)) { case Cursor.FIELD_TYPE_BLOB: columnData.dataType = DataType.TEXT; - columnData.value = cursor.getBlob(i); + columnData.value = ConverterUtils.blobToString(cursor.getBlob(i)); break; case Cursor.FIELD_TYPE_FLOAT: columnData.dataType = DataType.REAL; From 3050fb8d12e26e14a343918cbcbe542a9d462fcd Mon Sep 17 00:00:00 2001 From: AMIT SHEKHAR Date: Mon, 6 Feb 2017 16:11:00 +0530 Subject: [PATCH 16/50] Refactor Code --- .../com/amitshekhar/server/ClientServer.java | 201 ++---------------- .../com/amitshekhar/utils/DatabaseHelper.java | 83 ++++++++ .../java/com/amitshekhar/utils/Utils.java | 130 +++++++++++ 3 files changed, 232 insertions(+), 182 deletions(-) create mode 100644 debug-db/src/main/java/com/amitshekhar/utils/Utils.java diff --git a/debug-db/src/main/java/com/amitshekhar/server/ClientServer.java b/debug-db/src/main/java/com/amitshekhar/server/ClientServer.java index 361bce0..e5845bd 100644 --- a/debug-db/src/main/java/com/amitshekhar/server/ClientServer.java +++ b/debug-db/src/main/java/com/amitshekhar/server/ClientServer.java @@ -26,7 +26,6 @@ import android.content.Context; import android.content.res.AssetManager; -import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import android.net.Uri; import android.text.TextUtils; @@ -34,32 +33,24 @@ import com.amitshekhar.model.Response; import com.amitshekhar.model.TableDataResponse; -import com.amitshekhar.model.TableDataResponse.ColumnData; import com.amitshekhar.model.UpdateRowResponse; import com.amitshekhar.utils.Constants; -import com.amitshekhar.utils.ConverterUtils; -import com.amitshekhar.utils.DataType; import com.amitshekhar.utils.DatabaseFileProvider; import com.amitshekhar.utils.DatabaseHelper; import com.amitshekhar.utils.PrefHelper; +import com.amitshekhar.utils.Utils; import com.google.gson.Gson; import java.io.BufferedReader; -import java.io.ByteArrayOutputStream; import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; import java.io.IOException; -import java.io.InputStream; import java.io.InputStreamReader; import java.io.PrintStream; import java.net.ServerSocket; import java.net.Socket; import java.net.SocketException; import java.net.URLDecoder; -import java.util.ArrayList; import java.util.HashMap; -import java.util.List; public class ClientServer implements Runnable { @@ -90,7 +81,7 @@ public class ClientServer implements Runnable { private SQLiteDatabase mDatabase; private Gson mGson; private boolean isDbOpened; - HashMap databaseFiles; + private HashMap databaseFiles; /** * Hold the selected database name @@ -188,7 +179,7 @@ private void handle(Socket socket) throws IOException { tableName = route.substring(route.indexOf("=") + 1, route.length()); } - TableDataResponse response = null; + TableDataResponse response; if (isDbOpened) { String sql = "SELECT * FROM " + tableName; @@ -213,12 +204,12 @@ private void handle(Socket socket) throws IOException { String first = query.split(" ")[0].toLowerCase(); - String data = ""; + String data; if (first.equals("select")) { - TableDataResponse response = query(query); + TableDataResponse response = DatabaseHelper.query(mDatabase, query); data = mGson.toJson(response); } else { - Response response = exec(query); + Response response = DatabaseHelper.exec(mDatabase, query); data = mGson.toJson(response); } @@ -249,7 +240,7 @@ private void handle(Socket socket) throws IOException { String data = mGson.toJson(response); bytes = data.getBytes(); } else if (route.startsWith("downloadDb")) { - bytes = getDatabaseFile(); + bytes = Utils.getDatabase(mSelectedDatabase, databaseFiles); } else if (route.startsWith("updateTableData")) { Uri uri = Uri.parse(URLDecoder.decode(route, "UTF-8")); @@ -260,7 +251,7 @@ private void handle(Socket socket) throws IOException { String data = mGson.toJson(response); bytes = data.getBytes(); } else { - bytes = loadContent(route); + bytes = Utils.loadContent(route, mAssets); } @@ -271,7 +262,7 @@ private void handle(Socket socket) throws IOException { // Send out the content. output.println("HTTP/1.0 200 OK"); - output.println("Content-Type: " + detectMimeType(route)); + output.println("Content-Type: " + Utils.detectMimeType(route)); if (route.startsWith("downloadDb")) { output.println("Content-Disposition: attachment; filename=" + mSelectedDatabase); @@ -282,11 +273,15 @@ private void handle(Socket socket) throws IOException { output.write(bytes); output.flush(); } finally { - if (null != output) { - output.close(); - } - if (null != reader) { - reader.close(); + try { + if (null != output) { + output.close(); + } + if (null != reader) { + reader.close(); + } + } catch (Exception e) { + e.printStackTrace(); } } } @@ -301,80 +296,6 @@ private void writeServerError(PrintStream output) { output.flush(); } - /** - * Loads all the content of {@code fileName}. - * - * @param fileName The name of the file. - * @return The content of the file. - * @throws IOException - */ - private byte[] loadContent(String fileName) throws IOException { - InputStream input = null; - try { - ByteArrayOutputStream output = new ByteArrayOutputStream(); - input = mAssets.open(fileName); - byte[] buffer = new byte[1024]; - int size; - while (-1 != (size = input.read(buffer))) { - output.write(buffer, 0, size); - } - output.flush(); - return output.toByteArray(); - } catch (FileNotFoundException e) { - return null; - } finally { - if (null != input) { - input.close(); - } - } - } - - /** - * Detects the MIME type from the {@code fileName}. - * - * @param fileName The name of the file. - * @return A MIME type. - */ - private String detectMimeType(String fileName) { - if (TextUtils.isEmpty(fileName)) { - return null; - } else if (fileName.endsWith(".html")) { - return "text/html"; - } else if (fileName.endsWith(".js")) { - return "application/javascript"; - } else if (fileName.endsWith(".css")) { - return "text/css"; - } else { - return "application/octet-stream"; - } - } - - private byte[] getDatabaseFile() { - if (TextUtils.isEmpty(mSelectedDatabase)) { - return null; - } - - File file = databaseFiles.get(mSelectedDatabase); - - byte[] byteArray = null; - try { - InputStream inputStream = new FileInputStream(file); - ByteArrayOutputStream bos = new ByteArrayOutputStream(); - byte[] b = new byte[(int) file.length()]; - int bytesRead = 0; - - while ((bytesRead = inputStream.read(b)) != -1) { - bos.write(b, 0, bytesRead); - } - - byteArray = bos.toByteArray(); - } catch (IOException e) { - Log.e(TAG, "getDatabaseFile: ", e); - } - - return byteArray; - } - private void openDatabase(String database) { mDatabase = mContext.openOrCreateDatabase(database, 0, null); @@ -386,90 +307,7 @@ private void closeDatabase() { isDbOpened = false; } - private Response exec(String sql) { - Response response = new Response(); - try { - mDatabase.execSQL(sql); - } catch (Exception e) { - e.printStackTrace(); - response.isSuccessful = false; - response.error = e.getMessage(); - return response; - } - response.isSuccessful = true; - return response; - } - - private TableDataResponse query(String sql) { - Cursor cursor; - try { - cursor = mDatabase.rawQuery(sql, null); - } catch (Exception e) { - e.printStackTrace(); - TableDataResponse errorResponse = new TableDataResponse(); - errorResponse.isSuccessful = false; - errorResponse.errorMessage = e.getMessage(); - return errorResponse; - } - - if (cursor != null) { - cursor.moveToFirst(); - TableDataResponse response = new TableDataResponse(); - response.isSuccessful = true; - - response.tableInfos = new ArrayList<>(); - for (int i = 0; i < cursor.getColumnCount(); i++) { - TableDataResponse.TableInfo tableInfo = new TableDataResponse.TableInfo(); - tableInfo.title = cursor.getColumnName(i); - tableInfo.isPrimary = false; - - response.tableInfos.add(tableInfo); - } - - response.rows = new ArrayList<>(); - if (cursor.getCount() > 0) { - do { - List row = new ArrayList<>(); - for (int i = 0; i < cursor.getColumnCount(); i++) { - ColumnData columnData = new ColumnData(); - switch (cursor.getType(i)) { - case Cursor.FIELD_TYPE_BLOB: - columnData.dataType = DataType.TEXT; - columnData.value = ConverterUtils.blobToString(cursor.getBlob(i)); - break; - case Cursor.FIELD_TYPE_FLOAT: - columnData.dataType = DataType.REAL; - columnData.value = cursor.getDouble(i); - break; - case Cursor.FIELD_TYPE_INTEGER: - columnData.dataType = DataType.INTEGER; - columnData.value = cursor.getLong(i); - break; - case Cursor.FIELD_TYPE_STRING: - columnData.dataType = DataType.TEXT; - columnData.value = cursor.getString(i); - break; - default: - columnData.dataType = DataType.TEXT; - columnData.value = cursor.getString(i); - } - row.add(columnData); - } - response.rows.add(row); - - } while (cursor.moveToNext()); - } - cursor.close(); - return response; - } else { - TableDataResponse errorResponse = new TableDataResponse(); - errorResponse.isSuccessful = false; - errorResponse.errorMessage = "Cursor is null"; - return errorResponse; - } - } - - public Response getDBList() { + private Response getDBList() { databaseFiles = DatabaseFileProvider.getDatabaseFiles(mContext); Response response = new Response(); if (databaseFiles != null) { @@ -482,5 +320,4 @@ public Response getDBList() { return response; } - } diff --git a/debug-db/src/main/java/com/amitshekhar/utils/DatabaseHelper.java b/debug-db/src/main/java/com/amitshekhar/utils/DatabaseHelper.java index 25a2519..ec387f7 100644 --- a/debug-db/src/main/java/com/amitshekhar/utils/DatabaseHelper.java +++ b/debug-db/src/main/java/com/amitshekhar/utils/DatabaseHelper.java @@ -241,6 +241,89 @@ public static UpdateRowResponse updateRow(SQLiteDatabase db, String tableName, S } } + public static TableDataResponse query(SQLiteDatabase database, String sql) { + Cursor cursor; + try { + cursor = database.rawQuery(sql, null); + } catch (Exception e) { + e.printStackTrace(); + TableDataResponse errorResponse = new TableDataResponse(); + errorResponse.isSuccessful = false; + errorResponse.errorMessage = e.getMessage(); + return errorResponse; + } + + if (cursor != null) { + cursor.moveToFirst(); + TableDataResponse response = new TableDataResponse(); + response.isSuccessful = true; + + response.tableInfos = new ArrayList<>(); + for (int i = 0; i < cursor.getColumnCount(); i++) { + TableDataResponse.TableInfo tableInfo = new TableDataResponse.TableInfo(); + tableInfo.title = cursor.getColumnName(i); + tableInfo.isPrimary = false; + + response.tableInfos.add(tableInfo); + } + + response.rows = new ArrayList<>(); + if (cursor.getCount() > 0) { + do { + List row = new ArrayList<>(); + for (int i = 0; i < cursor.getColumnCount(); i++) { + TableDataResponse.ColumnData columnData = new TableDataResponse.ColumnData(); + switch (cursor.getType(i)) { + case Cursor.FIELD_TYPE_BLOB: + columnData.dataType = DataType.TEXT; + columnData.value = ConverterUtils.blobToString(cursor.getBlob(i)); + break; + case Cursor.FIELD_TYPE_FLOAT: + columnData.dataType = DataType.REAL; + columnData.value = cursor.getDouble(i); + break; + case Cursor.FIELD_TYPE_INTEGER: + columnData.dataType = DataType.INTEGER; + columnData.value = cursor.getLong(i); + break; + case Cursor.FIELD_TYPE_STRING: + columnData.dataType = DataType.TEXT; + columnData.value = cursor.getString(i); + break; + default: + columnData.dataType = DataType.TEXT; + columnData.value = cursor.getString(i); + } + row.add(columnData); + } + response.rows.add(row); + + } while (cursor.moveToNext()); + } + cursor.close(); + return response; + } else { + TableDataResponse errorResponse = new TableDataResponse(); + errorResponse.isSuccessful = false; + errorResponse.errorMessage = "Cursor is null"; + return errorResponse; + } + } + + public static Response exec(SQLiteDatabase database, String sql) { + Response response = new Response(); + try { + database.execSQL(sql); + } catch (Exception e) { + e.printStackTrace(); + response.isSuccessful = false; + response.error = e.getMessage(); + return response; + } + response.isSuccessful = true; + return response; + } + public static String getTableName(String selectQuery) { return null; } diff --git a/debug-db/src/main/java/com/amitshekhar/utils/Utils.java b/debug-db/src/main/java/com/amitshekhar/utils/Utils.java new file mode 100644 index 0000000..adbd07d --- /dev/null +++ b/debug-db/src/main/java/com/amitshekhar/utils/Utils.java @@ -0,0 +1,130 @@ +/* + * + * * Copyright (C) 2016 Amit Shekhar + * * Copyright (C) 2011 Android Open Source Project + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * http://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package com.amitshekhar.utils; + +import android.content.res.AssetManager; +import android.text.TextUtils; +import android.util.Log; + +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.util.HashMap; + +/** + * Created by amitshekhar on 06/02/17. + */ + +public class Utils { + + private static final String TAG = "Utils"; + + private Utils() { + // This class in not publicly instantiable + } + + /** + * Detects the MIME type from the {@code fileName}. + * + * @param fileName The name of the file. + * @return A MIME type. + */ + public static String detectMimeType(String fileName) { + if (TextUtils.isEmpty(fileName)) { + return null; + } else if (fileName.endsWith(".html")) { + return "text/html"; + } else if (fileName.endsWith(".js")) { + return "application/javascript"; + } else if (fileName.endsWith(".css")) { + return "text/css"; + } else { + return "application/octet-stream"; + } + } + + /** + * Loads all the content of {@code fileName}. + * + * @param fileName The name of the file. + * @param assetManager The AssetManager. + * @return The content of the file. + * @throws IOException + */ + public static byte[] loadContent(String fileName, AssetManager assetManager) throws IOException { + InputStream input = null; + try { + ByteArrayOutputStream output = new ByteArrayOutputStream(); + input = assetManager.open(fileName); + byte[] buffer = new byte[1024]; + int size; + while (-1 != (size = input.read(buffer))) { + output.write(buffer, 0, size); + } + output.flush(); + return output.toByteArray(); + } catch (FileNotFoundException e) { + return null; + } finally { + try { + if (null != input) { + input.close(); + } + } catch (Exception e) { + e.printStackTrace(); + } + } + } + + public static byte[] getDatabase(String selectedDatabase, HashMap databaseFiles) { + if (TextUtils.isEmpty(selectedDatabase)) { + return null; + } + + byte[] byteArray = new byte[0]; + try { + File file = databaseFiles.get(selectedDatabase); + + byteArray = null; + try { + InputStream inputStream = new FileInputStream(file); + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + byte[] b = new byte[(int) file.length()]; + int bytesRead; + + while ((bytesRead = inputStream.read(b)) != -1) { + bos.write(b, 0, bytesRead); + } + + byteArray = bos.toByteArray(); + } catch (IOException e) { + Log.e(TAG, "getDatabase: ", e); + } + } catch (Exception e) { + e.printStackTrace(); + } + + return byteArray; + } + +} From 1204cf2f25597a759280afbef6b9d1621304d393 Mon Sep 17 00:00:00 2001 From: AMIT SHEKHAR Date: Mon, 6 Feb 2017 16:15:51 +0530 Subject: [PATCH 17/50] Refactor Code --- .../com/amitshekhar/server/ClientServer.java | 9 ++- .../com/amitshekhar/utils/DatabaseHelper.java | 77 ++++++++----------- 2 files changed, 38 insertions(+), 48 deletions(-) diff --git a/debug-db/src/main/java/com/amitshekhar/server/ClientServer.java b/debug-db/src/main/java/com/amitshekhar/server/ClientServer.java index e5845bd..82ca2cc 100644 --- a/debug-db/src/main/java/com/amitshekhar/server/ClientServer.java +++ b/debug-db/src/main/java/com/amitshekhar/server/ClientServer.java @@ -32,6 +32,7 @@ import android.util.Log; import com.amitshekhar.model.Response; +import com.amitshekhar.model.RowDataRequest; import com.amitshekhar.model.TableDataResponse; import com.amitshekhar.model.UpdateRowResponse; import com.amitshekhar.utils.Constants; @@ -40,6 +41,7 @@ import com.amitshekhar.utils.PrefHelper; import com.amitshekhar.utils.Utils; import com.google.gson.Gson; +import com.google.gson.reflect.TypeToken; import java.io.BufferedReader; import java.io.File; @@ -51,6 +53,7 @@ import java.net.SocketException; import java.net.URLDecoder; import java.util.HashMap; +import java.util.List; public class ClientServer implements Runnable { @@ -242,12 +245,12 @@ private void handle(Socket socket) throws IOException { } else if (route.startsWith("downloadDb")) { bytes = Utils.getDatabase(mSelectedDatabase, databaseFiles); } else if (route.startsWith("updateTableData")) { - Uri uri = Uri.parse(URLDecoder.decode(route, "UTF-8")); String tableName = uri.getQueryParameter("tableName"); String updatedData = uri.getQueryParameter("updatedData"); - - UpdateRowResponse response = DatabaseHelper.updateRow(mDatabase, tableName, updatedData); + List rowDataRequests = mGson.fromJson(updatedData, new TypeToken>() { + }.getType()); + UpdateRowResponse response = DatabaseHelper.updateRow(mDatabase, tableName, rowDataRequests); String data = mGson.toJson(response); bytes = data.getBytes(); } else { diff --git a/debug-db/src/main/java/com/amitshekhar/utils/DatabaseHelper.java b/debug-db/src/main/java/com/amitshekhar/utils/DatabaseHelper.java index ec387f7..091432c 100644 --- a/debug-db/src/main/java/com/amitshekhar/utils/DatabaseHelper.java +++ b/debug-db/src/main/java/com/amitshekhar/utils/DatabaseHelper.java @@ -27,8 +27,6 @@ import com.amitshekhar.model.RowDataRequest; import com.amitshekhar.model.TableDataResponse; import com.amitshekhar.model.UpdateRowResponse; -import com.google.gson.Gson; -import com.google.gson.reflect.TypeToken; import java.util.ArrayList; import java.util.List; @@ -39,8 +37,6 @@ public class DatabaseHelper { - public static final Gson gson = new Gson(); - private DatabaseHelper() { // This class in not publicly instantiable } @@ -183,62 +179,53 @@ public static List getTableInfo(SQLiteDatabase db, return null; } - public static UpdateRowResponse updateRow(SQLiteDatabase db, String tableName, String data) { + public static UpdateRowResponse updateRow(SQLiteDatabase db, String tableName, List rowDataRequests) { UpdateRowResponse updateRowResponse = new UpdateRowResponse(); - if (data == null) { + if (rowDataRequests == null) { updateRowResponse.isSuccessful = false; return updateRowResponse; } - List rowDataRequests = gson.fromJson(data, new TypeToken>() { - }.getType()); - - if (rowDataRequests != null) { - ContentValues contentValues = new ContentValues(); + ContentValues contentValues = new ContentValues(); - String whereClause = null; - List whereArgsList = new ArrayList<>(); + String whereClause = null; + List whereArgsList = new ArrayList<>(); - for (RowDataRequest rowDataRequest : rowDataRequests) { - if (rowDataRequest.isPrimary) { - if (whereClause == null) { - whereClause = rowDataRequest.title + "=? "; - } else { - whereClause = "and " + rowDataRequest.title + "=? "; - } - whereArgsList.add(rowDataRequest.value); + for (RowDataRequest rowDataRequest : rowDataRequests) { + if (rowDataRequest.isPrimary) { + if (whereClause == null) { + whereClause = rowDataRequest.title + "=? "; } else { - switch (rowDataRequest.dataType) { - case DataType.INTEGER: - contentValues.put(rowDataRequest.title, Long.valueOf(rowDataRequest.value)); - break; - case DataType.REAL: - contentValues.put(rowDataRequest.title, Double.valueOf(rowDataRequest.value)); - break; - case DataType.TEXT: - contentValues.put(rowDataRequest.title, rowDataRequest.value); - break; - default: - } + whereClause = "and " + rowDataRequest.title + "=? "; + } + whereArgsList.add(rowDataRequest.value); + } else { + switch (rowDataRequest.dataType) { + case DataType.INTEGER: + contentValues.put(rowDataRequest.title, Long.valueOf(rowDataRequest.value)); + break; + case DataType.REAL: + contentValues.put(rowDataRequest.title, Double.valueOf(rowDataRequest.value)); + break; + case DataType.TEXT: + contentValues.put(rowDataRequest.title, rowDataRequest.value); + break; + default: } } + } - String[] whereArgs = new String[whereArgsList.size()]; - - for (int i = 0; i < whereArgsList.size(); i++) { - whereArgs[i] = whereArgsList.get(i); - } - - db.update(tableName, contentValues, whereClause, whereArgs); - updateRowResponse.isSuccessful = true; - return updateRowResponse; + String[] whereArgs = new String[whereArgsList.size()]; - } else { - updateRowResponse.isSuccessful = false; - return updateRowResponse; + for (int i = 0; i < whereArgsList.size(); i++) { + whereArgs[i] = whereArgsList.get(i); } + + db.update(tableName, contentValues, whereClause, whereArgs); + updateRowResponse.isSuccessful = true; + return updateRowResponse; } public static TableDataResponse query(SQLiteDatabase database, String sql) { From 120e53632713a4be5fb4ca82acfc2e95afe9be17 Mon Sep 17 00:00:00 2001 From: AMIT SHEKHAR Date: Mon, 6 Feb 2017 16:32:07 +0530 Subject: [PATCH 18/50] Add RequestHandler for better understanding --- .../com/amitshekhar/server/ClientServer.java | 228 +--------------- .../amitshekhar/server/RequestHandler.java | 251 ++++++++++++++++++ 2 files changed, 257 insertions(+), 222 deletions(-) create mode 100644 debug-db/src/main/java/com/amitshekhar/server/RequestHandler.java diff --git a/debug-db/src/main/java/com/amitshekhar/server/ClientServer.java b/debug-db/src/main/java/com/amitshekhar/server/ClientServer.java index 82ca2cc..d0db43b 100644 --- a/debug-db/src/main/java/com/amitshekhar/server/ClientServer.java +++ b/debug-db/src/main/java/com/amitshekhar/server/ClientServer.java @@ -25,35 +25,12 @@ import android.content.Context; -import android.content.res.AssetManager; -import android.database.sqlite.SQLiteDatabase; -import android.net.Uri; -import android.text.TextUtils; import android.util.Log; -import com.amitshekhar.model.Response; -import com.amitshekhar.model.RowDataRequest; -import com.amitshekhar.model.TableDataResponse; -import com.amitshekhar.model.UpdateRowResponse; -import com.amitshekhar.utils.Constants; -import com.amitshekhar.utils.DatabaseFileProvider; -import com.amitshekhar.utils.DatabaseHelper; -import com.amitshekhar.utils.PrefHelper; -import com.amitshekhar.utils.Utils; -import com.google.gson.Gson; -import com.google.gson.reflect.TypeToken; - -import java.io.BufferedReader; -import java.io.File; import java.io.IOException; -import java.io.InputStreamReader; -import java.io.PrintStream; import java.net.ServerSocket; import java.net.Socket; import java.net.SocketException; -import java.net.URLDecoder; -import java.util.HashMap; -import java.util.List; public class ClientServer implements Runnable { @@ -64,11 +41,6 @@ public class ClientServer implements Runnable { */ private final int mPort; - /** - * {@link AssetManager} for loading files to serve. - */ - private final AssetManager mAssets; - /** * True if the server is running. */ @@ -79,26 +51,18 @@ public class ClientServer implements Runnable { */ private ServerSocket mServerSocket; - - private Context mContext; - private SQLiteDatabase mDatabase; - private Gson mGson; - private boolean isDbOpened; - private HashMap databaseFiles; - /** - * Hold the selected database name + * Handler for handling request. */ - private String mSelectedDatabase = null; + private final RequestHandler requestHandler; + /** - * WebServer constructor. + * ClientServer constructor. */ public ClientServer(Context context, int port) { + requestHandler = new RequestHandler(context); mPort = port; - mAssets = context.getResources().getAssets(); - mContext = context; - mGson = new Gson(); } /** @@ -130,7 +94,7 @@ public void run() { mServerSocket = new ServerSocket(mPort); while (mIsRunning) { Socket socket = mServerSocket.accept(); - handle(socket); + requestHandler.handle(socket); socket.close(); } } catch (SocketException e) { @@ -142,185 +106,5 @@ public void run() { } } - /** - * Respond to a request from a client. - * - * @param socket The client socket. - * @throws IOException - */ - private void handle(Socket socket) throws IOException { - BufferedReader reader = null; - PrintStream output = null; - try { - String route = null; - - // Read HTTP headers and parse out the route. - reader = new BufferedReader(new InputStreamReader(socket.getInputStream())); - String line; - while (!TextUtils.isEmpty(line = reader.readLine())) { - if (line.startsWith("GET /")) { - int start = line.indexOf('/') + 1; - int end = line.indexOf(' ', start); - route = line.substring(start, end); - break; - } - } - - // Output stream that we send the response to - output = new PrintStream(socket.getOutputStream()); - - if (route == null || route.isEmpty()) { - route = "index.html"; - } - - byte[] bytes; - - if (route.startsWith("getAllDataFromTheTable")) { - String tableName = null; - - if (route.contains("?tableName=")) { - tableName = route.substring(route.indexOf("=") + 1, route.length()); - } - - TableDataResponse response; - - if (isDbOpened) { - String sql = "SELECT * FROM " + tableName; - response = DatabaseHelper.getTableData(mDatabase, sql, tableName); - } else { - response = PrefHelper.getAllPrefData(mContext, tableName); - } - - String data = mGson.toJson(response); - bytes = data.getBytes(); - - } else if (route.startsWith("query")) { - String query = null; - if (route.contains("?query=")) { - query = route.substring(route.indexOf("=") + 1, route.length()); - } - try { - query = java.net.URLDecoder.decode(query, "UTF-8"); - } catch (Exception e) { - e.printStackTrace(); - } - - String first = query.split(" ")[0].toLowerCase(); - - String data; - if (first.equals("select")) { - TableDataResponse response = DatabaseHelper.query(mDatabase, query); - data = mGson.toJson(response); - } else { - Response response = DatabaseHelper.exec(mDatabase, query); - data = mGson.toJson(response); - } - - bytes = data.getBytes(); - - } else if (route.startsWith("getDbList")) { - Response response = getDBList(); - String data = mGson.toJson(response); - bytes = data.getBytes(); - } else if (route.startsWith("getTableList")) { - String database = null; - if (route.contains("?database=")) { - database = route.substring(route.indexOf("=") + 1, route.length()); - } - - Response response; - - if (Constants.APP_SHARED_PREFERENCES.equals(database)) { - response = PrefHelper.getAllPrefTableName(mContext); - closeDatabase(); - mSelectedDatabase = null; - } else { - openDatabase(database); - response = DatabaseHelper.getAllTableName(mDatabase); - mSelectedDatabase = database; - } - - String data = mGson.toJson(response); - bytes = data.getBytes(); - } else if (route.startsWith("downloadDb")) { - bytes = Utils.getDatabase(mSelectedDatabase, databaseFiles); - } else if (route.startsWith("updateTableData")) { - Uri uri = Uri.parse(URLDecoder.decode(route, "UTF-8")); - String tableName = uri.getQueryParameter("tableName"); - String updatedData = uri.getQueryParameter("updatedData"); - List rowDataRequests = mGson.fromJson(updatedData, new TypeToken>() { - }.getType()); - UpdateRowResponse response = DatabaseHelper.updateRow(mDatabase, tableName, rowDataRequests); - String data = mGson.toJson(response); - bytes = data.getBytes(); - } else { - bytes = Utils.loadContent(route, mAssets); - } - - - if (null == bytes) { - writeServerError(output); - return; - } - - // Send out the content. - output.println("HTTP/1.0 200 OK"); - output.println("Content-Type: " + Utils.detectMimeType(route)); - - if (route.startsWith("downloadDb")) { - output.println("Content-Disposition: attachment; filename=" + mSelectedDatabase); - } else { - output.println("Content-Length: " + bytes.length); - } - output.println(); - output.write(bytes); - output.flush(); - } finally { - try { - if (null != output) { - output.close(); - } - if (null != reader) { - reader.close(); - } - } catch (Exception e) { - e.printStackTrace(); - } - } - } - - /** - * Writes a server error response (HTTP/1.0 500) to the given output stream. - * - * @param output The output stream. - */ - private void writeServerError(PrintStream output) { - output.println("HTTP/1.0 500 Internal Server Error"); - output.flush(); - } - - - private void openDatabase(String database) { - mDatabase = mContext.openOrCreateDatabase(database, 0, null); - isDbOpened = true; - } - - private void closeDatabase() { - mDatabase = null; - isDbOpened = false; - } - - private Response getDBList() { - databaseFiles = DatabaseFileProvider.getDatabaseFiles(mContext); - Response response = new Response(); - if (databaseFiles != null) { - for (HashMap.Entry entry : databaseFiles.entrySet()) { - response.rows.add(entry.getKey()); - } - } - response.rows.add(Constants.APP_SHARED_PREFERENCES); - response.isSuccessful = true; - return response; - } } diff --git a/debug-db/src/main/java/com/amitshekhar/server/RequestHandler.java b/debug-db/src/main/java/com/amitshekhar/server/RequestHandler.java new file mode 100644 index 0000000..6c1acd1 --- /dev/null +++ b/debug-db/src/main/java/com/amitshekhar/server/RequestHandler.java @@ -0,0 +1,251 @@ +/* + * + * * Copyright (C) 2016 Amit Shekhar + * * Copyright (C) 2011 Android Open Source Project + * * + * * Licensed under the Apache License, Version 2.0 (the "License"); + * * you may not use this file except in compliance with the License. + * * You may obtain a copy of the License at + * * + * * http://www.apache.org/licenses/LICENSE-2.0 + * * + * * Unless required by applicable law or agreed to in writing, software + * * distributed under the License is distributed on an "AS IS" BASIS, + * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * * See the License for the specific language governing permissions and + * * limitations under the License. + * + */ + +package com.amitshekhar.server; + +import android.content.Context; +import android.content.res.AssetManager; +import android.database.sqlite.SQLiteDatabase; +import android.net.Uri; +import android.text.TextUtils; + +import com.amitshekhar.model.Response; +import com.amitshekhar.model.RowDataRequest; +import com.amitshekhar.model.TableDataResponse; +import com.amitshekhar.model.UpdateRowResponse; +import com.amitshekhar.utils.Constants; +import com.amitshekhar.utils.DatabaseFileProvider; +import com.amitshekhar.utils.DatabaseHelper; +import com.amitshekhar.utils.PrefHelper; +import com.amitshekhar.utils.Utils; +import com.google.gson.Gson; +import com.google.gson.reflect.TypeToken; + +import java.io.BufferedReader; +import java.io.File; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.PrintStream; +import java.net.Socket; +import java.net.URLDecoder; +import java.util.HashMap; +import java.util.List; + +/** + * Created by amitshekhar on 06/02/17. + */ + +public class RequestHandler { + + private final Context mContext; + private final Gson mGson; + private final AssetManager mAssets; + private boolean isDbOpened; + private SQLiteDatabase mDatabase; + private HashMap databaseFiles; + private String mSelectedDatabase = null; + + public RequestHandler(Context context) { + mContext = context; + mAssets = context.getResources().getAssets(); + mGson = new Gson(); + } + + /** + * Respond to a request from a client. + * + * @param socket The client socket. + * @throws IOException + */ + public void handle(Socket socket) throws IOException { + BufferedReader reader = null; + PrintStream output = null; + try { + String route = null; + + // Read HTTP headers and parse out the route. + reader = new BufferedReader(new InputStreamReader(socket.getInputStream())); + String line; + while (!TextUtils.isEmpty(line = reader.readLine())) { + if (line.startsWith("GET /")) { + int start = line.indexOf('/') + 1; + int end = line.indexOf(' ', start); + route = line.substring(start, end); + break; + } + } + + // Output stream that we send the response to + output = new PrintStream(socket.getOutputStream()); + + if (route == null || route.isEmpty()) { + route = "index.html"; + } + + byte[] bytes; + + if (route.startsWith("getAllDataFromTheTable")) { + String tableName = null; + + if (route.contains("?tableName=")) { + tableName = route.substring(route.indexOf("=") + 1, route.length()); + } + + TableDataResponse response; + + if (isDbOpened) { + String sql = "SELECT * FROM " + tableName; + response = DatabaseHelper.getTableData(mDatabase, sql, tableName); + } else { + response = PrefHelper.getAllPrefData(mContext, tableName); + } + + String data = mGson.toJson(response); + bytes = data.getBytes(); + + } else if (route.startsWith("query")) { + String query = null; + if (route.contains("?query=")) { + query = route.substring(route.indexOf("=") + 1, route.length()); + } + try { + query = java.net.URLDecoder.decode(query, "UTF-8"); + } catch (Exception e) { + e.printStackTrace(); + } + + String first = query.split(" ")[0].toLowerCase(); + + String data; + if (first.equals("select")) { + TableDataResponse response = DatabaseHelper.query(mDatabase, query); + data = mGson.toJson(response); + } else { + Response response = DatabaseHelper.exec(mDatabase, query); + data = mGson.toJson(response); + } + + bytes = data.getBytes(); + + } else if (route.startsWith("getDbList")) { + Response response = getDBList(); + String data = mGson.toJson(response); + bytes = data.getBytes(); + } else if (route.startsWith("getTableList")) { + String database = null; + if (route.contains("?database=")) { + database = route.substring(route.indexOf("=") + 1, route.length()); + } + + Response response; + + if (Constants.APP_SHARED_PREFERENCES.equals(database)) { + response = PrefHelper.getAllPrefTableName(mContext); + closeDatabase(); + mSelectedDatabase = null; + } else { + openDatabase(database); + response = DatabaseHelper.getAllTableName(mDatabase); + mSelectedDatabase = database; + } + + String data = mGson.toJson(response); + bytes = data.getBytes(); + } else if (route.startsWith("downloadDb")) { + bytes = Utils.getDatabase(mSelectedDatabase, databaseFiles); + } else if (route.startsWith("updateTableData")) { + Uri uri = Uri.parse(URLDecoder.decode(route, "UTF-8")); + String tableName = uri.getQueryParameter("tableName"); + String updatedData = uri.getQueryParameter("updatedData"); + List rowDataRequests = mGson.fromJson(updatedData, new TypeToken>() { + }.getType()); + UpdateRowResponse response = DatabaseHelper.updateRow(mDatabase, tableName, rowDataRequests); + String data = mGson.toJson(response); + bytes = data.getBytes(); + } else { + bytes = Utils.loadContent(route, mAssets); + } + + + if (null == bytes) { + writeServerError(output); + return; + } + + // Send out the content. + output.println("HTTP/1.0 200 OK"); + output.println("Content-Type: " + Utils.detectMimeType(route)); + + if (route.startsWith("downloadDb")) { + output.println("Content-Disposition: attachment; filename=" + mSelectedDatabase); + } else { + output.println("Content-Length: " + bytes.length); + } + output.println(); + output.write(bytes); + output.flush(); + } finally { + try { + if (null != output) { + output.close(); + } + if (null != reader) { + reader.close(); + } + } catch (Exception e) { + e.printStackTrace(); + } + } + } + + /** + * Writes a server error response (HTTP/1.0 500) to the given output stream. + * + * @param output The output stream. + */ + private void writeServerError(PrintStream output) { + output.println("HTTP/1.0 500 Internal Server Error"); + output.flush(); + } + + + private void openDatabase(String database) { + mDatabase = mContext.openOrCreateDatabase(database, 0, null); + isDbOpened = true; + } + + private void closeDatabase() { + mDatabase = null; + isDbOpened = false; + } + + private Response getDBList() { + databaseFiles = DatabaseFileProvider.getDatabaseFiles(mContext); + Response response = new Response(); + if (databaseFiles != null) { + for (HashMap.Entry entry : databaseFiles.entrySet()) { + response.rows.add(entry.getKey()); + } + } + response.rows.add(Constants.APP_SHARED_PREFERENCES); + response.isSuccessful = true; + return response; + } + +} From cb89c1b85c1e881d7e6e447683f0126875ed5d51 Mon Sep 17 00:00:00 2001 From: AMIT SHEKHAR Date: Mon, 6 Feb 2017 17:01:14 +0530 Subject: [PATCH 19/50] Refactor code --- .../com/amitshekhar/server/ClientServer.java | 30 +-- .../amitshekhar/server/RequestHandler.java | 189 +++++++++--------- .../java/com/amitshekhar/utils/Utils.java | 14 -- 3 files changed, 103 insertions(+), 130 deletions(-) diff --git a/debug-db/src/main/java/com/amitshekhar/server/ClientServer.java b/debug-db/src/main/java/com/amitshekhar/server/ClientServer.java index d0db43b..bef820b 100644 --- a/debug-db/src/main/java/com/amitshekhar/server/ClientServer.java +++ b/debug-db/src/main/java/com/amitshekhar/server/ClientServer.java @@ -34,48 +34,26 @@ public class ClientServer implements Runnable { - private static final String TAG = "SimpleWebServer"; + private static final String TAG = "ClientServer"; - /** - * The port number we listen to - */ private final int mPort; - /** - * True if the server is running. - */ private boolean mIsRunning; - /** - * The {@link ServerSocket} that we listen to. - */ private ServerSocket mServerSocket; - /** - * Handler for handling request. - */ - private final RequestHandler requestHandler; + private final RequestHandler mRequestHandler; - - /** - * ClientServer constructor. - */ public ClientServer(Context context, int port) { - requestHandler = new RequestHandler(context); + mRequestHandler = new RequestHandler(context); mPort = port; } - /** - * This method starts the web server listening to the specified port. - */ public void start() { mIsRunning = true; new Thread(this).start(); } - /** - * This method stops the web server - */ public void stop() { try { mIsRunning = false; @@ -94,7 +72,7 @@ public void run() { mServerSocket = new ServerSocket(mPort); while (mIsRunning) { Socket socket = mServerSocket.accept(); - requestHandler.handle(socket); + mRequestHandler.handle(socket); socket.close(); } } catch (SocketException e) { diff --git a/debug-db/src/main/java/com/amitshekhar/server/RequestHandler.java b/debug-db/src/main/java/com/amitshekhar/server/RequestHandler.java index 6c1acd1..7b4f83b 100644 --- a/debug-db/src/main/java/com/amitshekhar/server/RequestHandler.java +++ b/debug-db/src/main/java/com/amitshekhar/server/RequestHandler.java @@ -67,12 +67,6 @@ public RequestHandler(Context context) { mGson = new Gson(); } - /** - * Respond to a request from a client. - * - * @param socket The client socket. - * @throws IOException - */ public void handle(Socket socket) throws IOException { BufferedReader reader = null; PrintStream output = null; @@ -100,89 +94,27 @@ public void handle(Socket socket) throws IOException { byte[] bytes; - if (route.startsWith("getAllDataFromTheTable")) { - String tableName = null; - - if (route.contains("?tableName=")) { - tableName = route.substring(route.indexOf("=") + 1, route.length()); - } - - TableDataResponse response; - - if (isDbOpened) { - String sql = "SELECT * FROM " + tableName; - response = DatabaseHelper.getTableData(mDatabase, sql, tableName); - } else { - response = PrefHelper.getAllPrefData(mContext, tableName); - } - - String data = mGson.toJson(response); - bytes = data.getBytes(); - - } else if (route.startsWith("query")) { - String query = null; - if (route.contains("?query=")) { - query = route.substring(route.indexOf("=") + 1, route.length()); - } - try { - query = java.net.URLDecoder.decode(query, "UTF-8"); - } catch (Exception e) { - e.printStackTrace(); - } - - String first = query.split(" ")[0].toLowerCase(); - - String data; - if (first.equals("select")) { - TableDataResponse response = DatabaseHelper.query(mDatabase, query); - data = mGson.toJson(response); - } else { - Response response = DatabaseHelper.exec(mDatabase, query); - data = mGson.toJson(response); - } - - bytes = data.getBytes(); - - } else if (route.startsWith("getDbList")) { - Response response = getDBList(); - String data = mGson.toJson(response); - bytes = data.getBytes(); + if (route.startsWith("getDbList")) { + final String response = getDBListResponse(); + bytes = response.getBytes(); + } else if (route.startsWith("getAllDataFromTheTable")) { + final String response = getAllDataFromTheTableResponse(route); + bytes = response.getBytes(); } else if (route.startsWith("getTableList")) { - String database = null; - if (route.contains("?database=")) { - database = route.substring(route.indexOf("=") + 1, route.length()); - } - - Response response; - - if (Constants.APP_SHARED_PREFERENCES.equals(database)) { - response = PrefHelper.getAllPrefTableName(mContext); - closeDatabase(); - mSelectedDatabase = null; - } else { - openDatabase(database); - response = DatabaseHelper.getAllTableName(mDatabase); - mSelectedDatabase = database; - } - - String data = mGson.toJson(response); - bytes = data.getBytes(); + final String response = getTableListResponse(route); + bytes = response.getBytes(); + } else if (route.startsWith("updateTableData")) { + final String response = updateTableDataAndGetResponse(route); + bytes = response.getBytes(); + } else if (route.startsWith("query")) { + final String response = executeQueryAndGetResponse(route); + bytes = response.getBytes(); } else if (route.startsWith("downloadDb")) { bytes = Utils.getDatabase(mSelectedDatabase, databaseFiles); - } else if (route.startsWith("updateTableData")) { - Uri uri = Uri.parse(URLDecoder.decode(route, "UTF-8")); - String tableName = uri.getQueryParameter("tableName"); - String updatedData = uri.getQueryParameter("updatedData"); - List rowDataRequests = mGson.fromJson(updatedData, new TypeToken>() { - }.getType()); - UpdateRowResponse response = DatabaseHelper.updateRow(mDatabase, tableName, rowDataRequests); - String data = mGson.toJson(response); - bytes = data.getBytes(); } else { bytes = Utils.loadContent(route, mAssets); } - if (null == bytes) { writeServerError(output); return; @@ -214,17 +146,11 @@ public void handle(Socket socket) throws IOException { } } - /** - * Writes a server error response (HTTP/1.0 500) to the given output stream. - * - * @param output The output stream. - */ private void writeServerError(PrintStream output) { output.println("HTTP/1.0 500 Internal Server Error"); output.flush(); } - private void openDatabase(String database) { mDatabase = mContext.openOrCreateDatabase(database, 0, null); isDbOpened = true; @@ -235,7 +161,7 @@ private void closeDatabase() { isDbOpened = false; } - private Response getDBList() { + private String getDBListResponse() { databaseFiles = DatabaseFileProvider.getDatabaseFiles(mContext); Response response = new Response(); if (databaseFiles != null) { @@ -245,7 +171,90 @@ private Response getDBList() { } response.rows.add(Constants.APP_SHARED_PREFERENCES); response.isSuccessful = true; - return response; + return mGson.toJson(response); + } + + private String getAllDataFromTheTableResponse(String route) { + + String tableName = null; + + if (route.contains("?tableName=")) { + tableName = route.substring(route.indexOf("=") + 1, route.length()); + } + + TableDataResponse response; + + if (isDbOpened) { + String sql = "SELECT * FROM " + tableName; + response = DatabaseHelper.getTableData(mDatabase, sql, tableName); + } else { + response = PrefHelper.getAllPrefData(mContext, tableName); + } + + return mGson.toJson(response); + + } + + private String executeQueryAndGetResponse(String route) { + String query = null; + if (route.contains("?query=")) { + query = route.substring(route.indexOf("=") + 1, route.length()); + } + try { + query = java.net.URLDecoder.decode(query, "UTF-8"); + } catch (Exception e) { + e.printStackTrace(); + } + + String first = query.split(" ")[0].toLowerCase(); + + String data; + if (first.equals("select")) { + TableDataResponse response = DatabaseHelper.query(mDatabase, query); + data = mGson.toJson(response); + } else { + Response response = DatabaseHelper.exec(mDatabase, query); + data = mGson.toJson(response); + } + return data; + } + + private String getTableListResponse(String route) { + String database = null; + if (route.contains("?database=")) { + database = route.substring(route.indexOf("=") + 1, route.length()); + } + + Response response; + + if (Constants.APP_SHARED_PREFERENCES.equals(database)) { + response = PrefHelper.getAllPrefTableName(mContext); + closeDatabase(); + mSelectedDatabase = null; + } else { + openDatabase(database); + response = DatabaseHelper.getAllTableName(mDatabase); + mSelectedDatabase = database; + } + return mGson.toJson(response); + } + + private String updateTableDataAndGetResponse(String route) { + UpdateRowResponse response; + try { + Uri uri = Uri.parse(URLDecoder.decode(route, "UTF-8")); + String tableName = uri.getQueryParameter("tableName"); + String updatedData = uri.getQueryParameter("updatedData"); + List rowDataRequests = mGson.fromJson(updatedData, new TypeToken>() { + }.getType()); + response = DatabaseHelper.updateRow(mDatabase, tableName, rowDataRequests); + return mGson.toJson(response); + } catch (Exception e) { + e.printStackTrace(); + response = new UpdateRowResponse(); + response.isSuccessful = false; + return mGson.toJson(response); + } } } diff --git a/debug-db/src/main/java/com/amitshekhar/utils/Utils.java b/debug-db/src/main/java/com/amitshekhar/utils/Utils.java index adbd07d..93ec957 100644 --- a/debug-db/src/main/java/com/amitshekhar/utils/Utils.java +++ b/debug-db/src/main/java/com/amitshekhar/utils/Utils.java @@ -43,12 +43,6 @@ private Utils() { // This class in not publicly instantiable } - /** - * Detects the MIME type from the {@code fileName}. - * - * @param fileName The name of the file. - * @return A MIME type. - */ public static String detectMimeType(String fileName) { if (TextUtils.isEmpty(fileName)) { return null; @@ -63,14 +57,6 @@ public static String detectMimeType(String fileName) { } } - /** - * Loads all the content of {@code fileName}. - * - * @param fileName The name of the file. - * @param assetManager The AssetManager. - * @return The content of the file. - * @throws IOException - */ public static byte[] loadContent(String fileName, AssetManager assetManager) throws IOException { InputStream input = null; try { From 506f5dd72d43c94bd500f63de5ffbeb396a11dc4 Mon Sep 17 00:00:00 2001 From: AMIT SHEKHAR Date: Mon, 6 Feb 2017 21:33:01 +0530 Subject: [PATCH 20/50] Add all js and css in assets to make it work offline --- debug-db/src/main/assets/bootstrap.min.css | 6 + debug-db/src/main/assets/bootstrap.min.js | 7 + .../main/assets/buttons.dataTables.min.css | 1 + .../main/assets/dataTables.responsive.min.js | 25 +++ .../src/main/assets/dataTables.select.min.js | 25 +++ debug-db/src/main/assets/index.html | 13 +- .../src/main/assets/jquery.dataTables.min.css | 1 + .../src/main/assets/jquery.dataTables.min.js | 166 ++++++++++++++++++ debug-db/src/main/assets/jquery.min.js | 4 + .../main/assets/responsive.dataTables.min.css | 1 + .../src/main/assets/select.dataTables.min.css | 1 + 11 files changed, 243 insertions(+), 7 deletions(-) create mode 100644 debug-db/src/main/assets/bootstrap.min.css create mode 100644 debug-db/src/main/assets/bootstrap.min.js create mode 100644 debug-db/src/main/assets/buttons.dataTables.min.css create mode 100644 debug-db/src/main/assets/dataTables.responsive.min.js create mode 100644 debug-db/src/main/assets/dataTables.select.min.js create mode 100644 debug-db/src/main/assets/jquery.dataTables.min.css create mode 100644 debug-db/src/main/assets/jquery.dataTables.min.js create mode 100644 debug-db/src/main/assets/jquery.min.js create mode 100644 debug-db/src/main/assets/responsive.dataTables.min.css create mode 100644 debug-db/src/main/assets/select.dataTables.min.css diff --git a/debug-db/src/main/assets/bootstrap.min.css b/debug-db/src/main/assets/bootstrap.min.css new file mode 100644 index 0000000..ed3905e --- /dev/null +++ b/debug-db/src/main/assets/bootstrap.min.css @@ -0,0 +1,6 @@ +/*! + * Bootstrap v3.3.7 (http://getbootstrap.com) + * Copyright 2011-2016 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + *//*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}h1{margin:.67em 0;font-size:2em}mark{color:#000;background:#ff0}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{height:0;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{margin:0;font:inherit;color:inherit}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0}input{line-height:normal}input[type=checkbox],input[type=radio]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;-webkit-appearance:textfield}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}fieldset{padding:.35em .625em .75em;margin:0 2px;border:1px solid silver}legend{padding:0;border:0}textarea{overflow:auto}optgroup{font-weight:700}table{border-spacing:0;border-collapse:collapse}td,th{padding:0}/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */@media print{*,:after,:before{color:#000!important;text-shadow:none!important;background:0 0!important;-webkit-box-shadow:none!important;box-shadow:none!important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}a[href^="javascript:"]:after,a[href^="#"]:after{content:""}blockquote,pre{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}img,tr{page-break-inside:avoid}img{max-width:100%!important}h2,h3,p{orphans:3;widows:3}h2,h3{page-break-after:avoid}.navbar{display:none}.btn>.caret,.dropup>.btn>.caret{border-top-color:#000!important}.label{border:1px solid #000}.table{border-collapse:collapse!important}.table td,.table th{background-color:#fff!important}.table-bordered td,.table-bordered th{border:1px solid #ddd!important}}@font-face{font-family:'Glyphicons Halflings';src:url(../fonts/glyphicons-halflings-regular.eot);src:url(../fonts/glyphicons-halflings-regular.eot?#iefix) format('embedded-opentype'),url(../fonts/glyphicons-halflings-regular.woff2) format('woff2'),url(../fonts/glyphicons-halflings-regular.woff) format('woff'),url(../fonts/glyphicons-halflings-regular.ttf) format('truetype'),url(../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular) format('svg')}.glyphicon{position:relative;top:1px;display:inline-block;font-family:'Glyphicons Halflings';font-style:normal;font-weight:400;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.glyphicon-asterisk:before{content:"\002a"}.glyphicon-plus:before{content:"\002b"}.glyphicon-eur:before,.glyphicon-euro:before{content:"\20ac"}.glyphicon-minus:before{content:"\2212"}.glyphicon-cloud:before{content:"\2601"}.glyphicon-envelope:before{content:"\2709"}.glyphicon-pencil:before{content:"\270f"}.glyphicon-glass:before{content:"\e001"}.glyphicon-music:before{content:"\e002"}.glyphicon-search:before{content:"\e003"}.glyphicon-heart:before{content:"\e005"}.glyphicon-star:before{content:"\e006"}.glyphicon-star-empty:before{content:"\e007"}.glyphicon-user:before{content:"\e008"}.glyphicon-film:before{content:"\e009"}.glyphicon-th-large:before{content:"\e010"}.glyphicon-th:before{content:"\e011"}.glyphicon-th-list:before{content:"\e012"}.glyphicon-ok:before{content:"\e013"}.glyphicon-remove:before{content:"\e014"}.glyphicon-zoom-in:before{content:"\e015"}.glyphicon-zoom-out:before{content:"\e016"}.glyphicon-off:before{content:"\e017"}.glyphicon-signal:before{content:"\e018"}.glyphicon-cog:before{content:"\e019"}.glyphicon-trash:before{content:"\e020"}.glyphicon-home:before{content:"\e021"}.glyphicon-file:before{content:"\e022"}.glyphicon-time:before{content:"\e023"}.glyphicon-road:before{content:"\e024"}.glyphicon-download-alt:before{content:"\e025"}.glyphicon-download:before{content:"\e026"}.glyphicon-upload:before{content:"\e027"}.glyphicon-inbox:before{content:"\e028"}.glyphicon-play-circle:before{content:"\e029"}.glyphicon-repeat:before{content:"\e030"}.glyphicon-refresh:before{content:"\e031"}.glyphicon-list-alt:before{content:"\e032"}.glyphicon-lock:before{content:"\e033"}.glyphicon-flag:before{content:"\e034"}.glyphicon-headphones:before{content:"\e035"}.glyphicon-volume-off:before{content:"\e036"}.glyphicon-volume-down:before{content:"\e037"}.glyphicon-volume-up:before{content:"\e038"}.glyphicon-qrcode:before{content:"\e039"}.glyphicon-barcode:before{content:"\e040"}.glyphicon-tag:before{content:"\e041"}.glyphicon-tags:before{content:"\e042"}.glyphicon-book:before{content:"\e043"}.glyphicon-bookmark:before{content:"\e044"}.glyphicon-print:before{content:"\e045"}.glyphicon-camera:before{content:"\e046"}.glyphicon-font:before{content:"\e047"}.glyphicon-bold:before{content:"\e048"}.glyphicon-italic:before{content:"\e049"}.glyphicon-text-height:before{content:"\e050"}.glyphicon-text-width:before{content:"\e051"}.glyphicon-align-left:before{content:"\e052"}.glyphicon-align-center:before{content:"\e053"}.glyphicon-align-right:before{content:"\e054"}.glyphicon-align-justify:before{content:"\e055"}.glyphicon-list:before{content:"\e056"}.glyphicon-indent-left:before{content:"\e057"}.glyphicon-indent-right:before{content:"\e058"}.glyphicon-facetime-video:before{content:"\e059"}.glyphicon-picture:before{content:"\e060"}.glyphicon-map-marker:before{content:"\e062"}.glyphicon-adjust:before{content:"\e063"}.glyphicon-tint:before{content:"\e064"}.glyphicon-edit:before{content:"\e065"}.glyphicon-share:before{content:"\e066"}.glyphicon-check:before{content:"\e067"}.glyphicon-move:before{content:"\e068"}.glyphicon-step-backward:before{content:"\e069"}.glyphicon-fast-backward:before{content:"\e070"}.glyphicon-backward:before{content:"\e071"}.glyphicon-play:before{content:"\e072"}.glyphicon-pause:before{content:"\e073"}.glyphicon-stop:before{content:"\e074"}.glyphicon-forward:before{content:"\e075"}.glyphicon-fast-forward:before{content:"\e076"}.glyphicon-step-forward:before{content:"\e077"}.glyphicon-eject:before{content:"\e078"}.glyphicon-chevron-left:before{content:"\e079"}.glyphicon-chevron-right:before{content:"\e080"}.glyphicon-plus-sign:before{content:"\e081"}.glyphicon-minus-sign:before{content:"\e082"}.glyphicon-remove-sign:before{content:"\e083"}.glyphicon-ok-sign:before{content:"\e084"}.glyphicon-question-sign:before{content:"\e085"}.glyphicon-info-sign:before{content:"\e086"}.glyphicon-screenshot:before{content:"\e087"}.glyphicon-remove-circle:before{content:"\e088"}.glyphicon-ok-circle:before{content:"\e089"}.glyphicon-ban-circle:before{content:"\e090"}.glyphicon-arrow-left:before{content:"\e091"}.glyphicon-arrow-right:before{content:"\e092"}.glyphicon-arrow-up:before{content:"\e093"}.glyphicon-arrow-down:before{content:"\e094"}.glyphicon-share-alt:before{content:"\e095"}.glyphicon-resize-full:before{content:"\e096"}.glyphicon-resize-small:before{content:"\e097"}.glyphicon-exclamation-sign:before{content:"\e101"}.glyphicon-gift:before{content:"\e102"}.glyphicon-leaf:before{content:"\e103"}.glyphicon-fire:before{content:"\e104"}.glyphicon-eye-open:before{content:"\e105"}.glyphicon-eye-close:before{content:"\e106"}.glyphicon-warning-sign:before{content:"\e107"}.glyphicon-plane:before{content:"\e108"}.glyphicon-calendar:before{content:"\e109"}.glyphicon-random:before{content:"\e110"}.glyphicon-comment:before{content:"\e111"}.glyphicon-magnet:before{content:"\e112"}.glyphicon-chevron-up:before{content:"\e113"}.glyphicon-chevron-down:before{content:"\e114"}.glyphicon-retweet:before{content:"\e115"}.glyphicon-shopping-cart:before{content:"\e116"}.glyphicon-folder-close:before{content:"\e117"}.glyphicon-folder-open:before{content:"\e118"}.glyphicon-resize-vertical:before{content:"\e119"}.glyphicon-resize-horizontal:before{content:"\e120"}.glyphicon-hdd:before{content:"\e121"}.glyphicon-bullhorn:before{content:"\e122"}.glyphicon-bell:before{content:"\e123"}.glyphicon-certificate:before{content:"\e124"}.glyphicon-thumbs-up:before{content:"\e125"}.glyphicon-thumbs-down:before{content:"\e126"}.glyphicon-hand-right:before{content:"\e127"}.glyphicon-hand-left:before{content:"\e128"}.glyphicon-hand-up:before{content:"\e129"}.glyphicon-hand-down:before{content:"\e130"}.glyphicon-circle-arrow-right:before{content:"\e131"}.glyphicon-circle-arrow-left:before{content:"\e132"}.glyphicon-circle-arrow-up:before{content:"\e133"}.glyphicon-circle-arrow-down:before{content:"\e134"}.glyphicon-globe:before{content:"\e135"}.glyphicon-wrench:before{content:"\e136"}.glyphicon-tasks:before{content:"\e137"}.glyphicon-filter:before{content:"\e138"}.glyphicon-briefcase:before{content:"\e139"}.glyphicon-fullscreen:before{content:"\e140"}.glyphicon-dashboard:before{content:"\e141"}.glyphicon-paperclip:before{content:"\e142"}.glyphicon-heart-empty:before{content:"\e143"}.glyphicon-link:before{content:"\e144"}.glyphicon-phone:before{content:"\e145"}.glyphicon-pushpin:before{content:"\e146"}.glyphicon-usd:before{content:"\e148"}.glyphicon-gbp:before{content:"\e149"}.glyphicon-sort:before{content:"\e150"}.glyphicon-sort-by-alphabet:before{content:"\e151"}.glyphicon-sort-by-alphabet-alt:before{content:"\e152"}.glyphicon-sort-by-order:before{content:"\e153"}.glyphicon-sort-by-order-alt:before{content:"\e154"}.glyphicon-sort-by-attributes:before{content:"\e155"}.glyphicon-sort-by-attributes-alt:before{content:"\e156"}.glyphicon-unchecked:before{content:"\e157"}.glyphicon-expand:before{content:"\e158"}.glyphicon-collapse-down:before{content:"\e159"}.glyphicon-collapse-up:before{content:"\e160"}.glyphicon-log-in:before{content:"\e161"}.glyphicon-flash:before{content:"\e162"}.glyphicon-log-out:before{content:"\e163"}.glyphicon-new-window:before{content:"\e164"}.glyphicon-record:before{content:"\e165"}.glyphicon-save:before{content:"\e166"}.glyphicon-open:before{content:"\e167"}.glyphicon-saved:before{content:"\e168"}.glyphicon-import:before{content:"\e169"}.glyphicon-export:before{content:"\e170"}.glyphicon-send:before{content:"\e171"}.glyphicon-floppy-disk:before{content:"\e172"}.glyphicon-floppy-saved:before{content:"\e173"}.glyphicon-floppy-remove:before{content:"\e174"}.glyphicon-floppy-save:before{content:"\e175"}.glyphicon-floppy-open:before{content:"\e176"}.glyphicon-credit-card:before{content:"\e177"}.glyphicon-transfer:before{content:"\e178"}.glyphicon-cutlery:before{content:"\e179"}.glyphicon-header:before{content:"\e180"}.glyphicon-compressed:before{content:"\e181"}.glyphicon-earphone:before{content:"\e182"}.glyphicon-phone-alt:before{content:"\e183"}.glyphicon-tower:before{content:"\e184"}.glyphicon-stats:before{content:"\e185"}.glyphicon-sd-video:before{content:"\e186"}.glyphicon-hd-video:before{content:"\e187"}.glyphicon-subtitles:before{content:"\e188"}.glyphicon-sound-stereo:before{content:"\e189"}.glyphicon-sound-dolby:before{content:"\e190"}.glyphicon-sound-5-1:before{content:"\e191"}.glyphicon-sound-6-1:before{content:"\e192"}.glyphicon-sound-7-1:before{content:"\e193"}.glyphicon-copyright-mark:before{content:"\e194"}.glyphicon-registration-mark:before{content:"\e195"}.glyphicon-cloud-download:before{content:"\e197"}.glyphicon-cloud-upload:before{content:"\e198"}.glyphicon-tree-conifer:before{content:"\e199"}.glyphicon-tree-deciduous:before{content:"\e200"}.glyphicon-cd:before{content:"\e201"}.glyphicon-save-file:before{content:"\e202"}.glyphicon-open-file:before{content:"\e203"}.glyphicon-level-up:before{content:"\e204"}.glyphicon-copy:before{content:"\e205"}.glyphicon-paste:before{content:"\e206"}.glyphicon-alert:before{content:"\e209"}.glyphicon-equalizer:before{content:"\e210"}.glyphicon-king:before{content:"\e211"}.glyphicon-queen:before{content:"\e212"}.glyphicon-pawn:before{content:"\e213"}.glyphicon-bishop:before{content:"\e214"}.glyphicon-knight:before{content:"\e215"}.glyphicon-baby-formula:before{content:"\e216"}.glyphicon-tent:before{content:"\26fa"}.glyphicon-blackboard:before{content:"\e218"}.glyphicon-bed:before{content:"\e219"}.glyphicon-apple:before{content:"\f8ff"}.glyphicon-erase:before{content:"\e221"}.glyphicon-hourglass:before{content:"\231b"}.glyphicon-lamp:before{content:"\e223"}.glyphicon-duplicate:before{content:"\e224"}.glyphicon-piggy-bank:before{content:"\e225"}.glyphicon-scissors:before{content:"\e226"}.glyphicon-bitcoin:before{content:"\e227"}.glyphicon-btc:before{content:"\e227"}.glyphicon-xbt:before{content:"\e227"}.glyphicon-yen:before{content:"\00a5"}.glyphicon-jpy:before{content:"\00a5"}.glyphicon-ruble:before{content:"\20bd"}.glyphicon-rub:before{content:"\20bd"}.glyphicon-scale:before{content:"\e230"}.glyphicon-ice-lolly:before{content:"\e231"}.glyphicon-ice-lolly-tasted:before{content:"\e232"}.glyphicon-education:before{content:"\e233"}.glyphicon-option-horizontal:before{content:"\e234"}.glyphicon-option-vertical:before{content:"\e235"}.glyphicon-menu-hamburger:before{content:"\e236"}.glyphicon-modal-window:before{content:"\e237"}.glyphicon-oil:before{content:"\e238"}.glyphicon-grain:before{content:"\e239"}.glyphicon-sunglasses:before{content:"\e240"}.glyphicon-text-size:before{content:"\e241"}.glyphicon-text-color:before{content:"\e242"}.glyphicon-text-background:before{content:"\e243"}.glyphicon-object-align-top:before{content:"\e244"}.glyphicon-object-align-bottom:before{content:"\e245"}.glyphicon-object-align-horizontal:before{content:"\e246"}.glyphicon-object-align-left:before{content:"\e247"}.glyphicon-object-align-vertical:before{content:"\e248"}.glyphicon-object-align-right:before{content:"\e249"}.glyphicon-triangle-right:before{content:"\e250"}.glyphicon-triangle-left:before{content:"\e251"}.glyphicon-triangle-bottom:before{content:"\e252"}.glyphicon-triangle-top:before{content:"\e253"}.glyphicon-console:before{content:"\e254"}.glyphicon-superscript:before{content:"\e255"}.glyphicon-subscript:before{content:"\e256"}.glyphicon-menu-left:before{content:"\e257"}.glyphicon-menu-right:before{content:"\e258"}.glyphicon-menu-down:before{content:"\e259"}.glyphicon-menu-up:before{content:"\e260"}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}:after,:before{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:10px;-webkit-tap-highlight-color:rgba(0,0,0,0)}body{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:1.42857143;color:#333;background-color:#fff}button,input,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit}a{color:#337ab7;text-decoration:none}a:focus,a:hover{color:#23527c;text-decoration:underline}a:focus{outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}figure{margin:0}img{vertical-align:middle}.carousel-inner>.item>a>img,.carousel-inner>.item>img,.img-responsive,.thumbnail a>img,.thumbnail>img{display:block;max-width:100%;height:auto}.img-rounded{border-radius:6px}.img-thumbnail{display:inline-block;max-width:100%;height:auto;padding:4px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.img-circle{border-radius:50%}hr{margin-top:20px;margin-bottom:20px;border:0;border-top:1px solid #eee}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}[role=button]{cursor:pointer}.h1,.h2,.h3,.h4,.h5,.h6,h1,h2,h3,h4,h5,h6{font-family:inherit;font-weight:500;line-height:1.1;color:inherit}.h1 .small,.h1 small,.h2 .small,.h2 small,.h3 .small,.h3 small,.h4 .small,.h4 small,.h5 .small,.h5 small,.h6 .small,.h6 small,h1 .small,h1 small,h2 .small,h2 small,h3 .small,h3 small,h4 .small,h4 small,h5 .small,h5 small,h6 .small,h6 small{font-weight:400;line-height:1;color:#777}.h1,.h2,.h3,h1,h2,h3{margin-top:20px;margin-bottom:10px}.h1 .small,.h1 small,.h2 .small,.h2 small,.h3 .small,.h3 small,h1 .small,h1 small,h2 .small,h2 small,h3 .small,h3 small{font-size:65%}.h4,.h5,.h6,h4,h5,h6{margin-top:10px;margin-bottom:10px}.h4 .small,.h4 small,.h5 .small,.h5 small,.h6 .small,.h6 small,h4 .small,h4 small,h5 .small,h5 small,h6 .small,h6 small{font-size:75%}.h1,h1{font-size:36px}.h2,h2{font-size:30px}.h3,h3{font-size:24px}.h4,h4{font-size:18px}.h5,h5{font-size:14px}.h6,h6{font-size:12px}p{margin:0 0 10px}.lead{margin-bottom:20px;font-size:16px;font-weight:300;line-height:1.4}@media (min-width:768px){.lead{font-size:21px}}.small,small{font-size:85%}.mark,mark{padding:.2em;background-color:#fcf8e3}.text-left{text-align:left}.text-right{text-align:right}.text-center{text-align:center}.text-justify{text-align:justify}.text-nowrap{white-space:nowrap}.text-lowercase{text-transform:lowercase}.text-uppercase{text-transform:uppercase}.text-capitalize{text-transform:capitalize}.text-muted{color:#777}.text-primary{color:#337ab7}a.text-primary:focus,a.text-primary:hover{color:#286090}.text-success{color:#3c763d}a.text-success:focus,a.text-success:hover{color:#2b542c}.text-info{color:#31708f}a.text-info:focus,a.text-info:hover{color:#245269}.text-warning{color:#8a6d3b}a.text-warning:focus,a.text-warning:hover{color:#66512c}.text-danger{color:#a94442}a.text-danger:focus,a.text-danger:hover{color:#843534}.bg-primary{color:#fff;background-color:#337ab7}a.bg-primary:focus,a.bg-primary:hover{background-color:#286090}.bg-success{background-color:#dff0d8}a.bg-success:focus,a.bg-success:hover{background-color:#c1e2b3}.bg-info{background-color:#d9edf7}a.bg-info:focus,a.bg-info:hover{background-color:#afd9ee}.bg-warning{background-color:#fcf8e3}a.bg-warning:focus,a.bg-warning:hover{background-color:#f7ecb5}.bg-danger{background-color:#f2dede}a.bg-danger:focus,a.bg-danger:hover{background-color:#e4b9b9}.page-header{padding-bottom:9px;margin:40px 0 20px;border-bottom:1px solid #eee}ol,ul{margin-top:0;margin-bottom:10px}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}.list-unstyled{padding-left:0;list-style:none}.list-inline{padding-left:0;margin-left:-5px;list-style:none}.list-inline>li{display:inline-block;padding-right:5px;padding-left:5px}dl{margin-top:0;margin-bottom:20px}dd,dt{line-height:1.42857143}dt{font-weight:700}dd{margin-left:0}@media (min-width:768px){.dl-horizontal dt{float:left;width:160px;overflow:hidden;clear:left;text-align:right;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:180px}}abbr[data-original-title],abbr[title]{cursor:help;border-bottom:1px dotted #777}.initialism{font-size:90%;text-transform:uppercase}blockquote{padding:10px 20px;margin:0 0 20px;font-size:17.5px;border-left:5px solid #eee}blockquote ol:last-child,blockquote p:last-child,blockquote ul:last-child{margin-bottom:0}blockquote .small,blockquote footer,blockquote small{display:block;font-size:80%;line-height:1.42857143;color:#777}blockquote .small:before,blockquote footer:before,blockquote small:before{content:'\2014 \00A0'}.blockquote-reverse,blockquote.pull-right{padding-right:15px;padding-left:0;text-align:right;border-right:5px solid #eee;border-left:0}.blockquote-reverse .small:before,.blockquote-reverse footer:before,.blockquote-reverse small:before,blockquote.pull-right .small:before,blockquote.pull-right footer:before,blockquote.pull-right small:before{content:''}.blockquote-reverse .small:after,.blockquote-reverse footer:after,.blockquote-reverse small:after,blockquote.pull-right .small:after,blockquote.pull-right footer:after,blockquote.pull-right small:after{content:'\00A0 \2014'}address{margin-bottom:20px;font-style:normal;line-height:1.42857143}code,kbd,pre,samp{font-family:Menlo,Monaco,Consolas,"Courier New",monospace}code{padding:2px 4px;font-size:90%;color:#c7254e;background-color:#f9f2f4;border-radius:4px}kbd{padding:2px 4px;font-size:90%;color:#fff;background-color:#333;border-radius:3px;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.25);box-shadow:inset 0 -1px 0 rgba(0,0,0,.25)}kbd kbd{padding:0;font-size:100%;font-weight:700;-webkit-box-shadow:none;box-shadow:none}pre{display:block;padding:9.5px;margin:0 0 10px;font-size:13px;line-height:1.42857143;color:#333;word-break:break-all;word-wrap:break-word;background-color:#f5f5f5;border:1px solid #ccc;border-radius:4px}pre code{padding:0;font-size:inherit;color:inherit;white-space:pre-wrap;background-color:transparent;border-radius:0}.pre-scrollable{max-height:340px;overflow-y:scroll}.container{padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}@media (min-width:768px){.container{width:750px}}@media (min-width:992px){.container{width:970px}}@media (min-width:1200px){.container{width:1170px}}.container-fluid{padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}.row{margin-right:-15px;margin-left:-15px}.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9{position:relative;min-height:1px;padding-right:15px;padding-left:15px}.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9{float:left}.col-xs-12{width:100%}.col-xs-11{width:91.66666667%}.col-xs-10{width:83.33333333%}.col-xs-9{width:75%}.col-xs-8{width:66.66666667%}.col-xs-7{width:58.33333333%}.col-xs-6{width:50%}.col-xs-5{width:41.66666667%}.col-xs-4{width:33.33333333%}.col-xs-3{width:25%}.col-xs-2{width:16.66666667%}.col-xs-1{width:8.33333333%}.col-xs-pull-12{right:100%}.col-xs-pull-11{right:91.66666667%}.col-xs-pull-10{right:83.33333333%}.col-xs-pull-9{right:75%}.col-xs-pull-8{right:66.66666667%}.col-xs-pull-7{right:58.33333333%}.col-xs-pull-6{right:50%}.col-xs-pull-5{right:41.66666667%}.col-xs-pull-4{right:33.33333333%}.col-xs-pull-3{right:25%}.col-xs-pull-2{right:16.66666667%}.col-xs-pull-1{right:8.33333333%}.col-xs-pull-0{right:auto}.col-xs-push-12{left:100%}.col-xs-push-11{left:91.66666667%}.col-xs-push-10{left:83.33333333%}.col-xs-push-9{left:75%}.col-xs-push-8{left:66.66666667%}.col-xs-push-7{left:58.33333333%}.col-xs-push-6{left:50%}.col-xs-push-5{left:41.66666667%}.col-xs-push-4{left:33.33333333%}.col-xs-push-3{left:25%}.col-xs-push-2{left:16.66666667%}.col-xs-push-1{left:8.33333333%}.col-xs-push-0{left:auto}.col-xs-offset-12{margin-left:100%}.col-xs-offset-11{margin-left:91.66666667%}.col-xs-offset-10{margin-left:83.33333333%}.col-xs-offset-9{margin-left:75%}.col-xs-offset-8{margin-left:66.66666667%}.col-xs-offset-7{margin-left:58.33333333%}.col-xs-offset-6{margin-left:50%}.col-xs-offset-5{margin-left:41.66666667%}.col-xs-offset-4{margin-left:33.33333333%}.col-xs-offset-3{margin-left:25%}.col-xs-offset-2{margin-left:16.66666667%}.col-xs-offset-1{margin-left:8.33333333%}.col-xs-offset-0{margin-left:0}@media (min-width:768px){.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9{float:left}.col-sm-12{width:100%}.col-sm-11{width:91.66666667%}.col-sm-10{width:83.33333333%}.col-sm-9{width:75%}.col-sm-8{width:66.66666667%}.col-sm-7{width:58.33333333%}.col-sm-6{width:50%}.col-sm-5{width:41.66666667%}.col-sm-4{width:33.33333333%}.col-sm-3{width:25%}.col-sm-2{width:16.66666667%}.col-sm-1{width:8.33333333%}.col-sm-pull-12{right:100%}.col-sm-pull-11{right:91.66666667%}.col-sm-pull-10{right:83.33333333%}.col-sm-pull-9{right:75%}.col-sm-pull-8{right:66.66666667%}.col-sm-pull-7{right:58.33333333%}.col-sm-pull-6{right:50%}.col-sm-pull-5{right:41.66666667%}.col-sm-pull-4{right:33.33333333%}.col-sm-pull-3{right:25%}.col-sm-pull-2{right:16.66666667%}.col-sm-pull-1{right:8.33333333%}.col-sm-pull-0{right:auto}.col-sm-push-12{left:100%}.col-sm-push-11{left:91.66666667%}.col-sm-push-10{left:83.33333333%}.col-sm-push-9{left:75%}.col-sm-push-8{left:66.66666667%}.col-sm-push-7{left:58.33333333%}.col-sm-push-6{left:50%}.col-sm-push-5{left:41.66666667%}.col-sm-push-4{left:33.33333333%}.col-sm-push-3{left:25%}.col-sm-push-2{left:16.66666667%}.col-sm-push-1{left:8.33333333%}.col-sm-push-0{left:auto}.col-sm-offset-12{margin-left:100%}.col-sm-offset-11{margin-left:91.66666667%}.col-sm-offset-10{margin-left:83.33333333%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-8{margin-left:66.66666667%}.col-sm-offset-7{margin-left:58.33333333%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-5{margin-left:41.66666667%}.col-sm-offset-4{margin-left:33.33333333%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-2{margin-left:16.66666667%}.col-sm-offset-1{margin-left:8.33333333%}.col-sm-offset-0{margin-left:0}}@media (min-width:992px){.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9{float:left}.col-md-12{width:100%}.col-md-11{width:91.66666667%}.col-md-10{width:83.33333333%}.col-md-9{width:75%}.col-md-8{width:66.66666667%}.col-md-7{width:58.33333333%}.col-md-6{width:50%}.col-md-5{width:41.66666667%}.col-md-4{width:33.33333333%}.col-md-3{width:25%}.col-md-2{width:16.66666667%}.col-md-1{width:8.33333333%}.col-md-pull-12{right:100%}.col-md-pull-11{right:91.66666667%}.col-md-pull-10{right:83.33333333%}.col-md-pull-9{right:75%}.col-md-pull-8{right:66.66666667%}.col-md-pull-7{right:58.33333333%}.col-md-pull-6{right:50%}.col-md-pull-5{right:41.66666667%}.col-md-pull-4{right:33.33333333%}.col-md-pull-3{right:25%}.col-md-pull-2{right:16.66666667%}.col-md-pull-1{right:8.33333333%}.col-md-pull-0{right:auto}.col-md-push-12{left:100%}.col-md-push-11{left:91.66666667%}.col-md-push-10{left:83.33333333%}.col-md-push-9{left:75%}.col-md-push-8{left:66.66666667%}.col-md-push-7{left:58.33333333%}.col-md-push-6{left:50%}.col-md-push-5{left:41.66666667%}.col-md-push-4{left:33.33333333%}.col-md-push-3{left:25%}.col-md-push-2{left:16.66666667%}.col-md-push-1{left:8.33333333%}.col-md-push-0{left:auto}.col-md-offset-12{margin-left:100%}.col-md-offset-11{margin-left:91.66666667%}.col-md-offset-10{margin-left:83.33333333%}.col-md-offset-9{margin-left:75%}.col-md-offset-8{margin-left:66.66666667%}.col-md-offset-7{margin-left:58.33333333%}.col-md-offset-6{margin-left:50%}.col-md-offset-5{margin-left:41.66666667%}.col-md-offset-4{margin-left:33.33333333%}.col-md-offset-3{margin-left:25%}.col-md-offset-2{margin-left:16.66666667%}.col-md-offset-1{margin-left:8.33333333%}.col-md-offset-0{margin-left:0}}@media (min-width:1200px){.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9{float:left}.col-lg-12{width:100%}.col-lg-11{width:91.66666667%}.col-lg-10{width:83.33333333%}.col-lg-9{width:75%}.col-lg-8{width:66.66666667%}.col-lg-7{width:58.33333333%}.col-lg-6{width:50%}.col-lg-5{width:41.66666667%}.col-lg-4{width:33.33333333%}.col-lg-3{width:25%}.col-lg-2{width:16.66666667%}.col-lg-1{width:8.33333333%}.col-lg-pull-12{right:100%}.col-lg-pull-11{right:91.66666667%}.col-lg-pull-10{right:83.33333333%}.col-lg-pull-9{right:75%}.col-lg-pull-8{right:66.66666667%}.col-lg-pull-7{right:58.33333333%}.col-lg-pull-6{right:50%}.col-lg-pull-5{right:41.66666667%}.col-lg-pull-4{right:33.33333333%}.col-lg-pull-3{right:25%}.col-lg-pull-2{right:16.66666667%}.col-lg-pull-1{right:8.33333333%}.col-lg-pull-0{right:auto}.col-lg-push-12{left:100%}.col-lg-push-11{left:91.66666667%}.col-lg-push-10{left:83.33333333%}.col-lg-push-9{left:75%}.col-lg-push-8{left:66.66666667%}.col-lg-push-7{left:58.33333333%}.col-lg-push-6{left:50%}.col-lg-push-5{left:41.66666667%}.col-lg-push-4{left:33.33333333%}.col-lg-push-3{left:25%}.col-lg-push-2{left:16.66666667%}.col-lg-push-1{left:8.33333333%}.col-lg-push-0{left:auto}.col-lg-offset-12{margin-left:100%}.col-lg-offset-11{margin-left:91.66666667%}.col-lg-offset-10{margin-left:83.33333333%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-8{margin-left:66.66666667%}.col-lg-offset-7{margin-left:58.33333333%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-5{margin-left:41.66666667%}.col-lg-offset-4{margin-left:33.33333333%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-2{margin-left:16.66666667%}.col-lg-offset-1{margin-left:8.33333333%}.col-lg-offset-0{margin-left:0}}table{background-color:transparent}caption{padding-top:8px;padding-bottom:8px;color:#777;text-align:left}th{text-align:left}.table{width:100%;max-width:100%;margin-bottom:20px}.table>tbody>tr>td,.table>tbody>tr>th,.table>tfoot>tr>td,.table>tfoot>tr>th,.table>thead>tr>td,.table>thead>tr>th{padding:8px;line-height:1.42857143;vertical-align:top;border-top:1px solid #ddd}.table>thead>tr>th{vertical-align:bottom;border-bottom:2px solid #ddd}.table>caption+thead>tr:first-child>td,.table>caption+thead>tr:first-child>th,.table>colgroup+thead>tr:first-child>td,.table>colgroup+thead>tr:first-child>th,.table>thead:first-child>tr:first-child>td,.table>thead:first-child>tr:first-child>th{border-top:0}.table>tbody+tbody{border-top:2px solid #ddd}.table .table{background-color:#fff}.table-condensed>tbody>tr>td,.table-condensed>tbody>tr>th,.table-condensed>tfoot>tr>td,.table-condensed>tfoot>tr>th,.table-condensed>thead>tr>td,.table-condensed>thead>tr>th{padding:5px}.table-bordered{border:1px solid #ddd}.table-bordered>tbody>tr>td,.table-bordered>tbody>tr>th,.table-bordered>tfoot>tr>td,.table-bordered>tfoot>tr>th,.table-bordered>thead>tr>td,.table-bordered>thead>tr>th{border:1px solid #ddd}.table-bordered>thead>tr>td,.table-bordered>thead>tr>th{border-bottom-width:2px}.table-striped>tbody>tr:nth-of-type(odd){background-color:#f9f9f9}.table-hover>tbody>tr:hover{background-color:#f5f5f5}table col[class*=col-]{position:static;display:table-column;float:none}table td[class*=col-],table th[class*=col-]{position:static;display:table-cell;float:none}.table>tbody>tr.active>td,.table>tbody>tr.active>th,.table>tbody>tr>td.active,.table>tbody>tr>th.active,.table>tfoot>tr.active>td,.table>tfoot>tr.active>th,.table>tfoot>tr>td.active,.table>tfoot>tr>th.active,.table>thead>tr.active>td,.table>thead>tr.active>th,.table>thead>tr>td.active,.table>thead>tr>th.active{background-color:#f5f5f5}.table-hover>tbody>tr.active:hover>td,.table-hover>tbody>tr.active:hover>th,.table-hover>tbody>tr:hover>.active,.table-hover>tbody>tr>td.active:hover,.table-hover>tbody>tr>th.active:hover{background-color:#e8e8e8}.table>tbody>tr.success>td,.table>tbody>tr.success>th,.table>tbody>tr>td.success,.table>tbody>tr>th.success,.table>tfoot>tr.success>td,.table>tfoot>tr.success>th,.table>tfoot>tr>td.success,.table>tfoot>tr>th.success,.table>thead>tr.success>td,.table>thead>tr.success>th,.table>thead>tr>td.success,.table>thead>tr>th.success{background-color:#dff0d8}.table-hover>tbody>tr.success:hover>td,.table-hover>tbody>tr.success:hover>th,.table-hover>tbody>tr:hover>.success,.table-hover>tbody>tr>td.success:hover,.table-hover>tbody>tr>th.success:hover{background-color:#d0e9c6}.table>tbody>tr.info>td,.table>tbody>tr.info>th,.table>tbody>tr>td.info,.table>tbody>tr>th.info,.table>tfoot>tr.info>td,.table>tfoot>tr.info>th,.table>tfoot>tr>td.info,.table>tfoot>tr>th.info,.table>thead>tr.info>td,.table>thead>tr.info>th,.table>thead>tr>td.info,.table>thead>tr>th.info{background-color:#d9edf7}.table-hover>tbody>tr.info:hover>td,.table-hover>tbody>tr.info:hover>th,.table-hover>tbody>tr:hover>.info,.table-hover>tbody>tr>td.info:hover,.table-hover>tbody>tr>th.info:hover{background-color:#c4e3f3}.table>tbody>tr.warning>td,.table>tbody>tr.warning>th,.table>tbody>tr>td.warning,.table>tbody>tr>th.warning,.table>tfoot>tr.warning>td,.table>tfoot>tr.warning>th,.table>tfoot>tr>td.warning,.table>tfoot>tr>th.warning,.table>thead>tr.warning>td,.table>thead>tr.warning>th,.table>thead>tr>td.warning,.table>thead>tr>th.warning{background-color:#fcf8e3}.table-hover>tbody>tr.warning:hover>td,.table-hover>tbody>tr.warning:hover>th,.table-hover>tbody>tr:hover>.warning,.table-hover>tbody>tr>td.warning:hover,.table-hover>tbody>tr>th.warning:hover{background-color:#faf2cc}.table>tbody>tr.danger>td,.table>tbody>tr.danger>th,.table>tbody>tr>td.danger,.table>tbody>tr>th.danger,.table>tfoot>tr.danger>td,.table>tfoot>tr.danger>th,.table>tfoot>tr>td.danger,.table>tfoot>tr>th.danger,.table>thead>tr.danger>td,.table>thead>tr.danger>th,.table>thead>tr>td.danger,.table>thead>tr>th.danger{background-color:#f2dede}.table-hover>tbody>tr.danger:hover>td,.table-hover>tbody>tr.danger:hover>th,.table-hover>tbody>tr:hover>.danger,.table-hover>tbody>tr>td.danger:hover,.table-hover>tbody>tr>th.danger:hover{background-color:#ebcccc}.table-responsive{min-height:.01%;overflow-x:auto}@media screen and (max-width:767px){.table-responsive{width:100%;margin-bottom:15px;overflow-y:hidden;-ms-overflow-style:-ms-autohiding-scrollbar;border:1px solid #ddd}.table-responsive>.table{margin-bottom:0}.table-responsive>.table>tbody>tr>td,.table-responsive>.table>tbody>tr>th,.table-responsive>.table>tfoot>tr>td,.table-responsive>.table>tfoot>tr>th,.table-responsive>.table>thead>tr>td,.table-responsive>.table>thead>tr>th{white-space:nowrap}.table-responsive>.table-bordered{border:0}.table-responsive>.table-bordered>tbody>tr>td:first-child,.table-responsive>.table-bordered>tbody>tr>th:first-child,.table-responsive>.table-bordered>tfoot>tr>td:first-child,.table-responsive>.table-bordered>tfoot>tr>th:first-child,.table-responsive>.table-bordered>thead>tr>td:first-child,.table-responsive>.table-bordered>thead>tr>th:first-child{border-left:0}.table-responsive>.table-bordered>tbody>tr>td:last-child,.table-responsive>.table-bordered>tbody>tr>th:last-child,.table-responsive>.table-bordered>tfoot>tr>td:last-child,.table-responsive>.table-bordered>tfoot>tr>th:last-child,.table-responsive>.table-bordered>thead>tr>td:last-child,.table-responsive>.table-bordered>thead>tr>th:last-child{border-right:0}.table-responsive>.table-bordered>tbody>tr:last-child>td,.table-responsive>.table-bordered>tbody>tr:last-child>th,.table-responsive>.table-bordered>tfoot>tr:last-child>td,.table-responsive>.table-bordered>tfoot>tr:last-child>th{border-bottom:0}}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;padding:0;margin-bottom:20px;font-size:21px;line-height:inherit;color:#333;border:0;border-bottom:1px solid #e5e5e5}label{display:inline-block;max-width:100%;margin-bottom:5px;font-weight:700}input[type=search]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}input[type=checkbox],input[type=radio]{margin:4px 0 0;margin-top:1px\9;line-height:normal}input[type=file]{display:block}input[type=range]{display:block;width:100%}select[multiple],select[size]{height:auto}input[type=file]:focus,input[type=checkbox]:focus,input[type=radio]:focus{outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}output{display:block;padding-top:7px;font-size:14px;line-height:1.42857143;color:#555}.form-control{display:block;width:100%;height:34px;padding:6px 12px;font-size:14px;line-height:1.42857143;color:#555;background-color:#fff;background-image:none;border:1px solid #ccc;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-webkit-transition:border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;-o-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s}.form-control:focus{border-color:#66afe9;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6)}.form-control::-moz-placeholder{color:#999;opacity:1}.form-control:-ms-input-placeholder{color:#999}.form-control::-webkit-input-placeholder{color:#999}.form-control::-ms-expand{background-color:transparent;border:0}.form-control[disabled],.form-control[readonly],fieldset[disabled] .form-control{background-color:#eee;opacity:1}.form-control[disabled],fieldset[disabled] .form-control{cursor:not-allowed}textarea.form-control{height:auto}input[type=search]{-webkit-appearance:none}@media screen and (-webkit-min-device-pixel-ratio:0){input[type=date].form-control,input[type=time].form-control,input[type=datetime-local].form-control,input[type=month].form-control{line-height:34px}.input-group-sm input[type=date],.input-group-sm input[type=time],.input-group-sm input[type=datetime-local],.input-group-sm input[type=month],input[type=date].input-sm,input[type=time].input-sm,input[type=datetime-local].input-sm,input[type=month].input-sm{line-height:30px}.input-group-lg input[type=date],.input-group-lg input[type=time],.input-group-lg input[type=datetime-local],.input-group-lg input[type=month],input[type=date].input-lg,input[type=time].input-lg,input[type=datetime-local].input-lg,input[type=month].input-lg{line-height:46px}}.form-group{margin-bottom:15px}.checkbox,.radio{position:relative;display:block;margin-top:10px;margin-bottom:10px}.checkbox label,.radio label{min-height:20px;padding-left:20px;margin-bottom:0;font-weight:400;cursor:pointer}.checkbox input[type=checkbox],.checkbox-inline input[type=checkbox],.radio input[type=radio],.radio-inline input[type=radio]{position:absolute;margin-top:4px\9;margin-left:-20px}.checkbox+.checkbox,.radio+.radio{margin-top:-5px}.checkbox-inline,.radio-inline{position:relative;display:inline-block;padding-left:20px;margin-bottom:0;font-weight:400;vertical-align:middle;cursor:pointer}.checkbox-inline+.checkbox-inline,.radio-inline+.radio-inline{margin-top:0;margin-left:10px}fieldset[disabled] input[type=checkbox],fieldset[disabled] input[type=radio],input[type=checkbox].disabled,input[type=checkbox][disabled],input[type=radio].disabled,input[type=radio][disabled]{cursor:not-allowed}.checkbox-inline.disabled,.radio-inline.disabled,fieldset[disabled] .checkbox-inline,fieldset[disabled] .radio-inline{cursor:not-allowed}.checkbox.disabled label,.radio.disabled label,fieldset[disabled] .checkbox label,fieldset[disabled] .radio label{cursor:not-allowed}.form-control-static{min-height:34px;padding-top:7px;padding-bottom:7px;margin-bottom:0}.form-control-static.input-lg,.form-control-static.input-sm{padding-right:0;padding-left:0}.input-sm{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-sm{height:30px;line-height:30px}select[multiple].input-sm,textarea.input-sm{height:auto}.form-group-sm .form-control{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.form-group-sm select.form-control{height:30px;line-height:30px}.form-group-sm select[multiple].form-control,.form-group-sm textarea.form-control{height:auto}.form-group-sm .form-control-static{height:30px;min-height:32px;padding:6px 10px;font-size:12px;line-height:1.5}.input-lg{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}select.input-lg{height:46px;line-height:46px}select[multiple].input-lg,textarea.input-lg{height:auto}.form-group-lg .form-control{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}.form-group-lg select.form-control{height:46px;line-height:46px}.form-group-lg select[multiple].form-control,.form-group-lg textarea.form-control{height:auto}.form-group-lg .form-control-static{height:46px;min-height:38px;padding:11px 16px;font-size:18px;line-height:1.3333333}.has-feedback{position:relative}.has-feedback .form-control{padding-right:42.5px}.form-control-feedback{position:absolute;top:0;right:0;z-index:2;display:block;width:34px;height:34px;line-height:34px;text-align:center;pointer-events:none}.form-group-lg .form-control+.form-control-feedback,.input-group-lg+.form-control-feedback,.input-lg+.form-control-feedback{width:46px;height:46px;line-height:46px}.form-group-sm .form-control+.form-control-feedback,.input-group-sm+.form-control-feedback,.input-sm+.form-control-feedback{width:30px;height:30px;line-height:30px}.has-success .checkbox,.has-success .checkbox-inline,.has-success .control-label,.has-success .help-block,.has-success .radio,.has-success .radio-inline,.has-success.checkbox label,.has-success.checkbox-inline label,.has-success.radio label,.has-success.radio-inline label{color:#3c763d}.has-success .form-control{border-color:#3c763d;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-success .form-control:focus{border-color:#2b542c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168}.has-success .input-group-addon{color:#3c763d;background-color:#dff0d8;border-color:#3c763d}.has-success .form-control-feedback{color:#3c763d}.has-warning .checkbox,.has-warning .checkbox-inline,.has-warning .control-label,.has-warning .help-block,.has-warning .radio,.has-warning .radio-inline,.has-warning.checkbox label,.has-warning.checkbox-inline label,.has-warning.radio label,.has-warning.radio-inline label{color:#8a6d3b}.has-warning .form-control{border-color:#8a6d3b;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-warning .form-control:focus{border-color:#66512c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b}.has-warning .input-group-addon{color:#8a6d3b;background-color:#fcf8e3;border-color:#8a6d3b}.has-warning .form-control-feedback{color:#8a6d3b}.has-error .checkbox,.has-error .checkbox-inline,.has-error .control-label,.has-error .help-block,.has-error .radio,.has-error .radio-inline,.has-error.checkbox label,.has-error.checkbox-inline label,.has-error.radio label,.has-error.radio-inline label{color:#a94442}.has-error .form-control{border-color:#a94442;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-error .form-control:focus{border-color:#843534;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483}.has-error .input-group-addon{color:#a94442;background-color:#f2dede;border-color:#a94442}.has-error .form-control-feedback{color:#a94442}.has-feedback label~.form-control-feedback{top:25px}.has-feedback label.sr-only~.form-control-feedback{top:0}.help-block{display:block;margin-top:5px;margin-bottom:10px;color:#737373}@media (min-width:768px){.form-inline .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.form-inline .form-control{display:inline-block;width:auto;vertical-align:middle}.form-inline .form-control-static{display:inline-block}.form-inline .input-group{display:inline-table;vertical-align:middle}.form-inline .input-group .form-control,.form-inline .input-group .input-group-addon,.form-inline .input-group .input-group-btn{width:auto}.form-inline .input-group>.form-control{width:100%}.form-inline .control-label{margin-bottom:0;vertical-align:middle}.form-inline .checkbox,.form-inline .radio{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.form-inline .checkbox label,.form-inline .radio label{padding-left:0}.form-inline .checkbox input[type=checkbox],.form-inline .radio input[type=radio]{position:relative;margin-left:0}.form-inline .has-feedback .form-control-feedback{top:0}}.form-horizontal .checkbox,.form-horizontal .checkbox-inline,.form-horizontal .radio,.form-horizontal .radio-inline{padding-top:7px;margin-top:0;margin-bottom:0}.form-horizontal .checkbox,.form-horizontal .radio{min-height:27px}.form-horizontal .form-group{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.form-horizontal .control-label{padding-top:7px;margin-bottom:0;text-align:right}}.form-horizontal .has-feedback .form-control-feedback{right:15px}@media (min-width:768px){.form-horizontal .form-group-lg .control-label{padding-top:11px;font-size:18px}}@media (min-width:768px){.form-horizontal .form-group-sm .control-label{padding-top:6px;font-size:12px}}.btn{display:inline-block;padding:6px 12px;margin-bottom:0;font-size:14px;font-weight:400;line-height:1.42857143;text-align:center;white-space:nowrap;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-image:none;border:1px solid transparent;border-radius:4px}.btn.active.focus,.btn.active:focus,.btn.focus,.btn:active.focus,.btn:active:focus,.btn:focus{outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.btn.focus,.btn:focus,.btn:hover{color:#333;text-decoration:none}.btn.active,.btn:active{background-image:none;outline:0;-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn.disabled,.btn[disabled],fieldset[disabled] .btn{cursor:not-allowed;filter:alpha(opacity=65);-webkit-box-shadow:none;box-shadow:none;opacity:.65}a.btn.disabled,fieldset[disabled] a.btn{pointer-events:none}.btn-default{color:#333;background-color:#fff;border-color:#ccc}.btn-default.focus,.btn-default:focus{color:#333;background-color:#e6e6e6;border-color:#8c8c8c}.btn-default:hover{color:#333;background-color:#e6e6e6;border-color:#adadad}.btn-default.active,.btn-default:active,.open>.dropdown-toggle.btn-default{color:#333;background-color:#e6e6e6;border-color:#adadad}.btn-default.active.focus,.btn-default.active:focus,.btn-default.active:hover,.btn-default:active.focus,.btn-default:active:focus,.btn-default:active:hover,.open>.dropdown-toggle.btn-default.focus,.open>.dropdown-toggle.btn-default:focus,.open>.dropdown-toggle.btn-default:hover{color:#333;background-color:#d4d4d4;border-color:#8c8c8c}.btn-default.active,.btn-default:active,.open>.dropdown-toggle.btn-default{background-image:none}.btn-default.disabled.focus,.btn-default.disabled:focus,.btn-default.disabled:hover,.btn-default[disabled].focus,.btn-default[disabled]:focus,.btn-default[disabled]:hover,fieldset[disabled] .btn-default.focus,fieldset[disabled] .btn-default:focus,fieldset[disabled] .btn-default:hover{background-color:#fff;border-color:#ccc}.btn-default .badge{color:#fff;background-color:#333}.btn-primary{color:#fff;background-color:#337ab7;border-color:#2e6da4}.btn-primary.focus,.btn-primary:focus{color:#fff;background-color:#286090;border-color:#122b40}.btn-primary:hover{color:#fff;background-color:#286090;border-color:#204d74}.btn-primary.active,.btn-primary:active,.open>.dropdown-toggle.btn-primary{color:#fff;background-color:#286090;border-color:#204d74}.btn-primary.active.focus,.btn-primary.active:focus,.btn-primary.active:hover,.btn-primary:active.focus,.btn-primary:active:focus,.btn-primary:active:hover,.open>.dropdown-toggle.btn-primary.focus,.open>.dropdown-toggle.btn-primary:focus,.open>.dropdown-toggle.btn-primary:hover{color:#fff;background-color:#204d74;border-color:#122b40}.btn-primary.active,.btn-primary:active,.open>.dropdown-toggle.btn-primary{background-image:none}.btn-primary.disabled.focus,.btn-primary.disabled:focus,.btn-primary.disabled:hover,.btn-primary[disabled].focus,.btn-primary[disabled]:focus,.btn-primary[disabled]:hover,fieldset[disabled] .btn-primary.focus,fieldset[disabled] .btn-primary:focus,fieldset[disabled] .btn-primary:hover{background-color:#337ab7;border-color:#2e6da4}.btn-primary .badge{color:#337ab7;background-color:#fff}.btn-success{color:#fff;background-color:#5cb85c;border-color:#4cae4c}.btn-success.focus,.btn-success:focus{color:#fff;background-color:#449d44;border-color:#255625}.btn-success:hover{color:#fff;background-color:#449d44;border-color:#398439}.btn-success.active,.btn-success:active,.open>.dropdown-toggle.btn-success{color:#fff;background-color:#449d44;border-color:#398439}.btn-success.active.focus,.btn-success.active:focus,.btn-success.active:hover,.btn-success:active.focus,.btn-success:active:focus,.btn-success:active:hover,.open>.dropdown-toggle.btn-success.focus,.open>.dropdown-toggle.btn-success:focus,.open>.dropdown-toggle.btn-success:hover{color:#fff;background-color:#398439;border-color:#255625}.btn-success.active,.btn-success:active,.open>.dropdown-toggle.btn-success{background-image:none}.btn-success.disabled.focus,.btn-success.disabled:focus,.btn-success.disabled:hover,.btn-success[disabled].focus,.btn-success[disabled]:focus,.btn-success[disabled]:hover,fieldset[disabled] .btn-success.focus,fieldset[disabled] .btn-success:focus,fieldset[disabled] .btn-success:hover{background-color:#5cb85c;border-color:#4cae4c}.btn-success .badge{color:#5cb85c;background-color:#fff}.btn-info{color:#fff;background-color:#5bc0de;border-color:#46b8da}.btn-info.focus,.btn-info:focus{color:#fff;background-color:#31b0d5;border-color:#1b6d85}.btn-info:hover{color:#fff;background-color:#31b0d5;border-color:#269abc}.btn-info.active,.btn-info:active,.open>.dropdown-toggle.btn-info{color:#fff;background-color:#31b0d5;border-color:#269abc}.btn-info.active.focus,.btn-info.active:focus,.btn-info.active:hover,.btn-info:active.focus,.btn-info:active:focus,.btn-info:active:hover,.open>.dropdown-toggle.btn-info.focus,.open>.dropdown-toggle.btn-info:focus,.open>.dropdown-toggle.btn-info:hover{color:#fff;background-color:#269abc;border-color:#1b6d85}.btn-info.active,.btn-info:active,.open>.dropdown-toggle.btn-info{background-image:none}.btn-info.disabled.focus,.btn-info.disabled:focus,.btn-info.disabled:hover,.btn-info[disabled].focus,.btn-info[disabled]:focus,.btn-info[disabled]:hover,fieldset[disabled] .btn-info.focus,fieldset[disabled] .btn-info:focus,fieldset[disabled] .btn-info:hover{background-color:#5bc0de;border-color:#46b8da}.btn-info .badge{color:#5bc0de;background-color:#fff}.btn-warning{color:#fff;background-color:#f0ad4e;border-color:#eea236}.btn-warning.focus,.btn-warning:focus{color:#fff;background-color:#ec971f;border-color:#985f0d}.btn-warning:hover{color:#fff;background-color:#ec971f;border-color:#d58512}.btn-warning.active,.btn-warning:active,.open>.dropdown-toggle.btn-warning{color:#fff;background-color:#ec971f;border-color:#d58512}.btn-warning.active.focus,.btn-warning.active:focus,.btn-warning.active:hover,.btn-warning:active.focus,.btn-warning:active:focus,.btn-warning:active:hover,.open>.dropdown-toggle.btn-warning.focus,.open>.dropdown-toggle.btn-warning:focus,.open>.dropdown-toggle.btn-warning:hover{color:#fff;background-color:#d58512;border-color:#985f0d}.btn-warning.active,.btn-warning:active,.open>.dropdown-toggle.btn-warning{background-image:none}.btn-warning.disabled.focus,.btn-warning.disabled:focus,.btn-warning.disabled:hover,.btn-warning[disabled].focus,.btn-warning[disabled]:focus,.btn-warning[disabled]:hover,fieldset[disabled] .btn-warning.focus,fieldset[disabled] .btn-warning:focus,fieldset[disabled] .btn-warning:hover{background-color:#f0ad4e;border-color:#eea236}.btn-warning .badge{color:#f0ad4e;background-color:#fff}.btn-danger{color:#fff;background-color:#d9534f;border-color:#d43f3a}.btn-danger.focus,.btn-danger:focus{color:#fff;background-color:#c9302c;border-color:#761c19}.btn-danger:hover{color:#fff;background-color:#c9302c;border-color:#ac2925}.btn-danger.active,.btn-danger:active,.open>.dropdown-toggle.btn-danger{color:#fff;background-color:#c9302c;border-color:#ac2925}.btn-danger.active.focus,.btn-danger.active:focus,.btn-danger.active:hover,.btn-danger:active.focus,.btn-danger:active:focus,.btn-danger:active:hover,.open>.dropdown-toggle.btn-danger.focus,.open>.dropdown-toggle.btn-danger:focus,.open>.dropdown-toggle.btn-danger:hover{color:#fff;background-color:#ac2925;border-color:#761c19}.btn-danger.active,.btn-danger:active,.open>.dropdown-toggle.btn-danger{background-image:none}.btn-danger.disabled.focus,.btn-danger.disabled:focus,.btn-danger.disabled:hover,.btn-danger[disabled].focus,.btn-danger[disabled]:focus,.btn-danger[disabled]:hover,fieldset[disabled] .btn-danger.focus,fieldset[disabled] .btn-danger:focus,fieldset[disabled] .btn-danger:hover{background-color:#d9534f;border-color:#d43f3a}.btn-danger .badge{color:#d9534f;background-color:#fff}.btn-link{font-weight:400;color:#337ab7;border-radius:0}.btn-link,.btn-link.active,.btn-link:active,.btn-link[disabled],fieldset[disabled] .btn-link{background-color:transparent;-webkit-box-shadow:none;box-shadow:none}.btn-link,.btn-link:active,.btn-link:focus,.btn-link:hover{border-color:transparent}.btn-link:focus,.btn-link:hover{color:#23527c;text-decoration:underline;background-color:transparent}.btn-link[disabled]:focus,.btn-link[disabled]:hover,fieldset[disabled] .btn-link:focus,fieldset[disabled] .btn-link:hover{color:#777;text-decoration:none}.btn-group-lg>.btn,.btn-lg{padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}.btn-group-sm>.btn,.btn-sm{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.btn-group-xs>.btn,.btn-xs{padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px}.btn-block{display:block;width:100%}.btn-block+.btn-block{margin-top:5px}input[type=button].btn-block,input[type=reset].btn-block,input[type=submit].btn-block{width:100%}.fade{opacity:0;-webkit-transition:opacity .15s linear;-o-transition:opacity .15s linear;transition:opacity .15s linear}.fade.in{opacity:1}.collapse{display:none}.collapse.in{display:block}tr.collapse.in{display:table-row}tbody.collapse.in{display:table-row-group}.collapsing{position:relative;height:0;overflow:hidden;-webkit-transition-timing-function:ease;-o-transition-timing-function:ease;transition-timing-function:ease;-webkit-transition-duration:.35s;-o-transition-duration:.35s;transition-duration:.35s;-webkit-transition-property:height,visibility;-o-transition-property:height,visibility;transition-property:height,visibility}.caret{display:inline-block;width:0;height:0;margin-left:2px;vertical-align:middle;border-top:4px dashed;border-top:4px solid\9;border-right:4px solid transparent;border-left:4px solid transparent}.dropdown,.dropup{position:relative}.dropdown-toggle:focus{outline:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;font-size:14px;text-align:left;list-style:none;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.15);border-radius:4px;-webkit-box-shadow:0 6px 12px rgba(0,0,0,.175);box-shadow:0 6px 12px rgba(0,0,0,.175)}.dropdown-menu.pull-right{right:0;left:auto}.dropdown-menu .divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.dropdown-menu>li>a{display:block;padding:3px 20px;clear:both;font-weight:400;line-height:1.42857143;color:#333;white-space:nowrap}.dropdown-menu>li>a:focus,.dropdown-menu>li>a:hover{color:#262626;text-decoration:none;background-color:#f5f5f5}.dropdown-menu>.active>a,.dropdown-menu>.active>a:focus,.dropdown-menu>.active>a:hover{color:#fff;text-decoration:none;background-color:#337ab7;outline:0}.dropdown-menu>.disabled>a,.dropdown-menu>.disabled>a:focus,.dropdown-menu>.disabled>a:hover{color:#777}.dropdown-menu>.disabled>a:focus,.dropdown-menu>.disabled>a:hover{text-decoration:none;cursor:not-allowed;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.open>.dropdown-menu{display:block}.open>a{outline:0}.dropdown-menu-right{right:0;left:auto}.dropdown-menu-left{right:auto;left:0}.dropdown-header{display:block;padding:3px 20px;font-size:12px;line-height:1.42857143;color:#777;white-space:nowrap}.dropdown-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:990}.pull-right>.dropdown-menu{right:0;left:auto}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{content:"";border-top:0;border-bottom:4px dashed;border-bottom:4px solid\9}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:2px}@media (min-width:768px){.navbar-right .dropdown-menu{right:0;left:auto}.navbar-right .dropdown-menu-left{right:auto;left:0}}.btn-group,.btn-group-vertical{position:relative;display:inline-block;vertical-align:middle}.btn-group-vertical>.btn,.btn-group>.btn{position:relative;float:left}.btn-group-vertical>.btn.active,.btn-group-vertical>.btn:active,.btn-group-vertical>.btn:focus,.btn-group-vertical>.btn:hover,.btn-group>.btn.active,.btn-group>.btn:active,.btn-group>.btn:focus,.btn-group>.btn:hover{z-index:2}.btn-group .btn+.btn,.btn-group .btn+.btn-group,.btn-group .btn-group+.btn,.btn-group .btn-group+.btn-group{margin-left:-1px}.btn-toolbar{margin-left:-5px}.btn-toolbar .btn,.btn-toolbar .btn-group,.btn-toolbar .input-group{float:left}.btn-toolbar>.btn,.btn-toolbar>.btn-group,.btn-toolbar>.input-group{margin-left:5px}.btn-group>.btn:not(:first-child):not(:last-child):not(.dropdown-toggle){border-radius:0}.btn-group>.btn:first-child{margin-left:0}.btn-group>.btn:first-child:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn:last-child:not(:first-child),.btn-group>.dropdown-toggle:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.btn-group>.btn-group{float:left}.btn-group>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-left-radius:0;border-bottom-left-radius:0}.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0}.btn-group>.btn+.dropdown-toggle{padding-right:8px;padding-left:8px}.btn-group>.btn-lg+.dropdown-toggle{padding-right:12px;padding-left:12px}.btn-group.open .dropdown-toggle{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn-group.open .dropdown-toggle.btn-link{-webkit-box-shadow:none;box-shadow:none}.btn .caret{margin-left:0}.btn-lg .caret{border-width:5px 5px 0;border-bottom-width:0}.dropup .btn-lg .caret{border-width:0 5px 5px}.btn-group-vertical>.btn,.btn-group-vertical>.btn-group,.btn-group-vertical>.btn-group>.btn{display:block;float:none;width:100%;max-width:100%}.btn-group-vertical>.btn-group>.btn{float:none}.btn-group-vertical>.btn+.btn,.btn-group-vertical>.btn+.btn-group,.btn-group-vertical>.btn-group+.btn,.btn-group-vertical>.btn-group+.btn-group{margin-top:-1px;margin-left:0}.btn-group-vertical>.btn:not(:first-child):not(:last-child){border-radius:0}.btn-group-vertical>.btn:first-child:not(:last-child){border-top-left-radius:4px;border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn:last-child:not(:first-child){border-top-left-radius:0;border-top-right-radius:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.btn-group-vertical>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group-vertical>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group-vertical>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-left-radius:0;border-top-right-radius:0}.btn-group-justified{display:table;width:100%;table-layout:fixed;border-collapse:separate}.btn-group-justified>.btn,.btn-group-justified>.btn-group{display:table-cell;float:none;width:1%}.btn-group-justified>.btn-group .btn{width:100%}.btn-group-justified>.btn-group .dropdown-menu{left:auto}[data-toggle=buttons]>.btn input[type=checkbox],[data-toggle=buttons]>.btn input[type=radio],[data-toggle=buttons]>.btn-group>.btn input[type=checkbox],[data-toggle=buttons]>.btn-group>.btn input[type=radio]{position:absolute;clip:rect(0,0,0,0);pointer-events:none}.input-group{position:relative;display:table;border-collapse:separate}.input-group[class*=col-]{float:none;padding-right:0;padding-left:0}.input-group .form-control{position:relative;z-index:2;float:left;width:100%;margin-bottom:0}.input-group .form-control:focus{z-index:3}.input-group-lg>.form-control,.input-group-lg>.input-group-addon,.input-group-lg>.input-group-btn>.btn{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}select.input-group-lg>.form-control,select.input-group-lg>.input-group-addon,select.input-group-lg>.input-group-btn>.btn{height:46px;line-height:46px}select[multiple].input-group-lg>.form-control,select[multiple].input-group-lg>.input-group-addon,select[multiple].input-group-lg>.input-group-btn>.btn,textarea.input-group-lg>.form-control,textarea.input-group-lg>.input-group-addon,textarea.input-group-lg>.input-group-btn>.btn{height:auto}.input-group-sm>.form-control,.input-group-sm>.input-group-addon,.input-group-sm>.input-group-btn>.btn{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-group-sm>.form-control,select.input-group-sm>.input-group-addon,select.input-group-sm>.input-group-btn>.btn{height:30px;line-height:30px}select[multiple].input-group-sm>.form-control,select[multiple].input-group-sm>.input-group-addon,select[multiple].input-group-sm>.input-group-btn>.btn,textarea.input-group-sm>.form-control,textarea.input-group-sm>.input-group-addon,textarea.input-group-sm>.input-group-btn>.btn{height:auto}.input-group .form-control,.input-group-addon,.input-group-btn{display:table-cell}.input-group .form-control:not(:first-child):not(:last-child),.input-group-addon:not(:first-child):not(:last-child),.input-group-btn:not(:first-child):not(:last-child){border-radius:0}.input-group-addon,.input-group-btn{width:1%;white-space:nowrap;vertical-align:middle}.input-group-addon{padding:6px 12px;font-size:14px;font-weight:400;line-height:1;color:#555;text-align:center;background-color:#eee;border:1px solid #ccc;border-radius:4px}.input-group-addon.input-sm{padding:5px 10px;font-size:12px;border-radius:3px}.input-group-addon.input-lg{padding:10px 16px;font-size:18px;border-radius:6px}.input-group-addon input[type=checkbox],.input-group-addon input[type=radio]{margin-top:0}.input-group .form-control:first-child,.input-group-addon:first-child,.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group>.btn,.input-group-btn:first-child>.dropdown-toggle,.input-group-btn:last-child>.btn-group:not(:last-child)>.btn,.input-group-btn:last-child>.btn:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.input-group-addon:first-child{border-right:0}.input-group .form-control:last-child,.input-group-addon:last-child,.input-group-btn:first-child>.btn-group:not(:first-child)>.btn,.input-group-btn:first-child>.btn:not(:first-child),.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group>.btn,.input-group-btn:last-child>.dropdown-toggle{border-top-left-radius:0;border-bottom-left-radius:0}.input-group-addon:last-child{border-left:0}.input-group-btn{position:relative;font-size:0;white-space:nowrap}.input-group-btn>.btn{position:relative}.input-group-btn>.btn+.btn{margin-left:-1px}.input-group-btn>.btn:active,.input-group-btn>.btn:focus,.input-group-btn>.btn:hover{z-index:2}.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group{margin-right:-1px}.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group{z-index:2;margin-left:-1px}.nav{padding-left:0;margin-bottom:0;list-style:none}.nav>li{position:relative;display:block}.nav>li>a{position:relative;display:block;padding:10px 15px}.nav>li>a:focus,.nav>li>a:hover{text-decoration:none;background-color:#eee}.nav>li.disabled>a{color:#777}.nav>li.disabled>a:focus,.nav>li.disabled>a:hover{color:#777;text-decoration:none;cursor:not-allowed;background-color:transparent}.nav .open>a,.nav .open>a:focus,.nav .open>a:hover{background-color:#eee;border-color:#337ab7}.nav .nav-divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.nav>li>a>img{max-width:none}.nav-tabs{border-bottom:1px solid #ddd}.nav-tabs>li{float:left;margin-bottom:-1px}.nav-tabs>li>a{margin-right:2px;line-height:1.42857143;border:1px solid transparent;border-radius:4px 4px 0 0}.nav-tabs>li>a:hover{border-color:#eee #eee #ddd}.nav-tabs>li.active>a,.nav-tabs>li.active>a:focus,.nav-tabs>li.active>a:hover{color:#555;cursor:default;background-color:#fff;border:1px solid #ddd;border-bottom-color:transparent}.nav-tabs.nav-justified{width:100%;border-bottom:0}.nav-tabs.nav-justified>li{float:none}.nav-tabs.nav-justified>li>a{margin-bottom:5px;text-align:center}.nav-tabs.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-tabs.nav-justified>li{display:table-cell;width:1%}.nav-tabs.nav-justified>li>a{margin-bottom:0}}.nav-tabs.nav-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:focus,.nav-tabs.nav-justified>.active>a:hover{border:1px solid #ddd}@media (min-width:768px){.nav-tabs.nav-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:focus,.nav-tabs.nav-justified>.active>a:hover{border-bottom-color:#fff}}.nav-pills>li{float:left}.nav-pills>li>a{border-radius:4px}.nav-pills>li+li{margin-left:2px}.nav-pills>li.active>a,.nav-pills>li.active>a:focus,.nav-pills>li.active>a:hover{color:#fff;background-color:#337ab7}.nav-stacked>li{float:none}.nav-stacked>li+li{margin-top:2px;margin-left:0}.nav-justified{width:100%}.nav-justified>li{float:none}.nav-justified>li>a{margin-bottom:5px;text-align:center}.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-justified>li{display:table-cell;width:1%}.nav-justified>li>a{margin-bottom:0}}.nav-tabs-justified{border-bottom:0}.nav-tabs-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:focus,.nav-tabs-justified>.active>a:hover{border:1px solid #ddd}@media (min-width:768px){.nav-tabs-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:focus,.nav-tabs-justified>.active>a:hover{border-bottom-color:#fff}}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-left-radius:0;border-top-right-radius:0}.navbar{position:relative;min-height:50px;margin-bottom:20px;border:1px solid transparent}@media (min-width:768px){.navbar{border-radius:4px}}@media (min-width:768px){.navbar-header{float:left}}.navbar-collapse{padding-right:15px;padding-left:15px;overflow-x:visible;-webkit-overflow-scrolling:touch;border-top:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.1)}.navbar-collapse.in{overflow-y:auto}@media (min-width:768px){.navbar-collapse{width:auto;border-top:0;-webkit-box-shadow:none;box-shadow:none}.navbar-collapse.collapse{display:block!important;height:auto!important;padding-bottom:0;overflow:visible!important}.navbar-collapse.in{overflow-y:visible}.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse,.navbar-static-top .navbar-collapse{padding-right:0;padding-left:0}}.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse{max-height:340px}@media (max-device-width:480px) and (orientation:landscape){.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse{max-height:200px}}.container-fluid>.navbar-collapse,.container-fluid>.navbar-header,.container>.navbar-collapse,.container>.navbar-header{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.container-fluid>.navbar-collapse,.container-fluid>.navbar-header,.container>.navbar-collapse,.container>.navbar-header{margin-right:0;margin-left:0}}.navbar-static-top{z-index:1000;border-width:0 0 1px}@media (min-width:768px){.navbar-static-top{border-radius:0}}.navbar-fixed-bottom,.navbar-fixed-top{position:fixed;right:0;left:0;z-index:1030}@media (min-width:768px){.navbar-fixed-bottom,.navbar-fixed-top{border-radius:0}}.navbar-fixed-top{top:0;border-width:0 0 1px}.navbar-fixed-bottom{bottom:0;margin-bottom:0;border-width:1px 0 0}.navbar-brand{float:left;height:50px;padding:15px 15px;font-size:18px;line-height:20px}.navbar-brand:focus,.navbar-brand:hover{text-decoration:none}.navbar-brand>img{display:block}@media (min-width:768px){.navbar>.container .navbar-brand,.navbar>.container-fluid .navbar-brand{margin-left:-15px}}.navbar-toggle{position:relative;float:right;padding:9px 10px;margin-top:8px;margin-right:15px;margin-bottom:8px;background-color:transparent;background-image:none;border:1px solid transparent;border-radius:4px}.navbar-toggle:focus{outline:0}.navbar-toggle .icon-bar{display:block;width:22px;height:2px;border-radius:1px}.navbar-toggle .icon-bar+.icon-bar{margin-top:4px}@media (min-width:768px){.navbar-toggle{display:none}}.navbar-nav{margin:7.5px -15px}.navbar-nav>li>a{padding-top:10px;padding-bottom:10px;line-height:20px}@media (max-width:767px){.navbar-nav .open .dropdown-menu{position:static;float:none;width:auto;margin-top:0;background-color:transparent;border:0;-webkit-box-shadow:none;box-shadow:none}.navbar-nav .open .dropdown-menu .dropdown-header,.navbar-nav .open .dropdown-menu>li>a{padding:5px 15px 5px 25px}.navbar-nav .open .dropdown-menu>li>a{line-height:20px}.navbar-nav .open .dropdown-menu>li>a:focus,.navbar-nav .open .dropdown-menu>li>a:hover{background-image:none}}@media (min-width:768px){.navbar-nav{float:left;margin:0}.navbar-nav>li{float:left}.navbar-nav>li>a{padding-top:15px;padding-bottom:15px}}.navbar-form{padding:10px 15px;margin-top:8px;margin-right:-15px;margin-bottom:8px;margin-left:-15px;border-top:1px solid transparent;border-bottom:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1)}@media (min-width:768px){.navbar-form .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.navbar-form .form-control{display:inline-block;width:auto;vertical-align:middle}.navbar-form .form-control-static{display:inline-block}.navbar-form .input-group{display:inline-table;vertical-align:middle}.navbar-form .input-group .form-control,.navbar-form .input-group .input-group-addon,.navbar-form .input-group .input-group-btn{width:auto}.navbar-form .input-group>.form-control{width:100%}.navbar-form .control-label{margin-bottom:0;vertical-align:middle}.navbar-form .checkbox,.navbar-form .radio{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.navbar-form .checkbox label,.navbar-form .radio label{padding-left:0}.navbar-form .checkbox input[type=checkbox],.navbar-form .radio input[type=radio]{position:relative;margin-left:0}.navbar-form .has-feedback .form-control-feedback{top:0}}@media (max-width:767px){.navbar-form .form-group{margin-bottom:5px}.navbar-form .form-group:last-child{margin-bottom:0}}@media (min-width:768px){.navbar-form{width:auto;padding-top:0;padding-bottom:0;margin-right:0;margin-left:0;border:0;-webkit-box-shadow:none;box-shadow:none}}.navbar-nav>li>.dropdown-menu{margin-top:0;border-top-left-radius:0;border-top-right-radius:0}.navbar-fixed-bottom .navbar-nav>li>.dropdown-menu{margin-bottom:0;border-top-left-radius:4px;border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.navbar-btn{margin-top:8px;margin-bottom:8px}.navbar-btn.btn-sm{margin-top:10px;margin-bottom:10px}.navbar-btn.btn-xs{margin-top:14px;margin-bottom:14px}.navbar-text{margin-top:15px;margin-bottom:15px}@media (min-width:768px){.navbar-text{float:left;margin-right:15px;margin-left:15px}}@media (min-width:768px){.navbar-left{float:left!important}.navbar-right{float:right!important;margin-right:-15px}.navbar-right~.navbar-right{margin-right:0}}.navbar-default{background-color:#f8f8f8;border-color:#e7e7e7}.navbar-default .navbar-brand{color:#777}.navbar-default .navbar-brand:focus,.navbar-default .navbar-brand:hover{color:#5e5e5e;background-color:transparent}.navbar-default .navbar-text{color:#777}.navbar-default .navbar-nav>li>a{color:#777}.navbar-default .navbar-nav>li>a:focus,.navbar-default .navbar-nav>li>a:hover{color:#333;background-color:transparent}.navbar-default .navbar-nav>.active>a,.navbar-default .navbar-nav>.active>a:focus,.navbar-default .navbar-nav>.active>a:hover{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav>.disabled>a,.navbar-default .navbar-nav>.disabled>a:focus,.navbar-default .navbar-nav>.disabled>a:hover{color:#ccc;background-color:transparent}.navbar-default .navbar-toggle{border-color:#ddd}.navbar-default .navbar-toggle:focus,.navbar-default .navbar-toggle:hover{background-color:#ddd}.navbar-default .navbar-toggle .icon-bar{background-color:#888}.navbar-default .navbar-collapse,.navbar-default .navbar-form{border-color:#e7e7e7}.navbar-default .navbar-nav>.open>a,.navbar-default .navbar-nav>.open>a:focus,.navbar-default .navbar-nav>.open>a:hover{color:#555;background-color:#e7e7e7}@media (max-width:767px){.navbar-default .navbar-nav .open .dropdown-menu>li>a{color:#777}.navbar-default .navbar-nav .open .dropdown-menu>li>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>li>a:hover{color:#333;background-color:transparent}.navbar-default .navbar-nav .open .dropdown-menu>.active>a,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:hover{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:hover{color:#ccc;background-color:transparent}}.navbar-default .navbar-link{color:#777}.navbar-default .navbar-link:hover{color:#333}.navbar-default .btn-link{color:#777}.navbar-default .btn-link:focus,.navbar-default .btn-link:hover{color:#333}.navbar-default .btn-link[disabled]:focus,.navbar-default .btn-link[disabled]:hover,fieldset[disabled] .navbar-default .btn-link:focus,fieldset[disabled] .navbar-default .btn-link:hover{color:#ccc}.navbar-inverse{background-color:#222;border-color:#080808}.navbar-inverse .navbar-brand{color:#9d9d9d}.navbar-inverse .navbar-brand:focus,.navbar-inverse .navbar-brand:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-text{color:#9d9d9d}.navbar-inverse .navbar-nav>li>a{color:#9d9d9d}.navbar-inverse .navbar-nav>li>a:focus,.navbar-inverse .navbar-nav>li>a:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav>.active>a,.navbar-inverse .navbar-nav>.active>a:focus,.navbar-inverse .navbar-nav>.active>a:hover{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav>.disabled>a,.navbar-inverse .navbar-nav>.disabled>a:focus,.navbar-inverse .navbar-nav>.disabled>a:hover{color:#444;background-color:transparent}.navbar-inverse .navbar-toggle{border-color:#333}.navbar-inverse .navbar-toggle:focus,.navbar-inverse .navbar-toggle:hover{background-color:#333}.navbar-inverse .navbar-toggle .icon-bar{background-color:#fff}.navbar-inverse .navbar-collapse,.navbar-inverse .navbar-form{border-color:#101010}.navbar-inverse .navbar-nav>.open>a,.navbar-inverse .navbar-nav>.open>a:focus,.navbar-inverse .navbar-nav>.open>a:hover{color:#fff;background-color:#080808}@media (max-width:767px){.navbar-inverse .navbar-nav .open .dropdown-menu>.dropdown-header{border-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu .divider{background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a{color:#9d9d9d}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:hover{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:hover{color:#444;background-color:transparent}}.navbar-inverse .navbar-link{color:#9d9d9d}.navbar-inverse .navbar-link:hover{color:#fff}.navbar-inverse .btn-link{color:#9d9d9d}.navbar-inverse .btn-link:focus,.navbar-inverse .btn-link:hover{color:#fff}.navbar-inverse .btn-link[disabled]:focus,.navbar-inverse .btn-link[disabled]:hover,fieldset[disabled] .navbar-inverse .btn-link:focus,fieldset[disabled] .navbar-inverse .btn-link:hover{color:#444}.breadcrumb{padding:8px 15px;margin-bottom:20px;list-style:none;background-color:#f5f5f5;border-radius:4px}.breadcrumb>li{display:inline-block}.breadcrumb>li+li:before{padding:0 5px;color:#ccc;content:"/\00a0"}.breadcrumb>.active{color:#777}.pagination{display:inline-block;padding-left:0;margin:20px 0;border-radius:4px}.pagination>li{display:inline}.pagination>li>a,.pagination>li>span{position:relative;float:left;padding:6px 12px;margin-left:-1px;line-height:1.42857143;color:#337ab7;text-decoration:none;background-color:#fff;border:1px solid #ddd}.pagination>li:first-child>a,.pagination>li:first-child>span{margin-left:0;border-top-left-radius:4px;border-bottom-left-radius:4px}.pagination>li:last-child>a,.pagination>li:last-child>span{border-top-right-radius:4px;border-bottom-right-radius:4px}.pagination>li>a:focus,.pagination>li>a:hover,.pagination>li>span:focus,.pagination>li>span:hover{z-index:2;color:#23527c;background-color:#eee;border-color:#ddd}.pagination>.active>a,.pagination>.active>a:focus,.pagination>.active>a:hover,.pagination>.active>span,.pagination>.active>span:focus,.pagination>.active>span:hover{z-index:3;color:#fff;cursor:default;background-color:#337ab7;border-color:#337ab7}.pagination>.disabled>a,.pagination>.disabled>a:focus,.pagination>.disabled>a:hover,.pagination>.disabled>span,.pagination>.disabled>span:focus,.pagination>.disabled>span:hover{color:#777;cursor:not-allowed;background-color:#fff;border-color:#ddd}.pagination-lg>li>a,.pagination-lg>li>span{padding:10px 16px;font-size:18px;line-height:1.3333333}.pagination-lg>li:first-child>a,.pagination-lg>li:first-child>span{border-top-left-radius:6px;border-bottom-left-radius:6px}.pagination-lg>li:last-child>a,.pagination-lg>li:last-child>span{border-top-right-radius:6px;border-bottom-right-radius:6px}.pagination-sm>li>a,.pagination-sm>li>span{padding:5px 10px;font-size:12px;line-height:1.5}.pagination-sm>li:first-child>a,.pagination-sm>li:first-child>span{border-top-left-radius:3px;border-bottom-left-radius:3px}.pagination-sm>li:last-child>a,.pagination-sm>li:last-child>span{border-top-right-radius:3px;border-bottom-right-radius:3px}.pager{padding-left:0;margin:20px 0;text-align:center;list-style:none}.pager li{display:inline}.pager li>a,.pager li>span{display:inline-block;padding:5px 14px;background-color:#fff;border:1px solid #ddd;border-radius:15px}.pager li>a:focus,.pager li>a:hover{text-decoration:none;background-color:#eee}.pager .next>a,.pager .next>span{float:right}.pager .previous>a,.pager .previous>span{float:left}.pager .disabled>a,.pager .disabled>a:focus,.pager .disabled>a:hover,.pager .disabled>span{color:#777;cursor:not-allowed;background-color:#fff}.label{display:inline;padding:.2em .6em .3em;font-size:75%;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25em}a.label:focus,a.label:hover{color:#fff;text-decoration:none;cursor:pointer}.label:empty{display:none}.btn .label{position:relative;top:-1px}.label-default{background-color:#777}.label-default[href]:focus,.label-default[href]:hover{background-color:#5e5e5e}.label-primary{background-color:#337ab7}.label-primary[href]:focus,.label-primary[href]:hover{background-color:#286090}.label-success{background-color:#5cb85c}.label-success[href]:focus,.label-success[href]:hover{background-color:#449d44}.label-info{background-color:#5bc0de}.label-info[href]:focus,.label-info[href]:hover{background-color:#31b0d5}.label-warning{background-color:#f0ad4e}.label-warning[href]:focus,.label-warning[href]:hover{background-color:#ec971f}.label-danger{background-color:#d9534f}.label-danger[href]:focus,.label-danger[href]:hover{background-color:#c9302c}.badge{display:inline-block;min-width:10px;padding:3px 7px;font-size:12px;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:middle;background-color:#777;border-radius:10px}.badge:empty{display:none}.btn .badge{position:relative;top:-1px}.btn-group-xs>.btn .badge,.btn-xs .badge{top:0;padding:1px 5px}a.badge:focus,a.badge:hover{color:#fff;text-decoration:none;cursor:pointer}.list-group-item.active>.badge,.nav-pills>.active>a>.badge{color:#337ab7;background-color:#fff}.list-group-item>.badge{float:right}.list-group-item>.badge+.badge{margin-right:5px}.nav-pills>li>a>.badge{margin-left:3px}.jumbotron{padding-top:30px;padding-bottom:30px;margin-bottom:30px;color:inherit;background-color:#eee}.jumbotron .h1,.jumbotron h1{color:inherit}.jumbotron p{margin-bottom:15px;font-size:21px;font-weight:200}.jumbotron>hr{border-top-color:#d5d5d5}.container .jumbotron,.container-fluid .jumbotron{padding-right:15px;padding-left:15px;border-radius:6px}.jumbotron .container{max-width:100%}@media screen and (min-width:768px){.jumbotron{padding-top:48px;padding-bottom:48px}.container .jumbotron,.container-fluid .jumbotron{padding-right:60px;padding-left:60px}.jumbotron .h1,.jumbotron h1{font-size:63px}}.thumbnail{display:block;padding:4px;margin-bottom:20px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:border .2s ease-in-out;-o-transition:border .2s ease-in-out;transition:border .2s ease-in-out}.thumbnail a>img,.thumbnail>img{margin-right:auto;margin-left:auto}a.thumbnail.active,a.thumbnail:focus,a.thumbnail:hover{border-color:#337ab7}.thumbnail .caption{padding:9px;color:#333}.alert{padding:15px;margin-bottom:20px;border:1px solid transparent;border-radius:4px}.alert h4{margin-top:0;color:inherit}.alert .alert-link{font-weight:700}.alert>p,.alert>ul{margin-bottom:0}.alert>p+p{margin-top:5px}.alert-dismissable,.alert-dismissible{padding-right:35px}.alert-dismissable .close,.alert-dismissible .close{position:relative;top:-2px;right:-21px;color:inherit}.alert-success{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.alert-success hr{border-top-color:#c9e2b3}.alert-success .alert-link{color:#2b542c}.alert-info{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.alert-info hr{border-top-color:#a6e1ec}.alert-info .alert-link{color:#245269}.alert-warning{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.alert-warning hr{border-top-color:#f7e1b5}.alert-warning .alert-link{color:#66512c}.alert-danger{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.alert-danger hr{border-top-color:#e4b9c0}.alert-danger .alert-link{color:#843534}@-webkit-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-o-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}.progress{height:20px;margin-bottom:20px;overflow:hidden;background-color:#f5f5f5;border-radius:4px;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.1);box-shadow:inset 0 1px 2px rgba(0,0,0,.1)}.progress-bar{float:left;width:0;height:100%;font-size:12px;line-height:20px;color:#fff;text-align:center;background-color:#337ab7;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);-webkit-transition:width .6s ease;-o-transition:width .6s ease;transition:width .6s ease}.progress-bar-striped,.progress-striped .progress-bar{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);-webkit-background-size:40px 40px;background-size:40px 40px}.progress-bar.active,.progress.active .progress-bar{-webkit-animation:progress-bar-stripes 2s linear infinite;-o-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.progress-bar-success{background-color:#5cb85c}.progress-striped .progress-bar-success{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-info{background-color:#5bc0de}.progress-striped .progress-bar-info{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-warning{background-color:#f0ad4e}.progress-striped .progress-bar-warning{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-danger{background-color:#d9534f}.progress-striped .progress-bar-danger{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.media{margin-top:15px}.media:first-child{margin-top:0}.media,.media-body{overflow:hidden;zoom:1}.media-body{width:10000px}.media-object{display:block}.media-object.img-thumbnail{max-width:none}.media-right,.media>.pull-right{padding-left:10px}.media-left,.media>.pull-left{padding-right:10px}.media-body,.media-left,.media-right{display:table-cell;vertical-align:top}.media-middle{vertical-align:middle}.media-bottom{vertical-align:bottom}.media-heading{margin-top:0;margin-bottom:5px}.media-list{padding-left:0;list-style:none}.list-group{padding-left:0;margin-bottom:20px}.list-group-item{position:relative;display:block;padding:10px 15px;margin-bottom:-1px;background-color:#fff;border:1px solid #ddd}.list-group-item:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.list-group-item:last-child{margin-bottom:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px}a.list-group-item,button.list-group-item{color:#555}a.list-group-item .list-group-item-heading,button.list-group-item .list-group-item-heading{color:#333}a.list-group-item:focus,a.list-group-item:hover,button.list-group-item:focus,button.list-group-item:hover{color:#555;text-decoration:none;background-color:#f5f5f5}button.list-group-item{width:100%;text-align:left}.list-group-item.disabled,.list-group-item.disabled:focus,.list-group-item.disabled:hover{color:#777;cursor:not-allowed;background-color:#eee}.list-group-item.disabled .list-group-item-heading,.list-group-item.disabled:focus .list-group-item-heading,.list-group-item.disabled:hover .list-group-item-heading{color:inherit}.list-group-item.disabled .list-group-item-text,.list-group-item.disabled:focus .list-group-item-text,.list-group-item.disabled:hover .list-group-item-text{color:#777}.list-group-item.active,.list-group-item.active:focus,.list-group-item.active:hover{z-index:2;color:#fff;background-color:#337ab7;border-color:#337ab7}.list-group-item.active .list-group-item-heading,.list-group-item.active .list-group-item-heading>.small,.list-group-item.active .list-group-item-heading>small,.list-group-item.active:focus .list-group-item-heading,.list-group-item.active:focus .list-group-item-heading>.small,.list-group-item.active:focus .list-group-item-heading>small,.list-group-item.active:hover .list-group-item-heading,.list-group-item.active:hover .list-group-item-heading>.small,.list-group-item.active:hover .list-group-item-heading>small{color:inherit}.list-group-item.active .list-group-item-text,.list-group-item.active:focus .list-group-item-text,.list-group-item.active:hover .list-group-item-text{color:#c7ddef}.list-group-item-success{color:#3c763d;background-color:#dff0d8}a.list-group-item-success,button.list-group-item-success{color:#3c763d}a.list-group-item-success .list-group-item-heading,button.list-group-item-success .list-group-item-heading{color:inherit}a.list-group-item-success:focus,a.list-group-item-success:hover,button.list-group-item-success:focus,button.list-group-item-success:hover{color:#3c763d;background-color:#d0e9c6}a.list-group-item-success.active,a.list-group-item-success.active:focus,a.list-group-item-success.active:hover,button.list-group-item-success.active,button.list-group-item-success.active:focus,button.list-group-item-success.active:hover{color:#fff;background-color:#3c763d;border-color:#3c763d}.list-group-item-info{color:#31708f;background-color:#d9edf7}a.list-group-item-info,button.list-group-item-info{color:#31708f}a.list-group-item-info .list-group-item-heading,button.list-group-item-info .list-group-item-heading{color:inherit}a.list-group-item-info:focus,a.list-group-item-info:hover,button.list-group-item-info:focus,button.list-group-item-info:hover{color:#31708f;background-color:#c4e3f3}a.list-group-item-info.active,a.list-group-item-info.active:focus,a.list-group-item-info.active:hover,button.list-group-item-info.active,button.list-group-item-info.active:focus,button.list-group-item-info.active:hover{color:#fff;background-color:#31708f;border-color:#31708f}.list-group-item-warning{color:#8a6d3b;background-color:#fcf8e3}a.list-group-item-warning,button.list-group-item-warning{color:#8a6d3b}a.list-group-item-warning .list-group-item-heading,button.list-group-item-warning .list-group-item-heading{color:inherit}a.list-group-item-warning:focus,a.list-group-item-warning:hover,button.list-group-item-warning:focus,button.list-group-item-warning:hover{color:#8a6d3b;background-color:#faf2cc}a.list-group-item-warning.active,a.list-group-item-warning.active:focus,a.list-group-item-warning.active:hover,button.list-group-item-warning.active,button.list-group-item-warning.active:focus,button.list-group-item-warning.active:hover{color:#fff;background-color:#8a6d3b;border-color:#8a6d3b}.list-group-item-danger{color:#a94442;background-color:#f2dede}a.list-group-item-danger,button.list-group-item-danger{color:#a94442}a.list-group-item-danger .list-group-item-heading,button.list-group-item-danger .list-group-item-heading{color:inherit}a.list-group-item-danger:focus,a.list-group-item-danger:hover,button.list-group-item-danger:focus,button.list-group-item-danger:hover{color:#a94442;background-color:#ebcccc}a.list-group-item-danger.active,a.list-group-item-danger.active:focus,a.list-group-item-danger.active:hover,button.list-group-item-danger.active,button.list-group-item-danger.active:focus,button.list-group-item-danger.active:hover{color:#fff;background-color:#a94442;border-color:#a94442}.list-group-item-heading{margin-top:0;margin-bottom:5px}.list-group-item-text{margin-bottom:0;line-height:1.3}.panel{margin-bottom:20px;background-color:#fff;border:1px solid transparent;border-radius:4px;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.05);box-shadow:0 1px 1px rgba(0,0,0,.05)}.panel-body{padding:15px}.panel-heading{padding:10px 15px;border-bottom:1px solid transparent;border-top-left-radius:3px;border-top-right-radius:3px}.panel-heading>.dropdown .dropdown-toggle{color:inherit}.panel-title{margin-top:0;margin-bottom:0;font-size:16px;color:inherit}.panel-title>.small,.panel-title>.small>a,.panel-title>a,.panel-title>small,.panel-title>small>a{color:inherit}.panel-footer{padding:10px 15px;background-color:#f5f5f5;border-top:1px solid #ddd;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.list-group,.panel>.panel-collapse>.list-group{margin-bottom:0}.panel>.list-group .list-group-item,.panel>.panel-collapse>.list-group .list-group-item{border-width:1px 0;border-radius:0}.panel>.list-group:first-child .list-group-item:first-child,.panel>.panel-collapse>.list-group:first-child .list-group-item:first-child{border-top:0;border-top-left-radius:3px;border-top-right-radius:3px}.panel>.list-group:last-child .list-group-item:last-child,.panel>.panel-collapse>.list-group:last-child .list-group-item:last-child{border-bottom:0;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.panel-heading+.panel-collapse>.list-group .list-group-item:first-child{border-top-left-radius:0;border-top-right-radius:0}.panel-heading+.list-group .list-group-item:first-child{border-top-width:0}.list-group+.panel-footer{border-top-width:0}.panel>.panel-collapse>.table,.panel>.table,.panel>.table-responsive>.table{margin-bottom:0}.panel>.panel-collapse>.table caption,.panel>.table caption,.panel>.table-responsive>.table caption{padding-right:15px;padding-left:15px}.panel>.table-responsive:first-child>.table:first-child,.panel>.table:first-child{border-top-left-radius:3px;border-top-right-radius:3px}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child,.panel>.table:first-child>thead:first-child>tr:first-child{border-top-left-radius:3px;border-top-right-radius:3px}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table:first-child>thead:first-child>tr:first-child th:first-child{border-top-left-radius:3px}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table:first-child>thead:first-child>tr:first-child th:last-child{border-top-right-radius:3px}.panel>.table-responsive:last-child>.table:last-child,.panel>.table:last-child{border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child{border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:first-child{border-bottom-left-radius:3px}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:last-child{border-bottom-right-radius:3px}.panel>.panel-body+.table,.panel>.panel-body+.table-responsive,.panel>.table+.panel-body,.panel>.table-responsive+.panel-body{border-top:1px solid #ddd}.panel>.table>tbody:first-child>tr:first-child td,.panel>.table>tbody:first-child>tr:first-child th{border-top:0}.panel>.table-bordered,.panel>.table-responsive>.table-bordered{border:0}.panel>.table-bordered>tbody>tr>td:first-child,.panel>.table-bordered>tbody>tr>th:first-child,.panel>.table-bordered>tfoot>tr>td:first-child,.panel>.table-bordered>tfoot>tr>th:first-child,.panel>.table-bordered>thead>tr>td:first-child,.panel>.table-bordered>thead>tr>th:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:first-child,.panel>.table-responsive>.table-bordered>thead>tr>td:first-child,.panel>.table-responsive>.table-bordered>thead>tr>th:first-child{border-left:0}.panel>.table-bordered>tbody>tr>td:last-child,.panel>.table-bordered>tbody>tr>th:last-child,.panel>.table-bordered>tfoot>tr>td:last-child,.panel>.table-bordered>tfoot>tr>th:last-child,.panel>.table-bordered>thead>tr>td:last-child,.panel>.table-bordered>thead>tr>th:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:last-child,.panel>.table-responsive>.table-bordered>thead>tr>td:last-child,.panel>.table-responsive>.table-bordered>thead>tr>th:last-child{border-right:0}.panel>.table-bordered>tbody>tr:first-child>td,.panel>.table-bordered>tbody>tr:first-child>th,.panel>.table-bordered>thead>tr:first-child>td,.panel>.table-bordered>thead>tr:first-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>th,.panel>.table-responsive>.table-bordered>thead>tr:first-child>td,.panel>.table-responsive>.table-bordered>thead>tr:first-child>th{border-bottom:0}.panel>.table-bordered>tbody>tr:last-child>td,.panel>.table-bordered>tbody>tr:last-child>th,.panel>.table-bordered>tfoot>tr:last-child>td,.panel>.table-bordered>tfoot>tr:last-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>th,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>td,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>th{border-bottom:0}.panel>.table-responsive{margin-bottom:0;border:0}.panel-group{margin-bottom:20px}.panel-group .panel{margin-bottom:0;border-radius:4px}.panel-group .panel+.panel{margin-top:5px}.panel-group .panel-heading{border-bottom:0}.panel-group .panel-heading+.panel-collapse>.list-group,.panel-group .panel-heading+.panel-collapse>.panel-body{border-top:1px solid #ddd}.panel-group .panel-footer{border-top:0}.panel-group .panel-footer+.panel-collapse .panel-body{border-bottom:1px solid #ddd}.panel-default{border-color:#ddd}.panel-default>.panel-heading{color:#333;background-color:#f5f5f5;border-color:#ddd}.panel-default>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ddd}.panel-default>.panel-heading .badge{color:#f5f5f5;background-color:#333}.panel-default>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ddd}.panel-primary{border-color:#337ab7}.panel-primary>.panel-heading{color:#fff;background-color:#337ab7;border-color:#337ab7}.panel-primary>.panel-heading+.panel-collapse>.panel-body{border-top-color:#337ab7}.panel-primary>.panel-heading .badge{color:#337ab7;background-color:#fff}.panel-primary>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#337ab7}.panel-success{border-color:#d6e9c6}.panel-success>.panel-heading{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.panel-success>.panel-heading+.panel-collapse>.panel-body{border-top-color:#d6e9c6}.panel-success>.panel-heading .badge{color:#dff0d8;background-color:#3c763d}.panel-success>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#d6e9c6}.panel-info{border-color:#bce8f1}.panel-info>.panel-heading{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.panel-info>.panel-heading+.panel-collapse>.panel-body{border-top-color:#bce8f1}.panel-info>.panel-heading .badge{color:#d9edf7;background-color:#31708f}.panel-info>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#bce8f1}.panel-warning{border-color:#faebcc}.panel-warning>.panel-heading{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.panel-warning>.panel-heading+.panel-collapse>.panel-body{border-top-color:#faebcc}.panel-warning>.panel-heading .badge{color:#fcf8e3;background-color:#8a6d3b}.panel-warning>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#faebcc}.panel-danger{border-color:#ebccd1}.panel-danger>.panel-heading{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.panel-danger>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ebccd1}.panel-danger>.panel-heading .badge{color:#f2dede;background-color:#a94442}.panel-danger>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ebccd1}.embed-responsive{position:relative;display:block;height:0;padding:0;overflow:hidden}.embed-responsive .embed-responsive-item,.embed-responsive embed,.embed-responsive iframe,.embed-responsive object,.embed-responsive video{position:absolute;top:0;bottom:0;left:0;width:100%;height:100%;border:0}.embed-responsive-16by9{padding-bottom:56.25%}.embed-responsive-4by3{padding-bottom:75%}.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #e3e3e3;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.05);box-shadow:inset 0 1px 1px rgba(0,0,0,.05)}.well blockquote{border-color:#ddd;border-color:rgba(0,0,0,.15)}.well-lg{padding:24px;border-radius:6px}.well-sm{padding:9px;border-radius:3px}.close{float:right;font-size:21px;font-weight:700;line-height:1;color:#000;text-shadow:0 1px 0 #fff;filter:alpha(opacity=20);opacity:.2}.close:focus,.close:hover{color:#000;text-decoration:none;cursor:pointer;filter:alpha(opacity=50);opacity:.5}button.close{-webkit-appearance:none;padding:0;cursor:pointer;background:0 0;border:0}.modal-open{overflow:hidden}.modal{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1050;display:none;overflow:hidden;-webkit-overflow-scrolling:touch;outline:0}.modal.fade .modal-dialog{-webkit-transition:-webkit-transform .3s ease-out;-o-transition:-o-transform .3s ease-out;transition:transform .3s ease-out;-webkit-transform:translate(0,-25%);-ms-transform:translate(0,-25%);-o-transform:translate(0,-25%);transform:translate(0,-25%)}.modal.in .modal-dialog{-webkit-transform:translate(0,0);-ms-transform:translate(0,0);-o-transform:translate(0,0);transform:translate(0,0)}.modal-open .modal{overflow-x:hidden;overflow-y:auto}.modal-dialog{position:relative;width:auto;margin:10px}.modal-content{position:relative;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #999;border:1px solid rgba(0,0,0,.2);border-radius:6px;outline:0;-webkit-box-shadow:0 3px 9px rgba(0,0,0,.5);box-shadow:0 3px 9px rgba(0,0,0,.5)}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000}.modal-backdrop.fade{filter:alpha(opacity=0);opacity:0}.modal-backdrop.in{filter:alpha(opacity=50);opacity:.5}.modal-header{padding:15px;border-bottom:1px solid #e5e5e5}.modal-header .close{margin-top:-2px}.modal-title{margin:0;line-height:1.42857143}.modal-body{position:relative;padding:15px}.modal-footer{padding:15px;text-align:right;border-top:1px solid #e5e5e5}.modal-footer .btn+.btn{margin-bottom:0;margin-left:5px}.modal-footer .btn-group .btn+.btn{margin-left:-1px}.modal-footer .btn-block+.btn-block{margin-left:0}.modal-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}@media (min-width:768px){.modal-dialog{width:600px;margin:30px auto}.modal-content{-webkit-box-shadow:0 5px 15px rgba(0,0,0,.5);box-shadow:0 5px 15px rgba(0,0,0,.5)}.modal-sm{width:300px}}@media (min-width:992px){.modal-lg{width:900px}}.tooltip{position:absolute;z-index:1070;display:block;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:12px;font-style:normal;font-weight:400;line-height:1.42857143;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;word-wrap:normal;white-space:normal;filter:alpha(opacity=0);opacity:0;line-break:auto}.tooltip.in{filter:alpha(opacity=90);opacity:.9}.tooltip.top{padding:5px 0;margin-top:-3px}.tooltip.right{padding:0 5px;margin-left:3px}.tooltip.bottom{padding:5px 0;margin-top:3px}.tooltip.left{padding:0 5px;margin-left:-3px}.tooltip-inner{max-width:200px;padding:3px 8px;color:#fff;text-align:center;background-color:#000;border-radius:4px}.tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-left .tooltip-arrow{right:5px;bottom:0;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-right .tooltip-arrow{bottom:0;left:5px;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-width:5px 5px 5px 0;border-right-color:#000}.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-width:5px 0 5px 5px;border-left-color:#000}.tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-left .tooltip-arrow{top:0;right:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-right .tooltip-arrow{top:0;left:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#000}.popover{position:absolute;top:0;left:0;z-index:1060;display:none;max-width:276px;padding:1px;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;font-style:normal;font-weight:400;line-height:1.42857143;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;word-wrap:normal;white-space:normal;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.2);border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2);line-break:auto}.popover.top{margin-top:-10px}.popover.right{margin-left:10px}.popover.bottom{margin-top:10px}.popover.left{margin-left:-10px}.popover-title{padding:8px 14px;margin:0;font-size:14px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;border-radius:5px 5px 0 0}.popover-content{padding:9px 14px}.popover>.arrow,.popover>.arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.popover>.arrow{border-width:11px}.popover>.arrow:after{content:"";border-width:10px}.popover.top>.arrow{bottom:-11px;left:50%;margin-left:-11px;border-top-color:#999;border-top-color:rgba(0,0,0,.25);border-bottom-width:0}.popover.top>.arrow:after{bottom:1px;margin-left:-10px;content:" ";border-top-color:#fff;border-bottom-width:0}.popover.right>.arrow{top:50%;left:-11px;margin-top:-11px;border-right-color:#999;border-right-color:rgba(0,0,0,.25);border-left-width:0}.popover.right>.arrow:after{bottom:-10px;left:1px;content:" ";border-right-color:#fff;border-left-width:0}.popover.bottom>.arrow{top:-11px;left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#999;border-bottom-color:rgba(0,0,0,.25)}.popover.bottom>.arrow:after{top:1px;margin-left:-10px;content:" ";border-top-width:0;border-bottom-color:#fff}.popover.left>.arrow{top:50%;right:-11px;margin-top:-11px;border-right-width:0;border-left-color:#999;border-left-color:rgba(0,0,0,.25)}.popover.left>.arrow:after{right:1px;bottom:-10px;content:" ";border-right-width:0;border-left-color:#fff}.carousel{position:relative}.carousel-inner{position:relative;width:100%;overflow:hidden}.carousel-inner>.item{position:relative;display:none;-webkit-transition:.6s ease-in-out left;-o-transition:.6s ease-in-out left;transition:.6s ease-in-out left}.carousel-inner>.item>a>img,.carousel-inner>.item>img{line-height:1}@media all and (transform-3d),(-webkit-transform-3d){.carousel-inner>.item{-webkit-transition:-webkit-transform .6s ease-in-out;-o-transition:-o-transform .6s ease-in-out;transition:transform .6s ease-in-out;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-perspective:1000px;perspective:1000px}.carousel-inner>.item.active.right,.carousel-inner>.item.next{left:0;-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)}.carousel-inner>.item.active.left,.carousel-inner>.item.prev{left:0;-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}.carousel-inner>.item.active,.carousel-inner>.item.next.left,.carousel-inner>.item.prev.right{left:0;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}}.carousel-inner>.active,.carousel-inner>.next,.carousel-inner>.prev{display:block}.carousel-inner>.active{left:0}.carousel-inner>.next,.carousel-inner>.prev{position:absolute;top:0;width:100%}.carousel-inner>.next{left:100%}.carousel-inner>.prev{left:-100%}.carousel-inner>.next.left,.carousel-inner>.prev.right{left:0}.carousel-inner>.active.left{left:-100%}.carousel-inner>.active.right{left:100%}.carousel-control{position:absolute;top:0;bottom:0;left:0;width:15%;font-size:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6);background-color:rgba(0,0,0,0);filter:alpha(opacity=50);opacity:.5}.carousel-control.left{background-image:-webkit-linear-gradient(left,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);background-image:-o-linear-gradient(left,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);background-image:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.5)),to(rgba(0,0,0,.0001)));background-image:linear-gradient(to right,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1);background-repeat:repeat-x}.carousel-control.right{right:0;left:auto;background-image:-webkit-linear-gradient(left,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);background-image:-o-linear-gradient(left,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);background-image:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.0001)),to(rgba(0,0,0,.5)));background-image:linear-gradient(to right,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1);background-repeat:repeat-x}.carousel-control:focus,.carousel-control:hover{color:#fff;text-decoration:none;filter:alpha(opacity=90);outline:0;opacity:.9}.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next,.carousel-control .icon-prev{position:absolute;top:50%;z-index:5;display:inline-block;margin-top:-10px}.carousel-control .glyphicon-chevron-left,.carousel-control .icon-prev{left:50%;margin-left:-10px}.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next{right:50%;margin-right:-10px}.carousel-control .icon-next,.carousel-control .icon-prev{width:20px;height:20px;font-family:serif;line-height:1}.carousel-control .icon-prev:before{content:'\2039'}.carousel-control .icon-next:before{content:'\203a'}.carousel-indicators{position:absolute;bottom:10px;left:50%;z-index:15;width:60%;padding-left:0;margin-left:-30%;text-align:center;list-style:none}.carousel-indicators li{display:inline-block;width:10px;height:10px;margin:1px;text-indent:-999px;cursor:pointer;background-color:#000\9;background-color:rgba(0,0,0,0);border:1px solid #fff;border-radius:10px}.carousel-indicators .active{width:12px;height:12px;margin:0;background-color:#fff}.carousel-caption{position:absolute;right:15%;bottom:20px;left:15%;z-index:10;padding-top:20px;padding-bottom:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6)}.carousel-caption .btn{text-shadow:none}@media screen and (min-width:768px){.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next,.carousel-control .icon-prev{width:30px;height:30px;margin-top:-10px;font-size:30px}.carousel-control .glyphicon-chevron-left,.carousel-control .icon-prev{margin-left:-10px}.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next{margin-right:-10px}.carousel-caption{right:20%;left:20%;padding-bottom:30px}.carousel-indicators{bottom:20px}}.btn-group-vertical>.btn-group:after,.btn-group-vertical>.btn-group:before,.btn-toolbar:after,.btn-toolbar:before,.clearfix:after,.clearfix:before,.container-fluid:after,.container-fluid:before,.container:after,.container:before,.dl-horizontal dd:after,.dl-horizontal dd:before,.form-horizontal .form-group:after,.form-horizontal .form-group:before,.modal-footer:after,.modal-footer:before,.modal-header:after,.modal-header:before,.nav:after,.nav:before,.navbar-collapse:after,.navbar-collapse:before,.navbar-header:after,.navbar-header:before,.navbar:after,.navbar:before,.pager:after,.pager:before,.panel-body:after,.panel-body:before,.row:after,.row:before{display:table;content:" "}.btn-group-vertical>.btn-group:after,.btn-toolbar:after,.clearfix:after,.container-fluid:after,.container:after,.dl-horizontal dd:after,.form-horizontal .form-group:after,.modal-footer:after,.modal-header:after,.nav:after,.navbar-collapse:after,.navbar-header:after,.navbar:after,.pager:after,.panel-body:after,.row:after{clear:both}.center-block{display:block;margin-right:auto;margin-left:auto}.pull-right{float:right!important}.pull-left{float:left!important}.hide{display:none!important}.show{display:block!important}.invisible{visibility:hidden}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.hidden{display:none!important}.affix{position:fixed}@-ms-viewport{width:device-width}.visible-lg,.visible-md,.visible-sm,.visible-xs{display:none!important}.visible-lg-block,.visible-lg-inline,.visible-lg-inline-block,.visible-md-block,.visible-md-inline,.visible-md-inline-block,.visible-sm-block,.visible-sm-inline,.visible-sm-inline-block,.visible-xs-block,.visible-xs-inline,.visible-xs-inline-block{display:none!important}@media (max-width:767px){.visible-xs{display:block!important}table.visible-xs{display:table!important}tr.visible-xs{display:table-row!important}td.visible-xs,th.visible-xs{display:table-cell!important}}@media (max-width:767px){.visible-xs-block{display:block!important}}@media (max-width:767px){.visible-xs-inline{display:inline!important}}@media (max-width:767px){.visible-xs-inline-block{display:inline-block!important}}@media (min-width:768px) and (max-width:991px){.visible-sm{display:block!important}table.visible-sm{display:table!important}tr.visible-sm{display:table-row!important}td.visible-sm,th.visible-sm{display:table-cell!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-block{display:block!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline{display:inline!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline-block{display:inline-block!important}}@media (min-width:992px) and (max-width:1199px){.visible-md{display:block!important}table.visible-md{display:table!important}tr.visible-md{display:table-row!important}td.visible-md,th.visible-md{display:table-cell!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-block{display:block!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline{display:inline!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline-block{display:inline-block!important}}@media (min-width:1200px){.visible-lg{display:block!important}table.visible-lg{display:table!important}tr.visible-lg{display:table-row!important}td.visible-lg,th.visible-lg{display:table-cell!important}}@media (min-width:1200px){.visible-lg-block{display:block!important}}@media (min-width:1200px){.visible-lg-inline{display:inline!important}}@media (min-width:1200px){.visible-lg-inline-block{display:inline-block!important}}@media (max-width:767px){.hidden-xs{display:none!important}}@media (min-width:768px) and (max-width:991px){.hidden-sm{display:none!important}}@media (min-width:992px) and (max-width:1199px){.hidden-md{display:none!important}}@media (min-width:1200px){.hidden-lg{display:none!important}}.visible-print{display:none!important}@media print{.visible-print{display:block!important}table.visible-print{display:table!important}tr.visible-print{display:table-row!important}td.visible-print,th.visible-print{display:table-cell!important}}.visible-print-block{display:none!important}@media print{.visible-print-block{display:block!important}}.visible-print-inline{display:none!important}@media print{.visible-print-inline{display:inline!important}}.visible-print-inline-block{display:none!important}@media print{.visible-print-inline-block{display:inline-block!important}}@media print{.hidden-print{display:none!important}} +/*# sourceMappingURL=bootstrap.min.css.map */ \ No newline at end of file diff --git a/debug-db/src/main/assets/bootstrap.min.js b/debug-db/src/main/assets/bootstrap.min.js new file mode 100644 index 0000000..9bcd2fc --- /dev/null +++ b/debug-db/src/main/assets/bootstrap.min.js @@ -0,0 +1,7 @@ +/*! + * Bootstrap v3.3.7 (http://getbootstrap.com) + * Copyright 2011-2016 Twitter, Inc. + * Licensed under the MIT license + */ +if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";var b=a.fn.jquery.split(" ")[0].split(".");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1||b[0]>3)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4")}(jQuery),+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){if(a(b.target).is(this))return b.handleObj.handler.apply(this,arguments)}})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var c=a(this),e=c.data("bs.alert");e||c.data("bs.alert",e=new d(this)),"string"==typeof b&&e[b].call(c)})}var c='[data-dismiss="alert"]',d=function(b){a(b).on("click",c,this.close)};d.VERSION="3.3.7",d.TRANSITION_DURATION=150,d.prototype.close=function(b){function c(){g.detach().trigger("closed.bs.alert").remove()}var e=a(this),f=e.attr("data-target");f||(f=e.attr("href"),f=f&&f.replace(/.*(?=#[^\s]*$)/,""));var g=a("#"===f?[]:f);b&&b.preventDefault(),g.length||(g=e.closest(".alert")),g.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(g.removeClass("in"),a.support.transition&&g.hasClass("fade")?g.one("bsTransitionEnd",c).emulateTransitionEnd(d.TRANSITION_DURATION):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on("click.bs.alert.data-api",c,d.prototype.close)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof b&&b;e||d.data("bs.button",e=new c(this,f)),"toggle"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION="3.3.7",c.DEFAULTS={loadingText:"loading..."},c.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",null==f.resetText&&d.data("resetText",d[e]()),setTimeout(a.proxy(function(){d[e](null==f[b]?this.options[b]:f[b]),"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c).prop(c,!0)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c).prop(c,!1))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")?(c.prop("checked")&&(a=!1),b.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==c.prop("type")&&(c.prop("checked")!==this.$element.hasClass("active")&&(a=!1),this.$element.toggleClass("active")),c.prop("checked",this.$element.hasClass("active")),a&&c.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(c){var d=a(c.target).closest(".btn");b.call(d,"toggle"),a(c.target).is('input[type="radio"], input[type="checkbox"]')||(c.preventDefault(),d.is("input,button")?d.trigger("focus"):d.find("input:visible,button:visible").first().trigger("focus"))}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(b){a(b.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(b.type))})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b),g="string"==typeof b?b:f.slide;e||d.data("bs.carousel",e=new c(this,f)),"number"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",a.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))};c.VERSION="3.3.7",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},c.prototype.keydown=function(a){if(!/input|textarea/i.test(a.target.tagName)){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()}},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(a){return this.$items=a.parent().children(".item"),this.$items.index(a||this.$active)},c.prototype.getItemForDirection=function(a,b){var c=this.getItemIndex(b),d="prev"==a&&0===c||"next"==a&&c==this.$items.length-1;if(d&&!this.options.wrap)return b;var e="prev"==a?-1:1,f=(c+e)%this.$items.length;return this.$items.eq(f)},c.prototype.to=function(a){var b=this,c=this.getItemIndex(this.$active=this.$element.find(".item.active"));if(!(a>this.$items.length-1||a<0))return this.sliding?this.$element.one("slid.bs.carousel",function(){b.to(a)}):c==a?this.pause().cycle():this.slide(a>c?"next":"prev",this.$items.eq(a))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){if(!this.sliding)return this.slide("next")},c.prototype.prev=function(){if(!this.sliding)return this.slide("prev")},c.prototype.slide=function(b,d){var e=this.$element.find(".item.active"),f=d||this.getItemForDirection(b,e),g=this.interval,h="next"==b?"left":"right",i=this;if(f.hasClass("active"))return this.sliding=!1;var j=f[0],k=a.Event("slide.bs.carousel",{relatedTarget:j,direction:h});if(this.$element.trigger(k),!k.isDefaultPrevented()){if(this.sliding=!0,g&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var l=a(this.$indicators.children()[this.getItemIndex(f)]);l&&l.addClass("active")}var m=a.Event("slid.bs.carousel",{relatedTarget:j,direction:h});return a.support.transition&&this.$element.hasClass("slide")?(f.addClass(b),f[0].offsetWidth,e.addClass(h),f.addClass(h),e.one("bsTransitionEnd",function(){f.removeClass([b,h].join(" ")).addClass("active"),e.removeClass(["active",h].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger(m)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(e.removeClass("active"),f.addClass("active"),this.sliding=!1,this.$element.trigger(m)),g&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this};var e=function(c){var d,e=a(this),f=a(e.attr("data-target")||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""));if(f.hasClass("carousel")){var g=a.extend({},f.data(),e.data()),h=e.attr("data-slide-to");h&&(g.interval=!1),b.call(f,g),h&&f.data("bs.carousel").to(h),c.preventDefault()}};a(document).on("click.bs.carousel.data-api","[data-slide]",e).on("click.bs.carousel.data-api","[data-slide-to]",e),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){"use strict";function b(b){var c,d=b.attr("data-target")||(c=b.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"");return a(d)}function c(b){return this.each(function(){var c=a(this),e=c.data("bs.collapse"),f=a.extend({},d.DEFAULTS,c.data(),"object"==typeof b&&b);!e&&f.toggle&&/show|hide/.test(b)&&(f.toggle=!1),e||c.data("bs.collapse",e=new d(this,f)),"string"==typeof b&&e[b]()})}var d=function(b,c){this.$element=a(b),this.options=a.extend({},d.DEFAULTS,c),this.$trigger=a('[data-toggle="collapse"][href="#'+b.id+'"],[data-toggle="collapse"][data-target="#'+b.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};d.VERSION="3.3.7",d.TRANSITION_DURATION=350,d.DEFAULTS={toggle:!0},d.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},d.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b,e=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(e&&e.length&&(b=e.data("bs.collapse"),b&&b.transitioning))){var f=a.Event("show.bs.collapse");if(this.$element.trigger(f),!f.isDefaultPrevented()){e&&e.length&&(c.call(e,"hide"),b||e.data("bs.collapse",null));var g=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[g](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var h=function(){this.$element.removeClass("collapsing").addClass("collapse in")[g](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return h.call(this);var i=a.camelCase(["scroll",g].join("-"));this.$element.one("bsTransitionEnd",a.proxy(h,this)).emulateTransitionEnd(d.TRANSITION_DURATION)[g](this.$element[0][i])}}}},d.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var e=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return a.support.transition?void this.$element[c](0).one("bsTransitionEnd",a.proxy(e,this)).emulateTransitionEnd(d.TRANSITION_DURATION):e.call(this)}}},d.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},d.prototype.getParent=function(){return a(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(a.proxy(function(c,d){var e=a(d);this.addAriaAndCollapsedClass(b(e),e)},this)).end()},d.prototype.addAriaAndCollapsedClass=function(a,b){var c=a.hasClass("in");a.attr("aria-expanded",c),b.toggleClass("collapsed",!c).attr("aria-expanded",c)};var e=a.fn.collapse;a.fn.collapse=c,a.fn.collapse.Constructor=d,a.fn.collapse.noConflict=function(){return a.fn.collapse=e,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(d){var e=a(this);e.attr("data-target")||d.preventDefault();var f=b(e),g=f.data("bs.collapse"),h=g?"toggle":e.data();c.call(f,h)})}(jQuery),+function(a){"use strict";function b(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}function c(c){c&&3===c.which||(a(e).remove(),a(f).each(function(){var d=a(this),e=b(d),f={relatedTarget:this};e.hasClass("open")&&(c&&"click"==c.type&&/input|textarea/i.test(c.target.tagName)&&a.contains(e[0],c.target)||(e.trigger(c=a.Event("hide.bs.dropdown",f)),c.isDefaultPrevented()||(d.attr("aria-expanded","false"),e.removeClass("open").trigger(a.Event("hidden.bs.dropdown",f)))))}))}function d(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new g(this)),"string"==typeof b&&d[b].call(c)})}var e=".dropdown-backdrop",f='[data-toggle="dropdown"]',g=function(b){a(b).on("click.bs.dropdown",this.toggle)};g.VERSION="3.3.7",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=b(e),g=f.hasClass("open");if(c(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(a(this)).on("click",c);var h={relatedTarget:this};if(f.trigger(d=a.Event("show.bs.dropdown",h)),d.isDefaultPrevented())return;e.trigger("focus").attr("aria-expanded","true"),f.toggleClass("open").trigger(a.Event("shown.bs.dropdown",h))}return!1}},g.prototype.keydown=function(c){if(/(38|40|27|32)/.test(c.which)&&!/input|textarea/i.test(c.target.tagName)){var d=a(this);if(c.preventDefault(),c.stopPropagation(),!d.is(".disabled, :disabled")){var e=b(d),g=e.hasClass("open");if(!g&&27!=c.which||g&&27==c.which)return 27==c.which&&e.find(f).trigger("focus"),d.trigger("click");var h=" li:not(.disabled):visible a",i=e.find(".dropdown-menu"+h);if(i.length){var j=i.index(c.target);38==c.which&&j>0&&j--,40==c.which&&jdocument.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&a?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!a?this.scrollbarWidth:""})},c.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},c.prototype.checkScrollbar=function(){var a=window.innerWidth;if(!a){var b=document.documentElement.getBoundingClientRect();a=b.right-Math.abs(b.left)}this.bodyIsOverflowing=document.body.clientWidth
',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},c.prototype.init=function(b,c,d){if(this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.$viewport=this.options.viewport&&a(a.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focusin",i="hover"==g?"mouseleave":"focusout";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},c.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},c.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusin"==b.type?"focus":"hover"]=!0),c.tip().hasClass("in")||"in"==c.hoverState?void(c.hoverState="in"):(clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?void(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show)):c.show())},c.prototype.isInStateTrue=function(){for(var a in this.inState)if(this.inState[a])return!0;return!1},c.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);if(c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusout"==b.type?"focus":"hover"]=!1),!c.isInStateTrue())return clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide)):c.hide()},c.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(b);var d=a.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(b.isDefaultPrevented()||!d)return;var e=this,f=this.tip(),g=this.getUID(this.type);this.setContent(),f.attr("id",g),this.$element.attr("aria-describedby",g),this.options.animation&&f.addClass("fade");var h="function"==typeof this.options.placement?this.options.placement.call(this,f[0],this.$element[0]):this.options.placement,i=/\s?auto?\s?/i,j=i.test(h);j&&(h=h.replace(i,"")||"top"),f.detach().css({top:0,left:0,display:"block"}).addClass(h).data("bs."+this.type,this),this.options.container?f.appendTo(this.options.container):f.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var k=this.getPosition(),l=f[0].offsetWidth,m=f[0].offsetHeight;if(j){var n=h,o=this.getPosition(this.$viewport);h="bottom"==h&&k.bottom+m>o.bottom?"top":"top"==h&&k.top-mo.width?"left":"left"==h&&k.left-lg.top+g.height&&(e.top=g.top+g.height-i)}else{var j=b.left-f,k=b.left+f+c;jg.right&&(e.left=g.left+g.width-k)}return e},c.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.title)},c.prototype.getUID=function(a){do a+=~~(1e6*Math.random());while(document.getElementById(a));return a},c.prototype.tip=function(){if(!this.$tip&&(this.$tip=a(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},c.prototype.enable=function(){this.enabled=!0},c.prototype.disable=function(){this.enabled=!1},c.prototype.toggleEnabled=function(){this.enabled=!this.enabled},c.prototype.toggle=function(b){var c=this;b&&(c=a(b.currentTarget).data("bs."+this.type),c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c))),b?(c.inState.click=!c.inState.click,c.isInStateTrue()?c.enter(c):c.leave(c)):c.tip().hasClass("in")?c.leave(c):c.enter(c)},c.prototype.destroy=function(){var a=this;clearTimeout(this.timeout),this.hide(function(){a.$element.off("."+a.type).removeData("bs."+a.type),a.$tip&&a.$tip.detach(),a.$tip=null,a.$arrow=null,a.$viewport=null,a.$element=null})};var d=a.fn.tooltip;a.fn.tooltip=b,a.fn.tooltip.Constructor=c,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=d,this}}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof b&&b;!e&&/destroy|hide/.test(b)||(e||d.data("bs.popover",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.init("popover",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");c.VERSION="3.3.7",c.DEFAULTS=a.extend({},a.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:''}),c.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),c.prototype.constructor=c,c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof c?"html":"append":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},c.prototype.hasContent=function(){return this.getTitle()||this.getContent()},c.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var d=a.fn.popover;a.fn.popover=b,a.fn.popover.Constructor=c,a.fn.popover.noConflict=function(){return a.fn.popover=d,this}}(jQuery),+function(a){"use strict";function b(c,d){this.$body=a(document.body),this.$scrollElement=a(a(c).is(document.body)?window:c),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",a.proxy(this.process,this)),this.refresh(),this.process()}function c(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})}b.VERSION="3.3.7",b.DEFAULTS={offset:10},b.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},b.prototype.refresh=function(){var b=this,c="offset",d=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),a.isWindow(this.$scrollElement[0])||(c="position",d=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var b=a(this),e=b.data("target")||b.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[c]().top+d,e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){b.offsets.push(this[0]),b.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.getScrollHeight(),d=this.options.offset+c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(this.scrollHeight!=c&&this.refresh(),b>=d)return g!=(a=f[f.length-1])&&this.activate(a);if(g&&b=e[a]&&(void 0===e[a+1]||b .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),b.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),h?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu").length&&b.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),e&&e()}var g=d.find("> .active"),h=e&&a.support.transition&&(g.length&&g.hasClass("fade")||!!d.find("> .fade").length);g.length&&h?g.one("bsTransitionEnd",f).emulateTransitionEnd(c.TRANSITION_DURATION):f(),g.removeClass("in")};var d=a.fn.tab;a.fn.tab=b,a.fn.tab.Constructor=c,a.fn.tab.noConflict=function(){return a.fn.tab=d,this};var e=function(c){c.preventDefault(),b.call(a(this),"show")};a(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',e).on("click.bs.tab.data-api",'[data-toggle="pill"]',e)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof b&&b;e||d.data("bs.affix",e=new c(this,f)),"string"==typeof b&&e[b]()})}var c=function(b,d){this.options=a.extend({},c.DEFAULTS,d),this.$target=a(this.options.target).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(b),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};c.VERSION="3.3.7",c.RESET="affix affix-top affix-bottom",c.DEFAULTS={offset:0,target:window},c.prototype.getState=function(a,b,c,d){var e=this.$target.scrollTop(),f=this.$element.offset(),g=this.$target.height();if(null!=c&&"top"==this.affixed)return e=a-d&&"bottom"},c.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(c.RESET).addClass("affix");var a=this.$target.scrollTop(),b=this.$element.offset();return this.pinnedOffset=b.top-a},c.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},c.prototype.checkPosition=function(){if(this.$element.is(":visible")){var b=this.$element.height(),d=this.options.offset,e=d.top,f=d.bottom,g=Math.max(a(document).height(),a(document.body).height());"object"!=typeof d&&(f=e=d),"function"==typeof e&&(e=d.top(this.$element)),"function"==typeof f&&(f=d.bottom(this.$element));var h=this.getState(g,b,e,f);if(this.affixed!=h){null!=this.unpin&&this.$element.css("top","");var i="affix"+(h?"-"+h:""),j=a.Event(i+".bs.affix");if(this.$element.trigger(j),j.isDefaultPrevented())return;this.affixed=h,this.unpin="bottom"==h?this.getPinnedOffset():null,this.$element.removeClass(c.RESET).addClass(i).trigger(i.replace("affix","affixed")+".bs.affix")}"bottom"==h&&this.$element.offset({top:g-b-f})}};var d=a.fn.affix;a.fn.affix=b,a.fn.affix.Constructor=c,a.fn.affix.noConflict=function(){return a.fn.affix=d,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var c=a(this),d=c.data();d.offset=d.offset||{},null!=d.offsetBottom&&(d.offset.bottom=d.offsetBottom),null!=d.offsetTop&&(d.offset.top=d.offsetTop),b.call(c,d)})})}(jQuery); \ No newline at end of file diff --git a/debug-db/src/main/assets/buttons.dataTables.min.css b/debug-db/src/main/assets/buttons.dataTables.min.css new file mode 100644 index 0000000..7fcddfe --- /dev/null +++ b/debug-db/src/main/assets/buttons.dataTables.min.css @@ -0,0 +1 @@ +div.dt-button-info{position:fixed;top:50%;left:50%;width:400px;margin-top:-100px;margin-left:-200px;background-color:white;border:2px solid #111;box-shadow:3px 3px 8px rgba(0,0,0,0.3);border-radius:3px;text-align:center;z-index:21}div.dt-button-info h2{padding:0.5em;margin:0;font-weight:normal;border-bottom:1px solid #ddd;background-color:#f3f3f3}div.dt-button-info>div{padding:1em}button.dt-button,div.dt-button,a.dt-button{position:relative;display:inline-block;box-sizing:border-box;margin-right:0.333em;padding:0.5em 1em;border:1px solid #999;border-radius:2px;cursor:pointer;font-size:0.88em;color:black;white-space:nowrap;overflow:hidden;background-color:#e9e9e9;background-image:-webkit-linear-gradient(top, #fff 0%, #e9e9e9 100%);background-image:-moz-linear-gradient(top, #fff 0%, #e9e9e9 100%);background-image:-ms-linear-gradient(top, #fff 0%, #e9e9e9 100%);background-image:-o-linear-gradient(top, #fff 0%, #e9e9e9 100%);background-image:linear-gradient(top, #fff 0%, #e9e9e9 100%);filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,StartColorStr='white', EndColorStr='#e9e9e9');-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;text-decoration:none;outline:none}button.dt-button.disabled,div.dt-button.disabled,a.dt-button.disabled{color:#999;border:1px solid #d0d0d0;cursor:default;background-color:#f9f9f9;background-image:-webkit-linear-gradient(top, #fff 0%, #f9f9f9 100%);background-image:-moz-linear-gradient(top, #fff 0%, #f9f9f9 100%);background-image:-ms-linear-gradient(top, #fff 0%, #f9f9f9 100%);background-image:-o-linear-gradient(top, #fff 0%, #f9f9f9 100%);background-image:linear-gradient(top, #fff 0%, #f9f9f9 100%);filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,StartColorStr='#ffffff', EndColorStr='#f9f9f9')}button.dt-button:active:not(.disabled),button.dt-button.active:not(.disabled),div.dt-button:active:not(.disabled),div.dt-button.active:not(.disabled),a.dt-button:active:not(.disabled),a.dt-button.active:not(.disabled){background-color:#e2e2e2;background-image:-webkit-linear-gradient(top, #f3f3f3 0%, #e2e2e2 100%);background-image:-moz-linear-gradient(top, #f3f3f3 0%, #e2e2e2 100%);background-image:-ms-linear-gradient(top, #f3f3f3 0%, #e2e2e2 100%);background-image:-o-linear-gradient(top, #f3f3f3 0%, #e2e2e2 100%);background-image:linear-gradient(top, #f3f3f3 0%, #e2e2e2 100%);filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,StartColorStr='#f3f3f3', EndColorStr='#e2e2e2');box-shadow:inset 1px 1px 3px #999999}button.dt-button:active:not(.disabled):hover:not(.disabled),button.dt-button.active:not(.disabled):hover:not(.disabled),div.dt-button:active:not(.disabled):hover:not(.disabled),div.dt-button.active:not(.disabled):hover:not(.disabled),a.dt-button:active:not(.disabled):hover:not(.disabled),a.dt-button.active:not(.disabled):hover:not(.disabled){box-shadow:inset 1px 1px 3px #999999;background-color:#cccccc;background-image:-webkit-linear-gradient(top, #eaeaea 0%, #ccc 100%);background-image:-moz-linear-gradient(top, #eaeaea 0%, #ccc 100%);background-image:-ms-linear-gradient(top, #eaeaea 0%, #ccc 100%);background-image:-o-linear-gradient(top, #eaeaea 0%, #ccc 100%);background-image:linear-gradient(top, #eaeaea 0%, #ccc 100%);filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,StartColorStr='#eaeaea', EndColorStr='#cccccc')}button.dt-button:hover,div.dt-button:hover,a.dt-button:hover{text-decoration:none}button.dt-button:hover:not(.disabled),div.dt-button:hover:not(.disabled),a.dt-button:hover:not(.disabled){border:1px solid #666;background-color:#e0e0e0;background-image:-webkit-linear-gradient(top, #f9f9f9 0%, #e0e0e0 100%);background-image:-moz-linear-gradient(top, #f9f9f9 0%, #e0e0e0 100%);background-image:-ms-linear-gradient(top, #f9f9f9 0%, #e0e0e0 100%);background-image:-o-linear-gradient(top, #f9f9f9 0%, #e0e0e0 100%);background-image:linear-gradient(top, #f9f9f9 0%, #e0e0e0 100%);filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,StartColorStr='#f9f9f9', EndColorStr='#e0e0e0')}button.dt-button:focus:not(.disabled),div.dt-button:focus:not(.disabled),a.dt-button:focus:not(.disabled){border:1px solid #426c9e;text-shadow:0 1px 0 #c4def1;outline:none;background-color:#79ace9;background-image:-webkit-linear-gradient(top, #bddef4 0%, #79ace9 100%);background-image:-moz-linear-gradient(top, #bddef4 0%, #79ace9 100%);background-image:-ms-linear-gradient(top, #bddef4 0%, #79ace9 100%);background-image:-o-linear-gradient(top, #bddef4 0%, #79ace9 100%);background-image:linear-gradient(top, #bddef4 0%, #79ace9 100%);filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,StartColorStr='#bddef4', EndColorStr='#79ace9')}.dt-button embed{outline:none}div.dt-buttons{position:relative;float:left}div.dt-buttons.buttons-right{float:right}div.dt-button-collection{position:absolute;top:0;left:0;width:150px;margin-top:3px;padding:8px 8px 4px 8px;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.4);background-color:white;overflow:hidden;z-index:2002;border-radius:5px;box-shadow:3px 3px 5px rgba(0,0,0,0.3);z-index:2002;-webkit-column-gap:8px;-moz-column-gap:8px;-ms-column-gap:8px;-o-column-gap:8px;column-gap:8px}div.dt-button-collection button.dt-button,div.dt-button-collection div.dt-button,div.dt-button-collection a.dt-button{position:relative;left:0;right:0;display:block;float:none;margin-bottom:4px;margin-right:0}div.dt-button-collection button.dt-button:active:not(.disabled),div.dt-button-collection button.dt-button.active:not(.disabled),div.dt-button-collection div.dt-button:active:not(.disabled),div.dt-button-collection div.dt-button.active:not(.disabled),div.dt-button-collection a.dt-button:active:not(.disabled),div.dt-button-collection a.dt-button.active:not(.disabled){background-color:#dadada;background-image:-webkit-linear-gradient(top, #f0f0f0 0%, #dadada 100%);background-image:-moz-linear-gradient(top, #f0f0f0 0%, #dadada 100%);background-image:-ms-linear-gradient(top, #f0f0f0 0%, #dadada 100%);background-image:-o-linear-gradient(top, #f0f0f0 0%, #dadada 100%);background-image:linear-gradient(top, #f0f0f0 0%, #dadada 100%);filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,StartColorStr='#f0f0f0', EndColorStr='#dadada');box-shadow:inset 1px 1px 3px #666}div.dt-button-collection.fixed{position:fixed;top:50%;left:50%;margin-left:-75px;border-radius:0}div.dt-button-collection.fixed.two-column{margin-left:-150px}div.dt-button-collection.fixed.three-column{margin-left:-225px}div.dt-button-collection.fixed.four-column{margin-left:-300px}div.dt-button-collection>*{-webkit-column-break-inside:avoid;break-inside:avoid}div.dt-button-collection.two-column{width:300px;padding-bottom:1px;-webkit-column-count:2;-moz-column-count:2;-ms-column-count:2;-o-column-count:2;column-count:2}div.dt-button-collection.three-column{width:450px;padding-bottom:1px;-webkit-column-count:3;-moz-column-count:3;-ms-column-count:3;-o-column-count:3;column-count:3}div.dt-button-collection.four-column{width:600px;padding-bottom:1px;-webkit-column-count:4;-moz-column-count:4;-ms-column-count:4;-o-column-count:4;column-count:4}div.dt-button-background{position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,0.7);background:-ms-radial-gradient(center, ellipse farthest-corner, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.7) 100%);background:-moz-radial-gradient(center, ellipse farthest-corner, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.7) 100%);background:-o-radial-gradient(center, ellipse farthest-corner, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.7) 100%);background:-webkit-gradient(radial, center center, 0, center center, 497, color-stop(0, rgba(0,0,0,0.3)), color-stop(1, rgba(0,0,0,0.7)));background:-webkit-radial-gradient(center, ellipse farthest-corner, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.7) 100%);background:radial-gradient(ellipse farthest-corner at center, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.7) 100%);z-index:2001}@media screen and (max-width: 640px){div.dt-buttons{float:none !important;text-align:center}} diff --git a/debug-db/src/main/assets/dataTables.responsive.min.js b/debug-db/src/main/assets/dataTables.responsive.min.js new file mode 100644 index 0000000..8fc97ef --- /dev/null +++ b/debug-db/src/main/assets/dataTables.responsive.min.js @@ -0,0 +1,25 @@ +/*! + Responsive 2.0.2 + 2014-2016 SpryMedia Ltd - datatables.net/license +*/ +(function(c){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(j){return c(j,window,document)}):"object"===typeof exports?module.exports=function(j,k){j||(j=window);if(!k||!k.fn.dataTable)k=require("datatables.net")(j,k).$;return c(k,j,j.document)}:c(jQuery,window,document)})(function(c,j,k,p){var n=c.fn.dataTable,l=function(a,b){if(!n.versionCheck||!n.versionCheck("1.10.3"))throw"DataTables Responsive requires DataTables 1.10.3 or newer";this.s={dt:new n.Api(a),columns:[], +current:[]};this.s.dt.settings()[0].responsive||(b&&"string"===typeof b.details?b.details={type:b.details}:b&&!1===b.details?b.details={type:!1}:b&&!0===b.details&&(b.details={type:"inline"}),this.c=c.extend(!0,{},l.defaults,n.defaults.responsive,b),a.responsive=this,this._constructor())};c.extend(l.prototype,{_constructor:function(){var a=this,b=this.s.dt,d=b.settings()[0],e=c(j).width();b.settings()[0]._responsive=this;c(j).on("resize.dtr orientationchange.dtr",n.util.throttle(function(){var b= +c(j).width();b!==e&&(a._resize(),e=b)}));d.oApi._fnCallbackReg(d,"aoRowCreatedCallback",function(e){-1!==c.inArray(!1,a.s.current)&&c("td, th",e).each(function(e){e=b.column.index("toData",e);!1===a.s.current[e]&&c(this).css("display","none")})});b.on("destroy.dtr",function(){b.off(".dtr");c(b.table().body()).off(".dtr");c(j).off("resize.dtr orientationchange.dtr");c.each(a.s.current,function(b,e){!1===e&&a._setColumnVis(b,!0)})});this.c.breakpoints.sort(function(a,b){return a.width +b.width?-1:0});this._classLogic();this._resizeAuto();d=this.c.details;!1!==d.type&&(a._detailsInit(),b.on("column-visibility.dtr",function(){a._classLogic();a._resizeAuto();a._resize()}),b.on("draw.dtr",function(){a._redrawChildren()}),c(b.table().node()).addClass("dtr-"+d.type));b.on("column-reorder.dtr",function(){a._classLogic();a._resizeAuto();a._resize()});b.on("column-sizing.dtr",function(){a._resize()});b.on("init.dtr",function(){a._resizeAuto();a._resize();c.inArray(false,a.s.current)&&b.columns.adjust()}); +this._resize()},_columnsVisiblity:function(a){var b=this.s.dt,d=this.s.columns,e,f,g=d.map(function(a,b){return{columnIdx:b,priority:a.priority}}).sort(function(a,b){return a.priority!==b.priority?a.priority-b.priority:a.columnIdx-b.columnIdx}),h=c.map(d,function(b){return b.auto&&null===b.minWidth?!1:!0===b.auto?"-":-1!==c.inArray(a,b.includeIn)}),m=0;e=0;for(f=h.length;eb-d[i].minWidth?(m=!0,h[i]=!1):h[i]=!0,b-=d[i].minWidth)}g=!1;e=0;for(f=d.length;e= +g&&f(c,b[d].name)}else{if("not-"===i){d=0;for(i=b.length;d").append(h).appendTo(f)}c("").append(g).appendTo(e);"inline"===this.c.details.type&&c(d).addClass("dtr-inline collapsed");d=c("
").css({width:1,height:1,overflow:"hidden"}).append(d);d.insertBefore(a.table().node()); +g.each(function(c){c=a.column.index("fromVisible",c);b[c].minWidth=this.offsetWidth||0});d.remove()}},_setColumnVis:function(a,b){var d=this.s.dt,e=b?"":"none";c(d.column(a).header()).css("display",e);c(d.column(a).footer()).css("display",e);d.column(a).nodes().to$().css("display",e)},_tabIndexes:function(){var a=this.s.dt,b=a.cells({page:"current"}).nodes().to$(),d=a.settings()[0],e=this.c.details.target;b.filter("[data-dtr-keyboard]").removeData("[data-dtr-keyboard]");c("number"===typeof e?":eq("+ +e+")":e,a.rows({page:"current"}).nodes()).attr("tabIndex",d.iTabIndex).data("dtr-keyboard",1)}});l.breakpoints=[{name:"desktop",width:Infinity},{name:"tablet-l",width:1024},{name:"tablet-p",width:768},{name:"mobile-l",width:480},{name:"mobile-p",width:320}];l.display={childRow:function(a,b,d){if(b){if(c(a.node()).hasClass("parent"))return a.child(d(),"child").show(),!0}else{if(a.child.isShown())return a.child(!1),c(a.node()).removeClass("parent"),!1;a.child(d(),"child").show();c(a.node()).addClass("parent"); +return!0}},childRowImmediate:function(a,b,d){if(!b&&a.child.isShown()||!a.responsive.hasHidden())return a.child(!1),c(a.node()).removeClass("parent"),!1;a.child(d(),"child").show();c(a.node()).addClass("parent");return!0},modal:function(a){return function(b,d,e){if(d)c("div.dtr-modal-content").empty().append(e());else{var f=function(){g.remove();c(k).off("keypress.dtr")},g=c('
').append(c('
').append(c('
').append(e())).append(c('
×
').click(function(){f()}))).append(c('
').click(function(){f()})).appendTo("body"); +c(k).on("keyup.dtr",function(a){27===a.keyCode&&(a.stopPropagation(),f())})}a&&a.header&&c("div.dtr-modal-content").prepend("

"+a.header(b)+"

")}}};l.defaults={breakpoints:l.breakpoints,auto:!0,details:{display:l.display.childRow,renderer:function(a,b,d){return(a=c.map(d,function(a){return a.hidden?'
  • '+a.title+' '+a.data+"
  • ": +""}).join(""))?c('
      ').append(a):!1},target:0,type:"inline"},orthogonal:"display"};var o=c.fn.dataTable.Api;o.register("responsive()",function(){return this});o.register("responsive.index()",function(a){a=c(a);return{column:a.data("dtr-index"),row:a.parent().data("dtr-index")}});o.register("responsive.rebuild()",function(){return this.iterator("table",function(a){a._responsive&&a._responsive._classLogic()})});o.register("responsive.recalc()",function(){return this.iterator("table", +function(a){a._responsive&&(a._responsive._resizeAuto(),a._responsive._resize())})});o.register("responsive.hasHidden()",function(){var a=this.context[0];return a._responsive?-1!==c.inArray(!1,a._responsive.s.current):!1});l.version="2.0.2";c.fn.dataTable.Responsive=l;c.fn.DataTable.Responsive=l;c(k).on("preInit.dt.dtr",function(a,b){if("dt"===a.namespace&&(c(b.nTable).hasClass("responsive")||c(b.nTable).hasClass("dt-responsive")||b.oInit.responsive||n.defaults.responsive)){var d=b.oInit.responsive; +!1!==d&&new l(b,c.isPlainObject(d)?d:{})}});return l}); diff --git a/debug-db/src/main/assets/dataTables.select.min.js b/debug-db/src/main/assets/dataTables.select.min.js new file mode 100644 index 0000000..4491760 --- /dev/null +++ b/debug-db/src/main/assets/dataTables.select.min.js @@ -0,0 +1,25 @@ +/*! + Select for DataTables 1.1.2 + 2015-2016 SpryMedia Ltd - datatables.net/license/mit +*/ +(function(e){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(j){return e(j,window,document)}):"object"===typeof exports?module.exports=function(j,l){j||(j=window);if(!l||!l.fn.dataTable)l=require("datatables.net")(j,l).$;return e(l,j,j.document)}:e(jQuery,window,document)})(function(e,j,l,i){function s(a){var b=a.settings()[0]._select.selector;e(a.table().body()).off("mousedown.dtSelect",b).off("mouseup.dtSelect",b).off("click.dtSelect",b);e("body").off("click.dtSelect")} +function u(a){var b=e(a.table().body()),c=a.settings()[0],d=c._select.selector;b.on("mousedown.dtSelect",d,function(c){if(c.shiftKey)b.css("-moz-user-select","none").one("selectstart.dtSelect",d,function(){return!1})}).on("mouseup.dtSelect",d,function(){b.css("-moz-user-select","")}).on("click.dtSelect",d,function(c){var b=a.select.items();if(!j.getSelection||!j.getSelection().toString()){var d=a.settings()[0];if(e(c.target).closest("div.dataTables_wrapper")[0]==a.table().container()){var m=e(c.target).closest("td, th"), +h=a.cell(m).index();a.cell(m).any()&&("row"===b?(b=h.row,t(c,a,d,"row",b)):"column"===b?(b=a.cell(m).index().column,t(c,a,d,"column",b)):"cell"===b&&(b=a.cell(m).index(),t(c,a,d,"cell",b)),d._select_lastCell=h)}}});e("body").on("click.dtSelect",function(b){c._select.blurable&&!e(b.target).parents().filter(a.table().container()).length&&(e(b.target).parents("div.DTE").length||q(c,!0))})}function k(a,b,c,d){if(!d||a.flatten().length)c.unshift(a),e(a.table().node()).triggerHandler(b+".dt",c)}function v(a){var b= +a.settings()[0];if(b._select.info&&b.aanFeatures.i){var c=e(''),d=function(b,d){c.append(e('').append(a.i18n("select."+b+"s",{_:"%d "+b+"s selected","0":"",1:"1 "+b+" selected"},d)))};d("row",a.rows({selected:!0}).flatten().length);d("column",a.columns({selected:!0}).flatten().length);d("cell",a.cells({selected:!0}).flatten().length);e.each(b.aanFeatures.i,function(b,a){var a=e(a),d=a.children("span.select-info");d.length&&d.remove();""!==c.text()&& +a.append(c)})}}function q(a,b){if(b||"single"===a._select.style){var c=new h.Api(a);c.rows({selected:!0}).deselect();c.columns({selected:!0}).deselect();c.cells({selected:!0}).deselect()}}function t(a,b,c,d,f){var n=b.select.style(),g=b[d](f,{selected:!0}).any();"os"===n?a.ctrlKey||a.metaKey?b[d](f).select(!g):a.shiftKey?"cell"===d?(d=c._select_lastCell||null,g=function(c,a){if(c>a)var d=a,a=c,c=d;var f=!1;return b.columns(":visible").indexes().filter(function(b){b===c&&(f=!0);return b===a?(f=!1, +!0):f})},a=function(c,a){var d=b.rows({search:"applied"}).indexes();if(d.indexOf(c)>d.indexOf(a))var f=a,a=c,c=f;var g=!1;return d.filter(function(b){b===c&&(g=!0);return b===a?(g=!1,!0):g})},!b.cells({selected:!0}).any()&&!d?(g=g(0,f.column),d=a(0,f.row)):(g=g(d.column,f.column),d=a(d.row,f.row)),d=b.cells(d,g).flatten(),b.cells(f,{selected:!0}).any()?b.cells(d).deselect():b.cells(d).select()):(a=c._select_lastCell?c._select_lastCell[d]:null,g=b[d+"s"]({search:"applied"}).indexes(),a=e.inArray(a, +g),c=e.inArray(f,g),!b[d+"s"]({selected:!0}).any()&&-1===a?g.splice(e.inArray(f,g)+1,g.length):(a>c&&(n=c,c=a,a=n),g.splice(c+1,g.length),g.splice(0,a)),b[d](f,{selected:!0}).any())?(g.splice(e.inArray(f,g),1),b[d+"s"](g).deselect()):b[d+"s"](g).select():(a=b[d+"s"]({selected:!0}),g&&1===a.flatten().length?b[d](f).deselect():(a.deselect(),b[d](f).select())):b[d](f).select(!g)}function r(a,b){return function(c){return c.i18n("buttons."+a,b)}}var h=e.fn.dataTable;h.select={};h.select.version="1.1.2"; +h.select.init=function(a){var b=a.settings()[0],c=b.oInit.select,d=h.defaults.select,c=c===i?d:c,d="row",f="api",n=!1,g=!0,m="td, th",j="selected";b._select={};if(!0===c)f="os";else if("string"===typeof c)f=c;else if(e.isPlainObject(c)&&(c.blurable!==i&&(n=c.blurable),c.info!==i&&(g=c.info),c.items!==i&&(d=c.items),c.style!==i&&(f=c.style),c.selector!==i&&(m=c.selector),c.className!==i))j=c.className;a.select.selector(m);a.select.items(d);a.select.style(f);a.select.blurable(n);a.select.info(g);b._select.className= +j;e.fn.dataTable.ext.order["select-checkbox"]=function(b,c){return this.api().column(c,{order:"index"}).nodes().map(function(c){return"row"===b._select.items?e(c).parent().hasClass(b._select.className):"cell"===b._select.items?e(c).hasClass(b._select.className):!1})};e(a.table().node()).hasClass("selectable")&&a.select.style("os")};e.each([{type:"row",prop:"aoData"},{type:"column",prop:"aoColumns"}],function(a,b){h.ext.selector[b.type].push(function(c,a,f){var a=a.selected,e,g=[];if(a===i)return f; +for(var h=0,j=f.length;h - - - - - - + @@ -41,7 +35,12 @@ + + + + + diff --git a/debug-db/src/main/assets/jquery.dataTables.min.css b/debug-db/src/main/assets/jquery.dataTables.min.css new file mode 100644 index 0000000..781de6b --- /dev/null +++ b/debug-db/src/main/assets/jquery.dataTables.min.css @@ -0,0 +1 @@ +table.dataTable{width:100%;margin:0 auto;clear:both;border-collapse:separate;border-spacing:0}table.dataTable thead th,table.dataTable tfoot th{font-weight:bold}table.dataTable thead th,table.dataTable thead td{padding:10px 18px;border-bottom:1px solid #111}table.dataTable thead th:active,table.dataTable thead td:active{outline:none}table.dataTable tfoot th,table.dataTable tfoot td{padding:10px 18px 6px 18px;border-top:1px solid #111}table.dataTable thead .sorting,table.dataTable thead .sorting_asc,table.dataTable thead .sorting_desc{cursor:pointer;*cursor:hand}table.dataTable thead .sorting,table.dataTable thead .sorting_asc,table.dataTable thead .sorting_desc,table.dataTable thead .sorting_asc_disabled,table.dataTable thead .sorting_desc_disabled{background-repeat:no-repeat;background-position:center right}table.dataTable thead .sorting{background-image:url("../images/sort_both.png")}table.dataTable thead .sorting_asc{background-image:url("../images/sort_asc.png")}table.dataTable thead .sorting_desc{background-image:url("../images/sort_desc.png")}table.dataTable thead .sorting_asc_disabled{background-image:url("../images/sort_asc_disabled.png")}table.dataTable thead .sorting_desc_disabled{background-image:url("../images/sort_desc_disabled.png")}table.dataTable tbody tr{background-color:#ffffff}table.dataTable tbody tr.selected{background-color:#B0BED9}table.dataTable tbody th,table.dataTable tbody td{padding:8px 10px}table.dataTable.row-border tbody th,table.dataTable.row-border tbody td,table.dataTable.display tbody th,table.dataTable.display tbody td{border-top:1px solid #ddd}table.dataTable.row-border tbody tr:first-child th,table.dataTable.row-border tbody tr:first-child td,table.dataTable.display tbody tr:first-child th,table.dataTable.display tbody tr:first-child td{border-top:none}table.dataTable.cell-border tbody th,table.dataTable.cell-border tbody td{border-top:1px solid #ddd;border-right:1px solid #ddd}table.dataTable.cell-border tbody tr th:first-child,table.dataTable.cell-border tbody tr td:first-child{border-left:1px solid #ddd}table.dataTable.cell-border tbody tr:first-child th,table.dataTable.cell-border tbody tr:first-child td{border-top:none}table.dataTable.stripe tbody tr.odd,table.dataTable.display tbody tr.odd{background-color:#f9f9f9}table.dataTable.stripe tbody tr.odd.selected,table.dataTable.display tbody tr.odd.selected{background-color:#acbad4}table.dataTable.hover tbody tr:hover,table.dataTable.display tbody tr:hover{background-color:#f6f6f6}table.dataTable.hover tbody tr:hover.selected,table.dataTable.display tbody tr:hover.selected{background-color:#aab7d1}table.dataTable.order-column tbody tr>.sorting_1,table.dataTable.order-column tbody tr>.sorting_2,table.dataTable.order-column tbody tr>.sorting_3,table.dataTable.display tbody tr>.sorting_1,table.dataTable.display tbody tr>.sorting_2,table.dataTable.display tbody tr>.sorting_3{background-color:#fafafa}table.dataTable.order-column tbody tr.selected>.sorting_1,table.dataTable.order-column tbody tr.selected>.sorting_2,table.dataTable.order-column tbody tr.selected>.sorting_3,table.dataTable.display tbody tr.selected>.sorting_1,table.dataTable.display tbody tr.selected>.sorting_2,table.dataTable.display tbody tr.selected>.sorting_3{background-color:#acbad5}table.dataTable.display tbody tr.odd>.sorting_1,table.dataTable.order-column.stripe tbody tr.odd>.sorting_1{background-color:#f1f1f1}table.dataTable.display tbody tr.odd>.sorting_2,table.dataTable.order-column.stripe tbody tr.odd>.sorting_2{background-color:#f3f3f3}table.dataTable.display tbody tr.odd>.sorting_3,table.dataTable.order-column.stripe tbody tr.odd>.sorting_3{background-color:whitesmoke}table.dataTable.display tbody tr.odd.selected>.sorting_1,table.dataTable.order-column.stripe tbody tr.odd.selected>.sorting_1{background-color:#a6b4cd}table.dataTable.display tbody tr.odd.selected>.sorting_2,table.dataTable.order-column.stripe tbody tr.odd.selected>.sorting_2{background-color:#a8b5cf}table.dataTable.display tbody tr.odd.selected>.sorting_3,table.dataTable.order-column.stripe tbody tr.odd.selected>.sorting_3{background-color:#a9b7d1}table.dataTable.display tbody tr.even>.sorting_1,table.dataTable.order-column.stripe tbody tr.even>.sorting_1{background-color:#fafafa}table.dataTable.display tbody tr.even>.sorting_2,table.dataTable.order-column.stripe tbody tr.even>.sorting_2{background-color:#fcfcfc}table.dataTable.display tbody tr.even>.sorting_3,table.dataTable.order-column.stripe tbody tr.even>.sorting_3{background-color:#fefefe}table.dataTable.display tbody tr.even.selected>.sorting_1,table.dataTable.order-column.stripe tbody tr.even.selected>.sorting_1{background-color:#acbad5}table.dataTable.display tbody tr.even.selected>.sorting_2,table.dataTable.order-column.stripe tbody tr.even.selected>.sorting_2{background-color:#aebcd6}table.dataTable.display tbody tr.even.selected>.sorting_3,table.dataTable.order-column.stripe tbody tr.even.selected>.sorting_3{background-color:#afbdd8}table.dataTable.display tbody tr:hover>.sorting_1,table.dataTable.order-column.hover tbody tr:hover>.sorting_1{background-color:#eaeaea}table.dataTable.display tbody tr:hover>.sorting_2,table.dataTable.order-column.hover tbody tr:hover>.sorting_2{background-color:#ececec}table.dataTable.display tbody tr:hover>.sorting_3,table.dataTable.order-column.hover tbody tr:hover>.sorting_3{background-color:#efefef}table.dataTable.display tbody tr:hover.selected>.sorting_1,table.dataTable.order-column.hover tbody tr:hover.selected>.sorting_1{background-color:#a2aec7}table.dataTable.display tbody tr:hover.selected>.sorting_2,table.dataTable.order-column.hover tbody tr:hover.selected>.sorting_2{background-color:#a3b0c9}table.dataTable.display tbody tr:hover.selected>.sorting_3,table.dataTable.order-column.hover tbody tr:hover.selected>.sorting_3{background-color:#a5b2cb}table.dataTable.no-footer{border-bottom:1px solid #111}table.dataTable.nowrap th,table.dataTable.nowrap td{white-space:nowrap}table.dataTable.compact thead th,table.dataTable.compact thead td{padding:4px 17px 4px 4px}table.dataTable.compact tfoot th,table.dataTable.compact tfoot td{padding:4px}table.dataTable.compact tbody th,table.dataTable.compact tbody td{padding:4px}table.dataTable th.dt-left,table.dataTable td.dt-left{text-align:left}table.dataTable th.dt-center,table.dataTable td.dt-center,table.dataTable td.dataTables_empty{text-align:center}table.dataTable th.dt-right,table.dataTable td.dt-right{text-align:right}table.dataTable th.dt-justify,table.dataTable td.dt-justify{text-align:justify}table.dataTable th.dt-nowrap,table.dataTable td.dt-nowrap{white-space:nowrap}table.dataTable thead th.dt-head-left,table.dataTable thead td.dt-head-left,table.dataTable tfoot th.dt-head-left,table.dataTable tfoot td.dt-head-left{text-align:left}table.dataTable thead th.dt-head-center,table.dataTable thead td.dt-head-center,table.dataTable tfoot th.dt-head-center,table.dataTable tfoot td.dt-head-center{text-align:center}table.dataTable thead th.dt-head-right,table.dataTable thead td.dt-head-right,table.dataTable tfoot th.dt-head-right,table.dataTable tfoot td.dt-head-right{text-align:right}table.dataTable thead th.dt-head-justify,table.dataTable thead td.dt-head-justify,table.dataTable tfoot th.dt-head-justify,table.dataTable tfoot td.dt-head-justify{text-align:justify}table.dataTable thead th.dt-head-nowrap,table.dataTable thead td.dt-head-nowrap,table.dataTable tfoot th.dt-head-nowrap,table.dataTable tfoot td.dt-head-nowrap{white-space:nowrap}table.dataTable tbody th.dt-body-left,table.dataTable tbody td.dt-body-left{text-align:left}table.dataTable tbody th.dt-body-center,table.dataTable tbody td.dt-body-center{text-align:center}table.dataTable tbody th.dt-body-right,table.dataTable tbody td.dt-body-right{text-align:right}table.dataTable tbody th.dt-body-justify,table.dataTable tbody td.dt-body-justify{text-align:justify}table.dataTable tbody th.dt-body-nowrap,table.dataTable tbody td.dt-body-nowrap{white-space:nowrap}table.dataTable,table.dataTable th,table.dataTable td{-webkit-box-sizing:content-box;box-sizing:content-box}.dataTables_wrapper{position:relative;clear:both;*zoom:1;zoom:1}.dataTables_wrapper .dataTables_length{float:left}.dataTables_wrapper .dataTables_filter{float:right;text-align:right}.dataTables_wrapper .dataTables_filter input{margin-left:0.5em}.dataTables_wrapper .dataTables_info{clear:both;float:left;padding-top:0.755em}.dataTables_wrapper .dataTables_paginate{float:right;text-align:right;padding-top:0.25em}.dataTables_wrapper .dataTables_paginate .paginate_button{box-sizing:border-box;display:inline-block;min-width:1.5em;padding:0.5em 1em;margin-left:2px;text-align:center;text-decoration:none !important;cursor:pointer;*cursor:hand;color:#333 !important;border:1px solid transparent;border-radius:2px}.dataTables_wrapper .dataTables_paginate .paginate_button.current,.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover{color:#333 !important;border:1px solid #979797;background-color:white;background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #fff), color-stop(100%, #dcdcdc));background:-webkit-linear-gradient(top, #fff 0%, #dcdcdc 100%);background:-moz-linear-gradient(top, #fff 0%, #dcdcdc 100%);background:-ms-linear-gradient(top, #fff 0%, #dcdcdc 100%);background:-o-linear-gradient(top, #fff 0%, #dcdcdc 100%);background:linear-gradient(to bottom, #fff 0%, #dcdcdc 100%)}.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover,.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:active{cursor:default;color:#666 !important;border:1px solid transparent;background:transparent;box-shadow:none}.dataTables_wrapper .dataTables_paginate .paginate_button:hover{color:white !important;border:1px solid #111;background-color:#585858;background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #585858), color-stop(100%, #111));background:-webkit-linear-gradient(top, #585858 0%, #111 100%);background:-moz-linear-gradient(top, #585858 0%, #111 100%);background:-ms-linear-gradient(top, #585858 0%, #111 100%);background:-o-linear-gradient(top, #585858 0%, #111 100%);background:linear-gradient(to bottom, #585858 0%, #111 100%)}.dataTables_wrapper .dataTables_paginate .paginate_button:active{outline:none;background-color:#2b2b2b;background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #2b2b2b), color-stop(100%, #0c0c0c));background:-webkit-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);background:-moz-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);background:-ms-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);background:-o-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);background:linear-gradient(to bottom, #2b2b2b 0%, #0c0c0c 100%);box-shadow:inset 0 0 3px #111}.dataTables_wrapper .dataTables_paginate .ellipsis{padding:0 1em}.dataTables_wrapper .dataTables_processing{position:absolute;top:50%;left:50%;width:100%;height:40px;margin-left:-50%;margin-top:-25px;padding-top:20px;text-align:center;font-size:1.2em;background-color:white;background:-webkit-gradient(linear, left top, right top, color-stop(0%, rgba(255,255,255,0)), color-stop(25%, rgba(255,255,255,0.9)), color-stop(75%, rgba(255,255,255,0.9)), color-stop(100%, rgba(255,255,255,0)));background:-webkit-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%);background:-moz-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%);background:-ms-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%);background:-o-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%);background:linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%)}.dataTables_wrapper .dataTables_length,.dataTables_wrapper .dataTables_filter,.dataTables_wrapper .dataTables_info,.dataTables_wrapper .dataTables_processing,.dataTables_wrapper .dataTables_paginate{color:#333}.dataTables_wrapper .dataTables_scroll{clear:both}.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody{*margin-top:-1px;-webkit-overflow-scrolling:touch}.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody th,.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody td{vertical-align:middle}.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody th>div.dataTables_sizing,.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody td>div.dataTables_sizing{height:0;overflow:hidden;margin:0 !important;padding:0 !important}.dataTables_wrapper.no-footer .dataTables_scrollBody{border-bottom:1px solid #111}.dataTables_wrapper.no-footer div.dataTables_scrollHead table,.dataTables_wrapper.no-footer div.dataTables_scrollBody table{border-bottom:none}.dataTables_wrapper:after{visibility:hidden;display:block;content:"";clear:both;height:0}@media screen and (max-width: 767px){.dataTables_wrapper .dataTables_info,.dataTables_wrapper .dataTables_paginate{float:none;text-align:center}.dataTables_wrapper .dataTables_paginate{margin-top:0.5em}}@media screen and (max-width: 640px){.dataTables_wrapper .dataTables_length,.dataTables_wrapper .dataTables_filter{float:none;text-align:center}.dataTables_wrapper .dataTables_filter{margin-top:0.5em}} diff --git a/debug-db/src/main/assets/jquery.dataTables.min.js b/debug-db/src/main/assets/jquery.dataTables.min.js new file mode 100644 index 0000000..f127725 --- /dev/null +++ b/debug-db/src/main/assets/jquery.dataTables.min.js @@ -0,0 +1,166 @@ +/*! + DataTables 1.10.12 + ©2008-2015 SpryMedia Ltd - datatables.net/license +*/ +(function(h){"function"===typeof define&&define.amd?define(["jquery"],function(D){return h(D,window,document)}):"object"===typeof exports?module.exports=function(D,I){D||(D=window);I||(I="undefined"!==typeof window?require("jquery"):require("jquery")(D));return h(I,D,D.document)}:h(jQuery,window,document)})(function(h,D,I,k){function X(a){var b,c,d={};h.each(a,function(e){if((b=e.match(/^([^A-Z]+?)([A-Z])/))&&-1!=="a aa ai ao as b fn i m o s ".indexOf(b[1]+" "))c=e.replace(b[0],b[2].toLowerCase()), +d[c]=e,"o"===b[1]&&X(a[e])});a._hungarianMap=d}function K(a,b,c){a._hungarianMap||X(a);var d;h.each(b,function(e){d=a._hungarianMap[e];if(d!==k&&(c||b[d]===k))"o"===d.charAt(0)?(b[d]||(b[d]={}),h.extend(!0,b[d],b[e]),K(a[d],b[d],c)):b[d]=b[e]})}function Da(a){var b=m.defaults.oLanguage,c=a.sZeroRecords;!a.sEmptyTable&&(c&&"No data available in table"===b.sEmptyTable)&&E(a,a,"sZeroRecords","sEmptyTable");!a.sLoadingRecords&&(c&&"Loading..."===b.sLoadingRecords)&&E(a,a,"sZeroRecords","sLoadingRecords"); +a.sInfoThousands&&(a.sThousands=a.sInfoThousands);(a=a.sDecimal)&&db(a)}function eb(a){A(a,"ordering","bSort");A(a,"orderMulti","bSortMulti");A(a,"orderClasses","bSortClasses");A(a,"orderCellsTop","bSortCellsTop");A(a,"order","aaSorting");A(a,"orderFixed","aaSortingFixed");A(a,"paging","bPaginate");A(a,"pagingType","sPaginationType");A(a,"pageLength","iDisplayLength");A(a,"searching","bFilter");"boolean"===typeof a.sScrollX&&(a.sScrollX=a.sScrollX?"100%":"");"boolean"===typeof a.scrollX&&(a.scrollX= +a.scrollX?"100%":"");if(a=a.aoSearchCols)for(var b=0,c=a.length;b").css({position:"fixed",top:0,left:0,height:1,width:1,overflow:"hidden"}).append(h("
      ").css({position:"absolute",top:1,left:1, +width:100,overflow:"scroll"}).append(h("
      ").css({width:"100%",height:10}))).appendTo("body"),d=c.children(),e=d.children();b.barWidth=d[0].offsetWidth-d[0].clientWidth;b.bScrollOversize=100===e[0].offsetWidth&&100!==d[0].clientWidth;b.bScrollbarLeft=1!==Math.round(e.offset().left);b.bBounding=c[0].getBoundingClientRect().width?!0:!1;c.remove()}h.extend(a.oBrowser,m.__browser);a.oScroll.iBarWidth=m.__browser.barWidth}function hb(a,b,c,d,e,f){var g,j=!1;c!==k&&(g=c,j=!0);for(;d!==e;)a.hasOwnProperty(d)&& +(g=j?b(g,a[d],d,a):a[d],j=!0,d+=f);return g}function Ea(a,b){var c=m.defaults.column,d=a.aoColumns.length,c=h.extend({},m.models.oColumn,c,{nTh:b?b:I.createElement("th"),sTitle:c.sTitle?c.sTitle:b?b.innerHTML:"",aDataSort:c.aDataSort?c.aDataSort:[d],mData:c.mData?c.mData:d,idx:d});a.aoColumns.push(c);c=a.aoPreSearchCols;c[d]=h.extend({},m.models.oSearch,c[d]);ja(a,d,h(b).data())}function ja(a,b,c){var b=a.aoColumns[b],d=a.oClasses,e=h(b.nTh);if(!b.sWidthOrig){b.sWidthOrig=e.attr("width")||null;var f= +(e.attr("style")||"").match(/width:\s*(\d+[pxem%]+)/);f&&(b.sWidthOrig=f[1])}c!==k&&null!==c&&(fb(c),K(m.defaults.column,c),c.mDataProp!==k&&!c.mData&&(c.mData=c.mDataProp),c.sType&&(b._sManualType=c.sType),c.className&&!c.sClass&&(c.sClass=c.className),h.extend(b,c),E(b,c,"sWidth","sWidthOrig"),c.iDataSort!==k&&(b.aDataSort=[c.iDataSort]),E(b,c,"aDataSort"));var g=b.mData,j=Q(g),i=b.mRender?Q(b.mRender):null,c=function(a){return"string"===typeof a&&-1!==a.indexOf("@")};b._bAttrSrc=h.isPlainObject(g)&& +(c(g.sort)||c(g.type)||c(g.filter));b._setter=null;b.fnGetData=function(a,b,c){var d=j(a,b,k,c);return i&&b?i(d,b,a,c):d};b.fnSetData=function(a,b,c){return R(g)(a,b,c)};"number"!==typeof g&&(a._rowReadObject=!0);a.oFeatures.bSort||(b.bSortable=!1,e.addClass(d.sSortableNone));a=-1!==h.inArray("asc",b.asSorting);c=-1!==h.inArray("desc",b.asSorting);!b.bSortable||!a&&!c?(b.sSortingClass=d.sSortableNone,b.sSortingClassJUI=""):a&&!c?(b.sSortingClass=d.sSortableAsc,b.sSortingClassJUI=d.sSortJUIAscAllowed): +!a&&c?(b.sSortingClass=d.sSortableDesc,b.sSortingClassJUI=d.sSortJUIDescAllowed):(b.sSortingClass=d.sSortable,b.sSortingClassJUI=d.sSortJUI)}function Y(a){if(!1!==a.oFeatures.bAutoWidth){var b=a.aoColumns;Fa(a);for(var c=0,d=b.length;cq[f])d(l.length+q[f],n);else if("string"===typeof q[f]){j=0;for(i=l.length;jb&&a[e]--; -1!=d&&c===k&&a.splice(d,1)}function ca(a,b,c,d){var e=a.aoData[b],f,g=function(c,d){for(;c.childNodes.length;)c.removeChild(c.firstChild); +c.innerHTML=B(a,b,d,"display")};if("dom"===c||(!c||"auto"===c)&&"dom"===e.src)e._aData=Ia(a,e,d,d===k?k:e._aData).data;else{var j=e.anCells;if(j)if(d!==k)g(j[d],d);else{c=0;for(f=j.length;c").appendTo(g));b=0;for(c=l.length;btr").attr("role","row");h(g).find(">tr>th, >tr>td").addClass(n.sHeaderTH);h(j).find(">tr>th, >tr>td").addClass(n.sFooterTH); +if(null!==j){a=a.aoFooter[0];b=0;for(c=a.length;b=a.fnRecordsDisplay()?0:g,a.iInitDisplayStart= +-1);var g=a._iDisplayStart,n=a.fnDisplayEnd();if(a.bDeferLoading)a.bDeferLoading=!1,a.iDraw++,C(a,!1);else if(j){if(!a.bDestroying&&!lb(a))return}else a.iDraw++;if(0!==i.length){f=j?a.aoData.length:n;for(j=j?0:g;j",{"class":e?d[0]:""}).append(h("",{valign:"top",colSpan:aa(a),"class":a.oClasses.sRowEmpty}).html(c))[0];u(a,"aoHeaderCallback","header",[h(a.nTHead).children("tr")[0],Ka(a),g,n,i]);u(a,"aoFooterCallback","footer",[h(a.nTFoot).children("tr")[0],Ka(a),g,n,i]);d=h(a.nTBody);d.children().detach();d.append(h(b));u(a,"aoDrawCallback","draw",[a]);a.bSorted=!1;a.bFiltered=!1;a.bDrawing=!1}}function T(a,b){var c=a.oFeatures,d=c.bFilter; +c.bSort&&mb(a);d?fa(a,a.oPreviousSearch):a.aiDisplay=a.aiDisplayMaster.slice();!0!==b&&(a._iDisplayStart=0);a._drawHold=b;O(a);a._drawHold=!1}function nb(a){var b=a.oClasses,c=h(a.nTable),c=h("
      ").insertBefore(c),d=a.oFeatures,e=h("
      ",{id:a.sTableId+"_wrapper","class":b.sWrapper+(a.nTFoot?"":" "+b.sNoFooter)});a.nHolding=c[0];a.nTableWrapper=e[0];a.nTableReinsertBefore=a.nTable.nextSibling;for(var f=a.sDom.split(""),g,j,i,n,l,q,t=0;t")[0]; +n=f[t+1];if("'"==n||'"'==n){l="";for(q=2;f[t+q]!=n;)l+=f[t+q],q++;"H"==l?l=b.sJUIHeader:"F"==l&&(l=b.sJUIFooter);-1!=l.indexOf(".")?(n=l.split("."),i.id=n[0].substr(1,n[0].length-1),i.className=n[1]):"#"==l.charAt(0)?i.id=l.substr(1,l.length-1):i.className=l;t+=q}e.append(i);e=h(i)}else if(">"==j)e=e.parent();else if("l"==j&&d.bPaginate&&d.bLengthChange)g=ob(a);else if("f"==j&&d.bFilter)g=pb(a);else if("r"==j&&d.bProcessing)g=qb(a);else if("t"==j)g=rb(a);else if("i"==j&&d.bInfo)g=sb(a);else if("p"== +j&&d.bPaginate)g=tb(a);else if(0!==m.ext.feature.length){i=m.ext.feature;q=0;for(n=i.length;q',j=d.sSearch,j=j.match(/_INPUT_/)?j.replace("_INPUT_",g):j+g,b=h("
      ",{id:!f.f?c+"_filter":null,"class":b.sFilter}).append(h("
      ").addClass(b.sLength);a.aanFeatures.l||(i[0].id=c+"_length");i.children().append(a.oLanguage.sLengthMenu.replace("_MENU_",e[0].outerHTML));h("select",i).val(a._iDisplayLength).bind("change.DT",function(){Ra(a,h(this).val());O(a)});h(a.nTable).bind("length.dt.DT",function(b,c,d){a===c&&h("select",i).val(d)});return i[0]}function tb(a){var b=a.sPaginationType,c=m.ext.pager[b],d="function"===typeof c,e=function(a){O(a)},b=h("
      ").addClass(a.oClasses.sPaging+b)[0],f=a.aanFeatures; +d||c.fnInit(a,b,e);f.p||(b.id=a.sTableId+"_paginate",a.aoDrawCallback.push({fn:function(a){if(d){var b=a._iDisplayStart,i=a._iDisplayLength,h=a.fnRecordsDisplay(),l=-1===i,b=l?0:Math.ceil(b/i),i=l?1:Math.ceil(h/i),h=c(b,i),k,l=0;for(k=f.p.length;lf&&(d=0)):"first"==b?d=0: +"previous"==b?(d=0<=e?d-e:0,0>d&&(d=0)):"next"==b?d+e",{id:!a.aanFeatures.r?a.sTableId+"_processing":null,"class":a.oClasses.sProcessing}).html(a.oLanguage.sProcessing).insertBefore(a.nTable)[0]}function C(a,b){a.oFeatures.bProcessing&&h(a.aanFeatures.r).css("display",b?"block":"none");u(a,null,"processing", +[a,b])}function rb(a){var b=h(a.nTable);b.attr("role","grid");var c=a.oScroll;if(""===c.sX&&""===c.sY)return a.nTable;var d=c.sX,e=c.sY,f=a.oClasses,g=b.children("caption"),j=g.length?g[0]._captionSide:null,i=h(b[0].cloneNode(!1)),n=h(b[0].cloneNode(!1)),l=b.children("tfoot");l.length||(l=null);i=h("
      ",{"class":f.sScrollWrapper}).append(h("
      ",{"class":f.sScrollHead}).css({overflow:"hidden",position:"relative",border:0,width:d?!d?null:x(d):"100%"}).append(h("
      ",{"class":f.sScrollHeadInner}).css({"box-sizing":"content-box", +width:c.sXInner||"100%"}).append(i.removeAttr("id").css("margin-left",0).append("top"===j?g:null).append(b.children("thead"))))).append(h("
      ",{"class":f.sScrollBody}).css({position:"relative",overflow:"auto",width:!d?null:x(d)}).append(b));l&&i.append(h("
      ",{"class":f.sScrollFoot}).css({overflow:"hidden",border:0,width:d?!d?null:x(d):"100%"}).append(h("
      ",{"class":f.sScrollFootInner}).append(n.removeAttr("id").css("margin-left",0).append("bottom"===j?g:null).append(b.children("tfoot"))))); +var b=i.children(),k=b[0],f=b[1],t=l?b[2]:null;if(d)h(f).on("scroll.DT",function(){var a=this.scrollLeft;k.scrollLeft=a;l&&(t.scrollLeft=a)});h(f).css(e&&c.bCollapse?"max-height":"height",e);a.nScrollHead=k;a.nScrollBody=f;a.nScrollFoot=t;a.aoDrawCallback.push({fn:ka,sName:"scrolling"});return i[0]}function ka(a){var b=a.oScroll,c=b.sX,d=b.sXInner,e=b.sY,b=b.iBarWidth,f=h(a.nScrollHead),g=f[0].style,j=f.children("div"),i=j[0].style,n=j.children("table"),j=a.nScrollBody,l=h(j),q=j.style,t=h(a.nScrollFoot).children("div"), +m=t.children("table"),o=h(a.nTHead),F=h(a.nTable),p=F[0],r=p.style,u=a.nTFoot?h(a.nTFoot):null,Eb=a.oBrowser,Ua=Eb.bScrollOversize,s=G(a.aoColumns,"nTh"),P,v,w,y,z=[],A=[],B=[],C=[],D,E=function(a){a=a.style;a.paddingTop="0";a.paddingBottom="0";a.borderTopWidth="0";a.borderBottomWidth="0";a.height=0};v=j.scrollHeight>j.clientHeight;if(a.scrollBarVis!==v&&a.scrollBarVis!==k)a.scrollBarVis=v,Y(a);else{a.scrollBarVis=v;F.children("thead, tfoot").remove();u&&(w=u.clone().prependTo(F),P=u.find("tr"),w= +w.find("tr"));y=o.clone().prependTo(F);o=o.find("tr");v=y.find("tr");y.find("th, td").removeAttr("tabindex");c||(q.width="100%",f[0].style.width="100%");h.each(qa(a,y),function(b,c){D=Z(a,b);c.style.width=a.aoColumns[D].sWidth});u&&J(function(a){a.style.width=""},w);f=F.outerWidth();if(""===c){r.width="100%";if(Ua&&(F.find("tbody").height()>j.offsetHeight||"scroll"==l.css("overflow-y")))r.width=x(F.outerWidth()-b);f=F.outerWidth()}else""!==d&&(r.width=x(d),f=F.outerWidth());J(E,v);J(function(a){B.push(a.innerHTML); +z.push(x(h(a).css("width")))},v);J(function(a,b){if(h.inArray(a,s)!==-1)a.style.width=z[b]},o);h(v).height(0);u&&(J(E,w),J(function(a){C.push(a.innerHTML);A.push(x(h(a).css("width")))},w),J(function(a,b){a.style.width=A[b]},P),h(w).height(0));J(function(a,b){a.innerHTML='
      '+B[b]+"
      ";a.style.width=z[b]},v);u&&J(function(a,b){a.innerHTML='
      '+C[b]+"
      ";a.style.width= +A[b]},w);if(F.outerWidth()j.offsetHeight||"scroll"==l.css("overflow-y")?f+b:f;if(Ua&&(j.scrollHeight>j.offsetHeight||"scroll"==l.css("overflow-y")))r.width=x(P-b);(""===c||""!==d)&&L(a,1,"Possible column misalignment",6)}else P="100%";q.width=x(P);g.width=x(P);u&&(a.nScrollFoot.style.width=x(P));!e&&Ua&&(q.height=x(p.offsetHeight+b));c=F.outerWidth();n[0].style.width=x(c);i.width=x(c);d=F.height()>j.clientHeight||"scroll"==l.css("overflow-y");e="padding"+(Eb.bScrollbarLeft?"Left": +"Right");i[e]=d?b+"px":"0px";u&&(m[0].style.width=x(c),t[0].style.width=x(c),t[0].style[e]=d?b+"px":"0px");F.children("colgroup").insertBefore(F.children("thead"));l.scroll();if((a.bSorted||a.bFiltered)&&!a._drawHold)j.scrollTop=0}}function J(a,b,c){for(var d=0,e=0,f=b.length,g,j;e").appendTo(j.find("tbody")); +j.find("thead, tfoot").remove();j.append(h(a.nTHead).clone()).append(h(a.nTFoot).clone());j.find("tfoot th, tfoot td").css("width","");n=qa(a,j.find("thead")[0]);for(m=0;m").css({width:o.sWidthOrig,margin:0,padding:0,border:0,height:1}));if(a.aoData.length)for(m=0;m").css(f||e?{position:"absolute",top:0,left:0,height:1,right:0,overflow:"hidden"}:{}).append(j).appendTo(k);f&&g?j.width(g):f?(j.css("width","auto"),j.removeAttr("width"),j.width()").css("width",x(a)).appendTo(b||I.body),d=c[0].offsetWidth;c.remove();return d}function Gb(a,b){var c=Hb(a,b);if(0>c)return null;var d=a.aoData[c];return!d.nTr?h("").html(B(a,c,b,"display"))[0]:d.anCells[b]}function Hb(a,b){for(var c,d=-1,e=-1,f=0,g=a.aoData.length;fd&&(d=c.length,e=f);return e}function x(a){return null===a?"0px":"number"==typeof a?0>a?"0px":a+"px":a.match(/\d$/)?a+"px":a}function V(a){var b,c,d=[],e=a.aoColumns,f,g,j,i;b=a.aaSortingFixed;c=h.isPlainObject(b);var n=[];f=function(a){a.length&&!h.isArray(a[0])?n.push(a):h.merge(n,a)};h.isArray(b)&&f(b);c&&b.pre&&f(b.pre);f(a.aaSorting);c&&b.post&&f(b.post);for(a=0;ae?1:0,0!==c)return"asc"===j.dir?c:-c;c=d[a];e=d[b];return ce?1:0}):i.sort(function(a,b){var c,g,j,i,k=h.length,m=f[a]._aSortData,p=f[b]._aSortData;for(j=0;jg?1:0})}a.bSorted=!0}function Jb(a){for(var b,c,d=a.aoColumns,e=V(a),a=a.oLanguage.oAria,f=0,g=d.length;f/g, +"");var i=c.nTh;i.removeAttribute("aria-sort");c.bSortable&&(0e?e+1:3));e=0;for(f=d.length;ee?e+1:3))}a.aLastSort=d}function Ib(a,b){var c=a.aoColumns[b],d=m.ext.order[c.sSortDataType],e;d&&(e=d.call(a.oInstance,a,b,$(a,b)));for(var f,g=m.ext.type.order[c.sType+"-pre"],j=0,i=a.aoData.length;j= +d.length?[0,c[1]]:c)}));e.search!==k&&h.extend(a.oPreviousSearch,Bb(e.search));b=0;for(c=e.columns.length;b=c&&(b=c-d);b-=b%d;if(-1===d||0>b)b=0;a._iDisplayStart=b}function Na(a,b){var c=a.renderer,d=m.ext.renderer[b];return h.isPlainObject(c)&&c[b]?d[c[b]]||d._:"string"===typeof c?d[c]||d._:d._}function y(a){return a.oFeatures.bServerSide?"ssp":a.ajax||a.sAjaxSource?"ajax":"dom"}function ya(a,b){var c=[],c=Mb.numbers_length,d=Math.floor(c/2);b<=c?c=W(0,b):a<=d?(c=W(0,c-2),c.push("ellipsis"),c.push(b-1)):(a>=b-1-d?c=W(b-(c-2),b):(c=W(a-d+2,a+d-1),c.push("ellipsis"), +c.push(b-1)),c.splice(0,0,"ellipsis"),c.splice(0,0,0));c.DT_el="span";return c}function db(a){h.each({num:function(b){return za(b,a)},"num-fmt":function(b){return za(b,a,Xa)},"html-num":function(b){return za(b,a,Aa)},"html-num-fmt":function(b){return za(b,a,Aa,Xa)}},function(b,c){v.type.order[b+a+"-pre"]=c;b.match(/^html\-/)&&(v.type.search[b+a]=v.type.search.html)})}function Nb(a){return function(){var b=[xa(this[m.ext.iApiIndex])].concat(Array.prototype.slice.call(arguments));return m.ext.internal[a].apply(this, +b)}}var m=function(a){this.$=function(a,b){return this.api(!0).$(a,b)};this._=function(a,b){return this.api(!0).rows(a,b).data()};this.api=function(a){return a?new r(xa(this[v.iApiIndex])):new r(this)};this.fnAddData=function(a,b){var c=this.api(!0),d=h.isArray(a)&&(h.isArray(a[0])||h.isPlainObject(a[0]))?c.rows.add(a):c.row.add(a);(b===k||b)&&c.draw();return d.flatten().toArray()};this.fnAdjustColumnSizing=function(a){var b=this.api(!0).columns.adjust(),c=b.settings()[0],d=c.oScroll;a===k||a?b.draw(!1): +(""!==d.sX||""!==d.sY)&&ka(c)};this.fnClearTable=function(a){var b=this.api(!0).clear();(a===k||a)&&b.draw()};this.fnClose=function(a){this.api(!0).row(a).child.hide()};this.fnDeleteRow=function(a,b,c){var d=this.api(!0),a=d.rows(a),e=a.settings()[0],h=e.aoData[a[0][0]];a.remove();b&&b.call(this,e,h);(c===k||c)&&d.draw();return h};this.fnDestroy=function(a){this.api(!0).destroy(a)};this.fnDraw=function(a){this.api(!0).draw(a)};this.fnFilter=function(a,b,c,d,e,h){e=this.api(!0);null===b||b===k?e.search(a, +c,d,h):e.column(b).search(a,c,d,h);e.draw()};this.fnGetData=function(a,b){var c=this.api(!0);if(a!==k){var d=a.nodeName?a.nodeName.toLowerCase():"";return b!==k||"td"==d||"th"==d?c.cell(a,b).data():c.row(a).data()||null}return c.data().toArray()};this.fnGetNodes=function(a){var b=this.api(!0);return a!==k?b.row(a).node():b.rows().nodes().flatten().toArray()};this.fnGetPosition=function(a){var b=this.api(!0),c=a.nodeName.toUpperCase();return"TR"==c?b.row(a).index():"TD"==c||"TH"==c?(a=b.cell(a).index(), +[a.row,a.columnVisible,a.column]):null};this.fnIsOpen=function(a){return this.api(!0).row(a).child.isShown()};this.fnOpen=function(a,b,c){return this.api(!0).row(a).child(b,c).show().child()[0]};this.fnPageChange=function(a,b){var c=this.api(!0).page(a);(b===k||b)&&c.draw(!1)};this.fnSetColumnVis=function(a,b,c){a=this.api(!0).column(a).visible(b);(c===k||c)&&a.columns.adjust().draw()};this.fnSettings=function(){return xa(this[v.iApiIndex])};this.fnSort=function(a){this.api(!0).order(a).draw()};this.fnSortListener= +function(a,b,c){this.api(!0).order.listener(a,b,c)};this.fnUpdate=function(a,b,c,d,e){var h=this.api(!0);c===k||null===c?h.row(b).data(a):h.cell(b,c).data(a);(e===k||e)&&h.columns.adjust();(d===k||d)&&h.draw();return 0};this.fnVersionCheck=v.fnVersionCheck;var b=this,c=a===k,d=this.length;c&&(a={});this.oApi=this.internal=v.internal;for(var e in m.ext.internal)e&&(this[e]=Nb(e));this.each(function(){var e={},e=1t<"F"ip>'),o.renderer)?h.isPlainObject(o.renderer)&&!o.renderer.header&&(o.renderer.header="jqueryui"): +o.renderer="jqueryui":h.extend(i,m.ext.classes,e.oClasses);q.addClass(i.sTable);o.iInitDisplayStart===k&&(o.iInitDisplayStart=e.iDisplayStart,o._iDisplayStart=e.iDisplayStart);null!==e.iDeferLoading&&(o.bDeferLoading=!0,g=h.isArray(e.iDeferLoading),o._iRecordsDisplay=g?e.iDeferLoading[0]:e.iDeferLoading,o._iRecordsTotal=g?e.iDeferLoading[1]:e.iDeferLoading);var r=o.oLanguage;h.extend(!0,r,e.oLanguage);""!==r.sUrl&&(h.ajax({dataType:"json",url:r.sUrl,success:function(a){Da(a);K(l.oLanguage,a);h.extend(true, +r,a);ga(o)},error:function(){ga(o)}}),n=!0);null===e.asStripeClasses&&(o.asStripeClasses=[i.sStripeOdd,i.sStripeEven]);var g=o.asStripeClasses,v=q.children("tbody").find("tr").eq(0);-1!==h.inArray(!0,h.map(g,function(a){return v.hasClass(a)}))&&(h("tbody tr",this).removeClass(g.join(" ")),o.asDestroyStripes=g.slice());t=[];g=this.getElementsByTagName("thead");0!==g.length&&(da(o.aoHeader,g[0]),t=qa(o));if(null===e.aoColumns){p=[];g=0;for(j=t.length;g").appendTo(this));o.nTHead=j[0];j=q.children("tbody");0===j.length&&(j=h("").appendTo(this));o.nTBody=j[0];j=q.children("tfoot");if(0===j.length&&0").appendTo(this);0===j.length||0===j.children().length?q.addClass(i.sNoFooter):0/g,ac=/^[\w\+\-]/,bc=/[\w\+\-]$/,cc=RegExp("(\\/|\\.|\\*|\\+|\\?|\\||\\(|\\)|\\[|\\]|\\{|\\}|\\\\|\\$|\\^|\\-)","g"),Xa=/[',$£€¥%\u2009\u202F\u20BD\u20a9\u20BArfk]/gi,M=function(a){return!a||!0===a||"-"===a?!0:!1},Pb=function(a){var b=parseInt(a,10);return!isNaN(b)&&isFinite(a)?b:null},Qb=function(a,b){Ya[b]||(Ya[b]=RegExp(Qa(b),"g"));return"string"===typeof a&&"."!==b?a.replace(/\./g, +"").replace(Ya[b],"."):a},Za=function(a,b,c){var d="string"===typeof a;if(M(a))return!0;b&&d&&(a=Qb(a,b));c&&d&&(a=a.replace(Xa,""));return!isNaN(parseFloat(a))&&isFinite(a)},Rb=function(a,b,c){return M(a)?!0:!(M(a)||"string"===typeof a)?null:Za(a.replace(Aa,""),b,c)?!0:null},G=function(a,b,c){var d=[],e=0,f=a.length;if(c!==k)for(;e")[0],Zb=ua.textContent!==k,$b=/<.*?>/g,Oa=m.util.throttle,Tb=[],w=Array.prototype,dc=function(a){var b,c,d=m.settings,e=h.map(d,function(a){return a.nTable});if(a){if(a.nTable&&a.oApi)return[a];if(a.nodeName&&"table"===a.nodeName.toLowerCase())return b=h.inArray(a,e),-1!==b?[d[b]]: +null;if(a&&"function"===typeof a.settings)return a.settings().toArray();"string"===typeof a?c=h(a):a instanceof h&&(c=a)}else return[];if(c)return c.map(function(){b=h.inArray(this,e);return-1!==b?d[b]:null}).toArray()};r=function(a,b){if(!(this instanceof r))return new r(a,b);var c=[],d=function(a){(a=dc(a))&&(c=c.concat(a))};if(h.isArray(a))for(var e=0,f=a.length;ea?new r(b[a],this[a]):null},filter:function(a){var b=[];if(w.filter)b=w.filter.call(this,a,this);else for(var c=0,d=this.length;c").addClass(b),h("td",c).addClass(b).html(a)[0].colSpan=aa(d),e.push(c[0]))};f(a,b);c._details&&c._details.remove();c._details=h(e);c._detailsShow&&c._details.insertAfter(c.nTr)}return this}); +p(["row().child.show()","row().child().show()"],function(){Vb(this,!0);return this});p(["row().child.hide()","row().child().hide()"],function(){Vb(this,!1);return this});p(["row().child.remove()","row().child().remove()"],function(){cb(this);return this});p("row().child.isShown()",function(){var a=this.context;return a.length&&this.length?a[0].aoData[this[0]]._detailsShow||!1:!1});var ec=/^(.+):(name|visIdx|visible)$/,Wb=function(a,b,c,d,e){for(var c=[],d=0,f=e.length;d=0?b:g.length+b];if(typeof a==="function"){var e=Ba(c,f);return h.map(g,function(b,f){return a(f,Wb(c,f,0,0,e),i[f])?f:null})}var k=typeof a==="string"?a.match(ec):"";if(k)switch(k[2]){case "visIdx":case "visible":b=parseInt(k[1], +10);if(b<0){var m=h.map(g,function(a,b){return a.bVisible?b:null});return[m[m.length+b]]}return[Z(c,b)];case "name":return h.map(j,function(a,b){return a===k[1]?b:null});default:return[]}if(a.nodeName&&a._DT_CellIndex)return[a._DT_CellIndex.column];b=h(i).filter(a).map(function(){return h.inArray(this,i)}).toArray();if(b.length||!a.nodeName)return b;b=h(a).closest("*[data-dt-column]");return b.length?[b.data("dt-column")]:[]},c,f)},1);c.selector.cols=a;c.selector.opts=b;return c});s("columns().header()", +"column().header()",function(){return this.iterator("column",function(a,b){return a.aoColumns[b].nTh},1)});s("columns().footer()","column().footer()",function(){return this.iterator("column",function(a,b){return a.aoColumns[b].nTf},1)});s("columns().data()","column().data()",function(){return this.iterator("column-rows",Wb,1)});s("columns().dataSrc()","column().dataSrc()",function(){return this.iterator("column",function(a,b){return a.aoColumns[b].mData},1)});s("columns().cache()","column().cache()", +function(a){return this.iterator("column-rows",function(b,c,d,e,f){return ha(b.aoData,f,"search"===a?"_aFilterData":"_aSortData",c)},1)});s("columns().nodes()","column().nodes()",function(){return this.iterator("column-rows",function(a,b,c,d,e){return ha(a.aoData,e,"anCells",b)},1)});s("columns().visible()","column().visible()",function(a,b){var c=this.iterator("column",function(b,c){if(a===k)return b.aoColumns[c].bVisible;var f=b.aoColumns,g=f[c],j=b.aoData,i,n,l;if(a!==k&&g.bVisible!==a){if(a){var m= +h.inArray(!0,G(f,"bVisible"),c+1);i=0;for(n=j.length;id;return!0};m.isDataTable=m.fnIsDataTable=function(a){var b=h(a).get(0),c=!1;h.each(m.settings,function(a,e){var f=e.nScrollHead?h("table",e.nScrollHead)[0]:null,g=e.nScrollFoot?h("table",e.nScrollFoot)[0]: +null;if(e.nTable===b||f===b||g===b)c=!0});return c};m.tables=m.fnTables=function(a){var b=!1;h.isPlainObject(a)&&(b=a.api,a=a.visible);var c=h.map(m.settings,function(b){if(!a||a&&h(b.nTable).is(":visible"))return b.nTable});return b?new r(c):c};m.camelToHungarian=K;p("$()",function(a,b){var c=this.rows(b).nodes(),c=h(c);return h([].concat(c.filter(a).toArray(),c.find(a).toArray()))});h.each(["on","one","off"],function(a,b){p(b+"()",function(){var a=Array.prototype.slice.call(arguments);a[0].match(/\.dt\b/)|| +(a[0]+=".dt");var d=h(this.tables().nodes());d[b].apply(d,a);return this})});p("clear()",function(){return this.iterator("table",function(a){na(a)})});p("settings()",function(){return new r(this.context,this.context)});p("init()",function(){var a=this.context;return a.length?a[0].oInit:null});p("data()",function(){return this.iterator("table",function(a){return G(a.aoData,"_aData")}).flatten()});p("destroy()",function(a){a=a||!1;return this.iterator("table",function(b){var c=b.nTableWrapper.parentNode, +d=b.oClasses,e=b.nTable,f=b.nTBody,g=b.nTHead,j=b.nTFoot,i=h(e),f=h(f),k=h(b.nTableWrapper),l=h.map(b.aoData,function(a){return a.nTr}),p;b.bDestroying=!0;u(b,"aoDestroyCallback","destroy",[b]);a||(new r(b)).columns().visible(!0);k.unbind(".DT").find(":not(tbody *)").unbind(".DT");h(D).unbind(".DT-"+b.sInstance);e!=g.parentNode&&(i.children("thead").detach(),i.append(g));j&&e!=j.parentNode&&(i.children("tfoot").detach(),i.append(j));b.aaSorting=[];b.aaSortingFixed=[];va(b);h(l).removeClass(b.asStripeClasses.join(" ")); +h("th, td",g).removeClass(d.sSortable+" "+d.sSortableAsc+" "+d.sSortableDesc+" "+d.sSortableNone);b.bJUI&&(h("th span."+d.sSortIcon+", td span."+d.sSortIcon,g).detach(),h("th, td",g).each(function(){var a=h("div."+d.sSortJUIWrapper,this);h(this).append(a.contents());a.detach()}));f.children().detach();f.append(l);g=a?"remove":"detach";i[g]();k[g]();!a&&c&&(c.insertBefore(e,b.nTableReinsertBefore),i.css("width",b.sDestroyWidth).removeClass(d.sTable),(p=b.asDestroyStripes.length)&&f.children().each(function(a){h(this).addClass(b.asDestroyStripes[a% +p])}));c=h.inArray(b,m.settings);-1!==c&&m.settings.splice(c,1)})});h.each(["column","row","cell"],function(a,b){p(b+"s().every()",function(a){var d=this.selector.opts,e=this;return this.iterator(b,function(f,g,h,i,n){a.call(e[b](g,"cell"===b?h:d,"cell"===b?d:k),g,h,i,n)})})});p("i18n()",function(a,b,c){var d=this.context[0],a=Q(a)(d.oLanguage);a===k&&(a=b);c!==k&&h.isPlainObject(a)&&(a=a[c]!==k?a[c]:a._);return a.replace("%d",c)});m.version="1.10.12";m.settings=[];m.models={};m.models.oSearch={bCaseInsensitive:!0, +sSearch:"",bRegex:!1,bSmart:!0};m.models.oRow={nTr:null,anCells:null,_aData:[],_aSortData:null,_aFilterData:null,_sFilterRow:null,_sRowStripe:"",src:null,idx:-1};m.models.oColumn={idx:null,aDataSort:null,asSorting:null,bSearchable:null,bSortable:null,bVisible:null,_sManualType:null,_bAttrSrc:!1,fnCreatedCell:null,fnGetData:null,fnSetData:null,mData:null,mRender:null,nTh:null,nTf:null,sClass:null,sContentPadding:null,sDefaultContent:null,sName:null,sSortDataType:"std",sSortingClass:null,sSortingClassJUI:null, +sTitle:null,sType:null,sWidth:null,sWidthOrig:null};m.defaults={aaData:null,aaSorting:[[0,"asc"]],aaSortingFixed:[],ajax:null,aLengthMenu:[10,25,50,100],aoColumns:null,aoColumnDefs:null,aoSearchCols:[],asStripeClasses:null,bAutoWidth:!0,bDeferRender:!1,bDestroy:!1,bFilter:!0,bInfo:!0,bJQueryUI:!1,bLengthChange:!0,bPaginate:!0,bProcessing:!1,bRetrieve:!1,bScrollCollapse:!1,bServerSide:!1,bSort:!0,bSortMulti:!0,bSortCellsTop:!1,bSortClasses:!0,bStateSave:!1,fnCreatedRow:null,fnDrawCallback:null,fnFooterCallback:null, +fnFormatNumber:function(a){return a.toString().replace(/\B(?=(\d{3})+(?!\d))/g,this.oLanguage.sThousands)},fnHeaderCallback:null,fnInfoCallback:null,fnInitComplete:null,fnPreDrawCallback:null,fnRowCallback:null,fnServerData:null,fnServerParams:null,fnStateLoadCallback:function(a){try{return JSON.parse((-1===a.iStateDuration?sessionStorage:localStorage).getItem("DataTables_"+a.sInstance+"_"+location.pathname))}catch(b){}},fnStateLoadParams:null,fnStateLoaded:null,fnStateSaveCallback:function(a,b){try{(-1=== +a.iStateDuration?sessionStorage:localStorage).setItem("DataTables_"+a.sInstance+"_"+location.pathname,JSON.stringify(b))}catch(c){}},fnStateSaveParams:null,iStateDuration:7200,iDeferLoading:null,iDisplayLength:10,iDisplayStart:0,iTabIndex:0,oClasses:{},oLanguage:{oAria:{sSortAscending:": activate to sort column ascending",sSortDescending:": activate to sort column descending"},oPaginate:{sFirst:"First",sLast:"Last",sNext:"Next",sPrevious:"Previous"},sEmptyTable:"No data available in table",sInfo:"Showing _START_ to _END_ of _TOTAL_ entries", +sInfoEmpty:"Showing 0 to 0 of 0 entries",sInfoFiltered:"(filtered from _MAX_ total entries)",sInfoPostFix:"",sDecimal:"",sThousands:",",sLengthMenu:"Show _MENU_ entries",sLoadingRecords:"Loading...",sProcessing:"Processing...",sSearch:"Search:",sSearchPlaceholder:"",sUrl:"",sZeroRecords:"No matching records found"},oSearch:h.extend({},m.models.oSearch),sAjaxDataProp:"data",sAjaxSource:null,sDom:"lfrtip",searchDelay:null,sPaginationType:"simple_numbers",sScrollX:"",sScrollXInner:"",sScrollY:"",sServerMethod:"GET", +renderer:null,rowId:"DT_RowId"};X(m.defaults);m.defaults.column={aDataSort:null,iDataSort:-1,asSorting:["asc","desc"],bSearchable:!0,bSortable:!0,bVisible:!0,fnCreatedCell:null,mData:null,mRender:null,sCellType:"td",sClass:"",sContentPadding:"",sDefaultContent:null,sName:"",sSortDataType:"std",sTitle:null,sType:null,sWidth:null};X(m.defaults.column);m.models.oSettings={oFeatures:{bAutoWidth:null,bDeferRender:null,bFilter:null,bInfo:null,bLengthChange:null,bPaginate:null,bProcessing:null,bServerSide:null, +bSort:null,bSortMulti:null,bSortClasses:null,bStateSave:null},oScroll:{bCollapse:null,iBarWidth:0,sX:null,sXInner:null,sY:null},oLanguage:{fnInfoCallback:null},oBrowser:{bScrollOversize:!1,bScrollbarLeft:!1,bBounding:!1,barWidth:0},ajax:null,aanFeatures:[],aoData:[],aiDisplay:[],aiDisplayMaster:[],aIds:{},aoColumns:[],aoHeader:[],aoFooter:[],oPreviousSearch:{},aoPreSearchCols:[],aaSorting:null,aaSortingFixed:[],asStripeClasses:null,asDestroyStripes:[],sDestroyWidth:0,aoRowCallback:[],aoHeaderCallback:[], +aoFooterCallback:[],aoDrawCallback:[],aoRowCreatedCallback:[],aoPreDrawCallback:[],aoInitComplete:[],aoStateSaveParams:[],aoStateLoadParams:[],aoStateLoaded:[],sTableId:"",nTable:null,nTHead:null,nTFoot:null,nTBody:null,nTableWrapper:null,bDeferLoading:!1,bInitialised:!1,aoOpenRows:[],sDom:null,searchDelay:null,sPaginationType:"two_button",iStateDuration:0,aoStateSave:[],aoStateLoad:[],oSavedState:null,oLoadedState:null,sAjaxSource:null,sAjaxDataProp:null,bAjaxDataGet:!0,jqXHR:null,json:k,oAjaxData:k, +fnServerData:null,aoServerParams:[],sServerMethod:null,fnFormatNumber:null,aLengthMenu:null,iDraw:0,bDrawing:!1,iDrawError:-1,_iDisplayLength:10,_iDisplayStart:0,_iRecordsTotal:0,_iRecordsDisplay:0,bJUI:null,oClasses:{},bFiltered:!1,bSorted:!1,bSortCellsTop:null,oInit:null,aoDestroyCallback:[],fnRecordsTotal:function(){return"ssp"==y(this)?1*this._iRecordsTotal:this.aiDisplayMaster.length},fnRecordsDisplay:function(){return"ssp"==y(this)?1*this._iRecordsDisplay:this.aiDisplay.length},fnDisplayEnd:function(){var a= +this._iDisplayLength,b=this._iDisplayStart,c=b+a,d=this.aiDisplay.length,e=this.oFeatures,f=e.bPaginate;return e.bServerSide?!1===f||-1===a?b+d:Math.min(b+a,this._iRecordsDisplay):!f||c>d||-1===a?d:c},oInstance:null,sInstance:null,iTabIndex:0,nScrollHead:null,nScrollFoot:null,aLastSort:[],oPlugins:{},rowIdFn:null,rowId:null};m.ext=v={buttons:{},classes:{},builder:"-source-",errMode:"alert",feature:[],search:[],selector:{cell:[],column:[],row:[]},internal:{},legacy:{ajax:null},pager:{},renderer:{pageButton:{}, +header:{}},order:{},type:{detect:[],search:{},order:{}},_unique:0,fnVersionCheck:m.fnVersionCheck,iApiIndex:0,oJUIClasses:{},sVersion:m.version};h.extend(v,{afnFiltering:v.search,aTypes:v.type.detect,ofnSearch:v.type.search,oSort:v.type.order,afnSortData:v.order,aoFeatures:v.feature,oApi:v.internal,oStdClasses:v.classes,oPagination:v.pager});h.extend(m.ext.classes,{sTable:"dataTable",sNoFooter:"no-footer",sPageButton:"paginate_button",sPageButtonActive:"current",sPageButtonDisabled:"disabled",sStripeOdd:"odd", +sStripeEven:"even",sRowEmpty:"dataTables_empty",sWrapper:"dataTables_wrapper",sFilter:"dataTables_filter",sInfo:"dataTables_info",sPaging:"dataTables_paginate paging_",sLength:"dataTables_length",sProcessing:"dataTables_processing",sSortAsc:"sorting_asc",sSortDesc:"sorting_desc",sSortable:"sorting",sSortableAsc:"sorting_asc_disabled",sSortableDesc:"sorting_desc_disabled",sSortableNone:"sorting_disabled",sSortColumn:"sorting_",sFilterInput:"",sLengthSelect:"",sScrollWrapper:"dataTables_scroll",sScrollHead:"dataTables_scrollHead", +sScrollHeadInner:"dataTables_scrollHeadInner",sScrollBody:"dataTables_scrollBody",sScrollFoot:"dataTables_scrollFoot",sScrollFootInner:"dataTables_scrollFootInner",sHeaderTH:"",sFooterTH:"",sSortJUIAsc:"",sSortJUIDesc:"",sSortJUI:"",sSortJUIAscAllowed:"",sSortJUIDescAllowed:"",sSortJUIWrapper:"",sSortIcon:"",sJUIHeader:"",sJUIFooter:""});var Ca="",Ca="",H=Ca+"ui-state-default",ia=Ca+"css_right ui-icon ui-icon-",Xb=Ca+"fg-toolbar ui-toolbar ui-widget-header ui-helper-clearfix";h.extend(m.ext.oJUIClasses, +m.ext.classes,{sPageButton:"fg-button ui-button "+H,sPageButtonActive:"ui-state-disabled",sPageButtonDisabled:"ui-state-disabled",sPaging:"dataTables_paginate fg-buttonset ui-buttonset fg-buttonset-multi ui-buttonset-multi paging_",sSortAsc:H+" sorting_asc",sSortDesc:H+" sorting_desc",sSortable:H+" sorting",sSortableAsc:H+" sorting_asc_disabled",sSortableDesc:H+" sorting_desc_disabled",sSortableNone:H+" sorting_disabled",sSortJUIAsc:ia+"triangle-1-n",sSortJUIDesc:ia+"triangle-1-s",sSortJUI:ia+"carat-2-n-s", +sSortJUIAscAllowed:ia+"carat-1-n",sSortJUIDescAllowed:ia+"carat-1-s",sSortJUIWrapper:"DataTables_sort_wrapper",sSortIcon:"DataTables_sort_icon",sScrollHead:"dataTables_scrollHead "+H,sScrollFoot:"dataTables_scrollFoot "+H,sHeaderTH:H,sFooterTH:H,sJUIHeader:Xb+" ui-corner-tl ui-corner-tr",sJUIFooter:Xb+" ui-corner-bl ui-corner-br"});var Mb=m.ext.pager;h.extend(Mb,{simple:function(){return["previous","next"]},full:function(){return["first","previous","next","last"]},numbers:function(a,b){return[ya(a, +b)]},simple_numbers:function(a,b){return["previous",ya(a,b),"next"]},full_numbers:function(a,b){return["first","previous",ya(a,b),"next","last"]},_numbers:ya,numbers_length:7});h.extend(!0,m.ext.renderer,{pageButton:{_:function(a,b,c,d,e,f){var g=a.oClasses,j=a.oLanguage.oPaginate,i=a.oLanguage.oAria.paginate||{},k,l,m=0,p=function(b,d){var o,r,u,s,v=function(b){Ta(a,b.data.action,true)};o=0;for(r=d.length;o").appendTo(b);p(u,s)}else{k=null; +l="";switch(s){case "ellipsis":b.append('');break;case "first":k=j.sFirst;l=s+(e>0?"":" "+g.sPageButtonDisabled);break;case "previous":k=j.sPrevious;l=s+(e>0?"":" "+g.sPageButtonDisabled);break;case "next":k=j.sNext;l=s+(e",{"class":g.sPageButton+" "+l,"aria-controls":a.sTableId,"aria-label":i[s], +"data-dt-idx":m,tabindex:a.iTabIndex,id:c===0&&typeof s==="string"?a.sTableId+"_"+s:null}).html(k).appendTo(b);Wa(u,{action:s},v);m++}}}},r;try{r=h(b).find(I.activeElement).data("dt-idx")}catch(o){}p(h(b).empty(),d);r&&h(b).find("[data-dt-idx="+r+"]").focus()}}});h.extend(m.ext.type.detect,[function(a,b){var c=b.oLanguage.sDecimal;return Za(a,c)?"num"+c:null},function(a){if(a&&!(a instanceof Date)&&(!ac.test(a)||!bc.test(a)))return null;var b=Date.parse(a);return null!==b&&!isNaN(b)||M(a)?"date": +null},function(a,b){var c=b.oLanguage.sDecimal;return Za(a,c,!0)?"num-fmt"+c:null},function(a,b){var c=b.oLanguage.sDecimal;return Rb(a,c)?"html-num"+c:null},function(a,b){var c=b.oLanguage.sDecimal;return Rb(a,c,!0)?"html-num-fmt"+c:null},function(a){return M(a)||"string"===typeof a&&-1!==a.indexOf("<")?"html":null}]);h.extend(m.ext.type.search,{html:function(a){return M(a)?a:"string"===typeof a?a.replace(Ob," ").replace(Aa,""):""},string:function(a){return M(a)?a:"string"===typeof a?a.replace(Ob, +" "):a}});var za=function(a,b,c,d){if(0!==a&&(!a||"-"===a))return-Infinity;b&&(a=Qb(a,b));a.replace&&(c&&(a=a.replace(c,"")),d&&(a=a.replace(d,"")));return 1*a};h.extend(v.type.order,{"date-pre":function(a){return Date.parse(a)||0},"html-pre":function(a){return M(a)?"":a.replace?a.replace(/<.*?>/g,"").toLowerCase():a+""},"string-pre":function(a){return M(a)?"":"string"===typeof a?a.toLowerCase():!a.toString?"":a.toString()},"string-asc":function(a,b){return ab?1:0},"string-desc":function(a, +b){return ab?-1:0}});db("");h.extend(!0,m.ext.renderer,{header:{_:function(a,b,c,d){h(a.nTable).on("order.dt.DT",function(e,f,g,h){if(a===f){e=c.idx;b.removeClass(c.sSortingClass+" "+d.sSortAsc+" "+d.sSortDesc).addClass(h[e]=="asc"?d.sSortAsc:h[e]=="desc"?d.sSortDesc:c.sSortingClass)}})},jqueryui:function(a,b,c,d){h("
      ").addClass(d.sSortJUIWrapper).append(b.contents()).append(h("").addClass(d.sSortIcon+" "+c.sSortingClassJUI)).appendTo(b);h(a.nTable).on("order.dt.DT",function(e, +f,g,h){if(a===f){e=c.idx;b.removeClass(d.sSortAsc+" "+d.sSortDesc).addClass(h[e]=="asc"?d.sSortAsc:h[e]=="desc"?d.sSortDesc:c.sSortingClass);b.find("span."+d.sSortIcon).removeClass(d.sSortJUIAsc+" "+d.sSortJUIDesc+" "+d.sSortJUI+" "+d.sSortJUIAscAllowed+" "+d.sSortJUIDescAllowed).addClass(h[e]=="asc"?d.sSortJUIAsc:h[e]=="desc"?d.sSortJUIDesc:c.sSortingClassJUI)}})}}});var Yb=function(a){return"string"===typeof a?a.replace(//g,">").replace(/"/g,"""):a};m.render={number:function(a, +b,c,d,e){return{display:function(f){if("number"!==typeof f&&"string"!==typeof f)return f;var g=0>f?"-":"",h=parseFloat(f);if(isNaN(h))return Yb(f);f=Math.abs(h);h=parseInt(f,10);f=c?b+(f-h).toFixed(c).substring(2):"";return g+(d||"")+h.toString().replace(/\B(?=(\d{3})+(?!\d))/g,a)+f+(e||"")}}},text:function(){return{display:Yb}}};h.extend(m.ext.internal,{_fnExternApiFunc:Nb,_fnBuildAjax:ra,_fnAjaxUpdate:lb,_fnAjaxParameters:ub,_fnAjaxUpdateDraw:vb,_fnAjaxDataSrc:sa,_fnAddColumn:Ea,_fnColumnOptions:ja, +_fnAdjustColumnSizing:Y,_fnVisibleToColumnIndex:Z,_fnColumnIndexToVisible:$,_fnVisbleColumns:aa,_fnGetColumns:la,_fnColumnTypes:Ga,_fnApplyColumnDefs:ib,_fnHungarianMap:X,_fnCamelToHungarian:K,_fnLanguageCompat:Da,_fnBrowserDetect:gb,_fnAddData:N,_fnAddTr:ma,_fnNodeToDataIndex:function(a,b){return b._DT_RowIndex!==k?b._DT_RowIndex:null},_fnNodeToColumnIndex:function(a,b,c){return h.inArray(c,a.aoData[b].anCells)},_fnGetCellData:B,_fnSetCellData:jb,_fnSplitObjNotation:Ja,_fnGetObjectDataFn:Q,_fnSetObjectDataFn:R, +_fnGetDataMaster:Ka,_fnClearTable:na,_fnDeleteIndex:oa,_fnInvalidate:ca,_fnGetRowElements:Ia,_fnCreateTr:Ha,_fnBuildHead:kb,_fnDrawHead:ea,_fnDraw:O,_fnReDraw:T,_fnAddOptionsHtml:nb,_fnDetectHeader:da,_fnGetUniqueThs:qa,_fnFeatureHtmlFilter:pb,_fnFilterComplete:fa,_fnFilterCustom:yb,_fnFilterColumn:xb,_fnFilter:wb,_fnFilterCreateSearch:Pa,_fnEscapeRegex:Qa,_fnFilterData:zb,_fnFeatureHtmlInfo:sb,_fnUpdateInfo:Cb,_fnInfoMacros:Db,_fnInitialise:ga,_fnInitComplete:ta,_fnLengthChange:Ra,_fnFeatureHtmlLength:ob, +_fnFeatureHtmlPaginate:tb,_fnPageChange:Ta,_fnFeatureHtmlProcessing:qb,_fnProcessingDisplay:C,_fnFeatureHtmlTable:rb,_fnScrollDraw:ka,_fnApplyToChildren:J,_fnCalculateColumnWidths:Fa,_fnThrottle:Oa,_fnConvertToWidth:Fb,_fnGetWidestNode:Gb,_fnGetMaxLenString:Hb,_fnStringToCss:x,_fnSortFlatten:V,_fnSort:mb,_fnSortAria:Jb,_fnSortListener:Va,_fnSortAttachListener:Ma,_fnSortingClasses:va,_fnSortData:Ib,_fnSaveState:wa,_fnLoadState:Kb,_fnSettingsFromNode:xa,_fnLog:L,_fnMap:E,_fnBindAction:Wa,_fnCallbackReg:z, +_fnCallbackFire:u,_fnLengthOverflow:Sa,_fnRenderer:Na,_fnDataSource:y,_fnRowAttributes:La,_fnCalculateEnd:function(){}});h.fn.dataTable=m;m.$=h;h.fn.dataTableSettings=m.settings;h.fn.dataTableExt=m.ext;h.fn.DataTable=function(a){return h(this).dataTable(a).api()};h.each(m,function(a,b){h.fn.DataTable[a]=b});return h.fn.dataTable}); diff --git a/debug-db/src/main/assets/jquery.min.js b/debug-db/src/main/assets/jquery.min.js new file mode 100644 index 0000000..4c5be4c --- /dev/null +++ b/debug-db/src/main/assets/jquery.min.js @@ -0,0 +1,4 @@ +/*! jQuery v3.1.1 | (c) jQuery Foundation | jquery.org/license */ +!function(a,b){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){"use strict";var c=[],d=a.document,e=Object.getPrototypeOf,f=c.slice,g=c.concat,h=c.push,i=c.indexOf,j={},k=j.toString,l=j.hasOwnProperty,m=l.toString,n=m.call(Object),o={};function p(a,b){b=b||d;var c=b.createElement("script");c.text=a,b.head.appendChild(c).parentNode.removeChild(c)}var q="3.1.1",r=function(a,b){return new r.fn.init(a,b)},s=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,t=/^-ms-/,u=/-([a-z])/g,v=function(a,b){return b.toUpperCase()};r.fn=r.prototype={jquery:q,constructor:r,length:0,toArray:function(){return f.call(this)},get:function(a){return null==a?f.call(this):a<0?this[a+this.length]:this[a]},pushStack:function(a){var b=r.merge(this.constructor(),a);return b.prevObject=this,b},each:function(a){return r.each(this,a)},map:function(a){return this.pushStack(r.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(f.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(a<0?b:0);return this.pushStack(c>=0&&c0&&b-1 in a)}var x=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C={}.hasOwnProperty,D=[],E=D.pop,F=D.push,G=D.push,H=D.slice,I=function(a,b){for(var c=0,d=a.length;c+~]|"+K+")"+K+"*"),S=new RegExp("="+K+"*([^\\]'\"]*?)"+K+"*\\]","g"),T=new RegExp(N),U=new RegExp("^"+L+"$"),V={ID:new RegExp("^#("+L+")"),CLASS:new RegExp("^\\.("+L+")"),TAG:new RegExp("^("+L+"|[*])"),ATTR:new RegExp("^"+M),PSEUDO:new RegExp("^"+N),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+K+"*(even|odd|(([+-]|)(\\d*)n|)"+K+"*(?:([+-]|)"+K+"*(\\d+)|))"+K+"*\\)|)","i"),bool:new RegExp("^(?:"+J+")$","i"),needsContext:new RegExp("^"+K+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+K+"*((?:-\\d)?\\d*)"+K+"*\\)|)(?=[^-]|$)","i")},W=/^(?:input|select|textarea|button)$/i,X=/^h\d$/i,Y=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,$=/[+~]/,_=new RegExp("\\\\([\\da-f]{1,6}"+K+"?|("+K+")|.)","ig"),aa=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:d<0?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},ba=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ca=function(a,b){return b?"\0"===a?"\ufffd":a.slice(0,-1)+"\\"+a.charCodeAt(a.length-1).toString(16)+" ":"\\"+a},da=function(){m()},ea=ta(function(a){return a.disabled===!0&&("form"in a||"label"in a)},{dir:"parentNode",next:"legend"});try{G.apply(D=H.call(v.childNodes),v.childNodes),D[v.childNodes.length].nodeType}catch(fa){G={apply:D.length?function(a,b){F.apply(a,H.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function ga(a,b,d,e){var f,h,j,k,l,o,r,s=b&&b.ownerDocument,w=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==w&&9!==w&&11!==w)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==w&&(l=Z.exec(a)))if(f=l[1]){if(9===w){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(s&&(j=s.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(l[2])return G.apply(d,b.getElementsByTagName(a)),d;if((f=l[3])&&c.getElementsByClassName&&b.getElementsByClassName)return G.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==w)s=b,r=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(ba,ca):b.setAttribute("id",k=u),o=g(a),h=o.length;while(h--)o[h]="#"+k+" "+sa(o[h]);r=o.join(","),s=$.test(a)&&qa(b.parentNode)||b}if(r)try{return G.apply(d,s.querySelectorAll(r)),d}catch(x){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(P,"$1"),b,d,e)}function ha(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ia(a){return a[u]=!0,a}function ja(a){var b=n.createElement("fieldset");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ka(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function la(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&a.sourceIndex-b.sourceIndex;if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function na(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function oa(a){return function(b){return"form"in b?b.parentNode&&b.disabled===!1?"label"in b?"label"in b.parentNode?b.parentNode.disabled===a:b.disabled===a:b.isDisabled===a||b.isDisabled!==!a&&ea(b)===a:b.disabled===a:"label"in b&&b.disabled===a}}function pa(a){return ia(function(b){return b=+b,ia(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 qa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=ga.support={},f=ga.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return!!b&&"HTML"!==b.nodeName},m=ga.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),v!==n&&(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ja(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ja(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Y.test(n.getElementsByClassName),c.getById=ja(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){return a.getAttribute("id")===b}},d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}}):(d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}},d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c,d,e,f=b.getElementById(a);if(f){if(c=f.getAttributeNode("id"),c&&c.value===a)return[f];e=b.getElementsByName(a),d=0;while(f=e[d++])if(c=f.getAttributeNode("id"),c&&c.value===a)return[f]}return[]}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){if("undefined"!=typeof b.getElementsByClassName&&p)return b.getElementsByClassName(a)},r=[],q=[],(c.qsa=Y.test(n.querySelectorAll))&&(ja(function(a){o.appendChild(a).innerHTML="",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+K+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+K+"*(?:value|"+J+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ja(function(a){a.innerHTML="";var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+K+"*[*^$|!~]?="),2!==a.querySelectorAll(":enabled").length&&q.push(":enabled",":disabled"),o.appendChild(a).disabled=!0,2!==a.querySelectorAll(":disabled").length&&q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Y.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ja(function(a){c.disconnectedMatch=s.call(a,"*"),s.call(a,"[s!='']:x"),r.push("!=",N)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Y.test(o.compareDocumentPosition),t=b||Y.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?I(k,a)-I(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?I(k,a)-I(k,b):0;if(e===f)return la(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?la(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},ga.matches=function(a,b){return ga(a,null,null,b)},ga.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(S,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return ga(b,n,null,[a]).length>0},ga.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},ga.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&C.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},ga.escape=function(a){return(a+"").replace(ba,ca)},ga.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},ga.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=ga.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=ga.selectors={cacheLength:50,createPseudo:ia,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(_,aa),a[3]=(a[3]||a[4]||a[5]||"").replace(_,aa),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||ga.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&ga.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return V.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&T.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(_,aa).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+K+")"+a+"("+K+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=ga.attr(d,a);return null==e?"!="===b:!b||(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(O," ")+" ").indexOf(c)>-1:"|="===b&&(e===c||e.slice(0,c.length+1)===c+"-"))}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||ga.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ia(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=I(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ia(function(a){var b=[],c=[],d=h(a.replace(P,"$1"));return d[u]?ia(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ia(function(a){return function(b){return ga(a,b).length>0}}),contains:ia(function(a){return a=a.replace(_,aa),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ia(function(a){return U.test(a||"")||ga.error("unsupported lang: "+a),a=a.replace(_,aa).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:oa(!1),disabled:oa(!0),checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return X.test(a.nodeName)},input:function(a){return W.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:pa(function(){return[0]}),last:pa(function(a,b){return[b-1]}),eq:pa(function(a,b,c){return[c<0?c+b:c]}),even:pa(function(a,b){for(var c=0;c=0;)a.push(d);return a}),gt:pa(function(a,b,c){for(var d=c<0?c+b:c;++d1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function va(a,b,c){for(var d=0,e=b.length;d-1&&(f[j]=!(g[j]=l))}}else r=wa(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):G.apply(g,r)})}function ya(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ta(function(a){return a===b},h,!0),l=ta(function(a){return I(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];i1&&ua(m),i>1&&sa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(P,"$1"),c,i0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=E.call(i));u=wa(u)}G.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&ga.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ia(f):f}return h=ga.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=ya(b[c]),f[u]?d.push(f):e.push(f);f=A(a,za(e,d)),f.selector=a}return f},i=ga.select=function(a,b,c,e){var f,i,j,k,l,m="function"==typeof a&&a,n=!e&&g(a=m.selector||a);if(c=c||[],1===n.length){if(i=n[0]=n[0].slice(0),i.length>2&&"ID"===(j=i[0]).type&&9===b.nodeType&&p&&d.relative[i[1].type]){if(b=(d.find.ID(j.matches[0].replace(_,aa),b)||[])[0],!b)return c;m&&(b=b.parentNode),a=a.slice(i.shift().value.length)}f=V.needsContext.test(a)?0:i.length;while(f--){if(j=i[f],d.relative[k=j.type])break;if((l=d.find[k])&&(e=l(j.matches[0].replace(_,aa),$.test(i[0].type)&&qa(b.parentNode)||b))){if(i.splice(f,1),a=e.length&&sa(i),!a)return G.apply(c,e),c;break}}}return(m||h(a,n))(e,b,!p,c,!b||$.test(a)&&qa(b.parentNode)||b),c},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ja(function(a){return 1&a.compareDocumentPosition(n.createElement("fieldset"))}),ja(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||ka("type|href|height|width",function(a,b,c){if(!c)return a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ja(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ka("value",function(a,b,c){if(!c&&"input"===a.nodeName.toLowerCase())return a.defaultValue}),ja(function(a){return null==a.getAttribute("disabled")})||ka(J,function(a,b,c){var d;if(!c)return a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),ga}(a);r.find=x,r.expr=x.selectors,r.expr[":"]=r.expr.pseudos,r.uniqueSort=r.unique=x.uniqueSort,r.text=x.getText,r.isXMLDoc=x.isXML,r.contains=x.contains,r.escapeSelector=x.escape;var y=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&r(a).is(c))break;d.push(a)}return d},z=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},A=r.expr.match.needsContext,B=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i,C=/^.[^:#\[\.,]*$/;function D(a,b,c){return r.isFunction(b)?r.grep(a,function(a,d){return!!b.call(a,d,a)!==c}):b.nodeType?r.grep(a,function(a){return a===b!==c}):"string"!=typeof b?r.grep(a,function(a){return i.call(b,a)>-1!==c}):C.test(b)?r.filter(b,a,c):(b=r.filter(b,a),r.grep(a,function(a){return i.call(b,a)>-1!==c&&1===a.nodeType}))}r.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?r.find.matchesSelector(d,a)?[d]:[]:r.find.matches(a,r.grep(b,function(a){return 1===a.nodeType}))},r.fn.extend({find:function(a){var b,c,d=this.length,e=this;if("string"!=typeof a)return this.pushStack(r(a).filter(function(){for(b=0;b1?r.uniqueSort(c):c},filter:function(a){return this.pushStack(D(this,a||[],!1))},not:function(a){return this.pushStack(D(this,a||[],!0))},is:function(a){return!!D(this,"string"==typeof a&&A.test(a)?r(a):a||[],!1).length}});var E,F=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,G=r.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||E,"string"==typeof a){if(e="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:F.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof r?b[0]:b,r.merge(this,r.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),B.test(e[1])&&r.isPlainObject(b))for(e in b)r.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}return f=d.getElementById(e[2]),f&&(this[0]=f,this.length=1),this}return a.nodeType?(this[0]=a,this.length=1,this):r.isFunction(a)?void 0!==c.ready?c.ready(a):a(r):r.makeArray(a,this)};G.prototype=r.fn,E=r(d);var H=/^(?:parents|prev(?:Until|All))/,I={children:!0,contents:!0,next:!0,prev:!0};r.fn.extend({has:function(a){var b=r(a,this),c=b.length;return this.filter(function(){for(var a=0;a-1:1===c.nodeType&&r.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?r.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?i.call(r(a),this[0]):i.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(r.uniqueSort(r.merge(this.get(),r(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function J(a,b){while((a=a[b])&&1!==a.nodeType);return a}r.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return y(a,"parentNode")},parentsUntil:function(a,b,c){return y(a,"parentNode",c)},next:function(a){return J(a,"nextSibling")},prev:function(a){return J(a,"previousSibling")},nextAll:function(a){return y(a,"nextSibling")},prevAll:function(a){return y(a,"previousSibling")},nextUntil:function(a,b,c){return y(a,"nextSibling",c)},prevUntil:function(a,b,c){return y(a,"previousSibling",c)},siblings:function(a){return z((a.parentNode||{}).firstChild,a)},children:function(a){return z(a.firstChild)},contents:function(a){return a.contentDocument||r.merge([],a.childNodes)}},function(a,b){r.fn[a]=function(c,d){var e=r.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=r.filter(d,e)),this.length>1&&(I[a]||r.uniqueSort(e),H.test(a)&&e.reverse()),this.pushStack(e)}});var K=/[^\x20\t\r\n\f]+/g;function L(a){var b={};return r.each(a.match(K)||[],function(a,c){b[c]=!0}),b}r.Callbacks=function(a){a="string"==typeof a?L(a):r.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h-1)f.splice(c,1),c<=h&&h--}),this},has:function(a){return a?r.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=g=[],c||b||(f=c=""),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j};function M(a){return a}function N(a){throw a}function O(a,b,c){var d;try{a&&r.isFunction(d=a.promise)?d.call(a).done(b).fail(c):a&&r.isFunction(d=a.then)?d.call(a,b,c):b.call(void 0,a)}catch(a){c.call(void 0,a)}}r.extend({Deferred:function(b){var c=[["notify","progress",r.Callbacks("memory"),r.Callbacks("memory"),2],["resolve","done",r.Callbacks("once memory"),r.Callbacks("once memory"),0,"resolved"],["reject","fail",r.Callbacks("once memory"),r.Callbacks("once memory"),1,"rejected"]],d="pending",e={state:function(){return d},always:function(){return f.done(arguments).fail(arguments),this},"catch":function(a){return e.then(null,a)},pipe:function(){var a=arguments;return r.Deferred(function(b){r.each(c,function(c,d){var e=r.isFunction(a[d[4]])&&a[d[4]];f[d[1]](function(){var a=e&&e.apply(this,arguments);a&&r.isFunction(a.promise)?a.promise().progress(b.notify).done(b.resolve).fail(b.reject):b[d[0]+"With"](this,e?[a]:arguments)})}),a=null}).promise()},then:function(b,d,e){var f=0;function g(b,c,d,e){return function(){var h=this,i=arguments,j=function(){var a,j;if(!(b=f&&(d!==N&&(h=void 0,i=[a]),c.rejectWith(h,i))}};b?k():(r.Deferred.getStackHook&&(k.stackTrace=r.Deferred.getStackHook()),a.setTimeout(k))}}return r.Deferred(function(a){c[0][3].add(g(0,a,r.isFunction(e)?e:M,a.notifyWith)),c[1][3].add(g(0,a,r.isFunction(b)?b:M)),c[2][3].add(g(0,a,r.isFunction(d)?d:N))}).promise()},promise:function(a){return null!=a?r.extend(a,e):e}},f={};return r.each(c,function(a,b){var g=b[2],h=b[5];e[b[1]]=g.add,h&&g.add(function(){d=h},c[3-a][2].disable,c[0][2].lock),g.add(b[3].fire),f[b[0]]=function(){return f[b[0]+"With"](this===f?void 0:this,arguments),this},f[b[0]+"With"]=g.fireWith}),e.promise(f),b&&b.call(f,f),f},when:function(a){var b=arguments.length,c=b,d=Array(c),e=f.call(arguments),g=r.Deferred(),h=function(a){return function(c){d[a]=this,e[a]=arguments.length>1?f.call(arguments):c,--b||g.resolveWith(d,e)}};if(b<=1&&(O(a,g.done(h(c)).resolve,g.reject),"pending"===g.state()||r.isFunction(e[c]&&e[c].then)))return g.then();while(c--)O(e[c],h(c),g.reject);return g.promise()}});var P=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;r.Deferred.exceptionHook=function(b,c){a.console&&a.console.warn&&b&&P.test(b.name)&&a.console.warn("jQuery.Deferred exception: "+b.message,b.stack,c)},r.readyException=function(b){a.setTimeout(function(){throw b})};var Q=r.Deferred();r.fn.ready=function(a){return Q.then(a)["catch"](function(a){r.readyException(a)}),this},r.extend({isReady:!1,readyWait:1,holdReady:function(a){a?r.readyWait++:r.ready(!0)},ready:function(a){(a===!0?--r.readyWait:r.isReady)||(r.isReady=!0,a!==!0&&--r.readyWait>0||Q.resolveWith(d,[r]))}}),r.ready.then=Q.then;function R(){d.removeEventListener("DOMContentLoaded",R), +a.removeEventListener("load",R),r.ready()}"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll?a.setTimeout(r.ready):(d.addEventListener("DOMContentLoaded",R),a.addEventListener("load",R));var S=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===r.type(c)){e=!0;for(h in c)S(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,r.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(r(a),c)})),b))for(;h1,null,!0)},removeData:function(a){return this.each(function(){W.remove(this,a)})}}),r.extend({queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=V.get(a,b),c&&(!d||r.isArray(c)?d=V.access(a,b,r.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){b=b||"fx";var c=r.queue(a,b),d=c.length,e=c.shift(),f=r._queueHooks(a,b),g=function(){r.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&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 V.get(a,c)||V.access(a,c,{empty:r.Callbacks("once memory").add(function(){V.remove(a,[b+"queue",c])})})}}),r.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length\x20\t\r\n\f]+)/i,ka=/^$|\/(?:java|ecma)script/i,la={option:[1,""],thead:[1,"","
      "],col:[2,"","
      "],tr:[2,"","
      "],td:[3,"","
      "],_default:[0,"",""]};la.optgroup=la.option,la.tbody=la.tfoot=la.colgroup=la.caption=la.thead,la.th=la.td;function ma(a,b){var c;return c="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):[],void 0===b||b&&r.nodeName(a,b)?r.merge([a],c):c}function na(a,b){for(var c=0,d=a.length;c-1)e&&e.push(f);else if(j=r.contains(f.ownerDocument,f),g=ma(l.appendChild(f),"script"),j&&na(g),c){k=0;while(f=g[k++])ka.test(f.type||"")&&c.push(f)}return l}!function(){var a=d.createDocumentFragment(),b=a.appendChild(d.createElement("div")),c=d.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),o.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="",o.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var qa=d.documentElement,ra=/^key/,sa=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,ta=/^([^.]*)(?:\.(.+)|)/;function ua(){return!0}function va(){return!1}function wa(){try{return d.activeElement}catch(a){}}function xa(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)xa(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=va;else if(!e)return a;return 1===f&&(g=e,e=function(a){return r().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=r.guid++)),a.each(function(){r.event.add(this,b,e,d,c)})}r.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=V.get(a);if(q){c.handler&&(f=c,c=f.handler,e=f.selector),e&&r.find.matchesSelector(qa,e),c.guid||(c.guid=r.guid++),(i=q.events)||(i=q.events={}),(g=q.handle)||(g=q.handle=function(b){return"undefined"!=typeof r&&r.event.triggered!==b.type?r.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(K)||[""],j=b.length;while(j--)h=ta.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n&&(l=r.event.special[n]||{},n=(e?l.delegateType:l.bindType)||n,l=r.event.special[n]||{},k=r.extend({type:n,origType:p,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&r.expr.match.needsContext.test(e),namespace:o.join(".")},f),(m=i[n])||(m=i[n]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,o,g)!==!1||a.addEventListener&&a.addEventListener(n,g)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),r.event.global[n]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=V.hasData(a)&&V.get(a);if(q&&(i=q.events)){b=(b||"").match(K)||[""],j=b.length;while(j--)if(h=ta.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n){l=r.event.special[n]||{},n=(d?l.delegateType:l.bindType)||n,m=i[n]||[],h=h[2]&&new RegExp("(^|\\.)"+o.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&p!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,o,q.handle)!==!1||r.removeEvent(a,n,q.handle),delete i[n])}else for(n in i)r.event.remove(a,n+b[j],c,d,!0);r.isEmptyObject(i)&&V.remove(a,"handle events")}},dispatch:function(a){var b=r.event.fix(a),c,d,e,f,g,h,i=new Array(arguments.length),j=(V.get(this,"events")||{})[b.type]||[],k=r.event.special[b.type]||{};for(i[0]=b,c=1;c=1))for(;j!==this;j=j.parentNode||this)if(1===j.nodeType&&("click"!==a.type||j.disabled!==!0)){for(f=[],g={},c=0;c-1:r.find(e,this,null,[j]).length),g[e]&&f.push(d);f.length&&h.push({elem:j,handlers:f})}return j=this,i\x20\t\r\n\f]*)[^>]*)\/>/gi,za=/\s*$/g;function Da(a,b){return r.nodeName(a,"table")&&r.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a:a}function Ea(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function Fa(a){var b=Ba.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function Ga(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(V.hasData(a)&&(f=V.access(a),g=V.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;c1&&"string"==typeof q&&!o.checkClone&&Aa.test(q))return a.each(function(e){var f=a.eq(e);s&&(b[0]=q.call(this,e,f.html())),Ia(f,b,c,d)});if(m&&(e=pa(b,a[0].ownerDocument,!1,a,d),f=e.firstChild,1===e.childNodes.length&&(e=f),f||d)){for(h=r.map(ma(e,"script"),Ea),i=h.length;l")},clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=r.contains(a.ownerDocument,a);if(!(o.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||r.isXMLDoc(a)))for(g=ma(h),f=ma(a),d=0,e=f.length;d0&&na(g,!i&&ma(a,"script")),h},cleanData:function(a){for(var b,c,d,e=r.event.special,f=0;void 0!==(c=a[f]);f++)if(T(c)){if(b=c[V.expando]){if(b.events)for(d in b.events)e[d]?r.event.remove(c,d):r.removeEvent(c,d,b.handle);c[V.expando]=void 0}c[W.expando]&&(c[W.expando]=void 0)}}}),r.fn.extend({detach:function(a){return Ja(this,a,!0)},remove:function(a){return Ja(this,a)},text:function(a){return S(this,function(a){return void 0===a?r.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=a)})},null,a,arguments.length)},append:function(){return Ia(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Da(this,a);b.appendChild(a)}})},prepend:function(){return Ia(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Da(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return Ia(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return Ia(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(r.cleanData(ma(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null!=a&&a,b=null==b?a:b,this.map(function(){return r.clone(this,a,b)})},html:function(a){return S(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!za.test(a)&&!la[(ja.exec(a)||["",""])[1].toLowerCase()]){a=r.htmlPrefilter(a);try{for(;c1)}});function Ya(a,b,c,d,e){return new Ya.prototype.init(a,b,c,d,e)}r.Tween=Ya,Ya.prototype={constructor:Ya,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||r.easing._default,this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(r.cssNumber[c]?"":"px")},cur:function(){var a=Ya.propHooks[this.prop];return a&&a.get?a.get(this):Ya.propHooks._default.get(this)},run:function(a){var b,c=Ya.propHooks[this.prop];return this.options.duration?this.pos=b=r.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):Ya.propHooks._default.set(this),this}},Ya.prototype.init.prototype=Ya.prototype,Ya.propHooks={_default:{get:function(a){var b;return 1!==a.elem.nodeType||null!=a.elem[a.prop]&&null==a.elem.style[a.prop]?a.elem[a.prop]:(b=r.css(a.elem,a.prop,""),b&&"auto"!==b?b:0)},set:function(a){r.fx.step[a.prop]?r.fx.step[a.prop](a):1!==a.elem.nodeType||null==a.elem.style[r.cssProps[a.prop]]&&!r.cssHooks[a.prop]?a.elem[a.prop]=a.now:r.style(a.elem,a.prop,a.now+a.unit)}}},Ya.propHooks.scrollTop=Ya.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},r.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2},_default:"swing"},r.fx=Ya.prototype.init,r.fx.step={};var Za,$a,_a=/^(?:toggle|show|hide)$/,ab=/queueHooks$/;function bb(){$a&&(a.requestAnimationFrame(bb),r.fx.tick())}function cb(){return a.setTimeout(function(){Za=void 0}),Za=r.now()}function db(a,b){var c,d=0,e={height:a};for(b=b?1:0;d<4;d+=2-b)c=ba[d],e["margin"+c]=e["padding"+c]=a;return b&&(e.opacity=e.width=a),e}function eb(a,b,c){for(var d,e=(hb.tweeners[b]||[]).concat(hb.tweeners["*"]),f=0,g=e.length;f1)},removeAttr:function(a){return this.each(function(){r.removeAttr(this,a)})}}),r.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return"undefined"==typeof a.getAttribute?r.prop(a,b,c):(1===f&&r.isXMLDoc(a)||(e=r.attrHooks[b.toLowerCase()]||(r.expr.match.bool.test(b)?ib:void 0)), +void 0!==c?null===c?void r.removeAttr(a,b):e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:(a.setAttribute(b,c+""),c):e&&"get"in e&&null!==(d=e.get(a,b))?d:(d=r.find.attr(a,b),null==d?void 0:d))},attrHooks:{type:{set:function(a,b){if(!o.radioValue&&"radio"===b&&r.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}},removeAttr:function(a,b){var c,d=0,e=b&&b.match(K);if(e&&1===a.nodeType)while(c=e[d++])a.removeAttribute(c)}}),ib={set:function(a,b,c){return b===!1?r.removeAttr(a,c):a.setAttribute(c,c),c}},r.each(r.expr.match.bool.source.match(/\w+/g),function(a,b){var c=jb[b]||r.find.attr;jb[b]=function(a,b,d){var e,f,g=b.toLowerCase();return d||(f=jb[g],jb[g]=e,e=null!=c(a,b,d)?g:null,jb[g]=f),e}});var kb=/^(?:input|select|textarea|button)$/i,lb=/^(?:a|area)$/i;r.fn.extend({prop:function(a,b){return S(this,r.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[r.propFix[a]||a]})}}),r.extend({prop:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return 1===f&&r.isXMLDoc(a)||(b=r.propFix[b]||b,e=r.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=r.find.attr(a,"tabindex");return b?parseInt(b,10):kb.test(a.nodeName)||lb.test(a.nodeName)&&a.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),o.optSelected||(r.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null},set:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}}),r.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){r.propFix[this.toLowerCase()]=this});function mb(a){var b=a.match(K)||[];return b.join(" ")}function nb(a){return a.getAttribute&&a.getAttribute("class")||""}r.fn.extend({addClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each(function(b){r(this).addClass(a.call(this,b,nb(this)))});if("string"==typeof a&&a){b=a.match(K)||[];while(c=this[i++])if(e=nb(c),d=1===c.nodeType&&" "+mb(e)+" "){g=0;while(f=b[g++])d.indexOf(" "+f+" ")<0&&(d+=f+" ");h=mb(d),e!==h&&c.setAttribute("class",h)}}return this},removeClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each(function(b){r(this).removeClass(a.call(this,b,nb(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof a&&a){b=a.match(K)||[];while(c=this[i++])if(e=nb(c),d=1===c.nodeType&&" "+mb(e)+" "){g=0;while(f=b[g++])while(d.indexOf(" "+f+" ")>-1)d=d.replace(" "+f+" "," ");h=mb(d),e!==h&&c.setAttribute("class",h)}}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):r.isFunction(a)?this.each(function(c){r(this).toggleClass(a.call(this,c,nb(this),b),b)}):this.each(function(){var b,d,e,f;if("string"===c){d=0,e=r(this),f=a.match(K)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else void 0!==a&&"boolean"!==c||(b=nb(this),b&&V.set(this,"__className__",b),this.setAttribute&&this.setAttribute("class",b||a===!1?"":V.get(this,"__className__")||""))})},hasClass:function(a){var b,c,d=0;b=" "+a+" ";while(c=this[d++])if(1===c.nodeType&&(" "+mb(nb(c))+" ").indexOf(b)>-1)return!0;return!1}});var ob=/\r/g;r.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=r.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,r(this).val()):a,null==e?e="":"number"==typeof e?e+="":r.isArray(e)&&(e=r.map(e,function(a){return null==a?"":a+""})),b=r.valHooks[this.type]||r.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=r.valHooks[e.type]||r.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(ob,""):null==c?"":c)}}}),r.extend({valHooks:{option:{get:function(a){var b=r.find.attr(a,"value");return null!=b?b:mb(r.text(a))}},select:{get:function(a){var b,c,d,e=a.options,f=a.selectedIndex,g="select-one"===a.type,h=g?null:[],i=g?f+1:e.length;for(d=f<0?i:g?f:0;d-1)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),r.each(["radio","checkbox"],function(){r.valHooks[this]={set:function(a,b){if(r.isArray(b))return a.checked=r.inArray(r(a).val(),b)>-1}},o.checkOn||(r.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var pb=/^(?:focusinfocus|focusoutblur)$/;r.extend(r.event,{trigger:function(b,c,e,f){var g,h,i,j,k,m,n,o=[e||d],p=l.call(b,"type")?b.type:b,q=l.call(b,"namespace")?b.namespace.split("."):[];if(h=i=e=e||d,3!==e.nodeType&&8!==e.nodeType&&!pb.test(p+r.event.triggered)&&(p.indexOf(".")>-1&&(q=p.split("."),p=q.shift(),q.sort()),k=p.indexOf(":")<0&&"on"+p,b=b[r.expando]?b:new r.Event(p,"object"==typeof b&&b),b.isTrigger=f?2:3,b.namespace=q.join("."),b.rnamespace=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=e),c=null==c?[b]:r.makeArray(c,[b]),n=r.event.special[p]||{},f||!n.trigger||n.trigger.apply(e,c)!==!1)){if(!f&&!n.noBubble&&!r.isWindow(e)){for(j=n.delegateType||p,pb.test(j+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),i=h;i===(e.ownerDocument||d)&&o.push(i.defaultView||i.parentWindow||a)}g=0;while((h=o[g++])&&!b.isPropagationStopped())b.type=g>1?j:n.bindType||p,m=(V.get(h,"events")||{})[b.type]&&V.get(h,"handle"),m&&m.apply(h,c),m=k&&h[k],m&&m.apply&&T(h)&&(b.result=m.apply(h,c),b.result===!1&&b.preventDefault());return b.type=p,f||b.isDefaultPrevented()||n._default&&n._default.apply(o.pop(),c)!==!1||!T(e)||k&&r.isFunction(e[p])&&!r.isWindow(e)&&(i=e[k],i&&(e[k]=null),r.event.triggered=p,e[p](),r.event.triggered=void 0,i&&(e[k]=i)),b.result}},simulate:function(a,b,c){var d=r.extend(new r.Event,c,{type:a,isSimulated:!0});r.event.trigger(d,null,b)}}),r.fn.extend({trigger:function(a,b){return this.each(function(){r.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];if(c)return r.event.trigger(a,b,c,!0)}}),r.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(a,b){r.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),r.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),o.focusin="onfocusin"in a,o.focusin||r.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){r.event.simulate(b,a.target,r.event.fix(a))};r.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=V.access(d,b);e||d.addEventListener(a,c,!0),V.access(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=V.access(d,b)-1;e?V.access(d,b,e):(d.removeEventListener(a,c,!0),V.remove(d,b))}}});var qb=a.location,rb=r.now(),sb=/\?/;r.parseXML=function(b){var c;if(!b||"string"!=typeof b)return null;try{c=(new a.DOMParser).parseFromString(b,"text/xml")}catch(d){c=void 0}return c&&!c.getElementsByTagName("parsererror").length||r.error("Invalid XML: "+b),c};var tb=/\[\]$/,ub=/\r?\n/g,vb=/^(?:submit|button|image|reset|file)$/i,wb=/^(?:input|select|textarea|keygen)/i;function xb(a,b,c,d){var e;if(r.isArray(b))r.each(b,function(b,e){c||tb.test(a)?d(a,e):xb(a+"["+("object"==typeof e&&null!=e?b:"")+"]",e,c,d)});else if(c||"object"!==r.type(b))d(a,b);else for(e in b)xb(a+"["+e+"]",b[e],c,d)}r.param=function(a,b){var c,d=[],e=function(a,b){var c=r.isFunction(b)?b():b;d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(null==c?"":c)};if(r.isArray(a)||a.jquery&&!r.isPlainObject(a))r.each(a,function(){e(this.name,this.value)});else for(c in a)xb(c,a[c],b,e);return d.join("&")},r.fn.extend({serialize:function(){return r.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=r.prop(this,"elements");return a?r.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!r(this).is(":disabled")&&wb.test(this.nodeName)&&!vb.test(a)&&(this.checked||!ia.test(a))}).map(function(a,b){var c=r(this).val();return null==c?null:r.isArray(c)?r.map(c,function(a){return{name:b.name,value:a.replace(ub,"\r\n")}}):{name:b.name,value:c.replace(ub,"\r\n")}}).get()}});var yb=/%20/g,zb=/#.*$/,Ab=/([?&])_=[^&]*/,Bb=/^(.*?):[ \t]*([^\r\n]*)$/gm,Cb=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Db=/^(?:GET|HEAD)$/,Eb=/^\/\//,Fb={},Gb={},Hb="*/".concat("*"),Ib=d.createElement("a");Ib.href=qb.href;function Jb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(K)||[];if(r.isFunction(c))while(d=f[e++])"+"===d[0]?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Kb(a,b,c,d){var e={},f=a===Gb;function g(h){var i;return e[h]=!0,r.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Lb(a,b){var c,d,e=r.ajaxSettings.flatOptions||{};for(c in b)void 0!==b[c]&&((e[c]?a:d||(d={}))[c]=b[c]);return d&&r.extend(!0,a,d),a}function Mb(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===d&&(d=a.mimeType||b.getResponseHeader("Content-Type"));if(d)for(e in h)if(h[e]&&h[e].test(d)){i.unshift(e);break}if(i[0]in c)f=i[0];else{for(e in c){if(!i[0]||a.converters[e+" "+i[0]]){f=e;break}g||(g=e)}f=f||g}if(f)return f!==i[0]&&i.unshift(f),c[f]}function Nb(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}r.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:qb.href,type:"GET",isLocal:Cb.test(qb.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Hb,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":r.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Lb(Lb(a,r.ajaxSettings),b):Lb(r.ajaxSettings,a)},ajaxPrefilter:Jb(Fb),ajaxTransport:Jb(Gb),ajax:function(b,c){"object"==typeof b&&(c=b,b=void 0),c=c||{};var e,f,g,h,i,j,k,l,m,n,o=r.ajaxSetup({},c),p=o.context||o,q=o.context&&(p.nodeType||p.jquery)?r(p):r.event,s=r.Deferred(),t=r.Callbacks("once memory"),u=o.statusCode||{},v={},w={},x="canceled",y={readyState:0,getResponseHeader:function(a){var b;if(k){if(!h){h={};while(b=Bb.exec(g))h[b[1].toLowerCase()]=b[2]}b=h[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return k?g:null},setRequestHeader:function(a,b){return null==k&&(a=w[a.toLowerCase()]=w[a.toLowerCase()]||a,v[a]=b),this},overrideMimeType:function(a){return null==k&&(o.mimeType=a),this},statusCode:function(a){var b;if(a)if(k)y.always(a[y.status]);else for(b in a)u[b]=[u[b],a[b]];return this},abort:function(a){var b=a||x;return e&&e.abort(b),A(0,b),this}};if(s.promise(y),o.url=((b||o.url||qb.href)+"").replace(Eb,qb.protocol+"//"),o.type=c.method||c.type||o.method||o.type,o.dataTypes=(o.dataType||"*").toLowerCase().match(K)||[""],null==o.crossDomain){j=d.createElement("a");try{j.href=o.url,j.href=j.href,o.crossDomain=Ib.protocol+"//"+Ib.host!=j.protocol+"//"+j.host}catch(z){o.crossDomain=!0}}if(o.data&&o.processData&&"string"!=typeof o.data&&(o.data=r.param(o.data,o.traditional)),Kb(Fb,o,c,y),k)return y;l=r.event&&o.global,l&&0===r.active++&&r.event.trigger("ajaxStart"),o.type=o.type.toUpperCase(),o.hasContent=!Db.test(o.type),f=o.url.replace(zb,""),o.hasContent?o.data&&o.processData&&0===(o.contentType||"").indexOf("application/x-www-form-urlencoded")&&(o.data=o.data.replace(yb,"+")):(n=o.url.slice(f.length),o.data&&(f+=(sb.test(f)?"&":"?")+o.data,delete o.data),o.cache===!1&&(f=f.replace(Ab,"$1"),n=(sb.test(f)?"&":"?")+"_="+rb++ +n),o.url=f+n),o.ifModified&&(r.lastModified[f]&&y.setRequestHeader("If-Modified-Since",r.lastModified[f]),r.etag[f]&&y.setRequestHeader("If-None-Match",r.etag[f])),(o.data&&o.hasContent&&o.contentType!==!1||c.contentType)&&y.setRequestHeader("Content-Type",o.contentType),y.setRequestHeader("Accept",o.dataTypes[0]&&o.accepts[o.dataTypes[0]]?o.accepts[o.dataTypes[0]]+("*"!==o.dataTypes[0]?", "+Hb+"; q=0.01":""):o.accepts["*"]);for(m in o.headers)y.setRequestHeader(m,o.headers[m]);if(o.beforeSend&&(o.beforeSend.call(p,y,o)===!1||k))return y.abort();if(x="abort",t.add(o.complete),y.done(o.success),y.fail(o.error),e=Kb(Gb,o,c,y)){if(y.readyState=1,l&&q.trigger("ajaxSend",[y,o]),k)return y;o.async&&o.timeout>0&&(i=a.setTimeout(function(){y.abort("timeout")},o.timeout));try{k=!1,e.send(v,A)}catch(z){if(k)throw z;A(-1,z)}}else A(-1,"No Transport");function A(b,c,d,h){var j,m,n,v,w,x=c;k||(k=!0,i&&a.clearTimeout(i),e=void 0,g=h||"",y.readyState=b>0?4:0,j=b>=200&&b<300||304===b,d&&(v=Mb(o,y,d)),v=Nb(o,v,y,j),j?(o.ifModified&&(w=y.getResponseHeader("Last-Modified"),w&&(r.lastModified[f]=w),w=y.getResponseHeader("etag"),w&&(r.etag[f]=w)),204===b||"HEAD"===o.type?x="nocontent":304===b?x="notmodified":(x=v.state,m=v.data,n=v.error,j=!n)):(n=x,!b&&x||(x="error",b<0&&(b=0))),y.status=b,y.statusText=(c||x)+"",j?s.resolveWith(p,[m,x,y]):s.rejectWith(p,[y,x,n]),y.statusCode(u),u=void 0,l&&q.trigger(j?"ajaxSuccess":"ajaxError",[y,o,j?m:n]),t.fireWith(p,[y,x]),l&&(q.trigger("ajaxComplete",[y,o]),--r.active||r.event.trigger("ajaxStop")))}return y},getJSON:function(a,b,c){return r.get(a,b,c,"json")},getScript:function(a,b){return r.get(a,void 0,b,"script")}}),r.each(["get","post"],function(a,b){r[b]=function(a,c,d,e){return r.isFunction(c)&&(e=e||d,d=c,c=void 0),r.ajax(r.extend({url:a,type:b,dataType:e,data:c,success:d},r.isPlainObject(a)&&a))}}),r._evalUrl=function(a){return r.ajax({url:a,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},r.fn.extend({wrapAll:function(a){var b;return this[0]&&(r.isFunction(a)&&(a=a.call(this[0])),b=r(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstElementChild)a=a.firstElementChild;return a}).append(this)),this},wrapInner:function(a){return r.isFunction(a)?this.each(function(b){r(this).wrapInner(a.call(this,b))}):this.each(function(){var b=r(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=r.isFunction(a);return this.each(function(c){r(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(a){return this.parent(a).not("body").each(function(){r(this).replaceWith(this.childNodes)}),this}}),r.expr.pseudos.hidden=function(a){return!r.expr.pseudos.visible(a)},r.expr.pseudos.visible=function(a){return!!(a.offsetWidth||a.offsetHeight||a.getClientRects().length)},r.ajaxSettings.xhr=function(){try{return new a.XMLHttpRequest}catch(b){}};var Ob={0:200,1223:204},Pb=r.ajaxSettings.xhr();o.cors=!!Pb&&"withCredentials"in Pb,o.ajax=Pb=!!Pb,r.ajaxTransport(function(b){var c,d;if(o.cors||Pb&&!b.crossDomain)return{send:function(e,f){var g,h=b.xhr();if(h.open(b.type,b.url,b.async,b.username,b.password),b.xhrFields)for(g in b.xhrFields)h[g]=b.xhrFields[g];b.mimeType&&h.overrideMimeType&&h.overrideMimeType(b.mimeType),b.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest");for(g in e)h.setRequestHeader(g,e[g]);c=function(a){return function(){c&&(c=d=h.onload=h.onerror=h.onabort=h.onreadystatechange=null,"abort"===a?h.abort():"error"===a?"number"!=typeof h.status?f(0,"error"):f(h.status,h.statusText):f(Ob[h.status]||h.status,h.statusText,"text"!==(h.responseType||"text")||"string"!=typeof h.responseText?{binary:h.response}:{text:h.responseText},h.getAllResponseHeaders()))}},h.onload=c(),d=h.onerror=c("error"),void 0!==h.onabort?h.onabort=d:h.onreadystatechange=function(){4===h.readyState&&a.setTimeout(function(){c&&d()})},c=c("abort");try{h.send(b.hasContent&&b.data||null)}catch(i){if(c)throw i}},abort:function(){c&&c()}}}),r.ajaxPrefilter(function(a){a.crossDomain&&(a.contents.script=!1)}),r.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(a){return r.globalEval(a),a}}}),r.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET")}),r.ajaxTransport("script",function(a){if(a.crossDomain){var b,c;return{send:function(e,f){b=r(" - + From a5e3c04a7d47211cb74ba003d7966220daccfc68 Mon Sep 17 00:00:00 2001 From: AMIT SHEKHAR Date: Mon, 6 Feb 2017 21:41:45 +0530 Subject: [PATCH 22/50] Link more js to offline --- debug-db/src/main/assets/index.html | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/debug-db/src/main/assets/index.html b/debug-db/src/main/assets/index.html index 90800fa..a148c33 100644 --- a/debug-db/src/main/assets/index.html +++ b/debug-db/src/main/assets/index.html @@ -28,13 +28,12 @@ - - - - + + + From 1be62609b05e337fe158c30b2028d6c9e92ac175 Mon Sep 17 00:00:00 2001 From: AMIT SHEKHAR Date: Mon, 6 Feb 2017 21:45:13 +0530 Subject: [PATCH 23/50] Link bootstrap.min.js for offline --- debug-db/src/main/assets/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debug-db/src/main/assets/index.html b/debug-db/src/main/assets/index.html index a148c33..065fdda 100644 --- a/debug-db/src/main/assets/index.html +++ b/debug-db/src/main/assets/index.html @@ -27,8 +27,8 @@ - + From 875e0560969b179c70de12f578c0c83e851780df Mon Sep 17 00:00:00 2001 From: AMIT SHEKHAR Date: Mon, 6 Feb 2017 21:47:15 +0530 Subject: [PATCH 24/50] Link jquery.min.js for offline --- debug-db/src/main/assets/index.html | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/debug-db/src/main/assets/index.html b/debug-db/src/main/assets/index.html index 065fdda..9ff40f5 100644 --- a/debug-db/src/main/assets/index.html +++ b/debug-db/src/main/assets/index.html @@ -26,9 +26,8 @@ - - + From 5a034b46d8556e40a7bc66697d5c7c56a03b1f22 Mon Sep 17 00:00:00 2001 From: AMIT SHEKHAR Date: Tue, 7 Feb 2017 10:34:00 +0530 Subject: [PATCH 25/50] Link jquery.min.js online (error in opening model) --- debug-db/src/main/assets/index.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/debug-db/src/main/assets/index.html b/debug-db/src/main/assets/index.html index 9ff40f5..065fdda 100644 --- a/debug-db/src/main/assets/index.html +++ b/debug-db/src/main/assets/index.html @@ -26,8 +26,9 @@ + + - From a2dd5e2777c3eb4856e981dc0a5cd2c13d0a44d8 Mon Sep 17 00:00:00 2001 From: AMIT SHEKHAR Date: Tue, 7 Feb 2017 11:36:30 +0530 Subject: [PATCH 26/50] Add support for update shared pref --- .../amitshekhar/server/RequestHandler.java | 8 ++- .../com/amitshekhar/utils/DatabaseHelper.java | 2 +- .../com/amitshekhar/utils/PrefHelper.java | 51 +++++++++++++++++++ 3 files changed, 58 insertions(+), 3 deletions(-) diff --git a/debug-db/src/main/java/com/amitshekhar/server/RequestHandler.java b/debug-db/src/main/java/com/amitshekhar/server/RequestHandler.java index 7b4f83b..b6a05e4 100644 --- a/debug-db/src/main/java/com/amitshekhar/server/RequestHandler.java +++ b/debug-db/src/main/java/com/amitshekhar/server/RequestHandler.java @@ -230,7 +230,7 @@ private String getTableListResponse(String route) { if (Constants.APP_SHARED_PREFERENCES.equals(database)) { response = PrefHelper.getAllPrefTableName(mContext); closeDatabase(); - mSelectedDatabase = null; + mSelectedDatabase = Constants.APP_SHARED_PREFERENCES; } else { openDatabase(database); response = DatabaseHelper.getAllTableName(mDatabase); @@ -247,7 +247,11 @@ private String updateTableDataAndGetResponse(String route) { String updatedData = uri.getQueryParameter("updatedData"); List rowDataRequests = mGson.fromJson(updatedData, new TypeToken>() { }.getType()); - response = DatabaseHelper.updateRow(mDatabase, tableName, rowDataRequests); + if (Constants.APP_SHARED_PREFERENCES.equals(mSelectedDatabase)) { + response = PrefHelper.updateRow(mContext, tableName, rowDataRequests); + } else { + response = DatabaseHelper.updateRow(mDatabase, tableName, rowDataRequests); + } return mGson.toJson(response); } catch (Exception e) { e.printStackTrace(); diff --git a/debug-db/src/main/java/com/amitshekhar/utils/DatabaseHelper.java b/debug-db/src/main/java/com/amitshekhar/utils/DatabaseHelper.java index 091432c..7a68f8e 100644 --- a/debug-db/src/main/java/com/amitshekhar/utils/DatabaseHelper.java +++ b/debug-db/src/main/java/com/amitshekhar/utils/DatabaseHelper.java @@ -183,7 +183,7 @@ public static UpdateRowResponse updateRow(SQLiteDatabase db, String tableName, L UpdateRowResponse updateRowResponse = new UpdateRowResponse(); - if (rowDataRequests == null) { + if (rowDataRequests == null || tableName == null) { updateRowResponse.isSuccessful = false; return updateRowResponse; } diff --git a/debug-db/src/main/java/com/amitshekhar/utils/PrefHelper.java b/debug-db/src/main/java/com/amitshekhar/utils/PrefHelper.java index 3fbe3b2..e031d08 100644 --- a/debug-db/src/main/java/com/amitshekhar/utils/PrefHelper.java +++ b/debug-db/src/main/java/com/amitshekhar/utils/PrefHelper.java @@ -23,11 +23,16 @@ import android.content.SharedPreferences; import com.amitshekhar.model.Response; +import com.amitshekhar.model.RowDataRequest; import com.amitshekhar.model.TableDataResponse; +import com.amitshekhar.model.UpdateRowResponse; + +import org.json.JSONArray; import java.io.File; import java.util.ArrayList; import java.util.Collections; +import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; @@ -134,4 +139,50 @@ public static TableDataResponse getAllPrefData(Context context, String tag) { return response; } + + public static UpdateRowResponse updateRow(Context context, String tableName, List rowDataRequests) { + UpdateRowResponse updateRowResponse = new UpdateRowResponse(); + + RowDataRequest rowDataKey = rowDataRequests.get(0); + RowDataRequest rowDataValue = rowDataRequests.get(1); + + String key = rowDataKey.value; + String value = rowDataValue.value; + + SharedPreferences preferences = context.getSharedPreferences(tableName, Context.MODE_PRIVATE); + Map allEntries = preferences.getAll(); + + Object prevValue = allEntries.get(key); + + try { + if (prevValue instanceof String) { + preferences.edit().putString(key, value).apply(); + updateRowResponse.isSuccessful = true; + } else if (prevValue instanceof Integer) { + preferences.edit().putInt(key, Integer.valueOf(value)).apply(); + updateRowResponse.isSuccessful = true; + } else if (prevValue instanceof Long) { + preferences.edit().putLong(key, Long.valueOf(value)).apply(); + updateRowResponse.isSuccessful = true; + } else if (prevValue instanceof Float) { + preferences.edit().putFloat(key, Float.valueOf(value)).apply(); + updateRowResponse.isSuccessful = true; + } else if (prevValue instanceof Boolean) { + preferences.edit().putBoolean(key, Boolean.valueOf(value)).apply(); + updateRowResponse.isSuccessful = true; + } else if (prevValue instanceof Set) { + JSONArray jsonArray = new JSONArray(value); + Set stringSet = new HashSet<>(); + for (int i = 0; i < jsonArray.length(); i++) { + stringSet.add(jsonArray.getString(i)); + } + preferences.edit().putStringSet(key, stringSet).apply(); + updateRowResponse.isSuccessful = true; + } + } catch (Exception e) { + e.printStackTrace(); + } + + return updateRowResponse; + } } From cef0c5f861a450a349e0acd1e8bca078c4049d3a Mon Sep 17 00:00:00 2001 From: AMIT SHEKHAR Date: Tue, 7 Feb 2017 11:44:19 +0530 Subject: [PATCH 27/50] FIX DB-leak issue --- .../src/main/java/com/amitshekhar/server/RequestHandler.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/debug-db/src/main/java/com/amitshekhar/server/RequestHandler.java b/debug-db/src/main/java/com/amitshekhar/server/RequestHandler.java index b6a05e4..5957085 100644 --- a/debug-db/src/main/java/com/amitshekhar/server/RequestHandler.java +++ b/debug-db/src/main/java/com/amitshekhar/server/RequestHandler.java @@ -152,11 +152,15 @@ private void writeServerError(PrintStream output) { } private void openDatabase(String database) { + closeDatabase(); mDatabase = mContext.openOrCreateDatabase(database, 0, null); isDbOpened = true; } private void closeDatabase() { + if (mDatabase != null && mDatabase.isOpen()) { + mDatabase.close(); + } mDatabase = null; isDbOpened = false; } From f620672aaf1d75b008961d192634b36ad3db9195 Mon Sep 17 00:00:00 2001 From: AMIT SHEKHAR Date: Tue, 7 Feb 2017 12:26:54 +0530 Subject: [PATCH 28/50] jquery made locally.. issue was of order.. thanks to vinayagasundar --- debug-db/src/main/assets/index.html | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/debug-db/src/main/assets/index.html b/debug-db/src/main/assets/index.html index 065fdda..73147fe 100644 --- a/debug-db/src/main/assets/index.html +++ b/debug-db/src/main/assets/index.html @@ -26,8 +26,7 @@ - - + From fad6ffa2fd9549c767e3ca8087f28f98b90c13c1 Mon Sep 17 00:00:00 2001 From: AMIT SHEKHAR Date: Tue, 7 Feb 2017 12:35:12 +0530 Subject: [PATCH 29/50] Debug-DB now works completely offline --- debug-db/src/main/assets/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debug-db/src/main/assets/index.html b/debug-db/src/main/assets/index.html index 73147fe..f537a64 100644 --- a/debug-db/src/main/assets/index.html +++ b/debug-db/src/main/assets/index.html @@ -24,7 +24,6 @@ - @@ -34,6 +33,7 @@ + From 261d67df0468949d1ef827420cc9d928800cd6d2 Mon Sep 17 00:00:00 2001 From: AMIT SHEKHAR Date: Tue, 7 Feb 2017 14:13:30 +0530 Subject: [PATCH 30/50] Structure Front-End code --- .../{ => debugDbHome/css}/bootstrap.min.css | 0 .../css}/buttons.dataTables.min.css | 0 .../assets/{ => debugDbHome/css}/custom.css | 0 .../css}/jquery.dataTables.min.css | 0 .../css}/responsive.dataTables.min.css | 0 .../css}/select.dataTables.min.css | 0 .../{ => debugDbHome/images}/favicon.ico | Bin .../main/assets/{ => debugDbHome}/index.html | 30 +++++++++--------- .../main/assets/{ => debugDbHome/js}/app.js | 0 .../{ => debugDbHome/js}/bootstrap.min.js | 0 .../js}/dataTables.altEditor.free.js | 0 .../js}/dataTables.buttons.min.js | 0 .../js}/dataTables.responsive.min.js | 0 .../js}/dataTables.select.min.js | 0 .../js}/jquery.dataTables.min.js | 0 .../assets/{ => debugDbHome/js}/jquery.min.js | 0 .../amitshekhar/server/RequestHandler.java | 2 +- 17 files changed, 16 insertions(+), 16 deletions(-) rename debug-db/src/main/assets/{ => debugDbHome/css}/bootstrap.min.css (100%) rename debug-db/src/main/assets/{ => debugDbHome/css}/buttons.dataTables.min.css (100%) rename debug-db/src/main/assets/{ => debugDbHome/css}/custom.css (100%) rename debug-db/src/main/assets/{ => debugDbHome/css}/jquery.dataTables.min.css (100%) rename debug-db/src/main/assets/{ => debugDbHome/css}/responsive.dataTables.min.css (100%) rename debug-db/src/main/assets/{ => debugDbHome/css}/select.dataTables.min.css (100%) rename debug-db/src/main/assets/{ => debugDbHome/images}/favicon.ico (100%) rename debug-db/src/main/assets/{ => debugDbHome}/index.html (83%) rename debug-db/src/main/assets/{ => debugDbHome/js}/app.js (100%) rename debug-db/src/main/assets/{ => debugDbHome/js}/bootstrap.min.js (100%) rename debug-db/src/main/assets/{ => debugDbHome/js}/dataTables.altEditor.free.js (100%) rename debug-db/src/main/assets/{ => debugDbHome/js}/dataTables.buttons.min.js (100%) rename debug-db/src/main/assets/{ => debugDbHome/js}/dataTables.responsive.min.js (100%) rename debug-db/src/main/assets/{ => debugDbHome/js}/dataTables.select.min.js (100%) rename debug-db/src/main/assets/{ => debugDbHome/js}/jquery.dataTables.min.js (100%) rename debug-db/src/main/assets/{ => debugDbHome/js}/jquery.min.js (100%) diff --git a/debug-db/src/main/assets/bootstrap.min.css b/debug-db/src/main/assets/debugDbHome/css/bootstrap.min.css similarity index 100% rename from debug-db/src/main/assets/bootstrap.min.css rename to debug-db/src/main/assets/debugDbHome/css/bootstrap.min.css diff --git a/debug-db/src/main/assets/buttons.dataTables.min.css b/debug-db/src/main/assets/debugDbHome/css/buttons.dataTables.min.css similarity index 100% rename from debug-db/src/main/assets/buttons.dataTables.min.css rename to debug-db/src/main/assets/debugDbHome/css/buttons.dataTables.min.css diff --git a/debug-db/src/main/assets/custom.css b/debug-db/src/main/assets/debugDbHome/css/custom.css similarity index 100% rename from debug-db/src/main/assets/custom.css rename to debug-db/src/main/assets/debugDbHome/css/custom.css diff --git a/debug-db/src/main/assets/jquery.dataTables.min.css b/debug-db/src/main/assets/debugDbHome/css/jquery.dataTables.min.css similarity index 100% rename from debug-db/src/main/assets/jquery.dataTables.min.css rename to debug-db/src/main/assets/debugDbHome/css/jquery.dataTables.min.css diff --git a/debug-db/src/main/assets/responsive.dataTables.min.css b/debug-db/src/main/assets/debugDbHome/css/responsive.dataTables.min.css similarity index 100% rename from debug-db/src/main/assets/responsive.dataTables.min.css rename to debug-db/src/main/assets/debugDbHome/css/responsive.dataTables.min.css diff --git a/debug-db/src/main/assets/select.dataTables.min.css b/debug-db/src/main/assets/debugDbHome/css/select.dataTables.min.css similarity index 100% rename from debug-db/src/main/assets/select.dataTables.min.css rename to debug-db/src/main/assets/debugDbHome/css/select.dataTables.min.css diff --git a/debug-db/src/main/assets/favicon.ico b/debug-db/src/main/assets/debugDbHome/images/favicon.ico similarity index 100% rename from debug-db/src/main/assets/favicon.ico rename to debug-db/src/main/assets/debugDbHome/images/favicon.ico diff --git a/debug-db/src/main/assets/index.html b/debug-db/src/main/assets/debugDbHome/index.html similarity index 83% rename from debug-db/src/main/assets/index.html rename to debug-db/src/main/assets/debugDbHome/index.html index f537a64..07413b9 100644 --- a/debug-db/src/main/assets/index.html +++ b/debug-db/src/main/assets/debugDbHome/index.html @@ -23,22 +23,22 @@ Android Debug Database - + - - - - - - - + + + + + + + - - - - - - + + + + + + @@ -147,6 +147,6 @@
      - + \ No newline at end of file diff --git a/debug-db/src/main/assets/app.js b/debug-db/src/main/assets/debugDbHome/js/app.js similarity index 100% rename from debug-db/src/main/assets/app.js rename to debug-db/src/main/assets/debugDbHome/js/app.js diff --git a/debug-db/src/main/assets/bootstrap.min.js b/debug-db/src/main/assets/debugDbHome/js/bootstrap.min.js similarity index 100% rename from debug-db/src/main/assets/bootstrap.min.js rename to debug-db/src/main/assets/debugDbHome/js/bootstrap.min.js diff --git a/debug-db/src/main/assets/dataTables.altEditor.free.js b/debug-db/src/main/assets/debugDbHome/js/dataTables.altEditor.free.js similarity index 100% rename from debug-db/src/main/assets/dataTables.altEditor.free.js rename to debug-db/src/main/assets/debugDbHome/js/dataTables.altEditor.free.js diff --git a/debug-db/src/main/assets/dataTables.buttons.min.js b/debug-db/src/main/assets/debugDbHome/js/dataTables.buttons.min.js similarity index 100% rename from debug-db/src/main/assets/dataTables.buttons.min.js rename to debug-db/src/main/assets/debugDbHome/js/dataTables.buttons.min.js diff --git a/debug-db/src/main/assets/dataTables.responsive.min.js b/debug-db/src/main/assets/debugDbHome/js/dataTables.responsive.min.js similarity index 100% rename from debug-db/src/main/assets/dataTables.responsive.min.js rename to debug-db/src/main/assets/debugDbHome/js/dataTables.responsive.min.js diff --git a/debug-db/src/main/assets/dataTables.select.min.js b/debug-db/src/main/assets/debugDbHome/js/dataTables.select.min.js similarity index 100% rename from debug-db/src/main/assets/dataTables.select.min.js rename to debug-db/src/main/assets/debugDbHome/js/dataTables.select.min.js diff --git a/debug-db/src/main/assets/jquery.dataTables.min.js b/debug-db/src/main/assets/debugDbHome/js/jquery.dataTables.min.js similarity index 100% rename from debug-db/src/main/assets/jquery.dataTables.min.js rename to debug-db/src/main/assets/debugDbHome/js/jquery.dataTables.min.js diff --git a/debug-db/src/main/assets/jquery.min.js b/debug-db/src/main/assets/debugDbHome/js/jquery.min.js similarity index 100% rename from debug-db/src/main/assets/jquery.min.js rename to debug-db/src/main/assets/debugDbHome/js/jquery.min.js diff --git a/debug-db/src/main/java/com/amitshekhar/server/RequestHandler.java b/debug-db/src/main/java/com/amitshekhar/server/RequestHandler.java index 5957085..c0ad153 100644 --- a/debug-db/src/main/java/com/amitshekhar/server/RequestHandler.java +++ b/debug-db/src/main/java/com/amitshekhar/server/RequestHandler.java @@ -89,7 +89,7 @@ public void handle(Socket socket) throws IOException { output = new PrintStream(socket.getOutputStream()); if (route == null || route.isEmpty()) { - route = "index.html"; + route = "debugDbHome/index.html"; } byte[] bytes; From 81e63b1a32fb79b82679019f51856d4e47af7cca Mon Sep 17 00:00:00 2001 From: AMIT SHEKHAR Date: Tue, 7 Feb 2017 14:38:55 +0530 Subject: [PATCH 31/50] Add links --- debug-db/src/main/assets/debugDbHome/index.html | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/debug-db/src/main/assets/debugDbHome/index.html b/debug-db/src/main/assets/debugDbHome/index.html index 07413b9..cfea96d 100644 --- a/debug-db/src/main/assets/debugDbHome/index.html +++ b/debug-db/src/main/assets/debugDbHome/index.html @@ -23,7 +23,7 @@ Android Debug Database - + @@ -55,7 +55,7 @@ - DebugDB + Android Debug Database
      - - - - +
      @@ -153,6 +154,8 @@
      +
      Data Updated Successfully
      +
      diff --git a/debug-db/src/main/assets/debugDbHome/js/app.js b/debug-db/src/main/assets/debugDbHome/js/app.js index 5ca45de..99cfd92 100644 --- a/debug-db/src/main/assets/debugDbHome/js/app.js +++ b/debug-db/src/main/assets/debugDbHome/js/app.js @@ -121,7 +121,11 @@ function openDatabaseAndGetTableList(db) { function inflateData(result){ if(result.isSuccessful){ - showSuccessInfo(); + + if(!result.isSelectQuery){ + showSuccessInfo("Query Executed Successfully"); + } + var columnHeader = result.tableInfos; // set function to return cell data for different usages like set, display, filter, search etc.. @@ -183,7 +187,11 @@ function inflateData(result){ $(".dataTables_scrollHeadInner").css({"width":"100%"}); $(".table ").css({"width":"100%"}); }else{ - showErrorInfo(); + if(!result.isSelectQuery){ + showSuccessInfo("Query Execution Failed"); + }else { + showErrorInfo("Some Error Occurred"); + } } } @@ -217,6 +225,7 @@ function updateTableData(updatedData, callback) { if(response.isSuccessful){ console.log("Data updated successfully"); callback(true); + showSuccessInfo("Data Updated Successfully"); } else { console.log("Data updated failed"); callback(false); @@ -225,17 +234,18 @@ function updateTableData(updatedData, callback) { }) } -function showSuccessInfo(){ - $("#success-info").show(); - $("#error-info").hide(); +function showSuccessInfo(message){ + var snackbar = document.getElementById("snackbar") + snackbar.className = "show"; + snackbar.style.backgroundColor = "#5cb85c"; + snackbar.innerHTML = message; + setTimeout(function(){ snackbar.className = snackbar.className.replace("show", ""); }, 2000); } -function showErrorInfo(){ - $("#success-info").hide(); - $("#error-info").show(); +function showErrorInfo(message){ + var snackbar = document.getElementById("snackbar") + snackbar.className = "show"; + snackbar.style.backgroundColor = "#d9534f"; + snackbar.innerHTML = message; + setTimeout(function(){ snackbar.className = snackbar.className.replace("show", ""); }, 2000); } - -function hideBothInfo(){ - $("#success-info").hide(); - $("#error-info").hide(); -} \ No newline at end of file diff --git a/debug-db/src/main/java/com/amitshekhar/model/TableDataResponse.java b/debug-db/src/main/java/com/amitshekhar/model/TableDataResponse.java index dd658a7..241bded 100644 --- a/debug-db/src/main/java/com/amitshekhar/model/TableDataResponse.java +++ b/debug-db/src/main/java/com/amitshekhar/model/TableDataResponse.java @@ -32,6 +32,7 @@ public class TableDataResponse { public List rows; public String errorMessage; public boolean isEditable; + public boolean isSelectQuery; public static class TableInfo { public String title; diff --git a/debug-db/src/main/java/com/amitshekhar/server/RequestHandler.java b/debug-db/src/main/java/com/amitshekhar/server/RequestHandler.java index 020d90b..b8f4128 100644 --- a/debug-db/src/main/java/com/amitshekhar/server/RequestHandler.java +++ b/debug-db/src/main/java/com/amitshekhar/server/RequestHandler.java @@ -219,7 +219,7 @@ private String executeQueryAndGetResponse(String route) { TableDataResponse response = DatabaseHelper.getTableData(mDatabase, query, null); data = mGson.toJson(response); } else { - Response response = DatabaseHelper.exec(mDatabase, query); + TableDataResponse response = DatabaseHelper.exec(mDatabase, query); data = mGson.toJson(response); } } diff --git a/debug-db/src/main/java/com/amitshekhar/utils/DatabaseHelper.java b/debug-db/src/main/java/com/amitshekhar/utils/DatabaseHelper.java index 02b3bb1..ba9b1a8 100644 --- a/debug-db/src/main/java/com/amitshekhar/utils/DatabaseHelper.java +++ b/debug-db/src/main/java/com/amitshekhar/utils/DatabaseHelper.java @@ -63,7 +63,7 @@ public static Response getAllTableName(SQLiteDatabase database) { public static TableDataResponse getTableData(SQLiteDatabase db, String selectQuery, String tableName) { TableDataResponse tableData = new TableDataResponse(); - + tableData.isSelectQuery = true; if (tableName == null) { tableName = getTableName(selectQuery); } @@ -239,18 +239,19 @@ public static UpdateRowResponse updateRow(SQLiteDatabase db, String tableName, L return updateRowResponse; } - public static Response exec(SQLiteDatabase database, String sql) { - Response response = new Response(); + public static TableDataResponse exec(SQLiteDatabase database, String sql) { + TableDataResponse tableDataResponse = new TableDataResponse(); + tableDataResponse.isSelectQuery = false; try { database.execSQL(sql); } catch (Exception e) { e.printStackTrace(); - response.isSuccessful = false; - response.error = e.getMessage(); - return response; + tableDataResponse.isSuccessful = false; + tableDataResponse.errorMessage = e.getMessage(); + return tableDataResponse; } - response.isSuccessful = true; - return response; + tableDataResponse.isSuccessful = true; + return tableDataResponse; } private static String getTableName(String selectQuery) { diff --git a/debug-db/src/main/java/com/amitshekhar/utils/PrefHelper.java b/debug-db/src/main/java/com/amitshekhar/utils/PrefHelper.java index a2c16bc..0f6c8dd 100644 --- a/debug-db/src/main/java/com/amitshekhar/utils/PrefHelper.java +++ b/debug-db/src/main/java/com/amitshekhar/utils/PrefHelper.java @@ -88,6 +88,7 @@ public static TableDataResponse getAllPrefData(Context context, String tag) { TableDataResponse response = new TableDataResponse(); response.isSuccessful = true; + response.isSelectQuery = true; TableDataResponse.TableInfo keyInfo = new TableDataResponse.TableInfo(); keyInfo.isPrimary = true; From cddb63a98137d721d63e3030711f206b4093b817 Mon Sep 17 00:00:00 2001 From: AMIT SHEKHAR Date: Tue, 7 Feb 2017 21:50:59 +0530 Subject: [PATCH 40/50] Return in case of no data(no select query) --- debug-db/src/main/assets/debugDbHome/js/app.js | 1 + 1 file changed, 1 insertion(+) diff --git a/debug-db/src/main/assets/debugDbHome/js/app.js b/debug-db/src/main/assets/debugDbHome/js/app.js index 99cfd92..ed28064 100644 --- a/debug-db/src/main/assets/debugDbHome/js/app.js +++ b/debug-db/src/main/assets/debugDbHome/js/app.js @@ -124,6 +124,7 @@ function inflateData(result){ if(!result.isSelectQuery){ showSuccessInfo("Query Executed Successfully"); + return; } var columnHeader = result.tableInfos; From 85fd7c03e2d2711e5a4d188435f5f7a72494f009 Mon Sep 17 00:00:00 2001 From: Vinayaga Sundar Date: Tue, 7 Feb 2017 21:52:39 +0530 Subject: [PATCH 41/50] feat : added option to delete data from the UI --- .../src/main/assets/debugDbHome/js/app.js | 64 ++++++++++++++++++ .../js/dataTables.altEditor.free.js | 65 +++++++++++++++++-- .../amitshekhar/server/RequestHandler.java | 26 ++++++++ .../com/amitshekhar/utils/DatabaseHelper.java | 43 ++++++++++++ .../com/amitshekhar/utils/PrefHelper.java | 26 ++++++++ 5 files changed, 219 insertions(+), 5 deletions(-) diff --git a/debug-db/src/main/assets/debugDbHome/js/app.js b/debug-db/src/main/assets/debugDbHome/js/app.js index 5ca45de..7a238e3 100644 --- a/debug-db/src/main/assets/debugDbHome/js/app.js +++ b/debug-db/src/main/assets/debugDbHome/js/app.js @@ -163,6 +163,11 @@ function inflateData(result){ extend: 'selected', // Bind to Selected row text: 'Edit', name: 'edit' // do not change name + }, + { + extend: 'selected', + text: 'Delete', + name: 'delete' } ] }) @@ -179,6 +184,26 @@ function inflateData(result){ //send update table data request to server updateTableData(data, callback); }); + + + //attach delete-updated listener + $(tableId).on('delete-row.dt', function (e, updatedRowData, callback) { + var deleteRowDataArray = JSON.parse(updatedRowData); + + console.log(deleteRowDataArray); + + //add value for each column + var data = columnHeader; + for(var i = 0; i < data.length; i++) { + data[i].value = deleteRowDataArray[i].value; + data[i].dataType = deleteRowDataArray[i].dataType; + + } + + //send delete table data request to server + deleteTableData(data, callback); + }); + // hack to fix alignment issue when scrollX is enabled $(".dataTables_scrollHeadInner").css({"width":"100%"}); $(".table ").css({"width":"100%"}); @@ -225,6 +250,45 @@ function updateTableData(updatedData, callback) { }) } + +function deleteTableData(deleteData, callback) { + + var selectedTableElement = $("#table-list .list-group-item.selected"); + var filteredUpdatedData = deleteData.map(function(columnData){ + return { + title: columnData.title, + isPrimary: columnData.isPrimary, + value: columnData.value, + dataType: columnData.dataType + } + }); + + console.log(filteredUpdatedData); + + //build request parameters + var requestParameters = {}; + requestParameters.dbName = selectedTableElement.attr('data-db-name'); + requestParameters.tableName = selectedTableElement.attr('data-table-name');; + requestParameters.deleteData = encodeURIComponent(JSON.stringify(filteredUpdatedData)); + + //execute request + $.ajax({ + url: "deleteTableData", + type: 'GET', + data: requestParameters, + success: function(response) { + response = JSON.parse(response); + if(response.isSuccessful){ + console.log("Data deleted successfully"); + callback(true); + } else { + console.log("Data delete failed"); + callback(false); + } + } + }) +} + function showSuccessInfo(){ $("#success-info").show(); $("#error-info").hide(); diff --git a/debug-db/src/main/assets/debugDbHome/js/dataTables.altEditor.free.js b/debug-db/src/main/assets/debugDbHome/js/dataTables.altEditor.free.js index 3696d6f..dd4b188 100644 --- a/debug-db/src/main/assets/debugDbHome/js/dataTables.altEditor.free.js +++ b/debug-db/src/main/assets/debugDbHome/js/dataTables.altEditor.free.js @@ -412,9 +412,34 @@ data += "
      "; for (var i in columnDefs) { + var cellData = adata.data()[0][i]; - data += "
      " + adata.data()[0][i] + "
      "; + var inputType = "text"; + switch (cellData.dataType) { + case 'integer': + inputType = "number"; + break; + case 'real': + inputType = "number"; + break; + case 'boolean': + inputType = "checkbox"; + break; + case 'long': + inputType = "number"; + break; + case 'float': + inputType = "number"; + break; + case 'text': + inputType = "text"; + break; + case 'string_set': + inputType = "text"; + break; + } + data += "
      " + cellData.value + "
      "; } data += "
      "; @@ -434,6 +459,22 @@ var that = this; var dt = this.s.dt; + var data = []; + + $('form[name="altEditor-form"] input').each(function(i) { + var addToList = true; + var value = $(this).val(); + value = $(this).val(); + + console.log("Value : " + value); + if (addToList){ + data.push({ + "value": value, + "dataType": $(this).attr('data-type') + }); + } + }); + $('#altEditor-modal .modal-body .alert').remove(); var message = ' - + \ No newline at end of file diff --git a/debug-db/src/main/assets/debugDbHome/css/jquery.dataTables.min.css b/debug-db/src/main/assets/jquery.dataTables.min.css similarity index 100% rename from debug-db/src/main/assets/debugDbHome/css/jquery.dataTables.min.css rename to debug-db/src/main/assets/jquery.dataTables.min.css diff --git a/debug-db/src/main/assets/debugDbHome/js/jquery.dataTables.min.js b/debug-db/src/main/assets/jquery.dataTables.min.js similarity index 100% rename from debug-db/src/main/assets/debugDbHome/js/jquery.dataTables.min.js rename to debug-db/src/main/assets/jquery.dataTables.min.js diff --git a/debug-db/src/main/assets/debugDbHome/js/jquery.min.js b/debug-db/src/main/assets/jquery.min.js similarity index 100% rename from debug-db/src/main/assets/debugDbHome/js/jquery.min.js rename to debug-db/src/main/assets/jquery.min.js diff --git a/debug-db/src/main/assets/debugDbHome/css/responsive.dataTables.min.css b/debug-db/src/main/assets/responsive.dataTables.min.css similarity index 100% rename from debug-db/src/main/assets/debugDbHome/css/responsive.dataTables.min.css rename to debug-db/src/main/assets/responsive.dataTables.min.css diff --git a/debug-db/src/main/assets/debugDbHome/css/select.dataTables.min.css b/debug-db/src/main/assets/select.dataTables.min.css similarity index 100% rename from debug-db/src/main/assets/debugDbHome/css/select.dataTables.min.css rename to debug-db/src/main/assets/select.dataTables.min.css diff --git a/debug-db/src/main/java/com/amitshekhar/server/RequestHandler.java b/debug-db/src/main/java/com/amitshekhar/server/RequestHandler.java index ad01aa0..2538cfe 100644 --- a/debug-db/src/main/java/com/amitshekhar/server/RequestHandler.java +++ b/debug-db/src/main/java/com/amitshekhar/server/RequestHandler.java @@ -90,7 +90,7 @@ public void handle(Socket socket) throws IOException { output = new PrintStream(socket.getOutputStream()); if (route == null || route.isEmpty()) { - route = "debugDbHome/index.html"; + route = "index.html"; } byte[] bytes;