added guard for missing models error

'
This commit is contained in:
Kev Zettler 2011-07-26 12:59:07 -07:00
parent b780bbd42a
commit 0473fdd7ea

View File

@ -18,30 +18,30 @@ $(document).ready(function(){
}); });
guiders.createGuider({ guiders.createGuider({
attachTo: "#newpage", attachTo: "#newpage",
buttons: [{name: "Close", onclick: guiders.hideAll}], buttons: [{name: "Close", onclick: guiders.hideAll}],
description: "Click above to make a new page", description: "Click above to make a new page",
id: "newpage", id: "newpage",
position: 6, position: 6,
width: 200, width: 200,
title: "Make a new page", title: "Make a new page",
}); });
guiders.createGuider({ guiders.createGuider({
attachTo: "undefined", attachTo: "undefined",
description: "Thank you for choosing LocomotiveCMS!, <br /><br />\ description: "Thank you for choosing LocomotiveCMS!, <br /><br />\
This guide will help you get up and running.\ This guide will help you get up and running.\
We will walk you through some common tasks of LocomotiveCMS.\ We will walk you through some common tasks of LocomotiveCMS.\
This guide can be reached at any time by clicking the \"Help\" link<br /><br />\ This guide can be reached at any time by clicking the \"Help\" link<br /><br />\
Lets start by editing a page.", Lets start by editing a page.",
buttons: [{name: "Quit", onclick: guiders.hideAll}, buttons: [{name: "Quit", onclick: guiders.hideAll},
{name: "Next"}], {name: "Next"}],
id: "welcome", id: "welcome",
next: "pagewelcome", next: "pagewelcome",
overlay: true, overlay: true,
title: "Welcome to Locomotive CMS" title: "Welcome to Locomotive CMS"
}); });
guiders.createGuider({ guiders.createGuider({
attachTo: "#help", attachTo: "#help",
buttons: [], buttons: [],
@ -53,7 +53,7 @@ $(document).ready(function(){
height: 100, height: 100,
title: "" title: ""
}); });
var pagehook = (function(){ var pagehook = (function(){
var possibles = ['ul.folder:first li', var possibles = ['ul.folder:first li',
'ul#pages-list li']; 'ul#pages-list li'];
@ -63,7 +63,7 @@ $(document).ready(function(){
} }
} }
}()); }());
guiders.createGuider({ guiders.createGuider({
attachTo: pagehook, attachTo: pagehook,
buttons: [{name: "Quit", onclick: guiders.hideAll}, buttons: [{name: "Quit", onclick: guiders.hideAll},
@ -79,142 +79,148 @@ $(document).ready(function(){
overlay: true, overlay: true,
title: "" title: ""
}); });
guiders.createGuider({ guiders.createGuider({
attachTo: "undefined", attachTo: "undefined",
description: "A page is a collection of content on your site that can be reached at a web address <br /></br>\ description: "A page is a collection of content on your site that can be reached at a web address <br /></br>\
For this example we will edit the '"+$(pagehook+' a:first').text()+"' page. To do that you would click on the page name.", For this example we will edit the '"+$(pagehook+' a:first').text()+"' page. To do that you would click on the page name.",
buttons: [{name: "Quit", onclick: guiders.hideAll}, buttons: [{name: "Quit", onclick: guiders.hideAll},
{name: "Next"}], {name: "Next"}],
id: "pagewelcome", id: "pagewelcome",
next: "pagepointer", next: "pagepointer",
overlay: true, overlay: true,
title: "What is a page?"// , title: "What is a page?"// ,
// onShow: function(){ // onShow: function(){
// guiders.show('pagepointer') // guiders.show('pagepointer')
// } // }
}); });
guiders.createGuider({ guiders.createGuider({
attachTo: 'li.hoverable:eq(2)', attachTo: (function(){
buttons: [{name: "Quit", onclick: guiders.hideAll}, if($('li.hoverable:eq(2)').length > 0){
{name: "Next - Edit an Event", return 'li.hoverable:eq(2)';
onclick: function(){ }else{
window.location = $('li.hoverable:eq(2) li:first a').attr('href') + "#guider=editmodelwelcome"; return 'li.hoverable:first';
}}], }
description: "These are models.<br /> You can hover over to edit them. For this next section of the guide. We will edit an Event model. '"+$('.inner:eq(3) li:first a').text()+"' ", }()),
id: "modelpointer", buttons: [{name: "Quit", onclick: guiders.hideAll},
next: "editpagewelcome", {name: "Next - Edit an Event",
width: 240, onclick: function(){
position: 4, window.location = $('li.hoverable:eq(2) li:first a').attr('href') + "#guider=editmodelwelcome";
title: "" }}],
}); description: "These are models.<br /> You can hover over to edit them. For this next section of the guide. We will edit an Event model. '"+$('.inner:eq(3) li:first a').text()+"' ",
id: "modelpointer",
guiders.createGuider({ next: "editpagewelcome",
attachTo: 'div.action span', width: 240,
buttons: [], position: 4,
description: "Click here to make a new model", title: ""
id: "newmodelpointer", });
next: "editpagewelcome",
position: 6, guiders.createGuider({
overlay: true, attachTo: 'div.action span',
width: 200, buttons: [],
title: "" description: "Click here to make a new model",
}); id: "newmodelpointer",
next: "editpagewelcome",
guiders.createGuider({ position: 6,
attachTo: 'div.action span', overlay: true,
buttons: [], width: 200,
description: "Click here to make a new model", title: ""
id: "newmodelpointer-next", });
next: "editpagewelcome",
position: 6, guiders.createGuider({
width: 200, attachTo: 'div.action span',
title: "", buttons: [],
onShow: function(){ description: "Click here to make a new model",
console.log("updating new model url"); id: "newmodelpointer-next",
$('div.action a').attr('href', next: "editpagewelcome",
$('div.action a').attr('href') + "#guider=newmodelwelcome"); position: 6,
} width: 200,
}); title: "",
onShow: function(){
console.log("updating new model url");
guiders.createGuider({ $('div.action a').attr('href',
attachTo: "undefined", $('div.action a').attr('href') + "#guider=newmodelwelcome");
description: (function(){ }
var ret = "What is a model?<br />\ });
The concept of a model within locomotiveCMS is a peice of content that you might reuse through out your site.\
Some example models could be: Blog posts, Products, Events, Locations, Photos<br /></br />"
guiders.createGuider({
if($('li.hoverable').length > 1){ attachTo: "undefined",
ret += "For this next section of the guide. We will edit our Event model. '"+$('.inner:eq(3) li:first a').text()+"' "; description: (function(){
}else{ var ret = "What is a model?<br />\
ret += "For this next section of the guide, lets make a new model"; The concept of a model within locomotiveCMS is a peice of content that you might reuse through out your site.\
} Some example models could be: Blog posts, Products, Events, Locations, Photos<br /></br />"
return ret; if($('li.hoverable').length > 1){
}()), ret += "For this next section of the guide. We will edit our Event model. '"+$('.inner:eq(3) li:first a').text()+"' ";
buttons: [{name: "Quit", onclick: guiders.hideAll}, }else{
{name: "Next"}], ret += "For this next section of the guide, lets make a new model";
// (function(){ }
// if($('li.hoverable').length < 1){
// return { return ret;
// name: "Next - Create a Model", }()),
// onclick: function(){ buttons: [{name: "Quit", onclick: guiders.hideAll},
// guiders.hideAll(); {name: "Next"}],
// guiders.show('newmodelpointer-next'); // (function(){
// } // if($('li.hoverable').length < 1){
// }; // return {
// }else{ // name: "Next - Create a Model",
// return { // onclick: function(){
// name: "Next - Edit an Event", // guiders.hideAll();
// onclick: function(){ // guiders.show('newmodelpointer-next');
// window.location = $('li.hoverable:eq(2) li:first a').attr('href') + "#guider=editmodelwelcome"; // }
// } // };
// }; // }else{
// } // return {
// }())], // name: "Next - Edit an Event",
id: "modelwelcome", // onclick: function(){
next: (function(){ // window.location = $('li.hoverable:eq(2) li:first a').attr('href') + "#guider=editmodelwelcome";
if($('li.hoverable').length > 1){ // }
return "modelpointer"; // };
} // }
return 'newmodelpointer'; // }())],
}()), id: "modelwelcome",
overlay: true, next: (function(){
title: "Lets talk about Models...", if($('li.hoverable').length > 1){
// onShow: function(){ return "modelpointer";
// if($('li.hoverable').length > 1){ }
// guiders.show("modelpointer"); return 'newmodelpointer';
// } }()),
// //guiders.show('newmodelpointer'); overlay: true,
// } title: "Lets talk about Models...",
}); // onShow: function(){
// if($('li.hoverable').length > 1){
guiders.createGuider({ // guiders.show("modelpointer");
attachTo: 'li.settings a', // }
buttons: [], // //guiders.show('newmodelpointer');
description: "Click this tab to edit your settings.", // }
id: "settingspointer", });
position: 3,
width: 200, guiders.createGuider({
title: "" attachTo: 'li.settings a',
}); buttons: [],
description: "Click this tab to edit your settings.",
guiders.createGuider({ id: "settingspointer",
attachTo: "undefined", position: 3,
description: "LocomotiveCMS has several features that you can adjust in the settings panel. Lets head there now!", width: 200,
buttons: [{name: "Quit", onclick: guiders.hideAll}, title: ""
{name: "Next - Goto Settings", onclick: function(){ });
window.location = $('li.settings a').attr('href') + "#guider=settingseditwelcome";
}}], guiders.createGuider({
id: "settingswelcome", attachTo: "undefined",
overlay: true, description: "LocomotiveCMS has several features that you can adjust in the settings panel. Lets head there now!",
title: "How To Change Your Settings", buttons: [{name: "Quit", onclick: guiders.hideAll},
onShow: function(){ {name: "Next - Goto Settings", onclick: function(){
guiders.show("settingspointer"); window.location = $('li.settings a').attr('href') + "#guider=settingseditwelcome";
} }}],
}); id: "settingswelcome",
overlay: true,
title: "How To Change Your Settings",
onShow: function(){
guiders.show("settingspointer");
}
});
} }