From 85548af7b5337d7f60f64e7ac7ba37f3ba0212fc Mon Sep 17 00:00:00 2001 From: "H.Plato" Date: Mon, 18 Sep 2017 18:15:26 -0600 Subject: [PATCH 1/6] 5.0 updates --- lib/ia7_utilities.pl | 4 ++-- web/ia7/include/javascript.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/ia7_utilities.pl b/lib/ia7_utilities.pl index d8c7dfa10..ce53d31be 100644 --- a/lib/ia7_utilities.pl +++ b/lib/ia7_utilities.pl @@ -142,7 +142,7 @@ sub ia7_update_collection { &main::print_log("[IA7_Collection_Updater] : WARNING: decode_json failed for v1.3 update."); } else { $json_data->{meta}->{version} = "1.3"; - &main::print_log("[IA7_Collection_Updater] : Updating $file to version 1.3 (MH 4.3 IA7 v1.4.400 support)"); + &main::print_log("[IA7_Collection_Updater] : Updating $file to version 1.3 (MH 5.0 IA7 v1.4.400 support)"); $updated = 1; } } @@ -158,7 +158,7 @@ sub ia7_update_collection { &main::print_log("[IA7_Collection_Updater] : WARNING: decode_json failed for v1.4 update."); } else { $json_data->{meta}->{version} = "1.4"; - &main::print_log("[IA7_Collection_Updater] : Updating $file to version 1.4 (MH 4.3 IA7 v1.5.800 weathericon change)"); + &main::print_log("[IA7_Collection_Updater] : Updating $file to version 1.4 (MH 5.0 IA7 v1.5.800 weathericon change)"); $updated = 1; } } diff --git a/web/ia7/include/javascript.js b/web/ia7/include/javascript.js index 239d799d9..7c5324c95 100644 --- a/web/ia7/include/javascript.js +++ b/web/ia7/include/javascript.js @@ -675,7 +675,7 @@ var loadList = function() { button_html += '
'; button_html += ''; button_html += '
'; - button_html += ''; From 2ce7627778b1821a38700e452bdab3d029f147a9 Mon Sep 17 00:00:00 2001 From: "H.Plato" Date: Tue, 19 Sep 2017 14:01:11 -0600 Subject: [PATCH 2/6] IA7 v1.6.150 - update noaa weather to support IA7 web icon. include additional icons in IA7 --- code/common/internet_weather_noaa.pl | 43 +++++++++++++++++++++------- code/common/weather_metar.pl | 3 +- lib/Weather_Common.pm | 1 + lib/json_server.pl | 6 +++- web/ia7/include/javascript.js | 36 +++++++++++++++++++---- 5 files changed, 72 insertions(+), 17 deletions(-) diff --git a/code/common/internet_weather_noaa.pl b/code/common/internet_weather_noaa.pl index cd0c2ea63..db088043b 100644 --- a/code/common/internet_weather_noaa.pl +++ b/code/common/internet_weather_noaa.pl @@ -2,7 +2,7 @@ # # #@ This code will retrieve and parse data from the XML feeds provided -#@ by the Natiional Weather service. +#@ by the Natiional Weather service. (MH5 Updated) #@ #@ Check http://www.weather.gov/data/current_obs/ #@ for the nearest station's ID. Add the ID to the "weather_noaa_station" @@ -19,7 +19,7 @@ Revision History - + Version 2 September 19, 2017 Version 0.1 December 8, 2006 Initial version @@ -32,24 +32,39 @@ my $NWSdata; my $station = $config_parms{weather_noaa_station}; +my $internet_weather_noaa_file = $config_parms{data_dir} . '/web/weather_noaa.html'; + $station = 'KARR' unless $station; # create object $xml = new XML::Simple; $v_get_xml_weather = new Voice_Cmd('Get XML weather data'); +$p_internet_weather_noaa_fetch = new Process_Item(qq{get_url -quiet "http://www.weather.gov/data/current_obs/$station.xml" "$internet_weather_noaa_file"}); # Create trigger if ($Reload) { &trigger_set( "time_cron '15 * * * *'", "run_voice_cmd('Get XML weather data')", 'NoExpire', 'get xml weather' ) unless &trigger_get('get xml weather'); + $Weather_Common::weather_module_enabled = 1; + } if ( said $v_get_xml_weather) { - if (&net_connect_check) { - $v_get_xml_weather->respond("app=weather Retrieving XML weather..."); - # + start $p_internet_weather_noaa_fetch; + $v_get_xml_weather->respond("app=weather Retrieving XML weather..."); +} + +if ( done_now $p_internet_weather_noaa_fetch or $Reload ) { + &process_noaa; +} + +sub process_noaa { + my $data = file_read $internet_weather_noaa_file; + return unless ($data); # read XML file - $NWSdata = $xml->XMLin( get( "http://www.weather.gov/data/current_obs/" . $station . ".xml" ) ); + $NWSdata = $xml->XMLin( $data ); + +print Dumper $NWSdata; # hash used to temporarily store weather info before selective load into %Weather my %w = (); @@ -66,6 +81,18 @@ $w{DewOutdoor} = NA_to_zero( $NWSdata->{dewpoint_f} ); $w{Summary_Short} = $NWSdata->{weather}; + ($w{LastUpdated}) = $NWSdata->{observation_time} =~ /Last Updated on (.*)$/; + + $w{IsRaining} = 0; + $w{IsRaining} = 1 if ($NWSdata->{weather} =~ m/rain/i); + + $w{IsSnowing} = 0; + $w{IsSnowing} = 1 if ($NWSdata->{weather} =~ m/snow/i); + + $w{Clouds} = $NWSdata->{weather}; + $w{Clouds} = "" if ($NWSdata->{weather} =~ m/fair/i); + + &populate_internet_weather( \%w ); &weather_updated; @@ -78,10 +105,6 @@ &print_log( "weather_xml: finished retrieving weather for station " . $station ); $v_get_xml_weather->respond( 'app=weather connected=0 Weather data for ' . $NWSdata->{location} . ' retrieved.' ); - } - else { - $v_get_xml_weather->respond("I must be connected to the Internet to get weather data."); - } } sub NA_to_zero { diff --git a/code/common/weather_metar.pl b/code/common/weather_metar.pl index c370a43e4..987b65df5 100644 --- a/code/common/weather_metar.pl +++ b/code/common/weather_metar.pl @@ -3,7 +3,7 @@ # $Revision$ # $Date$ # -#@ Weather METAR parser +#@ Weather METAR parser (MH5 Updated) #@ #@ $Revision$ #@ @@ -50,6 +50,7 @@ if ($Reload) { &trigger_set( '$New_Minute and $Minute == 5', '$p_weather_metar_page->start', 'NoExpire', 'Update weather information via METAR' ) unless &trigger_get('Update weather information via METAR'); + $Weather_Common::weather_module_enabled = 1; } if ( said $v_get_metar_weather) { diff --git a/lib/Weather_Common.pm b/lib/Weather_Common.pm index f6e4c9750..0dfab1a06 100644 --- a/lib/Weather_Common.pm +++ b/lib/Weather_Common.pm @@ -37,6 +37,7 @@ BEGIN { } our @weather_hooks; +our $weather_module_enabled; #used to display an icon on web interface if a weather module is enabled # this should be called whenever a client has FINISHED updating %main::Weather diff --git a/lib/json_server.pl b/lib/json_server.pl index 0175ddc2e..9c4c11fbc 100755 --- a/lib/json_server.pl +++ b/lib/json_server.pl @@ -727,18 +727,22 @@ sub json_get { if ( $path[0] eq 'weather' || $path[0] eq 'misc' || $path[0] eq '' ) { my $source = "weather"; $source = "misc" if ($path[0] eq 'misc'); + my $enabled = 0; + $enabled = 1 if (defined $Weather_Common::weather_module_enabled and $Weather_Common::weather_module_enabled=1); $json_data{$source}{barom} = $Weather{"Barom"}; $json_data{$source}{summary} = $Weather{"Summary"}; $json_data{$source}{summary_long} = $Weather{"Summary_Long"}; $json_data{$source}{tempindoor} = $Weather{"TempIndoor"}; $json_data{$source}{tempoutdoor} = $Weather{"TempOutdoor"}; $json_data{$source}{wind} = $Weather{"Wind"}; - $json_data{$source}{clouds} = $Weather{"Clouds"}; + $json_data{$source}{clouds} = (lc $Weather{"Clouds"}); $json_data{$source}{clouds} =~ s/^\s+|\s+$//g; #remove leading/trailing spaces $json_data{$source}{raining} = int($Weather{"IsRaining"}); $json_data{$source}{snowing} = int($Weather{"IsSnowing"}); $json_data{$source}{night} = $Dark; $json_data{$source}{weather_lastupdated} = $Weather{"LastUpdated"}; + $json_data{$source}{weather_enabled} = $enabled; + } diff --git a/web/ia7/include/javascript.js b/web/ia7/include/javascript.js index 7c5324c95..5e2704a4c 100644 --- a/web/ia7/include/javascript.js +++ b/web/ia7/include/javascript.js @@ -1,5 +1,5 @@ -var ia7_ver = "v1.6.140"; +var ia7_ver = "v1.6.150"; var entity_store = {}; //global storage of entities var json_store = {}; var updateSocket; @@ -1498,7 +1498,7 @@ var get_stats = function(tagline) { $('.mh-wi-icon').hide(); } - if (json.data.tempoutdoor !== undefined) { + if ((json.data.tempoutdoor !== undefined && json.data.tempoutdoor !== null) && (json.data.weather_enabled !== undefined && json.data.weather_enabled == 1)) { $('.mh-wi-text').html(" "+json.data.tempoutdoor+"° "); $('.mh-wi-icon').removeClass(function (index, classname) { return (classname.match (/(^|\s)wi-\S+/g) || []).join(' '); @@ -1518,7 +1518,7 @@ var get_stats = function(tagline) { } $('.mh-wi').click( function () { - var summary = "Summary:  "+json.data.summary+"
"; + var summary = "Summary:  "+json.data.summary_long+"
"; summary += "Last Updated:  "+json.data.weather_lastupdated; $('#lastResponse').find('.modal-body').html(summary); @@ -1550,20 +1550,46 @@ var get_wi_icon = function (conditions,rain,snow,night) { icon = "wi-cloudy"; if (rain) icon = "wi-rain"; if (snow) icon = "wi-snow"; + } else if (conditions == "sky clear" || conditions == "" ) { if (night) { icon = "wi-night-clear"; } else { icon = "wi-day-sunny"; } - } else if (conditions == "few clouds" || conditions == "scattered clouds" || conditions == "broken clouds") { + + } else if (conditions.includes("thunderstorm")) { + icon = "wi-thunderstorm"; + + } else if ((conditions.includes("mist") || conditions.includes("fog")) + icon += "fog"; + + } else if (conditions.includes("breezy")) { + if (conditions.includes("cloud")) { + if (night) { + icon = "wi-night-cloudy-windy" + } else { + icon = "wi-day-cloudy-gusts"; + } + else if (conditions.includes("overcast") { + icon = "wi-cloudy-gusts"; + } else { + if (night) { + icon = "wi-strong-wind" + } else { + icon = "wi-day-windy"; + } + } + + } else if (condition.includes("few clouds") || conditions == "scattered clouds" || conditions == "broken clouds") { if (rain) { icon += "rain"; } else if (snow) { icon += "snow"; } else { icon += "cloudy"; - } + } + } else { icon = "wi-na"; } From 096198d4c36a5280936c93b1dbef6e12bed971c4 Mon Sep 17 00:00:00 2001 From: "H.Plato" Date: Tue, 19 Sep 2017 19:08:27 -0600 Subject: [PATCH 3/6] fixed some weather if statements --- web/ia7/include/javascript.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/ia7/include/javascript.js b/web/ia7/include/javascript.js index 5e2704a4c..2fa58dc3f 100644 --- a/web/ia7/include/javascript.js +++ b/web/ia7/include/javascript.js @@ -1561,7 +1561,7 @@ var get_wi_icon = function (conditions,rain,snow,night) { } else if (conditions.includes("thunderstorm")) { icon = "wi-thunderstorm"; - } else if ((conditions.includes("mist") || conditions.includes("fog")) + } else if (conditions.includes("mist") || conditions.includes("fog")) { icon += "fog"; } else if (conditions.includes("breezy")) { @@ -1571,7 +1571,7 @@ var get_wi_icon = function (conditions,rain,snow,night) { } else { icon = "wi-day-cloudy-gusts"; } - else if (conditions.includes("overcast") { + } else if (conditions.includes("overcast")) { icon = "wi-cloudy-gusts"; } else { if (night) { From 41259bc0eb68bbc401d08c18c694990a7c669764 Mon Sep 17 00:00:00 2001 From: "H.Plato" Date: Tue, 19 Sep 2017 19:33:48 -0600 Subject: [PATCH 4/6] wunderground, add celcuis enable it as a IA7 weather source --- code/common/weather_wunderground.pl | 37 +++++++++++++++++++++-------- web/ia7/include/javascript.js | 4 ++-- 2 files changed, 29 insertions(+), 12 deletions(-) diff --git a/code/common/weather_wunderground.pl b/code/common/weather_wunderground.pl index 15a862e76..1b43166fd 100644 --- a/code/common/weather_wunderground.pl +++ b/code/common/weather_wunderground.pl @@ -1,5 +1,5 @@ # Category = Weather -#@ Updates live weather variables from http://api.wunderground.com. +#@ Updates live weather variables from http://api.wunderground.com. (Updated MH5) =begin @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@ -36,6 +36,11 @@ my $wunderground_getweather_file; my $wunderground_stationid = $config_parms{wunderground_stationid}; my $wunderground_apikey = $config_parms{wunderground_apikey}; +my $wunderground_units = "f"; +$wunderground_units = $config_parms{wunderground_units} if (defined $config_parms{wunderground_units}); +my $wunderground_units2 = "mph"; +$wunderground_units2 = "kph" if ((defined $config_parms{wunderground_units}) and (lc $config_parms{wunderground_units} eq "c")); + my $wunderground_url; my %wunderground_data; my @wunderground_keys; @@ -43,6 +48,7 @@ my $wunderground_states = 'getweather,parsefile,debug'; $v_wunderground = new Voice_Cmd("wunderground [$wunderground_states]"); +$Weather_Common::weather_module_enabled = 1; # noloop=stop @@ -114,25 +120,26 @@ @wunderground_keys = []; #TempOutdoor - weather_wunderground_addelem( $channel, 'TempOutdoor', 'temp_f' ); + weather_wunderground_addelem( $channel, 'TempOutdoor', 'temp_' . $wunderground_units ); #DewOutdoor - weather_wunderground_addelem( $channel, 'DewOutdoor', 'dewpoint_f' ); + weather_wunderground_addelem( $channel, 'DewOutdoor', 'dewpoint_' . $wunderground_units ); #WindAvgDir weather_wunderground_addelem( $channel, 'WindAvgDir', 'wind_dir' ); #WindAvgSpeed - weather_wunderground_addelem( $channel, 'WindAvgSpeed', 'wind_mph' ); + weather_wunderground_addelem( $channel, 'WindAvgSpeed', 'wind_' . $wunderground_units2 ); #WindGustDir #WindGustSpeed - weather_wunderground_addelem( $channel, 'WindGustSpeed', 'wind_gust_mph' ); + weather_wunderground_addelem( $channel, 'WindGustSpeed', 'wind_gust' . $wunderground_units2 ); #WindGustTime - #Clouds #Conditions weather_wunderground_addelem( $channel, 'Conditions', 'weather' ); + #Clouds + weather_wunderground_addelem( $channel, 'Clouds', 'weather' ); #Barom weather_wunderground_addelem( $channel, 'Barom', 'pressure_mb' ); @@ -143,15 +150,25 @@ #HumidOutdoor weather_wunderground_addelem( $channel, 'HumidOutdoor', 'relative_humidity' ); - #IsRaining - #IsSnowing +# #IsRaining + my $israining = 0; + $israining = 1 if ($wunderground_data{Conditions} =~ m/rain/i); + +# #IsSnowing + my $issnowing = 0; + $issnowing = 1 if ($wunderground_data{Conditions} =~ m/snow/i); + + weather_wunderground_addelem( $channel, 'Clouds', 'weather' ); + #RainTotal weather_wunderground_addelem( $channel, 'RainTotal', 'precip_today_in' ); #RainRate + weather_wunderground_addelem( $channel, 'LastUpdated', 'observation_time' ); + $wunderground_data{LastUpdated} =~ s/^Last Updated on //; - print_log "[WUnderground] " . Dumper %wunderground_data if $Debug{weather} >= 5; - + print_log "[WUnderground] " . Dumper %wunderground_data; ## if $Debug{weather} >= 5; +#TODO print_log "[WUnderground] Using elements: $config_parms{weather_wunderground_elements}" if $Debug{weather}; &Weather_Common::populate_internet_weather( \%wunderground_data, $config_parms{weather_wunderground_elements} ); &Weather_Common::weather_updated; diff --git a/web/ia7/include/javascript.js b/web/ia7/include/javascript.js index 2fa58dc3f..c3f8ee565 100644 --- a/web/ia7/include/javascript.js +++ b/web/ia7/include/javascript.js @@ -1551,7 +1551,7 @@ var get_wi_icon = function (conditions,rain,snow,night) { if (rain) icon = "wi-rain"; if (snow) icon = "wi-snow"; - } else if (conditions == "sky clear" || conditions == "" ) { + } else if (conditions == "sky clear" || conditions == "" || conditions == "clear") { if (night) { icon = "wi-night-clear"; } else { @@ -1581,7 +1581,7 @@ var get_wi_icon = function (conditions,rain,snow,night) { } } - } else if (condition.includes("few clouds") || conditions == "scattered clouds" || conditions == "broken clouds") { + } else if (conditions.includes("few clouds") || conditions == "scattered clouds" || conditions == "broken clouds") { if (rain) { icon += "rain"; } else if (snow) { From f148086525798afb3f474ac0a6736b8bb50d35b0 Mon Sep 17 00:00:00 2001 From: "H.Plato" Date: Tue, 19 Sep 2017 19:35:07 -0600 Subject: [PATCH 5/6] removed some debug statements --- code/common/weather_wunderground.pl | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/code/common/weather_wunderground.pl b/code/common/weather_wunderground.pl index 1b43166fd..23709fac7 100644 --- a/code/common/weather_wunderground.pl +++ b/code/common/weather_wunderground.pl @@ -150,11 +150,11 @@ #HumidOutdoor weather_wunderground_addelem( $channel, 'HumidOutdoor', 'relative_humidity' ); -# #IsRaining + #IsRaining my $israining = 0; $israining = 1 if ($wunderground_data{Conditions} =~ m/rain/i); -# #IsSnowing + #IsSnowing my $issnowing = 0; $issnowing = 1 if ($wunderground_data{Conditions} =~ m/snow/i); @@ -167,8 +167,7 @@ weather_wunderground_addelem( $channel, 'LastUpdated', 'observation_time' ); $wunderground_data{LastUpdated} =~ s/^Last Updated on //; - print_log "[WUnderground] " . Dumper %wunderground_data; ## if $Debug{weather} >= 5; -#TODO + print_log "[WUnderground] " . Dumper %wunderground_data if $Debug{weather} >= 5; print_log "[WUnderground] Using elements: $config_parms{weather_wunderground_elements}" if $Debug{weather}; &Weather_Common::populate_internet_weather( \%wunderground_data, $config_parms{weather_wunderground_elements} ); &Weather_Common::weather_updated; From e5eea1fe6ae44b6edfb34e92f71bb3b48e647219 Mon Sep 17 00:00:00 2001 From: "H.Plato" Date: Wed, 20 Sep 2017 17:25:16 -0600 Subject: [PATCH 6/6] IA7 v1.6.200 - sortable collection --- code/common/weather_wunderground.pl | 8 ++-- web/ia7/include/javascript.js | 61 ++++++++++++++++++++++++++--- web/ia7/index.shtml | 18 +++++++++ 3 files changed, 78 insertions(+), 9 deletions(-) diff --git a/code/common/weather_wunderground.pl b/code/common/weather_wunderground.pl index 23709fac7..bc2a82a71 100644 --- a/code/common/weather_wunderground.pl +++ b/code/common/weather_wunderground.pl @@ -151,12 +151,12 @@ weather_wunderground_addelem( $channel, 'HumidOutdoor', 'relative_humidity' ); #IsRaining - my $israining = 0; - $israining = 1 if ($wunderground_data{Conditions} =~ m/rain/i); + $wunderground_data{IsRaining} = 0; + $wunderground_data{IsRaining} = 1 if ($wunderground_data{Conditions} =~ m/rain/i); #IsSnowing - my $issnowing = 0; - $issnowing = 1 if ($wunderground_data{Conditions} =~ m/snow/i); + $wunderground_data{IsSnowing} = 0; + $wunderground_data{IsSnowing} = 1 if ($wunderground_data{Conditions} =~ m/snow/i); weather_wunderground_addelem( $channel, 'Clouds', 'weather' ); diff --git a/web/ia7/include/javascript.js b/web/ia7/include/javascript.js index c3f8ee565..eab253451 100644 --- a/web/ia7/include/javascript.js +++ b/web/ia7/include/javascript.js @@ -1,5 +1,5 @@ -var ia7_ver = "v1.6.150"; +var ia7_ver = "v1.6.200"; var entity_store = {}; //global storage of entities var json_store = {}; var updateSocket; @@ -1249,6 +1249,7 @@ var loadCollection = function(collection_keys) { var button_html = "
"; + button_html = "
" + button_html + "
"; entity_arr.push(button_html); items += item+","; } @@ -1283,6 +1284,7 @@ var loadCollection = function(collection_keys) { } else { button_html = ""+name+""; } + button_html = "
" + button_html + "
"; entity_arr.push(button_html); } } @@ -1297,7 +1299,9 @@ var loadCollection = function(collection_keys) { $('#list_content').append("
"); $('#buffer'+row).append("
"); } - $('#row'+row).append("
" + entity_arr[i] + "
"); +// $('#row'+row).append("
" + entity_arr[i] + "
"); + $('#row'+row).append(entity_arr[i]); + if (column == 3){ column = 0; row++; @@ -1520,7 +1524,9 @@ var get_stats = function(tagline) { $('.mh-wi').click( function () { var summary = "Summary:  "+json.data.summary_long+"
"; summary += "Last Updated:  "+json.data.weather_lastupdated; - + if ($('.mh-wi-icon').hasClass("wi-na")) { + summary += "
Clouds:  "+json.data.clouds; + } $('#lastResponse').find('.modal-body').html(summary); $('#lastResponse').modal({ show: true @@ -1550,6 +1556,12 @@ var get_wi_icon = function (conditions,rain,snow,night) { icon = "wi-cloudy"; if (rain) icon = "wi-rain"; if (snow) icon = "wi-snow"; + + } else if (conditions == "rain") { + icon += "rain"; + + } else if (conditions == "snow") { + icon += "snow"; } else if (conditions == "sky clear" || conditions == "" || conditions == "clear") { if (night) { @@ -1581,7 +1593,7 @@ var get_wi_icon = function (conditions,rain,snow,night) { } } - } else if (conditions.includes("few clouds") || conditions == "scattered clouds" || conditions == "broken clouds") { + } else if (conditions.includes("few clouds") || conditions == "scattered clouds" || conditions == "broken clouds" || conditions == "cloudy") { if (rain) { icon += "rain"; } else if (snow) { @@ -1593,7 +1605,6 @@ var get_wi_icon = function (conditions,rain,snow,night) { } else { icon = "wi-na"; } - return icon; } @@ -3454,6 +3465,46 @@ $(document).ready(function() { display_mode = $(this).find('input').attr('id'); developer = false; } + + if (developer == true) { + //turn on collections drag-n-dropping + $("#list_content").sortable({ + tolerance: "pointer", + items: ".col-sm-4", + update: function( event, ui ) { + var URLHash = URLToHash(); + //Get Sorted Array of Entities + var outputJSON = $( "#list_content" ).sortable( "toArray", { attribute: "colid" } ); + //outputJSON = '["' + outputJSON.join('","') + '"]'; + //URLHash.path = "/objects/" + entity + "/sort_order"; + //delete URLHash.parents; + console.log("outputJSON="+JSON.stringify(outputJSON)); + //URLHash={"_collection_key":"0,6"} + console.log("URLHash="+JSON.stringify(URLHash)); + console.log("Key="+URLHash._collection_key.substr(URLHash._collection_key.lastIndexOf(',') + 1)); + + }, + //to prevent long clicks from firing while dragging + start: function(event, ui) { + // $("#list_content").mayTriggerLongClicks().off(); + }, + stop: function(event, ui) { + // $("#list_content").mayTriggerLongClicks().on( 'longClick', function() { + // var entity = $(this).attr("entity"); + // console.log("long_click="+JSON.stringify($(this))); + // }); + } + }); + //$('#list_content').disableSelection(); + $("#list_content").mayTriggerLongClicks().on( 'longClick', function() { + var entity = $(this).attr("entity"); + console.log("long_click="+JSON.stringify($(this))); + }); + } else { + $("#list_content").sortable("destroy"); + //$("#list_content").enableSelection(); + $("#list_content").mayTriggerLongClicks().off(); + } document.cookie = "display_mode="+display_mode; document.cookie = "developer="+developer; diff --git a/web/ia7/index.shtml b/web/ia7/index.shtml index e635c72d7..ff486f8e6 100644 --- a/web/ia7/index.shtml +++ b/web/ia7/index.shtml @@ -372,6 +372,24 @@
+ +
\ No newline at end of file