rem
stringlengths 0
126k
| add
stringlengths 0
441k
| context
stringlengths 15
136k
|
---|---|---|
completion.searchEngine = function searchEngine(context, suggest) { | completion.searchEngine = function searchEngine(context, args, suggest) { | completion.searchEngine = function searchEngine(context, suggest) { let engines = services.get("browserSearch").getEngines({}); if (suggest) engines = engines.filter(function (e) e.supportsResponseType("application/x-suggestions+json")); context.title = ["Suggest Engine", "Description"]; context.completions = engines.map(function (e) [e.alias, e.description]); }; |
let engineList = (engineAliases || options["suggestengines"] || "google").split(","); | let engineList = (engineAliases || options["suggestengines"].join(",") || "google").split(","); | completion.searchEngineSuggest = function searchEngineSuggest(context, engineAliases, kludge) { if (!context.filter) return; let engineList = (engineAliases || options["suggestengines"] || "google").split(","); let completions = []; engineList.forEach(function (name) { let engine = services.get("browserSearch").getEngineByAlias(name); if (!engine) return; let [, word] = /^\s*(\S+)/.exec(context.filter) || []; if (!kludge && word == name) // FIXME: Check for matching keywords return; let ctxt = context.fork(name, 0); ctxt.title = [engine.description + " Suggestions"]; ctxt.compare = CompletionContext.Sort.unsorted; ctxt.incomplete = true; bookmarks.getSuggestions(name, ctxt.filter, function (compl) { ctxt.incomplete = false; ctxt.completions = compl; }); }); }; |
completion.searchEngineSuggest = function searchEngineSuggest(context, engineAliases, kludge) { | completion.searchEngineSuggest = function searchEngineSuggest(context, args, engineAliases, kludge) { | completion.searchEngineSuggest = function searchEngineSuggest(context, engineAliases, kludge) { if (!context.filter) return; let engineList = (engineAliases || options["suggestengines"].join(",") || "google").split(","); let completions = []; engineList.forEach(function (name) { let engine = services.get("browserSearch").getEngineByAlias(name); if (!engine) return; let [, word] = /^\s*(\S+)/.exec(context.filter) || []; if (!kludge && word == name) // FIXME: Check for matching keywords return; let ctxt = context.fork(name, 0); ctxt.title = [engine.description + " Suggestions"]; ctxt.compare = CompletionContext.Sort.unsorted; ctxt.incomplete = true; bookmarks.getSuggestions(name, ctxt.filter, function (compl) { ctxt.incomplete = false; ctxt.completions = compl; }); }); }; |
switch(SC.typeOf(value)) { | switch(type) { | var searchObject = function(root, object, levels) { levels-- ; // not the fastest, but safe if (seen.indexOf(object) >= 0) return ; seen.push(object) ; for(var key in object) { if (key == '__scope__') continue ; if (key == 'superclass') continue ; if (key == '__SC__') key = 'SC' ; if (!key.match(/^[A-Z0-9]/)) continue ; if (key == 'SC') { if (detectedSC) continue; detectedSC = true; } var path = (root) ? [root,key].join('.') : key ; var value = object[key] ; switch(SC.typeOf(value)) { case SC.T_CLASS: if (!value._object_className) value._object_className = path; if (levels>=0) searchObject(path, value, levels) ; break ; case SC.T_OBJECT: if (levels>=0) searchObject(path, value, levels) ; break ; case SC.T_HASH: if (((root) || (path==='SC')) && (levels>=0)) searchObject(path, value, levels) ; break ; default: break; } } } ; |
if(! parent.opener || ! parent.opener.addNewAirport) { guest = true; } else { guest = false; } | function searchResult(str) { var airports = str.split("\n"); var table = "<table width=95% cellspacing=0>"; var offset, sql; var db = document.forms['searchform'].db.value; var disclaimer = ""; if(! parent.opener || ! parent.opener.addNewAirport) { guest = true; } else { guest = false; } if(warning) { table += "<tr><td colspan=2><i><font color='red'>" + warning + "</font></i></td></tr>"; warning = null; } for(a in airports) { // First line contains header info if(a == 0) { var col = airports[a].split(";"); offset = parseInt(col[0]); max = col[1]; if(max == 0) { table += "<tr><td><i>" + gt.gettext("No matches found in this database.") + "<br><ul>"; if(document.forms['searchform'].iatafilter.checked) { table += "<li>" + gt.gettext("Try unchecking 'Show only major airports' and search again."); } if(document.forms['searchform'].db.value != DB_OURAIRPORTS) { table += "<li>" + gt.gettext("Switch to the OurAirports database and search again."); } table += "</ul></td></tr>"; break; } table += "<tr><td><b>" + Gettext.strargs(gt.gettext("Results %1 to %2 of %3"), [offset+1, Math.min(offset+10, max), max]) + "</b><br></td>"; if(max > 10) { table += "<td style=\"text-align: right\"><nobr>"; if(offset - 10 >= 0) { table += "<INPUT id=\"b_back\" type=\"button\" value=\"<\" onClick=\"doSearch(" + (offset-10) + ")\">"; } else { table += "<INPUT type=\"button\" value=\"<\" disabled>"; } if(offset + 10 < max) { table += "<INPUT id=\"b_fwd\" type=\"button\" value=\">\" onClick=\"doSearch(" + (offset+10) + ")\">"; } else { table += "<INPUT type=\"button\" value=\">\" disabled>"; } table += "</nobr></td>"; } table += "</tr>"; continue; } // Meat of the table var col = jsonParse(airports[a]); if(a % 2 == 1) { bgcolor = "#fff"; } else { bgcolor = "#ddd"; } switch(col["ap_uid"]) { case "user": bgcolor = "#fdd"; disclaimer = "<br><span style='background-color: " + bgcolor + "'>" + gt.gettext("Airports in pink have been added by users of OpenFlights.") + "</span>"; break; case "own": bgcolor = "#ddf"; disclaimer = "<br><span style='background-color: " + bgcolor + "'>" + gt.gettext("Airports in blue have been added by you and can be edited.") + "<span>"; break; } table += "<tr><td style='background-color: " + bgcolor + "'>" + col["ap_name"] + "</td>"; if(db == DB_OPENFLIGHTS && !guest) { // code:apid:x:y:tz:dst id = (col["iata"] != "" ? col["iata"] : col["icao"]) + ":" + col["apid"] + ":" + col["x"] + ":" + col["y"] + ":" + col["timezone"] + ":" + col["dst"]; table += "<td style='text-align: right; background-color: " + bgcolor + "'><INPUT type='button' value='" + gt.gettext("Select") + "' onClick='selectAirport(\"" + id + "\",\"" + encodeURIComponent(col["ap_name"]) + "\")'></td>"; } if(db != DB_OPENFLIGHTS || col["ap_uid"] == "own" || guest) { if(col["ap_uid"] == "own" && db == DB_OPENFLIGHTS) { label = gt.gettext("Edit"); } else { label = gt.gettext("Load"); } table += "<td style='text-align: right; background-color: " + bgcolor + "'><INPUT type='button' value='" + label + "' onClick='loadAirport(\"" + encodeURIComponent(airports[a]) + "\")'></td>"; } table += "</tr>"; } table += "</table>"; table += disclaimer; document.getElementById("miniresultbox").innerHTML = table;} |
|
if(db == DB_OPENFLIGHTS && !guest) { | if(db == DB_OPENFLIGHTS && isEditMode()) { | function searchResult(str) { var airports = str.split("\n"); var table = "<table width=95% cellspacing=0>"; var offset, sql; var db = document.forms['searchform'].db.value; var disclaimer = ""; if(! parent.opener || ! parent.opener.addNewAirport) { guest = true; } else { guest = false; } if(warning) { table += "<tr><td colspan=2><i><font color='red'>" + warning + "</font></i></td></tr>"; warning = null; } for(a in airports) { // First line contains header info if(a == 0) { var col = airports[a].split(";"); offset = parseInt(col[0]); max = col[1]; if(max == 0) { table += "<tr><td><i>" + gt.gettext("No matches found in this database.") + "<br><ul>"; if(document.forms['searchform'].iatafilter.checked) { table += "<li>" + gt.gettext("Try unchecking 'Show only major airports' and search again."); } if(document.forms['searchform'].db.value != DB_OURAIRPORTS) { table += "<li>" + gt.gettext("Switch to the OurAirports database and search again."); } table += "</ul></td></tr>"; break; } table += "<tr><td><b>" + Gettext.strargs(gt.gettext("Results %1 to %2 of %3"), [offset+1, Math.min(offset+10, max), max]) + "</b><br></td>"; if(max > 10) { table += "<td style=\"text-align: right\"><nobr>"; if(offset - 10 >= 0) { table += "<INPUT id=\"b_back\" type=\"button\" value=\"<\" onClick=\"doSearch(" + (offset-10) + ")\">"; } else { table += "<INPUT type=\"button\" value=\"<\" disabled>"; } if(offset + 10 < max) { table += "<INPUT id=\"b_fwd\" type=\"button\" value=\">\" onClick=\"doSearch(" + (offset+10) + ")\">"; } else { table += "<INPUT type=\"button\" value=\">\" disabled>"; } table += "</nobr></td>"; } table += "</tr>"; continue; } // Meat of the table var col = jsonParse(airports[a]); if(a % 2 == 1) { bgcolor = "#fff"; } else { bgcolor = "#ddd"; } switch(col["ap_uid"]) { case "user": bgcolor = "#fdd"; disclaimer = "<br><span style='background-color: " + bgcolor + "'>" + gt.gettext("Airports in pink have been added by users of OpenFlights.") + "</span>"; break; case "own": bgcolor = "#ddf"; disclaimer = "<br><span style='background-color: " + bgcolor + "'>" + gt.gettext("Airports in blue have been added by you and can be edited.") + "<span>"; break; } table += "<tr><td style='background-color: " + bgcolor + "'>" + col["ap_name"] + "</td>"; if(db == DB_OPENFLIGHTS && !guest) { // code:apid:x:y:tz:dst id = (col["iata"] != "" ? col["iata"] : col["icao"]) + ":" + col["apid"] + ":" + col["x"] + ":" + col["y"] + ":" + col["timezone"] + ":" + col["dst"]; table += "<td style='text-align: right; background-color: " + bgcolor + "'><INPUT type='button' value='" + gt.gettext("Select") + "' onClick='selectAirport(\"" + id + "\",\"" + encodeURIComponent(col["ap_name"]) + "\")'></td>"; } if(db != DB_OPENFLIGHTS || col["ap_uid"] == "own" || guest) { if(col["ap_uid"] == "own" && db == DB_OPENFLIGHTS) { label = gt.gettext("Edit"); } else { label = gt.gettext("Load"); } table += "<td style='text-align: right; background-color: " + bgcolor + "'><INPUT type='button' value='" + label + "' onClick='loadAirport(\"" + encodeURIComponent(airports[a]) + "\")'></td>"; } table += "</tr>"; } table += "</table>"; table += disclaimer; document.getElementById("miniresultbox").innerHTML = table;} |
if(db != DB_OPENFLIGHTS || col["ap_uid"] == "own" || guest) { | if(db != DB_OPENFLIGHTS || col["ap_uid"] == "own" || ! isEditMode()) { | function searchResult(str) { var airports = str.split("\n"); var table = "<table width=95% cellspacing=0>"; var offset, sql; var db = document.forms['searchform'].db.value; var disclaimer = ""; if(! parent.opener || ! parent.opener.addNewAirport) { guest = true; } else { guest = false; } if(warning) { table += "<tr><td colspan=2><i><font color='red'>" + warning + "</font></i></td></tr>"; warning = null; } for(a in airports) { // First line contains header info if(a == 0) { var col = airports[a].split(";"); offset = parseInt(col[0]); max = col[1]; if(max == 0) { table += "<tr><td><i>" + gt.gettext("No matches found in this database.") + "<br><ul>"; if(document.forms['searchform'].iatafilter.checked) { table += "<li>" + gt.gettext("Try unchecking 'Show only major airports' and search again."); } if(document.forms['searchform'].db.value != DB_OURAIRPORTS) { table += "<li>" + gt.gettext("Switch to the OurAirports database and search again."); } table += "</ul></td></tr>"; break; } table += "<tr><td><b>" + Gettext.strargs(gt.gettext("Results %1 to %2 of %3"), [offset+1, Math.min(offset+10, max), max]) + "</b><br></td>"; if(max > 10) { table += "<td style=\"text-align: right\"><nobr>"; if(offset - 10 >= 0) { table += "<INPUT id=\"b_back\" type=\"button\" value=\"<\" onClick=\"doSearch(" + (offset-10) + ")\">"; } else { table += "<INPUT type=\"button\" value=\"<\" disabled>"; } if(offset + 10 < max) { table += "<INPUT id=\"b_fwd\" type=\"button\" value=\">\" onClick=\"doSearch(" + (offset+10) + ")\">"; } else { table += "<INPUT type=\"button\" value=\">\" disabled>"; } table += "</nobr></td>"; } table += "</tr>"; continue; } // Meat of the table var col = jsonParse(airports[a]); if(a % 2 == 1) { bgcolor = "#fff"; } else { bgcolor = "#ddd"; } switch(col["ap_uid"]) { case "user": bgcolor = "#fdd"; disclaimer = "<br><span style='background-color: " + bgcolor + "'>" + gt.gettext("Airports in pink have been added by users of OpenFlights.") + "</span>"; break; case "own": bgcolor = "#ddf"; disclaimer = "<br><span style='background-color: " + bgcolor + "'>" + gt.gettext("Airports in blue have been added by you and can be edited.") + "<span>"; break; } table += "<tr><td style='background-color: " + bgcolor + "'>" + col["ap_name"] + "</td>"; if(db == DB_OPENFLIGHTS && !guest) { // code:apid:x:y:tz:dst id = (col["iata"] != "" ? col["iata"] : col["icao"]) + ":" + col["apid"] + ":" + col["x"] + ":" + col["y"] + ":" + col["timezone"] + ":" + col["dst"]; table += "<td style='text-align: right; background-color: " + bgcolor + "'><INPUT type='button' value='" + gt.gettext("Select") + "' onClick='selectAirport(\"" + id + "\",\"" + encodeURIComponent(col["ap_name"]) + "\")'></td>"; } if(db != DB_OPENFLIGHTS || col["ap_uid"] == "own" || guest) { if(col["ap_uid"] == "own" && db == DB_OPENFLIGHTS) { label = gt.gettext("Edit"); } else { label = gt.gettext("Load"); } table += "<td style='text-align: right; background-color: " + bgcolor + "'><INPUT type='button' value='" + label + "' onClick='loadAirport(\"" + encodeURIComponent(airports[a]) + "\")'></td>"; } table += "</tr>"; } table += "</table>"; table += disclaimer; document.getElementById("miniresultbox").innerHTML = table;} |
var bt_edit_security_group = new DcmgrGUI.Dialog({ target:'.edit_security_group', width:500, height:580, title:'Edit Security Group', path:'/edit_security_group', button:{ "Yes, Update": function() { var name = $('#security_group_name').val(); var description = $('#security_group_description').val(); var rule = $('#security_group_rule').val(); var data = 'name=' + name +'&description=' + description +'&rule=' + rule; $.ajax({ "type": "PUT", "async": true, "url": '/security_groups/'+ name +'.json', "dataType": "json", "data": data, success: function(json,status){ console.log(json); bt_refresh.element.trigger('dcmgrGUI.refresh'); } }); $(this).dialog("close"); } } }); bt_edit_security_group.target.bind('click',function(event){ var id = $(this).attr('id').replace(/edit_([a-z_]+)/,'$1') if( id ){ bt_edit_security_group.open({"ids":[id]}); } c_list.checkRadioButton(id); $('#detail').html(''); return false; }); | DcmgrGUI.prototype.securityGroupPanel = function(){ var total = 0; var maxrow = 10; var page = 1; var list_request = { "url" : DcmgrGUI.Util.getPagePath('/security_groups/list/',page), "data" : DcmgrGUI.Util.getPagenateData(page,maxrow) }; DcmgrGUI.List.prototype.getEmptyData = function(){ return [{ "name":'', "description":'' }] } DcmgrGUI.Detail.prototype.getEmptyData = function(){ return { "name" : "-", "description" : "-", "rule":'' } } var c_pagenate = new DcmgrGUI.Pagenate({ row:maxrow, total:total }); var c_list = new DcmgrGUI.List({ element_id:'#display_security_groups', template_id:'#securityGroupsListTemplate', maxrow:maxrow, page:page }); c_list.setDetailTemplate({ template_id:'#securityGroupsDetailTemplate', detail_path:'/security_groups/show/' }); c_list.element.bind('dcmgrGUI.contentChange',function(event,params){ var netfilter_group = params.data.netfilter_group; c_pagenate.changeTotal(netfilter_group.owner_total); c_list.setData(netfilter_group.results); c_list.singleCheckList(c_list.detail_template); }); var bt_refresh = new DcmgrGUI.Refresh(); bt_refresh.element.bind('dcmgrGUI.refresh',function(){ //Update list element c_list.page = c_pagenate.current_page; list_request.url = DcmgrGUI.Util.getPagePath('/security_groups/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}) $.each(c_list.checked_list,function(check_id,obj){ //All remove detail element $($('#detail').find('#'+check_id)).remove(); //All reload detail element c_list.checked_list[check_id].c_detail.update({ url:DcmgrGUI.Util.getPagePath('/security_groups/show/',check_id) },true); }); }); c_pagenate.element.bind('dcmgrGUI.updatePagenate',function(){ c_list.clearCheckedList(); $('#detail').html(''); bt_refresh.element.trigger('dcmgrGUI.refresh'); }); var bt_create_security_group = new DcmgrGUI.Dialog({ target:'.create_security_group', width:500, height:580, title:'Create Security Group', path:'/create_security_group', button:{ "Create": function() { var name = $('#security_group_name').val(); var description = $('#security_group_description').val(); var rule = $('#security_group_rule').val(); var data = 'name=' + name +'&description=' + description +'&rule=' + rule; if(!name){ $('#security_group_name').focus(); return false; } if(!name.match(/[a-z_]+/)){ $('#security_group_name').focus(); return false; } $.ajax({ "type": "POST", "async": true, "url": '/security_groups.json', "dataType": "json", "data": data, success: function(json,status){ console.log(json); bt_refresh.element.trigger('dcmgrGUI.refresh'); } }); $(this).dialog("close"); } } }); bt_create_security_group.target.bind('click',function(){ bt_create_security_group.open(); }); var bt_delete_security_group = new DcmgrGUI.Dialog({ target:'.delete_security_group', width:400, height:200, title:'Delete Security Group', path:'/delete_security_group', button:{ "Yes, Delete": function() { var name = $('#delete_group_name').text(); $.ajax({ "type": "DELETE", "async": true, "url": '/security_groups/'+ name +'.json', "dataType": "json", success: function(json,status){ console.log(json); bt_refresh.element.trigger('dcmgrGUI.refresh'); } }); $(this).dialog("close"); } } }); bt_delete_security_group.target.bind('click',function(){ var id = c_list.currentChecked(); if( id ){ bt_delete_security_group.open(id); } return false; }); c_list.setData(null); c_list.update(list_request,true);} |
|
$('#detail').find('#config_'+id).html(initialize_config); | $('#security_group_config').html(initialize_config); | DcmgrGUI.prototype.securityGroupPanel = function(){ var list_request = { "url":DcmgrGUI.Util.getPagePath('/security_groups/show/',1) }; DcmgrGUI.List.prototype.getEmptyData = function(){ return [{ "id":'', "group_id":'', "name":'', "description":'' }] } DcmgrGUI.Detail.prototype.getEmptyData = function(){ return { "group_id":"-", "name" : "-", "description" : "-", "config" : "", } } DcmgrGUI.Detail.prototype.register_event('dcmgrGUI.configUpdate',function(event,id){ var initialize_config = "" + "# Format\n" + "# Connection Method,Protocol,From Port,To Port,Source(IP or group)\n" + "#\n" + "# Exmaple:\n" + "# ssh,tcp,22,22,0.0.0.0/0\n"; var data = $('#detail').find('#config_'+id).html(); if(!data){ $('#detail').find('#config_'+id).html(initialize_config); } }); DcmgrGUI.Detail.prototype.register_event('dcmgrGUI.afterUpdate',function(event,params){ var self = params.self; $('#detail').find('#update_'+self.id).live('click',function(){ $.ajax({ "type": "POST", "async": true, "url": '/security_groups/config', "data":"id="+self.id, "dataType": "json", success: function(json,status){ console.log(status); } }); }); self.element.trigger('dcmgrGUI.configUpdatee',[self.id]); }); var c_list = new DcmgrGUI.List({ element_id:'#display_volumes', template_id:'#securityGroupsListTemplate' }); c_list.setDetailTemplate({ template_id:'#securityGroupsDetailTemplate', detail_path:'/security_groups/detail/' }); var c_pagenate = new DcmgrGUI.Pagenate({ row:10, total:30 //todo:get total from dcmgr }); var bt_refresh = new DcmgrGUI.Refresh(); bt_refresh.element.bind('dcmgrGUI.refresh',function(){ //Update list element list_request.url = DcmgrGUI.Util.getPagePath('/security_groups/show/',c_pagenate.current_page); c_list.element.trigger('dcmgrGUI.updateList',{request:list_request}) $.each(c_list.checked_list,function(check_id,obj){ //All remove detail element $($('#detail').find('#'+check_id)).remove(); //All reload detail element c_list.checked_list[check_id].c_detail.update({ url:DcmgrGUI.Util.getPagePath('/security_groups/detail/',check_id) },true); }); }); c_pagenate.element.bind('dcmgrGUI.updatePagenate',function(){ c_list.clearCheckedList(); $('#detail').html(''); bt_refresh.element.trigger('dcmgrGUI.refresh'); }); c_list.setData(null); c_list.update(list_request,true);} |
self.element.trigger('dcmgrGUI.configUpdatee',[self.id]); | self.element.trigger('dcmgrGUI.configUpdate',[self.id]); | DcmgrGUI.prototype.securityGroupPanel = function(){ var list_request = { "url":DcmgrGUI.Util.getPagePath('/security_groups/show/',1) }; DcmgrGUI.List.prototype.getEmptyData = function(){ return [{ "id":'', "group_id":'', "name":'', "description":'' }] } DcmgrGUI.Detail.prototype.getEmptyData = function(){ return { "group_id":"-", "name" : "-", "description" : "-", "config" : "", } } DcmgrGUI.Detail.prototype.register_event('dcmgrGUI.configUpdate',function(event,id){ var initialize_config = "" + "# Format\n" + "# Connection Method,Protocol,From Port,To Port,Source(IP or group)\n" + "#\n" + "# Exmaple:\n" + "# ssh,tcp,22,22,0.0.0.0/0\n"; var data = $('#detail').find('#config_'+id).html(); if(!data){ $('#detail').find('#config_'+id).html(initialize_config); } }); DcmgrGUI.Detail.prototype.register_event('dcmgrGUI.afterUpdate',function(event,params){ var self = params.self; $('#detail').find('#update_'+self.id).live('click',function(){ $.ajax({ "type": "POST", "async": true, "url": '/security_groups/config', "data":"id="+self.id, "dataType": "json", success: function(json,status){ console.log(status); } }); }); self.element.trigger('dcmgrGUI.configUpdatee',[self.id]); }); var c_list = new DcmgrGUI.List({ element_id:'#display_volumes', template_id:'#securityGroupsListTemplate' }); c_list.setDetailTemplate({ template_id:'#securityGroupsDetailTemplate', detail_path:'/security_groups/detail/' }); var c_pagenate = new DcmgrGUI.Pagenate({ row:10, total:30 //todo:get total from dcmgr }); var bt_refresh = new DcmgrGUI.Refresh(); bt_refresh.element.bind('dcmgrGUI.refresh',function(){ //Update list element list_request.url = DcmgrGUI.Util.getPagePath('/security_groups/show/',c_pagenate.current_page); c_list.element.trigger('dcmgrGUI.updateList',{request:list_request}) $.each(c_list.checked_list,function(check_id,obj){ //All remove detail element $($('#detail').find('#'+check_id)).remove(); //All reload detail element c_list.checked_list[check_id].c_detail.update({ url:DcmgrGUI.Util.getPagePath('/security_groups/detail/',check_id) },true); }); }); c_pagenate.element.bind('dcmgrGUI.updatePagenate',function(){ c_list.clearCheckedList(); $('#detail').html(''); bt_refresh.element.trigger('dcmgrGUI.refresh'); }); 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.singleCheckList(c_list.detail_template); | DcmgrGUI.prototype.securityGroupPanel = function(){ var list_request = { "url":DcmgrGUI.Util.getPagePath('/security_groups/show/',1) }; DcmgrGUI.List.prototype.getEmptyData = function(){ return [{ "id":'', "group_id":'', "name":'', "description":'' }] } DcmgrGUI.Detail.prototype.getEmptyData = function(){ return { "group_id":"-", "name" : "-", "description" : "-", "config" : "", } } DcmgrGUI.Detail.prototype.register_event('dcmgrGUI.configUpdate',function(event,id){ var initialize_config = "" + "# Format\n" + "# Connection Method,Protocol,From Port,To Port,Source(IP or group)\n" + "#\n" + "# Exmaple:\n" + "# ssh,tcp,22,22,0.0.0.0/0\n"; var data = $('#detail').find('#config_'+id).html(); if(!data){ $('#detail').find('#config_'+id).html(initialize_config); } }); DcmgrGUI.Detail.prototype.register_event('dcmgrGUI.afterUpdate',function(event,params){ var self = params.self; $('#detail').find('#update_'+self.id).live('click',function(){ $.ajax({ "type": "POST", "async": true, "url": '/security_groups/config', "data":"id="+self.id, "dataType": "json", success: function(json,status){ console.log(status); } }); }); self.element.trigger('dcmgrGUI.configUpdatee',[self.id]); }); var c_list = new DcmgrGUI.List({ element_id:'#display_volumes', template_id:'#securityGroupsListTemplate' }); c_list.setDetailTemplate({ template_id:'#securityGroupsDetailTemplate', detail_path:'/security_groups/detail/' }); var c_pagenate = new DcmgrGUI.Pagenate({ row:10, total:30 //todo:get total from dcmgr }); var bt_refresh = new DcmgrGUI.Refresh(); bt_refresh.element.bind('dcmgrGUI.refresh',function(){ //Update list element list_request.url = DcmgrGUI.Util.getPagePath('/security_groups/show/',c_pagenate.current_page); c_list.element.trigger('dcmgrGUI.updateList',{request:list_request}) $.each(c_list.checked_list,function(check_id,obj){ //All remove detail element $($('#detail').find('#'+check_id)).remove(); //All reload detail element c_list.checked_list[check_id].c_detail.update({ url:DcmgrGUI.Util.getPagePath('/security_groups/detail/',check_id) },true); }); }); c_pagenate.element.bind('dcmgrGUI.updatePagenate',function(){ c_list.clearCheckedList(); $('#detail').html(''); bt_refresh.element.trigger('dcmgrGUI.refresh'); }); c_list.setData(null); c_list.update(list_request,true);} |
|
width:600, height:220, | width:500, height:580, | DcmgrGUI.prototype.securityGroupPanel = function(){ var total = 0; var maxrow = 10; var page = 1; var list_request = { "url" : DcmgrGUI.Util.getPagePath('/security_groups/list/',page), "data" : DcmgrGUI.Util.getPagenateData(page,maxrow) }; DcmgrGUI.List.prototype.getEmptyData = function(){ return [{ "name":'', "description":'' }] } DcmgrGUI.Detail.prototype.getEmptyData = function(){ return { "name" : "-", "description" : "-", "rule":'' } } var c_pagenate = new DcmgrGUI.Pagenate({ row:maxrow, total:total }); var c_list = new DcmgrGUI.List({ element_id:'#display_security_groups', template_id:'#securityGroupsListTemplate', maxrow:maxrow, page:page }); c_list.setDetailTemplate({ template_id:'#securityGroupsDetailTemplate', detail_path:'/security_groups/show/' }); c_list.element.bind('dcmgrGUI.contentChange',function(event,params){ var netfilter_group = params.data.netfilter_group; c_pagenate.changeTotal(netfilter_group.owner_total); c_list.setData(netfilter_group.results); c_list.singleCheckList(c_list.detail_template); }); var bt_refresh = new DcmgrGUI.Refresh(); bt_refresh.element.bind('dcmgrGUI.refresh',function(){ //Update list element c_list.page = c_pagenate.current_page; list_request.url = DcmgrGUI.Util.getPagePath('/security_groups/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}) $.each(c_list.checked_list,function(check_id,obj){ //All remove detail element $($('#detail').find('#'+check_id)).remove(); //All reload detail element c_list.checked_list[check_id].c_detail.update({ url:DcmgrGUI.Util.getPagePath('/security_groups/show/',check_id) },true); }); }); c_pagenate.element.bind('dcmgrGUI.updatePagenate',function(){ c_list.clearCheckedList(); $('#detail').html(''); bt_refresh.element.trigger('dcmgrGUI.refresh'); }); var bt_create_security_group = new DcmgrGUI.Dialog({ target:'.create_security_group', width:600, height:220, title:'Create Security Group', path:'/create_security_group', button:{ "Create": function() { var name = $('#security_group_name').val(); var description = $('#security_group_description').val(); var rule = $('#security_group_rule').val(); var data = 'name=' + name +'&description=' + description +'&rule=' + rule; if(!name){ $('#security_group_name').focus(); return false; } if(!description){ $('#security_group_description').focus(); return false; } if(!rule){ $('#security_group_rule').focus(); return false; } $('#security_group_name').focus(); $.ajax({ "type": "POST", "async": true, "url": '/security_groups.json', "dataType": "json", "data": data, success: function(json,status){ console.log(json); bt_refresh.element.trigger('dcmgrGUI.refresh'); } }); $(this).dialog("close"); } } }); bt_create_security_group.target.bind('click',function(){ bt_create_security_group.open(); }); var bt_delete_security_group = new DcmgrGUI.Dialog({ target:'.delete_security_group', width:400, height:200, title:'Delete Security Group', path:'/delete_security_group', button:{ "Yes, Delete": function() { var name = $('#delete_group_name').text(); $.ajax({ "type": "DELETE", "async": true, "url": '/security_groups/'+ name +'.json', "dataType": "json", success: function(json,status){ console.log(json); bt_refresh.element.trigger('dcmgrGUI.refresh'); } }); $(this).dialog("close"); } } }); bt_delete_security_group.target.bind('click',function(){ var id = c_list.currentChecked(); if( id ){ bt_delete_security_group.open(id); } return false; }); c_list.setData(null); c_list.update(list_request,true);} |
if(!description){ $('#security_group_description').focus(); | if(!name.match(/[a-z_]+/)){ $('#security_group_name').focus(); | DcmgrGUI.prototype.securityGroupPanel = function(){ var total = 0; var maxrow = 10; var page = 1; var list_request = { "url" : DcmgrGUI.Util.getPagePath('/security_groups/list/',page), "data" : DcmgrGUI.Util.getPagenateData(page,maxrow) }; DcmgrGUI.List.prototype.getEmptyData = function(){ return [{ "name":'', "description":'' }] } DcmgrGUI.Detail.prototype.getEmptyData = function(){ return { "name" : "-", "description" : "-", "rule":'' } } var c_pagenate = new DcmgrGUI.Pagenate({ row:maxrow, total:total }); var c_list = new DcmgrGUI.List({ element_id:'#display_security_groups', template_id:'#securityGroupsListTemplate', maxrow:maxrow, page:page }); c_list.setDetailTemplate({ template_id:'#securityGroupsDetailTemplate', detail_path:'/security_groups/show/' }); c_list.element.bind('dcmgrGUI.contentChange',function(event,params){ var netfilter_group = params.data.netfilter_group; c_pagenate.changeTotal(netfilter_group.owner_total); c_list.setData(netfilter_group.results); c_list.singleCheckList(c_list.detail_template); }); var bt_refresh = new DcmgrGUI.Refresh(); bt_refresh.element.bind('dcmgrGUI.refresh',function(){ //Update list element c_list.page = c_pagenate.current_page; list_request.url = DcmgrGUI.Util.getPagePath('/security_groups/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}) $.each(c_list.checked_list,function(check_id,obj){ //All remove detail element $($('#detail').find('#'+check_id)).remove(); //All reload detail element c_list.checked_list[check_id].c_detail.update({ url:DcmgrGUI.Util.getPagePath('/security_groups/show/',check_id) },true); }); }); c_pagenate.element.bind('dcmgrGUI.updatePagenate',function(){ c_list.clearCheckedList(); $('#detail').html(''); bt_refresh.element.trigger('dcmgrGUI.refresh'); }); var bt_create_security_group = new DcmgrGUI.Dialog({ target:'.create_security_group', width:600, height:220, title:'Create Security Group', path:'/create_security_group', button:{ "Create": function() { var name = $('#security_group_name').val(); var description = $('#security_group_description').val(); var rule = $('#security_group_rule').val(); var data = 'name=' + name +'&description=' + description +'&rule=' + rule; if(!name){ $('#security_group_name').focus(); return false; } if(!description){ $('#security_group_description').focus(); return false; } if(!rule){ $('#security_group_rule').focus(); return false; } $('#security_group_name').focus(); $.ajax({ "type": "POST", "async": true, "url": '/security_groups.json', "dataType": "json", "data": data, success: function(json,status){ console.log(json); bt_refresh.element.trigger('dcmgrGUI.refresh'); } }); $(this).dialog("close"); } } }); bt_create_security_group.target.bind('click',function(){ bt_create_security_group.open(); }); var bt_delete_security_group = new DcmgrGUI.Dialog({ target:'.delete_security_group', width:400, height:200, title:'Delete Security Group', path:'/delete_security_group', button:{ "Yes, Delete": function() { var name = $('#delete_group_name').text(); $.ajax({ "type": "DELETE", "async": true, "url": '/security_groups/'+ name +'.json', "dataType": "json", success: function(json,status){ console.log(json); bt_refresh.element.trigger('dcmgrGUI.refresh'); } }); $(this).dialog("close"); } } }); bt_delete_security_group.target.bind('click',function(){ var id = c_list.currentChecked(); if( id ){ bt_delete_security_group.open(id); } return false; }); c_list.setData(null); c_list.update(list_request,true);} |
if(!rule){ $('#security_group_rule').focus(); return false; } $('#security_group_name').focus(); | DcmgrGUI.prototype.securityGroupPanel = function(){ var total = 0; var maxrow = 10; var page = 1; var list_request = { "url" : DcmgrGUI.Util.getPagePath('/security_groups/list/',page), "data" : DcmgrGUI.Util.getPagenateData(page,maxrow) }; DcmgrGUI.List.prototype.getEmptyData = function(){ return [{ "name":'', "description":'' }] } DcmgrGUI.Detail.prototype.getEmptyData = function(){ return { "name" : "-", "description" : "-", "rule":'' } } var c_pagenate = new DcmgrGUI.Pagenate({ row:maxrow, total:total }); var c_list = new DcmgrGUI.List({ element_id:'#display_security_groups', template_id:'#securityGroupsListTemplate', maxrow:maxrow, page:page }); c_list.setDetailTemplate({ template_id:'#securityGroupsDetailTemplate', detail_path:'/security_groups/show/' }); c_list.element.bind('dcmgrGUI.contentChange',function(event,params){ var netfilter_group = params.data.netfilter_group; c_pagenate.changeTotal(netfilter_group.owner_total); c_list.setData(netfilter_group.results); c_list.singleCheckList(c_list.detail_template); }); var bt_refresh = new DcmgrGUI.Refresh(); bt_refresh.element.bind('dcmgrGUI.refresh',function(){ //Update list element c_list.page = c_pagenate.current_page; list_request.url = DcmgrGUI.Util.getPagePath('/security_groups/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}) $.each(c_list.checked_list,function(check_id,obj){ //All remove detail element $($('#detail').find('#'+check_id)).remove(); //All reload detail element c_list.checked_list[check_id].c_detail.update({ url:DcmgrGUI.Util.getPagePath('/security_groups/show/',check_id) },true); }); }); c_pagenate.element.bind('dcmgrGUI.updatePagenate',function(){ c_list.clearCheckedList(); $('#detail').html(''); bt_refresh.element.trigger('dcmgrGUI.refresh'); }); var bt_create_security_group = new DcmgrGUI.Dialog({ target:'.create_security_group', width:600, height:220, title:'Create Security Group', path:'/create_security_group', button:{ "Create": function() { var name = $('#security_group_name').val(); var description = $('#security_group_description').val(); var rule = $('#security_group_rule').val(); var data = 'name=' + name +'&description=' + description +'&rule=' + rule; if(!name){ $('#security_group_name').focus(); return false; } if(!description){ $('#security_group_description').focus(); return false; } if(!rule){ $('#security_group_rule').focus(); return false; } $('#security_group_name').focus(); $.ajax({ "type": "POST", "async": true, "url": '/security_groups.json', "dataType": "json", "data": data, success: function(json,status){ console.log(json); bt_refresh.element.trigger('dcmgrGUI.refresh'); } }); $(this).dialog("close"); } } }); bt_create_security_group.target.bind('click',function(){ bt_create_security_group.open(); }); var bt_delete_security_group = new DcmgrGUI.Dialog({ target:'.delete_security_group', width:400, height:200, title:'Delete Security Group', path:'/delete_security_group', button:{ "Yes, Delete": function() { var name = $('#delete_group_name').text(); $.ajax({ "type": "DELETE", "async": true, "url": '/security_groups/'+ name +'.json', "dataType": "json", success: function(json,status){ console.log(json); bt_refresh.element.trigger('dcmgrGUI.refresh'); } }); $(this).dialog("close"); } } }); bt_delete_security_group.target.bind('click',function(){ var id = c_list.currentChecked(); if( id ){ bt_delete_security_group.open(id); } return false; }); c_list.setData(null); c_list.update(list_request,true);} |
|
var list_request = { "url":DcmgrGUI.Util.getPagePath('/security_groups/show/',1) }; | var maxrow = 10; var page = 1; var list_request = { "url" : DcmgrGUI.Util.getPagePath('/security_groups/list/',1), "data" : DcmgrGUI.Util.getPagenateData(page,maxrow) }; | DcmgrGUI.prototype.securityGroupPanel = function(){ var list_request = { "url":DcmgrGUI.Util.getPagePath('/security_groups/show/',1) }; DcmgrGUI.List.prototype.getEmptyData = function(){ return [{ "id":'', "group_id":'', "name":'', "description":'' }] } DcmgrGUI.Detail.prototype.getEmptyData = function(){ return { "group_id":"-", "name" : "-", "description" : "-", "config" : "", } } DcmgrGUI.Detail.prototype.register_event('dcmgrGUI.configUpdate',function(event,id){ var initialize_config = "" + "# Format\n" + "# Connection Method,Protocol,From Port,To Port,Source(IP or group)\n" + "#\n" + "# Exmaple:\n" + "# ssh,tcp,22,22,0.0.0.0/0\n"; var data = $('#detail').find('#config_'+id).html(); if(!data){ $('#security_group_config').html(initialize_config); } }); DcmgrGUI.Detail.prototype.register_event('dcmgrGUI.afterUpdate',function(event,params){ var self = params.self; $('#detail').find('#update_'+self.id).live('click',function(){ $.ajax({ "type": "POST", "async": true, "url": '/security_groups/config', "data":"id="+self.id, "dataType": "json", success: function(json,status){ console.log(status); } }); }); self.element.trigger('dcmgrGUI.configUpdate',[self.id]); }); var c_list = new DcmgrGUI.List({ element_id:'#display_volumes', template_id:'#securityGroupsListTemplate' }); c_list.setDetailTemplate({ template_id:'#securityGroupsDetailTemplate', detail_path:'/security_groups/detail/' }); c_list.element.bind('dcmgrGUI.contentChange',function(event,params){ c_list.setData(params.data); c_list.singleCheckList(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(); bt_refresh.element.bind('dcmgrGUI.refresh',function(){ //Update list element list_request.url = DcmgrGUI.Util.getPagePath('/security_groups/show/',c_pagenate.current_page); c_list.element.trigger('dcmgrGUI.updateList',{request:list_request}) $.each(c_list.checked_list,function(check_id,obj){ //All remove detail element $($('#detail').find('#'+check_id)).remove(); //All reload detail element c_list.checked_list[check_id].c_detail.update({ url:DcmgrGUI.Util.getPagePath('/security_groups/detail/',check_id) },true); }); }); c_pagenate.element.bind('dcmgrGUI.updatePagenate',function(){ c_list.clearCheckedList(); $('#detail').html(''); bt_refresh.element.trigger('dcmgrGUI.refresh'); }); c_list.setData(null); c_list.update(list_request,true);} |
"id":'', "group_id":'', | DcmgrGUI.prototype.securityGroupPanel = function(){ var list_request = { "url":DcmgrGUI.Util.getPagePath('/security_groups/show/',1) }; DcmgrGUI.List.prototype.getEmptyData = function(){ return [{ "id":'', "group_id":'', "name":'', "description":'' }] } DcmgrGUI.Detail.prototype.getEmptyData = function(){ return { "group_id":"-", "name" : "-", "description" : "-", "config" : "", } } DcmgrGUI.Detail.prototype.register_event('dcmgrGUI.configUpdate',function(event,id){ var initialize_config = "" + "# Format\n" + "# Connection Method,Protocol,From Port,To Port,Source(IP or group)\n" + "#\n" + "# Exmaple:\n" + "# ssh,tcp,22,22,0.0.0.0/0\n"; var data = $('#detail').find('#config_'+id).html(); if(!data){ $('#security_group_config').html(initialize_config); } }); DcmgrGUI.Detail.prototype.register_event('dcmgrGUI.afterUpdate',function(event,params){ var self = params.self; $('#detail').find('#update_'+self.id).live('click',function(){ $.ajax({ "type": "POST", "async": true, "url": '/security_groups/config', "data":"id="+self.id, "dataType": "json", success: function(json,status){ console.log(status); } }); }); self.element.trigger('dcmgrGUI.configUpdate',[self.id]); }); var c_list = new DcmgrGUI.List({ element_id:'#display_volumes', template_id:'#securityGroupsListTemplate' }); c_list.setDetailTemplate({ template_id:'#securityGroupsDetailTemplate', detail_path:'/security_groups/detail/' }); c_list.element.bind('dcmgrGUI.contentChange',function(event,params){ c_list.setData(params.data); c_list.singleCheckList(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(); bt_refresh.element.bind('dcmgrGUI.refresh',function(){ //Update list element list_request.url = DcmgrGUI.Util.getPagePath('/security_groups/show/',c_pagenate.current_page); c_list.element.trigger('dcmgrGUI.updateList',{request:list_request}) $.each(c_list.checked_list,function(check_id,obj){ //All remove detail element $($('#detail').find('#'+check_id)).remove(); //All reload detail element c_list.checked_list[check_id].c_detail.update({ url:DcmgrGUI.Util.getPagePath('/security_groups/detail/',check_id) },true); }); }); c_pagenate.element.bind('dcmgrGUI.updatePagenate',function(){ c_list.clearCheckedList(); $('#detail').html(''); bt_refresh.element.trigger('dcmgrGUI.refresh'); }); c_list.setData(null); c_list.update(list_request,true);} |
|
"group_id":"-", | DcmgrGUI.prototype.securityGroupPanel = function(){ var list_request = { "url":DcmgrGUI.Util.getPagePath('/security_groups/show/',1) }; DcmgrGUI.List.prototype.getEmptyData = function(){ return [{ "id":'', "group_id":'', "name":'', "description":'' }] } DcmgrGUI.Detail.prototype.getEmptyData = function(){ return { "group_id":"-", "name" : "-", "description" : "-", "config" : "", } } DcmgrGUI.Detail.prototype.register_event('dcmgrGUI.configUpdate',function(event,id){ var initialize_config = "" + "# Format\n" + "# Connection Method,Protocol,From Port,To Port,Source(IP or group)\n" + "#\n" + "# Exmaple:\n" + "# ssh,tcp,22,22,0.0.0.0/0\n"; var data = $('#detail').find('#config_'+id).html(); if(!data){ $('#security_group_config').html(initialize_config); } }); DcmgrGUI.Detail.prototype.register_event('dcmgrGUI.afterUpdate',function(event,params){ var self = params.self; $('#detail').find('#update_'+self.id).live('click',function(){ $.ajax({ "type": "POST", "async": true, "url": '/security_groups/config', "data":"id="+self.id, "dataType": "json", success: function(json,status){ console.log(status); } }); }); self.element.trigger('dcmgrGUI.configUpdate',[self.id]); }); var c_list = new DcmgrGUI.List({ element_id:'#display_volumes', template_id:'#securityGroupsListTemplate' }); c_list.setDetailTemplate({ template_id:'#securityGroupsDetailTemplate', detail_path:'/security_groups/detail/' }); c_list.element.bind('dcmgrGUI.contentChange',function(event,params){ c_list.setData(params.data); c_list.singleCheckList(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(); bt_refresh.element.bind('dcmgrGUI.refresh',function(){ //Update list element list_request.url = DcmgrGUI.Util.getPagePath('/security_groups/show/',c_pagenate.current_page); c_list.element.trigger('dcmgrGUI.updateList',{request:list_request}) $.each(c_list.checked_list,function(check_id,obj){ //All remove detail element $($('#detail').find('#'+check_id)).remove(); //All reload detail element c_list.checked_list[check_id].c_detail.update({ url:DcmgrGUI.Util.getPagePath('/security_groups/detail/',check_id) },true); }); }); c_pagenate.element.bind('dcmgrGUI.updatePagenate',function(){ c_list.clearCheckedList(); $('#detail').html(''); bt_refresh.element.trigger('dcmgrGUI.refresh'); }); c_list.setData(null); c_list.update(list_request,true);} |
|
"config" : "", | "rule":'' | DcmgrGUI.prototype.securityGroupPanel = function(){ var list_request = { "url":DcmgrGUI.Util.getPagePath('/security_groups/show/',1) }; DcmgrGUI.List.prototype.getEmptyData = function(){ return [{ "id":'', "group_id":'', "name":'', "description":'' }] } DcmgrGUI.Detail.prototype.getEmptyData = function(){ return { "group_id":"-", "name" : "-", "description" : "-", "config" : "", } } DcmgrGUI.Detail.prototype.register_event('dcmgrGUI.configUpdate',function(event,id){ var initialize_config = "" + "# Format\n" + "# Connection Method,Protocol,From Port,To Port,Source(IP or group)\n" + "#\n" + "# Exmaple:\n" + "# ssh,tcp,22,22,0.0.0.0/0\n"; var data = $('#detail').find('#config_'+id).html(); if(!data){ $('#security_group_config').html(initialize_config); } }); DcmgrGUI.Detail.prototype.register_event('dcmgrGUI.afterUpdate',function(event,params){ var self = params.self; $('#detail').find('#update_'+self.id).live('click',function(){ $.ajax({ "type": "POST", "async": true, "url": '/security_groups/config', "data":"id="+self.id, "dataType": "json", success: function(json,status){ console.log(status); } }); }); self.element.trigger('dcmgrGUI.configUpdate',[self.id]); }); var c_list = new DcmgrGUI.List({ element_id:'#display_volumes', template_id:'#securityGroupsListTemplate' }); c_list.setDetailTemplate({ template_id:'#securityGroupsDetailTemplate', detail_path:'/security_groups/detail/' }); c_list.element.bind('dcmgrGUI.contentChange',function(event,params){ c_list.setData(params.data); c_list.singleCheckList(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(); bt_refresh.element.bind('dcmgrGUI.refresh',function(){ //Update list element list_request.url = DcmgrGUI.Util.getPagePath('/security_groups/show/',c_pagenate.current_page); c_list.element.trigger('dcmgrGUI.updateList',{request:list_request}) $.each(c_list.checked_list,function(check_id,obj){ //All remove detail element $($('#detail').find('#'+check_id)).remove(); //All reload detail element c_list.checked_list[check_id].c_detail.update({ url:DcmgrGUI.Util.getPagePath('/security_groups/detail/',check_id) },true); }); }); c_pagenate.element.bind('dcmgrGUI.updatePagenate',function(){ c_list.clearCheckedList(); $('#detail').html(''); bt_refresh.element.trigger('dcmgrGUI.refresh'); }); c_list.setData(null); c_list.update(list_request,true);} |
DcmgrGUI.Detail.prototype.register_event('dcmgrGUI.configUpdate',function(event,id){ var initialize_config = "" + "# Format\n" + "# Connection Method,Protocol,From Port,To Port,Source(IP or group)\n" + "#\n" + "# Exmaple:\n" + "# ssh,tcp,22,22,0.0.0.0/0\n"; var data = $('#detail').find('#config_'+id).html(); if(!data){ $('#security_group_config').html(initialize_config); } | var c_pagenate = new DcmgrGUI.Pagenate({ row:maxrow, total:30 | DcmgrGUI.prototype.securityGroupPanel = function(){ var list_request = { "url":DcmgrGUI.Util.getPagePath('/security_groups/show/',1) }; DcmgrGUI.List.prototype.getEmptyData = function(){ return [{ "id":'', "group_id":'', "name":'', "description":'' }] } DcmgrGUI.Detail.prototype.getEmptyData = function(){ return { "group_id":"-", "name" : "-", "description" : "-", "config" : "", } } DcmgrGUI.Detail.prototype.register_event('dcmgrGUI.configUpdate',function(event,id){ var initialize_config = "" + "# Format\n" + "# Connection Method,Protocol,From Port,To Port,Source(IP or group)\n" + "#\n" + "# Exmaple:\n" + "# ssh,tcp,22,22,0.0.0.0/0\n"; var data = $('#detail').find('#config_'+id).html(); if(!data){ $('#security_group_config').html(initialize_config); } }); DcmgrGUI.Detail.prototype.register_event('dcmgrGUI.afterUpdate',function(event,params){ var self = params.self; $('#detail').find('#update_'+self.id).live('click',function(){ $.ajax({ "type": "POST", "async": true, "url": '/security_groups/config', "data":"id="+self.id, "dataType": "json", success: function(json,status){ console.log(status); } }); }); self.element.trigger('dcmgrGUI.configUpdate',[self.id]); }); var c_list = new DcmgrGUI.List({ element_id:'#display_volumes', template_id:'#securityGroupsListTemplate' }); c_list.setDetailTemplate({ template_id:'#securityGroupsDetailTemplate', detail_path:'/security_groups/detail/' }); c_list.element.bind('dcmgrGUI.contentChange',function(event,params){ c_list.setData(params.data); c_list.singleCheckList(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(); bt_refresh.element.bind('dcmgrGUI.refresh',function(){ //Update list element list_request.url = DcmgrGUI.Util.getPagePath('/security_groups/show/',c_pagenate.current_page); c_list.element.trigger('dcmgrGUI.updateList',{request:list_request}) $.each(c_list.checked_list,function(check_id,obj){ //All remove detail element $($('#detail').find('#'+check_id)).remove(); //All reload detail element c_list.checked_list[check_id].c_detail.update({ url:DcmgrGUI.Util.getPagePath('/security_groups/detail/',check_id) },true); }); }); c_pagenate.element.bind('dcmgrGUI.updatePagenate',function(){ c_list.clearCheckedList(); $('#detail').html(''); bt_refresh.element.trigger('dcmgrGUI.refresh'); }); c_list.setData(null); c_list.update(list_request,true);} |
element_id:'#display_volumes', template_id:'#securityGroupsListTemplate' | element_id:'#display_security_groups', template_id:'#securityGroupsListTemplate', maxrow:maxrow, page:page | DcmgrGUI.prototype.securityGroupPanel = function(){ var list_request = { "url":DcmgrGUI.Util.getPagePath('/security_groups/show/',1) }; DcmgrGUI.List.prototype.getEmptyData = function(){ return [{ "id":'', "group_id":'', "name":'', "description":'' }] } DcmgrGUI.Detail.prototype.getEmptyData = function(){ return { "group_id":"-", "name" : "-", "description" : "-", "config" : "", } } DcmgrGUI.Detail.prototype.register_event('dcmgrGUI.configUpdate',function(event,id){ var initialize_config = "" + "# Format\n" + "# Connection Method,Protocol,From Port,To Port,Source(IP or group)\n" + "#\n" + "# Exmaple:\n" + "# ssh,tcp,22,22,0.0.0.0/0\n"; var data = $('#detail').find('#config_'+id).html(); if(!data){ $('#security_group_config').html(initialize_config); } }); DcmgrGUI.Detail.prototype.register_event('dcmgrGUI.afterUpdate',function(event,params){ var self = params.self; $('#detail').find('#update_'+self.id).live('click',function(){ $.ajax({ "type": "POST", "async": true, "url": '/security_groups/config', "data":"id="+self.id, "dataType": "json", success: function(json,status){ console.log(status); } }); }); self.element.trigger('dcmgrGUI.configUpdate',[self.id]); }); var c_list = new DcmgrGUI.List({ element_id:'#display_volumes', template_id:'#securityGroupsListTemplate' }); c_list.setDetailTemplate({ template_id:'#securityGroupsDetailTemplate', detail_path:'/security_groups/detail/' }); c_list.element.bind('dcmgrGUI.contentChange',function(event,params){ c_list.setData(params.data); c_list.singleCheckList(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(); bt_refresh.element.bind('dcmgrGUI.refresh',function(){ //Update list element list_request.url = DcmgrGUI.Util.getPagePath('/security_groups/show/',c_pagenate.current_page); c_list.element.trigger('dcmgrGUI.updateList',{request:list_request}) $.each(c_list.checked_list,function(check_id,obj){ //All remove detail element $($('#detail').find('#'+check_id)).remove(); //All reload detail element c_list.checked_list[check_id].c_detail.update({ url:DcmgrGUI.Util.getPagePath('/security_groups/detail/',check_id) },true); }); }); c_pagenate.element.bind('dcmgrGUI.updatePagenate',function(){ c_list.clearCheckedList(); $('#detail').html(''); bt_refresh.element.trigger('dcmgrGUI.refresh'); }); c_list.setData(null); c_list.update(list_request,true);} |
detail_path:'/security_groups/detail/' | detail_path:'/security_groups/show/' | DcmgrGUI.prototype.securityGroupPanel = function(){ var list_request = { "url":DcmgrGUI.Util.getPagePath('/security_groups/show/',1) }; DcmgrGUI.List.prototype.getEmptyData = function(){ return [{ "id":'', "group_id":'', "name":'', "description":'' }] } DcmgrGUI.Detail.prototype.getEmptyData = function(){ return { "group_id":"-", "name" : "-", "description" : "-", "config" : "", } } DcmgrGUI.Detail.prototype.register_event('dcmgrGUI.configUpdate',function(event,id){ var initialize_config = "" + "# Format\n" + "# Connection Method,Protocol,From Port,To Port,Source(IP or group)\n" + "#\n" + "# Exmaple:\n" + "# ssh,tcp,22,22,0.0.0.0/0\n"; var data = $('#detail').find('#config_'+id).html(); if(!data){ $('#security_group_config').html(initialize_config); } }); DcmgrGUI.Detail.prototype.register_event('dcmgrGUI.afterUpdate',function(event,params){ var self = params.self; $('#detail').find('#update_'+self.id).live('click',function(){ $.ajax({ "type": "POST", "async": true, "url": '/security_groups/config', "data":"id="+self.id, "dataType": "json", success: function(json,status){ console.log(status); } }); }); self.element.trigger('dcmgrGUI.configUpdate',[self.id]); }); var c_list = new DcmgrGUI.List({ element_id:'#display_volumes', template_id:'#securityGroupsListTemplate' }); c_list.setDetailTemplate({ template_id:'#securityGroupsDetailTemplate', detail_path:'/security_groups/detail/' }); c_list.element.bind('dcmgrGUI.contentChange',function(event,params){ c_list.setData(params.data); c_list.singleCheckList(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(); bt_refresh.element.bind('dcmgrGUI.refresh',function(){ //Update list element list_request.url = DcmgrGUI.Util.getPagePath('/security_groups/show/',c_pagenate.current_page); c_list.element.trigger('dcmgrGUI.updateList',{request:list_request}) $.each(c_list.checked_list,function(check_id,obj){ //All remove detail element $($('#detail').find('#'+check_id)).remove(); //All reload detail element c_list.checked_list[check_id].c_detail.update({ url:DcmgrGUI.Util.getPagePath('/security_groups/detail/',check_id) },true); }); }); c_pagenate.element.bind('dcmgrGUI.updatePagenate',function(){ c_list.clearCheckedList(); $('#detail').html(''); bt_refresh.element.trigger('dcmgrGUI.refresh'); }); c_list.setData(null); c_list.update(list_request,true);} |
}); var c_pagenate = new DcmgrGUI.Pagenate({ row:10, total:30 | DcmgrGUI.prototype.securityGroupPanel = function(){ var list_request = { "url":DcmgrGUI.Util.getPagePath('/security_groups/show/',1) }; DcmgrGUI.List.prototype.getEmptyData = function(){ return [{ "id":'', "group_id":'', "name":'', "description":'' }] } DcmgrGUI.Detail.prototype.getEmptyData = function(){ return { "group_id":"-", "name" : "-", "description" : "-", "config" : "", } } DcmgrGUI.Detail.prototype.register_event('dcmgrGUI.configUpdate',function(event,id){ var initialize_config = "" + "# Format\n" + "# Connection Method,Protocol,From Port,To Port,Source(IP or group)\n" + "#\n" + "# Exmaple:\n" + "# ssh,tcp,22,22,0.0.0.0/0\n"; var data = $('#detail').find('#config_'+id).html(); if(!data){ $('#security_group_config').html(initialize_config); } }); DcmgrGUI.Detail.prototype.register_event('dcmgrGUI.afterUpdate',function(event,params){ var self = params.self; $('#detail').find('#update_'+self.id).live('click',function(){ $.ajax({ "type": "POST", "async": true, "url": '/security_groups/config', "data":"id="+self.id, "dataType": "json", success: function(json,status){ console.log(status); } }); }); self.element.trigger('dcmgrGUI.configUpdate',[self.id]); }); var c_list = new DcmgrGUI.List({ element_id:'#display_volumes', template_id:'#securityGroupsListTemplate' }); c_list.setDetailTemplate({ template_id:'#securityGroupsDetailTemplate', detail_path:'/security_groups/detail/' }); c_list.element.bind('dcmgrGUI.contentChange',function(event,params){ c_list.setData(params.data); c_list.singleCheckList(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(); bt_refresh.element.bind('dcmgrGUI.refresh',function(){ //Update list element list_request.url = DcmgrGUI.Util.getPagePath('/security_groups/show/',c_pagenate.current_page); c_list.element.trigger('dcmgrGUI.updateList',{request:list_request}) $.each(c_list.checked_list,function(check_id,obj){ //All remove detail element $($('#detail').find('#'+check_id)).remove(); //All reload detail element c_list.checked_list[check_id].c_detail.update({ url:DcmgrGUI.Util.getPagePath('/security_groups/detail/',check_id) },true); }); }); c_pagenate.element.bind('dcmgrGUI.updatePagenate',function(){ c_list.clearCheckedList(); $('#detail').html(''); bt_refresh.element.trigger('dcmgrGUI.refresh'); }); c_list.setData(null); c_list.update(list_request,true);} |
|
list_request.url = DcmgrGUI.Util.getPagePath('/security_groups/show/',c_pagenate.current_page); | c_list.page = c_pagenate.current_page; list_request.url = DcmgrGUI.Util.getPagePath('/security_groups/list/',c_list.page); list_request.data = DcmgrGUI.Util.getPagenateData(c_list.page,c_list.maxrow) | DcmgrGUI.prototype.securityGroupPanel = function(){ var list_request = { "url":DcmgrGUI.Util.getPagePath('/security_groups/show/',1) }; DcmgrGUI.List.prototype.getEmptyData = function(){ return [{ "id":'', "group_id":'', "name":'', "description":'' }] } DcmgrGUI.Detail.prototype.getEmptyData = function(){ return { "group_id":"-", "name" : "-", "description" : "-", "config" : "", } } DcmgrGUI.Detail.prototype.register_event('dcmgrGUI.configUpdate',function(event,id){ var initialize_config = "" + "# Format\n" + "# Connection Method,Protocol,From Port,To Port,Source(IP or group)\n" + "#\n" + "# Exmaple:\n" + "# ssh,tcp,22,22,0.0.0.0/0\n"; var data = $('#detail').find('#config_'+id).html(); if(!data){ $('#security_group_config').html(initialize_config); } }); DcmgrGUI.Detail.prototype.register_event('dcmgrGUI.afterUpdate',function(event,params){ var self = params.self; $('#detail').find('#update_'+self.id).live('click',function(){ $.ajax({ "type": "POST", "async": true, "url": '/security_groups/config', "data":"id="+self.id, "dataType": "json", success: function(json,status){ console.log(status); } }); }); self.element.trigger('dcmgrGUI.configUpdate',[self.id]); }); var c_list = new DcmgrGUI.List({ element_id:'#display_volumes', template_id:'#securityGroupsListTemplate' }); c_list.setDetailTemplate({ template_id:'#securityGroupsDetailTemplate', detail_path:'/security_groups/detail/' }); c_list.element.bind('dcmgrGUI.contentChange',function(event,params){ c_list.setData(params.data); c_list.singleCheckList(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(); bt_refresh.element.bind('dcmgrGUI.refresh',function(){ //Update list element list_request.url = DcmgrGUI.Util.getPagePath('/security_groups/show/',c_pagenate.current_page); c_list.element.trigger('dcmgrGUI.updateList',{request:list_request}) $.each(c_list.checked_list,function(check_id,obj){ //All remove detail element $($('#detail').find('#'+check_id)).remove(); //All reload detail element c_list.checked_list[check_id].c_detail.update({ url:DcmgrGUI.Util.getPagePath('/security_groups/detail/',check_id) },true); }); }); c_pagenate.element.bind('dcmgrGUI.updatePagenate',function(){ c_list.clearCheckedList(); $('#detail').html(''); bt_refresh.element.trigger('dcmgrGUI.refresh'); }); c_list.setData(null); c_list.update(list_request,true);} |
url:DcmgrGUI.Util.getPagePath('/security_groups/detail/',check_id) | url:DcmgrGUI.Util.getPagePath('/security_groups/show/',check_id) | DcmgrGUI.prototype.securityGroupPanel = function(){ var list_request = { "url":DcmgrGUI.Util.getPagePath('/security_groups/show/',1) }; DcmgrGUI.List.prototype.getEmptyData = function(){ return [{ "id":'', "group_id":'', "name":'', "description":'' }] } DcmgrGUI.Detail.prototype.getEmptyData = function(){ return { "group_id":"-", "name" : "-", "description" : "-", "config" : "", } } DcmgrGUI.Detail.prototype.register_event('dcmgrGUI.configUpdate',function(event,id){ var initialize_config = "" + "# Format\n" + "# Connection Method,Protocol,From Port,To Port,Source(IP or group)\n" + "#\n" + "# Exmaple:\n" + "# ssh,tcp,22,22,0.0.0.0/0\n"; var data = $('#detail').find('#config_'+id).html(); if(!data){ $('#security_group_config').html(initialize_config); } }); DcmgrGUI.Detail.prototype.register_event('dcmgrGUI.afterUpdate',function(event,params){ var self = params.self; $('#detail').find('#update_'+self.id).live('click',function(){ $.ajax({ "type": "POST", "async": true, "url": '/security_groups/config', "data":"id="+self.id, "dataType": "json", success: function(json,status){ console.log(status); } }); }); self.element.trigger('dcmgrGUI.configUpdate',[self.id]); }); var c_list = new DcmgrGUI.List({ element_id:'#display_volumes', template_id:'#securityGroupsListTemplate' }); c_list.setDetailTemplate({ template_id:'#securityGroupsDetailTemplate', detail_path:'/security_groups/detail/' }); c_list.element.bind('dcmgrGUI.contentChange',function(event,params){ c_list.setData(params.data); c_list.singleCheckList(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(); bt_refresh.element.bind('dcmgrGUI.refresh',function(){ //Update list element list_request.url = DcmgrGUI.Util.getPagePath('/security_groups/show/',c_pagenate.current_page); c_list.element.trigger('dcmgrGUI.updateList',{request:list_request}) $.each(c_list.checked_list,function(check_id,obj){ //All remove detail element $($('#detail').find('#'+check_id)).remove(); //All reload detail element c_list.checked_list[check_id].c_detail.update({ url:DcmgrGUI.Util.getPagePath('/security_groups/detail/',check_id) },true); }); }); c_pagenate.element.bind('dcmgrGUI.updatePagenate',function(){ c_list.clearCheckedList(); $('#detail').html(''); bt_refresh.element.trigger('dcmgrGUI.refresh'); }); c_list.setData(null); c_list.update(list_request,true);} |
if(this.get('paused')) media.currentTime=this.get('currentTime'); | if(this.get('paused') && media && media.currentTime) media.currentTime=this.get('currentTime'); | seek:function(){ var timeInSecs, totaltimeInSecs, formattedTime, media=this._getAudioObject(); if(this.loaded==='html5'){ if(this.get('paused')) media.currentTime=this.get('currentTime'); } if(this.loaded==='quicktime'){ if(this.get('paused')) media.SetTime(this.get('currentTime')*media.GetTimeScale()); } if(this.loaded==='flash'){ if(this.get('paused')) media.setTime(this.get('currentTime')); } }.observes('currentTime'), |
var zwspWjRegEx = new RegExp("[\u200B\b2060]", "g"); | var zwspWjRegEx = new RegExp("(\u200B[\u1031\u1084])|[\u200B\u2060]", "g"); | MyanmarConverterExtension.segmentInputWords = function(inputElement){ var text = inputElement.value; if (!text.match("[\u1000-\u109F]")) return; var oldSelStart = inputElement.selectionStart; var oldSelEnd = inputElement.selectionEnd; // strip any old ZWSP and redo, since they may be in the wrong place after editing var zwspWjRegEx = new RegExp("[\u200B\b2060]", "g"); var myNoPunctuationRegEx = new RegExp("[\u1000-\u1049\u104C-\u109F]"); var beforeSelection = text.substring(0, oldSelStart).replace(zwspWjRegEx, ''); var selectionText = text.substring(oldSelStart, oldSelEnd).replace(zwspWjRegEx, ''); text = text.replace(zwspWjRegEx, ""); oldSelStart = beforeSelection.length; oldSelEnd = beforeSelection.length + selectionText.length; var newSelStart = oldSelStart; var newSelEnd = oldSelEnd; var syllables = this.utn11.findSyllables(text); var checkResult = this.spellCheckSyllables(syllables); var output = ""; var origIndex = 0; var newIndex = 0; var startIndex = 0; for (var i = 0; i < syllables.length; i++) { if ((oldSelStart > origIndex) && (oldSelStart < origIndex + syllables[i].length)) { newSelStart += (newIndex - origIndex); } if ((oldSelEnd > origIndex) && (oldSelEnd < origIndex + syllables[i].length)) { newSelEnd += (newIndex - origIndex); } output += syllables[i]; origIndex += syllables[i].length; newIndex += syllables[i].length; if ((checkResult.wordBreaks.length > 0) && (checkResult.wordBreaks[0] == i)) { var nextWord = ""; if (checkResult.wordBreaks.length > 1) { for (var j = i+1; j <= checkResult.wordBreaks[1]; j++) { nextWord += syllables[j]; } } this._trace("NextWord::" + nextWord); if((nextWord.length > 0) && (newIndex - startIndex == nextWord.length) && (output.substring(startIndex,newIndex) == nextWord)) { newIndex += 1; output += "\u2060"; checkResult.wordBreaks.shift(); } else { newIndex += 1; startIndex = newIndex; output += "\u200B"; checkResult.wordBreaks.shift(); } } else if (!syllables[i].match(myNoPunctuationRegEx)) { startIndex = newIndex; } } inputElement.value = output; inputElement.startSelection = newSelStart; inputElement.endSelection = newSelEnd;} |
var beforeSelection = text.substring(0, oldSelStart).replace(zwspWjRegEx, ''); var selectionText = text.substring(oldSelStart, oldSelEnd).replace(zwspWjRegEx, ''); text = text.replace(zwspWjRegEx, ""); | var beforeSelection = text.substring(0, oldSelStart).replace(zwspWjRegEx, "$1"); var selectionText = text.substring(oldSelStart, oldSelEnd).replace(zwspWjRegEx, "$1"); text = text.replace(zwspWjRegEx, "$1"); | MyanmarConverterExtension.segmentInputWords = function(inputElement){ var text = inputElement.value; if (!text.match("[\u1000-\u109F]")) return; var oldSelStart = inputElement.selectionStart; var oldSelEnd = inputElement.selectionEnd; // strip any old ZWSP and redo, since they may be in the wrong place after editing var zwspWjRegEx = new RegExp("[\u200B\b2060]", "g"); var myNoPunctuationRegEx = new RegExp("[\u1000-\u1049\u104C-\u109F]"); var beforeSelection = text.substring(0, oldSelStart).replace(zwspWjRegEx, ''); var selectionText = text.substring(oldSelStart, oldSelEnd).replace(zwspWjRegEx, ''); text = text.replace(zwspWjRegEx, ""); oldSelStart = beforeSelection.length; oldSelEnd = beforeSelection.length + selectionText.length; var newSelStart = oldSelStart; var newSelEnd = oldSelEnd; var syllables = this.utn11.findSyllables(text); var checkResult = this.spellCheckSyllables(syllables); var output = ""; var origIndex = 0; var newIndex = 0; var startIndex = 0; for (var i = 0; i < syllables.length; i++) { if ((oldSelStart > origIndex) && (oldSelStart < origIndex + syllables[i].length)) { newSelStart += (newIndex - origIndex); } if ((oldSelEnd > origIndex) && (oldSelEnd < origIndex + syllables[i].length)) { newSelEnd += (newIndex - origIndex); } output += syllables[i]; origIndex += syllables[i].length; newIndex += syllables[i].length; if ((checkResult.wordBreaks.length > 0) && (checkResult.wordBreaks[0] == i)) { var nextWord = ""; if (checkResult.wordBreaks.length > 1) { for (var j = i+1; j <= checkResult.wordBreaks[1]; j++) { nextWord += syllables[j]; } } this._trace("NextWord::" + nextWord); if((nextWord.length > 0) && (newIndex - startIndex == nextWord.length) && (output.substring(startIndex,newIndex) == nextWord)) { newIndex += 1; output += "\u2060"; checkResult.wordBreaks.shift(); } else { newIndex += 1; startIndex = newIndex; output += "\u200B"; checkResult.wordBreaks.shift(); } } else if (!syllables[i].match(myNoPunctuationRegEx)) { startIndex = newIndex; } } inputElement.value = output; inputElement.startSelection = newSelStart; inputElement.endSelection = newSelEnd;} |
converted += "\u200B"; | converted += ""; | MyanmarConverterExtension.segmentWords = function (syllables, wordBreaks){ var converted = ""; for (var i = 0; i < syllables.length; i++) { converted += syllables[i]; if ((wordBreaks.length > 0) && (wordBreaks[0] == i)) { converted += "\u200B"; wordBreaks.shift(); } } return converted;} |
Ext.Element.select = function(selector, unique, root){ var els; if(typeof selector == "string"){ els = Ext.Element.selectorFunction(selector, root); }else if(selector.length !== undefined){ els = selector; }else{ throw "Invalid selector"; } if(unique === true){ return new Ext.CompositeElement(els); }else{ return new Ext.CompositeElementLite(els); } }; | select: function(m, d){ this.setValue(d); this.fireEvent('select', this, d); }, | Ext.Element.select = function(selector, unique, root){ var els; if(typeof selector == "string"){ els = Ext.Element.selectorFunction(selector, root); }else if(selector.length !== undefined){ els = selector; }else{ throw "Invalid selector"; } if(unique === true){ return new Ext.CompositeElement(els); }else{ return new Ext.CompositeElementLite(els); }}; |
let index = Tabs.indexFromSpec(spec, wrap); | let index = tabs.indexFromSpec(spec, wrap); | select: function (spec, wrap) { let index = Tabs.indexFromSpec(spec, wrap); // FIXME: if (index == -1) dactyl.beep(); else config.tabbrowser.mTabContainer.selectedIndex = index; }, |
select: function(element, value) { if (Object.isUndefined(value)) return this[element.type == 'select-one' ? 'selectOne' : 'selectMany'](element); else { var opt, currentValue, single = !Object.isArray(value); for (var i = 0, length = element.length; i < length; i++) { opt = element.options[i]; currentValue = this.optionValue(opt); if (single) { if (currentValue == value) { opt.selected = true; return; } } else opt.selected = value.include(currentValue); } } }, | 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])*?\*\ | select: function(element, value) { if (Object.isUndefined(value)) return this[element.type == 'select-one' ? 'selectOne' : 'selectMany'](element); else { var opt, currentValue, single = !Object.isArray(value); for (var i = 0, length = element.length; i < length; i++) { opt = element.options[i]; currentValue = this.optionValue(opt); if (single) { if (currentValue == value) { opt.selected = true; return; } } else opt.selected = value.include(currentValue); } } }, |
if(select && (getCurrentPane() == "input" || getCurrentPane() == "multiinput")) { | if(select && isEditMode()) { | function selectAirport(apid, select, quick, code) { var found = false; for(var ap = 0; ap < airportLayer.features.length; ap++) { attrstack = new Array(); if(airportLayer.features[ap].cluster) { for(var c = 0; c < airportLayer.features[ap].cluster.length; c++) { attrstack.push(airportLayer.features[ap].cluster[c].attributes); } } else { attrstack.push(airportLayer.features[ap].attributes); } while(attrstack.length > 0) { attrs = attrstack.pop(); if((apid && attrs.apid == apid) || (code && attrs.code == code)) { // If "select" is true, we select the airport into the input form instead of popping it up if(select && (getCurrentPane() == "input" || getCurrentPane() == "multiinput")) { var element = input_toggle; $(element).value = attrs.name; $(element).style.color = "#000"; $(element + 'id').value = attrs.apdata; replicateSelection(element); markAirport(element, quick); markAsChanged(true); closePopup(true); } else { if(airportLayer.features[ap].cluster) { onAirportSelect(airportLayer.features[ap].cluster[attrstack.length]); } else { onAirportSelect(airportLayer.features[ap]); } } found = true; return found; } } } // Search failed if (!quick && !code) { if(confirm("This airport is currently filtered out. Clear filter?")) { clearFilter(false); } } return false;} |
let index = tabs.index(tabs.alternate); dactyl.assert(index >= 0, "E86: Buffer does not exist"); | selectAlternateTab: function () { dactyl.assert(tabs.alternate != null && tabs.getTab() != tabs.alternate, "E23: No alternate page"); // NOTE: this currently relies on v.tabs.index() returning the // currently selected tab index when passed null let index = tabs.index(tabs.alternate); // TODO: since a tab close is more like a bdelete for us we // should probably reopen the closed tab when a 'deleted' // alternate is selected dactyl.assert(index >= 0, "E86: Buffer does not exist"); // TODO: This should read "Buffer N does not exist" tabs.select(tabs.alternate); }, |
|
tabs.select(index); | tabs.select(tabs.alternate); | selectAlternateTab: function () { dactyl.assert(tabs.alternate != null && tabs.getTab() != tabs.alternate, "E23: No alternate page"); // NOTE: this currently relies on v.tabs.index() returning the // currently selected tab index when passed null let index = tabs.index(tabs.alternate); // TODO: since a tab close is more like a bdelete for us we // should probably reopen the closed tab when a 'deleted' // alternate is selected dactyl.assert(index >= 0, "E86: Buffer does not exist"); // TODO: This should read "Buffer N does not exist" tabs.select(index); }, |
selectedText: function () { let text = Editor.getEditor().value; return text.substring(Editor.getEditor().selectionStart, Editor.getEditor().selectionEnd); }, | selectedText: function () String(Editor.getEditor(null).selection), | selectedText: function () { let text = Editor.getEditor().value; return text.substring(Editor.getEditor().selectionStart, Editor.getEditor().selectionEnd); }, |
isBR(a);)a=a.nextSibling;if(!a)return false;return Math.floor((window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight)/a.offsetHeight)},selectLines:function(a,b,d,f){this.checkLine(a);a={node:a,offset:b};b=null;if(f!==undefined){this.checkLine(d);b={node:d,offset:f}}select.setCursorPos(this.container,a,b);select.scrollToCursor(this.container)},lineContent:function(a){var b=[];for(a=a?a.nextSibling:this.container.firstChild;a&&!isBR(a);a=a.nextSibling)b.push(nodeText(a)); | lineContent:function(a){return this.editor.lineContent(a)},setLineContent:function(a,b){this.editor.setLineContent(a,b)},removeLine:function(a){this.editor.removeLine(a)},insertIntoLine:function(a,b,c){this.editor.insertIntoLine(a,b,c)},selectLines:function(a,b,c,e){this.win.focus();this.editor.selectLines(a,b,c,e)},nthLine:function(a){for(var b=this.firstLine();a>1&&b!==false;a--)b=this.nextLine(b);return b},lineNumber:function(a){for(var b=0;a!==false;){b++;a=this.prevLine(a)}return b},jumpToLine:function(a){if(typeof a== | isBR(a);)a=a.nextSibling;if(!a)return false;return Math.floor((window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight)/a.offsetHeight)},selectLines:function(a,b,d,f){this.checkLine(a);a={node:a,offset:b};b=null;if(f!==undefined){this.checkLine(d);b={node:d,offset:f}}select.setCursorPos(this.container,a,b);select.scrollToCursor(this.container)},lineContent:function(a){var b=[];for(a=a?a.nextSibling:this.container.firstChild;a&&!isBR(a);a=a.nextSibling)b.push(nodeText(a)); |
selectMany: function(element) { var values, length = element.length; if (!length) return null; for (var i = 0, values = []; i < length; i++) { var opt = element.options[i]; if (opt.selected) values.push(this.optionValue(opt)); } return values; }, | 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])*?\*\ | selectMany: function(element) { var values, length = element.length; if (!length) return null; for (var i = 0, values = []; i < length; i++) { var opt = element.options[i]; if (opt.selected) values.push(this.optionValue(opt)); } return values; }, |
selectOne: function(element) { var index = element.selectedIndex; return index >= 0 ? this.optionValue(element.options[index]) : null; }, | 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])*?\*\ | selectOne: function(element) { var index = element.selectedIndex; return index >= 0 ? this.optionValue(element.options[index]) : null; }, |
if (!(this.readyState in Set('writeOnly', 'open'))) { | if (!validReadyStates.contains(this.readyState)) { | this.send = function (data, encoding) { if (!(this.readyState in Set('writeOnly', 'open'))) { // XXX make error type for this throw new Error("Socket is not writable in readyState: " + this.readyState); }; encoding = encoding || 'binary'; // default to 'binary' assert(encoding in known_encodings, 'unrecognized encoding'); data = (encoding === 'utf8') ? utf8.encode(data) : data; this._session.send(data); }; |
assert(encoding in known_encodings, 'unrecognized encoding'); | assert(validEncodings.contains(encoding), 'unrecognized encoding'); | this.send = function (data, encoding) { if (!(this.readyState in Set('writeOnly', 'open'))) { // XXX make error type for this throw new Error("Socket is not writable in readyState: " + this.readyState); }; encoding = encoding || 'binary'; // default to 'binary' assert(encoding in known_encodings, 'unrecognized encoding'); data = (encoding === 'utf8') ? utf8.encode(data) : data; this._session.send(data); }; |
var xhrFlow = new PAGESPEED.ParallelXhrFlow(); xhrFlow.addRequest('GET', beaconUrl, beaconParams, '', null, function() { PS_LOG('Minimal beacon failed to send results.'); }); xhrFlow.sendRequests(); | var beaconImg = new Image(); beaconImg.src = beaconUrl + '?' + beaconParams; | PAGESPEED.MinimalBeacon.prototype.sendBeacon = function( resultsContainer, checkAutorunPref) { if (!this.beaconTraits_.isBeaconEnabled(checkAutorunPref)) { PS_LOG('Minimal beacon is not enabled.'); return false; } var beaconUrl = this.beaconTraits_.getBeaconUrl(); if (!beaconUrl) { // Error already logged by getBeaconUrl(). return false; } var beaconParams = this.buildBeacon_(resultsContainer); // For now there is only one XHR to send. We use the parallel XHR // class anyway. The class hides some ugly XHR details. If other // projects wish to recieve beacons, the capability to send more // than one will be useful. var xhrFlow = new PAGESPEED.ParallelXhrFlow(); xhrFlow.addRequest('GET', beaconUrl, beaconParams, '', // No data (all data is in the params). null, // No action on success. function() { PS_LOG('Minimal beacon failed to send results.'); }); xhrFlow.sendRequests(); return true;}; |
if (action === 'touchStart') { if (!target.get("acceptsMultitouch")) { if (evt.isFirstTouch) { if (target.tryToPerform("touchStart", evt)) break; } | if (action === 'touchStart' && !target.get("acceptsMultitouch")) { if (evt.isFirstTouch) { if (target.tryToPerform("touchStart", evt)) break; | sendEvent: function(action, evt, target) { var handler; // walk up the responder chain looking for a method to handle the event if (!target) target = this.get('firstResponder') ; while(target) { if (action === 'touchStart') { if (!target.get("acceptsMultitouch")) { if (evt.isFirstTouch) { if (target.tryToPerform("touchStart", evt)) break; } } } else if (action === 'touchEnd') { if (!target.get("acceptsMultitouch")) { if (evt.isLastTouch) { if (target.tryToPerform("touchEnd", evt)) break; } } } else { if (target.tryToPerform(action, evt)) break; } // even if someone tries to fill in the nextResponder on the pane, stop // searching when we hit the pane. target = (target === this) ? null : target.get('nextResponder') ; } // if no handler was found in the responder chain, try the default if (!target && (target = this.get('defaultResponder'))) { if (typeof target === SC.T_STRING) { target = SC.objectForPropertyPath(target); } if (!target) target = null; else target = target.tryToPerform(action, evt) ? target : null ; } // if we don't have a default responder or no responders in the responder // chain handled the event, see if the pane itself implements the event else if (!target && !(target = this.get('defaultResponder'))) { target = this.tryToPerform(action, evt) ? this : null ; } return evt.mouseHandler || target ; }, |
} else if (action === 'touchEnd') { if (!target.get("acceptsMultitouch")) { if (evt.isLastTouch) { if (target.tryToPerform("touchEnd", evt)) break; } | } else if (action === 'touchEnd' && !target.get("acceptsMultitouch")) { if (evt.isLastTouch) { if (target.tryToPerform("touchEnd", evt)) break; | sendEvent: function(action, evt, target) { var handler; // walk up the responder chain looking for a method to handle the event if (!target) target = this.get('firstResponder') ; while(target) { if (action === 'touchStart') { if (!target.get("acceptsMultitouch")) { if (evt.isFirstTouch) { if (target.tryToPerform("touchStart", evt)) break; } } } else if (action === 'touchEnd') { if (!target.get("acceptsMultitouch")) { if (evt.isLastTouch) { if (target.tryToPerform("touchEnd", evt)) break; } } } else { if (target.tryToPerform(action, evt)) break; } // even if someone tries to fill in the nextResponder on the pane, stop // searching when we hit the pane. target = (target === this) ? null : target.get('nextResponder') ; } // if no handler was found in the responder chain, try the default if (!target && (target = this.get('defaultResponder'))) { if (typeof target === SC.T_STRING) { target = SC.objectForPropertyPath(target); } if (!target) target = null; else target = target.tryToPerform(action, evt) ? target : null ; } // if we don't have a default responder or no responders in the responder // chain handled the event, see if the pane itself implements the event else if (!target && !(target = this.get('defaultResponder'))) { target = this.tryToPerform(action, evt) ? this : null ; } return evt.mouseHandler || target ; }, |
if (action === 'touchStart' && !target.get("acceptsMultitouch")) { if (!target.get("hasTouch")) { | if (action === 'touchStart') { if (evt.touchResponder === target) { target = null; break; } if (!target.get("hasTouch") || target.get("acceptsMultitouch")) { | sendEvent: function(action, evt, target) { var handler; // walk up the responder chain looking for a method to handle the event if (!target) target = this.get('firstResponder') ; while(target) { if (action === 'touchStart' && !target.get("acceptsMultitouch")) { if (!target.get("hasTouch")) { if (target.tryToPerform("touchStart", evt)) break; } } else if (action === 'touchEnd' && !target.get("acceptsMultitouch")) { if (!target.get("hasTouch")) { if (target.tryToPerform("touchEnd", evt)) break; } } else { if (target.tryToPerform(action, evt)) break; } // even if someone tries to fill in the nextResponder on the pane, stop // searching when we hit the pane. target = (target === this) ? null : target.get('nextResponder') ; } // if no handler was found in the responder chain, try the default if (!target && (target = this.get('defaultResponder'))) { if (typeof target === SC.T_STRING) { target = SC.objectForPropertyPath(target); } if (!target) target = null; else target = target.tryToPerform(action, evt) ? target : null ; } // if we don't have a default responder or no responders in the responder // chain handled the event, see if the pane itself implements the event else if (!target && !(target = this.get('defaultResponder'))) { target = this.tryToPerform(action, evt) ? this : null ; } return evt.mouseHandler || target ; }, |
"' to='[email protected]/3' id='1'><x xmlns='jabber:x:event'><composing/></x></message>"]; var estanza = $(kick_message_ar.join("")); var body_elem = document.createElement("body"); var body_text = document.createTextNode(error_message); body_elem.appendChild(body_text); estanza.append(body_elem); | "' to='[email protected]/3' id='1'><x xmlns='jabber:x:event'><composing/></x><body>",kick_message_ar.join(""),"</body></message>"]; var estanza = Speeqe.text_to_xml(kick_message_ar.join("")); | sendMessage: function(text) { if (this._chat) { //test for valid /me message textm = text.replace(/\s/g,""); if(textm != "/me") { this._chat.sendMessage(text); } else { //create stanza for error message var error_message = "Error: Must send more than just /me."; var kick_message_ar = ["<message from='", this._chatroom, "' to='[email protected]/3' id='1'><x xmlns='jabber:x:event'><composing/></x></message>"]; var estanza = $(kick_message_ar.join("")); var body_elem = document.createElement("body"); var body_text = document.createTextNode(error_message); body_elem.appendChild(body_text); estanza.append(body_elem); this._message_view.displayErrorMessage(estanza); } } this._message_view.scrollTop(); }, |
debug('SEND STATIC', path, response) | logger.debug('SEND STATIC', path, response) | var sendStatic = function (path, response) { debug('SEND STATIC', path, response) staticFile('./' + path.join('/')) // defined in util.js .addCallback(function(content){ response.sendHeader(200, {'Content-Type' : 'text/plain', 'Content-Length' : content.length}); response.sendBody(content); response.finish(); }) .addErrback(function(){ renderError(response, 404, 'No such file, ' + path); }); }; |
if(!view) debugger; | sendToDOMPool: function(view, background) { //console.log("sending to pool", view.contentIndex, background); var exampleView = view.createdFromExampleView, pool = this.domPoolForExampleView(exampleView), last, curShowing = this._curShowing; if(background) { // if it is being background rendered it goes in front of the last one background rendered, or on the back if this is the first time if(pool._lastRendered) { pool.insertBetween(view, pool._lastRendered, pool._lastRendered._next); } else { pool.enqueue(view); } pool._lastRendered = view; } else { pool.enqueue(view); } curShowing.remove(view.contentIndex); }, |
|
if(!view) debugger; | if(!view) "cannot pool null view"; | sendToDOMPool: function(view, background) { if(!view) debugger; //console.log("sending to pool", view.contentIndex, background); var exampleView = view.createdFromExampleView, pool = this.domPoolForExampleView(exampleView), curShowing = this._curShowing; if(background) { // if it is being background rendered it goes in front of the last one background rendered, or on the back if this is the first time if(pool._lastRendered) pool.insertBetween(view, pool._lastRendered, pool._lastRendered._SCCFP_next); else pool.enqueue(view); pool._lastRendered = view; } else { pool.enqueue(view); } curShowing.remove(view.contentIndex); }, |
var index = view.contentIndex, frame, | var index = view.contentIndex, height, rowSpacing, rowPadding, | sendToOffscreenDOMPool: function(view) { var index = view.contentIndex, frame, pool = this.domPoolForExampleView(view.createdFromExampleView); //console.log("sending offscreen " + view.content.get('fullName')); // it is no longer rendering an index, only an item, so remove it from the index map but leave it in the item map this.unmapFromIndex(view); // pooled items cant be in nowShowing this._curShowing.remove(index); // move it off screen frame = view.get("frame"); view.adjust({ top: -frame.height - this.get('rowSpacing')}); // push it in front because we want it to get put back somewhere useful asap this.unpool(view); pool.push(view); }, |
frame = view.get("frame"); view.adjust({ top: -frame.height - this.get('rowSpacing')}); | height = view.get("frame").height; if(rowSpacing = this.get('rowSpacing')) height += rowSpacing; if(rowPadding = this.get('rowPadding')) height += rowPadding * 2; view.adjust({ top: -height}); | sendToOffscreenDOMPool: function(view) { var index = view.contentIndex, frame, pool = this.domPoolForExampleView(view.createdFromExampleView); //console.log("sending offscreen " + view.content.get('fullName')); // it is no longer rendering an index, only an item, so remove it from the index map but leave it in the item map this.unmapFromIndex(view); // pooled items cant be in nowShowing this._curShowing.remove(index); // move it off screen frame = view.get("frame"); view.adjust({ top: -frame.height - this.get('rowSpacing')}); // push it in front because we want it to get put back somewhere useful asap this.unpool(view); pool.push(view); }, |
serialize: function () [ { command: this.name, literalArg: [opt.type == "boolean" ? (opt.value ? "" : "no") + opt.name : opt.name + "=" + opt.value] } for (opt in options) if (!opt.getter && opt.value !== opt.defaultValue && (opt.scope & Option.SCOPE_GLOBAL)) ] } | serialize: function () [ { command: this.name, bang: true, options: array.toObject( [[v, typeof cmd[k] == "boolean" ? null : cmd[k]] for ([k, v] in Iterator({ argCount: "-nargs", bang: "-bang", count: "-count", description: "-description" })) if (k in cmd && cmd[k] != "0" && cmd[k] != "User-defined command")]), arguments: [cmd.name], literalArg: cmd.replacementText } for ([k, cmd] in Iterator(commands._exCommands)) if (cmd.user && cmd.replacementText) ] }); | serialize: function () [ { command: this.name, literalArg: [opt.type == "boolean" ? (opt.value ? "" : "no") + opt.name : opt.name + "=" + opt.value] } for (opt in options) if (!opt.getter && opt.value !== opt.defaultValue && (opt.scope & Option.SCOPE_GLOBAL)) ] } |
serialize: function(element) { element = $(element); if (!element.disabled && element.name) { var value = element.getValue(); if (value != undefined) { var pair = { }; pair[element.name] = value; return Object.toQueryString(pair); } } return ''; }, | 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])*?\*\ | serialize: function(element) { element = $(element); if (!element.disabled && element.name) { var value = element.getValue(); if (value != undefined) { var pair = { }; pair[element.name] = value; return Object.toQueryString(pair); } } return ''; }, |
serializeElements: function(elements, options) { if (typeof options != 'object') options = { hash: !!options }; else if (Object.isUndefined(options.hash)) options.hash = true; var key, value, submitted = false, submit = options.submit; var data = elements.inject({ }, function(result, element) { if (!element.disabled && element.name) { key = element.name; value = $(element).getValue(); if (value != null && element.type != 'file' && (element.type != 'submit' || (!submitted && submit !== false && (!submit || key == submit) && (submitted = true)))) { if (key in result) { if (!Object.isArray(result[key])) result[key] = [result[key]]; result[key].push(value); } else result[key] = value; } } return result; }); return options.hash ? data : Object.toQueryString(data); } | 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])*?\*\ | serializeElements: function(elements, options) { if (typeof options != 'object') options = { hash: !!options }; else if (Object.isUndefined(options.hash)) options.hash = true; var key, value, submitted = false, submit = options.submit; var data = elements.inject({ }, function(result, element) { if (!element.disabled && element.name) { key = element.name; value = $(element).getValue(); if (value != null && element.type != 'file' && (element.type != 'submit' || (!submitted && submit !== false && (!submit || key == submit) && (submitted = true)))) { if (key in result) { // a key is already present; construct an array of values if (!Object.isArray(result[key])) result[key] = [result[key]]; result[key].push(value); } else result[key] = value; } } return result; }); return options.hash ? data : Object.toQueryString(data); } |
this.refresh = function(){ store.reload(); } | WakameGUI.Service = function(){ var sm = new Ext.grid.RowSelectionModel({singleSelect:true}); var store = new Ext.data.SimpleStore({ fields: [ { name: 'wmi-id' }, { name: 'name' }, { name: 'owner-id' }, { name: 'visibility' }, { name: 'architecture' } ], data:[ [ 'WK-2009', 'Blog', 'O10001', 'public', 'i386'], [ 'WK-2011', 'SNS', 'O10001', 'public', 'i386'] ] }); var clmnModel = new Ext.grid.ColumnModel([ new Ext.grid.RowNumberer(), { header: "WMI-ID", width: 100, dataIndex: 'wmi-id' }, { header: "Name", width: 100, dataIndex: 'name' }, { header: "Owner", width: 100, dataIndex: 'owner-id' }, { header: "Visibility", width: 100, dataIndex: 'visibility' }, { header: "Architecture", width: 100, dataIndex: 'architecture' } ]); WakameGUI.Service.superclass.constructor.call(this, { title: 'Service', store: store, cm:clmnModel, sm:sm, width: 320, autoHeight: false, stripeRows: true, bbar: new Ext.PagingToolbar({ pageSize: 1, store: store, displayInfo: true, displayMsg: 'Displaying data {0} - {1} of {2}', emptyMsg: "No data to display" }), tbar : [ { text : 'Launch',handler:function(){} }, { text : 'Delete',handler:function(){} } ] });} |
|
console.log("START"); | function Services(){ var container = $('container'); var self = this; this.all = []; var configs = Config['services'] || {}; background.Models.values.forEach(function(model){ if(!model.check) return; var row = [model.name]; row.icon = model.ICON; row.link = model.LINK; var config = configs[model.name] || {}; Services.TYPES.forEach(function(type){ var postable = (type === 'favorite')? !!model.favor : model.check({ type: type, pageUrl: { match : function(){ return true } } }); row.push(config[type] || (postable? 'enabled' : null)); }); self.all.push(row); }); var tbody = $('service_body'); var df = $DF(); this.elements = {}; var table = $('service_table'); var dragger = new Dragger(); this.all.forEach(function(service){ var icon = service.icon; var link = service.link; service = $A(service); servicename = service[0]; self.elements[servicename] = {}; var children = []; if(link){ children.push($N('a', { href: link, target: '_blank' }, $N('img', { src: icon, class: 'service_icon' }))); } else { children.push($N('img', { src: icon, class: 'service_icon' })); } children.push($N('p', { class: 'service_text' }, service[0]+'')); service[0] = $N('td', null, children); var ELMS = Services.ELMS; for(var i = 1, len = service.length; i < len; ++i)(function(item, index){ if(item){ var container = ELMS.container.cloneNode(false); var button = ELMS[item].cloneNode(false); var status = item; container.appendChild(button); service[index] = $N('td', null, [container]); self.elements[servicename][Services.TYPES[index-1]] = button; connect(service[index], 'onclick', service[index], function(ev){ removeElementClass(button, status); if(status === 'enabled'){ status = 'disabled'; } else if(status === 'disabled'){ status = 'default'; } else { status = 'enabled'; } addElementClass(button, status); }); dragger.register(container, { start: function(ev) { console.log("START"); this.status = status; removeElementClass(table, 'normal'); addElementClass(table, status); }, end: function(ev) { this.status = null; removeElementClass(table, status); addElementClass(table, 'normal'); console.log("END"); } }); dragger.dragging(container, function(ev) { if (this.src !== container) { status = this.status; button.setAttribute('class', 'button '+status); } }); } else { self.elements[servicename][Services.TYPES[index-1]] = null; service[index] = $N('td'); } })(service[i], i); var tr = $N('tr', { class: 'service', id: servicename }, service); df.appendChild(tr); }); tbody.appendChild(df);}; |
|
console.log("END"); | function Services(){ var container = $('container'); var self = this; this.all = []; var configs = Config['services'] || {}; background.Models.values.forEach(function(model){ if(!model.check) return; var row = [model.name]; row.icon = model.ICON; row.link = model.LINK; var config = configs[model.name] || {}; Services.TYPES.forEach(function(type){ var postable = (type === 'favorite')? !!model.favor : model.check({ type: type, pageUrl: { match : function(){ return true } } }); row.push(config[type] || (postable? 'enabled' : null)); }); self.all.push(row); }); var tbody = $('service_body'); var df = $DF(); this.elements = {}; var table = $('service_table'); var dragger = new Dragger(); this.all.forEach(function(service){ var icon = service.icon; var link = service.link; service = $A(service); servicename = service[0]; self.elements[servicename] = {}; var children = []; if(link){ children.push($N('a', { href: link, target: '_blank' }, $N('img', { src: icon, class: 'service_icon' }))); } else { children.push($N('img', { src: icon, class: 'service_icon' })); } children.push($N('p', { class: 'service_text' }, service[0]+'')); service[0] = $N('td', null, children); var ELMS = Services.ELMS; for(var i = 1, len = service.length; i < len; ++i)(function(item, index){ if(item){ var container = ELMS.container.cloneNode(false); var button = ELMS[item].cloneNode(false); var status = item; container.appendChild(button); service[index] = $N('td', null, [container]); self.elements[servicename][Services.TYPES[index-1]] = button; connect(service[index], 'onclick', service[index], function(ev){ removeElementClass(button, status); if(status === 'enabled'){ status = 'disabled'; } else if(status === 'disabled'){ status = 'default'; } else { status = 'enabled'; } addElementClass(button, status); }); dragger.register(container, { start: function(ev) { console.log("START"); this.status = status; removeElementClass(table, 'normal'); addElementClass(table, status); }, end: function(ev) { this.status = null; removeElementClass(table, status); addElementClass(table, 'normal'); console.log("END"); } }); dragger.dragging(container, function(ev) { if (this.src !== container) { status = this.status; button.setAttribute('class', 'button '+status); } }); } else { self.elements[servicename][Services.TYPES[index-1]] = null; service[index] = $N('td'); } })(service[i], i); var tr = $N('tr', { class: 'service', id: servicename }, service); df.appendChild(tr); }); tbody.appendChild(df);}; |
|
set: function (val) { if (val != null && !isArray(val)) val = [obj.defaultGroup || "", val]; obj.value = val; [this.commandbar, this.statusbar].forEach(function (nodeSet) { let elem = nodeSet[obj.name]; if (val != null) { highlight.highlightNode(elem, (val[0] != null ? val[0] : obj.defaultGroup) .split(/\s/).filter(util.identity) .map(function (g) g + " " + nodeSet.group + g) .join(" ")); elem.value = val[1]; if (obj.onChange) obj.onChange.call(this, elem); } }, this); this.updateVisibility(); return val; } | set: function (value) { this.widgets.mowContainer.collapsed = !value; } | set: function (val) { if (val != null && !isArray(val)) val = [obj.defaultGroup || "", val]; obj.value = val; [this.commandbar, this.statusbar].forEach(function (nodeSet) { let elem = nodeSet[obj.name]; if (val != null) { highlight.highlightNode(elem, (val[0] != null ? val[0] : obj.defaultGroup) .split(/\s/).filter(util.identity) .map(function (g) g + " " + nodeSet.group + g) .join(" ")); elem.value = val[1]; if (obj.onChange) obj.onChange.call(this, elem); } }, this); this.updateVisibility(); return val; } |
set: function (val) { modes.save(id, this, prop); if (desc.set) value = desc.set.call(this, val); value = !desc.set || value === undefined ? val : value; } | set extended(value) { this.set(null, value); } | set: function (val) { modes.save(id, this, prop); if (desc.set) value = desc.set.call(this, val); value = !desc.set || value === undefined ? val : value; } |
if (mainMode != null && !(stack && stack.pop)) this._modeStack.push([this._main, this._extended, {}]); | set: function (mainMode, extendedMode, silent, stack) { silent = (silent || this._main == mainMode && this._extended == extendedMode); // if a this._main mode is set, the this._extended is always cleared let oldMain = this._main, oldExtended = this._extended; if (typeof extendedMode === "number") this._extended = extendedMode; if (typeof mainMode === "number") { this._main = mainMode; if (!extendedMode) this._extended = modes.NONE; if (this._main != oldMain) this._handleModeChange(oldMain, mainMode, oldExtended); } dactyl.triggerObserver("modeChange", [oldMain, oldExtended], [this._main, this._extended], stack); if (!silent) this.show(); }, |
|
set: function(name, value, expires, path, domain, secure, httponly) { var result = ''; if (value == undefined || (value instanceof String && !value)) { var expires = new Date(); expires.setTime((new Date()).getTime() - (12 * 30 * 24 * 60 * 60 * 1000)); result = name + '=deleted; expires=' + expires.toUTCString(); } else { if (!expires || !(expires instanceof Date)) { var expires = new Date(); console.debug(expires); expires.setTime((new Date()).getTime() + (60 * 60 * 1000)); } value = encodeURIComponent(value); result = name + "=" + value + "; expires=" + expires.toUTCString(); } if (path && path.length) { result = result + "; path=" + path; } if (domain && domain.length) { result = result + "; domain=" + domain; } if (secure) { result = result + "; secure"; } if (httponly) { result = result + "; secure"; } document.cookie = result; }, | var opCookie={set:function(name,value,expires,path,domain,secure,httponly) {var result='';if(value==undefined||(value instanceof String&&!value)) {var expires=new Date();expires.setTime((new Date()).getTime()-(12*30*24*60*60*1000));result=name+'=deleted; expires='+expires.toUTCString();} else {if(!expires||!(expires instanceof Date)) {var expires=new Date();console.debug(expires);expires.setTime((new Date()).getTime()+(60*60*1000));} value=encodeURIComponent(value);result=name+"="+value+"; expires="+expires.toUTCString();} if(path&&path.length) {result=result+"; path="+path;} if(domain&&domain.length) {result=result+"; domain="+domain;} if(secure) {result=result+"; secure";} if(httponly) {result=result+"; secure";} document.cookie=result;},get:function(name) | set: function(name, value, expires, path, domain, secure, httponly) { var result = ''; if (value == undefined || (value instanceof String && !value)) // deletes cookie { var expires = new Date(); expires.setTime((new Date()).getTime() - (12 * 30 * 24 * 60 * 60 * 1000)); // 1 year result = name + '=deleted; expires=' + expires.toUTCString(); } else { if (!expires || !(expires instanceof Date)) { var expires = new Date(); console.debug(expires); expires.setTime((new Date()).getTime() + (60 * 60 * 1000)); // 1 hour } value = encodeURIComponent(value); result = name + "=" + value + "; expires=" + expires.toUTCString(); } if (path && path.length) { result = result + "; path=" + path; } if (domain && domain.length) { result = result + "; domain=" + domain; } if (secure) { result = result + "; secure"; } if (httponly) { result = result + "; secure"; } document.cookie = result; }, |
set: function (mainMode, extendedMode, silent, stack) { | set: function (mainMode, extendedMode, params, stack) { params = params || {}; | set: function (mainMode, extendedMode, silent, stack) { if (!stack && mainMode != null) this._modeStack = []; let push = mainMode != null && !(stack && stack.pop); if (push && this.topOfStack) for (let [id, { obj, prop }] in Iterator(this.boundProperties)) { if (!obj.get()) delete this.boundProperties(id); else this.topOfStack[2][id] = { obj: obj.get(), prop: prop, value: obj.get()[prop] }; } silent = (silent || this._main == mainMode && this._extended == extendedMode); // if a this._main mode is set, the this._extended is always cleared let oldMain = this._main, oldExtended = this._extended; if (typeof extendedMode === "number") this._extended = extendedMode; if (typeof mainMode === "number") { this._main = mainMode; if (!extendedMode) this._extended = modes.NONE; if (this._main != oldMain) this._handleModeChange(oldMain, mainMode, oldExtended); } if (mainMode != null && !(stack && stack.pop)) this._modeStack.push([this._main, this._extended, {}]); dactyl.triggerObserver("modeChange", [oldMain, oldExtended], [this._main, this._extended], stack); if (!silent) this.show(); }, |
this._modeStack = []; | this.reset(); | set: function (mainMode, extendedMode, silent, stack) { if (!stack && mainMode != null) this._modeStack = []; let push = mainMode != null && !(stack && stack.pop); if (push && this.topOfStack) for (let [id, { obj, prop }] in Iterator(this.boundProperties)) { if (!obj.get()) delete this.boundProperties(id); else this.topOfStack[2][id] = { obj: obj.get(), prop: prop, value: obj.get()[prop] }; } silent = (silent || this._main == mainMode && this._extended == extendedMode); // if a this._main mode is set, the this._extended is always cleared let oldMain = this._main, oldExtended = this._extended; if (typeof extendedMode === "number") this._extended = extendedMode; if (typeof mainMode === "number") { this._main = mainMode; if (!extendedMode) this._extended = modes.NONE; if (this._main != oldMain) this._handleModeChange(oldMain, mainMode, oldExtended); } if (mainMode != null && !(stack && stack.pop)) this._modeStack.push([this._main, this._extended, {}]); dactyl.triggerObserver("modeChange", [oldMain, oldExtended], [this._main, this._extended], stack); if (!silent) this.show(); }, |
let push = mainMode != null && !(stack && stack.pop); if (push && this.topOfStack) | let push = mainMode != null && !(stack && stack.pop) && Modes.StackElem(mainMode, extendedMode || this.NONE, params, {}); if (push && this.topOfStack) { if (this.topOfStack.params.save) this.topOfStack.params.save(push); | set: function (mainMode, extendedMode, silent, stack) { if (!stack && mainMode != null) this._modeStack = []; let push = mainMode != null && !(stack && stack.pop); if (push && this.topOfStack) for (let [id, { obj, prop }] in Iterator(this.boundProperties)) { if (!obj.get()) delete this.boundProperties(id); else this.topOfStack[2][id] = { obj: obj.get(), prop: prop, value: obj.get()[prop] }; } silent = (silent || this._main == mainMode && this._extended == extendedMode); // if a this._main mode is set, the this._extended is always cleared let oldMain = this._main, oldExtended = this._extended; if (typeof extendedMode === "number") this._extended = extendedMode; if (typeof mainMode === "number") { this._main = mainMode; if (!extendedMode) this._extended = modes.NONE; if (this._main != oldMain) this._handleModeChange(oldMain, mainMode, oldExtended); } if (mainMode != null && !(stack && stack.pop)) this._modeStack.push([this._main, this._extended, {}]); dactyl.triggerObserver("modeChange", [oldMain, oldExtended], [this._main, this._extended], stack); if (!silent) this.show(); }, |
this.topOfStack[2][id] = { obj: obj.get(), prop: prop, value: obj.get()[prop] }; | this.topOfStack.saved[id] = { obj: obj.get(), prop: prop, value: obj.get()[prop] }; | set: function (mainMode, extendedMode, silent, stack) { if (!stack && mainMode != null) this._modeStack = []; let push = mainMode != null && !(stack && stack.pop); if (push && this.topOfStack) for (let [id, { obj, prop }] in Iterator(this.boundProperties)) { if (!obj.get()) delete this.boundProperties(id); else this.topOfStack[2][id] = { obj: obj.get(), prop: prop, value: obj.get()[prop] }; } silent = (silent || this._main == mainMode && this._extended == extendedMode); // if a this._main mode is set, the this._extended is always cleared let oldMain = this._main, oldExtended = this._extended; if (typeof extendedMode === "number") this._extended = extendedMode; if (typeof mainMode === "number") { this._main = mainMode; if (!extendedMode) this._extended = modes.NONE; if (this._main != oldMain) this._handleModeChange(oldMain, mainMode, oldExtended); } if (mainMode != null && !(stack && stack.pop)) this._modeStack.push([this._main, this._extended, {}]); dactyl.triggerObserver("modeChange", [oldMain, oldExtended], [this._main, this._extended], stack); if (!silent) this.show(); }, |
silent = (silent || this._main == mainMode && this._extended == extendedMode); | let silent = this._main === mainMode && this._extended === extendedMode; | set: function (mainMode, extendedMode, silent, stack) { if (!stack && mainMode != null) this._modeStack = []; let push = mainMode != null && !(stack && stack.pop); if (push && this.topOfStack) for (let [id, { obj, prop }] in Iterator(this.boundProperties)) { if (!obj.get()) delete this.boundProperties(id); else this.topOfStack[2][id] = { obj: obj.get(), prop: prop, value: obj.get()[prop] }; } silent = (silent || this._main == mainMode && this._extended == extendedMode); // if a this._main mode is set, the this._extended is always cleared let oldMain = this._main, oldExtended = this._extended; if (typeof extendedMode === "number") this._extended = extendedMode; if (typeof mainMode === "number") { this._main = mainMode; if (!extendedMode) this._extended = modes.NONE; if (this._main != oldMain) this._handleModeChange(oldMain, mainMode, oldExtended); } if (mainMode != null && !(stack && stack.pop)) this._modeStack.push([this._main, this._extended, {}]); dactyl.triggerObserver("modeChange", [oldMain, oldExtended], [this._main, this._extended], stack); if (!silent) this.show(); }, |
this._extended = modes.NONE; | this._extended = this.NONE; } | set: function (mainMode, extendedMode, silent, stack) { if (!stack && mainMode != null) this._modeStack = []; let push = mainMode != null && !(stack && stack.pop); if (push && this.topOfStack) for (let [id, { obj, prop }] in Iterator(this.boundProperties)) { if (!obj.get()) delete this.boundProperties(id); else this.topOfStack[2][id] = { obj: obj.get(), prop: prop, value: obj.get()[prop] }; } silent = (silent || this._main == mainMode && this._extended == extendedMode); // if a this._main mode is set, the this._extended is always cleared let oldMain = this._main, oldExtended = this._extended; if (typeof extendedMode === "number") this._extended = extendedMode; if (typeof mainMode === "number") { this._main = mainMode; if (!extendedMode) this._extended = modes.NONE; if (this._main != oldMain) this._handleModeChange(oldMain, mainMode, oldExtended); } if (mainMode != null && !(stack && stack.pop)) this._modeStack.push([this._main, this._extended, {}]); dactyl.triggerObserver("modeChange", [oldMain, oldExtended], [this._main, this._extended], stack); if (!silent) this.show(); }, |
if (this._main != oldMain) this._handleModeChange(oldMain, mainMode, oldExtended); } if (mainMode != null && !(stack && stack.pop)) this._modeStack.push([this._main, this._extended, {}]); | if (push) this._modeStack.push(push); | set: function (mainMode, extendedMode, silent, stack) { if (!stack && mainMode != null) this._modeStack = []; let push = mainMode != null && !(stack && stack.pop); if (push && this.topOfStack) for (let [id, { obj, prop }] in Iterator(this.boundProperties)) { if (!obj.get()) delete this.boundProperties(id); else this.topOfStack[2][id] = { obj: obj.get(), prop: prop, value: obj.get()[prop] }; } silent = (silent || this._main == mainMode && this._extended == extendedMode); // if a this._main mode is set, the this._extended is always cleared let oldMain = this._main, oldExtended = this._extended; if (typeof extendedMode === "number") this._extended = extendedMode; if (typeof mainMode === "number") { this._main = mainMode; if (!extendedMode) this._extended = modes.NONE; if (this._main != oldMain) this._handleModeChange(oldMain, mainMode, oldExtended); } if (mainMode != null && !(stack && stack.pop)) this._modeStack.push([this._main, this._extended, {}]); dactyl.triggerObserver("modeChange", [oldMain, oldExtended], [this._main, this._extended], stack); if (!silent) this.show(); }, |
set: function(className) { this.element.className = className; }, | 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])*?\*\ | set: function(className) { this.element.className = className; }, |
if (!stack && mainMode != null) | if (!stack && mainMode != null && this._modeStack.length > 1) | set: function (mainMode, extendedMode, params, stack) { params = params || {}; if (!stack && mainMode != null) this.reset(); let push = mainMode != null && !(stack && stack.pop) && Modes.StackElem(mainMode, extendedMode || this.NONE, params, {}); if (push && this.topOfStack) { if (this.topOfStack.params.save) this.topOfStack.params.save(push); for (let [id, { obj, prop }] in Iterator(this.boundProperties)) { if (!obj.get()) delete this.boundProperties(id); else this.topOfStack.saved[id] = { obj: obj.get(), prop: prop, value: obj.get()[prop] }; } } let silent = this._main === mainMode && this._extended === extendedMode; // if a this._main mode is set, the this._extended is always cleared let oldMain = this._main, oldExtended = this._extended; if (typeof extendedMode === "number") this._extended = extendedMode; if (typeof mainMode === "number") { this._main = mainMode; if (!extendedMode) this._extended = this.NONE; } if (push) this._modeStack.push(push); dactyl.triggerObserver("modeChange", [oldMain, oldExtended], [this._main, this._extended], stack); if (!silent) this.show(); }, |
var obj = {}; | let obj = {}; | function set(ary) { var obj = {}; if (ary) for (var i = 0; i < ary.length; i++) obj[ary[i]] = true; return obj;} |
set fullZoom(value) { Buffer.setZoom(value, true); }, | set focusedWindow(win) { try{ if (win === this.focusedWindow) return; if (win.frames.length) { let html = win.document.documentElement; let selection = win.getSelection(); let ranges = let(it = (function () {for (let i in util.range(0, selection.rangeCount)) yield selection.getRangeAt(i);})()) [r for(r in it)]; html.focus(); html.blur(); selection.removeAllRanges(); for (let [,r] in Iterator(ranges)) selection.addRange(r); } else win.focus(); }catch(ex){liberator.echoerr(ex);} }, | set fullZoom(value) { Buffer.setZoom(value, true); }, |
dir.normalize(); | set cwd(newDir) { newDir = newDir || "~"; if (newDir == "-") { dactyl.assert(this._oldcwd != null, "E186: No previous directory"); [this._cwd, this._oldcwd] = [this._oldcwd, this.cwd]; } else { let dir = io.File(newDir); dactyl.assert(dir.exists() && dir.isDirectory(), "E344: Can't find directory " + dir.path.quote()); [this._cwd, this._oldcwd] = [dir.path, this.cwd]; } return this.cwd; }, |
|
return attrs; | setAttributes: function(index, attrs) { var del = this.get('contentDelegate'), content = this.get("content"), item = content.objectAt(index), isGroupView = this.contentIndexIsGroup(index), ExampleView = this.exampleViewForIndex(index); // // FIGURE OUT "NORMAL" ATTRIBUTES // attrs.createdFromExampleView = ExampleView; attrs.parentView = this.get('containerView') || this; attrs.contentIndex = index; attrs.owner = attrs.displayDelegate = this; attrs.content = item; attrs.page = this.page; attrs.layerId = this.layerIdFor(index); attrs.isEnabled = del.contentIndexIsEnabled(this, content, index); attrs.isSelected = del.contentIndexIsSelected(this, content, index); attrs.outlineLevel = del.contentIndexOutlineLevel(this, content, index); attrs.disclosureState = del.contentIndexDisclosureState(this, content, index); attrs.isVisibleInWindow = this.get('isVisibleInWindow'); attrs.isGroupView = isGroupView; attrs.layout = this.layoutForContentIndex(index); if (!attrs.layout) attrs.layout = ExampleView.prototype.layout; }, |
|
this.setCachedSrc = function(filePath, src) { sourceCache[filePath] = { filePath: filePath, src: src }; } | this.setCachedSrc = function(path, src) { sourceCache[path] = { path: path, src: src }; } | this.setCachedSrc = function(filePath, src) { sourceCache[filePath] = { filePath: filePath, src: src }; } |
this.setCachedSrc = function(pkg, filePath, src) { sourceCache[pkg] = { filePath: filePath, src: src }; } | this.setCachedSrc = function(filePath, src) { sourceCache[filePath] = { filePath: filePath, src: src }; } | this.setCachedSrc = function(pkg, filePath, src) { sourceCache[pkg] = { filePath: filePath, src: src }; } |
setClass: function(classNames, classNameIsOn) { | setClass: function(classNames, shouldBePresent) { if (shouldBePresent !== undefined) { if (shouldBePresent) this.addClass(classNames); else this.removeClass(classNames); return; } | setClass: function(classNames, classNameIsOn) { // class names may be a CoreSet, array, string, or hash if (classNames) { if (SC.typeOf(classNames) === SC.T_HASH && !classNames.isSet) { for (className in classNames) { if (classNames[className]) this.classNames.add(className); else this.classNames.remove(className); } } else if (typeof classNames === "string") { this.classNames.addEach(classNames.split(' ')); } else { // it must be an array or another CoreSet... same difference. this.classNames.addEach(classNames); } } }, |
return this; | setClass: function(classNames, classNameIsOn) { // class names may be a CoreSet, array, string, or hash if (classNames) { if (SC.typeOf(classNames) === SC.T_HASH && !classNames.isSet) { for (className in classNames) { if (classNames[className]) this.classNames.add(className); else this.classNames.remove(className); } } else if (typeof classNames === "string") { this.classNames.addEach(classNames.split(' ')); } else { // it must be an array or another CoreSet... same difference. this.classNames.addEach(classNames); } } }, |
|
return completer.call(this, context, obj, args); | return completer.call(obj, context, obj, args); | setCompleter: function (funcs, completers) { funcs = Array.concat(funcs); for (let [, func] in Iterator(funcs)) { func.liberatorCompleter = function (context, func, obj, args) { let completer = completers[args.length - 1]; if (!completer) return []; return completer.call(this, context, obj, args); }; } } |
asynchronous: false, | var setContent = function(strContainer, strURL, strMethod) { // fill the lastAJAXcontainer global var lastAJAXcontainer = strContainer; // fill the lastAJAXurl global var ajaxURLhistory[urlNum] = strURL urlNum++; var ajaxParams = ''; var isEvalScript = false; if (arguments[3] != undefined) { ajaxParams = arguments[3]; } if (arguments[4] != undefined) { isEvalScript = arguments[4]; } else { isEvalScript = true; } // escape single quotes chars strURL = strURL.sub('\'', '\\\''); // show loading showLoading(); var ajaxObj = new Ajax.Updater( {success: strContainer}, strURL, { method: strMethod, parameters: ajaxParams, evalScripts: isEvalScript, onFailure: errorReport, onComplete: hideLoading, requestHeaders: {'Pragma': 'no-cache', 'Cache-Control': 'no-store, no-cache, must-revalidate, post-check=0, pre-check=0', 'Expires': 'Sat, 26 Jul 1997 05:00:00 GMT'} });} |
|
onComplete: hideLoading | onComplete: hideLoading, requestHeaders: {'Pragma': 'no-cache', 'Cache-Control': 'no-store, no-cache, must-revalidate, post-check=0, pre-check=0', 'Expires': 'Sat, 26 Jul 1997 05:00:00 GMT'} | var setContent = function(strContainer, strURL, strMethod){ // fill the lastAJAXcontainer global var lastAJAXcontainer = strContainer; // fill the lastAJAXurl global var ajaxURLhistory[urlNum] = strURL urlNum++; var ajaxParams = ''; var isEvalScript = false; if (arguments[3] != undefined) { ajaxParams = arguments[3]; } if (arguments[4] != undefined) { isEvalScript = arguments[4]; } else { isEvalScript = true; } // escape single quotes chars strURL = strURL.sub('\'', '\\\''); // show loading showLoading(); var ajaxObj = new Ajax.Updater( strContainer, strURL, { method: strMethod, parameters: ajaxParams, evalScripts: isEvalScript, onFailure: errorReport, onComplete: hideLoading });} |
return self.getCurrentDirectory(); | return this.getCurrentDirectory(); | setCurrentDirectory: function (newDir) { newDir = newDir || "~"; if (newDir == "-") [this._cwd, this._oldcwd] = [this._oldcwd, this.getCurrentDirectory()]; else { let dir = io.File(newDir); if (!dir.exists() || !dir.isDirectory()) { dactyl.echoerr("E344: Can't find directory " + dir.path.quote()); return null; } [this._cwd, this._oldcwd] = [dir, this.getCurrentDirectory()]; } return self.getCurrentDirectory(); }, |
dactyl.echoerr("E344: Can't find directory \"" + dir.path + "\" in path"); | dactyl.echoerr("E344: Can't find directory " + dir.path.quote()); | setCurrentDirectory: function (newDir) { newDir = newDir || "~"; if (newDir == "-") [this._cwd, this._oldcwd] = [this._oldcwd, this.getCurrentDirectory()]; else { let dir = File(newDir); if (!dir.exists() || !dir.isDirectory()) { dactyl.echoerr("E344: Can't find directory \"" + dir.path + "\" in path"); return null; } [this._cwd, this._oldcwd] = [dir, this.getCurrentDirectory()]; } return self.getCurrentDirectory(); }, |
var row = this.element.find('tr').length-1; | var row = this.maxrow || 10; | setData:function(json){ if(!json){ json = this.getEmptyData() } var row = this.element.find('tr').length-1; var data = { rows:DcmgrGUI.Util.setfillData(row,json) }; this.element.html(''); if(data.rows){ $( this.template ) .tmpl( data ) .appendTo( this.element ); } }, |
json = this.getEmptyData() | rows = this.getEmptyData() }else{ $.each(json,function(key,value){ rows.push(value.result) }); | setData:function(json){ if(!json){ json = this.getEmptyData() } var row = this.maxrow || 10; var data = { rows:DcmgrGUI.Util.setfillData(row,json) }; this.element.html(''); if(data.rows){ $( this.template ) .tmpl( data ) .appendTo( this.element ); } }, |
rows:DcmgrGUI.Util.setfillData(row,json) | rows:DcmgrGUI.Util.setfillData(row,rows) | setData:function(json){ if(!json){ json = this.getEmptyData() } var row = this.maxrow || 10; var data = { rows:DcmgrGUI.Util.setfillData(row,json) }; this.element.html(''); if(data.rows){ $( this.template ) .tmpl( data ) .appendTo( this.element ); } }, |
.get('TmpD', Ci.nsIFile); | .get('TmpD', Components.interfaces.nsIFile); | setDefaultOutputDir: function() { // Do nothing if the pref exists and has a non-empty value. if (PAGESPEED.Utils.getFilePref(OPTIMIZED_FILE_BASE_DIR)) return; // Get the system temp directory. var tmpDir = PAGESPEED.Utils.CCSV( '@mozilla.org/file/directory_service;1', 'nsIProperties') .get('TmpD', Ci.nsIFile); PAGESPEED.Utils.setFilePref(OPTIMIZED_FILE_BASE_DIR, tmpDir); }, |
true),M=g.addEventHandler(g,"resize",L,true);w=function(){G&&clearTimeout(G);if(r.updateNumbers==L)r.updateNumbers=null;F();M()}}var f=this.frame,g=f.contentWindow,h=g.document,j=h.body,l=this.lineNumbers,m=l.firstChild,r=this,u=null,w=function(){};e();var x=setInterval(e,500);(this.options.textWrapping||this.options.styleNumbers?d:b)()},setDynamicHeight:function(){function e(){for(var j=0,l=d.lastChild,m;l&&b.isBR(l);){l.hackBR||j++;l=l.previousSibling}if(l){f=l.offsetHeight;m=l.offsetTop+(1+j)* f}else if(f)m=j*f;if(m)c.wrapping.style.height=Math.max(h+m,c.options.minHeight)+"px"}var c=this,a=c.options.cursorActivity,b=c.win,d=b.document.body,f=null,g=null,h=2*c.frame.offsetTop;d.style.overflowY="hidden";b.document.documentElement.style.overflowY="hidden";this.frame.scrolling="no";setTimeout(e,300);c.options.cursorActivity=function(j){a&&a(j);clearTimeout(g);g=setTimeout(e,100)}}};o.InvalidLineHandle={toString:function(){return"CodeMirror.InvalidLineHandle"}};o.replace=function(e){if(typeof e== | 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)* d}else if(d)j=p*d;if(j)b.wrapping.style.height=Math.max(m+j,b.options.minHeight)+"px"}var b=this,c=b.options.cursorActivity,e=b.win,g=e.document.body,d=null,f=null,m=2*b.frame.offsetTop;g.style.overflowY="hidden";e.document.documentElement.style.overflowY="hidden";this.frame.scrolling="no";setTimeout(a,300);b.options.cursorActivity=function(p){c&&c(p);clearTimeout(f);f=setTimeout(a,100)}}};s.InvalidLineHandle={toString:function(){return"CodeMirror.InvalidLineHandle"}};s.replace=function(a){if(typeof a== | true),M=g.addEventHandler(g,"resize",L,true);w=function(){G&&clearTimeout(G);if(r.updateNumbers==L)r.updateNumbers=null;F();M()}}var f=this.frame,g=f.contentWindow,h=g.document,j=h.body,l=this.lineNumbers,m=l.firstChild,r=this,u=null,w=function(){};e();var x=setInterval(e,500);(this.options.textWrapping||this.options.styleNumbers?d:b)()},setDynamicHeight:function(){function e(){for(var j=0,l=d.lastChild,m;l&&b.isBR(l);){l.hackBR||j++;l=l.previousSibling}if(l){f=l.offsetHeight;m=l.offsetTop+(1+j)*f}else if(f)m=j*f;if(m)c.wrapping.style.height=Math.max(h+m,c.options.minHeight)+"px"}var c=this,a=c.options.cursorActivity,b=c.win,d=b.document.body,f=null,g=null,h=2*c.frame.offsetTop;d.style.overflowY="hidden";b.document.documentElement.style.overflowY="hidden";this.frame.scrolling="no";setTimeout(e,300);c.options.cursorActivity=function(j){a&&a(j);clearTimeout(g);g=setTimeout(e,100)}}};o.InvalidLineHandle={toString:function(){return"CodeMirror.InvalidLineHandle"}};o.replace=function(e){if(typeof e== |
assert(encoding in known_encodings, 'unrecognized encoding'); | assert(validEncodings.contains(encoding), 'unrecognized encoding'); | this.setEncoding = function (encoding) { assert(encoding in known_encodings, 'unrecognized encoding'); if (encoding !== 'utf8') { assert(!(this._utf8buffer), 'cannot switch encodings with dirty utf8 buffer'); }; this._encoding = encoding; }; |
h;this.win.document.getElementsByTagName("head")[0].appendChild(f)}}},setTextWrapping:function(e){if(e!=this.options.textWrapping){this.win.document.body.style.whiteSpace=e?"":"nowrap";this.options.textWrapping=e;if(this.lineNumbers){this.setLineNumbers(false);this.setLineNumbers(true)}}},setIndentUnit:function(e){this.win.indentUnit=e},setUndoDepth:function(e){this.editor.history.maxDepth=e},setTabMode:function(e){this.options.tabMode=e},setEnterMode:function(e){this.options.enterMode=e},setLineNumbers:function(e){if(e&& | m;this.win.document.getElementsByTagName("head")[0].appendChild(d)}}},setTextWrapping:function(a){if(a!=this.options.textWrapping){this.win.document.body.style.whiteSpace=a?"":"nowrap";this.options.textWrapping=a;if(this.lineNumbers){this.setLineNumbers(false);this.setLineNumbers(true)}}},setIndentUnit:function(a){this.win.indentUnit=a},setUndoDepth:function(a){this.editor.history.maxDepth=a},setTabMode:function(a){this.options.tabMode=a},setEnterMode:function(a){this.options.enterMode=a},setLineNumbers:function(a){if(a&& | h;this.win.document.getElementsByTagName("head")[0].appendChild(f)}}},setTextWrapping:function(e){if(e!=this.options.textWrapping){this.win.document.body.style.whiteSpace=e?"":"nowrap";this.options.textWrapping=e;if(this.lineNumbers){this.setLineNumbers(false);this.setLineNumbers(true)}}},setIndentUnit:function(e){this.win.indentUnit=e},setUndoDepth:function(e){this.editor.history.maxDepth=e},setTabMode:function(e){this.options.tabMode=e},setEnterMode:function(e){this.options.enterMode=e},setLineNumbers:function(e){if(e&& |
this.setEnv = function(env) { if(ENV && (env == ENV || env == ENV.name)) { return; } if(typeof env == 'string') { switch(env) { | this.setEnv = function(envCtor) { if(typeof envCtor == 'string') { switch(envCtor) { | this.setEnv = function(env) { if(ENV && (env == ENV || env == ENV.name)) { return; } if(typeof env == 'string') { switch(env) { case 'node': ENV = new ENV_node(); break; case 'browser': default: ENV = new ENV_browser(); break; } } else { ENV = env; } jsio.__env = ENV; jsio.__dir = ENV.getCwd(); if(!jsio.__path.__default__.length) { jsio.setPath(ENV.getPath()); } } |
ENV = new ENV_node(); | ENV = new ENV_node(util); | this.setEnv = function(env) { if(ENV && (env == ENV || env == ENV.name)) { return; } if(typeof env == 'string') { switch(env) { case 'node': ENV = new ENV_node(); break; case 'browser': default: ENV = new ENV_browser(); break; } } else { ENV = env; } jsio.__env = ENV; jsio.__dir = ENV.getCwd(); if(!jsio.__path.__default__.length) { jsio.setPath(ENV.getPath()); } } |
ENV = new ENV_browser(); | ENV = new ENV_browser(util); | this.setEnv = function(env) { if(ENV && (env == ENV || env == ENV.name)) { return; } if(typeof env == 'string') { switch(env) { case 'node': ENV = new ENV_node(); break; case 'browser': default: ENV = new ENV_browser(); break; } } else { ENV = env; } jsio.__env = ENV; jsio.__dir = ENV.getCwd(); if(!jsio.__path.__default__.length) { jsio.setPath(ENV.getPath()); } } |
ENV = env; | ENV = new envCtor(util); | this.setEnv = function(env) { if(ENV && (env == ENV || env == ENV.name)) { return; } if(typeof env == 'string') { switch(env) { case 'node': ENV = new ENV_node(); break; case 'browser': default: ENV = new ENV_browser(); break; } } else { ENV = env; } jsio.__env = ENV; jsio.__dir = ENV.getCwd(); if(!jsio.__path.__default__.length) { jsio.setPath(ENV.getPath()); } } |
jsio.__env = ENV; jsio.__dir = ENV.getCwd(); if(!jsio.__path.__default__.length) { jsio.setPath(ENV.getPath()); } | this.__env = ENV; this.__dir = ENV.getCwd(); this.setPath(ENV.getPath()); | this.setEnv = function(env) { if(ENV && (env == ENV || env == ENV.name)) { return; } if(typeof env == 'string') { switch(env) { case 'node': ENV = new ENV_node(); break; case 'browser': default: ENV = new ENV_browser(); break; } } else { ENV = env; } jsio.__env = ENV; jsio.__dir = ENV.getCwd(); if(!jsio.__path.__default__.length) { jsio.setPath(ENV.getPath()); } } |
if(!jsio.path.__default__.length) { jsio.setPath(ENV.getPath()); } | if(!jsio.__path.__default__.length) { jsio.setPath(ENV.getPath()); } | this.setEnv = function(env) { if(ENV && (env == ENV || env == ENV.name)) { return; } if(typeof env == 'string') { switch(env) { case 'node': ENV = new ENV_node(); break; case 'browser': default: ENV = new ENV_browser(); break; } } else { ENV = env; } jsio.__env = ENV; jsio.__dir = ENV.getCwd(); if(!jsio.path.__default__.length) { jsio.setPath(ENV.getPath()); } } |
Ci.nsILocalFile, | Components.interfaces.nsILocalFile, | setFilePref: function(prefName, file) { var pageSpeedPrefs = PAGESPEED.Utils.getPrefs(); pageSpeedPrefs.setComplexValue(prefName, Ci.nsILocalFile, file); }, |
h;this.win.document.getElementsByTagName("head")[0].appendChild(f)}}},setTextWrapping:function(e){if(e!=this.options.textWrapping){this.win.document.body.style.whiteSpace=e?"":"nowrap";this.options.textWrapping=e;if(this.lineNumbers){this.setLineNumbers(false);this.setLineNumbers(true)}}},setIndentUnit:function(e){this.win.indentUnit=e},setUndoDepth:function(e){this.editor.history.maxDepth=e},setTabMode:function(e){this.options.tabMode=e},setEnterMode:function(e){this.options.enterMode=e},setLineNumbers:function(e){if(e&& !this.lineNumbers){this.lineNumbers=k(this.wrapping,this.options.firstLineNumber);this.activateLineNumbers()}else if(!e&&this.lineNumbers){this.wrapping.removeChild(this.lineNumbers);this.wrapping.style.paddingLeft="";this.lineNumbers=null}},cursorPosition:function(e){this.focusIfIE();return this.editor.cursorPosition(e)},firstLine:function(){return this.editor.firstLine()},lastLine:function(){return this.editor.lastLine()},nextLine:function(e){return this.editor.nextLine(e)},prevLine:function(e){return this.editor.prevLine(e)}, | m;this.win.document.getElementsByTagName("head")[0].appendChild(d)}}},setTextWrapping:function(a){if(a!=this.options.textWrapping){this.win.document.body.style.whiteSpace=a?"":"nowrap";this.options.textWrapping=a;if(this.lineNumbers){this.setLineNumbers(false);this.setLineNumbers(true)}}},setIndentUnit:function(a){this.win.indentUnit=a},setUndoDepth:function(a){this.editor.history.maxDepth=a},setTabMode:function(a){this.options.tabMode=a},setEnterMode:function(a){this.options.enterMode=a},setLineNumbers:function(a){if(a&& !this.lineNumbers){this.lineNumbers=E(this.wrapping,this.options.firstLineNumber);this.activateLineNumbers()}else if(!a&&this.lineNumbers){this.wrapping.removeChild(this.lineNumbers);this.wrapping.style.paddingLeft="";this.lineNumbers=null}},cursorPosition:function(a){this.focusIfIE();return this.editor.cursorPosition(a)},firstLine:function(){return this.editor.firstLine()},lastLine:function(){return this.editor.lastLine()},nextLine:function(a){return this.editor.nextLine(a)},prevLine:function(a){return this.editor.prevLine(a)}, | h;this.win.document.getElementsByTagName("head")[0].appendChild(f)}}},setTextWrapping:function(e){if(e!=this.options.textWrapping){this.win.document.body.style.whiteSpace=e?"":"nowrap";this.options.textWrapping=e;if(this.lineNumbers){this.setLineNumbers(false);this.setLineNumbers(true)}}},setIndentUnit:function(e){this.win.indentUnit=e},setUndoDepth:function(e){this.editor.history.maxDepth=e},setTabMode:function(e){this.options.tabMode=e},setEnterMode:function(e){this.options.enterMode=e},setLineNumbers:function(e){if(e&&!this.lineNumbers){this.lineNumbers=k(this.wrapping,this.options.firstLineNumber);this.activateLineNumbers()}else if(!e&&this.lineNumbers){this.wrapping.removeChild(this.lineNumbers);this.wrapping.style.paddingLeft="";this.lineNumbers=null}},cursorPosition:function(e){this.focusIfIE();return this.editor.cursorPosition(e)},firstLine:function(){return this.editor.firstLine()},lastLine:function(){return this.editor.lastLine()},nextLine:function(e){return this.editor.nextLine(e)},prevLine:function(e){return this.editor.prevLine(e)}, |
if (cellStylist) { setupList(0, aIndex); } | function setListBoxSelection(aIndex) { let currentIndex; let currentRow; if (beforeSelection || afterSelection) { if (selectorStatus === SELECTOR_STATE_CANDIDATES) { currentIndex = wholeListIndex; currentRow = wholeList[currentIndex]; } else { currentIndex = selectorContext[SELECTOR_STATE_CANDIDATES].wholeListIndex; currentRow = selectorContext[SELECTOR_STATE_CANDIDATES].wholeList[currentIndex]; } } if (beforeSelection) beforeSelection({row: currentRow, i: currentIndex}); var center = Math.round(listboxRows / 2); var pos; var listLen = currentIndexList ? currentIndexList.length : currentList.length; if (listLen <= listboxRows) { // just change the selected index of the listbox listbox.currentIndex = listbox.selectedIndex = aIndex; return; } if (aIndex <= center) setupList(0, aIndex); else if (aIndex >= listLen - center) setupList(listLen - listboxRows, listboxRows - (listLen - aIndex)); else setupList(aIndex - center, center); if (afterSelection) afterSelection({row: currentRow, i: currentIndex}); } |
|
Element.Methods.setOpacity = function(element, value) { element = $(element); element.style.opacity = (value == 1 || value === '') ? '' : (value < 0.00001) ? 0 : value; if (value == 1) if(element.tagName.toUpperCase() == 'IMG' && element.width) { element.width++; element.width--; } else try { var n = document.createTextNode(' '); element.appendChild(n); element.removeChild(n); } catch (e) { } 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])*?\*\ | Element.Methods.setOpacity = function(element, value) { element = $(element); element.style.opacity = (value == 1 || value === '') ? '' : (value < 0.00001) ? 0 : value; if (value == 1) if(element.tagName.toUpperCase() == 'IMG' && element.width) { element.width++; element.width--; } else try { var n = document.createTextNode(' '); element.appendChild(n); element.removeChild(n); } catch (e) { } return element; }; |
select.selectionTopNode(this.container,true),d=select.selectionTopNode(this.container,false);b===false||d===false||this.indentRegion(b,d,a)}else this.indentAtCursor(a)},grabKeys:function(a,b){this.frozen=a;this.keyFilter=b},ungrabKeys:function(){this.frozen="leave"},setParser:function(a,b){e.Parser=window[a];(b=b||this.options.parserConfig)&&e.Parser.configure&&e.Parser.configure(b);if(this.container.firstChild){forEach(this.container.childNodes,function(d){if(d.nodeType!=3)d.dirty=true});this.addDirtyNode(this.firstChild); this.scheduleHighlight()}},keyDown:function(a){if(this.frozen=="leave")this.keyFilter=this.frozen=null;if(this.frozen&&(!this.keyFilter||this.keyFilter(a.keyCode,a))){a.stop();this.frozen(a)}else{var b=a.keyCode;this.delayScanning();this.options.autoMatchParens&&this.scheduleParenHighlight();if(b==13){if(a.ctrlKey&&!a.altKey)this.reparseBuffer();else{select.insertNewlineAtCursor();if(webkit&&!this.options.textWrapping){var d=makePartSpan("\u200b");select.insertNodeAtCursor(d);setTimeout(function(){removeElement(d)}, | b,c){this.editor.replaceChars(a,b,c)},getSearchCursor:function(a,b,c){return this.editor.getSearchCursor(a,b,c)},undo:function(){this.editor.history.undo()},redo:function(){this.editor.history.redo()},historySize:function(){return this.editor.history.historySize()},clearHistory:function(){this.editor.history.clear()},grabKeys:function(a,b){this.editor.grabKeys(a,b)},ungrabKeys:function(){this.editor.ungrabKeys()},setParser:function(a,b){this.editor.setParser(a,b)},setSpellcheck:function(a){this.win.document.body.spellcheck= | select.selectionTopNode(this.container,true),d=select.selectionTopNode(this.container,false);b===false||d===false||this.indentRegion(b,d,a)}else this.indentAtCursor(a)},grabKeys:function(a,b){this.frozen=a;this.keyFilter=b},ungrabKeys:function(){this.frozen="leave"},setParser:function(a,b){e.Parser=window[a];(b=b||this.options.parserConfig)&&e.Parser.configure&&e.Parser.configure(b);if(this.container.firstChild){forEach(this.container.childNodes,function(d){if(d.nodeType!=3)d.dirty=true});this.addDirtyNode(this.firstChild);this.scheduleHighlight()}},keyDown:function(a){if(this.frozen=="leave")this.keyFilter=this.frozen=null;if(this.frozen&&(!this.keyFilter||this.keyFilter(a.keyCode,a))){a.stop();this.frozen(a)}else{var b=a.keyCode;this.delayScanning();this.options.autoMatchParens&&this.scheduleParenHighlight();if(b==13){if(a.ctrlKey&&!a.altKey)this.reparseBuffer();else{select.insertNewlineAtCursor();if(webkit&&!this.options.textWrapping){var d=makePartSpan("\u200b");select.insertNodeAtCursor(d);setTimeout(function(){removeElement(d)}, |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.