allow user to config custom menu

This commit is contained in:
OttoMao
2015-07-12 21:19:49 +08:00
parent 95531a3558
commit 1558813144
9 changed files with 325 additions and 290 deletions

View File

@@ -21,19 +21,14 @@ function init(React){
return (
React.createElement("div", null,
React.createElement("h4", {className: "subTitle"}, "Log Filter"),
React.createElement("div", {className: "filterSection"},
React.createElement("form", {className: "uk-form"},
React.createElement("input", {className: "uk-form-large", ref: "keywordInput", onChange: self.dealChange, type: "text", placeholder: "keywords or /^regExp$/", width: "300"})
)
),
React.createElement("dl", {className: "uk-description-list-horizontal"},
React.createElement("dt", null, "wrap your RegExp between two slashes"),
React.createElement("dd", null,
"e.g. ", React.createElement("br", null),
"type ", React.createElement("strong", null, "/id=\\d", 3, "/"), " will give you all the logs containing ", React.createElement("strong", null, "id=123")
)
)
React.createElement("p", null,
React.createElement("i", {className: "uk-icon-gift"}), "  type ", React.createElement("strong", null, "/id=\\d", 3, "/"), " will give you all the logs containing ", React.createElement("strong", null, "id=123")
)
)
);
},

View File

@@ -88,18 +88,10 @@ var showPop;
document.getElementById("J_popOuter")
);
showPop = function(tag,props,popArg){
var tagEl = PopupContent[tag];
if(!tagEl) throw new Error("element not found, please make sure your panel has been pluged");
var contentEl = React.createElement(tagEl, props);
var defaultPopPara = {
show : true,
content : contentEl
};
pop.setState(util_merge(defaultPopPara,popArg));
}
showPop = function(popArg){
var stateArg = util_merge({show : true },popArg);
pop.setState(stateArg);
};
})();
//init record panel
@@ -137,7 +129,7 @@ var recorder;
});
function showDetail(data){
showPop("detail", {data:data}, {left:"35%"});
showPop({left:"35%",content:React.createElement(PopupContent["detail"], {data:data})});
}
//init recorder panel
@@ -198,14 +190,29 @@ var recorder;
}
$(".J_showFilter").on("click",function(){
showPop("filter", {onChangeKeyword : updateKeyword}, { left : "50%"});
showPop({ left:"50%", content:React.createElement(PopupContent["filter"], {onChangeKeyword : updateKeyword})});
});
})();
//map local
(function(){
$(".J_showMapPanel").on("click",function(){
showPop("map", {}, {left : "40%"});
showPop({left:"40%", content:React.createElement(PopupContent["map"],null)});
});
})();
//other button
(function(){
$(".J_customButton").on("click",function(){
var thisEl = $(this),
iframeUrl = thisEl.attr("iframeUrl");
if(!iframeUrl){
throw new Error("cannot find the url assigned for this button");
}
var iframeEl = React.createElement("iframe",{src:iframeUrl,frameBorder:0});
showPop({left:"35%", content: iframeEl });
});
})();