Commit 473b2515 authored by shibakaneki's avatar shibakaneki

Merge branch 'master' of https://github.com/Sankore/Sankore-3.1

parents 529106dc c8ffde9f
......@@ -6,6 +6,63 @@ html, body {
color: #666666;
}
::-webkit-scrollbar {
width: 14px;
}
::-webkit-scrollbar-thumb {
/*border-radius: 10px; */
background-color:lightgray;
border: 2px solid gray;
}
::-webkit-scrollbar-button:vertical:start{
border-top-right-radius: 10px;
border-top-left-radius: 10px;
background-color:lightgray;
background-image: url(images/trgUp.png);
background-size: 8px auto;
background-position: center;
background-repeat: no-repeat;
border: 2px solid gray;
}
::-webkit-scrollbar-button:vertical:end{
border-bottom-right-radius: 10px;
border-bottom-left-radius: 10px;
background-color:lightgray;
background-image: url(images/trgDown.png);
background-size: 8px auto;
background-position: center;
background-repeat: no-repeat;
border: 2px solid gray;
}
::-webkit-scrollbar-button:horizontal:start{
width: 14px;
border-bottom-left-radius: 10px;
border-top-left-radius: 10px;
background-color:lightgray;
background-image: url(images/trgLeft.png);
background-size: 8px auto;
background-position: center;
background-repeat: no-repeat;
border: 2px solid gray;
}
::-webkit-scrollbar-button:horizontal:end{
width: 14px;
border-bottom-right-radius: 10px;
border-top-right-radius: 10px;
background-color:lightgray;
background-image: url(images/trgRight.png);
background-size: 8px auto;
background-position: center;
background-repeat: no-repeat;
border: 2px solid gray;
}
#ubwidget {
position: absolute;
top: 0;
......
......@@ -77,6 +77,8 @@ function initAfterI18nMessagesLoaded(reload, templates, callbacks) {
log("Toobar Initialisation");
$("button[role=edit]").click(function(){
app.onEdit = true;
if(window.sankore)
window.sankore.enableDropOnWidget(app.onEdit);
$(document.body).addClass("onEdit");
if(callbacks.onEdit && typeof callbacks.onEdit === 'function') {
callbacks.onEdit(app);
......@@ -84,6 +86,8 @@ function initAfterI18nMessagesLoaded(reload, templates, callbacks) {
});
$("button[role=view]").click(function(){
app.onEdit = false;
if(window.sankore)
window.sankore.enableDropOnWidget(app.onEdit);
$(document.body).removeClass("onEdit");
if(callbacks.onView && typeof callbacks.onView === 'function') {
callbacks.onView(app);
......@@ -133,7 +137,10 @@ var Parameters = (function(){
else {
log("Set parameter value ["+value+"] for key : ["+key+"]");
this.delegate.setPreference(key, value);
this.container.trigger("preferenceChange", {key: key, value: value});
this.container.trigger("preferenceChange", {
key: key,
value: value
});
}
}
}
......@@ -234,9 +241,39 @@ var App = (function() {
return doc;
}
var file = stringToXML(e.dataTransfer.getData("text/plain"));
var tmp_img = $("<img/>").attr("src", $(file).find("path:eq(0)").text());
var w = 0;
var h = 0;
$(this).append(tmp_img);
setTimeout(function(){
if(tmp_img.height() >= tmp_img.width()){
if(tmp_img.height() > 180){
h = 180;
tmp_img.attr("height",h);
w = tmp_img.width();
} else {
h = tmp_img.height();
w = tmp_img.width();
}
}
else{
if(tmp_img.width() > 180){
w = 180;
tmp_img.attr("width",w);
h = tmp_img.height();
} else {
h = tmp_img.height();
w = tmp_img.width();
}
}
callback({
src: $(file).find("path:eq(0)").text()
src: $(file).find("path:eq(0)").text(),
width: w,
height: h
});
tmp_img.remove();
}, 6)
return false;
}
......
......@@ -195,5 +195,8 @@ $(document).ready(function(){
onEdit: reloadApp,
onView: reloadApp
};
init(reloadCallback, {toolbar: toolbarTemplate, parameters: parametersTemplate}, callbacks);
init(reloadCallback, {
toolbar: toolbarTemplate,
parameters: parametersTemplate
}, callbacks);
});
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment