Hi Pawel,

you are right, there are different approaches and they do not look the same and I've also ran into that issue. I solved this by giving the init function another name. I'm not sure if this issue arises because of the different approaches of declaring a "class" in javascript. If you are sure about this, go ahead and fix the oc.upload.new.js. But then you should think about cleaning all of the files.

Markus

Am 25.05.2012 18:15, schrieb Pawel Fic:
I was looking at jQuery code (trying to add a CAManagement tab -just to learn 
some of Matterhorn).

As Tobias mentioned, I would like to find a problem, propose solution, and then 
introduce it into the project (by getting a ticket etc.).
So to be constructive:




I have researched latest Matterhorn 1.4 (trunk rev 12275) of course!
And there are 4 different approaches:

Approach 1
oc.statistics.js:
======================
ocStatistics = new (function() ....
      this.Component = function ...

Approach 2
oc.admin.js:
=============
var ocAdmin = (function() {
   var admin = {};
   admin.Component = ....

Approach 3
oc.episode.js:
===================
var opencast = opencast || {};
opencast.episode = (function() {
   .....

Approach 4
oc.upload.js: (BTW: this file is not used any more)
===============
var ocUpload = ocUpload || {};
ocUpload.init = function()






And her is a serious problem I think, as long oc.upload.new.js, was written in 
Approach 2 style:

oc.upload.new.js:
=========================
var ocUpload = (function() {
   this.init = function() {
       }
   return this; ) ;

why it causes a problem ?
If somebody would like to add a simple tab to Matterhorn like 
(oc.capture_admin_managment.js), s/he would start with:

var ocCAManager = (function() {
   this.init = function() {
    .....


and there you go! Uploads are ruined by new tab (or vice versa depends on the 
order of includes in index.html).


So, my proposal is to :
==============================
1. pick an approach
2. Mark obselete approaches in source code as - not to be duplicated (or like: 
to be changed by newcomers to the project).
      +instruction how to do this.
3. fix oc.upload.new.js  -- I can do this taks.


=============
What do you think about it ?
I


_______________________________________________
Matterhorn mailing list
[email protected]
http://lists.opencastproject.org/mailman/listinfo/matterhorn


To unsubscribe please email
[email protected]
_______________________________________________


_______________________________________________
Matterhorn mailing list
[email protected]
http://lists.opencastproject.org/mailman/listinfo/matterhorn


To unsubscribe please email
[email protected]
_______________________________________________

Reply via email to