diff --git a/scribeengine/public/images/media-button.png b/scribeengine/public/images/media-button.png new file mode 100644 index 0000000..a0fcdeb Binary files /dev/null and b/scribeengine/public/images/media-button.png differ diff --git a/scribeengine/public/scripts/ScribeEngine.Media.js b/scribeengine/public/scripts/ScribeEngine.Media.js index cb23fca..f9e5c78 100644 --- a/scribeengine/public/scripts/ScribeEngine.Media.js +++ b/scribeengine/public/scripts/ScribeEngine.Media.js @@ -22,9 +22,9 @@ ScribeEngine.Namespace.create("ScribeEngine.Media", { { var dirname = prompt("New Directory:", "directory"); }, - get_files: function (node, tree) + get_files: function (event, data) { - alert(tree.get_path(node)); + alert(data.inst.get_path(ScribeEngine.Events.getElement(event))); } }); diff --git a/scribeengine/public/scripts/ScribeEngine.js b/scribeengine/public/scripts/ScribeEngine.js index d9d78b3..9bdab02 100644 --- a/scribeengine/public/scripts/ScribeEngine.js +++ b/scribeengine/public/scripts/ScribeEngine.js @@ -177,25 +177,15 @@ ScribeEngine.Namespace.create("ScribeEngine.Widgets", { file_browser_callback: "ScribeEngine.Widgets.fileBrowser" }); }, - tree: function (selector, data, onselect) + tree: function (selector, tree_data, onselect) { - $(selector).jstree({ - json_data: { - data: - { - type: "json", - opts: - { - static: data - } - }, - callback: - { - onselect: onselect - } - }, - plugins : [ "themes", "json_data"] - }); + $(selector) + .bind("set_focus.jstree", onselect) + .jstree({ + plugins: ["themes", "json_data"], + json_data: {data: tree_data}, + themes: {theme: "default"} + }); } }); diff --git a/scribeengine/templates/media/index.mako b/scribeengine/templates/media/index.mako index ad302f1..5a95c69 100644 --- a/scribeengine/templates/media/index.mako +++ b/scribeengine/templates/media/index.mako @@ -19,6 +19,7 @@ #file-list ul li { float: left; } #file-list ul li div.file { border: 1px solid #f0f0f0; height: 87px; line-height: 87px; list-style: none; margin: 5px; padding: 0; width: 87px; } #file-list ul li div.caption { font-size: 8pt; text-align: center; width: 89px; } + input[type=button] { background: #f0f0f0 url(/images/media-button.png) top left repeat-x; border: 1px solid #ccc; color: #000; height: 24px; }