From: <die...@us...> - 2010-05-25 07:19:20
|
Revision: 2546 http://openutils.svn.sourceforge.net/openutils/?rev=2546&view=rev Author: diego_schivo Date: 2010-05-25 07:19:13 +0000 (Tue, 25 May 2010) Log Message: ----------- MEDIA-144 editing media in the playlist interface Modified Paths: -------------- trunk/openutils-mgnlmedia/src/main/resources/mgnl-resources/media/js/playlist-view.js trunk/openutils-mgnlmedia/src/main/resources/net/sourceforge/openutils/mgnlmedia/playlist/pages/PlaylistsBrowserPage.html Modified: trunk/openutils-mgnlmedia/src/main/resources/mgnl-resources/media/js/playlist-view.js =================================================================== --- trunk/openutils-mgnlmedia/src/main/resources/mgnl-resources/media/js/playlist-view.js 2010-05-24 16:44:31 UTC (rev 2545) +++ trunk/openutils-mgnlmedia/src/main/resources/mgnl-resources/media/js/playlist-view.js 2010-05-25 07:19:13 UTC (rev 2546) @@ -79,9 +79,9 @@ iconCls: 'button-edit', disabled: true, handler: function(){ - var s = grid.getSelectionModel().getSelections()[0]; - parent.openWindow('.magnolia/dialogs/' + s.data['mediaDialog'] + '.html' - + '?mgnlPath=' + s.data['mediaHandle'] + var s = grid.getSelectionModel().getSelections(); + parent.openWindow('.magnolia/dialogs/' + s[0].data['mediaDialog'] + '.html' + + '?mgnlPath=' + s[0].data['mediaHandle'] + '&mgnlRepository=media'); } } @@ -163,64 +163,6 @@ } }); - var mediaRecord; - var mediaForm = new Ext.FormPanel({ - items: { - xtype: 'fieldset', - labelWidth: 90, - title: 'Selected media details', - defaults: {width: 140}, - defaultType: 'textfield', - autoHeight: true, - bodyStyle: Ext.isIE ? 'padding:0 0 5px 15px;' : 'padding:10px 15px;', - border: false, - style: { - "margin-left": "10px", - "margin-right": Ext.isIE6 ? (Ext.isStrict ? "-10px" : "-13px") : "0" - }, - items: [{ - xtype: 'hidden', - name: 'command', - value: 'saveMedia' - }, { - xtype: 'hidden', - name: 'mgnlCK', - value: (new Date()).getTime() - }, { - xtype: 'hidden', - name: 'mediaHandle', - }, { - fieldLabel: 'Title', - name: 'title', - anchor: '100% none' - }, { - xtype: 'textarea', - fieldLabel: 'Description', - name: 'description', - anchor: '100% none' - }], - buttons: [{ - text: 'Save', - handler: function(){ - var form = mediaForm.getForm(); - if(form.isValid()){ - form.submit({ - url: contextPath + '/.magnolia/pages/playlistView.html', - success: function(){ - form.updateRecord(mediaRecord); - Ext.Msg.alert('Success', 'Media successfully saved'); - }, - failure: function(){ - Ext.Msg.alert('Failure', 'Can\'t save media'); - } - }); - } - } - }] - } - }); - mediaForm.hide(); - playlistView = new Ext.Panel({ id: 'playlistView', frame: true, @@ -242,12 +184,10 @@ singleSelect: true, listeners: { rowselect: function(sm, row, rec) { - mediaForm.getForm().loadRecord(rec); - mediaRecord = rec; - mediaForm.show(); + // nothing to do }, rowdeselect: function(sm, row, rec) { - mediaForm.hide(); + // nothing to do } } }), @@ -259,7 +199,7 @@ } },{ columnWidth: 0.4, - items: [ playlistForm, mediaForm ] + items: [ playlistForm ] }], renderTo: Ext.getBody() }); Modified: trunk/openutils-mgnlmedia/src/main/resources/net/sourceforge/openutils/mgnlmedia/playlist/pages/PlaylistsBrowserPage.html =================================================================== --- trunk/openutils-mgnlmedia/src/main/resources/net/sourceforge/openutils/mgnlmedia/playlist/pages/PlaylistsBrowserPage.html 2010-05-24 16:44:31 UTC (rev 2545) +++ trunk/openutils-mgnlmedia/src/main/resources/net/sourceforge/openutils/mgnlmedia/playlist/pages/PlaylistsBrowserPage.html 2010-05-25 07:19:13 UTC (rev 2546) @@ -50,10 +50,13 @@ }, 100); }); +var currentPath; + function openPlaylist(path){ + if (path) currentPath = path; var frame = frames['playlistView']; if (frame.disposePlaylistView) frame.disposePlaylistView(); - frame.location.href = '${this.request.contextPath}/.magnolia/pages/playlistView.html?path=' + path + '&mgnlCK=' + (new Date()).getTime(); + frame.location.href = '${this.request.contextPath}/.magnolia/pages/playlistView.html?path=' + currentPath + '&mgnlCK=' + (new Date()).getTime(); } var ulDialog; @@ -84,6 +87,15 @@ ulDialog.show(); } +//set dialog title +function setLayerTitle(title) +{ + if (ulDialog) + { + ulDialog.setTitle(title); + } +} + // close dialog function closeLayer() { @@ -92,6 +104,12 @@ ulDialog.destroy(); } } + +//reload folder content +function reloadFolder(path, type) +{ + openPlaylist(); +} //]]> </script> </head> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |