Progress, implementing color picker
This commit is contained in:
@@ -18,14 +18,6 @@ function Commander()
|
||||
if(q.raw.indexOf("$") > -1){ console.log("Variables present"); return; }
|
||||
if(q.raw.indexOf(";") > -1){ this.validate_multi(q); return; }
|
||||
|
||||
// Update settings
|
||||
for(setting_id in q.settings){
|
||||
var setting_value = q.settings[setting_id];
|
||||
if(!ronin.modules[q.module].settings[setting_id]){ console.log("Missing setting",setting_id); return; }
|
||||
ronin.modules[q.module].settings[setting_id] = setting_value;
|
||||
}
|
||||
ronin.modules[q.module].routes = q.routes;
|
||||
|
||||
// Run methods
|
||||
for(method_id in q.methods){
|
||||
var method_param = q.methods[method_id];
|
||||
|
||||
@@ -8,12 +8,15 @@ function Cursor(rune)
|
||||
this.query = null;
|
||||
this.mode = "vertex";
|
||||
|
||||
this.color = "#f0f"
|
||||
this.size = 4;
|
||||
|
||||
this.draw_cursor = function(pos,touch = false)
|
||||
{
|
||||
this.clear();
|
||||
|
||||
var ctx = this.context();
|
||||
var radius = ronin.brush.settings.size;
|
||||
var radius = ronin.cursor.size;
|
||||
|
||||
ctx.beginPath();
|
||||
ctx.arc(pos.x * 2, pos.y * 2, radius, 0, 2 * Math.PI, false);
|
||||
@@ -110,7 +113,6 @@ function Cursor(rune)
|
||||
return {x:a.x-b.x,y:a.y-b.y};
|
||||
}
|
||||
|
||||
|
||||
this.inject_query = function()
|
||||
{
|
||||
if(ronin.cursor.query && ronin.cursor.query.indexOf("$") < 0){ return; }
|
||||
|
||||
@@ -37,7 +37,6 @@ function Docs()
|
||||
html += "## "+module_name+"\n\n";
|
||||
html += module.docs+"\n\n";
|
||||
html += this.print_methods(module.methods)+"\n";
|
||||
html += this.print_settings(module.settings)+"\n";
|
||||
}
|
||||
return html+"\n";
|
||||
}
|
||||
@@ -53,17 +52,6 @@ function Docs()
|
||||
return html;
|
||||
}
|
||||
|
||||
this.print_settings = function(settings)
|
||||
{
|
||||
var html = "### Settings\n";
|
||||
|
||||
for(setting_name in settings){
|
||||
var setting_val = settings[setting_name];
|
||||
html += "- `"+setting_name+"`, default "+setting_val+"\n";
|
||||
}
|
||||
return html;
|
||||
}
|
||||
|
||||
this.print_license = function()
|
||||
{
|
||||
html = "## License\n";
|
||||
|
||||
@@ -9,7 +9,9 @@ function Hint()
|
||||
{
|
||||
ronin.commander.el.appendChild(this.el);
|
||||
ronin.commander.el.appendChild(this.cursor_hint_el);
|
||||
this.cursor_hint_el.innerHTML = "";
|
||||
this.cursor_hint_el.innerHTML = "●";
|
||||
this.cursor_hint_el.title = ronin.cursor.color;
|
||||
this.cursor_hint_el.style.color = ronin.cursor.color;
|
||||
}
|
||||
|
||||
this.find_autocomplete = function(collection,append = "")
|
||||
|
||||
@@ -2,7 +2,7 @@ function Module(name,docs = "Missing documentation.")
|
||||
{
|
||||
this.name = name;
|
||||
this.methods = {};
|
||||
this.settings = {};
|
||||
|
||||
this.routes = {};
|
||||
this.ports = {};
|
||||
this.docs = docs;
|
||||
@@ -15,12 +15,7 @@ function Module(name,docs = "Missing documentation.")
|
||||
var v = this.methods[id];
|
||||
html += v.hint();
|
||||
}
|
||||
|
||||
for(setting_id in this.settings){
|
||||
var setting_value = this.settings[setting_id];
|
||||
html += setting_id+"="+setting_value+" ";
|
||||
}
|
||||
|
||||
|
||||
for(route_id in this.routes){
|
||||
var route_val = this.routes[route_id];
|
||||
html += route_id+"->"+route_val+" ";
|
||||
|
||||
@@ -8,9 +8,9 @@ function Query(query_str = "")
|
||||
var parts = query_str.split(" ").splice(1);
|
||||
this.raw = parts.join(" ");
|
||||
this.methods = {};
|
||||
this.settings = {};
|
||||
this.routes = {};
|
||||
this.last = query_str.indexOf(" ") > -1 ? query_str.split(" ")[query_str.split(" ").length-1] : query_str;
|
||||
this.last_char = query_str.trim().substr(query_str.trim().length-1,1);
|
||||
|
||||
for(part_id in parts){
|
||||
var part = parts[part_id];
|
||||
@@ -20,12 +20,6 @@ function Query(query_str = "")
|
||||
var value = part.indexOf(":") > -1 ? part.split(":")[1] : part;
|
||||
this.methods[key] = parse_parameters(value);
|
||||
}
|
||||
// Setting
|
||||
else if(part.indexOf("=") > -1){
|
||||
var key = part.indexOf("=") > -1 ? part.split("=")[0] : "any";
|
||||
var value = part.indexOf("=") > -1 ? part.split("=")[1] : part;
|
||||
this.settings[key] = parse_parameters(value);
|
||||
}
|
||||
// Port
|
||||
else if(part.indexOf("->") > -1){
|
||||
var key = part.indexOf("->") > -1 ? part.split("->")[0] : "any";
|
||||
|
||||
Reference in New Issue
Block a user