Skip to content

Commit

Permalink
Lagt til litt oppdaterings script, endret semantic ++
Browse files Browse the repository at this point in the history
  • Loading branch information
Gunhild Griff With committed Apr 24, 2013
1 parent 8d5460a commit 295d4c1
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 196 deletions.
50 changes: 30 additions & 20 deletions H5P.PictureSlider/js/pictureslider.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,19 +67,21 @@ H5P.PictureSlider = function(params, contentId) {
var $slidercontainer = $('<div id="slidercontainer"></div>');
$slider.append($slidercontainer);
for (var i = 0; i < slider_params.images.length; i++) {
$slidercontainer.append($('<div class="slide"><img src="' + cp + slider_params.images[i].image.path + '" width="' + slider_params.width + '" height="' + slider_params.height + '"/><div><h4>'+ slider_params.images[i].header +'</h4><p>' + slider_params.images[i].text + '</p></div></div>'));
console.log("header: "+slider_params.images[i].header);
console.log("text: "+slider_params.images[i].text);
$slidercontainer.append($('<div class="slide"><img src="' + cp + slider_params.images[i].image.path + '" alt="carousel '+i+'" width="' + slider_params.width + '" height="' + slider_params.height + '"/><div><h4>'+ slider_params.images[i].header +'</h4><p>' + slider_params.images[i].text + '</p></div></div>'));
}
} else if (slider_params.SliderType == "image_carousel") {
var $slidercontainer = $('<div id="slidercontainer"></div>');
$slider.append($slidercontainer);
for (var i = 0; i < slider_params.images.length; i++) {
$slidercontainer.append($('<img src="' + cp + slider_params.images[i].image.path + '" width="' + slider_params.images[i].image.width + '"/>'));
$slidercontainer.append($('<img src="' + cp + slider_params.images[i].image.path + '" width="' + slider_params.width + '" height="' + slider_params.height + '"/>'));
}
} else if (slider_params.SliderType == "-list_carousel") {
} else if (slider_params.SliderType == "list_carousel") {
var $slidercontainer = $('<ul id="slidercontainer"></ul>');
$slider.append($slidercontainer);
for (var i = 0; i < slider_params.images.length; i++) {
$slidercontainer.append($('<li><img src="' + cp + slider_params.images[i].image.path + '" width="' + slider_params.images[i].image.width + '"/><div></li>'));
$slidercontainer.append($('<li><img src="' + cp + slider_params.images[i].image.path + '" width="' + slider_params.width + '" height="' + slider_params.height + '"/><div></li>'));
}
}
$slidercontainer.append($('<div class="clearfix"></div>'));
Expand All @@ -88,6 +90,7 @@ H5P.PictureSlider = function(params, contentId) {
$(".picture-slider", dom).append($slider);


// $(window).ready(function() {
$(function() {
var as_circular = slider_params.circular;
if(as_circular == undefined) as_circular = true;
Expand All @@ -112,7 +115,16 @@ H5P.PictureSlider = function(params, contentId) {

var as_cookie = slider_params.cookie;
if(as_cookie == undefined) as_cookie = false;


var as_items = slider_params.items;
if(as_items == undefined) as_items = 1;

var as_auto = slider_params.auto;
if(as_auto == undefined) as_auto = true;

var as_scroll = slider_params.scroll;
if(as_scroll == undefined) as_scroll = 1;

$("#slidercontainer").carouFredSel({
circular: as_circular,
infinite: as_infinite,
Expand All @@ -121,21 +133,19 @@ H5P.PictureSlider = function(params, contentId) {
align: as_align,
padding: as_padding,
synchronise: as_synchronise,
cookie: as_cookie

/*
items: slider_params[0].items,
auto: {
easing: slider_params[0].auto.easing,
duration: slider_params[0].duration,
timeoutDuration: slider_params[0].timeoutDuration,
pauseOnHover: slider_params[0].pauseOnHover
}
}).find(".slide").hover(
// function() { $(this).find("div").slideDown(); },
// function() { $(this).find("div").slideUp(); }
*/
});
cookie: as_cookie,
items: as_items,
scroll: as_scroll
// auto : {
// easing : "elastic",
// duration : 1000,
// timeoutDuration: 2000,
// pauseOnHover: true
// }
}).find(".slide").hover(
function() { $(this).find("div").slideDown(); },
function() { $(this).find("div").slideUp(); }
);
});

//TODO: add actions
Expand Down
159 changes: 1 addition & 158 deletions H5P.PictureSlider/semantics.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,164 +70,7 @@
"type": "text",
"label": "Cookie ADD MORE INFO",
"description": "Determines whether the carousel should start at its last viewed position."
},
{
"name": "autos",
"type": "group",
"label": "Bla bla",
"Descrition": "Atuo",
"field": {
"name": "auto",
"type": "group",
"label": "Auto",
"fields": [
{
"name": "play",
"type": "text",
"label": "play (true)",
"description": "play"
},
{
"name": "timeoutDuration",
"type": "text",
"label": "timeoutDuration (true)",
"description": "timeoutDuration"
},
{
"name": "delay",
"type": "text",
"label": "delay (true)",
"description": "delay"
},
{
"name": "items",
"type": "text",
"label": "items",
"description": "items"
},
{
"name": "fx",
"type": "text",
"label": "fx",
"description": "fx"
},
{
"name": "easing",
"type": "text",
"label": "easing",
"description": "easing"
},
{
"name": "duration",
"type": "text",
"label": "duration",
"description": "duration"
},
{
"name": "pauseOnHover",
"type": "text",
"label": "pauseOnHover",
"description": "pauseOnHover"
},
{
"name": "pauseOnEvent",
"type": "text",
"label": "pauseOnEvent",
"description": "pauseOnEvent"
},
{
"name": "pauseOnResize",
"type": "text",
"label": "pauseOnResize",
"description": "pauseOnResize"
},
{
"name": "queue",
"type": "text",
"label": "queue",
"description": "queue"
},
{
"name": "event",
"type": "text",
"label": "event",
"description": "event"
},
{
"name": "progresss",
"type": "group",
"label": "Bla bla",
"field": {
"name": "progress",
"type": "group",
"label": "Progress",
"fields": [
{
"name": "bar",
"type": "text",
"label": "bar",
"description": "bar"
},
{
"name": "updater",
"type": "text",
"label": "updater",
"description": "updater"
},
{
"name": "interval",
"type": "text",
"label": "interval",
"description": "interval"
}
]
}
},
{
"name": "conditions",
"type": "text",
"label": "conditions",
"description": "conditions"
},
{
"name": "onBefore",
"type": "text",
"label": "onBefore",
"description": "onBefore"
},
{
"name": "onAfter",
"type": "text",
"label": "onAfter",
"description": "onAfter"
},
{
"name": "onEnd",
"type": "text",
"label": "onEnd",
"description": "onEnd"
},
{
"name": "onTimeoutStart",
"type": "text",
"label": "onTimeoutStart",
"description": "onTimeoutStart"
},
{
"name": "onTimeoutEnd",
"type": "text",
"label": "onTimeoutEnd",
"description": "onTimeoutEnd"
},
{
"name": "onTimeoutPause",
"type": "text",
"label": "onTimeoutPause",
"description": "onTimeoutPause"
}
]
}
},
},
{
"name": "images",
"type": "list",
Expand Down
3 changes: 2 additions & 1 deletion create_zip.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
echo "##################"
echo "# Delete old H5P #"
echo "##################"
cd ~/dev/picture_slider/
rm picture_slider.h5p
zip -r picture_slider.h5p *
zip -x *.sh .git TODO -r picture_slider.h5p *
echo "################################"
echo "# New Picture Slider is ready! #"
echo "################################"
10 changes: 1 addition & 9 deletions d6_reinstall_zip.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
echo "##################"
echo "# Delete old H5P #"
echo "##################"
rm picture_slider.h5p
zip -r picture_slider.h5p *
echo "################################"
echo "# New Picture Slider is ready! #"
echo "################################"
echo "################################"
sudo sh create_zip.sh
echo ""
echo "################################"
echo "# Delete temp files from H5P #"
Expand Down
9 changes: 1 addition & 8 deletions d6_update_reinstall_zip.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
echo "##################"
echo "# Delete old H5P #"
echo "##################"
rm picture_slider.h5p
zip -r picture_slider.h5p *
echo "################################"
echo "# New Picture Slider is ready! #"
echo "################################"
sudo sh create_zip.sh
echo "################################"
echo ""
echo "################################"
Expand Down
Binary file modified picture_slider.h5p
Binary file not shown.
1 change: 1 addition & 0 deletions project_path.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cd ~/dev/picture_slider/
4 changes: 4 additions & 0 deletions symlink1.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
cd /var/www/drupal6/sites/default/files/h5p/libraries/1
sudo rm -r 1
sudo ln -s ~/dev/picture_slider/H5P.PictureSlider 1
cd ~/dev/picture_slider/

0 comments on commit 295d4c1

Please sign in to comment.