<commit_before><!--
  This file is a demo of the FlickrStore, a simple wrapper to the public feed service
  of Flickr.  This just does very basic queries against Flickr and loads the results
  into a list viewing widget.
-->
<html>
<head>
	<title>Demo of FlickrStore</title>
	<style type="text/css">

		@import "../../../../dijit/themes/tundra/tundra.css";
		@import "../../../../dojo/resources/dojo.css";
		@import "../../../../dijit/tests/css/dijitTests.css";
		@import "./flickrDemo.css";
	</style>

	<script type="text/javascript" src="../../../../dojo/dojo.js" djConfig="isDebug: true, parseOnLoad: true"></script>
	<script type="text/javascript">
		dojo.require("dojo.parser");
		dojo.require("dijit.form.Textbox");
		dojo.require("dijit.form.Button");
		dojo.require("dijit.form.ComboBox");
		dojo.require("dijit.form.NumberSpinner");
		dojo.require("dojox.data.FlickrStore");
		dojo.require("dojox.wire.ml.Invocation");
		dojo.require("dojox.wire.ml.DataStore");
		dojo.require("dojox.wire.ml.Transfer");
		dojo.require("dojox.wire");
		dojo.require("dojox.data.demos.widgets.FlickrViewList");
		dojo.require("dojox.data.demos.widgets.FlickrView");

		//Toplevel JS Object to contain a few basics for us, such as the request to pass to the store and a stub onItem and onComplete function
		// to trap on for triggering other events.
		var dataHolder = {
			//Simple stub datastore request
			request: {query: {}, onItem: function(item, req){}, onComplete: function(items, req){}},
			
			//Spot to store off data values as they're generated by the declarative binding.
			result: null
		};

		//Simple messages holder for setting the value of a textbox from.
		var demoMessages = {
			processingStart: "PROCESSING REQUEST",
			processingDone: "PROCESSING COMPLETE"
		}

		//Function to convert the input from a widget into a comma separated list.
		//that is the format of the store parameter.
		var tagsInputConverter = function(tags){
			if(tags && tags !== ""){
				var tagsArray = tags.split(" ");
				tags = "";
				for(var i = 0; i < tagsArray.length; i++){
					tags = tags + tagsArray[i];
					if(i < (tagsArray.length - 1)){
						tags += ","
					}
				}
			}
			return tags
		}

	</script>
</head>

<body class="tundra">
	<h1>
		DEMO:  FlickrStore Search
	</h1>
	<hr>
	<h3>
		Description:
	</h3>
	<p>
		This simple demo shows how services, such as Flickr, can be wrapped by the datastore API.  In this demo, you can search public 
        Flickr images through a simple FlickrStore by specifying a series of tags (separated by spaces) to search on.  The results 
        will be displayed below the search box.  This demo is the same as the example demo provided in dojox/data/demos/demo_FlickrStore.html, 
        except that all the interactions are implemented via Wire instead of a script that runs at dojo.addOnLoad().
	</p>
	<p>
		For fun, search on the 3dny tag!
	</p>

	<blockquote>

	<!--
		The store instance used by this demo.
	-->
	<table>
		<tbody>
			<tr>
				<td>
					<b>Status:</b>
				</td>
				<td>
					<div dojoType="dijit.form.Textbox" size="50" id="status" jsId="statusWidget" disabled="true"></div>
				</td>
			</tr>
			<tr>
				<td>
					<b>ID:</b>
				</td>
				<td>
					<div dojoType="dijit.form.Textbox" size="50" id="userid" jsId="idWidget"></div>
				</td>
			</tr>
			<tr>
				<td>
					<b>Tags:</b>
				</td>
				<td>
					<div dojoType="dijit.form.Textbox" size="50" id="tags" jsId="tagsWidget" value="3dny"></div>
				</td>
			</tr>
			<tr>
				<td>
					<b>Tagmode:</b>
				</td>
				<td>
					<select id="tagmode"
							jsId="tagmodeWidget"
							dojoType="dijit.form.ComboBox"
							autocomplete="false"
							value="any"
					>
						<option>any</option>
						<option>all</option>
					</select>
				</td>
			</tr>
			<tr>
				<td>
					<b>Number of Pictures:</b>
				</td>
				<td>
					<div   
						id="count"
						jsId="countWidget"
						dojoType="dijit.form.NumberSpinner"
						value="20"
						constraints="{min:1,max:20,places:0}" 
					></div>
				</td>
			</tr>
			<tr>
				<td>
				</td>
				<td>
					<div dojoType="dijit.form.Button" label="Search" id="searchButton" jsId="searchButtonWidget"></div>
				</td>
			</tr>
		</tbody>
	</table>
	<hr/>
	<div dojoType="dojox.data.FlickrStore" jsId="flickrStore" label="title"></div>
	<div dojoType="dojox.data.demos.widgets.FlickrViewList" id="flickrViews" jsId="flickrViewsWidget"></div>

	<!-------------------------------- Using dojox.wire, declaratively wire up the widgets. --------------------------->

	<!-- 
		When the search button is clicked, do the following in order:
		1.)  Map the widget values over to the request properties.
		2.)  Clear existing rows from table, 
		3.)  Set the status to processing
		4.)  Invoke the fetch to repopulate the table.
	-->
	<div dojoType="dojox.wire.ml.Action"
		trigger="searchButtonWidget"
		triggerEvent="onClick">
		<!-- Read in the values from the widgets and bind them to the appropriate data locations -->


		<div dojoType="dojox.wire.ml.Transfer"<commit_msg>Minor tweak to the file to fix a comment. refs #3779<commit_after><!--
  This file is a demo of the FlickrStore, a simple wrapper to the public feed service
  of Flickr.  This just does very basic queries against Flickr and loads the results
  into a list viewing widget.
-->
<html>
<head>
	<title>Demo of FlickrStore</title>
	<style type="text/css">

		@import "../../../../dijit/themes/tundra/tundra.css";
		@import "../../../../dojo/resources/dojo.css";
		@import "../../../../dijit/tests/css/dijitTests.css";
		@import "./flickrDemo.css";
	</style>

	<script type="text/javascript" src="../../../../dojo/dojo.js" djConfig="isDebug: true, parseOnLoad: true"></script>
	<script type="text/javascript">
		dojo.require("dojo.parser");
		dojo.require("dijit.form.Textbox");
		dojo.require("dijit.form.Button");
		dojo.require("dijit.form.ComboBox");
		dojo.require("dijit.form.NumberSpinner");
		dojo.require("dojox.data.FlickrStore");
		dojo.require("dojox.wire.ml.Invocation");
		dojo.require("dojox.wire.ml.DataStore");
		dojo.require("dojox.wire.ml.Transfer");
		dojo.require("dojox.wire");
		dojo.require("dojox.data.demos.widgets.FlickrViewList");
		dojo.require("dojox.data.demos.widgets.FlickrView");

		//Toplevel JS Object to contain a few basics for us, such as the request to pass to the store and a stub onItem and onComplete function
		// to trap on for triggering other events.
		var dataHolder = {
			//Simple stub datastore request
			request: {query: {}, onItem: function(item, req){}, onComplete: function(items, req){}},
			
			//Spot to store off data values as they're generated by the declarative binding.
			result: null
		};

		//Simple messages holder for setting the value of a textbox from.
		var demoMessages = {
			processingStart: "PROCESSING REQUEST",
			processingDone: "PROCESSING COMPLETE"
		}

		//Function to convert the input from a widget into a comma separated list.
		//that is the format of the store parameter.
		var tagsInputConverter = function(tags){
			if(tags && tags !== ""){
				var tagsArray = tags.split(" ");
				tags = "";
				for(var i = 0; i < tagsArray.length; i++){
					tags = tags + tagsArray[i];
					if(i < (tagsArray.length - 1)){
						tags += ","
					}
				}
			}
			return tags
		}

	</script>
</head>

<body class="tundra">
	<h1>
		DEMO:  FlickrStore Search
	</h1>
	<hr>
	<h3>
		Description:
	</h3>
	<p>
		This simple demo shows how services, such as Flickr, can be wrapped by the datastore API.  In this demo, you can search public 
        Flickr images through a simple FlickrStore by specifying a series of tags (separated by spaces) to search on.  The results 
        will be displayed below the search box.  This demo is the same as the example demo provided in dojox/data/demos/demo_FlickrStore.html, 
        except that all the interactions are implemented via Wire instead of a script that runs at dojo.addOnLoad().
	</p>
	<p>
		For fun, search on the 3dny tag!
	</p>

	<blockquote>

	<!--
		Layout.
	-->
	<table>
		<tbody>
			<tr>
				<td>
					<b>Status:</b>
				</td>
				<td>
					<div dojoType="dijit.form.Textbox" size="50" id="status" jsId="statusWidget" disabled="true"></div>
				</td>
			</tr>
			<tr>
				<td>
					<b>ID:</b>
				</td>
				<td>
					<div dojoType="dijit.form.Textbox" size="50" id="userid" jsId="idWidget"></div>
				</td>
			</tr>
			<tr>
				<td>
					<b>Tags:</b>
				</td>
				<td>
					<div dojoType="dijit.form.Textbox" size="50" id="tags" jsId="tagsWidget" value="3dny"></div>
				</td>
			</tr>
			<tr>
				<td>
					<b>Tagmode:</b>
				</td>
				<td>
					<select id="tagmode"
							jsId="tagmodeWidget"
							dojoType="dijit.form.ComboBox"
							autocomplete="false"
							value="any"
					>
						<option>any</option>
						<option>all</option>
					</select>
				</td>
			</tr>
			<tr>
				<td>
					<b>Number of Pictures:</b>
				</td>
				<td>
					<div   
						id="count"
						jsId="countWidget"
						dojoType="dijit.form.NumberSpinner"
						value="20"
						constraints="{min:1,max:20,places:0}" 
					></div>
				</td>
			</tr>
			<tr>
				<td>
				</td>
				<td>
					<div dojoType="dijit.form.Button" label="Search" id="searchButton" jsId="searchButtonWidget"></div>
				</td>
			</tr>
		</tbody>
	</table>
	<hr/>
	<!--
		The store instance used by this demo.
	-->
	<div dojoType="dojox.data.FlickrStore" jsId="flickrStore" label="title"></div>
	<div dojoType="dojox.data.demos.widgets.FlickrViewList" id="flickrViews" jsId="flickrViewsWidget"></div>

	<!-------------------------------- Using dojox.wire, declaratively wire up the widgets. --------------------------->

	<!-- 
		When the search button is clicked, do the following in order:
		1.)  Map the widget values over to the request properties.
		2.)  Clear existing rows from table, 
		3.)  Set the status to processing
		4.)  Invoke the fetch to repopulate the table.
	-->
	<div dojoType="dojox.wire.ml.Action"
		trigger="searchButtonWidget"
		triggerEvent="onClick">
		<!-- Read in the values from the widgets and bind them to the appropriate data locations -->


		<div dojoType="dojox.wire.ml.Transfer"
{'fraction_non_alphanumeric': 0.16614048934490924, 'fraction_numerical': 0.005130228887134964, 'mean_word_length': 2.808039068369647, 'pattern_counts': {'":': 0, '<': 208, '<?xml version=': 0, '>': 202, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3860134', 'n_tokens_mistral': 4214, 'n_tokens_neox': 3485, 'n_words': 956}