This commit is contained in:
shuhongfan
2023-09-04 16:40:17 +08:00
commit cf5ac25c14
8267 changed files with 1305066 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
<html>
<head>
<title></title>
</head>
<body>
<br />
<div style="width:100%; text-align:center; font-family:Arial; font-size:12px;" id=other></div>
<br />
<div style="width:100%; text-align:center; font-family:Arial; font-size:12px;">
<button onclick="parent.window.close();">
Close
</button>
</div>
<SCRIPT src="axurerp_pagescript.js"></SCRIPT>
<script language=javascript>
function getQueryVariable(variable) {
var query = window.location.hash.substring(1);
var vars = query.split("&&&");
for (var i=0;i<vars.length;i++) {
var pair = vars[i].split("=");
if (pair[0] == variable) {
return decodeURI(pair[1]);
}
}
}
var other = document.getElementById('other');
other.innerHTML = getQueryVariable('other');
</script>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

View File

@@ -0,0 +1,186 @@
<html>
<head>
<title>Install the Axure RP Chrome Extension</title>
<style type="text/css">
*
{
font-family: NunitoSans, Helvetica, Arial, sans-serif;
}
body
{
text-align: center;
background-color: #fafafa;
}
p
{
font-size: 14px;
line-height: 18px;
color: #333333;
}
div.container
{
width: 980px;
margin-left: auto;
margin-right: auto;
text-align: left;
}
a
{
text-decoration: none;
color: #009dda;
}
.button
{
background: #A502B3;
font: normal 16px Arial, sans-serif;
color: #FFFFFF;
padding: 10px 30px 10px 30px;
border: 2px solid #A502B3;
display: inline-block;
margin-top: 10px;
text-transform: uppercase;
font-size: 14px;
border-radius: 4px;
}
a:hover.button
{
border: 2px solid #A502B3;
color: #A502B3;
background-color: #FFFFFF;
}
div.left
{
width: 400px;
float: left;
margin-right: 80px;
}
div.right
{
width: 400px;
float: left;
}
div.buttonContainer
{
text-align: center;
}
h1
{
font-size: 36px;
color: #333333;
line-height: 50px;
margin-bottom: 20px;
font-weight: normal;
}
h2
{
font-size: 24px;
font-weight: normal;
color: #08639C;
text-align: center;
}
h3
{
font-size: 16px;
color: #333333;
font-weight: normal;
text-transform: uppercase;
}
.heading
{
border-bottom: 1px solid black;
height: 36px;
line-height: 36px;
font-size: 22px;
color: #000000;
}
span.faq
{
font-size: 16px;
line-height: 24px;
font-weight: normal;
text-transform: uppercase;
color: #333333;
display: block;
}
</style>
</head>
<body>
<div class="container">
<br />
<br />
<img src="axure_logo.png" alt="axure" />
<br />
<br />
<h1>
AXURE RP EXTENSION FOR CHROME</h1>
<p style="font-size: 14px; color: #666666; margin-top: 10px;">
Google Chrome requires an extension to view locally stored projects. Alternatively,
upload your RP file to <a href="https://share.axure.com">Axure Cloud</a> or use a different
browser.</p>
<h3 class="heading">
VIEW LOCAL PROJECTS IN CHROME</h3>
<div class="left">
<h3>
1. Install Extension from Chrome Store</h3>
<div class="buttonContainer">
<a class="button" href="https://chrome.google.com/webstore/detail/dogkpdfcklifaemcdfbildhcofnopogp"
target="_blank">Install Extension</a>
</div>
</div>
<div class="right">
<h3>
2. Open "More Tools > Extensions"</h3>
<img src="extensions.png" alt="extensions"/>
</div>
<div style="clear: both; height: 20px;">
&nbsp;</div>
<div class="left">
<h3>
3. View Axure RP Extension Details</h3>
<img src="details.png" alt="extension details"/>
</div>
<div class="right">
<h3>
4. Check "Allow access to file URLs"</h3>
<img src="allow-access.png" alt="allow access"/>
</div>
<div style="clear: both; height: 20px;">
&nbsp;</div>
<div class="left">
<h3>
5. Click the button below</h3>
<div class="buttonContainer">
<a class="button" href="../../start.html">View in Chrome</a>
</div>
</div>
<div style="clear: both; height: 20px;">
</div>
<h3 class="heading">
EXTENSION FAQ</h3>
<p>
<span class="faq">What is a Chrome Extension?</span> Extensions are downloadable
plug-ins for Google Chrome that modify the browser
and allow you additional capabilities.
</p>
<p style="margin-top: 25px;">
<span class="faq">Why do I need to install the extension?</span> Google requires
this extension to be installed to allow the viewing of local files in
Chrome
</p>
<p style="margin-top: 25px; margin-bottom: 25px;">
<span class="faq">Why does this extension require a high access level?</span> This
extension requires a high access level to allow the viewing of the file://
protocol. Axure does not track or access any of your information.
</p>
<h3 class="heading">
WE'RE HERE TO HELP</h3>
<p>
Need help or have any questions? Contact our support team at <a href="mailto:support@axure.com">
support@axure.com</a>.
</p>
<div style="clear: both; height: 20px;">
</div>
</div>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

View File

@@ -0,0 +1,154 @@
<html>
<head>
<title>Axure RP - Safari Local File Restrictions</title>
<style type="text/css">
*
{
font-family: Helvetica, Arial, sans-serif;
}
body
{
text-align: center;
background-color: #fafafa;
}
p
{
font-size: 14px;
line-height: 18px;
color: #333333;
}
div.container
{
width: 980px;
margin-left: auto;
margin-right: auto;
text-align: left;
}
a
{
text-decoration: none;
color: #009dda;
}
.button
{
background: #A502B3;
font: normal 16px Arial, sans-serif;
color: #FFFFFF;
padding: 10px 30px 10px 30px;
border: 2px solid #A502B3;
display: inline-block;
margin-top: 10px;
text-transform: uppercase;
font-size: 14px;
border-radius: 4px;
}
a:hover.button
{
border: 2px solid #A502B3;
color: #A502B3;
background-color: #FFFFFF;
}
div.left
{
width: 400px;
float: left;
margin-right: 80px;
}
div.right
{
width: 400px;
float: left;
}
div.buttonContainer
{
text-align: center;
}
h1
{
font-size: 36px;
color: #333333;
line-height: 50px;
margin-bottom: 20px;
font-weight: normal;
}
h2
{
font-size: 24px;
font-weight: normal;
color: #08639C;
text-align: center;
}
h3
{
font-size: 16px;
line-height: 24px;
color: #333333;
font-weight: normal;
}
.heading
{
border-bottom: 1px solid black;
height: 36px;
line-height: 36px;
font-size: 22px;
color: #000000;
}
span.faq
{
font-size: 16px;
font-weight: normal;
text-transform: uppercase;
color: #333333;
display: block;
}
</style>
</head>
<body>
<div class="container">
<br />
<br />
<img src="axure_logo.png" alt="axure" />
<br />
<h1>
SAFARI LOCAL FILE RESTRICTIONS</h1>
<p style="font-size: 16px; line-height: 24px; color: #666666; margin-top: 10px;">
To view locally stored projects in Safari, you will need to "disable local file restrictions". Alternatively,
you can upload your RP file to <a href="https://share.axure.com">Axure Cloud</a> or publish the local files to a web server.</p>
<h3 class="heading">
VIEW LOCAL PROJECTS IN SAFARI</h3>
<div class="">
<h3>
1. Open "Safari > Preferences > Advanced" from the top menu menu, and check the option to "Show Develop menu in menu bar"</h3>
<img src="safari_advanced.png" alt="advanced" />
</div>
<div style="clear: both; height: 20px;">
&nbsp;
</div>
<div class="">
<h3>
2. In the Develop menu that appears in the menu bar, click "Develop > Disable Local File Restrictions" to un-select the menu option</h3>
<img src="safari_restrictions.png" alt="extensions" />
</div>
<div style="clear: both; height: 20px;">
&nbsp;</div>
<div class="left">
<h3>
3. Click the button below
</h3>
<div class="buttonContainer">
<a class="button" href="../../start.html">View in Safari</a>
</div>
</div>
<div style="clear: both; height: 20px;">
</div>
<h3 class="heading">
We're Here to Help</h3>
<p>
Need help or have any questions? Drop us a line at <a href="mailto:support@axure.com">
support@axure.com</a>.
</p>
<div style="clear: both; height: 20px;">
</div>
</div>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 149 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 251 B

View File

@@ -0,0 +1,292 @@
/* so the window resize fires within a frame in IE7 */
html, body {
height: 100%;
}
.mobileFrameCursor div * {
cursor: inherit !important;
}
a {
color: inherit;
}
p {
margin: 0px;
text-rendering: optimizeLegibility;
font-feature-settings: "kern" 1;
-webkit-font-feature-settings: "kern";
-moz-font-feature-settings: "kern";
-moz-font-feature-settings: "kern=1";
font-kerning: normal;
}
ul {
margin:0px;
}
iframe {
background: #FFFFFF;
}
/* to match IE with C, FF */
input {
padding: 1px 0px 1px 0px;
box-sizing: border-box;
-moz-box-sizing: border-box;
}
input[type=text]::-ms-clear {
width: 0;
height: 0;
display: none;
}
textarea {
margin: 0px;
box-sizing: border-box;
-moz-box-sizing: border-box;
}
.focused:focus, .selectedFocused:focus {
outline: none;
}
div.intcases {
font-family: arial;
font-size: 12px;
text-align:left;
border:1px solid #AAA;
background:#FFF none repeat scroll 0% 0%;
z-index:9999;
visibility:hidden;
position:absolute;
padding: 0px;
border-radius: 3px;
white-space: nowrap;
}
div.intcaselink {
cursor: pointer;
padding: 3px 8px 3px 8px;
margin: 5px;
background:#EEE none repeat scroll 0% 0%;
border:1px solid #AAA;
border-radius: 3px;
}
div.refpageimage {
position: absolute;
left: 0px;
top: 0px;
font-size: 0px;
width: 16px;
height: 16px;
cursor: pointer;
background-image: url(images/newwindow.gif);
background-repeat: no-repeat;
}
div.annnoteimage {
position: absolute;
left: 0px;
top: 0px;
font-size: 0px;
/*width: 16px;
height: 12px;*/
cursor: help;
/*background-image: url(images/note.gif);*/
/*background-repeat: no-repeat;*/
width: 13px;
height: 12px;
padding-top: 1px;
text-align: center;
background-color: #138CDD;
-moz-box-shadow: 1px 1px 3px #aaa;
-webkit-box-shadow: 1px 1px 3px #aaa;
box-shadow: 1px 1px 3px #aaa;
}
div.annnoteline {
display: inline-block;
width: 9px;
height: 1px;
border-bottom: 1px solid white;
margin-top: 1px;
}
div.annnotelabel {
/*position: absolute;
left: 0px;
top: 0px;*/
font-family: Helvetica,Arial;
white-space: nowrap;
padding-top: 1px;
background-color: #fff849;
font-size: 10px;
font-weight: bold;
line-height: 14px;
margin-right: 3px;
padding: 0px 4px;
color: #000;
-moz-box-shadow: 1px 1px 3px #aaa;
-webkit-box-shadow: 1px 1px 3px #aaa;
box-shadow: 1px 1px 3px #aaa;
}
div.annnote {
display: flex;
position: absolute;
cursor: help;
line-height: 14px;
}
.annotation {
font-size: 12px;
padding-left: 2px;
margin-bottom: 5px;
}
.annotationName {
/*font-size: 13px;
font-weight: bold;
margin-bottom: 3px;
white-space: nowrap;*/
font-family: 'Trebuchet MS';
font-size: 14px;
font-weight: bold;
margin-bottom: 5px;
white-space: nowrap;
}
.annotationValue {
font-family: Arial, Helvetica, Sans-Serif;
font-size: 12px;
color: #4a4a4a;
line-height: 21px;
margin-bottom: 20px;
}
.noteLink {
text-decoration: inherit;
color: inherit;
}
.noteLink:hover {
background-color: white;
}
/* this is a fix for the issue where dialogs jump around and takes the text-align from the body */
.dialogFix {
position:absolute;
text-align:left;
border: 1px solid #8f949a;
}
@keyframes pulsate {
from {
box-shadow: 0 0 10px #15d6ba;
}
to {
box-shadow: 0 0 20px #15d6ba;
}
}
@-webkit-keyframes pulsate {
from {
-webkit-box-shadow: 0 0 10px #15d6ba;
box-shadow: 0 0 10px #15d6ba;
}
to {
-webkit-box-shadow: 0 0 20px #15d6ba;
box-shadow: 0 0 20px #15d6ba;
}
}
@-moz-keyframes pulsate {
from {
-moz-box-shadow: 0 0 10px #15d6ba;
box-shadow: 0 0 10px #15d6ba;
}
to {
-moz-box-shadow: 0 0 20px #15d6ba;
box-shadow: 0 0 20px #15d6ba;
}
}
.legacyPulsateBorder {
/*border: 5px solid #15d6ba;
margin: -5px;*/
-moz-box-shadow: 0 0 10px 3px #15d6ba;
box-shadow: 0 0 10px 3px #15d6ba;
}
.pulsateBorder {
animation-name: pulsate;
animation-timing-function: ease-in-out;
animation-duration: 0.9s;
animation-iteration-count: infinite;
animation-direction: alternate;
-webkit-animation-name: pulsate;
-webkit-animation-timing-function: ease-in-out;
-webkit-animation-duration: 0.9s;
-webkit-animation-iteration-count: infinite;
-webkit-animation-direction: alternate;
-moz-animation-name: pulsate;
-moz-animation-timing-function: ease-in-out;
-moz-animation-duration: 0.9s;
-moz-animation-iteration-count: infinite;
-moz-animation-direction: alternate;
}
.ax_default_hidden, .ax_default_unplaced{
display: none;
visibility: hidden;
}
.widgetNoteSelected {
-moz-box-shadow: 0 0 10px 3px #138CDD;
box-shadow: 0 0 10px 3px #138CDD;
/*-moz-box-shadow: 0 0 20px #3915d6;
box-shadow: 0 0 20px #3915d6;*/
/*border: 3px solid #3915d6;*/
/*margin: -3px;*/
}
.singleImg {
display: none;
visibility: hidden;
}
#ios-safari {
overflow: auto;
-webkit-overflow-scrolling: touch;
}
#ios-safari-html {
display: block;
overflow: auto;
-webkit-overflow-scrolling: touch;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
#ios-safari-fixed {
position: absolute;
pointer-events: none;
width: initial;
}
#ios-safari-fixed div {
pointer-events: auto;
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,25 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title></title>
</head>
<body>
<p>
<img border="0" src="note.gif" width="1" height="1">
<img border="0" src="newwindow.gif" width="1" height="1">
<img border="0" src="ui-bg_flat_0_aaaaaa_40x100.png" width="1" height="1">
<img border="0" src="ui-bg_glass_55_fbf9ee_1x400.png" width="1" height="1">
<img border="0" src="ui-bg_glass_65_ffffff_1x400.png" width="1" height="1">
<img border="0" src="ui-bg_glass_75_dadada_1x400.png" width="1" height="1">
<img border="0" src="ui-bg_glass_75_e6e6e6_1x400.png" width="1" height="1">
<img border="0" src="ui-bg_glass_75_ffffff_1x400.png" width="1" height="1">
<img border="0" src="ui-bg_highlight-soft_75_cccccc_1x100.png" width="1" height="1">
<img border="0" src="ui-bg_inset-soft_95_fef1ec_1x100.png" width="1" height="1">
<img border="0" src="ui-icons_222222_256x240.png" width="1" height="1">
<img border="0" src="ui-icons_2e83ff_256x240.png" width="1" height="1">
<img border="0" src="ui-icons_454545_256x240.png" width="1" height="1">
<img border="0" src="ui-icons_888888_256x240.png" width="1" height="1">
<img border="0" src="ui-icons_cd0a0a_256x240.png" width="1" height="1">
</p>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View File

@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="64px" height="64px" viewBox="0 0 64 64" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 50.2 (55047) - http://www.bohemiancoding.com/sketch -->
<title>touch_update</title>
<desc>Created with Sketch.</desc>
<defs>
<circle id="path-1" cx="859" cy="783" r="24"></circle>
<filter x="-26.0%" y="-26.0%" width="152.1%" height="152.1%" filterUnits="objectBoundingBox" id="filter-2">
<feMorphology radius="0.5" operator="dilate" in="SourceAlpha" result="shadowSpreadOuter1"></feMorphology>
<feOffset dx="0" dy="0" in="shadowSpreadOuter1" result="shadowOffsetOuter1"></feOffset>
<feGaussianBlur stdDeviation="4" in="shadowOffsetOuter1" result="shadowBlurOuter1"></feGaussianBlur>
<feComposite in="shadowBlurOuter1" in2="SourceAlpha" operator="out" result="shadowBlurOuter1"></feComposite>
<feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.5 0" type="matrix" in="shadowBlurOuter1"></feColorMatrix>
</filter>
<filter x="-41.7%" y="-41.7%" width="183.3%" height="183.3%" filterUnits="objectBoundingBox" id="filter-3">
<feGaussianBlur stdDeviation="7.5" in="SourceAlpha" result="shadowBlurInner1"></feGaussianBlur>
<feOffset dx="5" dy="8" in="shadowBlurInner1" result="shadowOffsetInner1"></feOffset>
<feComposite in="shadowOffsetInner1" in2="SourceAlpha" operator="arithmetic" k2="-1" k3="1" result="shadowInnerInner1"></feComposite>
<feColorMatrix values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.356034873 0" type="matrix" in="shadowInnerInner1"></feColorMatrix>
</filter>
</defs>
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Sitemap-expanded" transform="translate(-827.000000, -751.000000)" fill-rule="nonzero">
<g id="touch_update">
<use fill="black" fill-opacity="1" filter="url(#filter-2)" xlink:href="#path-1"></use>
<use fill-opacity="0.236894248" fill="#E4DEDE" fill-rule="evenodd" xlink:href="#path-1"></use>
<use fill="black" fill-opacity="1" filter="url(#filter-3)" xlink:href="#path-1"></use>
<use stroke-opacity="0.225798234" stroke="#CACACA" stroke-width="1" xlink:href="#path-1"></use>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 180 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 120 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 123 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

@@ -0,0 +1,412 @@
/*
* jQuery UI CSS Framework
* Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses.
*/
/* Layout helpers
----------------------------------*/
.ui-helper-hidden { display: none; }
.ui-helper-hidden-accessible { position: absolute; left: -99999999px; }
.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
.ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
.ui-helper-clearfix { display: inline-block; }
/* required comment for clearfix to work in Opera \*/
* html .ui-helper-clearfix { height:1%; }
.ui-helper-clearfix { display:block; }
/* end clearfix */
.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
/* Interaction Cues
----------------------------------*/
.ui-state-disabled { cursor: default !important; }
/* Icons
----------------------------------*/
/* states and images */
.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
/* Misc visuals
----------------------------------*/
/* Overlays */
.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }/* Accordion
----------------------------------*/
.ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; }
.ui-accordion .ui-accordion-li-fix { display: inline; }
.ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; }
.ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em 2.2em; }
.ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; }
.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; }
.ui-accordion .ui-accordion-content-active { display: block; }
/* Datepicker
----------------------------------*/
.ui-datepicker { width: 17em; padding: .2em .2em 0; }
.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; }
.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; }
.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; }
.ui-datepicker .ui-datepicker-prev { left:2px; }
.ui-datepicker .ui-datepicker-next { right:2px; }
.ui-datepicker .ui-datepicker-prev-hover { left:1px; }
.ui-datepicker .ui-datepicker-next-hover { right:1px; }
.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; }
.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; }
.ui-datepicker .ui-datepicker-title select { float:left; font-size:1em; margin:1px 0; }
.ui-datepicker select.ui-datepicker-month-year {width: 100%;}
.ui-datepicker select.ui-datepicker-month,
.ui-datepicker select.ui-datepicker-year { width: 49%;}
.ui-datepicker .ui-datepicker-title select.ui-datepicker-year { float: right; }
.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; }
.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; }
.ui-datepicker td { border: 0; padding: 1px; }
.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; }
.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; }
.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; }
.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; }
/* with multiple calendars */
.ui-datepicker.ui-datepicker-multi { width:auto; }
.ui-datepicker-multi .ui-datepicker-group { float:left; }
.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; }
.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; }
.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; }
.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; }
.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; }
.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; }
.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; }
.ui-datepicker-row-break { clear:both; width:100%; }
/* RTL support */
.ui-datepicker-rtl { direction: rtl; }
.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; }
.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; }
.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; }
.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; }
.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; }
.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; }
.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; }
.ui-datepicker-rtl .ui-datepicker-group { float:right; }
.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */
.ui-datepicker-cover {
display: none; /*sorry for IE5*/
display/**/: block; /*sorry for IE5*/
position: absolute; /*must have*/
z-index: -1; /*must have*/
filter: mask(); /*must have*/
top: -4px; /*must have*/
left: -4px; /*must have*/
width: 200px; /*must have*/
height: 200px; /*must have*/
}
/* Dialog
----------------------------------*/
.ui-dialog { position: relative; padding: 0px; width: 300px;}
.ui-dialog .ui-dialog-titlebar { padding: .3em .3em .1em .8em; font-size:.7em; position: relative; background-image: none; }
.ui-dialog .ui-dialog-title { float: left; margin: .1em 0 .2em;
font-family: 'Trebuchet MS';
font-size: 15px;
font-weight: normal;
color: #ffffff;}
.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .1em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; }
.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; }
.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { /*padding: 0;*/ }
.ui-dialog .ui-dialog-content { border: 0; padding: .5em .2em; background: none; overflow: auto; zoom: 1; background-color: #ffffff;}
.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; }
.ui-dialog .ui-dialog-buttonpane button { float: right; margin: .5em .4em .5em 0; cursor: pointer; padding: .2em .6em .3em .6em; line-height: 1.4em; width:auto; overflow:visible; }
.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; }
.ui-draggable .ui-dialog-titlebar { cursor: move; background-color: #8f949a; border-bottom: 1px solid #d9d9d9;}
/* Progressbar
----------------------------------*/
.ui-progressbar { height:2em; text-align: left; }
.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; }/* Resizable
----------------------------------*/
.ui-resizable { position: relative;}
.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block;}
.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; }
.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0px; }
.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0px; }
.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0px; height: 100%; }
.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0px; height: 100%; }
.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; }
.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; }
.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; }
.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/* Slider
----------------------------------*/
.ui-slider { position: relative; text-align: left; }
.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; }
.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; }
.ui-slider-horizontal { height: .8em; }
.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; }
.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; }
.ui-slider-horizontal .ui-slider-range-min { left: 0; }
.ui-slider-horizontal .ui-slider-range-max { right: 0; }
.ui-slider-vertical { width: .8em; height: 100px; }
.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; }
.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; }
.ui-slider-vertical .ui-slider-range-min { bottom: 0; }
.ui-slider-vertical .ui-slider-range-max { top: 0; }/* Tabs
----------------------------------*/
.ui-tabs { padding: .2em; zoom: 1; }
.ui-tabs .ui-tabs-nav { list-style: none; position: relative; padding: .2em .2em 0; }
.ui-tabs .ui-tabs-nav li { position: relative; float: left; border-bottom-width: 0 !important; margin: 0 .2em -1px 0; padding: 0; }
.ui-tabs .ui-tabs-nav li a { float: left; text-decoration: none; padding: .5em 1em; }
.ui-tabs .ui-tabs-nav li.ui-tabs-selected { padding-bottom: 1px; border-bottom-width: 0; }
.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; }
.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
.ui-tabs .ui-tabs-panel { padding: 1em 1.4em; display: block; border-width: 0; background: none; }
.ui-tabs .ui-tabs-hide { display: none !important; }
/*
* jQuery UI CSS Framework
* Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses.
* To view and modify this theme, visit http://jqueryui.com/themeroller/
*/
/* Component containers
----------------------------------*/
.ui-widget { font-family: Verdana,Arial,sans-serif/*{ffDefault}*/; font-size: 1.1em/*{fsDefault}*/; }
.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana,Arial,sans-serif/*{ffDefault}*/; font-size: 1em; }
.ui-widget-content { border: 1px solid #aaaaaa/*{borderColorContent}*/; background: #ffffff/*{bgColorContent}*/ url(images/ui-bg_glass_75_ffffff_1x400.png)/*{bgImgUrlContent}*/ 0/*{bgContentXPos}*/ 0/*{bgContentYPos}*/ repeat-x/*{bgContentRepeat}*/; color: #222222/*{fcContent}*/; }
.ui-widget-content a { /*color: #222222*//*{fcContent}*/; }
.ui-widget-header { border: none /*1px solid #aaaaaa*//*{borderColorHeader}*/; background: #D3D3D3/*{bgColorHeader}*/ url(images/ui-bg_highlight-soft_75_cccccc_1x100.png)/*{bgImgUrlHeader}*/ 0/*{bgHeaderXPos}*/ 50%/*{bgHeaderYPos}*/ repeat-x/*{bgHeaderRepeat}*/; color: #000000/*{fcHeader}*/; font-weight: bold; }
.ui-widget-header a { color: #222222/*{fcHeader}*/; }
/* Interaction states
----------------------------------*/
.ui-state-default, .ui-widget-content .ui-state-default { border: none /*1px solid #d3d3d3*//*{borderColorDefault}*/; /*background: #e6e6e6*//*{bgColorDefault}*/ /*url(images/ui-bg_glass_75_e6e6e6_1x400.png)*//*{bgImgUrlDefault}*/ /*0*//*{bgDefaultXPos}*/ /*50%*//*{bgDefaultYPos}*/ /*repeat-x*//*{bgDefaultRepeat}*/ font-weight: normal/*{fwDefault}*/; color: #555555/*{fcDefault}*/; outline: none; }
.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #555555/*{fcDefault}*/; text-decoration: none; outline: none; }
.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus { border: none /*1px solid #999999*//*{borderColorHover}*/; /*background: #dadada*//*{bgColorHover}*/ /*url(images/ui-bg_glass_75_dadada_1x400.png)*//*{bgImgUrlHover}*/ /*0*//*{bgHoverXPos}*/ /*50%*//*{bgHoverYPos}*/ /*repeat-x*//*{bgHoverRepeat}*/ font-weight: normal/*{fwDefault}*/; color: #212121/*{fcHover}*/; outline: none; }
.ui-state-hover a, .ui-state-hover a:hover { color: #212121/*{fcHover}*/; text-decoration: none; outline: none; }
.ui-state-active, .ui-widget-content .ui-state-active { border: 1px solid #aaaaaa/*{borderColorActive}*/; background: #ffffff/*{bgColorActive}*/ url(images/ui-bg_glass_65_ffffff_1x400.png)/*{bgImgUrlActive}*/ 0/*{bgActiveXPos}*/ 50%/*{bgActiveYPos}*/ repeat-x/*{bgActiveRepeat}*/; font-weight: normal/*{fwDefault}*/; color: #212121/*{fcActive}*/; outline: none; }
.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #212121/*{fcActive}*/; outline: none; text-decoration: none; }
/* Interaction Cues
----------------------------------*/
.ui-state-highlight, .ui-widget-content .ui-state-highlight {border: 1px solid #fcefa1/*{borderColorHighlight}*/; background: #fbf9ee/*{bgColorHighlight}*/ url(images/ui-bg_glass_55_fbf9ee_1x400.png)/*{bgImgUrlHighlight}*/ 0/*{bgHighlightXPos}*/ 50%/*{bgHighlightYPos}*/ repeat-x/*{bgHighlightRepeat}*/; color: #363636/*{fcHighlight}*/; }
.ui-state-highlight a, .ui-widget-content .ui-state-highlight a { color: #363636/*{fcHighlight}*/; }
.ui-state-error, .ui-widget-content .ui-state-error {border: 1px solid #cd0a0a/*{borderColorError}*/; background: #fef1ec/*{bgColorError}*/ url(images/ui-bg_inset-soft_95_fef1ec_1x100.png)/*{bgImgUrlError}*/ 0/*{bgErrorXPos}*/ 50%/*{bgErrorYPos}*/ repeat-x/*{bgErrorRepeat}*/; color: #cd0a0a/*{fcError}*/; }
.ui-state-error a, .ui-widget-content .ui-state-error a { color: #363636/*{fcError}*/; }
.ui-state-error-text, .ui-widget-content .ui-state-error-text { color: #cd0a0a/*{fcError}*/; }
.ui-state-disabled, .ui-widget-content .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; }
.ui-priority-primary, .ui-widget-content .ui-priority-primary { font-weight: bold; }
.ui-priority-secondary, .ui-widget-content .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; }
/* Icons
----------------------------------*/
/* states and images */
.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png)/*{iconsContent}*/; }
.ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png)/*{iconsContent}*/; }
.ui-widget-header .ui-icon {background-image: url(images/ui-icons_454545_256x240.png)/*{iconsHeader}*/; }
.ui-state-default .ui-icon { background-image: url(images/ui-icons_888888_256x240.png)/*{iconsDefault}*/; }
.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_222222_256x240.png)/*{iconsHover}*/; }
.ui-state-active .ui-icon {background-image: url(images/ui-icons_454545_256x240.png)/*{iconsActive}*/; }
.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_2e83ff_256x240.png)/*{iconsHighlight}*/; }
.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_cd0a0a_256x240.png)/*{iconsError}*/; }
/* positioning */
.ui-icon-carat-1-n { background-position: 0 0; }
.ui-icon-carat-1-ne { background-position: -16px 0; }
.ui-icon-carat-1-e { background-position: -32px 0; }
.ui-icon-carat-1-se { background-position: -48px 0; }
.ui-icon-carat-1-s { background-position: -64px 0; }
.ui-icon-carat-1-sw { background-position: -80px 0; }
.ui-icon-carat-1-w { background-position: -96px 0; }
.ui-icon-carat-1-nw { background-position: -112px 0; }
.ui-icon-carat-2-n-s { background-position: -128px 0; }
.ui-icon-carat-2-e-w { background-position: -144px 0; }
.ui-icon-triangle-1-n { background-position: 0 -16px; }
.ui-icon-triangle-1-ne { background-position: -16px -16px; }
.ui-icon-triangle-1-e { background-position: -32px -16px; }
.ui-icon-triangle-1-se { background-position: -48px -16px; }
.ui-icon-triangle-1-s { background-position: -64px -16px; }
.ui-icon-triangle-1-sw { background-position: -80px -16px; }
.ui-icon-triangle-1-w { background-position: -96px -16px; }
.ui-icon-triangle-1-nw { background-position: -112px -16px; }
.ui-icon-triangle-2-n-s { background-position: -128px -16px; }
.ui-icon-triangle-2-e-w { background-position: -144px -16px; }
.ui-icon-arrow-1-n { background-position: 0 -32px; }
.ui-icon-arrow-1-ne { background-position: -16px -32px; }
.ui-icon-arrow-1-e { background-position: -32px -32px; }
.ui-icon-arrow-1-se { background-position: -48px -32px; }
.ui-icon-arrow-1-s { background-position: -64px -32px; }
.ui-icon-arrow-1-sw { background-position: -80px -32px; }
.ui-icon-arrow-1-w { background-position: -96px -32px; }
.ui-icon-arrow-1-nw { background-position: -112px -32px; }
.ui-icon-arrow-2-n-s { background-position: -128px -32px; }
.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
.ui-icon-arrow-2-e-w { background-position: -160px -32px; }
.ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
.ui-icon-arrowstop-1-n { background-position: -192px -32px; }
.ui-icon-arrowstop-1-e { background-position: -208px -32px; }
.ui-icon-arrowstop-1-s { background-position: -224px -32px; }
.ui-icon-arrowstop-1-w { background-position: -240px -32px; }
.ui-icon-arrowthick-1-n { background-position: 0 -48px; }
.ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
.ui-icon-arrowthick-1-e { background-position: -32px -48px; }
.ui-icon-arrowthick-1-se { background-position: -48px -48px; }
.ui-icon-arrowthick-1-s { background-position: -64px -48px; }
.ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
.ui-icon-arrowthick-1-w { background-position: -96px -48px; }
.ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
.ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
.ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
.ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
.ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
.ui-icon-arrow-4 { background-position: 0 -80px; }
.ui-icon-arrow-4-diag { background-position: -16px -80px; }
.ui-icon-extlink { background-position: -32px -80px; }
.ui-icon-newwin { background-position: -48px -80px; }
.ui-icon-refresh { background-position: -64px -80px; }
.ui-icon-shuffle { background-position: -80px -80px; }
.ui-icon-transfer-e-w { background-position: -96px -80px; }
.ui-icon-transferthick-e-w { background-position: -112px -80px; }
.ui-icon-folder-collapsed { background-position: 0 -96px; }
.ui-icon-folder-open { background-position: -16px -96px; }
.ui-icon-document { background-position: -32px -96px; }
.ui-icon-document-b { background-position: -48px -96px; }
.ui-icon-note { background-position: -64px -96px; }
.ui-icon-mail-closed { background-position: -80px -96px; }
.ui-icon-mail-open { background-position: -96px -96px; }
.ui-icon-suitcase { background-position: -112px -96px; }
.ui-icon-comment { background-position: -128px -96px; }
.ui-icon-person { background-position: -144px -96px; }
.ui-icon-print { background-position: -160px -96px; }
.ui-icon-trash { background-position: -176px -96px; }
.ui-icon-locked { background-position: -192px -96px; }
.ui-icon-unlocked { background-position: -208px -96px; }
.ui-icon-bookmark { background-position: -224px -96px; }
.ui-icon-tag { background-position: -240px -96px; }
.ui-icon-home { background-position: 0 -112px; }
.ui-icon-flag { background-position: -16px -112px; }
.ui-icon-calendar { background-position: -32px -112px; }
.ui-icon-cart { background-position: -48px -112px; }
.ui-icon-pencil { background-position: -64px -112px; }
.ui-icon-clock { background-position: -80px -112px; }
.ui-icon-disk { background-position: -96px -112px; }
.ui-icon-calculator { background-position: -112px -112px; }
.ui-icon-zoomin { background-position: -128px -112px; }
.ui-icon-zoomout { background-position: -144px -112px; }
.ui-icon-search { background-position: -160px -112px; }
.ui-icon-wrench { background-position: -176px -112px; }
.ui-icon-gear { background-position: -192px -112px; }
.ui-icon-heart { background-position: -208px -112px; }
.ui-icon-star { background-position: -224px -112px; }
.ui-icon-link { background-position: -240px -112px; }
.ui-icon-cancel { background-position: 0 -128px; }
.ui-icon-plus { background-position: -16px -128px; }
.ui-icon-plusthick { background-position: -32px -128px; }
.ui-icon-minus { background-position: -48px -128px; }
.ui-icon-minusthick { background-position: -64px -128px; }
.ui-icon-close { background-position: -80px -128px; }
.ui-icon-closethick { background-position: -96px -128px; }
.ui-icon-key { background-position: -112px -128px; }
.ui-icon-lightbulb { background-position: -128px -128px; }
.ui-icon-scissors { background-position: -144px -128px; }
.ui-icon-clipboard { background-position: -160px -128px; }
.ui-icon-copy { background-position: -176px -128px; }
.ui-icon-contact { background-position: -192px -128px; }
.ui-icon-image { background-position: -208px -128px; }
.ui-icon-video { background-position: -224px -128px; }
.ui-icon-script { background-position: -240px -128px; }
.ui-icon-alert { background-position: 0 -144px; }
.ui-icon-info { background-position: -16px -144px; }
.ui-icon-notice { background-position: -32px -144px; }
.ui-icon-help { background-position: -48px -144px; }
.ui-icon-check { background-position: -64px -144px; }
.ui-icon-bullet { background-position: -80px -144px; }
.ui-icon-radio-off { background-position: -96px -144px; }
.ui-icon-radio-on { background-position: -112px -144px; }
.ui-icon-pin-w { background-position: -128px -144px; }
.ui-icon-pin-s { background-position: -144px -144px; }
.ui-icon-play { background-position: 0 -160px; }
.ui-icon-pause { background-position: -16px -160px; }
.ui-icon-seek-next { background-position: -32px -160px; }
.ui-icon-seek-prev { background-position: -48px -160px; }
.ui-icon-seek-end { background-position: -64px -160px; }
.ui-icon-seek-first { background-position: -80px -160px; }
.ui-icon-stop { background-position: -96px -160px; }
.ui-icon-eject { background-position: -112px -160px; }
.ui-icon-volume-off { background-position: -128px -160px; }
.ui-icon-volume-on { background-position: -144px -160px; }
.ui-icon-power { background-position: 0 -176px; }
.ui-icon-signal-diag { background-position: -16px -176px; }
.ui-icon-signal { background-position: -32px -176px; }
.ui-icon-battery-0 { background-position: -48px -176px; }
.ui-icon-battery-1 { background-position: -64px -176px; }
.ui-icon-battery-2 { background-position: -80px -176px; }
.ui-icon-battery-3 { background-position: -96px -176px; }
.ui-icon-circle-plus { background-position: 0 -192px; }
.ui-icon-circle-minus { background-position: -16px -192px; }
.ui-icon-circle-close { background-position: -32px -192px; }
.ui-icon-circle-triangle-e { background-position: -48px -192px; }
.ui-icon-circle-triangle-s { background-position: -64px -192px; }
.ui-icon-circle-triangle-w { background-position: -80px -192px; }
.ui-icon-circle-triangle-n { background-position: -96px -192px; }
.ui-icon-circle-arrow-e { background-position: -112px -192px; }
.ui-icon-circle-arrow-s { background-position: -128px -192px; }
.ui-icon-circle-arrow-w { background-position: -144px -192px; }
.ui-icon-circle-arrow-n { background-position: -160px -192px; }
.ui-icon-circle-zoomin { background-position: -176px -192px; }
.ui-icon-circle-zoomout { background-position: -192px -192px; }
.ui-icon-circle-check { background-position: -208px -192px; }
.ui-icon-circlesmall-plus { background-position: 0 -208px; }
.ui-icon-circlesmall-minus { background-position: -16px -208px; }
.ui-icon-circlesmall-close { background-position: -32px -208px; }
.ui-icon-squaresmall-plus { background-position: -48px -208px; }
.ui-icon-squaresmall-minus { background-position: -64px -208px; }
.ui-icon-squaresmall-close { background-position: -80px -208px; }
.ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
.ui-icon-grip-solid-vertical { background-position: -32px -224px; }
.ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
.ui-icon-grip-diagonal-se { background-position: -80px -224px; }
/* Misc visuals
----------------------------------*/
/* Corner radius */
.ui-corner-tl { -moz-border-radius-topleft: 4px/*{cornerRadius}*/; -webkit-border-top-left-radius: 4px/*{cornerRadius}*/; }
.ui-corner-tr { -moz-border-radius-topright: 4px/*{cornerRadius}*/; -webkit-border-top-right-radius: 4px/*{cornerRadius}*/; }
.ui-corner-bl { -moz-border-radius-bottomleft: 4px/*{cornerRadius}*/; -webkit-border-bottom-left-radius: 4px/*{cornerRadius}*/; }
.ui-corner-br { -moz-border-radius-bottomright: 4px/*{cornerRadius}*/; -webkit-border-bottom-right-radius: 4px/*{cornerRadius}*/; }
.ui-corner-top { -moz-border-radius-topleft: 4px/*{cornerRadius}*/; -webkit-border-top-left-radius: 4px/*{cornerRadius}*/; -moz-border-radius-topright: 4px/*{cornerRadius}*/; -webkit-border-top-right-radius: 4px/*{cornerRadius}*/; }
.ui-corner-bottom { -moz-border-radius-bottomleft: 4px/*{cornerRadius}*/; -webkit-border-bottom-left-radius: 4px/*{cornerRadius}*/; -moz-border-radius-bottomright: 4px/*{cornerRadius}*/; -webkit-border-bottom-right-radius: 4px/*{cornerRadius}*/; }
.ui-corner-right { -moz-border-radius-topright: 4px/*{cornerRadius}*/; -webkit-border-top-right-radius: 4px/*{cornerRadius}*/; -moz-border-radius-bottomright: 4px/*{cornerRadius}*/; -webkit-border-bottom-right-radius: 4px/*{cornerRadius}*/; }
.ui-corner-left { -moz-border-radius-topleft: 4px/*{cornerRadius}*/; -webkit-border-top-left-radius: 4px/*{cornerRadius}*/; -moz-border-radius-bottomleft: 4px/*{cornerRadius}*/; -webkit-border-bottom-left-radius: 4px/*{cornerRadius}*/; }
.ui-corner-all { -moz-border-radius: 0px/*{cornerRadius}*/; -webkit-border-radius: 0px/*{cornerRadius}*/; }
/* Overlays */
.ui-widget-overlay { background: #aaaaaa/*{bgColorOverlay}*/ none/*{bgImgUrlOverlay}*/ 0/*{bgOverlayXPos}*/ 0/*{bgOverlayYPos}*/ repeat-x/*{bgOverlayRepeat}*/; opacity: .3;filter:Alpha(Opacity=30)/*{opacityOverlay}*/; }
.ui-widget-shadow { margin: -4px/*{offsetTopShadow}*/ 0 0 -4px/*{offsetLeftShadow}*/; padding: 4px/*{thicknessShadow}*/; background: #aaaaaa/*{bgColorShadow}*/ none/*{bgImgUrlShadow}*/ 0/*{bgShadowXPos}*/ 0/*{bgShadowYPos}*/ repeat-x/*{bgShadowRepeat}*/; opacity: .35;filter:Alpha(Opacity=35)/*{opacityShadow}*/; -moz-border-radius: 4px/*{cornerRadiusShadow}*/; -webkit-border-radius: 4px/*{cornerRadiusShadow}*/; }

View File

@@ -0,0 +1,12 @@
@font-face {
font-family: 'Source Sans Pro';
font-style: normal;
font-weight: 400;
src: local('Source Sans Pro Regular'), local('SourceSansPro-Regular'), url('previewfonts/SourceSansPro-Regular.woff2') format('woff2'), url('previewfonts/SourceSansPro-Regular.woff') format('woff');
}
@font-face {
font-family: 'Source Sans Pro Semibold';
font-style: normal;
font-weight: 400;
src: local('Source Sans Pro Semibold'), local('SourceSansPro-Semibold'), url('previewfonts/SourceSansPro-Semibold.woff2') format('woff2'), url('previewfonts/SourceSansPro-Semibold.woff') format('woff');
}

View File

@@ -0,0 +1,24 @@
html,body,div,span,
applet,object,iframe,
h1,h2,h3,h4,h5,h6,p,blockquote,pre,
a,abbr,acronym,address,big,cite,code,
del,dfn,em,font,img,ins,kbd,q,s,samp,
small,strike,strong,sub,sup,tt,var,
dd,dl,dt,li,ol,ul,
fieldset,form,label,legend,
table,caption,tbody,tfoot,thead,tr,th,td {
margin: 0;
padding: 0;
border: 0;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
ol,ul {
list-style: none;
}
q:before,q:after,
blockquote:before,blockquote:after {
content: "";
}

View File

@@ -0,0 +1,60 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title></title>
<link type="text/css" href="css/default.css" rel="Stylesheet" />
<script type="text/javascript" src="scripts/jquery-3.2.1.min.js"></script>
<script type="text/javascript" src="scripts/messagecenter.js"></script>
<script type="text/javascript">
<!--
$(document).ready(function () {
$axure.messageCenter.addMessageListener(messageCenter_message);
function messageCenter_message(message, data) {
if(message == 'collapseFrameOnLoad') {
setTimeout(function() {
$('#maximizePanel').animate({
left:'-' + maxPanelWidth + 'px'
}, 300);
}, 2000);
}
}
$axure.messageCenter.postMessage('getCollapseFrameOnLoad');
if(MOBILE_DEVICE) {
$('#maximizePanel').height('45px');
}
var maxPanelWidth = $('#maximizePanel').width();
$('#maximizePanel').click(function () {
$(this).removeClass('maximizePanelOver');
$axure.messageCenter.postMessage('expandFrame');
});
if(!MOBILE_DEVICE) {
$('#maximizePanel').mouseenter(function() {
$(this).addClass('maximizePanelOver');
});
$('#maximizePanel').mouseleave(function() {
if($(this).hasClass('maximizePanelOver')) {
$(this).animate({
left:'-' + maxPanelWidth + 'px'
}, 300);
}
$(this).removeClass('maximizePanelOver');
});
$('#maximizePanelOver').mouseenter(function() {
$('#maximizePanel').animate({
left:'0px'
}, 100);
});
}
});
--></script>
</head>
<body style="background-color: transparent;">
<div id="maximizePanelOver">
<div id="maximizePanel" class="maximizePanel" title="Expand">
</div>
</div>
</body>
</html>

View File

@@ -0,0 +1 @@
<svg height="14" viewBox="0 0 50 14" width="50" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><g fill="#3f4040"><path d="m6.7827 7.0792v2.741c-.866.119-2.101.146-2.521.146-1.998 0-2.09-.542-2.09-1.581 0-1.013.345-1.306 1.541-1.306zm-2.619-6.916c-.624 0-1.476.017-2.547.147l-.056.012c-.367.105-.561.358-.561.731v.432c0 .445.287.732.733.732h2.431c1.885 0 2.619.476 2.619 1.698v1.13h-3.07c-2.568 0-3.713 1.03-3.713 3.34 0 2.568 1.184 3.615 4.085 3.615 1.159 0 3.295-.091 4.09-.334.504-.14.76-.472.76-.987v-6.881c0-2.446-1.561-3.635-4.771-3.635z" transform="translate(0 .8362)"/><path d="m8.6973.3014h-.686c-.425 0-.733.308-.733.732v8.913h-2.717c-1.659 0-2.345 0-2.345-2.796v-6.117c0-.424-.309-.732-.733-.732h-.667c-.429 0-.752.315-.752.732v6.117c0 4.1 1.56 4.85 4.633 4.85 1.101 0 2.608 0 4.057-.205l.039-.008c.526-.132.636-.473.636-.736v-10.018c0-.424-.308-.732-.732-.732" transform="translate(22 .8362)"/><path d="m5.2529.3297-.062-.017c-.411-.086-1.525-.149-2.076-.149-2.549 0-3.085 1.348-3.085 2.478v8.527c0 .425.308.733.733.733h.686c.425 0 .733-.308.733-.733v-8.371c0-.272 0-.58 1.11-.58l1.688-.003c.206.026.402-.032.553-.161.165-.14.256-.342.256-.569v-.431c0-.341-.201-.611-.536-.724" transform="translate(34 .8362)"/><path d="m5.4444.1637c-2.024 0-3.174.399-3.843 1.335-.691.966-.83 2.466-.83 4.574 0 4.099.675 5.927 4.673 5.927.472 0 2.083-.009 3.032-.125.443-.073.641-.417.641-.725v-.451c0-.429-.323-.752-.752-.752h-2.921c-2.113 0-2.466-.47-2.521-3.345v-.958c.018-2.946.372-3.426 2.521-3.426 1.957 0 2.317.406 2.393 2.867h-3.282v2.073h4.457c.451 0 .988-.161.988-.929v-.576c-.063-4.207-1.127-5.489-4.556-5.489" transform="translate(40 .8362)"/></g><path d="m19.9341 1.496c-.111-.237-.346-.378-.629-.378h-.882c-.305 0-.543.128-.661.349l-1.362 1.994 1.314 1.802 2.101-3.022c.269-.328.173-.63.119-.745" fill="#74bb11"/><path d="m13.0293 1.4428-.003-.004c-.159-.213-.382-.321-.661-.321h-.862c-.274 0-.498.128-.618.351-.121.227-.098.498.068.746l3.139 4.361-3.621 5.062c-.157.237-.178.503-.056.73.119.223.344.351.617.351h.882c.274 0 .522-.144.636-.36l4.172-5.762z" fill="#009cd9"/><path d="m20.3711 11.6977-2.687-3.699-1.296 1.793 2.109 2.822.086.038c.105.045.206.067.31.067h.863c.257 0 .476-.117.601-.32.128-.207.134-.462.014-.701" fill="#eb2084"/></g></svg>

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="52px" height="12px" viewBox="0 0 52 12" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 50.2 (55047) - http://www.bohemiancoding.com/sketch -->
<title>axure_logo</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="Symbols" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="updated_header-copy" transform="translate(-1371.000000, -12.000000)" fill="#3D4557">
<g id="axure_logo" transform="translate(1371.000000, 12.000000)">
<path d="M23.6337569,0.211361346 L19.4142734,6.12413879 C20.5929844,7.76544547 22.4073623,10.3236224 23.4927644,11.7946181 L20.5223167,11.7946181 L17.9762186,8.20017753 C17.1271762,9.43098196 16.2788199,10.5887458 15.4297775,11.7946181 L12.5066702,11.7946181 L16.5141504,6.12413879 C15.1944469,4.24193858 13.6623971,2.1427235 12.3420075,0.211361346 L15.2884419,0.211361346 L17.9762186,4.04915352 L20.6633092,0.211361346 L23.6337569,0.211361346 Z" id="Fill-5-Copy-124"></path>
<path d="M11.6136895,6.03116989 L11.6136895,11.8575336 L9.24336066,11.8575336 L9.24336066,10.4558287 C8.49296706,11.4226674 7.06182513,12.0035446 5.7952372,12.0035446 C2.6052109,12.0035446 0,9.31940634 0,6.03116989 C0,2.74293344 2.6052109,0.0591470426 5.7952372,0.0591470426 C7.06182513,0.0591470426 8.49296706,0.638265082 9.24336066,1.60580737 L9.24336066,0.228027151 L11.6136895,0.228027151 L11.6136895,6.03116989 L11.6136895,6.03116989 Z M5.7952372,9.56146783 C7.69648468,9.56146783 9.24336066,7.98841998 9.24336066,6.03116989 C9.24336066,4.07216063 7.69648468,2.50052012 5.7952372,2.50052012 C3.89467252,2.50052012 2.34745514,4.07216063 2.34745514,6.03116989 C2.34745514,7.98841998 3.89467252,9.56146783 5.7952372,9.56146783 L5.7952372,9.56146783 Z" id="Fill-1-Copy-126"></path>
<path d="M33.9017123,11.8397627 L31.548487,11.8397627 L31.548487,10.8706411 C31.0307226,11.6705454 29.8537675,12.0086274 29.006579,12.0086274 C25.8999928,12.0086274 24.0885024,9.73230222 24.0885024,6.9218849 L24.0885024,0.211361346 L26.4413853,0.211361346 L26.4413853,6.9218849 C26.4413853,8.39971598 27.5477984,9.56237985 29.006579,9.56237985 C30.39516,9.56237985 31.4776026,8.4233359 31.548487,6.99485986 L31.548487,0.211361346 L33.9017123,0.211361346 L33.9017123,11.8397627" id="Fill-2-Copy-128"></path>
<path d="M37.4691032,5.23094818 L37.4691032,11.7946181 L35.1006626,11.7946181 L35.1006626,0.211361346 L37.4691032,0.211361346 L37.4691032,1.27329157 C37.8195915,0.596591985 39.2986725,0.211361346 40.307478,0.211361346 L40.7524991,0.211361346 L40.7524991,2.67269366 L40.307478,2.67269366 C39.2747833,2.67269366 37.4691032,3.1548465 37.4691032,5.23094818" id="Fill-3-Copy-125"></path>
<path d="M50.9313232,9.28841829 C49.5903307,11.130254 47.7551081,11.8564131 46.1557058,11.8564131 C43.004476,11.8564131 40.4405722,9.21685989 40.4405722,5.9706465 C40.4405722,2.6997578 43.004476,0.0591470426 46.1557058,0.0591470426 C49.8254664,0.0591470426 52.6002052,3.64482221 51.7777435,7.32743609 L42.9805175,7.32743609 C43.404241,8.63452255 44.8150555,9.60390976 46.1557058,9.60390976 C47.1670976,9.60390976 47.7082178,9.26480049 48.3208714,8.73181378 L50.9313232,9.28841829 L50.9313232,9.28841829 Z M42.910011,4.97693648 L49.3794957,4.97693648 C48.9554299,3.57220629 47.6616699,2.48155755 46.1557058,2.48155755 C44.6976588,2.48155755 43.3806247,3.6201469 42.910011,4.97693648 L42.910011,4.97693648 Z" id="Fill-4-Copy-124"></path>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.5 KiB

View File

@@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" width="10" height="5" viewBox="0 0 10 5">
<path fill="#666" fill-rule="evenodd" d="M10 0L5 5 0 0h2l3 3 3-3z"/>
</svg>

After

Width:  |  Height:  |  Size: 162 B

View File

@@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" width="10" height="5" viewBox="0 0 10 5">
<path fill="#008DCB" fill-rule="evenodd" d="M10 0L5 5 0 0h2l3 3 3-3z"/>
</svg>

After

Width:  |  Height:  |  Size: 164 B

View File

@@ -0,0 +1,6 @@
<svg xmlns="http://www.w3.org/2000/svg" width="9" height="8" viewBox="0 0 9 8">
<g fill="#666" fill-rule="evenodd">
<path d="M7.682.11l.707.708-7.071 7.071-.707-.707z"/>
<path d="M8.39 7.182l-.708.707L.611.818l.707-.707z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 260 B

View File

@@ -0,0 +1,6 @@
<svg xmlns="http://www.w3.org/2000/svg" width="9" height="9" viewBox="0 0 9 9">
<g fill="#6D6D6D" fill-rule="evenodd">
<path d="M7.018-.053l1.178 1.178-7.07 7.071-1.18-1.178z"/>
<path d="M1.125-.053l7.07 7.07-1.178 1.18-7.071-7.072z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 272 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 B

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="58" height="2" viewBox="0 0 58 2" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">
<defs>
<path id="path-1" d="M245.5,521 L305.5,521" stroke-linejoin="round" stroke="#bababa" stroke-dasharray="1 8" stroke-width="2" stroke-linecap="round"/>
</defs>
<g id="Axshare---Web-View" fill="none" fill-rule="evenodd" sketch:type="MSPage">
<g id="Share-Page-Notes-Copy" sketch:type="MSArtboardGroup" transform="translate(-244.000000, -520.000000)">
<g id="divider">
<use xlink:href="#path-1"/>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 691 B

View File

@@ -0,0 +1,6 @@
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19">
<g fill="#FFF" fill-rule="nonzero">
<path d="M16.305 18.94H6.547a.714.714 0 0 1-.717-.712v-3.344c0-.393.321-.712.717-.712.395 0 .716.319.716.712v2.632h8.325V1.484H7.263v2.632c0 .393-.32.712-.716.712a.714.714 0 0 1-.717-.712V.772c0-.394.321-.713.717-.713h9.758c.395 0 .716.32.716.713v17.456c0 .394-.32.713-.716.713z"/>
<path d="M.363 9.01l3.29-3.476a.719.719 0 0 1 1.217.277.71.71 0 0 1-.174.699L2.548 8.787h9.072c.396 0 .717.32.717.713 0 .394-.321.713-.717.713H2.548l2.148 2.277a.71.71 0 0 1-.353 1.192.719.719 0 0 1-.69-.216L.363 9.99a.71.71 0 0 1 0-.978z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 680 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

View File

@@ -0,0 +1,7 @@
<svg xmlns="http://www.w3.org/2000/svg" width="3" height="12" viewBox="0 0 3 12">
<g fill="#6D6D6D" fill-rule="evenodd">
<circle cx="1.5" cy="10.5" r="1.5"/>
<circle cx="1.5" cy="1.5" r="1.5"/>
<circle cx="1.5" cy="6" r="1.5"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 272 B

View File

@@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" width="10" height="8" viewBox="0 0 10 8">
<path fill="#FFF" fill-rule="evenodd" d="M8.404 0L10 1.548 3.865 7.5 0 3.75l1.596-1.548 2.27 2.202L8.403 0z"/>
</svg>

After

Width:  |  Height:  |  Size: 204 B

View File

@@ -0,0 +1,7 @@
<svg xmlns="http://www.w3.org/2000/svg" width="3" height="12" viewBox="0 0 3 12">
<g fill="#008DCB" fill-rule="evenodd">
<circle cx="1.5" cy="10.5" r="1.5"/>
<circle cx="1.5" cy="1.5" r="1.5"/>
<circle cx="1.5" cy="6" r="1.5"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 272 B

View File

@@ -0,0 +1,5 @@
<svg xmlns="http://www.w3.org/2000/svg" width="23" height="20" viewBox="0 0 23 20">
<g fill="#FFF" fill-rule="nonzero">
<path d="M16.097 3.636H14.73v1.48h1.367c2.797 0 5.065 2.32 5.065 5.183 0 2.861-2.268 5.181-5.065 5.181h-3.041l1.647-2a.753.753 0 0 0-.087-1.045.713.713 0 0 0-1.02.09l-2.573 3.13a.753.753 0 0 0 0 .955l2.573 3.127a.715.715 0 0 0 1.234-.226.754.754 0 0 0-.127-.73l-1.5-1.82h2.894c3.596 0 6.512-2.983 6.512-6.662 0-3.68-2.916-6.663-6.512-6.663zM0 9.739c0 3.658 2.867 6.625 6.403 6.625h1.345V14.89H6.403c-2.75 0-4.98-2.307-4.98-5.152 0-2.846 2.23-5.153 4.98-5.153h2.66L7.512 6.487a.754.754 0 0 0 .085 1.038c.3.262.75.223 1.003-.088l2.538-3.114a.756.756 0 0 0 0-.95L8.607.266A.702.702 0 0 0 7.934.01a.722.722 0 0 0-.548.475.76.76 0 0 0 .124.728l1.546 1.902H6.403C2.868 3.116.001 6.08 0 9.739z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 838 B

View File

@@ -0,0 +1,5 @@
<svg xmlns="http://www.w3.org/2000/svg" width="11" height="11" viewBox="0 0 11 11">
<g fill="#ACACAC" fill-rule="evenodd">
<path d="M8.104 9.956l1.389-1.439.72.695-1.39 1.439zM5.276 10.005L9.444 5.69l.719.695L5.995 10.7zM2.448 10.055L9.394 2.86l.72.695-6.947 7.193zM.314 9.385L8.65.753l.72.694-8.336 8.632z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 338 B

View File

@@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" width="22" height="18" viewBox="0 0 22 18">
<path fill="#008FE0" fill-rule="nonzero" d="M21.6 4.89V16.8c0 .66-.54 1.2-1.2 1.2H2.73c-.66 0-1.2-.54-1.2-1.2 0-.66.54-1.2 1.2-1.2H19.2V6H4.11l1.65 1.68c.48.48.48 1.26 0 1.74-.24.24-.54.36-.84.36-.3 0-.6-.12-.84-.36L.36 5.73C.12 5.49 0 5.19 0 4.89c0-.33.12-.63.36-.84L4.08.36c.48-.48 1.23-.48 1.71 0s.45 1.2 0 1.68L4.11 3.6H20.4c.66 0 1.2.63 1.2 1.29z"/>
</svg>

After

Width:  |  Height:  |  Size: 450 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 B

View File

@@ -0,0 +1,6 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="10" viewBox="0 0 16 10">
<g fill="#4A4A4A" fill-rule="nonzero">
<path d="M.05 3.8h.833V.917H14.45v8.166H9.217v.834h6.066V.083H.05z"/>
<path d="M.05 9.917h8.217v-5.15H.05v5.15zM.883 5.6h6.55v3.483H.883V5.6z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 304 B

View File

@@ -0,0 +1,24 @@
<html>
<head>
<title></title>
</head>
<body>
<script language="javascript">
function getUrl() {
var query = window.location.hash.substring(1);
var vars = query.split("&&&");
for (var i=0;i<vars.length;i++) {
var url = vars[i];
return decodeURI(url).replace("html%23","html#");
}
}
var rel = '../';
var url = getUrl();
if (url.indexOf(":") > 0 && url.indexOf(":") < 10) rel = '';
self.location.href = rel + url;
</script>
</body>
</html>

View File

@@ -0,0 +1,688 @@
$axure.internal(function($ax) {
$ax.adaptive = {};
$axure.utils.makeBindable($ax.adaptive, ["viewChanged"]);
var _auto = true;
var _autoIsHandledBySidebar = false;
var _views;
var _idToView;
var _enabledViews = [];
var _initialViewToLoad;
var _initialViewSizeToLoad;
var _loadFinished = false;
$ax.adaptive.loadFinished = function() {
if(_loadFinished) return;
_loadFinished = true;
if($ax.adaptive.currentViewId) $ax.viewChangePageAndMasters();
else $ax.postAdaptiveViewChanged();
};
var _handleResize = function(forceSwitchTo) {
if(!_auto) return;
if(_auto && _autoIsHandledBySidebar && !forceSwitchTo) return;
var $window = $(window);
var height = $window.height();
var width = $window.width();
var toView = _getAdaptiveView(width, height);
var toViewId = toView && toView.id;
_switchView(toViewId, forceSwitchTo);
};
var _setAuto = $ax.adaptive.setAuto = function(val) {
if(_auto != val) {
_auto = Boolean(val);
}
};
var _setLineImage = function(id, imageUrl) {
$jobj(id).attr('src', imageUrl);
};
var _switchView = function (viewId, forceSwitchTo) {
//if(!$ax.pageData.isAdaptiveEnabled) return;
var previousViewId = $ax.adaptive.currentViewId;
if(typeof previousViewId == 'undefined') previousViewId = '';
if(typeof viewId == 'undefined') viewId = '';
if (viewId == previousViewId) {
if(forceSwitchTo) $ax.postAdaptiveViewChanged(forceSwitchTo);
return;
}
$ax('*').each(function(obj, elementId) {
if (!$ax.public.fn.IsTreeNodeObject(obj.type)) return;
if(!obj.hasOwnProperty('isExpanded')) return;
var query = $ax('#' + elementId);
var defaultExpanded = obj.isExpanded;
query.expanded(defaultExpanded);
});
// reset all the inline positioning from move and rotate actions including size and transformation
$axure('*').each(function (diagramObject, elementId) {
if(diagramObject.isContained) return;
if($ax.getParentRepeaterFromElementIdExcludeSelf(elementId)) return;
var element = document.getElementById(elementId);
if(element) {
var resetCss = {
top: "", left: "", width: "", height: "", opacity: "",
transform: "", webkitTransform: "", MozTransform: "", msTransform: "", OTransform: ""
};
var query = $(element);
query.css(resetCss);
var isPanel = $ax.public.fn.IsDynamicPanel(diagramObject.type);
if(!isPanel || diagramObject.fitToContent) { //keeps size on the panel states when switching adaptive views to optimize fit to panel
if(diagramObject.fitToContent) $ax.dynamicPanelManager.setFitToContentCss(elementId, true);
var children = query.children();
if(children.length) children.css(resetCss);
}
$ax.dynamicPanelManager.resetFixedPanel(diagramObject, element);
$ax.dynamicPanelManager.resetAdaptivePercentPanel(diagramObject, element);
}
});
$ax.adaptive.currentViewId = viewId; // we need to set this so the enabled and selected styles will apply properly
if(previousViewId) {
$ax.style.clearAdaptiveStyles();
$('*').removeClass(previousViewId);
} else {
$ax.style.reselectElements();
}
$axure('*').each(function (obj, elementId) {
if($ax.getParentRepeaterFromElementIdExcludeSelf(elementId)) return;
$ax.style.updateElementIdImageStyle(elementId); // When image override exists, fix styling/borders
});
//$ax.style.startSuspendTextAlignment();
// reset all the images only if we're going back to the default view
if(!viewId) {
$axure('*').each(function (diagramObject, elementId) {
if($ax.getParentRepeaterFromElementIdExcludeSelf(elementId)) return;
$ax.placeholderManager.refreshPlaceholder(elementId);
var images = diagramObject.images;
if(diagramObject.type == 'horizontalLine' || diagramObject.type == 'verticalLine') {
var startImg = images['start~'];
_setLineImage(elementId + "_start", startImg);
var endImg = images['end~'];
_setLineImage(elementId + "_end", endImg);
var lineImg = images['line~'];
_setLineImage(elementId + "_line", lineImg);
} else if(diagramObject.type == $ax.constants.CONNECTOR_TYPE) {
_setAdaptiveConnectorImages(elementId, images, '');
} else if(images) {
if (diagramObject.generateCompound) {
if($ax.style.IsWidgetDisabled(elementId)) {
disabledImage = _getImageWithTag(images, 'disabled~');
if(disabledImage) $ax.style.applyImage(elementId, disabledImage, 'disabled');
return;
}
if($ax.style.IsWidgetSelected(elementId)) {
selectedImage = _getImageWithTag(images, 'selected~');
if(selectedImage) $ax.style.applyImage(elementId, selectedImage, 'selected');
return;
}
$ax.style.applyImage(elementId, _getImageWithTag(images, 'normal~'), 'normal');
} else {
if ($ax.style.IsWidgetDisabled(elementId)) {
var disabledImage = _matchImage(elementId, images, [], 'disabled', true);
if (disabledImage) $ax.style.applyImage(elementId, disabledImage, 'disabled');
return;
}
if ($ax.style.IsWidgetSelected(elementId)) {
var selectedImage = _matchImage(elementId, images, [], 'selected', true);
if (selectedImage) $ax.style.applyImage(elementId, selectedImage, 'selected');
return;
}
var normalImage = _matchImage(elementId, images, [], 'normal', true);
$ax.style.applyImage(elementId, normalImage, 'normal');
}
}
//align all text
var child = $jobj(elementId).children('.text');
if(child.length) $ax.style.transformTextWithVerticalAlignment(child[0].id, function() { });
});
// we have to reset visibility if we aren't applying a new view
$ax.visibility.resetLimboAndHiddenToDefaults();
$ax.visibility.clearMovedAndResized();
$ax.repeater.refreshAllRepeaters();
$ax.dynamicPanelManager.updateParentsOfNonDefaultFitPanels();
$ax.dynamicPanelManager.updatePercentPanelCache($ax('*'));
} else {
$ax.visibility.clearLimboAndHidden();
$ax.visibility.clearMovedAndResized();
_applyView(viewId);
$ax.repeater.refreshAllRepeaters();
$ax.dynamicPanelManager.updateAllLayerSizeCaches();
$ax.dynamicPanelManager.updateParentsOfNonDefaultFitPanels();
}
$ax.annotation.updateAllFootnotes();
//$ax.style.resumeSuspendTextAlignment();
$ax.adaptive.triggerEvent('viewChanged', {});
if(_loadFinished) $ax.viewChangePageAndMasters(forceSwitchTo);
};
var _getImageWithTag = function(image, tag) {
var flattened = {};
for (var component in image) {
var componentImage = image[component][tag];
if(componentImage) flattened[component] = componentImage;
}
return flattened;
}
// gets the inheritance chain of a particular view.
var _getAdaptiveIdChain = $ax.adaptive.getAdaptiveIdChain = function(viewId) {
if(!viewId) return [];
var view = _idToView[viewId];
var chain = [];
var current = view;
while(current) {
chain[chain.length] = current.id;
current = _idToView[current.baseViewId];
}
return chain.reverse();
};
var _getMasterAdaptiveIdChain = $ax.adaptive.getMasterAdaptiveIdChain = function (masterId, viewId) {
if (!viewId) return [];
var master = $ax.pageData.masters[masterId];
var masterViews = master.adaptiveViews;
var idToMasterView = {};
if (masterViews && masterViews.length > 0) {
for (var i = 0; i < masterViews.length; i++) {
var view = masterViews[i];
idToMasterView[view.id] = view;
}
}
if (!idToMasterView) return [];
var view = idToMasterView[viewId];
var chain = [];
var current = view;
while (current) {
chain[chain.length] = current.id;
current = idToMasterView[current.baseViewId];
}
return chain.reverse();
};
var _getPageStyle = $ax.adaptive.getPageStyle = function() {
var currentViewId = $ax.adaptive.currentViewId;
var adaptiveChain = _getAdaptiveIdChain(currentViewId);
var currentStyle = $.extend({}, $ax.pageData.page.style);
for(var i = 0; i < adaptiveChain.length; i++) {
var viewId = adaptiveChain[i];
$.extend(currentStyle, $ax.pageData.page.adaptiveStyles[viewId]);
}
return currentStyle;
};
var _setAdaptiveLineImages = function(elementId, images, viewIdChain) {
for(var i = viewIdChain.length - 1; i >= 0; i--) {
var viewId = viewIdChain[i];
var startImg = images['start~' + viewId];
if(startImg) {
_setLineImage(elementId + "_start", startImg);
var endImg = images['end~' + viewId];
_setLineImage(elementId + "_end", endImg);
var lineImg = images['line~' + viewId];
_setLineImage(elementId + "_line", lineImg);
break;
}
}
};
var _setAdaptiveConnectorImages = function (elementId, images, view) {
var conn = $jobj(elementId);
var count = conn.children().length-1; // -1 for rich text panel
for(var i = 0; i < count; i++) {
var img = images['' + i + '~' + view];
$jobj(elementId + '_seg' + i).attr('src', img);
}
};
var _applyView = $ax.adaptive.applyView = function(viewId, query) {
var limboIds = {};
var hiddenIds = {};
var jquery;
if(query) {
jquery = query.jQuery();
jquery = jquery.add(jquery.find('*'));
var jqueryAnn = $ax.annotation.jQueryAnn(query);
jquery = jquery.add(jqueryAnn);
} else {
jquery = $('*').not('#ios-safari-fixed');
query = $ax('*');
}
jquery.addClass(viewId);
var viewIdChain = _getAdaptiveIdChain(viewId);
// this could be made more efficient by computing it only once per object
query.each(function(diagramObject, elementId) {
_applyAdaptiveViewOnObject(diagramObject, elementId, viewIdChain, viewId, limboIds, hiddenIds);
});
$ax.visibility.addLimboAndHiddenIds(limboIds, hiddenIds, query);
//$ax.dynamicPanelManager.updateAllFitPanelsAndLayerSizeCaches();
$ax.dynamicPanelManager.updatePercentPanelCache(query);
};
var _applyAdaptiveViewOnObject = function(diagramObject, elementId, viewIdChain, viewId, limboIds, hiddenIds) {
var adaptiveChain = [];
for(var i = 0; i < viewIdChain.length; i++) {
var viewId = viewIdChain[i];
var viewStyle = diagramObject.adaptiveStyles[viewId];
if(viewStyle) {
adaptiveChain[adaptiveChain.length] = viewStyle;
if (viewStyle.size) $ax.public.fn.convertToSingleImage($jobj(elementId));
}
}
var state = $ax.style.generateState(elementId);
// set the image
var images = diagramObject.images;
if(images) {
if(diagramObject.type == 'horizontalLine' || diagramObject.type == 'verticalLine') {
_setAdaptiveLineImages(elementId, images, viewIdChain);
} else if (diagramObject.type == $ax.constants.CONNECTOR_TYPE) {
_setAdaptiveConnectorImages(elementId, images, viewId);
} else if (diagramObject.generateCompound) {
var compoundUrl = _matchImageCompound(diagramObject, elementId, viewIdChain, state);
if (compoundUrl) $ax.style.applyImage(elementId, compoundUrl, state);
}else {
var imgUrl = _matchImage(elementId, images, viewIdChain, state);
if(imgUrl) $ax.style.applyImage(elementId, imgUrl, state);
}
}
// addaptive override style (not including default style props)
var adaptiveStyle = $ax.style.computeAllOverrides(elementId, undefined, state, viewId);
// this style INCLUDES the object's my style
var compoundStyle = $.extend({}, diagramObject.style, adaptiveStyle);
if (diagramObject.owner.type == 'Axure:Master' && diagramObject.adaptiveStyles) {
adaptiveStyle = $ax.style.computeFullStyle(elementId, state, viewId);
}
if(!diagramObject.isContained) {
$ax.style.setAdaptiveStyle(elementId, adaptiveStyle);
}
var scriptId = $ax.repeater.getScriptIdFromElementId(elementId);
if(compoundStyle.limbo && !diagramObject.isContained) limboIds[scriptId] = true;
// sigh, javascript. we need the === here because undefined means not overriden
if(compoundStyle.visible === false) hiddenIds[scriptId] = true;
};
var _matchImage = function(id, images, viewIdChain, state, doNotProgress) {
var override = $ax.style.getElementImageOverride(id, state);
if(override) return override;
if(!images) return undefined;
var scriptId = $ax.repeater.getScriptIdFromElementId(id);
// first check all the images for this state
for(var i = viewIdChain.length - 1; i >= 0; i--) {
var viewId = viewIdChain[i];
var img = images[scriptId + "~" + state + "~" + viewId];
if(!img) img = images[state + "~" + viewId];
if(img) return img;
}
// check for the default state style
var defaultStateImage = images[scriptId + "~" + state + "~"];
if(!defaultStateImage) defaultStateImage = images[state + "~"];
if(defaultStateImage) return defaultStateImage;
if(doNotProgress) return undefined;
state = $ax.style.progessState(state);
if (state) return _matchImage(scriptId, images, viewIdChain, state);
// SHOULD NOT REACH HERE! NORMAL SHOULD ALWAYS CATCH AT THE DEFAULT!
return images['normal~']; // this is the default
};
var _matchImageCompound = function(diagramObject, id, viewIdChain, state) {
var images = [];
for(var i = 0; i < diagramObject.compoundChildren.length; i++) {
var component = diagramObject.compoundChildren[i];
images[component] = _matchImage(id, diagramObject.images[component], viewIdChain, state);
}
return images;
};
$ax.adaptive.getImageForStateAndView = function(id, state) {
var viewIdChain = _getAdaptiveIdChain($ax.adaptive.currentViewId);
var diagramObject = $ax.getObjectFromElementId(id);
if (diagramObject.generateCompound) return _matchImageCompound(diagramObject, id, viewIdChain, state);
else return _matchImage(id, diagramObject.images, viewIdChain, state);
};
var _getAdaptiveView = function(winWidth, winHeight) {
var _isViewOneGreaterThanTwo = function (view1, view2, winHeight) {
if (view1.size.width > view2.size.width) return true;
if (view1.size.width == view2.size.width) {
if (view2.size.height <= winHeight) return view1.size.height > view2.size.height && view1.size.height <= winHeight;
else return view1.size.height < view2.size.height;
}
return false;
};
var _isViewOneLessThanTwo = function(view1, view2) {
var width2 = view2.size.width || 1000000; // artificially large number
var height2 = view2.size.height || 1000000;
var width1 = view1.size.width || 1000000;
var height1 = view1.size.height || 1000000;
return width1 < width2 || (width1 == width2 && height1 < height2);
};
var _isWindowWidthGreaterThanViewWidth = function(view, width) {
return width >= view.size.width;
};
var _isWindowWidthLessThanViewWidth = function(view1, width) {
var viewWidth = view1.size.width || 1000000;
return width <= viewWidth;
};
var greater = undefined;
var less = undefined;
var defaultView = $ax.pageData.defaultAdaptiveView;
if (_isWindowWidthGreaterThanViewWidth(defaultView, winWidth, winHeight)) greater = defaultView;
less = defaultView;
for(var i = 0; i < _enabledViews.length; i++) {
var view = _enabledViews[i];
if(_isWindowWidthGreaterThanViewWidth(view, winWidth, winHeight)) {
if(!greater || _isViewOneGreaterThanTwo(view, greater, winHeight)) greater = view;
}
if(_isWindowWidthLessThanViewWidth(view, winWidth, winHeight)) {
if(!less || _isViewOneLessThanTwo(view, less)) less = view;
}
}
return greater || less;
};
var _isAdaptiveInitialized = function() {
return typeof _idToView != 'undefined';
};
$ax.messageCenter.addMessageListener(function(message, data) {
//If the adaptive plugin hasn't been initialized yet then
//save the view to load so that it can get set when initialize occurs
if (message == 'switchAdaptiveView') {
if (window.name != 'mainFrame') return;
var href = window.location.href.split('#')[0];
var lastSlash = href.lastIndexOf('/');
href = href.substring(lastSlash + 1);
if(href != data.src) return;
var view = data.view == 'auto' ? undefined : (data.view == 'default' ? '' : data.view);
if(!_isAdaptiveInitialized()) {
_initialViewToLoad = view;
} else _handleLoadViewId(view);
} else if (message == 'setAdaptiveViewForSize') {
if (window.name != 'mainFrame') return;
_autoIsHandledBySidebar = true;
if(!_isAdaptiveInitialized()) {
_initialViewSizeToLoad = data;
} else _handleSetViewForSize(data.width, data.height);
} else if (message == 'getScale') {
if (window.name != 'mainFrame') return;
var prevScaleN = data.prevScaleN;
var newScaleN = 1;
var contentOriginOffset = 0;
var $body = $('body');
$body.css('height', '');
if (data.scale != 0) {
var adjustScrollScale = false;
if ($('html').getNiceScroll().length == 0 && !MOBILE_DEVICE && !SAFARI) {
//adding nicescroll so width is correct when getting scale
_addNiceScroll($('html'), { emulatetouch: false, horizrailenabled: false });
adjustScrollScale = true;
}
if (!MOBILE_DEVICE && SAFARI) _removeNiceScroll($('html'));
$('html').css('overflow-x', 'hidden');
var bodyWidth = $body.width();
var isCentered = $body.css('position') == 'relative';
// screen width does not adjust on screen rotation for iOS (width is always shorter screen measurement)
var isLandscape = window.orientation != 0 && window.orientation != 180;
var mobileWidth = (IOS ? (isLandscape ? window.screen.height : window.screen.width) : window.screen.width) - data.panelWidthOffset;
var scaleN = newScaleN = (MOBILE_DEVICE ? mobileWidth : $(window).width()) / bodyWidth;
if (data.scale == 2) {
var pageSize = $ax.public.fn.getPageSize();
var hScaleN = (MOBILE_DEVICE ? data.viewportHeight : $(window).height()) / Math.max(1, pageSize.bottom);
if (hScaleN < scaleN) {
scaleN = newScaleN = hScaleN;
}
if (isCentered) contentOriginOffset = scaleN * (bodyWidth / 2);
}
if ((SAFARI && IOS) || SHARE_APP) {
var pageSize = $ax.public.fn.getPageSize();
$body.first().css('height', pageSize.bottom + 'px');
} //else $body.css('height', $body.height() + 'px');
if (adjustScrollScale) {
_removeNiceScroll($('html'));
_addNiceScroll($('html'), { emulatetouch: false, horizrailenabled: false, cursorwidth: Math.ceil(6 / newScaleN) + 'px', cursorborder: 1 / newScaleN + 'px solid #fff', cursorborderradius: 5 / newScaleN + 'px' });
}
}
var contentScale = {
scaleN: newScaleN,
prevScaleN: prevScaleN,
contentOriginOffset: contentOriginOffset,
clipToView: data.clipToView,
viewportHeight: data.viewportHeight,
viewportWidth: data.viewportWidth,
panelWidthOffset: data.panelWidthOffset,
scale: data.scale
};
$axure.messageCenter.postMessage('setContentScale', contentScale);
} else if (message == 'setDeviceMode') {
if (window.name != 'mainFrame') return;
_isDeviceMode = data.device;
if (data.device) {
// FIXES firefox cursor not staying outside initial device frame border
// SAFARI needs entire content height so that trackpad can be disabled
//if (FIREFOX || (SAFARI && !IOS)) {
// var pageSize = $ax.public.fn.getPageSize();
// $('html').css('height', pageSize.bottom + 'px');
//}
_removeNiceScroll($('html'));
if (!MOBILE_DEVICE) {
_addNiceScroll($('html'), { emulatetouch: true, horizrailenabled: false });
$('html').addClass('mobileFrameCursor');
$('html').css('cursor', 'url(resources/css/images/touch.cur), auto');
$('html').css('cursor', 'url(resources/css/images/touch.svg) 32 32, auto');
$('html').css('overflow-x', 'hidden');
if (IE) {
document.addEventListener("click", function () {
// IE still sometimes wants an argument here
this.activeElement.releasePointerCapture();
}, false);
}
if ($axure.browser.isEdge) {
document.addEventListener("pointerdown", function (e) {
this.activeElement.releasePointerCapture(e.pointerId);
}, false);
}
$ax.dynamicPanelManager.initMobileScroll();
}
// Gives horizontal scroll to android in 100% (handled outside of iframe)
$('html').css('overflow-x', 'hidden');
$('body').css('margin', '0px');
$(function () { _setHorizontalScroll(false); });
} else {
_removeNiceScroll($('html'));
$('html').css('overflow-x', '');
$('html').css('cursor', '');
//$('html').removeAttr('style');
$('body').css('margin', '');
$('html').removeClass('mobileFrameCursor');
$(function () { _setHorizontalScroll(!data.scaleToWidth); });
$ax.dynamicPanelManager.initMobileScroll();
}
}
});
var _isDeviceMode = false;
$ax.adaptive.isDeviceMode = function () {
return _isDeviceMode;
}
var _removeNiceScroll = $ax.adaptive.removeNiceScroll = function ($container, blockResetScroll) {
if (!blockResetScroll) {
$container.scrollLeft(0);
$container.scrollTop(0);
}
$container.getNiceScroll().remove();
//clean up nicescroll css
if (IE) $container.css({ '-ms-overflow-y': '', 'overflow-y': '', '-ms-overflow-style': '', '-ms-touch-action': '' });
}
var _addNiceScroll = $ax.adaptive.addNiceScroll = function ($container, options, blockResetScroll) {
if (!blockResetScroll) {
$container.scrollLeft(0);
$container.scrollTop(0);
}
$container.niceScroll(options);
//clean up nicescroll css so child scroll containers show scrollbars in IE
if (IE) $container.css({ '-ms-overflow-y': '', '-ms-overflow-style': '' });
}
$ax.adaptive.updateMobileScrollOnBody = function () {
var niceScroll = $('html').getNiceScroll();
if (niceScroll.length == 0) return;
niceScroll.resize();
}
var _setTrackpadHorizontalScroll = function (active) {
var preventScroll = function (e) {
if (Math.abs(e.wheelDeltaX) != 0) {
e.preventDefault();
}
}
if (!active) {
document.body.addEventListener("mousewheel", preventScroll, { passive: false });
document.getElementById('html').addEventListener("mousewheel", preventScroll, { passive: false });
} else {
document.body.removeEventListener("mousewheel", preventScroll, { passive: false });
document.getElementById('html').removeEventListener("mousewheel", preventScroll, { passive: false });
}
}
var _setHorizontalScroll = function (active) {
var $body = $(document);
if (!active) {
$body.bind('scroll', function () {
if ($body.scrollLeft() !== 0) {
$body.scrollLeft(0);
}
});
} else {
$body.unbind('scroll');
}
}
$ax.adaptive.setAdaptiveView = function(view) {
var viewIdForSitemapToUnderstand = view == 'auto' ? undefined : (view == 'default' ? '' : view);
if(!_isAdaptiveInitialized()) {
_initialViewToLoad = viewIdForSitemapToUnderstand;
} else _handleLoadViewId(viewIdForSitemapToUnderstand);
};
$ax.adaptive.initialize = function() {
_views = $ax.pageData.adaptiveViews;
_idToView = {};
var useViews = $ax.document.configuration.useViews;
if(_views && _views.length > 0) {
for(var i = 0; i < _views.length; i++) {
var view = _views[i];
_idToView[view.id] = view;
if(useViews) _enabledViews[_enabledViews.length] = view;
}
if(_autoIsHandledBySidebar && _initialViewSizeToLoad) _handleSetViewForSize(_initialViewSizeToLoad.width, _initialViewSizeToLoad.height);
else _handleLoadViewId(_initialViewToLoad);
}
$axure.resize(function(e) {
_handleResize();
$ax.postResize(e); //window resize fires after view changed
});
};
var _handleLoadViewId = function (loadViewId, forceSwitchTo) {
if(typeof loadViewId != 'undefined') {
_setAuto(false);
_switchView(loadViewId != 'default' ? loadViewId : '', forceSwitchTo);
} else {
_setAuto(true);
_handleResize(forceSwitchTo);
}
};
var _handleSetViewForSize = function (width, height) {
var toView = _getAdaptiveView(width, height);
var toViewId = toView && toView.id;
_switchView(toViewId, "auto");
};
$ax.adaptive.getSketchKey = function() {
return $ax.pageData.sketchKeys[$ax.adaptive.currentViewId || ''];
}
});

View File

@@ -0,0 +1,161 @@
// ******* Annotation MANAGER ******** //
$axure.internal(function($ax) {
var NOTE_SIZE = 10;
var _annotationManager = $ax.annotation = {};
var _updateLinkLocations = $ax.annotation.updateLinkLocations = function(elementId) {
var textId = $ax.GetTextPanelId(elementId);
if(!textId) return;
var rotation = $ax.getObjectFromElementId(elementId).style.rotation;
//we have to do this because webkit reports the post-transform position but when you set positions it's pre-transform
if(WEBKIT && rotation) {
//we can dynamiclly rotate a widget now, show need to remember the transform rather than just remove it
//here jquery.css will return 'none' if element is display none
var oldShapeTransform = document.getElementById(elementId).style['-webkit-transform'];
var oldTextTransform = document.getElementById(textId).style['-webkit-transform'];
$('#' + elementId).css('-webkit-transform', 'scale(1)');
$('#' + textId).css('-webkit-transform', 'scale(1)');
}
$('#' + textId).find('div[id$="_ann"]').each(function(index, value) {
var elementId = value.id.replace('_ann', '');
var $link = $('#' + elementId);
var annPos = $link.position();
annPos.left += $link.width();
//var annPos = $(value).position();
var left = annPos.left;// - NOTE_SIZE;
var top = annPos.top - 5;
$(value).css('left', left).css('top', top);
});
//undo the transform reset
if(WEBKIT && rotation) {
$('#' + elementId).css('-webkit-transform', oldShapeTransform || '');
$('#' + textId).css('-webkit-transform', oldTextTransform || '');
}
};
var _toggleAnnotationDialog = function (elementId, event) {
var win = $(window);
var scrollY = win.scrollTop();
var scrollX = win.scrollLeft();
var messageData = { id: elementId, x: event.pageX - scrollX, y: event.pageY - scrollY }
if (window.name != 'mainFrame') messageData.page = $ax.pageData.notesData;
$ax.messageCenter.postMessage('toggleAnnDialog', messageData);
}
$ax.annotation.initialize = function () {
_createFootnotes($ax('*'), true);
}
var _createFootnotes = $ax.annotation.createFootnotes = function(query, create) {
if(!$ax.document.configuration.showAnnotations) return;
var widgetNotes = $ax.pageData.notesData.widgetNotes;
if (widgetNotes) {
var ownerToFns = $ax.pageData.notesData.ownerToFns;
if(!$.isEmptyObject(ownerToFns)) {
query.each(function(dObj, elementId) {
var fns = ownerToFns[dObj.id];
if (fns !== undefined) {
var elementIdQuery = $('#' + elementId);
if (dObj.type == 'hyperlink') {
var parentId = $ax.GetParentIdFromLink(elementId);
if (create) {
elementIdQuery.after("<div id='" + elementId + "_ann' class='annnote'>&#8203;</div>");
appendFns($('#' + elementId + "_ann"), fns);
}
_updateLinkLocations(parentId);
} else {
if (create) {
elementIdQuery.after("<div id='" + elementId + "_ann' class='annnote'>&#8203;</div>");
appendFns($('#' + elementId + "_ann"), fns);
}
_adjustIconLocation(elementId, dObj);
}
if (create) {
$('#' + elementId + "_ann").click(function (e) {
_toggleAnnotationDialog(dObj.id, e);
return false;
});
var isVisible = true;
var isMaster = $ax.public.fn.IsReferenceDiagramObject(dObj.type);
if (isMaster) isVisible = dObj.visible;
else isVisible = $ax.visibility.IsIdVisible(elementId);
if (!isVisible) {
var ann = document.getElementById(elementId + "_ann");
if (ann) $ax.visibility.SetVisible(ann, false);
}
}
}
});
}
}
function appendFns($parent, fns) {
for (var index = 0; index < fns.length; index++) {
$parent.append("<div class='annnotelabel' >" + fns[index] + "</div>");
}
}
};
$ax.annotation.updateAllFootnotes = function () {
_createFootnotes($ax('*'), false);
}
$ax.annotation.jQueryAnn = function(query) {
var elementIds = [];
query.each(function(diagramObject, elementId) {
if(diagramObject.annotation) elementIds[elementIds.length] = elementId;
});
var elementIdSelectors = jQuery.map(elementIds, function(elementId) { return '#' + elementId + '_ann'; });
var jQuerySelectorText = (elementIdSelectors.length > 0) ? elementIdSelectors.join(', ') : '';
return $(jQuerySelectorText);
};
$(window.document).ready(function() {
//$ax.annotation.InitializeAnnotations($ax(function(dObj) { return dObj.annotation; }));
$ax.messageCenter.addMessageListener(function(message, data) {
//If the annotations are being hidden via the Sitemap toggle button, hide any open dialogs
if(message == 'annotationToggle') {
if (data == true) {
$('div.annnote').show();
} else {
$('div.annnote').hide();
}
}
});
});
//adjust annotation location to a element's top right corner
var _adjustIconLocation = $ax.annotation.adjustIconLocation = function(id, dObj) {
var ann = document.getElementById(id + "_ann");
if(ann) {
var corners = $ax.public.fn.getCornersFromComponent(id);
var width = $(ann).width();
var newTopRight = $ax.public.fn.vectorPlus(corners.relativeTopRight, corners.centerPoint);
//note size is 14x8, this is how rp calculated it as well
ann.style.left = (newTopRight.x - width) + "px";
var elementType = dObj ? dObj.type : $ax.getTypeFromElementId(id);
var yOffset = $ax.public.fn.IsTableCell(elementType) ? 0 : -8;
ann.style.top = (newTopRight.y + yOffset) + "px";
}
var ref = document.getElementById(id + "_ref");
if(ref) {
if(!corners) corners = $ax.public.fn.getCornersFromComponent(id);
var newBottomRight = $ax.public.fn.vectorPlus(corners.relativeBottomRight, corners.centerPoint);
ref.style.left = (newBottomRight.x - 8) + 'px';
ref.style.top = (newBottomRight.y - 10) + 'px';
}
}
});

View File

@@ -0,0 +1,404 @@
$axure = function(query) {
return $axure.query(query);
};
// ******* AxQuery and Page metadata ******** //
(function() {
var $ax = function() {
var returnVal = $axure.apply(this, arguments);
var axFn = $ax.fn;
for (var key in axFn) {
returnVal[key] = axFn[key];
}
return returnVal;
};
$ax.public = $axure;
$ax.fn = {};
$axure.internal = function(initFunction) {
//Attach messagecenter to $ax object so that it can be used in viewer.js, etc in internal scope
if(!$ax.messageCenter) $ax.messageCenter = $axure.messageCenter;
return initFunction($ax);
};
var _lastFiredResize = 0;
var _resizeFunctions = [];
var _lastTimeout;
var _fireResize = function() {
if (_lastTimeout) window.clearTimeout(_lastTimeout);
_lastTimeout = undefined;
_lastFiredResize = new Date().getTime();
for(var i = 0; i < _resizeFunctions.length; i++) _resizeFunctions[i]();
};
$axure.resize = function(fn) {
if(fn) _resizeFunctions[_resizeFunctions.length] = fn;
else $(window).resize();
};
$(window).resize(function() {
var THRESHOLD = 50;
var now = new Date().getTime();
if(now - _lastFiredResize > THRESHOLD) {
_updateWindowInfo();
_fireResize();
} else if(!_lastTimeout) {
_lastTimeout = window.setTimeout(_fireResize, THRESHOLD);
}
});
$(window).scroll(function () {
_updateWindowInfo();
});
var _windowInfo;
var _updateWindowInfo = $axure.updateWindowInfo = function () {
var win = {};
var jWin = $(window);
var scrollWin = $('#ios-safari-html').length > 0 ? $('#ios-safari-html') : jWin;
win.width = jWin.width();
win.height = jWin.height();
win.scrollx = scrollWin.scrollLeft();
win.scrolly = scrollWin.scrollTop();
_windowInfo = win;
};
$ax.getWindowInfo = function () {
if(!_windowInfo) _updateWindowInfo();
return _windowInfo;
};
window.$obj = function(id) {
return $ax.getObjectFromElementId(id);
};
window.$id = function(obj) {
return obj.scriptIds[0];
};
window.$jobj = function(id) {
return $(document.getElementById(id));
};
window.$jobjAll = function(id) {
return $addAll($jobj(id), id);
};
window.$addAll = function(jobj, id) {
return jobj.add($jobj(id + '_ann')).add($jobj(id + '_ref'));
};
$ax.INPUT = function(id) { return id + "_input"; };
$ax.IsImageFocusable = function (type) { return $ax.public.fn.IsImageBox(type) || $ax.public.fn.IsVector(type) || $ax.public.fn.IsTreeNodeObject(type) || $ax.public.fn.IsTableCell(type); };
$ax.IsTreeNodeObject = function (type) { return $ax.public.fn.IsTreeNodeObject(type); };
$ax.IsSelectionButton = function (type) { return $ax.public.fn.IsCheckBox(type) || $ax.public.fn.IsRadioButton(type); };
var _fn = {};
$axure.fn = _fn;
$axure.fn.jQuery = function() {
var elements = this.getElements();
return $(elements);
};
$axure.fn.$ = $axure.fn.jQuery;
var _query = function(query, queryArg) {
var returnVal = {};
var _axQueryObject = returnVal.query = { };
_axQueryObject.filterFunctions = [];
if (query == '*') {
_axQueryObject.filterFunctions[0] = function() { return true; };
} else if (typeof(query) === 'function') {
_axQueryObject.filterFunctions[0] = query;
} else {
var firstString = $.trim(query.toString());
if (firstString.charAt(0) == '@') {
_axQueryObject.filterFunctions[0] = function(diagramObject) {
return diagramObject.label == firstString.substring(1);
};
} else if (firstString.charAt(0) == '#') {
_axQueryObject.elementId = firstString.substring(1);
} else {
if (firstString == 'label') {
_axQueryObject.filterFunctions[0] = function(diagramObject) {
return queryArg instanceof Array && queryArg.indexOf(diagramObject.label) > 0 ||
queryArg instanceof RegExp && queryArg.test(diagramObject.label) ||
diagramObject.label == queryArg;
};
} else if(firstString == 'elementId') {
_axQueryObject.filterFunctions[0] = function(diagramObject, elementId) {
return queryArg instanceof Array && queryArg.indexOf(elementId) > 0 ||
elementId == queryArg;
};
}
}
}
var axureFn = $axure.fn;
for (var key in axureFn) {
returnVal[key] = axureFn[key];
}
return returnVal;
};
$axure.query = _query;
var _getFilterFnFromQuery = function(query) {
var filter = function(diagramObject, elementId) {
// Non diagram objects are allowed to be queryed, such as text inputs.
if (diagramObject && !$ax.public.fn.IsReferenceDiagramObject(diagramObject.type) && !document.getElementById(elementId)) return false;
var retVal = true;
for(var i = 0; i < query.filterFunctions.length && retVal; i++) {
retVal = query.filterFunctions[i](diagramObject, elementId);
}
return retVal;
};
return filter;
};
$ax.public.fn.filter = function(query, queryArg) {
var returnVal = _query(query, queryArg);
if(this.query.elementId) returnVal.query.elementId = this.query.elementId;
//If there is already a function, offset by 1 when copying other functions over.
var offset = returnVal.query.filterFunctions[0] ? 1 : 0;
//Copy all functions over to new array.
for(var i = 0; i < this.query.filterFunctions.length; i++) returnVal.query.filterFunctions[i+offset] = this.query.filterFunctions[i];
//Functions are in reverse order now
returnVal.query.filterFunctions.reverse();
return returnVal;
};
$ax.public.fn.each = function(fn) {
var filter = _getFilterFnFromQuery(this.query);
var elementIds = this.query.elementId ? [this.query.elementId] : $ax.getAllElementIds();
for (var i = 0; i < elementIds.length; i++) {
var elementId = elementIds[i];
var diagramObject = $ax.getObjectFromElementId(elementId);
if (filter(diagramObject, elementId)) {
fn.apply(diagramObject, [diagramObject, elementId]);
}
}
};
$ax.public.fn.getElements = function() {
var elements = [];
this.each(function(dObj, elementId) {
var elementById = document.getElementById(elementId);
if(elementById) elements[elements.length] = elementById;
});
return elements;
};
$ax.public.fn.getElementIds = function() {
var elementIds = [];
this.each(function(dObj, elementId) { elementIds[elementIds.length] = elementId; });
return elementIds;
};
// Deep means to keep getting parents parent until at the root parent. Parent is then an array instead of an id.
// Filter options: layer, rdo, repeater, item, dynamicPanel, state
$ax.public.fn.getParents = function (deep, filter) {
if(filter == '*') filter = ['layer', 'rdo', 'repeater', 'item', 'dynamicPanel', 'state'];
var elementIds = this.getElementIds();
var parentIds = [];
var getParent = function(elementId) {
var containerIndex = elementId.indexOf('_container');
if(containerIndex !== -1) elementId = elementId.substring(0, containerIndex);
if(elementId.indexOf('_text') !== -1) elementId = $ax.GetShapeIdFromText(elementId);
// Check repeater item before layer, because repeater item detects it's parent layer, but wants to go directly to it's repeater first.
// if repeater item, then just return repeater
var scriptId = $ax.repeater.getScriptIdFromElementId(elementId);
var itemNum = $ax.repeater.getItemIdFromElementId(elementId);
var parentRepeater = $ax.getParentRepeaterFromScriptId(scriptId);
// scriptId is item or repeater itself
if (parentRepeater == scriptId) {
// If you are repeater item, return your repeater
if (itemNum) return filter.indexOf('repeater') != -1 ? scriptId : getParent(scriptId);
// Otherwise you are actually at repeater, clean parentRepeater, or else you loop
parentRepeater = undefined;
}
// Layer only references it if it is a direct layer to it
var parent = $ax.getLayerParentFromElementId(elementId);
// If layer is allowed we found parent, otherwise ignore and keep climbing
if (parent) return filter.indexOf('layer') != -1 ? parent : getParent(parent);
// if state, then just return panel
if(scriptId.indexOf('_state') != -1) {
var panelId = $ax.repeater.createElementId(scriptId.split('_')[0], itemNum);
// If dynamic panel is allowed we found parent, otherwise ignore and keep climbing
return filter.indexOf('dynamicPanel') != -1 ? panelId : getParent(panelId);
}
var parentType = '';
if(parentRepeater) {
parentType = 'item';
parent = $ax.repeater.createElementId(parentRepeater, itemNum);
}
var masterPath = $ax.getPathFromScriptId($ax.repeater.getScriptIdFromElementId(elementId));
masterPath.pop();
if(masterPath.length > 0) {
var masterId = $ax.getElementIdFromPath(masterPath, { itemNum: itemNum }, true);
if(!masterId) return undefined;
var masterRepeater = $ax.getParentRepeaterFromElementId($ax.repeater.getScriptIdFromElementId(masterId));
if(!parentRepeater || masterRepeater) {
parentType = 'rdo';
parent = masterId;
}
}
var obj = $obj(elementId);
var parentDynamicPanel = obj.parentDynamicPanel;
if(parentDynamicPanel) {
// Make sure the parent if not parentRepeater, or dynamic panel is also in that repeater
// If there is a parent master, the dynamic panel must be in it, otherwise parentDynamicPanel would be undefined.
var panelPath = masterPath;
panelPath[panelPath.length] = parentDynamicPanel;
panelId = $ax.getElementIdFromPath(panelPath, { itemNum: itemNum }, true);
if(!panelId) return undefined;
var panelRepeater = $ax.getParentRepeaterFromElementId(panelId);
if(!parentRepeater || panelRepeater) {
parentType = 'state';
parent = panelId + '_state' + obj.panelIndex;
}
}
// If at top or parent type is desired, then return parent, otherwise keep climbing
return !parent || filter.indexOf(parentType) != -1 ? parent : getParent(parent);
};
for(var i = 0; i < elementIds.length; i++) {
var parent = getParent(elementIds[i]);
if(deep) {
var parents = [];
while(parent) {
parents[parents.length] = parent;
// If id is not a valid object, you are either repeater item or dynamic panel state
//if(!$obj(parent)) parent = $ax.visibility.getWidgetFromContainer($jobj(parent).parent().attr('id'));
parent = getParent(parent);
}
parent = parents;
}
parentIds[parentIds.length] = parent;
}
return parentIds;
};
// Get the path to the child, where non leaf nodes can be masters, layers, dynamic panels, and repeaters.
$ax.public.fn.getChildren = function(deep, ignoreUnplaced) { // ignoreUnplaced should probably be the default, but when that is done a full audit of usages should be done
var elementIds = this.getElementIds();
var children = [];
var getChildren = function (elementId) {
var obj = $obj(elementId);
//if(!obj) return undefined;
var isRepeater = obj && obj.type == $ax.constants.REPEATER_TYPE;
if (isRepeater && $ax.repeater.getScriptIdFromElementId(elementId) != elementId) {
//prevent repeater items from being marked as isRepeater
//TODO: evaluate changing the naming convention to be more like panel states which don't seem to have this problem
obj = undefined;
isRepeater = false;
}
var isDynamicPanel = obj && obj.type == $ax.constants.DYNAMIC_PANEL_TYPE;
//var isLayer = obj.type == $ax.constants.LAYER_TYPE;
//var isMaster = obj.type == $ax.constants.MASTER_TYPE || obj.type == $ax.constants.REFERENCE_DIAGRAM_OBJECT_TYPE;
var isMenu = obj && obj.type == $ax.constants.MENU_OBJECT_TYPE;
var isTreeNode = obj && obj.type == $ax.constants.TREE_NODE_OBJECT_TYPE;
//var isTable = obj.type == $ax.constants.TABLE_TYPE;
//var isCompoundVector = obj.type == $ax.constants.VECTOR_SHAPE_TYPE && obj.generateCompound;
//if (isRepeater || isDynamicPanel || isLayer || isMaster || isMenu || isTreeNode || isTable) {// || isCompoundVector) {
// Find parent that children should be pulled from. Default is just the elementId query (used by table and master)
var parent = $jobj(elementId);
if(isRepeater) {
parent = $();
var itemIds = $ax.getItemIdsForRepeater(elementId);
for(var itemIndex = 0; itemIndex < itemIds.length; itemIndex++) parent = parent.add($jobj($ax.repeater.createElementId(elementId, itemIds[itemIndex])));
} else if(isDynamicPanel) {
// Really only need to do active state probably...
parent = $jobj(elementId).children();
// Get through all containers
while ($(parent[0]).attr('id').indexOf('container') != -1) parent = parent.children();
// Now at states, but want states content
parent = parent.children();
} else if(isTreeNode) parent = $jobj($ax.repeater.applySuffixToElementId(elementId, '_children'));
// Menu doesn't want all children, only tables and menus, so it must be handled specially
var children = isMenu ? parent.children('.ax_table').add(parent.children('.ax_menu')) : parent.children();
children = $ax.visibility.getRealChildren(_fixForBasicLinks(children));
// For tree nodes you want the the button shape contained by the elementQuery too
if(isTreeNode) {
var treeNodeChildren = $jobj(elementId).children();
for(var treeNodeIndex = 0; treeNodeIndex < treeNodeChildren.length; treeNodeIndex++) {
var treeNodeChild = $(treeNodeChildren[treeNodeIndex]);
var childObj = $obj(treeNodeChild.attr('id'));
if (childObj && $ax.public.fn.IsVector(childObj.type)) children = children.add(treeNodeChild);
}
}
var childrenIds = [];
for(var childIndex = 0; childIndex < children.length; childIndex++) {
var childObj = $(children[childIndex]);
var id = childObj.attr('id');
if(typeof(id) == 'undefined' && childObj.is('a')) id = $(childObj.children()[0]).attr('id');
// Ignore annotations and any other children that are not elements
if (id.split('_').length > 1) continue;
// Ignore Unplaced
if(ignoreUnplaced && $ax.visibility.isScriptIdLimbo($ax.repeater.getScriptIdFromElementId(id))) continue;
childrenIds.push(id);
}
if(deep) {
var childObjs = [];
for(var i = 0; i < childrenIds.length; i++) {
var childId = childrenIds[i];
childObjs[i] = { id: childId, children: getChildren(childId) };
}
childrenIds = childObjs;
}
return childrenIds;
//}
//return undefined;
};
for(var i = 0; i < elementIds.length; i++) {
var elementId = elementIds[i];
//if the state is passed in, look for children in the content element
if (elementId.indexOf('_state') > -1 && elementId.indexOf('_content') < 0) elementId = elementId + '_content';
children[children.length] = { id: elementId, children: getChildren(elementId)};
}
return children;
};
var _fixForBasicLinks = function(query) {
var hasBasicLinks = query.filter('.basiclink').length > 0;
if(!hasBasicLinks) return query;
var retval = $();
for(var i = 0; i < query.length; i++) {
var child = $(query[i]);
if(child.hasClass('basiclink')) retval = retval.add(child.children());
else retval = retval.add(child);
}
return retval;
};
})();

View File

@@ -0,0 +1,901 @@
$axure.internal(function($ax) {
var _pageData;
var _initializePageFragment = function(pageFragment, objIdToObject) {
var objectArrayHelper = function(objects, parent) {
for(var i = 0; i < objects.length; i++) {
diagramObjectHelper(objects[i], parent);
}
};
var diagramObjectHelper = function(diagramObject, parent) {
$ax.initializeObject('diagramObject', diagramObject);
objIdToObject[pageFragment.packageId + '~' + diagramObject.id] = diagramObject;
diagramObject.parent = parent;
diagramObject.owner = pageFragment;
diagramObject.scriptIds = [];
if(diagramObject.diagrams) { //dynamic panel
for(var i = 0; i < diagramObject.diagrams.length; i++) {
var diagram = diagramObject.diagrams[i];
objectArrayHelper(diagram.objects, diagram);
}
} else if($ax.public.fn.IsLayer(diagramObject.type)) {
var layerObjs = diagramObject.objs;
objectArrayHelper(layerObjs, parent);
}
if(diagramObject.objects) objectArrayHelper(diagramObject.objects, diagramObject);
};
objectArrayHelper(pageFragment.diagram.objects, pageFragment.diagram);
};
var _initalizeStylesheet = function(stylesheet) {
var stylesById = {};
var customStyles = stylesheet.customStyles;
for(var key in customStyles) {
var style = customStyles[key];
stylesById[style.id] = style;
}
var duplicateStyles = stylesheet.duplicateStyles;
for(var duplicateKey in duplicateStyles) {
stylesById[duplicateKey] = stylesById[duplicateStyles[duplicateKey]];
}
stylesheet.stylesById = stylesById;
};
var _initializeDocumentData = function() {
_initalizeStylesheet($ax.document.stylesheet);
};
var _initializePageData;
// ******* Dictionaries ******** //
(function() {
var scriptIdToParentLayer = {};
var elementIdToObject = {};
var scriptIdToObject = {};
var scriptIdToRepeaterId = {};
var repeaterIdToScriptIds = {};
var repeaterIdToItemIds = {};
var scriptIdToPath = {};
var _scriptIds = [];
var elementIdToText = {};
var radioGroupToSelectedElementId = {};
_initializePageData = function() {
if(!_pageData || !_pageData.page || !_pageData.page.diagram) return;
var objIdToObject = {};
_initializePageFragment(_pageData.page, objIdToObject);
for(var masterId in _pageData.masters) {
var master = _pageData.masters[masterId];
_initializePageFragment(master, objIdToObject);
}
var _pathsToScriptIds = [];
_pathToScriptIdHelper(_pageData.objectPaths, [], _pathsToScriptIds, scriptIdToPath);
for(var i = 0; i < _pathsToScriptIds.length; i++) {
var path = _pathsToScriptIds[i].idPath;
var scriptId = _pathsToScriptIds[i].scriptId;
var packageId = _pageData.page.packageId;
if(path.length > 1) {
for(var j = 0; j < path.length - 1; j++) {
var rdoId = path[j];
var rdo = objIdToObject[packageId + '~' + rdoId];
packageId = rdo.masterId;
}
}
var diagramObject = objIdToObject[packageId + '~' + path[path.length - 1]];
diagramObject.scriptIds[diagramObject.scriptIds.length] = scriptId;
scriptIdToObject[scriptId] = diagramObject;
_scriptIds[_scriptIds.length] = scriptId;
}
// Now map scriptIds to repeaters and layers
var mapScriptIdToRepeaterId = function(scriptId, repeaterId) {
scriptIdToRepeaterId[scriptId] = repeaterId;
var scriptIds = repeaterIdToScriptIds[repeaterId];
if(scriptIds) scriptIds[scriptIds.length] = scriptId;
else repeaterIdToScriptIds[repeaterId] = [scriptId];
};
var mapScriptIdToLayerId = function(obj, layerId, path) {
var pathCopy = $ax.deepCopy(path);
pathCopy[path.length] = obj.id;
var scriptId = $ax.getScriptIdFromPath(pathCopy);
scriptIdToParentLayer[scriptId] = layerId;
}
var mapIdsToRepeaterAndLayer = function(path, objs, repeaterId) {
var pathCopy = $ax.deepCopy(path);
for(var i = 0; i < objs.length; i++) {
var obj = objs[i];
pathCopy[path.length] = obj.id;
var scriptId = $ax.getScriptIdFromPath(pathCopy);
// Rdo have no element on page and are not mapped to the repeater
if(repeaterId) mapScriptIdToRepeaterId(scriptId, repeaterId);
if($ax.public.fn.IsDynamicPanel(obj.type)) {
for(var j = 0; j < obj.diagrams.length; j++) mapIdsToRepeaterAndLayer(path, obj.diagrams[j].objects, repeaterId);
} else if($ax.public.fn.IsReferenceDiagramObject(obj.type)) {
mapIdsToRepeaterAndLayer(pathCopy, $ax.pageData.masters[obj.masterId].diagram.objects, repeaterId);
} else if($ax.public.fn.IsRepeater(obj.type)) {
mapScriptIdToRepeaterId(scriptId, scriptId);
mapIdsToRepeaterAndLayer(path, obj.objects, scriptId);
} else if($ax.public.fn.IsLayer(obj.type)) {
var layerObjs = obj.objs;
for(var j = 0; j < layerObjs.length; j++) {
mapScriptIdToLayerId(layerObjs[j], scriptId, path);
}
mapIdsToRepeaterAndLayer(path, layerObjs, repeaterId);
} else if(obj.objects && obj.objects.length) {
if(repeaterId) {
for(var j = 0; j < obj.objects.length; j++) {
mapIdsToRepeaterAndLayer(path, obj.objects, repeaterId);
}
}
}
}
};
mapIdsToRepeaterAndLayer([], $ax.pageData.page.diagram.objects);
};
$ax.getPathFromScriptId = function(scriptId) {
var reversedPath = [];
var path = scriptIdToPath[scriptId];
while(path && path.uniqueId) {
reversedPath[reversedPath.length] = path.uniqueId;
path = path.parent;
}
return reversedPath.reverse();
};
var _getScriptIdFromFullPath = function(path) {
var current = $ax.pageData.objectPaths;
for(var i = 0; i < path.length; i++) {
current = current[path[i]];
if(!current) return current;
}
return current && current.scriptId;
};
var _getScriptIdFromPath = function(path, relativeTo, includeLimbo) {
var relativePath = [];
var includeMasterInPath = false;
if(relativeTo) {
var relativeToScriptId;
if(relativeTo.srcElement) { //this is eventInfo
relativeToScriptId = $ax.repeater.getScriptIdFromElementId(relativeTo.srcElement);
includeMasterInPath = relativeTo.isMasterEvent;
} else if(typeof relativeTo === 'string') { //this is an element id
relativeToScriptId = relativeTo;
}
if(relativeToScriptId) {
relativePath = $ax.getPathFromScriptId(relativeToScriptId);
if(!includeMasterInPath) relativePath = relativePath.slice(0, relativePath.length - 1);
} else if(relativeTo instanceof Array) { //this is a path
relativePath = relativeTo;
}
}
var fullPath = relativePath.concat(path);
var scriptId = _getScriptIdFromFullPath(fullPath);
return (includeLimbo || !$ax.visibility.isScriptIdLimbo(scriptId)) && scriptId;
};
$ax.getScriptIdFromPath = _getScriptIdFromPath;
var _getElementIdsFromPath = function(path, eventInfo) {
var scriptId = _getScriptIdFromPath(path, eventInfo);
if(!scriptId) return [];
// Don't need placed check hear. If unplaced, scriptId will be undefined and exit out before here.
return $ax.getElementIdsFromEventAndScriptId(eventInfo, scriptId);
};
$ax.getElementIdsFromPath = _getElementIdsFromPath;
var _getElementIdFromPath = function(path, params, includeLimbo) {
var scriptId = _getScriptIdFromPath(path, params.relativeTo, includeLimbo);
if(!scriptId) return scriptId;
var itemNum = params.itemNum;
if(params.relativeTo && typeof params.relativeTo === 'string') {
if($jobj(params.relativeTo)) itemNum = $ax.repeater.getItemIdFromElementId(params.relativeTo);
}
return $ax.repeater.createElementId(scriptId, itemNum);
};
$ax.getElementIdFromPath = _getElementIdFromPath;
var _getElementsIdFromEventAndScriptId = function(eventInfo, scriptId) {
var itemId = eventInfo && $ax.repeater.getItemIdFromElementId(eventInfo.srcElement);
var target = false;
// Try to get itemId from target if you can't get it from source.
if(!itemId) {
itemId = eventInfo && eventInfo.targetElement && $ax.repeater.getItemIdFromElementId(eventInfo.targetElement);
if(itemId) target = true;
}
var parentRepeater = $ax.getParentRepeaterFromScriptId(scriptId);
if(parentRepeater && scriptId != parentRepeater) {
if(itemId && (!eventInfo || parentRepeater == $ax.getParentRepeaterFromScriptId($ax.repeater.getScriptIdFromElementId(target ? eventInfo.targetElement : eventInfo.srcElement)))) {
return [$ax.repeater.createElementId(scriptId, itemId)];
}
var elementIds = [];
var itemIds = $ax.getItemIdsForRepeater(parentRepeater);
if(!itemIds) return [];
for(var i = 0; i < itemIds.length; i++) elementIds[i] = $ax.repeater.createElementId(scriptId, itemIds[i]);
return elementIds;
}
return [scriptId];
};
$ax.getElementIdsFromEventAndScriptId = _getElementsIdFromEventAndScriptId;
var _getSrcElementIdFromEvent = function(event) {
var currentQuery = $(event.srcElement || event.target);
while(currentQuery && currentQuery.length && (!$obj(currentQuery.attr('id')) || $jobj(currentQuery.attr('id')).hasClass('text'))) {
currentQuery = currentQuery.parent();
};
return currentQuery.attr('id');
};
$ax.getSrcElementIdFromEvent = _getSrcElementIdFromEvent;
var _getEventInfoFromEvent = function(event, skipShowDescriptions, elementId) {
var eventInfo = {};
eventInfo.srcElement = elementId;
eventInfo.now = new Date();
if(event != null) {
//elementId can be empty string, so can't simple use "or" assignment here.
eventInfo.srcElement = elementId || elementId == '' ? elementId : _getSrcElementIdFromEvent(event);
eventInfo.which = event.which;
// When getting locations in mobile, need to extract the touch object to get the mouse location attributes
var mouseEvent = (event.originalEvent && event.originalEvent.changedTouches && event.originalEvent.changedTouches[0]) || event.originalEvent;
if(mouseEvent && !mouseEvent.type) mouseEvent.type = event.type;
if(skipShowDescriptions) eventInfo.skipShowDescriptions = true;
// Always update mouse location if possible
$ax.event.updateMouseLocation(mouseEvent);
}
// Always set event info about cursor
var _cursor = eventInfo.cursor = {};
_cursor.x = $ax.mouseLocation.x;
_cursor.y = $ax.mouseLocation.y;
var body = $('body');
if(body.css('position') == 'relative') {
_cursor.x -= ($ax.getNumFromPx(body.css('left')) + Math.max(0, ($(window).width() - body.width()) / 2));
}
eventInfo.pageX = _cursor.x + 'px';
eventInfo.pageY = _cursor.y + 'px';
// Do Keyboard Info
eventInfo.keyInfo = $ax.event.keyState();
eventInfo.window = $ax.getWindowInfo();
eventInfo.thiswidget = _getWidgetInfo(eventInfo.srcElement);
eventInfo.item = _getItemInfo(eventInfo.srcElement);
eventInfo.dragInfo = $ax.drag.GetWidgetDragInfo();
return eventInfo;
};
$ax.getEventInfoFromEvent = _getEventInfoFromEvent;
$ax.getBasicEventInfo = function() {
var eventInfo = {};
eventInfo.now = new Date();
eventInfo.window = $ax.getWindowInfo();
eventInfo.cursor = { x: 0, y: 0};
return eventInfo;
};
//var _getWindowInfo = function() {
// var win = {};
// win.width = $(window).width();
// win.height = $(window).height();
// win.scrollx = $(window).scrollLeft();
// win.scrolly = $(window).scrollTop();
// return win;
//};
//$ax.getWindowInfo = _getWindowInfo;
var repeaterInfoCache = [];
$ax.cacheRepeaterInfo = function(repeaterId, repeaterInfo) {
repeaterInfoCache[repeaterId] = repeaterInfo;
}
$ax.removeCachedRepeaterInfo = function(repeaterId) {
repeaterInfoCache[repeaterId] = undefined;
}
var _getItemInfo = function(elementId) {
if(!elementId) return { valid: false };
elementId = _getParentElement(elementId);
var index = $ax.repeater.getItemIdFromElementId(elementId);
if(!index) return { valid: false };
var item = { valid: true };
var scriptId = $ax.repeater.getScriptIdFromElementId(elementId);
var repeaterId = $ax.getParentRepeaterFromScriptId(scriptId);
item.repeater = repeaterInfoCache[repeaterId] ? repeaterInfoCache[repeaterId] : _getWidgetInfo(repeaterId);
$ax.repeater.setDisplayProps(item, repeaterId, index);
item.ismarked = $ax.repeater.isEditItem(repeaterId, index);
item.isvisible = Boolean($jobj(elementId).length);
return item;
};
$ax.getItemInfo = _getItemInfo;
var _getWidgetInfo = function(elementId) {
if(!elementId) return { valid: false };
elementId = _getParentElement(elementId);
//var elementAxQuery = $ax('#' + elementId);
var elementQuery = $jobj(elementId);
var obj = $obj(elementId);
var widget = { valid: true, isWidget: true, obj: obj, elementQuery: elementQuery, isLayer: $ax.public.fn.IsLayer(obj.type) };
widget.elementId = elementId;
widget.name = widget.label = (elementQuery.data('label') ? elementQuery.data('label') : '');
//widget.text = $ax('#' + elementId).text();
widget.opacity = Number(elementQuery.css('opacity')) * 100;
//widget.rotation = $ax.move.getRotationDegree(widget.elementId);
var scriptId = $ax.repeater.getScriptIdFromElementId(elementId);
var repeaterId = $ax.getParentRepeaterFromScriptId(scriptId);
if(repeaterId) widget.repeater = $ax.public.fn.IsRepeater(obj.type) ? widget : _getWidgetInfo(repeaterId);
// Right now only dynamic panel can scroll
if($ax.public.fn.IsDynamicPanel(obj.type)) {
var stateId = $ax.visibility.GetPanelState(elementId);
//can be empty when refreshing repeater and applying filter
if(stateId) {
var stateQuery = $('#' + stateId);
widget.scrollx = stateQuery.scrollLeft();
widget.scrolly = stateQuery.scrollTop();
//widget.stateQuery = stateQuery;
}
} else {
widget.scrollx = 0;
widget.scrolly = 0;
}
// repeater only props
if($ax.public.fn.IsRepeater(obj.type)) {
widget.visibleitemcount = repeaterIdToItemIds[scriptId] ? repeaterIdToItemIds[scriptId].length : $ax.repeater.getVisibleDataCount(scriptId);
widget.itemcount = $ax.repeater.getFilteredDataCount(scriptId);
widget.datacount = $ax.repeater.getDataCount(scriptId);
widget.pagecount = $ax.repeater.getPageCount(scriptId);
widget.pageindex = $ax.repeater.getPageIndex(scriptId);
}
// Get widget info funcs
//widget.elementAxQuery = function () {
// return this.elementAxQueryProp || (this.elementAxQueryProp = $ax('#' + this.elementId));
//}
//widget.isFitToContent = function () {
// if (this.isFitToContentProp === undefined) {
// if (!this.stateQuery) this.isFitToContentProp = false;
// else this.isFitToContentProp = $ax.dynamicPanelManager.isIdFitToContent(this.elementId);
// }
// return this.isFitToContentProp;
//}
widget.x = function () { return this.getProp('x'); }
widget.y = function () { return this.getProp('y'); }
widget.pagex = function () { return this.getProp('pagex'); }
widget.pagey = function () { return this.getProp('pagey'); }
widget.width = function () { return this.getProp('width'); }
widget.height = function () { return this.getProp('height'); }
widget.left = function () { return this.x(); }
widget.top = function () { return this.y(); }
widget.right = function () { return this.x() + this.width(); }
widget.bottom = function () { return this.y() + this.height(); }
widget.rotation = function () { return this.getProp('rotation'); }
widget.text = function () { return this.getProp('text'); }
widget.getProp = function (prop) {
var propName = prop + 'Prop';
if (typeof (this[propName]) != 'undefined') return this[propName];
return this[propName] = this.cacheProp(prop);
};
widget.cacheProp = function (prop) {
if(prop == 'x' || prop == 'y' || prop == 'width' || prop == 'height') {
var boundingRect = $ax('#' + this.elementId).offsetBoundingRect(true);
this.xProp = boundingRect.left;
this.yProp = boundingRect.top;
this.widthProp = boundingRect.width;
this.heightProp = boundingRect.height;
}
if(prop == 'pagex' || prop == 'pagey') {
var viewportLocation = $ax('#' + this.elementId).viewportLocation();
this.pagexProp = viewportLocation.left;
this.pageyProp = viewportLocation.top;
}
if(prop == 'rotation') {
this.rotationProp = $ax.move.getRotationDegree(this.elementId);
}
if (prop == 'text') {
this.textProp = $ax('#' + this.elementId).text();
}
return this[prop + 'Prop'];
//// I'm keeping the returned undefineds the same as before, but really I could probably return undefined right away if elementQuery is empty
//if (this.isLayer) {
// if (prop == 'pagex' || prop == 'pagey') {
// if (this.elementQuery.length > 0) {
// if (prop == 'pagex') return this.elementAxQuery().left();
// else return this.elementAxQuery().top();
// }
// return undefined; // Otherwise, it is undefined as there is no element
// }
// var boundingRect = $ax.public.fn.getWidgetBoundingRect(this.elementId);
// this.xProp = boundingRect.left;
// this.yProp = boundingRect.top;
// this.widthProp = boundingRect.width;
// this.heightProp = boundingRect.height;
// return this[prop + 'Prop'];
//}
//if (this.elementQuery.length <= 0) return prop == 'x' || prop == 'y' ? 0 : undefined;
//switch (prop) {
// case 'x': return this.elementAxQuery().locRelativeIgnoreLayer(false);
// case 'y': return this.elementAxQuery().locRelativeIgnoreLayer(true);
// case 'pagex': return this.elementAxQuery().left();
// case 'pagey': return this.elementAxQuery().top();
//}
//var val = this.elementAxQuery()[prop]();
//if (this.isFitToContent()) val = this.stateQuery[prop]();
//return val;
};
//widget.leftfixed = function() { this.getFixed('left'); }
//widget.topfixed = function() { this.getFixed('top'); }
//widget.rightfixed = function() { this.getFixed('right'); }
//widget.bottomfixed = function() { this.getFixed('bottom'); }
//widget.isFixed = function() {
// if(this.isFixedProp === undefined) this.isFixedProp = this.elementQuery.css('position') == 'fixed)';
// return this.isFixedProp;
//}
//widget.getFixed = function (prop) {
// var fixed = prop + 'fixedProp';
// if(!this.isFixed()) widget[fixed] = widget[prop]();
// if(widget[fixed] === undefined) {
// if(prop == 'left' || prop == 'right') {
// if(this.windowScrollX === undefined) this.windowScrollX = $(window).scrollLeft();
// var windowScroll = this.windowScrollX;
// } else {
// if(this.windowScrollY === undefined) this.windowScrollY = $(window).scrollTop();
// windowScroll = this.windowScrollY;
// }
// widget[fixed] = widget[prop]() - windowScroll;
// }
// return widget[fixed];
//}
return widget;
};
$ax.getWidgetInfo = _getWidgetInfo;
$ax.GetTextPanelId = function (id, create) {
if(!$ax('#' + id).SupportsRichText()) return '';
var buttonShape = $ax.GetButtonShape(id);
var panelDiv = buttonShape.find('.text')[0];
if(!panelDiv) {
if(!create) return "";
var adaptiveId = $ax.adaptive.currentViewId;
var newId = id + "_text";
//var newDiv = $('<div id="' + newId + '" class="text" style="visibility: inherit; position: absolute"></div>');
var newDiv = $('<div id="' + newId + '" class="text' + (adaptiveId ? (' ' + adaptiveId) : '') + '" style="visibility: inherit; position: absolute"><p><span></span></p></div>');
buttonShape.append(newDiv);
$ax.style.setAdaptiveStyle(id, $ax.style.computeAllOverrides(id, undefined, $ax.style.generateState(id), adaptiveId));
panelDiv = newDiv[0];
}
return panelDiv.id;
}
$ax.GetParentIdFromLink = function(id) {
return $ax.GetShapeIdFromText($jobj(id).parentsUntil('.text').parent().attr('id'));
};
$ax.GetButtonShapeId = function(id) {
var obj = $obj(id);
switch(obj.type) {
case $ax.constants.TREE_NODE_OBJECT_TYPE:
return obj.buttonShapeId ? $ax.getElementIdFromPath([obj.buttonShapeId], { relativeTo: id }) : "";
case $ax.constants.LINK_TYPE:
return "";
default:
return id;
}
};
$ax.GetButtonShape = function(id) {
return $jobj($ax.GetButtonShapeId(id));
};
$ax.GetShapeIdFromText = function(id) {
if(!id) return undefined; // this is to prevent an infinite loop.
var current = document.getElementById(id);
if(!current) return undefined;
current = current.parentElement;
while(current && current.tagName != 'BODY') {
var currentId = current.id;
if(currentId && currentId != 'base') return $ax.visibility.getWidgetFromContainer(currentId);
current = current.parentElement;
}
return undefined;
};
$ax.GetImageIdFromShape = function(id) {
var image = $ax.GetButtonShape(id).find('img[id$=img]');
if(!image.length) image = $jobj(id).find('img[id$=image_sketch]');
return image.attr('id');
};
var _getParentElement = $ax.getParentElement = function(elementId) {
var obj = $obj(elementId);
while(obj.isContained) {
var path = $ax.getPathFromScriptId($ax.repeater.getScriptIdFromElementId(elementId));
var itemId = $ax.repeater.getItemIdFromElementId(elementId);
path[path.length - 1] = obj.parent.id;
elementId = $ax.getElementIdFromPath(path, { itemNum: itemId });
obj = $obj(elementId);
}
return elementId;
};
$ax.addItemIdToRepeater = function(itemId, repeaterId) {
var itemIds = repeaterIdToItemIds[repeaterId];
if(itemIds) itemIds[itemIds.length] = itemId;
else repeaterIdToItemIds[repeaterId] = [itemId];
var scriptIds = repeaterIdToScriptIds[repeaterId];
for(var i = 0; i < scriptIds.length; i++) elementIdToObject[$ax.repeater.createElementId(scriptIds[i], itemId)] = $ax.getObjectFromScriptId(scriptIds[i]);
};
$ax.getAllElementIds = function() {
var elementIds = [];
for(var i = 0; i < _scriptIds.length; i++) {
var scriptId = _scriptIds[i];
var repeaterId = scriptIdToRepeaterId[scriptId];
if(repeaterId && repeaterId != scriptId) {
var itemIds = repeaterIdToItemIds[repeaterId] || [];
for(var j = 0; j < itemIds.length; j++) elementIds[elementIds.length] = $ax.repeater.createElementId(scriptId, itemIds[j]);
} else elementIds[elementIds.length] = scriptId;
}
return elementIds;
};
$ax.getAllScriptIds = function() {
return _scriptIds;
};
$ax.getObjectFromElementId = function(elementId) {
return $ax.getObjectFromScriptId($ax.repeater.getScriptIdFromElementId(elementId));
};
$ax.getObjectFromScriptId = function(scriptId) {
return scriptIdToObject[scriptId];
};
$ax.getParentRepeaterFromElementId = function(elementId) {
return $ax.getParentRepeaterFromScriptId($ax.repeater.getScriptIdFromElementId(elementId));
};
$ax.getParentRepeaterFromElementIdExcludeSelf = function (elementId) {
var repeaterId = $ax.getParentRepeaterFromElementId(elementId);
return repeaterId != elementId ? repeaterId : undefined;
};
$ax.getParentRepeaterFromScriptId = function(scriptId) {
return scriptIdToRepeaterId[scriptId];
};
var _getChildScriptIdsForRepeater = function(repeaterId) {
return repeaterIdToScriptIds[repeaterId];
};
var _getItemIdsForRepeater = function(repeaterId) {
return repeaterIdToItemIds[repeaterId] || [];
};
$ax.getItemIdsForRepeater = _getItemIdsForRepeater;
var _clearItemIdsForRepeater = function(repeaterId) {
repeaterIdToItemIds[repeaterId] = [];
};
$ax.clearItemsForRepeater = _clearItemIdsForRepeater;
$ax.getChildElementIdsForRepeater = function(repeaterId) {
var scriptIds = _getChildScriptIdsForRepeater(repeaterId);
var itemIds = _getItemIdsForRepeater(repeaterId);
var retVal = [];
if(!itemIds || !scriptIds) return retVal;
for(var i = 0; i < scriptIds.length; i++) {
for(var j = 0; j < itemIds.length; j++) {
retVal[retVal.length] = $ax.repeater.createElementId(scriptIds[i], itemIds[j]);
}
}
return retVal;
};
$ax.getRdoParentFromElementId = function(elementId) {
var scriptId = $ax.repeater.getScriptIdFromElementId(elementId);
var rdoId = scriptIdToPath[scriptId].parent.scriptId;
if($ax.getParentRepeaterFromScriptId(rdoId)) rdoId = $ax.repeater.createElementId(rdoId, $ax.repeater.getItemIdFromElementId(elementId));
return rdoId;
};
$ax.getLayerParentFromElementId = function (elementId) {
var itemId = $ax.repeater.getItemIdFromElementId(elementId);
var scriptId = scriptIdToParentLayer[$ax.repeater.getScriptIdFromElementId(elementId)];
return $ax.getParentRepeaterFromElementId(scriptId) ? $ax.repeater.createElementId(scriptId, itemId) : scriptId;
}
$ax.updateElementText = function(elementId, text) {
elementIdToText[elementId] = text;
};
$ax.hasElementTextChanged = function(elementId, text) {
return elementIdToText[elementId] != text;
};
$ax.updateRadioButtonSelected = function(group, elementId) {
var old = radioGroupToSelectedElementId[group];
radioGroupToSelectedElementId[group] = elementId;
return old;
};
$ax.hasRadioButtonSelectedChanged = function(group, elementId) {
return radioGroupToSelectedElementId[group] != elementId;
};
})();
//Recursively populates fullPathArray with:
// [ { idPath, scriptId }, ... ]
//for every scriptId in the object
//also populates an object of scriptId -> path
var _pathToScriptIdHelper = function(currentPath, currentChain, fullPathArray, scriptIdToPath) {
for(var key in currentPath) {
if(key != "scriptId") {
var nextPath = currentPath[key];
_pathToScriptIdHelper(nextPath, currentChain.concat(key), fullPathArray, scriptIdToPath);
nextPath.parent = currentPath;
nextPath.uniqueId = key;
} else {
fullPathArray[fullPathArray.length] = { idPath: currentChain, scriptId: currentPath.scriptId };
scriptIdToPath[currentPath.scriptId] = currentPath;
}
}
};
$ax.public.loadCurrentPage = $ax.loadCurrentPage = function(pageData) {
$ax.pageData = _pageData = pageData;
_initializePageData();
};
$ax.public.loadDocument = $ax.loadDocument = function(document) {
$ax.document = document;
_initializeDocumentData();
};
/**
Navigates to a page
*/
$ax.public.navigate = $ax.navigate = function(to) { //url, includeVariables, type) {
var targetUrl;
if(typeof (to) === 'object') {
includeVariables = to.includeVariables;
targetUrl = !includeVariables ? to.url : $ax.globalVariableProvider.getLinkUrl(to.url);
if(to.target == "new") {
window.open(targetUrl, "");
} else if(to.target == "popup") {
var features = _getPopupFeatures(to.popupOptions);
window.open(targetUrl, "", features);
} else {
var targetLocation = window.location;
if(to.target == "current") {
} else if(to.target == "parent") {
if(!top.opener) return;
targetLocation = top.opener.window.location;
} else if(to.target == "parentFrame") {
targetLocation = parent.location;
} else if(to.target == "frame") {
// targetLocation = to.frame.contentWindow.location;
$(to.frame).attr('src', targetUrl || 'about:blank');
return;
}
if (!_needsReload(targetLocation, to.url)) {
targetLocation.href = targetUrl || 'about:blank';
} else {
targetLocation.href = $axure.utils.getReloadPath() + "#" + encodeURI(targetUrl);
}
}
} else {
$ax.navigate({
url: to,
target: "current",
includeVariables: arguments[1]
});
}
};
var _needsReload = function(oldLocation, newBaseUrl) {
var reload = false;
try {
var oldUrl = oldLocation.href;
var oldBaseUrl = oldUrl.split("#")[0];
var lastslash = oldBaseUrl.lastIndexOf("/");
if(lastslash > 0) {
oldBaseUrl = oldBaseUrl.substring(lastslash + 1, oldBaseUrl.length);
if(oldBaseUrl == encodeURI(newBaseUrl)) {
reload = true;
}
}
} catch(e) {
}
return reload;
};
var _getPopupFeatures = function(options) {
var defaultOptions = {
toolbar: true,
scrollbars: true,
location: true,
status: true,
menubar: true,
directories: true,
resizable: true,
centerwindow: true,
left: -1,
top: -1,
height: -1,
width: -1
};
var selectedOptions = $.extend({}, defaultOptions, options);
var optionsList = [];
optionsList.push('toolbar=' + (selectedOptions.toolbar ? 'yes' : 'no'));
optionsList.push('scrollbars=' + (selectedOptions.scrollbars ? 'yes' : 'no'));
optionsList.push('location=' + (selectedOptions.location ? 'yes' : 'no'));
optionsList.push('status=' + (selectedOptions.status ? 'yes' : 'no'));
optionsList.push('menubar=' + (selectedOptions.menubar ? 'yes' : 'no'));
optionsList.push('directories=' + (selectedOptions.directories ? 'yes' : 'no'));
optionsList.push('resizable=' + (selectedOptions.resizable ? 'yes' : 'no'));
if(selectedOptions.centerwindow == false) {
if(selectedOptions.left > -1) {
optionsList.push('left=' + selectedOptions.left);
}
if(selectedOptions.top > -1) {
optionsList.push('top=' + selectedOptions.top);
}
}
var height = 0;
var width = 0;
if(selectedOptions.height > 0) {
optionsList.push('height=' + selectedOptions.height);
height = selectedOptions.height;
}
if(selectedOptions.width > 0) {
optionsList.push('width=' + selectedOptions.width);
width = selectedOptions.width;
}
var features = optionsList.join(',');
if(selectedOptions.centerwindow) {
var winl = (window.screen.width - width) / 2;
var wint = (window.screen.height - height) / 2;
features = features + ',left=' + winl + ',top=' + wint;
}
return features;
};
/**
Closes a window
*/
$ax.public.closeWindow = $ax.closeWindow = function() {
parent.window.close();
};
/**
Goes back
*/
$ax.public.back = $ax.back = function() {
window.history.go(-1);
};
/**
Reloads the current page.
# includeVariables: true if it should re-include the variables when the page is reloaded
*/
$ax.public.reload = $ax.reload = function(includeVariables) {
var targetUrl = (includeVariables === false)
? $axure.utils.getReloadPath() + "#" + encodeURI($ax.pageData.url)
: $axure.utils.getReloadPath() + "#" + encodeURI($ax.globalVariableProvider.getLinkUrl($ax.pageData.url));
window.location.href = targetUrl;
};
/**
Sets a variable.
# name: The name of the global variable to set
# value: The value that should be set
*/
$ax.public.setGlobalVariable = $ax.setGlobalVariable = function(name, value) {
if(!name || !value) {
return;
}
$ax.globalVariableProvider.setVariableValue(name, value);
};
/**
Gets the value of a global variable
# name: The name of the global variable value to get
*/
$ax.public.getGlobalVariable = $ax.getGlobalVariable = function(name) {
$ax.globalVariableProvider.getVariableValue(name);
};
$ax.getObjectFromElementIdDisregardHex = function (elementId) {
var elementIdInput = elementId.charAt(0) == '#' ? elementId.substring(1) : elementId;
return this.getObjectFromElementId(elementIdInput);
}
$ax.getTypeFromElementId = function(elementId) {
var obj = this.getObjectFromElementIdDisregardHex(elementId);
return obj && obj.type;
};
$ax.getNumFromPx = function(pxNum) {
return Number(pxNum.replace('px', ''));
}
});

View File

@@ -0,0 +1,256 @@
$axure.internal(function($ax) {
var widgetDragInfo = new Object();
var _drag = {};
$ax.drag = _drag;
$ax.drag.GetWidgetDragInfo = function() {
return $.extend({}, widgetDragInfo);
};
$ax.drag.StartDragWidget = function(event, id) {
$ax.setjBrowserEvent(jQuery.Event(event));
if(event.donotdrag) return;
var x, y;
var tg;
if(IE_10_AND_BELOW) {
x = window.event.clientX + window.document.documentElement.scrollLeft + window.document.body.scrollLeft;
y = window.event.clientY + window.document.documentElement.scrollTop + window.document.body.scrollTop;
tg = window.event.srcElement;
} else {
if(event.changedTouches) {
x = event.changedTouches[0].pageX;
y = event.changedTouches[0].pageY;
} else {
x = event.pageX;
y = event.pageY;
event.preventDefault();
}
tg = event.target;
}
widgetDragInfo.hasStarted = false;
widgetDragInfo.widgetId = id;
widgetDragInfo.cursorStartX = x;
widgetDragInfo.cursorStartY = y;
widgetDragInfo.lastX = x;
widgetDragInfo.lastY = y;
widgetDragInfo.currentX = x;
widgetDragInfo.currentY = y;
widgetDragInfo.movedWidgets = new Object();
widgetDragInfo.startTime = (new Date()).getTime();
widgetDragInfo.targetWidget = tg;
var movedownName = IE_10_AND_BELOW && $ax.features.supports.windowsMobile ?
$ax.features.eventNames.mouseDownName : $ax.features.eventNames.mouseMoveName;
$ax.event.addEvent(document, movedownName, _dragWidget, true);
$ax.event.addEvent(document, $ax.features.eventNames.mouseUpName, _stopDragWidget, true);
$ax.legacy.SuppressBubble(event);
};
var _dragWidget = function(event) {
$ax.setjBrowserEvent(jQuery.Event(event));
var x, y;
if(IE_10_AND_BELOW) {
x = window.event.clientX + window.document.documentElement.scrollLeft + window.document.body.scrollLeft;
y = window.event.clientY + window.document.documentElement.scrollTop + window.document.body.scrollTop;
} else {
if(event.changedTouches) {
x = event.changedTouches[0].pageX;
y = event.changedTouches[0].pageY;
//allow scroll (defaults) if only swipe events have cases and delta x is less than 5px and not blocking scrolling
var deltaX = x - widgetDragInfo.currentX;
var target = window.document.getElementById(widgetDragInfo.widgetId);
if($ax.event.hasSyntheticEvent(widgetDragInfo.widgetId, "onDrag") || $ax.event.hasSyntheticEvent(widgetDragInfo.widgetId, "onSwipeUp") ||
$ax.event.hasSyntheticEvent(widgetDragInfo.widgetId, "onSwipeDown") || (deltaX * deltaX) > 25
|| ($ax.document.configuration.preventScroll && $ax.legacy.GetScrollable(target) == window.document.body)) {
event.preventDefault();
}
} else {
x = event.pageX;
y = event.pageY;
}
}
widgetDragInfo.xDelta = x - widgetDragInfo.currentX;
widgetDragInfo.yDelta = y - widgetDragInfo.currentY;
widgetDragInfo.lastX = widgetDragInfo.currentX;
widgetDragInfo.lastY = widgetDragInfo.currentY;
widgetDragInfo.currentX = x;
widgetDragInfo.currentY = y;
widgetDragInfo.currentTime = (new Date()).getTime();
$ax.legacy.SuppressBubble(event);
if(!widgetDragInfo.hasStarted) {
widgetDragInfo.hasStarted = true;
$ax.event.raiseSyntheticEvent(widgetDragInfo.widgetId, "onDragStart");
widgetDragInfo.oldBodyCursor = window.document.body.style.cursor;
window.document.body.style.cursor = 'move';
var widget = window.document.getElementById(widgetDragInfo.widgetId);
widgetDragInfo.oldCursor = widget.style.cursor;
widget.style.cursor = 'move';
}
$ax.event.raiseSyntheticEvent(widgetDragInfo.widgetId, "onDrag");
};
var _suppressClickAfterDrag = function(event) {
_removeSuppressEvents();
$ax.legacy.SuppressBubble(event);
};
var _removeSuppressEvents = function () {
if(IE_10_AND_BELOW) {
$ax.event.removeEvent(event.srcElement, 'click', _suppressClickAfterDrag, undefined, true);
$ax.event.removeEvent(widgetDragInfo.targetWidget, 'mousemove', _removeSuppressEvents, undefined, true);
} else {
$ax.event.removeEvent(document, "click", _suppressClickAfterDrag, true);
$ax.event.removeEvent(document, 'mousemove', _removeSuppressEvents, true);
}
};
var _stopDragWidget = function(event) {
$ax.setjBrowserEvent(jQuery.Event(event));
var tg;
var movedownName = IE_10_AND_BELOW && $ax.features.supports.windowsMobile ?
$ax.features.eventNames.mouseDownName : $ax.features.eventNames.mouseMoveName;
$ax.event.removeEvent(document, movedownName, _dragWidget, true);
$ax.event.removeEvent(document, $ax.features.eventNames.mouseUpName, _stopDragWidget, true);
tg = IE_10_AND_BELOW ? window.event.srcElement : event.target;
if(widgetDragInfo.hasStarted) {
widgetDragInfo.currentTime = (new Date()).getTime();
$ax.event.raiseSyntheticEvent(widgetDragInfo.widgetId, "onDragDrop");
if($ax.globalVariableProvider.getVariableValue('totaldragx') < -30 && $ax.globalVariableProvider.getVariableValue('dragtime') < 1000) {
$ax.event.raiseSyntheticEvent(widgetDragInfo.widgetId, "onSwipeLeft");
}
if($ax.globalVariableProvider.getVariableValue('totaldragx') > 30 && $ax.globalVariableProvider.getVariableValue('dragtime') < 1000) {
$ax.event.raiseSyntheticEvent(widgetDragInfo.widgetId, "onSwipeRight");
}
var totalDragY = $ax.globalVariableProvider.getVariableValue('totaldragy');
if(totalDragY < -30 && $ax.globalVariableProvider.getVariableValue('dragtime') < 1000) {
$ax.event.raiseSyntheticEvent(widgetDragInfo.widgetId, "onSwipeUp");
}
if(totalDragY > 30 && $ax.globalVariableProvider.getVariableValue('dragtime') < 1000) {
$ax.event.raiseSyntheticEvent(widgetDragInfo.widgetId, "onSwipeDown");
}
window.document.body.style.cursor = widgetDragInfo.oldBodyCursor;
var widget = window.document.getElementById(widgetDragInfo.widgetId);
// It may be null if OnDragDrop filtered out the widget
if(widget != null) widget.style.cursor = widgetDragInfo.oldCursor;
if(widgetDragInfo.targetWidget == tg && !event.changedTouches) {
// suppress the click after the drag on desktop browsers
if(IE_10_AND_BELOW && widgetDragInfo.targetWidget) {
$ax.event.addEvent(widgetDragInfo.targetWidget, 'click', _suppressClickAfterDrag, true, true);
$ax.event.addEvent(widgetDragInfo.targetWidget, "onmousemove", _removeSuppressEvents, true, true);
} else {
$ax.event.addEvent(document, "click", _suppressClickAfterDrag, true);
$ax.event.addEvent(document, "mousemove", _removeSuppressEvents, true);
}
}
}
widgetDragInfo.hasStarted = false;
widgetDragInfo.movedWidgets = new Object();
return false;
};
$ax.drag.GetDragX = function() {
if(widgetDragInfo.hasStarted) return widgetDragInfo.xDelta;
return 0;
};
$ax.drag.GetDragY = function() {
if(widgetDragInfo.hasStarted) return widgetDragInfo.yDelta;
return 0;
};
$ax.drag.GetTotalDragX = function() {
if(widgetDragInfo.hasStarted) return widgetDragInfo.currentX - widgetDragInfo.cursorStartX;
return 0;
};
$ax.drag.GetTotalDragY = function() {
if(widgetDragInfo.hasStarted) return widgetDragInfo.currentY - widgetDragInfo.cursorStartY;
return 0;
};
$ax.drag.GetDragTime = function() {
if(widgetDragInfo.hasStarted) return widgetDragInfo.currentTime - widgetDragInfo.startTime;
return 600000;
};
$ax.drag.LogMovedWidgetForDrag = function (id, dragInfo) {
dragInfo = dragInfo || widgetDragInfo;
if(dragInfo.hasStarted) {
var containerIndex = id.indexOf('_container');
if(containerIndex != -1) id = id.substring(0, containerIndex);
// If state or other non-widget id, this should not be dragged, and should exit out to avoid exceptions.
if(!$obj(id)) return;
var query = $ax('#' + id);
//var x = query.left();
//var y = query.top();
var viewportLocation = query.viewportLocation();
var x = viewportLocation.left;
var y = viewportLocation.top;
var movedWidgets = dragInfo.movedWidgets;
if(!movedWidgets[id]) {
movedWidgets[id] = new Location(x, y);
}
}
};
var Location = function(x, y) {
this.x = x;
this.y = y;
};
$ax.drag.location = Location;
var Rectangle = $ax.drag.Rectangle = function(x, y, width, height) {
this.x = x;
this.y = y;
this.width = width;
this.height = height;
this.right = x + width;
this.bottom = y + height;
};
Rectangle.prototype.IntersectsWith = function(rect) {
if(this.Invalid()) return false;
if(rect.length) {
for(var i = 0; i < rect.length; i++) if(!rect[i].Invalid && this.IntersectsWith(rect[i])) return true;
return false;
}
if(rect.Invalid()) return false;
return this.x < rect.right && this.right > rect.x && this.y < rect.bottom && this.bottom > rect.y;
};
Rectangle.prototype.Invalid = function() {
return this.x == -1 && this.y == -1 && this.width == -1 && this.height == -1;
};
Rectangle.prototype.Move = function(x, y) {
return new Rectangle(x, y, this.width, this.height);
};
});

View File

@@ -0,0 +1,579 @@
// ******* Expr MANAGER ******** //
$axure.internal(function($ax) {
var _expr = $ax.expr = {};
var _binOpHandlers = {
'&&': function(left, right) { return _binOpOverride(left, right, function(left) { return $ax.getBool(left) && $ax.getBool(right()); }); },
'||': function(left, right) { return _binOpOverride(left, right, function(left) { return $ax.getBool(left) || $ax.getBool(right()); }); },
'==': function(left, right) { return isEqual(left, right, true); },
'!=': function(left, right) { return !isEqual(left, right, true); },
'>': function(left, right) { return _binOpNum(left, right, function(left, right) { return left > right; }); },
'<': function(left, right) { return _binOpNum(left, right, function(left, right) { return left < right; }); },
'>=': function(left, right) { return _binOpNum(left, right, function(left, right) { return left >= right; }); },
'<=': function(left, right) { return _binOpNum(left, right, function(left, right) { return left <= right; }); }
};
var checkOps = function(left, right) {
return left == undefined || right == undefined;
};
var isEqual = function (left, right, isFunction) {
if (isFunction) {
//if left and right is function, then get the value
//otherwise left and right should be already the value we want
left = left();
right = right();
}
if(checkOps(left, right)) return false;
if(left instanceof Date && right instanceof Date) {
if(left.getMilliseconds() != right.getMilliseconds()) return false;
if(left.getSeconds() != right.getSeconds()) return false;
if(left.getMinutes() != right.getMinutes()) return false;
if(left.getHours() != right.getHours()) return false;
if(left.getDate() != right.getDate()) return false;
if(left.getMonth() != right.getMonth()) return false;
if(left.getYear() != right.getYear()) return false;
return true;
}
if(left instanceof Object && right instanceof Object) {
var prop;
// Go through all of lefts properties and compare them to rights.
for(prop in left) {
if(!left.hasOwnProperty(prop)) continue;
// If left has a property that the right doesn't they are not equal.
if(!right.hasOwnProperty(prop)) return false;
// If any of their properties are not equal, they are not equal.
if(!isEqual(left[prop], right[prop], false)) return false;
}
for(prop in right) {
// final check to make sure right doesn't have some extra properties that make them not equal.
if(left.hasOwnProperty(prop) != right.hasOwnProperty(prop)) return false;
}
return true;
}
return $ax.getBool(left) == $ax.getBool(right);
};
var _binOpOverride = function(left, right, func) {
left = left();
if(left == undefined) return false;
var res = func(left, right);
return res == undefined ? false : res;
};
var _binOpNum = function(left, right, func) {
var left = left();
var right = right();
if(checkOps(left, right)) return false;
return func(left, Number(right));
};
var _exprHandlers = {};
_exprHandlers.array = function(expr, eventInfo) {
var returnVal = [];
for(var i = 0; i < expr.items.length; i++) {
returnVal[returnVal.length] = _evaluateExpr(expr.items[i], eventInfo);
}
return returnVal;
};
_exprHandlers.binaryOp = function(expr, eventInfo) {
var left = function() { return expr.leftExpr && _evaluateExpr(expr.leftExpr, eventInfo); };
var right = function() { return expr.rightExpr && _evaluateExpr(expr.rightExpr, eventInfo); };
if(left == undefined || right == undefined) return false;
return _binOpHandlers[expr.op](left, right);
};
_exprHandlers.block = function(expr, eventInfo) {
var subExprs = expr.subExprs;
for(var i = 0; i < subExprs.length; i++) {
_evaluateExpr(subExprs[i], eventInfo); //ignore the result
}
};
_exprHandlers.booleanLiteral = function(expr) {
return expr.value;
};
_exprHandlers.nullLiteral = function() { return null; };
_exprHandlers.pathLiteral = function(expr, eventInfo) {
if(expr.isThis) return [eventInfo.srcElement];
if(expr.isFocused && window.lastFocusedControl) {
$ax('#' + window.lastFocusedControl).focus();
return [window.lastFocusedControl];
}
if(expr.isTarget) return [eventInfo.targetElement];
return $ax.getElementIdsFromPath(expr.value, eventInfo);
};
_exprHandlers.panelDiagramLiteral = function(expr, eventInfo) {
var elementIds = $ax.getElementIdsFromPath(expr.panelPath, eventInfo);
var elementIdsWithSuffix = [];
var suffix = '_state' + expr.panelIndex;
for(var i = 0; i < elementIds.length; i++) {
elementIdsWithSuffix[i] = $ax.repeater.applySuffixToElementId(elementIds[i], suffix);
}
return String($jobj(elementIdsWithSuffix).data('label'));
};
_exprHandlers.fcall = function(expr, eventInfo) {
var oldTarget = eventInfo.targetElement;
var targets = [];
var fcallArgs = [];
var exprArgs = expr.arguments;
for(var i = 0; i < expr.arguments.length; i++) {
var exprArg = exprArgs[i];
var fcallArg = '';
if(targets.length) {
for(var j = 0; j < targets.length; j++) {
if(exprArg == null) {
fcallArgs[j][i] = null;
continue;
}
eventInfo.targetElement = targets[j];
fcallArg = _evaluateExpr(exprArg, eventInfo);
if(typeof (fcallArg) == 'undefined') return '';
fcallArgs[j][i] = fcallArg;
}
} else {
if(exprArg == null) {
fcallArgs[i] = null;
continue;
}
fcallArg = _evaluateExpr(exprArg, eventInfo);
if(typeof (fcallArg) == 'undefined') return '';
fcallArgs[i] = fcallArg;
}
// We do support null exprArgs...
// TODO: This makes 2 assumptions that may change in the future. 1. The pathLiteral is the always the first arg. 2. there is always only 1 pathLiteral
if(exprArg && exprArg.exprType == 'pathLiteral') {
targets = fcallArg;
// fcallArgs is now an array of an array of args
for(j = 0; j < targets.length; j++) fcallArgs[j] = [[fcallArg[j]]];
}
}
// we want to preserve the target element from outside this function.
eventInfo.targetElement = oldTarget;
var retval = '';
if(targets.length) {
// Go backwards so retval is the first item.
for(i = targets.length - 1; i >= 0; i--) {
var args = fcallArgs[i];
// Add event info to the end
args[args.length] = eventInfo;
retval = _exprFunctions[expr.functionName].apply(this, args);
}
} else fcallArgs[fcallArgs.length] = eventInfo;
return targets.length ? retval : _exprFunctions[expr.functionName].apply(this, fcallArgs);
};
_exprHandlers.globalVariableLiteral = function(expr) {
return expr.variableName;
};
_exprHandlers.keyPressLiteral = function(expr) {
var keyInfo = {};
keyInfo.keyCode = expr.keyCode;
keyInfo.ctrl = expr.ctrl;
keyInfo.alt = expr.alt;
keyInfo.shift = expr.shift;
return keyInfo;
};
_exprHandlers.adaptiveViewLiteral = function(expr) {
return expr.id;
};
_exprHandlers.optionLiteral = function(expr) {
return expr.value;
}
var _substituteSTOs = function(expr, eventInfo) {
//first evaluate the local variables
var scope = {};
for(var varName in expr.localVariables) {
scope[varName] = $ax.expr.evaluateExpr(expr.localVariables[varName], eventInfo);
}
// TODO: [ben] Date and data object (obj with info for url or image) both need to return non-strings.
var i = 0;
var retval;
var retvalString = expr.value.replace(/\[\[(?!\[)(.*?)\]\](?=\]*)/g, function(match) {
var sto = expr.stos[i++];
if(sto.sto == 'error') return match;
try {
var result = $ax.evaluateSTO(sto, scope, eventInfo);
} catch(e) {
return match;
}
if((result instanceof Object) && i == 1 && expr.value.substring(0, 2) == '[[' &&
expr.value.substring(expr.value.length - 2) == ']]') {
// If the result was an object, this was the first result, and the whole thing was this expresion.
retval = result;
}
return ((result instanceof Object) && (result.label || result.text)) || result;
});
// If more than one group returned, the object is not valid
if(i != 1) retval = false;
return retval || retvalString;
};
_exprHandlers.htmlLiteral = function (expr, eventInfo) {
eventInfo.htmlLiteral = true;
var html = _substituteSTOs(expr, eventInfo);
eventInfo.htmlLiteral = false
return html;
};
_exprHandlers.stringLiteral = function(expr, eventInfo) {
return _substituteSTOs(expr, eventInfo);
};
var _exprFunctions = {};
_exprFunctions.SetCheckState = function(elementIds, value) {
var toggle = value == 'toggle';
var boolValue = Boolean(value) && value != 'false';
for(var i = 0; i < elementIds.length; i++) {
var query = $ax('#' + elementIds[i]);
query.selected(toggle ? !query.selected() : boolValue);
}
};
_exprFunctions.SetSelectedOption = function(elementIds, value) {
for(var i = 0; i < elementIds.length; i++) {
var elementId = elementIds[i];
var obj = $jobj($ax.INPUT(elementId));
if(obj.val() == value) return;
obj.val(value);
if($ax.event.HasSelectionChanged($ax.getObjectFromElementId(elementId))) $ax.event.raiseSyntheticEvent(elementId, 'onSelectionChange');
}
};
_exprFunctions.SetGlobalVariableValue = function(varName, value) {
$ax.globalVariableProvider.setVariableValue(varName, value);
};
_exprFunctions.SetWidgetFormText = function(elementIds, value) {
for(var i = 0; i < elementIds.length; i++) {
var elementId = elementIds[i];
var inputId = $ax.repeater.applySuffixToElementId(elementId, '_input');
var obj = $jobj(inputId);
if(obj.val() == value || (value == '' && $ax.placeholderManager.isActive(elementId))) return;
obj.val(value);
$ax.placeholderManager.updatePlaceholder(elementId, !value);
if($ax.event.HasTextChanged($ax.getObjectFromElementId(elementId))) $ax.event.TryFireTextChanged(elementId);
}
};
_exprFunctions.SetFocusedWidgetText = function(elementId, value) {
if(window.lastFocusedControl) {
var elementId = window.lastFocusedControl;
var type = $obj(elementId).type;
if ($ax.public.fn.IsTextBox(type) || $ax.public.fn.IsTextArea(type)) _exprFunctions.SetWidgetFormText([elementId], value);
else _exprFunctions.SetWidgetRichText([elementId], value, true);
}
};
_exprFunctions.GetRtfElementHeight = function(rtfElement) {
if(rtfElement.innerHTML == '') rtfElement.innerHTML = '&nbsp;';
return rtfElement.offsetHeight;
};
_exprFunctions.SetWidgetRichText = function(ids, value, plain) {
// Converts dates, widgetinfo, and the like to strings.
value = _exprFunctions.ToString(value);
//Replace any newlines with line breaks
var finalValue = value.replace(/\r\n/g, '<br>').replace(/\n/g, '<br>');
for(var i = 0; i < ids.length; i++) {
var id = ids[i];
// If calling this on button shape, get the id of the rich text panel inside instead
if($obj(id).type !== $ax.constants.LINK_TYPE) id = $ax.GetTextPanelId(id, true);
var element = window.document.getElementById(id);
$ax.visibility.SetVisible(element, value != '');
$ax.style.transformTextWithVerticalAlignment(id, function() {
var spans = $jobj(id).find('span');
if(plain) {
// Can't set value as text because '<br/>' doesn't actually do a line break
// Can't set vaule as html because it doesn't like '<' and ignores all after it
// Create tags yourself
var lines = value.split(/\r\n|\n/);
//if we are dealing with only one line, just reuse the old one
if(spans.length === 1 && lines.length === 1) {
$(spans[0]).text(value);
return;
}
// Wrap in span and p, style them accordingly.
var span = $('<span></span>');
if(spans.length > 0) {
span.attr('style', $(spans[0]).attr('style'));
span.attr('id', $(spans[0]).attr('id'));
}
if(lines.length == 1) span.text(value);
else {
for(var i = 0; i < lines.length; i++) {
if(i != 0) span.append($('<br />'));
var line = lines[i];
if(line.length == 0) continue;
var subSpan = $('<span />');
subSpan.text(line);
span.append(subSpan);
}
}
var ps = $jobj(id).find('p');
if(ps && ps.length) {
ps[0].innerHTML = $('<div></div>').append(span).html();;
if(ps.length > 1) {
for(var i = 1; i < ps.length; i++) {
$(ps[i]).remove();
}
}
} else {
var p = $('<p></p>');
p.append(span);
element.innerHTML = $('<div></div>').append(p).html();
}
} else element.innerHTML = finalValue;
});
if(!plain) $ax.style.CacheOriginalText(id, true);
}
};
_exprFunctions.GetCheckState = function(ids) {
return $ax('#' + ids[0]).selected();
};
_exprFunctions.GetDisabledState = function (ids) {
return !$ax('#' + ids[0]).enabled();
};
_exprFunctions.GetSelectedOption = function (ids) {
var inputs = $jobj($ax.INPUT(ids[0]));
return inputs.length ? inputs[0].value : '';
};
_exprFunctions.GetNum = function(str) {
//Setting a GlobalVariable to some blank text then setting a widget to the value of that variable would result in 0 not ""
//I have fixed this another way so commenting this should be fine now
//if (!str) return "";
return isNaN(str) ? str : Number(str);
};
_exprFunctions.GetGlobalVariableValue = function(id) {
return $ax.globalVariableProvider.getVariableValue(id);
};
_exprFunctions.GetGlobalVariableLength = function(id) {
return _exprFunctions.GetGlobalVariableValue(id).length;
};
_exprFunctions.GetWidgetText = function(ids) {
if($ax.placeholderManager.isActive(ids[0])) return '';
var input = $ax.INPUT(ids[0]);
return $ax('#' + ($jobj(input).length ? input : ids[0])).text();
};
_exprFunctions.GetFocusedWidgetText = function() {
if(window.lastFocusedControl) {
return $ax('#' + window.lastFocusedControl).text();
} else {
return "";
}
};
_exprFunctions.GetWidgetValueLength = function(ids) {
var id = ids[0];
if(!id) return undefined;
if($ax.placeholderManager.isActive(id)) return 0;
var obj = $jobj($ax.INPUT(id));
if(!obj.length) obj = $jobj(id);
var val = obj[0].value || _exprFunctions.GetWidgetText([id]);
return val.length;
};
_exprFunctions.GetPanelState = function(ids) {
var id = ids[0];
if(!id) return undefined;
var stateId = $ax.visibility.GetPanelState(id);
return stateId && String($jobj(stateId).data('label'));
};
_exprFunctions.GetWidgetVisibility = function(ids) {
var id = ids[0];
if(!id) return undefined;
return $ax.visibility.IsIdVisible(id);
};
// ***************** Validation Functions ***************** //
_exprFunctions.IsValueAlpha = function(val) {
var isAlphaRegex = new RegExp("^[a-z\\s]+$", "gi");
return isAlphaRegex.test(val);
};
_exprFunctions.IsValueNumeric = function(val) {
var isNumericRegex = new RegExp("^[0-9,\\.\\s]+$", "gi");
return isNumericRegex.test(val);
};
_exprFunctions.IsValueAlphaNumeric = function(val) {
var isAlphaNumericRegex = new RegExp("^[0-9a-z\\s]+$", "gi");
return isAlphaNumericRegex.test(val);
};
_exprFunctions.IsValueOneOf = function(val, values) {
for(var i = 0; i < values.length; i++) {
var option = values[i];
if(val == option) return true;
}
//by default, return false
return false;
};
_exprFunctions.IsValueNotAlpha = function(val) {
return !_exprFunctions.IsValueAlpha(val);
};
_exprFunctions.IsValueNotNumeric = function(val) {
return !_exprFunctions.IsValueNumeric(val);
};
_exprFunctions.IsValueNotAlphaNumeric = function(val) {
return !_exprFunctions.IsValueAlphaNumeric(val);
};
_exprFunctions.IsValueNotOneOf = function(val, values) {
return !_exprFunctions.IsValueOneOf(val, values);
};
_exprFunctions.GetKeyPressed = function(eventInfo) {
return eventInfo.keyInfo;
};
_exprFunctions.GetCursorRectangles = function() {
var rects = new Object();
rects.lastRect = new $ax.drag.Rectangle($ax.lastMouseLocation.x, $ax.lastMouseLocation.y, 1, 1);
rects.currentRect = new $ax.drag.Rectangle($ax.mouseLocation.x, $ax.mouseLocation.y, 1, 1);
return rects;
};
_exprFunctions.GetWidgetRectangles = function (elementIds, eventInfo) {
var elementId = elementIds[0];
var rects = new Object();
var jObj = $jobj(elementId);
var invalid = jObj.length == 0;
var parent = jObj;
// Or are in valid if no obj can be found, or if it is not visible.
while(parent.length != 0 && !parent.is('body')) {
if(parent.css('display') == 'none') {
invalid = true;
break;
}
parent = parent.parent();
}
if(invalid) {
rects.lastRect = rects.currentRect = new $ax.drag.Rectangle(-1, -1, -1, -1);
return rects;
}
var axObj = $ax('#' + elementId);
var boundingRect = axObj.viewportBoundingRect();
rects.lastRect = new $ax.drag.Rectangle(
boundingRect.left,
boundingRect.top,
boundingRect.width,
boundingRect.height);
//rects.lastRect = new $ax.drag.Rectangle(
// axObj.left(),
// axObj.top(),
// axObj.width(),
// axObj.height());
rects.currentRect = rects.lastRect;
return rects;
};
_exprFunctions.GetWidget = function(elementId) {
return $ax.getWidgetInfo(elementId[0]);
};
_exprFunctions.GetAdaptiveView = function (eventInfo) {
if (eventInfo && eventInfo.srcElement) {
var id = eventInfo.srcElement;
var diagramObject = $ax.getObjectFromElementId(id);
if (diagramObject.owner.type == 'Axure:Master') {
var viewIdChain = $ax.style.getViewIdChain($ax.adaptive.currentViewId || '', id, diagramObject);
if (viewIdChain.length > 0) return viewIdChain[viewIdChain.length - 1];
else return '19e82109f102476f933582835c373474';
}
}
return $ax.adaptive.currentViewId || '';
};
_exprFunctions.IsEntering = function(movingRects, targetRects) {
return !movingRects.lastRect.IntersectsWith(targetRects.currentRect) && movingRects.currentRect.IntersectsWith(targetRects.currentRect);
};
_exprFunctions.IsLeaving = function(movingRects, targetRects) {
return movingRects.lastRect.IntersectsWith(targetRects.currentRect) && !movingRects.currentRect.IntersectsWith(targetRects.currentRect);
};
var _IsOver = _exprFunctions.IsOver = function(movingRects, targetRects) {
return movingRects.currentRect.IntersectsWith(targetRects.currentRect);
};
_exprFunctions.IsNotOver = function(movingRects, targetRects) {
return !_IsOver(movingRects, targetRects);
};
_exprFunctions.ValueContains = function(inputString, value) {
return inputString.indexOf(value) > -1;
};
_exprFunctions.ValueNotContains = function(inputString, value) {
return !_exprFunctions.ValueContains(inputString, value);
};
_exprFunctions.ToString = function(value) {
if(value.isWidget) {
return value.text;
}
return String(value);
};
var _evaluateExpr = $ax.expr.evaluateExpr = function(expr, eventInfo, toString) {
if(expr === undefined || expr === null) return undefined;
var result = _exprHandlers[expr.exprType](expr, eventInfo);
return toString ? _exprFunctions.ToString(result) : result;
};
});

View File

@@ -0,0 +1,286 @@
// ******* Flyout MANAGER ******** //
$axure.internal(function($ax) {
var _flyoutManager = $ax.flyoutManager = {};
var getFlyoutLabel = function(panelId) {
return panelId + '_flyout';
};
var _unregisterPanel = function(panelId, keepShown) {
$ax.geometry.unregister(getFlyoutLabel(panelId));
if(panelToSrc[panelId]) {
$ax.style.RemoveRolloverOverride(panelToSrc[panelId]);
delete panelToSrc[panelId];
}
if(!keepShown) {
$ax.action.addAnimation(panelId, $ax.action.queueTypes.fade, function() {
$ax('#' + panelId).hide();
});
}
};
_flyoutManager.unregisterPanel = _unregisterPanel;
var genPoint = $ax.geometry.genPoint;
var _updateFlyout = function(panelId) {
var label = getFlyoutLabel(panelId);
if(!$ax.geometry.polygonRegistered(label)) return;
var info = $ax.geometry.getPolygonInfo(label);
var rects = info && info.rects;
var targetWidget = $ax.getWidgetInfo(panelId);
rects.target = $ax.geometry.genRect(targetWidget);
// Src will stay the same, just updating
$ax.flyoutManager.registerFlyout(rects, panelId, panelToSrc[panelId]);
if(!$ax.geometry.checkInsideRegion(label)) _unregisterPanel(panelId);
};
_flyoutManager.updateFlyout = _updateFlyout;
var panelToSrc = {};
var _registerFlyout = function(rects, panelId, srcId) {
var label = _getFlyoutLabel(panelId);
var callback = function(info) {
// If leaving object or already outside it, then unregister, otherwise just return
if(!info.exiting && !info.outside) return;
_unregisterPanel(panelId);
};
var points = [];
var lastSrcId = panelToSrc[panelId];
if(lastSrcId != srcId) {
if(lastSrcId) $ax.style.RemoveRolloverOverride(lastSrcId);
if(srcId) {
$ax.style.AddRolloverOverride(srcId);
panelToSrc[panelId] = srcId;
} else delete panelToSrc[panelId];
}
// rects should be one or two rectangles
if(!rects.src) {
var rect = rects.target;
points.push(genPoint(rect.Left(), rect.Top()));
points.push(genPoint(rect.Right(), rect.Top()));
points.push(genPoint(rect.Right(), rect.Bottom()));
points.push(genPoint(rect.Left(), rect.Bottom()));
} else {
var r0 = rects.src;
var r1 = rects.target;
// Right left of right, left right of left, top below top, bottom above bottom
var rlr = r0.Right() <= r1.Right();
var lrl = r0.Left() >= r1.Left();
var tbt = r0.Top() >= r1.Top();
var bab = r0.Bottom() <= r1.Bottom();
var info = { rlr: rlr, lrl: lrl, tbt: tbt, bab: bab };
if((rlr && lrl) || (tbt && bab)) {
points = getSmallPolygon(r0, r1, info);
} else {
points = getLargePolygon(r0, r1, info);
}
}
$ax.geometry.registerPolygon(label, points, callback, { rects: rects });
};
_flyoutManager.registerFlyout = _registerFlyout;
var _getFlyoutLabel = function(panelId) {
return panelId + '_flyout';
};
var _reregisterAllFlyouts = function() {
for(var panelId in panelToSrc) _reregisterFlyout(panelId);
};
_flyoutManager.reregisterAllFlyouts = _reregisterAllFlyouts;
var _reregisterFlyout = function(panelId) {
var rects = $ax.geometry.getPolygonInfo(getFlyoutLabel(panelId)).rects;
_registerFlyout(rects, panelId, panelToSrc[panelId]);
};
// This is the reduced size polygon connecting r0 to r1 by means of horizontal or vertical lines.
var getSmallPolygon = function(r0, r1, info) {
var points = [];
// NOTE: currently I make the assumption that if horizontal/vertical connecting lines from the src hit the target
// Meaning if horizontal, rlr and lrl are true, and if vertical, tbt and bab are true.
var r0Left = r0.Left();
var r0Right = r0.Right();
var r0Top = r0.Top();
var r0Bottom = r0.Bottom();
var r1Left = r1.Left();
var r1Right = r1.Right();
var r1Top = r1.Top();
var r1Bottom = r1.Bottom();
points.push(genPoint(r1Left, r1Top));
if(!info.tbt) {
points.push(genPoint(r0Left, r1Top));
points.push(genPoint(r0Left, r0Top));
points.push(genPoint(r0Right, r0Top));
points.push(genPoint(r0Right, r1Top));
}
points.push(genPoint(r1Right, r1Top));
if(!info.rlr) {
points.push(genPoint(r1Right, r0Top));
points.push(genPoint(r0Right, r0Top));
points.push(genPoint(r0Right, r0Bottom));
points.push(genPoint(r1Right, r0Bottom));
}
points.push(genPoint(r1Right, r1Bottom));
if(!info.bab) {
points.push(genPoint(r0Right, r1Bottom));
points.push(genPoint(r0Right, r0Bottom));
points.push(genPoint(r0Left, r0Bottom));
points.push(genPoint(r0Left, r1Bottom));
}
points.push(genPoint(r1Left, r1Bottom));
if(!info.lrl) {
points.push(genPoint(r1Left, r0Bottom));
points.push(genPoint(r0Left, r0Bottom));
points.push(genPoint(r0Left, r0Top));
points.push(genPoint(r1Left, r0Top));
}
return points;
};
// This is the original algorithm that connects the most extream corners to make polygon
var getLargePolygon = function(r0, r1, info) {
var points = [];
var r0Left = r0.Left();
var r0Right = r0.Right();
var r0Top = r0.Top();
var r0Bottom = r0.Bottom();
var r1Left = r1.Left();
var r1Right = r1.Right();
var r1Top = r1.Top();
var r1Bottom = r1.Bottom();
// Top lefts
if(info.tbt) {
if(!info.lrl) points.push(genPoint(r0Left, r0Top));
points.push(genPoint(r1Left, r1Top));
} else {
if(info.lrl) points.push(genPoint(r1Left, r1Top));
points.push(genPoint(r0Left, r0Top));
}
// Top rights
if(info.tbt) {
points.push(genPoint(r1Right, r1Top));
if(!info.rlr) points.push(genPoint(r0Right, r0Top));
} else {
points.push(genPoint(r0Right, r0Top));
if(info.rlr) points.push(genPoint(r1Right, r1Top));
}
// Bottom rights
if(info.bab) {
if(!info.rlr) points.push(genPoint(r0Right, r0Bottom));
points.push(genPoint(r1Right, r1Bottom));
} else {
if(info.rlr) points.push(genPoint(r1Right, r1Bottom));
points.push(genPoint(r0Right, r0Bottom));
}
// Bottom Lefts
if(info.bab) {
points.push(genPoint(r1Left, r1Bottom));
if(!info.lrl) points.push(genPoint(r0Left, r0Bottom));
} else {
points.push(genPoint(r0Left, r0Bottom));
if(info.lrl) points.push(genPoint(r1Left, r1Bottom));
}
return points;
};
});
// ******* Placeholder Manager ********* //
$axure.internal(function($ax) {
var _placeholderManager = $ax.placeholderManager = {};
var idToPlaceholderInfo = {};
var _registerPlaceholder = function(elementId, text, password) {
idToPlaceholderInfo[elementId] = { text: text, password: password, active: false };
};
_placeholderManager.registerPlaceholder = _registerPlaceholder;
_placeholderManager.refreshPlaceholder = function (elementId) {
var info = idToPlaceholderInfo[elementId];
if (!info || !info.active) return;
$ax.style.SetWidgetPlaceholder(elementId, true, info.text, info.password);
}
var _updatePlaceholder = function(elementId, active, clearText) {
var inputId = $ax.repeater.applySuffixToElementId(elementId, '_input');
var info = idToPlaceholderInfo[elementId];
if(!info || info.active == active) return;
info.active = active;
if(active) var text = info.text;
else if(!ANDROID) text = clearText ? '' : document.getElementById(inputId).value;
else {
var currentText = document.getElementById(inputId).value;
if(!clearText) text = currentText;
else if(currentText == info.text) text = "";
else {
var lastIndex = currentText.lastIndexOf(info.text);
//here i am assuming the text is always inserted in front
text = currentText.substring(0, lastIndex);
}
}
$ax.style.SetWidgetPlaceholder(elementId, active, text, info.password);
};
_placeholderManager.updatePlaceholder = _updatePlaceholder;
var _isActive = function(elementId) {
var info = idToPlaceholderInfo[elementId];
return Boolean(info && info.active);
};
_placeholderManager.isActive = _isActive;
var _selectRange = function(elementId, start, end) {
$jobj(elementId).each(function() {
if(this.setSelectionRange) {
var validTypes = ["text", "search", "url", "tel", "password"];
if(this.tagName.toLowerCase() != "input" || validTypes.indexOf(this.type) > -1) {
this.focus();
this.setSelectionRange(start, end);
}
} else if(this.createTextRange) {
var range = this.createTextRange();
range.collapse(true);
range.moveEnd('character', end);
range.moveStart('character', start);
range.select();
}
});
};
_placeholderManager.selectRange = _selectRange;
var _moveCaret = function(id, index) {
var inputIndex = id.indexOf('_input');
if(inputIndex == -1) return;
var inputId = id.substring(0, inputIndex);
if(!_isActive(inputId)) return;
_selectRange(id, index, index);
};
_placeholderManager.moveCaret = _moveCaret;
});

View File

@@ -0,0 +1,301 @@
// ******* Region MANAGER ******** //
$axure.internal(function($ax) {
var _geometry = $ax.geometry = {};
var regionMap = {};
var regionList = [];
var _unregister = function(label) {
var regionIndex = regionList.indexOf(label);
if(regionIndex != -1) {
var end = $ax.splice(regionList, regionIndex + 1);
$ax.splice(regionList, regionIndex, regionList.length - regionIndex);
regionList = regionList.concat(end);
}
delete regionMap[label];
};
_geometry.unregister = _unregister;
var clear = function() {
regionMap = {};
regionList = [];
};
var _polygonRegistered = function(label) {
return Boolean(regionMap[label]);
};
_geometry.polygonRegistered = _polygonRegistered;
// Must be counterclockwise, or enter/exit will be wrong
var _registerPolygon = function(label, points, callback, info) {
var regionIndex = regionList.indexOf(label);
if(regionIndex == -1) regionList.push(label);
regionMap[label] = { points: points, callback: callback, info: info };
};
_geometry.registerPolygon = _registerPolygon;
var _getPolygonInfo = function(label) {
if(!_polygonRegistered(label)) return undefined;
return regionMap[label].info;
};
_geometry.getPolygonInfo = _getPolygonInfo;
var _genRect = function(info, roundHalfPixel) {
var x = info.pagex();
var y = info.pagey();
var w = info.width();
var h = info.height();
if(roundHalfPixel) {
if(x % 1 != 0) {
x = Math.floor(x);
w++;
}
if(y % 1 != 0) {
y = Math.floor(y);
h++;
}
}
var r = x + w;
var b = y + h;
var rect = {
X: function() { return x; },
Y: function() { return y; },
Wigth: function() { return w; },
Height: function() { return h; },
Left: function() { return x; },
Right: function() { return r; },
Top: function() { return y; },
Bottom: function() { return b; }
};
return rect;
};
_geometry.genRect = _genRect;
var _genPoint = function(x, y) {
return { x: x, y: y };
};
_geometry.genPoint = _genPoint;
var oldPoint = _genPoint(0, 0);
_geometry.tick = function(x, y, end) {
var lastPoint = oldPoint;
var nextPoint = oldPoint = _genPoint(x, y);
var line = { p1: lastPoint, p2: nextPoint };
if(!regionList.length) return;
for(var i = 0; i < regionList.length; i++) {
var region = regionMap[regionList[i]];
var points = region.points;
if(!region.checked) {
if(!_checkInside(points, $ax.mouseLocation)) {
region.callback({ outside: true });
continue;
}
region.checked = true;
}
for(var j = 0; j < points.length; j++) {
var startSegment = points[j];
var endSegment = points[(j + 1) % points.length];
var intersectInfo = linesIntersect(line, { p1: startSegment, p2: endSegment });
if(intersectInfo) {
region.callback(intersectInfo);
break;
}
}
}
if(end) clear();
};
// Info if the one line touches the other (even barely), false otherwise
// Info includes point, if l1 is entering or exiting l2, and any ties that happened, or parallel info
var linesIntersect = function(l1, l2) {
var retval = {};
var ties = {};
var l1p1 = l1.p1.x < l1.p2.x || (l1.p1.x == l1.p2.x && l1.p1.y < l1.p2.y) ? l1.p1 : l1.p2;
var l1p2 = l1.p1.x < l1.p2.x || (l1.p1.x == l1.p2.x && l1.p1.y < l1.p2.y) ? l1.p2 : l1.p1;
var m1 = (l1p2.y - l1p1.y) / (l1p2.x - l1p1.x);
var l2p1 = l2.p1.x < l2.p2.x || (l2.p1.x == l2.p2.x && l2.p1.y < l2.p2.y) ? l2.p1 : l2.p2;
var l2p2 = l2.p1.x < l2.p2.x || (l2.p1.x == l2.p2.x && l2.p1.y < l2.p2.y) ? l2.p2 : l2.p1;
var m2 = (l2p2.y - l2p1.y) / (l2p2.x - l2p1.x);
var l1Vert = l1.p1.x == l1.p2.x;
var l2Vert = l2.p1.x == l2.p2.x;
if(l1Vert || l2Vert) {
if(l1Vert && l2Vert) {
// If the lines don't follow the same path, return
if(l1p1.x != l2p1.x) return false;
// if they never meet, return
if(l1p2.y < l2p1.y || l1p1.y > l2p2.y) return false;
var firstVert = l1p1.y >= l2p1.y ? l1p1 : l2p1;
var secondVert = l1p2.y <= l2p2.y ? l1p2 : l2p2;
// First is from the perspective of l1
retval.parallel = {
first: l1p1 == l1.p1 ? firstVert : secondVert,
second: l1p2 == l1.p2 ? secondVert : firstVert,
sameDirection: (l1p1 == l1.p1) == (l2p1 == l2.p1)
};
return retval;
}
var x1 = l2Vert ? l1p1.x : l2p1.x;
var x2 = l2Vert ? l1p2.x : l2p2.x;
var xVert = l2Vert ? l2p1.x : l1p1.x;
var y = l2Vert ? l1p1.y + (xVert - x1) * m1 : l2p1.y + (xVert - x1) * m2;
var y1 = l2Vert ? l2p1.y : l1p1.y;
var y2 = l2Vert ? l2p2.y : l1p2.y;
if(xVert >= x1 && xVert <= x2 && y >= y1 && y <= y2) {
retval.point = { x: xVert, y: y };
retval.exiting = l2Vert == (y1 == (l2Vert ? l2.p1.y : l1.p1.y)) == (x1 == (l2Vert ? l1.p1.x : l2.p1.x));
retval.entering = !retval.exiting;
// Calculate ties
if(x1 == xVert) {
ties[l2Vert ? 'l1' : 'l2'] = (x1 == (l2Vert ? l1.p1.x : l2.p1.x)) ? 'start' : 'end';
retval.ties = ties;
} else if(x2 == xVert) {
ties[l2Vert ? 'l1' : 'l2'] = (x2 == (l2Vert ? l1.p2.x : l2.p2.x)) ? 'end' : 'start';
retval.ties = ties;
}
if(y1 == y) {
ties[l2Vert ? 'l2' : 'l1'] = (y1 == (l2Vert ? l2.p1.y : l1.p1.y)) ? 'start' : 'end';
retval.ties = ties;
} else if(y2 == y) {
ties[l2Vert ? 'l2' : 'l1'] = (y2 == (l2Vert ? l2.p2.y : l1.p2.y)) ? 'end' : 'start';
retval.ties = ties;
}
return retval;
}
return false;
}
// If here, no vertical lines
if(m1 == m2) {
// If the lines don't follow the same path, return
if(l1p1.y != (l2p1.y + (l1p1.x - l2p1.x) * m1)) return false;
// if they never meet, return
if(l1p2.x < l2p1.x || l1p1.x > l2p2.x) return false;
var first = l1p1.x >= l2p1.x ? l1p1 : l2p1;
var second = l1p2.x <= l2p2.x ? l1p2 : l2p2;
// First is from the perspective of l1
retval.parallel = {
first: l1p1 == l1.p1 ? first : second,
second: l1p2 == l1.p2 ? second : first,
sameDirection: (l1p1 == l1.p1) == (l2p1 == l2.p1)
};
return retval;
}
var x = (l2p1.y - l2p1.x * m2 - l1p1.y + l1p1.x * m1) / (m1 - m2);
// Check if x is out of bounds
if(x >= l1p1.x && x <= l1p2.x && x >= l2p1.x && x <= l2p2.x) {
var y = l1p1.y + (x - l1p1.x) * m1;
retval.point = { x: x, y: y };
retval.entering = m1 > m2 == (l1p1 == l1.p1) == (l2p1 == l2.p1);
retval.exiting = !retval.entering;
// Calculate ties
if(l1.p1.x == x) {
ties.l1 = 'start';
retval.ties = ties;
} else if(l1.p2.x == x) {
ties.l1 = 'end';
retval.ties = ties;
}
if(l2.p1.x == x) {
ties.l2 = 'start';
retval.ties = ties;
} else if(l2.p2.x == x) {
ties.l2 = 'end';
retval.ties = ties;
}
return retval;
}
return false;
};
var _checkInsideRegion = function(label, point) {
if(!_polygonRegistered(label)) return false;
return _checkInside(regionMap[label].points, point || $ax.mouseLocation);
};
_geometry.checkInsideRegion = _checkInsideRegion;
// Returns true if point is inside the polygon, including ties
var _checkInside = function(polygon, point) {
// Make horizontal line wider than the polygon, with the y of point to test location
var firstX = polygon[0].x;
var secondX = firstX;
var i;
for(i = 1; i < polygon.length; i++) {
var polyX = polygon[i].x;
firstX = Math.min(firstX, polyX);
secondX = Math.max(secondX, polyX);
}
var line = {
p1: _genPoint(--firstX, point.y),
p2: _genPoint(++secondX, point.y)
};
// If entered true, with closest intersection says you are inside the polygon.
var entered = false;
// Closest is the closest intersection to the left of the point
var closest = line.p1.x;
// This is for if intersections hit the same point, to find out which is correct
var cos = -2;
var getCos = function(line) {
var x = line.p2.x - line.p1.x;
var y = line.p2.y - line.p1.y;
return x / Math.sqrt(x * x + y * y);
};
for(i = 0; i < polygon.length; i++) {
var polyLine = { p1: polygon[i], p2: polygon[(i + 1) % polygon.length] };
var intersectInfo = linesIntersect(line, polyLine);
if(!intersectInfo) continue;
if(intersectInfo.parallel) {
// Only really care about this if it actually touches the point
if(intersectInfo.parallel.first.x <= point.x && intersectInfo.parallel.second.x >= point.x) return true;
continue;
}
var intersectionX = intersectInfo.point.x;
if(intersectionX > point.x || intersectionX < closest) continue;
if(intersectionX == point.x) return true;
// If closer than last time, reset cosine.
if(intersectionX != closest) cos = -2;
// For getting cosine, need to possibly reverse the direction of polyLine.
if(intersectInfo.ties) {
// Tie must be on l2, if the ties is end, reverse so cosine indicates how close the angle is to that of 'point' from here.
if(intersectInfo.ties.l2 == 'end') polyLine = { p1: polyLine.p2, p2: polyLine.p1 };
} else {
// It is on both side, so you can take the larger one
if(polyLine.p1.x > polyLine.p2.x) polyLine = { p1: polyLine.p2, p2: polyLine.p1 };
}
var currCos = getCos(polyLine);
if(currCos > cos) {
cos = currCos;
closest = intersectionX;
entered = intersectInfo.entering;
}
}
return entered;
};
_geometry.checkInside = _checkInside;
});

View File

@@ -0,0 +1,7 @@
$axure.internal(function($ax) {
var _globals = $ax.globals = {};
$ax.globals.MaxZIndex = 1000;
$ax.globals.MinZIndex = -1000;
});

View File

@@ -0,0 +1,344 @@

//// ******* Internet Explorer MANAGER ******** //
////this is to handle all the stupid IE Stuff
//$axure.internal(function($ax) {
// if(!IE_10_AND_BELOW) return;
// var _ieColorManager = {};
// if(Number(BROWSER_VERSION) < 9) $ax.ieColorManager = _ieColorManager;
// var _applyIEFixedPosition = function() {
// if(Number(BROWSER_VERSION) >= 7) return;
// $axure(function(diagramObject) { return diagramObject.fixedVertical; }).$()
// .appendTo($('body'))
// .css('position', 'absolute').css('margin-left', 0 + 'px').css('margin-top', 0 + 'px');
// var handleScroll = function() {
// $axure(function(diagramObject) { return diagramObject.fixedVertical; })
// .each(function(diagramObject, elementId) {
// var win = $(window);
// var windowWidth = win.width();
// var windowHeight = win.height();
// var windowScrollLeft = win.scrollLeft();
// var windowScrollTop = win.scrollTop();
// var newLeft = 0;
// var newTop = 0;
// var elementQuery = $('#' + elementId);
// var elementAxQuery = $ax('#' + elementId);
// var width = elementAxQuery.width();
// var height = elementAxQuery.height();
// var horz = diagramObject.fixedHorizontal;
// if(horz == 'left') {
// newLeft = windowScrollLeft + diagramObject.fixedMarginHorizontal;
// } else if(horz == 'center') {
// newLeft = windowScrollLeft + ((windowWidth - width) / 2) + diagramObject.fixedMarginHorizontal;
// } else if(horz == 'right') {
// newLeft = windowScrollLeft + windowWidth - width - diagramObject.fixedMarginHorizontal;
// }
// var vert = diagramObject.fixedVertical;
// if(vert == 'top') {
// newTop = windowScrollTop + diagramObject.fixedMarginVertical;
// } else if(vert == 'middle') {
// newTop = windowScrollTop + ((windowHeight - height) / 2) + diagramObject.fixedMarginVertical;
// } else if(vert == 'bottom') {
// newTop = windowScrollTop + windowHeight - height - diagramObject.fixedMarginVertical;
// }
// elementQuery.css('top', newTop + 'px').css('left', newLeft + 'px');
// });
// };
// $(window).scroll(handleScroll);
// $axure.resize(handleScroll);
// handleScroll();
// };
// var _applyBackground = function() {
// if(Number(BROWSER_VERSION) >= 9) return;
// var styleChain = $ax.adaptive.getAdaptiveIdChain($ax.adaptive.currentViewId);
// var argb = _getArgb($ax.pageData.page, styleChain);
// var hexColor = _getHexColor(argb, false);
// if(hexColor) $('body').css('background-color', hexColor);
// _applyBackgroundToQuery($ax('*'));
// };
// var _applyBackgroundToQuery = function(query) {
// if(Number(BROWSER_VERSION) >= 9) return;
// var styleChain = $ax.adaptive.getAdaptiveIdChain($ax.adaptive.currentViewId);
// query.each(function(obj, elementId) {
// if ($ax.public.fn.IsDynamicPanel(obj.type)) {
// var stateCount = obj.diagrams.length;
// for(var j = 0; j < stateCount; j++) {
// var stateId = $ax.repeater.applySuffixToElementId(elementId, '_state' + j);
// var argb = _getArgb(obj.diagrams[j], styleChain);
// var hexColor = _getHexColor(argb, true);
// if(hexColor) $jobj(stateId).css('background-color', hexColor);
// }
// } else if ($ax.public.fn.IsRepeater(obj.type)) {
// }
// });
// };
// _ieColorManager.applyBackground = _applyBackgroundToQuery;
// var _getArgb = function(diagram, styleChain) {
// var argb = undefined;
// for(var i = 0; i < styleChain.length && !argb; i++) {
// var style = diagram.adaptiveStyles[styleChain[i]];
// argb = style.fill && style.fill.color;
// }
// if(!argb) argb = diagram.style.fill.color;
// return argb;
// };
// var gMult = 256;
// var rMult = gMult * 256;
// var aMult = rMult * 256;
// var _getHexColor = function(argb, allowWhite) {
// var a = Math.floor(argb / aMult);
// argb -= a * aMult;
// var r = Math.floor(argb / rMult);
// argb -= r * rMult;
// var g = Math.floor(argb / gMult);
// var b = argb - g * gMult;
// return _getColorFromArgb(a, r, g, b, allowWhite);
// };
// var _getColorFromArgb = function(a, r, g, b, allowWhite) {
// if(Number(BROWSER_VERSION) >= 9) return undefined;
// //convert the color with alpha to a color with no alpha (assuming white background)
// r = Math.min((r * a) / 255 + 255 - a, 255);
// g = Math.min((g * a) / 255 + 255 - a, 255);
// b = Math.min((b * a) / 255 + 255 - a, 255);
// if(a == 0) return undefined;
// if(!allowWhite && (r == 255 && g == 255 && b == 255)) return undefined;
// var color = '#';
// color += Math.floor(r / 16).toString(16);
// color += Math.floor(r % 16).toString(16);
// color += Math.floor(g / 16).toString(16);
// color += Math.floor(g % 16).toString(16);
// color += Math.floor(b / 16).toString(16);
// color += Math.floor(b % 16).toString(16);
// return color;
// };
// _ieColorManager.getColorFromArgb = _getColorFromArgb;
// var getIEOffset = function(transform, rect) {
// var translatedVertexes = [
// $axure.utils.Vector2D(0, 0), //we dont translate, so the orgin is fixed
// transform.mul($axure.utils.Vector2D(0, rect.height)),
// transform.mul($axure.utils.Vector2D(rect.width, 0)),
// transform.mul($axure.utils.Vector2D(rect.width, rect.height))];
// var minX = 0, minY = 0, maxX = 0, maxY = 0;
// $.each(translatedVertexes, function(index, p) {
// minX = Math.min(minX, p.x);
// minY = Math.min(minY, p.y);
// maxX = Math.max(maxX, p.x);
// maxY = Math.max(maxY, p.y);
// });
// return $axure.utils.Vector2D(
// (maxX - minX - rect.width) / 2,
// (maxY - minY - rect.height) / 2);
// };
// var _filterFromTransform = function(transform) {
// return "progid:DXImageTransform.Microsoft.Matrix(M11=" + transform.m11 +
// ", M12=" + transform.m12 + ", M21=" + transform.m21 +
// ", M22=" + transform.m22 + ", SizingMethod='auto expand')";
// };
// var _applyIERotation = function() {
// if(Number(BROWSER_VERSION) >= 9) return;
// $axure(function(diagramObject) {
// return ((diagramObject.style.rotation && Math.abs(diagramObject.style.rotation) > 0.1)
// || (diagramObject.style.textRotation && Math.abs(diagramObject.style.textRotation) > 0.1))
// && !diagramObject.isContained;
// }).each(function(diagramObject, elementId) {
// var rotation = diagramObject.style.rotation || 0;
// var $element = $('#' + elementId);
// var axElement = $ax('#' + elementId);
// var width = axElement.width();
// var height = axElement.height();
// var originX = width / 2;
// var originY = height / 2;
// var shapeIeOffset;
// $element.children().each(function() {
// var $child = $(this);
// var axChild = $ax('#' + $child.attr('id'));
// var childWidth = axChild.width();
// var childHeight = axChild.height() + $child.position().top;
// var centerX = $child.position().left + (childWidth / 2);
// var centerY = $child.position().top + (childHeight / 2);
// var deltaX = centerX - originX;
// var deltaY = centerY - originY;
// var effectiveRotation = rotation;
// var textObject = $ax.getObjectFromElementId($child.attr('id'));
// if(textObject) {
// if(textObject.style.textRotation) effectiveRotation = textObject.style.textRotation;
// else return;
// }
// var transform = $ax.utils.Matrix2D.identity().rotate(effectiveRotation);
// var filter = _filterFromTransform(transform);
// $child.css('filter', filter)
// .width(childWidth + 1)
// .height(childHeight + 1);
// var p = transform.mul($ax.utils.Vector2D(deltaX, deltaY));
// var ieOffset = getIEOffset(transform, { width: childWidth, height: childHeight });
// if(!textObject) {
// shapeIeOffset = ieOffset;
// } else {
// // This is a close approximation, but not exact
// if(diagramObject.style.verticalAlignment != 'top') ieOffset.y -= shapeIeOffset.y + Math.abs(shapeIeOffset.x);
// }
// $child.css("margin-left", -ieOffset.x - deltaX + p.x).css("margin-top", -ieOffset.y - deltaY + p.y);
// });
// });
// };
// var _fixIEStretchBackground = function() {
// if(Number(BROWSER_VERSION) >= 9) return;
// var pageStyle = $ax.adaptive.getPageStyle();
// if(!pageStyle.imageRepeat || pageStyle.imageRepeat == 'auto') return;
// $('body').css('background-image', 'none');
// var viewId = $ax.adaptive.currentViewId;
// var imageInfo = viewId ? $ax.pageData.viewIdToBackgroundImageInfo && $ax.pageData.viewIdToBackgroundImageInfo[viewId] : $ax.pageData.defaultBackgroundImageInfo;
// if(imageInfo && imageInfo.path) {
// if($('#bg_img').length == 0) $('body').append('<img id="bg_img"/>');
// $('#bg_img').attr('src', imageInfo.path).css('position', 'fixed').css('z-index', '-10000');
// _resizeIEBackground();
// } else $('#bg_img').remove();
// };
// var _resizeIEBackground = function() {
// if(Number(BROWSER_VERSION) >= 9) return;
// //var page = $ax.pageData.page;
// var viewId = $ax.adaptive.currentViewId;
// var pageStyle = $ax.adaptive.getPageStyle();
// if(!$ax.pageData.defaultBackgroundImageInfo && !$ax.pageData.viewIdToBackgroundImageInfo) return;
// var imageInfo = viewId ? $ax.pageData.viewIdToBackgroundImageInfo[viewId] : $ax.pageData.defaultBackgroundImageInfo;
// if(!imageInfo) return;
// var imageWidth = imageInfo.width;
// var imageHeight = imageInfo.height;
// var windowWidth = $(window).width();
// var windowHeight = $(window).height();
// var isCover = pageStyle.imageRepeat == 'cover';
// var wRatio = windowWidth / imageWidth;
// var hRatio = windowHeight / imageHeight;
// var ratio = wRatio;
// if(isCover) {
// if(hRatio > wRatio) ratio = hRatio;
// } else {
// if(hRatio < wRatio) ratio = hRatio;
// }
// var width = imageWidth * ratio;
// var height = imageHeight * ratio;
// var left = '0px';
// if((isCover && width > windowWidth) || (!isCover && width < windowWidth)) {
// if(pageStyle.imageHorizontalAlignment == 'center') {
// left = ((windowWidth - width) / 2) + 'px';
// } else if(pageStyle.imageHorizontalAlignment == 'far') {
// left = (windowWidth - width) + 'px';
// }
// }
// var top = '0px';
// if((isCover && height > windowHeight) || (!isCover && height < windowHeight)) {
// if(pageStyle.imageVerticalAlignment == 'center') {
// top = ((windowHeight - height) / 2) + 'px';
// } else if(pageStyle.imageVerticalAlignment == 'far') {
// top = (windowHeight - height) + 'px';
// }
// }
// $('#bg_img').css('top', top).css('left', left).css('width', width).css('height', height);
// };
// var _fixAllPngs = function() {
// if(!(/MSIE ((5\.5)|6)/.test(window.navigator.userAgent) && window.navigator.platform == "Win32")) return;
// $('img[src$=".png"]').each(function() {
// if(!this.complete) {
// this.onload = function() { $axure.utils.fixPng(this); };
// } else {
// $axure.utils.fixPng(this);
// }
// });
// };
// var _fixInputSize = function() {
// if(Number(BROWSER_VERSION) >= 8 || window.navigator.userAgent.indexOf("Trident/4.0") > -1) return;
// var inputs = $('input').not(':input[type=button], :input[type=submit], :input[type=radio], :input[type=checkbox]');
// inputs.each(function() {
// var $input = $(this);
// var axInput = $ax('#' + $input.attr('id'));
// $input.css('height', (axInput.height() - 4 + 'px')).css('width', (axInput.width() - 2 + 'px'));
// });
// var textAreas = $($ax.constants.TEXT_AREA_TYPE);
// textAreas.each(function() {
// var $textArea = $(this);
// var axText = $ax('#' + $textArea.attr('id'));
// $textArea.css('height', (axText.height() - 6 + 'px')).css('width', (axText.width() - 6 + 'px'));
// });
// };
// var _fixInputBackground = function() {
// var inputs = $('input').not(':input[type=button], :input[type=submit], :input[type=radio], :input[type=checkbox]');
// inputs = inputs.add($($ax.constants.TEXT_AREA_TYPE));
// inputs.each(function() {
// var $input = $(this);
// if($input.css('background-color') == 'transparent') {
// $input.css('background-image', 'url(../../transparent.gif)');
// } else {
// $input.css('background-image', '');
// }
// });
// };
// $(document).ready(function() {
// _fixIEStretchBackground();
// _applyIEFixedPosition();
// $axure.resize(function() {
// _resizeIEBackground();
// });
// $ax.adaptive.bind('viewChanged', function() {
// _fixIEStretchBackground();
// _applyBackground();
// _fixInputBackground();
// });
// _fixAllPngs();
// _applyIERotation();
// _applyBackground();
// _fixInputSize();
// _fixInputBackground();
// });
//});

View File

@@ -0,0 +1,326 @@
$axure.internal(function($ax) {
$(window.document).ready(function () {
//var readyStart = (new Date()).getTime();
//this is because the page id is not formatted as a guid
var pageId = $ax.pageData.page.packageId;
var pageData = {
id: pageId,
pageName: $ax.pageData.page.name,
location: window.location.toString(),
notes: $ax.pageData.page.notes,
widgetNotes: $ax.pageData.page.annotations,
//clipToView: $ax.pageData.clipToView,
defaultAdaptiveView: $ax.pageData.defaultAdaptiveView,
adaptiveViews: $ax.pageData.adaptiveViews,
masterNotes: []
};
var fnPrefix = '';
function pushNextPrefix() {
if (fnPrefix.length == 0) fnPrefix = 'A';
else fnPrefix = fnPrefix[0] == 'Z' ? 'A'.repeat(fnPrefix.length + 1) : String.fromCharCode(fnPrefix.charCodeAt(0) + 1).repeat(fnPrefix.length);
}
function populateNotes(pageForNotes) {
for (var master in pageForNotes.masters) {
//var master = pageForNotes.masters[i];
var masterData = pageForNotes.masters[master];
var hasWidgetNotes = masterData.annotations && masterData.annotations.length > 0;
if ((master.notes && !$.isEmptyObject(masterData.notes)) || hasWidgetNotes) {
if(hasWidgetNotes) pushNextPrefix();
var m = {};
m.pageName = masterData.name;
m.notes = masterData.notes;
m.widgetNotes = masterData.annotations;
pageData.masterNotes.push(m);
if(hasWidgetNotes) populateOwnerToFn(m.widgetNotes);
}
populateNotes(master);
}
}
var ownerToFns = {};
function populateOwnerToFn(widgetNotes) {
if(typeof widgetNotes == 'undefined') return false;
for (var i = 0; i < widgetNotes.length; i++) {
var widgetNote = widgetNotes[i];
widgetNote['fn'] = fnPrefix + widgetNote['fn'];
var fn = widgetNote['fn'];
var ownerId = widgetNote['ownerId'];
if (ownerId !== undefined && ownerId.length > 0) {
var ownerLabels = ownerToFns[ownerId];
if (ownerLabels == undefined) ownerLabels = [];
ownerLabels.push(fn);
ownerToFns[ownerId] = ownerLabels;
}
}
}
populateOwnerToFn(pageData.widgetNotes);
populateNotes($ax.pageData);
pageData.ownerToFns = ownerToFns;
$ax.pageData.notesData = pageData;
//var anns = [];
//$ax('*').each(function (dObj, elementId) {
// pushAnnotation(dObj, elementId);
//});
//function pushAnnotation(dObj, elementId) {
// var ann = dObj.annotation;
// if(ann) {
// ann = $ax.deepCopy(ann);
// ann["id"] = elementId;
// ann["label"] = dObj.label + " (" + dObj.friendlyType + ")";
// anns.push(ann);
// }
// if(dObj.type === 'repeater' && dObj.objects) {
// //if it's repeater, save the id as repeaterId@scriptId
// for(var i = 0, len = dObj.objects.length; i < len; i++) {
// var child = dObj.objects[i];
// var scriptId = $ax.getScriptIdFromPath([child.id], elementId);
// pushAnnotation(child, elementId + '@' + scriptId);
// }
// }
//}
//pageData.widgetNotes = anns;
//only trigger the page.data setting if the window is on the mainframe
var isMainFrame = false;
try {
if(window.name == 'mainFrame' ||
(!CHROME_5_LOCAL && window.parent.$ && window.parent.$('#mainFrame').length > 0)) {
isMainFrame = true;
$ax.messageCenter.addMessageListener(function(message, data) {
if(message == 'finishInit') {
_processTempInit();
}
});
$axure.messageCenter.setState('page.data', pageData);
window.focus();
}
} catch(e) { }
//attach here for chrome local
//$(window).on('load', function() {
// $ax.style.initializeObjectTextAlignment($ax('*'));
//});
if(!isMainFrame) _processTempInit();
});
var touchCount = 0;
var lastTouch = Date.now();
var _registerTouchCount = $ax.registerTouchCount = function (e) {
var now = Date.now();
if (now - lastTouch < 375) {
if (++touchCount === 3) {
$(':input').blur();
$ax.messageCenter.postMessage('tripleClick', true);
e.preventDefault();
};
} else {
touchCount = 1;
}
lastTouch = now;
};
// Block IOS stalling second tap.
// Stop third click from also clicking mobile card
var _clearTouchCount = $ax.clearTouchCount = function (e) {
if (touchCount === 3) {
touchCount = 0;
e.preventDefault();
}
};
var _processTempInit = function() {
//var start = (new Date()).getTime();
//var end = (new Date()).getTime();
//window.alert('elapsed ' + (end - start));
$('iframe').each(function() {
var origSrc = $(this).attr('basesrc');
var $this = $(this);
if(origSrc) {
var newSrcUrl = origSrc.toLowerCase().indexOf('http://') == -1 ? $ax.globalVariableProvider.getLinkUrl(origSrc) : origSrc;
$this.attr('src', newSrcUrl);
}
if(IOS) {
$this.parent().css('overflow', 'auto').css('-webkit-overflow-scrolling', 'touch').css('-ms-overflow-x', 'hidden').css('overflow-x', 'hidden');
}
});
$axure.messageCenter.addMessageListener(function(message, data) {
if(message == 'setGlobalVar') {
$ax.globalVariableProvider.setVariableValue(data.globalVarName, data.globalVarValue, true);
}
});
window.lastFocusedClickable = null;
var _lastFocusedClickableSelector = 'input, a';
var shouldOutline = true;
$ax(function (dObj) { return dObj.tabbable; }).each(function (dObj, elementId) {
if ($ax.public.fn.IsLayer(dObj.type)) $ax.event.layerMapFocus(dObj, elementId);
var focusableId = $ax.event.getFocusableWidgetOrChildId(elementId);
var $focusable = $('#' + focusableId);
$focusable.attr("tabIndex", 0);
if($focusable.is('div') || $focusable.is('img')) {
$focusable.bind($ax.features.eventNames.mouseDownName, function() {
shouldOutline = false;
});
attachFocusAndBlur($focusable);
}
});
$(window.document).bind($ax.features.eventNames.mouseUpName, function() {
shouldOutline = true;
});
attachFocusAndBlur($(_lastFocusedClickableSelector));
function attachFocusAndBlur($query) {
$query.focus(function () {
if(shouldOutline) {
$(this).css('outline', '');
} else {
$(this).css('outline', 'none');
}
window.lastFocusedClickable = this;
}).blur(function () {
if(window.lastFocusedClickable == this) window.lastFocusedClickable = null;
});
}
$(window.document).bind('keyup', function (e) {
switch(e.which) {
case 13:
case 32:
if(window.lastFocusedClickable) $(window.lastFocusedClickable).click();
break;
default: return; // exit this handler for other keys
}
});
//if($ax.document.configuration.hideAddress) {
// $(window).on('load', function() {
// window.setTimeout(function() {
// window.scrollTo(0, 0.9);
// }, 0);
// });
//}
//if($ax.document.configuration.preventScroll) {
// $(window.document).bind('touchmove', function(e) {
// var inScrollable = $ax.legacy.GetScrollable(e.target) != window.document.body;
// if(!inScrollable) {
// e.preventDefault();
// }
// });
// $ax(function(diagramObject) {
// return $ax.public.fn.IsDynamicPanel(diagramObject.type) && diagramObject.scrollbars != 'none';
// }).$().children().bind('touchstart', function() {
// var target = this;
// var top = target.scrollTop;
// if(top <= 0) target.scrollTop = 1;
// if(top + target.offsetHeight >= target.scrollHeight) target.scrollTop = target.scrollHeight - target.offsetHeight - 1;
// });
//}
if(OS_MAC && WEBKIT) {
$ax(function(diagramObject) {
return $ax.public.fn.IsComboBox(diagramObject.type);
}).each(function(obj, id) {
$jobj($ax.INPUT(id)).css('-webkit-appearance', 'menulist-button');
});
}
if($ax.features.supports.mobile) {
$('html').first().on('touchstart', _registerTouchCount);
$('html').first().on('touchend', _clearTouchCount);
// Stop pinch zoom (stopping all gestures for now)
// Gesturestart is only supported in Safari
if (SAFARI) {
document.addEventListener("gesturestart", function (e) {
e.preventDefault();
});
}
}
$ax.annotation.initialize();
$ax.legacy.BringFixedToFront();
$ax.event.initialize();
$ax.style.initialize();
$ax.visibility.initialize();
$ax.repeater.initialize();
$ax.dynamicPanelManager.initialize(); //needs to be called after visibility is initialized
$ax.adaptive.initialize();
$ax.loadDynamicPanelsAndMasters();
$ax.adaptive.loadFinished();
var start = (new Date()).getTime();
$ax.repeater.initRefresh();
var end = (new Date()).getTime();
console.log('loadTime: ' + (end - start) / 1000);
$ax.style.prefetch();
$(window).resize();
//var readyEnd = (new Date()).getTime();
//window.alert('elapsed ' + (readyEnd - readyStart));
};
});
/* extend canvas */
var gv_hasCanvas = false;
(function() {
var _canvas = document.createElement('canvas'), proto, abbrev;
if(gv_hasCanvas = !!(_canvas.getContext && _canvas.getContext('2d')) && typeof (CanvasGradient) !== 'undefined') {
function chain(func) {
return function() {
return func.apply(this, arguments) || this;
};
}
with(proto = CanvasRenderingContext2D.prototype) for(var func in abbrev = {
a: arc,
b: beginPath,
n: clearRect,
c: clip,
p: closePath,
g: createLinearGradient,
f: fill,
j: fillRect,
z: function(s) { this.fillStyle = s; },
l: lineTo,
w: function(w) { this.lineWidth = w; },
m: moveTo,
q: quadraticCurveTo,
h: rect,
r: restore,
o: rotate,
s: save,
x: scale,
y: function(s) { this.strokeStyle = s; },
u: setTransform,
k: stroke,
i: strokeRect,
t: translate
}) proto[func] = chain(abbrev[func]);
CanvasGradient.prototype.a = chain(CanvasGradient.prototype.addColorStop);
}
})();

View File

@@ -0,0 +1,91 @@
$axure.internal(function ($ax) {
if ((IOS && SAFARI) || SHARE_APP) {
var outerHtml = document.documentElement;
outerHtml.id = 'ios-safari';
var html = document.createElement('html');
html.id = 'ios-safari-html';
outerHtml.appendChild(html);
var body = document.body;
html.appendChild(body);
Object.defineProperty(document, 'body', {
get: function () {
return body;
}
});
var fixedBody = document.createElement('body');
fixedBody.id = 'ios-safari-fixed';
outerHtml.appendChild(fixedBody);
var fixedBase = document.createElement('div');
fixedBase.id = 'base-fixed';
fixedBody.appendChild(fixedBase);
var isDevice = false;
var deviceWidth = 0;
var updateHtmlWidth = function (panelWidthOffset, scale, height, scaleN) {
var iosSafHtml = $('#ios-safari-html');
iosSafHtml.css('overflow', '');
iosSafHtml.css('overflow-x', '');
iosSafHtml.css('height', '');
if (isDevice) {
iosSafHtml.width(deviceWidth / scaleN);
iosSafHtml.css('overflow-x', 'hidden');
} else {
var isLandscape = window.orientation != 0 && window.orientation != 180;
var mobileWidth = isLandscape ? window.screen.height : window.screen.width
iosSafHtml.width((mobileWidth - panelWidthOffset) / scaleN);
}
if (scale == 1) {
iosSafHtml.css('overflow-x', 'hidden');
iosSafHtml.css('height', (height / scaleN) + 'px');
} else if (scale == 2) iosSafHtml.css('overflow', 'hidden');
};
updateHtmlWidth(0);
$axure('*').each(function (obj, element) {
if (obj && obj.fixedVertical && obj.fixedKeepInFront) {
var parent = $axure('#' + element).getParents(false, ['item', 'state'])[0];
if (!parent) {
$('#base-fixed').append($('#' + element));
}
}
});
$axure.messageCenter.addMessageListener(function (message, data) {
if (message == "setContentScale") {
updateHtmlWidth(data.panelWidthOffset, data.scale, data.viewportHeight, data.scaleN);
} else if (message == "setDeviceMode") {
isDevice = data.device && !data.scaleToWidth;
if (isDevice) deviceWidth = data.width;
updateHtmlWidth(0);
}
});
$('#ios-safari-html').scroll(function () {
$axure.updateWindowInfo();
});
var scrollStartY;
var maxScrollY
var touchStart;
$axure('*').each(function (obj, element) {
if (obj && obj.scrollbars && obj.scrollbars.toLowerCase() != 'none') {
if (obj.scrollbars == 'horizontalAsNeeded') return;
$('#' + element).on('touchstart', function (e) {
touchStart = e.pageY;
var stateId = $ax.visibility.GetPanelState($('#' + element).attr('id'));
scrollStartY = $('#' + stateId).scrollTop();
maxScrollY = $('#' + stateId)[0].scrollHeight - $('#' + stateId).height();
});
$('#' + element).on('touchmove', function (e) {
if (maxScrollY <= 0) return false;
if (scrollStartY == 0 && e.pageY > touchStart) e.preventDefault();
if (scrollStartY == maxScrollY && e.pageY < touchStart) e.preventDefault();
});
}
});
}
});

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,166 @@
//stored on each browser event
var windowEvent;
$axure.internal(function($ax) {
var _legacy = {};
$ax.legacy = _legacy;
var Forms = window.document.getElementsByTagName("FORM");
for(var i = 0; i < Forms.length; i++) {
var Form = Forms[i];
Form.onclick = $ax.legacy.SuppressBubble;
}
$ax.legacy.SuppressBubble = function(event) {
if(IE_10_AND_BELOW) {
window.event.cancelBubble = true;
window.event.returnValue = false;
} else {
if(event) {
event.stopPropagation();
}
}
};
$ax.legacy.BringToFront = function(id, skipFixed) {
_bringToFrontHelper(id);
if(!skipFixed) $ax.legacy.BringFixedToFront();
};
var _bringToFrontHelper = function(id) {
var target = window.document.getElementById(id);
if(target == null) return;
$ax.globals.MaxZIndex = $ax.globals.MaxZIndex + 1;
target.style.zIndex = $ax.globals.MaxZIndex;
};
$ax.legacy.BringFixedToFront = function() {
$ax(function(diagramObject) { return diagramObject.fixedKeepInFront; }).each(function(diagramObject, scriptId) {
_bringToFrontHelper(scriptId);
});
};
$ax.legacy.SendToBack = function(id) {
var target = window.document.getElementById(id);
if(target == null) return;
target.style.zIndex = $ax.globals.MinZIndex = $ax.globals.MinZIndex - 1;
};
$ax.legacy.RefreshScreen = function() {
var oldColor = window.document.body.style.backgroundColor;
var setColor = (oldColor == "rgb(0,0,0)") ? "#FFFFFF" : "#000000";
window.document.body.style.backgroundColor = setColor;
window.document.body.style.backgroundColor = oldColor;
};
$ax.legacy.getAbsoluteLeft = function(currentNode, elementId) {
var oldDisplay = currentNode.css('display');
var displaySet = false;
if(oldDisplay == 'none') {
currentNode.css('display', '');
displaySet = true;
}
var left = currentNode.offset().left;
// Special Layer code
if($ax.getTypeFromElementId(elementId) == 'layer') {
var first = true;
var children = currentNode.children();
for(var i = 0; i < children.length; i++) {
var child = $(children[i]);
var subDisplaySet = false;
if(child.css('display') == 'none') {
child.css('display', '');
subDisplaySet = true;
}
if(first) left = child.offset().left;
else left = Math.min(child.offset().left, left);
first = false;
if(subDisplaySet) child.css('display', 'none');
}
}
if (displaySet) currentNode.css('display', oldDisplay);
return $axure.fn.bodyToWorld(left, true);
};
$ax.legacy.getAbsoluteTop = function(currentNode, elementId) {
var oldDisplay = currentNode.css('display');
var displaySet = false;
if(oldDisplay == 'none') {
currentNode.css('display', '');
displaySet = true;
}
var top = currentNode.offset().top;
// Special Layer code
if ($ax.getTypeFromElementId(elementId) == 'layer') {
var first = true;
var children = currentNode.children();
for (var i = 0; i < children.length; i++) {
var child = $(children[i]);
var subDisplaySet = false;
if (child.css('display') == 'none') {
child.css('display', '');
subDisplaySet = true;
}
if (first) top = child.offset().top;
else top = Math.min(child.offset().top, top);
first = false;
if (subDisplaySet) child.css('display', 'none');
}
}
if(displaySet) currentNode.css('display', oldDisplay);
return top;
};
// ****************** Annotation and Link Functions ****************** //
$ax.legacy.GetAnnotationHtml = function(annJson) {
var retVal = "";
for(var noteName in annJson) {
if(noteName != "label" && noteName != "id") {
retVal += "<div class='annotationName'>" + noteName + "</div>";
retVal += "<div class='annotationValue'>" + linkify(annJson[noteName]) + "</div>";
}
}
return retVal;
function linkify(text) {
var urlRegex = /(\b(((https?|ftp|file):\/\/)|(www\.))[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig;
return text.replace(urlRegex, function (url, b, c) {
var url2 = (c == 'www.') ? 'http://' + url : url;
return '<a href="' + url2 + '" target="_blank" class="noteLink">' + url + '</a>';
});
}
};
$ax.legacy.GetScrollable = function(target) {
var $target = $(target);
var last = $target;
// Start past inital target. Can't scroll to target in itself, must be some ancestor.
var current = last.parent();
while(!current.is('body') && !current.is('html')) {
var elementId = current.attr('id');
var diagramObject = elementId && $ax.getObjectFromElementId(elementId);
if (diagramObject && $ax.public.fn.IsDynamicPanel(diagramObject.type) && diagramObject.scrollbars != 'none') {
//returns the panel diagram div which handles scrolling
return $ax.dynamicPanelManager.getShownState(current.attr('id'))[0];
}
last = current;
current = current.parent();
}
// Need to do this because of ie
if(IE_10_AND_BELOW) return window.document.documentElement;
else return window.document.body;
};
});

View File

@@ -0,0 +1,554 @@
$axure.internal(function($ax) {
$ax.public.fn.matrixMultiply = function(matrix, vector) {
if(!matrix.tx) matrix.tx = 0;
if(!matrix.ty) matrix.ty = 0;
var outX = matrix.m11 * vector.x + matrix.m12 * vector.y + matrix.tx;
var outY = matrix.m21 * vector.x + matrix.m22 * vector.y + matrix.ty;
return { x: outX, y: outY };
}
$ax.public.fn.matrixInverse = function(matrix) {
if(!matrix.tx) matrix.tx = 0;
if(!matrix.ty) matrix.ty = 0;
var determinant = matrix.m11*matrix.m22 - matrix.m12*matrix.m21;
//var threshold = (M11 * M11 + M22 *M22 + M12 *M12+ M21 *M21) / 100000;
//if(determinant.DeltaEquals(0, threshold) && determinant < 0.01) {
// return Invalid;
//}
return {
m11 : matrix.m22/determinant,
m12 : -matrix.m12/determinant,
tx : (matrix.ty*matrix.m12 - matrix.tx*matrix.m22)/determinant,
m21: -matrix.m21 / determinant,
m22: matrix.m11 / determinant,
ty: (matrix.tx * matrix.m21 - matrix.ty * matrix.m11) / determinant
};
}
$ax.public.fn.matrixMultiplyMatrix = function (matrix1, matrix2) {
if (!matrix1.tx) matrix1.tx = 0;
if (!matrix1.ty) matrix1.ty = 0;
if (!matrix2.tx) matrix2.tx = 0;
if (!matrix2.ty) matrix2.ty = 0;
return {
m11: matrix1.m12*matrix2.m21 + matrix1.m11*matrix2.m11,
m12: matrix1.m12*matrix2.m22 + matrix1.m11*matrix2.m12,
tx: matrix1.m12 * matrix2.ty + matrix1.m11 * matrix2.tx + matrix1.tx,
m21: matrix1.m22 * matrix2.m21 + matrix1.m21 * matrix2.m11,
m22: matrix1.m22 * matrix2.m22 + matrix1.m21 * matrix2.m12,
ty: matrix1.m22 * matrix2.ty + matrix1.m21 * matrix2.tx + matrix1.ty,
};
}
$ax.public.fn.transformFromElement = function (element) {
var st = window.getComputedStyle(element, null);
var tr = st.getPropertyValue("-webkit-transform") ||
st.getPropertyValue("-moz-transform") ||
st.getPropertyValue("-ms-transform") ||
st.getPropertyValue("-o-transform") ||
st.getPropertyValue("transform");
if (tr.indexOf('none') < 0) {
var matrix = tr.split('(')[1];
matrix = matrix.split(')')[0];
matrix = matrix.split(',');
for (var l = 0; l < matrix.length; l++) {
matrix[l] = Number(matrix[l]);
}
} else { matrix = [1.0, 0.0, 0.0, 1.0, 0.0, 0.0]; }
return matrix;
// matrix[0] = cosine, matrix[1] = sine.
// Assuming the element is still orthogonal.
}
$ax.public.fn.vectorMinus = function(vector1, vector2) { return { x: vector1.x - vector2.x, y: vector1.y - vector2.y }; }
$ax.public.fn.vectorPlus = function (vector1, vector2) { return { x: vector1.x + vector2.x, y: vector1.y + vector2.y }; }
$ax.public.fn.vectorMidpoint = function (vector1, vector2) { return { x: (vector1.x + vector2.x) / 2.0, y: (vector1.y + vector2.y) / 2.0 }; }
$ax.public.fn.fourCornersToBasis = function (fourCorners) {
return {
widthVector: $ax.public.fn.vectorMinus(fourCorners.widgetTopRight, fourCorners.widgetTopLeft),
heightVector: $ax.public.fn.vectorMinus(fourCorners.widgetBottomLeft, fourCorners.widgetTopLeft)
};
}
$ax.public.fn.matrixString = function(m11, m21, m12, m22, tx, ty) {
return "Matrix(" + m11 + "," + m21 + "," + m12 + "," + m22 + ", " + tx + ", " + ty + ")";
}
//$ax.public.fn.getWidgetBoundingRect = function (widgetId) {
// var emptyRect = { left: 0, top: 0, centerPoint: { x: 0, y: 0 }, width: 0, height: 0 };
// var element = document.getElementById(widgetId);
// if (!element) return emptyRect;
// var object = $obj(widgetId);
// if (object && object.type && $ax.public.fn.IsLayer(object.type)) {
// var layerChildren = _getLayerChildrenDeep(widgetId);
// if (!layerChildren) return emptyRect;
// else return _getBoundingRectForMultipleWidgets(layerChildren);
// }
// return _getBoundingRectForSingleWidget(widgetId);
//};
var _getLayerChildrenDeep = $ax.public.fn.getLayerChildrenDeep = function (layerId, includeLayers, includeHidden) {
var deep = [];
var children = $ax('#' + layerId).getChildren()[0].children;
for (var index = 0; index < children.length; index++) {
var childId = children[index];
if(!includeHidden && !$ax.visibility.IsIdVisible(childId)) continue;
if ($ax.public.fn.IsLayer($obj(childId).type)) {
if (includeLayers) deep.push(childId);
var recursiveChildren = _getLayerChildrenDeep(childId, includeLayers, includeHidden);
for (var j = 0; j < recursiveChildren.length; j++) deep.push(recursiveChildren[j]);
} else deep.push(childId);
}
return deep;
};
//var _getBoundingRectForMultipleWidgets = function (widgetsIdArray, relativeToPage) {
// if (!widgetsIdArray || widgetsIdArray.constructor !== Array) return undefined;
// if (widgetsIdArray.length == 0) return { left: 0, top: 0, centerPoint: { x: 0, y: 0 }, width: 0, height: 0 };
// var widgetRect = _getBoundingRectForSingleWidget(widgetsIdArray[0], relativeToPage, true);
// var boundingRect = { left: widgetRect.left, right: widgetRect.right, top: widgetRect.top, bottom: widgetRect.bottom };
// for (var index = 1; index < widgetsIdArray.length; index++) {
// widgetRect = _getBoundingRectForSingleWidget(widgetsIdArray[index], relativeToPage);
// boundingRect.left = Math.min(boundingRect.left, widgetRect.left);
// boundingRect.top = Math.min(boundingRect.top, widgetRect.top);
// boundingRect.right = Math.max(boundingRect.right, widgetRect.right);
// boundingRect.bottom = Math.max(boundingRect.bottom, widgetRect.bottom);
// }
// boundingRect.centerPoint = { x: (boundingRect.right + boundingRect.left) / 2.0, y: (boundingRect.bottom + boundingRect.top) / 2.0 };
// boundingRect.width = boundingRect.right - boundingRect.left;
// boundingRect.height = boundingRect.bottom - boundingRect.top;
// return boundingRect;
//};
//var _getBoundingRectForSingleWidget = function (widgetId, relativeToPage, justSides) {
// var element = document.getElementById(widgetId);
// var boundingRect, tempBoundingRect, position;
// var displayChanged = _displayHackStart(element);
// if (_isCompoundVectorHtml(element)) {
// //tempBoundingRect = _getCompoundImageBoundingClientSize(widgetId);
// //position = { left: tempBoundingRect.left, top: tempBoundingRect.top };
// position = $(element).position();
// tempBoundingRect = {};
// tempBoundingRect.left = position.left; //= _getCompoundImageBoundingClientSize(widgetId);
// tempBoundingRect.top = position.top;
// tempBoundingRect.width = Number(element.getAttribute('data-width'));
// tempBoundingRect.height = Number(element.getAttribute('data-height'));
// } else {
// var boundingElement = element;
// if($ax.dynamicPanelManager.isIdFitToContent(widgetId)) {
// var stateId = $ax.visibility.GetPanelState(widgetId);
// if(stateId != '') boundingElement = document.getElementById(stateId);
// }
// tempBoundingRect = boundingElement.getBoundingClientRect();
// var jElement = $(element);
// position = jElement.position();
// if(jElement.css('position') == 'fixed') {
// position.left += Number(jElement.css('margin-left').replace("px", ""));
// position.top += Number(jElement.css('margin-top').replace("px", ""));
// }
// }
// var layers = $ax('#' + widgetId).getParents(true, ['layer'])[0];
// var flip = '';
// var mirrorWidth = 0;
// var mirrorHeight = 0;
// for (var i = 0; i < layers.length; i++) {
// //should always be 0,0
// var layerPos = $jobj(layers[i]).position();
// position.left += layerPos.left;
// position.top += layerPos.top;
// var outer = $ax.visibility.applyWidgetContainer(layers[i], true, true);
// if (outer.length) {
// var outerPos = outer.position();
// position.left += outerPos.left;
// position.top += outerPos.top;
// }
// //when a group is flipped we find the unflipped position
// var inner = $jobj(layers[i] + '_container_inner');
// var taggedFlip = inner.data('flip');
// if (inner.length && taggedFlip) {
// //only account for flip if transform is applied
// var matrix = taggedFlip && (inner.css("-webkit-transform") || inner.css("-moz-transform") ||
// inner.css("-ms-transform") || inner.css("-o-transform") || inner.css("transform"));
// if (matrix !== 'none') {
// flip = taggedFlip;
// mirrorWidth = $ax.getNumFromPx(inner.css('width'));
// mirrorHeight = $ax.getNumFromPx(inner.css('height'));
// }
// }
// }
// //Now account for flip
// if (flip == 'x') position.top = mirrorHeight - position.top - element.getBoundingClientRect().height;
// else if (flip == 'y') position.left = mirrorWidth - position.left - element.getBoundingClientRect().width;
// boundingRect = {
// left: position.left,
// right: position.left + tempBoundingRect.width,
// top: position.top,
// bottom: position.top + tempBoundingRect.height
// };
// _displayHackEnd(displayChanged);
// if (justSides) return boundingRect;
// boundingRect.width = boundingRect.right - boundingRect.left;
// boundingRect.height = boundingRect.bottom - boundingRect.top;
// boundingRect.centerPoint = {
// x: boundingRect.width / 2 + boundingRect.left,
// y: boundingRect.height / 2 + boundingRect.top
// };
// return boundingRect;
//};
var _getPointAfterRotate = $ax.public.fn.getPointAfterRotate = function (angleInDegrees, pointToRotate, centerPoint) {
var displacement = $ax.public.fn.vectorMinus(pointToRotate, centerPoint);
var rotationMatrix = $ax.public.fn.rotationMatrix(angleInDegrees);
rotationMatrix.tx = centerPoint.x;
rotationMatrix.ty = centerPoint.y;
return $ax.public.fn.matrixMultiply(rotationMatrix, displacement);
};
$ax.public.fn.getBoundingSizeForRotate = function(width, height, rotation) {
// point to rotate around doesn't matter since we just care about size, if location matter we need more args and location matters.
var origin = { x: 0, y: 0 };
var corner1 = { x: width, y: 0 };
var corner2 = { x: 0, y: height };
var corner3 = { x: width, y: height };
corner1 = _getPointAfterRotate(rotation, corner1, origin);
corner2 = _getPointAfterRotate(rotation, corner2, origin);
corner3 = _getPointAfterRotate(rotation, corner3, origin);
var left = Math.min(0, corner1.x, corner2.x, corner3.x);
var right = Math.max(0, corner1.x, corner2.x, corner3.x);
var top = Math.min(0, corner1.y, corner2.y, corner3.y);
var bottom = Math.max(0, corner1.y, corner2.y, corner3.y);
return { width: right - left, height: bottom - top };
}
$ax.public.fn.getBoundingRectForRotate = function (boundingRect, rotation) {
var centerPoint = boundingRect.centerPoint;
var corner1 = { x: boundingRect.left, y: boundingRect.top };
var corner2 = { x: boundingRect.right, y: boundingRect.top };
var corner3 = { x: boundingRect.right, y: boundingRect.bottom };
var corner4 = { x: boundingRect.left, y: boundingRect.bottom };
corner1 = _getPointAfterRotate(rotation, corner1, centerPoint);
corner2 = _getPointAfterRotate(rotation, corner2, centerPoint);
corner3 = _getPointAfterRotate(rotation, corner3, centerPoint);
corner4 = _getPointAfterRotate(rotation, corner4, centerPoint);
var left = Math.min(corner1.x, corner2.x, corner3.x, corner4.x);
var right = Math.max(corner1.x, corner2.x, corner3.x, corner4.x);
var top = Math.min(corner1.y, corner2.y, corner3.y, corner4.y);
var bottom = Math.max(corner1.y, corner2.y, corner3.y, corner4.y);
return { left: left, top: top, width: right - left, height: bottom - top };
}
//$ax.public.fn.getPositionRelativeToParent = function (elementId) {
// var element = document.getElementById(elementId);
// var list = _displayHackStart(element);
// var position = $(element).position();
// _displayHackEnd(list);
// return position;
//};
//var _displayHackStart = $ax.public.fn.displayHackStart = function (element) {
// // TODO: Options: 1) stop setting display none. Big change for this late in the game. 2) Implement our own bounding.
// // TODO: 3) Current method is look for any parents that are set to none, and and temporarily unblock. Don't like it, but it works.
// var parent = element;
// var displays = [];
// while (parent) {
// if (parent.style.display == 'none') {
// displays.push(parent);
// //use block to overwrites default hidden objects' display
// parent.style.display = 'block';
// }
// parent = parent.parentElement;
// }
// return displays;
//};
//var _displayHackEnd = $ax.public.fn.displayHackEnd = function (displayChangedList) {
// for (var i = 0; i < displayChangedList.length; i++) displayChangedList[i].style.display = 'none';
//};
var _isCompoundVectorHtml = $ax.public.fn.isCompoundVectorHtml = function(hElement) {
return hElement.hasAttribute('compoundmode') && hElement.getAttribute('compoundmode') == "true";
}
$ax.public.fn.removeCompound = function (jobj) { if(_isCompoundVectorHtml(jobj[0])) jobj.removeClass('compound'); }
$ax.public.fn.restoreCompound = function (jobj) { if (_isCompoundVectorHtml(jobj[0])) jobj.addClass('compound'); }
$ax.public.fn.compoundIdFromComponent = function(id) {
var pPos = id.indexOf('p');
var dashPos = id.indexOf('-');
if (pPos < 1) return id;
else if (dashPos < 0) return id.substring(0, pPos);
else return id.substring(0, pPos) + id.substring(dashPos);
}
$ax.public.fn.l2 = function (x, y) { return Math.sqrt(x * x + y * y); }
$ax.public.fn.convertToSingleImage = function (jobj) {
if(!jobj[0]) return;
var widgetId = jobj[0].id;
var object = $obj(widgetId);
if ($ax.public.fn.IsLayer(object.type)) {
var recursiveChildren = _getLayerChildrenDeep(widgetId, true);
for (var j = 0; j < recursiveChildren.length; j++)
$ax.public.fn.convertToSingleImage($jobj(recursiveChildren[j]));
return;
}
//var layer =
if(!_isCompoundVectorHtml(jobj[0])) return;
$('#' + widgetId).removeClass("compound");
$('#' + widgetId + '_img').removeClass("singleImg");
jobj[0].setAttribute('compoundmode', 'false');
var components = object.compoundChildren;
delete object.generateCompound;
for (var i = 0; i < components.length; i++) {
var componentJobj = $jobj($ax.public.fn.getComponentId(widgetId, components[i]));
componentJobj.css('display', 'none');
componentJobj.css('visibility', 'hidden');
}
}
$ax.public.fn.getContainerDimensions = function(query) {
// returns undefined if no containers found.
var containerDimensions;
for (var i = 0; i < query[0].children.length; i++) {
var node = query[0].children[i];
if (node.id.indexOf(query[0].id) >= 0 && node.id.indexOf('container') >= 0) {
containerDimensions = node.style;
}
}
return containerDimensions;
}
$ax.public.fn.rotationMatrix = function (angleInDegrees) {
var angleInRadians = angleInDegrees * (Math.PI / 180);
var cosTheta = Math.cos(angleInRadians);
var sinTheta = Math.sin(angleInRadians);
return { m11: cosTheta, m12: -sinTheta, m21: sinTheta, m22: cosTheta, tx: 0.0, ty: 0.0 };
}
$ax.public.fn.GetFieldFromStyle = function (query, field) {
var raw = query[0].style[field];
if (!raw) raw = query.css(field);
return Number(raw.replace('px', ''));
}
$ax.public.fn.setTransformHowever = function (transformString) {
return {
'-webkit-transform': transformString,
'-moz-transform': transformString,
'-ms-transform': transformString,
'-o-transform': transformString,
'transform': transformString
};
}
$ax.public.fn.getCornersFromComponent = function (id) {
var element = document.getElementById(id);
var matrix = element ? $ax.public.fn.transformFromElement(element) : [1.0, 0.0, 0.0, 1.0, 0.0, 0.0];
var currentMatrix = { m11: matrix[0], m21: matrix[1], m12: matrix[2], m22: matrix[3], tx: matrix[4], ty: matrix[5] };
var dimensions = {};
var axObj = $ax('#' + id);
var viewportLocation = axObj.offsetLocation();
dimensions.left = viewportLocation.left;
dimensions.top = viewportLocation.top;
//dimensions.left = axObj.left(true);
//dimensions.top = axObj.top(true);
var size = axObj.size();
dimensions.width = size.width;
dimensions.height = size.height;
//var transformMatrix1 = { m11: 1, m12: 0, m21: 0, m22: 1, tx: -invariant.x, ty: -invariant.y };
//var transformMatrix2 = { m11: 1, m12: 0, m21: 0, m22: 1, tx: 500, ty: 500 };
var halfWidth = dimensions.width * 0.5;
var halfHeight = dimensions.height * 0.5;
//var preTransformTopLeft = { x: -halfWidth, y: -halfHeight };
//var preTransformBottomLeft = { x: -halfWidth, y: halfHeight };
var preTransformTopRight = { x: halfWidth, y: -halfHeight };
var preTransformBottomRight = { x: halfWidth, y: halfHeight };
return {
//relativeTopLeft: $ax.public.fn.matrixMultiply(currentMatrix, preTransformTopLeft),
//relativeBottomLeft: $ax.public.fn.matrixMultiply(currentMatrix, preTransformBottomLeft),
relativeTopRight: $ax.public.fn.matrixMultiply(currentMatrix, preTransformTopRight),
relativeBottomRight: $ax.public.fn.matrixMultiply(currentMatrix, preTransformBottomRight),
centerPoint: { x: dimensions.left + halfWidth, y: dimensions.top + halfHeight }
//originalDimensions: dimensions,
//transformShift: { x: matrix[4], y: matrix[5] }
}
}
$ax.public.fn.inversePathLengthFunction = function (pathFunction) {
// these are for computing the inverse functions of path integrals.
var makeDivisionNode = function(node1, node2) {
var param = 0.5 * (node1.Param + node2.Param);
var inBetweenNode = {
LowerStop: node1,
HigherStop: node2,
Param: param,
Position: pathFunction(param),
Cumulative: 0.0
};
var lowerDisplacement = $ax.public.fn.vectorMinus(node1.Position, inBetweenNode.Position);
inBetweenNode.LowerInterval = {
Length: $ax.public.fn.l2(lowerDisplacement.x, lowerDisplacement.y),
Node: inBetweenNode,
IsHigher: false
};
var higherDisplacement = $ax.public.fn.vectorMinus(node2.Position, inBetweenNode.Position);
inBetweenNode.HigherInterval = {
Length: $ax.public.fn.l2(higherDisplacement.x, higherDisplacement.y),
Node: inBetweenNode,
IsHigher: true
};
return inBetweenNode;
};
var expandLower = function(node) {
node.LowerChild = makeDivisionNode(node.LowerStop, node);
node.LowerChild.Parent = node;
};
var expandHigher = function(node) {
node.HigherChild = makeDivisionNode(node, node.HigherStop);
node.HigherChild.Parent = node;
};
// for this function, cumulative is a global variable
var cumulative = 0.0;
var labelCumulativeLength = function(node) {
if(!node.LowerChild) {
node.LowerStop.Cumulative = cumulative;
cumulative += node.LowerInterval.Length;
node.Cumulative = cumulative;
} else labelCumulativeLength(node.LowerChild);
if(!node.HigherChild) {
node.Cumulative = cumulative;
cumulative += node.HigherInterval.Length;
node.HigherStop.Cumulative = cumulative;
} else labelCumulativeLength(node.HigherChild);
};
var getIntervalFromPathLength = function(node, length) {
if(length < node.Cumulative) {
return node.LowerChild ? getIntervalFromPathLength(node.LowerChild, length) : node.LowerInterval;
} else return node.HigherChild ? getIntervalFromPathLength(node.HigherChild, length) : node.HigherInterval;
};
var intervalLowerEnd = function(interval) {
return interval.IsHigher ? interval.Node : interval.Node.LowerStop;
};
var intervalHigherEnd = function(interval) {
return interval.IsHigher ? interval.Node.HigherStop : interval.Node;
};
var getParameterFromPathLength = function (node, length) {
var interval = getIntervalFromPathLength(node, length);
var lowerNode = intervalLowerEnd(interval);
var higherNode = intervalHigherEnd(interval);
return lowerNode.Param + (higherNode.Param - lowerNode.Param) * (length - lowerNode.Cumulative) / (higherNode.Cumulative - lowerNode.Cumulative);
};
var insertIntoSortedList = function (longer, shorter, toInsert) {
while (true) {
if (!longer) {
longer = shorter;
shorter = shorter.NextLongest;
continue;
} else if (!shorter) longer.NextLongest = toInsert;
else {
if (longer.Length >= toInsert.Length && shorter.Length <= toInsert.Length) {
longer.NextLongest = toInsert;
toInsert.NextLongest = shorter;
} else {
longer = shorter;
shorter = shorter.NextLongest;
continue;
}
}
break;
}
}
var head = {Param: 0.0, Position: pathFunction(0.0) };
var tail = { Param: 1.0, Position: pathFunction(1.0) };
var root = makeDivisionNode(head, tail);
var currentCurveLength = root.LowerInterval.Length + root.HigherInterval.Length;
var longestInterval;
if (root.LowerInterval.Length < root.HigherInterval.Length) {
longestInterval = root.HigherInterval;
longestInterval.NextLongest = root.LowerInterval;
} else {
longestInterval = root.LowerInterval;
longestInterval.NextLongest = root.HigherInterval;
}
while (longestInterval.Length * 100.0 > currentCurveLength) {
var newNode;
if (longestInterval.IsHigher) {
expandHigher(longestInterval.Node);
newNode = longestInterval.Node.HigherChild;
} else {
expandLower(longestInterval.Node);
newNode = longestInterval.Node.LowerChild;
}
currentCurveLength += (newNode.LowerInterval.Length + newNode.HigherInterval.Length - longestInterval.Length);
insertIntoSortedList(null, longestInterval, newNode.LowerInterval);
insertIntoSortedList(null, longestInterval, newNode.HigherInterval);
longestInterval = longestInterval.NextLongest;
}
labelCumulativeLength(root);
return function(lengthParam) {
return getParameterFromPathLength(root, lengthParam * cumulative);
};
}
});

View File

@@ -0,0 +1,53 @@
// ******* Object Model ******** //
$axure.internal(function($ax) {
var _implementations = {};
var _initializeObject = function(type, obj) {
$.extend(obj, _implementations[type]);
};
$ax.initializeObject = _initializeObject;
var _model = $ax.model = {};
_model.idsInRdoToHideOrLimbo = function(rdoId, scriptIds) {
var rdoScriptId = $ax.repeater.getScriptIdFromElementId(rdoId);
var path = $ax.getPathFromScriptId(rdoScriptId);
if(!scriptIds) scriptIds = [];
var rdo = $ax.getObjectFromElementId(rdoId);
var master = $ax.pageData.masters[rdo.masterId];
var masterChildren = master.diagram.objects;
for(var i = 0; i < masterChildren.length; i++) {
var obj = masterChildren[i];
var objScriptIds = obj.scriptIds;
for(var j = 0; j < objScriptIds.length; j++) {
var scriptId = objScriptIds[j];
// Anything in a layer is already handled by the layer
if($ax.getLayerParentFromElementId(scriptId)) continue;
// Make sure in same rdo
var elementPath = $ax.getPathFromScriptId(scriptId);
// This is because last part of path is for the obj itself.
elementPath.pop();
if(elementPath.length != path.length) continue;
var samePath = true;
for(var k = 0; k < path.length; k++) {
if(elementPath[k] != path[k]) {
samePath = false;
break;
}
}
if(!samePath) continue;
if($ax.public.fn.IsReferenceDiagramObject(obj.type)) _model.idsInRdoToHideOrLimbo(scriptId, scriptIds);
else if(scriptIds.indexOf(scriptId) == -1) scriptIds.push(scriptId);
break;
}
}
return scriptIds;
};
});

View File

@@ -0,0 +1,463 @@
$axure.internal(function($ax) {
var _move = {};
$ax.move = _move;
var widgetMoveInfo = {};
//register and return move info, also create container for rootlayer if needed
$ax.move.PrepareForMove = function (id, x, y, to, options, jobj, rootLayer, skipContainerForRootLayer) {
var fixedInfo = jobj ? {} : $ax.dynamicPanelManager.getFixedInfo(id);
var widget = $jobj(id);
var query = $ax('#' + id);
var isLayer = $ax.getTypeFromElementId(id) == $ax.constants.LAYER_TYPE;
if(!rootLayer) {
rootLayer = _move.getRootLayer(id);
if (rootLayer && !skipContainerForRootLayer) {
$ax.visibility.pushContainer(rootLayer, false);
if (isLayer) widget = $ax.visibility.applyWidgetContainer(id, true);
}
}
if (!jobj) jobj = widget;
var horzProp = 'left';
var vertProp = 'top';
var offsetLocation = to ? query.offsetLocation() : undefined;
var horzX = to ? x - offsetLocation.x : x;
var vertY = to ? y - offsetLocation.y : y;
//var horzX = to ? x - query.locRelativeIgnoreLayer(false) : x;
//var vertY = to ? y - query.locRelativeIgnoreLayer(true) : y;
if (fixedInfo.horizontal == 'right') {
horzProp = 'right';
horzX = to ? $(window).width() - x - $ax.getNumFromPx(jobj.css('right')) - query.width() : -x;
var leftChanges = -horzX;
} else if(fixedInfo.horizontal == 'center') {
horzProp = 'margin-left';
if (to) horzX = x - $(window).width() / 2;
}
if (fixedInfo.vertical == 'bottom') {
vertProp = 'bottom';
vertY = to ? $(window).height() - y - $ax.getNumFromPx(jobj.css('bottom')) - query.height() : -y;
var topChanges = -vertY;
} else if (fixedInfo.vertical == 'middle') {
vertProp = 'margin-top';
if (to) vertY = y - $(window).height() / 2;
}
//todo currently this always save the info, which is not needed for compound vector children and maybe some other cases
//let's optimize it later, only register if registerid is valid..
widgetMoveInfo[id] = {
x: leftChanges === undefined ? horzX : leftChanges,
y: topChanges === undefined ? vertY : topChanges,
options: options
};
return {
horzX: horzX,
vertY: vertY,
horzProp: horzProp,
vertProp: vertProp,
rootLayer: rootLayer,
jobj: jobj
};
};
$ax.move.GetWidgetMoveInfo = function() {
return $.extend({}, widgetMoveInfo);
};
_move.getRootLayer = function (id) {
var isLayer = $ax.getTypeFromElementId(id) == $ax.constants.LAYER_TYPE;
var rootLayer = isLayer ? id : '';
var parentIds = $ax('#' + id).getParents(true, '*')[0];
for(var i = 0; i < parentIds.length; i++) {
var parentId = parentIds[i];
// Keep climbing up layers until you hit a non-layer. At that point you have your root layer
if($ax.public.fn.IsLayer($ax.getTypeFromElementId(parentId))) rootLayer = parentId;
else break;
}
return rootLayer;
};
$ax.move.MoveWidget = function (id, x, y, options, to, animationCompleteCallback, shouldFire, jobj, skipOnMoveEvent) {
var moveInfo = $ax.move.PrepareForMove(id, x, y, to, options, jobj);
$ax.drag.LogMovedWidgetForDrag(id, options.dragInfo);
var object = $obj(id);
if(object && $ax.public.fn.IsLayer(object.type)) {
var childrenIds = $ax.public.fn.getLayerChildrenDeep(id, true);
//don't push container when register moveinfo for child
if(!skipOnMoveEvent) {
for(var i = 0; i < childrenIds.length; i++) $ax.move.PrepareForMove(childrenIds[i], x, y, to, options, null, moveInfo.rootLayer, true);
}
}
//if(!moveInfo) moveInfo = _getMoveInfo(id, x, y, to, options, jobj);
jobj = moveInfo.jobj;
_moveElement(id, options, animationCompleteCallback, shouldFire, jobj, moveInfo);
if(skipOnMoveEvent) return;
$ax.event.raiseSyntheticEvent(id, "onMove");
if(childrenIds) {
for(var i = 0; i < childrenIds.length; i++) $ax.event.raiseSyntheticEvent(childrenIds[i], 'onMove');
}
};
var _moveElement = function (id, options, animationCompleteCallback, shouldFire, jobj, moveInfo){
var cssStyles = {};
if(!$ax.dynamicPanelManager.isPercentWidthPanel($obj(id))) cssStyles[moveInfo.horzProp] = '+=' + moveInfo.horzX;
cssStyles[moveInfo.vertProp] = '+=' + moveInfo.vertY;
$ax.visibility.moveMovedLocation(id, moveInfo.horzX, moveInfo.vertY);
// I don't think root layer is necessary anymore after changes to layer container structure.
// Wait to try removing it until more stable.
var rootLayer = moveInfo.rootLayer;
var query = $addAll(jobj, id);
var completeCount = query.length;
var completeAnimation = function() {
completeCount--;
if(completeCount == 0 && rootLayer) $ax.visibility.popContainer(rootLayer, false);
if(animationCompleteCallback) animationCompleteCallback();
if(shouldFire) $ax.action.fireAnimationFromQueue(id, $ax.action.queueTypes.move);
};
if(options.easing==='none') {
query.animate(cssStyles, { duration: 0, queue: false });
if(rootLayer) $ax.visibility.popContainer(rootLayer, false);
if(animationCompleteCallback) animationCompleteCallback();
//if this widget is inside a layer, we should just remove the layer from the queue
if(shouldFire) $ax.action.fireAnimationFromQueue(id, $ax.action.queueTypes.move);
} else if (options.trajectory === 'straight' || moveInfo.horzX === 0 || moveInfo.vertY === 0) {
query.animate(cssStyles, {
duration: options.duration, easing: options.easing, queue: false, complete: completeAnimation});
} else {
var initialHorzProp = $ax.getNumFromPx(query.css(moveInfo.horzProp));
var initialVertProp = $ax.getNumFromPx(query.css(moveInfo.vertProp));
var state = { parameter: 0 };
var ellipseArcFunctionY = function(param) {
return {
x: initialHorzProp + (1.0 - Math.cos(param * Math.PI * 0.5)) * moveInfo.horzX,
y: initialVertProp + Math.sin(param * Math.PI * 0.5) * moveInfo.vertY
};
};
var ellipseArcFunctionX = function (param) {
return {
x: initialHorzProp + Math.sin(param * Math.PI * 0.5) * moveInfo.horzX,
y: initialVertProp + (1.0 - Math.cos(param * Math.PI * 0.5)) * moveInfo.vertY
};
};
var ellipseArcFunction = (moveInfo.horzX > 0) ^ (moveInfo.vertY > 0) ^ options.trajectory === 'arcClockwise'
? ellipseArcFunctionX : ellipseArcFunctionY;
var inverseFunction = $ax.public.fn.inversePathLengthFunction(ellipseArcFunction);
$(state).animate({ parameter: 1.0 }, {
duration: options.duration, easing: options.easing, queue: false,
step: function (now) {
var newPos = ellipseArcFunction(inverseFunction(now));
var changeFields = {};
changeFields[moveInfo.horzProp] = newPos.x;
changeFields[moveInfo.vertProp] = newPos.y;
query.css(changeFields);
},
complete: completeAnimation});
}
// //moveinfo is used for moving 'with this'
// var moveInfo = new Object();
// moveInfo.x = horzX;
// moveInfo.y = vertY;
// moveInfo.options = options;
// widgetMoveInfo[id] = moveInfo;
};
_move.nopMove = function(id, options) {
var moveInfo = new Object();
moveInfo.x = 0;
moveInfo.y = 0;
moveInfo.options = {};
moveInfo.options.easing = 'none';
moveInfo.options.duration = 0;
widgetMoveInfo[id] = moveInfo;
// Layer move using container now.
var obj = $obj(id);
if($ax.public.fn.IsLayer(obj.type)) if(options.onComplete) options.onComplete();
$ax.event.raiseSyntheticEvent(id, "onMove");
};
//rotationDegree: total degree to rotate
//centerPoint: the center of the circular path
var _noRotateOnlyMove = function (id, moveDelta, rotatableMove, fireAnimationQueue, easing, duration, completionCallback) {
moveDelta.x += rotatableMove.x;
moveDelta.y += rotatableMove.y;
if (moveDelta.x == 0 && moveDelta.y == 0) {
if(fireAnimationQueue) {
$ax.action.fireAnimationFromQueue(id, $ax.action.queueTypes.rotate);
$ax.action.fireAnimationFromQueue(id, $ax.action.queueTypes.move);
}
if (completionCallback) completionCallback();
} else {
$jobj(id).animate({ top: '+=' + moveDelta.y, left: '+=' + moveDelta.x }, {
duration: duration,
easing: easing,
queue: false,
complete: function () {
if(fireAnimationQueue) {
$ax.action.fireAnimationFromQueue(id, $ax.action.queueTypes.move);
$ax.action.fireAnimationFromQueue(id, $ax.action.queueTypes.rotate);
}
if (completionCallback) completionCallback();
}
});
}
}
_move.circularMove = function (id, degreeDelta, centerPoint, moveDelta, rotatableMove, resizeOffset, options, fireAnimationQueue, completionCallback, willDoRotation) {
var elem = $jobj(id);
if(!willDoRotation) elem = $addAll(elem, id);
var moveInfo = $ax.move.PrepareForMove(id, moveDelta.x, moveDelta.y, false, options);
// If not rotating, still need to check moveDelta and may need to handle that.
if (degreeDelta === 0) {
_noRotateOnlyMove(id, moveDelta, rotatableMove, fireAnimationQueue, options.easing, options.duration, completionCallback);
return;
}
var stepFunc = function(newDegree) {
var deg = newDegree - rotation.degree;
var widgetCenter = $ax('#' + id).offsetBoundingRect().centerPoint;
//var widgetCenter = $ax.public.fn.getWidgetBoundingRect(id).centerPoint;
//console.log("widget center of " + id + " x " + widgetCenter.x + " y " + widgetCenter.y);
var widgetNewCenter = $axure.fn.getPointAfterRotate(deg, widgetCenter, centerPoint);
// Start by getting the move not related to rotation, and make sure to update center point to move with it.
var ratio = deg / degreeDelta;
var xdelta = (moveDelta.x + rotatableMove.x) * ratio;
var ydelta = (moveDelta.y + rotatableMove.y) * ratio;
if(resizeOffset) {
var resizeShift = {};
resizeShift.x = resizeOffset.x * ratio;
resizeShift.y = resizeOffset.y * ratio;
$axure.fn.getPointAfterRotate(rotation.degree, resizeShift, { x: 0, y: 0 });
xdelta += resizeShift.x;
ydelta += resizeShift.y;
}
centerPoint.x += xdelta;
centerPoint.y += ydelta;
// Now for the move that is rotatable, it must be rotated
rotatableMove = $axure.fn.getPointAfterRotate(deg, rotatableMove, { x: 0, y: 0 });
// Now add in circular move to the mix.
xdelta += widgetNewCenter.x - widgetCenter.x;
ydelta += widgetNewCenter.y - widgetCenter.y;
$ax.visibility.moveMovedLocation(id, xdelta, ydelta);
if(xdelta < 0) elem.css('left', '-=' + -xdelta);
else if(xdelta > 0) elem.css('left', '+=' + xdelta);
if(ydelta < 0) elem.css('top', '-=' + -ydelta);
else if(ydelta > 0) elem.css('top', '+=' + ydelta);
};
var onComplete = function() {
if(fireAnimationQueue) $ax.action.fireAnimationFromQueue(id, $ax.action.queueTypes.move);
if(completionCallback) completionCallback();
if(moveInfo.rootLayer) $ax.visibility.popContainer(moveInfo.rootLayer, false);
var isPercentWidthPanel = $ax.dynamicPanelManager.isPercentWidthPanel($obj(id));
if(isPercentWidthPanel) {
$ax.dynamicPanelManager.updatePanelPercentWidth(id);
$ax.dynamicPanelManager.updatePanelContentPercentWidth(id);
}
if(elem.css('position') == 'fixed') {
if(!isPercentWidthPanel) elem.css('left', '');
elem.css('top', '');
}
};
var rotation = { degree: 0 };
if(!options.easing || options.easing === 'none' || options.duration <= 0) {
stepFunc(degreeDelta);
onComplete();
} else {
$(rotation).animate({ degree: degreeDelta }, {
duration: options.duration,
easing: options.easing,
queue: false,
step: stepFunc,
complete: onComplete
});
}
};
//rotate a widget by degree, center is 50% 50%
_move.rotate = function (id, degree, easing, duration, to, shouldFire, completionCallback) {
var currentDegree = _move.getRotationDegree(id);
if(to) degree = degree - currentDegree;
if(degree === 0) {
if (shouldFire) $ax.action.fireAnimationFromQueue(id, $ax.action.queueTypes.rotate);
return;
}
var query = $jobj(id);
var stepFunc = function(now) {
var degreeDelta = now - rotation.degree;
var newDegree = currentDegree + degreeDelta;
query.css($ax.public.fn.setTransformHowever("rotate(" + newDegree + "deg)"));
currentDegree = newDegree;
};
var onComplete = function() {
if(shouldFire) {
$ax.action.fireAnimationFromQueue($ax.public.fn.compoundIdFromComponent(id), $ax.action.queueTypes.rotate);
}
if(completionCallback) completionCallback();
$ax.annotation.adjustIconLocation(id);
};
var rotation = { degree: 0 };
$ax.visibility.setRotatedAngle(id, currentDegree + degree);
//if no animation, setting duration to 1, to prevent RangeError in rotation loops without animation
if(!easing || easing === 'none' || duration <= 0) {
stepFunc(degree);
onComplete();
} else {
$(rotation).animate({ degree: degree }, {
duration: duration,
easing: easing,
queue: false,
step: stepFunc,
complete: onComplete
});
}
};
_move.compoundRotateAround = function (id, degreeDelta, centerPoint, moveDelta, rotatableMove, resizeOffset, easing, duration, fireAnimationQueue, completionCallback) {
if (degreeDelta === 0) {
_noRotateOnlyMove($ax.public.fn.compoundIdFromComponent(id), moveDelta, rotatableMove, fireAnimationQueue, easing, duration, completionCallback, $ax.action.queueTypes.rotate);
return;
}
var elem = $jobj(id);
var rotation = { degree: 0 };
if (!easing || easing === 'none' || duration <= 0) {
duration = 1;
easing = 'linear'; //it doesn't matter anymore here...
}
var originalWidth = $ax.getNumFromPx(elem.css('width'));
var originalHeight = $ax.getNumFromPx(elem.css('height'));
var originalLeft = $ax.getNumFromPx(elem.css('left'));
var originalTop = $ax.getNumFromPx(elem.css('top'));
$(rotation).animate({ degree: degreeDelta }, {
duration: duration,
easing: easing,
queue: false,
step: function (newDegree) {
var transform = $ax.public.fn.transformFromElement(elem[0]);
var originalCenter = { x: originalLeft + 0.5 * originalWidth, y: originalTop + 0.5 * originalHeight};
var componentCenter = { x: originalCenter.x + transform[4], y: originalCenter.y + transform[5] };
var deg = newDegree - rotation.degree;
var ratio = deg / degreeDelta;
var xdelta = (moveDelta.x + rotatableMove.x) * ratio;
var ydelta = (moveDelta.y + rotatableMove.y) * ratio;
if (resizeOffset) {
var resizeShift = {};
resizeShift.x = resizeOffset.x * ratio;
resizeShift.y = resizeOffset.y * ratio;
$axure.fn.getPointAfterRotate(rotation.degree, resizeShift, { x: 0, y: 0 });
xdelta += resizeShift.x;
ydelta += resizeShift.y;
}
var rotationMatrix = $ax.public.fn.rotationMatrix(deg);
var compositionTransform = $ax.public.fn.matrixMultiplyMatrix(rotationMatrix,
{ m11: transform[0], m21: transform[1], m12: transform[2], m22: transform[3] });
//console.log("widget center of " + id + " x " + widgetCenter.x + " y " + widgetCenter.y);
var widgetNewCenter = $axure.fn.getPointAfterRotate(deg, componentCenter, centerPoint);
var newMatrix = $ax.public.fn.matrixString(compositionTransform.m11, compositionTransform.m21, compositionTransform.m12, compositionTransform.m22,
widgetNewCenter.x - originalCenter.x + xdelta, widgetNewCenter.y - originalCenter.y + ydelta);
elem.css($ax.public.fn.setTransformHowever(newMatrix));
},
complete: function () {
if (fireAnimationQueue) {
$ax.action.fireAnimationFromQueue(elem.parent()[0].id, $ax.action.queueTypes.rotate);
}
if(completionCallback) completionCallback();
}
});
};
_move.getRotationDegreeFromElement = function(element) {
if(element == null) return NaN;
var transformString = element.style['transform'] ||
element.style['-o-transform'] ||
element.style['-ms-transform'] ||
element.style['-moz-transform'] ||
element.style['-webkit-transform'];
if(transformString) {
var rotateRegex = /rotate\(([-?0-9]+)deg\)/;
var degreeMatch = rotateRegex.exec(transformString);
if(degreeMatch && degreeMatch[1]) return parseFloat(degreeMatch[1]);
}
if(window.getComputedStyle) {
var st = window.getComputedStyle(element, null);
} else {
console.log('rotation is not supported for ie 8 and below in this version of axure rp');
return 0;
}
var tr = st.getPropertyValue("transform") ||
st.getPropertyValue("-o-transform") ||
st.getPropertyValue("-ms-transform") ||
st.getPropertyValue("-moz-transform") ||
st.getPropertyValue("-webkit-transform");
if(!tr || tr === 'none') return 0;
var values = tr.split('(')[1];
values = values.split(')')[0],
values = values.split(',');
var a = values[0];
var b = values[1];
var radians = Math.atan2(b, a);
if(radians < 0) {
radians += (2 * Math.PI);
}
return radians * (180 / Math.PI);
};
_move.getRotationDegree = function(elementId) {
if($ax.public.fn.IsLayer($obj(elementId).type)) {
return $jobj(elementId).data('layerDegree');
}
return _move.getRotationDegreeFromElement(document.getElementById(elementId));
}
});

View File

@@ -0,0 +1,94 @@
// ******* Recording MANAGER ******** //
$axure.internal(function($ax) {
var _recording = $ax.recording = {};
$ax.recording.recordEvent = function(element, eventInfo, axEventObject, timeStamp) {
var elementHtml = $jobj(element);
var className = elementHtml.attr('class');
var inputValue;
if(className === 'ax_checkbox') {
inputValue = elementHtml.find('#' + element + '_input')[0].checked;
eventInfo.inputType = className;
eventInfo.inputValue = inputValue;
}
if(className === 'ax_text_field') {
inputValue = elementHtml.find('#' + element + '_input').val();
eventInfo.inputType = className;
eventInfo.inputValue = inputValue;
}
var scriptId = $ax.repeater.getScriptIdFromElementId(element);
var diagramObjectPath = $ax.getPathFromScriptId(scriptId);
var form = {
recordingId: $ax.recording.recordingId,
elementID: element,
eventType: axEventObject.description,
'eventInfo': eventInfo,
// eventObject: axEventObject,
'timeStamp': timeStamp,
'path': diagramObjectPath
// ,
// 'trigger': function() {
// $ax.event.handleEvent(element, eventInfo, axEventObject);
// return false;
// }
};
$ax.messageCenter.postMessage('logEvent', form);
};
$ax.recording.maybeRecordEvent = function(element, eventInfo, axEventObject, timeStamp) {
};
$ax.recording.recordingId = "";
$ax.recording.recordingName = "";
$ax.messageCenter.addMessageListener(function(message, data) {
if(message === 'startRecording') {
$ax.recording.maybeRecordEvent = $ax.recording.recordEvent;
$ax.recording.recordingId = data.recordingId;
$ax.recording.recordingName = data.recordingName;
} else if(message === 'stopRecording') {
$ax.recording.maybeRecordEvent = function(element, eventInfo, axEventObject, timeStamp) {
};
}
else if(message === 'playEvent') {
var eventType = makeFirstLetterLower(data.eventType);
var inputElement;
var dObj = data.element === '' ? $ax.pageData.page : $ax.getObjectFromElementId(data.element);
if(!data.axEventObject) {
data.axEventObject = dObj && dObj.interactionMap && dObj.interactionMap[eventType];
}
data.eventInfo.thiswidget = $ax.getWidgetInfo(data.element);
data.eventInfo.item = $ax.getItemInfo(data.element);
if(data.eventInfo.inputType && data.eventInfo.inputType === 'ax_checkbox') {
inputElement = $jobj(data.element + '_input');
inputElement[0].checked = data.eventInfo.inputValue;
}
if(data.eventInfo.inputType && data.eventInfo.inputType === 'ax_text_field') {
inputElement = $jobj(data.element + '_input');
inputElement.val(data.eventInfo.inputValue);
}
$ax.event.handleEvent(data.element, data.eventInfo, data.axEventObject, false, true);
}
});
var makeFirstLetterLower = function(eventName) {
return eventName.substr(0, 1).toLowerCase() + eventName.substr(1);
};
});

View File

@@ -0,0 +1,231 @@

$axure.internal(function($ax) {
var funcs = {};
var weekday = new Array(7);
weekday[0] = "Sunday";
weekday[1] = "Monday";
weekday[2] = "Tuesday";
weekday[3] = "Wednesday";
weekday[4] = "Thursday";
weekday[5] = "Friday";
weekday[6] = "Saturday";
funcs.getDayOfWeek = function() {
return _getDayOfWeek(this.getDay());
};
var _getDayOfWeek = $ax.getDayOfWeek = function(day) {
return weekday[day];
};
var month = new Array(12);
month[0] = "January";
month[1] = "February";
month[2] = "March";
month[3] = "April";
month[4] = "May";
month[5] = "June";
month[6] = "July";
month[7] = "August";
month[8] = "September";
month[9] = "October";
month[10] = "November";
month[11] = "December";
funcs.getMonthName = function() {
return _getMonthName(this.getMonth());
};
var _getMonthName = $ax.getMonthName = function(monthNum) {
return month[monthNum];
};
funcs.getMonth = function() {
return this.getMonth() + 1;
};
funcs.addYears = function(years) {
var retVal = new Date(this.valueOf());
retVal.setFullYear(this.getFullYear() + Number(years));
return retVal;
};
funcs.addMonths = function(months) {
var retVal = new Date(this.valueOf());
retVal.setMonth(this.getMonth() + Number(months));
return retVal;
};
funcs.addDays = function(days) {
var retVal = new Date(this.valueOf());
retVal.setDate(this.getDate() + Number(days));
return retVal;
};
funcs.addHours = function(hours) {
var retVal = new Date(this.valueOf());
retVal.setHours(this.getHours() + Number(hours));
return retVal;
};
funcs.addMinutes = function(minutes) {
var retVal = new Date(this.valueOf());
retVal.setMinutes(this.getMinutes() + Number(minutes));
return retVal;
};
funcs.addSeconds = function(seconds) {
var retVal = new Date(this.valueOf());
retVal.setSeconds(this.getSeconds() + Number(seconds));
return retVal;
};
funcs.addMilliseconds = function(milliseconds) {
var retVal = new Date(this.valueOf());
retVal.setMilliseconds(this.getMilliseconds() + Number(milliseconds));
return retVal;
};
var _stoHandlers = {};
_stoHandlers.literal = function(sto, scope, eventInfo) {
return sto.value;
};
//need angle bracket syntax because var is a reserved word
_stoHandlers['var'] = function(sto, scope, eventInfo) {
// Can't us 'A || B' here, because the first value can be false, true, or empty string and still be valid.
var retVal = scope.hasOwnProperty(sto.name) ? scope[sto.name] : $ax.globalVariableProvider.getVariableValue(sto.name, eventInfo);
// Handle desired type here?
if(retVal && retVal.exprType) {
retVal = $ax.expr.evaluateExpr(retVal, eventInfo);
}
if((sto.desiredType == 'int' || sto.desiredType == 'float')) {
var num = new Number(retVal);
retVal = isNaN(num.valueOf()) ? retVal : num;
}
return retVal;
};
//TODO: Perhaps repeaterId can be detirmined at generation, and stored in the sto info.
_stoHandlers.item = function(sto, scope, eventInfo, prop) {
prop = prop || (eventInfo.data ? 'data' : eventInfo.link ? 'url' : eventInfo.image ? 'img' : 'text');
var id = sto.isTarget || !$ax.repeater.hasData(eventInfo.srcElement, sto.name) ? eventInfo.targetElement : eventInfo.srcElement;
return getData(eventInfo, id, sto.name, prop);
};
var getData = function(eventInfo, id, name, prop) {
var repeaterId = $ax.getParentRepeaterFromScriptId($ax.repeater.getScriptIdFromElementId(id));
var itemId = $ax.repeater.getItemIdFromElementId(id);
return $ax.repeater.getData(eventInfo, repeaterId, itemId, name, prop);
};
_stoHandlers.paren = function(sto, scope, eventInfo) {
return _evaluateSTO(sto.innerSTO, scope, eventInfo);
};
_stoHandlers.fCall = function(sto, scope, eventInfo) {
//TODO: [mas] handle required type
var thisObj = _evaluateSTO(sto.thisSTO, scope, eventInfo);
if(sto.thisSTO.desiredType == 'string' && sto.thisSTO.computedType != 'string') thisObj = thisObj.toString();
var args = [];
for(var i = 0; i < sto.arguments.length; i++) {
args[i] = _evaluateSTO(sto.arguments[i], scope, eventInfo);
}
var fn = (funcs.hasOwnProperty(sto.func) && funcs[sto.func]) || thisObj[sto.func];
return fn.apply(thisObj, args);
};
_stoHandlers.propCall = function(sto, scope, eventInfo) {
//TODO: [mas] handle required type
if((sto.prop == 'url' || sto.prop == 'img') && sto.thisSTO.sto == 'item') return _stoHandlers.item(sto.thisSTO, scope, eventInfo, sto.prop);
var thisObj = _evaluateSTO(sto.thisSTO, scope, eventInfo);
var prop = thisObj[sto.prop] instanceof Function ? thisObj[sto.prop]() : thisObj[sto.prop];
return prop;
};
var _binOps = {};
_binOps['+'] = function(left, right) {
if(left instanceof Date) return addDayToDate(left, right);
if(right instanceof Date) return addDayToDate(right, left);
var num = Number(left) + Number(right);
return isNaN(num) ? (String(left) + String(right)) : num;
};
_binOps['-'] = function(left, right) {
if(left instanceof Date) return addDayToDate(left, -right);
return left - right;
};
_binOps['*'] = function(left, right) { return Number(left) * Number(right); };
_binOps['/'] = function(left, right) { return Number(left) / Number(right); };
_binOps['%'] = function(left, right) { return Number(left) % Number(right); };
_binOps['=='] = function(left, right) { return _getBool(left) == _getBool(right); };
_binOps['!='] = function(left, right) { return _getBool(left) != _getBool(right); };
_binOps['<'] = function(left, right) { return Number(left) < Number(right); };
_binOps['<='] = function(left, right) { return Number(left) <= Number(right); };
_binOps['>'] = function(left, right) { return Number(left) > Number(right); };
_binOps['>='] = function(left, right) { return Number(left) >= Number(right); };
_binOps['&&'] = function(left, right) { return _getBool(left) && _getBool(right); };
_binOps['||'] = function(left, right) { return _getBool(left) || _getBool(right); };
// TODO: Move this to generic place to be used.
var addDayToDate = function(date, days) {
var retVal = new Date(date.valueOf());
retVal.setDate(date.getDate() + days);
return retVal;
};
var _unOps = {};
_unOps['+'] = function(arg) { return +arg; };
_unOps['-'] = function(arg) { return -arg; };
_unOps['!'] = function(arg) { return !_getBool(arg); };
_stoHandlers.binOp = function(sto, scope, eventInfo) {
var left = _evaluateSTO(sto.leftSTO, scope, eventInfo);
var right = _evaluateSTO(sto.rightSTO, scope, eventInfo);
return _binOps[sto.op](left, right);
};
_stoHandlers.unOp = function(sto, scope, eventInfo) {
var input = _evaluateSTO(sto.inputSTO, scope, eventInfo);
return _unOps[sto.op](input);
};
var _getBool = function(val) {
var lowerVal = val.toLowerCase ? val.toLowerCase() : val;
return lowerVal == "false" ? false : lowerVal == "true" ? true : val;
};
$ax.getBool = _getBool;
var _evaluateSTO = function(sto, scope, eventInfo) {
if(sto.sto == 'error') return undefined;
return _tryEscapeRichText(castSto(_stoHandlers[sto.sto](sto, scope, eventInfo), sto), eventInfo);
};
$ax.evaluateSTO = _evaluateSTO;
var castSto = function(val, sto) {
var type = sto.computedType || sto.desiredType;
if(type == 'string') val = String(val);
else if(type == 'date' && !(val instanceof Date)) val = new Date(val);
else if(type == 'int' || type == 'float') val = Number(val);
else if(type == 'bool') val = Boolean(val);
return val;
};
var _tryEscapeRichText = function(text, eventInfo) {
return eventInfo.htmlLiteral ? _escapeRichText(text) : text;
};
var _escapeRichText = function(text) {
if(typeof (text) != 'string') return text;
return text.replace('<', '&lt;');
};
});

View File

@@ -0,0 +1,189 @@
// This is actually for BOTH trees and menus
$axure.internal(function($ax) {
var _tree = $ax.tree = {};
var _menu = $ax.menu = {};
$ax.menu.InitializeSubmenu = function(subMenuId, cellId) {
var $submenudiv = $('#' + subMenuId);
//mouseenter and leave for parent table cell
$('#' + cellId).mouseenter(function(e) {
//show current submenu
// var submenuElement = document.getElementById(subMenuId);
// if($ax.visibility.IsVisible(submenuElement) && submenuElement.style.display !== 'none') return;
$ax.visibility.SetIdVisible(subMenuId, true);
$ax.legacy.BringToFront(subMenuId);
//$submenudiv.find('.menu_item').each(function() {
// $ax.style.updateTextAlignmentForVisibility($ax.GetTextPanelId($(this).attr('id')));
//});
_fireEventForSubmenu(subMenuId, "onShow");
}).mouseleave(function (e) {
var offset = $submenudiv.offset();
var subcontwidth = $submenudiv.width();
var subcontheight = $submenudiv.height();
//If mouse is not within the submenu (added 3 pixel margin to top and left calculations), then close the submenu...
if(e.pageX + 3 < offset.left || e.pageX > offset.left + subcontwidth || e.pageY + 3 < offset.top || e.pageY > offset.top + subcontheight) {
$submenudiv.find('.sub_menu').addBack().each(function () {
// if(!$ax.visibility.IsVisible(this)) return;
$ax.visibility.SetVisible(this, false);
_fireEventForSubmenu(subMenuId, "onHide");
});
$ax.style.SetWidgetHover(cellId, false);
}
});
$submenudiv.css('display', 'none');
//mouseleave for submenu
$submenudiv.mouseleave(function(e) {
//close this menu and all menus below it
$(this).find('.sub_menu').addBack().css({ 'visibility': 'hidden', 'display': 'none' }).each(function () {
// if(!$ax.visibility.IsVisible(this)) return;
_fireEventForSubmenu(this.id, "onHide");
});
$ax.style.SetWidgetHover(cellId, false);
});
};
var _fireEventForSubmenu = function(targetId, eventName) {
var diagramObject = $ax.getObjectFromElementId(targetId);
var event = diagramObject.interactionMap && diagramObject.interactionMap[eventName];
if(event) {
var eventInfo = $ax.getEventInfoFromEvent($ax.getjBrowserEvent(), false, targetId);
$ax.event.handleEvent(targetId, eventInfo, event, false, true);
}
}
function IsNodeVisible(nodeId) {
var current = window.document.getElementById(nodeId);
var parent = current.parentNode;
//move all the parent's children that are below the node and their annotations
while(!$(current).hasClass("treeroot")) {
if(!$ax.visibility.IsVisible(parent)) return false;
current = parent;
parent = parent.parentNode;
}
return true;
}
$ax.tree.ExpandNode = function(nodeId, childContainerId, plusMinusId) {
var container = window.document.getElementById(childContainerId);
if(!container || $ax.visibility.IsVisible(container)) return;
$ax.visibility.SetVisible(container, true);
if(plusMinusId != '') $ax.style.SetWidgetSelected(plusMinusId, true);
var delta = _getExpandCollapseDelta(nodeId, childContainerId);
var isVisible = IsNodeVisible(nodeId);
var current = window.document.getElementById(nodeId);
var parent = current.parentNode;
//move all the parent's children that are below the node and their annotations
while(!$(current).hasClass("treeroot")) {
var after = false;
var i = 0;
for(i = 0; i < parent.childNodes.length; i++) {
var child = parent.childNodes[i];
if(after && child.id && $(child).hasClass("treenode")) {
var elementId = child.id;
child.style.top = $ax.getNumFromPx($(child).css('top')) + delta + 'px';
var ann = window.document.getElementById(elementId + "_ann");
if (ann) ann.style.top = $ax.getNumFromPx($(ann).css('top')) + delta + 'px';
}
if(child == current) after = true;
}
current = parent;
parent = parent.parentNode;
if(!isVisible && $ax.visibility.IsVisible(parent)) break;
}
};
$ax.tree.CollapseNode = function(nodeId, childContainerId, plusMinusId) {
var container = window.document.getElementById(childContainerId);
if(!container || !$ax.visibility.IsVisible(container)) return;
if(plusMinusId != '') $ax.style.SetWidgetSelected(plusMinusId, false);
var delta = _getExpandCollapseDelta(nodeId, childContainerId);
//hide it after getting the delta, otherwise the delta can't be calculated (offsetParent is null)
$ax.visibility.SetVisible(container, false);
var isVisible = IsNodeVisible(nodeId);
var current = window.document.getElementById(nodeId);
var parent = current.parentNode;
//move all the parent's children that are below the node and their annotations
while(!$(current).hasClass("treeroot")) {
var after = false;
var i = 0;
for(i = 0; i < parent.childNodes.length; i++) {
var child = parent.childNodes[i];
if(after && child.id && $(child).hasClass("treenode")) {
var elementId = child.id;
child.style.top = $ax.getNumFromPx($(child).css('top')) - delta + 'px';
var ann = window.document.getElementById(elementId + "_ann");
if (ann) ann.style.top = $ax.getNumFromPx($(ann).css('top')) - delta + 'px';
}
if(child == current) after = true;
}
current = parent;
parent = current.parentNode;
if(!isVisible && $ax.visibility.IsVisible(parent)) break;
}
};
var _getExpandCollapseDelta = function(nodeId, childContainerId) {
return _getChildContainerHeightHelper(childContainerId);
};
var _getChildContainerHeightHelper = function(childContainerId) {
var height = 0;
$('#' + childContainerId).children().each(function() {
if($(this).hasClass("treenode")) {
height += $(this).height();
var subContainer = window.document.getElementById(this.id + '_children');
if(subContainer && $ax.visibility.IsVisible(subContainer)) {
height += _getChildContainerHeightHelper(subContainer.id);
}
}
});
return height;
};
$ax.tree.InitializeTreeNode = function(nodeId, plusminusid, childContainerId, selectText) {
var childContainer = window.document.getElementById(childContainerId);
if(childContainer) {
//relying on the html generator to put this inline so we know to collapse by default
var isCollapsed = childContainer.style.visibility == "hidden";
if(isCollapsed) $ax.visibility.SetVisible(childContainer, false);
if(!isCollapsed && plusminusid != '') $ax.style.SetWidgetSelected(plusminusid, true);
}
if(plusminusid != '') {
$jobj(plusminusid).click(function() {
var visibleSet = $ax.visibility.IsIdVisible(childContainerId);
if(visibleSet) $ax.tree.CollapseNode(nodeId, childContainerId, plusminusid);
else $ax.tree.ExpandNode(nodeId, childContainerId, plusminusid);
$ax.tree.SelectTreeNode(nodeId, true);
return false;
}).css('cursor', 'default');
}
};
var _getButtonShapeId = function(id) {
var obj = $obj(id);
return $ax.public.fn.IsTreeNodeObject(obj.type) ? $ax.getElementIdFromPath([obj.buttonShapeId], { relativeTo: id }) : id;
};
$ax.tree.SelectTreeNode = function(id, selected) {
$ax.style.SetWidgetSelected(_getButtonShapeId(id), selected);
};
});

View File

@@ -0,0 +1,99 @@
// ******* Deep Copy ******** //
$axure.internal(function($ax) {
// TODO: [ben] Ah, infinite loops cause major issues here. Tried saving objects we've already hit, but that didn't seem to work (at least at my first shot).
// TODO: [ben] To continue from above, added a filter to filter out problem keys. Will need a better way of sorting this out eventually.
var _deepCopy = function (original, trackCopies, filter) {
if(trackCopies) {
var index = _getCopyIndex(original);
if(index != -1) return _originalToCopy[index][1];
}
var isArray = original instanceof Array;
var isObject = !(original instanceof Function) && !(original instanceof Date) && (original instanceof Object);
if(!isArray && !isObject) return original;
var copy = isArray ? [] : { };
if(trackCopies) _originalToCopy.push([original, copy]);
isArray ? deepCopyArray(original, trackCopies, copy, filter) : deepCopyObject(original, trackCopies, copy, filter);
return copy;
};
$ax.deepCopy = _deepCopy;
// Hacky way to copy event info. Copying dragInfo causes major issues due to infinite loops
// Hashmap doesn't map objects well. It just toStrings them, making them all the same key. This has to be slow...
var _originalToCopy = [];
var _getCopyIndex = function(original) {
for(var i = 0; i < _originalToCopy.length; i++) if(original === _originalToCopy[i][0]) return i;
return -1;
};
$ax.eventCopy = function(eventInfo) {
var copy = _deepCopy(eventInfo, true, ['dragInfo', 'elementQuery', 'obj']);
// reset the map. TODO: May need to reset elsewhere too, but this is the only way it's used currently
_originalToCopy = [];
return copy;
};
var deepCopyArray = function(original, trackCopies, copy, filter) {
for(var i = 0; i < original.length; i++) {
copy[i] = _deepCopy(original[i], trackCopies, filter);
}
};
var deepCopyObject = function(original, trackCopies, copy, filter) {
for(var key in original) {
if(!original.hasOwnProperty(key)) continue; // Continue if the prop was not put there like a dictionary, but just a native part of the object
if(filter && filter.indexOf[key] != -1) copy[key] = original[key]; // If that key is filtered out, skip recursion on it.
else copy[key] = _deepCopy(original[key], trackCopies, filter);
}
};
// Our implementation of splice because it is broken in IE8...
$ax.splice = function(array, startIndex, count) {
var retval = [];
if(startIndex >= array.length || startIndex < 0 || count == 0) return retval;
if(!count || startIndex + count > array.length) count = array.length - startIndex;
for(var i = 0; i < count; i++) retval[i] = array[startIndex + i];
for(i = startIndex + count; i < array.length; i++) array[i - count] = array[i];
for(i = 0; i < count; i++) array.pop();
return retval;
};
});
// ******* Flow Shape Links ******** //
$axure.internal(function($ax) {
$(window.document).ready(function() {
if (!$ax.document.configuration.linkFlowsToPages && !$ax.document.configuration.linkFlowsToPagesNewWindow) return;
$ax(function (dObj) { return ($ax.public.fn.IsVector(dObj.type) || $ax.public.fn.IsSnapshot(dObj.type)) && dObj.referencePageUrl; }).each(function (dObj, elementId) {
var elementIdQuery = $('#' + elementId);
if($ax.document.configuration.linkFlowsToPages && !$ax.event.HasClick(dObj)) {
elementIdQuery.css("cursor", "pointer");
elementIdQuery.click(function() {
$ax.navigate({
url: dObj.referencePageUrl,
target: "current",
includeVariables: true
});
});
}
if($ax.document.configuration.linkFlowsToPagesNewWindow) {
$('#' + elementId + "_ref").append("<div id='" + elementId + "PagePopup' class='refpageimage'></div>");
$('#' + elementId + "PagePopup").click(function() {
$ax.navigate({
url: dObj.referencePageUrl,
target: "new",
includeVariables: true
});
});
}
});
});
});

View File

@@ -0,0 +1,151 @@
// ******* GLOBAL VARIABLE PROVIDER ******** //
$axure.internal(function($ax) {
var _globalVariableValues = {};
var _globalVariableProvider = {};
$ax.globalVariableProvider = _globalVariableProvider;
var setVariableValue = function(variable, value, suppressBroadcast) {
if(!(value instanceof Object)) value = value.toString();
variable = variable.toLowerCase();
_globalVariableValues[variable] = value;
if(suppressBroadcast !== true) {
var varData = {
globalVarName: variable,
globalVarValue: value.toString()
};
$axure.messageCenter.postMessage('setGlobalVar', varData);
}
//Post global var values only if pageData is loaded (suppresses exception which occurs when page loads)
if($ax.pageData) {
_postGlobalVarVals();
}
};
_globalVariableProvider.setVariableValue = setVariableValue;
var getVariableValue = function(variable, eventInfo, ignoreDefaultsForLinkUrl) {
variable = variable.toLowerCase();
if(_globalVariableValues[variable] !== undefined) {
//If this is for the GetLinkUrl function and
//the current value of the global variable is the same as the default defined in the document, don't return it
if(ignoreDefaultsForLinkUrl == true && $ax.document.globalVariables[variable] == _globalVariableValues[variable]) {
return null;
}
return _globalVariableValues[variable];
}
if($ax.document.globalVariables[variable] !== undefined) return ignoreDefaultsForLinkUrl == true ? null : $ax.document.globalVariables[variable];
switch(variable) {
case "pagename": return $ax.pageData.page.name;
case "now": return eventInfo.now;
case "gendate": return $ax.pageData.generationDate;
case "dragx": return $ax.drag.GetDragX();
case "dragy": return $ax.drag.GetDragY();
case "totaldragx": return $ax.drag.GetTotalDragX();
case "totaldragy": return $ax.drag.GetTotalDragY();
case "dragtime": return $ax.drag.GetDragTime();
case "math": return Math;
case "date": return Date;
case "window": return eventInfo && eventInfo.window;
case "this": return eventInfo && eventInfo.thiswidget && $ax.getWidgetInfo(eventInfo.thiswidget.elementId);
case "item": return (eventInfo && eventInfo.item && eventInfo.item.valid && eventInfo.item) || getVariableValue('targetitem', eventInfo, ignoreDefaultsForLinkUrl);
case "targetitem": return eventInfo && eventInfo.targetElement && $ax.getItemInfo(eventInfo.targetElement);
case "repeater": return eventInfo && eventInfo.repeater;
case "target": return eventInfo && eventInfo.targetElement && $ax.getWidgetInfo(eventInfo.targetElement);
case "cursor": return eventInfo && eventInfo.cursor;
default:
var gen = variable.substr(0, 3) == "gen";
var date = gen ? $ax.pageData.generationDate : new Date();
var prop = gen ? variable.substr(3) : variable;
switch(prop) {
case "day": return date.getDate();
case "month": return date.getMonth() + 1;
case "monthname": return $ax.getMonthName(date.getMonth());
case "dayofweek": return $ax.getDayOfWeek(date.getDay());
case "year": return date.getFullYear();
case "time": return date.toLocaleTimeString();
case "hours": return date.getHours();
case "minutes": return date.getMinutes();
case "seconds": return date.getSeconds();
default: return '';
}
}
};
_globalVariableProvider.getVariableValue = getVariableValue;
var load = function() {
var csum = false;
var query = (window.location.href.split("#")[1] || ''); //hash.substring(1); Firefox decodes this so & in variables breaks
if(query.length > 0) {
var vars = query.split("&");
for(var i = 0; i < vars.length; i++) {
var pair = vars[i].split("=");
var varName = pair[0];
var varValue = pair[1];
if(varName) {
if(varName == 'CSUM') {
csum = true;
} else setVariableValue(varName, decodeURIComponent(varValue), true);
}
}
if(!csum && query.length > 250) {
window.alert('Axure Warning: The variable values were too long to pass to this page.\n\nIf you are using IE, using Chrome or Firefox will support more data.');
}
}
};
var getLinkUrl = function(baseUrl) {
var toAdd = '';
var definedVariables = _getDefinedVariables();
for(var i = 0; i < definedVariables.length; i++) {
var key = definedVariables[i];
var val = getVariableValue(key, undefined, true);
if(val != null) {
if(toAdd.length > 0) toAdd += '&';
toAdd += key + '=' + encodeURIComponent(val);
}
}
return toAdd.length > 0 ? baseUrl + ($axure.shouldSendVarsToServer() ? '?' : '#') + toAdd + "&CSUM=1" : baseUrl;
};
_globalVariableProvider.getLinkUrl = getLinkUrl;
var _getDefinedVariables = function() {
return $ax.pageData.variables;
};
_globalVariableProvider.getDefinedVariables = _getDefinedVariables;
var _postGlobalVarVals = function() {
var retVal = {};
var definedVariables = _getDefinedVariables();
for(var i = 0; i < definedVariables.length; i++) {
var key = definedVariables[i];
var val = getVariableValue(key);
if(val != null) {
retVal[key] = val;
}
}
$ax.messageCenter.postMessage('globalVariableValues', retVal);
};
$ax.messageCenter.addMessageListener(function(message, data) {
if(message == 'getGlobalVariables') {
_postGlobalVarVals();
} else if(message == 'resetGlobalVariables') {
_globalVariableValues = {};
_postGlobalVarVals();
}
});
load();
});

View File

@@ -0,0 +1,209 @@
// ******* SITEMAP TOOLBAR VIEWER ACTIONS ******** //
$axure.internal(function ($ax) {
var userTriggeredEventNames = ['onClick', 'onDoubleClick', 'onMouseOver', 'onMouseMove', 'onMouseOut', 'onMouseDown', 'onMouseUp',
'onKeyDown', 'onKeyUp', 'onFocus', 'onLostFocus', 'onTextChange', 'onSelectionChange', 'onSelectedChange', 'onSelect', 'onUnselect',
'onSwipeLeft', 'onSwipeRight', 'onSwipeUp', 'onSwipeDown', 'onDragStart', 'onDrag', 'onDragDrop', 'onScroll', 'onContextMenu', 'onMouseHover', 'onLongClick'];
//var _toggleSelectWidgetNoteForRepeater = function (repeaterId, scriptId, select) {
// var itemIds = $ax.getItemIdsForRepeater(repeaterId);
// for(var i = 0; i < itemIds.length; i++) {
// var itemId = itemIds[i];
// var elementId = $ax.repeater.createElementId(scriptId, itemId);
// if(select) $('#' + elementId).addClass('widgetNoteSelected');
// else $('#' + elementId).removeClass('widgetNoteSelected');
// }
//}
$ax.messageCenter.addMessageListener(function (message, data) {
//If annotation toggle message received from sitemap, toggle footnotes
if(message == 'toggleSelectWidgetNote') {
if (!IOS) {
$('.widgetNoteSelected').removeClass('widgetNoteSelected');
}
if(!data.value) return;
//if(lastSelectedWidgetNote == data.id) {
// lastSelectedWidgetNote = null;
// return;
//}
$ax('*').each(function(obj, elementId) {
if (obj.id == data.id) {
if (!IOS) {
$('#' + elementId).addClass('widgetNoteSelected');
}
_scrollToSelectedNote($('#' + elementId), data.view);
}
});
}
});
var _scrollToSelectedNote = function ($elmt, view) {
var isLandscape = IOS ? window.orientation != 0 && window.orientation != 180 : false;
var winWidth = !IOS ? $(window).width() : (isLandscape ? window.screen.height : window.screen.width) - view.panelWidthOffset;
var winHeight = !IOS ? $(window).height() : view.height;
var docLeft = $('html').last().scrollLeft();
var docTop = $('html').last().scrollTop();
var docRight = docLeft + winWidth;
var docBottom = docTop + winHeight;
var scale = $('#base').css('transform');;
scale = (scale == "none") ? 1 : Number(scale.substring(scale.indexOf('(') + 1, scale.indexOf(',')));
var bodyLeft = ($('body').css('left') !== undefined && $('body').css('left') !== "auto") ? Number($('body').css('left').replace('px','')) : 0;
var top = scale * Number($elmt.css('top').replace('px', ''));
var bottom = top + scale * $elmt.height();
var left = scale * Number($elmt.css('left').replace('px', '')) + bodyLeft;
var right = left + scale * $elmt.width();
var doHorizontalMove = left < docLeft || right > docRight;
var doVerticalMove = top < docTop || bottom > docBottom;
var padding = scale * 50;
var newScrollLeft = 0
if (left < docLeft) {
newScrollLeft = left - padding;
} else if (right > docRight) {
newScrollLeft = right + padding - winWidth;
}
var newScrollTop = 0
if (top < docTop) {
newScrollTop = top - padding;
} else if (bottom > docBottom) {
newScrollTop = bottom + padding - winHeight;
}
// Device Frame or Scale to width or Scale to fit (situations where there is no horizontal scroll)
if (view.h || view.scaleVal == 1 || view.scaleVal == 2) {
doHorizontalMove = false;
}
// Has Device Frame or Scale to Width and widget with note is outside of viewable panel right bounds
if ((view.scaleVal == 1 || view.h) && (left > docRight)) {
doVerticalMove = false;
}
// TODO: need to do something for dynamic panel with scroll
if (doHorizontalMove && doVerticalMove) {
$("html, body").animate({ scrollLeft: newScrollLeft, scrollTop: newScrollTop }, 300);
} else if (doHorizontalMove) {
$("html, body").animate({ scrollLeft: newScrollLeft }, 300);
} else if (doVerticalMove) {
$("html, body").animate({ scrollTop: newScrollTop }, 300);
}
}
var highlightEnabled = false;
$ax.messageCenter.addMessageListener(function(message, data) {
if(message == 'highlightInteractive') {
highlightEnabled = data == true;
_applyHighlight($ax('*'));
}
});
var _applyHighlight = $ax.applyHighlight = function(query, ignoreUnset) {
if(ignoreUnset && !highlightEnabled) return;
var pulsateClassName = 'legacyPulsateBorder';
//Determine if the widget has a defined userTriggeredEventName specified in the array above
var _isInteractive = function(diagramObject) {
if(diagramObject && diagramObject.interactionMap) {
for(var index in userTriggeredEventNames) {
if(diagramObject.interactionMap[userTriggeredEventNames[index]]) return true;
}
}
return false;
};
//Traverse through parent layers (if any) of an element and see if any have a defined userTriggeredEventName
var _findMatchInParent = function(id) {
var parents = $ax('#' + id).getParents(true, ['layer'])[0];
for(var i in parents) {
var parentId = parents[i];
var parentObj = $ax.getObjectFromScriptId(parentId);
if(_isInteractive(parentObj)) return true;
}
return false;
};
//Find all widgets with a defined userTriggeredEventName specified in the array above
var $matchingElements = query.filter(function (obj, id) {
//This prevents the top left corner of the page from highlighting with everything else
if($ax.public.fn.IsLayer(obj.type)) return false;
if(_isInteractive(obj)) return true;
else if($ax.public.fn.IsVector(obj.type) && obj.referencePageUrl) return true;
//Last check on the object's parent layer(s), if a layer has a defined userTriggeredEventName
//then we shall highlight each member of that layer TODO This is a design decision and is subject to change
return _findMatchInParent(id);
}).$();
var isHighlighted = $matchingElements.is('.' + pulsateClassName);
//Toggle the pulsate class on the matched elements
if(highlightEnabled && !isHighlighted) {
$matchingElements.addClass(pulsateClassName);
} else if(!highlightEnabled && isHighlighted) {
$matchingElements.removeClass(pulsateClassName);
}
};
$axure.getIdAndRectAtLoc = function (data) {
var element = document.elementFromPoint(data.x, data.y);
if (!element) return undefined;
var jObj = _getElementIdFromTarget(element);
if (jObj.length > 0) {
var id = jObj.attr('id');
var axObj = $ax('#' + id);
var rect = axObj.pageBoundingRect();
return { 'id': id, 'rect': rect };
}
return undefined;
}
$axure.getIdRectAndStyleAtLoc = function(data) {
var element = document.elementFromPoint(data.x, data.y);
if (!element) return undefined;
var jObj = _getElementIdFromTarget(element);
if (jObj.length > 0) {
var id = jObj.attr('id');
return $axure.getRectAndStyleById(id);
}
return undefined;
}
$axure.getRectAndStyleById = function (id) {
var axObj = $ax('#' + id);
var rect = axObj.pageBoundingRect();
var style = $ax.style.computeFullStyle(id, $ax.style.generateState(id), $ax.adaptive.currentViewId);
style.text = axObj.text();
return { 'id': id, 'rect': rect, 'style': style };
}
$axure.isIdVisible = function (id) {
return id ? $ax.visibility.IsIdVisible(id) : false;
}
var _getElementIdFromTarget = function (target) {
var targetId = target.id;
var jTarget = $(target);
while((!targetId || targetId.indexOf('cache') > -1) && jTarget[0].tagName != 'HTML') {
jTarget = jTarget.parent();
targetId = jTarget.attr('id');
}
if(targetId && targetId != 'base') {
var sections = targetId.split('_');
return $('#' + sections[0]);
}
return '';
}
});

View File

@@ -0,0 +1,231 @@
/*
*
*
*
*
*/
(function() {
// define the root namespace object
if(!window.$axure) window.$axure = {};
$axure.utils = {};
// ------------------------------------------------------------------------
// Makes an object bindable
// ------------------------------------------------------------------------
$axure.utils.makeBindable = function(obj, events) {
if(obj.registeredBindings != null) return;
// copy the events
obj.bindableEvents = events.slice();
obj.registeredBindings = {};
obj.bind = function(eventName, fn) {
var binding = {};
binding.eventName = eventName;
binding.action = fn;
var bindingList = this.registeredBindings[eventName];
if(bindingList == null) {
bindingList = [];
this.registeredBindings[eventName] = bindingList;
}
bindingList[bindingList.length] = binding;
};
obj.unbind = function(eventName) {
if(eventName.indexOf('.') >= 0) {
this.registeredBindings[eventName] = null;
} else {
var event = eventName.split('.')[0];
for(var bindingKey in this.registeredBindings) {
if(bindingKey.split('.')[0] == event) {
this.registeredBindings[bindingKey] = null;
}
}
}
};
obj.triggerEvent = function(eventName, arg) {
for(var bindingKey in this.registeredBindings) {
if(bindingKey.split('.')[0] == eventName) {
var bindings = this.registeredBindings[bindingKey];
for(var i = 0; i < bindings.length; i++) {
if(arg == null) {
bindings[i].action();
} else {
bindings[i].action(arg);
}
}
}
}
};
};
$axure.utils.loadCSS = function(url) {
$('head').append('<link text="text/css" href="' + url + '" rel="Stylesheet" />');
};
$axure.utils.loadJS = function(url) {
$('head').append('<script text="text/javascript" language="JavaScript" src="' + url + '"></script>');
};
$axure.utils.curry = function(fn) {
var curriedArgs = Array.prototype.slice.call(arguments, [1]);
return function() {
fn.apply(this, curriedArgs.concat(Array.prototype.slice.call(arguments)));
};
};
$axure.utils.succeeded = function(result) {
return result && result.success;
};
$axure.utils.createUniqueTag = function() {
return Math.random().toString().substring(2) +
Math.random().toString().substring(2) +
Math.random().toString().substring(2) +
Math.random().toString().substring(2);
};
$axure.utils.formatDate = function(date) {
var months = [
"Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
var hours = date.getHours();
var amPm = (hours > 11 ? 'PM' : 'AM');
hours = hours % 12;
if(hours == '0') hours = '12';
var minutes = date.getMinutes() + '';
if(minutes.length == 1) {
minutes = '0' + minutes;
}
return [
months[date.getMonth()], ' ', date.getDate(), ' ', date.getFullYear(), ' ',
hours, ':', minutes, ' ', amPm].join('');
};
$axure.utils.quickObject = function() {
var returnVal = {};
for(var i = 0; i < arguments.length; i += 2) {
returnVal[arguments[i]] = arguments[i + 1];
}
return returnVal;
};
var matrixBase = {
mul: function(val) {
if(val.x !== undefined) {
return $axure.utils.Vector2D(
this.m11 * val.x + this.m12 * val.y + this.tx,
this.m21 * val.x + this.m22 * val.y + this.ty);
} else if(val.m11) {
return $axure.utils.Matrix2D(
this.m11 * val.m11 + this.m12 * val.m21,
this.m11 * val.m12 + this.m12 * val.m22,
this.m21 * val.m11 + this.m22 * val.m21,
this.m21 * val.m12 + this.m22 * val.m22,
val.tx + this.tx * val.m11 + this.ty * val.m21,
val.ty + this.tx * val.m12 + this.ty * val.m22
);
} else if(Number(val)) {
var num = Number(val);
return $axure.utils.Matrix2D(this.m11 * num, this.m12 * num,
this.m21 * num, this.m22 * num,
this.tx * num, this.ty * num);
} else return undefined;
},
rotate: function(angle) {
var angleRad = angle * Math.PI / 180;
var c = Math.cos(angleRad);
var s = Math.sin(angleRad);
return this.mul($axure.utils.Matrix2D(c, -s, s, c));
},
translate: function(tx, ty) {
return this.mul($axure.utils.Matrix2D(1, 0, 0, 1, tx, ty));
}
};
$axure.utils.Matrix2D = function(m11, m12, m21, m22, tx, ty) {
return $.extend({
m11: m11 || 0,
m12: m12 || 0,
m21: m21 || 0,
m22: m22 || 0,
tx: tx || 0,
ty: ty || 0
}, matrixBase);
};
$axure.utils.Vector2D = function(x, y) {
return { x: x || 0, y: y || 0 };
};
$axure.utils.Matrix2D.identity = function() {
return $axure.utils.Matrix2D(1, 0, 0, 1, 0, 0);
};
})();
// TODO: [mas] simplify this
if(window.$axure && window.$axure.internal) {
$axure.internal(function($ax) { $ax.utils = $axure.utils; });
}
// Its too much of a pain to escape everything and use regular expresions, just replace manually
(function () {
var original = String.prototype.replace;
// TODO: maybe use flags or object instead to pass options in
String.prototype.replace = function (search, newVal, replaceFirst, ignoreCase) {
// Use original is some cases
if (search instanceof RegExp) return original.apply(this, arguments);
search = String(search);
var searchCompare = ignoreCase ? this.toLowerCase() : this;
if (ignoreCase) search = search.toLowerCase();
var searchLength = search.length;
var thisLength = this.length;
var index = 0;
var retVal = '';
while (index != -1) {
var nextIndex = searchCompare.indexOf(search, index);
if (nextIndex != -1) {
retVal += this.substring(index, nextIndex) + newVal;
index = nextIndex + searchLength;
if (index >= thisLength) index = -1;
} else {
retVal += this.substring(index);
index = -1;
}
if (replaceFirst) break;
}
return retVal;
};
if (!Array.prototype.indexOf) {
Array.prototype.indexOf = function (elt /*, from*/) {
var len = this.length >>> 0;
var from = trunc(Number(arguments[1]) || 0);
if(from < 0) from += len;
for(; from < len; from++) {
if(from in this && this[from] === elt) return from;
}
return -1;
};
}
var trunc = function(num) {
return num < 0 ? Math.ceil(num) : Math.floor(num);
};
})();

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,233 @@
/*!
* jQuery UI 1.8.10
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI
*/
(function(c,j){function k(a){return!c(a).parents().andSelf().filter(function(){return c.curCSS(this,"visibility")==="hidden"||c.expr.filters.hidden(this)}).length}c.ui=c.ui||{};if(!c.ui.version){c.extend(c.ui,{version:"1.8.10",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,
NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});c.fn.extend({_focus:c.fn.focus,focus:function(a,b){return typeof a==="number"?this.each(function(){var d=this;setTimeout(function(){c(d).focus();b&&b.call(d)},a)}):this._focus.apply(this,arguments)},scrollParent:function(){var a;a=c.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(c.curCSS(this,
"position",1))&&/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!a.length?c(document):a},zIndex:function(a){if(a!==j)return this.css("zIndex",a);if(this.length){a=c(this[0]);for(var b;a.length&&a[0]!==document;){b=a.css("position");
if(b==="absolute"||b==="relative"||b==="fixed"){b=parseInt(a.css("zIndex"),10);if(!isNaN(b)&&b!==0)return b}a=a.parent()}}return 0},disableSelection:function(){return this.bind((c.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});c.each(["Width","Height"],function(a,b){function d(f,g,l,m){c.each(e,function(){g-=parseFloat(c.curCSS(f,"padding"+this,true))||0;if(l)g-=parseFloat(c.curCSS(f,
"border"+this+"Width",true))||0;if(m)g-=parseFloat(c.curCSS(f,"margin"+this,true))||0});return g}var e=b==="Width"?["Left","Right"]:["Top","Bottom"],h=b.toLowerCase(),i={innerWidth:c.fn.innerWidth,innerHeight:c.fn.innerHeight,outerWidth:c.fn.outerWidth,outerHeight:c.fn.outerHeight};c.fn["inner"+b]=function(f){if(f===j)return i["inner"+b].call(this);return this.each(function(){c(this).css(h,d(this,f)+"px")})};c.fn["outer"+b]=function(f,g){if(typeof f!=="number")return i["outer"+b].call(this,f);return this.each(function(){c(this).css(h,
d(this,f,true,g)+"px")})}});c.extend(c.expr[":"],{data:function(a,b,d){return!!c.data(a,d[3])},focusable:function(a){var b=a.nodeName.toLowerCase(),d=c.attr(a,"tabindex");if("area"===b){b=a.parentNode;d=b.name;if(!a.href||!d||b.nodeName.toLowerCase()!=="map")return false;a=c("img[usemap=#"+d+"]")[0];return!!a&&k(a)}return(/input|select|textarea|button|object/.test(b)?!a.disabled:"a"==b?a.href||!isNaN(d):!isNaN(d))&&k(a)},tabbable:function(a){var b=c.attr(a,"tabindex");return(isNaN(b)||b>=0)&&c(a).is(":focusable")}});
c(function(){var a=document.body,b=a.appendChild(b=document.createElement("div"));c.extend(b.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});c.support.minHeight=b.offsetHeight===100;c.support.selectstart="onselectstart"in b;a.removeChild(b).style.display="none"});c.extend(c.ui,{plugin:{add:function(a,b,d){a=c.ui[a].prototype;for(var e in d){a.plugins[e]=a.plugins[e]||[];a.plugins[e].push([b,d[e]])}},call:function(a,b,d){if((b=a.plugins[b])&&a.element[0].parentNode)for(var e=0;e<b.length;e++)a.options[b[e][0]]&&
b[e][1].apply(a.element,d)}},contains:function(a,b){return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b)},hasScroll:function(a,b){if(c(a).css("overflow")==="hidden")return false;b=b&&b==="left"?"scrollLeft":"scrollTop";var d=false;if(a[b]>0)return true;a[b]=1;d=a[b]>0;a[b]=0;return d},isOverAxis:function(a,b,d){return a>b&&a<b+d},isOver:function(a,b,d,e,h,i){return c.ui.isOverAxis(a,d,h)&&c.ui.isOverAxis(b,e,i)}})}})(jQuery);
;/*!
* jQuery UI Widget 1.8.10
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Widget
*/
(function(b,j){if(b.cleanData){var k=b.cleanData;b.cleanData=function(a){for(var c=0,d;(d=a[c])!=null;c++)b(d).triggerHandler("remove");k(a)}}else{var l=b.fn.remove;b.fn.remove=function(a,c){return this.each(function(){if(!c)if(!a||b.filter(a,[this]).length)b("*",this).add([this]).each(function(){b(this).triggerHandler("remove")});return l.call(b(this),a,c)})}}b.widget=function(a,c,d){var e=a.split(".")[0],f;a=a.split(".")[1];f=e+"-"+a;if(!d){d=c;c=b.Widget}b.expr[":"][f]=function(h){return!!b.data(h,
a)};b[e]=b[e]||{};b[e][a]=function(h,g){arguments.length&&this._createWidget(h,g)};c=new c;c.options=b.extend(true,{},c.options);b[e][a].prototype=b.extend(true,c,{namespace:e,widgetName:a,widgetEventPrefix:b[e][a].prototype.widgetEventPrefix||a,widgetBaseClass:f},d);b.widget.bridge(a,b[e][a])};b.widget.bridge=function(a,c){b.fn[a]=function(d){var e=typeof d==="string",f=Array.prototype.slice.call(arguments,1),h=this;d=!e&&f.length?b.extend.apply(null,[true,d].concat(f)):d;if(e&&d.charAt(0)==="_")return h;
e?this.each(function(){var g=b.data(this,a),i=g&&b.isFunction(g[d])?g[d].apply(g,f):g;if(i!==g&&i!==j){h=i;return false}}):this.each(function(){var g=b.data(this,a);g?g.option(d||{})._init():b.data(this,a,new c(d,this))});return h}};b.Widget=function(a,c){arguments.length&&this._createWidget(a,c)};b.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(a,c){b.data(c,this.widgetName,this);this.element=b(c);this.options=b.extend(true,{},this.options,
this._getCreateOptions(),a);var d=this;this.element.bind("remove."+this.widgetName,function(){d.destroy()});this._create();this._trigger("create");this._init()},_getCreateOptions:function(){return b.metadata&&b.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled")},
widget:function(){return this.element},option:function(a,c){var d=a;if(arguments.length===0)return b.extend({},this.options);if(typeof a==="string"){if(c===j)return this.options[a];d={};d[a]=c}this._setOptions(d);return this},_setOptions:function(a){var c=this;b.each(a,function(d,e){c._setOption(d,e)});return this},_setOption:function(a,c){this.options[a]=c;if(a==="disabled")this.widget()[c?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",c);return this},
enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(a,c,d){var e=this.options[a];c=b.Event(c);c.type=(a===this.widgetEventPrefix?a:this.widgetEventPrefix+a).toLowerCase();d=d||{};if(c.originalEvent){a=b.event.props.length;for(var f;a;){f=b.event.props[--a];c[f]=c.originalEvent[f]}}this.element.trigger(c,d);return!(b.isFunction(e)&&e.call(this.element[0],c,d)===false||c.isDefaultPrevented())}}})(jQuery);
;/*!
* jQuery UI Mouse 1.8.10
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Mouse
*
* Depends:
* jquery.ui.widget.js
*/
(function(c){c.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var a=this;this.element.bind("mousedown."+this.widgetName,function(b){return a._mouseDown(b)}).bind("click."+this.widgetName,function(b){if(true===c.data(b.target,a.widgetName+".preventClickEvent")){c.removeData(b.target,a.widgetName+".preventClickEvent");b.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName)},_mouseDown:function(a){a.originalEvent=
a.originalEvent||{};if(!a.originalEvent.mouseHandled){this._mouseStarted&&this._mouseUp(a);this._mouseDownEvent=a;var b=this,e=a.which==1,f=typeof this.options.cancel=="string"?c(a.target).parents().add(a.target).filter(this.options.cancel).length:false;if(!e||f||!this._mouseCapture(a))return true;this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet)this._mouseDelayTimer=setTimeout(function(){b.mouseDelayMet=true},this.options.delay);if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a)){this._mouseStarted=
this._mouseStart(a)!==false;if(!this._mouseStarted){a.preventDefault();return true}}this._mouseMoveDelegate=function(d){return b._mouseMove(d)};this._mouseUpDelegate=function(d){return b._mouseUp(d)};c(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);a.preventDefault();return a.originalEvent.mouseHandled=true}},_mouseMove:function(a){if(c.browser.msie&&!(document.documentMode>=9)&&!a.button)return this._mouseUp(a);if(this._mouseStarted){this._mouseDrag(a);
return a.preventDefault()}if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a))(this._mouseStarted=this._mouseStart(this._mouseDownEvent,a)!==false)?this._mouseDrag(a):this._mouseUp(a);return!this._mouseStarted},_mouseUp:function(a){c(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;a.target==this._mouseDownEvent.target&&c.data(a.target,this.widgetName+".preventClickEvent",
true);this._mouseStop(a)}return false},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}})})(jQuery);
;/*
* jQuery UI Position 1.8.10
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Position
*/
(function(c){c.ui=c.ui||{};var n=/left|center|right/,o=/top|center|bottom/,t=c.fn.position,u=c.fn.offset;c.fn.position=function(b){if(!b||!b.of)return t.apply(this,arguments);b=c.extend({},b);var a=c(b.of),d=a[0],g=(b.collision||"flip").split(" "),e=b.offset?b.offset.split(" "):[0,0],h,k,j;if(d.nodeType===9){h=a.width();k=a.height();j={top:0,left:0}}else if(d.setTimeout){h=a.width();k=a.height();j={top:a.scrollTop(),left:a.scrollLeft()}}else if(d.preventDefault){b.at="left top";h=k=0;j={top:b.of.pageY,
left:b.of.pageX}}else{h=a.outerWidth();k=a.outerHeight();j=a.offset()}c.each(["my","at"],function(){var f=(b[this]||"").split(" ");if(f.length===1)f=n.test(f[0])?f.concat(["center"]):o.test(f[0])?["center"].concat(f):["center","center"];f[0]=n.test(f[0])?f[0]:"center";f[1]=o.test(f[1])?f[1]:"center";b[this]=f});if(g.length===1)g[1]=g[0];e[0]=parseInt(e[0],10)||0;if(e.length===1)e[1]=e[0];e[1]=parseInt(e[1],10)||0;if(b.at[0]==="right")j.left+=h;else if(b.at[0]==="center")j.left+=h/2;if(b.at[1]==="bottom")j.top+=
k;else if(b.at[1]==="center")j.top+=k/2;j.left+=e[0];j.top+=e[1];return this.each(function(){var f=c(this),l=f.outerWidth(),m=f.outerHeight(),p=parseInt(c.curCSS(this,"marginLeft",true))||0,q=parseInt(c.curCSS(this,"marginTop",true))||0,v=l+p+(parseInt(c.curCSS(this,"marginRight",true))||0),w=m+q+(parseInt(c.curCSS(this,"marginBottom",true))||0),i=c.extend({},j),r;if(b.my[0]==="right")i.left-=l;else if(b.my[0]==="center")i.left-=l/2;if(b.my[1]==="bottom")i.top-=m;else if(b.my[1]==="center")i.top-=
m/2;i.left=Math.round(i.left);i.top=Math.round(i.top);r={left:i.left-p,top:i.top-q};c.each(["left","top"],function(s,x){c.ui.position[g[s]]&&c.ui.position[g[s]][x](i,{targetWidth:h,targetHeight:k,elemWidth:l,elemHeight:m,collisionPosition:r,collisionWidth:v,collisionHeight:w,offset:e,my:b.my,at:b.at})});c.fn.bgiframe&&f.bgiframe();f.offset(c.extend(i,{using:b.using}))})};c.ui.position={fit:{left:function(b,a){var d=c(window);d=a.collisionPosition.left+a.collisionWidth-d.width()-d.scrollLeft();b.left=
d>0?b.left-d:Math.max(b.left-a.collisionPosition.left,b.left)},top:function(b,a){var d=c(window);d=a.collisionPosition.top+a.collisionHeight-d.height()-d.scrollTop();b.top=d>0?b.top-d:Math.max(b.top-a.collisionPosition.top,b.top)}},flip:{left:function(b,a){if(a.at[0]!=="center"){var d=c(window);d=a.collisionPosition.left+a.collisionWidth-d.width()-d.scrollLeft();var g=a.my[0]==="left"?-a.elemWidth:a.my[0]==="right"?a.elemWidth:0,e=a.at[0]==="left"?a.targetWidth:-a.targetWidth,h=-2*a.offset[0];b.left+=
a.collisionPosition.left<0?g+e+h:d>0?g+e+h:0}},top:function(b,a){if(a.at[1]!=="center"){var d=c(window);d=a.collisionPosition.top+a.collisionHeight-d.height()-d.scrollTop();var g=a.my[1]==="top"?-a.elemHeight:a.my[1]==="bottom"?a.elemHeight:0,e=a.at[1]==="top"?a.targetHeight:-a.targetHeight,h=-2*a.offset[1];b.top+=a.collisionPosition.top<0?g+e+h:d>0?g+e+h:0}}}};if(!c.offset.setOffset){c.offset.setOffset=function(b,a){if(/static/.test(c.curCSS(b,"position")))b.style.position="relative";var d=c(b),
g=d.offset(),e=parseInt(c.curCSS(b,"top",true),10)||0,h=parseInt(c.curCSS(b,"left",true),10)||0;g={top:a.top-g.top+e,left:a.left-g.left+h};"using"in a?a.using.call(b,g):d.css(g)};c.fn.offset=function(b){var a=this[0];if(!a||!a.ownerDocument)return null;if(b)return this.each(function(){c.offset.setOffset(this,b)});return u.call(this)}}})(jQuery);
;/*
* jQuery UI Draggable 1.8.10
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Draggables
*
* Depends:
* jquery.ui.core.js
* jquery.ui.mouse.js
* jquery.ui.widget.js
*/
(function(d){d.widget("ui.draggable",d.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false},_create:function(){if(this.options.helper==
"original"&&!/^(?:r|a|f)/.test(this.element.css("position")))this.element[0].style.position="relative";this.options.addClasses&&this.element.addClass("ui-draggable");this.options.disabled&&this.element.addClass("ui-draggable-disabled");this._mouseInit()},destroy:function(){if(this.element.data("draggable")){this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy();return this}},_mouseCapture:function(a){var b=
this.options;if(this.helper||b.disabled||d(a.target).is(".ui-resizable-handle"))return false;this.handle=this._getHandle(a);if(!this.handle)return false;return true},_mouseStart:function(a){var b=this.options;this.helper=this._createHelper(a);this._cacheHelperProportions();if(d.ui.ddmanager)d.ui.ddmanager.current=this;this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.positionAbs=this.element.offset();this.offset={top:this.offset.top-
this.margins.top,left:this.offset.left-this.margins.left};d.extend(this.offset,{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this.position=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt);b.containment&&this._setContainment();if(this._trigger("start",a)===false){this._clear();return false}this._cacheHelperProportions();
d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.helper.addClass("ui-draggable-dragging");this._mouseDrag(a,true);return true},_mouseDrag:function(a,b){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute");if(!b){b=this._uiHash();if(this._trigger("drag",a,b)===false){this._mouseUp({});return false}this.position=b.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||
this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";d.ui.ddmanager&&d.ui.ddmanager.drag(this,a);return false},_mouseStop:function(a){var b=false;if(d.ui.ddmanager&&!this.options.dropBehaviour)b=d.ui.ddmanager.drop(this,a);if(this.dropped){b=this.dropped;this.dropped=false}if((!this.element[0]||!this.element[0].parentNode)&&this.options.helper=="original")return false;if(this.options.revert=="invalid"&&!b||this.options.revert=="valid"&&b||this.options.revert===true||d.isFunction(this.options.revert)&&
this.options.revert.call(this.element,b)){var c=this;d(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){c._trigger("stop",a)!==false&&c._clear()})}else this._trigger("stop",a)!==false&&this._clear();return false},cancel:function(){this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear();return this},_getHandle:function(a){var b=!this.options.handle||!d(this.options.handle,this.element).length?true:false;d(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==
a.target)b=true});return b},_createHelper:function(a){var b=this.options;a=d.isFunction(b.helper)?d(b.helper.apply(this.element[0],[a])):b.helper=="clone"?this.element.clone():this.element;a.parents("body").length||a.appendTo(b.appendTo=="parent"?this.element[0].parentNode:b.appendTo);a[0]!=this.element[0]&&!/(fixed|absolute)/.test(a.css("position"))&&a.css("position","absolute");return a},_adjustOffsetFromHelper:function(a){if(typeof a=="string")a=a.split(" ");if(d.isArray(a))a={left:+a[0],top:+a[1]||
0};if("left"in a)this.offset.click.left=a.left+this.margins.left;if("right"in a)this.offset.click.left=this.helperProportions.width-a.right+this.margins.left;if("top"in a)this.offset.click.top=a.top+this.margins.top;if("bottom"in a)this.offset.click.top=this.helperProportions.height-a.bottom+this.margins.top},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var a=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],
this.offsetParent[0])){a.left+=this.scrollParent.scrollLeft();a.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&d.browser.msie)a={top:0,left:0};return{top:a.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:a.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.element.position();return{top:a.top-
(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var a=this.options;if(a.containment==
"parent")a.containment=this.helper[0].parentNode;if(a.containment=="document"||a.containment=="window")this.containment=[(a.containment=="document"?0:d(window).scrollLeft())-this.offset.relative.left-this.offset.parent.left,(a.containment=="document"?0:d(window).scrollTop())-this.offset.relative.top-this.offset.parent.top,(a.containment=="document"?0:d(window).scrollLeft())+d(a.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(a.containment=="document"?
0:d(window).scrollTop())+(d(a.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(a.containment)&&a.containment.constructor!=Array){var b=d(a.containment)[0];if(b){a=d(a.containment).offset();var c=d(b).css("overflow")!="hidden";this.containment=[a.left+(parseInt(d(b).css("borderLeftWidth"),10)||0)+(parseInt(d(b).css("paddingLeft"),10)||0)-this.margins.left,a.top+(parseInt(d(b).css("borderTopWidth"),
10)||0)+(parseInt(d(b).css("paddingTop"),10)||0)-this.margins.top,a.left+(c?Math.max(b.scrollWidth,b.offsetWidth):b.offsetWidth)-(parseInt(d(b).css("borderLeftWidth"),10)||0)-(parseInt(d(b).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,a.top+(c?Math.max(b.scrollHeight,b.offsetHeight):b.offsetHeight)-(parseInt(d(b).css("borderTopWidth"),10)||0)-(parseInt(d(b).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}}else if(a.containment.constructor==
Array)this.containment=a.containment},_convertPositionTo:function(a,b){if(!b)b=this.position;a=a=="absolute"?1:-1;var c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName);return{top:b.top+this.offset.relative.top*a+this.offset.parent.top*a-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():
f?0:c.scrollTop())*a),left:b.left+this.offset.relative.left*a+this.offset.parent.left*a-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():f?0:c.scrollLeft())*a)}},_generatePosition:function(a){var b=this.options,c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName),e=a.pageX,g=a.pageY;
if(this.originalPosition){if(this.containment){if(a.pageX-this.offset.click.left<this.containment[0])e=this.containment[0]+this.offset.click.left;if(a.pageY-this.offset.click.top<this.containment[1])g=this.containment[1]+this.offset.click.top;if(a.pageX-this.offset.click.left>this.containment[2])e=this.containment[2]+this.offset.click.left;if(a.pageY-this.offset.click.top>this.containment[3])g=this.containment[3]+this.offset.click.top}if(b.grid){g=this.originalPageY+Math.round((g-this.originalPageY)/
b.grid[1])*b.grid[1];g=this.containment?!(g-this.offset.click.top<this.containment[1]||g-this.offset.click.top>this.containment[3])?g:!(g-this.offset.click.top<this.containment[1])?g-b.grid[1]:g+b.grid[1]:g;e=this.originalPageX+Math.round((e-this.originalPageX)/b.grid[0])*b.grid[0];e=this.containment?!(e-this.offset.click.left<this.containment[0]||e-this.offset.click.left>this.containment[2])?e:!(e-this.offset.click.left<this.containment[0])?e-b.grid[0]:e+b.grid[0]:e}}return{top:g-this.offset.click.top-
this.offset.relative.top-this.offset.parent.top+(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():f?0:c.scrollTop()),left:e-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():f?0:c.scrollLeft())}},_clear:function(){this.helper.removeClass("ui-draggable-dragging");this.helper[0]!=
this.element[0]&&!this.cancelHelperRemoval&&this.helper.remove();this.helper=null;this.cancelHelperRemoval=false},_trigger:function(a,b,c){c=c||this._uiHash();d.ui.plugin.call(this,a,[b,c]);if(a=="drag")this.positionAbs=this._convertPositionTo("absolute");return d.Widget.prototype._trigger.call(this,a,b,c)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}});d.extend(d.ui.draggable,{version:"1.8.10"});
d.ui.plugin.add("draggable","connectToSortable",{start:function(a,b){var c=d(this).data("draggable"),f=c.options,e=d.extend({},b,{item:c.element});c.sortables=[];d(f.connectToSortable).each(function(){var g=d.data(this,"sortable");if(g&&!g.options.disabled){c.sortables.push({instance:g,shouldRevert:g.options.revert});g._refreshItems();g._trigger("activate",a,e)}})},stop:function(a,b){var c=d(this).data("draggable"),f=d.extend({},b,{item:c.element});d.each(c.sortables,function(){if(this.instance.isOver){this.instance.isOver=
0;c.cancelHelperRemoval=true;this.instance.cancelHelperRemoval=false;if(this.shouldRevert)this.instance.options.revert=true;this.instance._mouseStop(a);this.instance.options.helper=this.instance.options._helper;c.options.helper=="original"&&this.instance.currentItem.css({top:"auto",left:"auto"})}else{this.instance.cancelHelperRemoval=false;this.instance._trigger("deactivate",a,f)}})},drag:function(a,b){var c=d(this).data("draggable"),f=this;d.each(c.sortables,function(){this.instance.positionAbs=
c.positionAbs;this.instance.helperProportions=c.helperProportions;this.instance.offset.click=c.offset.click;if(this.instance._intersectsWith(this.instance.containerCache)){if(!this.instance.isOver){this.instance.isOver=1;this.instance.currentItem=d(f).clone().appendTo(this.instance.element).data("sortable-item",true);this.instance.options._helper=this.instance.options.helper;this.instance.options.helper=function(){return b.helper[0]};a.target=this.instance.currentItem[0];this.instance._mouseCapture(a,
true);this.instance._mouseStart(a,true,true);this.instance.offset.click.top=c.offset.click.top;this.instance.offset.click.left=c.offset.click.left;this.instance.offset.parent.left-=c.offset.parent.left-this.instance.offset.parent.left;this.instance.offset.parent.top-=c.offset.parent.top-this.instance.offset.parent.top;c._trigger("toSortable",a);c.dropped=this.instance.element;c.currentItem=c.element;this.instance.fromOutside=c}this.instance.currentItem&&this.instance._mouseDrag(a)}else if(this.instance.isOver){this.instance.isOver=
0;this.instance.cancelHelperRemoval=true;this.instance.options.revert=false;this.instance._trigger("out",a,this.instance._uiHash(this.instance));this.instance._mouseStop(a,true);this.instance.options.helper=this.instance.options._helper;this.instance.currentItem.remove();this.instance.placeholder&&this.instance.placeholder.remove();c._trigger("fromSortable",a);c.dropped=false}})}});d.ui.plugin.add("draggable","cursor",{start:function(){var a=d("body"),b=d(this).data("draggable").options;if(a.css("cursor"))b._cursor=
a.css("cursor");a.css("cursor",b.cursor)},stop:function(){var a=d(this).data("draggable").options;a._cursor&&d("body").css("cursor",a._cursor)}});d.ui.plugin.add("draggable","iframeFix",{start:function(){var a=d(this).data("draggable").options;d(a.iframeFix===true?"iframe":a.iframeFix).each(function(){d('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1E3}).css(d(this).offset()).appendTo("body")})},
stop:function(){d("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)})}});d.ui.plugin.add("draggable","opacity",{start:function(a,b){a=d(b.helper);b=d(this).data("draggable").options;if(a.css("opacity"))b._opacity=a.css("opacity");a.css("opacity",b.opacity)},stop:function(a,b){a=d(this).data("draggable").options;a._opacity&&d(b.helper).css("opacity",a._opacity)}});d.ui.plugin.add("draggable","scroll",{start:function(){var a=d(this).data("draggable");if(a.scrollParent[0]!=
document&&a.scrollParent[0].tagName!="HTML")a.overflowOffset=a.scrollParent.offset()},drag:function(a){var b=d(this).data("draggable"),c=b.options,f=false;if(b.scrollParent[0]!=document&&b.scrollParent[0].tagName!="HTML"){if(!c.axis||c.axis!="x")if(b.overflowOffset.top+b.scrollParent[0].offsetHeight-a.pageY<c.scrollSensitivity)b.scrollParent[0].scrollTop=f=b.scrollParent[0].scrollTop+c.scrollSpeed;else if(a.pageY-b.overflowOffset.top<c.scrollSensitivity)b.scrollParent[0].scrollTop=f=b.scrollParent[0].scrollTop-
c.scrollSpeed;if(!c.axis||c.axis!="y")if(b.overflowOffset.left+b.scrollParent[0].offsetWidth-a.pageX<c.scrollSensitivity)b.scrollParent[0].scrollLeft=f=b.scrollParent[0].scrollLeft+c.scrollSpeed;else if(a.pageX-b.overflowOffset.left<c.scrollSensitivity)b.scrollParent[0].scrollLeft=f=b.scrollParent[0].scrollLeft-c.scrollSpeed}else{if(!c.axis||c.axis!="x")if(a.pageY-d(document).scrollTop()<c.scrollSensitivity)f=d(document).scrollTop(d(document).scrollTop()-c.scrollSpeed);else if(d(window).height()-
(a.pageY-d(document).scrollTop())<c.scrollSensitivity)f=d(document).scrollTop(d(document).scrollTop()+c.scrollSpeed);if(!c.axis||c.axis!="y")if(a.pageX-d(document).scrollLeft()<c.scrollSensitivity)f=d(document).scrollLeft(d(document).scrollLeft()-c.scrollSpeed);else if(d(window).width()-(a.pageX-d(document).scrollLeft())<c.scrollSensitivity)f=d(document).scrollLeft(d(document).scrollLeft()+c.scrollSpeed)}f!==false&&d.ui.ddmanager&&!c.dropBehaviour&&d.ui.ddmanager.prepareOffsets(b,a)}});d.ui.plugin.add("draggable",
"snap",{start:function(){var a=d(this).data("draggable"),b=a.options;a.snapElements=[];d(b.snap.constructor!=String?b.snap.items||":data(draggable)":b.snap).each(function(){var c=d(this),f=c.offset();this!=a.element[0]&&a.snapElements.push({item:this,width:c.outerWidth(),height:c.outerHeight(),top:f.top,left:f.left})})},drag:function(a,b){for(var c=d(this).data("draggable"),f=c.options,e=f.snapTolerance,g=b.offset.left,n=g+c.helperProportions.width,m=b.offset.top,o=m+c.helperProportions.height,h=
c.snapElements.length-1;h>=0;h--){var i=c.snapElements[h].left,k=i+c.snapElements[h].width,j=c.snapElements[h].top,l=j+c.snapElements[h].height;if(i-e<g&&g<k+e&&j-e<m&&m<l+e||i-e<g&&g<k+e&&j-e<o&&o<l+e||i-e<n&&n<k+e&&j-e<m&&m<l+e||i-e<n&&n<k+e&&j-e<o&&o<l+e){if(f.snapMode!="inner"){var p=Math.abs(j-o)<=e,q=Math.abs(l-m)<=e,r=Math.abs(i-n)<=e,s=Math.abs(k-g)<=e;if(p)b.position.top=c._convertPositionTo("relative",{top:j-c.helperProportions.height,left:0}).top-c.margins.top;if(q)b.position.top=c._convertPositionTo("relative",
{top:l,left:0}).top-c.margins.top;if(r)b.position.left=c._convertPositionTo("relative",{top:0,left:i-c.helperProportions.width}).left-c.margins.left;if(s)b.position.left=c._convertPositionTo("relative",{top:0,left:k}).left-c.margins.left}var t=p||q||r||s;if(f.snapMode!="outer"){p=Math.abs(j-m)<=e;q=Math.abs(l-o)<=e;r=Math.abs(i-g)<=e;s=Math.abs(k-n)<=e;if(p)b.position.top=c._convertPositionTo("relative",{top:j,left:0}).top-c.margins.top;if(q)b.position.top=c._convertPositionTo("relative",{top:l-c.helperProportions.height,
left:0}).top-c.margins.top;if(r)b.position.left=c._convertPositionTo("relative",{top:0,left:i}).left-c.margins.left;if(s)b.position.left=c._convertPositionTo("relative",{top:0,left:k-c.helperProportions.width}).left-c.margins.left}if(!c.snapElements[h].snapping&&(p||q||r||s||t))c.options.snap.snap&&c.options.snap.snap.call(c.element,a,d.extend(c._uiHash(),{snapItem:c.snapElements[h].item}));c.snapElements[h].snapping=p||q||r||s||t}else{c.snapElements[h].snapping&&c.options.snap.release&&c.options.snap.release.call(c.element,
a,d.extend(c._uiHash(),{snapItem:c.snapElements[h].item}));c.snapElements[h].snapping=false}}}});d.ui.plugin.add("draggable","stack",{start:function(){var a=d(this).data("draggable").options;a=d.makeArray(d(a.stack)).sort(function(c,f){return(parseInt(d(c).css("zIndex"),10)||0)-(parseInt(d(f).css("zIndex"),10)||0)});if(a.length){var b=parseInt(a[0].style.zIndex)||0;d(a).each(function(c){this.style.zIndex=b+c});this[0].style.zIndex=b+a.length}}});d.ui.plugin.add("draggable","zIndex",{start:function(a,
b){a=d(b.helper);b=d(this).data("draggable").options;if(a.css("zIndex"))b._zIndex=a.css("zIndex");a.css("zIndex",b.zIndex)},stop:function(a,b){a=d(this).data("draggable").options;a._zIndex&&d(b.helper).css("zIndex",a._zIndex)}})})(jQuery);
;/*
* jQuery UI Resizable 1.8.10
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Resizables
*
* Depends:
* jquery.ui.core.js
* jquery.ui.mouse.js
* jquery.ui.widget.js
*/
(function(e){e.widget("ui.resizable",e.ui.mouse,{widgetEventPrefix:"resize",options:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,containment:false,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1E3},_create:function(){var b=this,a=this.options;this.element.addClass("ui-resizable");e.extend(this,{_aspectRatio:!!a.aspectRatio,aspectRatio:a.aspectRatio,originalElement:this.element,
_proportionallyResizeElements:[],_helper:a.helper||a.ghost||a.animate?a.helper||"ui-resizable-helper":null});if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)){/relative/.test(this.element.css("position"))&&e.browser.opera&&this.element.css({position:"relative",top:"auto",left:"auto"});this.element.wrap(e('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),
top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("resizable",this.element.data("resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle=
this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=a.handles||(!e(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",
nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all")this.handles="n,e,s,w,se,sw,ne,nw";var c=this.handles.split(",");this.handles={};for(var d=0;d<c.length;d++){var f=e.trim(c[d]),g=e('<div class="ui-resizable-handle '+("ui-resizable-"+f)+'"></div>');/sw|se|ne|nw/.test(f)&&g.css({zIndex:++a.zIndex});"se"==f&&g.addClass("ui-icon ui-icon-gripsmall-diagonal-se");this.handles[f]=".ui-resizable-"+f;this.element.append(g)}}this._renderAxis=function(h){h=h||this.element;for(var i in this.handles){if(this.handles[i].constructor==
String)this.handles[i]=e(this.handles[i],this.element).show();if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var j=e(this.handles[i],this.element),k=0;k=/sw|ne|nw|se|n|s/.test(i)?j.outerHeight():j.outerWidth();j=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join("");h.css(j,k);this._proportionallyResize()}e(this.handles[i])}};this._renderAxis(this.element);this._handles=e(".ui-resizable-handle",this.element).disableSelection();
this._handles.mouseover(function(){if(!b.resizing){if(this.className)var h=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);b.axis=h&&h[1]?h[1]:"se"}});if(a.autoHide){this._handles.hide();e(this.element).addClass("ui-resizable-autohide").hover(function(){e(this).removeClass("ui-resizable-autohide");b._handles.show()},function(){if(!b.resizing){e(this).addClass("ui-resizable-autohide");b._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy();var b=function(c){e(c).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};
if(this.elementIsWrapper){b(this.element);var a=this.element;a.after(this.originalElement.css({position:a.css("position"),width:a.outerWidth(),height:a.outerHeight(),top:a.css("top"),left:a.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle);b(this.originalElement);return this},_mouseCapture:function(b){var a=false;for(var c in this.handles)if(e(this.handles[c])[0]==b.target)a=true;return!this.options.disabled&&a},_mouseStart:function(b){var a=this.options,c=this.element.position(),
d=this.element;this.resizing=true;this.documentScroll={top:e(document).scrollTop(),left:e(document).scrollLeft()};if(d.is(".ui-draggable")||/absolute/.test(d.css("position")))d.css({position:"absolute",top:c.top,left:c.left});e.browser.opera&&/relative/.test(d.css("position"))&&d.css({position:"relative",top:"auto",left:"auto"});this._renderProxy();c=m(this.helper.css("left"));var f=m(this.helper.css("top"));if(a.containment){c+=e(a.containment).scrollLeft()||0;f+=e(a.containment).scrollTop()||0}this.offset=
this.helper.offset();this.position={left:c,top:f};this.size=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalSize=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalPosition={left:c,top:f};this.sizeDiff={width:d.outerWidth()-d.width(),height:d.outerHeight()-d.height()};this.originalMousePosition={left:b.pageX,top:b.pageY};this.aspectRatio=typeof a.aspectRatio=="number"?a.aspectRatio:
this.originalSize.width/this.originalSize.height||1;a=e(".ui-resizable-"+this.axis).css("cursor");e("body").css("cursor",a=="auto"?this.axis+"-resize":a);d.addClass("ui-resizable-resizing");this._propagate("start",b);return true},_mouseDrag:function(b){var a=this.helper,c=this.originalMousePosition,d=this._change[this.axis];if(!d)return false;c=d.apply(this,[b,b.pageX-c.left||0,b.pageY-c.top||0]);if(this._aspectRatio||b.shiftKey)c=this._updateRatio(c,b);c=this._respectSize(c,b);this._propagate("resize",
b);a.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize();this._updateCache(c);this._trigger("resize",b,this.ui());return false},_mouseStop:function(b){this.resizing=false;var a=this.options,c=this;if(this._helper){var d=this._proportionallyResizeElements,f=d.length&&/textarea/i.test(d[0].nodeName);d=f&&e.ui.hasScroll(d[0],"left")?0:c.sizeDiff.height;
f=f?0:c.sizeDiff.width;f={width:c.helper.width()-f,height:c.helper.height()-d};d=parseInt(c.element.css("left"),10)+(c.position.left-c.originalPosition.left)||null;var g=parseInt(c.element.css("top"),10)+(c.position.top-c.originalPosition.top)||null;a.animate||this.element.css(e.extend(f,{top:g,left:d}));c.helper.height(c.size.height);c.helper.width(c.size.width);this._helper&&!a.animate&&this._proportionallyResize()}e("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");
this._propagate("stop",b);this._helper&&this.helper.remove();return false},_updateCache:function(b){this.offset=this.helper.offset();if(l(b.left))this.position.left=b.left;if(l(b.top))this.position.top=b.top;if(l(b.height))this.size.height=b.height;if(l(b.width))this.size.width=b.width},_updateRatio:function(b){var a=this.position,c=this.size,d=this.axis;if(b.height)b.width=c.height*this.aspectRatio;else if(b.width)b.height=c.width/this.aspectRatio;if(d=="sw"){b.left=a.left+(c.width-b.width);b.top=
null}if(d=="nw"){b.top=a.top+(c.height-b.height);b.left=a.left+(c.width-b.width)}return b},_respectSize:function(b){var a=this.options,c=this.axis,d=l(b.width)&&a.maxWidth&&a.maxWidth<b.width,f=l(b.height)&&a.maxHeight&&a.maxHeight<b.height,g=l(b.width)&&a.minWidth&&a.minWidth>b.width,h=l(b.height)&&a.minHeight&&a.minHeight>b.height;if(g)b.width=a.minWidth;if(h)b.height=a.minHeight;if(d)b.width=a.maxWidth;if(f)b.height=a.maxHeight;var i=this.originalPosition.left+this.originalSize.width,j=this.position.top+
this.size.height,k=/sw|nw|w/.test(c);c=/nw|ne|n/.test(c);if(g&&k)b.left=i-a.minWidth;if(d&&k)b.left=i-a.maxWidth;if(h&&c)b.top=j-a.minHeight;if(f&&c)b.top=j-a.maxHeight;if((a=!b.width&&!b.height)&&!b.left&&b.top)b.top=null;else if(a&&!b.top&&b.left)b.left=null;return b},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var b=this.helper||this.element,a=0;a<this._proportionallyResizeElements.length;a++){var c=this._proportionallyResizeElements[a];if(!this.borderDif){var d=
[c.css("borderTopWidth"),c.css("borderRightWidth"),c.css("borderBottomWidth"),c.css("borderLeftWidth")],f=[c.css("paddingTop"),c.css("paddingRight"),c.css("paddingBottom"),c.css("paddingLeft")];this.borderDif=e.map(d,function(g,h){g=parseInt(g,10)||0;h=parseInt(f[h],10)||0;return g+h})}e.browser.msie&&(e(b).is(":hidden")||e(b).parents(":hidden").length)||c.css({height:b.height()-this.borderDif[0]-this.borderDif[2]||0,width:b.width()-this.borderDif[1]-this.borderDif[3]||0})}},_renderProxy:function(){var b=
this.options;this.elementOffset=this.element.offset();if(this._helper){this.helper=this.helper||e('<div style="overflow:hidden;"></div>');var a=e.browser.msie&&e.browser.version<7,c=a?1:0;a=a?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+a,height:this.element.outerHeight()+a,position:"absolute",left:this.elementOffset.left-c+"px",top:this.elementOffset.top-c+"px",zIndex:++b.zIndex});this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(b,
a){return{width:this.originalSize.width+a}},w:function(b,a){return{left:this.originalPosition.left+a,width:this.originalSize.width-a}},n:function(b,a,c){return{top:this.originalPosition.top+c,height:this.originalSize.height-c}},s:function(b,a,c){return{height:this.originalSize.height+c}},se:function(b,a,c){return e.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[b,a,c]))},sw:function(b,a,c){return e.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[b,a,
c]))},ne:function(b,a,c){return e.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[b,a,c]))},nw:function(b,a,c){return e.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[b,a,c]))}},_propagate:function(b,a){e.ui.plugin.call(this,b,[a,this.ui()]);b!="resize"&&this._trigger(b,a,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,
originalPosition:this.originalPosition}}});e.extend(e.ui.resizable,{version:"1.8.10"});e.ui.plugin.add("resizable","alsoResize",{start:function(){var b=e(this).data("resizable").options,a=function(c){e(c).each(function(){var d=e(this);d.data("resizable-alsoresize",{width:parseInt(d.width(),10),height:parseInt(d.height(),10),left:parseInt(d.css("left"),10),top:parseInt(d.css("top"),10),position:d.css("position")})})};if(typeof b.alsoResize=="object"&&!b.alsoResize.parentNode)if(b.alsoResize.length){b.alsoResize=
b.alsoResize[0];a(b.alsoResize)}else e.each(b.alsoResize,function(c){a(c)});else a(b.alsoResize)},resize:function(b,a){var c=e(this).data("resizable");b=c.options;var d=c.originalSize,f=c.originalPosition,g={height:c.size.height-d.height||0,width:c.size.width-d.width||0,top:c.position.top-f.top||0,left:c.position.left-f.left||0},h=function(i,j){e(i).each(function(){var k=e(this),q=e(this).data("resizable-alsoresize"),p={},r=j&&j.length?j:k.parents(a.originalElement[0]).length?["width","height"]:["width",
"height","top","left"];e.each(r,function(n,o){if((n=(q[o]||0)+(g[o]||0))&&n>=0)p[o]=n||null});if(e.browser.opera&&/relative/.test(k.css("position"))){c._revertToRelativePosition=true;k.css({position:"absolute",top:"auto",left:"auto"})}k.css(p)})};typeof b.alsoResize=="object"&&!b.alsoResize.nodeType?e.each(b.alsoResize,function(i,j){h(i,j)}):h(b.alsoResize)},stop:function(){var b=e(this).data("resizable"),a=b.options,c=function(d){e(d).each(function(){var f=e(this);f.css({position:f.data("resizable-alsoresize").position})})};
if(b._revertToRelativePosition){b._revertToRelativePosition=false;typeof a.alsoResize=="object"&&!a.alsoResize.nodeType?e.each(a.alsoResize,function(d){c(d)}):c(a.alsoResize)}e(this).removeData("resizable-alsoresize")}});e.ui.plugin.add("resizable","animate",{stop:function(b){var a=e(this).data("resizable"),c=a.options,d=a._proportionallyResizeElements,f=d.length&&/textarea/i.test(d[0].nodeName),g=f&&e.ui.hasScroll(d[0],"left")?0:a.sizeDiff.height;f={width:a.size.width-(f?0:a.sizeDiff.width),height:a.size.height-
g};g=parseInt(a.element.css("left"),10)+(a.position.left-a.originalPosition.left)||null;var h=parseInt(a.element.css("top"),10)+(a.position.top-a.originalPosition.top)||null;a.element.animate(e.extend(f,h&&g?{top:h,left:g}:{}),{duration:c.animateDuration,easing:c.animateEasing,step:function(){var i={width:parseInt(a.element.css("width"),10),height:parseInt(a.element.css("height"),10),top:parseInt(a.element.css("top"),10),left:parseInt(a.element.css("left"),10)};d&&d.length&&e(d[0]).css({width:i.width,
height:i.height});a._updateCache(i);a._propagate("resize",b)}})}});e.ui.plugin.add("resizable","containment",{start:function(){var b=e(this).data("resizable"),a=b.element,c=b.options.containment;if(a=c instanceof e?c.get(0):/parent/.test(c)?a.parent().get(0):c){b.containerElement=e(a);if(/document/.test(c)||c==document){b.containerOffset={left:0,top:0};b.containerPosition={left:0,top:0};b.parentData={element:e(document),left:0,top:0,width:e(document).width(),height:e(document).height()||document.body.parentNode.scrollHeight}}else{var d=
e(a),f=[];e(["Top","Right","Left","Bottom"]).each(function(i,j){f[i]=m(d.css("padding"+j))});b.containerOffset=d.offset();b.containerPosition=d.position();b.containerSize={height:d.innerHeight()-f[3],width:d.innerWidth()-f[1]};c=b.containerOffset;var g=b.containerSize.height,h=b.containerSize.width;h=e.ui.hasScroll(a,"left")?a.scrollWidth:h;g=e.ui.hasScroll(a)?a.scrollHeight:g;b.parentData={element:a,left:c.left,top:c.top,width:h,height:g}}}},resize:function(b){var a=e(this).data("resizable"),c=a.options,
d=a.containerOffset,f=a.position;b=a._aspectRatio||b.shiftKey;var g={top:0,left:0},h=a.containerElement;if(h[0]!=document&&/static/.test(h.css("position")))g=d;if(f.left<(a._helper?d.left:0)){a.size.width+=a._helper?a.position.left-d.left:a.position.left-g.left;if(b)a.size.height=a.size.width/c.aspectRatio;a.position.left=c.helper?d.left:0}if(f.top<(a._helper?d.top:0)){a.size.height+=a._helper?a.position.top-d.top:a.position.top;if(b)a.size.width=a.size.height*c.aspectRatio;a.position.top=a._helper?
d.top:0}a.offset.left=a.parentData.left+a.position.left;a.offset.top=a.parentData.top+a.position.top;c=Math.abs((a._helper?a.offset.left-g.left:a.offset.left-g.left)+a.sizeDiff.width);d=Math.abs((a._helper?a.offset.top-g.top:a.offset.top-d.top)+a.sizeDiff.height);f=a.containerElement.get(0)==a.element.parent().get(0);g=/relative|absolute/.test(a.containerElement.css("position"));if(f&&g)c-=a.parentData.left;if(c+a.size.width>=a.parentData.width){a.size.width=a.parentData.width-c;if(b)a.size.height=
a.size.width/a.aspectRatio}if(d+a.size.height>=a.parentData.height){a.size.height=a.parentData.height-d;if(b)a.size.width=a.size.height*a.aspectRatio}},stop:function(){var b=e(this).data("resizable"),a=b.options,c=b.containerOffset,d=b.containerPosition,f=b.containerElement,g=e(b.helper),h=g.offset(),i=g.outerWidth()-b.sizeDiff.width;g=g.outerHeight()-b.sizeDiff.height;b._helper&&!a.animate&&/relative/.test(f.css("position"))&&e(this).css({left:h.left-d.left-c.left,width:i,height:g});b._helper&&!a.animate&&
/static/.test(f.css("position"))&&e(this).css({left:h.left-d.left-c.left,width:i,height:g})}});e.ui.plugin.add("resizable","ghost",{start:function(){var b=e(this).data("resizable"),a=b.options,c=b.size;b.ghost=b.originalElement.clone();b.ghost.css({opacity:0.25,display:"block",position:"relative",height:c.height,width:c.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof a.ghost=="string"?a.ghost:"");b.ghost.appendTo(b.helper)},resize:function(){var b=e(this).data("resizable");
b.ghost&&b.ghost.css({position:"relative",height:b.size.height,width:b.size.width})},stop:function(){var b=e(this).data("resizable");b.ghost&&b.helper&&b.helper.get(0).removeChild(b.ghost.get(0))}});e.ui.plugin.add("resizable","grid",{resize:function(){var b=e(this).data("resizable"),a=b.options,c=b.size,d=b.originalSize,f=b.originalPosition,g=b.axis;a.grid=typeof a.grid=="number"?[a.grid,a.grid]:a.grid;var h=Math.round((c.width-d.width)/(a.grid[0]||1))*(a.grid[0]||1);a=Math.round((c.height-d.height)/
(a.grid[1]||1))*(a.grid[1]||1);if(/^(se|s|e)$/.test(g)){b.size.width=d.width+h;b.size.height=d.height+a}else if(/^(ne)$/.test(g)){b.size.width=d.width+h;b.size.height=d.height+a;b.position.top=f.top-a}else{if(/^(sw)$/.test(g)){b.size.width=d.width+h;b.size.height=d.height+a}else{b.size.width=d.width+h;b.size.height=d.height+a;b.position.top=f.top-a}b.position.left=f.left-h}}});var m=function(b){return parseInt(b,10)||0},l=function(b){return!isNaN(parseInt(b,10))}})(jQuery);
;/*
* jQuery UI Dialog 1.8.10
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Dialog
*
* Depends:
* jquery.ui.core.js
* jquery.ui.widget.js
* jquery.ui.button.js
* jquery.ui.draggable.js
* jquery.ui.mouse.js
* jquery.ui.position.js
* jquery.ui.resizable.js
*/
(function(c,j){var k={buttons:true,height:true,maxHeight:true,maxWidth:true,minHeight:true,minWidth:true,width:true},l={maxHeight:true,maxWidth:true,minHeight:true,minWidth:true};c.widget("ui.dialog",{options:{autoOpen:true,buttons:{},closeOnEscape:true,closeText:"close",dialogClass:"",draggable:true,hide:null,height:"auto",maxHeight:false,maxWidth:false,minHeight:150,minWidth:150,modal:false,position:{my:"center",at:"center",collision:"fit",using:function(a){var b=c(this).css(a).offset().top;b<0&&
c(this).css("top",a.top-b)}},resizable:true,show:null,stack:true,title:"",width:300,zIndex:1E3},_create:function(){this.originalTitle=this.element.attr("title");if(typeof this.originalTitle!=="string")this.originalTitle="";this.options.title=this.options.title||this.originalTitle;var a=this,b=a.options,d=b.title||"&#160;",e=c.ui.dialog.getTitleId(a.element),g=(a.uiDialog=c("<div></div>")).appendTo(document.body).hide().addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+b.dialogClass).css({zIndex:b.zIndex}).attr("tabIndex",
-1).css("outline",0).keydown(function(i){if(b.closeOnEscape&&i.keyCode&&i.keyCode===c.ui.keyCode.ESCAPE){a.close(i);i.preventDefault()}}).attr({role:"dialog","aria-labelledby":e}).mousedown(function(i){a.moveToTop(false,i)});a.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(g);var f=(a.uiDialogTitlebar=c("<div></div>")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(g),h=c('<a href="#"></a>').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role",
"button").hover(function(){h.addClass("ui-state-hover")},function(){h.removeClass("ui-state-hover")}).focus(function(){h.addClass("ui-state-focus")}).blur(function(){h.removeClass("ui-state-focus")}).click(function(i){a.close(i);return false}).appendTo(f);(a.uiDialogTitlebarCloseText=c("<span></span>")).addClass("ui-icon ui-icon-closethick").text(b.closeText).appendTo(h);c("<span></span>").addClass("ui-dialog-title").attr("id",e).html(d).prependTo(f);if(c.isFunction(b.beforeclose)&&!c.isFunction(b.beforeClose))b.beforeClose=
b.beforeclose;f.find("*").add(f).disableSelection();b.draggable&&c.fn.draggable&&a._makeDraggable();b.resizable&&c.fn.resizable&&a._makeResizable();a._createButtons(b.buttons);a._isOpen=false;c.fn.bgiframe&&g.bgiframe()},_init:function(){this.options.autoOpen&&this.open()},destroy:function(){var a=this;a.overlay&&a.overlay.destroy();a.uiDialog.hide();a.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body");a.uiDialog.remove();a.originalTitle&&
a.element.attr("title",a.originalTitle);return a},widget:function(){return this.uiDialog},close:function(a){var b=this,d,e;if(false!==b._trigger("beforeClose",a)){b.overlay&&b.overlay.destroy();b.uiDialog.unbind("keypress.ui-dialog");b._isOpen=false;if(b.options.hide)b.uiDialog.hide(b.options.hide,function(){b._trigger("close",a)});else{b.uiDialog.hide();b._trigger("close",a)}c.ui.dialog.overlay.resize();if(b.options.modal){d=0;c(".ui-dialog").each(function(){if(this!==b.uiDialog[0]){e=c(this).css("z-index");
isNaN(e)||(d=Math.max(d,e))}});c.ui.dialog.maxZ=d}return b}},isOpen:function(){return this._isOpen},moveToTop:function(a,b){var d=this,e=d.options;if(e.modal&&!a||!e.stack&&!e.modal)return d._trigger("focus",b);if(e.zIndex>c.ui.dialog.maxZ)c.ui.dialog.maxZ=e.zIndex;if(d.overlay){c.ui.dialog.maxZ+=1;d.overlay.$el.css("z-index",c.ui.dialog.overlay.maxZ=c.ui.dialog.maxZ)}a={scrollTop:d.element.attr("scrollTop"),scrollLeft:d.element.attr("scrollLeft")};c.ui.dialog.maxZ+=1;d.uiDialog.css("z-index",c.ui.dialog.maxZ);
d.element.attr(a);d._trigger("focus",b);return d},open:function(){if(!this._isOpen){var a=this,b=a.options,d=a.uiDialog;a.overlay=b.modal?new c.ui.dialog.overlay(a):null;a._size();a._position(b.position);d.show(b.show);a.moveToTop(true);b.modal&&d.bind("keypress.ui-dialog",function(e){if(e.keyCode===c.ui.keyCode.TAB){var g=c(":tabbable",this),f=g.filter(":first");g=g.filter(":last");if(e.target===g[0]&&!e.shiftKey){f.focus(1);return false}else if(e.target===f[0]&&e.shiftKey){g.focus(1);return false}}});
c(a.element.find(":tabbable").get().concat(d.find(".ui-dialog-buttonpane :tabbable").get().concat(d.get()))).eq(0).focus();a._isOpen=true;a._trigger("open");return a}},_createButtons:function(a){var b=this,d=false,e=c("<div></div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),g=c("<div></div>").addClass("ui-dialog-buttonset").appendTo(e);b.uiDialog.find(".ui-dialog-buttonpane").remove();typeof a==="object"&&a!==null&&c.each(a,function(){return!(d=true)});if(d){c.each(a,function(f,
h){h=c.isFunction(h)?{click:h,text:f}:h;f=c('<button type="button"></button>').attr(h,true).unbind("click").click(function(){h.click.apply(b.element[0],arguments)}).appendTo(g);c.fn.button&&f.button()});e.appendTo(b.uiDialog)}},_makeDraggable:function(){function a(f){return{position:f.position,offset:f.offset}}var b=this,d=b.options,e=c(document),g;b.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(f,h){g=
d.height==="auto"?"auto":c(this).height();c(this).height(c(this).height()).addClass("ui-dialog-dragging");b._trigger("dragStart",f,a(h))},drag:function(f,h){b._trigger("drag",f,a(h))},stop:function(f,h){d.position=[h.position.left-e.scrollLeft(),h.position.top-e.scrollTop()];c(this).removeClass("ui-dialog-dragging").height(g);b._trigger("dragStop",f,a(h));c.ui.dialog.overlay.resize()}})},_makeResizable:function(a){function b(f){return{originalPosition:f.originalPosition,originalSize:f.originalSize,
position:f.position,size:f.size}}a=a===j?this.options.resizable:a;var d=this,e=d.options,g=d.uiDialog.css("position");a=typeof a==="string"?a:"n,e,s,w,se,sw,ne,nw";d.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:d.element,maxWidth:e.maxWidth,maxHeight:e.maxHeight,minWidth:e.minWidth,minHeight:d._minHeight(),handles:a,start:function(f,h){c(this).addClass("ui-dialog-resizing");d._trigger("resizeStart",f,b(h))},resize:function(f,h){d._trigger("resize",f,b(h))},stop:function(f,
h){c(this).removeClass("ui-dialog-resizing");e.height=c(this).height();e.width=c(this).width();d._trigger("resizeStop",f,b(h));c.ui.dialog.overlay.resize()}}).css("position",g).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var a=this.options;return a.height==="auto"?a.minHeight:Math.min(a.minHeight,a.height)},_position:function(a){var b=[],d=[0,0],e;if(a){if(typeof a==="string"||typeof a==="object"&&"0"in a){b=a.split?a.split(" "):[a[0],a[1]];if(b.length===
1)b[1]=b[0];c.each(["left","top"],function(g,f){if(+b[g]===b[g]){d[g]=b[g];b[g]=f}});a={my:b.join(" "),at:b.join(" "),offset:d.join(" ")}}a=c.extend({},c.ui.dialog.prototype.options.position,a)}else a=c.ui.dialog.prototype.options.position;(e=this.uiDialog.is(":visible"))||this.uiDialog.show();this.uiDialog.css({top:0,left:0}).position(c.extend({of:window},a));e||this.uiDialog.hide()},_setOptions:function(a){var b=this,d={},e=false;c.each(a,function(g,f){b._setOption(g,f);if(g in k)e=true;if(g in
l)d[g]=f});e&&this._size();this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option",d)},_setOption:function(a,b){var d=this,e=d.uiDialog;switch(a){case "beforeclose":a="beforeClose";break;case "buttons":d._createButtons(b);break;case "closeText":d.uiDialogTitlebarCloseText.text(""+b);break;case "dialogClass":e.removeClass(d.options.dialogClass).addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+b);break;case "disabled":b?e.addClass("ui-dialog-disabled"):e.removeClass("ui-dialog-disabled");
break;case "draggable":var g=e.is(":data(draggable)");g&&!b&&e.draggable("destroy");!g&&b&&d._makeDraggable();break;case "position":d._position(b);break;case "resizable":(g=e.is(":data(resizable)"))&&!b&&e.resizable("destroy");g&&typeof b==="string"&&e.resizable("option","handles",b);!g&&b!==false&&d._makeResizable(b);break;case "title":c(".ui-dialog-title",d.uiDialogTitlebar).html(""+(b||"&#160;"));break}c.Widget.prototype._setOption.apply(d,arguments)},_size:function(){var a=this.options,b,d,e=
this.uiDialog.is(":visible");this.element.show().css({width:"auto",minHeight:0,height:0});if(a.minWidth>a.width)a.width=a.minWidth;b=this.uiDialog.css({height:"auto",width:a.width}).height();d=Math.max(0,a.minHeight-b);if(a.height==="auto")if(c.support.minHeight)this.element.css({minHeight:d,height:"auto"});else{this.uiDialog.show();a=this.element.css("height","auto").height();e||this.uiDialog.hide();this.element.height(Math.max(a,d))}else this.element.height(Math.max(a.height-b,0));this.uiDialog.is(":data(resizable)")&&
this.uiDialog.resizable("option","minHeight",this._minHeight())}});c.extend(c.ui.dialog,{version:"1.8.10",uuid:0,maxZ:0,getTitleId:function(a){a=a.attr("id");if(!a){this.uuid+=1;a=this.uuid}return"ui-dialog-title-"+a},overlay:function(a){this.$el=c.ui.dialog.overlay.create(a)}});c.extend(c.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:c.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(a){return a+".dialog-overlay"}).join(" "),create:function(a){if(this.instances.length===
0){setTimeout(function(){c.ui.dialog.overlay.instances.length&&c(document).bind(c.ui.dialog.overlay.events,function(d){if(c(d.target).zIndex()<c.ui.dialog.overlay.maxZ)return false})},1);c(document).bind("keydown.dialog-overlay",function(d){if(a.options.closeOnEscape&&d.keyCode&&d.keyCode===c.ui.keyCode.ESCAPE){a.close(d);d.preventDefault()}});c(window).bind("resize.dialog-overlay",c.ui.dialog.overlay.resize)}var b=(this.oldInstances.pop()||c("<div></div>").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(),
height:this.height()});c.fn.bgiframe&&b.bgiframe();this.instances.push(b);return b},destroy:function(a){var b=c.inArray(a,this.instances);b!=-1&&this.oldInstances.push(this.instances.splice(b,1)[0]);this.instances.length===0&&c([document,window]).unbind(".dialog-overlay");a.remove();var d=0;c.each(this.instances,function(){d=Math.max(d,this.css("z-index"))});this.maxZ=d},height:function(){var a,b;if(c.browser.msie&&c.browser.version<7){a=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);
b=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);return a<b?c(window).height()+"px":a+"px"}else return c(document).height()+"px"},width:function(){var a,b;if(c.browser.msie&&c.browser.version<7){a=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth);b=Math.max(document.documentElement.offsetWidth,document.body.offsetWidth);return a<b?c(window).width()+"px":a+"px"}else return c(document).width()+"px"},resize:function(){var a=c([]);c.each(c.ui.dialog.overlay.instances,
function(){a=a.add(this)});a.css({width:0,height:0}).css({width:c.ui.dialog.overlay.width(),height:c.ui.dialog.overlay.height()})}});c.extend(c.ui.dialog.overlay.prototype,{destroy:function(){c.ui.dialog.overlay.destroy(this.$el)}})})(jQuery);
;/*
* jQuery UI Effects 1.8.10
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Effects/
*/
jQuery.effects||function(f,j){function n(c){var a;if(c&&c.constructor==Array&&c.length==3)return c;if(a=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(c))return[parseInt(a[1],10),parseInt(a[2],10),parseInt(a[3],10)];if(a=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(c))return[parseFloat(a[1])*2.55,parseFloat(a[2])*2.55,parseFloat(a[3])*2.55];if(a=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(c))return[parseInt(a[1],
16),parseInt(a[2],16),parseInt(a[3],16)];if(a=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(c))return[parseInt(a[1]+a[1],16),parseInt(a[2]+a[2],16),parseInt(a[3]+a[3],16)];if(/rgba\(0, 0, 0, 0\)/.exec(c))return o.transparent;return o[f.trim(c).toLowerCase()]}function s(c,a){var b;do{b=f.curCSS(c,a);if(b!=""&&b!="transparent"||f.nodeName(c,"body"))break;a="backgroundColor"}while(c=c.parentNode);return n(b)}function p(){var c=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle,
a={},b,d;if(c&&c.length&&c[0]&&c[c[0]])for(var e=c.length;e--;){b=c[e];if(typeof c[b]=="string"){d=b.replace(/\-(\w)/g,function(g,h){return h.toUpperCase()});a[d]=c[b]}}else for(b in c)if(typeof c[b]==="string")a[b]=c[b];return a}function q(c){var a,b;for(a in c){b=c[a];if(b==null||f.isFunction(b)||a in t||/scrollbar/.test(a)||!/color/i.test(a)&&isNaN(parseFloat(b)))delete c[a]}return c}function u(c,a){var b={_:0},d;for(d in a)if(c[d]!=a[d])b[d]=a[d];return b}function k(c,a,b,d){if(typeof c=="object"){d=
a;b=null;a=c;c=a.effect}if(f.isFunction(a)){d=a;b=null;a={}}if(typeof a=="number"||f.fx.speeds[a]){d=b;b=a;a={}}if(f.isFunction(b)){d=b;b=null}a=a||{};b=b||a.duration;b=f.fx.off?0:typeof b=="number"?b:b in f.fx.speeds?f.fx.speeds[b]:f.fx.speeds._default;d=d||a.complete;return[c,a,b,d]}function m(c){if(!c||typeof c==="number"||f.fx.speeds[c])return true;if(typeof c==="string"&&!f.effects[c])return true;return false}f.effects={};f.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor",
"borderTopColor","borderColor","color","outlineColor"],function(c,a){f.fx.step[a]=function(b){if(!b.colorInit){b.start=s(b.elem,a);b.end=n(b.end);b.colorInit=true}b.elem.style[a]="rgb("+Math.max(Math.min(parseInt(b.pos*(b.end[0]-b.start[0])+b.start[0],10),255),0)+","+Math.max(Math.min(parseInt(b.pos*(b.end[1]-b.start[1])+b.start[1],10),255),0)+","+Math.max(Math.min(parseInt(b.pos*(b.end[2]-b.start[2])+b.start[2],10),255),0)+")"}});var o={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,
0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,
211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]},r=["add","remove","toggle"],t={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};f.effects.animateClass=function(c,a,b,
d){if(f.isFunction(b)){d=b;b=null}return this.queue("fx",function(){var e=f(this),g=e.attr("style")||" ",h=q(p.call(this)),l,v=e.attr("className");f.each(r,function(w,i){c[i]&&e[i+"Class"](c[i])});l=q(p.call(this));e.attr("className",v);e.animate(u(h,l),a,b,function(){f.each(r,function(w,i){c[i]&&e[i+"Class"](c[i])});if(typeof e.attr("style")=="object"){e.attr("style").cssText="";e.attr("style").cssText=g}else e.attr("style",g);d&&d.apply(this,arguments)});h=f.queue(this);l=h.splice(h.length-1,1)[0];
h.splice(1,0,l);f.dequeue(this)})};f.fn.extend({_addClass:f.fn.addClass,addClass:function(c,a,b,d){return a?f.effects.animateClass.apply(this,[{add:c},a,b,d]):this._addClass(c)},_removeClass:f.fn.removeClass,removeClass:function(c,a,b,d){return a?f.effects.animateClass.apply(this,[{remove:c},a,b,d]):this._removeClass(c)},_toggleClass:f.fn.toggleClass,toggleClass:function(c,a,b,d,e){return typeof a=="boolean"||a===j?b?f.effects.animateClass.apply(this,[a?{add:c}:{remove:c},b,d,e]):this._toggleClass(c,
a):f.effects.animateClass.apply(this,[{toggle:c},a,b,d])},switchClass:function(c,a,b,d,e){return f.effects.animateClass.apply(this,[{add:a,remove:c},b,d,e])}});f.extend(f.effects,{version:"1.8.10",save:function(c,a){for(var b=0;b<a.length;b++)a[b]!==null&&c.data("ec.storage."+a[b],c[0].style[a[b]])},restore:function(c,a){for(var b=0;b<a.length;b++)a[b]!==null&&c.css(a[b],c.data("ec.storage."+a[b]))},setMode:function(c,a){if(a=="toggle")a=c.is(":hidden")?"show":"hide";return a},getBaseline:function(c,
a){var b;switch(c[0]){case "top":b=0;break;case "middle":b=0.5;break;case "bottom":b=1;break;default:b=c[0]/a.height}switch(c[1]){case "left":c=0;break;case "center":c=0.5;break;case "right":c=1;break;default:c=c[1]/a.width}return{x:c,y:b}},createWrapper:function(c){if(c.parent().is(".ui-effects-wrapper"))return c.parent();var a={width:c.outerWidth(true),height:c.outerHeight(true),"float":c.css("float")},b=f("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",
border:"none",margin:0,padding:0});c.wrap(b);b=c.parent();if(c.css("position")=="static"){b.css({position:"relative"});c.css({position:"relative"})}else{f.extend(a,{position:c.css("position"),zIndex:c.css("z-index")});f.each(["top","left","bottom","right"],function(d,e){a[e]=c.css(e);if(isNaN(parseInt(a[e],10)))a[e]="auto"});c.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})}return b.css(a).show()},removeWrapper:function(c){if(c.parent().is(".ui-effects-wrapper"))return c.parent().replaceWith(c);
return c},setTransition:function(c,a,b,d){d=d||{};f.each(a,function(e,g){unit=c.cssUnit(g);if(unit[0]>0)d[g]=unit[0]*b+unit[1]});return d}});f.fn.extend({effect:function(c){var a=k.apply(this,arguments),b={options:a[1],duration:a[2],callback:a[3]};a=b.options.mode;var d=f.effects[c];if(f.fx.off||!d)return a?this[a](b.duration,b.callback):this.each(function(){b.callback&&b.callback.call(this)});return d.call(this,b)},_show:f.fn.show,show:function(c){if(m(c))return this._show.apply(this,arguments);
else{var a=k.apply(this,arguments);a[1].mode="show";return this.effect.apply(this,a)}},_hide:f.fn.hide,hide:function(c){if(m(c))return this._hide.apply(this,arguments);else{var a=k.apply(this,arguments);a[1].mode="hide";return this.effect.apply(this,a)}},__toggle:f.fn.toggle,toggle:function(c){if(m(c)||typeof c==="boolean"||f.isFunction(c))return this.__toggle.apply(this,arguments);else{var a=k.apply(this,arguments);a[1].mode="toggle";return this.effect.apply(this,a)}},cssUnit:function(c){var a=this.css(c),
b=[];f.each(["em","px","%","pt"],function(d,e){if(a.indexOf(e)>0)b=[parseFloat(a),e]});return b}});f.easing.jswing=f.easing.swing;f.extend(f.easing,{def:"easeOutQuad",swing:function(c,a,b,d,e){return f.easing[f.easing.def](c,a,b,d,e)},easeInQuad:function(c,a,b,d,e){return d*(a/=e)*a+b},easeOutQuad:function(c,a,b,d,e){return-d*(a/=e)*(a-2)+b},easeInOutQuad:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a+b;return-d/2*(--a*(a-2)-1)+b},easeInCubic:function(c,a,b,d,e){return d*(a/=e)*a*a+b},easeOutCubic:function(c,
a,b,d,e){return d*((a=a/e-1)*a*a+1)+b},easeInOutCubic:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a+b;return d/2*((a-=2)*a*a+2)+b},easeInQuart:function(c,a,b,d,e){return d*(a/=e)*a*a*a+b},easeOutQuart:function(c,a,b,d,e){return-d*((a=a/e-1)*a*a*a-1)+b},easeInOutQuart:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a*a+b;return-d/2*((a-=2)*a*a*a-2)+b},easeInQuint:function(c,a,b,d,e){return d*(a/=e)*a*a*a*a+b},easeOutQuint:function(c,a,b,d,e){return d*((a=a/e-1)*a*a*a*a+1)+b},easeInOutQuint:function(c,
a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a*a*a+b;return d/2*((a-=2)*a*a*a*a+2)+b},easeInSine:function(c,a,b,d,e){return-d*Math.cos(a/e*(Math.PI/2))+d+b},easeOutSine:function(c,a,b,d,e){return d*Math.sin(a/e*(Math.PI/2))+b},easeInOutSine:function(c,a,b,d,e){return-d/2*(Math.cos(Math.PI*a/e)-1)+b},easeInExpo:function(c,a,b,d,e){return a==0?b:d*Math.pow(2,10*(a/e-1))+b},easeOutExpo:function(c,a,b,d,e){return a==e?b+d:d*(-Math.pow(2,-10*a/e)+1)+b},easeInOutExpo:function(c,a,b,d,e){if(a==0)return b;if(a==
e)return b+d;if((a/=e/2)<1)return d/2*Math.pow(2,10*(a-1))+b;return d/2*(-Math.pow(2,-10*--a)+2)+b},easeInCirc:function(c,a,b,d,e){return-d*(Math.sqrt(1-(a/=e)*a)-1)+b},easeOutCirc:function(c,a,b,d,e){return d*Math.sqrt(1-(a=a/e-1)*a)+b},easeInOutCirc:function(c,a,b,d,e){if((a/=e/2)<1)return-d/2*(Math.sqrt(1-a*a)-1)+b;return d/2*(Math.sqrt(1-(a-=2)*a)+1)+b},easeInElastic:function(c,a,b,d,e){c=1.70158;var g=0,h=d;if(a==0)return b;if((a/=e)==1)return b+d;g||(g=e*0.3);if(h<Math.abs(d)){h=d;c=g/4}else c=
g/(2*Math.PI)*Math.asin(d/h);return-(h*Math.pow(2,10*(a-=1))*Math.sin((a*e-c)*2*Math.PI/g))+b},easeOutElastic:function(c,a,b,d,e){c=1.70158;var g=0,h=d;if(a==0)return b;if((a/=e)==1)return b+d;g||(g=e*0.3);if(h<Math.abs(d)){h=d;c=g/4}else c=g/(2*Math.PI)*Math.asin(d/h);return h*Math.pow(2,-10*a)*Math.sin((a*e-c)*2*Math.PI/g)+d+b},easeInOutElastic:function(c,a,b,d,e){c=1.70158;var g=0,h=d;if(a==0)return b;if((a/=e/2)==2)return b+d;g||(g=e*0.3*1.5);if(h<Math.abs(d)){h=d;c=g/4}else c=g/(2*Math.PI)*Math.asin(d/
h);if(a<1)return-0.5*h*Math.pow(2,10*(a-=1))*Math.sin((a*e-c)*2*Math.PI/g)+b;return h*Math.pow(2,-10*(a-=1))*Math.sin((a*e-c)*2*Math.PI/g)*0.5+d+b},easeInBack:function(c,a,b,d,e,g){if(g==j)g=1.70158;return d*(a/=e)*a*((g+1)*a-g)+b},easeOutBack:function(c,a,b,d,e,g){if(g==j)g=1.70158;return d*((a=a/e-1)*a*((g+1)*a+g)+1)+b},easeInOutBack:function(c,a,b,d,e,g){if(g==j)g=1.70158;if((a/=e/2)<1)return d/2*a*a*(((g*=1.525)+1)*a-g)+b;return d/2*((a-=2)*a*(((g*=1.525)+1)*a+g)+2)+b},easeInBounce:function(c,
a,b,d,e){return d-f.easing.easeOutBounce(c,e-a,0,d,e)+b},easeOutBounce:function(c,a,b,d,e){return(a/=e)<1/2.75?d*7.5625*a*a+b:a<2/2.75?d*(7.5625*(a-=1.5/2.75)*a+0.75)+b:a<2.5/2.75?d*(7.5625*(a-=2.25/2.75)*a+0.9375)+b:d*(7.5625*(a-=2.625/2.75)*a+0.984375)+b},easeInOutBounce:function(c,a,b,d,e){if(a<e/2)return f.easing.easeInBounce(c,a*2,0,d,e)*0.5+b;return f.easing.easeOutBounce(c,a*2-e,0,d,e)*0.5+d*0.5+b}})}(jQuery);
;

View File

@@ -0,0 +1,380 @@
if (typeof console == 'undefined') console = {
log: function () { }
};
// sniff chrome
var CHROME_5_LOCAL = false;
var CHROME = false;
var SAFARI = false;
var FIREFOX = false;
var WEBKIT = false;
var QQ = false;
var UC = false;
var OS_MAC = false;
var IOS = false;
var ANDROID = false;
var MOBILE_DEVICE = false;
var SHARE_APP = false;
var IE = false;
var IE_10_AND_BELOW = false; //ie 10 and lower
var IE_11_AND_ABOVE = false; //ie 11 and above
var BROWSER_VERSION = 5000;
(function () {
if(!window.$axure) window.$axure = function() {};
var useragent = window.navigator.userAgent;
IOS = useragent.match(/iPhone/i) || useragent.match(/iPad/i) || useragent.match(/iPod/i);
ANDROID = useragent.match(/Android/i);
MOBILE_DEVICE = ANDROID || IOS
|| navigator.userAgent.match(/webOS/i)
|| navigator.userAgent.match(/BlackBerry/i)
|| navigator.userAgent.match(/Tablet PC/i)
|| navigator.userAgent.match(/Windows Phone/i);
var edgeRegex = /Edge\/([0-9]+)/g;
var edgeMatch = edgeRegex.exec(useragent);
$axure.browser = { isEdge: Boolean(edgeMatch) };
if ($axure.browser.isEdge) BROWSER_VERSION = Number(edgeMatch[1]);
if(!$axure.browser.isEdge) {
var chromeRegex = /Chrome\/([0-9]+).([0-9]+)/g;
var chromeMatch = chromeRegex.exec(useragent);
CHROME = Boolean(chromeMatch);
CHROME_5_LOCAL = chromeMatch &&
Number(chromeMatch[1]) >= 5 &&
location.href.indexOf('file://') >= 0 &&
!MOBILE_DEVICE; // Otherwise, Android webview will show up as CHROME_5_LOCAL
if (CHROME) BROWSER_VERSION = Number(chromeMatch[1]);
}
var safariRegex = /Safari\/([0-9]+)/g;
var safariMatch = safariRegex.exec(useragent);
SAFARI = Boolean(safariMatch) && !CHROME && !$axure.browser.isEdge; //because chrome also inserts safari string into user agent
if (SAFARI) BROWSER_VERSION = Number(safariMatch[1]);
var webkitRegex = /WebKit\//g ;
WEBKIT = Boolean(webkitRegex.exec(useragent));
var firefoxRegex = /Firefox\/([0-9]+)/g;
var firefoxMatch = firefoxRegex.exec(useragent);
FIREFOX = useragent.toLowerCase().indexOf('firefox') > -1;
if (FIREFOX) BROWSER_VERSION = Number(firefoxMatch[1]);
QQ = useragent.toLowerCase().indexOf('qqbrowser') > -1;
UC = useragent.toLowerCase().indexOf('ucbrowser') > -1 || useragent.toLowerCase().indexOf('ubrowser') > -1;
SHARE_APP = useragent.toLowerCase().indexOf('shareapp') > -1;
var macRegex = /Mac/g ;
OS_MAC = Boolean(macRegex.exec(window.navigator.platform));
if($.browser) {
if($.browser.msie) IE_10_AND_BELOW = true;
else IE_11_AND_ABOVE = useragent.toLowerCase().indexOf('trident') > -1;
BROWSER_VERSION = $.browser.version;
}
IE_11_AND_ABOVE = useragent.toLowerCase().indexOf('trident') > -1;
IE_10_AND_BELOW = !IE_11_AND_ABOVE && useragent.toLowerCase().indexOf('msie') > -1;
IE = IE_10_AND_BELOW || IE_11_AND_ABOVE;
var _supports = $axure.mobileSupport = {};
_supports.touchstart = typeof window.ontouchstart !== 'undefined';
_supports.touchmove = typeof window.ontouchmove !== 'undefined';
_supports.touchend = typeof window.ontouchend !== 'undefined';
_supports.mobile = _supports.touchstart && _supports.touchend && _supports.touchmove;
if (!MOBILE_DEVICE && _supports.mobile) {
_supports.touchstart = false;
_supports.touchmove = false;
_supports.touchend = false;
_supports.mobile = false;
}
var _eventNames = $axure.eventNames = {};
_eventNames.mouseDownName = _supports.touchstart ? 'touchstart' : 'mousedown';
_eventNames.mouseUpName = _supports.touchend ? 'touchend' : 'mouseup';
_eventNames.mouseMoveName = _supports.touchmove ? 'touchmove' : 'mousemove';
//Used by sitemap and variables.js getLinkUrl functions so that they know
//whether to embed global variables in URL as query string or hash string
//_shouldSendVars persists the value for sitemap instead of re-checking every time
var _shouldSendVars;
var _shouldSendVarsToServer = function(url) {
if(typeof _shouldSendVars != 'undefined') {
return _shouldSendVars;
}
if(SAFARI || (IE_10_AND_BELOW && BROWSER_VERSION < 10)) {
var urlToCheck = typeof url != 'undefined' ? url : window.location.href;
var serverRegex = /http:\/\/127\.0\.0\.1:[0-9]{5}/g;
var serverMatch = serverRegex.exec(urlToCheck);
var previewRegex = /[0-9]{2}\.[0-9]{2}\.[0-9]{2}/g;
var previewMatch = previewRegex.exec(urlToCheck);
if(Boolean(serverMatch) && Boolean(previewMatch)) {
_shouldSendVars = true;
return _shouldSendVars;
}
}
_shouldSendVars = false;
return _shouldSendVars;
};
$axure.shouldSendVarsToServer = _shouldSendVarsToServer;
})();
(function () {
var matched, browser;
// Use of jQuery.browser is frowned upon.
// More details: http://api.jquery.com/jQuery.browser
// jQuery.uaMatch maintained for back-compat
jQuery.uaMatch = function (ua) {
ua = ua.toLowerCase();
var match = /(chrome)[ \/]([\w.]+)/.exec(ua) ||
/(webkit)[ \/]([\w.]+)/.exec(ua) ||
/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) ||
/(msie) ([\w.]+)/.exec(ua) ||
ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) ||
[];
return {
browser: match[1] || "",
version: match[2] || "0"
};
};
matched = jQuery.uaMatch(navigator.userAgent);
browser = {};
if (matched.browser) {
browser[matched.browser] = true;
browser.version = matched.version;
}
// Chrome is Webkit, but Webkit is also Safari.
if (browser.chrome) {
browser.webkit = true;
} else if (browser.webkit) {
browser.safari = true;
}
jQuery.browser = browser;
jQuery.sub = function () {
function jQuerySub(selector, context) {
return new jQuerySub.fn.init(selector, context);
}
jQuery.extend(true, jQuerySub, this);
jQuerySub.superclass = this;
jQuerySub.fn = jQuerySub.prototype = this();
jQuerySub.fn.constructor = jQuerySub;
jQuerySub.sub = this.sub;
jQuerySub.fn.init = function init(selector, context) {
if (context && context instanceof jQuery && !(context instanceof jQuerySub)) {
context = jQuerySub(context);
}
return jQuery.fn.init.call(this, selector, context, rootjQuerySub);
};
jQuerySub.fn.init.prototype = jQuerySub.fn;
var rootjQuerySub = jQuerySub(document);
return jQuerySub;
};
})();
(function() {
var _topMessageCenter;
var _messageCenter = {};
var _listeners = [];
var _stateListeners = [];
var _state = {};
var _eventObject = null;
var _queuedMessages = [];
var _initialized = false;
// this is for the non Chrome 5 local scenarios. The "top" message center will dispatch to all the bottom ones
var _childrenMessageCenters = [];
// create $axure if it hasn't been created
if(!window.$axure) window.$axure = function() {};
$axure.messageCenter = _messageCenter;
// isolate scope, and initialize _topMessageCenter.
(function() {
if(!CHROME_5_LOCAL) {
var topAxureWindow = window;
try {
while(topAxureWindow.parent && topAxureWindow.parent !== topAxureWindow && topAxureWindow.parent.$axure)
topAxureWindow = topAxureWindow.parent;
} catch(e) {
}
_topMessageCenter = topAxureWindow.$axure.messageCenter;
}
})();
if (CHROME_5_LOCAL) {
document.addEventListener("DOMContentLoaded", function () {
$('body').append("<div id='axureEventReceiverDiv' style='display:none'></div>" +
"<div id='axureEventSenderDiv' style='display:none'></div>");
_eventObject = window.document.createEvent('Event');
_eventObject.initEvent('axureMessageSenderEvent', true, true);
$('#axureEventReceiverDiv')[0].addEventListener('axureMessageReceiverEvent',
function () {
var request = JSON.parse($(this).text());
_handleRequest(request);
});
});
} else {
$(window.document).ready(function () {
if (_topMessageCenter != _messageCenter) {
_topMessageCenter.addChildMessageCenter(_messageCenter);
console.log('adding from ' + window.location.toString());
}
});
}
var _handleRequest = function (request) {
// route the request to all the listeners
for(var i = 0; i < _listeners.length; i++) _listeners[i](request.message, request.data);
// now handle the queued messages if we're initializing
if (request.message == 'initialize') {
_initialized = true;
// send all the queued messages and return
for (var i = 0; i < _queuedMessages.length; i++) {
var qRequest = _queuedMessages[i];
_messageCenter.postMessage(qRequest.message, qRequest.data);
}
_queuedMessages = [];
}
// and then handle the set state messages, if necessary
if (request.message == 'setState') {
_state[request.data.key] = request.data.value;
for (var i = 0; i < _stateListeners.length; i++) {
var keyListener = _stateListeners[i];
// if thep passed a null or empty value, always post the message
if (!keyListener.key || keyListener.key == request.data.key) {
keyListener.listener(request.data.key, request.data.value);
}
}
}
};
// -----------------------------------------------------------------------------------------
// This method allows for dispatching messages in the non-chromelocal scenario.
// Each child calls this on _topMessageCenter
// -----------------------------------------------------------------------------------------
_messageCenter.addChildMessageCenter = function(messageCenter) {
_childrenMessageCenters[_childrenMessageCenters.length] = messageCenter;
};
// -----------------------------------------------------------------------------------------
// This method allows for dispatching messages in the non-chromelocal scenario.
// Each child calls this on _topMessageCenter
// -----------------------------------------------------------------------------------------
_messageCenter.dispatchMessage = function(message, data) {
_handleRequest({
message: message,
data: data
});
};
// -----------------------------------------------------------------------------------------
// -----------------------------------------------------------------------------------------
_messageCenter.dispatchMessageRecursively = function(message, data) {
console.log("dispatched to " + window.location.toString());
// dispatch to the top center first
_messageCenter.dispatchMessage(message, data);
$('iframe').each(function(index, frame) {
//try,catch to handle permissions error in FF when loading pages from another domain
try {
if (frame.contentWindow.$axure && frame.contentWindow.$axure.messageCenter) {
frame.contentWindow.$axure.messageCenter.dispatchMessageRecursively(message, data);
}
}catch(e) {}
});
};
var _combineEventMessages = false;
var _compositeEventMessageData = [];
_messageCenter.startCombineEventMessages = function() {
_combineEventMessages = true;
}
_messageCenter.endCombineEventMessages = function () {
_messageCenter.sendCompositeEventMessage();
_combineEventMessages = false;
}
_messageCenter.sendCompositeEventMessage = function () {
_messageCenter.postMessage('axCompositeEventMessage', _compositeEventMessageData);
_compositeEventMessageData = [];
}
_messageCenter.postMessage = function (message, data) {
if(_combineEventMessages) {
if(message == 'axEvent' || message == 'axCase' || message == 'axAction' || message == 'axEventComplete') {
_compositeEventMessageData.push({ 'message': message, 'data': data });
if(_compositeEventMessageData.length >= 10) _messageCenter.sendCompositeEventMessage();
return;
}
}
if(!CHROME_5_LOCAL) {
_topMessageCenter.dispatchMessageRecursively(message, data);
} else {
var request = {
message: message,
data: data
};
if(_initialized) {
var senderDiv = window.document.getElementById('axureEventSenderDiv');
var messageText = JSON.stringify(request);
// console.log('sending event: ' + messageText);
senderDiv.innerText = messageText;
senderDiv.dispatchEvent(_eventObject);
// console.log('event sent');
} else {
_queuedMessages[_queuedMessages.length] = request;
}
}
};
_messageCenter.setState = function(key, value) {
var data = {
key: key,
value: value
};
_messageCenter.postMessage('setState', data);
};
_messageCenter.getState = function(key) {
return _state[key];
};
_messageCenter.addMessageListener = function(listener) {
_listeners[_listeners.length] = listener;
};
_messageCenter.addStateListener = function(key, listener) {
_stateListeners[_stateListeners.length] = {
key: key,
listener: listener
};
};
})();

View File

@@ -0,0 +1,18 @@
(function () {
$.holdReady(true);
var script = window.document.createElement("script");
script.type = "text/javascript";
script.async = true;
script.onload = script.onreadystatechange = function (e, isAbort) {
if (isAbort || !script.readyState || /loaded|complete/.test(script.readyState)) {
script.onload = script.onreadystatechange = null;
script = undefined;
}
if (!isAbort) { $.holdReady(false); }
}
script.src = "data/document.js";
window.document.head.appendChild(script);
})();

View File

@@ -0,0 +1,219 @@
/*
* jQuery.splitter.js - two-pane splitter window plugin
*
* version 1.51 (2009/01/09)
*
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*/
/**
* The splitter() plugin implements a two-pane resizable splitter window.
* The selected elements in the jQuery object are converted to a splitter;
* each selected element should have two child elements, used for the panes
* of the splitter. The plugin adds a third child element for the splitbar.
*
* For more details see: http://methvin.com/splitter/
*
*
* @example $('#MySplitter').splitter();
* @desc Create a vertical splitter with default settings
*
* @example $('#MySplitter').splitter({type: 'h', accessKey: 'M'});
* @desc Create a horizontal splitter resizable via Alt+Shift+M
*
* @name splitter
* @type jQuery
* @param Object options Options for the splitter (not required)
* @cat Plugins/Splitter
* @return jQuery
* @author Dave Methvin (dave.methvin@gmail.com)
*/
;(function($){
$.fn.splitter = function(args){
args = args || {};
return this.each(function() {
var zombie; // left-behind splitbar for outline resizes
function startSplitMouse(evt) {
if ( opts.outline )
zombie = zombie || bar.clone(false).insertAfter(A);
panes.css("-webkit-user-select", "none"); // Safari selects A/B text on a move
bar.addClass(opts.activeClass);
$('<div class="splitterMask"></div>').insertAfter(bar);
A._posSplit = A[0][opts.pxSplit] - evt[opts.eventPos];
$(document)
.bind("mousemove", doSplitMouse)
.bind("mouseup", endSplitMouse);
}
function doSplitMouse(evt) {
var newPos = A._posSplit+evt[opts.eventPos];
if ( opts.outline ) {
newPos = Math.max(0, Math.min(newPos, splitter._DA - bar._DA));
bar.css(opts.origin, newPos);
} else
resplit(newPos);
}
function endSplitMouse(evt) {
$('div.splitterMask').remove();
bar.removeClass(opts.activeClass);
var newPos = A._posSplit+evt[opts.eventPos];
if ( opts.outline ) {
zombie.remove(); zombie = null;
resplit(newPos);
}
panes.css("-webkit-user-select", "text"); // let Safari select text again
$(document)
.unbind("mousemove", doSplitMouse)
.unbind("mouseup", endSplitMouse);
}
function resplit(newPos) {
// Constrain new splitbar position to fit pane size limits
newPos = Math.max(A._min, splitter._DA - B._max,
Math.min(newPos, A._max, splitter._DA - bar._DA - B._min));
// Resize/position the two panes
bar._DA = bar[0][opts.pxSplit]; // bar size may change during dock
var posOffset = bar.is(':visible') ? bar._DA - 1 : 0;
bar.css(opts.origin, newPos - posOffset).css(opts.fixed, splitter._DF);
A.css(opts.origin, 0).css(opts.split, newPos).css(opts.fixed, splitter._DF);
B.css(opts.origin, newPos + bar._DA - posOffset)
.css(opts.split, splitter._DA-bar._DA-newPos).css(opts.fixed, splitter._DF);
// IE fires resize for us; all others pay cash
if ( !IE_10_AND_BELOW )
panes.trigger("resize");
}
function dimSum(jq, dims) {
// Opera returns -1 for missing min/max width, turn into 0
var sum = 0;
for ( var i=1; i < arguments.length; i++ )
sum += Math.max(parseInt(jq.css(arguments[i])) || 0, 0);
return sum;
}
// Determine settings based on incoming opts, element classes, and defaults
var vh = (args.splitHorizontal? 'h' : args.splitVertical? 'v' : args.type) || 'v';
var opts = $.extend({
activeClass: 'active', // class name for active splitter
pxPerKey: 8, // splitter px moved per keypress
tabIndex: 0, // tab order indicator
accessKey: '' // accessKey for splitbar
},{
v: { // Vertical splitters:
keyLeft: 39, keyRight: 37, cursor: "col-resize",
splitbarClass: "vsplitbar", outlineClass: "voutline",
type: 'v', eventPos: "pageX", origin: "left",
split: "width", pxSplit: "offsetWidth", side1: "Left", side2: "Right",
fixed: "height", pxFixed: "offsetHeight", side3: "Top", side4: "Bottom"
},
h: { // Horizontal splitters:
keyTop: 40, keyBottom: 38, cursor: "row-resize",
splitbarClass: "hsplitbar", outlineClass: "houtline",
type: 'h', eventPos: "pageY", origin: "top",
split: "height", pxSplit: "offsetHeight", side1: "Top", side2: "Bottom",
fixed: "width", pxFixed: "offsetWidth", side3: "Left", side4: "Right"
}
}[vh], args);
// Create jQuery object closures for splitter and both panes
var splitter = $(this).css({position: "relative"});
var panes = $(">*", splitter[0]).css({
position: "absolute", // positioned inside splitter container
"z-index": "1", // splitbar is positioned above
"-moz-outline-style": "none" // don't show dotted outline
});
var A = $(panes[0]); // left or top
var B = $(panes[1]); // right or bottom
// Focuser element, provides keyboard support; title is shown by Opera accessKeys
var focuser = $('<a href="javascript:void(0)"></a>')
.attr({accessKey: opts.accessKey, tabIndex: opts.tabIndex, title: opts.splitbarClass})
//.bind($.browser.opera?"click":"focus", function(){ this.focus(); bar.addClass(opts.activeClass) })
.bind("focus", function () { this.focus(); bar.addClass(opts.activeClass) })
.bind("keydown", function(e){
var key = e.which || e.keyCode;
var dir = key==opts["key"+opts.side1]? 1 : key==opts["key"+opts.side2]? -1 : 0;
if ( dir )
resplit(A[0][opts.pxSplit]+dir*opts.pxPerKey, false);
})
.bind("blur", function(){ bar.removeClass(opts.activeClass) });
// Splitbar element, can be already in the doc or we create one
var bar = $(panes[2] || '<div></div>')
.insertAfter(A).css("z-index", "100").append(focuser)
.attr({"class": opts.splitbarClass, unselectable: "on"})
.css({position: "absolute", "user-select": "none", "-webkit-user-select": "none",
"-khtml-user-select": "none", "-moz-user-select": "none", "top": "0px"})
.bind("mousedown", startSplitMouse);
// Use our cursor unless the style specifies a non-default cursor
if ( /^(auto|default|)$/.test(bar.css("cursor")) )
bar.css("cursor", opts.cursor);
// Cache several dimensions for speed, rather than re-querying constantly
bar._DA = bar[0][opts.pxSplit];
splitter._PBF = $.boxModel? dimSum(splitter, "border"+opts.side3+"Width", "border"+opts.side4+"Width") : 0;
splitter._PBA = $.boxModel? dimSum(splitter, "border"+opts.side1+"Width", "border"+opts.side2+"Width") : 0;
A._pane = opts.side1;
B._pane = opts.side2;
$.each([A,B], function(){
this._min = opts["min"+this._pane] || dimSum(this, "min-"+opts.split);
this._max = opts["max"+this._pane] || dimSum(this, "max-"+opts.split) || 9999;
this._init = opts["size"+this._pane]===true ?
parseInt($.curCSS(this[0],opts.split)) : opts["size"+this._pane];
});
// Determine initial position, get from cookie if specified
var initPos = A._init;
if ( !isNaN(B._init) ) // recalc initial B size as an offset from the top or left side
initPos = splitter[0][opts.pxSplit] - splitter._PBA - B._init - bar._DA;
if ( opts.cookie ) {
if ( !$.cookie )
alert('jQuery.splitter(): jQuery cookie plugin required');
var ckpos = parseInt($.cookie(opts.cookie));
if ( !isNaN(ckpos) )
initPos = ckpos;
$(window).bind("unload", function(){
var state = String(bar.css(opts.origin)); // current location of splitbar
$.cookie(opts.cookie, state, {expires: opts.cookieExpires || 365,
path: opts.cookiePath || document.location.pathname});
});
}
if ( isNaN(initPos) ) // King Solomon's algorithm
initPos = Math.round((splitter[0][opts.pxSplit] - splitter._PBA - bar._DA)/2);
// Resize event propagation and splitter sizing
if ( opts.anchorToWindow ) {
// Account for margin or border on the splitter container and enforce min height
splitter._hadjust = dimSum(splitter, "borderTopWidth", "borderBottomWidth", "marginBottom");
splitter._hmin = Math.max(dimSum(splitter, "minHeight"), 20);
$(window).bind("resize", function(){
var top = splitter.offset().top;
var wh = $(window).height();
splitter.css("height", Math.max(wh-top-splitter._hadjust, splitter._hmin)+"px");
if ( !IE_10_AND_BELOW ) splitter.trigger("resize");
}).trigger("resize");
}
else if ( opts.resizeToWidth && !IE_10_AND_BELOW )
$(window).bind("resize", function(){
splitter.trigger("resize");
});
// Resize event handler; triggered immediately to set initial position
splitter.bind("resize", function(e, size){
// Custom events bubble in jQuery 1.3; don't Yo Dawg
if ( e.target != this ) return;
// Determine new width/height of splitter container
splitter._DF = splitter[0][opts.pxFixed] - splitter._PBF;
splitter._DA = splitter[0][opts.pxSplit] - splitter._PBA;
// Bail if splitter isn't visible or content isn't there yet
if ( splitter._DF <= 0 || splitter._DA <= 0 ) return;
// Re-divvy the adjustable dimension; maintain size of the preferred pane
resplit(!isNaN(size)? size : (!(opts.sizeRight||opts.sizeBottom)? A[0][opts.pxSplit] :
splitter._DA-B[0][opts.pxSplit]-bar._DA));
}).trigger("resize" , [initPos]);
});
};
})(jQuery);