-> group @config rules to top
--> motion conf and run dirs should be configurable in settings
-> browser compatibility test
-> requirements test
-> hint text next to section titles
PROJECT_PATH = os.path.dirname(sys.argv[0])
-CONF_PATH = os.path.join(PROJECT_PATH, 'conf') # TODO use this
+CONF_PATH = os.path.join(PROJECT_PATH, 'conf')
RUN_PATH = PROJECT_PATH
DEBUG = True
import settings
-_CONFIG_DIR = 'conf'
_CAMERA_CONFIG_FILE_NAME = 'thread-%(id)s.conf'
-_MAIN_CONFIG_FILE_PATH = os.path.join(_CONFIG_DIR, 'motion.conf')
-_CAMERA_CONFIG_FILE_PATH = os.path.join(_CONFIG_DIR, _CAMERA_CONFIG_FILE_NAME)
+_MAIN_CONFIG_FILE_PATH = os.path.join(settings.CONF_PATH, 'motion.conf')
+_CAMERA_CONFIG_FILE_PATH = os.path.join(settings.CONF_PATH, _CAMERA_CONFIG_FILE_NAME)
def get_main(as_lines=False):
def get_camera_ids():
- config_path = os.path.join(settings.PROJECT_PATH, _CONFIG_DIR)
+ config_path = settings.CONF_PATH
logging.debug('listing config dir %(path)s...' % {'path': config_path})
if not program:
raise Exception('motion executable could not be found')
- motion_config_path = os.path.join(settings.PROJECT_PATH, 'conf', 'motion.conf') # TODO conf path should be configurable
+ motion_config_path = os.path.join(settings.CONF_PATH, 'motion.conf')
motion_log_path = os.path.join(settings.RUN_PATH, 'motion.log')
motion_pid_path = os.path.join(settings.RUN_PATH, 'motion.pid')
var pushConfigs = {};
- /* Ajax */
+ /* utils */
function ajax(method, url, data, callback) {
var options = {
$.ajax(options);
}
+Object.keys = Object.keys || (function () {
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
+ var hasDontEnumBug = !({toString: null}).propertyIsEnumerable('toString');
+ var dontEnums = [
+ 'toString',
+ 'toLocaleString',
+ 'valueOf',
+ 'hasOwnProperty',
+ 'isPrototypeOf',
+ 'propertyIsEnumerable',
+ 'constructor'
+ ];
+ var dontEnumsLength = dontEnums.length;
+
+ return function (obj) {
+ if (typeof obj !== 'object' && typeof obj !== 'function' || obj === null) {
+ return [];
+ }
+
+ var result = [];
+ for (var prop in obj) {
+ if (hasOwnProperty.call(obj, prop)) {
+ result.push(prop);
+ }
+ }
+
+ if (hasDontEnumBug) {
+ for (var i = 0; i < dontEnumsLength; i++) {
+ if (hasOwnProperty.call(obj, dontEnums[i])) {
+ result.push(dontEnums[i]);
+ }
+ }
+ }
+
+ return result;
+ };
+})();
+
/* UI */
applyButton.html('Apply');
applyButton.css('display', 'inline-block');
applyButton.animate({'opacity': '1'}, 100);
- applyButton.removeClass('inactive');
+ applyButton.removeClass('progress');
}
function showProgress() {
function testReady() {
if (finishedCount >= configs.length) {
- hideApply();
+ if (Object.keys(pushConfigs).length === 0) {
+ hideApply();
+ }
+ else {
+ showApply();
+ }
}
}