rem
stringlengths 0
126k
| add
stringlengths 0
441k
| context
stringlengths 15
136k
|
---|---|---|
var args = this.resultStack.splice(-func.args.args.length); | var args = func.args.args.length ? this.resultStack.splice(-func.args.args.length) : []; | visitFunctionCallNode: function(func) { func.args.accept(this); var args = this.resultStack.splice(-func.args.args.length); this.resultStack.push(this.context.call(func['name'], args)); }, |
args = this.resultStack.splice(-numArgs); | if (numArgs) args = this.resultStack.splice(-numArgs); | visitNodeTestNode: function(nodeTest) { var parts = nodeTest.name.split(":"), localName = parts.length > 1 ? parts[1] : parts[0], namespaceURI = parts.length > 1 ? parts[0] : null, args = []; if (nodeTest.args) { nodeTest.args.accept(this); var numArgs = nodeTest.args.args.length; args = this.resultStack.splice(-numArgs); // Pop off numArgs items } var nodeTypeCheck = this.context.getNodeTypeTest(nodeTest.type, args); if (nodeTest.type && !nodeTypeCheck) { /// @todo Throw a proper error throw new Error("Invalid node type in node test: '" + nodeTest.type + "'"); } // Don't want to overwrite axis iterator if we can avoid it if (localName == '*' && namespaceURI == null && (!nodeTest.type || nodeTest.type == "node")) return; // Get all matching nodes an update the context with an array iterator. var results = [], context = this.context; this.context.contextIterator(function(n) { // Perform the name test, if any if (localName != '*' || namespaceURI != null) { var expandedName = context.getExpandedName(n); if (expandedName == null || (localName != '*' && localName != expandedName.localName) || namespaceURI != expandedName.namespaceURI) { return true; // Skip this node } } // Perform the node type check, if any if (nodeTypeCheck && !nodeTypeCheck(n)) return true; // Skip this node results.push(n); }); context.size = results.length; context.iter = createArrayContextIterator(context, results); }, |
for (var i in this.bindings) | for (var i = 0; i < this.bindings.length; i++) | function Visualization(report, bindings, variables, options, container){ var visualization = this;//alert(visualization.type.value); this.report = report;//alert(Report.visualizationTypes.toSource()); //this.type = Report.visualizationTypes.filter(function(visType) { return visType.type.value == visualization.type.value; } );//alert(this.type.toSource()); this.variables = variables;//alert(this.type.value + "\n\n" + this.variables.toSource()); this.bindings = bindings;//alert(this.bindings.toSource()); this.container = container; for (var i in this.bindings) { var binding = this.bindings[i]; var bindingVariables = this.variables.filter(function(variable) { return variable.binding.value == binding.binding.value; } ); binding.constructor = Binding; binding.constructor(this.report, this, bindingVariables);//alert(bindingVariables.toSource()); //binding.variables = bindingVariables; } this.getColumns = Visualization.prototype.getColumns; this.columns = this.getColumns(); this.init = Visualization.prototype.init; this.init(); //alert(visualization.googleVis.toSource());} |
for (var i in this.bindingTypes) | for (var i = 0; i < this.bindingTypes.length; i++) | function VisualizationType(bindingTypes, dataTypes, optionTypes){ this.bindingTypes = bindingTypes; this.dataTypes = dataTypes; this.optionTypes = optionTypes;//alert(this.bindingTypes.toSource()); for (var i in this.bindingTypes) { var bindingType = this.bindingTypes[i]; var bindDataTypes = this.dataTypes.filter(function(dataType) { return dataType.bindingType.value == bindingType.type.value; } ); bindingType.constructor = BindingType; bindingType.constructor(bindDataTypes); bindingType.visType = this; //alert(bindDataTypes.toSource()); }} |
detail_path:'/volumes/list/' | detail_path:'/volumes/show/' | DcmgrGUI.prototype.volumePanel = function(){ var maxrow = 10; var page = 1; var list_request = { "url" : DcmgrGUI.Util.getPagePath('/volumes/list/',page), "data" : DcmgrGUI.Util.getPagenateData(page,maxrow) }; DcmgrGUI.List.prototype.getEmptyData = function(){ return [{ "uuid":'', "size":'', "snapshot_id":'', "created_at":'', "state":'' }] } DcmgrGUI.Detail.prototype.getEmptyData = function(){ return { "uuid" : "-", "size" : "-", "snapshot_id" : "-", "created_at" : "-", "updated_at" : "-", "state" : "", } } var c_pagenate = new DcmgrGUI.Pagenate({ row:maxrow, total:30 //todo:get total from dcmgr }); var c_list = new DcmgrGUI.List({ element_id:'#display_volumes', template_id:'#volumesListTemplate', maxrow:maxrow, page:page }); c_list.setDetailTemplate({ template_id:'#volumesDetailTemplate', detail_path:'/volumes/list/' }); c_list.element.bind('dcmgrGUI.contentChange',function(event,params){ c_list.page = c_pagenate.current_page; c_list.setData(params.data); c_list.multiCheckList(c_list.detail_template); }); var bt_refresh = new DcmgrGUI.Refresh(); var bt_create_volume = new DcmgrGUI.Dialog({ target:'.create_volume', width:400, height:200, title:'Create Volume', path:'/create_volume', button:{ "Create": function() { var volume_size = $('#volume_size').val(); var unit = $('#unit').find('option:selected').val(); if(!volume_size){ $('#volume_size').focus(); return false; } var data = "size="+volume_size+"&unit="+unit; $.ajax({ "type": "POST", "async": true, "url": '/volumes/create', "dataType": "json", "data": data, success: function(json,status){ console.log(json); bt_refresh.element.trigger('dcmgrGUI.refresh'); } }); $(this).dialog("close"); } } }); var bt_delete_volume = new DcmgrGUI.Dialog({ target:'.delete_volume', width:400, height:200, title:'Delete Volume', path:'/delete_volume', button:{ "Close": function() { $(this).dialog("close"); }, "Yes, Delete": function() { var delete_volumes = $('#delete_volumes').find('li'); var ids = [] $.each(delete_volumes,function(){ ids.push($(this).text()) }) var data = $.param({ids:ids}) $.ajax({ "type": "DELETE", "async": true, "url": '/volumes/delete', "dataType": "json", "data": data, success: function(json,status){ console.log(json); bt_refresh.element.trigger('dcmgrGUI.refresh'); } }); c_list.changeStatus('deleting'); $(this).dialog("close"); } } }); bt_create_volume.target.bind('click',function(){ bt_create_volume.open(); }); bt_delete_volume.target.bind('click',function(){ bt_delete_volume.open(c_list.getCheckedInstanceIds()); }); bt_refresh.element.bind('dcmgrGUI.refresh',function(){ c_list.page = c_pagenate.current_page; list_request.url = DcmgrGUI.Util.getPagePath('/volumes/list/',c_list.page); list_request.data = DcmgrGUI.Util.getPagenateData(c_list.page,c_list.maxrow) c_list.element.trigger('dcmgrGUI.updateList',{request:list_request}) //update detail $.each(c_list.checked_list,function(check_id,obj){ $($('#detail').find('#'+check_id)).remove(); c_list.checked_list[check_id].c_detail.update({ url:DcmgrGUI.Util.getPagePath('/volumes/list/',check_id) },true); }); }); c_pagenate.element.bind('dcmgrGUI.updatePagenate',function(){ c_list.clearCheckedList(); $('#detail').html(''); bt_refresh.element.trigger('dcmgrGUI.refresh'); }); //list c_list.setData(null); c_list.update(list_request,true); } |
url:DcmgrGUI.Util.getPagePath('/volumes/list/',check_id) | url:DcmgrGUI.Util.getPagePath('/volumes/show/',check_id) | DcmgrGUI.prototype.volumePanel = function(){ var maxrow = 10; var page = 1; var list_request = { "url" : DcmgrGUI.Util.getPagePath('/volumes/list/',page), "data" : DcmgrGUI.Util.getPagenateData(page,maxrow) }; DcmgrGUI.List.prototype.getEmptyData = function(){ return [{ "uuid":'', "size":'', "snapshot_id":'', "created_at":'', "state":'' }] } DcmgrGUI.Detail.prototype.getEmptyData = function(){ return { "uuid" : "-", "size" : "-", "snapshot_id" : "-", "created_at" : "-", "updated_at" : "-", "state" : "", } } var c_pagenate = new DcmgrGUI.Pagenate({ row:maxrow, total:30 //todo:get total from dcmgr }); var c_list = new DcmgrGUI.List({ element_id:'#display_volumes', template_id:'#volumesListTemplate', maxrow:maxrow, page:page }); c_list.setDetailTemplate({ template_id:'#volumesDetailTemplate', detail_path:'/volumes/list/' }); c_list.element.bind('dcmgrGUI.contentChange',function(event,params){ c_list.page = c_pagenate.current_page; c_list.setData(params.data); c_list.multiCheckList(c_list.detail_template); }); var bt_refresh = new DcmgrGUI.Refresh(); var bt_create_volume = new DcmgrGUI.Dialog({ target:'.create_volume', width:400, height:200, title:'Create Volume', path:'/create_volume', button:{ "Create": function() { var volume_size = $('#volume_size').val(); var unit = $('#unit').find('option:selected').val(); if(!volume_size){ $('#volume_size').focus(); return false; } var data = "size="+volume_size+"&unit="+unit; $.ajax({ "type": "POST", "async": true, "url": '/volumes/create', "dataType": "json", "data": data, success: function(json,status){ console.log(json); bt_refresh.element.trigger('dcmgrGUI.refresh'); } }); $(this).dialog("close"); } } }); var bt_delete_volume = new DcmgrGUI.Dialog({ target:'.delete_volume', width:400, height:200, title:'Delete Volume', path:'/delete_volume', button:{ "Close": function() { $(this).dialog("close"); }, "Yes, Delete": function() { var delete_volumes = $('#delete_volumes').find('li'); var ids = [] $.each(delete_volumes,function(){ ids.push($(this).text()) }) var data = $.param({ids:ids}) $.ajax({ "type": "DELETE", "async": true, "url": '/volumes/delete', "dataType": "json", "data": data, success: function(json,status){ console.log(json); bt_refresh.element.trigger('dcmgrGUI.refresh'); } }); c_list.changeStatus('deleting'); $(this).dialog("close"); } } }); bt_create_volume.target.bind('click',function(){ bt_create_volume.open(); }); bt_delete_volume.target.bind('click',function(){ bt_delete_volume.open(c_list.getCheckedInstanceIds()); }); bt_refresh.element.bind('dcmgrGUI.refresh',function(){ c_list.page = c_pagenate.current_page; list_request.url = DcmgrGUI.Util.getPagePath('/volumes/list/',c_list.page); list_request.data = DcmgrGUI.Util.getPagenateData(c_list.page,c_list.maxrow) c_list.element.trigger('dcmgrGUI.updateList',{request:list_request}) //update detail $.each(c_list.checked_list,function(check_id,obj){ $($('#detail').find('#'+check_id)).remove(); c_list.checked_list[check_id].c_detail.update({ url:DcmgrGUI.Util.getPagePath('/volumes/list/',check_id) },true); }); }); c_pagenate.element.bind('dcmgrGUI.updatePagenate',function(){ c_list.clearCheckedList(); $('#detail').html(''); bt_refresh.element.trigger('dcmgrGUI.refresh'); }); //list c_list.setData(null); c_list.update(list_request,true); } |
}); c_list.element.bind('dcmgrGUI.contentChange',function(event,params){ c_list.setData(params.data); c_list.multiCheckList(c_list.detail_template); | DcmgrGUI.prototype.volumePanel = function(){ var list_request = { "url":DcmgrGUI.Util.getPagePath('/volumes/show/',1) }; DcmgrGUI.List.prototype.getEmptyData = function(){ return [{ "id":'', "wmi_id":'', "source":'', "owner":'', "visibility":'', "state":'' }] } DcmgrGUI.Detail.prototype.getEmptyData = function(){ return { "volume_id" : "-", "capacity" : "-", "snapshot" : "-", "created" : "-", "zone" : "-", "status" : "", "attachment_information" : "-" } } var c_list = new DcmgrGUI.List({ element_id:'#display_volumes', template_id:'#volumesListTemplate' }); c_list.setDetailTemplate({ template_id:'#volumesDetailTemplate', detail_path:'/volumes/detail/' }); var c_pagenate = new DcmgrGUI.Pagenate({ row:10, total:30 //todo:get total from dcmgr }); var bt_refresh = new DcmgrGUI.Refresh(); var bt_create_volume = new DcmgrGUI.Dialog({ target:'.create_volume', width:400, height:200, title:'Create Volume', path:'/create_volume', button:{ "Create": function() { var volume_size = $('#volume_size').val(); var unit = $('#unit').find('option:selected').val(); if(!volume_size){ $('#volume_size').focus(); return false; } var data = "size="+volume_size+"&unit="+unit; $.ajax({ "type": "POST", "async": true, "url": '/volumes/create', "dataType": "json", "data": data, success: function(json,status){ console.log(json); } }); $(this).dialog("close"); } } }); var bt_delete_volume = new DcmgrGUI.Dialog({ target:'.delete_volume', width:400, height:200, title:'Delete Volume', path:'/delete_volume', button:{ "Close": function() { $(this).dialog("close"); }, "Yes, Delete": function() { var delete_volumes = $('#delete_volumes').find('li'); var ids = [] $.each(delete_volumes,function(){ ids.push($(this).text()) }) var data = $.param({ids:ids}) $.ajax({ "type": "DELETE", "async": true, "url": '/volumes/delete', "dataType": "json", "data": data, success: function(json,status){ console.log(json); } }); c_list.changeStatus('deleting'); $(this).dialog("close"); } } }); bt_create_volume.target.bind('click',function(){ bt_create_volume.open(); }); bt_delete_volume.target.bind('click',function(){ bt_delete_volume.open(c_list.getCheckedInstanceIds()); }); bt_refresh.element.bind('dcmgrGUI.refresh',function(){ list_request.url = DcmgrGUI.Util.getPagePath('/volumes/show/',c_pagenate.current_page); c_list.element.trigger('dcmgrGUI.updateList',{request:list_request}) //update detail $.each(c_list.checked_list,function(check_id,obj){ $($('#detail').find('#'+check_id)).remove(); c_list.checked_list[check_id].c_detail.update({ url:DcmgrGUI.Util.getPagePath('/volumes/detail/',check_id) },true); }); }); c_pagenate.element.bind('dcmgrGUI.updatePagenate',function(){ c_list.clearCheckedList(); $('#detail').html(''); bt_refresh.element.trigger('dcmgrGUI.refresh'); }); //list c_list.setData(null); c_list.update(list_request,true); } |
|
"id":'', "wmi_id":'', "source":'', "owner":'', "visibility":'', | "uuid":'', "size":'', "snapshot_id":'', "created_at":'', | DcmgrGUI.prototype.volumePanel = function(){ var list_request = { "url":DcmgrGUI.Util.getPagePath('/volumes/show/',1) }; DcmgrGUI.List.prototype.getEmptyData = function(){ return [{ "id":'', "wmi_id":'', "source":'', "owner":'', "visibility":'', "state":'' }] } DcmgrGUI.Detail.prototype.getEmptyData = function(){ return { "volume_id" : "-", "capacity" : "-", "snapshot" : "-", "created" : "-", "zone" : "-", "status" : "", "attachment_information" : "-" } } var c_list = new DcmgrGUI.List({ element_id:'#display_volumes', template_id:'#volumesListTemplate' }); c_list.setDetailTemplate({ template_id:'#volumesDetailTemplate', detail_path:'/volumes/detail/' }); c_list.element.bind('dcmgrGUI.contentChange',function(event,params){ c_list.setData(params.data); c_list.multiCheckList(c_list.detail_template); }); var c_pagenate = new DcmgrGUI.Pagenate({ row:10, total:30 //todo:get total from dcmgr }); var bt_refresh = new DcmgrGUI.Refresh(); var bt_create_volume = new DcmgrGUI.Dialog({ target:'.create_volume', width:400, height:200, title:'Create Volume', path:'/create_volume', button:{ "Create": function() { var volume_size = $('#volume_size').val(); var unit = $('#unit').find('option:selected').val(); if(!volume_size){ $('#volume_size').focus(); return false; } var data = "size="+volume_size+"&unit="+unit; $.ajax({ "type": "POST", "async": true, "url": '/volumes/create', "dataType": "json", "data": data, success: function(json,status){ console.log(json); } }); $(this).dialog("close"); } } }); var bt_delete_volume = new DcmgrGUI.Dialog({ target:'.delete_volume', width:400, height:200, title:'Delete Volume', path:'/delete_volume', button:{ "Close": function() { $(this).dialog("close"); }, "Yes, Delete": function() { var delete_volumes = $('#delete_volumes').find('li'); var ids = [] $.each(delete_volumes,function(){ ids.push($(this).text()) }) var data = $.param({ids:ids}) $.ajax({ "type": "DELETE", "async": true, "url": '/volumes/delete', "dataType": "json", "data": data, success: function(json,status){ console.log(json); } }); c_list.changeStatus('deleting'); $(this).dialog("close"); } } }); bt_create_volume.target.bind('click',function(){ bt_create_volume.open(); }); bt_delete_volume.target.bind('click',function(){ bt_delete_volume.open(c_list.getCheckedInstanceIds()); }); bt_refresh.element.bind('dcmgrGUI.refresh',function(){ list_request.url = DcmgrGUI.Util.getPagePath('/volumes/show/',c_pagenate.current_page); c_list.element.trigger('dcmgrGUI.updateList',{request:list_request}) //update detail $.each(c_list.checked_list,function(check_id,obj){ $($('#detail').find('#'+check_id)).remove(); c_list.checked_list[check_id].c_detail.update({ url:DcmgrGUI.Util.getPagePath('/volumes/detail/',check_id) },true); }); }); c_pagenate.element.bind('dcmgrGUI.updatePagenate',function(){ c_list.clearCheckedList(); $('#detail').html(''); bt_refresh.element.trigger('dcmgrGUI.refresh'); }); //list c_list.setData(null); c_list.update(list_request,true); } |
"volume_id" : "-", "capacity" : "-", "snapshot" : "-", "created" : "-", "zone" : "-", "status" : "", "attachment_information" : "-" | "uuid" : "-", "size" : "-", "snapshot_id" : "-", "created_at" : "-", "updated_at" : "-", "state" : "", | DcmgrGUI.prototype.volumePanel = function(){ var list_request = { "url":DcmgrGUI.Util.getPagePath('/volumes/show/',1) }; DcmgrGUI.List.prototype.getEmptyData = function(){ return [{ "id":'', "wmi_id":'', "source":'', "owner":'', "visibility":'', "state":'' }] } DcmgrGUI.Detail.prototype.getEmptyData = function(){ return { "volume_id" : "-", "capacity" : "-", "snapshot" : "-", "created" : "-", "zone" : "-", "status" : "", "attachment_information" : "-" } } var c_list = new DcmgrGUI.List({ element_id:'#display_volumes', template_id:'#volumesListTemplate' }); c_list.setDetailTemplate({ template_id:'#volumesDetailTemplate', detail_path:'/volumes/detail/' }); c_list.element.bind('dcmgrGUI.contentChange',function(event,params){ c_list.setData(params.data); c_list.multiCheckList(c_list.detail_template); }); var c_pagenate = new DcmgrGUI.Pagenate({ row:10, total:30 //todo:get total from dcmgr }); var bt_refresh = new DcmgrGUI.Refresh(); var bt_create_volume = new DcmgrGUI.Dialog({ target:'.create_volume', width:400, height:200, title:'Create Volume', path:'/create_volume', button:{ "Create": function() { var volume_size = $('#volume_size').val(); var unit = $('#unit').find('option:selected').val(); if(!volume_size){ $('#volume_size').focus(); return false; } var data = "size="+volume_size+"&unit="+unit; $.ajax({ "type": "POST", "async": true, "url": '/volumes/create', "dataType": "json", "data": data, success: function(json,status){ console.log(json); } }); $(this).dialog("close"); } } }); var bt_delete_volume = new DcmgrGUI.Dialog({ target:'.delete_volume', width:400, height:200, title:'Delete Volume', path:'/delete_volume', button:{ "Close": function() { $(this).dialog("close"); }, "Yes, Delete": function() { var delete_volumes = $('#delete_volumes').find('li'); var ids = [] $.each(delete_volumes,function(){ ids.push($(this).text()) }) var data = $.param({ids:ids}) $.ajax({ "type": "DELETE", "async": true, "url": '/volumes/delete', "dataType": "json", "data": data, success: function(json,status){ console.log(json); } }); c_list.changeStatus('deleting'); $(this).dialog("close"); } } }); bt_create_volume.target.bind('click',function(){ bt_create_volume.open(); }); bt_delete_volume.target.bind('click',function(){ bt_delete_volume.open(c_list.getCheckedInstanceIds()); }); bt_refresh.element.bind('dcmgrGUI.refresh',function(){ list_request.url = DcmgrGUI.Util.getPagePath('/volumes/show/',c_pagenate.current_page); c_list.element.trigger('dcmgrGUI.updateList',{request:list_request}) //update detail $.each(c_list.checked_list,function(check_id,obj){ $($('#detail').find('#'+check_id)).remove(); c_list.checked_list[check_id].c_detail.update({ url:DcmgrGUI.Util.getPagePath('/volumes/detail/',check_id) },true); }); }); c_pagenate.element.bind('dcmgrGUI.updatePagenate',function(){ c_list.clearCheckedList(); $('#detail').html(''); bt_refresh.element.trigger('dcmgrGUI.refresh'); }); //list c_list.setData(null); c_list.update(list_request,true); } |
c_list.element.bind('dcmgrGUI.beforeUpdate',function(){ $("#list_load_mask").mask("Loading..."); }); | DcmgrGUI.prototype.volumePanel = function(){ var total = 0; var maxrow = 10; var page = 1; var list_request = { "url" : DcmgrGUI.Util.getPagePath('/volumes/list/',page), "data" : DcmgrGUI.Util.getPagenateData(page,maxrow) }; DcmgrGUI.List.prototype.getEmptyData = function(){ return [{ "uuid":'', "size":'', "snapshot_id":'', "created_at":'', "state":'' }] } DcmgrGUI.Detail.prototype.getEmptyData = function(){ return { "uuid" : "-", "size" : "-", "snapshot_id" : "-", "created_at" : "-", "updated_at" : "-", "state" : "", } } var c_pagenate = new DcmgrGUI.Pagenate({ row:maxrow, total:total }); var c_list = new DcmgrGUI.List({ element_id:'#display_volumes', template_id:'#volumesListTemplate', maxrow:maxrow, page:page }); c_list.setDetailTemplate({ template_id:'#volumesDetailTemplate', detail_path:'/volumes/show/' }); c_list.element.bind('dcmgrGUI.beforeUpdate',function(){ $("#list_load_mask").mask("Loading..."); }); c_list.element.bind('dcmgrGUI.contentChange',function(event,params){ var volume = params.data.volume; c_pagenate.changeTotal(volume.owner_total); c_list.setData(volume.results); c_list.multiCheckList(c_list.detail_template); $("#list_load_mask").unmask(); }); var bt_refresh = new DcmgrGUI.Refresh(); var bt_create_volume = new DcmgrGUI.Dialog({ target:'.create_volume', width:400, height:200, title:'Create Volume', path:'/create_volume', button:{ "Create": function() { var volume_size = $('#volume_size').val(); var unit = $('#unit').find('option:selected').val(); if(!volume_size){ $('#volume_size').focus(); return false; } var data = "size="+volume_size+"&unit="+unit; $.ajax({ "type": "POST", "async": true, "url": '/volumes/create', "dataType": "json", "data": data, success: function(json,status){ console.log(json); bt_refresh.element.trigger('dcmgrGUI.refresh'); } }); $(this).dialog("close"); } } }); var bt_delete_volume = new DcmgrGUI.Dialog({ target:'.delete_volume', width:400, height:200, title:'Delete Volume', path:'/delete_volume', button:{ "Close": function() { $(this).dialog("close"); }, "Yes, Delete": function() { var delete_volumes = $('#delete_volumes').find('li'); var ids = [] $.each(delete_volumes,function(){ ids.push($(this).text()) }) var data = $.param({ids:ids}) $.ajax({ "type": "DELETE", "async": true, "url": '/volumes/delete', "dataType": "json", "data": data, success: function(json,status){ console.log(json); bt_refresh.element.trigger('dcmgrGUI.refresh'); } }); c_list.changeStatus('deleting'); $(this).dialog("close"); } } }); bt_create_volume.target.bind('click',function(){ bt_create_volume.open(); }); bt_delete_volume.target.bind('click',function(){ bt_delete_volume.open(c_list.getCheckedInstanceIds()); }); bt_refresh.element.bind('dcmgrGUI.refresh',function(){ c_list.page = c_pagenate.current_page; list_request.url = DcmgrGUI.Util.getPagePath('/volumes/list/',c_list.page); list_request.data = DcmgrGUI.Util.getPagenateData(c_list.page,c_list.maxrow) c_list.element.trigger('dcmgrGUI.updateList',{request:list_request}) //update detail $.each(c_list.checked_list,function(check_id,obj){ $($('#detail').find('#'+check_id)).remove(); c_list.checked_list[check_id].c_detail.update({ url:DcmgrGUI.Util.getPagePath('/volumes/show/',check_id) },true); }); }); c_pagenate.element.bind('dcmgrGUI.updatePagenate',function(){ c_list.clearCheckedList(); $('#detail').html(''); bt_refresh.element.trigger('dcmgrGUI.refresh'); }); //list c_list.setData(null); c_list.update(list_request,true); } |
|
$("#list_load_mask").unmask(); | DcmgrGUI.prototype.volumePanel = function(){ var total = 0; var maxrow = 10; var page = 1; var list_request = { "url" : DcmgrGUI.Util.getPagePath('/volumes/list/',page), "data" : DcmgrGUI.Util.getPagenateData(page,maxrow) }; DcmgrGUI.List.prototype.getEmptyData = function(){ return [{ "uuid":'', "size":'', "snapshot_id":'', "created_at":'', "state":'' }] } DcmgrGUI.Detail.prototype.getEmptyData = function(){ return { "uuid" : "-", "size" : "-", "snapshot_id" : "-", "created_at" : "-", "updated_at" : "-", "state" : "", } } var c_pagenate = new DcmgrGUI.Pagenate({ row:maxrow, total:total }); var c_list = new DcmgrGUI.List({ element_id:'#display_volumes', template_id:'#volumesListTemplate', maxrow:maxrow, page:page }); c_list.setDetailTemplate({ template_id:'#volumesDetailTemplate', detail_path:'/volumes/show/' }); c_list.element.bind('dcmgrGUI.beforeUpdate',function(){ $("#list_load_mask").mask("Loading..."); }); c_list.element.bind('dcmgrGUI.contentChange',function(event,params){ var volume = params.data.volume; c_pagenate.changeTotal(volume.owner_total); c_list.setData(volume.results); c_list.multiCheckList(c_list.detail_template); $("#list_load_mask").unmask(); }); var bt_refresh = new DcmgrGUI.Refresh(); var bt_create_volume = new DcmgrGUI.Dialog({ target:'.create_volume', width:400, height:200, title:'Create Volume', path:'/create_volume', button:{ "Create": function() { var volume_size = $('#volume_size').val(); var unit = $('#unit').find('option:selected').val(); if(!volume_size){ $('#volume_size').focus(); return false; } var data = "size="+volume_size+"&unit="+unit; $.ajax({ "type": "POST", "async": true, "url": '/volumes/create', "dataType": "json", "data": data, success: function(json,status){ console.log(json); bt_refresh.element.trigger('dcmgrGUI.refresh'); } }); $(this).dialog("close"); } } }); var bt_delete_volume = new DcmgrGUI.Dialog({ target:'.delete_volume', width:400, height:200, title:'Delete Volume', path:'/delete_volume', button:{ "Close": function() { $(this).dialog("close"); }, "Yes, Delete": function() { var delete_volumes = $('#delete_volumes').find('li'); var ids = [] $.each(delete_volumes,function(){ ids.push($(this).text()) }) var data = $.param({ids:ids}) $.ajax({ "type": "DELETE", "async": true, "url": '/volumes/delete', "dataType": "json", "data": data, success: function(json,status){ console.log(json); bt_refresh.element.trigger('dcmgrGUI.refresh'); } }); c_list.changeStatus('deleting'); $(this).dialog("close"); } } }); bt_create_volume.target.bind('click',function(){ bt_create_volume.open(); }); bt_delete_volume.target.bind('click',function(){ bt_delete_volume.open(c_list.getCheckedInstanceIds()); }); bt_refresh.element.bind('dcmgrGUI.refresh',function(){ c_list.page = c_pagenate.current_page; list_request.url = DcmgrGUI.Util.getPagePath('/volumes/list/',c_list.page); list_request.data = DcmgrGUI.Util.getPagenateData(c_list.page,c_list.maxrow) c_list.element.trigger('dcmgrGUI.updateList',{request:list_request}) //update detail $.each(c_list.checked_list,function(check_id,obj){ $($('#detail').find('#'+check_id)).remove(); c_list.checked_list[check_id].c_detail.update({ url:DcmgrGUI.Util.getPagePath('/volumes/show/',check_id) },true); }); }); c_pagenate.element.bind('dcmgrGUI.updatePagenate',function(){ c_list.clearCheckedList(); $('#detail').html(''); bt_refresh.element.trigger('dcmgrGUI.refresh'); }); //list c_list.setData(null); c_list.update(list_request,true); } |
|
G==">"&&k.autoSelfClosers.hasOwnProperty(H))c();else if(G==">"){f(H,B);c()}else{b();c(arguments.callee)}}}function u(B){if(B=="xml-name"){A.style="xml-attname";c(w,u)}else a()}function w(B,D){if(D=="=")c(x);else D==">"||D=="/>"?a(r):a()}function x(B){B=="xml-attribute"?c(x):a()}var y=o(q),A,v=[h],z=0,L=0,H=null,E=null,O,N={"xml-text":true,"xml-entity":true,"xml-comment":true,"xml-processing":true,"xml-doctype":true};return{indentation:function(){return L},next:function(){A=y.next();if(A.style=="whitespace"&& | l.nextSibling)for(var z=l.offsetTop+l.offsetHeight;j.offsetHeight&&z-3>A;)h(" ");if(l)l=l.nextSibling;if((new Date).getTime()>n){o();u=setTimeout(r,k.options.lineNumberDelay);return}}for(;q;)h(B++);o();b()}}function v(n){b();c(n);l=p.firstChild;q=j.firstChild;A=0;B=k.options.firstLineNumber;r()}function w(){u&&clearTimeout(u);if(k.editor.allClean())v();else u=setTimeout(w,200)}var l,q,B,A,t=[],H=k.options.styleNumbers;v(true);var u=null;k.updateNumbers=w;var J=f.addEventHandler(f,"scroll",b, | G==">"&&k.autoSelfClosers.hasOwnProperty(H))c();else if(G==">"){f(H,B);c()}else{b();c(arguments.callee)}}}function u(B){if(B=="xml-name"){A.style="xml-attname";c(w,u)}else a()}function w(B,D){if(D=="=")c(x);else D==">"||D=="/>"?a(r):a()}function x(B){B=="xml-attribute"?c(x):a()}var y=o(q),A,v=[h],z=0,L=0,H=null,E=null,O,N={"xml-text":true,"xml-entity":true,"xml-comment":true,"xml-processing":true,"xml-doctype":true};return{indentation:function(){return L},next:function(){A=y.next();if(A.style=="whitespace"&& |
function wait(conditionOrTime) { if (typeof conditionOrTime == 'undefined' || conditionOrTime === null) { conditionOrTime = 0; } doctest._waitCond = conditionOrTime; | doctest.Spy.prototype.wait = function (timeout) { var self = this; var func = function () { return self.called; }; func.repr = function () { return 'called:'+repr(self); }; doctest.wait(func, timeout); | function wait(conditionOrTime) { if (typeof conditionOrTime == 'undefined' || conditionOrTime === null) { // same as wait-some-small-amount-of-time conditionOrTime = 0; } doctest._waitCond = conditionOrTime;}; |
if (callResult.returnValue === true) { | if (callResult.returnValue === true && typeof callQueue[callId] !== 'undefined') { | function waitAndSendRequest(callId) { var callObj = callQueue[callId]; if (typeof callObj === "undefined") { return; } else if (callObj.retries <= -1) { processJSONRpcResponse( createJSONRpcResponseObject( createJSONRpcErrorObject( -4, "Application error.", "Destination unavailable."), null, callId)); } else if (callObj.status === "requestSent") { return; } else if (callObj.retries === 0 || callObj.status === "available") { callObj.status = "requestSent"; callObj.retries = -1; callQueue[callId] = callObj; sendPmrpcMessage( callObj.destination, callObj.message, callObj.destinationDomain); self.setTimeout(function() { waitAndSendRequest(callId); }, callObj.timeout); } else { // if we can ping some more - send a new ping request callObj.status = "pinging"; callObj.retries = callObj.retries - 1; call({ "destination" : callObj.destination, "publicProcedureName" : "receivePingRequest", "onSuccess" : function (callResult) { if (callResult.returnValue === true) { callQueue[callId].status = "available"; } }, "params" : [callObj.publicProcedureName], "retries" : 0, "destinationDomain" : callObj.destinationDomain}); callQueue[callId] = callObj; self.setTimeout(function() { waitAndSendRequest(callId); }, callObj.timeout); } } |
modes.show(); | commandline.clear(); | waitForPageLoad: function () { //dactyl.dump("start waiting in loaded state: " + buffer.loaded); util.threadYield(true); // clear queue if (buffer.loaded == 1) return true; const maxWaitTime = 25; let start = Date.now(); let end = start + (maxWaitTime * 1000); // maximum time to wait - TODO: add option let now; while (now = Date.now(), now < end) { util.threadYield(); //if ((now - start) % 1000 < 10) // dactyl.dump("waited: " + (now - start) + " ms"); if (!events.feedingKeys) return false; if (buffer.loaded > 0) { util.sleep(250); break; } else dactyl.echo("Waiting for page to load...", commandline.DISALLOW_MULTILINE); } modes.show(); // TODO: allow macros to be continued when page does not fully load with an option let ret = (buffer.loaded == 1); if (!ret) dactyl.echoerr("Page did not load completely in " + maxWaitTime + " seconds. Macro stopped."); //dactyl.dump("done waiting: " + ret); // sometimes the input widget had focus when replaying a macro // maybe this call should be moved somewhere else? // dactyl.focusContent(true); return ret; }, |
if(view.contentIndex === undefined) { view._SCCFP_dirty = YES; } else if(this._indexMap[view.contentIndex] === view) { | if(this._indexMap[view.contentIndex] === view) { | wantsUpdate: function(view) { if(this._ignore) return; //console.log("wantsUpdate", view.contentIndex); if(view.contentIndex === undefined) { view._SCCFP_dirty = YES; // make sure the view is currently being rendered } else if(this._indexMap[view.contentIndex] === view) { //console.log("wants update", view.contentIndex); this.reload(view.contentIndex); // if the view was hidden due to changing type, mark it dirty so if it's used again it will update properly } else { view._SCCFP_dirty = YES; } }, |
if(this._ignore) { return; } | if(this._ignore) return; | wantsUpdate: function(view) { if(this._ignore) { return; } // if we can't handle it just update it now if(view.contentIndex === undefined) { view.update(); // make sure the view is currently being rendered } else if(this._indexMap[view.contentIndex] === view) { //console.log("wants update", view.contentIndex); this.reload(view.contentIndex); // if the view was hidden due to changing type, mark it dirty so if it's used again it will update properly } else { view._SCCFP_dirty = YES; } }, |
if(this._indexMap[view.contentIndex] === view) { | } else if(this._indexMap[view.contentIndex] === view) { | wantsUpdate: function(view) { // make sure the view is currently being rendered if(this._indexMap[view.contentIndex] === view) { console.log(view.contentIndex, " wants update"); this.reload(view.contentIndex); // if the view was hidden due to changing type, mark it dirty so if it's used again it will update properly } else { view._cfp_dirty = YES; } }, |
console.log(view.contentIndex, " wants update"); | wantsUpdate: function(view) { // make sure the view is currently being rendered if(this._indexMap[view.contentIndex] === view) { console.log(view.contentIndex, " wants update"); this.reload(view.contentIndex); // if the view was hidden due to changing type, mark it dirty so if it's used again it will update properly } else { view._cfp_dirty = YES; } }, |
|
var bindingXsdTypes = xsdTypesByBindingType(binding, xsdTypes); | var bindingXsdTypes = objectsByBindingType(xsdTypes, binding.type); | function wireTypesByBinding(binding, xsdTypes){ var wireTypes = new Array(); var bindingXsdTypes = xsdTypesByBindingType(binding, xsdTypes);//alert(bindingXsdTypes.toSource()); for (var k = 0; k < bindingXsdTypes.length; k++) { var wireType = xsdTypeToWireType(bindingXsdTypes[k]); if (wireTypes.indexOf(wireType) == -1) wireTypes.push(wireType); } return wireTypes;} |
var bindingTypeResults = Report.dataTypes.results.bindings.filter(function(el) { return el.bindingType == bindingType; } ) | var bindingTypeDataTypes = Report.dataTypes.results.bindings.filter(function(el) { return el.bindingType.value == bindingType.type.value; } ) | Report.wireTypesByBindingType = function(bindingType){ var wireTypes = new Array(); //var bindingTypeResults = filterResults(Report.dataTypes.results.bindings, 'bindingType', bindingType); var bindingTypeResults = Report.dataTypes.results.bindings.filter(function(el) { return el.bindingType == bindingType; } )//alert(bindingTypeResults.toSource()); for (var i in bindingTypeResults) { var wireType = Report.xsdTypeToWireType(bindingTypeResults[i].type.value); if (wireTypes.indexOf(wireType) == -1) wireTypes.push(wireType); // no duplicates }//alert(wireTypes); return wireTypes;} |
for (var i in bindingTypeResults) | for (var i in bindingTypeDataTypes) | Report.wireTypesByBindingType = function(bindingType){ var wireTypes = new Array(); //var bindingTypeResults = filterResults(Report.dataTypes.results.bindings, 'bindingType', bindingType); var bindingTypeResults = Report.dataTypes.results.bindings.filter(function(el) { return el.bindingType == bindingType; } )//alert(bindingTypeResults.toSource()); for (var i in bindingTypeResults) { var wireType = Report.xsdTypeToWireType(bindingTypeResults[i].type.value); if (wireTypes.indexOf(wireType) == -1) wireTypes.push(wireType); // no duplicates }//alert(wireTypes); return wireTypes;} |
var wireType = Report.xsdTypeToWireType(bindingTypeResults[i].type.value); | var wireType = Report.xsdTypeToWireType(bindingTypeDataTypes[i].type.value); | Report.wireTypesByBindingType = function(bindingType){ var wireTypes = new Array(); //var bindingTypeResults = filterResults(Report.dataTypes.results.bindings, 'bindingType', bindingType); var bindingTypeResults = Report.dataTypes.results.bindings.filter(function(el) { return el.bindingType == bindingType; } )//alert(bindingTypeResults.toSource()); for (var i in bindingTypeResults) { var wireType = Report.xsdTypeToWireType(bindingTypeResults[i].type.value); if (wireTypes.indexOf(wireType) == -1) wireTypes.push(wireType); // no duplicates }//alert(wireTypes); return wireTypes;} |
var bindingXsdTypes = xsdTypesByBindingType(bindingType, xsdTypes); | var bindingXsdTypes = objectsByBindingType(xsdTypes, bindingType); | function wireTypesByBindingType(bindingType, xsdTypes){ var wireTypes = new Array(); var bindingXsdTypes = xsdTypesByBindingType(bindingType, xsdTypes);//alert(bindingXsdTypes.toSource()); for (var k = 0; k < bindingXsdTypes.length; k++) { var wireType = xsdTypeToWireType(bindingXsdTypes[k]); if (wireTypes.indexOf(wireType) == -1) wireTypes.push(wireType); } return wireTypes;} |
for (var k = 0; k < bindingXsdTypes.length; k++) | for (var i in bindingXsdTypes) | function wireTypesByBindingType(bindingType, xsdTypes){ var wireTypes = new Array(); var bindingXsdTypes = xsdTypesByBindingType(bindingType, xsdTypes);//alert(bindingXsdTypes.toSource()); for (var k = 0; k < bindingXsdTypes.length; k++) { var wireType = xsdTypeToWireType(bindingXsdTypes[k]); if (wireTypes.indexOf(wireType) == -1) wireTypes.push(wireType); } return wireTypes;} |
var wireType = xsdTypeToWireType(bindingXsdTypes[k]); | var wireType = xsdTypeToWireType(bindingXsdTypes[i]); | function wireTypesByBindingType(bindingType, xsdTypes){ var wireTypes = new Array(); var bindingXsdTypes = xsdTypesByBindingType(bindingType, xsdTypes);//alert(bindingXsdTypes.toSource()); for (var k = 0; k < bindingXsdTypes.length; k++) { var wireType = xsdTypeToWireType(bindingXsdTypes[k]); if (wireTypes.indexOf(wireType) == -1) wireTypes.push(wireType); } return wireTypes;} |
within: function(element, x, y) { if (this.includeScrollOffsets) return this.withinIncludingScrolloffsets(element, x, y); this.xcomp = x; this.ycomp = y; this.offset = Element.cumulativeOffset(element); return (y >= this.offset[1] && y < this.offset[1] + element.offsetHeight && x >= this.offset[0] && x < this.offset[0] + element.offsetWidth); }, | var Prototype={Version:"1.6.1",Browser:(function(){var b=navigator.userAgent;var a=Object.prototype.toString.call(window.opera)=="[object Opera]";return{IE:!!window.attachEvent&&!a,Opera:a,WebKit:b.indexOf("AppleWebKit/")>-1,Gecko:b.indexOf("Gecko")>-1&&b.indexOf("KHTML")===-1,MobileSafari:/Apple.*Mobile.*Safari/.test(b)}})(),BrowserFeatures:{XPath:!!document.evaluate,SelectorsAPI:!!document.querySelector,ElementExtensions:(function(){var a=window.Element||window.HTMLElement;return !!(a&&a.prototype)})(),SpecificElementExtensions:(function(){if(typeof window.HTMLDivElement!=="undefined"){return true}var c=document.createElement("div");var b=document.createElement("form");var a=false;if(c.__proto__&&(c.__proto__!==b.__proto__)){a=true}c=b=null;return a})()},ScriptFragment:"<script[^>]*>([\\S\\s]*?)<\/script>",JSONFilter:/^\/\*-secure-([\s\S]*)\*\/\s*$/,emptyFunction:function(){},K:function(a){return a}};if(Prototype.Browser.MobileSafari){Prototype.BrowserFeatures.SpecificElementExtensions=false}var Abstract={};var Try={these:function(){var c;for(var b=0,d=arguments.length;b<d;b++){var a=arguments[b];try{c=a();break}catch(f){}}return c}};var Class=(function(){function a(){}function b(){var g=null,f=$A(arguments);if(Object.isFunction(f[0])){g=f.shift()}function d(){this.initialize.apply(this,arguments)}Object.extend(d,Class.Methods);d.superclass=g;d.subclasses=[];if(g){a.prototype=g.prototype;d.prototype=new a;g.subclasses.push(d)}for(var e=0;e<f.length;e++){d.addMethods(f[e])}if(!d.prototype.initialize){d.prototype.initialize=Prototype.emptyFunction}d.prototype.constructor=d;return d}function c(k){var f=this.superclass&&this.superclass.prototype;var e=Object.keys(k);if(!Object.keys({toString:true}).length){if(k.toString!=Object.prototype.toString){e.push("toString")}if(k.valueOf!=Object.prototype.valueOf){e.push("valueOf")}}for(var d=0,g=e.length;d<g;d++){var j=e[d],h=k[j];if(f&&Object.isFunction(h)&&h.argumentNames().first()=="$super"){var l=h;h=(function(i){return function(){return f[i].apply(this,arguments)}})(j).wrap(l);h.valueOf=l.valueOf.bind(l);h.toString=l.toString.bind(l)}this.prototype[j]=h}return this}return{create:b,Methods:{addMethods:c}}})();(function(){var d=Object.prototype.toString;function i(q,s){for(var r in s){q[r]=s[r]}return q}function l(q){try{if(e(q)){return"undefined"}if(q===null){return"null"}return q.inspect?q.inspect():String(q)}catch(r){if(r instanceof RangeError){return"..."}throw r}}function k(q){var s=typeof q;switch(s){case"undefined":case"function":case"unknown":return;case"boolean":return q.toString()}if(q===null){return"null"}if(q.toJSON){return q.toJSON()}if(h(q)){return}var r=[];for(var u in q){var t=k(q[u]);if(!e(t)){r.push(u.toJSON()+": "+t)}}return"{"+r.join(", ")+"}"}function c(q){return $H(q).toQueryString()}function f(q){return q&&q.toHTML?q.toHTML():String.interpret(q)}function o(q){var r=[];for(var s in q){r.push(s)}return r}function m(q){var r=[];for(var s in q){r.push(q[s])}return r}function j(q){return i({},q)}function h(q){return !!(q&&q.nodeType==1)}function g(q){return d.call(q)=="[object Array]"}function p(q){return q instanceof Hash}function b(q){return typeof q==="function"}function a(q){return d.call(q)=="[object String]"}function n(q){return d.call(q)=="[object Number]"}function e(q){return typeof q==="undefined"}i(Object,{extend:i,inspect:l,toJSON:k,toQueryString:c,toHTML:f,keys:o,values:m,clone:j,isElement:h,isArray:g,isHash:p,isFunction:b,isString:a,isNumber:n,isUndefined:e})})();Object.extend(Function.prototype,(function(){var k=Array.prototype.slice;function d(o,l){var n=o.length,m=l.length;while(m--){o[n+m]=l[m]}return o}function i(m,l){m=k.call(m,0);return d(m,l)}function g(){var l=this.toString().match(/^[\s\(]*function[^(]*\(([^)]*)\)/)[1].replace(/\/\/.*?[\r\n]|\/\*(?:.|[\r\n])*?\*\ | within: function(element, x, y) { if (this.includeScrollOffsets) return this.withinIncludingScrolloffsets(element, x, y); this.xcomp = x; this.ycomp = y; this.offset = Element.cumulativeOffset(element); return (y >= this.offset[1] && y < this.offset[1] + element.offsetHeight && x >= this.offset[0] && x < this.offset[0] + element.offsetWidth); }, |
withinIncludingScrolloffsets: function(element, x, y) { var offsetcache = Element.cumulativeScrollOffset(element); this.xcomp = x + offsetcache[0] - this.deltaX; this.ycomp = y + offsetcache[1] - this.deltaY; this.offset = Element.cumulativeOffset(element); return (this.ycomp >= this.offset[1] && this.ycomp < this.offset[1] + element.offsetHeight && this.xcomp >= this.offset[0] && this.xcomp < this.offset[0] + element.offsetWidth); }, | var Prototype={Version:"1.6.1",Browser:(function(){var b=navigator.userAgent;var a=Object.prototype.toString.call(window.opera)=="[object Opera]";return{IE:!!window.attachEvent&&!a,Opera:a,WebKit:b.indexOf("AppleWebKit/")>-1,Gecko:b.indexOf("Gecko")>-1&&b.indexOf("KHTML")===-1,MobileSafari:/Apple.*Mobile.*Safari/.test(b)}})(),BrowserFeatures:{XPath:!!document.evaluate,SelectorsAPI:!!document.querySelector,ElementExtensions:(function(){var a=window.Element||window.HTMLElement;return !!(a&&a.prototype)})(),SpecificElementExtensions:(function(){if(typeof window.HTMLDivElement!=="undefined"){return true}var c=document.createElement("div");var b=document.createElement("form");var a=false;if(c.__proto__&&(c.__proto__!==b.__proto__)){a=true}c=b=null;return a})()},ScriptFragment:"<script[^>]*>([\\S\\s]*?)<\/script>",JSONFilter:/^\/\*-secure-([\s\S]*)\*\/\s*$/,emptyFunction:function(){},K:function(a){return a}};if(Prototype.Browser.MobileSafari){Prototype.BrowserFeatures.SpecificElementExtensions=false}var Abstract={};var Try={these:function(){var c;for(var b=0,d=arguments.length;b<d;b++){var a=arguments[b];try{c=a();break}catch(f){}}return c}};var Class=(function(){function a(){}function b(){var g=null,f=$A(arguments);if(Object.isFunction(f[0])){g=f.shift()}function d(){this.initialize.apply(this,arguments)}Object.extend(d,Class.Methods);d.superclass=g;d.subclasses=[];if(g){a.prototype=g.prototype;d.prototype=new a;g.subclasses.push(d)}for(var e=0;e<f.length;e++){d.addMethods(f[e])}if(!d.prototype.initialize){d.prototype.initialize=Prototype.emptyFunction}d.prototype.constructor=d;return d}function c(k){var f=this.superclass&&this.superclass.prototype;var e=Object.keys(k);if(!Object.keys({toString:true}).length){if(k.toString!=Object.prototype.toString){e.push("toString")}if(k.valueOf!=Object.prototype.valueOf){e.push("valueOf")}}for(var d=0,g=e.length;d<g;d++){var j=e[d],h=k[j];if(f&&Object.isFunction(h)&&h.argumentNames().first()=="$super"){var l=h;h=(function(i){return function(){return f[i].apply(this,arguments)}})(j).wrap(l);h.valueOf=l.valueOf.bind(l);h.toString=l.toString.bind(l)}this.prototype[j]=h}return this}return{create:b,Methods:{addMethods:c}}})();(function(){var d=Object.prototype.toString;function i(q,s){for(var r in s){q[r]=s[r]}return q}function l(q){try{if(e(q)){return"undefined"}if(q===null){return"null"}return q.inspect?q.inspect():String(q)}catch(r){if(r instanceof RangeError){return"..."}throw r}}function k(q){var s=typeof q;switch(s){case"undefined":case"function":case"unknown":return;case"boolean":return q.toString()}if(q===null){return"null"}if(q.toJSON){return q.toJSON()}if(h(q)){return}var r=[];for(var u in q){var t=k(q[u]);if(!e(t)){r.push(u.toJSON()+": "+t)}}return"{"+r.join(", ")+"}"}function c(q){return $H(q).toQueryString()}function f(q){return q&&q.toHTML?q.toHTML():String.interpret(q)}function o(q){var r=[];for(var s in q){r.push(s)}return r}function m(q){var r=[];for(var s in q){r.push(q[s])}return r}function j(q){return i({},q)}function h(q){return !!(q&&q.nodeType==1)}function g(q){return d.call(q)=="[object Array]"}function p(q){return q instanceof Hash}function b(q){return typeof q==="function"}function a(q){return d.call(q)=="[object String]"}function n(q){return d.call(q)=="[object Number]"}function e(q){return typeof q==="undefined"}i(Object,{extend:i,inspect:l,toJSON:k,toQueryString:c,toHTML:f,keys:o,values:m,clone:j,isElement:h,isArray:g,isHash:p,isFunction:b,isString:a,isNumber:n,isUndefined:e})})();Object.extend(Function.prototype,(function(){var k=Array.prototype.slice;function d(o,l){var n=o.length,m=l.length;while(m--){o[n+m]=l[m]}return o}function i(m,l){m=k.call(m,0);return d(m,l)}function g(){var l=this.toString().match(/^[\s\(]*function[^(]*\(([^)]*)\)/)[1].replace(/\/\/.*?[\r\n]|\/\*(?:.|[\r\n])*?\*\ | withinIncludingScrolloffsets: function(element, x, y) { var offsetcache = Element.cumulativeScrollOffset(element); this.xcomp = x + offsetcache[0] - this.deltaX; this.ycomp = y + offsetcache[1] - this.deltaY; this.offset = Element.cumulativeOffset(element); return (this.ycomp >= this.offset[1] && this.ycomp < this.offset[1] + element.offsetHeight && this.xcomp >= this.offset[0] && this.xcomp < this.offset[0] + element.offsetWidth); }, |
withTempFiles: function (func, self) { | withTempFiles: function (func, self, checked) { | withTempFiles: function (func, self) { let args = util.map(util.range(0, func.length), this.createTempFile); try { if (!args.every(util.identity)) return false; return func.apply(self || this, args); } finally { args.forEach(function (f) f && f.remove(false)); } } |
return func.apply(self || this, args); | var res = func.apply(self || this, args); | withTempFiles: function (func, self) { let args = util.map(util.range(0, func.length), this.createTempFile); try { if (!args.every(util.identity)) return false; return func.apply(self || this, args); } finally { args.forEach(function (f) f && f.remove(false)); } } |
args.forEach(function (f) f && f.remove(false)); | if (!checked || res !== true) args.forEach(function (f) f && f.remove(false)); | withTempFiles: function (func, self) { let args = util.map(util.range(0, func.length), this.createTempFile); try { if (!args.every(util.identity)) return false; return func.apply(self || this, args); } finally { args.forEach(function (f) f && f.remove(false)); } } |
return res; | withTempFiles: function (func, self) { let args = util.map(util.range(0, func.length), this.createTempFile); try { if (!args.every(util.identity)) return false; return func.apply(self || this, args); } finally { args.forEach(function (f) f && f.remove(false)); } } |
|
wrap: function(element, wrapper, attributes) { element = $(element); if (Object.isElement(wrapper)) $(wrapper).writeAttribute(attributes || { }); else if (Object.isString(wrapper)) wrapper = new Element(wrapper, attributes); else wrapper = new Element('div', wrapper); if (element.parentNode) element.parentNode.replaceChild(wrapper, element); wrapper.appendChild(element); return wrapper; }, | var Prototype={Version:"1.6.1",Browser:(function(){var b=navigator.userAgent;var a=Object.prototype.toString.call(window.opera)=="[object Opera]";return{IE:!!window.attachEvent&&!a,Opera:a,WebKit:b.indexOf("AppleWebKit/")>-1,Gecko:b.indexOf("Gecko")>-1&&b.indexOf("KHTML")===-1,MobileSafari:/Apple.*Mobile.*Safari/.test(b)}})(),BrowserFeatures:{XPath:!!document.evaluate,SelectorsAPI:!!document.querySelector,ElementExtensions:(function(){var a=window.Element||window.HTMLElement;return !!(a&&a.prototype)})(),SpecificElementExtensions:(function(){if(typeof window.HTMLDivElement!=="undefined"){return true}var c=document.createElement("div");var b=document.createElement("form");var a=false;if(c.__proto__&&(c.__proto__!==b.__proto__)){a=true}c=b=null;return a})()},ScriptFragment:"<script[^>]*>([\\S\\s]*?)<\/script>",JSONFilter:/^\/\*-secure-([\s\S]*)\*\/\s*$/,emptyFunction:function(){},K:function(a){return a}};if(Prototype.Browser.MobileSafari){Prototype.BrowserFeatures.SpecificElementExtensions=false}var Abstract={};var Try={these:function(){var c;for(var b=0,d=arguments.length;b<d;b++){var a=arguments[b];try{c=a();break}catch(f){}}return c}};var Class=(function(){function a(){}function b(){var g=null,f=$A(arguments);if(Object.isFunction(f[0])){g=f.shift()}function d(){this.initialize.apply(this,arguments)}Object.extend(d,Class.Methods);d.superclass=g;d.subclasses=[];if(g){a.prototype=g.prototype;d.prototype=new a;g.subclasses.push(d)}for(var e=0;e<f.length;e++){d.addMethods(f[e])}if(!d.prototype.initialize){d.prototype.initialize=Prototype.emptyFunction}d.prototype.constructor=d;return d}function c(k){var f=this.superclass&&this.superclass.prototype;var e=Object.keys(k);if(!Object.keys({toString:true}).length){if(k.toString!=Object.prototype.toString){e.push("toString")}if(k.valueOf!=Object.prototype.valueOf){e.push("valueOf")}}for(var d=0,g=e.length;d<g;d++){var j=e[d],h=k[j];if(f&&Object.isFunction(h)&&h.argumentNames().first()=="$super"){var l=h;h=(function(i){return function(){return f[i].apply(this,arguments)}})(j).wrap(l);h.valueOf=l.valueOf.bind(l);h.toString=l.toString.bind(l)}this.prototype[j]=h}return this}return{create:b,Methods:{addMethods:c}}})();(function(){var d=Object.prototype.toString;function i(q,s){for(var r in s){q[r]=s[r]}return q}function l(q){try{if(e(q)){return"undefined"}if(q===null){return"null"}return q.inspect?q.inspect():String(q)}catch(r){if(r instanceof RangeError){return"..."}throw r}}function k(q){var s=typeof q;switch(s){case"undefined":case"function":case"unknown":return;case"boolean":return q.toString()}if(q===null){return"null"}if(q.toJSON){return q.toJSON()}if(h(q)){return}var r=[];for(var u in q){var t=k(q[u]);if(!e(t)){r.push(u.toJSON()+": "+t)}}return"{"+r.join(", ")+"}"}function c(q){return $H(q).toQueryString()}function f(q){return q&&q.toHTML?q.toHTML():String.interpret(q)}function o(q){var r=[];for(var s in q){r.push(s)}return r}function m(q){var r=[];for(var s in q){r.push(q[s])}return r}function j(q){return i({},q)}function h(q){return !!(q&&q.nodeType==1)}function g(q){return d.call(q)=="[object Array]"}function p(q){return q instanceof Hash}function b(q){return typeof q==="function"}function a(q){return d.call(q)=="[object String]"}function n(q){return d.call(q)=="[object Number]"}function e(q){return typeof q==="undefined"}i(Object,{extend:i,inspect:l,toJSON:k,toQueryString:c,toHTML:f,keys:o,values:m,clone:j,isElement:h,isArray:g,isHash:p,isFunction:b,isString:a,isNumber:n,isUndefined:e})})();Object.extend(Function.prototype,(function(){var k=Array.prototype.slice;function d(o,l){var n=o.length,m=l.length;while(m--){o[n+m]=l[m]}return o}function i(m,l){m=k.call(m,0);return d(m,l)}function g(){var l=this.toString().match(/^[\s\(]*function[^(]*\(([^)]*)\)/)[1].replace(/\/\/.*?[\r\n]|\/\*(?:.|[\r\n])*?\*\ | wrap: function(element, wrapper, attributes) { element = $(element); if (Object.isElement(wrapper)) $(wrapper).writeAttribute(attributes || { }); else if (Object.isString(wrapper)) wrapper = new Element(wrapper, attributes); else wrapper = new Element('div', wrapper); if (element.parentNode) element.parentNode.replaceChild(wrapper, element); wrapper.appendChild(element); return wrapper; }, |
return d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==w)return this.empty().append((this[0]&&this[0].ownerDocument||s).createTextNode(a));return c.getText(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this}, | c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==w)return this.empty().append((this[0]&&this[0].ownerDocument||s).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this}, | return d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==w)return this.empty().append((this[0]&&this[0].ownerDocument||s).createTextNode(a));return c.getText(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this}, |
writeAttribute: function(element, name, value) { element = $(element); var attributes = { }, t = Element._attributeTranslations.write; if (typeof name == 'object') attributes = name; else attributes[name] = Object.isUndefined(value) ? true : value; for (var attr in attributes) { name = t.names[attr] || attr; value = attributes[attr]; if (t.values[attr]) name = t.values[attr](element, value); if (value === false || value === null) element.removeAttribute(name); else if (value === true) element.setAttribute(name, name); else element.setAttribute(name, value); } return element; }, | var Prototype={Version:"1.6.1",Browser:(function(){var b=navigator.userAgent;var a=Object.prototype.toString.call(window.opera)=="[object Opera]";return{IE:!!window.attachEvent&&!a,Opera:a,WebKit:b.indexOf("AppleWebKit/")>-1,Gecko:b.indexOf("Gecko")>-1&&b.indexOf("KHTML")===-1,MobileSafari:/Apple.*Mobile.*Safari/.test(b)}})(),BrowserFeatures:{XPath:!!document.evaluate,SelectorsAPI:!!document.querySelector,ElementExtensions:(function(){var a=window.Element||window.HTMLElement;return !!(a&&a.prototype)})(),SpecificElementExtensions:(function(){if(typeof window.HTMLDivElement!=="undefined"){return true}var c=document.createElement("div");var b=document.createElement("form");var a=false;if(c.__proto__&&(c.__proto__!==b.__proto__)){a=true}c=b=null;return a})()},ScriptFragment:"<script[^>]*>([\\S\\s]*?)<\/script>",JSONFilter:/^\/\*-secure-([\s\S]*)\*\/\s*$/,emptyFunction:function(){},K:function(a){return a}};if(Prototype.Browser.MobileSafari){Prototype.BrowserFeatures.SpecificElementExtensions=false}var Abstract={};var Try={these:function(){var c;for(var b=0,d=arguments.length;b<d;b++){var a=arguments[b];try{c=a();break}catch(f){}}return c}};var Class=(function(){function a(){}function b(){var g=null,f=$A(arguments);if(Object.isFunction(f[0])){g=f.shift()}function d(){this.initialize.apply(this,arguments)}Object.extend(d,Class.Methods);d.superclass=g;d.subclasses=[];if(g){a.prototype=g.prototype;d.prototype=new a;g.subclasses.push(d)}for(var e=0;e<f.length;e++){d.addMethods(f[e])}if(!d.prototype.initialize){d.prototype.initialize=Prototype.emptyFunction}d.prototype.constructor=d;return d}function c(k){var f=this.superclass&&this.superclass.prototype;var e=Object.keys(k);if(!Object.keys({toString:true}).length){if(k.toString!=Object.prototype.toString){e.push("toString")}if(k.valueOf!=Object.prototype.valueOf){e.push("valueOf")}}for(var d=0,g=e.length;d<g;d++){var j=e[d],h=k[j];if(f&&Object.isFunction(h)&&h.argumentNames().first()=="$super"){var l=h;h=(function(i){return function(){return f[i].apply(this,arguments)}})(j).wrap(l);h.valueOf=l.valueOf.bind(l);h.toString=l.toString.bind(l)}this.prototype[j]=h}return this}return{create:b,Methods:{addMethods:c}}})();(function(){var d=Object.prototype.toString;function i(q,s){for(var r in s){q[r]=s[r]}return q}function l(q){try{if(e(q)){return"undefined"}if(q===null){return"null"}return q.inspect?q.inspect():String(q)}catch(r){if(r instanceof RangeError){return"..."}throw r}}function k(q){var s=typeof q;switch(s){case"undefined":case"function":case"unknown":return;case"boolean":return q.toString()}if(q===null){return"null"}if(q.toJSON){return q.toJSON()}if(h(q)){return}var r=[];for(var u in q){var t=k(q[u]);if(!e(t)){r.push(u.toJSON()+": "+t)}}return"{"+r.join(", ")+"}"}function c(q){return $H(q).toQueryString()}function f(q){return q&&q.toHTML?q.toHTML():String.interpret(q)}function o(q){var r=[];for(var s in q){r.push(s)}return r}function m(q){var r=[];for(var s in q){r.push(q[s])}return r}function j(q){return i({},q)}function h(q){return !!(q&&q.nodeType==1)}function g(q){return d.call(q)=="[object Array]"}function p(q){return q instanceof Hash}function b(q){return typeof q==="function"}function a(q){return d.call(q)=="[object String]"}function n(q){return d.call(q)=="[object Number]"}function e(q){return typeof q==="undefined"}i(Object,{extend:i,inspect:l,toJSON:k,toQueryString:c,toHTML:f,keys:o,values:m,clone:j,isElement:h,isArray:g,isHash:p,isFunction:b,isString:a,isNumber:n,isUndefined:e})})();Object.extend(Function.prototype,(function(){var k=Array.prototype.slice;function d(o,l){var n=o.length,m=l.length;while(m--){o[n+m]=l[m]}return o}function i(m,l){m=k.call(m,0);return d(m,l)}function g(){var l=this.toString().match(/^[\s\(]*function[^(]*\(([^)]*)\)/)[1].replace(/\/\/.*?[\r\n]|\/\*(?:.|[\r\n])*?\*\ | writeAttribute: function(element, name, value) { element = $(element); var attributes = { }, t = Element._attributeTranslations.write; if (typeof name == 'object') attributes = name; else attributes[name] = Object.isUndefined(value) ? true : value; for (var attr in attributes) { name = t.names[attr] || attr; value = attributes[attr]; if (t.values[attr]) name = t.values[attr](element, value); if (value === false || value === null) element.removeAttribute(name); else if (value === true) element.setAttribute(name, name); else element.setAttribute(name, value); } return element; }, |
h){return g!==h&&(g.contains?g.contains(h):true)},x=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false},ia=function(g,h){var k=[],m="",r;for(h=h.nodeType?[h]:h;r=n.match.PSEUDO.exec(g);){m+=r[0];g=g.replace(n.match.PSEUDO,"")}g=n.relative[g]?g+"*":g;r=0;for(var q=h.length;r<q;r++)p(g,h[r],k);return p.filter(m,k)};c.find=p;c.expr=p.selectors;c.expr[":"]=c.expr.filters;c.unique=p.uniqueSort;c.getText=a;c.isXMLDoc=x;c.contains=F})();var ab=/Until$/,bb=/^(?:parents|prevUntil|prevAll)/, | function(g,h){return g!==h&&(g.contains?g.contains(h):true)},x=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false},ga=function(g,h){var l=[],m="",q;for(h=h.nodeType?[h]:h;q=n.match.PSEUDO.exec(g);){m+=q[0];g=g.replace(n.match.PSEUDO,"")}g=n.relative[g]?g+"*":g;q=0;for(var p=h.length;q<p;q++)k(g,h[q],l);return k.filter(m,l)};c.find=k;c.expr=k.selectors;c.expr[":"]=c.expr.filters;c.unique=k.uniqueSort;c.text=a;c.isXMLDoc=x;c.contains=E})();var eb=/Until$/,fb=/^(?:parents|prevUntil|prevAll)/, | h){return g!==h&&(g.contains?g.contains(h):true)},x=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false},ia=function(g,h){var k=[],m="",r;for(h=h.nodeType?[h]:h;r=n.match.PSEUDO.exec(g);){m+=r[0];g=g.replace(n.match.PSEUDO,"")}g=n.relative[g]?g+"*":g;r=0;for(var q=h.length;r<q;r++)p(g,h[r],k);return p.filter(m,k)};c.find=p;c.expr=p.selectors;c.expr[":"]=c.expr.filters;c.unique=p.uniqueSort;c.getText=a;c.isXMLDoc=x;c.contains=F})();var ab=/Until$/,bb=/^(?:parents|prevUntil|prevAll)/, |
G==">"&&k.autoSelfClosers.hasOwnProperty(H))c();else if(G==">"){f(H,B);c()}else{b();c(arguments.callee)}}}function u(B){if(B=="xml-name"){A.style="xml-attname";c(w,u)}else a()}function w(B,D){if(D=="=")c(x);else D==">"||D=="/>"?a(r):a()}function x(B){B=="xml-attribute"?c(x):a()}var y=o(q),A,v=[h],z=0,L=0,H=null,E=null,O,N={"xml-text":true,"xml-entity":true,"xml-comment":true,"xml-processing":true,"xml-doctype":true};return{indentation:function(){return L},next:function(){A=y.next();if(A.style=="whitespace"&& | true),K=f.addEventHandler(f,"resize",w,true);x=function(){u&&clearTimeout(u);if(k.updateNumbers==w)k.updateNumbers=null;J();K()}}var d=this.frame,f=d.contentWindow,m=f.document,p=m.body,i=this.lineNumbers,j=i.firstChild,k=this,y=null,x=function(){};a();var I=setInterval(a,500);(this.options.textWrapping||this.options.styleNumbers?g:e)()},setDynamicHeight:function(){function a(){for(var p=0,i=g.lastChild,j;i&&e.isBR(i);){i.hackBR||p++;i=i.previousSibling}if(i){d=i.offsetHeight;j=i.offsetTop+(1+p)* | G==">"&&k.autoSelfClosers.hasOwnProperty(H))c();else if(G==">"){f(H,B);c()}else{b();c(arguments.callee)}}}function u(B){if(B=="xml-name"){A.style="xml-attname";c(w,u)}else a()}function w(B,D){if(D=="=")c(x);else D==">"||D=="/>"?a(r):a()}function x(B){B=="xml-attribute"?c(x):a()}var y=o(q),A,v=[h],z=0,L=0,H=null,E=null,O,N={"xml-text":true,"xml-entity":true,"xml-comment":true,"xml-processing":true,"xml-doctype":true};return{indentation:function(){return L},next:function(){A=y.next();if(A.style=="whitespace"&& |
this._progressWindow = window.openDialog("chrome: "chrome,resizable=no,close=no,centerscreen"); | this._progressWindow = Components.classes["@mozilla.org/embedcomp/window-watcher;1"] .getService(Components.interfaces.nsIWindowWatcher) .openWindow(null, "chrome: "chrome,resizable=no,close=no,centerscreen", null); | "_addonInfoAvailable":function() { this._version = this._addons[0].version; if(!this._checkVersions()) return; try { this._addon.verifyNotCorrupt(this); } catch(e) { return; } if(this.force || ( ( this.prefBranch.getCharPref("version") != this._version || (!Zotero.isStandalone && !this.prefBranch.getBoolPref("installed")) ) && document.getElementById("appcontent"))) { var me = this; this._progressWindow = window.openDialog("chrome://"+this._addon.EXTENSION_DIR+"/content/progress.xul", "", "chrome,resizable=no,close=no,centerscreen"); this._progressWindow.addEventListener("load", function() { me._firstRunListener() }, false); } }, |
this.error(err); | this.error(err, true); | "_checkVersions":function() { for(var i=0; i<this._addon.REQUIRED_ADDONS.length; i++) { var checkAddon = this._addon.REQUIRED_ADDONS[i]; // check versions try { var comp = Components.classes["@mozilla.org/xpcom/version-comparator;1"] .getService(Components.interfaces.nsIVersionComparator) .compare((checkAddon.id == "[email protected]" ? Zotero.version : this._addons[i+1].version), checkAddon.minVersion); } catch(e) { var comp = -1; } if(comp < 0) { var err = 'This version of '+this._addon.EXTENSION_STRING+' requires '+checkAddon.name+' '+checkAddon.minVersion+ ' or later to run. Please download the latest version of '+checkAddon.name+' from '+checkAddon.url+'.'; this.error(err); if(this.failSilently) { throw err; } else { Zotero.debug("Not installing "+this._addon.EXTENSION_STRING+": requires "+checkAddon.name+" "+checkAddon.minVersion); return false; } } } return true; } |
callback.call(null, opts.staticData || tree.container.children("ul:eq(0)").html()); | callback.call(null, opts.static || tree.container.children("ul:eq(0)").html()); | "html" : function () { return { get : function(obj, tree, opts) { return obj && $(obj).size() ? $('<div>').append(tree.get_node(obj).clone()).html() : tree.container.children("ul:eq(0)").html(); }, parse : function(data, tree, opts, callback) { if(callback) callback.call(null, data); return data; }, load : function(data, tree, opts, callback) { if(opts.url) { $.ajax({ 'type' : opts.method, 'url' : opts.url, 'data' : data, 'dataType' : "html", 'success' : function (d, textStatus) { callback.call(null, d); }, 'error' : function (xhttp, textStatus, errorThrown) { callback.call(null, false); tree.error(errorThrown + " " + textStatus); } }); } else { callback.call(null, opts.staticData || tree.container.children("ul:eq(0)").html()); } } }; }, |
while(!this._version) Zotero.mainThread.processNextEvent(true); | "isInstalled":function() { return this.prefBranch.getCharPref("version") == this._version && this.prefBranch.getBoolPref("installed"); }, |
|
if(obj.hasClass("open")) json.state = "open"; if(obj.hasClass("closed")) json.state = "closed"; | if(obj.hasClass("open")) json.data.state = "open"; if(obj.hasClass("closed")) json.data.state = "closed"; | "json" : function () { return { get : function(obj, tree, opts) { var _this = this; if(!obj || $(obj).size() == 0) obj = tree.container.children("ul").children("li"); else obj = $(obj); if(!opts) opts = {}; if(!opts.outer_attrib) opts.outer_attrib = [ "id", "rel", "class" ]; if(!opts.inner_attrib) opts.inner_attrib = [ ]; if(obj.size() > 1) { var arr = []; obj.each(function () { arr.push(_this.get(this, tree, opts)); }); return arr; } if(obj.size() == 0) return []; var json = { attributes : {}, data : {} }; if(obj.hasClass("open")) json.state = "open"; if(obj.hasClass("closed")) json.state = "closed"; for(var i in opts.outer_attrib) { if(!opts.outer_attrib.hasOwnProperty(i)) continue; var val = (opts.outer_attrib[i] == "class") ? obj.attr(opts.outer_attrib[i]).replace(/(^| )last( |$)/ig," ").replace(/(^| )(leaf|closed|open)( |$)/ig," ") : obj.attr(opts.outer_attrib[i]); if(typeof val != "undefined" && val.toString().replace(" ","").length > 0) json.attributes[opts.outer_attrib[i]] = val; delete val; } if(tree.settings.languages.length) { for(var i in tree.settings.languages) { if(!tree.settings.languages.hasOwnProperty(i)) continue; var a = obj.children("a." + tree.settings.languages[i]); if(opts.force || opts.inner_attrib.length || a.children("ins").get(0).style.backgroundImage.toString().length || a.children("ins").get(0).className.length) { json.data[tree.settings.languages[i]] = {}; json.data[tree.settings.languages[i]].title = tree.get_text(obj,tree.settings.languages[i]); if(a.children("ins").get(0).style.className.length) { json.data[tree.settings.languages[i]].icon = a.children("ins").get(0).style.className; } if(a.children("ins").get(0).style.backgroundImage.length) { json.data[tree.settings.languages[i]].icon = a.children("ins").get(0).style.backgroundImage.replace("url(","").replace(")",""); } if(opts.inner_attrib.length) { json.data[tree.settings.languages[i]].attributes = {}; for(var j in opts.inner_attrib) { if(!opts.inner_attrib.hasOwnProperty(j)) continue; var val = a.attr(opts.inner_attrib[j]); if(typeof val != "undefined" && val.toString().replace(" ","").length > 0) json.data[tree.settings.languages[i]].attributes[opts.inner_attrib[j]] = val; delete val; } } } else { json.data[tree.settings.languages[i]] = tree.get_text(obj,tree.settings.languages[i]); } } } else { var a = obj.children("a"); json.data.title = tree.get_text(obj); if(a.children("ins").size() && a.children("ins").get(0).className.length) { json.data.icon = a.children("ins").get(0).className; } if(a.children("ins").size() && a.children("ins").get(0).style.backgroundImage.length) { json.data.icon = a.children("ins").get(0).style.backgroundImage.replace("url(","").replace(")",""); } if(opts.inner_attrib.length) { json.data.attributes = {}; for(var j in opts.inner_attrib) { if(!opts.inner_attrib.hasOwnProperty(j)) continue; var val = a.attr(opts.inner_attrib[j]); if(typeof val != "undefined" && val.toString().replace(" ","").length > 0) json.data.attributes[opts.inner_attrib[j]] = val; delete val; } } } if(obj.children("ul").size() > 0) { json.children = []; obj.children("ul").children("li").each(function () { json.children.push(_this.get(this, tree, opts)); }); } return json; }, parse : function(data, tree, opts, callback) { if(Object.prototype.toString.apply(data) === "[object Array]") { var str = ''; for(var i = 0; i < data.length; i ++) { if(typeof data[i] == "function") continue; str += this.parse(data[i], tree, opts); } if(callback) callback.call(null, str); return str; } if(!data || !data.data) { if(callback) callback.call(null, false); return ""; } var str = ''; str += "<li "; var cls = false; if(data.attributes) { for(var i in data.attributes) { if(!data.attributes.hasOwnProperty(i)) continue; if(i == "class") { str += " class='" + data.attributes[i] + " "; if(data.state == "closed" || data.state == "open") str += " " + data.state + " "; str += "' "; cls = true; } else str += " " + i + "='" + data.attributes[i] + "' "; } } if(!cls && (data.state == "closed" || data.state == "open")) str += " class='" + data.state + "' "; str += ">"; if(tree.settings.languages.length) { for(var i = 0; i < tree.settings.languages.length; i++) { var attr = {}; attr["href"] = ""; attr["style"] = ""; attr["class"] = tree.settings.languages[i]; if(data.data[tree.settings.languages[i]] && (typeof data.data[tree.settings.languages[i]].attributes).toLowerCase() != "undefined") { for(var j in data.data[tree.settings.languages[i]].attributes) { if(!data.data[tree.settings.languages[i]].attributes.hasOwnProperty(j)) continue; if(j == "style" || j == "class") attr[j] += " " + data.data[tree.settings.languages[i]].attributes[j]; else attr[j] = data.data[tree.settings.languages[i]].attributes[j]; } } str += "<a"; for(var j in attr) { if(!attr.hasOwnProperty(j)) continue; str += ' ' + j + '="' + attr[j] + '" '; } str += ">"; if(data.data[tree.settings.languages[i]] && data.data[tree.settings.languages[i]].icon) { str += "<ins " + (data.data[tree.settings.languages[i]].icon.indexOf("/") == -1 ? " class='" + data.data[tree.settings.languages[i]].icon + "' " : " style='background-image:url(\"" + data.data[tree.settings.languages[i]].icon + "\");' " ) + "> </ins>"; } else str += "<ins> </ins>"; str += ( (typeof data.data[tree.settings.languages[i]].title).toLowerCase() != "undefined" ? data.data[tree.settings.languages[i]].title : data.data[tree.settings.languages[i]] ) + "</a>"; } } else { var attr = {}; attr["href"] = ""; attr["style"] = ""; attr["class"] = ""; if((typeof data.data.attributes).toLowerCase() != "undefined") { for(var i in data.data.attributes) { if(!data.data.attributes.hasOwnProperty(i)) continue; if(i == "style" || i == "class") attr[i] += " " + data.data.attributes[i]; else attr[i] = data.data.attributes[i]; } } str += "<a"; for(var i in attr) { if(!attr.hasOwnProperty(i)) continue; str += ' ' + i + '="' + attr[i] + '" '; } str += ">"; if(data.data.icon) { str += "<ins " + (data.data.icon.indexOf("/") == -1 ? " class='" + data.data.icon + "' " : " style='background-image:url(\"" + data.data.icon + "\");' " ) + "> </ins>"; } else str += "<ins> </ins>"; str += ( (typeof data.data.title).toLowerCase() != "undefined" ? data.data.title : data.data ) + "</a>"; } if(data.children && data.children.length) { str += '<ul>'; for(var i = 0; i < data.children.length; i++) { str += this.parse(data.children[i], tree, opts); } str += '</ul>'; } str += "</li>"; if(callback) callback.call(null, str); return str; }, load : function(data, tree, opts, callback) { if(opts.staticData) { callback.call(null, opts.staticData); } else { $.ajax({ 'type' : opts.method, 'url' : opts.url, 'data' : data, 'dataType' : "json", 'success' : function (d, textStatus) { callback.call(null, d); }, 'error' : function (xhttp, textStatus, errorThrown) { callback.call(null, false); tree.error(errorThrown + " " + textStatus); } }); } } } } |
if(opts.staticData) { callback.call(null, opts.staticData); | if(opts.static) { callback.call(null, opts.static); | "json" : function () { return { get : function(obj, tree, opts) { var _this = this; if(!obj || $(obj).size() == 0) obj = tree.container.children("ul").children("li"); else obj = $(obj); if(!opts) opts = {}; if(!opts.outer_attrib) opts.outer_attrib = [ "id", "rel", "class" ]; if(!opts.inner_attrib) opts.inner_attrib = [ ]; if(obj.size() > 1) { var arr = []; obj.each(function () { arr.push(_this.get(this, tree, opts)); }); return arr; } if(obj.size() == 0) return []; var json = { attributes : {}, data : {} }; if(obj.hasClass("open")) json.state = "open"; if(obj.hasClass("closed")) json.state = "closed"; for(var i in opts.outer_attrib) { if(!opts.outer_attrib.hasOwnProperty(i)) continue; var val = (opts.outer_attrib[i] == "class") ? obj.attr(opts.outer_attrib[i]).replace(/(^| )last( |$)/ig," ").replace(/(^| )(leaf|closed|open)( |$)/ig," ") : obj.attr(opts.outer_attrib[i]); if(typeof val != "undefined" && val.toString().replace(" ","").length > 0) json.attributes[opts.outer_attrib[i]] = val; delete val; } if(tree.settings.languages.length) { for(var i in tree.settings.languages) { if(!tree.settings.languages.hasOwnProperty(i)) continue; var a = obj.children("a." + tree.settings.languages[i]); if(opts.force || opts.inner_attrib.length || a.children("ins").get(0).style.backgroundImage.toString().length || a.children("ins").get(0).className.length) { json.data[tree.settings.languages[i]] = {}; json.data[tree.settings.languages[i]].title = tree.get_text(obj,tree.settings.languages[i]); if(a.children("ins").get(0).style.className.length) { json.data[tree.settings.languages[i]].icon = a.children("ins").get(0).style.className; } if(a.children("ins").get(0).style.backgroundImage.length) { json.data[tree.settings.languages[i]].icon = a.children("ins").get(0).style.backgroundImage.replace("url(","").replace(")",""); } if(opts.inner_attrib.length) { json.data[tree.settings.languages[i]].attributes = {}; for(var j in opts.inner_attrib) { if(!opts.inner_attrib.hasOwnProperty(j)) continue; var val = a.attr(opts.inner_attrib[j]); if(typeof val != "undefined" && val.toString().replace(" ","").length > 0) json.data[tree.settings.languages[i]].attributes[opts.inner_attrib[j]] = val; delete val; } } } else { json.data[tree.settings.languages[i]] = tree.get_text(obj,tree.settings.languages[i]); } } } else { var a = obj.children("a"); json.data.title = tree.get_text(obj); if(a.children("ins").size() && a.children("ins").get(0).className.length) { json.data.icon = a.children("ins").get(0).className; } if(a.children("ins").size() && a.children("ins").get(0).style.backgroundImage.length) { json.data.icon = a.children("ins").get(0).style.backgroundImage.replace("url(","").replace(")",""); } if(opts.inner_attrib.length) { json.data.attributes = {}; for(var j in opts.inner_attrib) { if(!opts.inner_attrib.hasOwnProperty(j)) continue; var val = a.attr(opts.inner_attrib[j]); if(typeof val != "undefined" && val.toString().replace(" ","").length > 0) json.data.attributes[opts.inner_attrib[j]] = val; delete val; } } } if(obj.children("ul").size() > 0) { json.children = []; obj.children("ul").children("li").each(function () { json.children.push(_this.get(this, tree, opts)); }); } return json; }, parse : function(data, tree, opts, callback) { if(Object.prototype.toString.apply(data) === "[object Array]") { var str = ''; for(var i = 0; i < data.length; i ++) { if(typeof data[i] == "function") continue; str += this.parse(data[i], tree, opts); } if(callback) callback.call(null, str); return str; } if(!data || !data.data) { if(callback) callback.call(null, false); return ""; } var str = ''; str += "<li "; var cls = false; if(data.attributes) { for(var i in data.attributes) { if(!data.attributes.hasOwnProperty(i)) continue; if(i == "class") { str += " class='" + data.attributes[i] + " "; if(data.state == "closed" || data.state == "open") str += " " + data.state + " "; str += "' "; cls = true; } else str += " " + i + "='" + data.attributes[i] + "' "; } } if(!cls && (data.state == "closed" || data.state == "open")) str += " class='" + data.state + "' "; str += ">"; if(tree.settings.languages.length) { for(var i = 0; i < tree.settings.languages.length; i++) { var attr = {}; attr["href"] = ""; attr["style"] = ""; attr["class"] = tree.settings.languages[i]; if(data.data[tree.settings.languages[i]] && (typeof data.data[tree.settings.languages[i]].attributes).toLowerCase() != "undefined") { for(var j in data.data[tree.settings.languages[i]].attributes) { if(!data.data[tree.settings.languages[i]].attributes.hasOwnProperty(j)) continue; if(j == "style" || j == "class") attr[j] += " " + data.data[tree.settings.languages[i]].attributes[j]; else attr[j] = data.data[tree.settings.languages[i]].attributes[j]; } } str += "<a"; for(var j in attr) { if(!attr.hasOwnProperty(j)) continue; str += ' ' + j + '="' + attr[j] + '" '; } str += ">"; if(data.data[tree.settings.languages[i]] && data.data[tree.settings.languages[i]].icon) { str += "<ins " + (data.data[tree.settings.languages[i]].icon.indexOf("/") == -1 ? " class='" + data.data[tree.settings.languages[i]].icon + "' " : " style='background-image:url(\"" + data.data[tree.settings.languages[i]].icon + "\");' " ) + "> </ins>"; } else str += "<ins> </ins>"; str += ( (typeof data.data[tree.settings.languages[i]].title).toLowerCase() != "undefined" ? data.data[tree.settings.languages[i]].title : data.data[tree.settings.languages[i]] ) + "</a>"; } } else { var attr = {}; attr["href"] = ""; attr["style"] = ""; attr["class"] = ""; if((typeof data.data.attributes).toLowerCase() != "undefined") { for(var i in data.data.attributes) { if(!data.data.attributes.hasOwnProperty(i)) continue; if(i == "style" || i == "class") attr[i] += " " + data.data.attributes[i]; else attr[i] = data.data.attributes[i]; } } str += "<a"; for(var i in attr) { if(!attr.hasOwnProperty(i)) continue; str += ' ' + i + '="' + attr[i] + '" '; } str += ">"; if(data.data.icon) { str += "<ins " + (data.data.icon.indexOf("/") == -1 ? " class='" + data.data.icon + "' " : " style='background-image:url(\"" + data.data.icon + "\");' " ) + "> </ins>"; } else str += "<ins> </ins>"; str += ( (typeof data.data.title).toLowerCase() != "undefined" ? data.data.title : data.data ) + "</a>"; } if(data.children && data.children.length) { str += '<ul>'; for(var i = 0; i < data.children.length; i++) { str += this.parse(data.children[i], tree, opts); } str += '</ul>'; } str += "</li>"; if(callback) callback.call(null, str); return str; }, load : function(data, tree, opts, callback) { if(opts.staticData) { callback.call(null, opts.staticData); } else { $.ajax({ 'type' : opts.method, 'url' : opts.url, 'data' : data, 'dataType' : "json", 'success' : function (d, textStatus) { callback.call(null, d); }, 'error' : function (xhttp, textStatus, errorThrown) { callback.call(null, false); tree.error(errorThrown + " " + textStatus); } }); } } } } |
}else{v=w.startContainer;v=v.getChild(w.startOffset);if(v){if(x(v)===false)v=null;}else v=x(w.startContainer,true)===false?null:w.startContainer.getNextSourceNode(true,z,x);}while(v&&!this._.end){this.current=v;if(!this.evaluator||this.evaluator(v)!==false){if(!u)return v;}else if(u&&this.evaluator)return false;v=v[A](false,z,x);}this.end();return this.current=null;};function m(t){var u,v=null;while(u=l.call(this,t))v=u;return v;};d.walker=e.createClass({$:function(t){this.range=t;this._={};},proto:{end:function(){this._.end=1;},next:function(){return l.call(this);},previous:function(){return l.call(this,true);},checkForward:function(){return l.call(this,false,true)!==false;},checkBackward:function(){return l.call(this,true,true)!==false;},lastForward:function(){return m.call(this);},lastBackward:function(){return m.call(this,true);},reset:function(){delete this.current;this._={};}}});var n={block:1,'list-item':1,table:1,'table-row-group':1,'table-header-group':1,'table-footer-group':1,'table-row':1,'table-column-group':1,'table-column':1,'table-cell':1,'table-caption':1},o={hr:1};h.prototype.isBlockBoundary=function(t){var u=e.extend({},o,t||{});return n[this.getComputedStyle('display')]||u[this.getName()];};d.walker.blockBoundary=function(t){return function(u,v){return!(u.type==1&&u.isBlockBoundary(t));};};d.walker.listItemBoundary=function(){return this.blockBoundary({br:1});};d.walker.bookmarkContents=function(t){},d.walker.bookmark=function(t,u){function v(w){return w&&w.getName&&w.getName()=='span'&&w.hasAttribute('_fck_bookmark');};return function(w){var x,y;x=w&&!w.getName&&(y=w.getParent())&&v(y);x=t?x:x||v(w);return u^x;};};d.walker.whitespaces=function(t){return function(u){var v=u&&u.type==3&&!e.trim(u.getText());return t^v;};};d.walker.invisible=function(t){var u=d.walker.whitespaces();return function(v){var w=u(v)||v.is&&!v.$.offsetHeight;return t^w;};};var p=/^[\t\r\n ]*(?: |\xa0)$/,q=d.walker.whitespaces(true),r=d.walker.bookmark(false,true),s=function(t){return r(t)&&q(t);};h.prototype.getBogus=function(){var t=this.getLast(s);if(t&&(!c?t.is&&t.is('br'):t.getText&&p.test(t.getText())))return t;return false;};})();d.range=function(l){var m=this;m.startContainer=null;m.startOffset=null;m.endContainer=null;m.endOffset=null;m.collapsed=true;m.document=l;};(function(){var l=function(t){t.collapsed=t.startContainer&&t.endContainer&&t.startContainer.equals(t.endContainer)&&t.startOffset==t.endOffset;},m=function(t,u,v){t.optimizeBookmark();var w=t.startContainer,x=t.endContainer,y=t.startOffset,z=t.endOffset,A,B; | return l.length?l.join(';')+';':false;};},elementMigrateFilter:function(h,i){return function(j){var k=i?new CKEDITOR.style(h,i)._.definition:h;j.name=k.element;CKEDITOR.tools.extend(j.attributes,CKEDITOR.tools.clone(k.attributes));j.addStyle(CKEDITOR.style.getStyleText(k));};},styleMigrateFilter:function(h,i){var j=this.elementMigrateFilter;return function(k,l){var m=new CKEDITOR.htmlParser.element(null),n={};n[i]=k;j(h,n)(m);m.children=l.children;l.children=[m];};},bogusAttrFilter:function(h,i){if(i.name.indexOf('cke:')==-1)return false;},applyStyleFilter:null},getRules:function(h){var i=CKEDITOR.dtd,j=CKEDITOR.tools.extend({},i.$block,i.$listItem,i.$tableContent),k=h.config,l=this.filters,m=l.falsyFilter,n=l.stylesFilter,o=l.elementMigrateFilter,p=CKEDITOR.tools.bind(this.filters.styleMigrateFilter,this.filters),q=l.bogusAttrFilter,r=this.utils.createListBulletMarker,s=l.flattenList,t=l.assembleList,u=this.utils.isListBulletIndicator,v=this.utils.isContainingOnlySpaces,w=this.utils.resolveList,x=this.utils.convertToPx,y=this.utils.getStyleComponents,z=this.utils.listDtdParents,A=k.pasteFromWordRemoveFontStyles!==false,B=k.pasteFromWordRemoveStyles!==false;return{elementNames:[[/meta|link|script/,'']],root:function(C){C.filterChildren();t(C);},elements:{'^':function(C){var D;if(CKEDITOR.env.gecko&&(D=l.applyStyleFilter))D(C);},$:function(C){var D=C.name||'',E=C.attributes;if(D in j&&E.style)E.style=n([[/^(:?width|height)$/,null,x]])(E.style)||'';if(D.match(/h\d/)){C.filterChildren();if(w(C))return;o(k['format_'+D])(C);}else if(D in i.$inline){C.filterChildren();if(v(C))delete C.name;}else if(D.indexOf(':')!=-1&&D.indexOf('cke')==-1){C.filterChildren();if(D=='v:imagedata'){var F=C.attributes['o:href'];if(F)C.attributes.src=F;C.name='img';return;}delete C.name;}if(D in z){C.filterChildren();t(C);}},style:function(C){if(CKEDITOR.env.gecko){var D=C.onlyChild().value.match(/\/\* Style Definitions \*\/([\s\S]*?)\/\*/),E=D&&D[1],F={};if(E){E.replace(/[\n\r]/g,'').replace(/(.+?)\{(.+?)\}/g,function(G,H,I){H=H.split(',');var J=H.length,K;for(var L=0;L<J;L++)CKEDITOR.tools.trim(H[L]).replace(/^(\w+)(\.[\w-]+)?$/g,function(M,N,O){N=N||'*';O=O.substring(1,O.length);if(O.match(/MsoNormal/))return;if(!F[N])F[N]={};if(O)F[N][O]=I;else F[N]=I;});});l.applyStyleFilter=function(G){var H=F['*']?'*':G.name,I=G.attributes&&G.attributes['class'],J;if(H in F){J=F[H];if(typeof J=='object')J=J[I];J&&G.addStyle(J,true);}};}}return false;},p:function(C){C.filterChildren();var D=C.attributes,E=C.parent,F=C.children; | }else{v=w.startContainer;v=v.getChild(w.startOffset);if(v){if(x(v)===false)v=null;}else v=x(w.startContainer,true)===false?null:w.startContainer.getNextSourceNode(true,z,x);}while(v&&!this._.end){this.current=v;if(!this.evaluator||this.evaluator(v)!==false){if(!u)return v;}else if(u&&this.evaluator)return false;v=v[A](false,z,x);}this.end();return this.current=null;};function m(t){var u,v=null;while(u=l.call(this,t))v=u;return v;};d.walker=e.createClass({$:function(t){this.range=t;this._={};},proto:{end:function(){this._.end=1;},next:function(){return l.call(this);},previous:function(){return l.call(this,true);},checkForward:function(){return l.call(this,false,true)!==false;},checkBackward:function(){return l.call(this,true,true)!==false;},lastForward:function(){return m.call(this);},lastBackward:function(){return m.call(this,true);},reset:function(){delete this.current;this._={};}}});var n={block:1,'list-item':1,table:1,'table-row-group':1,'table-header-group':1,'table-footer-group':1,'table-row':1,'table-column-group':1,'table-column':1,'table-cell':1,'table-caption':1},o={hr:1};h.prototype.isBlockBoundary=function(t){var u=e.extend({},o,t||{});return n[this.getComputedStyle('display')]||u[this.getName()];};d.walker.blockBoundary=function(t){return function(u,v){return!(u.type==1&&u.isBlockBoundary(t));};};d.walker.listItemBoundary=function(){return this.blockBoundary({br:1});};d.walker.bookmarkContents=function(t){},d.walker.bookmark=function(t,u){function v(w){return w&&w.getName&&w.getName()=='span'&&w.hasAttribute('_fck_bookmark');};return function(w){var x,y;x=w&&!w.getName&&(y=w.getParent())&&v(y);x=t?x:x||v(w);return u^x;};};d.walker.whitespaces=function(t){return function(u){var v=u&&u.type==3&&!e.trim(u.getText());return t^v;};};d.walker.invisible=function(t){var u=d.walker.whitespaces();return function(v){var w=u(v)||v.is&&!v.$.offsetHeight;return t^w;};};var p=/^[\t\r\n ]*(?: |\xa0)$/,q=d.walker.whitespaces(true),r=d.walker.bookmark(false,true),s=function(t){return r(t)&&q(t);};h.prototype.getBogus=function(){var t=this.getLast(s);if(t&&(!c?t.is&&t.is('br'):t.getText&&p.test(t.getText())))return t;return false;};})();d.range=function(l){var m=this;m.startContainer=null;m.startOffset=null;m.endContainer=null;m.endOffset=null;m.collapsed=true;m.document=l;};(function(){var l=function(t){t.collapsed=t.startContainer&&t.endContainer&&t.startContainer.equals(t.endContainer)&&t.startOffset==t.endOffset;},m=function(t,u,v){t.optimizeBookmark();var w=t.startContainer,x=t.endContainer,y=t.startOffset,z=t.endOffset,A,B; |
h(a[0],b):null}function Z(){return(new Date).getTime()}function $(a,b){var e=0;b.each(function(){if(this.nodeName===(a[e]&&a[e].nodeName)){var g=d.data(a[e++]),h=d.data(this,g);if(g=g&&g.events){delete h.handle;h.events={};for(var k in g)for(var l in g[k])d.event.add(this,k,g[k][l],g[k][l].data)}}})}function aa(a,b,e){var g,h,k;if(a.length===1&&typeof a[0]==="string"&&a[0].length<512&&a[0].indexOf("<option")<0){h=true;if(k=d.fragments[a[0]])if(k!==1)g=k}if(!g){b=b&&b[0]?b[0].ownerDocument||b[0]:r; | h(a[0],b):null}function Z(){return(new Date).getTime()}function $(a,b){var e=0;b.each(function(){if(this.nodeName===(a[e]&&a[e].nodeName)){var f=c.data(a[e++]),h=c.data(this,f);if(f=f&&f.events){delete h.handle;h.events={};for(var k in f)for(var l in f[k])c.event.add(this,k,f[k][l],f[k][l].data)}}})}function aa(a,b,e){var f,h,k;if(a.length===1&&typeof a[0]==="string"&&a[0].length<512&&a[0].indexOf("<option")<0){h=true;if(k=c.fragments[a[0]])if(k!==1)f=k}if(!f){b=b&&b[0]?b[0].ownerDocument||b[0]:r; | h(a[0],b):null}function Z(){return(new Date).getTime()}function $(a,b){var e=0;b.each(function(){if(this.nodeName===(a[e]&&a[e].nodeName)){var g=d.data(a[e++]),h=d.data(this,g);if(g=g&&g.events){delete h.handle;h.events={};for(var k in g)for(var l in g[k])d.event.add(this,k,g[k][l],g[k][l].data)}}})}function aa(a,b,e){var g,h,k;if(a.length===1&&typeof a[0]==="string"&&a[0].length<512&&a[0].indexOf("<option")<0){h=true;if(k=d.fragments[a[0]])if(k!==1)g=k}if(!g){b=b&&b[0]?b[0].ownerDocument||b[0]:r; |
"<table border=\"1\" cellspacing=\"1\" width=\"100%\" bgcolor=\"#EAF0F8\">"; | '<table border="1" cellspacing="1" width="100%" bgcolor="#EAF0F8">'; | 'addDataTab' : function(values, tabI, label) { //Parse records and build html string var sHtml = ""; if(values.length > 1) { sHtml += '<div style="padding-bottom:10px;" >' + 'Available data sets:' + '</div>' + '<div>' + 'Note: Browsers may not be able to display the following data due to the '+ 'format or large size. It is advisable to download the data before viewing '+ '(right click > Save Target / Link As).' + '</div>' + '<div>' + "<table border=\"1\" cellspacing=\"1\" width=\"100%\" bgcolor=\"#EAF0F8\">"; for (var i = 0; i < values.length; i++) { sHtml += "<tr><td>"; sHtml += "<a href='" + values[i] + "' target='_blank'>"+ values[i] +"</a><br/>"; sHtml += "</tr></td>"; } sHtml += "</table>"; sHtml += '</div>'; this.mask.hide(); } else { sHtml += '<div style="padding-bottom:10px;" >' + 'No DataSets available.' + '</div>' this.mask.hide(); } //Create new tab this.tabsArray[tabI] = new GInfoWindowTab(label, sHtml); //Add new tab to pop-up window this.map.updateInfoWindow(this.tabsArray); this.mask.hide(); } |
'No DataSets available.' + '</div>' | 'No DataSets available.' + '</div>'; | 'addDataTab' : function(values, tabI, label) { //Parse records and build html string var sHtml = ""; if(values.length > 1) { sHtml += '<div style="padding-bottom:10px;" >' + 'Available data sets:' + '</div>' + '<div>' + 'Note: Browsers may not be able to display the following data due to the '+ 'format or large size. It is advisable to download the data before viewing '+ '(right click > Save Target / Link As).' + '</div>' + '<div>' + "<table border=\"1\" cellspacing=\"1\" width=\"100%\" bgcolor=\"#EAF0F8\">"; for (var i = 0; i < values.length; i++) { sHtml += "<tr><td>"; sHtml += "<a href='" + values[i] + "' target='_blank'>"+ values[i] +"</a><br/>"; sHtml += "</tr></td>"; } sHtml += "</table>"; sHtml += '</div>'; this.mask.hide(); } else { sHtml += '<div style="padding-bottom:10px;" >' + 'No DataSets available.' + '</div>' this.mask.hide(); } //Create new tab this.tabsArray[tabI] = new GInfoWindowTab(label, sHtml); //Add new tab to pop-up window this.map.updateInfoWindow(this.tabsArray); this.mask.hide(); } |
R in P&&delete P[Q[S]];}}return O;},embed:function(O){var P=O.parent;if(P&&P.name=='object'){var Q=P.attributes.width,R=P.attributes.height;Q&&(O.attributes.width=Q);R&&(O.attributes.height=R);}},param:function(O){O.children=[];O.isEmpty=true;return O;},a:function(O){if(!(O.children.length||O.attributes.name||O.attributes._cke_saved_name))return false;},body:function(O){delete O.attributes.spellcheck;delete O.attributes.contenteditable;},style:function(O){var P=O.children[0];P&&P.value&&(P.value=e.trim(P.value));if(!O.attributes.type)O.attributes.type='text/css';},title:function(O){O.children[0].value=O.attributes._cke_title;}},attributes:{'class':function(O,P){return e.ltrim(O.replace(/(?:^|\s+)cke_[^\s]*/g,''))||false;}},comment:function(O){if(O.substr(0,m.length)==m){if(O.substr(m.length,3)=='{C}')O=O.substr(m.length+3);else O=O.substr(m.length);return new a.htmlParser.cdata(decodeURIComponent(O));}return O;}},y={elements:{}};for(u in t)y.elements[u]=r;if(c)x.attributes.style=function(O,P){return O.toLowerCase();};var z=/<(?:a|area|img|input)[\s\S]*?\s((?:href|src|name)\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|(?:[^ "'>]+)))/gi,A=/(?:<style(?=[ >])[^>]*>[\s\S]*<\/style>)|(?:<(:?link|meta|base)[^>]*>)/gi,B=/<cke:encoded>([^<]*)<\/cke:encoded>/gi,C=/(<\/?)((?:object|embed|param|html|body|head|title)[^>]*>)/gi,D=/(<\/?)cke:((?:html|body|head|title)[^>]*>)/gi,E=/<cke:(param|embed)([^>]*?)\/?>(?!\s*<\/cke:\1)/gi;function F(O){return O.replace(z,'$& _cke_saved_$1');};function G(O){return O.replace(A,function(P){return '<cke:encoded>'+encodeURIComponent(P)+'</cke:encoded>';});};function H(O){return O.replace(B,function(P,Q){return decodeURIComponent(Q);});};function I(O){return O.replace(C,'$1cke:$2');};function J(O){return O.replace(D,'$1$2');};function K(O){return O.replace(E,'<cke:$1$2></cke:$1>');};function L(O){return O.replace(/<!--(?!{cke_protected})[\s\S]+?-->/g,function(P){return '<!--'+m+'{C}'+encodeURIComponent(P).replace(/--/g,'%2D%2D')+'-->';});};function M(O){return O.replace(/<!--\{cke_protected\}\{C\}([\s\S]+?)-->/g,function(P,Q){return decodeURIComponent(Q);});};function N(O,P){var Q=[],R=/<\!--\{cke_temp(comment)?\}(\d*?)-->/g,S=[/<script[\s\S]*?<\/script>/gi,/<noscript[\s\S]*?<\/noscript>/gi].concat(P);O=O.replace(/<!--[\s\S]*?-->/g,function(U){return '<!--{cke_tempcomment}'+(Q.push(U)-1)+'-->';});for(var T=0;T<S.length;T++)O=O.replace(S[T],function(U){U=U.replace(R,function(V,W,X){return Q[X];});return '<!--{cke_temp}'+(Q.push(U)-1)+'-->';});O=O.replace(R,function(U,V,W){return '<!--'+m+(V?'{C}':'')+encodeURIComponent(Q[W]).replace(/--/g,'%2D%2D')+'-->'; | delete R.attributes.contenteditable;},style:function(R){var S=R.children[0];S&&S.value&&(S.value=e.trim(S.value));if(!R.attributes.type)R.attributes.type='text/css';},title:function(R){var S=R.children[0];S&&(S.value=R.attributes._cke_title||'');}},attributes:{'class':function(R,S){return e.ltrim(R.replace(/(?:^|\s+)cke_[^\s]*/g,''))||false;}},comment:function(R){if(R.substr(0,m.length)==m){if(R.substr(m.length,3)=='{C}')R=R.substr(m.length+3);else R=R.substr(m.length);return new a.htmlParser.cdata(decodeURIComponent(R));}return R;}},y={elements:{}};for(u in t)y.elements[u]=r;if(c)x.attributes.style=function(R,S){return R.toLowerCase();};function z(R){R.attributes.contenteditable='false';};function A(R){delete R.attributes.contenteditable;};for(u in {input:1,textarea:1}){v.elements[u]=z;x.elements[u]=A;}var B=/<((?:a|area|img|input)[\s\S]*?\s)((href|src|name)\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|(?:[^ "'>]+)))([^>]*)>/gi,C=/\s_cke_saved_src\s*=/,D=/(?:<style(?=[ >])[^>]*>[\s\S]*<\/style>)|(?:<(:?link|meta|base)[^>]*>)/gi,E=/<cke:encoded>([^<]*)<\/cke:encoded>/gi,F=/(<\/?)((?:object|embed|param|html|body|head|title)[^>]*>)/gi,G=/(<\/?)cke:((?:html|body|head|title)[^>]*>)/gi,H=/<cke:(param|embed)([^>]*?)\/?>(?!\s*<\/cke:\1)/gi;function I(R){return R.replace(B,function(S,T,U,V,W){if(V=='src'&&C.test(S))return S;else return '<'+T+U+' _cke_saved_'+U+W+'>';});};function J(R){return R.replace(D,function(S){return '<cke:encoded>'+encodeURIComponent(S)+'</cke:encoded>';});};function K(R){return R.replace(E,function(S,T){return decodeURIComponent(T);});};function L(R){return R.replace(F,'$1cke:$2');};function M(R){return R.replace(G,'$1$2');};function N(R){return R.replace(H,'<cke:$1$2></cke:$1>');};function O(R){return R.replace(/<!--(?!{cke_protected})[\s\S]+?-->/g,function(S){return '<!--'+m+'{C}'+encodeURIComponent(S).replace(/--/g,'%2D%2D')+'-->';});};function P(R){return R.replace(/<!--\{cke_protected\}\{C\}([\s\S]+?)-->/g,function(S,T){return decodeURIComponent(T);});};function Q(R,S){var T=[],U=/<\!--\{cke_temp(comment)?\}(\d*?)-->/g,V=[/<script[\s\S]*?<\/script>/gi,/<noscript[\s\S]*?<\/noscript>/gi].concat(S);R=R.replace(/<!--[\s\S]*?-->/g,function(X){return '<!--{cke_tempcomment}'+(T.push(X)-1)+'-->';});for(var W=0;W<V.length;W++)R=R.replace(V[W],function(X){X=X.replace(U,function(Y,Z,aa){return T[aa];});return '<!--{cke_temp}'+(T.push(X)-1)+'-->';});R=R.replace(U,function(X,Y,Z){return '<!--'+m+(Y?'{C}':'')+encodeURIComponent(T[Z]).replace(/--/g,'%2D%2D')+'-->'; | R in P&&delete P[Q[S]];}}return O;},embed:function(O){var P=O.parent;if(P&&P.name=='object'){var Q=P.attributes.width,R=P.attributes.height;Q&&(O.attributes.width=Q);R&&(O.attributes.height=R);}},param:function(O){O.children=[];O.isEmpty=true;return O;},a:function(O){if(!(O.children.length||O.attributes.name||O.attributes._cke_saved_name))return false;},body:function(O){delete O.attributes.spellcheck;delete O.attributes.contenteditable;},style:function(O){var P=O.children[0];P&&P.value&&(P.value=e.trim(P.value));if(!O.attributes.type)O.attributes.type='text/css';},title:function(O){O.children[0].value=O.attributes._cke_title;}},attributes:{'class':function(O,P){return e.ltrim(O.replace(/(?:^|\s+)cke_[^\s]*/g,''))||false;}},comment:function(O){if(O.substr(0,m.length)==m){if(O.substr(m.length,3)=='{C}')O=O.substr(m.length+3);else O=O.substr(m.length);return new a.htmlParser.cdata(decodeURIComponent(O));}return O;}},y={elements:{}};for(u in t)y.elements[u]=r;if(c)x.attributes.style=function(O,P){return O.toLowerCase();};var z=/<(?:a|area|img|input)[\s\S]*?\s((?:href|src|name)\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|(?:[^ "'>]+)))/gi,A=/(?:<style(?=[ >])[^>]*>[\s\S]*<\/style>)|(?:<(:?link|meta|base)[^>]*>)/gi,B=/<cke:encoded>([^<]*)<\/cke:encoded>/gi,C=/(<\/?)((?:object|embed|param|html|body|head|title)[^>]*>)/gi,D=/(<\/?)cke:((?:html|body|head|title)[^>]*>)/gi,E=/<cke:(param|embed)([^>]*?)\/?>(?!\s*<\/cke:\1)/gi;function F(O){return O.replace(z,'$& _cke_saved_$1');};function G(O){return O.replace(A,function(P){return '<cke:encoded>'+encodeURIComponent(P)+'</cke:encoded>';});};function H(O){return O.replace(B,function(P,Q){return decodeURIComponent(Q);});};function I(O){return O.replace(C,'$1cke:$2');};function J(O){return O.replace(D,'$1$2');};function K(O){return O.replace(E,'<cke:$1$2></cke:$1>');};function L(O){return O.replace(/<!--(?!{cke_protected})[\s\S]+?-->/g,function(P){return '<!--'+m+'{C}'+encodeURIComponent(P).replace(/--/g,'%2D%2D')+'-->';});};function M(O){return O.replace(/<!--\{cke_protected\}\{C\}([\s\S]+?)-->/g,function(P,Q){return decodeURIComponent(Q);});};function N(O,P){var Q=[],R=/<\!--\{cke_temp(comment)?\}(\d*?)-->/g,S=[/<script[\s\S]*?<\/script>/gi,/<noscript[\s\S]*?<\/noscript>/gi].concat(P);O=O.replace(/<!--[\s\S]*?-->/g,function(U){return '<!--{cke_tempcomment}'+(Q.push(U)-1)+'-->';});for(var T=0;T<S.length;T++)O=O.replace(S[T],function(U){U=U.replace(R,function(V,W,X){return Q[X];});return '<!--{cke_temp}'+(Q.push(U)-1)+'-->';});O=O.replace(R,function(U,V,W){return '<!--'+m+(V?'{C}':'')+encodeURIComponent(Q[W]).replace(/--/g,'%2D%2D')+'-->'; |
this.deck.getCard().setCorrect(); | if(card) { | 'correct':function() { // Set the card correct flag this.deck.getCard().setCorrect(); // Change style of correct button this.resetButtons(); // Advance to next card this.next(); }, |
this.resetButtons(); | card.setCorrect(); | 'correct':function() { // Set the card correct flag this.deck.getCard().setCorrect(); // Change style of correct button this.resetButtons(); // Advance to next card this.next(); }, |
this.next(); | this.resetButtons(); this.next(); } | 'correct':function() { // Set the card correct flag this.deck.getCard().setCorrect(); // Change style of correct button this.resetButtons(); // Advance to next card this.next(); }, |
this.deck.getCard().setIncorrect(); this.resetButtons(); | if(card) { | 'incorrect':function() { // Set the card incorrect flag this.deck.getCard().setIncorrect(); // Change style of incorrect button this.resetButtons(); // Advance to next card this.next(); }, |
this.next(); | card.setIncorrect(); this.resetButtons(); this.next(); } | 'incorrect':function() { // Set the card incorrect flag this.deck.getCard().setIncorrect(); // Change style of incorrect button this.resetButtons(); // Advance to next card this.next(); }, |
$(document).unbind('keydown', 'space', function(){ DeckViewerUI.showAnswer(); return false; }); | 'next':function() { // Get the next card var success = this.deck.getNextCard(); // Reset the display and show the card if(success) { this.resetButtons(); this.showCard(this.deck.getCard()); } // End of deck, show special div else { this.hideAnswer(); $("div#row_body").hide(); $("div#row_body_mask").show(); } }, |
|
$(document).bind('keydown', 'space', function(){ DeckViewerUI.showAnswer(); return false; }); | 'previous':function() { // Get the previous card this.deck.getPreviousCard(); // If the 'end of deck' div is showing, reset var bodyHidden = ($("div#row_body").css('display') == 'none'); if(bodyHidden) { $("div#row_body").show(); $("div#row_body_mask").hide(); } // Reset the display and show the card this.resetButtons(); this.showCard(this.deck.getCard()); }, |
|
this.Marker.openInfoWindowTabs(this.tabsArray); this.retrieveDatasets(); | var me = this; this.Marker.openInfoWindowTabs(this.tabsArray, { onOpenFn:function(){ me.retrieveDatasets(); } }); | 'show': function() { //Open our window with the basic info displayed this.tabsArray[0] = new GInfoWindowTab(this.TAB_1, this.summaryHtml); this.Marker.openInfoWindowTabs(this.tabsArray); //And update it with the downloaded data as it arrives this.retrieveDatasets(); }, |
var sHtml = "<div style=\"padding-bottom:30px;white-space:pre-wrap;white-space:-moz-pre-wrap;" + "white-space:-pre-wrap;white-space:-o-pre-wrap;word-wrap:break-word;" + "width:99%;max-height:300px;overflow:auto;\">" + "<table border=\"1\" cellspacing=\"1\" width=\"100%\" bgcolor=\"#EAF0F8\">" + "<tr><td>" + this.cswRecord.getServiceName() + "</td></tr>" + "<tr><td>" + this.cswRecord.getDataIdentificationAbstract(); + "</td></tr>"; | var sHtml = '<div style="padding-bottom:30px;white-space:pre-wrap;white-space:-moz-pre-wrap;' + 'white-space:-pre-wrap;white-space:-o-pre-wrap;word-wrap:break-word;' + 'width:99%;max-height:300px;overflow:auto;">' + '<table border="1" cellspacing="1" width="100%" bgcolor="#EAF0F8">' + '<tr><td>' + this.cswRecord.getServiceName() + '</td></tr>' + '<tr><td>' + this.cswRecord.getDataIdentificationAbstract() + '</td></tr>'; | 'show': function() { var sHtml = "<div style=\"padding-bottom:30px;white-space:pre-wrap;white-space:-moz-pre-wrap;" + "white-space:-pre-wrap;white-space:-o-pre-wrap;word-wrap:break-word;" + "width:99%;max-height:300px;overflow:auto;\">" + "<table border=\"1\" cellspacing=\"1\" width=\"100%\" bgcolor=\"#EAF0F8\">" + "<tr><td>" + this.cswRecord.getServiceName() + "</td></tr>" + "<tr><td>" + this.cswRecord.getDataIdentificationAbstract(); + "</td></tr>"; var wwwLinks = this.cswRecord.getFilteredOnlineResources('WWW'); for(var i=0; i< wwwLinks.length; i++) { var linkName = wwwLinks[i].name != null && wwwLinks[i].name != "" ? wwwLinks[i].name : wwwLinks[i].url; sHtml += "<tr><td>" + "<a href='" + wwwLinks[i].url + "' target='_blank'>" + linkName + "</a>" + "</td></tr>"; } sHtml += "</table>" + "</div>"; if (this.overlay instanceof GPolygon) { this.map.openInfoWindowHtml(this.overlay.getBounds().getCenter(), sHtml, {maxWidth:800, maxHeight:400, autoScroll:true}); } else if (this.overlay instanceof GMarker) { this.map.openInfoWindowHtml(this.overlay.getPoint(), sHtml, {maxWidth:800, maxHeight:400, autoScroll:true}); } } |
var linkName = wwwLinks[i].name != null && wwwLinks[i].name != "" ? wwwLinks[i].name : wwwLinks[i].url; sHtml += "<tr><td>" + "<a href='" + wwwLinks[i].url + "' target='_blank'>" + linkName + "</a>" + "</td></tr>"; | var linkName = wwwLinks[i].name !== null && wwwLinks[i].name !== "" ? wwwLinks[i].name : wwwLinks[i].url; sHtml += "<tr><td>" + "<a href='" + wwwLinks[i].url + "' target='_blank'>" + linkName + "</a>" + "</td></tr>"; | 'show': function() { var sHtml = "<div style=\"padding-bottom:30px;white-space:pre-wrap;white-space:-moz-pre-wrap;" + "white-space:-pre-wrap;white-space:-o-pre-wrap;word-wrap:break-word;" + "width:99%;max-height:300px;overflow:auto;\">" + "<table border=\"1\" cellspacing=\"1\" width=\"100%\" bgcolor=\"#EAF0F8\">" + "<tr><td>" + this.cswRecord.getServiceName() + "</td></tr>" + "<tr><td>" + this.cswRecord.getDataIdentificationAbstract(); + "</td></tr>"; var wwwLinks = this.cswRecord.getFilteredOnlineResources('WWW'); for(var i=0; i< wwwLinks.length; i++) { var linkName = wwwLinks[i].name != null && wwwLinks[i].name != "" ? wwwLinks[i].name : wwwLinks[i].url; sHtml += "<tr><td>" + "<a href='" + wwwLinks[i].url + "' target='_blank'>" + linkName + "</a>" + "</td></tr>"; } sHtml += "</table>" + "</div>"; if (this.overlay instanceof GPolygon) { this.map.openInfoWindowHtml(this.overlay.getBounds().getCenter(), sHtml, {maxWidth:800, maxHeight:400, autoScroll:true}); } else if (this.overlay instanceof GMarker) { this.map.openInfoWindowHtml(this.overlay.getPoint(), sHtml, {maxWidth:800, maxHeight:400, autoScroll:true}); } } |
sHtml += "</table>" + "</div>"; | sHtml += "</table></div>"; | 'show': function() { var sHtml = "<div style=\"padding-bottom:30px;white-space:pre-wrap;white-space:-moz-pre-wrap;" + "white-space:-pre-wrap;white-space:-o-pre-wrap;word-wrap:break-word;" + "width:99%;max-height:300px;overflow:auto;\">" + "<table border=\"1\" cellspacing=\"1\" width=\"100%\" bgcolor=\"#EAF0F8\">" + "<tr><td>" + this.cswRecord.getServiceName() + "</td></tr>" + "<tr><td>" + this.cswRecord.getDataIdentificationAbstract(); + "</td></tr>"; var wwwLinks = this.cswRecord.getFilteredOnlineResources('WWW'); for(var i=0; i< wwwLinks.length; i++) { var linkName = wwwLinks[i].name != null && wwwLinks[i].name != "" ? wwwLinks[i].name : wwwLinks[i].url; sHtml += "<tr><td>" + "<a href='" + wwwLinks[i].url + "' target='_blank'>" + linkName + "</a>" + "</td></tr>"; } sHtml += "</table>" + "</div>"; if (this.overlay instanceof GPolygon) { this.map.openInfoWindowHtml(this.overlay.getBounds().getCenter(), sHtml, {maxWidth:800, maxHeight:400, autoScroll:true}); } else if (this.overlay instanceof GMarker) { this.map.openInfoWindowHtml(this.overlay.getPoint(), sHtml, {maxWidth:800, maxHeight:400, autoScroll:true}); } } |
"overflow:auto;\">" | "width:99%;overflow:auto;\">" | 'show': function() { //Open our window with the basic info displayed this.tabsArray[0] = new GInfoWindowTab(this.TAB_1, "<table border=\"1\" cellspacing=\"1\" width=\"100%\" bgcolor=\"#EAF0F8\">" +"<tr><td><pre style=\"white-space:pre-wrap;white-space:-moz-pre-wrap;" + "white-space:-pre-wrap;white-space:-o-pre-wrap;word-wrap:break-word;" + "overflow:auto;\">" + this.description + "</pre></td></tr>" +"</table>"); //The following initialisation is required as the tabs later added asynchronously //may end up being added in the wrong order (2 before 1 exists) resulting in errors //such as: contextElem is null or not an object. this.tabsArray[1] = new GInfoWindowTab(this.TAB_2, ""); this.tabsArray[2] = new GInfoWindowTab(this.TAB_3, ""); this.map.openInfoWindowTabs(this.latlng, this.tabsArray, {maxWidth:800, maxHeight:500, autoScroll:true}); //And update it with the downloaded data as it arrives this.retrieveDatasets(); }, |
+"</table>"); | +"</table>" + "</div>"); | 'show': function() { //Open our window with the basic info displayed this.tabsArray[0] = new GInfoWindowTab(this.TAB_1, "<table border=\"1\" cellspacing=\"1\" width=\"100%\" bgcolor=\"#EAF0F8\">" +"<tr><td><pre style=\"white-space:pre-wrap;white-space:-moz-pre-wrap;" + "white-space:-pre-wrap;white-space:-o-pre-wrap;word-wrap:break-word;" + "overflow:auto;\">" + this.description + "</pre></td></tr>" +"</table>"); //The following initialisation is required as the tabs later added asynchronously //may end up being added in the wrong order (2 before 1 exists) resulting in errors //such as: contextElem is null or not an object. this.tabsArray[1] = new GInfoWindowTab(this.TAB_2, ""); this.tabsArray[2] = new GInfoWindowTab(this.TAB_3, ""); this.map.openInfoWindowTabs(this.latlng, this.tabsArray, {maxWidth:800, maxHeight:500, autoScroll:true}); //And update it with the downloaded data as it arrives this.retrieveDatasets(); }, |
{maxWidth:800, maxHeight:500, autoScroll:true}); this.retrieveDatasets(); | {maxWidth:800, maxHeight:300, autoScroll:true, onOpenFn:function(){ me.retrieveDatasets(); }}); | 'show': function() { //Open our window with the basic info displayed this.tabsArray[0] = new GInfoWindowTab(this.TAB_1, "<table border=\"1\" cellspacing=\"1\" width=\"100%\" bgcolor=\"#EAF0F8\">" +"<tr><td><pre style=\"white-space:pre-wrap;white-space:-moz-pre-wrap;" + "white-space:-pre-wrap;white-space:-o-pre-wrap;word-wrap:break-word;" + "overflow:auto;\">" + this.description + "</pre></td></tr>" +"</table>"); //The following initialisation is required as the tabs later added asynchronously //may end up being added in the wrong order (2 before 1 exists) resulting in errors //such as: contextElem is null or not an object. this.tabsArray[1] = new GInfoWindowTab(this.TAB_2, ""); this.tabsArray[2] = new GInfoWindowTab(this.TAB_3, ""); this.map.openInfoWindowTabs(this.latlng, this.tabsArray, {maxWidth:800, maxHeight:500, autoScroll:true}); //And update it with the downloaded data as it arrives this.retrieveDatasets(); }, |
if($("input#show_ans_chk").is(':checked')) { | var chkbox = $("input#show_ans_chk"); if(chkbox.is(':checked')) { | 'showAnswerToggle':function() { if($("input#show_ans_chk").is(':checked')) { this.isShowingAnswer = 1; this.showAnswer(); } else { this.isShowingAnswer = 0; this.hideAnswer(); } } |
} else { this.showAnswer(); | 'showCard':function(card) { if(!card) { //alert("Null card in DeckViewerUI.showCard"); return; } // Hide answer field if showAnswer bit set false if(!this.isShowingAnswer) { this.hideAnswer(); } // Set rating field if(this.rts) { // Pass to RatingSelector this.rts.setCard(card); } else { // TODO: Display rating somewhere in Quiz mode when there is no RTS? //var eltStr = "<div class=\"rating_str\">" + card.getRatingStr() + "</div>"; //$("#card_rating").html(eltStr); } // Set question field //$("#card_question").text(card.question); $("#card_question").html(card.question); // Set answer field //$("#card_answer").text(card.answer); $("#card_answer").html(card.answer); // Update deck progress var progressStr = this.deck.getNumViewed() + "/" + this.deck.getNumCards(); $("#deck_progress").text(progressStr); // Update card metrics var totalAns = parseInt(card.totalCorrect) + parseInt(card.totalIncorrect); var percentCorrect = (totalAns > 0) ? Math.round((card.totalCorrect/totalAns)*100) : null; var quizHistoryStr = ""; if(percentCorrect != null) { quizHistoryStr += percentCorrect + "% "; } quizHistoryStr += "(" + card.totalCorrect + "/" + totalAns + ")"; var lastAnswerStr = VERACITY_MAP[card.lastAnswer]; $("span#ans_corr").text(quizHistoryStr); $("span#last_ans").text(lastAnswerStr); }, |
|
var newRating = (this.deck.getCard().rating + 1)%RATING_MAP.length; | var rating = this.deck.getCard().rating; var newRating = rating+1; if(newRating > 3) { newRating = 1; } | 'toggleRating':function() { // Get new rating var newRating = (this.deck.getCard().rating + 1)%RATING_MAP.length; this.deck.getCard().setRating(newRating); // Display new rating var ratingStr = RATING_MAP[this.deck.getCard().rating]; $("#card_rating").text(ratingStr); }, |
var ratingStr = RATING_MAP[this.deck.getCard().rating]; | var ratingStr = RATING_MAP[tmp]; | 'toggleRating':function() { // Get new rating var newRating = (this.deck.getCard().rating + 1)%RATING_MAP.length; this.deck.getCard().setRating(newRating); // Display new rating var ratingStr = RATING_MAP[this.deck.getCard().rating]; $("#card_rating").text(ratingStr); }, |
} | self.seekTo(0, 0); } | (function($) { // static constructs $.tools = $.tools || {version: '@VERSION'}; $.tools.scrollable = { conf: { activeClass: 'active', circular: false, clonedClass: 'cloned', disabledClass: 'disabled', easing: 'swing', initialIndex: 0, item: null, items: '.items', keyboard: true, mousewheel: false, next: '.next', prev: '.prev', speed: 400, vertical: false, wheelSpeed: 0 } }; // get hidden element's width or height even though it's hidden function dim(el, key) { var v = parseInt(el.css(key), 10); if (v) { return v; } var s = el[0].currentStyle; return s && s.width && parseInt(s.width, 10); } function find(root, query) { var el = $(query); return el.length < 2 ? el : root.parent().find(query); } var current; // constructor function Scrollable(root, conf) { // current instance var self = this, fire = root.add(self), itemWrap = root.children(), index = 0, forward, vertical = conf.vertical; if (!current) { current = self; } if (itemWrap.length > 1) { itemWrap = $(conf.items, root); } // methods $.extend(self, { getConf: function() { return conf; }, getIndex: function() { return index; }, getSize: function() { return self.getItems().size(); }, getNaviButtons: function() { return prev.add(next); }, getRoot: function() { return root; }, getItemWrap: function() { return itemWrap; }, getItems: function() { return itemWrap.children(conf.item).not("." + conf.clonedClass); }, move: function(offset, time) { return self.seekTo(index + offset, time); }, next: function(time) { return self.move(1, time); }, prev: function(time) { return self.move(-1, time); }, begin: function(time) { return self.seekTo(0, time); }, end: function(time) { return self.seekTo(self.getSize() -1, time); }, focus: function() { current = self; return self; }, addItem: function(item) { item = $(item); if (!conf.circular) { itemWrap.append(item); } else { $(".cloned:last").before(item); $(".cloned:first").replaceWith(item.clone().addClass(conf.clonedClass)); } fire.trigger("onAddItem", [item]); return self; }, /* all seeking functions depend on this */ seekTo: function(i, time, fn) { // check that index is sane if (!conf.circular && i < 0 || i > self.getSize()) { return self; } var item = i; if (i.jquery) { i = self.getItems().index(i); } else { item = self.getItems().eq(i); } // onBeforeSeek var e = $.Event("onBeforeSeek"); if (!fn) { fire.trigger(e, [i, time]); if (e.isDefaultPrevented() || !item.length) { return self; } } var props = vertical ? {top: -item.position().top} : {left: -item.position().left}; itemWrap.animate(props, time, conf.easing, fn || function() { fire.trigger("onSeek", [i]); }); current = self; index = i; return self; } }); // callbacks $.each(['onBeforeSeek', 'onSeek', 'onAddItem'], function(i, name) { // configuration if ($.isFunction(conf[name])) { $(self).bind(name, conf[name]); } self[name] = function(fn) { $(self).bind(name, fn); return self; }; }); // circular loop if (conf.circular) { var cloned1 = self.getItems().slice(-1).clone().prependTo(itemWrap), cloned2 = self.getItems().eq(1).clone().appendTo(itemWrap); cloned1.add(cloned2).addClass(conf.clonedClass); self.onBeforeSeek(function(e, i, time) { if (e.isDefaultPrevented()) { return; } /* 1. animate to the clone without event triggering 2. seek to correct position with 0 speed */ if (i == -1) { self.seekTo(cloned1, time, function() { self.end(0); }); return e.preventDefault(); } else if (i == self.getSize()) { self.seekTo(cloned2, time, function() { self.begin(0); }); } }); } // next/prev buttons var prev = find(root, conf.prev).click(function() { self.prev(); }), next = find(root, conf.next).click(function() { self.next(); }); if (!conf.circular && self.getSize() > 2) { self.onBeforeSeek(function(e, i) { prev.toggleClass(conf.disabledClass, i <= 0); next.toggleClass(conf.disabledClass, i >= self.getSize() -1); }); } // mousewheel support if (conf.mousewheel && $.fn.mousewheel) { root.mousewheel(function(e, delta) { if (conf.mousewheel) { self.move(delta < 0 ? 1 : -1, conf.wheelSpeed || 50); return false; } }); } if (conf.keyboard) { $(document).bind("keydown.scrollable", function(evt) { // skip certain conditions if (!conf.keyboard || evt.altKey || evt.ctrlKey || $(evt.target).is(":input")) { return; } // does this instance have focus? if (conf.keyboard != 'static' && current != self) { return; } var key = evt.keyCode; if (vertical && (key == 38 || key == 40)) { self.move(key == 38 ? -1 : 1); return evt.preventDefault(); } if (!vertical && (key == 37 || key == 39)) { self.move(key == 37 ? -1 : 1); return evt.preventDefault(); } }); } // initial index $(self).trigger("onBeforeSeek", [conf.initialIndex]); } // jQuery plugin implementation $.fn.scrollable = function(conf) { // already constructed --> return API var el = this.data("scrollable"); if (el) { return el; } conf = $.extend({}, $.tools.scrollable.conf, conf); this.each(function() { el = new Scrollable($(this), conf); $(this).data("scrollable", el); }); return conf.api ? el: this; }; })(jQuery); |
function Slideshow(root, conf, len) { | function Slideshow(root, conf) { | (function($) { var tool; tool = $.tools.tabs.slideshow = { conf: { next: '.forward', prev: '.backward', disabledClass: 'disabled', autoplay: false, autopause: true, interval: 3000, clickable: true, api: false } }; function Slideshow(root, conf, len) { var self = this, fire = root.add(this), tabs = root.data("tabs"), timer, hoverTimer, startTimer, stopped = false; // next / prev buttons function find(query) { return len == 1 ? $(query) : root.parent().find(query); } var nextButton = find(conf.next).click(function() { tabs.next(); }); var prevButton = find(conf.prev).click(function() { tabs.prev(); }); // extend the Tabs API with slideshow methods $.extend(self, { // return tabs API getTabs: function() { return tabs; }, getConf: function() { return conf; }, play: function() { // do not start additional timer if already exists if (timer) { return; } // onBeforePlay var e = $.Event("onBeforePlay"); fire.trigger(e); if (e.isDefaultPrevented()) { return self; } stopped = false; // construct new timer timer = setInterval(tabs.next, conf.interval); // onPlay fire.trigger("onPlay"); tabs.next(); }, pause: function() { if (!timer) { return self; } // onBeforePause var e = $.Event("onBeforePause"); fire.trigger(e); if (e.isDefaultPrevented()) { return self; } timer = clearInterval(timer); startTimer = clearInterval(startTimer); // onPause fire.trigger("onPause"); }, // when stopped - mouseover won't restart stop: function() { self.pause(); stopped = true; } }); // callbacks $.each("onBeforePlay,onPlay,onBeforePause,onPause".split(","), function(i, name) { // configuration if ($.isFunction(conf[name])) { self.bind(name, conf[name]); } // API methods self[name] = function(fn) { return self.bind(name, fn); }; }); /* when mouse enters, slideshow stops */ if (conf.autopause) { var els = tabs.getTabs().add(nextButton).add(prevButton).add(tabs.getPanes()); els.hover(function() { self.pause(); hoverTimer = clearInterval(hoverTimer); }, function() { if (!stopped) { hoverTimer = setTimeout(self.play, conf.interval); } }); } if (conf.autoplay) { startTimer = setTimeout(self.play, conf.interval); } else { self.stop(); } if (conf.clickable) { tabs.getPanes().click(function() { tabs.next(); }); } // manage disabling of next/prev buttons if (!tabs.getConf().rotate) { var cls = conf.disabledClass; if (!tabs.getIndex()) { prevButton.addClass(cls); } tabs.onBeforeClick(function(e, i) { if (!i) { prevButton.addClass(cls); } else { prevButton.removeClass(cls); if (i == tabs.getTabs().length -1) { nextButton.addClass(cls); } else { nextButton.removeClass(cls); } } }); } } // jQuery plugin implementation $.fn.slideshow = function(conf) { // return existing instance var el = this.data("slideshow"), len = this.length; if (el) { return el; } conf = $.extend({}, tool.conf, conf); this.each(function() { el = new Slideshow($(this), conf, len); $(this).data("slideshow", el); }); return conf.api ? el : this; }; })(jQuery); |
return len == 1 ? $(query) : root.parent().find(query); | var el = $(query); return el.length < 2 ? el : root.parent().find(query); | (function($) { var tool; tool = $.tools.tabs.slideshow = { conf: { next: '.forward', prev: '.backward', disabledClass: 'disabled', autoplay: false, autopause: true, interval: 3000, clickable: true, api: false } }; function Slideshow(root, conf, len) { var self = this, fire = root.add(this), tabs = root.data("tabs"), timer, hoverTimer, startTimer, stopped = false; // next / prev buttons function find(query) { return len == 1 ? $(query) : root.parent().find(query); } var nextButton = find(conf.next).click(function() { tabs.next(); }); var prevButton = find(conf.prev).click(function() { tabs.prev(); }); // extend the Tabs API with slideshow methods $.extend(self, { // return tabs API getTabs: function() { return tabs; }, getConf: function() { return conf; }, play: function() { // do not start additional timer if already exists if (timer) { return; } // onBeforePlay var e = $.Event("onBeforePlay"); fire.trigger(e); if (e.isDefaultPrevented()) { return self; } stopped = false; // construct new timer timer = setInterval(tabs.next, conf.interval); // onPlay fire.trigger("onPlay"); tabs.next(); }, pause: function() { if (!timer) { return self; } // onBeforePause var e = $.Event("onBeforePause"); fire.trigger(e); if (e.isDefaultPrevented()) { return self; } timer = clearInterval(timer); startTimer = clearInterval(startTimer); // onPause fire.trigger("onPause"); }, // when stopped - mouseover won't restart stop: function() { self.pause(); stopped = true; } }); // callbacks $.each("onBeforePlay,onPlay,onBeforePause,onPause".split(","), function(i, name) { // configuration if ($.isFunction(conf[name])) { self.bind(name, conf[name]); } // API methods self[name] = function(fn) { return self.bind(name, fn); }; }); /* when mouse enters, slideshow stops */ if (conf.autopause) { var els = tabs.getTabs().add(nextButton).add(prevButton).add(tabs.getPanes()); els.hover(function() { self.pause(); hoverTimer = clearInterval(hoverTimer); }, function() { if (!stopped) { hoverTimer = setTimeout(self.play, conf.interval); } }); } if (conf.autoplay) { startTimer = setTimeout(self.play, conf.interval); } else { self.stop(); } if (conf.clickable) { tabs.getPanes().click(function() { tabs.next(); }); } // manage disabling of next/prev buttons if (!tabs.getConf().rotate) { var cls = conf.disabledClass; if (!tabs.getIndex()) { prevButton.addClass(cls); } tabs.onBeforeClick(function(e, i) { if (!i) { prevButton.addClass(cls); } else { prevButton.removeClass(cls); if (i == tabs.getTabs().length -1) { nextButton.addClass(cls); } else { nextButton.removeClass(cls); } } }); } } // jQuery plugin implementation $.fn.slideshow = function(conf) { // return existing instance var el = this.data("slideshow"), len = this.length; if (el) { return el; } conf = $.extend({}, tool.conf, conf); this.each(function() { el = new Slideshow($(this), conf, len); $(this).data("slideshow", el); }); return conf.api ? el : this; }; })(jQuery); |
var el = this.data("slideshow"), len = this.length; | var el = this.data("slideshow"); | (function($) { var tool; tool = $.tools.tabs.slideshow = { conf: { next: '.forward', prev: '.backward', disabledClass: 'disabled', autoplay: false, autopause: true, interval: 3000, clickable: true, api: false } }; function Slideshow(root, conf, len) { var self = this, fire = root.add(this), tabs = root.data("tabs"), timer, hoverTimer, startTimer, stopped = false; // next / prev buttons function find(query) { return len == 1 ? $(query) : root.parent().find(query); } var nextButton = find(conf.next).click(function() { tabs.next(); }); var prevButton = find(conf.prev).click(function() { tabs.prev(); }); // extend the Tabs API with slideshow methods $.extend(self, { // return tabs API getTabs: function() { return tabs; }, getConf: function() { return conf; }, play: function() { // do not start additional timer if already exists if (timer) { return; } // onBeforePlay var e = $.Event("onBeforePlay"); fire.trigger(e); if (e.isDefaultPrevented()) { return self; } stopped = false; // construct new timer timer = setInterval(tabs.next, conf.interval); // onPlay fire.trigger("onPlay"); tabs.next(); }, pause: function() { if (!timer) { return self; } // onBeforePause var e = $.Event("onBeforePause"); fire.trigger(e); if (e.isDefaultPrevented()) { return self; } timer = clearInterval(timer); startTimer = clearInterval(startTimer); // onPause fire.trigger("onPause"); }, // when stopped - mouseover won't restart stop: function() { self.pause(); stopped = true; } }); // callbacks $.each("onBeforePlay,onPlay,onBeforePause,onPause".split(","), function(i, name) { // configuration if ($.isFunction(conf[name])) { self.bind(name, conf[name]); } // API methods self[name] = function(fn) { return self.bind(name, fn); }; }); /* when mouse enters, slideshow stops */ if (conf.autopause) { var els = tabs.getTabs().add(nextButton).add(prevButton).add(tabs.getPanes()); els.hover(function() { self.pause(); hoverTimer = clearInterval(hoverTimer); }, function() { if (!stopped) { hoverTimer = setTimeout(self.play, conf.interval); } }); } if (conf.autoplay) { startTimer = setTimeout(self.play, conf.interval); } else { self.stop(); } if (conf.clickable) { tabs.getPanes().click(function() { tabs.next(); }); } // manage disabling of next/prev buttons if (!tabs.getConf().rotate) { var cls = conf.disabledClass; if (!tabs.getIndex()) { prevButton.addClass(cls); } tabs.onBeforeClick(function(e, i) { if (!i) { prevButton.addClass(cls); } else { prevButton.removeClass(cls); if (i == tabs.getTabs().length -1) { nextButton.addClass(cls); } else { nextButton.removeClass(cls); } } }); } } // jQuery plugin implementation $.fn.slideshow = function(conf) { // return existing instance var el = this.data("slideshow"), len = this.length; if (el) { return el; } conf = $.extend({}, tool.conf, conf); this.each(function() { el = new Slideshow($(this), conf, len); $(this).data("slideshow", el); }); return conf.api ? el : this; }; })(jQuery); |
el = new Slideshow($(this), conf, len); | el = new Slideshow($(this), conf); | (function($) { var tool; tool = $.tools.tabs.slideshow = { conf: { next: '.forward', prev: '.backward', disabledClass: 'disabled', autoplay: false, autopause: true, interval: 3000, clickable: true, api: false } }; function Slideshow(root, conf, len) { var self = this, fire = root.add(this), tabs = root.data("tabs"), timer, hoverTimer, startTimer, stopped = false; // next / prev buttons function find(query) { return len == 1 ? $(query) : root.parent().find(query); } var nextButton = find(conf.next).click(function() { tabs.next(); }); var prevButton = find(conf.prev).click(function() { tabs.prev(); }); // extend the Tabs API with slideshow methods $.extend(self, { // return tabs API getTabs: function() { return tabs; }, getConf: function() { return conf; }, play: function() { // do not start additional timer if already exists if (timer) { return; } // onBeforePlay var e = $.Event("onBeforePlay"); fire.trigger(e); if (e.isDefaultPrevented()) { return self; } stopped = false; // construct new timer timer = setInterval(tabs.next, conf.interval); // onPlay fire.trigger("onPlay"); tabs.next(); }, pause: function() { if (!timer) { return self; } // onBeforePause var e = $.Event("onBeforePause"); fire.trigger(e); if (e.isDefaultPrevented()) { return self; } timer = clearInterval(timer); startTimer = clearInterval(startTimer); // onPause fire.trigger("onPause"); }, // when stopped - mouseover won't restart stop: function() { self.pause(); stopped = true; } }); // callbacks $.each("onBeforePlay,onPlay,onBeforePause,onPause".split(","), function(i, name) { // configuration if ($.isFunction(conf[name])) { self.bind(name, conf[name]); } // API methods self[name] = function(fn) { return self.bind(name, fn); }; }); /* when mouse enters, slideshow stops */ if (conf.autopause) { var els = tabs.getTabs().add(nextButton).add(prevButton).add(tabs.getPanes()); els.hover(function() { self.pause(); hoverTimer = clearInterval(hoverTimer); }, function() { if (!stopped) { hoverTimer = setTimeout(self.play, conf.interval); } }); } if (conf.autoplay) { startTimer = setTimeout(self.play, conf.interval); } else { self.stop(); } if (conf.clickable) { tabs.getPanes().click(function() { tabs.next(); }); } // manage disabling of next/prev buttons if (!tabs.getConf().rotate) { var cls = conf.disabledClass; if (!tabs.getIndex()) { prevButton.addClass(cls); } tabs.onBeforeClick(function(e, i) { if (!i) { prevButton.addClass(cls); } else { prevButton.removeClass(cls); if (i == tabs.getTabs().length -1) { nextButton.addClass(cls); } else { nextButton.removeClass(cls); } } }); } } // jQuery plugin implementation $.fn.slideshow = function(conf) { // return existing instance var el = this.data("slideshow"), len = this.length; if (el) { return el; } conf = $.extend({}, tool.conf, conf); this.each(function() { el = new Slideshow($(this), conf, len); $(this).data("slideshow", el); }); return conf.api ? el : this; }; })(jQuery); |
(function(c){var d=[];c.tools=c.tools||{};c.tools.tooltip={version:"1.1.3",conf:{effect:"toggle",fadeOutSpeed:"fast",tip:null,predelay:0,delay:30,opacity:1,lazy:undefined,position:["top","center"],offset:[0,0],cancelDefault:true,relative:false,oneInstance:true,events:{def:"mouseover,mouseout",input:"focus,blur",widget:"focus mouseover,blur mouseout",tooltip:"mouseover,mouseout"},api:false},addEffect:function(e,g,f){b[e]=[g,f]}};var b={toggle:[function(e){var f=this.getConf(),g=this.getTip(),h=f.opacity;if(h<1){g.css({opacity:h})}g.show();e.call()},function(e){this.getTip().hide();e.call()}],fade:[function(e){this.getTip().fadeIn(this.getConf().fadeInSpeed,e)},function(e){this.getTip().fadeOut(this.getConf().fadeOutSpeed,e)}]};function a(f,g){var p=this,k=c(this);f.data("tooltip",p);var l=f.next();if(g.tip){l=c(g.tip);if(l.length>1){l=f.nextAll(g.tip).eq(0);if(!l.length){l=f.parent().nextAll(g.tip).eq(0)}}}function o(u){var t=g.relative?f.position().top:f.offset().top,s=g.relative?f.position().left:f.offset().left,v=g.position[0];t-=l.outerHeight()-g.offset[0];s+=f.outerWidth()+g.offset[1];var q=l.outerHeight()+f.outerHeight();if(v=="center"){t+=q/2}if(v=="bottom"){t+=q}v=g.position[1];var r=l.outerWidth()+f.outerWidth();if(v=="center"){s-=r/2}if(v=="left"){s-=r}return{top:t,left:s}}var i=f.is(":input"),e=i&&f.is(":checkbox, :radio, select, :button"),h=f.attr("type"),n=g.events[h]||g.events[i?(e?"widget":"input"):"def"];n=n.split(/,\s*/);if(n.length!=2){throw"Tooltip: bad events configuration for "+h}f.bind(n[0],function(r){if(g.oneInstance){c.each(d,function(){this.hide()})}var q=l.data("trigger");if(q&&q[0]!=this){l.hide().stop(true,true)}r.target=this;p.show(r);n=g.events.tooltip.split(/,\s*/);l.bind(n[0],function(){p.show(r)});if(n[1]){l.bind(n[1],function(){p.hide(r)})}});f.bind(n[1],function(q){p.hide(q)});if(!c.browser.msie&&!i&&!g.predelay){f.mousemove(function(){if(!p.isShown()){f.triggerHandler("mouseover")}})}if(g.opacity<1){l.css("opacity",g.opacity)}var m=0,j=f.attr("title");if(j&&g.cancelDefault){f.removeAttr("title");f.data("title",j)}c.extend(p,{show:function(r){if(r){f=c(r.target)}clearTimeout(l.data("timer"));if(l.is(":animated")||l.is(":visible")){return p}function q(){l.data("trigger",f);var t=o(r);if(g.tip&&j){l.html(f.data("title"))}r=r||c.Event();r.type="onBeforeShow";k.trigger(r,[t]);if(r.isDefaultPrevented()){return p}t=o(r);l.css({position:"absolute",top:t.top,left:t.left});var s=b[g.effect];if(!s){throw'Nonexistent effect "'+g.effect+'"'}s[0].call(p,function(){r.type="onShow";k.trigger(r)})}if(g.predelay){clearTimeout(m);m=setTimeout(q,g.predelay)}else{q()}return p},hide:function(r){clearTimeout(l.data("timer"));clearTimeout(m);if(!l.is(":visible")){return}function q(){r=r||c.Event();r.type="onBeforeHide";k.trigger(r);if(r.isDefaultPrevented()){return}b[g.effect][1].call(p,function(){r.type="onHide";k.trigger(r)})}if(g.delay&&r){l.data("timer",setTimeout(q,g.delay))}else{q()}return p},isShown:function(){return l.is(":visible, :animated")},getConf:function(){return g},getTip:function(){return l},getTrigger:function(){return f},bind:function(q,r){k.bind(q,r);return p},onHide:function(q){return this.bind("onHide",q)},onBeforeShow:function(q){return this.bind("onBeforeShow",q)},onShow:function(q){return this.bind("onShow",q)},onBeforeHide:function(q){return this.bind("onBeforeHide",q)},unbind:function(q){k.unbind(q);return p}});c.each(g,function(q,r){if(c.isFunction(r)){p.bind(q,r)}})}c.prototype.tooltip=function(e){var f=this.eq(typeof e=="number"?e:0).data("tooltip");if(f){return f}var g=c.extend(true,{},c.tools.tooltip.conf);if(c.isFunction(e)){e={onBeforeShow:e}}else{if(typeof e=="string"){e={tip:e}}}e=c.extend(true,g,e);if(typeof e.position=="string"){e.position=e.position.split(/,?\s/)}if(e.lazy!==false&&(e.lazy===true||this.length>20)){this.one("mouseover",function(h){f=new a(c(this),e);f.show(h);d.push(f)})}else{this.each(function(){f=new a(c(this),e);d.push(f)})}return e.api?f:this}})(jQuery); | (function(f){function p(a,b,c){var h=c.relative?a.position().top:a.offset().top,d=c.relative?a.position().left:a.offset().left,i=c.position[0];h-=b.outerHeight()-c.offset[0];d+=a.outerWidth()+c.offset[1];if(/iPad/i.test(navigator.userAgent))h-=f(window).scrollTop();var j=b.outerHeight()+a.outerHeight();if(i=="center")h+=j/2;if(i=="bottom")h+=j;i=c.position[1];a=b.outerWidth()+a.outerWidth();if(i=="center")d-=a/2;if(i=="left")d-=a;return{top:h,left:d}}function u(a,b){var c=this,h=a.add(c),d,i=0,j= 0,m=a.attr("title"),q=a.attr("data-tooltip"),r=o[b.effect],l,s=a.is(":input"),v=s&&a.is(":checkbox, :radio, select, :button, :submit"),t=a.attr("type"),k=b.events[t]||b.events[s?v?"widget":"input":"def"];if(!r)throw'Nonexistent effect "'+b.effect+'"';k=k.split(/,\s*/);if(k.length!=2)throw"Tooltip: bad events configuration for "+t;a.bind(k[0],function(e){clearTimeout(i);if(b.predelay)j=setTimeout(function(){c.show(e)},b.predelay);else c.show(e)}).bind(k[1],function(e){clearTimeout(j);if(b.delay)i= setTimeout(function(){c.hide(e)},b.delay);else c.hide(e)});if(m&&b.cancelDefault){a.removeAttr("title");a.data("title",m)}f.extend(c,{show:function(e){if(!d){if(q)d=f(q);else if(b.tip)d=f(b.tip).eq(0);else if(m)d=f(b.layout).addClass(b.tipClass).appendTo(document.body).hide().append(m);else{d=a.next();d.length||(d=a.parent().next())}if(!d.length)throw"Cannot find tooltip for "+a;}if(c.isShown())return c;d.stop(true,true);var g=p(a,d,b);b.tip&&d.html(a.data("title"));e=e||f.Event();e.type="onBeforeShow"; h.trigger(e,[g]);if(e.isDefaultPrevented())return c;g=p(a,d,b);d.css({position:"absolute",top:g.top,left:g.left});l=true;r[0].call(c,function(){e.type="onShow";l="full";h.trigger(e)});g=b.events.tooltip.split(/,\s*/);if(!d.data("__set")){d.bind(g[0],function(){clearTimeout(i);clearTimeout(j)});g[1]&&!a.is("input:not(:checkbox, :radio), textarea")&&d.bind(g[1],function(n){n.relatedTarget!=a[0]&&a.trigger(k[1].split(" ")[0])});d.data("__set",true)}return c},hide:function(e){if(!d||!c.isShown())return c; e=e||f.Event();e.type="onBeforeHide";h.trigger(e);if(!e.isDefaultPrevented()){l=false;o[b.effect][1].call(c,function(){e.type="onHide";h.trigger(e)});return c}},isShown:function(e){return e?l=="full":l},getConf:function(){return b},getTip:function(){return d},getTrigger:function(){return a}});f.each("onHide,onBeforeShow,onShow,onBeforeHide".split(","),function(e,g){f.isFunction(b[g])&&f(c).bind(g,b[g]);c[g]=function(n){n&&f(c).bind(g,n);return c}})}f.tools=f.tools||{version:"1.2.5"};f.tools.tooltip= {conf:{effect:"toggle",fadeOutSpeed:"fast",predelay:0,delay:30,opacity:1,tip:0,position:["top","center"],offset:[0,0],relative:false,cancelDefault:true,events:{def:"mouseenter,mouseleave",input:"focus,blur",widget:"focus mouseenter,blur mouseleave",tooltip:"mouseenter,mouseleave"},layout:"<div/>",tipClass:"tooltip"},addEffect:function(a,b,c){o[a]=[b,c]}};var o={toggle:[function(a){var b=this.getConf(),c=this.getTip();b=b.opacity;b<1&&c.css({opacity:b});c.show();a.call()},function(a){this.getTip().hide(); a.call()}],fade:[function(a){var b=this.getConf();this.getTip().fadeTo(b.fadeInSpeed,b.opacity,a)},function(a){this.getTip().fadeOut(this.getConf().fadeOutSpeed,a)}]};f.fn.tooltip=function(a){var b=this.data("tooltip");if(b)return b;a=f.extend(true,{},f.tools.tooltip.conf,a);if(typeof a.position=="string")a.position=a.position.split(/,?\s/);this.each(function(){b=new u(f(this),a);f(this).data("tooltip",b)});return a.api?b:this}})(jQuery); | (function(c){var d=[];c.tools=c.tools||{};c.tools.tooltip={version:"1.1.3",conf:{effect:"toggle",fadeOutSpeed:"fast",tip:null,predelay:0,delay:30,opacity:1,lazy:undefined,position:["top","center"],offset:[0,0],cancelDefault:true,relative:false,oneInstance:true,events:{def:"mouseover,mouseout",input:"focus,blur",widget:"focus mouseover,blur mouseout",tooltip:"mouseover,mouseout"},api:false},addEffect:function(e,g,f){b[e]=[g,f]}};var b={toggle:[function(e){var f=this.getConf(),g=this.getTip(),h=f.opacity;if(h<1){g.css({opacity:h})}g.show();e.call()},function(e){this.getTip().hide();e.call()}],fade:[function(e){this.getTip().fadeIn(this.getConf().fadeInSpeed,e)},function(e){this.getTip().fadeOut(this.getConf().fadeOutSpeed,e)}]};function a(f,g){var p=this,k=c(this);f.data("tooltip",p);var l=f.next();if(g.tip){l=c(g.tip);if(l.length>1){l=f.nextAll(g.tip).eq(0);if(!l.length){l=f.parent().nextAll(g.tip).eq(0)}}}function o(u){var t=g.relative?f.position().top:f.offset().top,s=g.relative?f.position().left:f.offset().left,v=g.position[0];t-=l.outerHeight()-g.offset[0];s+=f.outerWidth()+g.offset[1];var q=l.outerHeight()+f.outerHeight();if(v=="center"){t+=q/2}if(v=="bottom"){t+=q}v=g.position[1];var r=l.outerWidth()+f.outerWidth();if(v=="center"){s-=r/2}if(v=="left"){s-=r}return{top:t,left:s}}var i=f.is(":input"),e=i&&f.is(":checkbox, :radio, select, :button"),h=f.attr("type"),n=g.events[h]||g.events[i?(e?"widget":"input"):"def"];n=n.split(/,\s*/);if(n.length!=2){throw"Tooltip: bad events configuration for "+h}f.bind(n[0],function(r){if(g.oneInstance){c.each(d,function(){this.hide()})}var q=l.data("trigger");if(q&&q[0]!=this){l.hide().stop(true,true)}r.target=this;p.show(r);n=g.events.tooltip.split(/,\s*/);l.bind(n[0],function(){p.show(r)});if(n[1]){l.bind(n[1],function(){p.hide(r)})}});f.bind(n[1],function(q){p.hide(q)});if(!c.browser.msie&&!i&&!g.predelay){f.mousemove(function(){if(!p.isShown()){f.triggerHandler("mouseover")}})}if(g.opacity<1){l.css("opacity",g.opacity)}var m=0,j=f.attr("title");if(j&&g.cancelDefault){f.removeAttr("title");f.data("title",j)}c.extend(p,{show:function(r){if(r){f=c(r.target)}clearTimeout(l.data("timer"));if(l.is(":animated")||l.is(":visible")){return p}function q(){l.data("trigger",f);var t=o(r);if(g.tip&&j){l.html(f.data("title"))}r=r||c.Event();r.type="onBeforeShow";k.trigger(r,[t]);if(r.isDefaultPrevented()){return p}t=o(r);l.css({position:"absolute",top:t.top,left:t.left});var s=b[g.effect];if(!s){throw'Nonexistent effect "'+g.effect+'"'}s[0].call(p,function(){r.type="onShow";k.trigger(r)})}if(g.predelay){clearTimeout(m);m=setTimeout(q,g.predelay)}else{q()}return p},hide:function(r){clearTimeout(l.data("timer"));clearTimeout(m);if(!l.is(":visible")){return}function q(){r=r||c.Event();r.type="onBeforeHide";k.trigger(r);if(r.isDefaultPrevented()){return}b[g.effect][1].call(p,function(){r.type="onHide";k.trigger(r)})}if(g.delay&&r){l.data("timer",setTimeout(q,g.delay))}else{q()}return p},isShown:function(){return l.is(":visible, :animated")},getConf:function(){return g},getTip:function(){return l},getTrigger:function(){return f},bind:function(q,r){k.bind(q,r);return p},onHide:function(q){return this.bind("onHide",q)},onBeforeShow:function(q){return this.bind("onBeforeShow",q)},onShow:function(q){return this.bind("onShow",q)},onBeforeHide:function(q){return this.bind("onBeforeHide",q)},unbind:function(q){k.unbind(q);return p}});c.each(g,function(q,r){if(c.isFunction(r)){p.bind(q,r)}})}c.prototype.tooltip=function(e){var f=this.eq(typeof e=="number"?e:0).data("tooltip");if(f){return f}var g=c.extend(true,{},c.tools.tooltip.conf);if(c.isFunction(e)){e={onBeforeShow:e}}else{if(typeof e=="string"){e={tip:e}}}e=c.extend(true,g,e);if(typeof e.position=="string"){e.position=e.position.split(/,?\s/)}if(e.lazy!==false&&(e.lazy===true||this.length>20)){this.one("mouseover",function(h){f=new a(c(this),e);f.show(h);d.push(f)})}else{this.each(function(){f=new a(c(this),e);d.push(f)})}return e.api?f:this}})(jQuery); |
if (this.ctx == null) { console.log('WGLWidget: failed to get a webgl context'); } | function(APP, canvas) { jQuery.data(canvas, 'obj', this); var self = this; var WT = APP.WT; var vec3 = WT.glMatrix.vec3; var mat3 = WT.glMatrix.mat3; var mat4 = WT.glMatrix.mat4; this.ctx = null; // Placeholders for the initializeGL and paintGL functions, // which will be overwritten by whatever is rendered this.initializeGL = function() {}; this.paintGL = function() {}; var dragPreviousXY = null; var lookAtCenter = null; var lookAtUpDir = null; var lookAtPitchRate = 0; var lookAtYawRate = 0; var cameraMatrix = null; var walkFrontRate = 0; var walkYawRate = 0; this.discoverContext = function() { if (canvas.getContext) { this.ctx = canvas.getContext('experimental-webgl'); if (this.ctx == null) { this.ctx = canvas.getContext('webgl'); } if (this.ctx == null) { console.log('WGLWidget: failed to get a webgl context'); } } return this.ctx; } this.setLookAtParams = function(matrix, center, up, pitchRate, yawRate) { cameraMatrix = matrix; lookAtCenter = center; lookAtUpDir = up; lookAtPitchRate = pitchRate; lookAtYawRate = yawRate; }; this.mouseDragLookAt = function(o, event) { var c = WT.pageCoordinates(event); var dx=(c.x - dragPreviousXY.x); var dy=(c.y - dragPreviousXY.y); var s=vec3.create(); s[0]=cameraMatrix[0]; s[1]=cameraMatrix[4]; s[2]=cameraMatrix[8]; var r=mat4.create(); mat4.identity(r); mat4.translate(r, lookAtCenter); mat4.rotate(r, dy * lookAtPitchRate, s); mat4.rotate(r, dx * lookAtYawRate, lookAtUpDir); vec3.negate(lookAtCenter); mat4.translate(r, lookAtCenter); vec3.negate(lookAtCenter); mat4.multiply(cameraMatrix,r,cameraMatrix); //console.log('mouseDragLookAt after: ' + mat4.str(cameraMatrix)); // Repaint! //console.log('mouseDragLookAt: repaint'); this.paintGl(); // store mouse coord for next action dragPreviousXY = WT.pageCoordinates(event); }; // Mouse wheel = zoom in/out this.mouseWheelLookAt = function(o, event) { WT.cancelEvent(event); //alert('foo'); var d = WT.wheelDelta(event); var s = Math.pow(1.2, d); mat4.translate(cameraMatrix, lookAtCenter); mat4.scale(cameraMatrix, [s, s, s]); vec3.negate(lookAtCenter); mat4.translate(cameraMatrix, lookAtCenter); vec3.negate(lookAtCenter); // Repaint! this.paintGl(); }; this.setWalkParams = function(matrix, frontRate, yawRate) { cameraMatrix = matrix; walkFrontRate = frontRate; walkYawRate = yawRate; }; this.mouseDragWalk = function(o, event){ var c = WT.pageCoordinates(event); var dx=(c.x - dragPreviousXY.x); var dy=(c.y - dragPreviousXY.y); var r=mat4.create(); mat4.identity(r); mat4.rotateY(r, dx * walkYawRate); var t=vec3.create(); t[0]=0; t[1]=0; t[2]=-walkFrontRate * dy; mat4.translate(r, t); mat4.multiply(r, cameraMatrix, cameraMatrix); this.paintGl(); dragPreviousXY = WT.pageCoordinates(event); } this.mouseDown = function(o, event) { WT.capture(null); WT.capture(canvas); dragPreviousXY = WT.pageCoordinates(event); }; this.mouseUp = function(o, event) { if (dragPreviousXY != null) dragPreviousXY = null; }; }); |
|
false&&f.load();return B(i)}if($f(a)){$f(a).getParent().innerHTML="";u=$f(a).getIndex();e[u]=f}else{e.push(f);u=e.length-1}I=parseInt(a.style.height,10)||a.clientHeight;if(typeof b=="string")b={src:b};j=a.id||"fp"+C();n=b.id||j+"_api";b.id=n;c.playerId=j;if(typeof c=="string")c={clip:{url:c}};if(typeof c.clip=="string")c.clip={url:c.clip};c.clip=c.clip||{};if(a.getAttribute("href",2)&&!c.clip.url)c.clip.url=a.getAttribute("href",2);h=new p(c.clip,-1,f);c.playlist=c.playlist||[c.clip];var q=0;o(c.playlist, | false&&f.load();return B(i)}if($f(a)){$f(a).getParent().innerHTML="";u=$f(a).getIndex();e[u]=f}else{e.push(f);u=e.length-1}G=parseInt(a.style.height,10)||a.clientHeight;if(typeof b=="string")b={src:b};j=a.id||"fp"+C();n=b.id||j+"_api";b.id=n;c.playerId=j;if(typeof c=="string")c={clip:{url:c}};if(typeof c.clip=="string")c.clip={url:c.clip};c.clip=c.clip||{};if(a.getAttribute("href",2)&&!c.clip.url)c.clip.url=a.getAttribute("href",2);h=new p(c.clip,-1,f);c.playlist=c.playlist||[c.clip];var q=0;o(c.playlist, | (function(){function z(a){if(!a||typeof a!="object")return a;var b=new a.constructor;for(var c in a)if(a.hasOwnProperty(c))b[c]=z(a[c]);return b}function o(a,b){if(a){var c,m=0,f=a.length;if(f===undefined)for(c in a){if(b.call(a[c],c,a[c])===false)break}else for(c=a[0];m<f&&b.call(c,m,c)!==false;c=a[++m]);return a}}function v(a,b,c){if(typeof b!="object")return a;a&&b&&o(b,function(m,f){if(!c||typeof f!="function")a[m]=f});return a}function t(a){var b=a.indexOf(".");if(b!=-1){var c=a.substring(0,b)||"*",m=a.substring(b+1,a.length),f=[];o(document.getElementsByTagName(c),function(){this.className&&this.className.indexOf(m)!=-1&&f.push(this)});return f}}function B(a){a=a||window.event;if(a.preventDefault){a.stopPropagation();a.preventDefault()}else{a.returnValue=false;a.cancelBubble=true}return false}function y(a,b,c){a[b]=a[b]||[];a[b].push(c)}function C(){return"_"+(""+Math.random()).substring(2,10)}function A(a,b,c){function m(){function g(i){!f.isLoaded()&&f._fireEvent("onBeforeClick")!==false&&f.load();return B(i)}if($f(a)){$f(a).getParent().innerHTML="";u=$f(a).getIndex();e[u]=f}else{e.push(f);u=e.length-1}I=parseInt(a.style.height,10)||a.clientHeight;if(typeof b=="string")b={src:b};j=a.id||"fp"+C();n=b.id||j+"_api";b.id=n;c.playerId=j;if(typeof c=="string")c={clip:{url:c}};if(typeof c.clip=="string")c.clip={url:c.clip};c.clip=c.clip||{};if(a.getAttribute("href",2)&&!c.clip.url)c.clip.url=a.getAttribute("href",2);h=new p(c.clip,-1,f);c.playlist=c.playlist||[c.clip];var q=0;o(c.playlist,function(){var i=this;if(typeof i=="object"&&i.length)i={url:""+i};o(c.clip,function(s,D){if(D!==undefined&&i[s]===undefined&&typeof D!="function")i[s]=D});c.playlist[q]=i;i=new p(i,q,f);k.push(i);q++});o(c,function(i,s){if(typeof s=="function"){h[i]?h[i](s):y(w,i,s);delete c[i]}});o(c.plugins,function(i,s){if(s)r[i]=new d(i,s,f)});if(!c.plugins||c.plugins.controls===undefined)r.controls=new d("controls",null,f);r.canvas=new d("canvas",null,f);b.bgcolor=b.bgcolor||"#000000";b.version=b.version||[9,0];b.expressInstall="http://www.flowplayer.org/swf/expressinstall.swf";F=a.innerHTML;if(F.replace(/\s/g,"")!=="")if(a.addEventListener)a.addEventListener("click",g,false);else a.attachEvent&&a.attachEvent("onclick",g);else{a.addEventListener&&a.addEventListener("click",B,false);f.load()}}var f=this,l=null,F,h,k=[],r={},w={},j,n,u,x,G,I;v(f,{id:function(){return j},isLoaded:function(){return l!==null},getParent:function(){return a},hide:function(g){if(g)a.style.height="0px";if(l)l.style.height="0px";return f},show:function(){a.style.height=I+"px";if(l)l.style.height=G+"px";return f},isHidden:function(){return l&&parseInt(l.style.height,10)===0},load:function(g){if(!l&&f._fireEvent("onBeforeLoad")!==false){o(e,function(){this.unload()});if((F=a.innerHTML)&&!flashembed.isSupported(b.version))a.innerHTML="";flashembed(a,b,{config:c});if(g){g.cached=true;y(w,"onLoad",g)}}return f},unload:function(){if(F.replace(/\s/g,"")!==""){if(f._fireEvent("onBeforeUnload")===false)return f;try{if(l){l.fp_close();f._fireEvent("onUnload")}}catch(g){}l=null;a.innerHTML=F}return f},getClip:function(g){if(g===undefined)g=x;return k[g]},getCommonClip:function(){return h},getPlaylist:function(){return k},getPlugin:function(g){var q=r[g];if(!q&&f.isLoaded()){var i=f._api().fp_getPlugin(g);if(i){q=new d(g,i,f);r[g]=q}}return q},getScreen:function(){return f.getPlugin("screen")},getControls:function(){return f.getPlugin("controls")},getConfig:function(g){return g?z(c):c},getFlashParams:function(){return b},loadPlugin:function(g,q,i,s){if(typeof i=="function"){s=i;i={}}var D=s?C():"_";f._api().fp_loadPlugin(g,q,i,D);q={};q[D]=s;s=new d(g,null,f,q);return r[g]=s},getState:function(){return l?l.fp_getState():-1},play:function(g,q){function i(){g!==undefined?f._api().fp_play(g,q):f._api().fp_play()}l?i():f.load(function(){i()});return f},getVersion:function(){if(l){var g=l.fp_getVersion();g.push("flowplayer.js 3.1.4");return g}return"flowplayer.js 3.1.4"},_api:function(){if(!l)throw"Flowplayer "+f.id()+" not loaded when calling an API method";return l},setClip:function(g){f.setPlaylist([g]);return f},getIndex:function(){return u}});o("Click*,Load*,Unload*,Keypress*,Volume*,Mute*,Unmute*,PlaylistReplace,ClipAdd,Fullscreen*,FullscreenExit,Error,MouseOver,MouseOut".split(","),function(){var g="on"+this;if(g.indexOf("*")!=-1){g=g.substring(0,g.length-1);var q="onBefore"+g.substring(2);f[q]=function(i){y(w,q,i);return f}}f[g]=function(i){y(w,g,i);return f}});o("pause,resume,mute,unmute,stop,toggle,seek,getStatus,getVolume,setVolume,getTime,isPaused,isPlaying,startBuffering,stopBuffering,isFullscreen,toggleFullscreen,reset,close,setPlaylist,addClip,playFeed".split(","),function(){var g=this;f[g]=function(q,i){if(!l)return f;var s=null;s=q!==undefined&&i!==undefined?l["fp_"+g](q,i):q===undefined?l["fp_"+g]():l["fp_"+g](q);return s==="undefined"||s===undefined?f:s}});f._fireEvent=function(g){if(typeof g=="string")g=[g];var q=g[0],i=g[1],s=g[2],D=g[3],H=0;c.debug&&console.log("$f.fireEvent",[].slice.call(g));if(!l&&q=="onLoad"&&i=="player"){l=l||document.getElementById(n);G=l.clientHeight;o(k,function(){this._fireEvent("onLoad")});o(r,function(L,K){K._fireEvent("onUpdate")});h._fireEvent("onLoad")}if(!(q=="onLoad"&&i!="player")){if(q=="onError")if(typeof i=="string"||typeof i=="number"&&typeof s=="number"){i=s;s=D}if(q=="onContextMenu")o(c.contextMenu[i],function(L,K){K.call(f)});else if(q=="onPluginEvent"){if(D=r[i.name||i]){D._fireEvent("onUpdate",i);D._fireEvent(s,g.slice(3))}}else{if(q=="onPlaylistReplace"){k=[];var M=0;o(i,function(){k.push(new p(this,M++,f))})}if(q=="onClipAdd"){if(i.isInStream)return;i=new p(i,s,f);k.splice(s,0,i);for(H=s+1;H<k.length;H++)k[H].index++}var J=true;if(typeof i=="number"&&i<k.length){x=i;if(g=k[i])J=g._fireEvent(q,s,D);if(!g||J!==false)J=h._fireEvent(q,s,D,g)}o(w[q],function(){J=this.call(f,i,s);this.cached&&w[q].splice(H,1);if(J===false)return false;H++});return J}}};typeof a=="string"?flashembed.domReady(function(){var g=document.getElementById(a);if(g){a=g;m()}else throw"Flowplayer cannot access element: "+a;}):m()}function E(a){this.length=a.length;this.each=function(b){o(a,b)};this.size=function(){return a.length}}var p=function(a,b,c){var m=this,f={},l={};m.index=b;if(typeof a=="string")a={url:a};v(this,a,true);o("Begin*,Start,Pause*,Resume*,Seek*,Stop*,Finish*,LastSecond,Update,BufferFull,BufferEmpty,BufferStop".split(","),function(){var h="on"+this;if(h.indexOf("*")!=-1){h=h.substring(0,h.length-1);var k="onBefore"+h.substring(2);m[k]=function(r){y(l,k,r);return m}}m[h]=function(r){y(l,h,r);return m};if(b==-1){if(m[k])c[k]=m[k];if(m[h])c[h]=m[h]}});v(this,{onCuepoint:function(h,k){if(arguments.length==1){f.embedded=[null,h];return m}if(typeof h=="number")h=[h];var r=C();f[r]=[h,k];c.isLoaded()&&c._api().fp_addCuepoints(h,b,r);return m},update:function(h){v(m,h);c.isLoaded()&&c._api().fp_updateClip(h,b);var k=c.getConfig();v(b==-1?k.clip:k.playlist[b],h,true)},_fireEvent:function(h,k,r,w){if(h=="onLoad"){o(f,function(u,x){x[0]&&c._api().fp_addCuepoints(x[0],b,u)});return false}w=w||m;if(h=="onCuepoint"){var j=f[k];if(j)return j[1].call(c,w,r)}if(k&&"onBeforeBegin,onMetaData,onStart,onUpdate,onResume".indexOf(h)!=-1){v(w,k);if(k.metaData)if(w.duration)w.fullDuration=k.metaData.duration;else w.duration=k.metaData.duration}var n=true;o(l[h],function(){n=this.call(c,w,k,r)});return n}});if(a.onCuepoint){var F=a.onCuepoint;m.onCuepoint.apply(m,typeof F=="function"?[F]:F);delete a.onCuepoint}o(a,function(h,k){if(typeof k=="function"){y(l,h,k);delete a[h]}});if(b==-1)c.onCuepoint=this.onCuepoint},d=function(a,b,c,m){var f={},l=this,F=false;m&&v(f,m);o(b,function(h,k){if(typeof k=="function"){f[h]=k;delete b[h]}});v(this,{animate:function(h,k,r){if(!h)return l;if(typeof k=="function"){r=k;k=500}if(typeof h=="string"){var w=h;h={};h[w]=k;k=500}if(r){var j=C();f[j]=r}if(k===undefined)k=500;b=c._api().fp_animate(a,h,k,j);return l},css:function(h,k){if(k!==undefined){var r={};r[h]=k;h=r}b=c._api().fp_css(a,h);v(l,b);return l},show:function(){this.display="block";c._api().fp_showPlugin(a);return l},hide:function(){this.display="none";c._api().fp_hidePlugin(a);return l},toggle:function(){this.display=c._api().fp_togglePlugin(a);return l},fadeTo:function(h,k,r){if(typeof k=="function"){r=k;k=500}if(r){var w=C();f[w]=r}this.display=c._api().fp_fadeTo(a,h,k,w);this.opacity=h;return l},fadeIn:function(h,k){return l.fadeTo(1,h,k)},fadeOut:function(h,k){return l.fadeTo(0,h,k)},getName:function(){return a},getPlayer:function(){return c},_fireEvent:function(h,k){if(h=="onUpdate"){var r=c._api().fp_getPlugin(a);if(!r)return;v(l,r);delete l.methods;if(!F){o(r.methods,function(){var w=""+this;l[w]=function(){var j=[].slice.call(arguments);j=c._api().fp_invoke(a,w,j);return j==="undefined"||j===undefined?l:j}});F=true}}if(r=f[h]){r.apply(l,k);h.substring(0,1)=="_"&&delete f[h]}}})},e=[];window.flowplayer=window.$f=function(){var a=null,b=arguments[0];if(!arguments.length){o(e,function(){if(this.isLoaded()){a=this;return false}});return a||e[0]}if(arguments.length==1)if(typeof b=="number")return e[b];else{if(b=="*")return new E(e);o(e,function(){if(this.id()==b.id||this.id()==b||this.getParent()==b){a=this;return false}});return a}if(arguments.length>1){var c=arguments[1],m=arguments.length==3?arguments[2]:{};if(typeof b=="string")if(b.indexOf(".")!=-1){var f=[];o(t(b),function(){f.push(new A(this,z(c),z(m)))});return new E(f)}else{var l=document.getElementById(b);return new A(l!==null?l:b,c,m)}else if(b)return new A(b,c,m)}return null};v(window.$f,{fireEvent:function(){var a=[].slice.call(arguments),b=$f(a[0]);return b?b._fireEvent(a.slice(1)):null},addPlugin:function(a,b){A.prototype[a]=b;return $f},each:o,extend:v});if(typeof jQuery=="function")jQuery.prototype.flowplayer=function(a,b){if(!arguments.length||typeof arguments[0]=="number"){var c=[];this.each(function(){var m=$f(this);m&&c.push(m)});return arguments.length?c[arguments[0]]:new E(c)}return this.each(function(){$f(this,z(a),b?z(b):{})})}})(); |
0];b.expressInstall="http: return f},show:function(){a.style.height=I+"px";if(l)l.style.height=G+"px";return f},isHidden:function(){return l&&parseInt(l.style.height,10)===0},load:function(g){if(!l&&f._fireEvent("onBeforeLoad")!==false){o(e,function(){this.unload()});if((F=a.innerHTML)&&!flashembed.isSupported(b.version))a.innerHTML="";flashembed(a,b,{config:c});if(g){g.cached=true;y(w,"onLoad",g)}}return f},unload:function(){if(F.replace(/\s/g,"")!==""){if(f._fireEvent("onBeforeUnload")===false)return f;try{if(l){l.fp_close(); | 0];b.expressInstall="http: return f},show:function(){a.style.height=G+"px";if(l)l.style.height=H+"px";return f},isHidden:function(){return l&&parseInt(l.style.height,10)===0},load:function(g){if(!l&&f._fireEvent("onBeforeLoad")!==false){o(e,function(){this.unload()});if((F=a.innerHTML)&&!flashembed.isSupported(b.version))a.innerHTML="";flashembed(a,b,{config:c});if(g){g.cached=true;y(w,"onLoad",g)}}return f},unload:function(){if(F.replace(/\s/g,"")!==""){if(f._fireEvent("onBeforeUnload")===false)return f;try{if(l){l.fp_close(); | (function(){function z(a){if(!a||typeof a!="object")return a;var b=new a.constructor;for(var c in a)if(a.hasOwnProperty(c))b[c]=z(a[c]);return b}function o(a,b){if(a){var c,m=0,f=a.length;if(f===undefined)for(c in a){if(b.call(a[c],c,a[c])===false)break}else for(c=a[0];m<f&&b.call(c,m,c)!==false;c=a[++m]);return a}}function v(a,b,c){if(typeof b!="object")return a;a&&b&&o(b,function(m,f){if(!c||typeof f!="function")a[m]=f});return a}function t(a){var b=a.indexOf(".");if(b!=-1){var c=a.substring(0,b)||"*",m=a.substring(b+1,a.length),f=[];o(document.getElementsByTagName(c),function(){this.className&&this.className.indexOf(m)!=-1&&f.push(this)});return f}}function B(a){a=a||window.event;if(a.preventDefault){a.stopPropagation();a.preventDefault()}else{a.returnValue=false;a.cancelBubble=true}return false}function y(a,b,c){a[b]=a[b]||[];a[b].push(c)}function C(){return"_"+(""+Math.random()).substring(2,10)}function A(a,b,c){function m(){function g(i){!f.isLoaded()&&f._fireEvent("onBeforeClick")!==false&&f.load();return B(i)}if($f(a)){$f(a).getParent().innerHTML="";u=$f(a).getIndex();e[u]=f}else{e.push(f);u=e.length-1}I=parseInt(a.style.height,10)||a.clientHeight;if(typeof b=="string")b={src:b};j=a.id||"fp"+C();n=b.id||j+"_api";b.id=n;c.playerId=j;if(typeof c=="string")c={clip:{url:c}};if(typeof c.clip=="string")c.clip={url:c.clip};c.clip=c.clip||{};if(a.getAttribute("href",2)&&!c.clip.url)c.clip.url=a.getAttribute("href",2);h=new p(c.clip,-1,f);c.playlist=c.playlist||[c.clip];var q=0;o(c.playlist,function(){var i=this;if(typeof i=="object"&&i.length)i={url:""+i};o(c.clip,function(s,D){if(D!==undefined&&i[s]===undefined&&typeof D!="function")i[s]=D});c.playlist[q]=i;i=new p(i,q,f);k.push(i);q++});o(c,function(i,s){if(typeof s=="function"){h[i]?h[i](s):y(w,i,s);delete c[i]}});o(c.plugins,function(i,s){if(s)r[i]=new d(i,s,f)});if(!c.plugins||c.plugins.controls===undefined)r.controls=new d("controls",null,f);r.canvas=new d("canvas",null,f);b.bgcolor=b.bgcolor||"#000000";b.version=b.version||[9,0];b.expressInstall="http://www.flowplayer.org/swf/expressinstall.swf";F=a.innerHTML;if(F.replace(/\s/g,"")!=="")if(a.addEventListener)a.addEventListener("click",g,false);else a.attachEvent&&a.attachEvent("onclick",g);else{a.addEventListener&&a.addEventListener("click",B,false);f.load()}}var f=this,l=null,F,h,k=[],r={},w={},j,n,u,x,G,I;v(f,{id:function(){return j},isLoaded:function(){return l!==null},getParent:function(){return a},hide:function(g){if(g)a.style.height="0px";if(l)l.style.height="0px";return f},show:function(){a.style.height=I+"px";if(l)l.style.height=G+"px";return f},isHidden:function(){return l&&parseInt(l.style.height,10)===0},load:function(g){if(!l&&f._fireEvent("onBeforeLoad")!==false){o(e,function(){this.unload()});if((F=a.innerHTML)&&!flashembed.isSupported(b.version))a.innerHTML="";flashembed(a,b,{config:c});if(g){g.cached=true;y(w,"onLoad",g)}}return f},unload:function(){if(F.replace(/\s/g,"")!==""){if(f._fireEvent("onBeforeUnload")===false)return f;try{if(l){l.fp_close();f._fireEvent("onUnload")}}catch(g){}l=null;a.innerHTML=F}return f},getClip:function(g){if(g===undefined)g=x;return k[g]},getCommonClip:function(){return h},getPlaylist:function(){return k},getPlugin:function(g){var q=r[g];if(!q&&f.isLoaded()){var i=f._api().fp_getPlugin(g);if(i){q=new d(g,i,f);r[g]=q}}return q},getScreen:function(){return f.getPlugin("screen")},getControls:function(){return f.getPlugin("controls")},getConfig:function(g){return g?z(c):c},getFlashParams:function(){return b},loadPlugin:function(g,q,i,s){if(typeof i=="function"){s=i;i={}}var D=s?C():"_";f._api().fp_loadPlugin(g,q,i,D);q={};q[D]=s;s=new d(g,null,f,q);return r[g]=s},getState:function(){return l?l.fp_getState():-1},play:function(g,q){function i(){g!==undefined?f._api().fp_play(g,q):f._api().fp_play()}l?i():f.load(function(){i()});return f},getVersion:function(){if(l){var g=l.fp_getVersion();g.push("flowplayer.js 3.1.4");return g}return"flowplayer.js 3.1.4"},_api:function(){if(!l)throw"Flowplayer "+f.id()+" not loaded when calling an API method";return l},setClip:function(g){f.setPlaylist([g]);return f},getIndex:function(){return u}});o("Click*,Load*,Unload*,Keypress*,Volume*,Mute*,Unmute*,PlaylistReplace,ClipAdd,Fullscreen*,FullscreenExit,Error,MouseOver,MouseOut".split(","),function(){var g="on"+this;if(g.indexOf("*")!=-1){g=g.substring(0,g.length-1);var q="onBefore"+g.substring(2);f[q]=function(i){y(w,q,i);return f}}f[g]=function(i){y(w,g,i);return f}});o("pause,resume,mute,unmute,stop,toggle,seek,getStatus,getVolume,setVolume,getTime,isPaused,isPlaying,startBuffering,stopBuffering,isFullscreen,toggleFullscreen,reset,close,setPlaylist,addClip,playFeed".split(","),function(){var g=this;f[g]=function(q,i){if(!l)return f;var s=null;s=q!==undefined&&i!==undefined?l["fp_"+g](q,i):q===undefined?l["fp_"+g]():l["fp_"+g](q);return s==="undefined"||s===undefined?f:s}});f._fireEvent=function(g){if(typeof g=="string")g=[g];var q=g[0],i=g[1],s=g[2],D=g[3],H=0;c.debug&&console.log("$f.fireEvent",[].slice.call(g));if(!l&&q=="onLoad"&&i=="player"){l=l||document.getElementById(n);G=l.clientHeight;o(k,function(){this._fireEvent("onLoad")});o(r,function(L,K){K._fireEvent("onUpdate")});h._fireEvent("onLoad")}if(!(q=="onLoad"&&i!="player")){if(q=="onError")if(typeof i=="string"||typeof i=="number"&&typeof s=="number"){i=s;s=D}if(q=="onContextMenu")o(c.contextMenu[i],function(L,K){K.call(f)});else if(q=="onPluginEvent"){if(D=r[i.name||i]){D._fireEvent("onUpdate",i);D._fireEvent(s,g.slice(3))}}else{if(q=="onPlaylistReplace"){k=[];var M=0;o(i,function(){k.push(new p(this,M++,f))})}if(q=="onClipAdd"){if(i.isInStream)return;i=new p(i,s,f);k.splice(s,0,i);for(H=s+1;H<k.length;H++)k[H].index++}var J=true;if(typeof i=="number"&&i<k.length){x=i;if(g=k[i])J=g._fireEvent(q,s,D);if(!g||J!==false)J=h._fireEvent(q,s,D,g)}o(w[q],function(){J=this.call(f,i,s);this.cached&&w[q].splice(H,1);if(J===false)return false;H++});return J}}};typeof a=="string"?flashembed.domReady(function(){var g=document.getElementById(a);if(g){a=g;m()}else throw"Flowplayer cannot access element: "+a;}):m()}function E(a){this.length=a.length;this.each=function(b){o(a,b)};this.size=function(){return a.length}}var p=function(a,b,c){var m=this,f={},l={};m.index=b;if(typeof a=="string")a={url:a};v(this,a,true);o("Begin*,Start,Pause*,Resume*,Seek*,Stop*,Finish*,LastSecond,Update,BufferFull,BufferEmpty,BufferStop".split(","),function(){var h="on"+this;if(h.indexOf("*")!=-1){h=h.substring(0,h.length-1);var k="onBefore"+h.substring(2);m[k]=function(r){y(l,k,r);return m}}m[h]=function(r){y(l,h,r);return m};if(b==-1){if(m[k])c[k]=m[k];if(m[h])c[h]=m[h]}});v(this,{onCuepoint:function(h,k){if(arguments.length==1){f.embedded=[null,h];return m}if(typeof h=="number")h=[h];var r=C();f[r]=[h,k];c.isLoaded()&&c._api().fp_addCuepoints(h,b,r);return m},update:function(h){v(m,h);c.isLoaded()&&c._api().fp_updateClip(h,b);var k=c.getConfig();v(b==-1?k.clip:k.playlist[b],h,true)},_fireEvent:function(h,k,r,w){if(h=="onLoad"){o(f,function(u,x){x[0]&&c._api().fp_addCuepoints(x[0],b,u)});return false}w=w||m;if(h=="onCuepoint"){var j=f[k];if(j)return j[1].call(c,w,r)}if(k&&"onBeforeBegin,onMetaData,onStart,onUpdate,onResume".indexOf(h)!=-1){v(w,k);if(k.metaData)if(w.duration)w.fullDuration=k.metaData.duration;else w.duration=k.metaData.duration}var n=true;o(l[h],function(){n=this.call(c,w,k,r)});return n}});if(a.onCuepoint){var F=a.onCuepoint;m.onCuepoint.apply(m,typeof F=="function"?[F]:F);delete a.onCuepoint}o(a,function(h,k){if(typeof k=="function"){y(l,h,k);delete a[h]}});if(b==-1)c.onCuepoint=this.onCuepoint},d=function(a,b,c,m){var f={},l=this,F=false;m&&v(f,m);o(b,function(h,k){if(typeof k=="function"){f[h]=k;delete b[h]}});v(this,{animate:function(h,k,r){if(!h)return l;if(typeof k=="function"){r=k;k=500}if(typeof h=="string"){var w=h;h={};h[w]=k;k=500}if(r){var j=C();f[j]=r}if(k===undefined)k=500;b=c._api().fp_animate(a,h,k,j);return l},css:function(h,k){if(k!==undefined){var r={};r[h]=k;h=r}b=c._api().fp_css(a,h);v(l,b);return l},show:function(){this.display="block";c._api().fp_showPlugin(a);return l},hide:function(){this.display="none";c._api().fp_hidePlugin(a);return l},toggle:function(){this.display=c._api().fp_togglePlugin(a);return l},fadeTo:function(h,k,r){if(typeof k=="function"){r=k;k=500}if(r){var w=C();f[w]=r}this.display=c._api().fp_fadeTo(a,h,k,w);this.opacity=h;return l},fadeIn:function(h,k){return l.fadeTo(1,h,k)},fadeOut:function(h,k){return l.fadeTo(0,h,k)},getName:function(){return a},getPlayer:function(){return c},_fireEvent:function(h,k){if(h=="onUpdate"){var r=c._api().fp_getPlugin(a);if(!r)return;v(l,r);delete l.methods;if(!F){o(r.methods,function(){var w=""+this;l[w]=function(){var j=[].slice.call(arguments);j=c._api().fp_invoke(a,w,j);return j==="undefined"||j===undefined?l:j}});F=true}}if(r=f[h]){r.apply(l,k);h.substring(0,1)=="_"&&delete f[h]}}})},e=[];window.flowplayer=window.$f=function(){var a=null,b=arguments[0];if(!arguments.length){o(e,function(){if(this.isLoaded()){a=this;return false}});return a||e[0]}if(arguments.length==1)if(typeof b=="number")return e[b];else{if(b=="*")return new E(e);o(e,function(){if(this.id()==b.id||this.id()==b||this.getParent()==b){a=this;return false}});return a}if(arguments.length>1){var c=arguments[1],m=arguments.length==3?arguments[2]:{};if(typeof b=="string")if(b.indexOf(".")!=-1){var f=[];o(t(b),function(){f.push(new A(this,z(c),z(m)))});return new E(f)}else{var l=document.getElementById(b);return new A(l!==null?l:b,c,m)}else if(b)return new A(b,c,m)}return null};v(window.$f,{fireEvent:function(){var a=[].slice.call(arguments),b=$f(a[0]);return b?b._fireEvent(a.slice(1)):null},addPlugin:function(a,b){A.prototype[a]=b;return $f},each:o,extend:v});if(typeof jQuery=="function")jQuery.prototype.flowplayer=function(a,b){if(!arguments.length||typeof arguments[0]=="number"){var c=[];this.each(function(){var m=$f(this);m&&c.push(m)});return arguments.length?c[arguments[0]]:new E(c)}return this.each(function(){$f(this,z(a),b?z(b):{})})}})(); |
function(){var g=this;f[g]=function(q,i){if(!l)return f;var s=null;s=q!==undefined&&i!==undefined?l["fp_"+g](q,i):q===undefined?l["fp_"+g]():l["fp_"+g](q);return s==="undefined"||s===undefined?f:s}});f._fireEvent=function(g){if(typeof g=="string")g=[g];var q=g[0],i=g[1],s=g[2],D=g[3],H=0;c.debug&&console.log("$f.fireEvent",[].slice.call(g));if(!l&&q=="onLoad"&&i=="player"){l=l||document.getElementById(n);G=l.clientHeight;o(k,function(){this._fireEvent("onLoad")});o(r,function(L,K){K._fireEvent("onUpdate")}); h._fireEvent("onLoad")}if(!(q=="onLoad"&&i!="player")){if(q=="onError")if(typeof i=="string"||typeof i=="number"&&typeof s=="number"){i=s;s=D}if(q=="onContextMenu")o(c.contextMenu[i],function(L,K){K.call(f)});else if(q=="onPluginEvent"){if(D=r[i.name||i]){D._fireEvent("onUpdate",i);D._fireEvent(s,g.slice(3))}}else{if(q=="onPlaylistReplace"){k=[];var M=0;o(i,function(){k.push(new p(this,M++,f))})}if(q=="onClipAdd"){if(i.isInStream)return;i=new p(i,s,f);k.splice(s,0,i);for(H=s+1;H<k.length;H++)k[H].index++}var J= true;if(typeof i=="number"&&i<k.length){x=i;if(g=k[i])J=g._fireEvent(q,s,D);if(!g||J!==false)J=h._fireEvent(q,s,D,g)}o(w[q],function(){J=this.call(f,i,s);this.cached&&w[q].splice(H,1);if(J===false)return false;H++});return J}}};typeof a=="string"?flashembed.domReady(function(){var g=document.getElementById(a);if(g){a=g;m()}else throw"Flowplayer cannot access element: "+a;}):m()}function E(a){this.length=a.length;this.each=function(b){o(a,b)};this.size=function(){return a.length}}var p=function(a, | function(){var g=this;f[g]=function(q,i){if(!l)return f;var s=null;s=q!==undefined&&i!==undefined?l["fp_"+g](q,i):q===undefined?l["fp_"+g]():l["fp_"+g](q);return s==="undefined"||s===undefined?f:s}});f._fireEvent=function(g){if(typeof g=="string")g=[g];var q=g[0],i=g[1],s=g[2],D=g[3],I=0;c.debug&&console.log("$f.fireEvent",[].slice.call(g));if(!l&&q=="onLoad"&&i=="player"){l=l||document.getElementById(n);H=l.clientHeight;o(k,function(){this._fireEvent("onLoad")});o(r,function(L,K){K._fireEvent("onUpdate")}); h._fireEvent("onLoad")}if(!(q=="onLoad"&&i!="player")){if(q=="onError")if(typeof i=="string"||typeof i=="number"&&typeof s=="number"){i=s;s=D}if(q=="onContextMenu")o(c.contextMenu[i],function(L,K){K.call(f)});else if(q=="onPluginEvent"){if(D=r[i.name||i]){D._fireEvent("onUpdate",i);D._fireEvent(s,g.slice(3))}}else{if(q=="onPlaylistReplace"){k=[];var M=0;o(i,function(){k.push(new p(this,M++,f))})}if(q=="onClipAdd"){if(i.isInStream)return;i=new p(i,s,f);k.splice(s,0,i);for(I=s+1;I<k.length;I++)k[I].index++}var J= true;if(typeof i=="number"&&i<k.length){x=i;if(g=k[i])J=g._fireEvent(q,s,D);if(!g||J!==false)J=h._fireEvent(q,s,D,g)}o(w[q],function(){J=this.call(f,i,s);this.cached&&w[q].splice(I,1);if(J===false)return false;I++});return J}}};typeof a=="string"?flashembed.domReady(function(){var g=document.getElementById(a);if(g){a=g;m()}else throw"Flowplayer cannot access element: "+a;}):m()}function E(a){this.length=a.length;this.each=function(b){o(a,b)};this.size=function(){return a.length}}var p=function(a, | (function(){function z(a){if(!a||typeof a!="object")return a;var b=new a.constructor;for(var c in a)if(a.hasOwnProperty(c))b[c]=z(a[c]);return b}function o(a,b){if(a){var c,m=0,f=a.length;if(f===undefined)for(c in a){if(b.call(a[c],c,a[c])===false)break}else for(c=a[0];m<f&&b.call(c,m,c)!==false;c=a[++m]);return a}}function v(a,b,c){if(typeof b!="object")return a;a&&b&&o(b,function(m,f){if(!c||typeof f!="function")a[m]=f});return a}function t(a){var b=a.indexOf(".");if(b!=-1){var c=a.substring(0,b)||"*",m=a.substring(b+1,a.length),f=[];o(document.getElementsByTagName(c),function(){this.className&&this.className.indexOf(m)!=-1&&f.push(this)});return f}}function B(a){a=a||window.event;if(a.preventDefault){a.stopPropagation();a.preventDefault()}else{a.returnValue=false;a.cancelBubble=true}return false}function y(a,b,c){a[b]=a[b]||[];a[b].push(c)}function C(){return"_"+(""+Math.random()).substring(2,10)}function A(a,b,c){function m(){function g(i){!f.isLoaded()&&f._fireEvent("onBeforeClick")!==false&&f.load();return B(i)}if($f(a)){$f(a).getParent().innerHTML="";u=$f(a).getIndex();e[u]=f}else{e.push(f);u=e.length-1}I=parseInt(a.style.height,10)||a.clientHeight;if(typeof b=="string")b={src:b};j=a.id||"fp"+C();n=b.id||j+"_api";b.id=n;c.playerId=j;if(typeof c=="string")c={clip:{url:c}};if(typeof c.clip=="string")c.clip={url:c.clip};c.clip=c.clip||{};if(a.getAttribute("href",2)&&!c.clip.url)c.clip.url=a.getAttribute("href",2);h=new p(c.clip,-1,f);c.playlist=c.playlist||[c.clip];var q=0;o(c.playlist,function(){var i=this;if(typeof i=="object"&&i.length)i={url:""+i};o(c.clip,function(s,D){if(D!==undefined&&i[s]===undefined&&typeof D!="function")i[s]=D});c.playlist[q]=i;i=new p(i,q,f);k.push(i);q++});o(c,function(i,s){if(typeof s=="function"){h[i]?h[i](s):y(w,i,s);delete c[i]}});o(c.plugins,function(i,s){if(s)r[i]=new d(i,s,f)});if(!c.plugins||c.plugins.controls===undefined)r.controls=new d("controls",null,f);r.canvas=new d("canvas",null,f);b.bgcolor=b.bgcolor||"#000000";b.version=b.version||[9,0];b.expressInstall="http://www.flowplayer.org/swf/expressinstall.swf";F=a.innerHTML;if(F.replace(/\s/g,"")!=="")if(a.addEventListener)a.addEventListener("click",g,false);else a.attachEvent&&a.attachEvent("onclick",g);else{a.addEventListener&&a.addEventListener("click",B,false);f.load()}}var f=this,l=null,F,h,k=[],r={},w={},j,n,u,x,G,I;v(f,{id:function(){return j},isLoaded:function(){return l!==null},getParent:function(){return a},hide:function(g){if(g)a.style.height="0px";if(l)l.style.height="0px";return f},show:function(){a.style.height=I+"px";if(l)l.style.height=G+"px";return f},isHidden:function(){return l&&parseInt(l.style.height,10)===0},load:function(g){if(!l&&f._fireEvent("onBeforeLoad")!==false){o(e,function(){this.unload()});if((F=a.innerHTML)&&!flashembed.isSupported(b.version))a.innerHTML="";flashembed(a,b,{config:c});if(g){g.cached=true;y(w,"onLoad",g)}}return f},unload:function(){if(F.replace(/\s/g,"")!==""){if(f._fireEvent("onBeforeUnload")===false)return f;try{if(l){l.fp_close();f._fireEvent("onUnload")}}catch(g){}l=null;a.innerHTML=F}return f},getClip:function(g){if(g===undefined)g=x;return k[g]},getCommonClip:function(){return h},getPlaylist:function(){return k},getPlugin:function(g){var q=r[g];if(!q&&f.isLoaded()){var i=f._api().fp_getPlugin(g);if(i){q=new d(g,i,f);r[g]=q}}return q},getScreen:function(){return f.getPlugin("screen")},getControls:function(){return f.getPlugin("controls")},getConfig:function(g){return g?z(c):c},getFlashParams:function(){return b},loadPlugin:function(g,q,i,s){if(typeof i=="function"){s=i;i={}}var D=s?C():"_";f._api().fp_loadPlugin(g,q,i,D);q={};q[D]=s;s=new d(g,null,f,q);return r[g]=s},getState:function(){return l?l.fp_getState():-1},play:function(g,q){function i(){g!==undefined?f._api().fp_play(g,q):f._api().fp_play()}l?i():f.load(function(){i()});return f},getVersion:function(){if(l){var g=l.fp_getVersion();g.push("flowplayer.js 3.1.4");return g}return"flowplayer.js 3.1.4"},_api:function(){if(!l)throw"Flowplayer "+f.id()+" not loaded when calling an API method";return l},setClip:function(g){f.setPlaylist([g]);return f},getIndex:function(){return u}});o("Click*,Load*,Unload*,Keypress*,Volume*,Mute*,Unmute*,PlaylistReplace,ClipAdd,Fullscreen*,FullscreenExit,Error,MouseOver,MouseOut".split(","),function(){var g="on"+this;if(g.indexOf("*")!=-1){g=g.substring(0,g.length-1);var q="onBefore"+g.substring(2);f[q]=function(i){y(w,q,i);return f}}f[g]=function(i){y(w,g,i);return f}});o("pause,resume,mute,unmute,stop,toggle,seek,getStatus,getVolume,setVolume,getTime,isPaused,isPlaying,startBuffering,stopBuffering,isFullscreen,toggleFullscreen,reset,close,setPlaylist,addClip,playFeed".split(","),function(){var g=this;f[g]=function(q,i){if(!l)return f;var s=null;s=q!==undefined&&i!==undefined?l["fp_"+g](q,i):q===undefined?l["fp_"+g]():l["fp_"+g](q);return s==="undefined"||s===undefined?f:s}});f._fireEvent=function(g){if(typeof g=="string")g=[g];var q=g[0],i=g[1],s=g[2],D=g[3],H=0;c.debug&&console.log("$f.fireEvent",[].slice.call(g));if(!l&&q=="onLoad"&&i=="player"){l=l||document.getElementById(n);G=l.clientHeight;o(k,function(){this._fireEvent("onLoad")});o(r,function(L,K){K._fireEvent("onUpdate")});h._fireEvent("onLoad")}if(!(q=="onLoad"&&i!="player")){if(q=="onError")if(typeof i=="string"||typeof i=="number"&&typeof s=="number"){i=s;s=D}if(q=="onContextMenu")o(c.contextMenu[i],function(L,K){K.call(f)});else if(q=="onPluginEvent"){if(D=r[i.name||i]){D._fireEvent("onUpdate",i);D._fireEvent(s,g.slice(3))}}else{if(q=="onPlaylistReplace"){k=[];var M=0;o(i,function(){k.push(new p(this,M++,f))})}if(q=="onClipAdd"){if(i.isInStream)return;i=new p(i,s,f);k.splice(s,0,i);for(H=s+1;H<k.length;H++)k[H].index++}var J=true;if(typeof i=="number"&&i<k.length){x=i;if(g=k[i])J=g._fireEvent(q,s,D);if(!g||J!==false)J=h._fireEvent(q,s,D,g)}o(w[q],function(){J=this.call(f,i,s);this.cached&&w[q].splice(H,1);if(J===false)return false;H++});return J}}};typeof a=="string"?flashembed.domReady(function(){var g=document.getElementById(a);if(g){a=g;m()}else throw"Flowplayer cannot access element: "+a;}):m()}function E(a){this.length=a.length;this.each=function(b){o(a,b)};this.size=function(){return a.length}}var p=function(a,b,c){var m=this,f={},l={};m.index=b;if(typeof a=="string")a={url:a};v(this,a,true);o("Begin*,Start,Pause*,Resume*,Seek*,Stop*,Finish*,LastSecond,Update,BufferFull,BufferEmpty,BufferStop".split(","),function(){var h="on"+this;if(h.indexOf("*")!=-1){h=h.substring(0,h.length-1);var k="onBefore"+h.substring(2);m[k]=function(r){y(l,k,r);return m}}m[h]=function(r){y(l,h,r);return m};if(b==-1){if(m[k])c[k]=m[k];if(m[h])c[h]=m[h]}});v(this,{onCuepoint:function(h,k){if(arguments.length==1){f.embedded=[null,h];return m}if(typeof h=="number")h=[h];var r=C();f[r]=[h,k];c.isLoaded()&&c._api().fp_addCuepoints(h,b,r);return m},update:function(h){v(m,h);c.isLoaded()&&c._api().fp_updateClip(h,b);var k=c.getConfig();v(b==-1?k.clip:k.playlist[b],h,true)},_fireEvent:function(h,k,r,w){if(h=="onLoad"){o(f,function(u,x){x[0]&&c._api().fp_addCuepoints(x[0],b,u)});return false}w=w||m;if(h=="onCuepoint"){var j=f[k];if(j)return j[1].call(c,w,r)}if(k&&"onBeforeBegin,onMetaData,onStart,onUpdate,onResume".indexOf(h)!=-1){v(w,k);if(k.metaData)if(w.duration)w.fullDuration=k.metaData.duration;else w.duration=k.metaData.duration}var n=true;o(l[h],function(){n=this.call(c,w,k,r)});return n}});if(a.onCuepoint){var F=a.onCuepoint;m.onCuepoint.apply(m,typeof F=="function"?[F]:F);delete a.onCuepoint}o(a,function(h,k){if(typeof k=="function"){y(l,h,k);delete a[h]}});if(b==-1)c.onCuepoint=this.onCuepoint},d=function(a,b,c,m){var f={},l=this,F=false;m&&v(f,m);o(b,function(h,k){if(typeof k=="function"){f[h]=k;delete b[h]}});v(this,{animate:function(h,k,r){if(!h)return l;if(typeof k=="function"){r=k;k=500}if(typeof h=="string"){var w=h;h={};h[w]=k;k=500}if(r){var j=C();f[j]=r}if(k===undefined)k=500;b=c._api().fp_animate(a,h,k,j);return l},css:function(h,k){if(k!==undefined){var r={};r[h]=k;h=r}b=c._api().fp_css(a,h);v(l,b);return l},show:function(){this.display="block";c._api().fp_showPlugin(a);return l},hide:function(){this.display="none";c._api().fp_hidePlugin(a);return l},toggle:function(){this.display=c._api().fp_togglePlugin(a);return l},fadeTo:function(h,k,r){if(typeof k=="function"){r=k;k=500}if(r){var w=C();f[w]=r}this.display=c._api().fp_fadeTo(a,h,k,w);this.opacity=h;return l},fadeIn:function(h,k){return l.fadeTo(1,h,k)},fadeOut:function(h,k){return l.fadeTo(0,h,k)},getName:function(){return a},getPlayer:function(){return c},_fireEvent:function(h,k){if(h=="onUpdate"){var r=c._api().fp_getPlugin(a);if(!r)return;v(l,r);delete l.methods;if(!F){o(r.methods,function(){var w=""+this;l[w]=function(){var j=[].slice.call(arguments);j=c._api().fp_invoke(a,w,j);return j==="undefined"||j===undefined?l:j}});F=true}}if(r=f[h]){r.apply(l,k);h.substring(0,1)=="_"&&delete f[h]}}})},e=[];window.flowplayer=window.$f=function(){var a=null,b=arguments[0];if(!arguments.length){o(e,function(){if(this.isLoaded()){a=this;return false}});return a||e[0]}if(arguments.length==1)if(typeof b=="number")return e[b];else{if(b=="*")return new E(e);o(e,function(){if(this.id()==b.id||this.id()==b||this.getParent()==b){a=this;return false}});return a}if(arguments.length>1){var c=arguments[1],m=arguments.length==3?arguments[2]:{};if(typeof b=="string")if(b.indexOf(".")!=-1){var f=[];o(t(b),function(){f.push(new A(this,z(c),z(m)))});return new E(f)}else{var l=document.getElementById(b);return new A(l!==null?l:b,c,m)}else if(b)return new A(b,c,m)}return null};v(window.$f,{fireEvent:function(){var a=[].slice.call(arguments),b=$f(a[0]);return b?b._fireEvent(a.slice(1)):null},addPlugin:function(a,b){A.prototype[a]=b;return $f},each:o,extend:v});if(typeof jQuery=="function")jQuery.prototype.flowplayer=function(a,b){if(!arguments.length||typeof arguments[0]=="number"){var c=[];this.each(function(){var m=$f(this);m&&c.push(m)});return arguments.length?c[arguments[0]]:new E(c)}return this.each(function(){$f(this,z(a),b?z(b):{})})}})(); |
a)return b;return-1}function w(a,b){var c=a.className.split(" ")[0],d=c.substring(7)*1,k=p.firstChild,g=f.firstChild;c=$(g).find("."+c).get(0);var j=a.nextSibling,e=c.nextSibling,l=i.pxself(a,"width")-1+b;k.style.width=g.style.width=i.pxself(k,"width")+b+"px";a.style.width=l+1+"px";for(c.style.width=l+7+"px";j;j=j.nextSibling)if(e){e.style.left=i.pxself(e,"left")+b+"px";e=e.nextSibling}n.emit(h,"columnResized",d,l)}jQuery.data(h,"obj",this);var i=n.WT,s=0,t=0,u=0,v=0;f.onscroll=function(){p.scrollLeft= | a)return b;return-1}function w(a,b){var c=a.className.split(" ")[0],d=c.substring(7)*1,k=p.firstChild,g=f.firstChild;c=$(g).find("."+c).get(0);var j=a.nextSibling,e=c.nextSibling,l=i.pxself(a,"width")-1+b;k.style.width=g.style.width=i.pxself(k,"width")+b+"px";a.style.width=l+1+"px";for(c.style.width=l+7+"px";j;j=j.nextSibling)if(e){e.style.left=i.pxself(e,"left")+b+"px";e=e.nextSibling}n.emit(h,"columnResized",d,parseInt(l))}jQuery.data(h,"obj",this);var i=n.WT,s=0,t=0,u=0,v=0;f.onscroll=function(){p.scrollLeft= | WT_DECLARE_WT_MEMBER(1,"WTableView",function(n,h,f,p){function q(a){var b=-1,c=false,d=false,k=null;for(a=a.target||a.srcElement;a;){var g=$(a);if(g.hasClass("Wt-tv-contents"))break;else if(g.hasClass("Wt-tv-c")){if(a.getAttribute("drop")==="true")d=true;if(g.hasClass("Wt-selected"))c=true;k=a;a=a.parentNode;b=a.className.split(" ")[0].substring(7)*1;break}a=a.parentNode}return{columnId:b,rowIdx:-1,selected:c,drop:d,el:k}}function r(a){var b,c,d=a.parentNode.childNodes;b=0;for(c=d.length;b<c;++b)if(d[b]==a)return b;return-1}function w(a,b){var c=a.className.split(" ")[0],d=c.substring(7)*1,k=p.firstChild,g=f.firstChild;c=$(g).find("."+c).get(0);var j=a.nextSibling,e=c.nextSibling,l=i.pxself(a,"width")-1+b;k.style.width=g.style.width=i.pxself(k,"width")+b+"px";a.style.width=l+1+"px";for(c.style.width=l+7+"px";j;j=j.nextSibling)if(e){e.style.left=i.pxself(e,"left")+b+"px";e=e.nextSibling}n.emit(h,"columnResized",d,l)}jQuery.data(h,"obj",this);var i=n.WT,s=0,t=0,u=0,v=0;f.onscroll=function(){p.scrollLeft=f.scrollLeft;if(f.scrollTop<u||f.scrollTop>v||f.scrollLeft<s||f.scrollLeft>t)n.emit(h,"scrolled",f.scrollLeft,f.scrollTop,f.clientWidth,f.clientHeight)};this.mouseDown=function(a,b){i.capture(null);a=q(b);h.getAttribute("drag")==="true"&&a.selected&&n._p_.dragStart(h,b)};this.resizeHandleMDown=function(a,b){var c=a.parentNode.parentNode,d=-(i.pxself(c,"width")-1);new i.SizeHandle(i,"h",a.offsetWidth,h.offsetHeight,d,1E4,"Wt-hsh",function(k){w(c,k)},a,h,b,-2,-1)};this.scrolled=function(a,b,c,d){s=a;t=b;u=c;v=d};var m=null;h.handleDragDrop=function(a,b,c,d,k){if(m){m.className=m.classNameOrig;m=null}if(a!="end"){var g=q(c);if(!g.selected&&g.drop)if(a=="drop")n.emit(h,{name:"dropEvent",eventObject:b,event:c},g.rowIdx,g.columnId,d,k);else{b.className="Wt-valid-drop";m=g.el;m.classNameOrig=m.className;m.className+=" Wt-drop-site"}else b.className=""}};h.onkeydown=function(a){var b=a||window.event;if(b.keyCode==9){i.cancelEvent(b);var c=q(b);if(c.el){a=c.el.parentNode;c=r(c.el);var d=r(a),k=a.parentNode.childNodes.length,g=a.childNodes.length;b=b.shiftKey;for(var j=false,e=c,l;;){for(;b?e>=0:e<g;e=b?e-1:e+1)for(l=e==c&&!j?b?d-1:d+1:b?k-1:0;b?l>=0:l<k;l=b?l-1:l+1){if(e==c&&l==d)return;a=a.parentNode.childNodes[l];var o=$(a.childNodes[e]).find(":input");if(o.size()>0){setTimeout(function(){o.focus()},0);return}}e=b?g-1:0;j=true}}}else if(b.keyCode>=37&&b.keyCode<=40){j=b.target||b.srcElement;if(j.nodeName!="select"){c=q(b);if(c.el){a=c.el.parentNode;c=r(c.el);d=r(a);k=a.parentNode.childNodes.length;g=a.childNodes.length;switch(b.keyCode){case 39:if(i.hasTag(j,"INPUT")&&j.type=="text"){e=i.getSelectionRange(j);if(e.start!=j.value.length)return}d++;break;case 38:c--;break;case 37:if(i.hasTag(j,"INPUT")&&j.type=="text"){e=i.getSelectionRange(j);if(e.start!=0)return}d--;break;case 40:c++;break;default:return}i.cancelEvent(b);if(c>-1&&c<g&&d>-1&&d<k){a=a.parentNode.childNodes[d];o=$(a.childNodes[c]).find(":input");o.size()>0&&setTimeout(function(){o.focus()},0)}}}}};this.autoJavaScript=function(){if(h.parentNode==null){h=f=p=null;this.autoJavaScript=function(){}}else if(!i.isHidden(h)){var a=h.offsetWidth-i.px(h,"borderLeftWidth")-i.px(h,"borderRightWidth"),b=f.offsetWidth-f.clientWidth;a-=b;if(a>200&&a!=f.tw){f.tw=a;f.style.width=a+b+"px";p.style.width=a+"px"}}}}); |
function find(root, query) { var el = $(query); return el.length < 2 ? el : root.parent().find(query); } | (function($) { var t = $.tools.scrollable; t.navigator = { conf: { navi: '.navi', naviItem: null, activeClass: 'active', indexed: false, idPrefix: null, // 1.2 history: false } }; // jQuery plugin implementation $.fn.navigator = function(conf) { // configuration if (typeof conf == 'string') { conf = {navi: conf}; } conf = $.extend({}, t.navigator.conf, conf); var ret; this.each(function() { var api = $(this).data("scrollable"), navi = api.getRoot().parent().find(conf.navi), buttons = api.getNaviButtons(), cls = conf.activeClass, history = conf.history && $.fn.history; // @deprecated stuff if (api) { ret = api; } api.getNaviButtons = function() { return buttons.add(navi); }; function doClick(el, i, e) { api.seekTo(i); if (history) { if (location.hash) { location.hash = el.attr("href").replace("#", ""); } } else { return e.preventDefault(); } } function els() { return navi.find(conf.naviItem || '> *'); } function addItem(i) { var item = $("<" + (conf.naviItem || 'a') + "/>").click(function(e) { doClick($(this), i, e); }).attr("href", "#" + i); // index number / id attribute if (i === 0) { item.addClass(cls); } if (conf.indexed) { item.text(i + 1); } if (conf.idPrefix) { item.attr("id", conf.idPrefix + i); } return item.appendTo(navi); } // generate navigator if (els().length) { els().each(function(i) { $(this).click(function(e) { doClick($(this), i, e); }); }); } else { $.each(api.getItems(), function(i) { addItem(i); }); } // activate correct entry api.onBeforeSeek(function(e, index) { var el = els().eq(index); if (!e.isDefaultPrevented() && el.length) { els().removeClass(cls).eq(index).addClass(cls); } }); function doHistory(evt, hash) { var el = els().eq(hash.replace("#", "")); if (!el.length) { el = els().filter("[href=" + hash + "]"); } el.click(); } // new item being added api.onAddItem(function(e, item) { item = addItem(api.getItems().index(item)); if (history) { item.history(doHistory); } }); if (history) { els().history(doHistory); } }); return conf.api ? ret : this; }; })(jQuery); |
|
navi = api.getRoot().parent().find(conf.navi), | navi = find(api.getRoot(), conf.navi), | (function($) { var t = $.tools.scrollable; t.navigator = { conf: { navi: '.navi', naviItem: null, activeClass: 'active', indexed: false, idPrefix: null, // 1.2 history: false } }; // jQuery plugin implementation $.fn.navigator = function(conf) { // configuration if (typeof conf == 'string') { conf = {navi: conf}; } conf = $.extend({}, t.navigator.conf, conf); var ret; this.each(function() { var api = $(this).data("scrollable"), navi = api.getRoot().parent().find(conf.navi), buttons = api.getNaviButtons(), cls = conf.activeClass, history = conf.history && $.fn.history; // @deprecated stuff if (api) { ret = api; } api.getNaviButtons = function() { return buttons.add(navi); }; function doClick(el, i, e) { api.seekTo(i); if (history) { if (location.hash) { location.hash = el.attr("href").replace("#", ""); } } else { return e.preventDefault(); } } function els() { return navi.find(conf.naviItem || '> *'); } function addItem(i) { var item = $("<" + (conf.naviItem || 'a') + "/>").click(function(e) { doClick($(this), i, e); }).attr("href", "#" + i); // index number / id attribute if (i === 0) { item.addClass(cls); } if (conf.indexed) { item.text(i + 1); } if (conf.idPrefix) { item.attr("id", conf.idPrefix + i); } return item.appendTo(navi); } // generate navigator if (els().length) { els().each(function(i) { $(this).click(function(e) { doClick($(this), i, e); }); }); } else { $.each(api.getItems(), function(i) { addItem(i); }); } // activate correct entry api.onBeforeSeek(function(e, index) { var el = els().eq(index); if (!e.isDefaultPrevented() && el.length) { els().removeClass(cls).eq(index).addClass(cls); } }); function doHistory(evt, hash) { var el = els().eq(hash.replace("#", "")); if (!el.length) { el = els().filter("[href=" + hash + "]"); } el.click(); } // new item being added api.onAddItem(function(e, item) { item = addItem(api.getItems().index(item)); if (history) { item.history(doHistory); } }); if (history) { els().history(doHistory); } }); return conf.api ? ret : this; }; })(jQuery); |
this.ctx = canvas.getContext('webgl'); | this.ctx = canvas.getContext('webgl', {antialias: true}); | function(APP, canvas) { jQuery.data(canvas, 'obj', this); var self = this; var WT = APP.WT; var vec3 = WT.glMatrix.vec3; var mat3 = WT.glMatrix.mat3; var mat4 = WT.glMatrix.mat4; this.ctx = null; // Placeholders for the initializeGL and paintGL functions, // which will be overwritten by whatever is rendered this.initializeGL = function() {}; this.paintGL = function() {}; var dragPreviousXY = null; var lookAtCenter = null; var lookAtUpDir = null; var lookAtPitchRate = 0; var lookAtYawRate = 0; var cameraMatrix = null; var walkFrontRate = 0; var walkYawRate = 0; this.discoverContext = function(noGLHandler) { if (canvas.getContext) { try { this.ctx = canvas.getContext('webgl'); } catch (e) {} if (this.ctx == null) { try { this.ctx = canvas.getContext('experimental-webgl'); } catch (e) {} } if (this.ctx == null) { var alternative = canvas.firstChild; var parentNode = canvas.parentNode; parentNode.replaceChild(alternative, canvas); noGLHandler(); } } return this.ctx; }; this.setLookAtParams = function(matrix, center, up, pitchRate, yawRate) { cameraMatrix = matrix; lookAtCenter = center; lookAtUpDir = up; lookAtPitchRate = pitchRate; lookAtYawRate = yawRate; }; this.mouseDragLookAt = function(o, event) { if (this.ctx == null) return; // no WebGL support var c = WT.pageCoordinates(event); var dx=(c.x - dragPreviousXY.x); var dy=(c.y - dragPreviousXY.y); var s=vec3.create(); s[0]=cameraMatrix[0]; s[1]=cameraMatrix[4]; s[2]=cameraMatrix[8]; var r=mat4.create(); mat4.identity(r); mat4.translate(r, lookAtCenter); mat4.rotate(r, dy * lookAtPitchRate, s); mat4.rotate(r, dx * lookAtYawRate, lookAtUpDir); vec3.negate(lookAtCenter); mat4.translate(r, lookAtCenter); vec3.negate(lookAtCenter); mat4.multiply(cameraMatrix,r,cameraMatrix); //console.log('mouseDragLookAt after: ' + mat4.str(cameraMatrix)); // Repaint! //console.log('mouseDragLookAt: repaint'); this.paintGL(); // store mouse coord for next action dragPreviousXY = WT.pageCoordinates(event); }; // Mouse wheel = zoom in/out this.mouseWheelLookAt = function(o, event) { if (this.ctx == null) return; // no WebGL support WT.cancelEvent(event); //alert('foo'); var d = WT.wheelDelta(event); var s = Math.pow(1.2, d); mat4.translate(cameraMatrix, lookAtCenter); mat4.scale(cameraMatrix, [s, s, s]); vec3.negate(lookAtCenter); mat4.translate(cameraMatrix, lookAtCenter); vec3.negate(lookAtCenter); // Repaint! this.paintGL(); }; this.setWalkParams = function(matrix, frontRate, yawRate) { cameraMatrix = matrix; walkFrontRate = frontRate; walkYawRate = yawRate; }; this.mouseDragWalk = function(o, event){ if (this.ctx == null) return; // no WebGL support var c = WT.pageCoordinates(event); var dx=(c.x - dragPreviousXY.x); var dy=(c.y - dragPreviousXY.y); var r=mat4.create(); mat4.identity(r); mat4.rotateY(r, dx * walkYawRate); var t=vec3.create(); t[0]=0; t[1]=0; t[2]=-walkFrontRate * dy; mat4.translate(r, t); mat4.multiply(r, cameraMatrix, cameraMatrix); this.paintGL(); dragPreviousXY = WT.pageCoordinates(event); }; this.mouseDown = function(o, event) { WT.capture(null); WT.capture(canvas); dragPreviousXY = WT.pageCoordinates(event); }; this.mouseUp = function(o, event) { if (dragPreviousXY != null) dragPreviousXY = null; }; }); |
key.accidentals.each(function(acc) { var pitch = pitches[acc.note]; pitch = pitch - mid; acc.verticalPos = pitch % 14; | key.each(function(k) { ret.accidentals.push(Object.clone(k)); | key.accidentals.each(function(acc) { var pitch = pitches[acc.note]; pitch = pitch - mid; acc.verticalPos = pitch % 14; // Always keep this on the two octaves on the staff }); |
showArtifactContainer : function(record) { if ('COLLAPSED' == record.get('version') || 'COLLAPSED' == record.get('packaging') || 'COLLAPSED' == record.get('classifier')) { return false; } return true; }, | Sonatype.Events.addListener('searchTypeInit', function(searchTypes, panel) { // keyword is the default, we always want first in list searchTypes.splice(0, 0, { value : 'quick', text : 'Keyword Search', scope : panel, handler : panel.switchSearchType, defaultQuickSearch : true, // use the default store store : null, showArtifactContainer : function(record) { if ('COLLAPSED' == record.get('version') || 'COLLAPSED' == record.get('packaging') || 'COLLAPSED' == record.get('classifier')) { return false; } return true; }, quickSearchCheckHandler : function(panel, value) { return true; }, quickSearchHandler : function(panel, value) { panel.getTopToolbar().items.itemAt(1).setRawValue(value); }, searchHandler : function(panel) { var value = panel.getTopToolbar().items.itemAt(1).getRawValue(); if (value) { panel.grid.store.baseParams = {}; panel.grid.store.baseParams['q'] = value; panel.grid.store.baseParams['collapseresults'] = true; panel.fetchRecords(panel); } }, applyBookmarkHandler : function(panel, data) { panel.extraData = null; panel.getTopToolbar().items.itemAt(1).setRawValue(data[1]); panel.startSearch(panel, false); }, getBookmarkHandler : function(panel) { var result = panel.searchTypeButton.value; result += '~'; result += panel.getTopToolbar().items.itemAt(1).getRawValue(); return result; }, panelItems : [{ xtype : 'nexussearchfield', name : 'single-search-field', searchPanel : panel, width : 300 }] }); }); |
|
a.style.display="";g.isHidden(a)||g.fitToWindow(a,b,f,b,f)};this.Horizontal=1;this.Vertical=2;this.positionAtWidget=function(a,b,f,l){a=g.getElement(a);b=g.getElement(b);var n=g.widgetPageCoordinates(b),o;if(l){a.parentNode.removeChild(a);$(".Wt-domRoot").get(0).appendChild(a)}a.style.position="absolute";a.style.display="block";if(f==g.Horizontal){f=n.x+b.offsetWidth;l=n.y;o=n.x;b=n.y+b.offsetHeight}else{f=n.x;l=n.y+b.offsetHeight;o=n.x+b.offsetWidth;b=n.y}g.fitToWindow(a,f,l,o,b);a.style.visibility= ""};this.hasFocus=function(a){return a==document.activeElement};this.history=function(){function a(){var k,h;h=location.href;k=h.indexOf("#");return k>=0?h.substr(k+1):null}function b(){J.value=x+"|"+D;if(u)J.value+="|"+O.join(",")}function f(k){if(k){if(!k||D!==k){D=k||x;Y(unescape(D))}}else{D=x;Y(unescape(D))}}function l(k){var h;k='<html><body><div id="state">'+k+"</div></body></html>";try{h=C.contentWindow.document;h.open();h.write(k);h.close();return true}catch(s){return false}}function n(){var k, h,s,A;if(!C.contentWindow||!C.contentWindow.document)setTimeout(n,10);else{k=C.contentWindow.document;s=(h=k.getElementById("state"))?h.innerText:null;A=a();setInterval(function(){var H,E;k=C.contentWindow.document;H=(h=k.getElementById("state"))?h.innerText:null;E=a();if(H!==s){s=H;f(s);E=s?s:x;A=location.hash=E;b()}else if(E!==A){A=E;l(E)}},50);K=true;r!=null&&r()}}function o(){if(!q){var k=a(),h=history.length;M&&clearInterval(M);M=setInterval(function(){var s,A;s=a();A=history.length;if(s!==k){k= s;h=A;f(k);b()}else if(A!==h&&u){k=s;h=A;s=O[h-1];f(s);b()}},50)}}function L(){var k;k=J.value.split("|");if(k.length>1){x=k[0];D=k[1]}if(k.length>2)O=k[2].split(",");if(q)n();else{o();K=true;r!=null&&r()}}var u=false,q=g.isIElt9,B=false,r=null,C=null,J=null,K=false,M=null,O=[],x,D,Y=function(){};return{onReady:function(k){if(K)setTimeout(function(){k()},0);else r=k},_initialize:function(){J!=null&&L()},_initTimeout:function(){o()},register:function(k,h){if(!K){D=x=escape(k);Y=h}},initialize:function(k, h){if(!K){var s=navigator.vendor||"";if(s!=="KDE")if(typeof window.opera!=="undefined")B=true;else if(!q&&s.indexOf("Apple Computer, Inc.")>-1)u=true;if(typeof k==="string")k=document.getElementById(k);if(!(!k||k.tagName.toUpperCase()!=="TEXTAREA"&&(k.tagName.toUpperCase()!=="INPUT"||k.type!=="hidden"&&k.type!=="text"))){J=k;if(q){if(typeof h==="string")h=document.getElementById(h);!h||h.tagName.toUpperCase()!=="IFRAME"||(C=h)}}}},navigate:function(k){if(K){fqstate=k;if(q)l(fqstate);else{location.hash= fqstate;if(u){O[history.length]=fqstate;b()}}}},getCurrentState:function(){if(!K)return"";return D}}}()}); | g.isHidden(a)||g.fitToWindow(a,b,f,b,f)};this.Horizontal=1;this.Vertical=2;this.positionAtWidget=function(a,b,f,l){a=g.getElement(a);b=g.getElement(b);var n=g.widgetPageCoordinates(b),o;if(l){a.parentNode.removeChild(a);$(".Wt-domRoot").get(0).appendChild(a)}a.style.position="absolute";a.style.display="block";if(f==g.Horizontal){f=n.x+b.offsetWidth;l=n.y;o=n.x;b=n.y+b.offsetHeight}else{f=n.x;l=n.y+b.offsetHeight;o=n.x+b.offsetWidth;b=n.y}g.fitToWindow(a,f,l,o,b);a.style.visibility=""};this.hasFocus= function(a){return a==document.activeElement};this.history=function(){function a(){var k,h;h=location.href;k=h.indexOf("#");return k>=0?h.substr(k+1):null}function b(){J.value=x+"|"+D;if(u)J.value+="|"+O.join(",")}function f(k){if(k){if(!k||D!==k){D=k||x;Y(unescape(D))}}else{D=x;Y(unescape(D))}}function l(k){var h;k='<html><body><div id="state">'+k+"</div></body></html>";try{h=C.contentWindow.document;h.open();h.write(k);h.close();return true}catch(s){return false}}function n(){var k,h,s,A;if(!C.contentWindow|| !C.contentWindow.document)setTimeout(n,10);else{k=C.contentWindow.document;s=(h=k.getElementById("state"))?h.innerText:null;A=a();setInterval(function(){var H,E;k=C.contentWindow.document;H=(h=k.getElementById("state"))?h.innerText:null;E=a();if(H!==s){s=H;f(s);E=s?s:x;A=location.hash=E;b()}else if(E!==A){A=E;l(E)}},50);K=true;r!=null&&r()}}function o(){if(!q){var k=a(),h=history.length;M&&clearInterval(M);M=setInterval(function(){var s,A;s=a();A=history.length;if(s!==k){k=s;h=A;f(k);b()}else if(A!== h&&u){k=s;h=A;s=O[h-1];f(s);b()}},50)}}function L(){var k;k=J.value.split("|");if(k.length>1){x=k[0];D=k[1]}if(k.length>2)O=k[2].split(",");if(q)n();else{o();K=true;r!=null&&r()}}var u=false,q=g.isIElt9,B=false,r=null,C=null,J=null,K=false,M=null,O=[],x,D,Y=function(){};return{onReady:function(k){if(K)setTimeout(function(){k()},0);else r=k},_initialize:function(){J!=null&&L()},_initTimeout:function(){o()},register:function(k,h){if(!K){D=x=escape(k);Y=h}},initialize:function(k,h){if(!K){var s=navigator.vendor|| "";if(s!=="KDE")if(typeof window.opera!=="undefined")B=true;else if(!q&&s.indexOf("Apple Computer, Inc.")>-1)u=true;if(typeof k==="string")k=document.getElementById(k);if(!(!k||k.tagName.toUpperCase()!=="TEXTAREA"&&(k.tagName.toUpperCase()!=="INPUT"||k.type!=="hidden"&&k.type!=="text"))){J=k;if(q){if(typeof h==="string")h=document.getElementById(h);!h||h.tagName.toUpperCase()!=="IFRAME"||(C=h)}}}},navigate:function(k){if(K){fqstate=k;if(q)l(fqstate);else{location.hash=fqstate;if(u){O[history.length]= fqstate;b()}}}},getCurrentState:function(){if(!K)return"";return D}}}()}); | window._$_WT_CLASS_$_=new (function(){function w(a,b){return a.style[b]?a.style[b]:document.defaultView&&document.defaultView.getComputedStyle?document.defaultView.getComputedStyle(a,null)[b]:a.currentStyle?a.currentStyle[b]:null}function v(a,b,f){if(a=="auto"||a==null)return f;return(a=(a=b.exec(a))&&a.length==2?a[1]:null)?parseFloat(a):f}function G(a){return v(a,/^\s*(-?\d+(?:\.\d+)?)\s*px\s*$/i,0)}function U(a,b){return v(a,/^\s*(-?\d+(?:\.\d+)?)\s*\%\s*$/i,b)}function ca(a){if(z==null)return null;if(!a)a=window.event;if(a){for(var b=a=g.target(a);b&&b!=z;)b=b.parentNode;return b==z?g.isIElt9?a:null:z}else return z}function V(a){var b=ca(a);if(b&&!N){if(!a)a=window.event;N=true;if(g.isIElt9){g.firedTarget=a.srcElement||b;b.fireEvent("onmousemove",a);g.firedTarget=null}else g.condCall(b,"onmousemove",a);return N=false}else return true}function R(a){var b=ca(a);g.capture(null);if(b){if(!a)a=window.event;if(g.isIElt9){g.firedTarget=a.srcElement||b;b.fireEvent("onmouseup",a);g.firedTarget=null}else g.condCall(b,"onmouseup",a);g.cancelEvent(a,g.CancelPropagate);return false}else return true}function W(){if(!da){da=true;if(document.body.addEventListener){var a=document.body;a.addEventListener("mousemove",V,true);a.addEventListener("mouseup",R,true);g.isGecko&&window.addEventListener("mouseout",function(b){!b.relatedTarget&&g.hasTag(b.target,"HTML")&&R(b)},true)}else{a=document.body;a.attachEvent("onmousemove",V);a.attachEvent("onmouseup",R)}}}var g=this;this.buttons=0;this.mouseDown=function(a){g.buttons|=g.button(a)};this.mouseUp=function(a){g.buttons^=g.button(a)};this.arrayRemove=function(a,b,f){f=a.slice((f||b)+1||a.length);a.length=b<0?a.length+b:b;return a.push.apply(a,f)};var X=function(){for(var a,b=3,f=document.createElement("div"),l=f.getElementsByTagName("i");f.innerHTML="<!--[if gt IE "+ ++b+"]><i></i><![endif]--\>",l[0];);return b>4?b:a}();this.isIE=X!==undefined;this.isIE6=X===6;this.isIElt9=X<9;this.isGecko=navigator.userAgent.toLowerCase().indexOf("gecko")!=-1;this.isIEMobile=navigator.userAgent.toLowerCase().indexOf("msie 4")!=-1||navigator.userAgent.toLowerCase().indexOf("msie 5")!=-1;this.isOpera=typeof window.opera!=="undefined";this.updateDelay=this.isIE?10:51;this.setHtml=function(a,b,f){function l(o,L){var u,q,B;switch(o.nodeType){case 1:u=o.namespaceURI==null?document.createElement(o.nodeName):document.createElementNS(o.namespaceURI,o.nodeName);if(o.attributes&&o.attributes.length>0){q=0;for(B=o.attributes.length;q<B;)u.setAttribute(o.attributes[q].nodeName,o.getAttribute(o.attributes[q++].nodeName))}if(L&&o.childNodes.length>0){q=0;for(B=o.childNodes.length;q<B;){var r=l(o.childNodes[q++],L);r&&u.appendChild(r)}}return u;case 3:case 4:case 5:return document.createTextNode(o.nodeValue)}return null}if(g.isIE||_$_INNER_HTML_$_&&!f)if(f)a.innerHTML+=b;else a.innerHTML=b;else{var n;n=new DOMParser;n=n.parseFromString("<div>"+b+"</div>","application/xhtml+xml").documentElement;if(n.nodeType!=1)n=n.nextSibling;if(!f)a.innerHTML="";b=0;for(f=n.childNodes.length;b<f;)a.appendChild(l(n.childNodes[b++],true))}};this.hasTag=function(a,b){return a.nodeType==1&&a.tagName.toUpperCase()===b};this.insertAt=function(a,b,f){a.childNodes.length==0?a.appendChild(b):a.insertBefore(b,a.childNodes[f])};this.remove=function(a){(a=g.getElement(a))&&a.parentNode.removeChild(a)};this.unstub=function(a,b,f){if(f==1){if(a.style.display!="none")b.style.display=a.style.display}else{b.style.position=a.style.position;b.style.left=a.style.left;b.style.visibility=a.style.visibility}if(a.style.height)b.style.height=a.style.height;if(a.style.width)b.style.width=a.style.width};this.unwrap=function(a){a=g.getElement(a);if(a.parentNode.className.indexOf("Wt-wrap")==0){var b=a;a=a.parentNode;if(a.className.length>=8)b.className=a.className.substring(8);g.isIE?b.style.setAttribute("cssText",a.getAttribute("style")):b.setAttribute("style",a.getAttribute("style"));a.parentNode.replaceChild(b,a)}else{if(a.getAttribute("type")=="submit"){a.setAttribute("type","button");a.removeAttribute("name")}if(g.hasTag(a,"INPUT")&&a.getAttribute("type")=="image"){b=document.createElement("img");if(b.mergeAttributes){b.mergeAttributes(a,false);b.src=a.src}else if(a.attributes&&a.attributes.length>0){var f,l;f=0;for(l=a.attributes.length;f<l;f++){var n=a.attributes[f].nodeName;n!="type"&&n!="name"&&b.setAttribute(n,a.getAttribute(n))}}a.parentNode.replaceChild(b,a)}}};var N=false;this.CancelPropagate=1;this.CancelDefaultAction=2;this.CancelAll=3;this.cancelEvent=function(a,b){if(!N){b=b===undefined?g.CancelAll:b;if(b&g.CancelDefaultAction)if(a.preventDefault)a.preventDefault();else a.returnValue=false;if(b&g.CancelPropagate){if(a.stopPropagation)a.stopPropagation();else a.cancelBubble=true;try{document.activeElement&&document.activeElement.blur&&g.hasTag(document.activeElement,"TEXTAREA")&&document.activeElement.blur()}catch(f){}}}};this.getElement=function(a){var b=document.getElementById(a);if(!b)for(var f=0;f<window.frames.length;++f)try{if(b=window.frames[f].document.getElementById(a))return b}catch(l){}return b};this.widgetPageCoordinates=function(a){var b=0,f=0,l;if(g.hasTag(a,"AREA"))a=a.parentNode.nextSibling;for(;a;){b+=a.offsetLeft;f+=a.offsetTop;if(w(a,"position")=="fixed"){b+=document.body.scrollLeft+document.documentElement.scrollLeft;f+=document.body.scrollTop+document.documentElement.scrollTop;break}l=a.offsetParent;if(l==null)a=null;else{do{a=a.parentNode;if(g.hasTag(a,"DIV")){b-=a.scrollLeft;f-=a.scrollTop}}while(a!=null&&a!=l)}}return{x:b,y:f}};this.widgetCoordinates=function(a,b){b=g.pageCoordinates(b);a=g.widgetPageCoordinates(a);return{x:b.x-a.x,y:b.y-a.y}};this.pageCoordinates=function(a){if(!a)a=window.event;var b=0,f=0;if(a.pageX||a.pageY){b=a.pageX;f=a.pageY}else if(a.clientX||a.clientY){b=a.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;f=a.clientY+document.body.scrollTop+document.documentElement.scrollTop}return{x:b,y:f}};this.windowCoordinates=function(a){a=g.pageCoordinates(a);return{x:a.x-document.body.scrollLeft-document.documentElement.scrollLeft,y:a.y-document.body.scrollTop-document.documentElement.scrollTop}};this.wheelDelta=function(a){var b=0;if(a.wheelDelta)b=a.wheelDelta>0?1:-1;else if(a.detail)b=a.detail<0?1:-1;return b};this.scrollIntoView=function(a){(a=document.getElementById(a))&&a.scrollIntoView&&a.scrollIntoView(true)};this.getSelectionRange=function(a){if(document.selection)if(g.hasTag(a,"TEXTAREA")){var b=document.selection.createRange(),f=b.duplicate();f.moveToElementText(a);var l=0;if(b.text.length>1){l-=b.text.length;if(l<0)l=0}a=-1+l;for(f.moveStart("character",l);f.inRange(b);){f.moveStart("character");a++}b=b.text.replace(/\r/g,"");return{start:a,end:b.length+a}}else{f=$(a).val();a=document.selection.createRange().duplicate();a.moveEnd("character",f.length);b=a.text==""?f.length:f.lastIndexOf(a.text);a=document.selection.createRange().duplicate();a.moveStart("character",-f.length);return{start:b,end:a.text.length}}else return a.selectionStart||a.selectionStart==0?{start:a.selectionStart,end:a.selectionEnd}:{start:-1,end:-1}};this.setSelectionRange=function(a,b,f){var l=$(a).val();if(typeof b!="number")b=-1;if(typeof f!="number")f=-1;if(b<0)b=0;if(f>l.length)f=l.length;if(f<b)f=b;if(b>f)b=f;a.focus();if(typeof a.selectionStart!=="undefined"){a.selectionStart=b;a.selectionEnd=f}else if(document.selection){a=a.createTextRange();a.collapse(true);a.moveStart("character",b);a.moveEnd("character",f-b);a.select()}};this.isKeyPress=function(a){if(!a)a=window.event;if(a.altKey||a.ctrlKey||a.metaKey)return false;return(typeof a.charCode!=="undefined"?a.charCode:0)>0||g.isIE?true:g.isOpera?a.keyCode==13||a.keyCode==27||a.keyCode>=32&&a.keyCode<125:a.keyCode==13||a.keyCode==27||a.keyCode==32||a.keyCode>46&&a.keyCode<112};this.px=function(a,b){return G(w(a,b))};this.pxself=function(a,b){return G(a.style[b])};this.pctself=function(a,b){return U(a.style[b],0)};this.isHidden=function(a){if(a.style.display=="none")return true;else{a=a.parentNode;return a!=null&&a.tagName.toLowerCase()!="body"?g.isHidden(a):false}};this.IEwidth=function(a,b,f){if(a.parentNode){var l=a.parentNode.clientWidth-g.px(a,"marginLeft")-g.px(a,"marginRight")-g.px(a,"borderLeftWidth")-g.px(a,"borderRightWidth")-g.px(a.parentNode,"paddingLeft")-g.px(a.parentNode,"paddingRight");b=U(b,0);f=U(f,1E5);return l<b?b-1:l>f?f+1:a.style.styleFloat!=""?b-1:"auto"}else return"auto"};this.hide=function(a){g.getElement(a).style.display="none"};this.inline=function(a){g.getElement(a).style.display="inline"};this.block=function(a){g.getElement(a).style.display="block"};this.show=function(a){g.getElement(a).style.display=""};var z=null;this.firedTarget=null;this.target=function(a){return g.firedTarget||a.target||a.srcElement};var da=false;this.capture=function(a){W();if(!(z&&a)){z=a;var b=document.body;if(b.setCapture)a!=null?b.setCapture():b.releaseCapture();if(a!=null){$(b).addClass("unselectable");b.setAttribute("unselectable","on");b.onselectstart="return false;"}else{$(b).removeClass("unselectable");b.setAttribute("unselectable","off");b.onselectstart=""}}};this.checkReleaseCapture=function(a,b){z&&a==z&&b.type=="mouseup"&&this.capture(null)};this.getElementsByClassName=function(a,b){if(document.getElementsByClassName)return b.getElementsByClassName(a);else{b=b.getElementsByTagName("*");for(var f=[],l,n=0,o=b.length;n<o;n++){l=b[n];l.className.indexOf(a)!=-1&&f.push(l)}return f}};this.addCss=function(a,b){var f=document.styleSheets[0];f.insertRule(a+" { "+b+" }",f.cssRules.length)};this.addCssText=function(a){var b=document.getElementById("Wt-inline-css");if(!b){b=document.createElement("style");document.getElementsByTagName("head")[0].appendChild(b)}if(b.styleSheet){var f=document.createElement("style");if(b)b.parentNode.insertBefore(f,b);else{f.id="Wt-inline-css";document.getElementsByTagName("head")[0].appendChild(f)}f.styleSheet.cssText=a}else{a=document.createTextNode(a);b.appendChild(a)}};this.getCssRule=function(a,b){a=a.toLowerCase();if(document.styleSheets)for(var f=0;f<document.styleSheets.length;f++){var l=document.styleSheets[f],n=0,o;do{o=null;if(l.cssRules)o=l.cssRules[n];else if(l.rules)o=l.rules[n];if(o&&o.selectorText)if(o.selectorText.toLowerCase()==a)if(b=="delete"){l.cssRules?l.deleteRule(n):l.removeRule(n);return true}else return o;++n}while(o)}return false};this.removeCssRule=function(a){return g.getCssRule(a,"delete")};this.addStyleSheet=function(a,b){if(document.createStyleSheet)setTimeout(function(){document.createStyleSheet(a)},15);else{var f=document.createElement("link");f.setAttribute("type","text/css");f.setAttribute("href",a);f.setAttribute("type","text/css");f.setAttribute("rel","stylesheet");b!=""&&b!="all"&&f.setAttribute("media",b);document.getElementsByTagName("head")[0].appendChild(f)}};this.windowSize=function(){var a,b;if(typeof window.innerWidth==="number"){a=window.innerWidth;b=window.innerHeight}else{a=document.documentElement.clientWidth;b=document.documentElement.clientHeight}return{x:a,y:b}};this.fitToWindow=function(a,b,f,l,n){var o=g.windowSize(),L=document.body.scrollLeft+document.documentElement.scrollLeft,u=document.body.scrollTop+document.documentElement.scrollTop,q=g.widgetPageCoordinates(a.offsetParent),B=["left","right"],r=["top","bottom"],C=g.px(a,"maxWidth")||a.offsetWidth,J=g.px(a,"maxHeight")||a.offsetHeight;if(b+C>L+o.x){l-=q.x;b=a.offsetParent.offsetWidth-(l+g.px(a,"marginRight"));l=1}else{b-=q.x;b-=g.px(a,"marginLeft");l=0}if(f+J>u+o.y){if(n>u+o.y)n=u+o.y;n-=q.y;f=a.offsetParent.offsetHeight-(n+g.px(a,"marginBottom"));n=1}else{f-=q.y;f-=g.px(a,"marginTop");n=0}a.style[B[l]]=b+"px";a.style[B[1-l]]="";a.style[r[n]]=f+"px";a.style[r[1-n]]=""};this.positionXY=function(a,b,f){a=g.getElement(a);a.style.display="";g.isHidden(a)||g.fitToWindow(a,b,f,b,f)};this.Horizontal=1;this.Vertical=2;this.positionAtWidget=function(a,b,f,l){a=g.getElement(a);b=g.getElement(b);var n=g.widgetPageCoordinates(b),o;if(l){a.parentNode.removeChild(a);$(".Wt-domRoot").get(0).appendChild(a)}a.style.position="absolute";a.style.display="block";if(f==g.Horizontal){f=n.x+b.offsetWidth;l=n.y;o=n.x;b=n.y+b.offsetHeight}else{f=n.x;l=n.y+b.offsetHeight;o=n.x+b.offsetWidth;b=n.y}g.fitToWindow(a,f,l,o,b);a.style.visibility=""};this.hasFocus=function(a){return a==document.activeElement};this.history=function(){function a(){var k,h;h=location.href;k=h.indexOf("#");return k>=0?h.substr(k+1):null}function b(){J.value=x+"|"+D;if(u)J.value+="|"+O.join(",")}function f(k){if(k){if(!k||D!==k){D=k||x;Y(unescape(D))}}else{D=x;Y(unescape(D))}}function l(k){var h;k='<html><body><div id="state">'+k+"</div></body></html>";try{h=C.contentWindow.document;h.open();h.write(k);h.close();return true}catch(s){return false}}function n(){var k,h,s,A;if(!C.contentWindow||!C.contentWindow.document)setTimeout(n,10);else{k=C.contentWindow.document;s=(h=k.getElementById("state"))?h.innerText:null;A=a();setInterval(function(){var H,E;k=C.contentWindow.document;H=(h=k.getElementById("state"))?h.innerText:null;E=a();if(H!==s){s=H;f(s);E=s?s:x;A=location.hash=E;b()}else if(E!==A){A=E;l(E)}},50);K=true;r!=null&&r()}}function o(){if(!q){var k=a(),h=history.length;M&&clearInterval(M);M=setInterval(function(){var s,A;s=a();A=history.length;if(s!==k){k=s;h=A;f(k);b()}else if(A!==h&&u){k=s;h=A;s=O[h-1];f(s);b()}},50)}}function L(){var k;k=J.value.split("|");if(k.length>1){x=k[0];D=k[1]}if(k.length>2)O=k[2].split(",");if(q)n();else{o();K=true;r!=null&&r()}}var u=false,q=g.isIElt9,B=false,r=null,C=null,J=null,K=false,M=null,O=[],x,D,Y=function(){};return{onReady:function(k){if(K)setTimeout(function(){k()},0);else r=k},_initialize:function(){J!=null&&L()},_initTimeout:function(){o()},register:function(k,h){if(!K){D=x=escape(k);Y=h}},initialize:function(k,h){if(!K){var s=navigator.vendor||"";if(s!=="KDE")if(typeof window.opera!=="undefined")B=true;else if(!q&&s.indexOf("Apple Computer, Inc.")>-1)u=true;if(typeof k==="string")k=document.getElementById(k);if(!(!k||k.tagName.toUpperCase()!=="TEXTAREA"&&(k.tagName.toUpperCase()!=="INPUT"||k.type!=="hidden"&&k.type!=="text"))){J=k;if(q){if(typeof h==="string")h=document.getElementById(h);!h||h.tagName.toUpperCase()!=="IFRAME"||(C=h)}}}},navigate:function(k){if(K){fqstate=k;if(q)l(fqstate);else{location.hash=fqstate;if(u){O[history.length]=fqstate;b()}}}},getCurrentState:function(){if(!K)return"";return D}}}()}); |
WT_DECLARE_WT_MEMBER(1,"WGLWidget",function(p,j){jQuery.data(j,"obj",this);var h=p.WT;this.ctx=null;this.initializeGL=function(){};this.paintGL=function(){};var f=null,g=null,k=null,l=0,m=0,c=null,n=0,o=0;this.discoverContext=function(){if(j.getContext){this.ctx=j.getContext("experimental-webgl");if(this.ctx==null)this.ctx=j.getContext("webgl");this.ctx==null&&console.log("WGLWidget: failed to get a webgl context")}console.log("ctx: "+this.ctx);return this.ctx};this.setLookAtParams=function(a,b,d, e,i){c=a;g=b;k=d;l=e;m=i};this.mouseDragLookAt=function(a,b){var d=h.pageCoordinates(b);a=d.x-f.x;d=d.y-f.y;var e=vec3.create();e[0]=c[0];e[1]=c[4];e[2]=c[8];var i=mat4.create();mat4.identity(i);mat4.translate(i,g);mat4.rotate(i,d*l,e);mat4.rotate(i,a*m,k);vec3.negate(g);mat4.translate(i,g);vec3.negate(g);mat4.multiply(c,i,c);console.log("mouseDragLookAt after: "+mat4.str(c));console.log("mouseDragLookAt: repaint");this.paintGl();f=h.pageCoordinates(b)};this.mouseWheelLookAt=function(a,b){a=h.wheelDelta(b); b=Math.pow(1.2,a);console.log("mouseWheelLookAt: "+a);mat4.translate(c,g);mat4.scale(c,[b,b,b]);vec3.negate(g);mat4.translate(c,g);vec3.negate(g);console.log("mouseWheelLookAt: repaint");this.paintGl()};this.setWalkParams=function(a,b,d){c=a;n=b;o=d};this.mouseDragWalk=function(a,b){var d=h.pageCoordinates(b);a=d.x-f.x;d=d.y-f.y;var e=mat4.create();mat4.identity(e);mat4.rotateY(e,a*o);a=vec3.create();a[0]=0;a[1]=0;a[2]=-n*d;mat4.translate(e,a);mat4.multiply(e,c,c);this.paintGl();f=h.pageCoordinates(b)}; this.mouseDown=function(a,b){h.capture(null);h.capture(j);f=h.pageCoordinates(b)};this.mouseUp=function(){if(f!=null)f=null}}); | WT_DECLARE_WT_MEMBER(1,"WGLWidget",function(r,l){jQuery.data(l,"obj",this);var f=r.WT,k=f.glMatrix.vec3,b=f.glMatrix.mat4;this.ctx=null;this.initializeGL=function(){};this.paintGL=function(){};var h=null,i=null,m=null,n=0,o=0,e=null,p=0,q=0;this.discoverContext=function(){if(l.getContext){this.ctx=l.getContext("experimental-webgl");if(this.ctx==null)this.ctx=l.getContext("webgl");this.ctx==null&&console.log("WGLWidget: failed to get a webgl context")}return this.ctx};this.setLookAtParams=function(a, c,d,g,j){e=a;i=c;m=d;n=g;o=j};this.mouseDragLookAt=function(a,c){var d=f.pageCoordinates(c);a=d.x-h.x;d=d.y-h.y;var g=k.create();g[0]=e[0];g[1]=e[4];g[2]=e[8];var j=b.create();b.identity(j);b.translate(j,i);b.rotate(j,d*n,g);b.rotate(j,a*o,m);k.negate(i);b.translate(j,i);k.negate(i);b.multiply(e,j,e);this.paintGl();h=f.pageCoordinates(c)};this.mouseWheelLookAt=function(a,c){f.cancelEvent(c);a=f.wheelDelta(c);a=Math.pow(1.2,a);b.translate(e,i);b.scale(e,[a,a,a]);k.negate(i);b.translate(e,i);k.negate(i); this.paintGl()};this.setWalkParams=function(a,c,d){e=a;p=c;q=d};this.mouseDragWalk=function(a,c){var d=f.pageCoordinates(c);a=d.x-h.x;d=d.y-h.y;var g=b.create();b.identity(g);b.rotateY(g,a*q);a=k.create();a[0]=0;a[1]=0;a[2]=-p*d;b.translate(g,a);b.multiply(g,e,e);this.paintGl();h=f.pageCoordinates(c)};this.mouseDown=function(a,c){f.capture(null);f.capture(l);h=f.pageCoordinates(c)};this.mouseUp=function(){if(h!=null)h=null}}); | WT_DECLARE_WT_MEMBER(1,"WGLWidget",function(p,j){jQuery.data(j,"obj",this);var h=p.WT;this.ctx=null;this.initializeGL=function(){};this.paintGL=function(){};var f=null,g=null,k=null,l=0,m=0,c=null,n=0,o=0;this.discoverContext=function(){if(j.getContext){this.ctx=j.getContext("experimental-webgl");if(this.ctx==null)this.ctx=j.getContext("webgl");this.ctx==null&&console.log("WGLWidget: failed to get a webgl context")}console.log("ctx: "+this.ctx);return this.ctx};this.setLookAtParams=function(a,b,d,e,i){c=a;g=b;k=d;l=e;m=i};this.mouseDragLookAt=function(a,b){var d=h.pageCoordinates(b);a=d.x-f.x;d=d.y-f.y;var e=vec3.create();e[0]=c[0];e[1]=c[4];e[2]=c[8];var i=mat4.create();mat4.identity(i);mat4.translate(i,g);mat4.rotate(i,d*l,e);mat4.rotate(i,a*m,k);vec3.negate(g);mat4.translate(i,g);vec3.negate(g);mat4.multiply(c,i,c);console.log("mouseDragLookAt after: "+mat4.str(c));console.log("mouseDragLookAt: repaint");this.paintGl();f=h.pageCoordinates(b)};this.mouseWheelLookAt=function(a,b){a=h.wheelDelta(b);b=Math.pow(1.2,a);console.log("mouseWheelLookAt: "+a);mat4.translate(c,g);mat4.scale(c,[b,b,b]);vec3.negate(g);mat4.translate(c,g);vec3.negate(g);console.log("mouseWheelLookAt: repaint");this.paintGl()};this.setWalkParams=function(a,b,d){c=a;n=b;o=d};this.mouseDragWalk=function(a,b){var d=h.pageCoordinates(b);a=d.x-f.x;d=d.y-f.y;var e=mat4.create();mat4.identity(e);mat4.rotateY(e,a*o);a=vec3.create();a[0]=0;a[1]=0;a[2]=-n*d;mat4.translate(e,a);mat4.multiply(e,c,c);this.paintGl();f=h.pageCoordinates(b)};this.mouseDown=function(a,b){h.capture(null);h.capture(j);f=h.pageCoordinates(b)};this.mouseUp=function(){if(f!=null)f=null}}); |
vertical = conf.vertical || dim(root, "height") > dim(root, "width"); | vertical = conf.vertical; | (function($) { // static constructs $.tools = $.tools || {version: '@VERSION'}; $.tools.scrollable = { conf: { activeClass: 'active', circular: false, clonedClass: 'cloned', disabledClass: 'disabled', easing: 'swing', initialIndex: 0, item: null, items: '.items', keyboard: true, mousewheel: false, next: '.next', prev: '.prev', speed: 400, vertical: false, wheelSpeed: 0 } }; // get hidden element's width or height even though it's hidden function dim(el, key) { var v = parseInt(el.css(key), 10); if (v) { return v; } var s = el[0].currentStyle; return s && s.width && parseInt(s.width, 10); } function find(root, query) { var el = $(query); return el.length < 2 ? el : root.parent().find(query); } var current; // constructor function Scrollable(root, conf) { // current instance var self = this, fire = root.add(self), itemWrap = root.children(), index = 0, forward, vertical = conf.vertical || dim(root, "height") > dim(root, "width"); if (!current) { current = self; } if (itemWrap.length > 1) { itemWrap = $(conf.items, root); } // methods $.extend(self, { getConf: function() { return conf; }, getIndex: function() { return index; }, getSize: function() { return self.getItems().size(); }, getNaviButtons: function() { return prev.add(next); }, getRoot: function() { return root; }, getItemWrap: function() { return itemWrap; }, getItems: function() { return itemWrap.children(conf.item).not("." + conf.clonedClass); }, move: function(offset, time) { return self.seekTo(index + offset, time); }, next: function(time) { return self.move(1, time); }, prev: function(time) { return self.move(-1, time); }, begin: function(time) { return self.seekTo(0, time); }, end: function(time) { return self.seekTo(self.getSize() -1, time); }, focus: function() { current = self; return self; }, addItem: function(item) { item = $(item); if (!conf.circular) { itemWrap.append(item); } else { $(".cloned:last").before(item); $(".cloned:first").replaceWith(item.clone().addClass(conf.clonedClass)); } fire.trigger("onAddItem", [item]); return self; }, /* all seeking functions depend on this */ seekTo: function(i, time, fn) { // check that index is sane if (!conf.circular && i < 0 || i > self.getSize()) { return self; } var item = i; if (i.jquery) { i = self.getItems().index(i); } else { item = self.getItems().eq(i); } // onBeforeSeek var e = $.Event("onBeforeSeek"); if (!fn) { fire.trigger(e, [i, time]); if (e.isDefaultPrevented() || !item.length) { return self; } } var props = vertical ? {top: -item.position().top} : {left: -item.position().left}; itemWrap.animate(props, time, conf.easing, fn || function() { fire.trigger("onSeek", [i]); }); current = self; index = i; return self; } }); // callbacks $.each("onBeforeSeek,onSeek,onAddItem".split(","), function(i, name) { // configuration if ($.isFunction(conf[name])) { $(self).bind(name, conf[name]); } self[name] = function(fn) { $(self).bind(name, fn); return self; }; }); // circular loop if (conf.circular) { var cloned1 = self.getItems().slice(-1).clone().prependTo(itemWrap), cloned2 = self.getItems().eq(1).clone().appendTo(itemWrap); cloned1.add(cloned2).addClass(conf.clonedClass); self.onBeforeSeek(function(e, i, time) { if (e.isDefaultPrevented()) { return; } /* 1. animate to the clone without event triggering 2. seek to correct position with 0 speed */ if (i == -1) { self.seekTo(cloned1, time, function() { self.end(0); }); return e.preventDefault(); } else if (i == self.getSize()) { self.seekTo(cloned2, time, function() { self.begin(0); }); } }); } // next/prev buttons var prev = find(root, conf.prev).click(function() { self.prev(); }), next = find(root, conf.next).click(function() { self.next(); }); if (!conf.circular && self.getSize() > 2) { self.onBeforeSeek(function(e, i) { prev.toggleClass(conf.disabledClass, i <= 0); next.toggleClass(conf.disabledClass, i >= self.getSize() -1); }); } // mousewheel support if (conf.mousewheel && $.fn.mousewheel) { root.mousewheel(function(e, delta) { if (conf.mousewheel) { self.move(delta < 0 ? 1 : -1, conf.wheelSpeed || 50); return false; } }); } if (conf.keyboard) { $(document).bind("keydown.scrollable", function(evt) { // skip certain conditions if (!conf.keyboard || evt.altKey || evt.ctrlKey || $(evt.target).is(":input")) { return; } // does this instance have focus? if (conf.keyboard != 'static' && current != self) { return; } var key = evt.keyCode; if (vertical && (key == 38 || key == 40)) { self.move(key == 38 ? -1 : 1); return evt.preventDefault(); } if (!vertical && (key == 37 || key == 39)) { self.move(key == 37 ? -1 : 1); return evt.preventDefault(); } }); } // initial index $(self).trigger("onBeforeSeek", [conf.initialIndex]); self.seekTo(conf.initialIndex, 0, true); } // jQuery plugin implementation $.fn.scrollable = function(conf) { // already constructed --> return API var el = this.data("scrollable"); if (el) { return el; } conf = $.extend({}, $.tools.scrollable.conf, conf); this.each(function() { el = new Scrollable($(this), conf); $(this).data("scrollable", el); }); return conf.api ? el: this; }; })(jQuery); |
$.each("onBeforeSeek,onSeek,onAddItem".split(","), function(i, name) { | $.each(['onBeforeSeek', 'onSeek', 'onAddItem'], function(i, name) { | (function($) { // static constructs $.tools = $.tools || {version: '@VERSION'}; $.tools.scrollable = { conf: { activeClass: 'active', circular: false, clonedClass: 'cloned', disabledClass: 'disabled', easing: 'swing', initialIndex: 0, item: null, items: '.items', keyboard: true, mousewheel: false, next: '.next', prev: '.prev', speed: 400, vertical: false, wheelSpeed: 0 } }; // get hidden element's width or height even though it's hidden function dim(el, key) { var v = parseInt(el.css(key), 10); if (v) { return v; } var s = el[0].currentStyle; return s && s.width && parseInt(s.width, 10); } function find(root, query) { var el = $(query); return el.length < 2 ? el : root.parent().find(query); } var current; // constructor function Scrollable(root, conf) { // current instance var self = this, fire = root.add(self), itemWrap = root.children(), index = 0, forward, vertical = conf.vertical || dim(root, "height") > dim(root, "width"); if (!current) { current = self; } if (itemWrap.length > 1) { itemWrap = $(conf.items, root); } // methods $.extend(self, { getConf: function() { return conf; }, getIndex: function() { return index; }, getSize: function() { return self.getItems().size(); }, getNaviButtons: function() { return prev.add(next); }, getRoot: function() { return root; }, getItemWrap: function() { return itemWrap; }, getItems: function() { return itemWrap.children(conf.item).not("." + conf.clonedClass); }, move: function(offset, time) { return self.seekTo(index + offset, time); }, next: function(time) { return self.move(1, time); }, prev: function(time) { return self.move(-1, time); }, begin: function(time) { return self.seekTo(0, time); }, end: function(time) { return self.seekTo(self.getSize() -1, time); }, focus: function() { current = self; return self; }, addItem: function(item) { item = $(item); if (!conf.circular) { itemWrap.append(item); } else { $(".cloned:last").before(item); $(".cloned:first").replaceWith(item.clone().addClass(conf.clonedClass)); } fire.trigger("onAddItem", [item]); return self; }, /* all seeking functions depend on this */ seekTo: function(i, time, fn) { // check that index is sane if (!conf.circular && i < 0 || i > self.getSize()) { return self; } var item = i; if (i.jquery) { i = self.getItems().index(i); } else { item = self.getItems().eq(i); } // onBeforeSeek var e = $.Event("onBeforeSeek"); if (!fn) { fire.trigger(e, [i, time]); if (e.isDefaultPrevented() || !item.length) { return self; } } var props = vertical ? {top: -item.position().top} : {left: -item.position().left}; itemWrap.animate(props, time, conf.easing, fn || function() { fire.trigger("onSeek", [i]); }); current = self; index = i; return self; } }); // callbacks $.each("onBeforeSeek,onSeek,onAddItem".split(","), function(i, name) { // configuration if ($.isFunction(conf[name])) { $(self).bind(name, conf[name]); } self[name] = function(fn) { $(self).bind(name, fn); return self; }; }); // circular loop if (conf.circular) { var cloned1 = self.getItems().slice(-1).clone().prependTo(itemWrap), cloned2 = self.getItems().eq(1).clone().appendTo(itemWrap); cloned1.add(cloned2).addClass(conf.clonedClass); self.onBeforeSeek(function(e, i, time) { if (e.isDefaultPrevented()) { return; } /* 1. animate to the clone without event triggering 2. seek to correct position with 0 speed */ if (i == -1) { self.seekTo(cloned1, time, function() { self.end(0); }); return e.preventDefault(); } else if (i == self.getSize()) { self.seekTo(cloned2, time, function() { self.begin(0); }); } }); } // next/prev buttons var prev = find(root, conf.prev).click(function() { self.prev(); }), next = find(root, conf.next).click(function() { self.next(); }); if (!conf.circular && self.getSize() > 2) { self.onBeforeSeek(function(e, i) { prev.toggleClass(conf.disabledClass, i <= 0); next.toggleClass(conf.disabledClass, i >= self.getSize() -1); }); } // mousewheel support if (conf.mousewheel && $.fn.mousewheel) { root.mousewheel(function(e, delta) { if (conf.mousewheel) { self.move(delta < 0 ? 1 : -1, conf.wheelSpeed || 50); return false; } }); } if (conf.keyboard) { $(document).bind("keydown.scrollable", function(evt) { // skip certain conditions if (!conf.keyboard || evt.altKey || evt.ctrlKey || $(evt.target).is(":input")) { return; } // does this instance have focus? if (conf.keyboard != 'static' && current != self) { return; } var key = evt.keyCode; if (vertical && (key == 38 || key == 40)) { self.move(key == 38 ? -1 : 1); return evt.preventDefault(); } if (!vertical && (key == 37 || key == 39)) { self.move(key == 37 ? -1 : 1); return evt.preventDefault(); } }); } // initial index $(self).trigger("onBeforeSeek", [conf.initialIndex]); self.seekTo(conf.initialIndex, 0, true); } // jQuery plugin implementation $.fn.scrollable = function(conf) { // already constructed --> return API var el = this.data("scrollable"); if (el) { return el; } conf = $.extend({}, $.tools.scrollable.conf, conf); this.each(function() { el = new Scrollable($(this), conf); $(this).data("scrollable", el); }); return conf.api ? el: this; }; })(jQuery); |
self.seekTo(conf.initialIndex, 0, true); | (function($) { // static constructs $.tools = $.tools || {version: '@VERSION'}; $.tools.scrollable = { conf: { activeClass: 'active', circular: false, clonedClass: 'cloned', disabledClass: 'disabled', easing: 'swing', initialIndex: 0, item: null, items: '.items', keyboard: true, mousewheel: false, next: '.next', prev: '.prev', speed: 400, vertical: false, wheelSpeed: 0 } }; // get hidden element's width or height even though it's hidden function dim(el, key) { var v = parseInt(el.css(key), 10); if (v) { return v; } var s = el[0].currentStyle; return s && s.width && parseInt(s.width, 10); } function find(root, query) { var el = $(query); return el.length < 2 ? el : root.parent().find(query); } var current; // constructor function Scrollable(root, conf) { // current instance var self = this, fire = root.add(self), itemWrap = root.children(), index = 0, forward, vertical = conf.vertical || dim(root, "height") > dim(root, "width"); if (!current) { current = self; } if (itemWrap.length > 1) { itemWrap = $(conf.items, root); } // methods $.extend(self, { getConf: function() { return conf; }, getIndex: function() { return index; }, getSize: function() { return self.getItems().size(); }, getNaviButtons: function() { return prev.add(next); }, getRoot: function() { return root; }, getItemWrap: function() { return itemWrap; }, getItems: function() { return itemWrap.children(conf.item).not("." + conf.clonedClass); }, move: function(offset, time) { return self.seekTo(index + offset, time); }, next: function(time) { return self.move(1, time); }, prev: function(time) { return self.move(-1, time); }, begin: function(time) { return self.seekTo(0, time); }, end: function(time) { return self.seekTo(self.getSize() -1, time); }, focus: function() { current = self; return self; }, addItem: function(item) { item = $(item); if (!conf.circular) { itemWrap.append(item); } else { $(".cloned:last").before(item); $(".cloned:first").replaceWith(item.clone().addClass(conf.clonedClass)); } fire.trigger("onAddItem", [item]); return self; }, /* all seeking functions depend on this */ seekTo: function(i, time, fn) { // check that index is sane if (!conf.circular && i < 0 || i > self.getSize()) { return self; } var item = i; if (i.jquery) { i = self.getItems().index(i); } else { item = self.getItems().eq(i); } // onBeforeSeek var e = $.Event("onBeforeSeek"); if (!fn) { fire.trigger(e, [i, time]); if (e.isDefaultPrevented() || !item.length) { return self; } } var props = vertical ? {top: -item.position().top} : {left: -item.position().left}; itemWrap.animate(props, time, conf.easing, fn || function() { fire.trigger("onSeek", [i]); }); current = self; index = i; return self; } }); // callbacks $.each("onBeforeSeek,onSeek,onAddItem".split(","), function(i, name) { // configuration if ($.isFunction(conf[name])) { $(self).bind(name, conf[name]); } self[name] = function(fn) { $(self).bind(name, fn); return self; }; }); // circular loop if (conf.circular) { var cloned1 = self.getItems().slice(-1).clone().prependTo(itemWrap), cloned2 = self.getItems().eq(1).clone().appendTo(itemWrap); cloned1.add(cloned2).addClass(conf.clonedClass); self.onBeforeSeek(function(e, i, time) { if (e.isDefaultPrevented()) { return; } /* 1. animate to the clone without event triggering 2. seek to correct position with 0 speed */ if (i == -1) { self.seekTo(cloned1, time, function() { self.end(0); }); return e.preventDefault(); } else if (i == self.getSize()) { self.seekTo(cloned2, time, function() { self.begin(0); }); } }); } // next/prev buttons var prev = find(root, conf.prev).click(function() { self.prev(); }), next = find(root, conf.next).click(function() { self.next(); }); if (!conf.circular && self.getSize() > 2) { self.onBeforeSeek(function(e, i) { prev.toggleClass(conf.disabledClass, i <= 0); next.toggleClass(conf.disabledClass, i >= self.getSize() -1); }); } // mousewheel support if (conf.mousewheel && $.fn.mousewheel) { root.mousewheel(function(e, delta) { if (conf.mousewheel) { self.move(delta < 0 ? 1 : -1, conf.wheelSpeed || 50); return false; } }); } if (conf.keyboard) { $(document).bind("keydown.scrollable", function(evt) { // skip certain conditions if (!conf.keyboard || evt.altKey || evt.ctrlKey || $(evt.target).is(":input")) { return; } // does this instance have focus? if (conf.keyboard != 'static' && current != self) { return; } var key = evt.keyCode; if (vertical && (key == 38 || key == 40)) { self.move(key == 38 ? -1 : 1); return evt.preventDefault(); } if (!vertical && (key == 37 || key == 39)) { self.move(key == 37 ? -1 : 1); return evt.preventDefault(); } }); } // initial index $(self).trigger("onBeforeSeek", [conf.initialIndex]); self.seekTo(conf.initialIndex, 0, true); } // jQuery plugin implementation $.fn.scrollable = function(conf) { // already constructed --> return API var el = this.data("scrollable"); if (el) { return el; } conf = $.extend({}, $.tools.scrollable.conf, conf); this.each(function() { el = new Scrollable($(this), conf); $(this).data("scrollable", el); }); return conf.api ? el: this; }; })(jQuery); |
|
}).error(function(error, b) { console.error(img.data("src"), error, b); done.call(); | }).error(function(error, b) { done.call(null, error); | (function($) { /* sizing: padding / margins */ $.tools = $.tools || {}; var tool = $.tools.lazyload = { conf: { css: { before: null, loading: 'loading', after: null, progress: 'progress' }, effect: 'show', fadeInSpeed: 0, growSpeed: 'slow', growParent: '.grow', // jquery || closest(growParent) || parent progress: 'Loading', loadOnScroll: false, placeholder: 'data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==' }, addLoader: function(matcher, initFn, loadFn) { var loader = loadFn ? [initFn, loadFn] : [null, initFn]; loaders[matcher] = loader; }, addEffect: function(name, fn) { effects[name] = fn; } }, effects = { show: function(el, done) { el.hide().css({visibility: 'visible'}).fadeIn(this.getConf().fadeInSpeed, done); }, /* we need two things: 1. the root element to be grown 2. element to get dimensions from */ grow: function(el, done) { var self = this, conf = self.getConf() root = conf.growParent.jquery ? conf.growParent : el.closest(conf.growParent), css = null; if (!root.length) { root = el.parent(); } if (el.is("img")) { var img = el[0]; css = {width: img.width, height: img.height}; } else if (el.is(":backgroundImage")) { var img = el.data("image")[0]; css = {width: img.width, height: img.height}; el.css(css); } else { var dim = el.is(":loaded") ? el : el.children(":first"); css = {width: dim.width(), height: dim.height()}; el = el.children(); } // hide element before show/fadeIn el.css({visibility: 'hidden'}).hide(); // grow the parent root.animate(css, conf.growParentSpeed, function() { effects.show.call(self, el, done); }); } }, loaders = {}; /* custom selectors */ $.extend($.expr[':'], { backgroundImage: function(el) { return $(el).css("backgroundImage") != 'none' || !!$(el).data("bg") ; }, unloaded: function(el) { return $(el).data("loaded") === false; }, loaded: function(el) { return $(el).data("loaded") === true; }, invisible: function(element) { var el = $(element); if (!el.is("img, :backgroundImage")) { return false; } var w = $(window), top = el.offset().top; // below || above return top + el.height() < w.scrollTop() || w.height() + w.scrollTop() < top; } }); //{{{ LOADERS /* image loader */ tool.addLoader('img', // initialization function(img) { var src = img.attr("src"); img.attr("src", this.getConf().placeholder).data("src", src); }, // load function function(img, done) { var p = this.getProgress(); if (p) { img.before(p); } img.load(function() { if (p) { p.remove(); } done.call(); }).error(function(error, b) { // TODO, call with error console.error(img.data("src"), error, b); done.call(); }).attr("src", img.data("src")); } ); /* content loader */ tool.addLoader(':has(a[href]:only-child)', function(root, done) { var url = root.children().attr("href"), p = this.getProgress(), callback = function(ev, els) { if (p) { p.remove(); } done.call(); }; root.html(p).load(url, function() { root.prepend(p); // lazyloading of nested elements var assets = root.find("img, :backgroundImage"); if (assets.length) { assets.lazyload({api: true}).onLoadAll(callback).load(); } else { callback(); } }).ajaxError(function(root, error) { done.call(null, error); }); }); tool.addLoader(":backgroundImage", // initialization function function(el) { var name = "backgroundImage", bg = el.css(name); el.data("bg", bg).css(name, "none"); }, // load function function(el, done) { // url("bg.jpg") --> bg.jpg var bg = el.data("bg"), p = this.getProgress(); bg = bg.substring(bg.indexOf("(") + 1, bg.indexOf(")")).replace(/\"/g, ""); // progress indicator if (p) { el.prepend(p); } // load image & store it using data() $("<img/>").load(function() { el.css("backgroundImage", "url(" + bg + ")").data("image", $(this)); if (p) { p.remove(); } done.call(); }).attr("src", bg); } );//}}} /** * @constructor */ function Loader(els, conf) { // private variables var self = this, $self = $(this), css = conf.css, progress; if (conf.progress) { progress = $("<div/>").addClass(css.progress).html(conf.progress); } // The API $.extend(self, { preload: function(begin, end) { return self.load(begin, end, true); }, /* load() // loads all load(2) // loads 3:rd element load(2, 4) // loads elements 3 - 5 load(els) // loads supplied elements. must be a subset of the initial elements */ load: function(begin, end) { // filtered set of nodes var nodes = null, preload = arguments[arguments.length -1] === true; if (begin && begin.jquery) { nodes = begin.filter(function() { return els.index(this) >= 0; }); } else { nodes = begin >= 0 ? els.slice(begin, end || begin + 1) : els; } // loop trough nodes nodes.each(function(index) { var el = $(this); // already loaded --> skip. if (el.is(":loaded")) { return effects[conf.effect].call(self, el, function() {}); } // loop trough loaders $.each(loaders, function(matcher, loader) { if (el.is(matcher) && $.isFunction(loader[1])) { // match found var e = new $.Event("onBeforeLoad"); $self.trigger(e, [el]); // loading cancelled by user if (e.isDefaultPrevented()) { return false; } // start loading el.addClass(css.loading); loader[1].call(self, el, function(error) { // if (el.is(":loaded")) { return; } // loading failed if (error) { return $self.trigger("onError", [el, error]); } function setLoaded() { // loaded flag el.data("loaded", true); // CSS class names el.removeClass(css.before).removeClass(css.loading); if (css.after) { el.addClass(css.after); } // onLoad callback $self.trigger("onLoad", [el]); } if (preload) { // mark as loaded setLoaded(); } else { // perform effect and mark loaded effects[conf.effect].call(self, el, setLoaded); } }); } }); }); // onLoadAll callback $self.bind("onLoad.tmp", function() { if (!nodes.not(":loaded").length) { $self.trigger("onLoadAll", [nodes], preload); $self.unbind("onLoad.tmp"); } }); return self; }, getElements: function() { return els; }, getConf: function() { return conf; }, getProgress: function() { return progress ? progress.clone() : null; }, bind: function(name, fn) { $self.bind(name, fn); return self; }, one: function(name, fn) { $self.one(name, fn); return self; }, unbind: function(name) { $self.unbind(name); return self; } }); // callbacks $.each("onBeforeLoad,onLoad,onLoadAll,onError".split(","), function(i, name) { // configuration if ($.isFunction(conf[name])) { self.bind(name, conf[name]); } // API methods self[name] = function(fn) { return self.bind(name, fn); }; }); if (conf.loadOnScroll) { $(window).bind("scroll", function() { els.each(function() { var el = $(this); if (!el.is(":loaded") && !el.is(":invisible")) { self.load(els.index(el[0])); } }); }); } // initialize els.each(function() { var el = $(this).addClass(css.before).data("loaded", false); $.each(loaders, function(matcher, loader) { if (el.filter(matcher).length && $.isFunction(loader[0])) { loader[0].call(self, el); } }); }); } // jQuery plugin implementation $.fn.lazyload = function(conf, all) { // return existing instance var el = this.data("lazyload"); if (el) { return el; } // loadOnScroll shortcut if (conf === true) { conf = {loadOnScroll: true, progress: null}; } // configuration conf = $.extend(true, {}, tool.conf, conf); console.info(conf); // construct loader el = new Loader(this, conf); this.data("lazyload", el); return conf.api ? el: this; }; })(jQuery); |
getElements: function() { return els; }, | (function($) { /* sizing: padding / margins */ $.tools = $.tools || {}; var tool = $.tools.lazyload = { conf: { css: { before: null, loading: 'loading', after: null, progress: 'progress' }, effect: 'show', fadeInSpeed: 0, growSpeed: 'slow', growParent: '.grow', // jquery || closest(growParent) || parent progress: 'Loading', loadOnScroll: false, placeholder: 'data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==' }, addLoader: function(matcher, initFn, loadFn) { var loader = loadFn ? [initFn, loadFn] : [null, initFn]; loaders[matcher] = loader; }, addEffect: function(name, fn) { effects[name] = fn; } }, effects = { show: function(el, done) { el.hide().css({visibility: 'visible'}).fadeIn(this.getConf().fadeInSpeed, done); }, /* we need two things: 1. the root element to be grown 2. element to get dimensions from */ grow: function(el, done) { var self = this, conf = self.getConf() root = conf.growParent.jquery ? conf.growParent : el.closest(conf.growParent), css = null; if (!root.length) { root = el.parent(); } if (el.is("img")) { var img = el[0]; css = {width: img.width, height: img.height}; } else if (el.is(":backgroundImage")) { var img = el.data("image")[0]; css = {width: img.width, height: img.height}; el.css(css); } else { var dim = el.is(":loaded") ? el : el.children(":first"); css = {width: dim.width(), height: dim.height()}; el = el.children(); } // hide element before show/fadeIn el.css({visibility: 'hidden'}).hide(); // grow the parent root.animate(css, conf.growParentSpeed, function() { effects.show.call(self, el, done); }); } }, loaders = {}; /* custom selectors */ $.extend($.expr[':'], { backgroundImage: function(el) { return $(el).css("backgroundImage") != 'none' || !!$(el).data("bg") ; }, unloaded: function(el) { return $(el).data("loaded") === false; }, loaded: function(el) { return $(el).data("loaded") === true; }, invisible: function(element) { var el = $(element); if (!el.is("img, :backgroundImage")) { return false; } var w = $(window), top = el.offset().top; // below || above return top + el.height() < w.scrollTop() || w.height() + w.scrollTop() < top; } }); //{{{ LOADERS /* image loader */ tool.addLoader('img', // initialization function(img) { var src = img.attr("src"); img.attr("src", this.getConf().placeholder).data("src", src); }, // load function function(img, done) { var p = this.getProgress(); if (p) { img.before(p); } img.load(function() { if (p) { p.remove(); } done.call(); }).error(function(error, b) { // TODO, call with error console.error(img.data("src"), error, b); done.call(); }).attr("src", img.data("src")); } ); /* content loader */ tool.addLoader(':has(a[href]:only-child)', function(root, done) { var url = root.children().attr("href"), p = this.getProgress(), callback = function(ev, els) { if (p) { p.remove(); } done.call(); }; root.html(p).load(url, function() { root.prepend(p); // lazyloading of nested elements var assets = root.find("img, :backgroundImage"); if (assets.length) { assets.lazyload({api: true}).onLoadAll(callback).load(); } else { callback(); } }).ajaxError(function(root, error) { done.call(null, error); }); }); tool.addLoader(":backgroundImage", // initialization function function(el) { var name = "backgroundImage", bg = el.css(name); el.data("bg", bg).css(name, "none"); }, // load function function(el, done) { // url("bg.jpg") --> bg.jpg var bg = el.data("bg"), p = this.getProgress(); bg = bg.substring(bg.indexOf("(") + 1, bg.indexOf(")")).replace(/\"/g, ""); // progress indicator if (p) { el.prepend(p); } // load image & store it using data() $("<img/>").load(function() { el.css("backgroundImage", "url(" + bg + ")").data("image", $(this)); if (p) { p.remove(); } done.call(); }).attr("src", bg); } );//}}} /** * @constructor */ function Loader(els, conf) { // private variables var self = this, $self = $(this), css = conf.css, progress; if (conf.progress) { progress = $("<div/>").addClass(css.progress).html(conf.progress); } // The API $.extend(self, { preload: function(begin, end) { return self.load(begin, end, true); }, /* load() // loads all load(2) // loads 3:rd element load(2, 4) // loads elements 3 - 5 load(els) // loads supplied elements. must be a subset of the initial elements */ load: function(begin, end) { // filtered set of nodes var nodes = null, preload = arguments[arguments.length -1] === true; if (begin && begin.jquery) { nodes = begin.filter(function() { return els.index(this) >= 0; }); } else { nodes = begin >= 0 ? els.slice(begin, end || begin + 1) : els; } // loop trough nodes nodes.each(function(index) { var el = $(this); // already loaded --> skip. if (el.is(":loaded")) { return effects[conf.effect].call(self, el, function() {}); } // loop trough loaders $.each(loaders, function(matcher, loader) { if (el.is(matcher) && $.isFunction(loader[1])) { // match found var e = new $.Event("onBeforeLoad"); $self.trigger(e, [el]); // loading cancelled by user if (e.isDefaultPrevented()) { return false; } // start loading el.addClass(css.loading); loader[1].call(self, el, function(error) { // if (el.is(":loaded")) { return; } // loading failed if (error) { return $self.trigger("onError", [el, error]); } function setLoaded() { // loaded flag el.data("loaded", true); // CSS class names el.removeClass(css.before).removeClass(css.loading); if (css.after) { el.addClass(css.after); } // onLoad callback $self.trigger("onLoad", [el]); } if (preload) { // mark as loaded setLoaded(); } else { // perform effect and mark loaded effects[conf.effect].call(self, el, setLoaded); } }); } }); }); // onLoadAll callback $self.bind("onLoad.tmp", function() { if (!nodes.not(":loaded").length) { $self.trigger("onLoadAll", [nodes], preload); $self.unbind("onLoad.tmp"); } }); return self; }, getElements: function() { return els; }, getConf: function() { return conf; }, getProgress: function() { return progress ? progress.clone() : null; }, bind: function(name, fn) { $self.bind(name, fn); return self; }, one: function(name, fn) { $self.one(name, fn); return self; }, unbind: function(name) { $self.unbind(name); return self; } }); // callbacks $.each("onBeforeLoad,onLoad,onLoadAll,onError".split(","), function(i, name) { // configuration if ($.isFunction(conf[name])) { self.bind(name, conf[name]); } // API methods self[name] = function(fn) { return self.bind(name, fn); }; }); if (conf.loadOnScroll) { $(window).bind("scroll", function() { els.each(function() { var el = $(this); if (!el.is(":loaded") && !el.is(":invisible")) { self.load(els.index(el[0])); } }); }); } // initialize els.each(function() { var el = $(this).addClass(css.before).data("loaded", false); $.each(loaders, function(matcher, loader) { if (el.filter(matcher).length && $.isFunction(loader[0])) { loader[0].call(self, el); } }); }); } // jQuery plugin implementation $.fn.lazyload = function(conf, all) { // return existing instance var el = this.data("lazyload"); if (el) { return el; } // loadOnScroll shortcut if (conf === true) { conf = {loadOnScroll: true, progress: null}; } // configuration conf = $.extend(true, {}, tool.conf, conf); console.info(conf); // construct loader el = new Loader(this, conf); this.data("lazyload", el); return conf.api ? el: this; }; })(jQuery); |
|
console.info(conf); | (function($) { /* sizing: padding / margins */ $.tools = $.tools || {}; var tool = $.tools.lazyload = { conf: { css: { before: null, loading: 'loading', after: null, progress: 'progress' }, effect: 'show', fadeInSpeed: 0, growSpeed: 'slow', growParent: '.grow', // jquery || closest(growParent) || parent progress: 'Loading', loadOnScroll: false, placeholder: 'data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==' }, addLoader: function(matcher, initFn, loadFn) { var loader = loadFn ? [initFn, loadFn] : [null, initFn]; loaders[matcher] = loader; }, addEffect: function(name, fn) { effects[name] = fn; } }, effects = { show: function(el, done) { el.hide().css({visibility: 'visible'}).fadeIn(this.getConf().fadeInSpeed, done); }, /* we need two things: 1. the root element to be grown 2. element to get dimensions from */ grow: function(el, done) { var self = this, conf = self.getConf() root = conf.growParent.jquery ? conf.growParent : el.closest(conf.growParent), css = null; if (!root.length) { root = el.parent(); } if (el.is("img")) { var img = el[0]; css = {width: img.width, height: img.height}; } else if (el.is(":backgroundImage")) { var img = el.data("image")[0]; css = {width: img.width, height: img.height}; el.css(css); } else { var dim = el.is(":loaded") ? el : el.children(":first"); css = {width: dim.width(), height: dim.height()}; el = el.children(); } // hide element before show/fadeIn el.css({visibility: 'hidden'}).hide(); // grow the parent root.animate(css, conf.growParentSpeed, function() { effects.show.call(self, el, done); }); } }, loaders = {}; /* custom selectors */ $.extend($.expr[':'], { backgroundImage: function(el) { return $(el).css("backgroundImage") != 'none' || !!$(el).data("bg") ; }, unloaded: function(el) { return $(el).data("loaded") === false; }, loaded: function(el) { return $(el).data("loaded") === true; }, invisible: function(element) { var el = $(element); if (!el.is("img, :backgroundImage")) { return false; } var w = $(window), top = el.offset().top; // below || above return top + el.height() < w.scrollTop() || w.height() + w.scrollTop() < top; } }); //{{{ LOADERS /* image loader */ tool.addLoader('img', // initialization function(img) { var src = img.attr("src"); img.attr("src", this.getConf().placeholder).data("src", src); }, // load function function(img, done) { var p = this.getProgress(); if (p) { img.before(p); } img.load(function() { if (p) { p.remove(); } done.call(); }).error(function(error, b) { // TODO, call with error console.error(img.data("src"), error, b); done.call(); }).attr("src", img.data("src")); } ); /* content loader */ tool.addLoader(':has(a[href]:only-child)', function(root, done) { var url = root.children().attr("href"), p = this.getProgress(), callback = function(ev, els) { if (p) { p.remove(); } done.call(); }; root.html(p).load(url, function() { root.prepend(p); // lazyloading of nested elements var assets = root.find("img, :backgroundImage"); if (assets.length) { assets.lazyload({api: true}).onLoadAll(callback).load(); } else { callback(); } }).ajaxError(function(root, error) { done.call(null, error); }); }); tool.addLoader(":backgroundImage", // initialization function function(el) { var name = "backgroundImage", bg = el.css(name); el.data("bg", bg).css(name, "none"); }, // load function function(el, done) { // url("bg.jpg") --> bg.jpg var bg = el.data("bg"), p = this.getProgress(); bg = bg.substring(bg.indexOf("(") + 1, bg.indexOf(")")).replace(/\"/g, ""); // progress indicator if (p) { el.prepend(p); } // load image & store it using data() $("<img/>").load(function() { el.css("backgroundImage", "url(" + bg + ")").data("image", $(this)); if (p) { p.remove(); } done.call(); }).attr("src", bg); } );//}}} /** * @constructor */ function Loader(els, conf) { // private variables var self = this, $self = $(this), css = conf.css, progress; if (conf.progress) { progress = $("<div/>").addClass(css.progress).html(conf.progress); } // The API $.extend(self, { preload: function(begin, end) { return self.load(begin, end, true); }, /* load() // loads all load(2) // loads 3:rd element load(2, 4) // loads elements 3 - 5 load(els) // loads supplied elements. must be a subset of the initial elements */ load: function(begin, end) { // filtered set of nodes var nodes = null, preload = arguments[arguments.length -1] === true; if (begin && begin.jquery) { nodes = begin.filter(function() { return els.index(this) >= 0; }); } else { nodes = begin >= 0 ? els.slice(begin, end || begin + 1) : els; } // loop trough nodes nodes.each(function(index) { var el = $(this); // already loaded --> skip. if (el.is(":loaded")) { return effects[conf.effect].call(self, el, function() {}); } // loop trough loaders $.each(loaders, function(matcher, loader) { if (el.is(matcher) && $.isFunction(loader[1])) { // match found var e = new $.Event("onBeforeLoad"); $self.trigger(e, [el]); // loading cancelled by user if (e.isDefaultPrevented()) { return false; } // start loading el.addClass(css.loading); loader[1].call(self, el, function(error) { // if (el.is(":loaded")) { return; } // loading failed if (error) { return $self.trigger("onError", [el, error]); } function setLoaded() { // loaded flag el.data("loaded", true); // CSS class names el.removeClass(css.before).removeClass(css.loading); if (css.after) { el.addClass(css.after); } // onLoad callback $self.trigger("onLoad", [el]); } if (preload) { // mark as loaded setLoaded(); } else { // perform effect and mark loaded effects[conf.effect].call(self, el, setLoaded); } }); } }); }); // onLoadAll callback $self.bind("onLoad.tmp", function() { if (!nodes.not(":loaded").length) { $self.trigger("onLoadAll", [nodes], preload); $self.unbind("onLoad.tmp"); } }); return self; }, getElements: function() { return els; }, getConf: function() { return conf; }, getProgress: function() { return progress ? progress.clone() : null; }, bind: function(name, fn) { $self.bind(name, fn); return self; }, one: function(name, fn) { $self.one(name, fn); return self; }, unbind: function(name) { $self.unbind(name); return self; } }); // callbacks $.each("onBeforeLoad,onLoad,onLoadAll,onError".split(","), function(i, name) { // configuration if ($.isFunction(conf[name])) { self.bind(name, conf[name]); } // API methods self[name] = function(fn) { return self.bind(name, fn); }; }); if (conf.loadOnScroll) { $(window).bind("scroll", function() { els.each(function() { var el = $(this); if (!el.is(":loaded") && !el.is(":invisible")) { self.load(els.index(el[0])); } }); }); } // initialize els.each(function() { var el = $(this).addClass(css.before).data("loaded", false); $.each(loaders, function(matcher, loader) { if (el.filter(matcher).length && $.isFunction(loader[0])) { loader[0].call(self, el); } }); }); } // jQuery plugin implementation $.fn.lazyload = function(conf, all) { // return existing instance var el = this.data("lazyload"); if (el) { return el; } // loadOnScroll shortcut if (conf === true) { conf = {loadOnScroll: true, progress: null}; } // configuration conf = $.extend(true, {}, tool.conf, conf); console.info(conf); // construct loader el = new Loader(this, conf); this.data("lazyload", el); return conf.api ? el: this; }; })(jQuery); |
|
return [ver[1], ver[3]]; | return ver ? [ver[1], ver[3]] : [0, 0]; | (function() { var IE = document.all, URL = 'http://www.adobe.com/go/getflashplayer', JQUERY = typeof jQuery == 'function', RE = /(\d+)[^\d]+(\d+)[^\d]*(\d*)/, GLOBAL_OPTS = { // very common opts width: '100%', height: '100%', id: "_" + ("" + Math.random()).slice(9), // flashembed defaults allowfullscreen: true, allowscriptaccess: 'always', quality: 'high', // flashembed specific options version: [3, 0], onFail: null, expressInstall: null, w3c: false, cachebusting: false }; // version 9 bugfix: (http://blog.deconcept.com/2006/07/28/swfobject-143-released/) if (window.attachEvent) { window.attachEvent("onbeforeunload", function() { __flash_unloadHandler = function() {}; __flash_savedUnloadHandler = function() {}; }); } // simple extend function extend(to, from) { if (from) { for (key in from) { if (from.hasOwnProperty(key)) { to[key] = from[key]; } } } return to; } // used by asString method function map(arr, func) { var newArr = []; for (var i in arr) { if (arr.hasOwnProperty(i)) { newArr[i] = func(arr[i]); } } return newArr; } window.flashembed = function(root, opts, conf) { // root must be found / loaded if (typeof root == 'string') { root = document.getElementById(root.replace("#", "")); } // not found if (!root) { return; } if (typeof opts == 'string') { opts = {src: opts}; } return new Flash(root, extend(extend({}, GLOBAL_OPTS), opts), conf); }; // flashembed "static" API var f = extend(window.flashembed, { conf: GLOBAL_OPTS, getVersion: function() { var ver; try { ver = navigator.plugins["Shockwave Flash"].description.slice(16); } catch(e) { try { var fo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7"); ver = fo && fo.GetVariable("$version"); } catch(err) { } } ver = RE.exec(ver); return [ver[1], ver[3]]; }, asString: function(obj) { if (obj === null || obj === undefined) { return null; } var type = typeof obj; if (type == 'object' && obj.push) { type = 'array'; } switch (type){ case 'string': obj = obj.replace(new RegExp('(["\\\\])', 'g'), '\\$1'); // flash does not handle %- characters well. transforms "50%" to "50pct" (a dirty hack, I admit) obj = obj.replace(/^\s?(\d+\.?\d+)%/, "$1pct"); return '"' +obj+ '"'; case 'array': return '['+ map(obj, function(el) { return f.asString(el); }).join(',') +']'; case 'function': return '"function()"'; case 'object': var str = []; for (var prop in obj) { if (obj.hasOwnProperty(prop)) { str.push('"'+prop+'":'+ f.asString(obj[prop])); } } return '{'+str.join(',')+'}'; } // replace ' --> " and remove spaces return String(obj).replace(/\s/g, " ").replace(/\'/g, "\""); }, getHTML: function(opts, conf) { opts = extend({}, opts); /******* OBJECT tag and it's attributes *******/ var html = '<object width="' + opts.width + '" height="' + opts.height + '" id="' + opts.id + '"' + '" name="' + opts.id + '"'; if (opts.cachebusting) { opts.src += ((opts.src.indexOf("?") != -1 ? "&" : "?") + Math.random()); } if (opts.w3c || !IE) { html += ' data="' +opts.src+ '" type="application/x-shockwave-flash"'; } else { html += ' classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'; } html += '>'; /******* nested PARAM tags *******/ if (opts.w3c || IE) { html += '<param name="movie" value="' +opts.src+ '" />'; } // not allowed params opts.width = opts.height = opts.id = opts.w3c = opts.src = null; opts.onFail = opts.version = opts.expressInstall = null; for (var key in opts) { if (opts[key]) { html += '<param name="'+ key +'" value="'+ opts[key] +'" />'; } } /******* FLASHVARS *******/ var vars = ""; if (conf) { for (var k in conf) { if (conf[k]) { var val = conf[k]; vars += k +'='+ (/function|object/.test(typeof val) ? f.asString(val) : val) + '&'; } } vars = vars.slice(0, -1); html += '<param name="flashvars" value=\'' + vars + '\' />'; } html += "</object>"; return html; }, isSupported: function(ver) { return VERSION[0] > ver[0] || VERSION[0] == ver[0] && VERSION[1] >= ver[1]; } }); var VERSION = f.getVersion(); function Flash(root, opts, conf) { // version is ok if (f.isSupported(opts.version)) { root.innerHTML = f.getHTML(opts, conf); // express install } else if (opts.expressInstall && f.isSupported([6, 65])) { root.innerHTML = f.getHTML(extend(opts, {src: opts.expressInstall}), { MMredirectURL: location.href, MMplayerType: 'PlugIn', MMdoctitle: document.title }); } else { // fail #2.1 custom content inside container if (!root.innerHTML.replace(/\s/g, '')) { root.innerHTML = "<h2>Flash version " + opts.version + " or greater is required</h2>" + "<h3>" + (VERSION[0] > 0 ? "Your version is " + VERSION : "You have no flash plugin installed") + "</h3>" + (root.tagName == 'A' ? "<p>Click here to download latest version</p>" : "<p>Download latest version from <a href='" + URL + "'>here</a></p>"); if (root.tagName == 'A') { root.onclick = function() { location.href = URL; }; } } // onFail if (opts.onFail) { var ret = opts.onFail.call(this); if (typeof ret == 'string') { root.innerHTML = ret; } } } // http://flowplayer.org/forum/8/18186#post-18593 if (IE) { window[opts.id] = document.getElementById(opts.id); } // API methods for callback extend(this, { getRoot: function() { return root; }, getOptions: function() { return opts; }, getConf: function() { return conf; }, getApi: function() { return root.firstChild; } }); } // setup jquery support if (JQUERY) { // tools version number jQuery.tools = jQuery.tools || {version: '@VERSION'}; jQuery.tools.flashembed = { conf: GLOBAL_OPTS }; jQuery.fn.flashembed = function(opts, conf) { return this.each(function() { $(this).data("flashembed", flashembed(this, opts, conf)); }); }; } })(); |
if(!window.CKEDITOR)window.CKEDITOR=(function(){var a={timestamp:'',version:'3.2.1',revision:'5372',_:{},status:'unloaded',basePath:(function(){var d=window.CKEDITOR_BASEPATH||'';if(!d){var e=document.getElementsByTagName('script');for(var f=0;f<e.length;f++){var g=e[f].src.match(/(^|.*[\\\/])ckeditor(?:_basic)?(?:_source)?.js(?:\?.*)?$/i);if(g){d=g[1];break;}}}if(d.indexOf(': | if(!window.CKEDITOR)window.CKEDITOR=(function(){var a={timestamp:'',version:'3.4.1',revision:'5892',_:{},status:'unloaded',basePath:(function(){var d=window.CKEDITOR_BASEPATH||'';if(!d){var e=document.getElementsByTagName('script');for(var f=0;f<e.length;f++){var g=e[f].src.match(/(^|.*[\\\/])ckeditor(?:_basic)?(?:_source)?.js(?:\?.*)?$/i);if(g){d=g[1];break;}}}if(d.indexOf(': | if(!window.CKEDITOR)window.CKEDITOR=(function(){var a={timestamp:'',version:'3.2.1',revision:'5372',_:{},status:'unloaded',basePath:(function(){var d=window.CKEDITOR_BASEPATH||'';if(!d){var e=document.getElementsByTagName('script');for(var f=0;f<e.length;f++){var g=e[f].src.match(/(^|.*[\\\/])ckeditor(?:_basic)?(?:_source)?.js(?:\?.*)?$/i);if(g){d=g[1];break;}}}if(d.indexOf('://')==-1)if(d.indexOf('/')===0)d=location.href.match(/^.*?:\/\/[^\/]*/)[0]+d;else d=location.href.match(/^[^\?]*\/(?:)/)[0]+d;return d;})(),getUrl:function(d){if(d.indexOf('://')==-1&&d.indexOf('/')!==0)d=this.basePath+d;if(this.timestamp&&d.charAt(d.length-1)!='/')d+=(d.indexOf('?')>=0?'&':'?')+('t=')+this.timestamp;return d;}},b=window.CKEDITOR_GETURL;if(b){var c=a.getUrl;a.getUrl=function(d){return b.call(a,d)||c.call(a,d);};}return a;})(); |
b.substring(7)*1;e.style.width=g+"px";r.adjustColumns();l.emit(d,"columnResized",m,g)},c,d,a,-2,-1)}};this.adjustColumns=function(){var c=q.firstChild,a=i.firstChild,b=0,e=0;e=i.lastChild.className.split(" ")[0];var h=f.getCssRule("#"+d.id+" ."+e);if(p)a=a.firstChild;if(!f.isHidden(d)){for(var g=0,m=a.childNodes.length;g<m;++g)if(a.childNodes[g].className){var j=a.childNodes[g].className.split(" ")[0];j=f.getCssRule("#"+d.id+" ."+j);b+=f.pxself(j,"width")+7}if(!p)if(h.style.width)$(d).find(".Wt-headerdiv ."+ | b.substring(7)*1;e.style.width=g+"px";r.adjustColumns();l.emit(d,"columnResized",m,parseInt(g))},c,d,a,-2,-1)}};this.adjustColumns=function(){var c=q.firstChild,a=i.firstChild,b=0,e=0;e=i.lastChild.className.split(" ")[0];var h=f.getCssRule("#"+d.id+" ."+e);if(p)a=a.firstChild;if(!f.isHidden(d)){for(var g=0,m=a.childNodes.length;g<m;++g)if(a.childNodes[g].className){var j=a.childNodes[g].className.split(" ")[0];j=f.getCssRule("#"+d.id+" ."+j);b+=f.pxself(j,"width")+7}if(!p)if(h.style.width)$(d).find(".Wt-headerdiv ."+ | WT_DECLARE_WT_MEMBER(1,"WTreeView",function(l,d,k,s,p){function o(c){var a=-1,b=null,e=false,h=false,g=null;for(c=c.target||c.srcElement;c;){if(c.className.indexOf("c1 rh")==0){if(a==-1)a=0}else if(c.className.indexOf("Wt-tv-c")==0){if(c.className.indexOf("Wt-tv-c")==0)a=c.className.split(" ")[0].substring(7)*1;else if(a==-1)a=0;if(c.getAttribute("drop")==="true")h=true;g=c}else if(c.className=="Wt-tv-node"){b=c.id;break}if(c.className==="Wt-selected")e=true;c=c.parentNode;if(f.hasTag(c,"BODY"))break}return{columnId:a,nodeId:b,selected:e,drop:h,el:g}}jQuery.data(d,"obj",this);var q=k.firstChild,i=s.firstChild,r=this,f=l.WT;this.click=function(c,a){var b=o(a);b.columnId!=-1&&l.emit(d,{name:"itemEvent",eventObject:c,event:a},b.nodeId,b.columnId,"clicked","","")};this.dblClick=function(c,a){var b=o(a);b.columnId!=-1&&l.emit(d,{name:"itemEvent",eventObject:c,event:a},b.nodeId,b.columnId,"dblclicked","","")};this.mouseDown=function(c,a){f.capture(null);var b=o(a);if(b.columnId!=-1){l.emit(d,{name:"itemEvent",eventObject:c,event:a},b.nodeId,b.columnId,"mousedown","","");d.getAttribute("drag")==="true"&&b.selected&&l._p_.dragStart(d,a)}};this.mouseUp=function(c,a){var b=o(a);b.columnId!=-1&&l.emit(d,{name:"itemEvent",eventObject:c,event:a},b.nodeId,b.columnId,"mouseup","","")};this.resizeHandleMDown=function(c,a){var b=c.parentNode.parentNode.className.split(" ")[0];if(b){var e=f.getCssRule("#"+d.id+" ."+b),h=f.pxself(e,"width");new f.SizeHandle(f,"h",c.offsetWidth,d.offsetHeight,-h,1E4,"Wt-hsh",function(g){g=h+g;var m=b.substring(7)*1;e.style.width=g+"px";r.adjustColumns();l.emit(d,"columnResized",m,g)},c,d,a,-2,-1)}};this.adjustColumns=function(){var c=q.firstChild,a=i.firstChild,b=0,e=0;e=i.lastChild.className.split(" ")[0];var h=f.getCssRule("#"+d.id+" ."+e);if(p)a=a.firstChild;if(!f.isHidden(d)){for(var g=0,m=a.childNodes.length;g<m;++g)if(a.childNodes[g].className){var j=a.childNodes[g].className.split(" ")[0];j=f.getCssRule("#"+d.id+" ."+j);b+=f.pxself(j,"width")+7}if(!p)if(h.style.width)$(d).find(".Wt-headerdiv ."+e).css("width",h.style.width);else h.style.width=i.offsetWidth-a.offsetWidth-8+"px";e=b+f.pxself(h,"width")+(f.isIE6?10:8);if(p){j=f.getCssRule("#"+d.id+" .Wt-tv-rowc");j.style.width=b+"px";$(d).find(".Wt-tv-rowc").css("width",b+"px").css("width","");d.changed=true;this.autoJavaScript()}else{i.style.width=c.style.width=e+"px";a.style.width=b+"px"}}};var n=null;d.handleDragDrop=function(c,a,b,e,h){if(n){n.className=n.classNameOrig;n=null}if(c!="end"){var g=o(b);if(!g.selected&&g.drop&&g.columnId!=-1)if(c=="drop")l.emit(d,{name:"itemEvent",eventObject:a,event:b},g.nodeId,g.columnId,"drop",e,h);else{a.className="Wt-valid-drop";n=g.el;n.classNameOrig=n.className;n.className+=" Wt-drop-site"}else a.className=""}};this.autoJavaScript=function(){if(d.parentNode==null){d=k=s=q=i=null;this.autoJavaScript=function(){}}else if(!f.isHidden(d)){var c=$(d),a=c.innerWidth(),b,e=null,h=k.offsetWidth-k.clientWidth;a-=h;if(c.hasClass("column1")){b=c.find(".Wt-headerdiv").get(0).lastChild.className.split(" ")[0];b=f.getCssRule("#"+d.id+" ."+b);e=f.pxself(b,"width")}if((!f.isIE||a>100)&&(a!=k.tw||e!=k.c0w||d.changed)){var g=!d.changed;k.tw=a;k.c0w=e;b=c.find(".Wt-headerdiv").get(0).lastChild.className.split(" ")[0];b=f.getCssRule("#"+d.id+" ."+b);var m=q.firstChild,j=f.getCssRule("#"+d.id+" .cwidth"),t=j.style.width==i.style.width,u=i.firstChild;j.style.width=a+"px";k.style.width=a+h+"px";i.style.width=m.offsetWidth+"px";if(e!=null){e=a-e-(f.isIE6?10:8);if(e>0){h=Math.min(e,f.pxself(f.getCssRule("#"+d.id+" .Wt-tv-rowc"),"width"));a-=e-h;f.getCssRule("#"+d.id+" .Wt-tv-row").style.width=h+"px";c.find(" .Wt-tv-row").css("width",h+"px").css("width","");i.style.width=a+"px";m.style.width=a+"px"}}else if(t){i.style.width=j.style.width;m.style.width=j.style.width}if(!p)b.style.width=m.offsetWidth-u.offsetWidth-8+"px";d.changed=false;g&&r.adjustColumns()}}};r.adjustColumns()}); |
var offset = WT.widgetCoordinates(el, event), elpos = WT.widgetPageCoordinates(el), | var offset, elpos = WT.widgetPageCoordinates(el), | function(WT, orientation, width, height, minDelta, maxDelta, dragWidgetClass, doneFn, el, parent, event, offsetX, offsetY) { var handle = document.createElement('div'); handle.style.position = 'absolute'; handle.style.zIndex = '100'; if (orientation == 'v') { handle.style.width = height + 'px'; handle.style.height = width + 'px'; } else { handle.style.height = height + 'px'; handle.style.width = width + 'px'; } var offset = WT.widgetCoordinates(el, event), elpos = WT.widgetPageCoordinates(el), parentpos = WT.widgetPageCoordinates(parent); offsetX -= WT.px(el, 'marginLeft'); offsetY -= WT.px(el, 'marginTop'); elpos.x += offsetX - parentpos.x; elpos.y += offsetY - parentpos.y; offset.x -= offsetX - parentpos.x; offset.y -= offsetY - parentpos.y; handle.style.left = elpos.x + 'px'; handle.style.top = elpos.y + 'px'; handle.className = dragWidgetClass; parent.appendChild(handle); WT.capture(null); WT.capture(handle); WT.cancelEvent(event); function computeDelta(event) { var p = WT.pageCoordinates(event), result; if (orientation == 'h') result = (p.x - offset.x) - elpos.x; else result = (p.y - offset.y) - elpos.y; return Math.min(Math.max(result, minDelta), maxDelta); } handle.onmousemove = function(event) { var delta = computeDelta(event); if (orientation == 'h') handle.style.left = (elpos.x + delta) + 'px'; else handle.style.top = (elpos.y + delta) + 'px'; }; handle.onmouseup = function(event) { if (handle.parentNode != null) { handle.parentNode.removeChild(handle); doneFn(computeDelta(event)); } }; } |
WT.capture(null); WT.capture(handle); | function(WT, orientation, width, height, minDelta, maxDelta, dragWidgetClass, doneFn, el, parent, event, offsetX, offsetY) { var handle = document.createElement('div'); handle.style.position = 'absolute'; handle.style.zIndex = '100'; if (orientation == 'v') { handle.style.width = height + 'px'; handle.style.height = width + 'px'; } else { handle.style.height = height + 'px'; handle.style.width = width + 'px'; } var offset = WT.widgetCoordinates(el, event), elpos = WT.widgetPageCoordinates(el), parentpos = WT.widgetPageCoordinates(parent); offsetX -= WT.px(el, 'marginLeft'); offsetY -= WT.px(el, 'marginTop'); elpos.x += offsetX - parentpos.x; elpos.y += offsetY - parentpos.y; offset.x -= offsetX - parentpos.x; offset.y -= offsetY - parentpos.y; handle.style.left = elpos.x + 'px'; handle.style.top = elpos.y + 'px'; handle.className = dragWidgetClass; parent.appendChild(handle); WT.capture(null); WT.capture(handle); WT.cancelEvent(event); function computeDelta(event) { var p = WT.pageCoordinates(event), result; if (orientation == 'h') result = (p.x - offset.x) - elpos.x; else result = (p.y - offset.y) - elpos.y; return Math.min(Math.max(result, minDelta), maxDelta); } handle.onmousemove = function(event) { var delta = computeDelta(event); if (orientation == 'h') handle.style.left = (elpos.x + delta) + 'px'; else handle.style.top = (elpos.y + delta) + 'px'; }; handle.onmouseup = function(event) { if (handle.parentNode != null) { handle.parentNode.removeChild(handle); doneFn(computeDelta(event)); } }; } |
|
var p = WT.pageCoordinates(event), result; | var p, result; if (event.changedTouches) p = { x: event.changedTouches[0].pageX, y: event.changedTouches[0].pageY }; else p = WT.pageCoordinates(event); | function(WT, orientation, width, height, minDelta, maxDelta, dragWidgetClass, doneFn, el, parent, event, offsetX, offsetY) { var handle = document.createElement('div'); handle.style.position = 'absolute'; handle.style.zIndex = '100'; if (orientation == 'v') { handle.style.width = height + 'px'; handle.style.height = width + 'px'; } else { handle.style.height = height + 'px'; handle.style.width = width + 'px'; } var offset = WT.widgetCoordinates(el, event), elpos = WT.widgetPageCoordinates(el), parentpos = WT.widgetPageCoordinates(parent); offsetX -= WT.px(el, 'marginLeft'); offsetY -= WT.px(el, 'marginTop'); elpos.x += offsetX - parentpos.x; elpos.y += offsetY - parentpos.y; offset.x -= offsetX - parentpos.x; offset.y -= offsetY - parentpos.y; handle.style.left = elpos.x + 'px'; handle.style.top = elpos.y + 'px'; handle.className = dragWidgetClass; parent.appendChild(handle); WT.capture(null); WT.capture(handle); WT.cancelEvent(event); function computeDelta(event) { var p = WT.pageCoordinates(event), result; if (orientation == 'h') result = (p.x - offset.x) - elpos.x; else result = (p.y - offset.y) - elpos.y; return Math.min(Math.max(result, minDelta), maxDelta); } handle.onmousemove = function(event) { var delta = computeDelta(event); if (orientation == 'h') handle.style.left = (elpos.x + delta) + 'px'; else handle.style.top = (elpos.y + delta) + 'px'; }; handle.onmouseup = function(event) { if (handle.parentNode != null) { handle.parentNode.removeChild(handle); doneFn(computeDelta(event)); } }; } |
handle.onmousemove = function(event) { | handle.onmousemove = parent.ontouchmove = function(event) { | function(WT, orientation, width, height, minDelta, maxDelta, dragWidgetClass, doneFn, el, parent, event, offsetX, offsetY) { var handle = document.createElement('div'); handle.style.position = 'absolute'; handle.style.zIndex = '100'; if (orientation == 'v') { handle.style.width = height + 'px'; handle.style.height = width + 'px'; } else { handle.style.height = height + 'px'; handle.style.width = width + 'px'; } var offset = WT.widgetCoordinates(el, event), elpos = WT.widgetPageCoordinates(el), parentpos = WT.widgetPageCoordinates(parent); offsetX -= WT.px(el, 'marginLeft'); offsetY -= WT.px(el, 'marginTop'); elpos.x += offsetX - parentpos.x; elpos.y += offsetY - parentpos.y; offset.x -= offsetX - parentpos.x; offset.y -= offsetY - parentpos.y; handle.style.left = elpos.x + 'px'; handle.style.top = elpos.y + 'px'; handle.className = dragWidgetClass; parent.appendChild(handle); WT.capture(null); WT.capture(handle); WT.cancelEvent(event); function computeDelta(event) { var p = WT.pageCoordinates(event), result; if (orientation == 'h') result = (p.x - offset.x) - elpos.x; else result = (p.y - offset.y) - elpos.y; return Math.min(Math.max(result, minDelta), maxDelta); } handle.onmousemove = function(event) { var delta = computeDelta(event); if (orientation == 'h') handle.style.left = (elpos.x + delta) + 'px'; else handle.style.top = (elpos.y + delta) + 'px'; }; handle.onmouseup = function(event) { if (handle.parentNode != null) { handle.parentNode.removeChild(handle); doneFn(computeDelta(event)); } }; } |
handle.onmouseup = function(event) { | handle.onmouseup = parent.ontouchend = function(event) { | function(WT, orientation, width, height, minDelta, maxDelta, dragWidgetClass, doneFn, el, parent, event, offsetX, offsetY) { var handle = document.createElement('div'); handle.style.position = 'absolute'; handle.style.zIndex = '100'; if (orientation == 'v') { handle.style.width = height + 'px'; handle.style.height = width + 'px'; } else { handle.style.height = height + 'px'; handle.style.width = width + 'px'; } var offset = WT.widgetCoordinates(el, event), elpos = WT.widgetPageCoordinates(el), parentpos = WT.widgetPageCoordinates(parent); offsetX -= WT.px(el, 'marginLeft'); offsetY -= WT.px(el, 'marginTop'); elpos.x += offsetX - parentpos.x; elpos.y += offsetY - parentpos.y; offset.x -= offsetX - parentpos.x; offset.y -= offsetY - parentpos.y; handle.style.left = elpos.x + 'px'; handle.style.top = elpos.y + 'px'; handle.className = dragWidgetClass; parent.appendChild(handle); WT.capture(null); WT.capture(handle); WT.cancelEvent(event); function computeDelta(event) { var p = WT.pageCoordinates(event), result; if (orientation == 'h') result = (p.x - offset.x) - elpos.x; else result = (p.y - offset.y) - elpos.y; return Math.min(Math.max(result, minDelta), maxDelta); } handle.onmousemove = function(event) { var delta = computeDelta(event); if (orientation == 'h') handle.style.left = (elpos.x + delta) + 'px'; else handle.style.top = (elpos.y + delta) + 'px'; }; handle.onmouseup = function(event) { if (handle.parentNode != null) { handle.parentNode.removeChild(handle); doneFn(computeDelta(event)); } }; } |
parent.ontouchmove = null; | function(WT, orientation, width, height, minDelta, maxDelta, dragWidgetClass, doneFn, el, parent, event, offsetX, offsetY) { var handle = document.createElement('div'); handle.style.position = 'absolute'; handle.style.zIndex = '100'; if (orientation == 'v') { handle.style.width = height + 'px'; handle.style.height = width + 'px'; } else { handle.style.height = height + 'px'; handle.style.width = width + 'px'; } var offset = WT.widgetCoordinates(el, event), elpos = WT.widgetPageCoordinates(el), parentpos = WT.widgetPageCoordinates(parent); offsetX -= WT.px(el, 'marginLeft'); offsetY -= WT.px(el, 'marginTop'); elpos.x += offsetX - parentpos.x; elpos.y += offsetY - parentpos.y; offset.x -= offsetX - parentpos.x; offset.y -= offsetY - parentpos.y; handle.style.left = elpos.x + 'px'; handle.style.top = elpos.y + 'px'; handle.className = dragWidgetClass; parent.appendChild(handle); WT.capture(null); WT.capture(handle); WT.cancelEvent(event); function computeDelta(event) { var p = WT.pageCoordinates(event), result; if (orientation == 'h') result = (p.x - offset.x) - elpos.x; else result = (p.y - offset.y) - elpos.y; return Math.min(Math.max(result, minDelta), maxDelta); } handle.onmousemove = function(event) { var delta = computeDelta(event); if (orientation == 'h') handle.style.left = (elpos.x + delta) + 'px'; else handle.style.top = (elpos.y + delta) + 'px'; }; handle.onmouseup = function(event) { if (handle.parentNode != null) { handle.parentNode.removeChild(handle); doneFn(computeDelta(event)); } }; } |
|
if (c[key] !== null) { vars += key +'='+ (typeof c[key] == 'object' ? asString(c[key]) : c[key]) + '&'; | var val = c[key]; if (val !== null) { vars += key +'='+ (typeof val == 'object' || typeof val == 'function' ? asString(val) : val) + '&'; | (function() { //{{{ utility functions var jQ = typeof jQuery == 'function';var options = { // very common opts width: '100%', height: '100%', // flashembed defaults allowfullscreen: true, allowscriptaccess: 'always', quality: 'high', // flashembed specific options version: null, onFail: null, expressInstall: null, w3c: false, cachebusting: false };if (jQ) { // tools version number jQuery.tools = jQuery.tools || {version: '@VERSION'}; jQuery.tools.flashembed = { conf: options }; }// from "Pro JavaScript techniques" by John Resigfunction isDomReady() { if (domReady.done) { return false; } var d = document; if (d && d.getElementsByTagName && d.getElementById && d.body) { clearInterval(domReady.timer); domReady.timer = null; for (var i = 0; i < domReady.ready.length; i++) { domReady.ready[i].call(); } domReady.ready = null; domReady.done = true; } }// if jQuery is present, use it's more effective domReady methodvar domReady = jQ ? jQuery : function(f) { if (domReady.done) { return f(); } if (domReady.timer) { domReady.ready.push(f); } else { domReady.ready = [f]; domReady.timer = setInterval(isDomReady, 13); } }; // override extend opts function function extend(to, from) { if (from) { for (key in from) { if (from.hasOwnProperty(key)) { to[key] = from[key]; } } } return to;} // JSON.asString() functionfunction asString(obj) { switch (typeOf(obj)){ case 'string': obj = obj.replace(new RegExp('(["\\\\])', 'g'), '\\$1'); // flash does not handle %- characters well. transforms "50%" to "50pct" (a dirty hack, I admit) obj = obj.replace(/^\s?(\d+\.?\d+)%/, "$1pct"); return '"' +obj+ '"'; case 'array': return '['+ map(obj, function(el) { return asString(el); }).join(',') +']'; case 'function': return '"function()"'; case 'object': var str = []; for (var prop in obj) { if (obj.hasOwnProperty(prop)) { str.push('"'+prop+'":'+ asString(obj[prop])); } } return '{'+str.join(',')+'}'; } // replace ' --> " and remove spaces return String(obj).replace(/\s/g, " ").replace(/\'/g, "\"");}// private functionsfunction typeOf(obj) { if (obj === null || obj === undefined) { return false; } var type = typeof obj; return (type == 'object' && obj.push) ? 'array' : type;}// version 9 bugfix: (http://blog.deconcept.com/2006/07/28/swfobject-143-released/)if (window.attachEvent) { window.attachEvent("onbeforeunload", function() { __flash_unloadHandler = function() {}; __flash_savedUnloadHandler = function() {}; });}function map(arr, func) { var newArr = []; for (var i in arr) { if (arr.hasOwnProperty(i)) { newArr[i] = func(arr[i]); } } return newArr;} function getHTML(p, c) { var e = extend({}, p); var ie = document.all; var html = '<object width="' +e.width+ '" height="' +e.height+ '"'; // force id for IE or Flash API cannot be returned if (ie && !e.id) { e.id = "_" + ("" + Math.random()).slice(9); } if (e.id) { html += ' id="' + e.id + '"'; } // prevent possible caching problems if (e.cachebusting) { e.src += ((e.src.indexOf("?") != -1 ? "&" : "?") + Math.random()); } if (e.w3c || !ie) { html += ' data="' +e.src+ '" type="application/x-shockwave-flash"'; } else { html += ' classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'; } html += '>'; if (e.w3c || ie) { html += '<param name="movie" value="' +e.src+ '" />'; } // parameters e.width = e.height = e.id = e.w3c = e.src = null; for (var k in e) { if (e[k] !== null) { html += '<param name="'+ k +'" value="'+ e[k] +'" />'; } } // flashvars var vars = ""; if (c) { for (var key in c) { if (c[key] !== null) { vars += key +'='+ (typeof c[key] == 'object' ? asString(c[key]) : c[key]) + '&'; } } vars = vars.slice(0, -1); html += '<param name="flashvars" value=\'' + vars + '\' />'; } html += "</object>"; return html;}//}}}function Flash(root, opts, flashvars) { var version = flashembed.getVersion(); // API methods for callback extend(this, { getContainer: function() { return root; }, getConf: function() { return opts; }, getVersion: function() { return version; }, getFlashvars: function() { return flashvars; }, getApi: function() { return root.firstChild; }, getHTML: function() { return getHTML(opts, flashvars); } }); // variables var required = opts.version; var express = opts.expressInstall; // everything ok -> generate OBJECT tag var ok = !required || flashembed.isSupported(required); if (ok) { opts.onFail = opts.version = opts.expressInstall = null; root.innerHTML = getHTML(opts, flashvars); // fail #1. express install } else if (required && express && flashembed.isSupported([6,65])) { extend(opts, {src: express}); flashvars = { MMredirectURL: location.href, MMplayerType: 'PlugIn', MMdoctitle: document.title }; root.innerHTML = getHTML(opts, flashvars); // fail #2. } else { // fail #2.1 custom content inside container if (root.innerHTML.replace(/\s/g, '') !== '') { // minor bug fixed here 08.04.2008 (thanks JRodman) // fail #2.2 default content } else { root.innerHTML = "<h2>Flash version " + required + " or greater is required</h2>" + "<h3>" + (version[0] > 0 ? "Your version is " + version : "You have no flash plugin installed") + "</h3>" + (root.tagName == 'A' ? "<p>Click here to download latest version</p>" : "<p>Download latest version from <a href='http://www.adobe.com/go/getflashplayer'>here</a></p>"); if (root.tagName == 'A') { root.onclick = function() { location.href= 'http://www.adobe.com/go/getflashplayer'; }; } } } // onFail if (!ok && opts.onFail) { var ret = opts.onFail.call(this); if (typeof ret == 'string') { root.innerHTML = ret; } } // http://flowplayer.org/forum/8/18186#post-18593 if (document.all) { window[opts.id] = document.getElementById(opts.id); } }window.flashembed = function(root, conf, flashvars) { //{{{ construction // root must be found / loaded if (typeof root == 'string') { var el = document.getElementById(root); if (el) { root = el; } else { domReady(function() { flashembed(root, conf, flashvars); }); return; } } // not found if (!root) { return; } if (typeof conf == 'string') { conf = {src: conf}; } var opts = extend({}, options); extend(opts, conf); return new Flash(root, opts, flashvars); //}}} };//{{{ static methodsextend(window.flashembed, { // returns arr[major, fix] getVersion: function() { var version = [0, 0]; if (navigator.plugins && typeof navigator.plugins["Shockwave Flash"] == "object") { var _d = navigator.plugins["Shockwave Flash"].description; if (typeof _d != "undefined") { _d = _d.replace(/^.*\s+(\S+\s+\S+$)/, "$1"); var _m = parseInt(_d.replace(/^(.*)\..*$/, "$1"), 10); var _r = /r/.test(_d) ? parseInt(_d.replace(/^.*r(.*)$/, "$1"), 10) : 0; version = [_m, _r]; } } else if (window.ActiveXObject) { try { // avoid fp 6 crashes var _a = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7"); } catch(e) { try { _a = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6"); version = [6, 0]; _a.AllowScriptAccess = "always"; // throws if fp < 6.47 } catch(ee) { if (version[0] == 6) { return version; } } try { _a = new ActiveXObject("ShockwaveFlash.ShockwaveFlash"); } catch(eee) { } } if (typeof _a == "object") { _d = _a.GetVariable("$version"); // bugs in fp 6.21 / 6.23 if (typeof _d != "undefined") { _d = _d.replace(/^\S+\s+(.*)$/, "$1").split(","); version = [parseInt(_d[0], 10), parseInt(_d[2], 10)]; } } } return version; }, isSupported: function(version) { var now = flashembed.getVersion(); var ret = (now[0] > version[0]) || (now[0] == version[0] && now[1] >= version[1]); return ret; }, domReady: domReady, // returns a String representation from JSON object asString: asString, getHTML: getHTML });//}}}// setup jquery supportif (jQ) { jQuery.fn.flashembed = function(conf, flashvars) { var el = null; this.each(function() { el = flashembed(this, conf, flashvars); }); return conf.api === false ? this : el; };}})(); |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.