mirror of
https://github.com/bodyrep/DemoApp.git
synced 2025-12-06 06:01:48 +00:00
little man
This commit is contained in:
1
.idea/.name
generated
Normal file
1
.idea/.name
generated
Normal file
@@ -0,0 +1 @@
|
||||
DemoApp
|
||||
10
.idea/DemoApp.iml
generated
Normal file
10
.idea/DemoApp.iml
generated
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="WEB_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" name="Node.js v0.6.18 Core Modules" level="application" />
|
||||
</component>
|
||||
</module>
|
||||
|
||||
3
.idea/dictionaries/fbleagh.xml
generated
Normal file
3
.idea/dictionaries/fbleagh.xml
generated
Normal file
@@ -0,0 +1,3 @@
|
||||
<component name="ProjectDictionaryState">
|
||||
<dictionary name="fbleagh" />
|
||||
</component>
|
||||
5
.idea/encodings.xml
generated
Normal file
5
.idea/encodings.xml
generated
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" />
|
||||
</project>
|
||||
|
||||
45
.idea/inspectionProfiles/Project_Default.xml
generated
Normal file
45
.idea/inspectionProfiles/Project_Default.xml
generated
Normal file
@@ -0,0 +1,45 @@
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<profile version="1.0" is_locked="false">
|
||||
<option name="myName" value="Project Default" />
|
||||
<option name="myLocal" value="false" />
|
||||
<inspection_tool class="CheckDtdRefs" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
<inspection_tool class="CheckNodeTest" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="CheckTagEmptyBody" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="CheckXmlFileWithXercesValidator" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
<inspection_tool class="CoffeeScriptInfiniteLoop" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="CoffeeScriptSillyAssignment" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="CoffeeScriptSwitchStatementWithNoDefaultBranch" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="CoffeeScriptUnusedLocalSymbols" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="CucumberUndefinedStep" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="HardwiredNamespacePrefix" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="ImplicitTypeConversion" enabled="false" level="WARNING" enabled_by_default="false">
|
||||
<option name="BITS" value="1720" />
|
||||
<option name="FLAG_EXPLICIT_CONVERSION" value="true" />
|
||||
<option name="IGNORE_NODESET_TO_BOOLEAN_VIA_STRING" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="IndexZeroUsage" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="LessUnresolvedImport" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="LessUnresolvedVariable" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="RedundantTypeConversion" enabled="false" level="WARNING" enabled_by_default="false">
|
||||
<option name="CHECK_ANY" value="false" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="SassUnresolvedFunction" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="SassUnresolvedImport" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="SassUnresolvedMixin" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="SassUnresolvedPlaceholderSelector" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="SassUnresolvedVariable" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="SpellCheckingInspection" enabled="false" level="TYPO" enabled_by_default="false">
|
||||
<option name="processCode" value="true" />
|
||||
<option name="processLiterals" value="true" />
|
||||
<option name="processComments" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="XmlDuplicatedId" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
<inspection_tool class="XmlUnboundNsPrefix" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="XmlUnusedNamespaceDeclaration" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="XmlWrongRootElement" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
<inspection_tool class="XsltDeclarations" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
<inspection_tool class="XsltTemplateInvocation" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
<inspection_tool class="XsltUnusedDeclaration" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="XsltVariableShadowing" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
</profile>
|
||||
</component>
|
||||
7
.idea/inspectionProfiles/profiles_settings.xml
generated
Normal file
7
.idea/inspectionProfiles/profiles_settings.xml
generated
Normal file
@@ -0,0 +1,7 @@
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<settings>
|
||||
<option name="PROJECT_PROFILE" value="Project Default" />
|
||||
<option name="USE_PROJECT_PROFILE" value="true" />
|
||||
<version value="1.0" />
|
||||
</settings>
|
||||
</component>
|
||||
7
.idea/jsLibraryMappings.xml
generated
Normal file
7
.idea/jsLibraryMappings.xml
generated
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="JavaScriptLibraryMappings">
|
||||
<file url="PROJECT" libraries="{Node.js v0.6.18 Core Modules}" />
|
||||
</component>
|
||||
</project>
|
||||
|
||||
8
.idea/libraries/sass_stdlib.xml
generated
Normal file
8
.idea/libraries/sass_stdlib.xml
generated
Normal file
@@ -0,0 +1,8 @@
|
||||
<component name="libraryTable">
|
||||
<library name="sass-stdlib">
|
||||
<CLASSES />
|
||||
<SOURCES>
|
||||
<root url="file://$APPLICATION_HOME_DIR$/plugins/sass/lib/stubs/sass_functions.scss" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
8
.idea/misc.xml
generated
Normal file
8
.idea/misc.xml
generated
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectResources">
|
||||
<default-html-doctype>jar:file:\C:\Program Files (x86)\JetBrains\WebStorm 5.0.4\lib\webide.jar!\resources\html5-schema\html5.rnc</default-html-doctype>
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" />
|
||||
</project>
|
||||
|
||||
9
.idea/modules.xml
generated
Normal file
9
.idea/modules.xml
generated
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/DemoApp.iml" filepath="$PROJECT_DIR$/.idea/DemoApp.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
|
||||
5
.idea/scopes/scope_settings.xml
generated
Normal file
5
.idea/scopes/scope_settings.xml
generated
Normal file
@@ -0,0 +1,5 @@
|
||||
<component name="DependencyValidationManager">
|
||||
<state>
|
||||
<option name="SKIP_IMPORT_STATEMENTS" value="false" />
|
||||
</state>
|
||||
</component>
|
||||
7
.idea/vcs.xml
generated
Normal file
7
.idea/vcs.xml
generated
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
|
||||
358
.idea/workspace.xml
generated
Normal file
358
.idea/workspace.xml
generated
Normal file
@@ -0,0 +1,358 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="a826c73a-963a-4a01-8b35-09246ddcc87b" name="Default" comment="" />
|
||||
<ignored path="DemoApp.iws" />
|
||||
<ignored path=".idea/workspace.xml" />
|
||||
<option name="TRACKING_ENABLED" value="true" />
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||
<option name="LAST_RESOLUTION" value="IGNORE" />
|
||||
</component>
|
||||
<component name="ChangesViewManager" flattened_view="true" show_ignored="false" />
|
||||
<component name="CreatePatchCommitExecutor">
|
||||
<option name="PATCH_PATH" value="" />
|
||||
</component>
|
||||
<component name="DaemonCodeAnalyzer">
|
||||
<disable_hints />
|
||||
</component>
|
||||
<component name="ExecutionTargetManager" SELECTED_TARGET="default_target" />
|
||||
<component name="FileEditorManager">
|
||||
<leaf>
|
||||
<file leaf-file-name="app.js" pinned="false" current="false" current-in-tab="false">
|
||||
<entry file="file://$PROJECT_DIR$/app.js">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state line="7" column="29" selection-start="121" selection-end="121" vertical-scroll-proportion="0.0">
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
<file leaf-file-name="workouts.js" pinned="false" current="false" current-in-tab="false">
|
||||
<entry file="file://$PROJECT_DIR$/routes/workouts.js">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state line="85" column="0" selection-start="2234" selection-end="2234" vertical-scroll-proportion="0.0">
|
||||
<folding>
|
||||
<element signature="n#!!doc" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
<file leaf-file-name="scripts.js" pinned="false" current="true" current-in-tab="true">
|
||||
<entry file="file://$PROJECT_DIR$/public/javascripts/scripts.js">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state line="241" column="36" selection-start="10447" selection-end="10447" vertical-scroll-proportion="0.7928994">
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
</leaf>
|
||||
</component>
|
||||
<component name="FindManager">
|
||||
<FindUsagesManager>
|
||||
<setting name="OPEN_NEW_TAB" value="false" />
|
||||
</FindUsagesManager>
|
||||
</component>
|
||||
<component name="Git.Settings">
|
||||
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
||||
</component>
|
||||
<component name="IdeDocumentHistory">
|
||||
<option name="changedFiles">
|
||||
<list>
|
||||
<option value="$PROJECT_DIR$/routes/workouts.js" />
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="ProjectFrameBounds">
|
||||
<option name="x" value="-9" />
|
||||
<option name="y" value="-9" />
|
||||
<option name="width" value="1938" />
|
||||
<option name="height" value="1050" />
|
||||
</component>
|
||||
<component name="ProjectInspectionProfilesVisibleTreeState">
|
||||
<entry key="Project Default">
|
||||
<profile-state>
|
||||
<expanded-state>
|
||||
<State>
|
||||
<id />
|
||||
</State>
|
||||
<State>
|
||||
<id>SASS/SCSS</id>
|
||||
</State>
|
||||
<State>
|
||||
<id>Spelling</id>
|
||||
</State>
|
||||
<State>
|
||||
<id>XSLT</id>
|
||||
</State>
|
||||
</expanded-state>
|
||||
<selected-state>
|
||||
<State>
|
||||
<id>XSLT</id>
|
||||
</State>
|
||||
</selected-state>
|
||||
</profile-state>
|
||||
</entry>
|
||||
</component>
|
||||
<component name="ProjectLevelVcsManager" settingsEditedManually="false">
|
||||
<OptionsSetting value="true" id="Add" />
|
||||
<OptionsSetting value="true" id="Remove" />
|
||||
<OptionsSetting value="true" id="Checkout" />
|
||||
<OptionsSetting value="true" id="Update" />
|
||||
<OptionsSetting value="true" id="Status" />
|
||||
<OptionsSetting value="true" id="Edit" />
|
||||
<ConfirmationsSetting value="0" id="Add" />
|
||||
<ConfirmationsSetting value="0" id="Remove" />
|
||||
</component>
|
||||
<component name="ProjectReloadState">
|
||||
<option name="STATE" value="0" />
|
||||
</component>
|
||||
<component name="ProjectView">
|
||||
<navigator currentView="ProjectPane" proportions="" version="1" splitterProportion="0.5">
|
||||
<flattenPackages />
|
||||
<showMembers />
|
||||
<showModules />
|
||||
<showLibraryContents ProjectPane="true" />
|
||||
<hideEmptyPackages />
|
||||
<abbreviatePackageNames />
|
||||
<autoscrollToSource />
|
||||
<autoscrollFromSource />
|
||||
<sortByType />
|
||||
</navigator>
|
||||
<panes>
|
||||
<pane id="Scope" />
|
||||
<pane id="ProjectPane">
|
||||
<subPane>
|
||||
<PATH>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="DemoApp" />
|
||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
|
||||
</PATH_ELEMENT>
|
||||
</PATH>
|
||||
<PATH>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="DemoApp" />
|
||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
|
||||
</PATH_ELEMENT>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="DemoApp" />
|
||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
||||
</PATH_ELEMENT>
|
||||
</PATH>
|
||||
<PATH>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="DemoApp" />
|
||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
|
||||
</PATH_ELEMENT>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="DemoApp" />
|
||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
||||
</PATH_ELEMENT>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="routes" />
|
||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
||||
</PATH_ELEMENT>
|
||||
</PATH>
|
||||
<PATH>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="DemoApp" />
|
||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
|
||||
</PATH_ELEMENT>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="DemoApp" />
|
||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
||||
</PATH_ELEMENT>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="public" />
|
||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
||||
</PATH_ELEMENT>
|
||||
</PATH>
|
||||
<PATH>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="DemoApp" />
|
||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
|
||||
</PATH_ELEMENT>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="DemoApp" />
|
||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
||||
</PATH_ELEMENT>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="public" />
|
||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
||||
</PATH_ELEMENT>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="javascripts" />
|
||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
||||
</PATH_ELEMENT>
|
||||
</PATH>
|
||||
</subPane>
|
||||
</pane>
|
||||
</panes>
|
||||
</component>
|
||||
<component name="PropertiesComponent">
|
||||
<property name="options.splitter.main.proportions" value="0.3" />
|
||||
<property name="WebServerToolWindowFactoryState" value="false" />
|
||||
<property name="options.lastSelected" value="fileTemplates" />
|
||||
<property name="options.searchVisible" value="true" />
|
||||
<property name="options.splitter.details.proportions" value="0.2" />
|
||||
</component>
|
||||
<component name="RunManager">
|
||||
<list size="0" />
|
||||
</component>
|
||||
<component name="ShelveChangesManager" show_recycled="false" />
|
||||
<component name="SvnConfiguration" maxAnnotateRevisions="500" myUseAcceleration="nothing" myAutoUpdateAfterCommit="false" cleanupOnStartRun="false">
|
||||
<option name="USER" value="" />
|
||||
<option name="PASSWORD" value="" />
|
||||
<option name="mySSHConnectionTimeout" value="30000" />
|
||||
<option name="mySSHReadTimeout" value="30000" />
|
||||
<option name="LAST_MERGED_REVISION" />
|
||||
<option name="MERGE_DRY_RUN" value="false" />
|
||||
<option name="MERGE_DIFF_USE_ANCESTRY" value="true" />
|
||||
<option name="UPDATE_LOCK_ON_DEMAND" value="false" />
|
||||
<option name="IGNORE_SPACES_IN_MERGE" value="false" />
|
||||
<option name="DETECT_NESTED_COPIES" value="true" />
|
||||
<option name="CHECK_NESTED_FOR_QUICK_MERGE" value="false" />
|
||||
<option name="IGNORE_SPACES_IN_ANNOTATE" value="true" />
|
||||
<option name="SHOW_MERGE_SOURCES_IN_ANNOTATE" value="true" />
|
||||
<option name="FORCE_UPDATE" value="false" />
|
||||
<option name="IGNORE_EXTERNALS" value="false" />
|
||||
<myIsUseDefaultProxy>false</myIsUseDefaultProxy>
|
||||
</component>
|
||||
<component name="TaskManager">
|
||||
<task active="true" id="Default" summary="Default task">
|
||||
<created>1359841287134</created>
|
||||
<updated>1359841287134</updated>
|
||||
</task>
|
||||
<servers />
|
||||
</component>
|
||||
<component name="ToolWindowManager">
|
||||
<frame x="-9" y="-9" width="1938" height="1050" extended-state="6" />
|
||||
<editor active="false" />
|
||||
<layout>
|
||||
<window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="true" content_ui="tabs" />
|
||||
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.24986821" sideWeight="0.9977401" order="0" side_tool="false" content_ui="combo" />
|
||||
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" />
|
||||
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" />
|
||||
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
|
||||
</layout>
|
||||
</component>
|
||||
<component name="VcsContentAnnotationSettings">
|
||||
<option name="myLimit" value="2678400000" />
|
||||
</component>
|
||||
<component name="VcsManagerConfiguration">
|
||||
<option name="OFFER_MOVE_TO_ANOTHER_CHANGELIST_ON_PARTIAL_COMMIT" value="true" />
|
||||
<option name="CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT" value="true" />
|
||||
<option name="CHECK_NEW_TODO" value="true" />
|
||||
<option name="myTodoPanelSettings">
|
||||
<value>
|
||||
<are-packages-shown value="false" />
|
||||
<are-modules-shown value="false" />
|
||||
<flatten-packages value="false" />
|
||||
<is-autoscroll-to-source value="false" />
|
||||
</value>
|
||||
</option>
|
||||
<option name="PERFORM_UPDATE_IN_BACKGROUND" value="true" />
|
||||
<option name="PERFORM_COMMIT_IN_BACKGROUND" value="true" />
|
||||
<option name="PERFORM_EDIT_IN_BACKGROUND" value="true" />
|
||||
<option name="PERFORM_CHECKOUT_IN_BACKGROUND" value="true" />
|
||||
<option name="PERFORM_ADD_REMOVE_IN_BACKGROUND" value="true" />
|
||||
<option name="PERFORM_ROLLBACK_IN_BACKGROUND" value="false" />
|
||||
<option name="CHECK_LOCALLY_CHANGED_CONFLICTS_IN_BACKGROUND" value="false" />
|
||||
<option name="CHANGED_ON_SERVER_INTERVAL" value="60" />
|
||||
<option name="SHOW_ONLY_CHANGED_IN_SELECTION_DIFF" value="true" />
|
||||
<option name="CHECK_COMMIT_MESSAGE_SPELLING" value="true" />
|
||||
<option name="DEFAULT_PATCH_EXTENSION" value="patch" />
|
||||
<option name="SHORT_DIFF_HORISONTALLY" value="true" />
|
||||
<option name="SHORT_DIFF_EXTRA_LINES" value="2" />
|
||||
<option name="SOFT_WRAPS_IN_SHORT_DIFF" value="true" />
|
||||
<option name="INCLUDE_TEXT_INTO_PATCH" value="false" />
|
||||
<option name="INCLUDE_TEXT_INTO_SHELF" value="false" />
|
||||
<option name="SHOW_FILE_HISTORY_DETAILS" value="true" />
|
||||
<option name="SHOW_VCS_ERROR_NOTIFICATIONS" value="true" />
|
||||
<option name="FORCE_NON_EMPTY_COMMENT" value="false" />
|
||||
<option name="CLEAR_INITIAL_COMMIT_MESSAGE" value="false" />
|
||||
<option name="LAST_COMMIT_MESSAGE" />
|
||||
<option name="MAKE_NEW_CHANGELIST_ACTIVE" value="false" />
|
||||
<option name="OPTIMIZE_IMPORTS_BEFORE_PROJECT_COMMIT" value="false" />
|
||||
<option name="CHECK_FILES_UP_TO_DATE_BEFORE_COMMIT" value="false" />
|
||||
<option name="REFORMAT_BEFORE_PROJECT_COMMIT" value="false" />
|
||||
<option name="REFORMAT_BEFORE_FILE_COMMIT" value="false" />
|
||||
<option name="FILE_HISTORY_DIALOG_COMMENTS_SPLITTER_PROPORTION" value="0.8" />
|
||||
<option name="FILE_HISTORY_DIALOG_SPLITTER_PROPORTION" value="0.5" />
|
||||
<option name="ACTIVE_VCS_NAME" />
|
||||
<option name="UPDATE_GROUP_BY_PACKAGES" value="false" />
|
||||
<option name="UPDATE_GROUP_BY_CHANGELIST" value="false" />
|
||||
<option name="SHOW_FILE_HISTORY_AS_TREE" value="false" />
|
||||
<option name="FILE_HISTORY_SPLITTER_PROPORTION" value="0.6" />
|
||||
</component>
|
||||
<component name="XDebuggerManager">
|
||||
<breakpoint-manager />
|
||||
</component>
|
||||
<component name="XSLT-Support.FileAssociations.UIState">
|
||||
<PATH>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="DemoApp" />
|
||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
|
||||
</PATH_ELEMENT>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="DemoApp" />
|
||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
||||
</PATH_ELEMENT>
|
||||
</PATH>
|
||||
</component>
|
||||
<component name="editorHistoryManager">
|
||||
<entry file="file://$PROJECT_DIR$/app.js">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state line="7" column="29" selection-start="121" selection-end="121" vertical-scroll-proportion="0.0">
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/routes/workouts.js">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state line="85" column="0" selection-start="2234" selection-end="2234" vertical-scroll-proportion="0.0">
|
||||
<folding>
|
||||
<element signature="n#!!doc" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/public/javascripts/scripts.js">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state line="241" column="36" selection-start="10447" selection-end="10447" vertical-scroll-proportion="0.7928994">
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</component>
|
||||
<component name="masterDetails">
|
||||
<states>
|
||||
<state key="ScopeChooserConfigurable.UI">
|
||||
<settings>
|
||||
<splitter-proportions>
|
||||
<option name="proportions">
|
||||
<list>
|
||||
<option value="0.2" />
|
||||
</list>
|
||||
</option>
|
||||
</splitter-proportions>
|
||||
</settings>
|
||||
</state>
|
||||
</states>
|
||||
</component>
|
||||
</project>
|
||||
|
||||
1227
public/images/BlankBody-01.svg
Normal file
1227
public/images/BlankBody-01.svg
Normal file
File diff suppressed because it is too large
Load Diff
|
After Width: | Height: | Size: 128 KiB |
BIN
public/images/BlankBody.png
Normal file
BIN
public/images/BlankBody.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 18 KiB |
1227
public/images/BlankBody.svg
Normal file
1227
public/images/BlankBody.svg
Normal file
File diff suppressed because it is too large
Load Diff
|
After Width: | Height: | Size: 128 KiB |
404
public/javascripts/filter.js
Normal file
404
public/javascripts/filter.js
Normal file
@@ -0,0 +1,404 @@
|
||||
/*
|
||||
* Filter.js
|
||||
* version: 1.3.2 (4/11/2012)
|
||||
*
|
||||
* Licensed under the MIT:
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
*
|
||||
* Copyright 2011 Jiren Patel[ joshsoftware.com ]
|
||||
*
|
||||
* Dependency:
|
||||
* jQuery(v1.6 >=)
|
||||
*/
|
||||
|
||||
(function(window) {
|
||||
|
||||
var _filterJS = function(dataModel, parentNode, view, settings) {
|
||||
this.dataModel = dataModel;
|
||||
this.view = view;
|
||||
this.parentNode = parentNode;
|
||||
this.settings = settings || {};
|
||||
//this.last_result = null;
|
||||
|
||||
if (this.dataModel.constructor == Object){
|
||||
this.dataModel = [this.dataModel];
|
||||
}
|
||||
|
||||
for (name in this.dataModel[0]) {
|
||||
this.settings.root = name;
|
||||
}
|
||||
|
||||
this.render();
|
||||
this.buildCategoryMap();
|
||||
this.bindEvents();
|
||||
|
||||
if(this.settings.exec_callbacks_on_init && this.settings.callbacks){
|
||||
this.execCallBacks(this.settings.all_objects);
|
||||
}
|
||||
|
||||
if(!this.settings.filter_types){
|
||||
this.settings.filter_types = {};
|
||||
}
|
||||
|
||||
if(!this.settings.filter_types['range']){
|
||||
this.settings.filter_types['range'] = this.rangeFilter;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
var FilterJS = function(dataModel, parentNode, view, settings) {
|
||||
return new _filterJS(dataModel, parentNode, view, settings);
|
||||
};
|
||||
|
||||
FilterJS.VERSION = '1.3.2';
|
||||
|
||||
//Register new html tag
|
||||
FilterJS.registerHtmlElement = function(tag_name){
|
||||
_filterJS.prototype[tag_name] = function(attrs, content){
|
||||
return _filterJS.prototype.content_tag(tag_name, attrs, content);
|
||||
};
|
||||
};
|
||||
|
||||
_filterJS.prototype = {
|
||||
/**
|
||||
* Tag to make html elements.
|
||||
* i.e this.content_tag('span', {class: 'logo_text'}, "Logo Text")
|
||||
* First argument is tag name
|
||||
* Second argument is attributes class,title,id etc.
|
||||
* Last argument is array of html elements or text.
|
||||
**/
|
||||
content_tag: function(tag, attrs, content) {
|
||||
var el = document.createElement(tag);
|
||||
|
||||
if (attrs) $(el).attr(attrs);
|
||||
if (content) {
|
||||
if (content.constructor == Array) {
|
||||
content.forEach(function(c) {
|
||||
if (c) $(el).append(c.constructor == String ? c : $(c));
|
||||
});
|
||||
}
|
||||
else {
|
||||
$(el).html(content);
|
||||
}
|
||||
}
|
||||
return el;
|
||||
},
|
||||
|
||||
/**
|
||||
* Link Tag:
|
||||
* i.e. this.link('/test/1' ,{'title': 'title'}, 'link text')
|
||||
**/
|
||||
link: function(url, attrs, content) {
|
||||
attrs = attrs || {};
|
||||
attrs['href'] = url;
|
||||
return this.content_tag('a', attrs, content)
|
||||
},
|
||||
|
||||
/**
|
||||
* Image Tag:
|
||||
* i.e. this.image('/test.png', {class: 'image'})
|
||||
**/
|
||||
image: function(url, attrs) {
|
||||
attrs = attrs || {};
|
||||
attrs['src'] = url;
|
||||
return this.content_tag('img', attrs)
|
||||
},
|
||||
|
||||
//Render Html using JSON data
|
||||
render: function(parentNode) {
|
||||
var base = this;
|
||||
var node = $(this.parentNode);
|
||||
|
||||
if (!this.parentNode || !this.view) return;
|
||||
|
||||
this.dataModel.forEach(function(dm) {
|
||||
dm = dm[base.settings.root];
|
||||
var el = $(base.view(dm));
|
||||
el.attr({'id': base.settings.root + '_' + dm.id, 'data-fjs': true});
|
||||
node.append(el);
|
||||
});
|
||||
},
|
||||
|
||||
//Bind Events to filter html elements
|
||||
bindEvents: function() {
|
||||
var base = this;
|
||||
base.settings.selector.forEach(function(selector, index) {
|
||||
$(selector.element).live(selector.events, function(e) {
|
||||
base.filter();
|
||||
});
|
||||
})
|
||||
|
||||
if(base.settings.search){
|
||||
$(base.settings.search.input).live('keyup', function(e){
|
||||
//var search_result = base.search(this, base.last_result || base.settings.all_objects);
|
||||
//base.hideShow(search_result);
|
||||
base.filter();
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
//Unbind fileter events
|
||||
unbindEvents: function() {
|
||||
var base = this;
|
||||
base.settings.selector.forEach(function(selector, index) {
|
||||
$(selector.element).die(selector.events);
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
//Find elements accroding to selection criteria.
|
||||
filter: function() {
|
||||
var base = this;
|
||||
var filter_out = base.settings.all_objects.slice();
|
||||
var selected_count = 0;
|
||||
var select_none = false; //Zero Selection for any category
|
||||
|
||||
base.settings.selector.forEach(function(s) {
|
||||
var out = $(s.element).filter(s.select).map(function() {
|
||||
return $(this).val();
|
||||
});
|
||||
selected_count += out.length;
|
||||
|
||||
if (out.length) {
|
||||
filter_out = base.grep(filter_out, base.findObjects(s.name, out, s.type));
|
||||
}
|
||||
else{
|
||||
select_none = true;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
if(select_none && base.settings.and_filter_on) filter_out = [];
|
||||
|
||||
//Search
|
||||
if(base.settings.search){
|
||||
filter_out = base.search(base.settings.search, filter_out);
|
||||
}
|
||||
base.hideShow(filter_out);
|
||||
|
||||
//Callbacks
|
||||
base.execCallBacks(filter_out);
|
||||
|
||||
//base.last_result = filter_out;
|
||||
},
|
||||
|
||||
//Compare and collect objects
|
||||
findObjects: function(filter_name, categories, filter_type) {
|
||||
var base = this;
|
||||
var out = [];
|
||||
var category_map = base.settings.object_map[filter_name];
|
||||
var filter_type_function = base.settings.filter_types[filter_type];
|
||||
|
||||
$.each(categories, function(index, category_value) {
|
||||
var cat;
|
||||
|
||||
if(filter_type){
|
||||
cat = $.map(category_map, function(n,v){
|
||||
if(filter_type_function(category_value, v)){
|
||||
return category_map[v];
|
||||
}
|
||||
});
|
||||
} else {
|
||||
cat = category_map[category_value];
|
||||
}
|
||||
|
||||
if(cat) {
|
||||
out = out.concat(cat);
|
||||
}
|
||||
});
|
||||
|
||||
return out;
|
||||
},
|
||||
|
||||
rangeFilter: function(category_value, v){
|
||||
var range = category_value.split('-');
|
||||
if(range.length == 2){
|
||||
if (range[0] == 'below') range[0] = -Infinity;
|
||||
if (range[1] == 'above') range[1] = Infinity;
|
||||
if (Number(v) >= range[0] && Number(v) <= range[1]){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
//Find objects in array
|
||||
grep: function(filter_out, value) {
|
||||
return jQuery.grep(filter_out,
|
||||
function(p, i) {
|
||||
return (jQuery.inArray(p, value) != -1);
|
||||
});
|
||||
},
|
||||
|
||||
//Make eval expresssion to collect object from the json data.
|
||||
makeEvalString: function(field_map, root) {
|
||||
var fields = field_map.split('.ARRAY.');
|
||||
var eval_out_str = root + '.' + fields[0];
|
||||
|
||||
for (i = 1; i < fields.length; i++) {
|
||||
eval_out_str += ".filter_collect('" + fields[i] + "')";
|
||||
}
|
||||
|
||||
return eval_out_str;
|
||||
},
|
||||
|
||||
//Create map accroding to selection criteria.
|
||||
buildObjectMap: function() {
|
||||
var base = this;
|
||||
var filter_criteria = this.settings.filter_criteria;
|
||||
var object_map = {};
|
||||
base.settings.selector = [];
|
||||
|
||||
for (name in filter_criteria) {
|
||||
var selector = {};
|
||||
|
||||
selector.element = filter_criteria[name][0].split(/.EVENT.|.SELECT.|.TYPE./)[0];
|
||||
selector.events = (filter_criteria[name][0].match(/.EVENT.(\S*)/) || [])[1];
|
||||
selector.select = (filter_criteria[name][0].match(/.SELECT.(\S*)/) || [])[1]
|
||||
selector.type = (filter_criteria[name][0].match(/.TYPE.(\S*)/) || [])[1];
|
||||
selector.name = name;
|
||||
|
||||
base.settings.selector.push(selector);
|
||||
|
||||
filter_criteria[name].push(base.makeEvalString(filter_criteria[name][1], base.settings.root));
|
||||
object_map[name] = {};
|
||||
}
|
||||
|
||||
return object_map;
|
||||
},
|
||||
|
||||
buildCategoryMap: function() {
|
||||
var filter_criteria = this.settings.filter_criteria;
|
||||
var object_map = this.buildObjectMap();
|
||||
var settings = this.settings;
|
||||
settings.all_objects = [];
|
||||
|
||||
this.dataModel.forEach(function(dm) {
|
||||
settings.all_objects.push(dm[settings.root].id);
|
||||
for (name in filter_criteria) {
|
||||
var eval_out = eval('dm.' + filter_criteria[name][2]);
|
||||
var obj = object_map[name];
|
||||
|
||||
if (eval_out && eval_out.constructor == Array) {
|
||||
eval_out.forEach(function(x) {
|
||||
if (obj[x]) {
|
||||
obj[x].push(dm[settings.root].id);
|
||||
} else {
|
||||
obj[x] = [dm[settings.root].id];
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
if (obj[eval_out]) {
|
||||
obj[eval_out].push(dm[settings.root].id);
|
||||
} else {
|
||||
obj[eval_out] = [dm[settings.root].id];
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
settings.object_map = object_map;
|
||||
|
||||
return object_map;
|
||||
},
|
||||
|
||||
hideShow: function(id_arr) {
|
||||
var id_str = "#" + this.settings.root + '_';
|
||||
$(this.parentNode + " > *[data-fjs]").hide();
|
||||
|
||||
id_arr.forEach(function(id) {
|
||||
$(id_str + id).show();
|
||||
});
|
||||
},
|
||||
|
||||
search: function(search_config, filter_result){
|
||||
var val = $.trim($(search_config.input).val());
|
||||
|
||||
if(!val.length) return filter_result;
|
||||
|
||||
var base = this;
|
||||
var id_str = "#" + base.settings.root + '_';
|
||||
|
||||
return $.map(filter_result, function(id){
|
||||
var $item = $(id_str + id);
|
||||
if(search_config.field_selector){
|
||||
$item = $item.find(search_config.field_selector)
|
||||
}
|
||||
|
||||
if($item.text().toUpperCase().indexOf(val.toUpperCase()) >= 0){
|
||||
return id;
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
execCallBacks: function(result){
|
||||
var base = this;
|
||||
if(!base.settings.callbacks) return;
|
||||
|
||||
filtered_objects = [];
|
||||
$.each(base.dataModel, function(i, v){
|
||||
if(v && result.indexOf(v[base.settings.root].id) != -1){
|
||||
filtered_objects.push(v[base.settings.root]);
|
||||
}
|
||||
});
|
||||
|
||||
$.each(base.settings.callbacks, function(name, callback){
|
||||
callback.call(base, filtered_objects);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
window.FilterJS = FilterJS;
|
||||
|
||||
//Register html tags
|
||||
FilterJS.registerHtmlElement('div');
|
||||
FilterJS.registerHtmlElement('span');
|
||||
FilterJS.registerHtmlElement('li');
|
||||
FilterJS.registerHtmlElement('ul');
|
||||
FilterJS.registerHtmlElement('p');
|
||||
|
||||
})(this);
|
||||
|
||||
/**
|
||||
* Recursive method to collect object from json object.
|
||||
* i.e. test = [ {"deal": {"id": 1 }}, {"deal": {"id": 2}}]
|
||||
* - to collect id from the json data
|
||||
* test.filter_collect('deal').filter_collect('id')
|
||||
* this will return [1,2]
|
||||
*/
|
||||
Array.prototype.filter_collect = function(field, out_arr) {
|
||||
var out_arr = out_arr || [];
|
||||
this.forEach(function(obj) {
|
||||
if (obj.constructor == Array) {
|
||||
obj.filter_collect(field, out_arr);
|
||||
}
|
||||
else {
|
||||
out_arr.push(obj[field]);
|
||||
}
|
||||
});
|
||||
return out_arr;
|
||||
};
|
||||
|
||||
//In IE forEach mathod not define so added manually if not define.
|
||||
if(!Array.prototype.forEach) {
|
||||
Array.prototype.forEach = function(action, that) {
|
||||
for (var i = 0, n = this.length; i < n; i++)
|
||||
if (i in this) action.call(that, this[i], i, this);
|
||||
};
|
||||
}
|
||||
|
||||
//In IE indexOf method not define.
|
||||
if (!Array.prototype.indexOf) {
|
||||
Array.prototype.indexOf = function(obj, start) {
|
||||
for (var i = (start || 0), j = this.length; i < j; i++) {
|
||||
if (this[i] === obj) { return i; }
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
7
public/javascripts/jquery.svg.min.js
vendored
Normal file
7
public/javascripts/jquery.svg.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
7
public/javascripts/jquery.svgdom.min.js
vendored
Normal file
7
public/javascripts/jquery.svgdom.min.js
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
/* http://keith-wood.name/svg.html
|
||||
jQuery DOM compatibility for jQuery SVG v1.4.5.
|
||||
Written by Keith Wood (kbwood{at}iinet.com.au) April 2009.
|
||||
Dual licensed under the GPL (http://dev.jquery.com/browser/trunk/jquery/GPL-LICENSE.txt) and
|
||||
MIT (http://dev.jquery.com/browser/trunk/jquery/MIT-LICENSE.txt) licenses.
|
||||
Please attribute the author if you use it. */
|
||||
(function($){$.fn.addClass=function(e){return function(d){d=d||'';return this.each(function(){if($.svg.isSVGElem(this)){var c=this;$.each(d.split(/\s+/),function(i,a){var b=(c.className?c.className.baseVal:c.getAttribute('class'));if($.inArray(a,b.split(/\s+/))==-1){b+=(b?' ':'')+a;(c.className?c.className.baseVal=b:c.setAttribute('class',b))}})}else{e.apply($(this),[d])}})}}($.fn.addClass);$.fn.removeClass=function(e){return function(d){d=d||'';return this.each(function(){if($.svg.isSVGElem(this)){var c=this;$.each(d.split(/\s+/),function(i,a){var b=(c.className?c.className.baseVal:c.getAttribute('class'));b=$.grep(b.split(/\s+/),function(n,i){return n!=a}).join(' ');(c.className?c.className.baseVal=b:c.setAttribute('class',b))})}else{e.apply($(this),[d])}})}}($.fn.removeClass);$.fn.toggleClass=function(c){return function(a,b){return this.each(function(){if($.svg.isSVGElem(this)){if(typeof b!=='boolean'){b=!$(this).hasClass(a)}$(this)[(b?'add':'remove')+'Class'](a)}else{c.apply($(this),[a,b])}})}}($.fn.toggleClass);$.fn.hasClass=function(d){return function(b){b=b||'';var c=false;this.each(function(){if($.svg.isSVGElem(this)){var a=(this.className?this.className.baseVal:this.getAttribute('class')).split(/\s+/);c=($.inArray(b,a)>-1)}else{c=(d.apply($(this),[b]))}return!c});return c}}($.fn.hasClass);$.fn.attr=function(h){return function(b,c,d){if(typeof b==='string'&&c===undefined){var e=h.apply(this,[b]);if(e&&e.baseVal&&e.baseVal.numberOfItems!=null){c='';e=e.baseVal;if(b=='transform'){for(var i=0;i<e.numberOfItems;i++){var f=e.getItem(i);switch(f.type){case 1:c+=' matrix('+f.matrix.a+','+f.matrix.b+','+f.matrix.c+','+f.matrix.d+','+f.matrix.e+','+f.matrix.f+')';break;case 2:c+=' translate('+f.matrix.e+','+f.matrix.f+')';break;case 3:c+=' scale('+f.matrix.a+','+f.matrix.d+')';break;case 4:c+=' rotate('+f.angle+')';break;case 5:c+=' skewX('+f.angle+')';break;case 6:c+=' skewY('+f.angle+')';break}}e=c.substring(1)}else{e=e.getItem(0).valueAsString}}return(e&&e.baseVal?e.baseVal.valueAsString:e)}var g=b;if(typeof b==='string'){g={};g[b]=c}return this.each(function(){if($.svg.isSVGElem(this)){for(var n in g){var a=($.isFunction(g[n])?g[n]():g[n]);(d?this.style[n]=a:this.setAttribute(n,a))}}else{h.apply($(this),[b,c,d])}})}}($.fn.attr);$.fn.removeAttr=function(b){return function(a){return this.each(function(){if($.svg.isSVGElem(this)){(this[a]&&this[a].baseVal?this[a].baseVal.value='':this.setAttribute(a,''))}else{b.apply($(this),[a])}})}}($.fn.removeAttr);$.extend($.cssNumber,{'stopOpacity':true,'strokeMitrelimit':true,'strokeOpacity':true});if($.cssProps){$.css=function(e){return function(a,b,c){var d=(b.match(/^svg.*/)?$(a).attr($.cssProps[b]||b):'');return d||e(a,b,c)}}($.css)}function anySVG(a){for(var i=0;i<a.length;i++){if(a[i].nodeType==1&&a[i].namespaceURI==$.svg.svgNS){return true}}return false}$.expr.relative['+']=function(d){return function(a,b,c){d(a,b,c||anySVG(a))}}($.expr.relative['+']);$.expr.relative['>']=function(d){return function(a,b,c){d(a,b,c||anySVG(a))}}($.expr.relative['>']);$.expr.relative['']=function(d){return function(a,b,c){d(a,b,c||anySVG(a))}}($.expr.relative['']);$.expr.relative['~']=function(d){return function(a,b,c){d(a,b,c||anySVG(a))}}($.expr.relative['~']);$.expr.find.ID=function(d){return function(a,b,c){return($.svg.isSVGElem(b)?[b.ownerDocument.getElementById(a[1])]:d(a,b,c))}}($.expr.find.ID);var j=document.createElement('div');j.appendChild(document.createComment(''));if(j.getElementsByTagName('*').length>0){$.expr.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==='*'){var d=[];for(var i=0;c[i]||c.item(i);i++){if((c[i]||c.item(i)).nodeType===1){d.push(c[i]||c.item(i))}}c=d}return c}}$.expr.preFilter.CLASS=function(a,b,c,d,f,g){a=' '+a[1].replace(/\\/g,'')+' ';if(g){return a}for(var i=0,elem={};elem!=null;i++){elem=b[i];if(!elem){try{elem=b.item(i)}catch(e){}}if(elem){var h=(!$.svg.isSVGElem(elem)?elem.className:(elem.className?elem.className.baseVal:'')||elem.getAttribute('class'));if(f^(h&&(' '+h+' ').indexOf(a)>-1)){if(!c)d.push(elem)}else if(c){b[i]=false}}}return false};$.expr.filter.CLASS=function(a,b){var c=(!$.svg.isSVGElem(a)?a.className:(a.className?a.className.baseVal:a.getAttribute('class')));return(' '+c+' ').indexOf(b)>-1};$.expr.filter.ATTR=function(g){return function(c,d){var e=null;if($.svg.isSVGElem(c)){e=d[1];$.expr.attrHandle[e]=function(a){var b=a.getAttribute(e);return b&&b.baseVal||b}}var f=g(c,d);if(e){$.expr.attrHandle[e]=null}return f}}($.expr.filter.ATTR)})(jQuery);
|
||||
486
public/javascripts/vendors/jquery.tmpl.js
vendored
Normal file
486
public/javascripts/vendors/jquery.tmpl.js
vendored
Normal file
@@ -0,0 +1,486 @@
|
||||
/*
|
||||
* jQuery Templating Plugin
|
||||
* Copyright 2010, John Resig
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
*/
|
||||
(function( jQuery, undefined ){
|
||||
var oldManip = jQuery.fn.domManip, tmplItmAtt = "_tmplitem", htmlExpr = /^[^<]*(<[\w\W]+>)[^>]*$|\{\{\! /,
|
||||
newTmplItems = {}, wrappedItems = {}, appendToTmplItems, topTmplItem = { key: 0, data: {} }, itemKey = 0, cloneIndex = 0, stack = [];
|
||||
|
||||
function newTmplItem( options, parentItem, fn, data ) {
|
||||
// Returns a template item data structure for a new rendered instance of a template (a 'template item').
|
||||
// The content field is a hierarchical array of strings and nested items (to be
|
||||
// removed and replaced by nodes field of dom elements, once inserted in DOM).
|
||||
var newItem = {
|
||||
data: data || (parentItem ? parentItem.data : {}),
|
||||
_wrap: parentItem ? parentItem._wrap : null,
|
||||
tmpl: null,
|
||||
parent: parentItem || null,
|
||||
nodes: [],
|
||||
calls: tiCalls,
|
||||
nest: tiNest,
|
||||
wrap: tiWrap,
|
||||
html: tiHtml,
|
||||
update: tiUpdate
|
||||
};
|
||||
if ( options ) {
|
||||
jQuery.extend( newItem, options, { nodes: [], parent: parentItem } );
|
||||
}
|
||||
if ( fn ) {
|
||||
// Build the hierarchical content to be used during insertion into DOM
|
||||
newItem.tmpl = fn;
|
||||
newItem._ctnt = newItem._ctnt || newItem.tmpl( jQuery, newItem );
|
||||
newItem.key = ++itemKey;
|
||||
// Keep track of new template item, until it is stored as jQuery Data on DOM element
|
||||
(stack.length ? wrappedItems : newTmplItems)[itemKey] = newItem;
|
||||
}
|
||||
return newItem;
|
||||
}
|
||||
|
||||
// Override appendTo etc., in order to provide support for targeting multiple elements. (This code would disappear if integrated in jquery core).
|
||||
jQuery.each({
|
||||
appendTo: "append",
|
||||
prependTo: "prepend",
|
||||
insertBefore: "before",
|
||||
insertAfter: "after",
|
||||
replaceAll: "replaceWith"
|
||||
}, function( name, original ) {
|
||||
jQuery.fn[ name ] = function( selector ) {
|
||||
var ret = [], insert = jQuery( selector ), elems, i, l, tmplItems,
|
||||
parent = this.length === 1 && this[0].parentNode;
|
||||
|
||||
appendToTmplItems = newTmplItems || {};
|
||||
if ( parent && parent.nodeType === 11 && parent.childNodes.length === 1 && insert.length === 1 ) {
|
||||
insert[ original ]( this[0] );
|
||||
ret = this;
|
||||
} else {
|
||||
for ( i = 0, l = insert.length; i < l; i++ ) {
|
||||
cloneIndex = i;
|
||||
elems = (i > 0 ? this.clone(true) : this).get();
|
||||
jQuery.fn[ original ].apply( jQuery(insert[i]), elems );
|
||||
ret = ret.concat( elems );
|
||||
}
|
||||
cloneIndex = 0;
|
||||
ret = this.pushStack( ret, name, insert.selector );
|
||||
}
|
||||
tmplItems = appendToTmplItems;
|
||||
appendToTmplItems = null;
|
||||
jQuery.tmpl.complete( tmplItems );
|
||||
return ret;
|
||||
};
|
||||
});
|
||||
|
||||
jQuery.fn.extend({
|
||||
// Use first wrapped element as template markup.
|
||||
// Return wrapped set of template items, obtained by rendering template against data.
|
||||
tmpl: function( data, options, parentItem ) {
|
||||
return jQuery.tmpl( this[0], data, options, parentItem );
|
||||
},
|
||||
|
||||
// Find which rendered template item the first wrapped DOM element belongs to
|
||||
tmplItem: function() {
|
||||
return jQuery.tmplItem( this[0] );
|
||||
},
|
||||
|
||||
// Consider the first wrapped element as a template declaration, and get the compiled template or store it as a named template.
|
||||
template: function( name ) {
|
||||
return jQuery.template( name, this[0] );
|
||||
},
|
||||
|
||||
domManip: function( args, table, callback, options ) {
|
||||
// This appears to be a bug in the appendTo, etc. implementation
|
||||
// it should be doing .call() instead of .apply(). See #6227
|
||||
if ( args[0] && args[0].nodeType ) {
|
||||
var dmArgs = jQuery.makeArray( arguments ), argsLength = args.length, i = 0, tmplItem;
|
||||
while ( i < argsLength && !(tmplItem = jQuery.data( args[i++], "tmplItem" ))) {}
|
||||
if ( argsLength > 1 ) {
|
||||
dmArgs[0] = [jQuery.makeArray( args )];
|
||||
}
|
||||
if ( tmplItem && cloneIndex ) {
|
||||
dmArgs[2] = function( fragClone ) {
|
||||
// Handler called by oldManip when rendered template has been inserted into DOM.
|
||||
jQuery.tmpl.afterManip( this, fragClone, callback );
|
||||
};
|
||||
}
|
||||
oldManip.apply( this, dmArgs );
|
||||
} else {
|
||||
oldManip.apply( this, arguments );
|
||||
}
|
||||
cloneIndex = 0;
|
||||
if ( !appendToTmplItems ) {
|
||||
jQuery.tmpl.complete( newTmplItems );
|
||||
}
|
||||
return this;
|
||||
}
|
||||
});
|
||||
|
||||
jQuery.extend({
|
||||
// Return wrapped set of template items, obtained by rendering template against data.
|
||||
tmpl: function( tmpl, data, options, parentItem ) {
|
||||
var ret, topLevel = !parentItem;
|
||||
if ( topLevel ) {
|
||||
// This is a top-level tmpl call (not from a nested template using {{tmpl}})
|
||||
parentItem = topTmplItem;
|
||||
tmpl = jQuery.template[tmpl] || jQuery.template( null, tmpl );
|
||||
wrappedItems = {}; // Any wrapped items will be rebuilt, since this is top level
|
||||
} else if ( !tmpl ) {
|
||||
// The template item is already associated with DOM - this is a refresh.
|
||||
// Re-evaluate rendered template for the parentItem
|
||||
tmpl = parentItem.tmpl;
|
||||
newTmplItems[parentItem.key] = parentItem;
|
||||
parentItem.nodes = [];
|
||||
if ( parentItem.wrapped ) {
|
||||
updateWrapped( parentItem, parentItem.wrapped );
|
||||
}
|
||||
// Rebuild, without creating a new template item
|
||||
return jQuery( build( parentItem, null, parentItem.tmpl( jQuery, parentItem ) ));
|
||||
}
|
||||
if ( !tmpl ) {
|
||||
return []; // Could throw...
|
||||
}
|
||||
if ( typeof data === "function" ) {
|
||||
data = data.call( parentItem || {} );
|
||||
}
|
||||
if ( options && options.wrapped ) {
|
||||
updateWrapped( options, options.wrapped );
|
||||
}
|
||||
ret = jQuery.isArray( data ) ?
|
||||
jQuery.map( data, function( dataItem ) {
|
||||
return dataItem ? newTmplItem( options, parentItem, tmpl, dataItem ) : null;
|
||||
}) :
|
||||
[ newTmplItem( options, parentItem, tmpl, data ) ];
|
||||
return topLevel ? jQuery( build( parentItem, null, ret ) ) : ret;
|
||||
},
|
||||
|
||||
// Return rendered template item for an element.
|
||||
tmplItem: function( elem ) {
|
||||
var tmplItem;
|
||||
if ( elem instanceof jQuery ) {
|
||||
elem = elem[0];
|
||||
}
|
||||
while ( elem && elem.nodeType === 1 && !(tmplItem = jQuery.data( elem, "tmplItem" )) && (elem = elem.parentNode) ) {}
|
||||
return tmplItem || topTmplItem;
|
||||
},
|
||||
|
||||
// Set:
|
||||
// Use $.template( name, tmpl ) to cache a named template,
|
||||
// where tmpl is a template string, a script element or a jQuery instance wrapping a script element, etc.
|
||||
// Use $( "selector" ).template( name ) to provide access by name to a script block template declaration.
|
||||
|
||||
// Get:
|
||||
// Use $.template( name ) to access a cached template.
|
||||
// Also $( selectorToScriptBlock ).template(), or $.template( null, templateString )
|
||||
// will return the compiled template, without adding a name reference.
|
||||
// If templateString includes at least one HTML tag, $.template( templateString ) is equivalent
|
||||
// to $.template( null, templateString )
|
||||
template: function( name, tmpl ) {
|
||||
if (tmpl) {
|
||||
// Compile template and associate with name
|
||||
if ( typeof tmpl === "string" ) {
|
||||
// This is an HTML string being passed directly in.
|
||||
tmpl = buildTmplFn( tmpl )
|
||||
} else if ( tmpl instanceof jQuery ) {
|
||||
tmpl = tmpl[0] || {};
|
||||
}
|
||||
if ( tmpl.nodeType ) {
|
||||
// If this is a template block, use cached copy, or generate tmpl function and cache.
|
||||
tmpl = jQuery.data( tmpl, "tmpl" ) || jQuery.data( tmpl, "tmpl", buildTmplFn( tmpl.innerHTML ));
|
||||
}
|
||||
return typeof name === "string" ? (jQuery.template[name] = tmpl) : tmpl;
|
||||
}
|
||||
// Return named compiled template
|
||||
return name ? (typeof name !== "string" ? jQuery.template( null, name ):
|
||||
(jQuery.template[name] ||
|
||||
// If not in map, treat as a selector. (If integrated with core, use quickExpr.exec)
|
||||
jQuery.template( null, htmlExpr.test( name ) ? name : jQuery( name )))) : null;
|
||||
},
|
||||
|
||||
encode: function( text ) {
|
||||
// Do HTML encoding replacing < > & and ' and " by corresponding entities.
|
||||
return ("" + text).split("<").join("<").split(">").join(">").split('"').join(""").split("'").join("'");
|
||||
}
|
||||
});
|
||||
|
||||
jQuery.extend( jQuery.tmpl, {
|
||||
tag: {
|
||||
"tmpl": {
|
||||
_default: { $2: "null" },
|
||||
open: "if($notnull_1){_=_.concat($item.nest($1,$2));}"
|
||||
// tmpl target parameter can be of type function, so use $1, not $1a (so not auto detection of functions)
|
||||
// This means that {{tmpl foo}} treats foo as a template (which IS a function).
|
||||
// Explicit parens can be used if foo is a function that returns a template: {{tmpl foo()}}.
|
||||
},
|
||||
"wrap": {
|
||||
_default: { $2: "null" },
|
||||
open: "$item.calls(_,$1,$2);_=[];",
|
||||
close: "call=$item.calls();_=call._.concat($item.wrap(call,_));"
|
||||
},
|
||||
"each": {
|
||||
_default: { $2: "$index, $value" },
|
||||
open: "if($notnull_1){$.each($1a,function($2){with(this){",
|
||||
close: "}});}"
|
||||
},
|
||||
"if": {
|
||||
open: "if(($notnull_1) && $1a){",
|
||||
close: "}"
|
||||
},
|
||||
"else": {
|
||||
_default: { $1: "true" },
|
||||
open: "}else if(($notnull_1) && $1a){"
|
||||
},
|
||||
"html": {
|
||||
// Unecoded expression evaluation.
|
||||
open: "if($notnull_1){_.push($1a);}"
|
||||
},
|
||||
"=": {
|
||||
// Encoded expression evaluation. Abbreviated form is ${}.
|
||||
_default: { $1: "$data" },
|
||||
open: "if($notnull_1){_.push($.encode($1a));}"
|
||||
},
|
||||
"!": {
|
||||
// Comment tag. Skipped by parser
|
||||
open: ""
|
||||
}
|
||||
},
|
||||
|
||||
// This stub can be overridden, e.g. in jquery.tmplPlus for providing rendered events
|
||||
complete: function( items ) {
|
||||
newTmplItems = {};
|
||||
},
|
||||
|
||||
// Call this from code which overrides domManip, or equivalent
|
||||
// Manage cloning/storing template items etc.
|
||||
afterManip: function afterManip( elem, fragClone, callback ) {
|
||||
// Provides cloned fragment ready for fixup prior to and after insertion into DOM
|
||||
var content = fragClone.nodeType === 11 ?
|
||||
jQuery.makeArray(fragClone.childNodes) :
|
||||
fragClone.nodeType === 1 ? [fragClone] : [];
|
||||
|
||||
// Return fragment to original caller (e.g. append) for DOM insertion
|
||||
callback.call( elem, fragClone );
|
||||
|
||||
// Fragment has been inserted:- Add inserted nodes to tmplItem data structure. Replace inserted element annotations by jQuery.data.
|
||||
storeTmplItems( content );
|
||||
cloneIndex++;
|
||||
}
|
||||
});
|
||||
|
||||
//========================== Private helper functions, used by code above ==========================
|
||||
|
||||
function build( tmplItem, nested, content ) {
|
||||
// Convert hierarchical content into flat string array
|
||||
// and finally return array of fragments ready for DOM insertion
|
||||
var frag, ret = content ? jQuery.map( content, function( item ) {
|
||||
return (typeof item === "string") ?
|
||||
// Insert template item annotations, to be converted to jQuery.data( "tmplItem" ) when elems are inserted into DOM.
|
||||
(tmplItem.key ? item.replace( /(<\w+)(?=[\s>])(?![^>]*_tmplitem)([^>]*)/g, "$1 " + tmplItmAtt + "=\"" + tmplItem.key + "\" $2" ) : item) :
|
||||
// This is a child template item. Build nested template.
|
||||
build( item, tmplItem, item._ctnt );
|
||||
}) :
|
||||
// If content is not defined, insert tmplItem directly. Not a template item. May be a string, or a string array, e.g. from {{html $item.html()}}.
|
||||
tmplItem;
|
||||
if ( nested ) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
// top-level template
|
||||
ret = ret.join("");
|
||||
|
||||
// Support templates which have initial or final text nodes, or consist only of text
|
||||
// Also support HTML entities within the HTML markup.
|
||||
ret.replace( /^\s*([^<\s][^<]*)?(<[\w\W]+>)([^>]*[^>\s])?\s*$/, function( all, before, middle, after) {
|
||||
frag = jQuery( middle ).get();
|
||||
|
||||
storeTmplItems( frag );
|
||||
if ( before ) {
|
||||
frag = unencode( before ).concat(frag);
|
||||
}
|
||||
if ( after ) {
|
||||
frag = frag.concat(unencode( after ));
|
||||
}
|
||||
});
|
||||
return frag ? frag : unencode( ret );
|
||||
}
|
||||
|
||||
function unencode( text ) {
|
||||
// Use createElement, since createTextNode will not render HTML entities correctly
|
||||
var el = document.createElement( "div" );
|
||||
el.innerHTML = text;
|
||||
return jQuery.makeArray(el.childNodes);
|
||||
}
|
||||
|
||||
// Generate a reusable function that will serve to render a template against data
|
||||
function buildTmplFn( markup ) {
|
||||
return new Function("jQuery","$item",
|
||||
"var $=jQuery,call,_=[],$data=$item.data;" +
|
||||
|
||||
// Introduce the data as local variables using with(){}
|
||||
"with($data){_.push('" +
|
||||
|
||||
// Convert the template into pure JavaScript
|
||||
jQuery.trim(markup)
|
||||
.replace( /([\\'])/g, "\\$1" )
|
||||
.replace( /[\r\t\n]/g, " " )
|
||||
.replace( /\$\{([^\}]*)\}/g, "{{= $1}}" )
|
||||
.replace( /\{\{(\/?)(\w+|.)(?:\(((?:[^\}]|\}(?!\}))*?)?\))?(?:\s+(.*?)?)?(\(((?:[^\}]|\}(?!\}))*?)\))?\s*\}\}/g,
|
||||
function( all, slash, type, fnargs, target, parens, args ) {
|
||||
var tag = jQuery.tmpl.tag[ type ], def, expr, exprAutoFnDetect;
|
||||
if ( !tag ) {
|
||||
throw "Template command not found: " + type;
|
||||
}
|
||||
def = tag._default || [];
|
||||
if ( parens && !/\w$/.test(target)) {
|
||||
target += parens;
|
||||
parens = "";
|
||||
}
|
||||
if ( target ) {
|
||||
target = unescape( target );
|
||||
args = args ? ("," + unescape( args ) + ")") : (parens ? ")" : "");
|
||||
// Support for target being things like a.toLowerCase();
|
||||
// In that case don't call with template item as 'this' pointer. Just evaluate...
|
||||
expr = parens ? (target.indexOf(".") > -1 ? target + parens : ("(" + target + ").call($item" + args)) : target;
|
||||
exprAutoFnDetect = parens ? expr : "(typeof(" + target + ")==='function'?(" + target + ").call($item):(" + target + "))";
|
||||
} else {
|
||||
exprAutoFnDetect = expr = def.$1 || "null";
|
||||
}
|
||||
fnargs = unescape( fnargs );
|
||||
return "');" +
|
||||
tag[ slash ? "close" : "open" ]
|
||||
.split( "$notnull_1" ).join( target ? "typeof(" + target + ")!=='undefined' && (" + target + ")!=null" : "true" )
|
||||
.split( "$1a" ).join( exprAutoFnDetect )
|
||||
.split( "$1" ).join( expr )
|
||||
.split( "$2" ).join( fnargs ?
|
||||
fnargs.replace( /\s*([^\(]+)\s*(\((.*?)\))?/g, function( all, name, parens, params ) {
|
||||
params = params ? ("," + params + ")") : (parens ? ")" : "");
|
||||
return params ? ("(" + name + ").call($item" + params) : all;
|
||||
})
|
||||
: (def.$2||"")
|
||||
) +
|
||||
"_.push('";
|
||||
}) +
|
||||
"');}return _;"
|
||||
);
|
||||
}
|
||||
function updateWrapped( options, wrapped ) {
|
||||
// Build the wrapped content.
|
||||
options._wrap = build( options, true,
|
||||
// Suport imperative scenario in which options.wrapped can be set to a selector or an HTML string.
|
||||
jQuery.isArray( wrapped ) ? wrapped : [htmlExpr.test( wrapped ) ? wrapped : jQuery( wrapped ).html()]
|
||||
).join("");
|
||||
}
|
||||
|
||||
function unescape( args ) {
|
||||
return args ? args.replace( /\\'/g, "'").replace(/\\\\/g, "\\" ) : null;
|
||||
}
|
||||
function outerHtml( elem ) {
|
||||
var div = document.createElement("div");
|
||||
div.appendChild( elem.cloneNode(true) );
|
||||
return div.innerHTML;
|
||||
}
|
||||
|
||||
// Store template items in jQuery.data(), ensuring a unique tmplItem data data structure for each rendered template instance.
|
||||
function storeTmplItems( content ) {
|
||||
var keySuffix = "_" + cloneIndex, elem, elems, newClonedItems = {}, i, l, m;
|
||||
for ( i = 0, l = content.length; i < l; i++ ) {
|
||||
if ( (elem = content[i]).nodeType !== 1 ) {
|
||||
continue;
|
||||
}
|
||||
elems = elem.getElementsByTagName("*");
|
||||
for ( m = elems.length - 1; m >= 0; m-- ) {
|
||||
processItemKey( elems[m] );
|
||||
}
|
||||
processItemKey( elem );
|
||||
}
|
||||
function processItemKey( el ) {
|
||||
var pntKey, pntNode = el, pntItem, tmplItem, key;
|
||||
// Ensure that each rendered template inserted into the DOM has its own template item,
|
||||
if ( (key = el.getAttribute( tmplItmAtt ))) {
|
||||
while ( pntNode.parentNode && (pntNode = pntNode.parentNode).nodeType === 1 && !(pntKey = pntNode.getAttribute( tmplItmAtt ))) { }
|
||||
if ( pntKey !== key ) {
|
||||
// The next ancestor with a _tmplitem expando is on a different key than this one.
|
||||
// So this is a top-level element within this template item
|
||||
// Set pntNode to the key of the parentNode, or to 0 if pntNode.parentNode is null, or pntNode is a fragment.
|
||||
pntNode = pntNode.parentNode ? (pntNode.nodeType === 11 ? 0 : (pntNode.getAttribute( tmplItmAtt ) || 0)) : 0;
|
||||
if ( !(tmplItem = newTmplItems[key]) ) {
|
||||
// The item is for wrapped content, and was copied from the temporary parent wrappedItem.
|
||||
tmplItem = wrappedItems[key];
|
||||
tmplItem = newTmplItem( tmplItem, newTmplItems[pntNode]||wrappedItems[pntNode], null, true );
|
||||
tmplItem.key = ++itemKey;
|
||||
newTmplItems[itemKey] = tmplItem;
|
||||
}
|
||||
if ( cloneIndex ) {
|
||||
cloneTmplItem( key );
|
||||
}
|
||||
}
|
||||
el.removeAttribute( tmplItmAtt );
|
||||
} else if ( cloneIndex && (tmplItem = jQuery.data( el, "tmplItem" )) ) {
|
||||
// This was a rendered element, cloned during append or appendTo etc.
|
||||
// TmplItem stored in jQuery data has already been cloned in cloneCopyEvent. We must replace it with a fresh cloned tmplItem.
|
||||
cloneTmplItem( tmplItem.key );
|
||||
newTmplItems[tmplItem.key] = tmplItem;
|
||||
pntNode = jQuery.data( el.parentNode, "tmplItem" );
|
||||
pntNode = pntNode ? pntNode.key : 0;
|
||||
}
|
||||
if ( tmplItem ) {
|
||||
pntItem = tmplItem;
|
||||
// Find the template item of the parent element.
|
||||
// (Using !=, not !==, since pntItem.key is number, and pntNode may be a string)
|
||||
while ( pntItem && pntItem.key != pntNode ) {
|
||||
// Add this element as a top-level node for this rendered template item, as well as for any
|
||||
// ancestor items between this item and the item of its parent element
|
||||
pntItem.nodes.push( el );
|
||||
pntItem = pntItem.parent;
|
||||
}
|
||||
// Delete content built during rendering - reduce API surface area and memory use, and avoid exposing of stale data after rendering...
|
||||
delete tmplItem._ctnt;
|
||||
delete tmplItem._wrap;
|
||||
// Store template item as jQuery data on the element
|
||||
jQuery.data( el, "tmplItem", tmplItem );
|
||||
}
|
||||
function cloneTmplItem( key ) {
|
||||
key = key + keySuffix;
|
||||
tmplItem = newClonedItems[key] =
|
||||
(newClonedItems[key] || newTmplItem( tmplItem, newTmplItems[tmplItem.parent.key + keySuffix] || tmplItem.parent, null, true ));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//---- Helper functions for template item ----
|
||||
|
||||
function tiCalls( content, tmpl, data, options ) {
|
||||
if ( !content ) {
|
||||
return stack.pop();
|
||||
}
|
||||
stack.push({ _: content, tmpl: tmpl, item:this, data: data, options: options });
|
||||
}
|
||||
|
||||
function tiNest( tmpl, data, options ) {
|
||||
// nested template, using {{tmpl}} tag
|
||||
return jQuery.tmpl( jQuery.template( tmpl ), data, options, this );
|
||||
}
|
||||
|
||||
function tiWrap( call, wrapped ) {
|
||||
// nested template, using {{wrap}} tag
|
||||
var options = call.options || {};
|
||||
options.wrapped = wrapped;
|
||||
// Apply the template, which may incorporate wrapped content,
|
||||
return jQuery.tmpl( jQuery.template( call.tmpl ), call.data, options, call.item );
|
||||
}
|
||||
|
||||
function tiHtml( filter, textOnly ) {
|
||||
var wrapped = this._wrap;
|
||||
return jQuery.map(
|
||||
jQuery( jQuery.isArray( wrapped ) ? wrapped.join("") : wrapped ).filter( filter || "*" ),
|
||||
function(e) {
|
||||
return textOnly ?
|
||||
e.innerText || e.textContent :
|
||||
e.outerHTML || outerHtml(e);
|
||||
});
|
||||
}
|
||||
|
||||
function tiUpdate() {
|
||||
var coll = this.nodes;
|
||||
jQuery.tmpl( null, null, null, this).insertBefore( coll[0] );
|
||||
jQuery( coll ).remove();
|
||||
}
|
||||
})( jQuery );
|
||||
325
public/javascripts/vendors/mustache.js
vendored
Normal file
325
public/javascripts/vendors/mustache.js
vendored
Normal file
@@ -0,0 +1,325 @@
|
||||
/*
|
||||
mustache.js — Logic-less templates in JavaScript
|
||||
|
||||
See http://mustache.github.com/ for more info.
|
||||
*/
|
||||
|
||||
var Mustache = function() {
|
||||
var Renderer = function() {};
|
||||
|
||||
Renderer.prototype = {
|
||||
otag: "{{",
|
||||
ctag: "}}",
|
||||
pragmas: {},
|
||||
buffer: [],
|
||||
pragmas_implemented: {
|
||||
"IMPLICIT-ITERATOR": true
|
||||
},
|
||||
context: {},
|
||||
|
||||
render: function(template, context, partials, in_recursion) {
|
||||
// reset buffer & set context
|
||||
if(!in_recursion) {
|
||||
this.context = context;
|
||||
this.buffer = []; // TODO: make this non-lazy
|
||||
}
|
||||
|
||||
// fail fast
|
||||
if(!this.includes("", template)) {
|
||||
if(in_recursion) {
|
||||
return template;
|
||||
} else {
|
||||
this.send(template);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
template = this.render_pragmas(template);
|
||||
var html = this.render_section(template, context, partials);
|
||||
if(in_recursion) {
|
||||
return this.render_tags(html, context, partials, in_recursion);
|
||||
}
|
||||
|
||||
this.render_tags(html, context, partials, in_recursion);
|
||||
},
|
||||
|
||||
/*
|
||||
Sends parsed lines
|
||||
*/
|
||||
send: function(line) {
|
||||
if(line !== "") {
|
||||
this.buffer.push(line);
|
||||
}
|
||||
},
|
||||
|
||||
/*
|
||||
Looks for %PRAGMAS
|
||||
*/
|
||||
render_pragmas: function(template) {
|
||||
// no pragmas
|
||||
if(!this.includes("%", template)) {
|
||||
return template;
|
||||
}
|
||||
|
||||
var that = this;
|
||||
var regex = new RegExp(this.otag + "%([\\w-]+) ?([\\w]+=[\\w]+)?" +
|
||||
this.ctag, "g");
|
||||
return template.replace(regex, function(match, pragma, options) {
|
||||
if(!that.pragmas_implemented[pragma]) {
|
||||
throw({message:
|
||||
"This implementation of mustache doesn't understand the '" +
|
||||
pragma + "' pragma"});
|
||||
}
|
||||
that.pragmas[pragma] = {};
|
||||
if(options) {
|
||||
var opts = options.split("=");
|
||||
that.pragmas[pragma][opts[0]] = opts[1];
|
||||
}
|
||||
return "";
|
||||
// ignore unknown pragmas silently
|
||||
});
|
||||
},
|
||||
|
||||
/*
|
||||
Tries to find a partial in the curent scope and render it
|
||||
*/
|
||||
render_partial: function(name, context, partials) {
|
||||
name = this.trim(name);
|
||||
if(!partials || partials[name] === undefined) {
|
||||
throw({message: "unknown_partial '" + name + "'"});
|
||||
}
|
||||
if(typeof(context[name]) != "object") {
|
||||
return this.render(partials[name], context, partials, true);
|
||||
}
|
||||
return this.render(partials[name], context[name], partials, true);
|
||||
},
|
||||
|
||||
/*
|
||||
Renders inverted (^) and normal (#) sections
|
||||
*/
|
||||
render_section: function(template, context, partials) {
|
||||
if(!this.includes("#", template) && !this.includes("^", template)) {
|
||||
return template;
|
||||
}
|
||||
|
||||
var that = this;
|
||||
// CSW - Added "+?" so it finds the tighest bound, not the widest
|
||||
var regex = new RegExp(this.otag + "(\\^|\\#)\\s*(.+)\\s*" + this.ctag +
|
||||
"\n*([\\s\\S]+?)" + this.otag + "\\/\\s*\\2\\s*" + this.ctag +
|
||||
"\\s*", "mg");
|
||||
|
||||
// for each {{#foo}}{{/foo}} section do...
|
||||
return template.replace(regex, function(match, type, name, content) {
|
||||
var value = that.find(name, context);
|
||||
if(type == "^") { // inverted section
|
||||
if(!value || that.is_array(value) && value.length === 0) {
|
||||
// false or empty list, render it
|
||||
return that.render(content, context, partials, true);
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
} else if(type == "#") { // normal section
|
||||
if(that.is_array(value)) { // Enumerable, Let's loop!
|
||||
return that.map(value, function(row) {
|
||||
return that.render(content, that.create_context(row),
|
||||
partials, true);
|
||||
}).join("");
|
||||
} else if(that.is_object(value)) { // Object, Use it as subcontext!
|
||||
return that.render(content, that.create_context(value),
|
||||
partials, true);
|
||||
} else if(typeof value === "function") {
|
||||
// higher order section
|
||||
return value.call(context, content, function(text) {
|
||||
return that.render(text, context, partials, true);
|
||||
});
|
||||
} else if(value) { // boolean section
|
||||
return that.render(content, context, partials, true);
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/*
|
||||
Replace {{foo}} and friends with values from our view
|
||||
*/
|
||||
render_tags: function(template, context, partials, in_recursion) {
|
||||
// tit for tat
|
||||
var that = this;
|
||||
|
||||
var new_regex = function() {
|
||||
return new RegExp(that.otag + "(=|!|>|\\{|%)?([^\\/#\\^]+?)\\1?" +
|
||||
that.ctag + "+", "g");
|
||||
};
|
||||
|
||||
var regex = new_regex();
|
||||
var tag_replace_callback = function(match, operator, name) {
|
||||
switch(operator) {
|
||||
case "!": // ignore comments
|
||||
return "";
|
||||
case "=": // set new delimiters, rebuild the replace regexp
|
||||
that.set_delimiters(name);
|
||||
regex = new_regex();
|
||||
return "";
|
||||
case ">": // render partial
|
||||
return that.render_partial(name, context, partials);
|
||||
case "{": // the triple mustache is unescaped
|
||||
return that.find(name, context);
|
||||
default: // escape the value
|
||||
return that.escape(that.find(name, context));
|
||||
}
|
||||
};
|
||||
var lines = template.split("\n");
|
||||
for(var i = 0; i < lines.length; i++) {
|
||||
lines[i] = lines[i].replace(regex, tag_replace_callback, this);
|
||||
if(!in_recursion) {
|
||||
this.send(lines[i]);
|
||||
}
|
||||
}
|
||||
|
||||
if(in_recursion) {
|
||||
return lines.join("\n");
|
||||
}
|
||||
},
|
||||
|
||||
set_delimiters: function(delimiters) {
|
||||
var dels = delimiters.split(" ");
|
||||
this.otag = this.escape_regex(dels[0]);
|
||||
this.ctag = this.escape_regex(dels[1]);
|
||||
},
|
||||
|
||||
escape_regex: function(text) {
|
||||
// thank you Simon Willison
|
||||
if(!arguments.callee.sRE) {
|
||||
var specials = [
|
||||
'/', '.', '*', '+', '?', '|',
|
||||
'(', ')', '[', ']', '{', '}', '\\'
|
||||
];
|
||||
arguments.callee.sRE = new RegExp(
|
||||
'(\\' + specials.join('|\\') + ')', 'g'
|
||||
);
|
||||
}
|
||||
return text.replace(arguments.callee.sRE, '\\$1');
|
||||
},
|
||||
|
||||
/*
|
||||
find `name` in current `context`. That is find me a value
|
||||
from the view object
|
||||
*/
|
||||
find: function(name, context) {
|
||||
name = this.trim(name);
|
||||
|
||||
// Checks whether a value is thruthy or false or 0
|
||||
function is_kinda_truthy(bool) {
|
||||
return bool === false || bool === 0 || bool;
|
||||
}
|
||||
|
||||
var value;
|
||||
if(is_kinda_truthy(context[name])) {
|
||||
value = context[name];
|
||||
} else if(is_kinda_truthy(this.context[name])) {
|
||||
value = this.context[name];
|
||||
}
|
||||
|
||||
if(typeof value === "function") {
|
||||
return value.apply(context);
|
||||
}
|
||||
if(value !== undefined) {
|
||||
return value;
|
||||
}
|
||||
// silently ignore unkown variables
|
||||
return "";
|
||||
},
|
||||
|
||||
// Utility methods
|
||||
|
||||
/* includes tag */
|
||||
includes: function(needle, haystack) {
|
||||
return haystack.indexOf(this.otag + needle) != -1;
|
||||
},
|
||||
|
||||
/*
|
||||
Does away with nasty characters
|
||||
*/
|
||||
escape: function(s) {
|
||||
s = String(s === null ? "" : s);
|
||||
return s.replace(/&(?!\w+;)|["'<>\\]/g, function(s) {
|
||||
switch(s) {
|
||||
case "&": return "&";
|
||||
case "\\": return "\\\\";
|
||||
case '"': return '"';
|
||||
case "'": return ''';
|
||||
case "<": return "<";
|
||||
case ">": return ">";
|
||||
default: return s;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// by @langalex, support for arrays of strings
|
||||
create_context: function(_context) {
|
||||
if(this.is_object(_context)) {
|
||||
return _context;
|
||||
} else {
|
||||
var iterator = ".";
|
||||
if(this.pragmas["IMPLICIT-ITERATOR"]) {
|
||||
iterator = this.pragmas["IMPLICIT-ITERATOR"].iterator;
|
||||
}
|
||||
var ctx = {};
|
||||
ctx[iterator] = _context;
|
||||
return ctx;
|
||||
}
|
||||
},
|
||||
|
||||
is_object: function(a) {
|
||||
return a && typeof a == "object";
|
||||
},
|
||||
|
||||
is_array: function(a) {
|
||||
return Object.prototype.toString.call(a) === '[object Array]';
|
||||
},
|
||||
|
||||
/*
|
||||
Gets rid of leading and trailing whitespace
|
||||
*/
|
||||
trim: function(s) {
|
||||
return s.replace(/^\s*|\s*$/g, "");
|
||||
},
|
||||
|
||||
/*
|
||||
Why, why, why? Because IE. Cry, cry cry.
|
||||
*/
|
||||
map: function(array, fn) {
|
||||
if (typeof array.map == "function") {
|
||||
return array.map(fn);
|
||||
} else {
|
||||
var r = [];
|
||||
var l = array.length;
|
||||
for(var i = 0; i < l; i++) {
|
||||
r.push(fn(array[i]));
|
||||
}
|
||||
return r;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
return({
|
||||
name: "mustache.js",
|
||||
version: "0.3.1-dev",
|
||||
|
||||
/*
|
||||
Turns a template and view into HTML
|
||||
*/
|
||||
to_html: function(template, view, partials, send_fun) {
|
||||
var renderer = new Renderer();
|
||||
if(send_fun) {
|
||||
renderer.send = send_fun;
|
||||
}
|
||||
renderer.render(template, view, partials);
|
||||
if(!send_fun) {
|
||||
return renderer.buffer.join("\n");
|
||||
}
|
||||
}
|
||||
});
|
||||
}();
|
||||
11
routes/404.js
Normal file
11
routes/404.js
Normal file
@@ -0,0 +1,11 @@
|
||||
//404 catch all
|
||||
|
||||
module.exports = function(app) {
|
||||
|
||||
//The 404 Route (ALWAYS Keep this as the last route)
|
||||
app.get('*', function(req, res){
|
||||
console.log("oook 404 " + req );
|
||||
res.send('Not Found', 404);
|
||||
});
|
||||
|
||||
};
|
||||
26
views/users/sidebar.jade
Normal file
26
views/users/sidebar.jade
Normal file
@@ -0,0 +1,26 @@
|
||||
h2= user.name
|
||||
div#userphoto
|
||||
User Pictures
|
||||
|
||||
- if (session.user)
|
||||
- if (session.user.name === requested)
|
||||
h2 Private View
|
||||
div
|
||||
button.recent-link(value= encodeURIComponent(session.user.name) ) Recent workouts
|
||||
div
|
||||
button.newex-link(value="/workouts/new") Create new workout
|
||||
div
|
||||
button Placeholder1
|
||||
div
|
||||
button Palceholder2
|
||||
- else
|
||||
h2 Public View
|
||||
|
||||
|
||||
|
||||
|
||||
- if (session.user)
|
||||
- if (session.user.is_admin === true)
|
||||
div
|
||||
h3 You're an Admin
|
||||
button.map-link(value="/admin") Goto Admin Page
|
||||
22
views/workouts/filters.jade
Normal file
22
views/workouts/filters.jade
Normal file
@@ -0,0 +1,22 @@
|
||||
h1 New workout
|
||||
|
||||
div#filters
|
||||
h3 Filters
|
||||
label Search
|
||||
input#searchbox (type="text", placeholder="Type here....")
|
||||
label Free Weights
|
||||
input.filter(type="checkbox", checked=true, value="Free Weights")
|
||||
label Bodyweight
|
||||
input.filter(type="checkbox", checked=true, value="Bodyweight")
|
||||
label Exercise Machines
|
||||
input.filter(type="checkbox", checked=true, value='Exercise Machine')
|
||||
label Kettlebells
|
||||
input.filter(type="checkbox", checked=true, value='Kettlebells')
|
||||
label Cardio
|
||||
input.filter(type="checkbox", checked=true, value='Cardio')
|
||||
div
|
||||
object(data='/images/BlankBody.svg', id='BlankBodyFilter', type='image/svg+xml')
|
||||
|
||||
h3 Exercises (dynamically loaded from database)
|
||||
ul#exerciselist
|
||||
li Unpopulated
|
||||
Reference in New Issue
Block a user