Merge branch 'IoTS-1.0.0' of https://github.com/wso2/carbon-device-mgt-plugins into IoTS-1.0.0

revert-dabc3590
ayyoob 8 years ago
commit d6bfce396d

@ -31,7 +31,7 @@
<script src="/portal/libs/analytics-wso2-2.0.0/vega.js"></script>
<script src="/portal/libs/analytics-wso2-2.0.0/VizGrammar.min.js"></script>
<script src="/portal/libs/analytics-wso2-2.0.0/VizGrammar_2.js"></script>
<script src="/portal/libs/analytics-wso2-2.0.0/wso2gadgets.js"></script>

@ -31,7 +31,7 @@
<script src="/portal/libs/analytics-wso2-2.0.0/vega.js"></script>
<script src="/portal/libs/analytics-wso2-2.0.0/VizGrammar.min.js"></script>
<script src="/portal/libs/analytics-wso2-2.0.0/VizGrammar_2.js"></script>
<script src="/portal/libs/analytics-wso2-2.0.0/wso2gadgets.js"></script>

@ -31,7 +31,7 @@
<script src="/portal/libs/analytics-wso2-2.0.0/vega.js"></script>
<script src="/portal/libs/analytics-wso2-2.0.0/VizGrammar.min.js"></script>
<script src="/portal/libs/analytics-wso2-2.0.0/VizGrammar_2.js"></script>
<script src="/portal/libs/analytics-wso2-2.0.0/wso2gadgets.js"></script>

@ -33,7 +33,7 @@
<script src="/portal/libs/analytics-wso2-2.0.0/vega.js"></script>
<script src="/portal/libs/analytics-wso2-2.0.0/VizGrammar.min.js"></script>
<script src="/portal/libs/analytics-wso2-2.0.0/VizGrammar_2.js"></script>
<script src="/portal/libs/analytics-wso2-2.0.0/wso2gadgets.js"></script>

@ -33,7 +33,7 @@
<script src="/portal/libs/analytics-wso2-2.0.0/vega.js"></script>
<script src="/portal/libs/analytics-wso2-2.0.0/VizGrammar.min.js"></script>
<script src="/portal/libs/analytics-wso2-2.0.0/VizGrammar_2.js"></script>
<script src="/portal/libs/analytics-wso2-2.0.0/wso2gadgets.js"></script>

@ -31,7 +31,7 @@
<script src="/portal/libs/analytics-wso2-2.0.0/vega.js"></script>
<script src="/portal/libs/analytics-wso2-2.0.0/VizGrammar.min.js"></script>
<script src="/portal/libs/analytics-wso2-2.0.0/VizGrammar_2.js"></script>
<script src="/portal/libs/analytics-wso2-2.0.0/wso2gadgets.js"></script>

@ -31,7 +31,7 @@
<script src="/portal/libs/analytics-wso2-2.0.0/vega.js"></script>
<script src="/portal/libs/analytics-wso2-2.0.0/VizGrammar.min.js"></script>
<script src="/portal/libs/analytics-wso2-2.0.0/VizGrammar_2.js"></script>
<script src="/portal/libs/analytics-wso2-2.0.0/wso2gadgets.js"></script>

@ -32,7 +32,7 @@
<script src="/portal/libs/analytics-wso2-2.0.0/vega.js"></script>
<script src="/portal/libs/analytics-wso2-2.0.0/VizGrammar.min.js"></script>
<script src="/portal/libs/analytics-wso2-2.0.0/VizGrammar_2.js"></script>
<script src="/portal/libs/analytics-wso2-2.0.0/wso2gadgets.js"></script>

@ -50,7 +50,7 @@
<script src="../commons/js/d3.min.js"></script>
<script src="../commons/js/vega.js"></script>
<!--
<script src="../commons/js/VizGrammar.min.js"></script>
<script src="../commons/js/VizGrammar_2.js"></script>
<script src="/portal/extensions/themes/analytics/js/colorbrewer.js"></script>
<script src="/portal/extensions/themes/analytics/js/VizGrammarSettings.js"></script>
-->
@ -58,7 +58,7 @@
<!-- JS -->
<script src="js/topojson.js"></script>
<script src="js/vega.js"></script>
<script src="js/VizGrammar.min.js"></script>
<script src="js/VizGrammar_2.js"></script>
<script src="js/VizGrammarSettings.js"></script>
<script src="js/gadgetconf.js"></script>
<script src="js/analyticsUtils.js"></script>

@ -46,7 +46,7 @@
<!-- Include VizGrammar -->
<script src="../commons/js/d3.min.js"></script>
<script src="../commons/js/vega.js"></script>
<script src="../commons/js/VizGrammar.min.js"></script>
<script src="../commons/js/VizGrammar_2.js"></script>
<script src="/portal/extensions/themes/analytics/js/colorbrewer.js"></script>
<script src="/portal/extensions/themes/analytics/js/VizGrammarSettings.js"></script>

@ -35,7 +35,7 @@
<script src="/portal/libs/analytics-wso2-2.0.0/vega.js"></script>
<script src="/portal/libs/analytics-wso2-2.0.0/VizGrammar.min.js"></script>
<script src="/portal/libs/analytics-wso2-2.0.0/VizGrammar_2.js"></script>
<script src="/portal/libs/analytics-wso2-2.0.0/wso2gadgets.js"></script>

@ -31,7 +31,7 @@
<script src="/portal/libs/analytics-wso2-2.0.0/vega.js"></script>
<script src="/portal/libs/analytics-wso2-2.0.0/VizGrammar.min.js"></script>
<script src="/portal/libs/analytics-wso2-2.0.0/VizGrammar_2.js"></script>
<script src="/portal/libs/analytics-wso2-2.0.0/wso2gadgets.js"></script>

@ -35,7 +35,7 @@
<script src="js/provider-libs/ws-client.js"></script>
<script src="/portal/libs/analytics-wso2-2.0.0/d3.min.js"></script>
<script src="/portal/libs/analytics-wso2-2.0.0/vega.js"></script>
<script src="/portal/libs/analytics-wso2-2.0.0/VizGrammar.min.js"></script>
<script src="/portal/libs/analytics-wso2-2.0.0/VizGrammar_2.js"></script>
<script src="/portal/libs/analytics-wso2-2.0.0/wso2gadgets.js"></script>
<script src="/portal/libs/analytics-wso2-2.0.0/chart-utils.js"></script>

@ -50,7 +50,7 @@
<!-- Include VizGrammar -->
<script src="../commons/js/d3.min.js"></script>
<script src="../commons/js/vega.js"></script>
<script src="../commons/js/VizGrammar.min.js"></script>
<script src="../commons/js/VizGrammar_2.js"></script>
<script src="/portal/extensions/themes/analytics/js/colorbrewer.js"></script>
<script src="/portal/extensions/themes/analytics/js/VizGrammarSettings.js"></script>

@ -4,11 +4,11 @@
<Require feature="dynamic-height"/>
<Require feature="wso2-gadgets-identity"/>
</ModulePrefs>
<UserPref name="windowSize"
display_name="Window Size"
default_value="10"/>
<Content type="html">
<![CDATA[
<head>
@ -37,13 +37,13 @@
<script src="/portal/libs/analytics-wso2-2.0.0/vega.js"></script>
<script src="/portal/libs/analytics-wso2-2.0.0/VizGrammar.min.js"></script>
<script src="/portal/libs/analytics-wso2-2.0.0/VizGrammar_2.js"></script>
<script src="/portal/libs/analytics-wso2-2.0.0/wso2gadgets.js"></script>
<script src="/portal/libs/analytics-wso2-2.0.0/chart-utils.js"></script>
<script src="/portal/libs/analytics-wso2-2.0.0/gadget-utils.js"></script>
<script src="/portal/libs/analytics-wso2-2.0.0/iot-gadget-utils.js"></script>
<!-- chart specific vendor libs -->

@ -4,11 +4,11 @@
<Require feature="dynamic-height"/>
<Require feature="wso2-gadgets-identity"/>
</ModulePrefs>
<UserPref name="windowSize"
display_name="Window Size"
default_value="10"/>
<Content type="html">
<![CDATA[
<head>
@ -37,12 +37,14 @@
<script src="/portal/libs/analytics-wso2-2.0.0/vega.js"></script>
<script src="/portal/libs/analytics-wso2-2.0.0/VizGrammar.min.js"></script>
<script src="/portal/libs/analytics-wso2-2.0.0/VizGrammar_2.js"></script>
<script src="/portal/libs/analytics-wso2-2.0.0/wso2gadgets.js"></script>
<script src="/portal/libs/analytics-wso2-2.0.0/chart-utils.js"></script>
<script src="/portal/libs/analytics-wso2-2.0.0/iot-gadget-utils.js"></script>
<!-- chart specific vendor libs -->
<!-- chart specific js -->

@ -4,11 +4,11 @@
<Require feature="dynamic-height"/>
<Require feature="wso2-gadgets-identity"/>
</ModulePrefs>
<UserPref name="windowSize"
display_name="Window Size"
default_value="10"/>
<Content type="html">
<![CDATA[
<head>
@ -37,13 +37,14 @@
<script src="/portal/libs/analytics-wso2-2.0.0/vega.js"></script>
<script src="/portal/libs/analytics-wso2-2.0.0/VizGrammar.min.js"></script>
<script src="/portal/libs/analytics-wso2-2.0.0/VizGrammar_2.js"></script>
<script src="/portal/libs/analytics-wso2-2.0.0/wso2gadgets.js"></script>
<script src="/portal/libs/analytics-wso2-2.0.0/iot-gadget-utils.js"></script>
<script src="/portal/libs/analytics-wso2-2.0.0/chart-utils.js"></script>
<script src="/portal/libs/analytics-wso2-2.0.0/gadget-utils.js"></script>
<!-- chart specific vendor libs -->

@ -4,11 +4,11 @@
<Require feature="dynamic-height"/>
<Require feature="wso2-gadgets-identity"/>
</ModulePrefs>
<UserPref name="windowSize"
display_name="Window Size"
default_value="10"/>
<Content type="html">
<![CDATA[
<head>
@ -37,7 +37,7 @@
<script src="/portal/libs/analytics-wso2-2.0.0/vega.js"></script>
<script src="/portal/libs/analytics-wso2-2.0.0/VizGrammar.min.js"></script>
<script src="/portal/libs/analytics-wso2-2.0.0/VizGrammar_2.js"></script>
<script src="/portal/libs/analytics-wso2-2.0.0/wso2gadgets.js"></script>

@ -4,11 +4,11 @@
<Require feature="dynamic-height"/>
<Require feature="wso2-gadgets-identity"/>
</ModulePrefs>
<UserPref name="windowSize"
display_name="Window Size"
default_value="10"/>
<Content type="html">
<![CDATA[
<head>
@ -37,12 +37,14 @@
<script src="/portal/libs/analytics-wso2-2.0.0/vega.js"></script>
<script src="/portal/libs/analytics-wso2-2.0.0/VizGrammar.min.js"></script>
<script src="/portal/libs/analytics-wso2-2.0.0/VizGrammar_2.js"></script>
<script src="/portal/libs/analytics-wso2-2.0.0/wso2gadgets.js"></script>
<script src="/portal/libs/analytics-wso2-2.0.0/chart-utils.js"></script>
<script src="/portal/libs/analytics-wso2-2.0.0/iot-gadget-utils.js"></script>
<!-- chart specific vendor libs -->
<!-- chart specific js -->

@ -4,11 +4,11 @@
<Require feature="dynamic-height"/>
<Require feature="wso2-gadgets-identity"/>
</ModulePrefs>
<UserPref name="windowSize"
display_name="Window Size"
default_value="10"/>
<Content type="html">
<![CDATA[
<head>
@ -37,11 +37,11 @@
<script src="/portal/libs/analytics-wso2-2.0.0/vega.js"></script>
<script src="/portal/libs/analytics-wso2-2.0.0/VizGrammar.min.js"></script>
<script src="/portal/libs/analytics-wso2-2.0.0/VizGrammar_2.js"></script>
<script src="/portal/libs/analytics-wso2-2.0.0/wso2gadgets.js"></script>
<script src="/portal/libs/analytics-wso2-2.0.0/gadget-utils.js"></script>
<script src="/portal/libs/analytics-wso2-2.0.0/iot-gadget-utils.js"></script>
<script src="/portal/libs/analytics-wso2-2.0.0/chart-utils.js"></script>

@ -31,7 +31,7 @@
<script src="/portal/libs/analytics-wso2-2.0.0/vega.js"></script>
<script src="/portal/libs/analytics-wso2-2.0.0/VizGrammar.min.js"></script>
<script src="/portal/libs/analytics-wso2-2.0.0/VizGrammar_2.js"></script>
<script src="/portal/libs/analytics-wso2-2.0.0/wso2gadgets.js"></script>

@ -31,7 +31,7 @@
<script src="/portal/libs/analytics-wso2-2.0.0/vega.js"></script>
<script src="/portal/libs/analytics-wso2-2.0.0/VizGrammar.min.js"></script>
<script src="/portal/libs/analytics-wso2-2.0.0/VizGrammar_2.js"></script>
<script src="/portal/libs/analytics-wso2-2.0.0/wso2gadgets.js"></script>

@ -46,7 +46,7 @@
<!-- Include VizGrammar -->
<script src="../commons/js/d3.min.js"></script>
<script src="../commons/js/vega.js"></script>
<script src="../commons/js/VizGrammar.min.js"></script>
<script src="../commons/js/VizGrammar_2.js"></script>
<script src="/portal/extensions/themes/analytics/js/colorbrewer.js"></script>
<script src="/portal/extensions/themes/analytics/js/VizGrammarSettings.js"></script>

@ -16,9 +16,14 @@
* under the License.
*/
package org.wso2.carbon.device.mgt.iot.androidsense.service.impl;
import org.wso2.carbon.apimgt.annotations.api.API;
import io.swagger.annotations.SwaggerDefinition;
import io.swagger.annotations.Info;
import io.swagger.annotations.ExtensionProperty;
import io.swagger.annotations.Extension;
import io.swagger.annotations.Tag;
import org.wso2.carbon.apimgt.annotations.api.Scope;
import org.wso2.carbon.device.mgt.extensions.feature.mgt.annotations.DeviceType;
import org.wso2.carbon.device.mgt.extensions.feature.mgt.annotations.Feature;
@ -27,7 +32,21 @@ import javax.ws.rs.*;
import javax.ws.rs.core.Response;
@DeviceType(value = "android_sense")
@API(name = "android_sense", version = "1.0.0", context = "/android_sense", tags = {"android_sense"})
@SwaggerDefinition(
info = @Info(
version = "1.0.0",
title = "",
extensions = {
@Extension(properties = {
@ExtensionProperty(name = "name", value = "android_sense"),
@ExtensionProperty(name = "context", value = "/android_sense"),
})
}
),
tags = {
@Tag(name = "android_sense", description = "")
}
)
public interface AndroidSenseService {
/**

@ -18,7 +18,12 @@
package org.wso2.carbon.device.mgt.iot.arduino.service.impl;
import org.wso2.carbon.apimgt.annotations.api.API;
import io.swagger.annotations.SwaggerDefinition;
import io.swagger.annotations.Info;
import io.swagger.annotations.ExtensionProperty;
import io.swagger.annotations.Extension;
import io.swagger.annotations.Tag;
import org.wso2.carbon.apimgt.annotations.api.Scope;
import org.wso2.carbon.device.mgt.extensions.feature.mgt.annotations.DeviceType;
import org.wso2.carbon.device.mgt.extensions.feature.mgt.annotations.Feature;
@ -26,7 +31,21 @@ import org.wso2.carbon.device.mgt.extensions.feature.mgt.annotations.Feature;
import javax.ws.rs.*;
import javax.ws.rs.core.Response;
@API(name = "arduino", version = "1.0.0", context = "/arduino", tags = {"arduino"})
@SwaggerDefinition(
info = @Info(
version = "1.0.0",
title = "",
extensions = {
@Extension(properties = {
@ExtensionProperty(name = "name", value = "arduino"),
@ExtensionProperty(name = "context", value = "/arduino"),
})
}
),
tags = {
@Tag(name = "arduino", description = "")
}
)
@DeviceType(value = "arduino")
public interface ArduinoService {

@ -18,7 +18,11 @@
package org.wso2.carbon.device.mgt.iot.raspberrypi.service.impl;
import org.wso2.carbon.apimgt.annotations.api.API;
import io.swagger.annotations.SwaggerDefinition;
import io.swagger.annotations.Info;
import io.swagger.annotations.ExtensionProperty;
import io.swagger.annotations.Extension;
import io.swagger.annotations.Tag;
import org.wso2.carbon.apimgt.annotations.api.Scope;
import org.wso2.carbon.device.mgt.extensions.feature.mgt.annotations.DeviceType;
import org.wso2.carbon.device.mgt.extensions.feature.mgt.annotations.Feature;
@ -27,7 +31,21 @@ import javax.ws.rs.*;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
@API(name = "raspberrypi", version = "1.0.0", context = "/raspberrypi", tags = {"raspberrypi"})
@SwaggerDefinition(
info = @Info(
version = "1.0.0",
title = "",
extensions = {
@Extension(properties = {
@ExtensionProperty(name = "name", value = "raspberrypi"),
@ExtensionProperty(name = "context", value = "/raspberrypi"),
})
}
),
tags = {
@Tag(name = "raspberrypi", description = "")
}
)
@DeviceType(value = "raspberrypi")
public interface RaspberryPiService {

@ -18,7 +18,11 @@
package org.wso2.carbon.device.mgt.iot.virtualfirealarm.service.impl;
import org.wso2.carbon.apimgt.annotations.api.API;
import io.swagger.annotations.SwaggerDefinition;
import io.swagger.annotations.Info;
import io.swagger.annotations.ExtensionProperty;
import io.swagger.annotations.Extension;
import io.swagger.annotations.Tag;
import org.wso2.carbon.apimgt.annotations.api.Scope;
import org.wso2.carbon.device.mgt.extensions.feature.mgt.annotations.DeviceType;
import org.wso2.carbon.device.mgt.extensions.feature.mgt.annotations.Feature;
@ -33,7 +37,21 @@ import javax.ws.rs.core.Response;
* the transport 'Connectors' [XMPP & MQTT] specific to the VirtualFirealarm device-type in order to communicate with
* such devices and to receive messages form it.
*/
@API(name = "virtual_firealarm", version = "1.0.0", context = "/virtual_firealarm", tags = {"virtual_firealarm"})
@SwaggerDefinition(
info = @Info(
version = "1.0.0",
title = "",
extensions = {
@Extension(properties = {
@ExtensionProperty(name = "name", value = "virtual_firealarm"),
@ExtensionProperty(name = "context", value = "/virtual_firealarm"),
})
}
),
tags = {
@Tag(name = "virtual_firealarm", description = "")
}
)
@DeviceType(value = "virtual_firealarm")
public interface VirtualFireAlarmService {

@ -18,10 +18,19 @@
*/
package org.wso2.carbon.mdm.services.android.services;
import io.swagger.annotations.*;
import org.wso2.carbon.apimgt.annotations.api.API;
import org.wso2.carbon.apimgt.annotations.api.Permission;
import org.wso2.carbon.apimgt.annotations.api.Scope;
import io.swagger.annotations.SwaggerDefinition;
import io.swagger.annotations.Info;
import io.swagger.annotations.ExtensionProperty;
import io.swagger.annotations.Extension;
import io.swagger.annotations.Tag;
import io.swagger.annotations.Api;
import io.swagger.annotations.AuthorizationScope;
import io.swagger.annotations.Authorization;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import io.swagger.annotations.ResponseHeader;
import org.wso2.carbon.device.mgt.common.operation.mgt.Activity;
import org.wso2.carbon.mdm.services.android.bean.wrapper.*;
@ -34,10 +43,23 @@ import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import java.util.List;
@API(name = "Android Device Management Administrative Service", version = "1.0.0",
context = "/api/device-mgt/android/v1.0/admin/devices",
tags = {"devicemgt_android"})
@SwaggerDefinition(
info = @Info(
version = "1.0.0",
title = "",
extensions = {
@Extension(properties = {
@ExtensionProperty(name = "name",
value = "Android Device Management Administrative Service"),
@ExtensionProperty(name = "context",
value = "/api/device-mgt/android/v1.0/admin/devices"),
})
}
),
tags = {
@Tag(name = "devicemgt_android", description = "")
}
)
@Path("/admin/devices")
@Api(value = "Android Device Management Administrative Service", description = "Device management related admin APIs.")
@Produces(MediaType.APPLICATION_JSON)
@ -53,7 +75,15 @@ public interface DeviceManagementAdminService {
notes = "Using this API you have the option of hard locking an Android device, where the Administrator " +
"permanently locks the device or screen locking an Android device.",
response = Activity.class,
tags = "Android Device Management Administrative Service"
tags = "Android Device Management Administrative Service",
authorizations = {
@Authorization(
value="permission",
scopes = { @AuthorizationScope(
scope = "/device-mgt/devices/owning-device/operations/android/lock",
description = "Lock Device") }
)
}
)
@ApiResponses(value = {
@ApiResponse(
@ -93,7 +123,6 @@ public interface DeviceManagementAdminService {
message = "Internal Server Error. \n " +
"Server error occurred while locking the device.")
})
@Permission(name = "Lock Device", permission = "/device-mgt/devices/owning-device/operations/android/lock")
Response configureDeviceLock(
@ApiParam(
name = "deviceLock",
@ -112,7 +141,16 @@ public interface DeviceManagementAdminService {
responseContainer = "List",
notes = "Unlock devices that were locked permanently using the hard lock operation. Devices that are hard locked can only be unlocked by the EMM administrator.",
response = Activity.class,
tags = "Android Device Management Administrative Service")
tags = "Android Device Management Administrative Service",
authorizations = {
@Authorization(
value="permission",
scopes = { @AuthorizationScope(
scope = "/device-mgt/devices/owning-device/operations/android/unlock",
description = "Unlock Device") }
)
}
)
@ApiResponses(value = {
@ApiResponse(
code = 201,
@ -151,7 +189,6 @@ public interface DeviceManagementAdminService {
message = "Internal Server Error. \n " +
"Server error occurred while unlocking the device.")
})
@Permission(name = "Unlock Device", permission = "/device-mgt/devices/owning-device/operations/android/unlock")
Response configureDeviceUnlock(
@ApiParam(
name = "deviceIDs",
@ -170,7 +207,16 @@ public interface DeviceManagementAdminService {
notes = "Request location coordinates of Android devices. \n" +
"Example: In situations where you have lost your device and need to find out where it is, you can use this REST API to get the location of the device.",
response = Activity.class,
tags = "Android Device Management Administrative Service")
tags = "Android Device Management Administrative Service",
authorizations = {
@Authorization(
value="permission",
scopes = { @AuthorizationScope(
scope = "/device-mgt/devices/owning-device/operations/android/location",
description = "Get Device Location") }
)
}
)
@ApiResponses(value = {
@ApiResponse(
code = 201,
@ -208,7 +254,6 @@ public interface DeviceManagementAdminService {
code = 500,
message = "Internal Server Error. \n " +
"Server error occurred while adding a new get-location operation.")})
@Permission(name = "Get Device Location", permission = "/device-mgt/devices/owning-device/operations/android/location")
Response getDeviceLocation(
@ApiParam(
name = "deviceIDs",
@ -224,7 +269,15 @@ public interface DeviceManagementAdminService {
value = "Clearing the Password on Android Devices",
notes = "Clear the password on Android devices",
response = Activity.class,
tags = "Android Device Management Administrative Service."
tags = "Android Device Management Administrative Service.",
authorizations = {
@Authorization(
value="permission",
scopes = { @AuthorizationScope(
scope = "/device-mgt/devices/owning-device/operations/android/clear-password",
description = "Clear Password of Device") }
)
}
)
@ApiResponses(value = {
@ApiResponse(
@ -264,7 +317,6 @@ public interface DeviceManagementAdminService {
message = "Internal Server Error. \n " +
"Server error occurred while adding a new clear password operation.")
})
@Permission(name = "Clear Password of Device", permission = "/device-mgt/devices/owning-device/operations/android/clear-password")
Response removePassword(
@ApiParam(name = "deviceIDs",
value = "Provide the ID of the Android device. Multiple device IDs can be added by using comma separated values. ",
@ -278,7 +330,13 @@ public interface DeviceManagementAdminService {
value = "Enabling or Disabling the Camera on Android Devices",
notes = "Enable or disable the camera on Android devices.",
response = Activity.class,
tags = "Android Device Management Administrative Service"
tags = "Android Device Management Administrative Service",
authorizations = {
@Authorization(
value="permission",
scopes = { @AuthorizationScope(scope = "/device-mgt/devices/owning-device/operations/android/camera", description = "Manage Camera") }
)
}
)
@ApiResponses(value = {
@ApiResponse(
@ -318,7 +376,6 @@ public interface DeviceManagementAdminService {
message = "Internal Server Error. \n " +
"Server error occurred while adding the new camera control operation.")
})
@Permission(name = "Manage Camera", permission = "/device-mgt/devices/owning-device/operations/android/camera")
Response configureCamera(
@ApiParam(
name = "cameraControl",
@ -340,7 +397,15 @@ public interface DeviceManagementAdminService {
" executed it will be in the Android operation queue until the device calls the server to retrieve " +
"the list of operations that needs to be executed on the device",
response = Activity.class,
tags = "Android Device Management Administrative Service"
tags = "Android Device Management Administrative Service",
authorizations = {
@Authorization(
value="permission",
scopes = { @AuthorizationScope(
scope = "/device-mgt/devices/owning-device/operations/android/info",
description = "Get Device Information") }
)
}
)
@ApiResponses(value = {
@ApiResponse(
@ -380,7 +445,6 @@ public interface DeviceManagementAdminService {
message = "Internal Server Error. \n " +
"Server error occurred while adding a new device info operation.")
})
@Permission(name = "Get Device Information", permission = "/device-mgt/devices/owning-device/operations/android/info")
Response getDeviceInformation(
@ApiParam(
name = "deviceIds",
@ -399,7 +463,15 @@ public interface DeviceManagementAdminService {
" executed it will be in the Android operation queue until the device calls the server to retrieve " +
"the list of operations that needs to be executed on the device.",
response = Activity.class,
tags = "Android Device Management Administrative Service"
tags = "Android Device Management Administrative Service",
authorizations = {
@Authorization(
value="permission",
scopes = { @AuthorizationScope(
scope = "/device-mgt/devices/owning-device/operations/android/logcat",
description = "Get Logs") }
)
}
)
@ApiResponses(value = {
@ApiResponse(
@ -439,7 +511,6 @@ public interface DeviceManagementAdminService {
message = "Internal Server Error. \n " +
"Server error occurred while adding a new device logcat operation.")
})
@Permission(name = "Get Logs", permission = "/device-mgt/devices/owning-device/operations/android/logcat")
Response getDeviceLogcat(
@ApiParam(
name = "deviceIds",
@ -457,7 +528,15 @@ public interface DeviceManagementAdminService {
notes = "Enterprise wipe is the process of deleting enterprise related data on a device while keeping the " +
"personal data intact. You are able to enterprise wipe Android devices using this REST API.",
response = Activity.class,
tags = "Android Device Management Administrative Service"
tags = "Android Device Management Administrative Service",
authorizations = {
@Authorization(
value="permission",
scopes = { @AuthorizationScope(
scope = "/device-mgt/devices/owning-device/operations/android/enterprise-wipe",
description = "Enterprise Wipe") }
)
}
)
@ApiResponses(value = {
@ApiResponse(
@ -496,7 +575,6 @@ public interface DeviceManagementAdminService {
code = 500,
message = "Internal Server Error. \n " +
"Server error occurred while adding the enterprise wipe operation.")})
@Permission(name = "Enterprise Wipe", permission = "/device-mgt/devices/owning-device/operations/android/enterprise-wipe")
Response wipeDevice(
@ApiParam(
name = "deviceIDs",
@ -513,7 +591,15 @@ public interface DeviceManagementAdminService {
notes = "Factory rest or erase all the data stored on the Android devices " +
"to restore them back to the original system.",
response = Activity.class,
tags = "Android Device Management Administrative Service"
tags = "Android Device Management Administrative Service",
authorizations = {
@Authorization(
value="permission",
scopes = { @AuthorizationScope(
scope = "/device-mgt/devices/owning-device/operations/android/wipe",
description = "Factory Reset") }
)
}
)
@ApiResponses(value = {
@ApiResponse(
@ -552,7 +638,6 @@ public interface DeviceManagementAdminService {
code = 500,
message = "Internal Server Error. \n " +
"Server error occurred while adding the device wipe operation.")})
@Permission(name = "Factory Reset", permission = "/device-mgt/devices/owning-device/operations/android/wipe")
Response wipeData(
@ApiParam(
name = "wipeData",
@ -573,7 +658,15 @@ public interface DeviceManagementAdminService {
"until the device calls the server to retrieve the list of operations that needs to be executed " +
"on the device.",
response = Activity.class,
tags = "Android Device Management Administrative Service"
tags = "Android Device Management Administrative Service",
authorizations = {
@Authorization(
value="permission",
scopes = { @AuthorizationScope(
scope = "/device-mgt/devices/owning-device/operations/android/applications",
description = "Get Installed Application") }
)
}
)
@ApiResponses(value = {
@ApiResponse(
@ -613,7 +706,6 @@ public interface DeviceManagementAdminService {
message = "Internal Server Error. \n " +
"Server error occurred while adding the new get-applications operation.")
})
@Permission(name = "Get Installed Application", permission = "/device-mgt/devices/owning-device/operations/android/applications")
Response getApplications(
@ApiParam(
name = "deviceIDs",
@ -629,7 +721,15 @@ public interface DeviceManagementAdminService {
value = "Ringing Android Devices",
notes = "Ring Android devices.",
response = Activity.class,
tags = "Android Device Management Administrative Service"
tags = "Android Device Management Administrative Service",
authorizations = {
@Authorization(
value="permission",
scopes = { @AuthorizationScope(
scope = "/device-mgt/devices/owning-device/operations/android/ring",
description = "Ring Device") }
)
}
)
@ApiResponses(value = {
@ApiResponse(
@ -669,7 +769,6 @@ public interface DeviceManagementAdminService {
message = "Internal Server Error. \n " +
"Server error occurred while adding a new device ring operation.")
})
@Permission(name = "Ring Device", permission = "/device-mgt/devices/owning-device/operations/android/ring")
Response ringDevice(
@ApiParam(
name = "deviceIDs",
@ -685,7 +784,15 @@ public interface DeviceManagementAdminService {
value = "Rebooting Android Devices",
notes = "Reboot or restart your Android devices.",
response = Activity.class,
tags = "Android Device Management Administrative Service"
tags = "Android Device Management Administrative Service",
authorizations = {
@Authorization(
value="permission",
scopes = { @AuthorizationScope(
scope = "/device-mgt/devices/owning-device/operations/android/reboot",
description = "Reboot Device") }
)
}
)
@ApiResponses(value = {
@ApiResponse(
@ -725,7 +832,6 @@ public interface DeviceManagementAdminService {
message = "Internal Server Error. \n " +
"Server error occurred while adding the new device reboot operation.")
})
@Permission(name = "Reboot Device", permission = "/device-mgt/devices/owning-device/operations/android/reboot")
Response rebootDevice(
@ApiParam(
name = "deviceIDs",
@ -740,7 +846,15 @@ public interface DeviceManagementAdminService {
value = "Muting Android Devices",
notes = "Mute or enable a silent profile for Android devices.",
response = Activity.class,
tags = "Android Device Management Administrative Service"
tags = "Android Device Management Administrative Service",
authorizations = {
@Authorization(
value="permission",
scopes = { @AuthorizationScope(
scope = "/device-mgt/devices/owning-device/operations/android/mute",
description = "Mute Device") }
)
}
)
@ApiResponses(value = {
@ApiResponse(
@ -781,7 +895,6 @@ public interface DeviceManagementAdminService {
"Server error occurred while adding a new device mute operation.")
})
@Path("/mute")
@Permission(name = "Mute Device", permission = "/device-mgt/devices/owning-device/operations/android/mute")
Response muteDevice(
@ApiParam(
name = "deviceIDs",
@ -799,7 +912,15 @@ public interface DeviceManagementAdminService {
notes = "Install an application on an Android device. If the device you are installing the application has the WSO2 system service application installed," +
" the application installation will happen in silent mode, else the device user's consent will be required.",
response = Activity.class,
tags = "Android Device Management Administrative Service"
tags = "Android Device Management Administrative Service",
authorizations = {
@Authorization(
value="permission",
scopes = { @AuthorizationScope(
scope = "/device-mgt/devices/owning-device/operations/android/install-app",
description = "Install Applications") }
)
}
)
@ApiResponses(value = {
@ApiResponse(
@ -839,7 +960,6 @@ public interface DeviceManagementAdminService {
message = "Internal Server Error. \n " +
"Server error occurred while adding a new install-application operation.")
})
@Permission(name = "Install Applications", permission = "/device-mgt/devices/owning-device/operations/android/install-app")
Response installApplication(
@ApiParam(
name = "applicationInstallation",
@ -860,7 +980,15 @@ public interface DeviceManagementAdminService {
" has the WSO2 system service application installed, the application update will happen in silent " +
"mode, else the device user's consent is required.",
response = Activity.class,
tags = "Android Device Management Administrative Service"
tags = "Android Device Management Administrative Service",
authorizations = {
@Authorization(
value="permission",
scopes = { @AuthorizationScope(
scope = "/device-mgt/devices/owning-device/operations/android/update-app",
description = "Update installed applications") }
)
}
)
@ApiResponses(value = {
@ApiResponse(
@ -900,7 +1028,6 @@ public interface DeviceManagementAdminService {
message = "Internal Server Error. \n " +
"Server error occurred while adding the new update-application operation.")
})
@Permission(name = "Update installed applications", permission = "/device-mgt/devices/owning-device/operations/android/update-app")
Response updateApplication(
@ApiParam(
name = "applicationUpdate",
@ -918,7 +1045,15 @@ public interface DeviceManagementAdminService {
value = "Uninstalling an Application from Android Devices",
notes = "Uninstall an application from Android devices.",
response = Activity.class,
tags = "Android Device Management Administrative Service"
tags = "Android Device Management Administrative Service",
authorizations = {
@Authorization(
value="permission",
scopes = { @AuthorizationScope(
scope = "/device-mgt/devices/owning-device/operations/android/uninstall-app",
description = "Uninstall Applications") }
)
}
)
@ApiResponses(value = {
@ApiResponse(
@ -958,7 +1093,6 @@ public interface DeviceManagementAdminService {
message = "Internal Server Error. \n " +
"Server error occurred while adding a new uninstall-application operation.")
})
@Permission(name = "Uninstall Applications", permission = "/device-mgt/devices/owning-device/operations/android/uninstall-app")
Response uninstallApplication(
@ApiParam(
name = "applicationUninstallation",
@ -980,7 +1114,15 @@ public interface DeviceManagementAdminService {
" Android operating systems and after, the blacklisted apps will be hidden. Blacklisting can be used on both BYOD and " +
"COPE devices. Applications can be blacklisted via the application restriction policy too.",
response = Activity.class,
tags = "Android Device Management Administrative Service"
tags = "Android Device Management Administrative Service",
authorizations = {
@Authorization(
value="permission",
scopes = { @AuthorizationScope(
scope = "/device-mgt/devices/owning-device/operations/android/blacklist-app",
description = "Blacklist Applications") }
)
}
)
@ApiResponses(value = {
@ApiResponse(
@ -1020,7 +1162,6 @@ public interface DeviceManagementAdminService {
message = "Internal Server Error. \n " +
"Server error occurred while adding the new blacklist-applications operation.")
})
@Permission(name = "Blacklist Applications", permission = "/device-mgt/devices/owning-device/operations/android/blacklist-app")
Response blacklistApplications(
@ApiParam(
name = "blacklistApplications",
@ -1038,7 +1179,15 @@ public interface DeviceManagementAdminService {
value = "UUpgrading Firmware of Android Devices",
notes = "Upgrade the firmware of Android devices.",
response = Activity.class,
tags = "Android Device Management Administrative Service"
tags = "Android Device Management Administrative Service",
authorizations = {
@Authorization(
value="permission",
scopes = { @AuthorizationScope(
scope = "/device-mgt/devices/owning-device/operations/android/upgrade",
description = "Upgrade Firmware") }
)
}
)
@ApiResponses(value = {
@ApiResponse(
@ -1078,7 +1227,6 @@ public interface DeviceManagementAdminService {
message = "Internal Server Error. \n " +
"Server error occurred while adding a new upgrade firmware operation.")
})
@Permission(name = "Upgrade Firmware", permission = "/device-mgt/devices/owning-device/operations/android/upgrade")
Response upgradeFirmware(
@ApiParam(
name = "upgradeFirmware",
@ -1098,7 +1246,15 @@ public interface DeviceManagementAdminService {
value = "Configuring VPN on Android devices",
notes = "Configure VPN on Android devices.",
response = Activity.class,
tags = "Android Device Management Administrative Service"
tags = "Android Device Management Administrative Service",
authorizations = {
@Authorization(
value="permission",
scopes = { @AuthorizationScope(
scope = "/device-mgt/devices/owning-device/operations/android/vpn",
description = "Add VPN") }
)
}
)
@ApiResponses(value = {
@ApiResponse(
@ -1138,7 +1294,6 @@ public interface DeviceManagementAdminService {
message = "Internal Server Error. \n " +
"Server error occurred while configuring the VPN.")
})
@Permission(name = "Add VPN", permission = "/device-mgt/devices/owning-device/operations/android/vpn")
Response configureVPN(
@ApiParam(
name = "vpnBean",
@ -1154,7 +1309,15 @@ public interface DeviceManagementAdminService {
value = "Sending a Notification to Android Devices",
notes = "Send a notification or message to Android devices.",
response = Activity.class,
tags = "Android Device Management Administrative Service"
tags = "Android Device Management Administrative Service",
authorizations = {
@Authorization(
value="permission",
scopes = { @AuthorizationScope(
scope = "/device-mgt/devices/owning-device/operations/android/send-notification",
description = "Send Notifications") }
)
}
)
@ApiResponses(value = {
@ApiResponse(
@ -1194,7 +1357,6 @@ public interface DeviceManagementAdminService {
message = "Internal Server Error. \n " +
"Server error occurred while adding a new send notification operation.")
})
@Permission(name = "Send Notifications", permission = "/device-mgt/devices/owning-device/operations/android/send-notification")
Response sendNotification(
@ApiParam(
name = "notification",
@ -1211,7 +1373,15 @@ public interface DeviceManagementAdminService {
value = "Configuring Wi-Fi on Android Devices",
notes = "Configure Wi-Fi on Android devices.",
response = Activity.class,
tags = "Android Device Management Administrative Service"
tags = "Android Device Management Administrative Service",
authorizations = {
@Authorization(
value="permission",
scopes = { @AuthorizationScope(
scope = "/device-mgt/devices/owning-device/operations/android/wifi",
description = "Add Wifi Configuration") }
)
}
)
@ApiResponses(value = {
@ApiResponse(
@ -1251,7 +1421,6 @@ public interface DeviceManagementAdminService {
message = "Internal Server Error. \n " +
"Server error occurred while configuring Wi-Fi.")
})
@Permission(name = "Add Wifi Configuration", permission = "/device-mgt/devices/owning-device/operations/android/wifi")
Response configureWifi(
@ApiParam(
name = "wifi",
@ -1269,7 +1438,15 @@ public interface DeviceManagementAdminService {
value = "Encrypting Storage on Android Devices",
notes = "Encrypt the data stored on Android devices.",
response = Activity.class,
tags = "Android Device Management Administrative Service"
tags = "Android Device Management Administrative Service",
authorizations = {
@Authorization(
value="permission",
scopes = { @AuthorizationScope(
scope = "/device-mgt/devices/owning-device/operations/android/encrypt",
description = "Encrypt Device") }
)
}
)
@ApiResponses(value = {
@ApiResponse(
@ -1309,7 +1486,6 @@ public interface DeviceManagementAdminService {
message = "Internal Server Error. \n " +
"Server error occurred while adding a new encrypt storage operation.")
})
@Permission(name = "Encrypt Device", permission = "/device-mgt/devices/owning-device/operations/android/encrypt")
Response encryptStorage(
@ApiParam(
name = "encryption",
@ -1327,7 +1503,15 @@ public interface DeviceManagementAdminService {
value = "Changing the Lock Code on Android Devices",
notes = "Change the lock code on Android devices.",
response = Activity.class,
tags = "Android Device Management Administrative Service"
tags = "Android Device Management Administrative Service",
authorizations = {
@Authorization(
value="permission",
scopes = { @AuthorizationScope(
scope = "/device-mgt/devices/owning-device/operations/android/change-lock-code",
description = "Change Password of Device") }
)
}
)
@ApiResponses(value = {
@ApiResponse(
@ -1367,7 +1551,6 @@ public interface DeviceManagementAdminService {
message = "Internal Server Error. \n " +
"Server error occurred while adding a new change lock code operation.")
})
@Permission(name = "Change Password of Device", permission = "/device-mgt/devices/owning-device/operations/android/change-lock-code")
Response changeLockCode(
@ApiParam(
name = "lockCode",
@ -1385,7 +1568,15 @@ public interface DeviceManagementAdminService {
value = "Setting a Password Policy on Android Devices",
notes = "Set a password policy on Android devices.",
response = Activity.class,
tags = "Android Device Management Administrative Service"
tags = "Android Device Management Administrative Service",
authorizations = {
@Authorization(
value="permission",
scopes = { @AuthorizationScope(
scope = "/device-mgt/devices/owning-device/operations/android/password-policy",
description = "Set Password Policy") }
)
}
)
@ApiResponses(value = {
@ApiResponse(
@ -1425,7 +1616,6 @@ public interface DeviceManagementAdminService {
message = "Internal Server Error. \n " +
"Server error occurred while adding a new set password policy operation.")
})
@Permission(name = "Set Password Policy", permission = "/device-mgt/devices/owning-device/operations/android/password-policy")
Response setPasswordPolicy(
@ApiParam(
name = "passwordPolicy",
@ -1441,7 +1631,15 @@ public interface DeviceManagementAdminService {
value = "Setting a Web Clip on Android Devices",
notes = "Set a web clip on Android devices. A web clip is used to add a bookmark to a web application.",
response = Activity.class,
tags = "Android Device Management Administrative Service"
tags = "Android Device Management Administrative Service",
authorizations = {
@Authorization(
value="permission",
scopes = { @AuthorizationScope(
scope = "/device-mgt/devices/owning-device/operations/android/webclip",
description = "Add Webclips") }
)
}
)
@ApiResponses(value = {
@ApiResponse(
@ -1481,7 +1679,6 @@ public interface DeviceManagementAdminService {
message = "Internal Server Error. \n " +
"Server error occurred while adding adding a the set web clip operation.")
})
@Permission(name = "Add Webclips", permission = "/device-mgt/devices/owning-device/operations/android/webclip")
Response setWebClip(
@ApiParam(
name = "webClip",

@ -18,9 +18,20 @@
*/
package org.wso2.carbon.mdm.services.android.services;
import io.swagger.annotations.*;
import org.wso2.carbon.apimgt.annotations.api.API;
import org.wso2.carbon.apimgt.annotations.api.Permission;
import io.swagger.annotations.SwaggerDefinition;
import io.swagger.annotations.Info;
import io.swagger.annotations.ExtensionProperty;
import io.swagger.annotations.Extension;
import io.swagger.annotations.Tag;
import io.swagger.annotations.Api;
import io.swagger.annotations.AuthorizationScope;
import io.swagger.annotations.Authorization;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import io.swagger.annotations.ResponseHeader;
import org.wso2.carbon.device.mgt.common.operation.mgt.Operation;
import org.wso2.carbon.mdm.services.android.bean.wrapper.AndroidApplication;
import org.wso2.carbon.mdm.services.android.bean.wrapper.AndroidDevice;
@ -34,10 +45,21 @@ import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import java.util.List;
@API(name = "Android Device Management", version = "1.0.0",
context = "/api/device-mgt/android/v1.0/devices",
tags = {"devicemgt_android"})
@SwaggerDefinition(
info = @Info(
version = "1.0.0",
title = "",
extensions = {
@Extension(properties = {
@ExtensionProperty(name = "name", value = "Android Device Management"),
@ExtensionProperty(name = "context", value = "/api/device-mgt/android/v1.0/devices"),
})
}
),
tags = {
@Tag(name = "devicemgt_android", description = "")
}
)
@Api(value = "Android Device Management",
description = "This carries all the resources related to the Android device management functionalities.")
@Path("/devices")
@ -53,7 +75,14 @@ public interface DeviceManagementService {
httpMethod = "PUT",
value = "Updating the Application Details on Android Devices",
notes = "Update the details of the applications that are installed on Android devices.",
tags = "Android Device Management"
tags = "Android Device Management",
authorizations = {
@Authorization(
value="permission",
scopes = { @AuthorizationScope(scope = "/device-mgt/devices/enroll/android",
description = "Enroll Device") }
)
}
)
@ApiResponses(value = {
@ApiResponse(
@ -88,7 +117,6 @@ public interface DeviceManagementService {
message = "Internal Server Error. \n " +
"Server error occurred while updating the application list.")
})
@Permission(name = "Enroll Device", permission = "/device-mgt/devices/enroll/android")
Response updateApplicationList(
@ApiParam(
name = "id",
@ -114,7 +142,15 @@ public interface DeviceManagementService {
" While getting the pending operations the details of the operations executed at the device end is shared with the server. " +
"The server then updates the status of the operations that were carried out on the device.",
response = Operation.class,
tags = "Android Device Management")
tags = "Android Device Management",
authorizations = {
@Authorization(
value="permission",
scopes = { @AuthorizationScope(scope = "/device-mgt/devices/enroll/android",
description = "Enroll Device") }
)
}
)
@ApiResponses(value = {
@ApiResponse(
code = 200,
@ -144,7 +180,6 @@ public interface DeviceManagementService {
code = 500,
message = "Internal Server Error. \n Server error occurred while fetching the list of pending operations.")
})
@Permission(name = "Enroll Device", permission = "/device-mgt/devices/enroll/android")
Response getPendingOperations(
@ApiParam(
name = "id",
@ -173,7 +208,14 @@ public interface DeviceManagementService {
" the Android Agent on the device, before being able to register the device with WSO2 EMM. Instead," +
" you can use this REST API to register an Android device with WSO2 EMM, without having to install" +
" an Android Agent. This API can be mainly used to test the device enrollment process.",
tags = "Android Device Management"
tags = "Android Device Management",
authorizations = {
@Authorization(
value="permission",
scopes = { @AuthorizationScope(scope = "/device-mgt/devices/enroll/android",
description = "Enroll Device") }
)
}
)
@ApiResponses(value = {
@ApiResponse(
@ -212,7 +254,6 @@ public interface DeviceManagementService {
message = "Internal Server Error. \n " +
"Server error occurred while adding a new device.")
})
@Permission(name = "Enroll Device", permission = "/device-mgt/devices/enroll/android")
Response enrollDevice(@ApiParam(
name = "device",
value = "The properties required to enroll a device.")
@ -224,7 +265,14 @@ public interface DeviceManagementService {
httpMethod = "GET",
value = "Getting the Registration Status of an Android Device",
notes = "Use this REST API to retrieve the registration status of an Android device.",
tags = "Android Device Management"
tags = "Android Device Management",
authorizations = {
@Authorization(
value="permission",
scopes = { @AuthorizationScope(scope = "/device-mgt/devices/enroll/android",
description = "Enroll Device") }
)
}
)
@ApiResponses(value = {
@ApiResponse(
@ -253,7 +301,6 @@ public interface DeviceManagementService {
code = 500,
message = "Internal Server Error. \n Server error occurred while fetching the enrollment status of the Android device.")
})
@Permission(name = "Enroll Device", permission = "/device-mgt/devices/enroll/android")
Response isEnrolled(
@ApiParam(
name = "id",
@ -273,7 +320,14 @@ public interface DeviceManagementService {
httpMethod = "PUT",
value = "Updating the Registration Details of an Android Device",
notes = "Use this REST API to update the registration details of an Android device.",
tags = "Android Device Management"
tags = "Android Device Management",
authorizations = {
@Authorization(
value="permission",
scopes = { @AuthorizationScope(scope = "/device-mgt/devices/enroll/android",
description = "Enroll Device") }
)
}
)
@ApiResponses(
value = {
@ -309,7 +363,6 @@ public interface DeviceManagementService {
message = "Internal Server Error. \n " +
"Server error occurred while updating the device enrollment.")
})
@Permission(name = "Enroll Device", permission = "/device-mgt/devices/enroll/android")
Response modifyEnrollment(
@ApiParam(
name = "id",
@ -325,7 +378,13 @@ public interface DeviceManagementService {
httpMethod = "DELETE",
value = "Unregistering an Android Device",
notes = "Use this REST API to unregister an Android device.",
tags = "Android Device Management"
tags = "Android Device Management",
authorizations = {
@Authorization(
value="permission",
scopes = { @AuthorizationScope(scope = "/device-mgt/devices/disenroll/android", description = "Disenroll Device") }
)
}
)
@ApiResponses(value = {
@ApiResponse(
@ -339,7 +398,6 @@ public interface DeviceManagementService {
message = "Internal Server Error. \n " +
"Server error occurred while dis-enrolling the device.")
})
@Permission(name = "Disenroll Device", permission = "/device-mgt/devices/disenroll/android")
Response disEnrollDevice(
@ApiParam(
name = "id",

@ -18,9 +18,19 @@
*/
package org.wso2.carbon.mdm.services.android.services;
import io.swagger.annotations.*;
import org.wso2.carbon.apimgt.annotations.api.API;
import org.wso2.carbon.apimgt.annotations.api.Permission;
import io.swagger.annotations.SwaggerDefinition;
import io.swagger.annotations.Info;
import io.swagger.annotations.ExtensionProperty;
import io.swagger.annotations.Extension;
import io.swagger.annotations.Tag;
import io.swagger.annotations.Api;
import io.swagger.annotations.AuthorizationScope;
import io.swagger.annotations.Authorization;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import io.swagger.annotations.ResponseHeader;
import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration;
import org.wso2.carbon.mdm.services.android.bean.AndroidPlatformConfiguration;
import org.wso2.carbon.mdm.services.android.exception.AndroidAgentException;
@ -30,10 +40,23 @@ import javax.ws.rs.*;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
@API(name = "Android Configuration Management", version = "1.0.0",
context = "/api/device-mgt/android/v1.0/configuration",
tags = {"devicemgt_android"})
@SwaggerDefinition(
info = @Info(
version = "1.0.0",
title = "",
extensions = {
@Extension(properties = {
@ExtensionProperty(name = "name",
value = "Android Configuration Management"),
@ExtensionProperty(name = "context",
value = "/api/device-mgt/android/v1.0/configuration"),
})
}
),
tags = {
@Tag(name = "devicemgt_android", description = "")
}
)
@Api(value = "Android Configuration Management", description = "This API carries all the resource used to mange the Android platform configurations.")
@Path("/configuration")
@Produces(MediaType.APPLICATION_JSON)
@ -47,7 +70,14 @@ public interface DeviceTypeConfigurationService {
value = "Getting Android Platform Configurations",
notes = "Get the Android platform configuration details using this REST API.",
response = PlatformConfiguration.class,
tags = "Android Configuration Management"
tags = "Android Configuration Management",
authorizations = {
@Authorization(
value="permission",
scopes = { @AuthorizationScope(scope = "/device-mgt/platform-configurations/view",
description = "View Configurations") }
)
}
)
@ApiResponses(value = {
@ApiResponse(
@ -80,7 +110,6 @@ public interface DeviceTypeConfigurationService {
code = 500,
message = "Internal Server Error. \n Server error occurred while fetching the Android platform configuration.")
})
@Permission(name = "View Configurations", permission = "/device-mgt/platform-configurations/view")
Response getConfiguration(
@ApiParam(
name = "If-Modified-Since",
@ -97,7 +126,14 @@ public interface DeviceTypeConfigurationService {
httpMethod = "PUT",
value = "Updating Android Platform Configurations",
notes = "Update the Android platform configurations using this REST API.",
tags = "Android Configuration Management"
tags = "Android Configuration Management",
authorizations = {
@Authorization(
value="permission",
scopes = { @AuthorizationScope(scope = "/device-mgt/platform-configurations/manage",
description = "Manage Configurations") }
)
}
)
@ApiResponses(value = {
@ApiResponse(
@ -132,7 +168,6 @@ public interface DeviceTypeConfigurationService {
message = "Internal Server Error. \n " +
"Server error occurred while modifying the Android platform configuration.")
})
@Permission(name = "Manage Configurations", permission = "/device-mgt/platform-configurations/manage")
Response updateConfiguration(
@ApiParam(name = "configuration",
value = "The properties to update the Android platform configurations.")
@ -148,7 +183,15 @@ public interface DeviceTypeConfigurationService {
notes = "Use this REST API to retrieve the license agreement that is used for the Android device " +
"registration process.",
response = String.class,
tags = "Android Configuration Management")
tags = "Android Configuration Management",
authorizations = {
@Authorization(
value="permission",
scopes = { @AuthorizationScope(scope = "/device-mgt/devices/enroll/android",
description = "Enroll Device") }
)
}
)
@ApiResponses(value = {
@ApiResponse(
code = 200,
@ -180,7 +223,6 @@ public interface DeviceTypeConfigurationService {
code = 500,
message = "Internal Server Error. \n Server error occurred while fetching the Android license configuration.")
})
@Permission(name = "Enroll Device", permission = "/device-mgt/devices/enroll/android")
Response getLicense(
@ApiParam(
name = "If-Modified-Since",

@ -18,10 +18,19 @@
*/
package org.wso2.carbon.mdm.services.android.services;
import io.swagger.annotations.*;
import org.wso2.carbon.apimgt.annotations.api.API;
import org.wso2.carbon.apimgt.annotations.api.Permission;
import org.wso2.carbon.apimgt.annotations.api.Scope;
import io.swagger.annotations.SwaggerDefinition;
import io.swagger.annotations.Info;
import io.swagger.annotations.ExtensionProperty;
import io.swagger.annotations.Extension;
import io.swagger.annotations.Tag;
import io.swagger.annotations.Api;
import io.swagger.annotations.AuthorizationScope;
import io.swagger.annotations.Authorization;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import io.swagger.annotations.ResponseHeader;
import org.wso2.carbon.mdm.services.android.bean.DeviceState;
import org.wso2.carbon.mdm.services.android.bean.wrapper.EventBeanWrapper;
@ -31,10 +40,21 @@ import javax.ws.rs.*;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
@API(name = "Android Event Receiver", version = "1.0.0",
context = "/api/device-mgt/android/v1.0/events",
tags = {"devicemgt_android"})
@SwaggerDefinition(
info = @Info(
version = "1.0.0",
title = "",
extensions = {
@Extension(properties = {
@ExtensionProperty(name = "name", value = "Android Event Receiver"),
@ExtensionProperty(name = "context", value = "/api/device-mgt/android/v1.0/events"),
})
}
),
tags = {
@Tag(name = "devicemgt_android", description = "")
}
)
@Api(value = "Event Receiver", description = "Event publishing/retrieving related APIs. To enable event publishing/retrieving you need to" +
" configure WSO2 EMM as explained in https://docs.wso2.com/display/EMM220/Managing+Event+Publishing+with+WSO2+Data+Analytics+Server, " +
"https://docs.wso2.com/display/EMM220/Creating+a+New+Event+Stream+and+Receiver")
@ -51,7 +71,14 @@ public interface EventReceiverService {
httpMethod = "POST",
value = "Publishing Events",
notes = "Publish events received by the WSO2 EMM Android client to the WSO2 Data Analytics Server (DAS) using this API.",
tags = "Event Receiver"
tags = "Event Receiver",
authorizations = {
@Authorization(
value="permission",
scopes = { @AuthorizationScope(scope = "/device-mgt/devices/enroll/android",
description = "Publish Events to DAS") }
)
}
)
@ApiResponses(
value = {
@ -91,7 +118,6 @@ public interface EventReceiverService {
message = "Internal Server Error. \n " +
"Server error occurred while publishing events.")
})
@Permission(name = "Publish Events to DAS", permission = "/device-mgt/devices/enroll/android")
Response publishEvents(
@ApiParam(
name = "eventBeanWrapper",
@ -110,7 +136,14 @@ public interface EventReceiverService {
"(This cannot be combined with the to and from parameters).",
response = DeviceState.class,
responseContainer = "List",
tags = "Event Receiver"
tags = "Event Receiver",
authorizations = {
@Authorization(
value="permission",
scopes = { @AuthorizationScope(scope = "/device-mgt/devices/enroll/android",
description = "Publish Events to DAS") }
)
}
)
@ApiResponses(
value = {
@ -140,7 +173,6 @@ public interface EventReceiverService {
code = 500,
message = "Error occurred while getting the published events for the specified device.")
})
@Permission(name = "Publish Events to DAS", permission = "/device-mgt/devices/enroll/android")
Response retrieveAlerts(
@ApiParam(
name = "id",

@ -18,9 +18,20 @@
package org.wso2.carbon.device.mgt.mobile.windows.api.services;
import io.swagger.annotations.*;
import org.wso2.carbon.apimgt.annotations.api.API;
import org.wso2.carbon.apimgt.annotations.api.Permission;
import io.swagger.annotations.SwaggerDefinition;
import io.swagger.annotations.Info;
import io.swagger.annotations.ExtensionProperty;
import io.swagger.annotations.Extension;
import io.swagger.annotations.Tag;
import io.swagger.annotations.Api;
import io.swagger.annotations.AuthorizationScope;
import io.swagger.annotations.Authorization;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import io.swagger.annotations.ResponseHeader;
import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration;
import org.wso2.carbon.device.mgt.mobile.windows.api.common.exceptions.WindowsConfigurationException;
import org.wso2.carbon.device.mgt.mobile.windows.api.common.util.Message;
@ -34,9 +45,23 @@ import javax.ws.rs.core.Response;
* Windows Platform Configuration REST-API implementation.
* All end points supports JSON, XMl with content negotiation.
*/
@API(name = "Windows Configuration Management", version = "1.0.0",
context = "/api/device-mgt/windows/v1.0/services/configuration",
tags = {"windows"})
@SwaggerDefinition(
info = @Info(
version = "1.0.0",
title = "",
extensions = {
@Extension(properties = {
@ExtensionProperty(name = "name", value = "Windows Configuration Management"),
@ExtensionProperty(name = "context",
value = "/api/device-mgt/windows/v1.0/services/configuration"),
})
}
),
tags = {
@Tag(name = "devicemgt_windows", description = "")
}
)
@Api(value = "Windows Configuration Management",
description = "This carries all the resources related to Windows configurations management functionalities")
@WebService
@ -52,7 +77,14 @@ public interface ConfigurationMgtService {
value = "Getting Windows Platform Configurations",
notes = "Get the Windows platform configuration details using this REST API.",
response = PlatformConfiguration.class,
tags = "Windows Configuration Management"
tags = "Windows Configuration Management",
authorizations = {
@Authorization(
value="permission",
scopes = { @AuthorizationScope(scope = "/device-mgt/platform-configurations/view",
description = "View Configurations") }
)
}
)
@ApiResponses(value = {
@ApiResponse(
@ -85,7 +117,6 @@ public interface ConfigurationMgtService {
code = 500,
message = "Internal Server Error. \n Server error occurred while fetching the Windows platform configuration.")
})
@Permission(name = "View Configurations", permission = "/device-mgt/platform-configurations/view")
PlatformConfiguration getConfiguration() throws WindowsConfigurationException;
/**
@ -102,7 +133,14 @@ public interface ConfigurationMgtService {
httpMethod = "PUT",
value = "Updating Windows Platform Configurations",
notes = "Update the Windows platform configurations using this REST API.",
tags = "Windows Configuration Management"
tags = "Windows Configuration Management",
authorizations = {
@Authorization(
value="permission",
scopes = { @AuthorizationScope(scope = "/device-mgt/configurations/manage",
description = "Manage Configurations") }
)
}
)
@ApiResponses(value = {
@ApiResponse(
@ -137,7 +175,6 @@ public interface ConfigurationMgtService {
message = "Internal Server Error. \n " +
"Server error occurred while modifying the Windows platform configurations.")
})
@Permission(name = "Manage Configurations", permission = "/device-mgt/configurations/manage")
Message updateConfiguration
( @ApiParam(
name = "configuration",
@ -154,7 +191,15 @@ public interface ConfigurationMgtService {
notes = "Use this REST API to retrieve the license agreement that is used for the Windows device " +
"registration process.",
response = String.class,
tags = "Windows Configuration Management")
tags = "Windows Configuration Management",
authorizations = {
@Authorization(
value="permission",
scopes = { @AuthorizationScope(scope = "/device-mgt/devices/enroll/windows",
description = "Enroll Device") }
)
}
)
@ApiResponses(value = {
@ApiResponse(
code = 200,
@ -186,7 +231,6 @@ public interface ConfigurationMgtService {
code = 500,
message = "Internal Server Error. \n Server error occurred while fetching the Windows license configuration.")
})
@Permission(name = "Enroll Device", permission = "/device-mgt/devices/enroll/windows")
Response getLicense(
@ApiParam(
name = "If-Modified-Since",

@ -18,8 +18,12 @@
package org.wso2.carbon.device.mgt.mobile.windows.api.services;
import io.swagger.annotations.SwaggerDefinition;
import io.swagger.annotations.Info;
import io.swagger.annotations.ExtensionProperty;
import io.swagger.annotations.Extension;
import io.swagger.annotations.Tag;
import io.swagger.annotations.Api;
import org.wso2.carbon.apimgt.annotations.api.API;
import org.wso2.carbon.apimgt.annotations.api.Permission;
import org.wso2.carbon.device.mgt.mobile.windows.api.common.exceptions.WindowsDeviceEnrolmentException;
@ -38,9 +42,24 @@ import java.util.List;
*/
@Api(value = "Windows Device Management Administrative Service",
description = "Device management related admin APIs.")
@API(name = "Windows Device Management Administrative Service", version = "1.0.0",
context = "/api/device-mgt/windows/v1.0/admin/devices",
tags = {"devicemgt_windows"})
@SwaggerDefinition(
info = @Info(
version = "1.0.0",
title = "",
extensions = {
@Extension(properties = {
@ExtensionProperty(name = "name",
value = "Windows Device Management Administrative Service"),
@ExtensionProperty(name = "context",
value = "/api/device-mgt/windows/v1.0/admin/devices"),
})
}
),
tags = {
@Tag(name = "devicemgt_windows", description = "")
}
)
@WebService
@Path("/admin/devices")
@Consumes(MediaType.APPLICATION_JSON)

@ -18,8 +18,12 @@
package org.wso2.carbon.device.mgt.mobile.windows.api.services;
import io.swagger.annotations.SwaggerDefinition;
import io.swagger.annotations.Info;
import io.swagger.annotations.ExtensionProperty;
import io.swagger.annotations.Extension;
import io.swagger.annotations.Tag;
import io.swagger.annotations.Api;
import org.wso2.carbon.apimgt.annotations.api.API;
import org.wso2.carbon.device.mgt.common.Device;
import org.wso2.carbon.device.mgt.common.license.mgt.License;
import org.wso2.carbon.device.mgt.mobile.windows.api.common.exceptions.WindowsConfigurationException;
@ -40,9 +44,22 @@ import java.util.List;
*/
@Api(value = "Windows Device Management",
description = "This carries all the resources related to Windows device management functionalities")
@API(name = "Windows Device Management", version = "1.0.0",
context = "/api/device-mgt/windows/v1.0/devices",
tags = {"devicemgt_windows"})
@SwaggerDefinition(
info = @Info(
version = "1.0.0",
title = "",
extensions = {
@Extension(properties = {
@ExtensionProperty(name = "name", value = "Windows Device Management"),
@ExtensionProperty(name = "context", value = "/api/device-mgt/windows/v1.0/devices"),
})
}
),
tags = {
@Tag(name = "devicemgt_windows", description = "")
}
)
@WebService
@Path("/devices")
@Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})

@ -29,7 +29,17 @@
<fileSets>
<fileSet>
<directory>${basedir}/src/main/resources/jaggeryapps/devicemgt</directory>
<outputDirectory>/</outputDirectory>
<outputDirectory>/devicemgt</outputDirectory>
<useDefaultExcludes>true</useDefaultExcludes>
</fileSet>
<fileSet>
<directory>${basedir}/src/main/resources/jaggeryapps/uuf-template-app</directory>
<outputDirectory>/windows-web-agent</outputDirectory>
<useDefaultExcludes>true</useDefaultExcludes>
</fileSet>
<fileSet>
<directory>${basedir}/src/main/resources/jaggeryapps/windows-web-agent</directory>
<outputDirectory>/windows-web-agent</outputDirectory>
<useDefaultExcludes>true</useDefaultExcludes>
</fileSet>
</fileSets>

@ -0,0 +1,45 @@
{
"appName": "UUF Template App",
"cachingEnabled": false,
"debuggingEnabled": false,
"permissionRoot": "/",
"loginPage": "uuf.page.sign-in",
"adminServicesUrl": "https://${server.ip}:${server.https_port}/admin/services/",
"authModule": {
"enabled": true,
"login": {
"onSuccess": {
"script": "/app/modules/login.js",
"page": "uuf.page.home"
},
"onFail": {
"script": "/app/modules/login.js",
"page": "uuf.page.sign-in"
}
},
"logout": {
"onSuccess": {
"script": "/app/modules/logout.js",
"page": "uuf.page.sign-in"
},
"onFail": {
"script": "/app/modules/logout.js",
"page": "uuf.page.home"
}
},
"sso": {
"enabled": false,
"issuer": "uuf",
"responseSigningEnabled": true,
"keyStoreName": "repository/resources/security/wso2carbon.jks",
"keyStorePassword": "wso2carbon",
"identityProviderAlias": "wso2carbon",
"identityProviderUrl": "https://${server.ip}:${server.https_port}/samlsso",
"intermediatePage": "uuf.page.sso-intermediate"
}
},
"errorPages": {
"404": "uuf.page.error",
"default": "uuf.page.error"
}
}

@ -0,0 +1,67 @@
{{!--
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
--}}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{{#defineZone "title"}}WSO2 Template{{/defineZone}}</title>
{{defineZone "favicon"}}
{{defineZone "topCss"}}
{{defineZone "topJs"}}
</head>
<body>
<!-- header -->
{{defineZone "header"}}
<!-- /header -->
<!-- navbars -->
<div class="navbar-wrapper">
{{defineZone "navbars"}}
</div>
<!-- /navbars -->
<!-- sidepanes -->
{{defineZone "sidePanes"}}
<!-- /sidepanes -->
<!-- page-content-wrapper -->
<div class="page-content-wrapper">
{{defineZone "contentTitle"}}
<div class="container-fluid ">
<div class="body-wrapper">
{{defineZone "content"}}
</div>
</div>
</div>
<!-- /page-content-wrapper -->
<!-- footer -->
<footer class="footer">
<div class="container-fluid">
{{defineZone "footer"}}
</div>
</footer>
<!-- /footer -->
{{defineZone "bottomJs"}}
</body>
</html>

@ -0,0 +1,56 @@
{{!--
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
--}}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{{#defineZone "title"}}WSO2 Template{{/defineZone}}</title>
{{defineZone "favicon"}}
{{defineZone "topCss"}}
{{defineZone "topJs"}}
</head>
<body>
<!-- header -->
{{defineZone "header"}}
<!-- /header -->
<!-- page-content-wrapper -->
<div class="page-content-wrapper">
<div class="container-fluid ">
<div class="body-wrapper">
{{defineZone "content"}}
</div>
</div>
</div>
<!-- /page-content-wrapper -->
<!-- footer -->
<footer class="footer">
<div class="container-fluid">
{{defineZone "footer"}}
</div>
</footer>
<!-- /footer -->
{{defineZone "bottomJs"}}
</body>
</html>

@ -0,0 +1,38 @@
{{!
Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
WSO2 Inc. licenses this file to you under the Apache License,
Version 2.0 (the "License"); you may not use this file except
in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
}}
{{#zone "title"}}Error | {{@app.conf.appName}}{{/zone}}
{{#zone "breadcrumbs"}}
<li>
<a href="{{@app.context}}/">
<i class="icon fw fw-home"></i>
</a>
</li>
{{/zone}}
{{#zone "content"}}
<div class="message message-danger">
<h4><i class="icon fw fw-error"></i>An Error Occurred!</h4>
<div style="padding-left: 25px;">
<h5><b>HTTP Status : {{@page.params.status}}</b></h5>
<p style="white-space: pre-wrap;">{{@page.params.message}}</p>
</div>
</div>
{{/zone}}

@ -0,0 +1,24 @@
$(document).ready(function(){
$("#signInForm").validate({
rules: {
username: {
required: true,
minlength: 3
},
password: {
required: true,
minlength: 3
}
},
messages: {
username: {
required: "Please enter a username",
minlength: "Your username must consist of at least 3 characters"
},
password: {
required: "Please provide a password",
minlength: "Your password must be at least 3 characters long"
}
}
});
});

@ -0,0 +1,63 @@
{{!
Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
WSO2 Inc. licenses this file to you under the Apache License,
Version 2.0 (the "License"); you may not use this file except
in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
}}
{{#zone "title"}}Sign In | {{@app.conf.appName}}{{/zone}}
{{~#zone "content"}}
<div class="col-sm-7 col-md-4 center-block" style="float: none; margin-top: 10%;">
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
{{#defineZone "signIn-title" scope="protected"}}Sign In to UUF Template App{{/defineZone}}
</h4>
</div>
<div class="panel-body">
{{#if message}}
<div id="_uuf_login-error-msg" class="alert alert-danger">
<i class="icon fw fw-warning"></i> {{message}}!
</div>
{{/if}}
<form id="signInForm" method="POST"
class="{{defineZone "signInForm-class" scope="protected"}}"
action="{{#defineZone "signInForm-action" scope="protected"}}{{@app.context}}/uuf/login{{/defineZone}}">
<div class="form-group">
<input type="text" name="username" class="form-control"
placeholder="User Name" required="required" autofocus="autofocus" />
</div>
<div class="form-group">
<input type="password" name="password" class="form-control"
placeholder="Password" required="required" />
</div>
{{#if referer}}
<input type="hidden" name="referer" value="{{referer}}" />
{{/if}}
<div class="form-group" style="padding-top: 10px;">
<input type="submit" name="signInBtn" class="btn btn-primary btn-block"
value="Sign In" />
</div>
{{defineZone "signInForm-below" scope="protected"}}
</form>
</div>
</div>
</div>
{{/zone}}
{{! sign-in form validation}}
{{~unit "uuf.unit.lib.form-validation"}}
{{~#zone "bottomJs"}}
{{~js "js/sign-in-validations.js"}}
{{/zone}}

@ -0,0 +1,30 @@
function onRequest(context) {
var authModuleConfigs = context.app.conf["authModule"];
if (authModuleConfigs && (authModuleConfigs["enabled"].toString() == "true")) {
// Auth module is enabled.
if (context.user) {
// User is already logged in.
response.sendRedirect(context.app.context + "/");
exit();
} else {
// User is not logged in.
var ssoConfigs = authModuleConfigs["sso"];
if (ssoConfigs && (ssoConfigs["enabled"].toString() == "true")) {
// SSO is enabled in Auth module.
var redirectUri = context.app.context + "/uuf/login";
var queryString = request.getQueryString();
if (queryString && (queryString.length > 0)) {
redirectUri = redirectUri + "?" + queryString;
}
response.sendRedirect(encodeURI(redirectUri));
exit();
} else {
// Generic login process is enabled.
return {
message: request.getParameter("error"),
referer: request.getParameter("referer")
};
}
}
}
}

@ -0,0 +1,18 @@
{{!
Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
WSO2 Inc. licenses this file to you under the Apache License,
Version 2.0 (the "License"); you may not use this file except
in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
}}
{{! This template won't be rendered. So nothing is here }}

@ -0,0 +1,16 @@
function onRequest(context) {
var authModuleConfigs = context.app.conf["authModule"];
if (authModuleConfigs && (authModuleConfigs["enabled"].toString() == "true")) {
// Auth module is enabled.
if (context.user) {
// User is logged in.
response.sendRedirect(context.app.context + "/uuf/logout");
exit();
} else {
// User is already logged out.
response.sendRedirect(context.app.context + "/");
exit();
}
}
}

@ -0,0 +1,45 @@
{{!
Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
WSO2 Inc. licenses this file to you under the Apache License,
Version 2.0 (the "License"); you may not use this file except
in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
}}
{{#zone "title"}}Sign In | {{@app.conf.appName}}{{/zone}}
{{unit "uuf.unit.theme"}}
{{unit "uuf.unit.header.logo"}}{{unit "uuf.unit.header"}}
{{unit "uuf.unit.footer"}}
{{#zone "content"}}
<div class="jumbotron">
<p>
You are now being redirected to Identity Server. If the redirection fails, please click
on the button below.
</p>
<div>
<form method="post" action="{{@page.params.identityProviderUrl}}">
<input type="hidden" name="SAMLRequest"
value="{{@page.params.encodedSAMLAuthRequest}}" />
<input type="hidden" name="RelayState" value="{{@page.params.relayState}}" />
<input type="hidden" name="SSOAuthSessionID" value="{{@page.params.sessionId}}" />
<button type="submit" class="btn btn-primary">Redirect manually</button>
</form>
</div>
</div>
{{/zone}}
{{#zone "bottomJs"}}
<script type="text/javascript">document.forms[0].submit();</script>
{{/zone}}

@ -0,0 +1,27 @@
{{!
Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
WSO2 Inc. licenses this file to you under the Apache License,
Version 2.0 (the "License"); you may not use this file except
in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
}}
<div {{#if @unit.params.id}}id="{{@unit.params.id}}" {{/if~}}
class="alert alert-{{@unit.params.type}}" role="alert">
<i class="icon fw fw-{{icon}}"></i>
<strong>{{@unit.params.title}}</strong> {{{@unit.params.message}}}
{{#if @unit.params.dismissable}}
<button type="button" class="close" aria-label="close" data-dismiss="alert">
<span aria-hidden="true"><i class="fw fw-cancel"></i></span>
</button>
{{/if}}
</div>

@ -0,0 +1,15 @@
function onRequest(context) {
var type = context.unit.params.type;
switch (type) {
case "success":
return {icon: "ok"};
case "info":
return {icon: "info"};
case "warning":
return {icon: "warning"};
case "danger":
return {icon: "error"};
default:
return {icon: "ok"};
}
}

@ -0,0 +1,20 @@
{{!
Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
WSO2 Inc. licenses this file to you under the Apache License,
Version 2.0 (the "License"); you may not use this file except
in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
}}
{{#zone "favicon"}}
<link rel="shortcut icon" href="{{@unit.publicUri}}/img/favicon.png" />
{{/zone}}

@ -0,0 +1,23 @@
{{!
Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
WSO2 Inc. licenses this file to you under the Apache License,
Version 2.0 (the "License"); you may not use this file except
in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
}}
{{#zone "footer"}}
<p>
WSO2 | &copy; 2015
<a href="http://wso2.com/" target="_blank"><i class="icon fw fw-wso2"></i> Inc</a>.
</p>
{{/zone}}

@ -0,0 +1,27 @@
{{!
Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
WSO2 Inc. licenses this file to you under the Apache License,
Version 2.0 (the "License"); you may not use this file except
in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
}}
{{#zone "brand"}}
<a href="{{#defineZone "productUri"}}{{@app.context}}/{{/defineZone}}">
<img src="{{@unit.publicUri}}/img/logo.png" alt="{{defineZone "productName"}}"
title="{{defineZone "productName"}}" class="logo" />
<h1>
<span class="hidden-xs">{{#defineZone "productName"}}Unified UI Template App{{/defineZone}}</span>
<span class="visible-xs-inline">{{#defineZone "productNameResponsive"}}UUI Tmpl. App{{/defineZone}}</span>
</h1>
</a>
{{/zone}}

@ -0,0 +1,39 @@
{{!
Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
WSO2 Inc. licenses this file to you under the Apache License,
Version 2.0 (the "License"); you may not use this file except
in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
}}
{{#zone "userMenu"}}
<ul class="nav navbar-right float-remove-xs text-center-xs">
<li class="visible-inline-block">
<a href="#" class="dropdown" data-toggle="dropdown">
<span class="icon fw-stack fw-lg">
<i class="fw fw-circle fw-stack-2x"></i>
<i class="fw fw-user fw-stack-1x fw-inverse"></i>
</span>
<span class="hidden-xs add-padding-left-1x">
{{@user.username}}<span class="caret"></span>
</span>
</a>
<ul class="dropdown-menu dropdown-menu-right slideInDown" role="menu">
{{#defineZone "userMenu-items"}}
<li>
<a href="{{@app.context}}/signout">Sign Out</a>
</li>
{{/defineZone}}
</ul>
</li>
</ul>
{{/zone}}

@ -0,0 +1,29 @@
{{!
Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
WSO2 Inc. licenses this file to you under the Apache License,
Version 2.0 (the "License"); you may not use this file except
in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
}}
{{#zone "header"}}
<header class="header header-default">
<div class="container-fluid">
<div class="pull-left brand">
{{defineZone "brand"}}
</div>
<div class="pull-right auth">
{{defineZone "userMenu"}}
</div>
</div>
</header>
{{/zone}}

@ -0,0 +1,27 @@
{{!
Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
WSO2 Inc. licenses this file to you under the Apache License,
Version 2.0 (the "License"); you may not use this file except
in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
}}
{{#zone "topCss"}}
{{~css "data-tables_1.10.7/extensions/Bootstrap/css/dataTables.bootstrap.css"}}
{{~css "data-tables_1.10.7/extensions/Responsive/css/dataTables.responsive.css"}}
{{/zone}}
{{~#zone "bottomJs"}}
{{~js "data-tables_1.10.7/media/js/jquery.dataTables.min.js"}}
{{~js "data-tables_1.10.7/extensions/Bootstrap/js/dataTables.bootstrap.js"}}
{{~js "data-tables_1.10.7/extensions/Responsive/js/dataTables.responsive.js"}}
{{/zone}}

@ -0,0 +1,24 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* AutoFill styles
*/
div.AutoFill_filler {
display: none;
position: absolute;
height: 14px;
width: 14px;
background: url(../images/filler.png) no-repeat center center;
z-index: 1002;
}
div.AutoFill_border {
display: none;
position: absolute;
background-color: #0063dc;
z-index: 1001;
box-shadow: 0px 0px 5px #76b4ff;
-moz-box-shadow: 0px 0px 5px #76b4ff;
-webkit-box-shadow: 0px 0px 5px #76b4ff;
}

@ -0,0 +1 @@
div.AutoFill_filler{display:none;position:absolute;height:14px;width:14px;background:url(../images/filler.png) no-repeat center center;z-index:1002}div.AutoFill_border{display:none;position:absolute;background-color:#0063dc;z-index:1001;box-shadow:0px 0px 5px #76b4ff;-moz-box-shadow:0px 0px 5px #76b4ff;-webkit-box-shadow:0px 0px 5px #76b4ff}

@ -0,0 +1,855 @@
/*! AutoFill 1.2.1
* ©2008-2014 SpryMedia Ltd - datatables.net/license
*/
/**
* @summary AutoFill
* @description Add Excel like click and drag auto-fill options to DataTables
* @version 1.2.1
* @file dataTables.autoFill.js
* @author SpryMedia Ltd (www.sprymedia.co.uk)
* @contact www.sprymedia.co.uk/contact
* @copyright Copyright 2010-2014 SpryMedia Ltd.
*
* 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.datatables.net
*/
(function( window, document, undefined ) {
var factory = function( $, DataTable ) {
"use strict";
/**
* AutoFill provides Excel like auto-fill features for a DataTable
*
* @class AutoFill
* @constructor
* @param {object} oTD DataTables settings object
* @param {object} oConfig Configuration object for AutoFill
*/
var AutoFill = function( oDT, oConfig )
{
/* Sanity check that we are a new instance */
if ( ! (this instanceof AutoFill) ) {
throw( "Warning: AutoFill must be initialised with the keyword 'new'" );
}
if ( ! $.fn.dataTableExt.fnVersionCheck('1.7.0') ) {
throw( "Warning: AutoFill requires DataTables 1.7 or greater");
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Public class variables
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
this.c = {};
/**
* @namespace Settings object which contains customisable information for AutoFill instance
*/
this.s = {
/**
* @namespace Cached information about the little dragging icon (the filler)
*/
"filler": {
"height": 0,
"width": 0
},
/**
* @namespace Cached information about the border display
*/
"border": {
"width": 2
},
/**
* @namespace Store for live information for the current drag
*/
"drag": {
"startX": -1,
"startY": -1,
"startTd": null,
"endTd": null,
"dragging": false
},
/**
* @namespace Data cache for information that we need for scrolling the screen when we near
* the edges
*/
"screen": {
"interval": null,
"y": 0,
"height": 0,
"scrollTop": 0
},
/**
* @namespace Data cache for the position of the DataTables scrolling element (when scrolling
* is enabled)
*/
"scroller": {
"top": 0,
"bottom": 0
},
/**
* @namespace Information stored for each column. An array of objects
*/
"columns": []
};
/**
* @namespace Common and useful DOM elements for the class instance
*/
this.dom = {
"table": null,
"filler": null,
"borderTop": null,
"borderRight": null,
"borderBottom": null,
"borderLeft": null,
"currentTarget": null
};
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Public class methods
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**
* Retreieve the settings object from an instance
* @method fnSettings
* @returns {object} AutoFill settings object
*/
this.fnSettings = function () {
return this.s;
};
/* Constructor logic */
this._fnInit( oDT, oConfig );
return this;
};
AutoFill.prototype = {
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Private methods (they are of course public in JS, but recommended as private)
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**
* Initialisation
* @method _fnInit
* @param {object} dt DataTables settings object
* @param {object} config Configuration object for AutoFill
* @returns void
*/
"_fnInit": function ( dt, config )
{
var
that = this,
i, iLen;
// Use DataTables API to get the settings allowing selectors, instances
// etc to be used, or for backwards compatibility get from the old
// fnSettings method
this.s.dt = DataTable.Api ?
new DataTable.Api( dt ).settings()[0] :
dt.fnSettings();
this.s.init = config || {};
this.dom.table = this.s.dt.nTable;
$.extend( true, this.c, AutoFill.defaults, config );
/* Add and configure the columns */
this._initColumns();
/* Auto Fill click and drag icon */
var filler = $('<div/>', {
'class': 'AutoFill_filler'
} )
.appendTo( 'body' );
this.dom.filler = filler[0];
// Get the height / width of the click element
this.s.filler.height = filler.height();
this.s.filler.width = filler.width();
filler[0].style.display = "none";
/* Border display - one div for each side. We can't just use a single
* one with a border, as we want the events to effectively pass through
* the transparent bit of the box
*/
var border;
var appender = document.body;
if ( that.s.dt.oScroll.sY !== "" ) {
that.s.dt.nTable.parentNode.style.position = "relative";
appender = that.s.dt.nTable.parentNode;
}
border = $('<div/>', {
"class": "AutoFill_border"
} );
this.dom.borderTop = border.clone().appendTo( appender )[0];
this.dom.borderRight = border.clone().appendTo( appender )[0];
this.dom.borderBottom = border.clone().appendTo( appender )[0];
this.dom.borderLeft = border.clone().appendTo( appender )[0];
/* Events */
filler.on( 'mousedown.DTAF', function (e) {
this.onselectstart = function() { return false; };
that._fnFillerDragStart.call( that, e );
return false;
} );
$('tbody', this.dom.table).on(
'mouseover.DTAF mouseout.DTAF',
'>tr>td, >tr>th',
function (e) {
that._fnFillerDisplay.call( that, e );
}
);
$(this.dom.table).on( 'destroy.dt.DTAF', function () {
filler.off( 'mousedown.DTAF' ).remove();
$('tbody', this.dom.table).off( 'mouseover.DTAF mouseout.DTAF' );
} );
},
_initColumns: function ( )
{
var that = this;
var i, ien;
var dt = this.s.dt;
var config = this.s.init;
for ( i=0, ien=dt.aoColumns.length ; i<ien ; i++ ) {
this.s.columns[i] = $.extend( true, {}, AutoFill.defaults.column );
}
dt.oApi._fnApplyColumnDefs(
dt,
config.aoColumnDefs || config.columnDefs,
config.aoColumns || config.columns,
function (colIdx, def) {
that._fnColumnOptions( colIdx, def );
}
);
// For columns which don't have read, write, step functions defined,
// use the default ones
for ( i=0, ien=dt.aoColumns.length ; i<ien ; i++ ) {
var column = this.s.columns[i];
if ( ! column.read ) {
column.read = this._fnReadCell;
}
if ( ! column.write ) {
column.read = this._fnWriteCell;
}
if ( ! column.step ) {
column.read = this._fnStep;
}
}
},
"_fnColumnOptions": function ( i, opts )
{
var column = this.s.columns[ i ];
var set = function ( outProp, inProp ) {
if ( opts[ inProp[0] ] !== undefined ) {
column[ outProp ] = opts[ inProp[0] ];
}
if ( opts[ inProp[1] ] !== undefined ) {
column[ outProp ] = opts[ inProp[1] ];
}
};
// Compatibility with the old Hungarian style of notation
set( 'enable', ['bEnable', 'enable'] );
set( 'read', ['fnRead', 'read'] );
set( 'write', ['fnWrite', 'write'] );
set( 'step', ['fnStep', 'step'] );
set( 'increment', ['bIncrement', 'increment'] );
},
/**
* Find out the coordinates of a given TD cell in a table
* @method _fnTargetCoords
* @param {Node} nTd
* @returns {Object} x and y properties, for the position of the cell in the tables DOM
*/
"_fnTargetCoords": function ( nTd )
{
var nTr = $(nTd).parents('tr')[0];
var position = this.s.dt.oInstance.fnGetPosition( nTd );
return {
"x": $('td', nTr).index(nTd),
"y": $('tr', nTr.parentNode).index(nTr),
"row": position[0],
"column": position[2]
};
},
/**
* Display the border around one or more cells (from start to end)
* @method _fnUpdateBorder
* @param {Node} nStart Starting cell
* @param {Node} nEnd Ending cell
* @returns void
*/
"_fnUpdateBorder": function ( nStart, nEnd )
{
var
border = this.s.border.width,
offsetStart = $(nStart).offset(),
offsetEnd = $(nEnd).offset(),
x1 = offsetStart.left - border,
x2 = offsetEnd.left + $(nEnd).outerWidth(),
y1 = offsetStart.top - border,
y2 = offsetEnd.top + $(nEnd).outerHeight(),
width = offsetEnd.left + $(nEnd).outerWidth() - offsetStart.left + (2*border),
height = offsetEnd.top + $(nEnd).outerHeight() - offsetStart.top + (2*border),
oStyle;
// Recalculate start and end (when dragging "backwards")
if( offsetStart.left > offsetEnd.left) {
x1 = offsetEnd.left - border;
x2 = offsetStart.left + $(nStart).outerWidth();
width = offsetStart.left + $(nStart).outerWidth() - offsetEnd.left + (2*border);
}
if ( this.s.dt.oScroll.sY !== "" )
{
/* The border elements are inside the DT scroller - so position relative to that */
var
offsetScroll = $(this.s.dt.nTable.parentNode).offset(),
scrollTop = $(this.s.dt.nTable.parentNode).scrollTop(),
scrollLeft = $(this.s.dt.nTable.parentNode).scrollLeft();
x1 -= offsetScroll.left - scrollLeft;
x2 -= offsetScroll.left - scrollLeft;
y1 -= offsetScroll.top - scrollTop;
y2 -= offsetScroll.top - scrollTop;
}
/* Top */
oStyle = this.dom.borderTop.style;
oStyle.top = y1+"px";
oStyle.left = x1+"px";
oStyle.height = this.s.border.width+"px";
oStyle.width = width+"px";
/* Bottom */
oStyle = this.dom.borderBottom.style;
oStyle.top = y2+"px";
oStyle.left = x1+"px";
oStyle.height = this.s.border.width+"px";
oStyle.width = width+"px";
/* Left */
oStyle = this.dom.borderLeft.style;
oStyle.top = y1+"px";
oStyle.left = x1+"px";
oStyle.height = height+"px";
oStyle.width = this.s.border.width+"px";
/* Right */
oStyle = this.dom.borderRight.style;
oStyle.top = y1+"px";
oStyle.left = x2+"px";
oStyle.height = height+"px";
oStyle.width = this.s.border.width+"px";
},
/**
* Mouse down event handler for starting a drag
* @method _fnFillerDragStart
* @param {Object} e Event object
* @returns void
*/
"_fnFillerDragStart": function (e)
{
var that = this;
var startingTd = this.dom.currentTarget;
this.s.drag.dragging = true;
that.dom.borderTop.style.display = "block";
that.dom.borderRight.style.display = "block";
that.dom.borderBottom.style.display = "block";
that.dom.borderLeft.style.display = "block";
var coords = this._fnTargetCoords( startingTd );
this.s.drag.startX = coords.x;
this.s.drag.startY = coords.y;
this.s.drag.startTd = startingTd;
this.s.drag.endTd = startingTd;
this._fnUpdateBorder( startingTd, startingTd );
$(document).bind('mousemove.AutoFill', function (e) {
that._fnFillerDragMove.call( that, e );
} );
$(document).bind('mouseup.AutoFill', function (e) {
that._fnFillerFinish.call( that, e );
} );
/* Scrolling information cache */
this.s.screen.y = e.pageY;
this.s.screen.height = $(window).height();
this.s.screen.scrollTop = $(document).scrollTop();
if ( this.s.dt.oScroll.sY !== "" )
{
this.s.scroller.top = $(this.s.dt.nTable.parentNode).offset().top;
this.s.scroller.bottom = this.s.scroller.top + $(this.s.dt.nTable.parentNode).height();
}
/* Scrolling handler - we set an interval (which is cancelled on mouse up) which will fire
* regularly and see if we need to do any scrolling
*/
this.s.screen.interval = setInterval( function () {
var iScrollTop = $(document).scrollTop();
var iScrollDelta = iScrollTop - that.s.screen.scrollTop;
that.s.screen.y += iScrollDelta;
if ( that.s.screen.height - that.s.screen.y + iScrollTop < 50 )
{
$('html, body').animate( {
"scrollTop": iScrollTop + 50
}, 240, 'linear' );
}
else if ( that.s.screen.y - iScrollTop < 50 )
{
$('html, body').animate( {
"scrollTop": iScrollTop - 50
}, 240, 'linear' );
}
if ( that.s.dt.oScroll.sY !== "" )
{
if ( that.s.screen.y > that.s.scroller.bottom - 50 )
{
$(that.s.dt.nTable.parentNode).animate( {
"scrollTop": $(that.s.dt.nTable.parentNode).scrollTop() + 50
}, 240, 'linear' );
}
else if ( that.s.screen.y < that.s.scroller.top + 50 )
{
$(that.s.dt.nTable.parentNode).animate( {
"scrollTop": $(that.s.dt.nTable.parentNode).scrollTop() - 50
}, 240, 'linear' );
}
}
}, 250 );
},
/**
* Mouse move event handler for during a move. See if we want to update the display based on the
* new cursor position
* @method _fnFillerDragMove
* @param {Object} e Event object
* @returns void
*/
"_fnFillerDragMove": function (e)
{
if ( e.target && e.target.nodeName.toUpperCase() == "TD" &&
e.target != this.s.drag.endTd )
{
var coords = this._fnTargetCoords( e.target );
if ( this.c.mode == "y" && coords.x != this.s.drag.startX )
{
e.target = $('tbody>tr:eq('+coords.y+')>td:eq('+this.s.drag.startX+')', this.dom.table)[0];
}
if ( this.c.mode == "x" && coords.y != this.s.drag.startY )
{
e.target = $('tbody>tr:eq('+this.s.drag.startY+')>td:eq('+coords.x+')', this.dom.table)[0];
}
if ( this.c.mode == "either")
{
if(coords.x != this.s.drag.startX )
{
e.target = $('tbody>tr:eq('+this.s.drag.startY+')>td:eq('+coords.x+')', this.dom.table)[0];
}
else if ( coords.y != this.s.drag.startY ) {
e.target = $('tbody>tr:eq('+coords.y+')>td:eq('+this.s.drag.startX+')', this.dom.table)[0];
}
}
// update coords
if ( this.c.mode !== "both" ) {
coords = this._fnTargetCoords( e.target );
}
var drag = this.s.drag;
drag.endTd = e.target;
if ( coords.y >= this.s.drag.startY ) {
this._fnUpdateBorder( drag.startTd, drag.endTd );
}
else {
this._fnUpdateBorder( drag.endTd, drag.startTd );
}
this._fnFillerPosition( e.target );
}
/* Update the screen information so we can perform scrolling */
this.s.screen.y = e.pageY;
this.s.screen.scrollTop = $(document).scrollTop();
if ( this.s.dt.oScroll.sY !== "" )
{
this.s.scroller.scrollTop = $(this.s.dt.nTable.parentNode).scrollTop();
this.s.scroller.top = $(this.s.dt.nTable.parentNode).offset().top;
this.s.scroller.bottom = this.s.scroller.top + $(this.s.dt.nTable.parentNode).height();
}
},
/**
* Mouse release handler - end the drag and take action to update the cells with the needed values
* @method _fnFillerFinish
* @param {Object} e Event object
* @returns void
*/
"_fnFillerFinish": function (e)
{
var that = this, i, iLen, j;
$(document).unbind('mousemove.AutoFill mouseup.AutoFill');
this.dom.borderTop.style.display = "none";
this.dom.borderRight.style.display = "none";
this.dom.borderBottom.style.display = "none";
this.dom.borderLeft.style.display = "none";
this.s.drag.dragging = false;
clearInterval( this.s.screen.interval );
var cells = [];
var table = this.dom.table;
var coordsStart = this._fnTargetCoords( this.s.drag.startTd );
var coordsEnd = this._fnTargetCoords( this.s.drag.endTd );
var columnIndex = function ( visIdx ) {
return that.s.dt.oApi._fnVisibleToColumnIndex( that.s.dt, visIdx );
};
// xxx - urgh - there must be a way of reducing this...
if ( coordsStart.y <= coordsEnd.y ) {
for ( i=coordsStart.y ; i<=coordsEnd.y ; i++ ) {
if ( coordsStart.x <= coordsEnd.x ) {
for ( j=coordsStart.x ; j<=coordsEnd.x ; j++ ) {
cells.push( {
node: $('tbody>tr:eq('+i+')>td:eq('+j+')', table)[0],
x: j - coordsStart.x,
y: i - coordsStart.y,
colIdx: columnIndex( j )
} );
}
}
else {
for ( j=coordsStart.x ; j>=coordsEnd.x ; j-- ) {
cells.push( {
node: $('tbody>tr:eq('+i+')>td:eq('+j+')', table)[0],
x: j - coordsStart.x,
y: i - coordsStart.y,
colIdx: columnIndex( j )
} );
}
}
}
}
else {
for ( i=coordsStart.y ; i>=coordsEnd.y ; i-- ) {
if ( coordsStart.x <= coordsEnd.x ) {
for ( j=coordsStart.x ; j<=coordsEnd.x ; j++ ) {
cells.push( {
node: $('tbody>tr:eq('+i+')>td:eq('+j+')', table)[0],
x: j - coordsStart.x,
y: i - coordsStart.y,
colIdx: columnIndex( j )
} );
}
}
else {
for ( j=coordsStart.x ; j>=coordsEnd.x ; j-- ) {
cells.push( {
node: $('tbody>tr:eq('+i+')>td:eq('+j+')', table)[0],
x: coordsStart.x - j,
y: coordsStart.y - i,
colIdx: columnIndex( j )
} );
}
}
}
}
// An auto-fill requires 2 or more cells
if ( cells.length <= 1 ) {
return;
}
var edited = [];
var previous;
for ( i=0, iLen=cells.length ; i<iLen ; i++ ) {
var cell = cells[i];
var column = this.s.columns[ cell.colIdx ];
var read = column.read.call( column, cell.node );
var stepValue = column.step.call( column, cell.node, read, previous, i, cell.x, cell.y );
column.write.call( column, cell.node, stepValue );
previous = stepValue;
edited.push( {
cell: cell,
colIdx: cell.colIdx,
newValue: stepValue,
oldValue: read
} );
}
if ( this.c.complete !== null ) {
this.c.complete.call( this, edited );
}
// In 1.10 we can do a static draw
if ( DataTable.Api ) {
new DataTable.Api( this.s.dt ).draw( false );
}
else {
this.s.dt.oInstance.fnDraw();
}
},
/**
* Display the drag handle on mouse over cell
* @method _fnFillerDisplay
* @param {Object} e Event object
* @returns void
*/
"_fnFillerDisplay": function (e)
{
var filler = this.dom.filler;
/* Don't display automatically when dragging */
if ( this.s.drag.dragging)
{
return;
}
/* Check that we are allowed to AutoFill this column or not */
var nTd = (e.target.nodeName.toLowerCase() == 'td') ? e.target : $(e.target).parents('td')[0];
var iX = this._fnTargetCoords(nTd).column;
if ( !this.s.columns[iX].enable )
{
filler.style.display = "none";
return;
}
if (e.type == 'mouseover')
{
this.dom.currentTarget = nTd;
this._fnFillerPosition( nTd );
filler.style.display = "block";
}
else if ( !e.relatedTarget || !e.relatedTarget.className.match(/AutoFill/) )
{
filler.style.display = "none";
}
},
/**
* Position the filler icon over a cell
* @method _fnFillerPosition
* @param {Node} nTd Cell to position filler icon over
* @returns void
*/
"_fnFillerPosition": function ( nTd )
{
var offset = $(nTd).offset();
var filler = this.dom.filler;
filler.style.top = (offset.top - (this.s.filler.height / 2)-1 + $(nTd).outerHeight())+"px";
filler.style.left = (offset.left - (this.s.filler.width / 2)-1 + $(nTd).outerWidth())+"px";
}
};
// Alias for access
DataTable.AutoFill = AutoFill;
DataTable.AutoFill = AutoFill;
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Constants
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**
* AutoFill version
* @constant version
* @type String
* @default See code
*/
AutoFill.version = "1.2.1";
/**
* AutoFill defaults
* @namespace
*/
AutoFill.defaults = {
/**
* Mode for dragging (restrict to y-axis only, x-axis only, either one or none):
*
* * `y` - y-axis only (default)
* * `x` - x-axis only
* * `either` - either one, but not both axis at the same time
* * `both` - multiple cells allowed
*
* @type {string}
* @default `y`
*/
mode: 'y',
complete: null,
/**
* Column definition defaults
* @namespace
*/
column: {
/**
* If AutoFill should be enabled on this column
*
* @type {boolean}
* @default true
*/
enable: true,
/**
* Allow automatic increment / decrement on this column if a number
* is found.
*
* @type {boolean}
* @default true
*/
increment: true,
/**
* Cell read function
*
* Default function will simply read the value from the HTML of the
* cell.
*
* @type {function}
* @param {node} cell `th` / `td` element to read the value from
* @return {string} Data that has been read
*/
read: function ( cell ) {
return $(cell).html();
},
/**
* Cell write function
*
* Default function will simply write to the HTML and tell the DataTable
* to update.
*
* @type {function}
* @param {node} cell `th` / `td` element to write the value to
* @return {string} Data two write
*/
write: function ( cell, val ) {
var table = $(cell).parents('table');
if ( DataTable.Api ) {
// 1.10
table.DataTable().cell( cell ).data( val );
}
else {
// 1.9
var dt = table.dataTable();
var pos = dt.fnGetPosition( cell );
dt.fnUpdate( val, pos[0], pos[2], false );
}
},
/**
* Step function. This provides the ability to customise how the values
* are incremented.
*
* @param {node} cell `th` / `td` element that is being operated upon
* @param {string} read Cell value from `read` function
* @param {string} last Value of the previous cell
* @param {integer} i Loop counter
* @param {integer} x Cell x-position in the current auto-fill. The
* starting cell is coordinate 0 regardless of its physical position
* in the DataTable.
* @param {integer} y Cell y-position in the current auto-fill. The
* starting cell is coordinate 0 regardless of its physical position
* in the DataTable.
* @return {string} Value to write
*/
step: function ( cell, read, last, i, x, y ) {
// Increment a number if it is found
var re = /(\-?\d+)/;
var match = this.increment && last ? last.match(re) : null;
if ( match ) {
return last.replace( re, parseInt(match[1],10) + (x<0 || y<0 ? -1 : 1) );
}
return last === undefined ?
read :
last;
}
}
};
return AutoFill;
};
// Define as an AMD module if possible
if ( typeof define === 'function' && define.amd ) {
define( ['jquery', 'datatables'], factory );
}
else if ( typeof exports === 'object' ) {
// Node/CommonJS
factory( require('jquery'), require('datatables') );
}
else if ( jQuery && !jQuery.fn.dataTable.AutoFill ) {
// Otherwise simply initialise as normal, stopping multiple evaluation
factory( jQuery, jQuery.fn.dataTable );
}
}(window, document));

@ -0,0 +1,22 @@
/*!
AutoFill 1.2.1
©2008-2014 SpryMedia Ltd - datatables.net/license
*/
(function(o,j,m){var l=function(c,k){var h=function(d,b){if(!(this instanceof h))throw"Warning: AutoFill must be initialised with the keyword 'new'";if(!c.fn.dataTableExt.fnVersionCheck("1.7.0"))throw"Warning: AutoFill requires DataTables 1.7 or greater";this.c={};this.s={filler:{height:0,width:0},border:{width:2},drag:{startX:-1,startY:-1,startTd:null,endTd:null,dragging:!1},screen:{interval:null,y:0,height:0,scrollTop:0},scroller:{top:0,bottom:0},columns:[]};this.dom={table:null,filler:null,borderTop:null,
borderRight:null,borderBottom:null,borderLeft:null,currentTarget:null};this.fnSettings=function(){return this.s};this._fnInit(d,b);return this};h.prototype={_fnInit:function(d,b){var a=this;this.s.dt=k.Api?(new k.Api(d)).settings()[0]:d.fnSettings();this.s.init=b||{};this.dom.table=this.s.dt.nTable;c.extend(!0,this.c,h.defaults,b);this._initColumns();var e=c("<div/>",{"class":"AutoFill_filler"}).appendTo("body");this.dom.filler=e[0];this.s.filler.height=e.height();this.s.filler.width=e.width();e[0].style.display=
"none";var g,f=j.body;""!==a.s.dt.oScroll.sY&&(a.s.dt.nTable.parentNode.style.position="relative",f=a.s.dt.nTable.parentNode);g=c("<div/>",{"class":"AutoFill_border"});this.dom.borderTop=g.clone().appendTo(f)[0];this.dom.borderRight=g.clone().appendTo(f)[0];this.dom.borderBottom=g.clone().appendTo(f)[0];this.dom.borderLeft=g.clone().appendTo(f)[0];e.on("mousedown.DTAF",function(b){this.onselectstart=function(){return false};a._fnFillerDragStart.call(a,b);return false});c("tbody",this.dom.table).on("mouseover.DTAF mouseout.DTAF",
">tr>td, >tr>th",function(b){a._fnFillerDisplay.call(a,b)});c(this.dom.table).on("destroy.dt.DTAF",function(){e.off("mousedown.DTAF").remove();c("tbody",this.dom.table).off("mouseover.DTAF mouseout.DTAF")})},_initColumns:function(){var d=this,b,a,e=this.s.dt,g=this.s.init;b=0;for(a=e.aoColumns.length;b<a;b++)this.s.columns[b]=c.extend(!0,{},h.defaults.column);e.oApi._fnApplyColumnDefs(e,g.aoColumnDefs||g.columnDefs,g.aoColumns||g.columns,function(a,b){d._fnColumnOptions(a,b)});b=0;for(a=e.aoColumns.length;b<
a;b++)if(e=this.s.columns[b],e.read||(e.read=this._fnReadCell),e.write||(e.read=this._fnWriteCell),!e.step)e.read=this._fnStep},_fnColumnOptions:function(d,b){var a=this.s.columns[d],c=function(c,d){b[d[0]]!==m&&(a[c]=b[d[0]]);b[d[1]]!==m&&(a[c]=b[d[1]])};c("enable",["bEnable","enable"]);c("read",["fnRead","read"]);c("write",["fnWrite","write"]);c("step",["fnStep","step"]);c("increment",["bIncrement","increment"])},_fnTargetCoords:function(d){var b=c(d).parents("tr")[0],a=this.s.dt.oInstance.fnGetPosition(d);
return{x:c("td",b).index(d),y:c("tr",b.parentNode).index(b),row:a[0],column:a[2]}},_fnUpdateBorder:function(d,b){var a=this.s.border.width,e=c(d).offset(),g=c(b).offset(),f=e.left-a,i=g.left+c(b).outerWidth(),n=e.top-a,h=g.top+c(b).outerHeight(),j=g.left+c(b).outerWidth()-e.left+2*a,k=g.top+c(b).outerHeight()-e.top+2*a;e.left>g.left&&(f=g.left-a,i=e.left+c(d).outerWidth(),j=e.left+c(d).outerWidth()-g.left+2*a);""!==this.s.dt.oScroll.sY&&(a=c(this.s.dt.nTable.parentNode).offset(),e=c(this.s.dt.nTable.parentNode).scrollTop(),
g=c(this.s.dt.nTable.parentNode).scrollLeft(),f-=a.left-g,i-=a.left-g,n-=a.top-e,h-=a.top-e);a=this.dom.borderTop.style;a.top=n+"px";a.left=f+"px";a.height=this.s.border.width+"px";a.width=j+"px";a=this.dom.borderBottom.style;a.top=h+"px";a.left=f+"px";a.height=this.s.border.width+"px";a.width=j+"px";a=this.dom.borderLeft.style;a.top=n+"px";a.left=f+"px";a.height=k+"px";a.width=this.s.border.width+"px";a=this.dom.borderRight.style;a.top=n+"px";a.left=i+"px";a.height=k+"px";a.width=this.s.border.width+
"px"},_fnFillerDragStart:function(d){var b=this,a=this.dom.currentTarget;this.s.drag.dragging=!0;b.dom.borderTop.style.display="block";b.dom.borderRight.style.display="block";b.dom.borderBottom.style.display="block";b.dom.borderLeft.style.display="block";var e=this._fnTargetCoords(a);this.s.drag.startX=e.x;this.s.drag.startY=e.y;this.s.drag.startTd=a;this.s.drag.endTd=a;this._fnUpdateBorder(a,a);c(j).bind("mousemove.AutoFill",function(a){b._fnFillerDragMove.call(b,a)});c(j).bind("mouseup.AutoFill",
function(a){b._fnFillerFinish.call(b,a)});this.s.screen.y=d.pageY;this.s.screen.height=c(o).height();this.s.screen.scrollTop=c(j).scrollTop();""!==this.s.dt.oScroll.sY&&(this.s.scroller.top=c(this.s.dt.nTable.parentNode).offset().top,this.s.scroller.bottom=this.s.scroller.top+c(this.s.dt.nTable.parentNode).height());this.s.screen.interval=setInterval(function(){var a=c(j).scrollTop();b.s.screen.y=b.s.screen.y+(a-b.s.screen.scrollTop);b.s.screen.height-b.s.screen.y+a<50?c("html, body").animate({scrollTop:a+
50},240,"linear"):b.s.screen.y-a<50&&c("html, body").animate({scrollTop:a-50},240,"linear");b.s.dt.oScroll.sY!==""&&(b.s.screen.y>b.s.scroller.bottom-50?c(b.s.dt.nTable.parentNode).animate({scrollTop:c(b.s.dt.nTable.parentNode).scrollTop()+50},240,"linear"):b.s.screen.y<b.s.scroller.top+50&&c(b.s.dt.nTable.parentNode).animate({scrollTop:c(b.s.dt.nTable.parentNode).scrollTop()-50},240,"linear"))},250)},_fnFillerDragMove:function(d){if(d.target&&"TD"==d.target.nodeName.toUpperCase()&&d.target!=this.s.drag.endTd){var b=
this._fnTargetCoords(d.target);"y"==this.c.mode&&b.x!=this.s.drag.startX&&(d.target=c("tbody>tr:eq("+b.y+")>td:eq("+this.s.drag.startX+")",this.dom.table)[0]);"x"==this.c.mode&&b.y!=this.s.drag.startY&&(d.target=c("tbody>tr:eq("+this.s.drag.startY+")>td:eq("+b.x+")",this.dom.table)[0]);"either"==this.c.mode&&(b.x!=this.s.drag.startX?d.target=c("tbody>tr:eq("+this.s.drag.startY+")>td:eq("+b.x+")",this.dom.table)[0]:b.y!=this.s.drag.startY&&(d.target=c("tbody>tr:eq("+b.y+")>td:eq("+this.s.drag.startX+
")",this.dom.table)[0]));"both"!==this.c.mode&&(b=this._fnTargetCoords(d.target));var a=this.s.drag;a.endTd=d.target;b.y>=this.s.drag.startY?this._fnUpdateBorder(a.startTd,a.endTd):this._fnUpdateBorder(a.endTd,a.startTd);this._fnFillerPosition(d.target)}this.s.screen.y=d.pageY;this.s.screen.scrollTop=c(j).scrollTop();""!==this.s.dt.oScroll.sY&&(this.s.scroller.scrollTop=c(this.s.dt.nTable.parentNode).scrollTop(),this.s.scroller.top=c(this.s.dt.nTable.parentNode).offset().top,this.s.scroller.bottom=
this.s.scroller.top+c(this.s.dt.nTable.parentNode).height())},_fnFillerFinish:function(){var d=this,b,a;c(j).unbind("mousemove.AutoFill mouseup.AutoFill");this.dom.borderTop.style.display="none";this.dom.borderRight.style.display="none";this.dom.borderBottom.style.display="none";this.dom.borderLeft.style.display="none";this.s.drag.dragging=!1;clearInterval(this.s.screen.interval);var e=[],g=this.dom.table,f=this._fnTargetCoords(this.s.drag.startTd),i=this._fnTargetCoords(this.s.drag.endTd),h=function(a){return d.s.dt.oApi._fnVisibleToColumnIndex(d.s.dt,
a)};if(f.y<=i.y)for(b=f.y;b<=i.y;b++)if(f.x<=i.x)for(a=f.x;a<=i.x;a++)e.push({node:c("tbody>tr:eq("+b+")>td:eq("+a+")",g)[0],x:a-f.x,y:b-f.y,colIdx:h(a)});else for(a=f.x;a>=i.x;a--)e.push({node:c("tbody>tr:eq("+b+")>td:eq("+a+")",g)[0],x:a-f.x,y:b-f.y,colIdx:h(a)});else for(b=f.y;b>=i.y;b--)if(f.x<=i.x)for(a=f.x;a<=i.x;a++)e.push({node:c("tbody>tr:eq("+b+")>td:eq("+a+")",g)[0],x:a-f.x,y:b-f.y,colIdx:h(a)});else for(a=f.x;a>=i.x;a--)e.push({node:c("tbody>tr:eq("+b+")>td:eq("+a+")",g)[0],x:f.x-a,y:f.y-
b,colIdx:h(a)});if(!(1>=e.length)){var g=[],m;b=0;for(a=e.length;b<a;b++){var f=e[b],i=this.s.columns[f.colIdx],h=i.read.call(i,f.node),l=i.step.call(i,f.node,h,m,b,f.x,f.y);i.write.call(i,f.node,l);m=l;g.push({cell:f,colIdx:f.colIdx,newValue:l,oldValue:h})}null!==this.c.complete&&this.c.complete.call(this,g);k.Api?(new k.Api(this.s.dt)).draw(!1):this.s.dt.oInstance.fnDraw()}},_fnFillerDisplay:function(d){var b=this.dom.filler;if(!this.s.drag.dragging){var a="td"==d.target.nodeName.toLowerCase()?
d.target:c(d.target).parents("td")[0],e=this._fnTargetCoords(a).column;if(this.s.columns[e].enable)if("mouseover"==d.type)this.dom.currentTarget=a,this._fnFillerPosition(a),b.style.display="block";else{if(!d.relatedTarget||!d.relatedTarget.className.match(/AutoFill/))b.style.display="none"}else b.style.display="none"}},_fnFillerPosition:function(d){var b=c(d).offset(),a=this.dom.filler;a.style.top=b.top-this.s.filler.height/2-1+c(d).outerHeight()+"px";a.style.left=b.left-this.s.filler.width/2-1+c(d).outerWidth()+
"px"}};k.AutoFill=h;k.AutoFill=h;h.version="1.2.1";h.defaults={mode:"y",complete:null,column:{enable:!0,increment:!0,read:function(d){return c(d).html()},write:function(d,b){var a=c(d).parents("table");if(k.Api)a.DataTable().cell(d).data(b);else{var a=a.dataTable(),e=a.fnGetPosition(d);a.fnUpdate(b,e[0],e[2],!1)}},step:function(c,b,a,e,g,f){c=/(\-?\d+)/;return(e=this.increment&&a?a.match(c):null)?a.replace(c,parseInt(e[1],10)+(0>g||0>f?-1:1)):a===m?b:a}}};return h};"function"===typeof define&&define.amd?
define(["jquery","datatables"],l):"object"===typeof exports?l(require("jquery"),require("datatables")):jQuery&&!jQuery.fn.dataTable.AutoFill&&l(jQuery,jQuery.fn.dataTable)})(window,document);

@ -0,0 +1,372 @@
div.dataTables_length label {
font-weight: normal;
text-align: left;
white-space: nowrap;
}
div.dataTables_length select {
width: 75px;
display: inline-block;
}
div.dataTables_filter {
text-align: right;
}
div.dataTables_filter label {
font-weight: normal;
white-space: nowrap;
text-align: left;
}
div.dataTables_filter input {
margin-left: 0.5em;
display: inline-block;
width: auto;
}
div.dataTables_info {
padding-top: 8px;
white-space: nowrap;
}
div.dataTables_paginate {
margin: 0;
white-space: nowrap;
text-align: right;
}
div.dataTables_paginate ul.pagination {
margin: 2px 0;
white-space: nowrap;
}
@media screen and (max-width: 767px) {
div.dataTables_wrapper > div.row > div,
div.dataTables_length,
div.dataTables_filter,
div.dataTables_info,
div.dataTables_paginate {
text-align: center;
}
div.DTTT {
margin-bottom: 0.5em;
}
}
table.dataTable td,
table.dataTable th {
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
box-sizing: content-box;
}
table.dataTable {
clear: both;
margin-top: 6px !important;
margin-bottom: 6px !important;
max-width: none !important;
}
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 {
cursor: pointer;
position: relative;
}
table.dataTable thead .sorting:after,
table.dataTable thead .sorting_asc:after,
table.dataTable thead .sorting_desc:after {
position: absolute;
top: 8px;
right: 8px;
display: block;
font-family: 'Glyphicons Halflings';
opacity: 0.5;
}
table.dataTable thead .sorting:after {
opacity: 0.2;
content: "\e150"; /* sort */
}
table.dataTable thead .sorting_asc:after {
content: "\e155"; /* sort-by-attributes */
}
table.dataTable thead .sorting_desc:after {
content: "\e156"; /* sort-by-attributes-alt */
}
div.dataTables_scrollBody table.dataTable thead .sorting:after,
div.dataTables_scrollBody table.dataTable thead .sorting_asc:after,
div.dataTables_scrollBody table.dataTable thead .sorting_desc:after {
display: none;
}
table.dataTable thead .sorting_asc_disabled:after,
table.dataTable thead .sorting_desc_disabled:after {
color: #eee;
}
table.dataTable thead > tr > th {
padding-right: 30px;
}
table.dataTable th:active {
outline: none;
}
/* Condensed */
table.dataTable.table-condensed thead > tr > th {
padding-right: 20px;
}
table.dataTable.table-condensed thead .sorting:after,
table.dataTable.table-condensed thead .sorting_asc:after,
table.dataTable.table-condensed thead .sorting_desc:after {
top: 6px;
right: 6px;
}
/* Scrolling */
div.dataTables_scrollHead table {
margin-bottom: 0 !important;
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
}
div.dataTables_scrollHead table thead tr:last-child th:first-child,
div.dataTables_scrollHead table thead tr:last-child td:first-child {
border-bottom-left-radius: 0 !important;
border-bottom-right-radius: 0 !important;
}
div.dataTables_scrollBody table {
border-top: none;
margin-top: 0 !important;
margin-bottom: 0 !important;
}
div.dataTables_scrollBody tbody tr:first-child th,
div.dataTables_scrollBody tbody tr:first-child td {
border-top: none;
}
div.dataTables_scrollFoot table {
margin-top: 0 !important;
border-top: none;
}
/* Frustratingly the border-collapse:collapse used by Bootstrap makes the column
width calculations when using scrolling impossible to align columns. We have
to use separate
*/
table.table-bordered.dataTable {
border-collapse: separate !important;
}
table.table-bordered thead th,
table.table-bordered thead td {
border-left-width: 0;
border-top-width: 0;
}
table.table-bordered tbody th,
table.table-bordered tbody td {
border-left-width: 0;
border-bottom-width: 0;
}
table.table-bordered tfoot th,
table.table-bordered tfoot td {
border-left-width: 0;
border-bottom-width: 0;
}
table.table-bordered th:last-child,
table.table-bordered td:last-child {
border-right-width: 0;
}
div.dataTables_scrollHead table.table-bordered {
border-bottom-width: 0;
}
/*
* TableTools styles
*/
.table.dataTable tbody tr.active td,
.table.dataTable tbody tr.active th {
background-color: #08C;
color: white;
}
.table.dataTable tbody tr.active:hover td,
.table.dataTable tbody tr.active:hover th {
background-color: #0075b0 !important;
}
.table.dataTable tbody tr.active th > a,
.table.dataTable tbody tr.active td > a {
color: white;
}
.table-striped.dataTable tbody tr.active:nth-child(odd) td,
.table-striped.dataTable tbody tr.active:nth-child(odd) th {
background-color: #017ebc;
}
table.DTTT_selectable tbody tr {
cursor: pointer;
}
div.DTTT .btn:hover {
text-decoration: none !important;
}
ul.DTTT_dropdown.dropdown-menu {
z-index: 2003;
}
ul.DTTT_dropdown.dropdown-menu a {
color: #333 !important; /* needed only when demo_page.css is included */
}
ul.DTTT_dropdown.dropdown-menu li {
position: relative;
}
ul.DTTT_dropdown.dropdown-menu li:hover a {
background-color: #0088cc;
color: white !important;
}
div.DTTT_collection_background {
z-index: 2002;
}
/* TableTools information display */
div.DTTT_print_info {
position: fixed;
top: 50%;
left: 50%;
width: 400px;
height: 150px;
margin-left: -200px;
margin-top: -75px;
text-align: center;
color: #333;
padding: 10px 30px;
opacity: 0.95;
background-color: white;
border: 1px solid rgba(0, 0, 0, 0.2);
border-radius: 6px;
-webkit-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.5);
box-shadow: 0 3px 7px rgba(0, 0, 0, 0.5);
}
div.DTTT_print_info h6 {
font-weight: normal;
font-size: 28px;
line-height: 28px;
margin: 1em;
}
div.DTTT_print_info p {
font-size: 14px;
line-height: 20px;
}
div.dataTables_processing {
position: absolute;
top: 50%;
left: 50%;
width: 100%;
height: 60px;
margin-left: -50%;
margin-top: -25px;
padding-top: 20px;
padding-bottom: 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%);
}
/*
* FixedColumns styles
*/
div.DTFC_LeftHeadWrapper table,
div.DTFC_LeftFootWrapper table,
div.DTFC_RightHeadWrapper table,
div.DTFC_RightFootWrapper table,
table.DTFC_Cloned tr.even {
background-color: white;
margin-bottom: 0;
}
div.DTFC_RightHeadWrapper table ,
div.DTFC_LeftHeadWrapper table {
border-bottom: none !important;
margin-bottom: 0 !important;
border-top-right-radius: 0 !important;
border-bottom-left-radius: 0 !important;
border-bottom-right-radius: 0 !important;
}
div.DTFC_RightHeadWrapper table thead tr:last-child th:first-child,
div.DTFC_RightHeadWrapper table thead tr:last-child td:first-child,
div.DTFC_LeftHeadWrapper table thead tr:last-child th:first-child,
div.DTFC_LeftHeadWrapper table thead tr:last-child td:first-child {
border-bottom-left-radius: 0 !important;
border-bottom-right-radius: 0 !important;
}
div.DTFC_RightBodyWrapper table,
div.DTFC_LeftBodyWrapper table {
border-top: none;
margin: 0 !important;
}
div.DTFC_RightBodyWrapper tbody tr:first-child th,
div.DTFC_RightBodyWrapper tbody tr:first-child td,
div.DTFC_LeftBodyWrapper tbody tr:first-child th,
div.DTFC_LeftBodyWrapper tbody tr:first-child td {
border-top: none;
}
div.DTFC_RightFootWrapper table,
div.DTFC_LeftFootWrapper table {
border-top: none;
margin-top: 0 !important;
}
div.DTFC_LeftBodyWrapper table.dataTable thead .sorting:after,
div.DTFC_LeftBodyWrapper table.dataTable thead .sorting_asc:after,
div.DTFC_LeftBodyWrapper table.dataTable thead .sorting_desc:after,
div.DTFC_RightBodyWrapper table.dataTable thead .sorting:after,
div.DTFC_RightBodyWrapper table.dataTable thead .sorting_asc:after,
div.DTFC_RightBodyWrapper table.dataTable thead .sorting_desc:after {
display: none;
}
/*
* FixedHeader styles
*/
div.FixedHeader_Cloned table {
margin: 0 !important
}

@ -0,0 +1,206 @@
/*! DataTables Bootstrap 3 integration
* ©2011-2014 SpryMedia Ltd - datatables.net/license
*/
/**
* DataTables integration for Bootstrap 3. This requires Bootstrap 3 and
* DataTables 1.10 or newer.
*
* This file sets the defaults and adds options to DataTables to style its
* controls using Bootstrap. See http://datatables.net/manual/styling/bootstrap
* for further information.
*/
(function(window, document, undefined){
var factory = function( $, DataTable ) {
"use strict";
/* Set the defaults for DataTables initialisation */
$.extend( true, DataTable.defaults, {
dom:
"<'row'<'col-sm-6'l><'col-sm-6'f>>" +
"<'row'<'col-sm-12'tr>>" +
"<'row'<'col-sm-5'i><'col-sm-7'p>>",
renderer: 'bootstrap'
} );
/* Default class modification */
$.extend( DataTable.ext.classes, {
sWrapper: "dataTables_wrapper form-inline dt-bootstrap",
sFilterInput: "form-control input-sm",
sLengthSelect: "form-control input-sm"
} );
/* Bootstrap paging button renderer */
DataTable.ext.renderer.pageButton.bootstrap = function ( settings, host, idx, buttons, page, pages ) {
var api = new DataTable.Api( settings );
var classes = settings.oClasses;
var lang = settings.oLanguage.oPaginate;
var btnDisplay, btnClass, counter=0;
var attach = function( container, buttons ) {
var i, ien, node, button;
var clickHandler = function ( e ) {
e.preventDefault();
if ( !$(e.currentTarget).hasClass('disabled') ) {
api.page( e.data.action ).draw( false );
}
};
for ( i=0, ien=buttons.length ; i<ien ; i++ ) {
button = buttons[i];
if ( $.isArray( button ) ) {
attach( container, button );
}
else {
btnDisplay = '';
btnClass = '';
switch ( button ) {
case 'ellipsis':
btnDisplay = '&hellip;';
btnClass = 'disabled';
break;
case 'first':
btnDisplay = lang.sFirst;
btnClass = button + (page > 0 ?
'' : ' disabled');
break;
case 'previous':
btnDisplay = lang.sPrevious;
btnClass = button + (page > 0 ?
'' : ' disabled');
break;
case 'next':
btnDisplay = lang.sNext;
btnClass = button + (page < pages-1 ?
'' : ' disabled');
break;
case 'last':
btnDisplay = lang.sLast;
btnClass = button + (page < pages-1 ?
'' : ' disabled');
break;
default:
btnDisplay = button + 1;
btnClass = page === button ?
'active' : '';
break;
}
if ( btnDisplay ) {
node = $('<li>', {
'class': classes.sPageButton+' '+btnClass,
'id': idx === 0 && typeof button === 'string' ?
settings.sTableId +'_'+ button :
null
} )
.append( $('<a>', {
'href': '#',
'aria-controls': settings.sTableId,
'data-dt-idx': counter,
'tabindex': settings.iTabIndex
} )
.html( btnDisplay )
)
.appendTo( container );
settings.oApi._fnBindAction(
node, {action: button}, clickHandler
);
counter++;
}
}
}
};
// IE9 throws an 'unknown error' if document.activeElement is used
// inside an iframe or frame.
var activeEl;
try {
// Because this approach is destroying and recreating the paging
// elements, focus is lost on the select button which is bad for
// accessibility. So we want to restore focus once the draw has
// completed
activeEl = $(document.activeElement).data('dt-idx');
}
catch (e) {}
attach(
$(host).empty().html('<ul class="pagination"/>').children('ul'),
buttons
);
if ( activeEl ) {
$(host).find( '[data-dt-idx='+activeEl+']' ).focus();
}
};
/*
* TableTools Bootstrap compatibility
* Required TableTools 2.1+
*/
if ( DataTable.TableTools ) {
// Set the classes that TableTools uses to something suitable for Bootstrap
$.extend( true, DataTable.TableTools.classes, {
"container": "DTTT btn-group",
"buttons": {
"normal": "btn btn-default",
"disabled": "disabled"
},
"collection": {
"container": "DTTT_dropdown dropdown-menu",
"buttons": {
"normal": "",
"disabled": "disabled"
}
},
"print": {
"info": "DTTT_print_info"
},
"select": {
"row": "active"
}
} );
// Have the collection use a bootstrap compatible drop down
$.extend( true, DataTable.TableTools.DEFAULTS.oTags, {
"collection": {
"container": "ul",
"button": "li",
"liner": "a"
}
} );
}
}; // /factory
// Define as an AMD module if possible
if ( typeof define === 'function' && define.amd ) {
define( ['jquery', 'datatables'], factory );
}
else if ( typeof exports === 'object' ) {
// Node/CommonJS
factory( require('jquery'), require('datatables') );
}
else if ( jQuery ) {
// Otherwise simply initialise as normal, stopping multiple evaluation
factory( jQuery, jQuery.fn.dataTable );
}
})(window, document);

@ -0,0 +1,14 @@
/*
* Namespace DTCR - "DataTables ColReorder" plug-in
*/
table.DTCR_clonedTable {
background-color: rgba(255, 255, 255, 0.7);
z-index: 202;
}
div.DTCR_pointer {
width: 1px;
background-color: #0259C4;
z-index: 201;
}

@ -0,0 +1,26 @@
/*!
ColReorder 1.1.3
©2010-2014 SpryMedia Ltd - datatables.net/license
*/
(function(o,r,s){function p(d){for(var f=[],a=0,b=d.length;a<b;a++)f[d[a]]=a;return f}function l(d,f,a){f=d.splice(f,1)[0];d.splice(a,0,f)}function q(d,f,a){for(var b=[],e=0,h=d.childNodes.length;e<h;e++)1==d.childNodes[e].nodeType&&b.push(d.childNodes[e]);f=b[f];null!==a?d.insertBefore(f,b[a]):d.appendChild(f)}o=function(d){d.fn.dataTableExt.oApi.fnColReorder=function(a,b,e){var h=d.fn.dataTable.Api?!0:!1,c,g,f,m,n=a.aoColumns.length,i,j;i=function(a,b,c){if(a[b]){var e=a[b].split("."),d=e.shift();
isNaN(1*d)||(a[b]=c[1*d]+"."+e.join("."))}};if(b!=e)if(0>b||b>=n)this.oApi._fnLog(a,1,"ColReorder 'from' index is out of bounds: "+b);else if(0>e||e>=n)this.oApi._fnLog(a,1,"ColReorder 'to' index is out of bounds: "+e);else{f=[];c=0;for(g=n;c<g;c++)f[c]=c;l(f,b,e);var k=p(f);c=0;for(g=a.aaSorting.length;c<g;c++)a.aaSorting[c][0]=k[a.aaSorting[c][0]];if(null!==a.aaSortingFixed){c=0;for(g=a.aaSortingFixed.length;c<g;c++)a.aaSortingFixed[c][0]=k[a.aaSortingFixed[c][0]]}c=0;for(g=n;c<g;c++){j=a.aoColumns[c];
f=0;for(m=j.aDataSort.length;f<m;f++)j.aDataSort[f]=k[j.aDataSort[f]];h&&(j.idx=k[j.idx])}h&&d.each(a.aLastSort,function(b,c){a.aLastSort[b].src=k[c.src]});c=0;for(g=n;c<g;c++)j=a.aoColumns[c],"number"==typeof j.mData?(j.mData=k[j.mData],a.oApi._fnColumnOptions(a,c,{})):d.isPlainObject(j.mData)&&(i(j.mData,"_",k),i(j.mData,"filter",k),i(j.mData,"sort",k),i(j.mData,"type",k),a.oApi._fnColumnOptions(a,c,{}));if(a.aoColumns[b].bVisible){f=this.oApi._fnColumnIndexToVisible(a,b);m=null;for(c=e<b?e:e+1;null===
m&&c<n;)m=this.oApi._fnColumnIndexToVisible(a,c),c++;i=a.nTHead.getElementsByTagName("tr");c=0;for(g=i.length;c<g;c++)q(i[c],f,m);if(null!==a.nTFoot){i=a.nTFoot.getElementsByTagName("tr");c=0;for(g=i.length;c<g;c++)q(i[c],f,m)}c=0;for(g=a.aoData.length;c<g;c++)null!==a.aoData[c].nTr&&q(a.aoData[c].nTr,f,m)}l(a.aoColumns,b,e);l(a.aoPreSearchCols,b,e);c=0;for(g=a.aoData.length;c<g;c++)i=a.aoData[c],h?(i.anCells&&l(i.anCells,b,e),"dom"!==i.src&&d.isArray(i._aData)&&l(i._aData,b,e)):(d.isArray(i._aData)&&
l(i._aData,b,e),l(i._anHidden,b,e));c=0;for(g=a.aoHeader.length;c<g;c++)l(a.aoHeader[c],b,e);if(null!==a.aoFooter){c=0;for(g=a.aoFooter.length;c<g;c++)l(a.aoFooter[c],b,e)}h&&(new d.fn.dataTable.Api(a)).rows().invalidate();c=0;for(g=n;c<g;c++)d(a.aoColumns[c].nTh).off("click.DT"),this.oApi._fnSortAttachListener(a,a.aoColumns[c].nTh,c);d(a.oInstance).trigger("column-reorder",[a,{iFrom:b,iTo:e,aiInvertMapping:k}])}};var f=function(a,b){var e;d.fn.dataTable.Api?e=(new d.fn.dataTable.Api(a)).settings()[0]:
a.fnSettings?e=a.fnSettings():"string"===typeof a?d.fn.dataTable.fnIsDataTable(d(a)[0])&&(e=d(a).eq(0).dataTable().fnSettings()):a.nodeName&&"table"===a.nodeName.toLowerCase()?d.fn.dataTable.fnIsDataTable(a.nodeName)&&(e=d(a.nodeName).dataTable().fnSettings()):a instanceof jQuery?d.fn.dataTable.fnIsDataTable(a[0])&&(e=a.eq(0).dataTable().fnSettings()):e=a;if(e._colReorder)throw"ColReorder already initialised on table #"+e.nTable.id;var h=d.fn.dataTable.camelToHungarian;h&&(h(f.defaults,f.defaults,
!0),h(f.defaults,b||{}));this.s={dt:null,init:d.extend(!0,{},f.defaults,b),fixed:0,fixedRight:0,reorderCallback:null,mouse:{startX:-1,startY:-1,offsetX:-1,offsetY:-1,target:-1,targetIndex:-1,fromIndex:-1},aoTargets:[]};this.dom={drag:null,pointer:null};this.s.dt=e;this.s.dt._colReorder=this;this._fnConstruct();e.oApi._fnCallbackReg(e,"aoDestroyCallback",d.proxy(this._fnDestroy,this),"ColReorder");return this};f.prototype={fnReset:function(){for(var a=[],b=0,e=this.s.dt.aoColumns.length;b<e;b++)a.push(this.s.dt.aoColumns[b]._ColReorder_iOrigCol);
this._fnOrderColumns(a);return this},fnGetCurrentOrder:function(){return this.fnOrder()},fnOrder:function(a){if(a===s){for(var a=[],b=0,e=this.s.dt.aoColumns.length;b<e;b++)a.push(this.s.dt.aoColumns[b]._ColReorder_iOrigCol);return a}this._fnOrderColumns(p(a));return this},_fnConstruct:function(){var a=this,b=this.s.dt.aoColumns.length,e;this.s.init.iFixedColumns&&(this.s.fixed=this.s.init.iFixedColumns);this.s.fixedRight=this.s.init.iFixedColumnsRight?this.s.init.iFixedColumnsRight:0;this.s.init.fnReorderCallback&&
(this.s.reorderCallback=this.s.init.fnReorderCallback);for(e=0;e<b;e++)e>this.s.fixed-1&&e<b-this.s.fixedRight&&this._fnMouseListener(e,this.s.dt.aoColumns[e].nTh),this.s.dt.aoColumns[e]._ColReorder_iOrigCol=e;this.s.dt.oApi._fnCallbackReg(this.s.dt,"aoStateSaveParams",function(b,c){a._fnStateSave.call(a,c)},"ColReorder_State");var d=null;this.s.init.aiOrder&&(d=this.s.init.aiOrder.slice());this.s.dt.oLoadedState&&("undefined"!=typeof this.s.dt.oLoadedState.ColReorder&&this.s.dt.oLoadedState.ColReorder.length==
this.s.dt.aoColumns.length)&&(d=this.s.dt.oLoadedState.ColReorder);if(d)if(a.s.dt._bInitComplete)b=p(d),a._fnOrderColumns.call(a,b);else{var c=!1;this.s.dt.aoDrawCallback.push({fn:function(){if(!a.s.dt._bInitComplete&&!c){c=true;var b=p(d);a._fnOrderColumns.call(a,b)}},sName:"ColReorder_Pre"})}else this._fnSetColumnIndexes()},_fnOrderColumns:function(a){if(a.length!=this.s.dt.aoColumns.length)this.s.dt.oInstance.oApi._fnLog(this.s.dt,1,"ColReorder - array reorder does not match known number of columns. Skipping.");
else{for(var b=0,e=a.length;b<e;b++){var h=d.inArray(b,a);b!=h&&(l(a,h,b),this.s.dt.oInstance.fnColReorder(h,b))}(""!==this.s.dt.oScroll.sX||""!==this.s.dt.oScroll.sY)&&this.s.dt.oInstance.fnAdjustColumnSizing(!1);this.s.dt.oInstance.oApi._fnSaveState(this.s.dt);this._fnSetColumnIndexes();null!==this.s.reorderCallback&&this.s.reorderCallback.call(this)}},_fnStateSave:function(a){var b,e,h,c=this.s.dt.aoColumns;a.ColReorder=[];if(a.aaSorting){for(b=0;b<a.aaSorting.length;b++)a.aaSorting[b][0]=c[a.aaSorting[b][0]]._ColReorder_iOrigCol;
var f=d.extend(!0,[],a.aoSearchCols);b=0;for(e=c.length;b<e;b++)h=c[b]._ColReorder_iOrigCol,a.aoSearchCols[h]=f[b],a.abVisCols[h]=c[b].bVisible,a.ColReorder.push(h)}else if(a.order){for(b=0;b<a.order.length;b++)a.order[b][0]=c[a.order[b][0]]._ColReorder_iOrigCol;f=d.extend(!0,[],a.columns);b=0;for(e=c.length;b<e;b++)h=c[b]._ColReorder_iOrigCol,a.columns[h]=f[b],a.ColReorder.push(h)}},_fnMouseListener:function(a,b){var e=this;d(b).on("mousedown.ColReorder",function(a){a.preventDefault();e._fnMouseDown.call(e,
a,b)})},_fnMouseDown:function(a,b){var e=this,f=d(a.target).closest("th, td").offset(),c=parseInt(d(b).attr("data-column-index"),10);c!==s&&(this.s.mouse.startX=a.pageX,this.s.mouse.startY=a.pageY,this.s.mouse.offsetX=a.pageX-f.left,this.s.mouse.offsetY=a.pageY-f.top,this.s.mouse.target=this.s.dt.aoColumns[c].nTh,this.s.mouse.targetIndex=c,this.s.mouse.fromIndex=c,this._fnRegions(),d(r).on("mousemove.ColReorder",function(a){e._fnMouseMove.call(e,a)}).on("mouseup.ColReorder",function(a){e._fnMouseUp.call(e,
a)}))},_fnMouseMove:function(a){if(null===this.dom.drag){if(5>Math.pow(Math.pow(a.pageX-this.s.mouse.startX,2)+Math.pow(a.pageY-this.s.mouse.startY,2),0.5))return;this._fnCreateDragNode()}this.dom.drag.css({left:a.pageX-this.s.mouse.offsetX,top:a.pageY-this.s.mouse.offsetY});for(var b=!1,e=this.s.mouse.toIndex,d=1,c=this.s.aoTargets.length;d<c;d++)if(a.pageX<this.s.aoTargets[d-1].x+(this.s.aoTargets[d].x-this.s.aoTargets[d-1].x)/2){this.dom.pointer.css("left",this.s.aoTargets[d-1].x);this.s.mouse.toIndex=
this.s.aoTargets[d-1].to;b=!0;break}b||(this.dom.pointer.css("left",this.s.aoTargets[this.s.aoTargets.length-1].x),this.s.mouse.toIndex=this.s.aoTargets[this.s.aoTargets.length-1].to);this.s.init.bRealtime&&e!==this.s.mouse.toIndex&&(this.s.dt.oInstance.fnColReorder(this.s.mouse.fromIndex,this.s.mouse.toIndex),this.s.mouse.fromIndex=this.s.mouse.toIndex,this._fnRegions())},_fnMouseUp:function(){d(r).off("mousemove.ColReorder mouseup.ColReorder");null!==this.dom.drag&&(this.dom.drag.remove(),this.dom.pointer.remove(),
this.dom.drag=null,this.dom.pointer=null,this.s.dt.oInstance.fnColReorder(this.s.mouse.fromIndex,this.s.mouse.toIndex),this._fnSetColumnIndexes(),(""!==this.s.dt.oScroll.sX||""!==this.s.dt.oScroll.sY)&&this.s.dt.oInstance.fnAdjustColumnSizing(!1),this.s.dt.oInstance.oApi._fnSaveState(this.s.dt),null!==this.s.reorderCallback&&this.s.reorderCallback.call(this))},_fnRegions:function(){var a=this.s.dt.aoColumns;this.s.aoTargets.splice(0,this.s.aoTargets.length);this.s.aoTargets.push({x:d(this.s.dt.nTable).offset().left,
to:0});for(var b=0,e=0,f=a.length;e<f;e++)e!=this.s.mouse.fromIndex&&b++,a[e].bVisible&&this.s.aoTargets.push({x:d(a[e].nTh).offset().left+d(a[e].nTh).outerWidth(),to:b});0!==this.s.fixedRight&&this.s.aoTargets.splice(this.s.aoTargets.length-this.s.fixedRight);0!==this.s.fixed&&this.s.aoTargets.splice(0,this.s.fixed)},_fnCreateDragNode:function(){var a=""!==this.s.dt.oScroll.sX||""!==this.s.dt.oScroll.sY,b=this.s.dt.aoColumns[this.s.mouse.targetIndex].nTh,e=b.parentNode,f=e.parentNode,c=f.parentNode,
g=d(b).clone();this.dom.drag=d(c.cloneNode(!1)).addClass("DTCR_clonedTable").append(d(f.cloneNode(!1)).append(d(e.cloneNode(!1)).append(g[0]))).css({position:"absolute",top:0,left:0,width:d(b).outerWidth(),height:d(b).outerHeight()}).appendTo("body");this.dom.pointer=d("<div></div>").addClass("DTCR_pointer").css({position:"absolute",top:a?d("div.dataTables_scroll",this.s.dt.nTableWrapper).offset().top:d(this.s.dt.nTable).offset().top,height:a?d("div.dataTables_scroll",this.s.dt.nTableWrapper).height():
d(this.s.dt.nTable).height()}).appendTo("body")},_fnDestroy:function(){var a,b;a=0;for(b=this.s.dt.aoDrawCallback.length;a<b;a++)if("ColReorder_Pre"===this.s.dt.aoDrawCallback[a].sName){this.s.dt.aoDrawCallback.splice(a,1);break}d(this.s.dt.nTHead).find("*").off(".ColReorder");d.each(this.s.dt.aoColumns,function(a,b){d(b.nTh).removeAttr("data-column-index")});this.s=this.s.dt._colReorder=null},_fnSetColumnIndexes:function(){d.each(this.s.dt.aoColumns,function(a,b){d(b.nTh).attr("data-column-index",
a)})}};f.defaults={aiOrder:null,bRealtime:!1,iFixedColumns:0,iFixedColumnsRight:0,fnReorderCallback:null};f.version="1.1.3";d.fn.dataTable.ColReorder=f;d.fn.DataTable.ColReorder=f;"function"==typeof d.fn.dataTable&&"function"==typeof d.fn.dataTableExt.fnVersionCheck&&d.fn.dataTableExt.fnVersionCheck("1.9.3")?d.fn.dataTableExt.aoFeatures.push({fnInit:function(a){var b=a.oInstance;a._colReorder?b.oApi._fnLog(a,1,"ColReorder attempted to initialise twice. Ignoring second"):(b=a.oInit,new f(a,b.colReorder||
b.oColReorder||{}));return null},cFeature:"R",sFeature:"ColReorder"}):alert("Warning: ColReorder requires DataTables 1.9.3 or greater - www.datatables.net/download");d.fn.dataTable.Api&&(d.fn.dataTable.Api.register("colReorder.reset()",function(){return this.iterator("table",function(a){a._colReorder.fnReset()})}),d.fn.dataTable.Api.register("colReorder.order()",function(a){return a?this.iterator("table",function(b){b._colReorder.fnOrder(a)}):this.context.length?this.context[0]._colReorder.fnOrder():
null}));return f};"function"===typeof define&&define.amd?define(["jquery","datatables"],o):"object"===typeof exports?o(require("jquery"),require("datatables")):jQuery&&!jQuery.fn.dataTable.ColReorder&&o(jQuery,jQuery.fn.dataTable)})(window,document);

@ -0,0 +1,185 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* ColVis styles
*/
div.ColVis {
float: right;
margin-bottom: 1em;
}
button.ColVis_Button,
ul.ColVis_collection li {
position: relative;
float: left;
margin-right: 3px;
padding: 5px 8px;
border: 1px solid #999;
cursor: pointer;
*cursor: hand;
font-size: 0.88em;
color: black !important;
white-space: nowrap;
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
-ms-border-radius: 2px;
-o-border-radius: 2px;
border-radius: 2px;
-webkit-box-shadow: 1px 1px 3px #ccc;
-moz-box-shadow: 1px 1px 3px #ccc;
-ms-box-shadow: 1px 1px 3px #ccc;
-o-box-shadow: 1px 1px 3px #ccc;
box-shadow: 1px 1px 3px #ccc;
/* Generated by http://www.colorzilla.com/gradient-editor/ */
background: #ffffff; /* Old browsers */
background: -webkit-linear-gradient(top, #ffffff 0%,#f3f3f3 89%,#f9f9f9 100%); /* Chrome10+,Safari5.1+ */
background: -moz-linear-gradient(top, #ffffff 0%,#f3f3f3 89%,#f9f9f9 100%); /* FF3.6+ */
background: -ms-linear-gradient(top, #ffffff 0%,#f3f3f3 89%,#f9f9f9 100%); /* IE10+ */
background: -o-linear-gradient(top, #ffffff 0%,#f3f3f3 89%,#f9f9f9 100%); /* Opera 11.10+ */
background: linear-gradient(top, #ffffff 0%,#f3f3f3 89%,#f9f9f9 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#f9f9f9',GradientType=0 ); /* IE6-9 */
}
.ColVis_Button:hover,
ul.ColVis_collection li:hover {
border: 1px solid #666;
text-decoration: none !important;
-webkit-box-shadow: 1px 1px 3px #999;
-moz-box-shadow: 1px 1px 3px #999;
-ms-box-shadow: 1px 1px 3px #999;
-o-box-shadow: 1px 1px 3px #999;
box-shadow: 1px 1px 3px #999;
background: #f3f3f3; /* Old browsers */
background: -webkit-linear-gradient(top, #f3f3f3 0%,#e2e2e2 89%,#f4f4f4 100%); /* Chrome10+,Safari5.1+ */
background: -moz-linear-gradient(top, #f3f3f3 0%,#e2e2e2 89%,#f4f4f4 100%); /* FF3.6+ */
background: -ms-linear-gradient(top, #f3f3f3 0%,#e2e2e2 89%,#f4f4f4 100%); /* IE10+ */
background: -o-linear-gradient(top, #f3f3f3 0%,#e2e2e2 89%,#f4f4f4 100%); /* Opera 11.10+ */
background: linear-gradient(top, #f3f3f3 0%,#e2e2e2 89%,#f4f4f4 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f3f3f3', endColorstr='#f4f4f4',GradientType=0 ); /* IE6-9 */
}
button.ColVis_Button {
height: 30px;
padding: 3px 8px;
}
button.ColVis_Button::-moz-focus-inner {
border: none !important;
padding: 0;
}
button.ColVis_Button:active {
outline: none;
}
div.ColVis_collectionBackground {
position: fixed;
top: 0;
left: 0;
height: 100%;
width: 100%;
background-color: black;
z-index: 1100;
}
ul.ColVis_collection {
list-style: none;
width: 150px;
padding: 8px 8px 4px 8px;
margin: 0;
border: 1px solid #ccc;
border: 1px solid rgba( 0, 0, 0, 0.4 );
background-color: #f3f3f3;
background-color: rgba( 255, 255, 255, 0.3 );
overflow: hidden;
z-index: 2002;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
-ms-border-radius: 5px;
-o-border-radius: 5px;
border-radius: 5px;
-webkit-box-shadow: 3px 3px 5px rgba(0, 0, 0, 0.3);
-moz-box-shadow: 3px 3px 5px rgba(0, 0, 0, 0.3);
-ms-box-shadow: 3px 3px 5px rgba(0, 0, 0, 0.3);
-o-box-shadow: 3px 3px 5px rgba(0, 0, 0, 0.3);
box-shadow: 3px 3px 5px rgba(0, 0, 0, 0.3);
}
ul.ColVis_collection li {
position: relative;
height: auto;
left: 0;
right: 0;
padding: 0.5em;
display: block;
float: none;
margin-bottom: 4px;
-webkit-box-shadow: 1px 1px 3px #999;
-moz-box-shadow: 1px 1px 3px #999;
-ms-box-shadow: 1px 1px 3px #999;
-o-box-shadow: 1px 1px 3px #999;
box-shadow: 1px 1px 3px #999;
}
ul.ColVis_collection li {
text-align: left;
}
ul.ColVis_collection li.ColVis_Button:hover {
border: 1px solid #999;
background-color: #f0f0f0;
}
ul.ColVis_collection li span {
display: inline-block;
padding-left: 0.5em;
cursor: pointer;
}
ul.ColVis_collection li.ColVis_Special {
border-color: #555;
background: rgb(237,237,237); /* Old browsers */
background: -webkit-linear-gradient(top, rgba(237,237,237,1) 0%,rgba(214,214,214,1) 77%,rgba(232,232,232,1) 100%); /* Chrome10+,Safari5.1+ */
background: -moz-linear-gradient(top, rgba(237,237,237,1) 0%, rgba(214,214,214,1) 77%, rgba(232,232,232,1) 100%); /* FF3.6+ */
background: -ms-linear-gradient(top, rgba(237,237,237,1) 0%,rgba(214,214,214,1) 77%,rgba(232,232,232,1) 100%); /* IE10+ */
background: -o-linear-gradient(top, rgba(237,237,237,1) 0%,rgba(214,214,214,1) 77%,rgba(232,232,232,1) 100%); /* Opera 11.10+ */
background: linear-gradient(to bottom, rgba(237,237,237,1) 0%,rgba(214,214,214,1) 77%,rgba(232,232,232,1) 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ededed', endColorstr='#e8e8e8',GradientType=0 ); /* IE6-9 */
}
ul.ColVis_collection li.ColVis_Special:hover {
background: #e2e2e2; /* Old browsers */
background: -webkit-linear-gradient(top, #d0d0d0 0%,#d5d5d5 89%,#e2e2e2 100%); /* Chrome10+,Safari5.1+ */
background: -moz-linear-gradient(top, #d0d0d0 0%,#d5d5d5 89%,#e2e2e2 100%); /* FF3.6+ */
background: -ms-linear-gradient(top, #d0d0d0 0%,#d5d5d5 89%,#e2e2e2 100%); /* IE10+ */
background: -o-linear-gradient(top, #d0d0d0 0%,#d5d5d5 89%,#e2e2e2 100%); /* Opera 11.10+ */
background: linear-gradient(top, #d0d0d0 0%,#d5d5d5 89%,#e2e2e2 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f3f3f3', endColorstr='#e2e2e2',GradientType=0 ); /* IE6-9 */
}
span.ColVis_radio {
display: inline-block;
width: 20px;
}
div.ColVis_catcher {
position: absolute;
z-index: 1101;
}
.disabled {
color: #999;
}

@ -0,0 +1 @@
div.ColVis{float:right;margin-bottom:1em}button.ColVis_Button,ul.ColVis_collection li{position:relative;float:left;margin-right:3px;padding:5px 8px;border:1px solid #999;cursor:pointer;*cursor:hand;font-size:0.88em;color:black !important;white-space:nowrap;-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;-o-border-radius:2px;border-radius:2px;-webkit-box-shadow:1px 1px 3px #ccc;-moz-box-shadow:1px 1px 3px #ccc;-ms-box-shadow:1px 1px 3px #ccc;-o-box-shadow:1px 1px 3px #ccc;box-shadow:1px 1px 3px #ccc;background:#ffffff;background:-webkit-linear-gradient(top, #fff 0%, #f3f3f3 89%, #f9f9f9 100%);background:-moz-linear-gradient(top, #fff 0%, #f3f3f3 89%, #f9f9f9 100%);background:-ms-linear-gradient(top, #fff 0%, #f3f3f3 89%, #f9f9f9 100%);background:-o-linear-gradient(top, #fff 0%, #f3f3f3 89%, #f9f9f9 100%);background:linear-gradient(top, #fff 0%, #f3f3f3 89%, #f9f9f9 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#f9f9f9',GradientType=0 )}.ColVis_Button:hover,ul.ColVis_collection li:hover{border:1px solid #666;text-decoration:none !important;-webkit-box-shadow:1px 1px 3px #999;-moz-box-shadow:1px 1px 3px #999;-ms-box-shadow:1px 1px 3px #999;-o-box-shadow:1px 1px 3px #999;box-shadow:1px 1px 3px #999;background:#f3f3f3;background:-webkit-linear-gradient(top, #f3f3f3 0%, #e2e2e2 89%, #f4f4f4 100%);background:-moz-linear-gradient(top, #f3f3f3 0%, #e2e2e2 89%, #f4f4f4 100%);background:-ms-linear-gradient(top, #f3f3f3 0%, #e2e2e2 89%, #f4f4f4 100%);background:-o-linear-gradient(top, #f3f3f3 0%, #e2e2e2 89%, #f4f4f4 100%);background:linear-gradient(top, #f3f3f3 0%, #e2e2e2 89%, #f4f4f4 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f3f3f3', endColorstr='#f4f4f4',GradientType=0 )}button.ColVis_Button{height:30px;padding:3px 8px}button.ColVis_Button::-moz-focus-inner{border:none !important;padding:0}button.ColVis_Button:active{outline:none}div.ColVis_collectionBackground{position:fixed;top:0;left:0;height:100%;width:100%;background-color:black;z-index:1100}ul.ColVis_collection{list-style:none;width:150px;padding:8px 8px 4px 8px;margin:0;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.4);background-color:#f3f3f3;background-color:rgba(255,255,255,0.3);overflow:hidden;z-index:2002;-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;-o-border-radius:5px;border-radius:5px;-webkit-box-shadow:3px 3px 5px rgba(0,0,0,0.3);-moz-box-shadow:3px 3px 5px rgba(0,0,0,0.3);-ms-box-shadow:3px 3px 5px rgba(0,0,0,0.3);-o-box-shadow:3px 3px 5px rgba(0,0,0,0.3);box-shadow:3px 3px 5px rgba(0,0,0,0.3)}ul.ColVis_collection li{position:relative;height:auto;left:0;right:0;padding:0.5em;display:block;float:none;margin-bottom:4px;-webkit-box-shadow:1px 1px 3px #999;-moz-box-shadow:1px 1px 3px #999;-ms-box-shadow:1px 1px 3px #999;-o-box-shadow:1px 1px 3px #999;box-shadow:1px 1px 3px #999}ul.ColVis_collection li{text-align:left}ul.ColVis_collection li.ColVis_Button:hover{border:1px solid #999;background-color:#f0f0f0}ul.ColVis_collection li span{display:inline-block;padding-left:0.5em;cursor:pointer}ul.ColVis_collection li.ColVis_Special{border-color:#555;background:#ededed;background:-webkit-linear-gradient(top, #ededed 0%, #d6d6d6 77%, #e8e8e8 100%);background:-moz-linear-gradient(top, #ededed 0%, #d6d6d6 77%, #e8e8e8 100%);background:-ms-linear-gradient(top, #ededed 0%, #d6d6d6 77%, #e8e8e8 100%);background:-o-linear-gradient(top, #ededed 0%, #d6d6d6 77%, #e8e8e8 100%);background:linear-gradient(to bottom, #ededed 0%, #d6d6d6 77%, #e8e8e8 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ededed', endColorstr='#e8e8e8',GradientType=0 )}ul.ColVis_collection li.ColVis_Special:hover{background:#e2e2e2;background:-webkit-linear-gradient(top, #d0d0d0 0%, #d5d5d5 89%, #e2e2e2 100%);background:-moz-linear-gradient(top, #d0d0d0 0%, #d5d5d5 89%, #e2e2e2 100%);background:-ms-linear-gradient(top, #d0d0d0 0%, #d5d5d5 89%, #e2e2e2 100%);background:-o-linear-gradient(top, #d0d0d0 0%, #d5d5d5 89%, #e2e2e2 100%);background:linear-gradient(top, #d0d0d0 0%, #d5d5d5 89%, #e2e2e2 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f3f3f3', endColorstr='#e2e2e2',GradientType=0 )}span.ColVis_radio{display:inline-block;width:20px}div.ColVis_catcher{position:absolute;z-index:1101}.disabled{color:#999}

@ -0,0 +1,41 @@
button.ColVis_Button,
ul.ColVis_collection li {
padding: 0.5em;
}
ul.ColVis_collection {
margin: 0;
padding: 0;
overflow: hidden;
z-index: 2002;
}
ul.ColVis_collection li {
clear: both;
display: block;
text-align: left;
margin: -1px 0 0 0;
}
ul.ColVis_collection li span {
display: inline-block;
padding-left: 0.5em;
cursor: pointer;
}
div.ColVis_collectionBackground {
position: fixed;
top: 0;
left: 0;
height: 100%;
width: 100%;
background-color: black;
z-index: 1100;
}
div.ColVis_catcher {
position: absolute;
z-index: 1101;
}

@ -0,0 +1,24 @@
/*!
ColVis 1.1.2
©2010-2015 SpryMedia Ltd - datatables.net/license
*/
(function(j,i,k){j=function(d){var e=function(a,b){(!this.CLASS||"ColVis"!=this.CLASS)&&alert("Warning: ColVis must be initialised with the keyword 'new'");"undefined"==typeof b&&(b={});var c=d.fn.dataTable.camelToHungarian;c&&(c(e.defaults,e.defaults,!0),c(e.defaults,b));this.s={dt:null,oInit:b,hidden:!0,abOriginal:[]};this.dom={wrapper:null,button:null,collection:null,background:null,catcher:null,buttons:[],groupButtons:[],restore:null};e.aInstances.push(this);this.s.dt=d.fn.dataTable.Api?(new d.fn.dataTable.Api(a)).settings()[0]:
a;this._fnConstruct(b);return this};e.prototype={button:function(){return this.dom.wrapper},fnRebuild:function(){this.rebuild()},rebuild:function(){for(var a=this.dom.buttons.length-1;0<=a;a--)this.dom.collection.removeChild(this.dom.buttons[a]);this.dom.buttons.splice(0,this.dom.buttons.length);this.dom.groupButtons.splice(0,this.dom.groupButtons.length);this.dom.restore&&this.dom.restore.parentNode(this.dom.restore);this._fnAddGroups();this._fnAddButtons();this._fnDrawCallback()},_fnConstruct:function(a){this._fnApplyCustomisation(a);
var b=this,c,f;this.dom.wrapper=i.createElement("div");this.dom.wrapper.className="ColVis";this.dom.button=d("<button />",{"class":!this.s.dt.bJUI?"ColVis_Button ColVis_MasterButton":"ColVis_Button ColVis_MasterButton ui-button ui-state-default"}).append("<span>"+this.s.buttonText+"</span>").bind("mouseover"==this.s.activate?"mouseover":"click",function(a){a.preventDefault();b._fnCollectionShow()}).appendTo(this.dom.wrapper)[0];this.dom.catcher=this._fnDomCatcher();this.dom.collection=this._fnDomCollection();
this.dom.background=this._fnDomBackground();this._fnAddGroups();this._fnAddButtons();c=0;for(f=this.s.dt.aoColumns.length;c<f;c++)this.s.abOriginal.push(this.s.dt.aoColumns[c].bVisible);this.s.dt.aoDrawCallback.push({fn:function(){b._fnDrawCallback.call(b)},sName:"ColVis"});d(this.s.dt.oInstance).bind("column-reorder.dt",function(a,d,e){c=0;for(f=b.s.aiExclude.length;c<f;c++)b.s.aiExclude[c]=e.aiInvertMapping[b.s.aiExclude[c]];a=b.s.abOriginal.splice(e.iFrom,1)[0];b.s.abOriginal.splice(e.iTo,0,a);
b.fnRebuild()});d(this.s.dt.oInstance).bind("destroy.dt",function(){d(b.dom.wrapper).remove()});this._fnDrawCallback()},_fnApplyCustomisation:function(a){d.extend(!0,this.s,e.defaults,a);!this.s.showAll&&this.s.bShowAll&&(this.s.showAll=this.s.sShowAll);!this.s.restore&&this.s.bRestore&&(this.s.restore=this.s.sRestore);var a=this.s.groups,b=this.s.aoGroups;if(a)for(var c=0,f=a.length;c<f;c++)if(a[c].title&&(b[c].sTitle=a[c].title),a[c].columns)b[c].aiColumns=a[c].columns},_fnDrawCallback:function(){for(var a=
this.s.dt.aoColumns,b=this.dom.buttons,c=this.s.aoGroups,f,g=0,h=b.length;g<h;g++)f=b[g],f.__columnIdx!==k&&d("input",f).prop("checked",a[f.__columnIdx].bVisible);b=0;for(f=c.length;b<f;b++){a:{for(var g=c[b].aiColumns,h=0,e=g.length;h<e;h++)if(!1===a[g[h]].bVisible){g=!1;break a}g=!0}if(g)d("input",this.dom.groupButtons[b]).prop("checked",!0),d("input",this.dom.groupButtons[b]).prop("indeterminate",!1);else{a:{g=c[b].aiColumns;h=0;for(e=g.length;h<e;h++)if(!0===a[g[h]].bVisible){g=!1;break a}g=!0}g?
(d("input",this.dom.groupButtons[b]).prop("checked",!1),d("input",this.dom.groupButtons[b]).prop("indeterminate",!1)):d("input",this.dom.groupButtons[b]).prop("indeterminate",!0)}}},_fnAddGroups:function(){var a;if("undefined"!=typeof this.s.aoGroups)for(var b=0,c=this.s.aoGroups.length;b<c;b++)a=this._fnDomGroupButton(b),this.dom.groupButtons.push(a),this.dom.buttons.push(a),this.dom.collection.appendChild(a)},_fnAddButtons:function(){var a,b=this.s.dt.aoColumns;if(-1===d.inArray("all",this.s.aiExclude))for(var c=
0,f=b.length;c<f;c++)-1===d.inArray(c,this.s.aiExclude)&&(a=this._fnDomColumnButton(c),a.__columnIdx=c,this.dom.buttons.push(a));"alpha"===this.s.order&&this.dom.buttons.sort(function(a,c){var d=b[a.__columnIdx].sTitle,f=b[c.__columnIdx].sTitle;return d===f?0:d<f?-1:1});this.s.restore&&(a=this._fnDomRestoreButton(),a.className+=" ColVis_Restore",this.dom.buttons.push(a));this.s.showAll&&(a=this._fnDomShowXButton(this.s.showAll,!0),a.className+=" ColVis_ShowAll",this.dom.buttons.push(a));this.s.showNone&&
(a=this._fnDomShowXButton(this.s.showNone,!1),a.className+=" ColVis_ShowNone",this.dom.buttons.push(a));d(this.dom.collection).append(this.dom.buttons)},_fnDomRestoreButton:function(){var a=this;return d('<li class="ColVis_Special '+(this.s.dt.bJUI?"ui-button ui-state-default":"")+'">'+this.s.restore+"</li>").click(function(){for(var b=0,c=a.s.abOriginal.length;b<c;b++)a.s.dt.oInstance.fnSetColumnVis(b,a.s.abOriginal[b],!1);a._fnAdjustOpenRows();a.s.dt.oInstance.fnAdjustColumnSizing(!1);a.s.dt.oInstance.fnDraw(!1)})[0]},
_fnDomShowXButton:function(a,b){var c=this;return d('<li class="ColVis_Special '+(this.s.dt.bJUI?"ui-button ui-state-default":"")+'">'+a+"</li>").click(function(){for(var a=0,d=c.s.abOriginal.length;a<d;a++)-1===c.s.aiExclude.indexOf(a)&&c.s.dt.oInstance.fnSetColumnVis(a,b,!1);c._fnAdjustOpenRows();c.s.dt.oInstance.fnAdjustColumnSizing(!1);c.s.dt.oInstance.fnDraw(!1)})[0]},_fnDomGroupButton:function(a){var b=this,c=this.s.aoGroups[a];return d('<li class="ColVis_Special '+(this.s.dt.bJUI?"ui-button ui-state-default":
"")+'"><label><input type="checkbox" /><span>'+c.sTitle+"</span></label></li>").click(function(a){var g=!d("input",this).is(":checked");"li"!==a.target.nodeName.toLowerCase()&&(g=!g);for(a=0;a<c.aiColumns.length;a++)b.s.dt.oInstance.fnSetColumnVis(c.aiColumns[a],g)})[0]},_fnDomColumnButton:function(a){var b=this,c=this.s.dt.aoColumns[a],f=this.s.dt,c=null===this.s.fnLabel?c.sTitle:this.s.fnLabel(a,c.sTitle,c.nTh);return d("<li "+(f.bJUI?'class="ui-button ui-state-default"':"")+'><label><input type="checkbox" /><span>'+
c+"</span></label></li>").click(function(c){var e=!d("input",this).is(":checked");if("li"!==c.target.nodeName.toLowerCase()&&("input"==c.target.nodeName.toLowerCase()||null===b.s.fnStateChange))e=!e;var i=d.fn.dataTableExt.iApiIndex;d.fn.dataTableExt.iApiIndex=b._fnDataTablesApiIndex.call(b);f.oFeatures.bServerSide?(b.s.dt.oInstance.fnSetColumnVis(a,e,!1),b.s.dt.oInstance.fnAdjustColumnSizing(!1),(""!==f.oScroll.sX||""!==f.oScroll.sY)&&b.s.dt.oInstance.oApi._fnScrollDraw(b.s.dt),b._fnDrawCallback()):
b.s.dt.oInstance.fnSetColumnVis(a,e);d.fn.dataTableExt.iApiIndex=i;null!==b.s.fnStateChange&&("span"==c.target.nodeName.toLowerCase()&&c.preventDefault(),b.s.fnStateChange.call(b,a,e))})[0]},_fnDataTablesApiIndex:function(){for(var a=0,b=this.s.dt.oInstance.length;a<b;a++)if(this.s.dt.oInstance[a]==this.s.dt.nTable)return a;return 0},_fnDomCollection:function(){return d("<ul />",{"class":!this.s.dt.bJUI?"ColVis_collection":"ColVis_collection ui-buttonset ui-buttonset-multi"}).css({display:"none",
opacity:0,position:!this.s.bCssPosition?"absolute":""})[0]},_fnDomCatcher:function(){var a=this,b=i.createElement("div");b.className="ColVis_catcher";d(b).click(function(){a._fnCollectionHide.call(a,null,null)});return b},_fnDomBackground:function(){var a=this,b=d("<div></div>").addClass("ColVis_collectionBackground").css("opacity",0).click(function(){a._fnCollectionHide.call(a,null,null)});"mouseover"==this.s.activate&&b.mouseover(function(){a.s.overcollection=!1;a._fnCollectionHide.call(a,null,
null)});return b[0]},_fnCollectionShow:function(){var a=this,b;b=d(this.dom.button).offset();var c=this.dom.collection,f=this.dom.background,e=parseInt(b.left,10),h=parseInt(b.top+d(this.dom.button).outerHeight(),10);this.s.bCssPosition||(c.style.top=h+"px",c.style.left=e+"px");d(c).css({display:"block",opacity:0});f.style.bottom="0px";f.style.right="0px";h=this.dom.catcher.style;h.height=d(this.dom.button).outerHeight()+"px";h.width=d(this.dom.button).outerWidth()+"px";h.top=b.top+"px";h.left=e+
"px";i.body.appendChild(f);i.body.appendChild(c);i.body.appendChild(this.dom.catcher);d(c).animate({opacity:1},a.s.iOverlayFade);d(f).animate({opacity:0.1},a.s.iOverlayFade,"linear",function(){d.browser&&(d.browser.msie&&d.browser.version=="6.0")&&a._fnDrawCallback()});this.s.bCssPosition||(b="left"==this.s.sAlign?e:e-d(c).outerWidth()+d(this.dom.button).outerWidth(),c.style.left=b+"px",f=d(c).outerWidth(),d(c).outerHeight(),e=d(i).width(),b+f>e&&(c.style.left=e-f+"px"));this.s.hidden=!1},_fnCollectionHide:function(){var a=
this;!this.s.hidden&&null!==this.dom.collection&&(this.s.hidden=!0,d(this.dom.collection).animate({opacity:0},a.s.iOverlayFade,function(){this.style.display="none"}),d(this.dom.background).animate({opacity:0},a.s.iOverlayFade,function(){i.body.removeChild(a.dom.background);i.body.removeChild(a.dom.catcher)}))},_fnAdjustOpenRows:function(){for(var a=this.s.dt.aoOpenRows,b=this.s.dt.oApi._fnVisbleColumns(this.s.dt),c=0,d=a.length;c<d;c++)a[c].nTr.getElementsByTagName("td")[0].colSpan=b}};e.fnRebuild=
function(a){var b=null;"undefined"!=typeof a&&(b=d.fn.dataTable.Api?(new d.fn.dataTable.Api(a)).table().node():a.fnSettings().nTable);for(var c=0,f=e.aInstances.length;c<f;c++)("undefined"==typeof a||b==e.aInstances[c].s.dt.nTable)&&e.aInstances[c].fnRebuild()};e.defaults={active:"click",buttonText:"Show / hide columns",aiExclude:[],bRestore:!1,sRestore:"Restore original",bShowAll:!1,sShowAll:"Show All",sAlign:"left",fnStateChange:null,iOverlayFade:500,fnLabel:null,bCssPosition:!1,aoGroups:[],order:"column"};
e.aInstances=[];e.prototype.CLASS="ColVis";e.VERSION="1.1.2";e.prototype.VERSION=e.VERSION;"function"==typeof d.fn.dataTable&&"function"==typeof d.fn.dataTableExt.fnVersionCheck&&d.fn.dataTableExt.fnVersionCheck("1.7.0")?d.fn.dataTableExt.aoFeatures.push({fnInit:function(a){var b=a.oInit;return(new e(a,b.colVis||b.oColVis||{})).button()},cFeature:"C",sFeature:"ColVis"}):alert("Warning: ColVis requires DataTables 1.7 or greater - www.datatables.net/download");d.fn.dataTable.ColVis=e;return d.fn.DataTable.ColVis=
e};"function"===typeof define&&define.amd?define(["jquery","datatables"],j):"object"===typeof exports?j(require("jquery"),require("datatables")):jQuery&&!jQuery.fn.dataTable.ColVis&&j(jQuery,jQuery.fn.dataTable)})(window,document);

@ -0,0 +1,25 @@
/* Block out what is behind the fixed column's header and footer */
table.DTFC_Cloned thead,
table.DTFC_Cloned tfoot {
background-color: white;
}
/* Block out the gap above the scrollbar on the right, when there is a fixed
* right column
*/
div.DTFC_Blocker {
background-color: white;
}
div.DTFC_LeftWrapper table.dataTable,
div.DTFC_RightWrapper table.dataTable {
margin-bottom: 0;
z-index: 2;
}
div.DTFC_LeftWrapper table.dataTable.no-footer,
div.DTFC_RightWrapper table.dataTable.no-footer {
border-bottom: none;
}

@ -0,0 +1 @@
table.DTFC_Cloned thead,table.DTFC_Cloned tfoot{background-color:white}div.DTFC_Blocker{background-color:white}div.DTFC_LeftWrapper table.dataTable,div.DTFC_RightWrapper table.dataTable{margin-bottom:0;z-index:2}div.DTFC_LeftWrapper table.dataTable.no-footer,div.DTFC_RightWrapper table.dataTable.no-footer{border-bottom:none}

@ -0,0 +1,30 @@
/*!
FixedColumns 3.0.4
©2010-2014 SpryMedia Ltd - datatables.net/license
*/
(function(r,s,t){var p=function(d){var j=function(a,b){var c=this;if(this instanceof j){"undefined"==typeof b&&(b={});var g=d.fn.dataTable.camelToHungarian;g&&(g(j.defaults,j.defaults,!0),g(j.defaults,b));g=d.fn.dataTable.Api?(new d.fn.dataTable.Api(a)).settings()[0]:a.fnSettings();this.s={dt:g,iTableColumns:g.aoColumns.length,aiOuterWidths:[],aiInnerWidths:[]};this.dom={scroller:null,header:null,body:null,footer:null,grid:{wrapper:null,dt:null,left:{wrapper:null,head:null,body:null,foot:null},right:{wrapper:null,
head:null,body:null,foot:null}},clone:{left:{header:null,body:null,footer:null},right:{header:null,body:null,footer:null}}};g._oFixedColumns=this;g._bInitComplete?this._fnConstruct(b):g.oApi._fnCallbackReg(g,"aoInitComplete",function(){c._fnConstruct(b)},"FixedColumns")}else alert("FixedColumns warning: FixedColumns must be initialised with the 'new' keyword.")};j.prototype={fnUpdate:function(){this._fnDraw(!0)},fnRedrawLayout:function(){this._fnColCalc();this._fnGridLayout();this.fnUpdate()},fnRecalculateHeight:function(a){delete a._DTTC_iHeight;
a.style.height="auto"},fnSetRowHeight:function(a,b){a.style.height=b+"px"},fnGetPosition:function(a){var b=this.s.dt.oInstance;if(d(a).parents(".DTFC_Cloned").length){if("tr"===a.nodeName.toLowerCase())return a=d(a).index(),b.fnGetPosition(d("tr",this.s.dt.nTBody)[a]);var c=d(a).index(),a=d(a.parentNode).index();return[b.fnGetPosition(d("tr",this.s.dt.nTBody)[a]),c,b.oApi._fnVisibleToColumnIndex(this.s.dt,c)]}return b.fnGetPosition(a)},_fnConstruct:function(a){var b=this;if("function"!=typeof this.s.dt.oInstance.fnVersionCheck||
!0!==this.s.dt.oInstance.fnVersionCheck("1.8.0"))alert("FixedColumns "+j.VERSION+" required DataTables 1.8.0 or later. Please upgrade your DataTables installation");else if(""===this.s.dt.oScroll.sX)this.s.dt.oInstance.oApi._fnLog(this.s.dt,1,"FixedColumns is not needed (no x-scrolling in DataTables enabled), so no action will be taken. Use 'FixedHeader' for column fixing when scrolling is not enabled");else{this.s=d.extend(!0,this.s,j.defaults,a);a=this.s.dt.oClasses;this.dom.grid.dt=d(this.s.dt.nTable).parents("div."+
a.sScrollWrapper)[0];this.dom.scroller=d("div."+a.sScrollBody,this.dom.grid.dt)[0];this._fnColCalc();this._fnGridSetup();var c;d(this.dom.scroller).on("mouseover.DTFC touchstart.DTFC",function(){c="main"}).on("scroll.DTFC",function(){if("main"===c&&(0<b.s.iLeftColumns&&(b.dom.grid.left.liner.scrollTop=b.dom.scroller.scrollTop),0<b.s.iRightColumns))b.dom.grid.right.liner.scrollTop=b.dom.scroller.scrollTop});var g="onwheel"in s.createElement("div")?"wheel.DTFC":"mousewheel.DTFC";if(0<b.s.iLeftColumns)d(b.dom.grid.left.liner).on("mouseover.DTFC touchstart.DTFC",
function(){c="left"}).on("scroll.DTFC",function(){"left"===c&&(b.dom.scroller.scrollTop=b.dom.grid.left.liner.scrollTop,0<b.s.iRightColumns&&(b.dom.grid.right.liner.scrollTop=b.dom.grid.left.liner.scrollTop))}).on(g,function(a){b.dom.scroller.scrollLeft-="wheel"===a.type?-a.originalEvent.deltaX:a.originalEvent.wheelDeltaX});if(0<b.s.iRightColumns)d(b.dom.grid.right.liner).on("mouseover.DTFC touchstart.DTFC",function(){c="right"}).on("scroll.DTFC",function(){"right"===c&&(b.dom.scroller.scrollTop=
b.dom.grid.right.liner.scrollTop,0<b.s.iLeftColumns&&(b.dom.grid.left.liner.scrollTop=b.dom.grid.right.liner.scrollTop))}).on(g,function(a){b.dom.scroller.scrollLeft-="wheel"===a.type?-a.originalEvent.deltaX:a.originalEvent.wheelDeltaX});d(r).on("resize.DTFC",function(){b._fnGridLayout.call(b)});var f=!0,e=d(this.s.dt.nTable);e.on("draw.dt.DTFC",function(){b._fnDraw.call(b,f);f=!1}).on("column-sizing.dt.DTFC",function(){b._fnColCalc();b._fnGridLayout(b)}).on("column-visibility.dt.DTFC",function(){b._fnColCalc();
b._fnGridLayout(b);b._fnDraw(!0)}).on("destroy.dt.DTFC",function(){e.off("column-sizing.dt.DTFC destroy.dt.DTFC draw.dt.DTFC");d(b.dom.scroller).off("scroll.DTFC mouseover.DTFC");d(r).off("resize.DTFC");d(b.dom.grid.left.liner).off("scroll.DTFC mouseover.DTFC "+g);d(b.dom.grid.left.wrapper).remove();d(b.dom.grid.right.liner).off("scroll.DTFC mouseover.DTFC "+g);d(b.dom.grid.right.wrapper).remove()});this._fnGridLayout();this.s.dt.oInstance.fnDraw(!1)}},_fnColCalc:function(){var a=this,b=0,c=0;this.s.aiInnerWidths=
[];this.s.aiOuterWidths=[];d.each(this.s.dt.aoColumns,function(g,f){var e=d(f.nTh),h;if(e.filter(":visible").length){var i=e.outerWidth();0===a.s.aiOuterWidths.length&&(h=d(a.s.dt.nTable).css("border-left-width"),i+="string"===typeof h?1:parseInt(h,10));a.s.aiOuterWidths.length===a.s.dt.aoColumns.length-1&&(h=d(a.s.dt.nTable).css("border-right-width"),i+="string"===typeof h?1:parseInt(h,10));a.s.aiOuterWidths.push(i);a.s.aiInnerWidths.push(e.width());g<a.s.iLeftColumns&&(b+=i);a.s.iTableColumns-a.s.iRightColumns<=
g&&(c+=i)}else a.s.aiInnerWidths.push(0),a.s.aiOuterWidths.push(0)});this.s.iLeftWidth=b;this.s.iRightWidth=c},_fnGridSetup:function(){var a=this._fnDTOverflow(),b;this.dom.body=this.s.dt.nTable;this.dom.header=this.s.dt.nTHead.parentNode;this.dom.header.parentNode.parentNode.style.position="relative";var c=d('<div class="DTFC_ScrollWrapper" style="position:relative; clear:both;"><div class="DTFC_LeftWrapper" style="position:absolute; top:0; left:0;"><div class="DTFC_LeftHeadWrapper" style="position:relative; top:0; left:0; overflow:hidden;"></div><div class="DTFC_LeftBodyWrapper" style="position:relative; top:0; left:0; overflow:hidden;"><div class="DTFC_LeftBodyLiner" style="position:relative; top:0; left:0; overflow-y:scroll;"></div></div><div class="DTFC_LeftFootWrapper" style="position:relative; top:0; left:0; overflow:hidden;"></div></div><div class="DTFC_RightWrapper" style="position:absolute; top:0; left:0;"><div class="DTFC_RightHeadWrapper" style="position:relative; top:0; left:0;"><div class="DTFC_RightHeadBlocker DTFC_Blocker" style="position:absolute; top:0; bottom:0;"></div></div><div class="DTFC_RightBodyWrapper" style="position:relative; top:0; left:0; overflow:hidden;"><div class="DTFC_RightBodyLiner" style="position:relative; top:0; left:0; overflow-y:scroll;"></div></div><div class="DTFC_RightFootWrapper" style="position:relative; top:0; left:0;"><div class="DTFC_RightFootBlocker DTFC_Blocker" style="position:absolute; top:0; bottom:0;"></div></div></div></div>')[0],
g=c.childNodes[0],f=c.childNodes[1];this.dom.grid.dt.parentNode.insertBefore(c,this.dom.grid.dt);c.appendChild(this.dom.grid.dt);this.dom.grid.wrapper=c;0<this.s.iLeftColumns&&(this.dom.grid.left.wrapper=g,this.dom.grid.left.head=g.childNodes[0],this.dom.grid.left.body=g.childNodes[1],this.dom.grid.left.liner=d("div.DTFC_LeftBodyLiner",c)[0],c.appendChild(g));0<this.s.iRightColumns&&(this.dom.grid.right.wrapper=f,this.dom.grid.right.head=f.childNodes[0],this.dom.grid.right.body=f.childNodes[1],this.dom.grid.right.liner=
d("div.DTFC_RightBodyLiner",c)[0],b=d("div.DTFC_RightHeadBlocker",c)[0],b.style.width=a.bar+"px",b.style.right=-a.bar+"px",this.dom.grid.right.headBlock=b,b=d("div.DTFC_RightFootBlocker",c)[0],b.style.width=a.bar+"px",b.style.right=-a.bar+"px",this.dom.grid.right.footBlock=b,c.appendChild(f));if(this.s.dt.nTFoot&&(this.dom.footer=this.s.dt.nTFoot.parentNode,0<this.s.iLeftColumns&&(this.dom.grid.left.foot=g.childNodes[2]),0<this.s.iRightColumns))this.dom.grid.right.foot=f.childNodes[2]},_fnGridLayout:function(){var a=
this.dom.grid,b=d(a.wrapper).width(),c=d(this.s.dt.nTable.parentNode).outerHeight(),g=d(this.s.dt.nTable.parentNode.parentNode).outerHeight(),f=this._fnDTOverflow(),e=this.s.iLeftWidth,h=this.s.iRightWidth,i=function(a,b){f.bar?a.style.width=b+f.bar+"px":(a.style.width=b+20+"px",a.style.paddingRight="20px",a.style.boxSizing="border-box")};f.x&&(c-=f.bar);a.wrapper.style.height=g+"px";0<this.s.iLeftColumns&&(a.left.wrapper.style.width=e+"px",a.left.wrapper.style.height="1px",a.left.body.style.height=
c+"px",a.left.foot&&(a.left.foot.style.top=(f.x?f.bar:0)+"px"),i(a.left.liner,e),a.left.liner.style.height=c+"px");0<this.s.iRightColumns&&(b-=h,f.y&&(b-=f.bar),a.right.wrapper.style.width=h+"px",a.right.wrapper.style.left=b+"px",a.right.wrapper.style.height="1px",a.right.body.style.height=c+"px",a.right.foot&&(a.right.foot.style.top=(f.x?f.bar:0)+"px"),i(a.right.liner,h),a.right.liner.style.height=c+"px",a.right.headBlock.style.display=f.y?"block":"none",a.right.footBlock.style.display=f.y?"block":
"none")},_fnDTOverflow:function(){var a=this.s.dt.nTable,b=a.parentNode,c={x:!1,y:!1,bar:this.s.dt.oScroll.iBarWidth};a.offsetWidth>b.clientWidth&&(c.x=!0);a.offsetHeight>b.clientHeight&&(c.y=!0);return c},_fnDraw:function(a){this._fnGridLayout();this._fnCloneLeft(a);this._fnCloneRight(a);null!==this.s.fnDrawCallback&&this.s.fnDrawCallback.call(this,this.dom.clone.left,this.dom.clone.right);d(this).trigger("draw.dtfc",{leftClone:this.dom.clone.left,rightClone:this.dom.clone.right})},_fnCloneRight:function(a){if(!(0>=
this.s.iRightColumns)){var b,c=[];for(b=this.s.iTableColumns-this.s.iRightColumns;b<this.s.iTableColumns;b++)this.s.dt.aoColumns[b].bVisible&&c.push(b);this._fnClone(this.dom.clone.right,this.dom.grid.right,c,a)}},_fnCloneLeft:function(a){if(!(0>=this.s.iLeftColumns)){var b,c=[];for(b=0;b<this.s.iLeftColumns;b++)this.s.dt.aoColumns[b].bVisible&&c.push(b);this._fnClone(this.dom.clone.left,this.dom.grid.left,c,a)}},_fnCopyLayout:function(a,b){for(var c=[],g=[],f=[],e=0,h=a.length;e<h;e++){var i=[];
i.nTr=d(a[e].nTr).clone(!0,!0)[0];for(var k=0,j=this.s.iTableColumns;k<j;k++)if(-1!==d.inArray(k,b)){var m=d.inArray(a[e][k].cell,f);-1===m?(m=d(a[e][k].cell).clone(!0,!0)[0],g.push(m),f.push(a[e][k].cell),i.push({cell:m,unique:a[e][k].unique})):i.push({cell:g[m],unique:a[e][k].unique})}c.push(i)}return c},_fnClone:function(a,b,c,g){var f=this,e,h,i,k,j,m,o,n,q,l=this.s.dt;if(g){null!==a.header&&a.header.parentNode.removeChild(a.header);a.header=d(this.dom.header).clone(!0,!0)[0];a.header.className+=
" DTFC_Cloned";a.header.style.width="100%";b.head.appendChild(a.header);n=this._fnCopyLayout(l.aoHeader,c);k=d(">thead",a.header);k.empty();e=0;for(h=n.length;e<h;e++)k[0].appendChild(n[e].nTr);l.oApi._fnDrawHead(l,n,!0)}else{n=this._fnCopyLayout(l.aoHeader,c);q=[];l.oApi._fnDetectHeader(q,d(">thead",a.header)[0]);e=0;for(h=n.length;e<h;e++){i=0;for(k=n[e].length;i<k;i++)q[e][i].cell.className=n[e][i].cell.className,d("span.DataTables_sort_icon",q[e][i].cell).each(function(){this.className=d("span.DataTables_sort_icon",
n[e][i].cell)[0].className})}}this._fnEqualiseHeights("thead",this.dom.header,a.header);"auto"==this.s.sHeightMatch&&d(">tbody>tr",f.dom.body).css("height","auto");null!==a.body&&(a.body.parentNode.removeChild(a.body),a.body=null);a.body=d(this.dom.body).clone(!0)[0];a.body.className+=" DTFC_Cloned";a.body.style.paddingBottom=l.oScroll.iBarWidth+"px";a.body.style.marginBottom=2*l.oScroll.iBarWidth+"px";null!==a.body.getAttribute("id")&&a.body.removeAttribute("id");d(">thead>tr",a.body).empty();d(">tfoot",
a.body).remove();var p=d("tbody",a.body)[0];d(p).empty();if(0<l.aiDisplay.length){h=d(">thead>tr",a.body)[0];for(o=0;o<c.length;o++)j=c[o],m=d(l.aoColumns[j].nTh).clone(!0)[0],m.innerHTML="",k=m.style,k.paddingTop="0",k.paddingBottom="0",k.borderTopWidth="0",k.borderBottomWidth="0",k.height=0,k.width=f.s.aiInnerWidths[j]+"px",h.appendChild(m);d(">tbody>tr",f.dom.body).each(function(a){var b=this.cloneNode(false);b.removeAttribute("id");a=f.s.dt.aoData[f.s.dt.oFeatures.bServerSide===false?f.s.dt.aiDisplay[f.s.dt._iDisplayStart+
a]:a].anCells||d(this).children("td, th");for(o=0;o<c.length;o++){j=c[o];if(a.length>0){m=d(a[j]).clone(true,true)[0];b.appendChild(m)}}p.appendChild(b)})}else d(">tbody>tr",f.dom.body).each(function(){m=this.cloneNode(true);m.className=m.className+" DTFC_NoData";d("td",m).html("");p.appendChild(m)});a.body.style.width="100%";a.body.style.margin="0";a.body.style.padding="0";l.oScroller!==t&&(h=l.oScroller.dom.force,b.forcer?b.forcer.style.height=h.style.height:(b.forcer=h.cloneNode(!0),b.liner.appendChild(b.forcer)));
b.liner.appendChild(a.body);this._fnEqualiseHeights("tbody",f.dom.body,a.body);if(null!==l.nTFoot){if(g){null!==a.footer&&a.footer.parentNode.removeChild(a.footer);a.footer=d(this.dom.footer).clone(!0,!0)[0];a.footer.className+=" DTFC_Cloned";a.footer.style.width="100%";b.foot.appendChild(a.footer);n=this._fnCopyLayout(l.aoFooter,c);b=d(">tfoot",a.footer);b.empty();e=0;for(h=n.length;e<h;e++)b[0].appendChild(n[e].nTr);l.oApi._fnDrawHead(l,n,!0)}else{n=this._fnCopyLayout(l.aoFooter,c);b=[];l.oApi._fnDetectHeader(b,
d(">tfoot",a.footer)[0]);e=0;for(h=n.length;e<h;e++){i=0;for(k=n[e].length;i<k;i++)b[e][i].cell.className=n[e][i].cell.className}}this._fnEqualiseHeights("tfoot",this.dom.footer,a.footer)}b=l.oApi._fnGetUniqueThs(l,d(">thead",a.header)[0]);d(b).each(function(a){j=c[a];this.style.width=f.s.aiInnerWidths[j]+"px"});null!==f.s.dt.nTFoot&&(b=l.oApi._fnGetUniqueThs(l,d(">tfoot",a.footer)[0]),d(b).each(function(a){j=c[a];this.style.width=f.s.aiInnerWidths[j]+"px"}))},_fnGetTrNodes:function(a){for(var b=
[],c=0,d=a.childNodes.length;c<d;c++)"TR"==a.childNodes[c].nodeName.toUpperCase()&&b.push(a.childNodes[c]);return b},_fnEqualiseHeights:function(a,b,c){if(!("none"==this.s.sHeightMatch&&"thead"!==a&&"tfoot"!==a)){var g,f,e=b.getElementsByTagName(a)[0],c=c.getElementsByTagName(a)[0],a=d(">"+a+">tr:eq(0)",b).children(":first");a.outerHeight();a.height();for(var e=this._fnGetTrNodes(e),b=this._fnGetTrNodes(c),h=[],c=0,a=b.length;c<a;c++)g=e[c].offsetHeight,f=b[c].offsetHeight,g=f>g?f:g,"semiauto"==this.s.sHeightMatch&&
(e[c]._DTTC_iHeight=g),h.push(g);c=0;for(a=b.length;c<a;c++)b[c].style.height=h[c]+"px",e[c].style.height=h[c]+"px"}}};j.defaults={iLeftColumns:1,iRightColumns:0,fnDrawCallback:null,sHeightMatch:"semiauto"};j.version="3.0.4";d.fn.dataTable.FixedColumns=j;return d.fn.DataTable.FixedColumns=j};"function"===typeof define&&define.amd?define(["jquery","datatables"],p):"object"===typeof exports?p(require("jquery"),require("datatables")):jQuery&&!jQuery.fn.dataTable.FixedColumns&&p(jQuery,jQuery.fn.dataTable)})(window,
document);

@ -0,0 +1,30 @@
/*!
FixedHeader 2.1.2
©2010-2014 SpryMedia Ltd - datatables.net/license
*/
var FixedHeader;
(function(j,k,h){var l=function(e){FixedHeader=function(a,b){if(!this instanceof FixedHeader)alert("FixedHeader warning: FixedHeader must be initialised with the 'new' keyword.");else{var c={aoCache:[],oSides:{top:!0,bottom:!1,left:0,right:0},oZIndexes:{top:104,bottom:103,left:102,right:101},oCloneOnDraw:{top:!1,bottom:!1,left:!0,right:!0},oMes:{iTableWidth:0,iTableHeight:0,iTableLeft:0,iTableRight:0,iTableTop:0,iTableBottom:0},oOffset:{top:0},nTable:null,bFooter:!1,bInitComplete:!1};this.fnGetSettings=
function(){return c};this.fnUpdate=function(){this._fnUpdateClones();this._fnUpdatePositions()};this.fnPosition=function(){this._fnUpdatePositions()};var d=e.fn.dataTable.Api?(new e.fn.dataTable.Api(a)).settings()[0]:a.fnSettings();d._oPluginFixedHeader=this;this.fnInit(d,b)}};FixedHeader.prototype={fnInit:function(a,b){var c=this.fnGetSettings(),d=this;this.fnInitSettings(c,b);""!==a.oScroll.sX||""!==a.oScroll.sY?alert("FixedHeader 2 is not supported with DataTables' scrolling mode at this time"):
(c.nTable=a.nTable,a.aoDrawCallback.unshift({fn:function(){FixedHeader.fnMeasure();d._fnUpdateClones.call(d);d._fnUpdatePositions.call(d)},sName:"FixedHeader"}),c.bFooter=0<e(">tfoot",c.nTable).length?!0:!1,c.oSides.top&&c.aoCache.push(d._fnCloneTable("fixedHeader","FixedHeader_Header",d._fnCloneThead)),c.oSides.bottom&&c.aoCache.push(d._fnCloneTable("fixedFooter","FixedHeader_Footer",d._fnCloneTfoot)),c.oSides.left&&c.aoCache.push(d._fnCloneTable("fixedLeft","FixedHeader_Left",d._fnCloneTLeft,c.oSides.left)),
c.oSides.right&&c.aoCache.push(d._fnCloneTable("fixedRight","FixedHeader_Right",d._fnCloneTRight,c.oSides.right)),FixedHeader.afnScroll.push(function(){d._fnUpdatePositions.call(d)}),e(j).resize(function(){FixedHeader.fnMeasure();d._fnUpdateClones.call(d);d._fnUpdatePositions.call(d)}),e(c.nTable).on("column-reorder.dt",function(){FixedHeader.fnMeasure();d._fnUpdateClones(!0);d._fnUpdatePositions()}).on("column-visibility.dt",function(){FixedHeader.fnMeasure();d._fnUpdateClones(!0);d._fnUpdatePositions()}),
FixedHeader.fnMeasure(),d._fnUpdateClones(),d._fnUpdatePositions(),c.bInitComplete=!0)},fnInitSettings:function(a,b){if(b!==h&&(b.top!==h&&(a.oSides.top=b.top),b.bottom!==h&&(a.oSides.bottom=b.bottom),"boolean"==typeof b.left?a.oSides.left=b.left?1:0:b.left!==h&&(a.oSides.left=b.left),"boolean"==typeof b.right?a.oSides.right=b.right?1:0:b.right!==h&&(a.oSides.right=b.right),b.zTop!==h&&(a.oZIndexes.top=b.zTop),b.zBottom!==h&&(a.oZIndexes.bottom=b.zBottom),b.zLeft!==h&&(a.oZIndexes.left=b.zLeft),b.zRight!==
h&&(a.oZIndexes.right=b.zRight),b.offsetTop!==h&&(a.oOffset.top=b.offsetTop),b.alwaysCloneTop!==h&&(a.oCloneOnDraw.top=b.alwaysCloneTop),b.alwaysCloneBottom!==h&&(a.oCloneOnDraw.bottom=b.alwaysCloneBottom),b.alwaysCloneLeft!==h&&(a.oCloneOnDraw.left=b.alwaysCloneLeft),b.alwaysCloneRight!==h))a.oCloneOnDraw.right=b.alwaysCloneRight},_fnCloneTable:function(a,b,c,d){var f=this.fnGetSettings(),g;"absolute"!=e(f.nTable.parentNode).css("position")&&(f.nTable.parentNode.style.position="relative");g=f.nTable.cloneNode(!1);
g.removeAttribute("id");var i=k.createElement("div");i.style.position="absolute";i.style.top="0px";i.style.left="0px";i.className+=" FixedHeader_Cloned "+a+" "+b;"fixedHeader"==a&&(i.style.zIndex=f.oZIndexes.top);"fixedFooter"==a&&(i.style.zIndex=f.oZIndexes.bottom);"fixedLeft"==a?i.style.zIndex=f.oZIndexes.left:"fixedRight"==a&&(i.style.zIndex=f.oZIndexes.right);g.style.margin="0";i.appendChild(g);k.body.appendChild(i);return{nNode:g,nWrapper:i,sType:a,sPosition:"",sTop:"",sLeft:"",fnClone:c,iCells:d}},
_fnMeasure:function(){var a=this.fnGetSettings(),b=a.oMes,c=e(a.nTable),d=c.offset(),f=this._fnSumScroll(a.nTable.parentNode,"scrollTop");this._fnSumScroll(a.nTable.parentNode,"scrollLeft");b.iTableWidth=c.outerWidth();b.iTableHeight=c.outerHeight();b.iTableLeft=d.left+a.nTable.parentNode.scrollLeft;b.iTableTop=d.top+f;b.iTableRight=b.iTableLeft+b.iTableWidth;b.iTableRight=FixedHeader.oDoc.iWidth-b.iTableLeft-b.iTableWidth;b.iTableBottom=FixedHeader.oDoc.iHeight-b.iTableTop-b.iTableHeight},_fnSumScroll:function(a,
b){for(var c=a[b];(a=a.parentNode)&&!("HTML"==a.nodeName||"BODY"==a.nodeName);)c=a[b];return c},_fnUpdatePositions:function(){var a=this.fnGetSettings();this._fnMeasure();for(var b=0,c=a.aoCache.length;b<c;b++)"fixedHeader"==a.aoCache[b].sType?this._fnScrollFixedHeader(a.aoCache[b]):"fixedFooter"==a.aoCache[b].sType?this._fnScrollFixedFooter(a.aoCache[b]):"fixedLeft"==a.aoCache[b].sType?this._fnScrollHorizontalLeft(a.aoCache[b]):this._fnScrollHorizontalRight(a.aoCache[b])},_fnUpdateClones:function(a){var b=
this.fnGetSettings();a&&(b.bInitComplete=!1);for(var c=0,d=b.aoCache.length;c<d;c++)b.aoCache[c].fnClone.call(this,b.aoCache[c]);a&&(b.bInitComplete=!0)},_fnScrollHorizontalRight:function(a){var b=this.fnGetSettings().oMes,c=FixedHeader.oWin,d=FixedHeader.oDoc,f=a.nWrapper,g=e(f).outerWidth();c.iScrollRight<b.iTableRight?(this._fnUpdateCache(a,"sPosition","absolute","position",f.style),this._fnUpdateCache(a,"sTop",b.iTableTop+"px","top",f.style),this._fnUpdateCache(a,"sLeft",b.iTableLeft+b.iTableWidth-
g+"px","left",f.style)):b.iTableLeft<d.iWidth-c.iScrollRight-g?(this._fnUpdateCache(a,"sPosition","fixed","position",f.style),this._fnUpdateCache(a,"sTop",b.iTableTop-c.iScrollTop+"px","top",f.style),this._fnUpdateCache(a,"sLeft",c.iWidth-g+"px","left",f.style)):(this._fnUpdateCache(a,"sPosition","absolute","position",f.style),this._fnUpdateCache(a,"sTop",b.iTableTop+"px","top",f.style),this._fnUpdateCache(a,"sLeft",b.iTableLeft+"px","left",f.style))},_fnScrollHorizontalLeft:function(a){var b=this.fnGetSettings().oMes,
c=FixedHeader.oWin,d=a.nWrapper,f=e(d).outerWidth();c.iScrollLeft<b.iTableLeft?(this._fnUpdateCache(a,"sPosition","absolute","position",d.style),this._fnUpdateCache(a,"sTop",b.iTableTop+"px","top",d.style),this._fnUpdateCache(a,"sLeft",b.iTableLeft+"px","left",d.style)):c.iScrollLeft<b.iTableLeft+b.iTableWidth-f?(this._fnUpdateCache(a,"sPosition","fixed","position",d.style),this._fnUpdateCache(a,"sTop",b.iTableTop-c.iScrollTop+"px","top",d.style),this._fnUpdateCache(a,"sLeft","0px","left",d.style)):
(this._fnUpdateCache(a,"sPosition","absolute","position",d.style),this._fnUpdateCache(a,"sTop",b.iTableTop+"px","top",d.style),this._fnUpdateCache(a,"sLeft",b.iTableLeft+b.iTableWidth-f+"px","left",d.style))},_fnScrollFixedFooter:function(a){var b=this.fnGetSettings(),c=b.oMes,d=FixedHeader.oWin,f=a.nWrapper,b=e("thead",b.nTable).outerHeight(),g=e(f).outerHeight();d.iScrollBottom<c.iTableBottom?(this._fnUpdateCache(a,"sPosition","absolute","position",f.style),this._fnUpdateCache(a,"sTop",c.iTableTop+
c.iTableHeight-g+"px","top",f.style),this._fnUpdateCache(a,"sLeft",c.iTableLeft+"px","left",f.style)):d.iScrollBottom<c.iTableBottom+c.iTableHeight-g-b?(this._fnUpdateCache(a,"sPosition","fixed","position",f.style),this._fnUpdateCache(a,"sTop",d.iHeight-g+"px","top",f.style),this._fnUpdateCache(a,"sLeft",c.iTableLeft-d.iScrollLeft+"px","left",f.style)):(this._fnUpdateCache(a,"sPosition","absolute","position",f.style),this._fnUpdateCache(a,"sTop",c.iTableTop+g+"px","top",f.style),this._fnUpdateCache(a,
"sLeft",c.iTableLeft+"px","left",f.style))},_fnScrollFixedHeader:function(a){for(var b=this.fnGetSettings(),c=b.oMes,d=FixedHeader.oWin,e=a.nWrapper,g=0,i=b.nTable.getElementsByTagName("tbody"),h=0;h<i.length;++h)g+=i[h].offsetHeight;c.iTableTop>d.iScrollTop+b.oOffset.top?(this._fnUpdateCache(a,"sPosition","absolute","position",e.style),this._fnUpdateCache(a,"sTop",c.iTableTop+"px","top",e.style),this._fnUpdateCache(a,"sLeft",c.iTableLeft+"px","left",e.style)):d.iScrollTop+b.oOffset.top>c.iTableTop+
g?(this._fnUpdateCache(a,"sPosition","absolute","position",e.style),this._fnUpdateCache(a,"sTop",c.iTableTop+g+"px","top",e.style),this._fnUpdateCache(a,"sLeft",c.iTableLeft+"px","left",e.style)):(this._fnUpdateCache(a,"sPosition","fixed","position",e.style),this._fnUpdateCache(a,"sTop",b.oOffset.top+"px","top",e.style),this._fnUpdateCache(a,"sLeft",c.iTableLeft-d.iScrollLeft+"px","left",e.style))},_fnUpdateCache:function(a,b,c,d,e){a[b]!=c&&(e[d]=c,a[b]=c)},_fnClassUpdate:function(a,b){var c=this;
if("TR"===a.nodeName.toUpperCase()||"TH"===a.nodeName.toUpperCase()||"TD"===a.nodeName.toUpperCase()||"SPAN"===a.nodeName.toUpperCase())b.className=a.className;e(a).children().each(function(d){c._fnClassUpdate(e(a).children()[d],e(b).children()[d])})},_fnCloneThead:function(a){var b=this.fnGetSettings(),c=a.nNode;if(b.bInitComplete&&!b.oCloneOnDraw.top)this._fnClassUpdate(e("thead",b.nTable)[0],e("thead",c)[0]);else{var d=e(b.nTable).outerWidth();a.nWrapper.style.width=d+"px";for(c.style.width=d+
"px";0<c.childNodes.length;)e("thead th",c).unbind("click"),c.removeChild(c.childNodes[0]);a=e("thead",b.nTable).clone(!0)[0];c.appendChild(a);var f=[],g=[];e("thead>tr th",b.nTable).each(function(){f.push(e(this).width())});e("thead>tr td",b.nTable).each(function(){g.push(e(this).width())});e("thead>tr th",b.nTable).each(function(a){e("thead>tr th:eq("+a+")",c).width(f[a]);e(this).width(f[a])});e("thead>tr td",b.nTable).each(function(a){e("thead>tr td:eq("+a+")",c).width(g[a]);e(this).width(g[a])});
e("th.sorting, th.sorting_desc, th.sorting_asc",c).bind("click",function(){this.blur()})}},_fnCloneTfoot:function(a){var b=this.fnGetSettings(),c=a.nNode;for(a.nWrapper.style.width=e(b.nTable).outerWidth()+"px";0<c.childNodes.length;)c.removeChild(c.childNodes[0]);a=e("tfoot",b.nTable).clone(!0)[0];c.appendChild(a);e("tfoot:eq(0)>tr th",b.nTable).each(function(a){e("tfoot:eq(0)>tr th:eq("+a+")",c).width(e(this).width())});e("tfoot:eq(0)>tr td",b.nTable).each(function(a){e("tfoot:eq(0)>tr td:eq("+
a+")",c).width(e(this).width())})},_fnCloneTLeft:function(a){for(var b=this.fnGetSettings(),c=a.nNode,d=e("tbody",b.nTable)[0];0<c.childNodes.length;)c.removeChild(c.childNodes[0]);c.appendChild(e("thead",b.nTable).clone(!0)[0]);c.appendChild(e("tbody",b.nTable).clone(!0)[0]);b.bFooter&&c.appendChild(e("tfoot",b.nTable).clone(!0)[0]);var f="gt("+(a.iCells-1)+")";e("thead tr",c).each(function(){e("th:"+f,this).remove()});e("tfoot tr",c).each(function(){e("th:"+f,this).remove()});e("tbody tr",c).each(function(){e("td:"+
f,this).remove()});this.fnEqualiseHeights("thead",d.parentNode,c);this.fnEqualiseHeights("tbody",d.parentNode,c);this.fnEqualiseHeights("tfoot",d.parentNode,c);for(var g=d=0;g<a.iCells;g++)d+=e("thead tr th:eq("+g+")",b.nTable).outerWidth();c.style.width=d+"px";a.nWrapper.style.width=d+"px"},_fnCloneTRight:function(a){for(var b=this.fnGetSettings(),c=e("tbody",b.nTable)[0],d=a.nNode,f=e("tbody tr:eq(0) td",b.nTable).length;0<d.childNodes.length;)d.removeChild(d.childNodes[0]);d.appendChild(e("thead",
b.nTable).clone(!0)[0]);d.appendChild(e("tbody",b.nTable).clone(!0)[0]);b.bFooter&&d.appendChild(e("tfoot",b.nTable).clone(!0)[0]);e("thead tr th:lt("+(f-a.iCells)+")",d).remove();e("tfoot tr th:lt("+(f-a.iCells)+")",d).remove();e("tbody tr",d).each(function(){e("td:lt("+(f-a.iCells)+")",this).remove()});this.fnEqualiseHeights("thead",c.parentNode,d);this.fnEqualiseHeights("tbody",c.parentNode,d);this.fnEqualiseHeights("tfoot",c.parentNode,d);for(var g=c=0;g<a.iCells;g++)c+=e("thead tr th:eq("+(f-
1-g)+")",b.nTable).outerWidth();d.style.width=c+"px";a.nWrapper.style.width=c+"px"},fnEqualiseHeights:function(a,b,c){var d=e(a+" tr",b),f;e(a+" tr",c).each(function(a){f=d.eq(a).css("height");"Microsoft Internet Explorer"==navigator.appName&&(f=parseInt(f,10)+1);e(this).css("height",f);d.eq(a).css("height",f)})}};FixedHeader.oWin={iScrollTop:0,iScrollRight:0,iScrollBottom:0,iScrollLeft:0,iHeight:0,iWidth:0};FixedHeader.oDoc={iHeight:0,iWidth:0};FixedHeader.afnScroll=[];FixedHeader.fnMeasure=function(){var a=
e(j),b=e(k),c=FixedHeader.oWin,d=FixedHeader.oDoc;d.iHeight=b.height();d.iWidth=b.width();c.iHeight=a.height();c.iWidth=a.width();c.iScrollTop=a.scrollTop();c.iScrollLeft=a.scrollLeft();c.iScrollRight=d.iWidth-c.iScrollLeft-c.iWidth;c.iScrollBottom=d.iHeight-c.iScrollTop-c.iHeight};FixedHeader.version="2.1.2";e(j).scroll(function(){FixedHeader.fnMeasure();for(var a=0,b=FixedHeader.afnScroll.length;a<b;a++)FixedHeader.afnScroll[a]()});e.fn.dataTable.FixedHeader=FixedHeader;return e.fn.DataTable.FixedHeader=
FixedHeader};"function"===typeof define&&define.amd?define(["jquery","datatables"],l):"object"===typeof exports?l(require("jquery"),require("datatables")):jQuery&&!jQuery.fn.dataTable.FixedHeader&&l(jQuery,jQuery.fn.dataTable)})(window,document);

@ -0,0 +1,18 @@
/*!
KeyTable 1.2.1
©2010-2014 SpryMedia Ltd - datatables.net/license
*/
var KeyTable;
(function(F,n,K){var A=function(d){KeyTable=function(j){function A(a){return function(e,c,p){(null===e||"number"==typeof e)&&(null===c||"number"==typeof c)&&"function"==typeof p?k[a].push({x:e,y:c,fn:p}):"object"==typeof e&&"function"==typeof c?(e=E(e),k[a].push({x:e[0],y:e[1],fn:c})):alert("Unhandable event type was added: x"+e+" y:"+c+" z:"+p)}}function L(a){return function(e,c,p){(null===e||"number"==typeof e)&&(null===c||"number"==typeof c)?"function"==typeof p?B(a,e,c,p):B(a,e,c):"object"==
typeof e?(e=E(e),"function"==typeof c?B(a,e[0],e[1],c):B(a,e[0],e[1])):alert("Unhandable event type was removed: x"+e+" y:"+c+" z:"+p)}}function B(a,e,c,p){for(var h=0,b=0,d=k[a].length;b<d-h;b++)if("undefined"!=typeof p)k[a][b-h].x==e&&(k[a][b-h].y==c&&k[a][b-h].fn==p)&&(k[a].splice(b-h,1),h++);else if(k[a][b-h].x==e&&k[a][b-h].y==c)return k[a].splice(b,1),1;return h}function C(a,e,c){for(var p=0,a=k[a],b=0;b<a.length;b++)if(a[b].x==e&&a[b].y==c||null===a[b].x&&a[b].y==c||a[b].x==e&&null===a[b].y||
null===a[b].x&&null===a[b].y)a[b].fn(w(e,c),e,c),p++;return p}function q(a,e){if(t!=a){"undefined"==typeof e&&(e=!0);null!==t&&G(t);d(a).addClass(x);d(a).parent().addClass(x);var c;if(i){c=i;for(var b=H(a)[1],h=o;b>=c.fnDisplayEnd();)0<=c._iDisplayLength?c._iDisplayStart+c._iDisplayLength<c.fnRecordsDisplay()&&(c._iDisplayStart+=c._iDisplayLength):c._iDisplayStart=0,i.oApi._fnCalculateEnd(c);for(;b<c._iDisplayStart;)c._iDisplayStart=0<=c._iDisplayLength?c._iDisplayStart-c._iDisplayLength:0,0>c._iDisplayStart&&
(c._iDisplayStart=0),i.oApi._fnCalculateEnd(c);i.oApi._fnDraw(c);o=h}b=E(a);t=a;l=b[0];g=b[1];var r,j,k,m,f;if(e){r=d(F).height();b=d(F).width();j=d(n).scrollTop();h=d(n).scrollLeft();k=a.offsetHeight;m=a.offsetWidth;f=a;var q=0,s=0;if(f.offsetParent){q=f.offsetLeft;s=f.offsetTop;for(f=f.offsetParent;f;)q+=f.offsetLeft,s+=f.offsetTop,f=f.offsetParent}f=[q,s];if(i&&"undefined"!=typeof c.oScroll&&(""!==c.oScroll.sX||""!==c.oScroll.sY))f[1]-=d(c.nTable.parentNode).scrollTop(),f[0]-=d(c.nTable.parentNode).scrollLeft();
f[1]+k>j+r?(r=f[1]+k-r,n.documentElement.scrollTop=r,n.body.scrollTop=r):f[1]<j&&(r=f[1],n.documentElement.scrollTop=r,n.body.scrollTop=r);f[0]+m>h+b?(b=f[0]+m-b,n.documentElement.scrollLeft=b,n.body.scrollLeft=b):f[0]<h&&(b=f[0],n.documentElement.scrollLeft=b,n.body.scrollLeft=b)}if(i&&"undefined"!=typeof c.oScroll&&(""!==c.oScroll.sX||""!==c.oScroll.sY))(c=c.nTable.parentNode,r=c.clientHeight,b=c.clientWidth,j=c.scrollTop,h=c.scrollLeft,k=a.offsetHeight,m=a.offsetWidth,a.offsetTop+k>r+j?c.scrollTop=
a.offsetTop+k-r:a.offsetTop<j&&(c.scrollTop=a.offsetTop),a.offsetLeft+m>b+h)?c.scrollLeft=a.offsetLeft+m-b:a.offsetLeft<h&&(c.scrollLeft=a.offsetLeft);o||(o=!0);C("focus",l,g)}}function y(){G(t);t=g=l=null;o=!1}function G(a){d(a).removeClass(x);d(a).parent().removeClass(x);C("blur",l,g)}function I(){for(var a=this;"TD"!=a.nodeName;)a=a.parentNode;q(a);o||(o=!0)}function w(a,b){return i?"undefined"!=typeof i.aoData[i.aiDisplay[b]]?i.aoData[i.aiDisplay[b]].nTr.getElementsByTagName("td")[a]:null:d("tr:eq("+
b+")>td:eq("+a+")",z)[0]}function E(a){return i?[d("td",a.parentNode).index(a),d("tr",a.parentNode.parentNode).index(a.parentNode)+i._iDisplayStart]:[d("td",a.parentNode).index(a),d("tr",a.parentNode.parentNode).index(a.parentNode)]}function H(a){for(var b=0,c=i.aiDisplay.length;b<c;b++)for(var d=i.aoData[i.aiDisplay[b]].nTr.getElementsByTagName("td"),h=0,g=d.length;h<g;h++)if(d[h]==a)return[h,b];return null}this.block=!1;this.event={remove:{}};this.fnGetCurrentPosition=function(){return[l,g]};this.fnGetCurrentData=
function(){return t.innerHTML};this.fnGetCurrentTD=function(){return t};this.fnSetPosition=function(a,b){"object"==typeof a&&a.nodeName?q(a):q(w(a,b))};this.fnBlur=function(){y()};var z=null,t=null,l=null,g=null,J=null,x="focus",o=!1,k={action:[],esc:[],focus:[],blur:[]},i=null,D,s,u=!1,m;for(m in k)m&&(this.event[m]=A(m),this.event.remove[m]=L(m));var v;j===K?(m=d("table.KeyTable")[0],v=null):d.isPlainObject(j)?(m=j.table,v=j.datatable):(v=(new d.fn.dataTable.Api(j)).settings()[0],m=v.nTable);var b=
j,J=this;"undefined"==typeof b&&(b={});"undefined"==typeof b.focus&&(b.focus=[0,0]);b.table=m;d(b.table).addClass("KeyTable");"undefined"!=typeof b.focusClass&&(x=b.focusClass);"undefined"!=typeof v&&(i=v);"undefined"==typeof b.initScroll&&(b.initScroll=!0);"undefined"==typeof b.form&&(b.form=!1);D=b.form;z=b.table.getElementsByTagName("tbody")[0];D?(j=n.createElement("div"),s=n.createElement("input"),j.style.height="1px",j.style.width="0px",j.style.overflow="hidden","undefined"!=typeof b.tabIndex&&
(s.tabIndex=b.tabIndex),j.appendChild(s),b.table.parentNode.insertBefore(j,b.table.nextSibling),d(s).focus(function(){if(!u){o=true;u=false;typeof b.focus.nodeName!="undefined"?q(b.focus,b.initScroll):q(w(b.focus[0],b.focus[1]),b.initScroll);setTimeout(function(){s.blur()},0)}}),o=!1):("undefined"!=typeof b.focus.nodeName?q(b.focus,b.initScroll):q(w(b.focus[0],b.focus[1]),b.initScroll),o||(o=!0));d(n).bind("keydown",function(a){if(J.block||!o||a.metaKey||a.altKey||a.ctrlKey)return true;var b;b=z.getElementsByTagName("tr")[0].getElementsByTagName("td").length;
var c;if(i){c=i.aiDisplay.length;var d=H(t);if(d===null)return;l=d[0];g=d[1]}else c=z.getElementsByTagName("tr").length;d=a.keyCode==9&&a.shiftKey?-1:a.keyCode;switch(d){case 13:a.preventDefault();a.stopPropagation();C("action",l,g);return true;case 27:if(!C("esc",l,g)){y();return}a=l;b=g;break;case -1:case 37:if(l>0){a=l-1;b=g}else if(g>0){a=b-1;b=g-1}else{if(d==-1&&D){u=true;s.focus();setTimeout(function(){u=false},0);o=false;y();return true}return false}break;case 38:if(g>0){a=l;b=g-1}else return false;
break;case 36:a=l;b=0;break;case 33:a=l;b=g-10;b<0&&(b=0);break;case 9:case 39:if(l<b-1){a=l+1;b=g}else if(g<c-1){a=0;b=g+1}else{if(d==9&&D){u=true;s.focus();setTimeout(function(){u=false},0);o=false;y();return true}return false}break;case 40:if(g<c-1){a=l;b=g+1}else return false;break;case 35:a=l;b=c-1;break;case 34:a=l;b=g+10;b>c-1&&(b=c-1);break;default:return true}q(w(a,b));return false});if(i)d(i.nTable).on("click","td",I);else d(z).on("click","td",I);d(n).click(function(a){for(var a=a.target,
d=false;a;){if(a==b.table){d=true;break}a=a.parentNode}d||y()})};KeyTable.version="1.2.1";d.fn.dataTable.KeyTable=KeyTable;return d.fn.DataTable.KeyTable=KeyTable};"function"===typeof define&&define.amd?define(["jquery","datatables"],A):"object"===typeof exports?A(require("jquery"),require("datatables")):jQuery&&!jQuery.fn.dataTable.KeyTable&&A(jQuery,jQuery.fn.dataTable)})(window,document);

@ -0,0 +1,106 @@
table.dataTable.dtr-inline.collapsed > tbody > tr > td:first-child,
table.dataTable.dtr-inline.collapsed > tbody > tr > th:first-child {
position: relative;
padding-left: 30px;
cursor: pointer;
}
table.dataTable.dtr-inline.collapsed > tbody > tr > td:first-child:before,
table.dataTable.dtr-inline.collapsed > tbody > tr > th:first-child:before {
top: 8px;
left: 4px;
height: 16px;
width: 16px;
display: block;
position: absolute;
color: white;
border: 2px solid white;
border-radius: 16px;
text-align: center;
line-height: 14px;
box-shadow: 0 0 3px #444;
box-sizing: content-box;
content: '+';
background-color: #31b131;
}
table.dataTable.dtr-inline.collapsed > tbody > tr > td:first-child.dataTables_empty:before,
table.dataTable.dtr-inline.collapsed > tbody > tr > th:first-child.dataTables_empty:before {
display: none;
}
table.dataTable.dtr-inline.collapsed > tbody > tr.parent > td:first-child:before,
table.dataTable.dtr-inline.collapsed > tbody > tr.parent > th:first-child:before {
content: '-';
background-color: #d33333;
}
table.dataTable.dtr-inline.collapsed > tbody > tr.child td:before {
display: none;
}
table.dataTable.dtr-inline.collapsed.compact > tbody > tr > td:first-child,
table.dataTable.dtr-inline.collapsed.compact > tbody > tr > th:first-child {
padding-left: 27px;
}
table.dataTable.dtr-inline.collapsed.compact > tbody > tr > td:first-child:before,
table.dataTable.dtr-inline.collapsed.compact > tbody > tr > th:first-child:before {
top: 5px;
left: 4px;
height: 14px;
width: 14px;
border-radius: 14px;
line-height: 12px;
}
table.dataTable.dtr-column > tbody > tr > td.control,
table.dataTable.dtr-column > tbody > tr > th.control {
position: relative;
cursor: pointer;
}
table.dataTable.dtr-column > tbody > tr > td.control:before,
table.dataTable.dtr-column > tbody > tr > th.control:before {
top: 50%;
left: 50%;
height: 16px;
width: 16px;
margin-top: -10px;
margin-left: -10px;
display: block;
position: absolute;
color: white;
border: 2px solid white;
border-radius: 16px;
text-align: center;
line-height: 14px;
box-shadow: 0 0 3px #444;
box-sizing: content-box;
content: '+';
background-color: #31b131;
}
table.dataTable.dtr-column > tbody > tr.parent td.control:before,
table.dataTable.dtr-column > tbody > tr.parent th.control:before {
content: '-';
background-color: #d33333;
}
table.dataTable > tbody > tr.child {
padding: 0.5em 1em;
}
table.dataTable > tbody > tr.child:hover {
background: transparent !important;
}
table.dataTable > tbody > tr.child ul {
display: inline-block;
list-style-type: none;
margin: 0;
padding: 0;
}
table.dataTable > tbody > tr.child ul li {
border-bottom: 1px solid #efefef;
padding: 0.5em 0;
}
table.dataTable > tbody > tr.child ul li:first-child {
padding-top: 0;
}
table.dataTable > tbody > tr.child ul li:last-child {
border-bottom: none;
}
table.dataTable > tbody > tr.child span.dtr-title {
display: inline-block;
min-width: 75px;
font-weight: bold;
}

@ -0,0 +1,149 @@
//
// Mixins
//
@mixin control() {
display: block;
position: absolute;
color: white;
border: 2px solid white;
border-radius: 16px;
text-align: center;
line-height: 14px;
box-shadow: 0 0 3px #444;
box-sizing: content-box;
}
@mixin control-open() {
content: '+';
background-color: #31b131;
}
@mixin control-close() {
content: '-';
background-color: #d33333;
}
//
// Table styles
//
table.dataTable {
// Styling for the `inline` type
&.dtr-inline.collapsed > tbody {
> tr > td:first-child,
> tr > th:first-child {
position: relative;
padding-left: 30px;
cursor: pointer;
&:before {
top: 8px;
left: 4px;
height: 16px;
width: 16px;
@include control;
@include control-open;
}
&.dataTables_empty:before {
display: none;
}
}
> tr.parent {
> td:first-child:before,
> th:first-child:before {
@include control-close;
}
}
> tr.child td:before {
display: none;
}
}
// DataTables' `compact` styling
&.dtr-inline.collapsed.compact > tbody {
> tr > td:first-child,
> tr > th:first-child {
padding-left: 27px;
&:before {
top: 5px;
left: 4px;
height: 14px;
width: 14px;
border-radius: 14px;
line-height: 12px;
}
}
}
// Styling for the `column` type
&.dtr-column > tbody {
> tr > td.control,
> tr > th.control {
position: relative;
cursor: pointer;
&:before {
top: 50%;
left: 50%;
height: 16px;
width: 16px;
margin-top: -10px;
margin-left: -10px;
@include control;
@include control-open;
}
}
> tr.parent {
td.control:before,
th.control:before {
@include control-close;
}
}
}
// Child row styling
> tbody > tr.child {
padding: 0.5em 1em;
&:hover {
background: transparent !important;
}
ul {
display: inline-block;
list-style-type: none;
margin: 0;
padding: 0;
li {
border-bottom: 1px solid #efefef;
padding: 0.5em 0;
&:first-child {
padding-top: 0;
}
&:last-child {
border-bottom: none;
}
}
}
span.dtr-title {
display: inline-block;
min-width: 75px;
font-weight: bold;
}
span.dtr-data {}
}
}

@ -0,0 +1,873 @@
/*! Responsive 1.0.6
* 2014-2015 SpryMedia Ltd - datatables.net/license
*/
/**
* @summary Responsive
* @description Responsive tables plug-in for DataTables
* @version 1.0.6
* @file dataTables.responsive.js
* @author SpryMedia Ltd (www.sprymedia.co.uk)
* @contact www.sprymedia.co.uk/contact
* @copyright Copyright 2014-2015 SpryMedia Ltd.
*
* 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.datatables.net
*/
(function(window, document, undefined) {
var factory = function( $, DataTable ) {
"use strict";
/**
* Responsive is a plug-in for the DataTables library that makes use of
* DataTables' ability to change the visibility of columns, changing the
* visibility of columns so the displayed columns fit into the table container.
* The end result is that complex tables will be dynamically adjusted to fit
* into the viewport, be it on a desktop, tablet or mobile browser.
*
* Responsive for DataTables has two modes of operation, which can used
* individually or combined:
*
* * Class name based control - columns assigned class names that match the
* breakpoint logic can be shown / hidden as required for each breakpoint.
* * Automatic control - columns are automatically hidden when there is no
* room left to display them. Columns removed from the right.
*
* In additional to column visibility control, Responsive also has built into
* options to use DataTables' child row display to show / hide the information
* from the table that has been hidden. There are also two modes of operation
* for this child row display:
*
* * Inline - when the control element that the user can use to show / hide
* child rows is displayed inside the first column of the table.
* * Column - where a whole column is dedicated to be the show / hide control.
*
* Initialisation of Responsive is performed by:
*
* * Adding the class `responsive` or `dt-responsive` to the table. In this case
* Responsive will automatically be initialised with the default configuration
* options when the DataTable is created.
* * Using the `responsive` option in the DataTables configuration options. This
* can also be used to specify the configuration options, or simply set to
* `true` to use the defaults.
*
* @class
* @param {object} settings DataTables settings object for the host table
* @param {object} [opts] Configuration options
* @requires jQuery 1.7+
* @requires DataTables 1.10.1+
*
* @example
* $('#example').DataTable( {
* responsive: true
* } );
* } );
*/
var Responsive = function ( settings, opts ) {
// Sanity check that we are using DataTables 1.10 or newer
if ( ! DataTable.versionCheck || ! DataTable.versionCheck( '1.10.1' ) ) {
throw 'DataTables Responsive requires DataTables 1.10.1 or newer';
}
this.s = {
dt: new DataTable.Api( settings ),
columns: []
};
// Check if responsive has already been initialised on this table
if ( this.s.dt.settings()[0].responsive ) {
return;
}
// details is an object, but for simplicity the user can give it as a string
if ( opts && typeof opts.details === 'string' ) {
opts.details = { type: opts.details };
}
this.c = $.extend( true, {}, Responsive.defaults, DataTable.defaults.responsive, opts );
settings.responsive = this;
this._constructor();
};
Responsive.prototype = {
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Constructor
*/
/**
* Initialise the Responsive instance
*
* @private
*/
_constructor: function ()
{
var that = this;
var dt = this.s.dt;
dt.settings()[0]._responsive = this;
// Use DataTables' private throttle function to avoid processor thrashing
$(window).on( 'resize.dtr orientationchange.dtr', dt.settings()[0].oApi._fnThrottle( function () {
that._resize();
} ) );
// Destroy event handler
dt.on( 'destroy.dtr', function () {
$(window).off( 'resize.dtr orientationchange.dtr draw.dtr' );
} );
// Reorder the breakpoints array here in case they have been added out
// of order
this.c.breakpoints.sort( function (a, b) {
return a.width < b.width ? 1 :
a.width > b.width ? -1 : 0;
} );
// Determine which columns are already hidden, and should therefore
// remain hidden. todo - should this be done? See thread 22677
//
// this.s.alwaysHidden = dt.columns(':hidden').indexes();
this._classLogic();
this._resizeAuto();
// Details handler
var details = this.c.details;
if ( details.type ) {
that._detailsInit();
this._detailsVis();
dt.on( 'column-visibility.dtr', function () {
that._detailsVis();
} );
// Redraw the details box on each draw. This is used until
// DataTables implements a native `updated` event for rows
dt.on( 'draw.dtr', function () {
dt.rows( {page: 'current'} ).iterator( 'row', function ( settings, idx ) {
var row = dt.row( idx );
if ( row.child.isShown() ) {
var info = that.c.details.renderer( dt, idx );
row.child( info, 'child' ).show();
}
} );
} );
$(dt.table().node()).addClass( 'dtr-'+details.type );
}
// First pass - draw the table for the current viewport size
this._resize();
},
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Private methods
*/
/**
* Calculate the visibility for the columns in a table for a given
* breakpoint. The result is pre-determined based on the class logic if
* class names are used to control all columns, but the width of the table
* is also used if there are columns which are to be automatically shown
* and hidden.
*
* @param {string} breakpoint Breakpoint name to use for the calculation
* @return {array} Array of boolean values initiating the visibility of each
* column.
* @private
*/
_columnsVisiblity: function ( breakpoint )
{
var dt = this.s.dt;
var columns = this.s.columns;
var i, ien;
// Class logic - determine which columns are in this breakpoint based
// on the classes. If no class control (i.e. `auto`) then `-` is used
// to indicate this to the rest of the function
var display = $.map( columns, function ( col ) {
return col.auto && col.minWidth === null ?
false :
col.auto === true ?
'-' :
$.inArray( breakpoint, col.includeIn ) !== -1;
} );
// Auto column control - first pass: how much width is taken by the
// ones that must be included from the non-auto columns
var requiredWidth = 0;
for ( i=0, ien=display.length ; i<ien ; i++ ) {
if ( display[i] === true ) {
requiredWidth += columns[i].minWidth;
}
}
// Second pass, use up any remaining width for other columns. For
// scrolling tables we need to subtract the width of the scrollbar. It
// may not be requires which makes this sub-optimal, but it would
// require another full redraw to make complete use of those extra few
// pixels
var scrolling = dt.settings()[0].oScroll;
var bar = scrolling.sY || scrolling.sX ? scrolling.iBarWidth : 0;
var widthAvailable = dt.table().container().offsetWidth - bar;
var usedWidth = widthAvailable - requiredWidth;
// Control column needs to always be included. This makes it sub-
// optimal in terms of using the available with, but to stop layout
// thrashing or overflow. Also we need to account for the control column
// width first so we know how much width is available for the other
// columns, since the control column might not be the first one shown
for ( i=0, ien=display.length ; i<ien ; i++ ) {
if ( columns[i].control ) {
usedWidth -= columns[i].minWidth;
}
}
// Allow columns to be shown (counting from the left) until we run out
// of room
var empty = false;
for ( i=0, ien=display.length ; i<ien ; i++ ) {
if ( display[i] === '-' && ! columns[i].control ) {
// Once we've found a column that won't fit we don't let any
// others display either, or columns might disappear in the
// middle of the table
if ( empty || usedWidth - columns[i].minWidth < 0 ) {
empty = true;
display[i] = false;
}
else {
display[i] = true;
}
usedWidth -= columns[i].minWidth;
}
}
// Determine if the 'control' column should be shown (if there is one).
// This is the case when there is a hidden column (that is not the
// control column). The two loops look inefficient here, but they are
// trivial and will fly through. We need to know the outcome from the
// first , before the action in the second can be taken
var showControl = false;
for ( i=0, ien=columns.length ; i<ien ; i++ ) {
if ( ! columns[i].control && ! columns[i].never && ! display[i] ) {
showControl = true;
break;
}
}
for ( i=0, ien=columns.length ; i<ien ; i++ ) {
if ( columns[i].control ) {
display[i] = showControl;
}
}
// Finally we need to make sure that there is at least one column that
// is visible
if ( $.inArray( true, display ) === -1 ) {
display[0] = true;
}
return display;
},
/**
* Create the internal `columns` array with information about the columns
* for the table. This includes determining which breakpoints the column
* will appear in, based upon class names in the column, which makes up the
* vast majority of this method.
*
* @private
*/
_classLogic: function ()
{
var that = this;
var calc = {};
var breakpoints = this.c.breakpoints;
var columns = this.s.dt.columns().eq(0).map( function (i) {
var className = this.column(i).header().className;
return {
className: className,
includeIn: [],
auto: false,
control: false,
never: className.match(/\bnever\b/) ? true : false
};
} );
// Simply add a breakpoint to `includeIn` array, ensuring that there are
// no duplicates
var add = function ( colIdx, name ) {
var includeIn = columns[ colIdx ].includeIn;
if ( $.inArray( name, includeIn ) === -1 ) {
includeIn.push( name );
}
};
var column = function ( colIdx, name, operator, matched ) {
var size, i, ien;
if ( ! operator ) {
columns[ colIdx ].includeIn.push( name );
}
else if ( operator === 'max-' ) {
// Add this breakpoint and all smaller
size = that._find( name ).width;
for ( i=0, ien=breakpoints.length ; i<ien ; i++ ) {
if ( breakpoints[i].width <= size ) {
add( colIdx, breakpoints[i].name );
}
}
}
else if ( operator === 'min-' ) {
// Add this breakpoint and all larger
size = that._find( name ).width;
for ( i=0, ien=breakpoints.length ; i<ien ; i++ ) {
if ( breakpoints[i].width >= size ) {
add( colIdx, breakpoints[i].name );
}
}
}
else if ( operator === 'not-' ) {
// Add all but this breakpoint (xxx need extra information)
for ( i=0, ien=breakpoints.length ; i<ien ; i++ ) {
if ( breakpoints[i].name.indexOf( matched ) === -1 ) {
add( colIdx, breakpoints[i].name );
}
}
}
};
// Loop over each column and determine if it has a responsive control
// class
columns.each( function ( col, i ) {
var classNames = col.className.split(' ');
var hasClass = false;
// Split the class name up so multiple rules can be applied if needed
for ( var k=0, ken=classNames.length ; k<ken ; k++ ) {
var className = $.trim( classNames[k] );
if ( className === 'all' ) {
// Include in all
hasClass = true;
col.includeIn = $.map( breakpoints, function (a) {
return a.name;
} );
return;
}
else if ( className === 'none' || className === 'never' ) {
// Include in none (default) and no auto
hasClass = true;
return;
}
else if ( className === 'control' ) {
// Special column that is only visible, when one of the other
// columns is hidden. This is used for the details control
hasClass = true;
col.control = true;
return;
}
$.each( breakpoints, function ( j, breakpoint ) {
// Does this column have a class that matches this breakpoint?
var brokenPoint = breakpoint.name.split('-');
var re = new RegExp( '(min\\-|max\\-|not\\-)?('+brokenPoint[0]+')(\\-[_a-zA-Z0-9])?' );
var match = className.match( re );
if ( match ) {
hasClass = true;
if ( match[2] === brokenPoint[0] && match[3] === '-'+brokenPoint[1] ) {
// Class name matches breakpoint name fully
column( i, breakpoint.name, match[1], match[2]+match[3] );
}
else if ( match[2] === brokenPoint[0] && ! match[3] ) {
// Class name matched primary breakpoint name with no qualifier
column( i, breakpoint.name, match[1], match[2] );
}
}
} );
}
// If there was no control class, then automatic sizing is used
if ( ! hasClass ) {
col.auto = true;
}
} );
this.s.columns = columns;
},
/**
* Initialisation for the details handler
*
* @private
*/
_detailsInit: function ()
{
var that = this;
var dt = this.s.dt;
var details = this.c.details;
// The inline type always uses the first child as the target
if ( details.type === 'inline' ) {
details.target = 'td:first-child';
}
// type.target can be a string jQuery selector or a column index
var target = details.target;
var selector = typeof target === 'string' ? target : 'td';
// Click handler to show / hide the details rows when they are available
$( dt.table().body() ).on( 'click', selector, function (e) {
// If the table is not collapsed (i.e. there is no hidden columns)
// then take no action
if ( ! $(dt.table().node()).hasClass('collapsed' ) ) {
return;
}
// Check that the row is actually a DataTable's controlled node
if ( ! dt.row( $(this).closest('tr') ).length ) {
return;
}
// For column index, we determine if we should act or not in the
// handler - otherwise it is already okay
if ( typeof target === 'number' ) {
var targetIdx = target < 0 ?
dt.columns().eq(0).length + target :
target;
if ( dt.cell( this ).index().column !== targetIdx ) {
return;
}
}
// $().closest() includes itself in its check
var row = dt.row( $(this).closest('tr') );
if ( row.child.isShown() ) {
row.child( false );
$( row.node() ).removeClass( 'parent' );
}
else {
var info = that.c.details.renderer( dt, row[0] );
row.child( info, 'child' ).show();
$( row.node() ).addClass( 'parent' );
}
} );
},
/**
* Update the child rows in the table whenever the column visibility changes
*
* @private
*/
_detailsVis: function ()
{
var that = this;
var dt = this.s.dt;
// Find how many columns are hidden
var hiddenColumns = dt.columns().indexes().filter( function ( idx ) {
var col = dt.column( idx );
if ( col.visible() ) {
return null;
}
// Only counts as hidden if it doesn't have the `never` class
return $( col.header() ).hasClass( 'never' ) ? null : idx;
} );
var haveHidden = true;
if ( hiddenColumns.length === 0 || ( hiddenColumns.length === 1 && this.s.columns[ hiddenColumns[0] ].control ) ) {
haveHidden = false;
}
if ( haveHidden ) {
// Show all existing child rows
dt.rows( { page: 'current' } ).eq(0).each( function (idx) {
var row = dt.row( idx );
if ( row.child() ) {
var info = that.c.details.renderer( dt, row[0] );
// The renderer can return false to have no child row
if ( info === false ) {
row.child.hide();
}
else {
row.child( info, 'child' ).show();
}
}
} );
}
else {
// Hide all existing child rows
dt.rows( { page: 'current' } ).eq(0).each( function (idx) {
dt.row( idx ).child.hide();
} );
}
},
/**
* Find a breakpoint object from a name
* @param {string} name Breakpoint name to find
* @return {object} Breakpoint description object
*/
_find: function ( name )
{
var breakpoints = this.c.breakpoints;
for ( var i=0, ien=breakpoints.length ; i<ien ; i++ ) {
if ( breakpoints[i].name === name ) {
return breakpoints[i];
}
}
},
/**
* Alter the table display for a resized viewport. This involves first
* determining what breakpoint the window currently is in, getting the
* column visibilities to apply and then setting them.
*
* @private
*/
_resize: function ()
{
var dt = this.s.dt;
var width = $(window).width();
var breakpoints = this.c.breakpoints;
var breakpoint = breakpoints[0].name;
var columns = this.s.columns;
var i, ien;
// Determine what breakpoint we are currently at
for ( i=breakpoints.length-1 ; i>=0 ; i-- ) {
if ( width <= breakpoints[i].width ) {
breakpoint = breakpoints[i].name;
break;
}
}
// Show the columns for that break point
var columnsVis = this._columnsVisiblity( breakpoint );
// Set the class before the column visibility is changed so event
// listeners know what the state is. Need to determine if there are
// any columns that are not visible but can be shown
var collapsedClass = false;
for ( i=0, ien=columns.length ; i<ien ; i++ ) {
if ( columnsVis[i] === false && ! columns[i].never ) {
collapsedClass = true;
break;
}
}
$( dt.table().node() ).toggleClass('collapsed', collapsedClass );
dt.columns().eq(0).each( function ( colIdx, i ) {
dt.column( colIdx ).visible( columnsVis[i] );
} );
},
/**
* Determine the width of each column in the table so the auto column hiding
* has that information to work with. This method is never going to be 100%
* perfect since column widths can change slightly per page, but without
* seriously compromising performance this is quite effective.
*
* @private
*/
_resizeAuto: function ()
{
var dt = this.s.dt;
var columns = this.s.columns;
// Are we allowed to do auto sizing?
if ( ! this.c.auto ) {
return;
}
// Are there any columns that actually need auto-sizing, or do they all
// have classes defined
if ( $.inArray( true, $.map( columns, function (c) { return c.auto; } ) ) === -1 ) {
return;
}
// Clone the table with the current data in it
var tableWidth = dt.table().node().offsetWidth;
var columnWidths = dt.columns;
var clonedTable = dt.table().node().cloneNode( false );
var clonedHeader = $( dt.table().header().cloneNode( false ) ).appendTo( clonedTable );
var clonedBody = $( dt.table().body().cloneNode( false ) ).appendTo( clonedTable );
$( dt.table().footer() ).clone( false ).appendTo( clonedTable );
// This is a bit slow, but we need to get a clone of each row that
// includes all columns. As such, try to do this as little as possible.
dt.rows( { page: 'current' } ).indexes().flatten().each( function ( idx ) {
var clone = dt.row( idx ).node().cloneNode( true );
if ( dt.columns( ':hidden' ).flatten().length ) {
$(clone).append( dt.cells( idx, ':hidden' ).nodes().to$().clone() );
}
$(clone).appendTo( clonedBody );
} );
var cells = dt.columns().header().to$().clone( false );
$('<tr/>')
.append( cells )
.appendTo( clonedHeader );
// In the inline case extra padding is applied to the first column to
// give space for the show / hide icon. We need to use this in the
// calculation
if ( this.c.details.type === 'inline' ) {
$(clonedTable).addClass( 'dtr-inline collapsed' );
}
var inserted = $('<div/>')
.css( {
width: 1,
height: 1,
overflow: 'hidden'
} )
.append( clonedTable );
// Remove columns which are not to be included
inserted.find('th.never, td.never').remove();
inserted.insertBefore( dt.table().node() );
// The cloned header now contains the smallest that each column can be
dt.columns().eq(0).each( function ( idx ) {
columns[idx].minWidth = cells[ idx ].offsetWidth || 0;
} );
inserted.remove();
}
};
/**
* List of default breakpoints. Each item in the array is an object with two
* properties:
*
* * `name` - the breakpoint name.
* * `width` - the breakpoint width
*
* @name Responsive.breakpoints
* @static
*/
Responsive.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 }
];
/**
* Responsive default settings for initialisation
*
* @namespace
* @name Responsive.defaults
* @static
*/
Responsive.defaults = {
/**
* List of breakpoints for the instance. Note that this means that each
* instance can have its own breakpoints. Additionally, the breakpoints
* cannot be changed once an instance has been creased.
*
* @type {Array}
* @default Takes the value of `Responsive.breakpoints`
*/
breakpoints: Responsive.breakpoints,
/**
* Enable / disable auto hiding calculations. It can help to increase
* performance slightly if you disable this option, but all columns would
* need to have breakpoint classes assigned to them
*
* @type {Boolean}
* @default `true`
*/
auto: true,
/**
* Details control. If given as a string value, the `type` property of the
* default object is set to that value, and the defaults used for the rest
* of the object - this is for ease of implementation.
*
* The object consists of the following properties:
*
* * `renderer` - function that is called for display of the child row data.
* The default function will show the data from the hidden columns
* * `target` - Used as the selector for what objects to attach the child
* open / close to
* * `type` - `false` to disable the details display, `inline` or `column`
* for the two control types
*
* @type {Object|string}
*/
details: {
renderer: function ( api, rowIdx ) {
var data = api.cells( rowIdx, ':hidden' ).eq(0).map( function ( cell ) {
var header = $( api.column( cell.column ).header() );
var idx = api.cell( cell ).index();
if ( header.hasClass( 'control' ) || header.hasClass( 'never' ) ) {
return '';
}
// Use a non-public DT API method to render the data for display
// This needs to be updated when DT adds a suitable method for
// this type of data retrieval
var dtPrivate = api.settings()[0];
var cellData = dtPrivate.oApi._fnGetCellData(
dtPrivate, idx.row, idx.column, 'display'
);
var title = header.text();
if ( title ) {
title = title + ':';
}
return '<li data-dtr-index="'+idx.column+'">'+
'<span class="dtr-title">'+
title+
'</span> '+
'<span class="dtr-data">'+
cellData+
'</span>'+
'</li>';
} ).toArray().join('');
return data ?
$('<ul data-dtr-index="'+rowIdx+'"/>').append( data ) :
false;
},
target: 0,
type: 'inline'
}
};
/*
* API
*/
var Api = $.fn.dataTable.Api;
// Doesn't do anything - work around for a bug in DT... Not documented
Api.register( 'responsive()', function () {
return this;
} );
Api.register( 'responsive.index()', function ( li ) {
li = $(li);
return {
column: li.data('dtr-index'),
row: li.parent().data('dtr-index')
};
} );
Api.register( 'responsive.rebuild()', function () {
return this.iterator( 'table', function ( ctx ) {
if ( ctx._responsive ) {
ctx._responsive._classLogic();
}
} );
} );
Api.register( 'responsive.recalc()', function () {
return this.iterator( 'table', function ( ctx ) {
if ( ctx._responsive ) {
ctx._responsive._resizeAuto();
ctx._responsive._resize();
}
} );
} );
/**
* Version information
*
* @name Responsive.version
* @static
*/
Responsive.version = '1.0.6';
$.fn.dataTable.Responsive = Responsive;
$.fn.DataTable.Responsive = Responsive;
// Attach a listener to the document which listens for DataTables initialisation
// events so we can automatically initialise
$(document).on( 'init.dt.dtr', function (e, settings, json) {
if ( e.namespace !== 'dt' ) {
return;
}
if ( $(settings.nTable).hasClass( 'responsive' ) ||
$(settings.nTable).hasClass( 'dt-responsive' ) ||
settings.oInit.responsive ||
DataTable.defaults.responsive
) {
var init = settings.oInit.responsive;
if ( init !== false ) {
new Responsive( settings, $.isPlainObject( init ) ? init : {} );
}
}
} );
return Responsive;
}; // /factory
// Define as an AMD module if possible
if ( typeof define === 'function' && define.amd ) {
define( ['jquery', 'datatables'], factory );
}
else if ( typeof exports === 'object' ) {
// Node/CommonJS
factory( require('jquery'), require('datatables') );
}
else if ( jQuery && !jQuery.fn.dataTable.Responsive ) {
// Otherwise simply initialise as normal, stopping multiple evaluation
factory( jQuery, jQuery.fn.dataTable );
}
})(window, document);

@ -0,0 +1,19 @@
/*!
Responsive 1.0.6
2014-2015 SpryMedia Ltd - datatables.net/license
*/
(function(n,p){var o=function(e,k){var h=function(d,a){if(!k.versionCheck||!k.versionCheck("1.10.1"))throw"DataTables Responsive requires DataTables 1.10.1 or newer";this.s={dt:new k.Api(d),columns:[]};this.s.dt.settings()[0].responsive||(a&&"string"===typeof a.details&&(a.details={type:a.details}),this.c=e.extend(!0,{},h.defaults,k.defaults.responsive,a),d.responsive=this,this._constructor())};h.prototype={_constructor:function(){var d=this,a=this.s.dt;a.settings()[0]._responsive=this;e(n).on("resize.dtr orientationchange.dtr",
a.settings()[0].oApi._fnThrottle(function(){d._resize()}));a.on("destroy.dtr",function(){e(n).off("resize.dtr orientationchange.dtr draw.dtr")});this.c.breakpoints.sort(function(a,c){return a.width<c.width?1:a.width>c.width?-1:0});this._classLogic();this._resizeAuto();var c=this.c.details;c.type&&(d._detailsInit(),this._detailsVis(),a.on("column-visibility.dtr",function(){d._detailsVis()}),a.on("draw.dtr",function(){a.rows({page:"current"}).iterator("row",function(b,c){var f=a.row(c);if(f.child.isShown()){var i=
d.c.details.renderer(a,c);f.child(i,"child").show()}})}),e(a.table().node()).addClass("dtr-"+c.type));this._resize()},_columnsVisiblity:function(d){var a=this.s.dt,c=this.s.columns,b,g,f=e.map(c,function(a){return a.auto&&null===a.minWidth?!1:!0===a.auto?"-":-1!==e.inArray(d,a.includeIn)}),i=0;b=0;for(g=f.length;b<g;b++)!0===f[b]&&(i+=c[b].minWidth);b=a.settings()[0].oScroll;b=b.sY||b.sX?b.iBarWidth:0;a=a.table().container().offsetWidth-b-i;b=0;for(g=f.length;b<g;b++)c[b].control&&(a-=c[b].minWidth);
i=!1;b=0;for(g=f.length;b<g;b++)"-"===f[b]&&!c[b].control&&(i||0>a-c[b].minWidth?(i=!0,f[b]=!1):f[b]=!0,a-=c[b].minWidth);a=!1;b=0;for(g=c.length;b<g;b++)if(!c[b].control&&!c[b].never&&!f[b]){a=!0;break}b=0;for(g=c.length;b<g;b++)c[b].control&&(f[b]=a);-1===e.inArray(!0,f)&&(f[0]=!0);return f},_classLogic:function(){var d=this,a=this.c.breakpoints,c=this.s.dt.columns().eq(0).map(function(a){a=this.column(a).header().className;return{className:a,includeIn:[],auto:!1,control:!1,never:a.match(/\bnever\b/)?
!0:!1}}),b=function(a,b){var d=c[a].includeIn;-1===e.inArray(b,d)&&d.push(b)},g=function(f,g,e,j){if(e)if("max-"===e){j=d._find(g).width;g=0;for(e=a.length;g<e;g++)a[g].width<=j&&b(f,a[g].name)}else if("min-"===e){j=d._find(g).width;g=0;for(e=a.length;g<e;g++)a[g].width>=j&&b(f,a[g].name)}else{if("not-"===e){g=0;for(e=a.length;g<e;g++)-1===a[g].name.indexOf(j)&&b(f,a[g].name)}}else c[f].includeIn.push(g)};c.each(function(b,c){for(var d=b.className.split(" "),j=!1,h=0,k=d.length;h<k;h++){var l=e.trim(d[h]);
if("all"===l){j=!0;b.includeIn=e.map(a,function(a){return a.name});return}if("none"===l||"never"===l){j=!0;return}if("control"===l){j=!0;b.control=!0;return}e.each(a,function(a,b){var d=b.name.split("-"),e=l.match(RegExp("(min\\-|max\\-|not\\-)?("+d[0]+")(\\-[_a-zA-Z0-9])?"));e&&(j=!0,e[2]===d[0]&&e[3]==="-"+d[1]?g(c,b.name,e[1],e[2]+e[3]):e[2]===d[0]&&!e[3]&&g(c,b.name,e[1],e[2]))})}j||(b.auto=!0)});this.s.columns=c},_detailsInit:function(){var d=this,a=this.s.dt,c=this.c.details;"inline"===c.type&&
(c.target="td:first-child");var b=c.target;e(a.table().body()).on("click","string"===typeof b?b:"td",function(){if(e(a.table().node()).hasClass("collapsed")&&a.row(e(this).closest("tr")).length){if(typeof b==="number"){var c=b<0?a.columns().eq(0).length+b:b;if(a.cell(this).index().column!==c)return}c=a.row(e(this).closest("tr"));if(c.child.isShown()){c.child(false);e(c.node()).removeClass("parent")}else{var f=d.c.details.renderer(a,c[0]);c.child(f,"child").show();e(c.node()).addClass("parent")}}})},
_detailsVis:function(){var d=this,a=this.s.dt,c=a.columns().indexes().filter(function(b){var c=a.column(b);return c.visible()?null:e(c.header()).hasClass("never")?null:b}),b=!0;if(0===c.length||1===c.length&&this.s.columns[c[0]].control)b=!1;b?a.rows({page:"current"}).eq(0).each(function(b){b=a.row(b);if(b.child()){var c=d.c.details.renderer(a,b[0]);!1===c?b.child.hide():b.child(c,"child").show()}}):a.rows({page:"current"}).eq(0).each(function(b){a.row(b).child.hide()})},_find:function(d){for(var a=
this.c.breakpoints,c=0,b=a.length;c<b;c++)if(a[c].name===d)return a[c]},_resize:function(){var d=this.s.dt,a=e(n).width(),c=this.c.breakpoints,b=c[0].name,g=this.s.columns,f;for(f=c.length-1;0<=f;f--)if(a<=c[f].width){b=c[f].name;break}var i=this._columnsVisiblity(b),c=!1;f=0;for(a=g.length;f<a;f++)if(!1===i[f]&&!g[f].never){c=!0;break}e(d.table().node()).toggleClass("collapsed",c);d.columns().eq(0).each(function(a,b){d.column(a).visible(i[b])})},_resizeAuto:function(){var d=this.s.dt,a=this.s.columns;
if(this.c.auto&&-1!==e.inArray(!0,e.map(a,function(a){return a.auto}))){d.table().node();var c=d.table().node().cloneNode(!1),b=e(d.table().header().cloneNode(!1)).appendTo(c),g=e(d.table().body().cloneNode(!1)).appendTo(c);e(d.table().footer()).clone(!1).appendTo(c);d.rows({page:"current"}).indexes().flatten().each(function(a){var b=d.row(a).node().cloneNode(!0);d.columns(":hidden").flatten().length&&e(b).append(d.cells(a,":hidden").nodes().to$().clone());e(b).appendTo(g)});var f=d.columns().header().to$().clone(!1);
e("<tr/>").append(f).appendTo(b);"inline"===this.c.details.type&&e(c).addClass("dtr-inline collapsed");c=e("<div/>").css({width:1,height:1,overflow:"hidden"}).append(c);c.find("th.never, td.never").remove();c.insertBefore(d.table().node());d.columns().eq(0).each(function(b){a[b].minWidth=f[b].offsetWidth||0});c.remove()}}};h.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}];h.defaults={breakpoints:h.breakpoints,
auto:!0,details:{renderer:function(d,a){var c=d.cells(a,":hidden").eq(0).map(function(a){var c=e(d.column(a.column).header()),a=d.cell(a).index();if(c.hasClass("control")||c.hasClass("never"))return"";var f=d.settings()[0],f=f.oApi._fnGetCellData(f,a.row,a.column,"display");(c=c.text())&&(c+=":");return'<li data-dtr-index="'+a.column+'"><span class="dtr-title">'+c+'</span> <span class="dtr-data">'+f+"</span></li>"}).toArray().join("");return c?e('<ul data-dtr-index="'+a+'"/>').append(c):!1},target:0,
type:"inline"}};var m=e.fn.dataTable.Api;m.register("responsive()",function(){return this});m.register("responsive.index()",function(d){d=e(d);return{column:d.data("dtr-index"),row:d.parent().data("dtr-index")}});m.register("responsive.rebuild()",function(){return this.iterator("table",function(d){d._responsive&&d._responsive._classLogic()})});m.register("responsive.recalc()",function(){return this.iterator("table",function(d){d._responsive&&(d._responsive._resizeAuto(),d._responsive._resize())})});
h.version="1.0.6";e.fn.dataTable.Responsive=h;e.fn.DataTable.Responsive=h;e(p).on("init.dt.dtr",function(d,a){if("dt"===d.namespace&&(e(a.nTable).hasClass("responsive")||e(a.nTable).hasClass("dt-responsive")||a.oInit.responsive||k.defaults.responsive)){var c=a.oInit.responsive;!1!==c&&new h(a,e.isPlainObject(c)?c:{})}});return h};"function"===typeof define&&define.amd?define(["jquery","datatables"],o):"object"===typeof exports?o(require("jquery"),require("datatables")):jQuery&&!jQuery.fn.dataTable.Responsive&&
o(jQuery,jQuery.fn.dataTable)})(window,document);

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save