define([
"dojo/dom"
],
function
(dom){
var
oldText = {};
return
{
setText:
function
(id, text){
var
node = dom.byId(id);
oldText[id] = node.innerHTML;
node.innerHTML = text;
},
restoreText:
function
(id){
var
node = dom.byId(id);
node.innerHTML = oldText[id];
delete
oldText[id];
}
};
});
require([
"demo/myModule"
],
function
(myModule){
myModule.setText(
"greeting"
,
"Hello Dojo!"
);
setTimeout(
function
(){
myModule.restoreText(
"greeting"
);
}, 3000);
});
--
You received this message because you are subscribed to the Google Groups "yuidoc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to yuidoc+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/yuidoc/-/x8UyBa9SLDwJ.
example code:
define([
'ModuleListView',
'backbone',
],
function(Backbone, ModuleListView,) {
var AppRouter = Backbone.Router.extend({
routes: {
"": "listCourse",
"showcourse/:id": "showCourse",
"liststudent/:id": "listStudentOnCourse",
"listmodules/:id": "listModule",
'listmodulestudents/:id': 'listmoduleStudents',
// Default
'*actions': 'defaultAction'
},
// methods
initialize: function () {
var tabHeader = '.tab > :header';
// initialisation code
},
listCourse: function () {
}
});
var initialize = function(){ // create a new AppRouter instance local, start the history bookmark
var app_router = new AppRouter;
Backbone.on('courseChange', function (id) {
app_router.navigate('showcourse/'+id, {trigger: true});
});
Backbone.history.start();
};
return { // return a handle to the initialize function
initialize: initialize
};
});
I'm totally not sure what AMD has to do with YUIDoc at all. YUIDoc
parses the Doc Block syntax, not the JS itself. There should be no
modification needed to parse and document AMD modules.
Dav
--
Dav Glass
davg...@gmail.com
blog.davglass.com