browser-sync-ui
Advanced tools
Comparing version 0.5.2 to 0.5.3
@@ -34,16 +34,22 @@ (function (angular) { | ||
ctrl.servers = ctrl.throttle.servers; | ||
ctrl.btnText = "Create Server"; | ||
ctrl.port = ""; | ||
ctrl.portEntry = "auto"; | ||
ctrl.serverCount = Object.keys(ctrl.servers).length; | ||
ctrl.blurs = []; | ||
ctrl.state = { | ||
success: false, | ||
waiting: false | ||
waiting: false, | ||
classname: "ready" | ||
}; | ||
ctrl.createServer = function () { | ||
ctrl.createServer = function (selected, event) { | ||
if (ctrl.blurs.indexOf(event.target) === -1) { | ||
ctrl.blurs.push(event.target); | ||
} | ||
var item = getByProp(ctrl.throttle.targets, "id", ctrl.selected); | ||
if (ctrl.portEntry === "auto") { | ||
@@ -58,2 +64,7 @@ return send(""); | ||
if (!ctrl.port.match(/\d{4,5}/)) { | ||
setError(); | ||
return; | ||
} | ||
var port = parseInt(ctrl.port, 10); | ||
@@ -66,5 +77,2 @@ | ||
ctrl.state.waiting = true; | ||
ctrl.btnText = "please wait..."; | ||
send(ctrl.port); | ||
@@ -79,2 +87,5 @@ | ||
ctrl.state.classname = "waiting"; | ||
ctrl.state.waiting = true; | ||
Socket.emit("ui", { | ||
@@ -123,13 +134,19 @@ namespace: SECTION_NAME, | ||
ctrl.state.success = true; | ||
ctrl.btnText = "Success"; | ||
ctrl.state.classname = "success"; | ||
setTimeout(function () { | ||
ctrl.blurs.forEach(function (elem) { | ||
elem.blur(); | ||
}); | ||
setTimeout(function () { | ||
ctrl.btnText = "Create Server"; | ||
ctrl.state.success = false; | ||
ctrl.state.waiting = false; | ||
ctrl.state.success = false; | ||
ctrl.state.waiting = false; | ||
ctrl.state.classname = "ready"; | ||
$scope.$digest(); | ||
}, 1000); | ||
}, 500); | ||
}, 300); | ||
@@ -136,0 +153,0 @@ } |
@@ -60,10 +60,15 @@ var Immutable = require("immutable"); | ||
ui.socket.emit("ui:network-throttle:update", { | ||
servers: ui.getOptionIn(serverOptPath).toJS(), | ||
event: "server:create" | ||
}); | ||
setTimeout(function () { | ||
ui.servers[opts.port] = opts.server; | ||
ui.socket.emit("ui:network-throttle:update", { | ||
servers: ui.getOptionIn(serverOptPath).toJS(), | ||
event: "server:create" | ||
}); | ||
data.cb(null, opts); | ||
ui.servers[opts.port] = opts.server; | ||
data.cb(null, opts); | ||
}, 300); | ||
} | ||
@@ -70,0 +75,0 @@ |
{ | ||
"name": "browser-sync-ui", | ||
"description": "User Interface for BrowserSync", | ||
"version": "0.5.2", | ||
"version": "0.5.3", | ||
"homepage": "http://www.browsersync.io/", | ||
@@ -6,0 +6,0 @@ "author": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4514861
7001