Skip to content
Browse files

Added the missing files of youtubeservice module

git-svn-id: http://svn.silverstripe.com/open/modules/youtubeservice/trunk@45006 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information...
1 parent db675bb commit 52201b3dd874f5d24719d576d4ffc092a3ef7783 lperera committed
Showing with 51 additions and 1 deletion.
  1. +5 −0 _config.php
  2. +2 −1 code/YoutubeWidget.php
  3. +39 −0 javascript/YoutubeWidget_CMS.js
  4. +5 −0 templates/YoutubeWidget.ss
View
5 _config.php
@@ -0,0 +1,5 @@
+<?php
+
+
+
+?>
View
3 code/YoutubeWidget.php
@@ -74,7 +74,8 @@ function getCMSFields() {
new TextField("Query", "Pharse"),
new TextField("CategoryTag", "Category or Tag"),
new NumericField("MaxResults", "Videos to Show")
- );
+
+ );
}
}
View
39 javascript/YoutubeWidget_CMS.js
@@ -0,0 +1,39 @@
+Behaviour.register({
+ '.YoutubeWidget select' : {
+ initialise : function() {
+ this.toggleFields();
+ },
+ onchange : function() {
+ this.toggleFields();
+ },
+
+ toggleFields : function() {
+ //hide all fields
+ var widgetFields = $$('.YoutubeWidget .widgetFields div');
+ for(i=1; i < 4; i++){
+ Element.hide(widgetFields[i]);
+ }
+
+ switch(this.value){
+ case '1':
+ Element.toggle(widgetFields[2]);
+ break;
+ case '2':
+ Element.toggle(widgetFields[3]);
+ break;
+ case '3':
+ Element.toggle(widgetFields[1]);
+ break;
+ case '4':
+ Element.toggle(widgetFields[1]);
+ break;
+
+ }
+ }
+ }
+ });
+
+
+
+
+
View
5 templates/YoutubeWidget.ss
@@ -0,0 +1,5 @@
+<div class="youtubewidget">
+ <% control Videos %>
+ <a href="$Link" title="$Title"><img src="$Image" alt="$Title" /></a>
+ <% end_control %>
+</div>

0 comments on commit 52201b3

Please sign in to comment.
Something went wrong with that request. Please try again.