diff --git a/.buildpath b/.buildpath new file mode 100644 index 0000000000000000000000000000000000000000..8bcb4b5fd612e3ad55fb07e4bed087c55afd0861 --- /dev/null +++ b/.buildpath @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<buildpath> + <buildpathentry kind="src" path=""/> + <buildpathentry kind="con" path="org.eclipse.php.core.LANGUAGE"/> +</buildpath> diff --git a/.project b/.project new file mode 100644 index 0000000000000000000000000000000000000000..bca3cb2a88e8403e0a2341579143e1c8170f3e88 --- /dev/null +++ b/.project @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>wdnmobile</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.wst.validation.validationbuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.dltk.core.scriptbuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.php.core.PHPNature</nature> + </natures> +</projectDescription> diff --git a/README b/README new file mode 100644 index 0000000000000000000000000000000000000000..8a4c5fe60094998dba18046e5542466a29d4a820 --- /dev/null +++ b/README @@ -0,0 +1,15 @@ +Basic idea: +This service is a mobile proxy for UNL template pages. + +The proxy grabs the page, pulls out the maincontentarea and navigation and +displays it in a popup template. The navigation UL is placed at the bottom of +the page below the content. + +TODO: +There's a cleaner way to scan the pages, I just can't find the api for it now. +Capture link clicks so links to other UNL pages are run through the proxy. +Rewrite images so they're absolute. +Resize images that are too big? +Add link to view the html version of the page ala Google mobile version. +Get the m.unl.edu domain and put it up. +Detect mobile screen size and adjust css accordingly? diff --git a/index.php b/index.php new file mode 100644 index 0000000000000000000000000000000000000000..7f3c8e7512f0c2b05816650cebec974bfc984174 --- /dev/null +++ b/index.php @@ -0,0 +1,36 @@ +<?php +require_once 'Validate.php'; +require_once 'UNL/Templates.php'; +require_once 'UNL/DWT/Generator.php'; +$p = UNL_Templates::factory('Popup'); +$options = array('allowed_schemes' => array('http')); +if (isset($_GET['u']) && Validate::uri($_GET['u'], $options)) { + $f = file_get_contents($_GET['u']); + $dwt = new UNL_DWT_Generator(); + $dwt->scanRegions($f); + foreach ($dwt->_regions[''] as $region) { + $p->{$region->name} = $region->value; + } +} else { + $p->maincontentarea = '<h2>Enter a UNL template based page to try out a different template</h2>'; +} + +$p->addStyleDeclaration(' +body * {max-width:300px !important;} +#maincontent .right, #maincontent .left{float:none;} +#maincontent .col {width:auto !important;} +#maincontent .two_col {width:auto !important;} +#maincontent {font-size:150%;line-height:120%; +} +input {font-size:1em;} +'); + +$p->head .= '<meta name="viewport" content="width = 320" />'; +$p->maincontentarea .= '<h2>Navigation</h2>'.$p->navlinks; + +$p->maincontentarea .= '<form style="clear:both" action="?" method="GET"> + URL:<input type="text" name="u" size="15" /> + <input type="submit" name="s" value="submit" /> +</form>'; + +echo $p->toHtml(); \ No newline at end of file