diff --git a/development.ini b/development.ini index 5212c77..5370edd 100644 --- a/development.ini +++ b/development.ini @@ -35,7 +35,7 @@ beaker.session.timeout = 1209600 sqlalchemy.url = sqlite:///%(here)s/scribeengine.sqlite # Media upload directory -paths.media = %(here)s/media +paths.media = %(here)s/scribeengine/public/files # Themes directory paths.themes = %(here)s/themes diff --git a/scribeengine/controllers/media.py b/scribeengine/controllers/media.py index ae50db1..d98b80c 100644 --- a/scribeengine/controllers/media.py +++ b/scribeengine/controllers/media.py @@ -71,7 +71,6 @@ class MediaController(BaseController): break def index(self): - log.debug(request.params) self._add_javascript(u'jstree/jquery.jstree.js') directories = [] path = os.path.join(config[u'paths.media'], u'user%s' % c.current_user.id) @@ -87,6 +86,7 @@ class MediaController(BaseController): def get_files(self): path = request.GET.get(u'path', u'').split(u',') dirpath = os.path.join(config[u'paths.media'], *path) + log.debug("Path: %s", path) return {u'results': self._get_files(dirpath)} @jsonify diff --git a/scribeengine/public/scripts/ScribeEngine.Media.js b/scribeengine/public/scripts/ScribeEngine.Media.js index 2a77354..6a97e8c 100644 --- a/scribeengine/public/scripts/ScribeEngine.Media.js +++ b/scribeengine/public/scripts/ScribeEngine.Media.js @@ -18,6 +18,10 @@ *****************************************************************************/ ScribeEngine.Namespace.create("ScribeEngine.Media", { + init: function () + { + // do nothing for the moment. in future, pre-select the file. + }, closeWindow: function () { window.close(); @@ -30,6 +34,7 @@ ScribeEngine.Namespace.create("ScribeEngine.Media", { { var tree = jQuery.jstree._focused(); var path = tree.get_path(ScribeEngine.Events.getElement(event)); + $("#selected-path").val(path); $.getJSON( '/media/get-files', {"path": path.toString()}, @@ -39,7 +44,11 @@ ScribeEngine.Namespace.create("ScribeEngine.Media", { var file = this; if (file.name.length > 15) { - file.name = file.name.substr(0, 12) + "..."; + file.display_name = file.name.substr(0, 12) + "..."; + } + else + { + file.display_name = file.name; } $("#file-list > ul").append( $("