[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
www.dhtmlgoodies.com • View topic - Save item
Advertisement

Save item

Moderators: Calcifer, slothy

Save item

Postby Daun » Sun Mar 04, 2007 9:11 pm

Sorry but my english is not good hope you understand.

Well i whant to save a items when i click on the link so next time i visit it should be there.
example
from the index.php
<li><a href="#" onclick="createRadio();">Radio</a></li>
<li><a href="#" onclick="createYoutube();">Youtube</a></li>

And from dragable-boxes.js

function createRadio()
{

var htmlContentOfNewBox = '<center><embed src="radio.php" width="150" height="150" wmode="transparent" type="application/x-shockwave-flash"></center>'; // HTML content of new box
var titleOfNewBox = 'Radio';
if(!staticObjectArray['staticObject3']){ // The box is not stored in cookie - we need to create it.
var newIndex = createABox(2,false,false,'staticObject3');
document.getElementById('dragableBoxContent' + newIndex).innerHTML = htmlContentOfNewBox;
document.getElementById('dragableBoxHeader_txt' + newIndex).innerHTML = titleOfNewBox;
}else{ // Box is stored in cookie - all we have to do is to move content into it.
document.getElementById('dragableBoxContent' + staticObjectArray['staticObject3']).innerHTML = htmlContentOfNewBox;
document.getElementById('dragableBoxHeader_txt' + staticObjectArray['staticObject3']).innerHTML = titleOfNewBox;

}
}
hideHeaderOptionsForStaticBoxes(staticObjectArray['staticObject3']);

function createYoutube()
{

var htmlContentOfNewBox = '<center><iframe src="youtube.php" name="iframe" width="230" marginwidth="10" height="100" marginheight="10" scrolling="auto"></iframe></center>'; // HTML content of new box
var titleOfNewBox = 'YouTube';
if(!staticObjectArray['staticObject4']){ // The box is not stored in cookie - we need to create it.
var newIndex = createABox(2,false,false,'staticObject4');
document.getElementById('dragableBoxContent' + newIndex).innerHTML = htmlContentOfNewBox;
document.getElementById('dragableBoxHeader_txt' + newIndex).innerHTML = titleOfNewBox;
}else{ // Box is stored in cookie - all we have to do is to move content into it.
document.getElementById('dragableBoxContent' + staticObjectArray['staticObject4']).innerHTML = htmlContentOfNewBox;
document.getElementById('dragableBoxHeader_txt' + staticObjectArray['staticObject4']).innerHTML = titleOfNewBox;

}
}
hideHeaderOptionsForStaticBoxes(staticObjectArray['staticObject4']);
Daun
 
Posts: 7
Joined: Tue Jan 02, 2007 12:09 pm

Postby Daun » Thu Mar 08, 2007 4:45 pm

Daun
 
Posts: 7
Joined: Tue Jan 02, 2007 12:09 pm

Postby rpgmax » Fri Mar 09, 2007 9:05 am

rpgmax
 
Posts: 5
Joined: Tue Mar 06, 2007 11:02 am

Postby Daun » Fri Mar 09, 2007 6:46 pm

Is it this line you mean setTimeout('saveCookies()',100);
Should i add it after this line
hideHeaderOptionsForStaticBoxes(staticObjectArray['staticObject2']);
Daun
 
Posts: 7
Joined: Tue Jan 02, 2007 12:09 pm

Postby Batalf » Fri Mar 09, 2007 7:19 pm

Daun,

Try to use the dragable-boxes.js which you find in the downloadable zip file.(it has been updated with some fixes today).
Batalf
Site Admin
 
Posts: 2160
Joined: Sat Oct 22, 2005 9:38 pm

Postby Daun » Fri Mar 09, 2007 8:49 pm

I have download the new one and add this but the create funktion dosent work.. What have i done wrong

/* Create static boxes */
function createClock()
{
var htmlContentOfNewBox = '<center><embed src="http://www.clocklink.com/clocks/0018-silver.swf?TimeZone=NZT&" width="150" height="150" wmode="transparent" type="application/x-shockwave-flash"></center>'; // HTML content of new box
var titleOfNewBox = 'Clock';
if(!staticObjectArray['staticObject1']){ // The box is not stored in cookie - we need to create it.
var newIndex = createABox(1,100,false,'staticObject1');
document.getElementById('dragableBoxContent' + newIndex).innerHTML = htmlContentOfNewBox;
document.getElementById('dragableBoxHeader_txt' + newIndex).innerHTML = titleOfNewBox;
}else{ // Box is stored in cookie - all we have to do is to move content into it.
document.getElementById('dragableBoxContent' + staticObjectArray['staticObject1']).innerHTML = htmlContentOfNewBox;
document.getElementById('dragableBoxHeader_txt' + staticObjectArray['staticObject1']).innerHTML = titleOfNewBox;

}
hideHeaderOptionsForStaticBoxes(staticObjectArray['staticObject1']);

function createRadio()
{
var htmlContentOfNewBox = '<center><iframe src="http://qunet.no-ip.org/drag/radio.htm" name="iframe" width="230" marginwidth="10" height="100" marginheight="10" scrolling="auto"></iframe></center>'; // HTML content of new box
var titleOfNewBox = 'Radio';
if(!staticObjectArray['staticObject2']){ // The box is not stored in cookie - we need to create it.
var newIndex = createABox(1,100,false,'staticObject2',true); // true as last argument indicates that this box is not dragable
document.getElementById('dragableBoxContent' + newIndex).innerHTML = htmlContentOfNewBox;
document.getElementById('dragableBoxHeader_txt' + newIndex).innerHTML = titleOfNewBox;
}else{ // Box is stored in cookie - all we have to do is to move content into it.
document.getElementById('dragableBoxContent' + staticObjectArray['staticObject2']).innerHTML = htmlContentOfNewBox;
document.getElementById('dragableBoxHeader_txt' + staticObjectArray['staticObject2']).innerHTML = titleOfNewBox;
disableBoxDrag( staticObjectArray['staticObject2']); // Not dragable

}
hideHeaderOptionsForStaticBoxes(staticObjectArray['staticObject2']);

setTimeout('saveCookies()',100);

}

/* Disable drag for a box */
function disableBoxDrag(boxIndex)
{
document.getElementById('dragableBoxHeader' + boxIndex).onmousedown = '';
document.getElementById('dragableBoxHeader' + boxIndex).style.cursor = 'default';

}


function initDragableBoxesScript()
{
createColumns(); // Always the first line of this function
createHelpObjects(); // Always the second line of this function
initEvents(); // Always the third line of this function

if(useCookiesToRememberRSSSources)createRSSBoxesFromCookie(); // Create RSS boxes from cookies
createDefaultBoxes(); // Create default boxes.



}




window.onload = initDragableBoxesScript;
Daun
 
Posts: 7
Joined: Tue Jan 02, 2007 12:09 pm

Postby Daun » Sun Mar 11, 2007 7:11 pm

Daun
 
Posts: 7
Joined: Tue Jan 02, 2007 12:09 pm


Return to Drag and drop scripts

Who is online

Users browsing this forum: No registered users and 22 guests

cron