merged with HEAD and other interesting changes
This commit is contained in:
parent
66c6c0fae5
commit
856cc06d04
151 changed files with 7335 additions and 2602 deletions
223
www/extras/VendorPayout/vendorPayout.js
Normal file
223
www/extras/VendorPayout/vendorPayout.js
Normal file
|
|
@ -0,0 +1,223 @@
|
|||
if (typeof WebGUI == "undefined" || !WebGUI) {
|
||||
var WebGUI = {};
|
||||
}
|
||||
|
||||
WebGUI.VendorPayout = function ( containerId ) {
|
||||
var obj = this;
|
||||
this.container = document.getElementById( containerId );
|
||||
|
||||
// Vendors data table
|
||||
this.vendorList = document.createElement('div');
|
||||
this.container.appendChild( this.vendorList );
|
||||
|
||||
// (De)schedule buttons
|
||||
this.buttonDiv = document.createElement('div');
|
||||
this.container.appendChild( this.buttonDiv );
|
||||
this.scheduleAllButton = new YAHOO.widget.Button({ label: 'Schedule all', container: this.buttonDiv });
|
||||
this.descheduleAllButton = new YAHOO.widget.Button({ label: 'Deschedule all', container: this.buttonDiv });
|
||||
|
||||
// Submit button
|
||||
this.submitPayoutsButton = new YAHOO.widget.Button({ label: 'Submit Scheduled Payouts', container: this.buttonDiv });
|
||||
this.submitPayoutsButton.on( 'click', function () {
|
||||
YAHOO.util.Connect.asyncRequest( 'GET', '/?shop=vendor;method=submitScheduledPayouts', {
|
||||
success: obj.initialize,
|
||||
scope: obj
|
||||
} );
|
||||
} );
|
||||
|
||||
// Payout details data table
|
||||
this.payoutDetails = document.createElement('div');
|
||||
this.container.appendChild( this.payoutDetails );
|
||||
|
||||
|
||||
this.itemBaseUrl = '/?shop=vendor;method=payoutDataAsJSON;';
|
||||
|
||||
// Initialise tables
|
||||
this.initialize();
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
WebGUI.VendorPayout.prototype.initialize = function () {
|
||||
this.initVendorList();
|
||||
this.initPayoutDetails();
|
||||
this.initButtons();
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
WebGUI.VendorPayout.prototype.initVendorList = function () {
|
||||
var obj = this;
|
||||
this.vendorSchema = [
|
||||
{ key: 'vendorId' },
|
||||
{ key: 'name' },
|
||||
{ key: 'Scheduled' },
|
||||
{ key: 'NotPaid' }
|
||||
];
|
||||
|
||||
// setup data source
|
||||
var url = '/?shop=vendor;method=vendorTotalsAsJSON;';
|
||||
this.vendorDataSource = new YAHOO.util.DataSource( url );
|
||||
this.vendorDataSource.responseType = YAHOO.util.DataSource.TYPE_JSON;
|
||||
this.vendorDataSource.responseSchema = {
|
||||
resultsList : 'vendors',
|
||||
fields : this.vendorSchema
|
||||
};
|
||||
|
||||
// initialize data table
|
||||
this.vendorDataTable = new YAHOO.widget.DataTable( this.vendorList, this.vendorSchema, this.vendorDataSource, {
|
||||
selectionMode : 'single'
|
||||
} );
|
||||
|
||||
// add handlers for rowhighlighting/selection
|
||||
this.vendorDataTable.subscribe( "rowClickEvent", this.vendorDataTable.onEventSelectRow );
|
||||
this.vendorDataTable.subscribe( "rowMouseoverEvent", this.vendorDataTable.onEventHighlightRow );
|
||||
this.vendorDataTable.subscribe( "rowMouseoutEvent", this.vendorDataTable.onEventUnhighlightRow );
|
||||
|
||||
// add an additional row click handler that fetches this vendor's data for the payout details table
|
||||
this.vendorDataTable.subscribe( "rowClickEvent", function (e) {
|
||||
var record = this.getRecord( e.target );
|
||||
obj.currentVendorId = record.getData( 'vendorId' );
|
||||
obj.currentVendorRow = record;
|
||||
|
||||
obj.refreshItemDataTable();
|
||||
} );
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
WebGUI.VendorPayout.prototype.refreshItemDataTable = function () {
|
||||
// Set the url here so pagination keeps working...
|
||||
this.itemDataSource.liveData = this.itemBaseUrl + 'vendorId=' + this.currentVendorId +';';
|
||||
|
||||
this.itemDataSource.sendRequest( '', {
|
||||
success : this.itemDataTable.onDataReturnInitializeTable, //ReplaceRows,
|
||||
scope : this.itemDataTable
|
||||
} );
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
WebGUI.VendorPayout.prototype.refreshVendorRow = function () {
|
||||
var obj = this;
|
||||
this.vendorDataSource.sendRequest( 'vendorId=' + this.currentVendorId, {
|
||||
// onDataReturnUpdateRows is not available in yui 2.6.0...
|
||||
success : function ( req, response , payload ) {
|
||||
this.updateRow( obj.currentVendorRow, response.results[0] );
|
||||
},
|
||||
scope : this.vendorDataTable
|
||||
} );
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
WebGUI.VendorPayout.prototype.initPayoutDetails = function () {
|
||||
var obj = this;
|
||||
this.itemSchema = [
|
||||
{ key: 'itemId' },
|
||||
{ key: 'configuredTitle' },
|
||||
{ key: 'price' },
|
||||
{ key: 'quantity' },
|
||||
{ key: 'vendorPayoutAmount' },
|
||||
{ key: 'vendorPayoutStatus' }
|
||||
]
|
||||
|
||||
// Create a row formatter to highlight Scheduled payouts
|
||||
var rowFormatter = function ( tr, record ) {
|
||||
if (record.getData('vendorPayoutStatus') === 'Scheduled') {
|
||||
YAHOO.util.Dom.addClass( tr, 'scheduled' );
|
||||
}
|
||||
else {
|
||||
YAHOO.util.Dom.removeClass( tr, 'scheduled' );
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// Instanciate the datasource.
|
||||
this.itemDataSource = new YAHOO.util.DataSource( this.itemBaseUrl );
|
||||
this.itemDataSource.responseType = YAHOO.util.DataSource.TYPE_JSON;
|
||||
this.itemDataSource.responseSchema = {
|
||||
resultsList : 'results',
|
||||
fields : this.itemSchema,
|
||||
metaFields : { totalRecords : 'totalRecords' }
|
||||
};
|
||||
|
||||
// Instanciate the DataTable.
|
||||
this.itemDataTable = new YAHOO.widget.DataTable( this.payoutDetails, this.itemSchema, this.itemDataSource, {
|
||||
dynamicData : true,
|
||||
formatRow : rowFormatter,
|
||||
paginator : new YAHOO.widget.Paginator({ rowsPerPage:10 } ) //, updateOnChange: true })
|
||||
});
|
||||
this.itemDataTable.handleDataReturnPayload = function(oRequest, oResponse, oPayload) {
|
||||
// For some reason oPayload is undefined when we're switch vendors. This is a hack to
|
||||
// still set the paginator correctly.
|
||||
if ( !oPayload ) {
|
||||
oPayload = this;
|
||||
var paginator = this.get('paginator');
|
||||
paginator.set( 'totalRecords', parseInt( oResponse.meta.totalRecords,10) );
|
||||
}
|
||||
oPayload.totalRecords = oResponse.meta.totalRecords;
|
||||
return oPayload;
|
||||
};
|
||||
|
||||
// Add event handlers for mouseover highlighting
|
||||
this.itemDataTable.subscribe( "rowMouseoverEvent", this.itemDataTable.onEventHighlightRow );
|
||||
this.itemDataTable.subscribe( "rowMouseoutEvent", this.itemDataTable.onEventUnhighlightRow );
|
||||
|
||||
// Add a row click handler which takes care of switching between Scheduled and NotPaid.
|
||||
this.itemDataTable.subscribe( "rowClickEvent", function (e) {
|
||||
var record = this.getRecord( e.target );
|
||||
var callback = {
|
||||
scope : this,
|
||||
success : function ( o ) {
|
||||
var status = o.responseText;
|
||||
if ( status.match(/^error/) ) {
|
||||
alert( status );
|
||||
return;
|
||||
}
|
||||
|
||||
// Update status cell contents
|
||||
this.updateCell( record, 'vendorPayoutStatus', status );
|
||||
|
||||
// Update row higlighting
|
||||
rowFormatter( this.getTrEl( record ), record );
|
||||
|
||||
// Update vendor row
|
||||
obj.refreshVendorRow();
|
||||
}
|
||||
};
|
||||
|
||||
var status = record.getData( 'vendorPayoutStatus' ) === 'NotPaid' ? 'Scheduled' : 'NotPaid';
|
||||
var url = '/?shop=vendor;method=setPayoutStatus' + ';itemId=' + record.getData( 'itemId' ) + ';status=' + status;
|
||||
YAHOO.util.Connect.asyncRequest( 'post', url, callback );
|
||||
} );
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
WebGUI.VendorPayout.prototype.initButtons = function () {
|
||||
var obj = this;
|
||||
|
||||
var updateAll = function ( status ) {
|
||||
// TODO: Make this range based.
|
||||
var records = obj.itemDataTable.getRecordSet().getRecords();
|
||||
var itemIds = new Array;
|
||||
for (i = 0; i < records.length; i++) {
|
||||
itemIds.push( 'itemId=' + records[i].getData( 'itemId' ) );
|
||||
}
|
||||
|
||||
var postdata = itemIds.join('&');
|
||||
var url = '/?shop=vendor&method=setPayoutStatus&status=' + status;
|
||||
var callback = {
|
||||
success: function (o) {
|
||||
this.refreshItemDataTable();
|
||||
this.refreshVendorRow();
|
||||
},
|
||||
scope: obj
|
||||
};
|
||||
|
||||
YAHOO.util.Connect.asyncRequest( 'POST', url, callback, postdata );
|
||||
}
|
||||
|
||||
this.scheduleAllButton.on( 'click', function () { updateAll( 'Scheduled' ) } );
|
||||
this.descheduleAllButton.on( 'click', function () { updateAll( 'NotPaid' ) } );
|
||||
|
||||
}
|
||||
|
||||
BIN
www/extras/adminConsole/assetHistory.gif
Normal file
BIN
www/extras/adminConsole/assetHistory.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.1 KiB |
BIN
www/extras/adminConsole/passiveAnalytics.png
Normal file
BIN
www/extras/adminConsole/passiveAnalytics.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.7 KiB |
BIN
www/extras/adminConsole/small/assetHistory.gif
Normal file
BIN
www/extras/adminConsole/small/assetHistory.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1 KiB |
BIN
www/extras/adminConsole/small/passiveAnalytics.png
Normal file
BIN
www/extras/adminConsole/small/passiveAnalytics.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 966 B |
|
|
@ -1,4 +1,4 @@
|
|||
function EAL(){this.version="0.7.2.2";date=new Date();this.start_time=date.getTime();this.win="loading";this.error=false;this.baseURL="";this.template="";this.lang=new Object();this.load_syntax=new Object();this.syntax=new Object();this.loadedFiles=new Array();this.waiting_loading=new Object();this.scripts_to_load=new Array();this.sub_scripts_to_load=new Array();this.resize=new Array();this.hidden=new Object();this.default_settings={debug:false ,smooth_selection:true ,font_size:"10" ,font_family:"monospace" ,start_highlight:false ,autocompletion:false ,toolbar:"search,go_to_line,fullscreen,|,undo,redo,|,select_font,|,change_smooth_selection,highlight,reset_highlight,|,help" ,begin_toolbar:"" ,end_toolbar:"" ,is_multi_files:false ,allow_resize:"both" ,show_line_colors:false ,min_width:400 ,min_height:125 ,replace_tab_by_spaces:false ,allow_toggle:true ,language:"en" ,syntax:"" ,syntax_selection_allow:"basic,brainfuck,c,coldfusion,cpp,css,html,js,pas,perl,php,python,ruby,robotstxt,sql,tsql,vb,xml" ,display:"onload" ,max_undo:30 ,browsers:"known" ,plugins:"" ,gecko_spellcheck:false ,fullscreen:false ,is_editable:true ,wrap_text:false ,load_callback:"" ,save_callback:"" ,change_callback:"" ,submit_callback:"" ,EA_init_callback:"" ,EA_delete_callback:"" ,EA_load_callback:"" ,EA_unload_callback:"" ,EA_toggle_on_callback:"" ,EA_toggle_off_callback:"" ,EA_file_switch_on_callback:"" ,EA_file_switch_off_callback:"" ,EA_file_close_callback:"" };this.advanced_buttons=[ ['new_document','newdocument.gif','new_document',false],['search','search.gif','show_search',false],['go_to_line','go_to_line.gif','go_to_line',false],['undo','undo.gif','undo',true],['redo','redo.gif','redo',true],['change_smooth_selection','smooth_selection.gif','change_smooth_selection_mode',true],['reset_highlight','reset_highlight.gif','resync_highlight',true],['highlight','highlight.gif','change_highlight',true],['help','help.gif','show_help',false],['save','save.gif','save',false],['load','load.gif','load',false],['fullscreen','fullscreen.gif','toggle_full_screen',false],['autocompletion','autocompletion.gif','toggle_autocompletion',true] ];ua=navigator.userAgent;this.nav=new Object();this.nav['isMacOS']=(ua.indexOf('Mac OS')!=-1);this.nav['isIE']=(navigator.appName=="Microsoft Internet Explorer");if(this.nav['isIE']){this.nav['isIE']=ua.replace(/^.*?MSIE ([0-9\.]*).*$/,"$1");if(this.nav['isIE']<6)this.has_error();}if(this.nav['isNS']=ua.indexOf('Netscape/')!=-1){this.nav['isNS']=ua.substr(ua.indexOf('Netscape/')+9);if(this.nav['isNS']<8||!this.nav['isIE'])this.has_error();}if(this.nav['isOpera']=(ua.indexOf('Opera')!=-1)){this.nav['isOpera']=ua.replace(/^.*?Opera.*?([0-9\.]+).*$/i,"$1");if(this.nav['isOpera']<9)this.has_error();this.nav['isIE']=false;}this.nav['isGecko']=(ua.indexOf('Gecko')!=-1);if(this.nav['isFirefox'] =(ua.indexOf('Firefox')!=-1))this.nav['isFirefox']=ua.replace(/^.*?Firefox.*?([0-9\.]+).*$/i,"$1");if(this.nav['isIceweasel'] =(ua.indexOf('Iceweasel')!=-1))this.nav['isFirefox']=this.nav['isIceweasel']=ua.replace(/^.*?Iceweasel.*?([0-9\.]+).*$/i,"$1");if(this.nav['GranParadiso'] =(ua.indexOf('GranParadiso')!=-1))this.nav['isFirefox']=this.nav['isGranParadiso']=ua.replace(/^.*?GranParadiso.*?([0-9\.]+).*$/i,"$1");if(this.nav['isCamino'] =(ua.indexOf('Camino')!=-1))this.nav['isCamino']=ua.replace(/^.*?Camino.*?([0-9\.]+).*$/i,"$1");if(this.nav['isChrome'] =(ua.indexOf('Chrome')!=-1))this.nav['isChrome']=ua.replace(/^.*?Chrome.*?([0-9\.]+).*$/i,"$1");if(this.nav['isSafari'] =(ua.indexOf('Safari')!=-1))this.nav['isSafari']=ua.replace(/^.*?Version\/([0-9]+\.[0-9]+).*$/i,"$1");if(this.nav['isIE']>=6||this.nav['isOpera']>=9||this.nav['isFirefox']||this.nav['isChrome']||this.nav['isCamino']||this.nav['isSafari']>=3)this.nav['isValidBrowser']=true;
|
||||
function EAL(){this.version="0.7.2.2";date=new Date();this.start_time=date.getTime();this.win="loading";this.error=false;this.baseURL="";this.template="";this.lang=new Object();this.load_syntax=new Object();this.syntax=new Object();this.loadedFiles=new Array();this.waiting_loading=new Object();this.scripts_to_load=new Array();this.sub_scripts_to_load=new Array();this.resize=new Array();this.hidden=new Object();this.default_settings={debug:false ,smooth_selection:true ,font_size:"10" ,font_family:"monospace" ,start_highlight:false ,autocompletion:false ,toolbar:"search,go_to_line,fullscreen,|,undo,redo,|,select_font,|,change_smooth_selection,highlight,reset_highlight,|,help" ,begin_toolbar:"" ,end_toolbar:"" ,is_multi_files:false ,allow_resize:"both" ,show_line_colors:false ,min_width:400 ,min_height:125 ,replace_tab_by_spaces:false ,allow_toggle:true ,language:"en" ,syntax:"" ,syntax_selection_allow:"basic,c,coldfusion,cpp,css,html,js,pas,perl,php,python,ruby,robotstxt,sql,tsql,vb,xml" ,display:"onload" ,max_undo:30 ,browsers:"known" ,plugins:"" ,gecko_spellcheck:false ,fullscreen:false ,is_editable:true ,wrap_text:false ,load_callback:"" ,save_callback:"" ,change_callback:"" ,submit_callback:"" ,EA_init_callback:"" ,EA_delete_callback:"" ,EA_load_callback:"" ,EA_unload_callback:"" ,EA_toggle_on_callback:"" ,EA_toggle_off_callback:"" ,EA_file_switch_on_callback:"" ,EA_file_switch_off_callback:"" ,EA_file_close_callback:"" };this.advanced_buttons=[ ['new_document','newdocument.gif','new_document',false],['search','search.gif','show_search',false],['go_to_line','go_to_line.gif','go_to_line',false],['undo','undo.gif','undo',true],['redo','redo.gif','redo',true],['change_smooth_selection','smooth_selection.gif','change_smooth_selection_mode',true],['reset_highlight','reset_highlight.gif','resync_highlight',true],['highlight','highlight.gif','change_highlight',true],['help','help.gif','show_help',false],['save','save.gif','save',false],['load','load.gif','load',false],['fullscreen','fullscreen.gif','toggle_full_screen',false],['autocompletion','autocompletion.gif','toggle_autocompletion',true] ];ua=navigator.userAgent;this.nav=new Object();this.nav['isMacOS']=(ua.indexOf('Mac OS')!=-1);this.nav['isIE']=(navigator.appName=="Microsoft Internet Explorer");if(this.nav['isIE']){this.nav['isIE']=ua.replace(/^.*?MSIE ([0-9\.]*).*$/,"$1");if(this.nav['isIE']<6)this.has_error();}if(this.nav['isNS']=ua.indexOf('Netscape/')!=-1){this.nav['isNS']=ua.substr(ua.indexOf('Netscape/')+9);if(this.nav['isNS']<8||!this.nav['isIE'])this.has_error();}if(this.nav['isOpera']=(ua.indexOf('Opera')!=-1)){this.nav['isOpera']=ua.replace(/^.*?Opera.*?([0-9\.]+).*$/i,"$1");if(this.nav['isOpera']<9)this.has_error();this.nav['isIE']=false;}this.nav['isGecko']=(ua.indexOf('Gecko')!=-1);if(this.nav['isFirefox'] =(ua.indexOf('Firefox')!=-1))this.nav['isFirefox']=ua.replace(/^.*?Firefox.*?([0-9\.]+).*$/i,"$1");if(this.nav['isIceweasel'] =(ua.indexOf('Iceweasel')!=-1))this.nav['isFirefox']=this.nav['isIceweasel']=ua.replace(/^.*?Iceweasel.*?([0-9\.]+).*$/i,"$1");if(this.nav['GranParadiso'] =(ua.indexOf('GranParadiso')!=-1))this.nav['isFirefox']=this.nav['isGranParadiso']=ua.replace(/^.*?GranParadiso.*?([0-9\.]+).*$/i,"$1");if(this.nav['isCamino'] =(ua.indexOf('Camino')!=-1))this.nav['isCamino']=ua.replace(/^.*?Camino.*?([0-9\.]+).*$/i,"$1");if(this.nav['isChrome'] =(ua.indexOf('Chrome')!=-1))this.nav['isChrome']=ua.replace(/^.*?Chrome.*?([0-9\.]+).*$/i,"$1");if(this.nav['isSafari'] =(ua.indexOf('Safari')!=-1))this.nav['isSafari']=ua.replace(/^.*?Version\/([0-9]+\.[0-9]+).*$/i,"$1");if(this.nav['isIE']>=6||this.nav['isOpera']>=9||this.nav['isFirefox']||this.nav['isChrome']||this.nav['isCamino']||this.nav['isSafari']>=3)this.nav['isValidBrowser']=true;
|
||||
else this.nav['isValidBrowser']=false;this.set_base_url();for(var i=0;i<this.scripts_to_load.length;i++){setTimeout("eAL.load_script('"+this.baseURL+this.scripts_to_load[i]+".js');",1);this.waiting_loading[this.scripts_to_load[i]+".js"]=false;}this.add_event(window,"load",EAL.prototype.window_loaded);};EAL.prototype ={has_error:function(){this.error=true;for(var i in EAL.prototype){EAL.prototype[i]=function(){};}},window_loaded:function(){eAL.win="loaded";if (document.forms){for (var i=0;i<document.forms.length;i++){var form=document.forms[i];form.edit_area_replaced_submit=null;try{form.edit_area_replaced_submit=form.onsubmit;form.onsubmit="";}catch (e){}eAL.add_event(form,"submit",EAL.prototype.submit);eAL.add_event(form,"reset",EAL.prototype.reset);}}eAL.add_event(window,"unload",function(){for(var i in eAs){eAL.delete_instance(i);}});},init_ie_textarea:function(id){var t=document.getElementById(id);try{if(t&&typeof(t.focused)=="undefined"){t.focus();t.focused=true;t.selectionStart=t.selectionEnd=0;get_IE_selection(t);eAL.add_event(t,"focus",IE_textarea_focus);eAL.add_event(t,"blur",IE_textarea_blur);}}catch(ex){}},init:function(settings){if(!settings["id"])this.has_error();if(this.error)return;if(eAs[settings["id"]])eAL.delete_instance(settings["id"]);for(var i in this.default_settings){if(typeof(settings[i])=="undefined")settings[i]=this.default_settings[i];}if(settings["browsers"]=="known"&&this.nav['isValidBrowser']==false){return;}if(settings["begin_toolbar"].length>0)settings["toolbar"]=settings["begin_toolbar"] +","+settings["toolbar"];if(settings["end_toolbar"].length>0)settings["toolbar"]=settings["toolbar"] +","+settings["end_toolbar"];settings["tab_toolbar"]=settings["toolbar"].replace(/ /g,"").split(",");settings["plugins"]=settings["plugins"].replace(/ /g,"").split(",");for(var i=0;i<settings["plugins"].length;i++){if(settings["plugins"][i].length==0)settings["plugins"].splice(i,1);}this.get_template();this.load_script(this.baseURL+"langs/"+settings["language"]+".js");if(settings["syntax"].length>0){settings["syntax"]=settings["syntax"].toLowerCase();this.load_script(this.baseURL+"reg_syntax/"+settings["syntax"]+".js");}eAs[settings["id"]]={"settings":settings};eAs[settings["id"]]["displayed"]=false;eAs[settings["id"]]["hidden"]=false;eAL.start(settings["id"]);},delete_instance:function(id){eAL.execCommand(id,"EA_delete");if(window.frames["frame_"+id]&&window.frames["frame_"+id].editArea){if(eAs[id]["displayed"])eAL.toggle(id,"off");window.frames["frame_"+id].editArea.execCommand("EA_unload");}var span=document.getElementById("EditAreaArroundInfos_"+id);if(span)span.parentNode.removeChild(span);var iframe=document.getElementById("frame_"+id);if(iframe){iframe.parentNode.removeChild(iframe);try{delete window.frames["frame_"+id];}catch (e){}}delete eAs[id];},start:function(id){if(this.win!="loaded"){setTimeout("eAL.start('"+id+"');",50);return;}for(var i in eAL.waiting_loading){if(eAL.waiting_loading[i]!="loaded"&&typeof(eAL.waiting_loading[i])!="function"){setTimeout("eAL.start('"+id+"');",50);return;}}if(!eAL.lang[eAs[id]["settings"]["language"]]||(eAs[id]["settings"]["syntax"].length>0&&!eAL.load_syntax[eAs[id]["settings"]["syntax"]])){setTimeout("eAL.start('"+id+"');",50);return;}if(eAs[id]["settings"]["syntax"].length>0)eAL.init_syntax_regexp();if(!document.getElementById("EditAreaArroundInfos_"+id)&&(eAs[id]["settings"]["debug"]||eAs[id]["settings"]["allow_toggle"])){var span=document.createElement("span");span.id="EditAreaArroundInfos_"+id;var html="";if(eAs[id]["settings"]["allow_toggle"]){checked=(eAs[id]["settings"]["display"]=="onload")?"checked":"";html+="<div id='edit_area_toggle_"+i+"'>";html+="<input id='edit_area_toggle_checkbox_"+id +"' class='toggle_"+id +"' type='checkbox' onclick='eAL.toggle(\""+id +"\");' accesskey='e' "+checked+" />";html+="<label for='edit_area_toggle_checkbox_"+id +"'>{$toggle}</label></div>";}if(eAs[id]["settings"]["debug"])html+="<textarea id='edit_area_debug_"+id +"' style='z-index:20;width:100%;height:120px;overflow:auto;border:solid black 1px;'></textarea><br />";html=eAL.translate(html,eAs[id]["settings"]["language"]);span.innerHTML=html;var father=document.getElementById(id).parentNode;var next=document.getElementById(id).nextSibling;if(next==null)father.appendChild(span);
|
||||
else father.insertBefore(span,next);}if(!eAs[id]["initialized"]){this.execCommand(id,"EA_init");if(eAs[id]["settings"]["display"]=="later"){eAs[id]["initialized"]=true;return;}}if(this.nav['isIE']){eAL.init_ie_textarea(id);}var html_toolbar_content="";area=eAs[id];for(var i=0;i<area["settings"]["tab_toolbar"].length;i++){html_toolbar_content+=this.get_control_html(area["settings"]["tab_toolbar"][i],area["settings"]["language"]);}if(!this.iframe_script){this.iframe_script="";for(var i=0;i<this.sub_scripts_to_load.length;i++)this.iframe_script+='<script language="javascript" type="text/javascript" src="'+this.baseURL+this.sub_scripts_to_load[i] +'.js"></script>';}for(var i=0;i<area["settings"]["plugins"].length;i++){if(!eAL.all_plugins_loaded)this.iframe_script+='<script language="javascript" type="text/javascript" src="'+this.baseURL+'plugins/'+area["settings"]["plugins"][i]+'/'+area["settings"]["plugins"][i] +'.js"></script>';this.iframe_script+='<script language="javascript" type="text/javascript" src="'+this.baseURL+'plugins/'+area["settings"]["plugins"][i]+'/langs/'+area["settings"]["language"] +'.js"></script>';}if(!this.iframe_css){this.iframe_css="<link href='"+this.baseURL +"edit_area.css' rel='stylesheet' type='text/css' />";}var template=this.template.replace(/\[__BASEURL__\]/g,this.baseURL);template=template.replace("[__TOOLBAR__]",html_toolbar_content);template=this.translate(template,area["settings"]["language"],"template");template=template.replace("[__CSSRULES__]",this.iframe_css);template=template.replace("[__JSCODE__]",this.iframe_script);template=template.replace("[__EA_VERSION__]",this.version);area.textarea=document.getElementById(area["settings"]["id"]);eAs[area["settings"]["id"]]["textarea"]=area.textarea;if(typeof(window.frames["frame_"+area["settings"]["id"]])!='undefined')delete window.frames["frame_"+area["settings"]["id"]];var father=area.textarea.parentNode;var content=document.createElement("iframe");content.name="frame_"+area["settings"]["id"];content.id="frame_"+area["settings"]["id"];content.style.borderWidth="0px";setAttribute(content,"frameBorder","0");content.style.overflow="hidden";content.style.display="none";var next=area.textarea.nextSibling;if(next==null)father.appendChild(content);
|
||||
else father.insertBefore(content,next);var frame=window.frames["frame_"+area["settings"]["id"]];frame.document.open();frame.eAs=eAs;frame.area_id=area["settings"]["id"];frame.document.area_id=area["settings"]["id"];frame.document.write(template);frame.document.close();},toggle:function(id,toggle_to){if(!toggle_to)toggle_to=(eAs[id]["displayed"]==true)?"off":"on";if(eAs[id]["displayed"]==true &&toggle_to=="off"){this.toggle_off(id);}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
function EAL(){this.version="0.7.2.2";date=new Date();this.start_time=date.getTime();this.win="loading";this.error=false;this.baseURL="";this.template="";this.lang=new Object();this.load_syntax=new Object();this.syntax=new Object();this.loadedFiles=new Array();this.waiting_loading=new Object();this.scripts_to_load=new Array();this.sub_scripts_to_load=new Array();this.resize=new Array();this.hidden=new Object();this.default_settings={debug:false ,smooth_selection:true ,font_size:"10" ,font_family:"monospace" ,start_highlight:false ,autocompletion:false ,toolbar:"search,go_to_line,fullscreen,|,undo,redo,|,select_font,|,change_smooth_selection,highlight,reset_highlight,|,help" ,begin_toolbar:"" ,end_toolbar:"" ,is_multi_files:false ,allow_resize:"both" ,show_line_colors:false ,min_width:400 ,min_height:125 ,replace_tab_by_spaces:false ,allow_toggle:true ,language:"en" ,syntax:"" ,syntax_selection_allow:"basic,brainfuck,c,coldfusion,cpp,css,html,js,pas,perl,php,python,ruby,robotstxt,sql,tsql,vb,xml" ,display:"onload" ,max_undo:30 ,browsers:"known" ,plugins:"" ,gecko_spellcheck:false ,fullscreen:false ,is_editable:true ,wrap_text:false ,load_callback:"" ,save_callback:"" ,change_callback:"" ,submit_callback:"" ,EA_init_callback:"" ,EA_delete_callback:"" ,EA_load_callback:"" ,EA_unload_callback:"" ,EA_toggle_on_callback:"" ,EA_toggle_off_callback:"" ,EA_file_switch_on_callback:"" ,EA_file_switch_off_callback:"" ,EA_file_close_callback:"" };this.advanced_buttons=[ ['new_document','newdocument.gif','new_document',false],['search','search.gif','show_search',false],['go_to_line','go_to_line.gif','go_to_line',false],['undo','undo.gif','undo',true],['redo','redo.gif','redo',true],['change_smooth_selection','smooth_selection.gif','change_smooth_selection_mode',true],['reset_highlight','reset_highlight.gif','resync_highlight',true],['highlight','highlight.gif','change_highlight',true],['help','help.gif','show_help',false],['save','save.gif','save',false],['load','load.gif','load',false],['fullscreen','fullscreen.gif','toggle_full_screen',false],['autocompletion','autocompletion.gif','toggle_autocompletion',true] ];ua=navigator.userAgent;this.nav=new Object();this.nav['isMacOS']=(ua.indexOf('Mac OS')!=-1);this.nav['isIE']=(navigator.appName=="Microsoft Internet Explorer");if(this.nav['isIE']){this.nav['isIE']=ua.replace(/^.*?MSIE ([0-9\.]*).*$/,"$1");if(this.nav['isIE']<6)this.has_error();}if(this.nav['isNS']=ua.indexOf('Netscape/')!=-1){this.nav['isNS']=ua.substr(ua.indexOf('Netscape/')+9);if(this.nav['isNS']<8||!this.nav['isIE'])this.has_error();}if(this.nav['isOpera']=(ua.indexOf('Opera')!=-1)){this.nav['isOpera']=ua.replace(/^.*?Opera.*?([0-9\.]+).*$/i,"$1");if(this.nav['isOpera']<9)this.has_error();this.nav['isIE']=false;}this.nav['isGecko']=(ua.indexOf('Gecko')!=-1);if(this.nav['isFirefox'] =(ua.indexOf('Firefox')!=-1))this.nav['isFirefox']=ua.replace(/^.*?Firefox.*?([0-9\.]+).*$/i,"$1");if(this.nav['isIceweasel'] =(ua.indexOf('Iceweasel')!=-1))this.nav['isFirefox']=this.nav['isIceweasel']=ua.replace(/^.*?Iceweasel.*?([0-9\.]+).*$/i,"$1");if(this.nav['GranParadiso'] =(ua.indexOf('GranParadiso')!=-1))this.nav['isFirefox']=this.nav['isGranParadiso']=ua.replace(/^.*?GranParadiso.*?([0-9\.]+).*$/i,"$1");if(this.nav['isCamino'] =(ua.indexOf('Camino')!=-1))this.nav['isCamino']=ua.replace(/^.*?Camino.*?([0-9\.]+).*$/i,"$1");if(this.nav['isChrome'] =(ua.indexOf('Chrome')!=-1))this.nav['isChrome']=ua.replace(/^.*?Chrome.*?([0-9\.]+).*$/i,"$1");if(this.nav['isSafari'] =(ua.indexOf('Safari')!=-1))this.nav['isSafari']=ua.replace(/^.*?Version\/([0-9]+\.[0-9]+).*$/i,"$1");if(this.nav['isIE']>=6||this.nav['isOpera']>=9||this.nav['isFirefox']||this.nav['isChrome']||this.nav['isCamino']||this.nav['isSafari']>=3)this.nav['isValidBrowser']=true;
|
||||
function EAL(){this.version="0.7.2.2";date=new Date();this.start_time=date.getTime();this.win="loading";this.error=false;this.baseURL="";this.template="";this.lang=new Object();this.load_syntax=new Object();this.syntax=new Object();this.loadedFiles=new Array();this.waiting_loading=new Object();this.scripts_to_load=new Array();this.sub_scripts_to_load=new Array();this.resize=new Array();this.hidden=new Object();this.default_settings={debug:false ,smooth_selection:true ,font_size:"10" ,font_family:"monospace" ,start_highlight:false ,autocompletion:false ,toolbar:"search,go_to_line,fullscreen,|,undo,redo,|,select_font,|,change_smooth_selection,highlight,reset_highlight,|,help" ,begin_toolbar:"" ,end_toolbar:"" ,is_multi_files:false ,allow_resize:"both" ,show_line_colors:false ,min_width:400 ,min_height:125 ,replace_tab_by_spaces:false ,allow_toggle:true ,language:"en" ,syntax:"" ,syntax_selection_allow:"basic,c,coldfusion,cpp,css,html,js,pas,perl,php,python,ruby,robotstxt,sql,tsql,vb,xml" ,display:"onload" ,max_undo:30 ,browsers:"known" ,plugins:"" ,gecko_spellcheck:false ,fullscreen:false ,is_editable:true ,wrap_text:false ,load_callback:"" ,save_callback:"" ,change_callback:"" ,submit_callback:"" ,EA_init_callback:"" ,EA_delete_callback:"" ,EA_load_callback:"" ,EA_unload_callback:"" ,EA_toggle_on_callback:"" ,EA_toggle_off_callback:"" ,EA_file_switch_on_callback:"" ,EA_file_switch_off_callback:"" ,EA_file_close_callback:"" };this.advanced_buttons=[ ['new_document','newdocument.gif','new_document',false],['search','search.gif','show_search',false],['go_to_line','go_to_line.gif','go_to_line',false],['undo','undo.gif','undo',true],['redo','redo.gif','redo',true],['change_smooth_selection','smooth_selection.gif','change_smooth_selection_mode',true],['reset_highlight','reset_highlight.gif','resync_highlight',true],['highlight','highlight.gif','change_highlight',true],['help','help.gif','show_help',false],['save','save.gif','save',false],['load','load.gif','load',false],['fullscreen','fullscreen.gif','toggle_full_screen',false],['autocompletion','autocompletion.gif','toggle_autocompletion',true] ];ua=navigator.userAgent;this.nav=new Object();this.nav['isMacOS']=(ua.indexOf('Mac OS')!=-1);this.nav['isIE']=(navigator.appName=="Microsoft Internet Explorer");if(this.nav['isIE']){this.nav['isIE']=ua.replace(/^.*?MSIE ([0-9\.]*).*$/,"$1");if(this.nav['isIE']<6)this.has_error();}if(this.nav['isNS']=ua.indexOf('Netscape/')!=-1){this.nav['isNS']=ua.substr(ua.indexOf('Netscape/')+9);if(this.nav['isNS']<8||!this.nav['isIE'])this.has_error();}if(this.nav['isOpera']=(ua.indexOf('Opera')!=-1)){this.nav['isOpera']=ua.replace(/^.*?Opera.*?([0-9\.]+).*$/i,"$1");if(this.nav['isOpera']<9)this.has_error();this.nav['isIE']=false;}this.nav['isGecko']=(ua.indexOf('Gecko')!=-1);if(this.nav['isFirefox'] =(ua.indexOf('Firefox')!=-1))this.nav['isFirefox']=ua.replace(/^.*?Firefox.*?([0-9\.]+).*$/i,"$1");if(this.nav['isIceweasel'] =(ua.indexOf('Iceweasel')!=-1))this.nav['isFirefox']=this.nav['isIceweasel']=ua.replace(/^.*?Iceweasel.*?([0-9\.]+).*$/i,"$1");if(this.nav['GranParadiso'] =(ua.indexOf('GranParadiso')!=-1))this.nav['isFirefox']=this.nav['isGranParadiso']=ua.replace(/^.*?GranParadiso.*?([0-9\.]+).*$/i,"$1");if(this.nav['isCamino'] =(ua.indexOf('Camino')!=-1))this.nav['isCamino']=ua.replace(/^.*?Camino.*?([0-9\.]+).*$/i,"$1");if(this.nav['isChrome'] =(ua.indexOf('Chrome')!=-1))this.nav['isChrome']=ua.replace(/^.*?Chrome.*?([0-9\.]+).*$/i,"$1");if(this.nav['isSafari'] =(ua.indexOf('Safari')!=-1))this.nav['isSafari']=ua.replace(/^.*?Version\/([0-9]+\.[0-9]+).*$/i,"$1");if(this.nav['isIE']>=6||this.nav['isOpera']>=9||this.nav['isFirefox']||this.nav['isChrome']||this.nav['isCamino']||this.nav['isSafari']>=3)this.nav['isValidBrowser']=true;
|
||||
else this.nav['isValidBrowser']=false;this.set_base_url();for(var i=0;i<this.scripts_to_load.length;i++){setTimeout("eAL.load_script('"+this.baseURL+this.scripts_to_load[i]+".js');",1);this.waiting_loading[this.scripts_to_load[i]+".js"]=false;}this.add_event(window,"load",EAL.prototype.window_loaded);};EAL.prototype ={has_error:function(){this.error=true;for(var i in EAL.prototype){EAL.prototype[i]=function(){};}},window_loaded:function(){eAL.win="loaded";if (document.forms){for (var i=0;i<document.forms.length;i++){var form=document.forms[i];form.edit_area_replaced_submit=null;try{form.edit_area_replaced_submit=form.onsubmit;form.onsubmit="";}catch (e){}eAL.add_event(form,"submit",EAL.prototype.submit);eAL.add_event(form,"reset",EAL.prototype.reset);}}eAL.add_event(window,"unload",function(){for(var i in eAs){eAL.delete_instance(i);}});},init_ie_textarea:function(id){var t=document.getElementById(id);try{if(t&&typeof(t.focused)=="undefined"){t.focus();t.focused=true;t.selectionStart=t.selectionEnd=0;get_IE_selection(t);eAL.add_event(t,"focus",IE_textarea_focus);eAL.add_event(t,"blur",IE_textarea_blur);}}catch(ex){}},init:function(settings){if(!settings["id"])this.has_error();if(this.error)return;if(eAs[settings["id"]])eAL.delete_instance(settings["id"]);for(var i in this.default_settings){if(typeof(settings[i])=="undefined")settings[i]=this.default_settings[i];}if(settings["browsers"]=="known"&&this.nav['isValidBrowser']==false){return;}if(settings["begin_toolbar"].length>0)settings["toolbar"]=settings["begin_toolbar"] +","+settings["toolbar"];if(settings["end_toolbar"].length>0)settings["toolbar"]=settings["toolbar"] +","+settings["end_toolbar"];settings["tab_toolbar"]=settings["toolbar"].replace(/ /g,"").split(",");settings["plugins"]=settings["plugins"].replace(/ /g,"").split(",");for(var i=0;i<settings["plugins"].length;i++){if(settings["plugins"][i].length==0)settings["plugins"].splice(i,1);}this.get_template();this.load_script(this.baseURL+"langs/"+settings["language"]+".js");if(settings["syntax"].length>0){settings["syntax"]=settings["syntax"].toLowerCase();this.load_script(this.baseURL+"reg_syntax/"+settings["syntax"]+".js");}eAs[settings["id"]]={"settings":settings};eAs[settings["id"]]["displayed"]=false;eAs[settings["id"]]["hidden"]=false;eAL.start(settings["id"]);},delete_instance:function(id){eAL.execCommand(id,"EA_delete");if(window.frames["frame_"+id]&&window.frames["frame_"+id].editArea){if(eAs[id]["displayed"])eAL.toggle(id,"off");window.frames["frame_"+id].editArea.execCommand("EA_unload");}var span=document.getElementById("EditAreaArroundInfos_"+id);if(span)span.parentNode.removeChild(span);var iframe=document.getElementById("frame_"+id);if(iframe){iframe.parentNode.removeChild(iframe);try{delete window.frames["frame_"+id];}catch (e){}}delete eAs[id];},start:function(id){if(this.win!="loaded"){setTimeout("eAL.start('"+id+"');",50);return;}for(var i in eAL.waiting_loading){if(eAL.waiting_loading[i]!="loaded"&&typeof(eAL.waiting_loading[i])!="function"){setTimeout("eAL.start('"+id+"');",50);return;}}if(!eAL.lang[eAs[id]["settings"]["language"]]||(eAs[id]["settings"]["syntax"].length>0&&!eAL.load_syntax[eAs[id]["settings"]["syntax"]])){setTimeout("eAL.start('"+id+"');",50);return;}if(eAs[id]["settings"]["syntax"].length>0)eAL.init_syntax_regexp();if(!document.getElementById("EditAreaArroundInfos_"+id)&&(eAs[id]["settings"]["debug"]||eAs[id]["settings"]["allow_toggle"])){var span=document.createElement("span");span.id="EditAreaArroundInfos_"+id;var html="";if(eAs[id]["settings"]["allow_toggle"]){checked=(eAs[id]["settings"]["display"]=="onload")?"checked":"";html+="<div id='edit_area_toggle_"+i+"'>";html+="<input id='edit_area_toggle_checkbox_"+id +"' class='toggle_"+id +"' type='checkbox' onclick='eAL.toggle(\""+id +"\");' accesskey='e' "+checked+" />";html+="<label for='edit_area_toggle_checkbox_"+id +"'>{$toggle}</label></div>";}if(eAs[id]["settings"]["debug"])html+="<textarea id='edit_area_debug_"+id +"' style='z-index:20;width:100%;height:120px;overflow:auto;border:solid black 1px;'></textarea><br />";html=eAL.translate(html,eAs[id]["settings"]["language"]);span.innerHTML=html;var father=document.getElementById(id).parentNode;var next=document.getElementById(id).nextSibling;if(next==null)father.appendChild(span);
|
||||
else father.insertBefore(span,next);}if(!eAs[id]["initialized"]){this.execCommand(id,"EA_init");if(eAs[id]["settings"]["display"]=="later"){eAs[id]["initialized"]=true;return;}}if(this.nav['isIE']){eAL.init_ie_textarea(id);}var html_toolbar_content="";area=eAs[id];for(var i=0;i<area["settings"]["tab_toolbar"].length;i++){html_toolbar_content+=this.get_control_html(area["settings"]["tab_toolbar"][i],area["settings"]["language"]);}if(!this.iframe_script){this.iframe_script="";for(var i=0;i<this.sub_scripts_to_load.length;i++)this.iframe_script+='<script language="javascript" type="text/javascript" src="'+this.baseURL+this.sub_scripts_to_load[i] +'.js"></script>';}for(var i=0;i<area["settings"]["plugins"].length;i++){if(!eAL.all_plugins_loaded)this.iframe_script+='<script language="javascript" type="text/javascript" src="'+this.baseURL+'plugins/'+area["settings"]["plugins"][i]+'/'+area["settings"]["plugins"][i] +'.js"></script>';this.iframe_script+='<script language="javascript" type="text/javascript" src="'+this.baseURL+'plugins/'+area["settings"]["plugins"][i]+'/langs/'+area["settings"]["language"] +'.js"></script>';}if(!this.iframe_css){this.iframe_css="<link href='"+this.baseURL +"edit_area.css' rel='stylesheet' type='text/css' />";}var template=this.template.replace(/\[__BASEURL__\]/g,this.baseURL);template=template.replace("[__TOOLBAR__]",html_toolbar_content);template=this.translate(template,area["settings"]["language"],"template");template=template.replace("[__CSSRULES__]",this.iframe_css);template=template.replace("[__JSCODE__]",this.iframe_script);template=template.replace("[__EA_VERSION__]",this.version);area.textarea=document.getElementById(area["settings"]["id"]);eAs[area["settings"]["id"]]["textarea"]=area.textarea;if(typeof(window.frames["frame_"+area["settings"]["id"]])!='undefined')delete window.frames["frame_"+area["settings"]["id"]];var father=area.textarea.parentNode;var content=document.createElement("iframe");content.name="frame_"+area["settings"]["id"];content.id="frame_"+area["settings"]["id"];content.style.borderWidth="0px";setAttribute(content,"frameBorder","0");content.style.overflow="hidden";content.style.display="none";var next=area.textarea.nextSibling;if(next==null)father.appendChild(content);
|
||||
else father.insertBefore(content,next);var frame=window.frames["frame_"+area["settings"]["id"]];frame.document.open();frame.eAs=eAs;frame.area_id=area["settings"]["id"];frame.document.area_id=area["settings"]["id"];frame.document.write(template);frame.document.close();},toggle:function(id,toggle_to){if(!toggle_to)toggle_to=(eAs[id]["displayed"]==true)?"off":"on";if(eAs[id]["displayed"]==true &&toggle_to=="off"){this.toggle_off(id);}
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ function EditAreaLoader(){
|
|||
,allow_toggle: true // true or false
|
||||
,language: "en"
|
||||
,syntax: ""
|
||||
,syntax_selection_allow: "basic,brainfuck,c,coldfusion,cpp,css,html,js,pas,perl,php,python,ruby,robotstxt,sql,tsql,vb,xml"
|
||||
,syntax_selection_allow: "basic,c,coldfusion,cpp,css,html,js,pas,perl,php,python,ruby,robotstxt,sql,tsql,vb,xml"
|
||||
,display: "onload" // onload or later
|
||||
,max_undo: 30
|
||||
,browsers: "known" // all or known
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
,language: "en"
|
||||
,syntax: "html"
|
||||
,toolbar: "search, go_to_line, |, undo, redo, |, select_font, |, syntax_selection, |, change_smooth_selection, highlight, reset_highlight, |, help"
|
||||
,syntax_selection_allow: "css,html,js,php,python,vb,xml,c,cpp,sql,basic,pas,brainfuck"
|
||||
,syntax_selection_allow: "css,html,js,php,python,vb,xml,c,cpp,sql,basic,pas"
|
||||
,is_multi_files: true
|
||||
,EA_load_callback: "editAreaLoaded"
|
||||
,show_line_colors: true
|
||||
|
|
|
|||
|
|
@ -1,37 +1,36 @@
|
|||
dl.accordion-menu dd.a-m-d div.ncmct {
|
||||
width: 140px;
|
||||
border-bottom: 1px solid #bbbbbb;
|
||||
color: black;
|
||||
font-weight: bold;
|
||||
font-size: 12px;
|
||||
margin-bottom: 5px;
|
||||
width: 140px;
|
||||
border-bottom: 1px solid #bbbbbb;
|
||||
color: black;
|
||||
font-weight: bold;
|
||||
font-size: 12px;
|
||||
margin-bottom: 5px;
|
||||
font-family: sans-serif;
|
||||
}
|
||||
|
||||
dl.accordion-menu {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
width: 160px;
|
||||
background: #eeeeee;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
width: 160px;
|
||||
background: #eeeeee;
|
||||
position:fixed;
|
||||
_position:absolute;
|
||||
top:0;
|
||||
|
||||
|
||||
_top:expression(eval((document.documentElement && document.documentElement.scrollTop) ? document.documentElement.scrollTop : document.body.scrollTop));
|
||||
|
||||
/*
|
||||
_top:expression(eval((document.documentElement && document.documentElement.scrollTop) ? document.documentElement.scrollTop : document.body.scrollTop)); */
|
||||
left:0;
|
||||
_left: -175px;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
dl.accordion-menu dt.a-m-t {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
background-color:#dddddd;
|
||||
background-image: url(btn_bg.jpg);
|
||||
font-weight: bold;
|
||||
height: 20px;
|
||||
color: #444444;
|
||||
color: #444444;
|
||||
border: 1px solid #ACACAC;
|
||||
line-height: 20px;
|
||||
font-size: 12px;
|
||||
|
|
@ -40,31 +39,31 @@ dl.accordion-menu dt.a-m-t {
|
|||
}
|
||||
|
||||
dl.accordion-menu dt.a-m-t-hover{
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
background:#cdcdcd;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
background:#cdcdcd;
|
||||
}
|
||||
|
||||
|
||||
dl.accordion-menu dt.a-m-t-down{
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border: solid 1px #222222;
|
||||
border-right-color: #dfdfdf;
|
||||
border-bottom-color: #dfdfdf;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border: solid 1px #222222;
|
||||
border-right-color: #dfdfdf;
|
||||
border-bottom-color: #dfdfdf;
|
||||
}
|
||||
|
||||
|
||||
html.accordion-menu-js dt.a-m-t{
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
cursor:pointer;
|
||||
zoom:1;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
cursor:pointer;
|
||||
zoom:1;
|
||||
}
|
||||
|
||||
dl.accordion-menu dd.a-m-d {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
overflow: auto;
|
||||
background-color: #eeeeee;
|
||||
background-image: url(panel_bg.jpg);
|
||||
|
|
@ -73,24 +72,24 @@ dl.accordion-menu dd.a-m-d {
|
|||
}
|
||||
|
||||
dl.accordion-menu dd.a-m-d .link {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
display: block;
|
||||
width: 118px;
|
||||
text-align:left;
|
||||
padding-left:20px;
|
||||
text-align:left;
|
||||
padding-left:20px;
|
||||
text-decoration: none;
|
||||
color: black;
|
||||
font-family: sans-serif;
|
||||
cursor: pointer;
|
||||
font-weight: normal;
|
||||
font-size: 12px;
|
||||
margin-bottom:5px;
|
||||
margin-left:2px;
|
||||
letter-spacing:0px;
|
||||
text-transform:none;
|
||||
font-variant:normal;
|
||||
line-height:12px;
|
||||
margin-bottom:5px;
|
||||
margin-left:2px;
|
||||
letter-spacing:0px;
|
||||
text-transform:none;
|
||||
font-variant:normal;
|
||||
line-height:12px;
|
||||
}
|
||||
|
||||
dl.accordion-menu dd.a-m-d .link img {
|
||||
|
|
@ -104,45 +103,48 @@ dl.accordion-menu dd.a-m-d .link:hover {
|
|||
}
|
||||
|
||||
html.accordion-menu-js dd.a-m-d{
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
display:none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
display:none;
|
||||
}
|
||||
|
||||
|
||||
html.accordion-menu-js dd.a-m-d-expand {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
display:block;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
display:block;
|
||||
}
|
||||
|
||||
html.accordion-menu-js dd.a-m-d-before-expand {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
display:block;
|
||||
position:relative;
|
||||
z-index:-1;
|
||||
opacity:0;
|
||||
height:auto !important;
|
||||
visibility:hidden;
|
||||
overflow:visible;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
display:block;
|
||||
position:relative;
|
||||
z-index:-1;
|
||||
opacity:0;
|
||||
height:auto !important;
|
||||
visibility:hidden;
|
||||
overflow:visible;
|
||||
}
|
||||
|
||||
|
||||
html.accordion-menu-js dt.a-m-t-expand {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border-left-color:#222222;
|
||||
color:black;
|
||||
background:#c0c0c0;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border-left-color:#222222;
|
||||
color:black;
|
||||
background:#c0c0c0;
|
||||
}
|
||||
|
||||
html.accordion-menu-js dd.a-m-d-anim {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
overflow:hidden;
|
||||
display:block;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
overflow:hidden;
|
||||
display:block;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
YAHOO.util.Event.addListener(window, "load", function() {
|
||||
YAHOO.example.XHR_JSON = new function() {
|
||||
this.formatUrl = function(elCell, oRecord, oColumn, sData) {
|
||||
elCell.innerHTML = "<a href='" + oRecord.getData("url") + "' target='_blank'>" + sData + "</a>";
|
||||
elCell.innerHTML = "<a href='" + oRecord.getData("url") + "'>" + sData + "</a>";
|
||||
};
|
||||
this.formatCheckBox = function(elCell, oRecord, oColumn, sData) {
|
||||
var innerHTML = "<input type='checkbox' name='listingId' value='" + sData + "' id='" + sData + "_checkBox'";
|
||||
|
|
@ -23,6 +23,7 @@ YAHOO.util.Event.addListener(window, "load", function() {
|
|||
|
||||
var uri = "func=getCompareFormData";
|
||||
if(typeof(listingIds) != 'undefined'){
|
||||
uri = uri + ';__listingId_isIn=1';
|
||||
for (var i = 0; i < listingIds.length; i++) {
|
||||
uri = uri+';listingId='+listingIds[i];
|
||||
}
|
||||
|
|
@ -33,7 +34,7 @@ YAHOO.util.Event.addListener(window, "load", function() {
|
|||
this.myDataSource.connXhrMode = "queueRequests";
|
||||
this.myDataSource.responseSchema = {
|
||||
resultsList: "ResultSet.Result",
|
||||
fields: ["title",{key: "views", parser: "number"},{key: "clicks", parser: "number"},{key: "compares", parser: "number"},{key: "checked", parser: "number"},{key: "lastUpdated", parser: "number"},"url","assetId"]
|
||||
fields: ["title",{key: "views", parser: "number"},{key: "clicks", parser: "number"},{key: "compares", parser: "number"},{key: "checked"},{key: "lastUpdated", parser: "number"},"url","assetId"]
|
||||
};
|
||||
|
||||
this.myDataTable = new YAHOO.widget.DataTable("compareForm", myColumnDefs,
|
||||
|
|
|
|||
|
|
@ -71,8 +71,7 @@ YAHOO.util.Event.addListener(window, "load", function() {
|
|||
}
|
||||
|
||||
this.myDataSource.doBeforeParseData = function (oRequest, oFullResponse) {
|
||||
myDataTable.getRecordSet().reset();
|
||||
myDataTable.refreshView();
|
||||
this.responseSchema.fields = oFullResponse.ResponseFields;
|
||||
var existingColumns = myDataTable.getColumnSet().keys;
|
||||
for (var i = 0; i < existingColumns.length; i++) {
|
||||
if(i > 1){
|
||||
|
|
@ -114,6 +113,9 @@ YAHOO.util.Event.addListener(window, "load", function() {
|
|||
uri = uri+';listingId='+compareCheckBoxes[i].value;
|
||||
}
|
||||
}
|
||||
myDataTable.getRecordSet().reset();
|
||||
myDataTable.refreshView();
|
||||
myDataTable.showTableMessage('Loading...');
|
||||
this.myDataSource.sendRequest(uri,callback2);
|
||||
},this,true);
|
||||
|
||||
|
|
@ -126,6 +128,9 @@ YAHOO.util.Event.addListener(window, "load", function() {
|
|||
uri = uri+';listingId='+compareCheckBoxes[i].value;
|
||||
}
|
||||
}
|
||||
myDataTable.getRecordSet().reset();
|
||||
myDataTable.refreshView();
|
||||
myDataTable.showTableMessage('Loading...');
|
||||
this.myDataSource.sendRequest(uri,callback2);
|
||||
},this,true);
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ YAHOO.util.Event.addListener(window, "load", function() {
|
|||
var Dom = YAHOO.util.Dom;
|
||||
|
||||
this.formatUrl = function(elCell, oRecord, oColumn, sData) {
|
||||
elCell.innerHTML = "<a href='" + oRecord.getData("url") + "' target='_blank'>" + sData + "</a>";
|
||||
elCell.innerHTML = "<a href='" + oRecord.getData("url") + "'>" + sData + "</a>";
|
||||
};
|
||||
this.formatCheckBox = function(elCell, oRecord, oColumn, sData) {
|
||||
var innerHTML = "<input type='checkbox' name='listingId' value='" + sData + "' id='" + sData + "_checkBox'";
|
||||
|
|
|
|||
|
|
@ -8,49 +8,29 @@ if (typeof Survey === "undefined") {
|
|||
var CLASS_INVALID = 'survey-invalid'; // For elements that fail input validation
|
||||
var CLASS_INVALID_MARKER = 'survey-invalid-marker'; // For default '*' invalid field marker
|
||||
|
||||
var multipleChoice = {
|
||||
'Multiple Choice': 1,
|
||||
'Gender': 1,
|
||||
'Yes/No': 1,
|
||||
'True/False': 1,
|
||||
'Ideology': 1,
|
||||
'Race': 1,
|
||||
'Party': 1,
|
||||
'Education': 1,
|
||||
'Scale': 1,
|
||||
'Agree/Disagree': 1,
|
||||
'Oppose/Support': 1,
|
||||
'Importance': 1,
|
||||
'Likelihood': 1,
|
||||
'Certainty': 1,
|
||||
'Satisfaction': 1,
|
||||
'Confidence': 1,
|
||||
'Effectiveness': 1,
|
||||
'Concern': 1,
|
||||
'Risk': 1,
|
||||
'Threat': 1,
|
||||
'Security': 1
|
||||
};
|
||||
var text = {
|
||||
// All specially-handled question types are listed here
|
||||
// (anything else is assumed to be a multi-choice bundle)
|
||||
var TEXT_TYPES = {
|
||||
'Text': 1,
|
||||
'Email': 1,
|
||||
'Phone Number': 1,
|
||||
'Text Date': 1,
|
||||
'Currency': 1
|
||||
'Currency': 1,
|
||||
'TextArea': 1
|
||||
};
|
||||
var slider = {
|
||||
var SLIDER_TYPES = {
|
||||
'Slider': 1,
|
||||
'Dual Slider - Range': 1,
|
||||
'Multi Slider - Allocate': 1
|
||||
};
|
||||
var dateType = {
|
||||
var DATE_TYPES = {
|
||||
'Date': 1,
|
||||
'Date Range': 1
|
||||
};
|
||||
var fileUpload = {
|
||||
var UPLOAD_TYPES = {
|
||||
'File Upload': 1
|
||||
};
|
||||
var hidden = {
|
||||
var HIDDEN_TYPES = {
|
||||
'Hidden': 1
|
||||
};
|
||||
|
||||
|
|
@ -65,8 +45,10 @@ if (typeof Survey === "undefined") {
|
|||
function formsubmit(event){
|
||||
var submit = 1;//boolean for if all was good or not
|
||||
for (var i in toValidate) {
|
||||
console.log(toValidate);
|
||||
if (YAHOO.lang.hasOwnProperty(toValidate, i)) {
|
||||
var answered = 0;
|
||||
console.log(toValidate[i].type);
|
||||
if (toValidate[i].type === 'Multi Slider - Allocate') {
|
||||
var total = 0;
|
||||
for (var z in toValidate[i].answers) {
|
||||
|
|
@ -94,6 +76,7 @@ if (typeof Survey === "undefined") {
|
|||
}
|
||||
}
|
||||
var node = document.getElementById(i + 'required');
|
||||
|
||||
var q_parent_node = YAHOO.util.Dom.getAncestorByClassName(node, 'question');
|
||||
if (!answered) {
|
||||
submit = 0;
|
||||
|
|
@ -229,7 +212,7 @@ if (typeof Survey === "undefined") {
|
|||
var step = Math.round(q.answers[i].step);
|
||||
var min = Math.round(parseFloat(q.answers[i].min));
|
||||
var distance = Math.round(parseFloat(q.answers[i].max) + (-1 * min));
|
||||
var scale = Math.round(sliderWidth / distance);
|
||||
var scale = Math.floor(sliderWidth / distance);
|
||||
var id = a.id;
|
||||
var s = YAHOO.widget.Slider.getHorizSlider(id + 'slider-bg', id + 'slider-thumb', 0, sliderWidth, (scale * step));
|
||||
s.scale = scale;
|
||||
|
|
@ -353,7 +336,6 @@ if (typeof Survey === "undefined") {
|
|||
if (lastSection !== s.id || s.everyPageText === '1') {
|
||||
document.getElementById('headertext').style.display = 'block';
|
||||
}
|
||||
|
||||
if (lastSection !== s.id && s.questionsOnSectionPage !== '1') {
|
||||
var span = document.createElement("div");
|
||||
span.innerHTML = "<input type=button id='showQuestionsButton' value='Continue'>";
|
||||
|
|
@ -385,11 +367,16 @@ if (typeof Survey === "undefined") {
|
|||
Survey.Form.addWidgets(qs);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
addWidgets: function(qs){
|
||||
hasFile = false;
|
||||
for (var i = 0; i < qs.length; i++) {
|
||||
var q = qs[i];
|
||||
if (!q || !q.answers) {
|
||||
// gracefully handle q with no answers
|
||||
continue;
|
||||
}
|
||||
|
||||
var verts = '';
|
||||
for (var x in q.answers) {
|
||||
if (YAHOO.lang.hasOwnProperty(q.answers, x)) {
|
||||
|
|
@ -403,106 +390,108 @@ if (typeof Survey === "undefined") {
|
|||
}
|
||||
}
|
||||
|
||||
//Check if this question should be validated
|
||||
if (q.required) {
|
||||
//Check if this question should be validated.
|
||||
//Sliders can't really be not answered, so requiring them makes little sense.
|
||||
if (q.required == true && q.questionType != 'Slider') {
|
||||
toValidate[q.id] = [];
|
||||
toValidate[q.id].type = q.questionType;
|
||||
toValidate[q.id].answers = [];
|
||||
}
|
||||
|
||||
|
||||
if (multipleChoice[q.questionType]) {
|
||||
var butts = [];
|
||||
verb = 0;
|
||||
for (var j = 0; j < q.answers.length; j++) {
|
||||
var a = q.answers[j];
|
||||
if (DATE_TYPES[q.questionType]) {
|
||||
for (var k = 0; k < q.answers.length; k++) {
|
||||
var ans = q.answers[k];
|
||||
if (toValidate[q.id]) {
|
||||
toValidate[q.id].answers[a.id] = 1;
|
||||
toValidate[q.id].answers[ans.id] = 1;
|
||||
}
|
||||
var b = document.getElementById(a.id + 'button');
|
||||
/*
|
||||
b = new YAHOO.widget.Button({ type: "checkbox", label: a.answerText, id: a.id+'button', name: a.id+'button',
|
||||
value: a.id,
|
||||
container: a.id+"container", checked: false });
|
||||
*/
|
||||
// b.on("click", buttonChanged,[b,a.id,q.maxAnswers,butts,qs.length,a.id]);
|
||||
// YAHOO.util.Event.addListener(a.id+'button', "click", buttonChanged,[b,a.id,q.maxAnswers,butts,qs.length,a.id]);
|
||||
if (a.verbatim) {
|
||||
verb = 1;
|
||||
}
|
||||
YAHOO.util.Event.addListener(a.id + 'button', "click", buttonChanged, [b, a.id, q.maxAnswers, butts, qs.length, a.id]);
|
||||
b.hid = a.id;
|
||||
butts.push(b);
|
||||
var calid = ans.id + 'container';
|
||||
var c = new YAHOO.widget.Calendar(calid, {
|
||||
title: 'Choose a date:',
|
||||
close: true
|
||||
});
|
||||
c.selectEvent.subscribe(selectCalendar, [c, ans.id], true);
|
||||
c.render();
|
||||
c.hide();
|
||||
var btn = new YAHOO.widget.Button({
|
||||
label: "Select Date",
|
||||
id: "pushbutton" + ans.id,
|
||||
container: ans.id + 'button'
|
||||
});
|
||||
btn.on("click", showCalendar, [c]);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
else
|
||||
if (dateType[q.questionType]) {
|
||||
for (var k = 0; k < q.answers.length; k++) {
|
||||
var ans = q.answers[k];
|
||||
if (toValidate[q.id]) {
|
||||
toValidate[q.id].answers[ans.id] = 1;
|
||||
|
||||
if (SLIDER_TYPES[q.questionType]) {
|
||||
//First run through and put up the span placeholders and find the max value for an answer, to know how big the allocation points will be.
|
||||
var max = 0;
|
||||
if (q.questionType === 'Dual Slider - Range') {
|
||||
handleDualSliders(q);
|
||||
}
|
||||
else {
|
||||
for (var s in q.answers) {
|
||||
if (YAHOO.lang.hasOwnProperty(q.answers, s)) {
|
||||
var a1 = q.answers[s];
|
||||
YAHOO.util.Event.addListener(a1.id, "blur", sliderTextSet);
|
||||
if (a1.max - a1.min > max) {
|
||||
max = a1.max - a1.min;
|
||||
}
|
||||
}
|
||||
var calid = ans.id + 'container';
|
||||
var c = new YAHOO.widget.Calendar(calid, {
|
||||
title: 'Choose a date:',
|
||||
close: true
|
||||
});
|
||||
c.selectEvent.subscribe(selectCalendar, [c, ans.id], true);
|
||||
c.render();
|
||||
c.hide();
|
||||
var btn = new YAHOO.widget.Button({
|
||||
label: "Select Date",
|
||||
id: "pushbutton" + ans.id,
|
||||
container: ans.id + 'button'
|
||||
});
|
||||
btn.on("click", showCalendar, [c]);
|
||||
}
|
||||
}
|
||||
if (q.questionType === 'Multi Slider - Allocate') {
|
||||
//sliderManagers[sliderManagers.length] = new this.sliderManager(q,max);
|
||||
for (var x1 = 0; x1 < q.answers.length; x1++) {
|
||||
if (toValidate[q.id]) {
|
||||
toValidate[q.id].total = q.answers[x1].max;
|
||||
toValidate[q.id].answers[q.answers[x1].id] = 1;
|
||||
}
|
||||
}
|
||||
sliderManager(q, max);
|
||||
}
|
||||
else
|
||||
if (slider[q.questionType]) {
|
||||
//First run through and put up the span placeholders and find the max value for an answer, to know how big the allocation points will be.
|
||||
var max = 0;
|
||||
if (q.questionType === 'Dual Slider - Range') {
|
||||
handleDualSliders(q);
|
||||
}
|
||||
else {
|
||||
for (var s in q.answers) {
|
||||
if (YAHOO.lang.hasOwnProperty(q.answers, s)) {
|
||||
var a1 = q.answers[s];
|
||||
YAHOO.util.Event.addListener(a1.id, "blur", sliderTextSet);
|
||||
if (a1.max - a1.min > max) {
|
||||
max = a1.max - a1.min;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (q.questionType === 'Multi Slider - Allocate') {
|
||||
//sliderManagers[sliderManagers.length] = new this.sliderManager(q,max);
|
||||
for (var x1 = 0; x1 < q.answers.length; x1++) {
|
||||
if (toValidate[q.id]) {
|
||||
toValidate[q.id].total = q.answers[x1].max;
|
||||
toValidate[q.id].answers[q.answers[x1].id] = 1;
|
||||
}
|
||||
}
|
||||
sliderManager(q, max);
|
||||
}
|
||||
else
|
||||
if (q.questionType === 'Slider') {
|
||||
handleSliders(q);
|
||||
}
|
||||
if (q.questionType === 'Slider') {
|
||||
handleSliders(q);
|
||||
}
|
||||
|
||||
else
|
||||
if (fileUpload[q.questionType]) {
|
||||
hasFile = true;
|
||||
}
|
||||
|
||||
else
|
||||
if (text[q.questionType]) {
|
||||
if (toValidate[q.id]) {
|
||||
toValidate[q.id].answers[q.answers[x].id] = 1;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if (UPLOAD_TYPES[q.questionType]) {
|
||||
hasFile = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (TEXT_TYPES[q.questionType]) {
|
||||
if (toValidate[q.id]) {
|
||||
toValidate[q.id].answers[q.answers[x].id] = 1;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
// Must be a multi-choice bundle
|
||||
var butts = [];
|
||||
verb = 0;
|
||||
for (var j = 0; j < q.answers.length; j++) {
|
||||
var a = q.answers[j];
|
||||
if (toValidate[q.id]) {
|
||||
toValidate[q.id].answers[a.id] = 1;
|
||||
}
|
||||
var b = document.getElementById(a.id + 'button');
|
||||
/*
|
||||
b = new YAHOO.widget.Button({ type: "checkbox", label: a.answerText, id: a.id+'button', name: a.id+'button',
|
||||
value: a.id,
|
||||
container: a.id+"container", checked: false });
|
||||
*/
|
||||
// b.on("click", buttonChanged,[b,a.id,q.maxAnswers,butts,qs.length,a.id]);
|
||||
// YAHOO.util.Event.addListener(a.id+'button', "click", buttonChanged,[b,a.id,q.maxAnswers,butts,qs.length,a.id]);
|
||||
if (a.verbatim) {
|
||||
verb = 1;
|
||||
}
|
||||
YAHOO.util.Event.addListener(a.id + 'button', "click", buttonChanged, [b, a.id, q.maxAnswers, butts, qs.length, a.id]);
|
||||
b.hid = a.id;
|
||||
butts.push(b);
|
||||
}
|
||||
}
|
||||
YAHOO.util.Event.addListener("submitbutton", "click", formsubmit);
|
||||
}
|
||||
|
|
@ -514,4 +503,4 @@ if (typeof Survey === "undefined") {
|
|||
YAHOO.util.Event.onDOMReady(function(){
|
||||
// Survey.Comm.setUrl('/' + document.getElementById('assetPath').value);
|
||||
Survey.Comm.callServer('', 'loadQuestions');
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -5,6 +5,8 @@ var Dom = YAHOO.util.Dom;
|
|||
var Event = YAHOO.util.Event;
|
||||
var DDM = YAHOO.util.DragDropMgr;
|
||||
|
||||
var currentDest;
|
||||
|
||||
Survey.DDList = function(id, sGroup, config) {
|
||||
|
||||
Survey.DDList.superclass.constructor.call(this, id, sGroup, config);
|
||||
|
|
@ -61,30 +63,10 @@ YAHOO.extend(Survey.DDList, YAHOO.util.DDProxy, {
|
|||
a.animate();
|
||||
},
|
||||
|
||||
onInvalidDrop: function(e, id) {
|
||||
Survey.Data.dragDrop(this.getEl());
|
||||
},
|
||||
onDragDrop: function(e, id) {
|
||||
|
||||
// If there is one drop interaction, the li was dropped either on the list,
|
||||
// or it was dropped on the current location of the source element.
|
||||
if (DDM.interactionInfo.drop.length === 1) {
|
||||
|
||||
// The position of the cursor at the time of the drop (YAHOO.util.Point)
|
||||
var pt = DDM.interactionInfo.point;
|
||||
|
||||
// The region occupied by the source element at the time of the drop
|
||||
var region = DDM.interactionInfo.sourceRegion;
|
||||
|
||||
// Check to see if we are over the source element's location. We will
|
||||
// append to the bottom of the list once we are sure it was a drop in
|
||||
// the negative space (the area of the list without any list items)
|
||||
if (!region.intersect(pt)) {
|
||||
var destEl = Dom.get(id);
|
||||
var destDD = DDM.getDDById(id);
|
||||
destEl.appendChild(this.getEl());
|
||||
destDD.isEmpty = false;
|
||||
DDM.refreshCache();
|
||||
}
|
||||
|
||||
}
|
||||
Survey.Data.dragDrop(this.getEl());
|
||||
},
|
||||
|
||||
|
|
@ -110,6 +92,8 @@ YAHOO.extend(Survey.DDList, YAHOO.util.DDProxy, {
|
|||
// We are only concerned with list items, we ignore the dragover
|
||||
// notifications for the list.
|
||||
if (destEl.nodeName.toLowerCase() == "li") {
|
||||
currentDest = destEl;
|
||||
console.log(destEl);
|
||||
var orig_p = srcEl.parentNode;
|
||||
var p = destEl.parentNode;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,134 +1,154 @@
|
|||
if (typeof Survey == "undefined") {
|
||||
/*global Survey, YAHOO */
|
||||
if (typeof Survey === "undefined") {
|
||||
var Survey = {};
|
||||
}
|
||||
|
||||
Survey.Data = new function(){
|
||||
Survey.Data = (function(){
|
||||
|
||||
var lastDataSet = {};
|
||||
var focus;
|
||||
var lastId = -1;
|
||||
|
||||
// Keep references to widgets here so that we can destory any instances before
|
||||
// creating new ones (to avoid memory leaks)
|
||||
var autoComplete;
|
||||
var sButton, qButton, aButton;
|
||||
|
||||
this.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 first = {id:did.id,type:type};
|
||||
var before = document.getElementById(did.id).previousSibling;
|
||||
|
||||
while(1){
|
||||
if( before == undefined || (before.id != undefined && before.id != '') ){
|
||||
break;
|
||||
}
|
||||
var before = before.previousSibling;
|
||||
}
|
||||
|
||||
var data = {id:'',type:''};
|
||||
|
||||
if(before != undefined && before.id != undefined && before.id != ''){
|
||||
if(before.className.match("section")){type = 'section';}
|
||||
else if(before.className.match("question")){type = 'question';}
|
||||
else{ type = 'answer';}
|
||||
data = {id:before.id,type:type};
|
||||
}
|
||||
YAHOO.log(first.id+' '+data.id);
|
||||
Survey.Comm.dragDrop(first,data);
|
||||
}
|
||||
|
||||
|
||||
|
||||
this.clicked = function(){
|
||||
Survey.Comm.loadSurvey(this.id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
this.loadData = function(d){
|
||||
focus = d.address;//What is the current highlighted item.
|
||||
var showEdit = 1;
|
||||
if(lastId.toString() == d.address.toString()){
|
||||
showEdit = 0;
|
||||
lastId = -1;
|
||||
}else{
|
||||
lastId = d.address;
|
||||
}
|
||||
document.getElementById('sections').innerHTML=d.ddhtml;
|
||||
|
||||
//add event handlers for if a tag is clicked
|
||||
for(var x in d.ids){
|
||||
YAHOO.log('adding handler for '+ d.ids[x]);
|
||||
YAHOO.util.Event.addListener(d.ids[x], "click", this.clicked);
|
||||
new Survey.DDList(d.ids[x],"sections");
|
||||
}
|
||||
|
||||
//add the add object buttons
|
||||
// if(d.buttons['section']){
|
||||
document.getElementById('addSection').innerHTML = '';
|
||||
document.getElementById('addQuestion').innerHTML = '';
|
||||
document.getElementById('addAnswer').innerHTML = '';
|
||||
var button = new YAHOO.widget.Button({ label:"Add Section", id:"addsection", container:"addSection" });
|
||||
button.on("click", this.addSection);
|
||||
// }
|
||||
// if(d.buttons['question']){
|
||||
var button = new YAHOO.widget.Button({ label:"Add Question", id:"addquestion", container:"addQuestion" });
|
||||
button.on("click", this.addQuestion,d.buttons['question']);
|
||||
// }
|
||||
if(d.buttons['answer']){
|
||||
var button = new YAHOO.widget.Button({ label:"Add Answer", id:"addanswer", container:"addAnswer" });
|
||||
button.on("click", this.addAnswer,d.buttons['answer']);
|
||||
}
|
||||
|
||||
if(showEdit == 1){
|
||||
this.loadObjectEdit(d.edithtml,d.type);
|
||||
}else{
|
||||
document.getElementById('edit').innerHTML = "";
|
||||
}
|
||||
lastDataSet = d;
|
||||
}
|
||||
|
||||
this.addSection = function(){
|
||||
Survey.Comm.newSection();
|
||||
}
|
||||
|
||||
|
||||
this.addQuestion = function(e,id){
|
||||
Survey.Comm.newQuestion(id);
|
||||
}
|
||||
|
||||
this.addAnswer = function(e,id){
|
||||
Survey.Comm.newAnswer(id);
|
||||
}
|
||||
|
||||
this.loadObjectEdit = function(edit,type){
|
||||
if(edit){
|
||||
Survey.ObjectTemplate.loadObject(edit,type);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
this.loadLast = function(){
|
||||
this.loadData(lastDataSet);
|
||||
}
|
||||
}();
|
||||
|
||||
|
||||
//----------------------------------------------------------------
|
||||
//
|
||||
// Initialize survey
|
||||
//
|
||||
//----------------------------------------------------------------
|
||||
Survey.OnLoad = function() {
|
||||
var e = YAHOO.util.Event;
|
||||
return {
|
||||
init: function() {
|
||||
e.onDOMReady(this.initHandler);
|
||||
},
|
||||
initHandler: function(){
|
||||
new YAHOO.util.DDTarget("sections","sections");
|
||||
Survey.Comm.loadSurvey();
|
||||
},
|
||||
}
|
||||
}();
|
||||
dragDrop: function(did){
|
||||
|
||||
Survey.OnLoad.init();
|
||||
YAHOO.log('In drag drop');
|
||||
var type = did.className.match("section") ? 'section'
|
||||
: did.className.match("question") ? 'question'
|
||||
: 'answer';
|
||||
|
||||
var first = {
|
||||
id: did.id, // pre-drag index of item
|
||||
type: type
|
||||
};
|
||||
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) {
|
||||
type = before.className.match("section") ? 'section'
|
||||
: before.className.match("question") ? 'question'
|
||||
: 'answer';
|
||||
data = {
|
||||
id: before.id,
|
||||
type: type
|
||||
};
|
||||
}
|
||||
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;
|
||||
if (lastId.toString() === d.address.toString()) {
|
||||
showEdit = 0;
|
||||
lastId = -1;
|
||||
}
|
||||
else {
|
||||
lastId = d.address;
|
||||
}
|
||||
|
||||
// First purge any event handlers bound to sections node..
|
||||
YAHOO.util.Event.purgeElement('sections', true);
|
||||
|
||||
// Now we can re-write its innerHTML without fear of memory leaks
|
||||
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)) {
|
||||
YAHOO.log('adding handler for ' + d.ids[x]);
|
||||
YAHOO.util.Event.addListener(d.ids[x], "click", this.clicked);
|
||||
var _s = new Survey.DDList(d.ids[x], "sections");
|
||||
}
|
||||
}
|
||||
|
||||
sButton && sButton.destroy();
|
||||
sButton = new YAHOO.widget.Button({
|
||||
label: "Add Section",
|
||||
id: "addsection",
|
||||
container: "addSection"
|
||||
});
|
||||
sButton.on("click", this.addSection);
|
||||
|
||||
qButton && qButton.destroy();
|
||||
qButton = new YAHOO.widget.Button({
|
||||
label: "Add Question",
|
||||
id: "addquestion",
|
||||
container: "addQuestion"
|
||||
});
|
||||
qButton.on("click", this.addQuestion, d.buttons.question);
|
||||
|
||||
if (d.buttons.answer) {
|
||||
aButton && aButton.destroy();
|
||||
aButton = new YAHOO.widget.Button({
|
||||
label: "Add Answer",
|
||||
id: "addanswer",
|
||||
container: "addAnswer"
|
||||
});
|
||||
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);
|
||||
autoComplete = new YAHOO.widget.AutoComplete('goto', 'goto-yui-ac-container', ds);
|
||||
}
|
||||
}
|
||||
else {
|
||||
Survey.ObjectTemplate.unloadObject();
|
||||
if (autoComplete) {
|
||||
autoComplete.destroy();
|
||||
autoComplete = null;
|
||||
}
|
||||
}
|
||||
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
|
||||
YAHOO.util.Event.onDOMReady(function(){
|
||||
var ddTarget = new YAHOO.util.DDTarget("sections", "sections");
|
||||
Survey.Comm.loadSurvey();
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,69 +0,0 @@
|
|||
if (typeof Survey == "undefined") {
|
||||
var Survey = {};
|
||||
}
|
||||
|
||||
Survey.AnswerTemplate = new function(){
|
||||
this.params;
|
||||
this.loadAnswer = function(params){
|
||||
for(var p in params){
|
||||
if(params[p] == undefined){params[p] = '';}
|
||||
}
|
||||
|
||||
var html = "\
|
||||
<div id='answer'>\
|
||||
<div class='hd'>Please enter answer information</div>\
|
||||
<div class='bd'>\
|
||||
\
|
||||
<form name='form' method='POST' action='?func=submitAnswerEdit'>\
|
||||
\
|
||||
<p>Answer Number: "+params.sequenceNumber + "\
|
||||
\
|
||||
<input type='hidden' name='Survey_sectionId' value='"+params.Survey_sectionId+"'>\
|
||||
<input type='hidden' name='Survey_questionId' value='"+params.Survey_questionId+"'>\
|
||||
<input type='hidden' name='Survey_answerId' value='"+params.Survey_answerId+"'>";
|
||||
html = html + "<p>Answer Text:\n<textarea name='answerText'>"+params.answerText+"</textArea>\n";
|
||||
html = html + "<p>Recorded Answer\n<textarea name='recordedAnswer'>"+params.recordedAnswer+"</textArea>\n";
|
||||
html = html + "<p>Jump to:<input type=text value='"+params.gotoQuestion+"' name=gotoQuestion size=4>";
|
||||
html = html + "<span id='textParams'><p>Text Answer Cols:<input type=text size=2 value='"+params.textCols+"' name=textCols> Rows: \
|
||||
<input type=text size=2 value='"+params.textRows+"' name=textRows> </p></span>";
|
||||
html = html + "<p>Is this the correct answer:\n" +
|
||||
this.makeRadio('isCorrect',[{text:'Yes',value:1},{text:'No',value:0}],params.isCorrect);
|
||||
html = html + "<p>Min:<input type=text value='"+params.min+"' name=min size=2>";
|
||||
html = html + "<p>Max:<input type=text value='"+params.max+"' name=max size=2>";
|
||||
html = html + "<p>Step:<input type=text value='"+params.step+"' name=step size=2>";
|
||||
html = html + "<p>Verbatim:\n" +
|
||||
this.makeRadio('verbatim',[{text:'Yes',value:1},{text:'No',value:0}],params.verbatim);
|
||||
document.getElementById('edit').innerHTML = html;
|
||||
|
||||
var butts = [{ text:"Submit", handler:function(){this.submit();}, isDefault:true },{ text:"Cancel", handler:function(){this.cancel();}} ];
|
||||
if(params.Survey_answerId != ''){
|
||||
butts[2] = { text:"Delete", handler:function(){Survey.Comm.deleteAnswer(Survey.AnswerTemplate.params.Survey_answerId);}};
|
||||
}
|
||||
|
||||
var form = new YAHOO.widget.Dialog("answer",
|
||||
{ width : "500px",
|
||||
fixedcenter : true,
|
||||
visible : false,
|
||||
constraintoviewport : true,
|
||||
buttons : butts
|
||||
});
|
||||
|
||||
form.callback = Survey.Comm.callback;
|
||||
form.render();
|
||||
form.show();
|
||||
this.params = params;
|
||||
};
|
||||
|
||||
this.makeRadio = function(name,values,checked){
|
||||
var html = '';
|
||||
for(var i in values){
|
||||
if(checked == values[i]['value']){
|
||||
html = html+ "<input type='radio' name='" + name + "' value='" + values[i]['value'] + "' checked>" + values[i]['text'];
|
||||
}else{
|
||||
html = html+ "<input type='radio' name='" + name + "' value='" + values[i]['value'] + "' >" + values[i]['text'];
|
||||
}
|
||||
}
|
||||
html = html + "\n";
|
||||
return html;
|
||||
}
|
||||
}();
|
||||
|
|
@ -6,6 +6,7 @@ Survey.Comm = new function(){
|
|||
var callMade = 0;
|
||||
|
||||
var request = function(sUrl,callback,postData){
|
||||
YAHOO.util.Dom.setStyle('mask-all','display','block');
|
||||
if(callMade == 1){
|
||||
alert("Waiting on previous request");
|
||||
}else{
|
||||
|
|
@ -15,10 +16,12 @@ Survey.Comm = new function(){
|
|||
}
|
||||
this.callback = {
|
||||
success:function(o){
|
||||
YAHOO.util.Dom.setStyle('mask-all','display','none');
|
||||
callMade = 0;
|
||||
Survey.Data.loadData(YAHOO.lang.JSON.parse(o.responseText));
|
||||
},
|
||||
failure: function(o){
|
||||
YAHOO.util.Dom.setStyle('mask-all','display','none')
|
||||
callMade = 0;
|
||||
alert("Last request failed");
|
||||
Survey.Data.loadLast();
|
||||
|
|
|
|||
|
|
@ -1,33 +1,118 @@
|
|||
if (typeof Survey == "undefined") {
|
||||
|
||||
/*global Survey, YAHOO */
|
||||
if (typeof Survey === "undefined") {
|
||||
var Survey = {};
|
||||
}
|
||||
|
||||
Survey.ObjectTemplate = new function(){
|
||||
Survey.ObjectTemplate = (function(){
|
||||
|
||||
this.loadObject = function(html,type){
|
||||
// Keep references to widgets here so that we can destory any instances before
|
||||
// creating new ones (to avoid memory leaks)
|
||||
var dialog;
|
||||
var editor;
|
||||
|
||||
document.getElementById('edit').innerHTML = html;
|
||||
return {
|
||||
|
||||
unloadObject: function(){
|
||||
// First destory the editor..
|
||||
if (editor) {
|
||||
editor.destroy();
|
||||
editor = null;
|
||||
}
|
||||
|
||||
// And then the Dialog that contains it.
|
||||
if (dialog) {
|
||||
dialog.destroy();
|
||||
dialog = null;
|
||||
}
|
||||
},
|
||||
|
||||
var butts = [
|
||||
{ text:"Submit", handler:function(){this.submit();}, isDefault:true },
|
||||
{ text:"Copy", handler:function(){document.getElementById('copy').value = 1; this.submit();}},
|
||||
{ text:"Cancel", handler:function(){this.cancel(); Survey.Comm.loadSurvey('-');}},
|
||||
{ text:"Delete", handler:function(){document.getElementById('delete').value = 1; this.submit();}}
|
||||
];
|
||||
loadObject: function(html, type){
|
||||
// Make sure we purge any event listeners before overwrite innerHTML..
|
||||
YAHOO.util.Event.purgeElement('edit', true);
|
||||
document.getElementById('edit').innerHTML = html;
|
||||
|
||||
var btns = [{
|
||||
text: "Submit",
|
||||
handler: function(){
|
||||
editor.saveHTML();
|
||||
this.submit();
|
||||
},
|
||||
isDefault: true
|
||||
}, {
|
||||
text: "Copy",
|
||||
handler: function(){
|
||||
document.getElementById('copy').value = 1;
|
||||
this.submit();
|
||||
}
|
||||
}, {
|
||||
text: "Cancel",
|
||||
handler: function(){
|
||||
this.cancel();
|
||||
Survey.Comm.loadSurvey('-');
|
||||
}
|
||||
}, {
|
||||
text: "Delete",
|
||||
handler: function(){
|
||||
document.getElementById('delete').value = 1;
|
||||
this.submit();
|
||||
}
|
||||
}, {
|
||||
text: "Preview",
|
||||
handler: function(){
|
||||
if (type === 'answer') {
|
||||
alert('Sorry, preview is only supported for Sections and Questions, not Answers');
|
||||
}
|
||||
else {
|
||||
var msg = 'This will delete any Survey responses you have made under this ' +
|
||||
'user account and redirect you to the Take Survey page starting at the selected item. ' +
|
||||
"\n\nAre you sure you want to continue?";
|
||||
if (confirm(msg)) {
|
||||
window.location.search = 'func=jumpTo;id=' + dialog.getData().id;
|
||||
}
|
||||
}
|
||||
}
|
||||
}];
|
||||
|
||||
dialog = new YAHOO.widget.Dialog(type, {
|
||||
width: "600px",
|
||||
context: [document.body, 'tr', 'tr'],
|
||||
visible: false,
|
||||
constraintoviewport: true,
|
||||
buttons: btns
|
||||
});
|
||||
|
||||
dialog.callback = Survey.Comm.callback;
|
||||
dialog.render();
|
||||
|
||||
var form = new YAHOO.widget.Dialog(type,
|
||||
{
|
||||
width : "500px",
|
||||
fixedcenter : true,
|
||||
visible : false,
|
||||
constraintoviewport : true,
|
||||
buttons : butts
|
||||
} );
|
||||
var resizeGotoExpression = new YAHOO.util.Resize('resize_gotoExpression_formId');
|
||||
resizeGotoExpression.on('resize', function(ev) {
|
||||
YAHOO.util.Dom.setStyle('gotoExpression_formId', 'width', (ev.width - 6) + "px");
|
||||
YAHOO.util.Dom.setStyle('gotoExpression_formId', 'height', (ev.height - 6) + "px");
|
||||
});
|
||||
|
||||
var textareaId = type + 'Text';
|
||||
var textarea = YAHOO.util.Dom.get(textareaId);
|
||||
|
||||
var height = YAHOO.util.Dom.getStyle(textarea, 'height');
|
||||
if (!height) {
|
||||
height = '300px';
|
||||
}
|
||||
|
||||
form.callback = Survey.Comm.callback;
|
||||
form.render();
|
||||
form.show();
|
||||
initHoverHelp(type);
|
||||
}
|
||||
}();
|
||||
// N.B. SimpleEditor has a memory leak so this eats memory on every instantiation
|
||||
editor = new YAHOO.widget.SimpleEditor(textareaId, {
|
||||
height: height,
|
||||
width: '100%',
|
||||
dompath: false //Turns on the bar at the bottom
|
||||
});
|
||||
|
||||
if (editor.get('toolbar')) {
|
||||
editor.get('toolbar').titlebar = false;
|
||||
}
|
||||
editor.render();
|
||||
|
||||
dialog.show();
|
||||
initHoverHelp(type);
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
|
|
|||
|
|
@ -1,40 +0,0 @@
|
|||
<div id='question'>
|
||||
<div class='hd'>Please enter question information</div>
|
||||
<div class='bd'>
|
||||
<form name='form' method='POST' action='?func=submitObjectEdit'>
|
||||
<p>Question Number: <tmpl_var displayed_id>
|
||||
<input type='hidden' name='id' value='<tmpl_var id>'>
|
||||
<p>Question Text:\n";
|
||||
<textarea name='questionText'><tmpl_var text></textArea>\n";
|
||||
<p>Question variable name:<input maxlength=35 size=10 type=text value='<tmpl_var variable>' name=variable size=2></p>";
|
||||
<p>Randomize answers:";
|
||||
<input type='radio' name='randomizeAnswers' value=1 <tmpl_if randomizeAnswers>checked</tmpl_if>>Yes
|
||||
<input type='radio' name='randomizeAnswers' value=0 <tmpl_unless randomizeAnswers>checked</tmpl_unless>>No
|
||||
<p>Question type:
|
||||
<select name='questionType'>
|
||||
<tmpl_loop questionType>
|
||||
<option value='<tmpl_var text>' <tmpl_if selected>selected</tmpl_if>><tmpl_var text></option>
|
||||
</tmpl_loop>
|
||||
</select>
|
||||
<p>Randomized words:
|
||||
<textarea name=randomizWords><tmpl_var randomWords></textArea>
|
||||
<p>Vertical display:
|
||||
<input type='radio' name='verticalDisplay' value=1 <tmpl_if verticalDisplay>checked</tmpl_if>>Yes
|
||||
<input type='radio' name='verticalDisplay' value=0 <tmpl_unless verticalDisplay>checked</tmpl_unless>>No
|
||||
|
||||
<p>Show text in button:
|
||||
<input type='radio' name='textInButton' value=1 <tmpl_if textInButton>checked</tmpl_if>>Yes
|
||||
<input type='radio' name='textInButton' value=0 <tmpl_unless textInButton>checked</tmpl_unless>>No
|
||||
|
||||
<p>Allow comment:
|
||||
<input type='radio' name='allowComment' value=1 <tmpl_if allowComment>checked</tmpl_if>>Yes
|
||||
<input type='radio' name='allowComment' value=0 <tmpl_unless allowComment>checked</tmpl_unlexx>>No
|
||||
<span id='commentParams'><p> Cols:<input type=text size=2 value='<tmpl_var commentCols>' name=commentCols> Rows:
|
||||
<input type=text size=2 value='<tmpl_var commentRows>' name=commentRows> </p></span>
|
||||
<p>Maximum number of answers:<input type=text value='<tmpl_var maxAnswers>' name=maxAnswers size=2>
|
||||
<p>Required:
|
||||
<input type='radio' name='required' value=1 <tmpl_if required>checked</tmpl_if>>Yes
|
||||
<input type='radio' name='required' value=0 <tmpl_unless required>checked</tmpl_unless>>No
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1,112 +0,0 @@
|
|||
if (typeof Survey == "undefined") {
|
||||
var Survey = {};
|
||||
}
|
||||
|
||||
Survey.QuestionTemplate = new function(){
|
||||
|
||||
this.loadQuestion = function(params){
|
||||
|
||||
for(var p in params){
|
||||
if(params[p] == undefined){params[p] = '';}
|
||||
}
|
||||
|
||||
var html = "\
|
||||
<div id='question'>\
|
||||
<div class='hd'>Please enter question information</div>\
|
||||
<div class='bd'>\
|
||||
\
|
||||
<form name='form' method='POST' action='?func=submitQuestionEdit'>\
|
||||
<p>Question Number: "+params.sequenceNumber + "\
|
||||
\
|
||||
<input type='hidden' name='Survey_sectionId' value='"+params.Survey_sectionId+"'>\
|
||||
<input type='hidden' name='Survey_questionId' value='"+params.Survey_questionId+"'>\
|
||||
<p>Question Text:\n";
|
||||
if(params.questionText == ''){
|
||||
html = html + "<textarea name='questionText'>Enter Text Here</textArea>\n";
|
||||
}
|
||||
else{
|
||||
html = html + "<textarea name='questionText'>"+params.questionText+"</textArea>\n";
|
||||
}
|
||||
html = html + "<p>Question variable name:<input maxlength=35 size=10 type=text value='"+ params.questionVariable +"' name=questionVariable size=2></p>";
|
||||
html = html + "<p>Randomize answers:";
|
||||
|
||||
html = html+ this.makeRadio('randomizeAnswers',[{text:'Yes',value:1},{text:'No',value:0}],params.randomizeAnswers);
|
||||
html = html + "<p>Question type:";
|
||||
var questions = ['Agree/Disagree','Certainty','Concern','Confidence','Currency','Date','Date Range','Dual Slider - Range','Education','Effectiveness',
|
||||
'Email','File Upload','Gender','Hidden','Ideology','Importance','Likelihood','Multi Slider - Allocate','Multiple Choice','Oppose/Support',
|
||||
'Party','Phone Number','Race','Risk','Satisfaction','Scale','Security','Slider','Text','Text Date','Threat','True/False','Yes/No'];
|
||||
// var questions = ['Multiple Choice','Gender','Yes/No','True/False','Agree/Disagree','Oppose/Support','Importance','Likelihood','Certainty','Satisfaction',
|
||||
// 'Confidence','Effectiveness','Concern','Risk','Threat','Security','Ideology','Race','Party','Education',
|
||||
// 'Text', 'Email', 'Phone Number', 'Text Date', 'Currency',
|
||||
// 'Slider','Dual Slider - Range','Multi Slider - Allocate', 'Date','Date Range', 'File Upload','Hidden'];
|
||||
|
||||
html = html + this.makeMenu('questionType',questions,questions,params.questionType);
|
||||
|
||||
html = html + "\
|
||||
<p>Randomized words:\
|
||||
<textarea name=randomizedWords>"+params.randomizedWords+"</textArea>\
|
||||
<p>Vertical display:";
|
||||
|
||||
html = html+ this.makeRadio('verticalDisplay',[{text:'Yes',value:1},{text:'No',value:0}],params.verticalDisplay);
|
||||
html = html + "<p>Show text in button:";
|
||||
html = html + this.makeRadio('textInButton',[{text:'Yes',value:1},{text:'No',value:0}],params.textInButton);
|
||||
html = html + "<p>Allow comment:";
|
||||
html = html + this.makeRadio('allowComment',[{text:'Yes',value:1},{text:'No',value:0}],params.allowComment);
|
||||
html = html + "<span id='commentParams'><p> Cols:<input type=text size=2 value='"+params.commentCols+"' name=commentCols> Rows: \
|
||||
<input type=text size=2 value='"+params.commentRows+"' name=commentRows> </p></span>";
|
||||
html = html + "<p>Maximum number of answers:<input type=text value='"+params.maxAnswers+"' name=maxAnswers size=2>";
|
||||
html = html + "<p>Required:";
|
||||
html = html+ this.makeRadio('required',[{text:'Yes',value:1},{text:'No',value:0}],params.required);
|
||||
html = html + "\
|
||||
</form>\
|
||||
</div>\
|
||||
</div>\
|
||||
";
|
||||
|
||||
document.getElementById('edit').innerHTML = html;
|
||||
|
||||
|
||||
var butts = [ { text:"Submit", handler:function(){this.submit();}, isDefault:true }, { text:"Cancel", handler:function(){this.cancel();}} ];
|
||||
if(params.Survey_questionId != ''){
|
||||
butts[2] = {text:"Delete", handler:function(){Survey.Comm.deleteQuestion(params.Survey_questionId);}};
|
||||
}
|
||||
|
||||
var form = new YAHOO.widget.Dialog("question",
|
||||
{ width : "500px",
|
||||
fixedcenter : true,
|
||||
visible : false,
|
||||
constraintoviewport : true,
|
||||
buttons : butts
|
||||
} );
|
||||
|
||||
form.callback = Survey.Comm.callback;
|
||||
form.render();
|
||||
form.show();
|
||||
|
||||
}
|
||||
this.makeMenu = function(name,values,text,selected){
|
||||
var html = "<select name='"+name+"'>\n";
|
||||
for(var i in values){
|
||||
if(values[i] == selected){
|
||||
html = html + "<option value='"+values[i]+"' selected>"+text[i]+"</option>\n";
|
||||
}else{
|
||||
html = html + "<option value='"+values[i]+"' >"+text[i]+"</option>\n";
|
||||
}
|
||||
}
|
||||
html = html + "</select>\n";
|
||||
return html;
|
||||
}
|
||||
this.makeRadio = function(name,values,checked){
|
||||
var html = '';
|
||||
for(var i in values){
|
||||
if(checked == values[i]['value']){
|
||||
html = html+ "<input type='radio' id='"+name+"' name='" + name + "' value='" + values[i]['value'] + "' checked>" + values[i]['text'];
|
||||
}else{
|
||||
html = html+ "<input type='radio' id='"+name+"' name='" + name + "' value='" + values[i]['value'] + "' >" + values[i]['text'];
|
||||
}
|
||||
}
|
||||
html = html + "\n";
|
||||
return html;
|
||||
}
|
||||
|
||||
}();
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
if (typeof Survey == "undefined") {
|
||||
var Survey = {};
|
||||
}
|
||||
|
||||
Survey.SectionTemplate = new function(){
|
||||
|
||||
this.loadSection = function(html){
|
||||
|
||||
document.getElementById('edit').innerHTML = html;
|
||||
|
||||
var butts = [ { text:"Submit", handler:function(){this.submit();}, isDefault:true }, { text:"Cancel", handler:function(){this.cancel();}},
|
||||
{text:"Delete", handler:function(){document.getElementById('delete').setValue(1); this.submit();}}
|
||||
];
|
||||
|
||||
var form = new YAHOO.widget.Dialog("section",
|
||||
{ width : "500px",
|
||||
fixedcenter : true,
|
||||
visible : false,
|
||||
constraintoviewport : true,
|
||||
buttons : butts
|
||||
} );
|
||||
|
||||
form.callback = Survey.Comm.callback;
|
||||
form.render();
|
||||
form.show();
|
||||
}
|
||||
}();
|
||||
|
||||
BIN
www/extras/wobject/Survey/rel_interstitial_loading.gif
Normal file
BIN
www/extras/wobject/Survey/rel_interstitial_loading.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.5 KiB |
|
|
@ -1,90 +0,0 @@
|
|||
body {
|
||||
margin: 0;
|
||||
background-repeat: repeat-y;
|
||||
background-position: 0px 0px;
|
||||
}
|
||||
.survey-header {
|
||||
width: 80%;
|
||||
height: 20px;
|
||||
margin-left: 80px;
|
||||
}
|
||||
#survey {
|
||||
margin-left: 80px;
|
||||
width: 85%;
|
||||
}
|
||||
|
||||
div.dateanswer {
|
||||
min-height: 250px;
|
||||
}
|
||||
div.slider-bg {
|
||||
position: relative;
|
||||
background:url(/extras/wobject/Survey/bg-fader-500.gif) 5px 0 no-repeat;
|
||||
height:68px;
|
||||
width:529px;
|
||||
}
|
||||
div.slider-thumb {
|
||||
cursor:default;
|
||||
position: absolute;
|
||||
top: 30px;
|
||||
left: 4px;
|
||||
}
|
||||
div.slider-min-thumb {
|
||||
cursor:default;
|
||||
position: absolute;
|
||||
top: 4px;
|
||||
}
|
||||
div.slider-max-thumb {
|
||||
cursor:default;
|
||||
position: absolute;
|
||||
top: 4px;
|
||||
}
|
||||
#headertitle {
|
||||
display: none;
|
||||
}
|
||||
#headertext {
|
||||
display: none;
|
||||
}
|
||||
#questions {
|
||||
display: none;
|
||||
}
|
||||
input.mcbutton{
|
||||
font-size: 10px;
|
||||
font-weight: bold;
|
||||
text-decoration: none;
|
||||
background-color: #CCCCCC;
|
||||
background-repeat: repeat-x;
|
||||
text-align: center;
|
||||
display: block;
|
||||
margin: 0.5em;
|
||||
padding: .8em;
|
||||
width: 60px;
|
||||
font-family: Verdana, Arial, Helvetica, sans-serif;
|
||||
color: #000000;
|
||||
background-image: url(/extras/wobject/Survey/gradient-glossy.png);
|
||||
}
|
||||
input.mcbutton:hover{
|
||||
background-color: #B6D2F1;
|
||||
font-family: Verdana, Arial, Helvetica, sans-serif;
|
||||
font-size: 10px;
|
||||
color: #000000;
|
||||
}
|
||||
input.mcbutton-selected{
|
||||
background-color: #172D9D;
|
||||
background-repeat: repeat-x;
|
||||
color: #FFFFFF;
|
||||
font-family: Verdana, Arial, Helvetica, sans-serif;
|
||||
font-size: 10px;
|
||||
margin: 0.5em;
|
||||
padding: .8em;
|
||||
width: 60px;
|
||||
text-align: center;
|
||||
display: block;
|
||||
font-weight: bold;
|
||||
background-image: url(/extras/wobject/Survey/gradient-glossy.png);
|
||||
background-position: 0px 0px;
|
||||
}
|
||||
|
||||
/* By default the marker for invalid (required) fields is a red '*' */
|
||||
.survey-invalid-marker {
|
||||
color: #FF0000;
|
||||
}
|
||||
|
|
@ -1,4 +1,38 @@
|
|||
|
||||
#loading-mask {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 20000;
|
||||
background-color: white;
|
||||
opacity:0.6;
|
||||
filter:alpha(opacity=60);
|
||||
}
|
||||
|
||||
#loading {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
padding: 2px;
|
||||
z-index: 20001;
|
||||
height: auto;
|
||||
margin: -35px 0 0 -30px;
|
||||
}
|
||||
|
||||
#loading .loading-indicator {
|
||||
background: url(/extras/wobject/Survey/rel_interstitial_loading.gif) no-repeat;
|
||||
color: #555;
|
||||
font: bold 13px tahoma,arial,helvetica;
|
||||
padding: 18px 80px;
|
||||
margin: 0;
|
||||
text-align: center;
|
||||
height: auto;
|
||||
z-index: 20002;
|
||||
}
|
||||
|
||||
|
||||
div.testarea {
|
||||
width: 200px;
|
||||
height: 100px;
|
||||
|
|
@ -92,9 +126,11 @@ li.squestion {
|
|||
min-height: 10px;
|
||||
}
|
||||
li.newQuestion {
|
||||
# background-color: #D1E6EC;
|
||||
# border:1px solid #7EA6B2;
|
||||
# cursor: move;
|
||||
/*
|
||||
background-color: #D1E6EC;
|
||||
border:1px solid #7EA6B2;
|
||||
cursor: move;
|
||||
*/
|
||||
padding-left:25px;
|
||||
}
|
||||
|
||||
|
|
@ -119,14 +155,19 @@ li.sanswer {
|
|||
background-color: #CC6600;
|
||||
border:1px solid #7EA6B2;
|
||||
cursor: move;
|
||||
padding-left:50px;
|
||||
padding-left:50px;
|
||||
width:60%;
|
||||
min-height: 10px;
|
||||
}
|
||||
li.newAnswer {
|
||||
# background-color: #D1E6EC;
|
||||
# border:1px solid #7EA6B2;
|
||||
padding-left:50px;
|
||||
# cursor: move;
|
||||
/*
|
||||
background-color: #D1E6EC;
|
||||
border:1px solid #7EA6B2;
|
||||
cursor: move;
|
||||
*/
|
||||
padding-left:50px;
|
||||
}
|
||||
#goto-yui-ac {
|
||||
width:15em;
|
||||
margin-top:0.5em;
|
||||
}
|
||||
|
||||
|
|
|
|||
142
www/extras/yui-webgui/build/assetHistory/assetHistory.js
vendored
Normal file
142
www/extras/yui-webgui/build/assetHistory/assetHistory.js
vendored
Normal file
|
|
@ -0,0 +1,142 @@
|
|||
/*** The WebGUI Asset History Viewer
|
||||
* Requires: YAHOO, Dom, Event
|
||||
* With all due credit to Doug Bell, who wrote the AssetManager. AssetHistory
|
||||
* is a blatant copy/paste/modify of it.
|
||||
*/
|
||||
|
||||
if ( typeof WebGUI == "undefined" ) {
|
||||
WebGUI = {};
|
||||
}
|
||||
if ( typeof WebGUI.AssetHistory == "undefined" ) {
|
||||
WebGUI.AssetHistory = {};
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
WebGUI.AssetHistory.DefaultSortedBy ( )
|
||||
*/
|
||||
WebGUI.AssetHistory.DefaultSortedBy = {
|
||||
"key" : "dateStamp",
|
||||
"dir" : YAHOO.widget.DataTable.CLASS_ASC
|
||||
};
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
WebGUI.AssetHistory.BuildQueryString ( )
|
||||
*/
|
||||
WebGUI.AssetHistory.BuildQueryString = function ( state, dt ) {
|
||||
var query = "startIndex=" + state.pagination.recordOffset
|
||||
+ ';sortDir=' + ((state.sortedBy.dir === YAHOO.widget.DataTable.CLASS_DESC) ? "DESC" : "ASC")
|
||||
+ ';results=' + state.pagination.rowsPerPage
|
||||
+ ';sortKey=' + state.sortedBy.key
|
||||
;
|
||||
return query;
|
||||
};
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
WebGUI.AssetHistory.formatDate ( )
|
||||
Format the date the asset was modified.
|
||||
*/
|
||||
WebGUI.AssetHistory.formatDate = function ( elCell, oRecord, oColumn, orderNumber ) {
|
||||
var actionDate = new Date( 1000 * oRecord.getData('dateStamp') );
|
||||
var formattedDate = YAHOO.util.Date.format(actionDate, { format: '%x %X' });
|
||||
elCell.innerHTML = formattedDate;
|
||||
};
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
WebGUI.AssetHistory.initManager ( )
|
||||
Initialize the i18n interface
|
||||
*/
|
||||
WebGUI.AssetHistory.initManager = function (o) {
|
||||
WebGUI.AssetHistory.i18n
|
||||
= new WebGUI.i18n( {
|
||||
namespaces : {
|
||||
'WebGUI' : [
|
||||
"50",
|
||||
"104",
|
||||
"352"
|
||||
]
|
||||
},
|
||||
onpreload : {
|
||||
fn : WebGUI.AssetHistory.initDataTable
|
||||
}
|
||||
} );
|
||||
};
|
||||
|
||||
/*---------------------------------------------------------------------------
|
||||
WebGUI.AssetHistory.initDataTable ( )
|
||||
Initialize the www_manage page
|
||||
*/
|
||||
WebGUI.AssetHistory.initDataTable = function (o) {
|
||||
var historyPaginator = new YAHOO.widget.Paginator({
|
||||
containers : ['pagination'],
|
||||
pageLinks : 7,
|
||||
rowsPerPage : 25,
|
||||
template : "<strong>{CurrentPageReport}</strong> {PreviousPageLink} {PageLinks} {NextPageLink}"
|
||||
});
|
||||
|
||||
|
||||
// initialize the data source
|
||||
WebGUI.AssetHistory.DataSource
|
||||
= new YAHOO.util.DataSource( '?op=assetHistory;method=getHistoryAsJson;',{connTimeout:30000} );
|
||||
WebGUI.AssetHistory.DataSource.responseType
|
||||
= YAHOO.util.DataSource.TYPE_JSON;
|
||||
WebGUI.AssetHistory.DataSource.responseSchema
|
||||
= {
|
||||
resultsList: 'records',
|
||||
fields: [
|
||||
{ key: 'assetId', parser: 'string' },
|
||||
{ key: 'username', parser: 'string' },
|
||||
{ key: 'dateStamp', parser: 'number' },
|
||||
{ key: 'title', parser: 'string' },
|
||||
{ key: 'actionTaken', parser: 'string' },
|
||||
{ key: 'url', parser: 'string' }
|
||||
],
|
||||
metaFields: {
|
||||
totalRecords: "totalRecords" // Access to value in the server response
|
||||
}
|
||||
};
|
||||
WebGUI.AssetHistory.ColumnDefs = [ // sortable:true enables sorting
|
||||
{key:"assetId", label:"assetId", sortable: true},
|
||||
{key:"username", label:WebGUI.AssetHistory.i18n.get('WebGUI', '50' ), sortable: true},
|
||||
{key:"dateStamp", label:WebGUI.AssetHistory.i18n.get('WebGUI', '352'), sortable: true, formatter: WebGUI.AssetHistory.formatDate},
|
||||
{key:"url", label:WebGUI.AssetHistory.i18n.get('WebGUI', '104'), sortable: true},
|
||||
{key:"actionTaken", label:"actionTaken"}
|
||||
];
|
||||
|
||||
|
||||
// Initialize the data table
|
||||
WebGUI.AssetHistory.DataTable
|
||||
= new YAHOO.widget.DataTable( 'dynamicdata',
|
||||
WebGUI.AssetHistory.ColumnDefs,
|
||||
WebGUI.AssetHistory.DataSource,
|
||||
{
|
||||
initialRequest : 'startIndex=0;results=25',
|
||||
dynamicData : true,
|
||||
paginator : historyPaginator,
|
||||
sortedBy : WebGUI.AssetHistory.DefaultSortedBy,
|
||||
generateRequest : WebGUI.AssetHistory.BuildQueryString
|
||||
}
|
||||
);
|
||||
|
||||
WebGUI.AssetHistory.DataTable.handleDataReturnPayload = function(oRequest, oResponse, oPayload) {
|
||||
oPayload.totalRecords = oResponse.meta.totalRecords;
|
||||
return oPayload;
|
||||
}
|
||||
|
||||
//Setup the form to submit an AJAX request back to the site.
|
||||
YAHOO.util.Dom.get('keywordSearchForm').onsubmit = function () {
|
||||
var state = WebGUI.AssetHistory.DataTable.getState();
|
||||
state.pagination.recordOffset = 0;
|
||||
WebGUI.AssetHistory.DataSource.sendRequest(
|
||||
'keywords=' + YAHOO.util.Dom.get('keywordsField').value + ';startIndex=0;results=25',
|
||||
{
|
||||
success : WebGUI.AssetHistory.DataTable.onDataReturnInitializeTable,
|
||||
scope : WebGUI.AssetHistory.DataTable, argument:state
|
||||
}
|
||||
);
|
||||
return false;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue