Author: rande
Date: 2010-01-12 01:56:00 +0100 (Tue, 12 Jan 2010)
New Revision: 26514
Added:
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/web/js/assetSelectJQuery.js
Modified:
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/modules/sfAsset/templates/_edit_form.php
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/web/css/media.css
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/web/js/popup.js
Log:
[swDoctrineAssetsLibraryPlugin] add mode file (to be review)
Modified:
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/modules/sfAsset/templates/_edit_form.php
===================================================================
---
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/modules/sfAsset/templates/_edit_form.php
2010-01-12 00:54:48 UTC (rev 26513)
+++
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/modules/sfAsset/templates/_edit_form.php
2010-01-12 00:56:00 UTC (rev 26514)
@@ -1,11 +1,9 @@
<?php if ($form->hasGlobalErrors()): ?>
-
- <ul class="error_list">
- <?php foreach ($form->getGlobalErrors() as $name => $error): ?>
- <li><?php echo $name.': '.$error ?></li>
- <?php endforeach; ?>
- </ul>
-
+ <ul class="error_list">
+ <?php foreach ($form->getGlobalErrors() as $name => $error): ?>
+ <li><?php echo $name.': '.$error ?></li>
+ <?php endforeach; ?>
+ </ul>
<?php endif; ?>
<form action="<?php echo url_for('sfAsset/update?id='.$sf_asset->getId()) ?>"
method="post" enctype="multipart/form-data">
Modified: plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/web/css/media.css
===================================================================
--- plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/web/css/media.css
2010-01-12 00:54:48 UTC (rev 26513)
+++ plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/web/css/media.css
2010-01-12 00:56:00 UTC (rev 26514)
@@ -3,7 +3,21 @@
padding-right: 280px;
}
+#sf_asset_container form {
+ margin:5px;
+}
+#sf_asset_container a img,:link img,:visited img { border: none; }
+#sf_asset_container a:link, #sf_admin_container a:visited
+{
+ text-decoration: none;
+}
+
+#sf_asset_container a:hover
+{
+ text-decoration: underline;
+}
+
#sf_asset_container td
{
margin: 0;
Copied:
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/web/js/assetSelectJQuery.js
(from rev 26507,
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3-vjousse/web/js/assetSelectJQuery.js)
===================================================================
---
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/web/js/assetSelectJQuery.js
(rev 0)
+++
plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/web/js/assetSelectJQuery.js
2010-01-12 00:56:00 UTC (rev 26514)
@@ -0,0 +1,75 @@
+//Appelé depuis le popup sfAsset
+
+function addAssetToTab(widgetId,assetId, url)
+{
+ if(eval('isMany'+widgetId)==0)
+ {
+ jQuery('#assets_content_'+widgetId).empty();
+ jQuery('#assets_content_'+widgetId).html('<ul
class="sortableJ"></ul>');
+ }
+
+
+ //for now, an asset is an Image ...
+ var img = new Image();
+ img.src = url;
+ jQuery('#assets_content_'+widgetId+' .sortableJ').append('<li id="item_' +
assetId + '"></li>');
+ //The image itself
+ jQuery('#assets_content_'+widgetId+' .sortableJ
#item_'+assetId).append(img);
+ //The button to remove the image
+ jQuery('#assets_content_'+widgetId+' .sortableJ
#item_'+assetId).append('<br /><span id="del_'+widgetId+'_' + assetId + '"
class="asset_del"><img src="/images/back/cross.png" alt="Enlever" /></span>');
+
+ //It's a multiple choice widget
+ if(eval('isMany'+widgetId) == 1)
+ {
+ jQuery('#assets_content_'+widgetId+' .sortableJ
#item_'+assetId).append('<input type="hidden" name="' + assetsFormName + '[]"
value="' + assetId + '" />');
+ }
+ else
+ {
+ //Just a single choice widget, so no tab
+ jQuery('#assets_content_'+widgetId+' .sortableJ
#item_'+assetId).append('<input type="hidden" name="' + assetsFormName + '"
value="' + assetId + '" />');
+
+ }
+
+ refreshDelEvent(widgetId);
+}
+
+function removeAssetFromTab(widgetId,assetId)
+{
+ jQuery('#item_'+assetId).remove();
+ refreshDelEvent(widgetId);
+}
+
+function refreshDelEvent(widgetId) {
+ //For each del cross, add the remove method
+ jQuery('.asset_del').each(function() {
+ jQuery(this).click(function() {
+ var id = jQuery(this).attr('id');
+ var widgetIdStart = 'del_' + widgetId;
+ var assetId = id.substring(widgetIdStart.length+1,id.length);
+ removeAssetFromTab(widgetId,assetId);
+ });
+
+ });
+}
+
+
+function addAssetForm(assetId, widgetId, full, thumb)
+{
+ jQuery.fn.colorbox.close();
+
+ addAssetToTab(widgetId,assetId,thumb);
+}
+
+jQuery(document).ready(function(){
+
+
+ //Popup assets
+ jQuery(".iframe").colorbox({
+ width:"80%",
+ height:"80%",
+ iframe:true,
+ opacity: 0.3
+
+ });
+
+});
\ No newline at end of file
Modified: plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/web/js/popup.js
===================================================================
--- plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/web/js/popup.js
2010-01-12 00:54:48 UTC (rev 26513)
+++ plugins/swDoctrineAssetsLibraryPlugin/branches/sf1.3/web/js/popup.js
2010-01-12 00:56:00 UTC (rev 26514)
@@ -7,3 +7,7 @@
window.close();
}
}
+
+function addAsset(assetId,widgetId,url,thumb) {
+ parent.addAssetForm(assetId,widgetId,url,thumb);
+}
\ No newline at end of file
--
You received this message because you are subscribed to the Google Groups
"symfony SVN" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/symfony-svn?hl=en.