Skip to content
Snippets Groups Projects
Commit dd1d7c84 authored by Brett Bieber's avatar Brett Bieber
Browse files

Add initial work on the mobile proxy.

parent c62cb498
Branches
No related tags found
No related merge requests found
<?xml version="1.0" encoding="UTF-8"?>
<buildpath>
<buildpathentry kind="src" path=""/>
<buildpathentry kind="con" path="org.eclipse.php.core.LANGUAGE"/>
</buildpath>
.project 0 → 100644
<?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>
README 0 → 100644
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?
<?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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment