Merge commit 'tags/WebGUI_7.6.8-beta' into survey-rfe

* commit 'tags/WebGUI_7.6.8-beta': (96 commits)
  Release 7.6.8-beta
  preparing for 7.6.8 release
  convert to new storage format
  fixing photo comment test
  fixed: Syndicated Content corrupts wide characters
  Add the WikiPage to the list of contributions shown in the Account Contributions tab.
  added #!/usr/bin/env perl to all utility scripts
  Forward port i18n fix for Gallery Album RSS list.
  Fix some Survey i18n typos in the time limit hoverhelp.
  Large batch of Help and i18n.  Also, make sure that the
  Fix a typo in the i18n help for the ITransact Pay Driver.
  Correct dataform captcha variable name in the help.
  Forward porting expanded patch for handling deleted things.
  Have Thingy check for existance of table and column to prevent
  Fix linking to other things and autocreating the form field for it.
  Update test to match fixed code.
  Remove the warnings pragma
  Only resize photos if they are larger than the Gallery resolutions.
  Fix a syntax error made in the i18n of the search button.
  I18n'ed a submit button in the manage transactions screen.
  ...

Conflicts:

	lib/WebGUI/Asset/Wobject/Survey.pm
	lib/WebGUI/Asset/Wobject/Survey/SurveyJSON.pm
	www/extras/wobject/Survey/editsurvey.js
	www/extras/wobject/Survey/editsurvey/object.js
This commit is contained in:
Patrick Donelan 2009-01-14 06:00:06 +00:00
commit b7520da07d
396 changed files with 2647 additions and 1186 deletions

View file

@ -4,7 +4,7 @@ YAHOO.util.Event.addListener(window, "load", function() {
var hideStickies = 0;
this.formatStickied = function(elCell, oRecord, oColumn, sData) {
if(oRecord.getData("fieldType") != 'category'){
if(!(oRecord.getData("fieldType") in {'category':'','lastUpdated':''})){
var innerHTML = "<input type='checkBox' class='stickieCheckbox' id='" + oRecord.getData("attributeId") + "_stickied' name='" + oRecord.getData("attributeId") + "' onChange='setStickied(this)'";
if(typeof(oRecord.getData("checked")) != 'undefined' && oRecord.getData("checked") == 'checked'){
innerHTML = innerHTML + " checked='checked'";
@ -15,7 +15,7 @@ YAHOO.util.Event.addListener(window, "load", function() {
};
this.formatColors = function(elCell, oRecord, oColumn, sData) {
if(oRecord.getData("fieldType") != 'category'){
if(!(oRecord.getData("fieldType") in {'category':'','lastUpdated':''})){
var colorField = oColumn.key + "_compareColor";
var color = oRecord.getData(colorField);
if(color){
@ -157,7 +157,7 @@ YAHOO.util.Event.addListener(window, "load", function() {
if(hideStickies == 0){
// hide non-selected attributes
for(i=0; i<elements.length; i++){
if(elements[i].getData('fieldType') != 'category'){
if(!(elements[i].getData('fieldType') in {'category':'','lastUpdated':''})){
var attributeId = elements[i].getData('attributeId');
var checkBox = Dom.get(attributeId+"_stickied");
if (checkBox.checked == false){
@ -170,7 +170,7 @@ YAHOO.util.Event.addListener(window, "load", function() {
}else{
// show all attributes
for(i=0; i<elements.length; i++){
if(elements[i].getData('fieldType') != 'category'){
if(!(elements[i].getData('fieldType') in {'category':'','lastUpdated':''})){
var attributeId = elements[i].getData('attributeId');
var checkBox = Dom.get(attributeId+"_stickied");
if (checkBox.checked == false){

View file

@ -8,51 +8,32 @@ Survey.Data = (function(){
var lastDataSet = {};
var focus;
var lastId = -1;
return {
dragDrop: function(did){
var type;
YAHOO.log('In drag drop');
if (did.className.match("section")) {
type = 'section';
}
else
if (did.className.match("question")) {
type = 'question';
}
else {
type = 'answer';
}
var type = did.className.match("section") ? 'section'
: did.className.match("question") ? 'question'
: 'answer';
var first = {
id: did.id,
id: did.id, // pre-drag index of item
type: type
};
var before = document.getElementById(did.id).previousSibling;
while (1) {
if (before === undefined || (before.id !== undefined && before.id !== '')) {
break;
}
before = before.previousSibling;
}
var before = YAHOO.util.Dom.getPreviousSiblingBy( document.getElementById(did.id), function(node){
return node.id; // true iff node has a non-empty id
});
var data = {
id: '',
type: ''
};
if (before && before.id !== '') {
if (before.className.match("section")) {
type = 'section';
}
else
if (before.className.match("question")) {
type = 'question';
}
else {
type = 'answer';
}
if (before) {
type = before.className.match("section") ? 'section'
: before.className.match("question") ? 'question'
: 'answer';
data = {
id: before.id,
type: type
@ -61,11 +42,11 @@ Survey.Data = (function(){
YAHOO.log(first.id + ' ' + data.id);
Survey.Comm.dragDrop(first, data);
},
clicked: function(){
Survey.Comm.loadSurvey(this.id);
},
loadData: function(d){
focus = d.address;//What is the current highlighted item.
var showEdit = 1;
@ -77,7 +58,7 @@ Survey.Data = (function(){
lastId = d.address;
}
document.getElementById('sections').innerHTML = d.ddhtml;
//add event handlers for if a tag is clicked
for (var x in d.ids) {
if (YAHOO.lang.hasOwnProperty(d.ids, x)) {
@ -86,7 +67,7 @@ Survey.Data = (function(){
var _s = new Survey.DDList(d.ids[x], "sections");
}
}
//add the add object buttons
// if(d.buttons['section']){
document.getElementById('addSection').innerHTML = '';
@ -115,10 +96,10 @@ Survey.Data = (function(){
});
aButton.on("click", this.addAnswer, d.buttons.answer);
}
if (showEdit == 1) {
this.loadObjectEdit(d.edithtml, d.type);
// build the goto auto-complete widget
if (d.gotoTargets && document.getElementById('goto')) {
var ds = new YAHOO.util.LocalDataSource(d.gotoTargets);
@ -130,32 +111,32 @@ Survey.Data = (function(){
}
lastDataSet = d;
},
addSection: function(){
Survey.Comm.newSection();
},
addQuestion: function(e, id){
Survey.Comm.newQuestion(id);
},
addAnswer: function(e, id){
Survey.Comm.newAnswer(id);
},
loadObjectEdit: function(edit, type){
if (edit) {
Survey.ObjectTemplate.loadObject(edit, type);
}
},
loadLast: function(){
this.loadData(lastDataSet);
}
};
})();
// Initialize survey
// Initialize survey
YAHOO.util.Event.onDOMReady(function(){
var ddTarget = new YAHOO.util.DDTarget("sections", "sections");
Survey.Comm.loadSurvey();

View file

@ -7,14 +7,14 @@ if (typeof Survey === "undefined") {
Survey.ObjectTemplate = (function(){
var editor;
var dialog;
var dialog;
return {
loadObject: function(html, type){
document.getElementById('edit').innerHTML = html;
var btns = [{
text: "Submit",
handler: function(){
@ -40,7 +40,7 @@ Survey.ObjectTemplate = (function(){
this.submit();
}
}];
dialog = new YAHOO.widget.Dialog(type, {
width: "600px",
context: [document.body, 'tr', 'tr'],
@ -48,7 +48,7 @@ Survey.ObjectTemplate = (function(){
constraintoviewport: true,
buttons: btns
});
if (type !== 'answer') {
btns.push({
text: "Preview",
@ -57,13 +57,13 @@ Survey.ObjectTemplate = (function(){
}
});
}
dialog.callback = Survey.Comm.callback;
dialog.render();
dialog.render();
var textareaId = type + 'Text';
var textarea = YAHOO.util.Dom.get(textareaId);
var height = YAHOO.util.Dom.getStyle(textarea, 'height');
if (!height) {
height = '300px';
@ -73,12 +73,12 @@ Survey.ObjectTemplate = (function(){
width: '100%',
dompath: false //Turns on the bar at the bottom
});
if (editor.get('toolbar')) {
editor.get('toolbar').titlebar = false;
}
editor.render();
dialog.show();
}
};