template redesign

This commit is contained in:
Jana Deutschländer 2017-01-02 08:58:59 +01:00
commit f414dd9577
31 changed files with 1150 additions and 74 deletions

4
.gitignore vendored Normal file
View file

@ -0,0 +1,4 @@
._COPYING
._.DS_Store
/._*
._*

View file

@ -4,3 +4,12 @@
* @author Jana Deutschlaender <deutschlaender@cosmocode.de>
*/
.content .row > .col-xs-12{
box-shadow: __box_shadow__;
}

View file

@ -0,0 +1,116 @@
/**
* This file provides the design styles for the direct / menu jump links.
*
* @author Jana Deutschlaender <deutschlaender@cosmocode.de>
*/
.breadcrumbs {
padding: 2rem 2rem 1rem;
border-bottom: 1px solid @color-border;
> p{
font-size: .83rem;
margin: 0;
*{
font-size: .83rem;
}
.bchead{
.sr-only();
}
a{
&:hover,&:focus,&:active{
color: @color-nav;
}
}
span.home{
a{
.fontello();
.hide-text-show-before();
.icon-home();
height: 1em;
width: auto;
text-decoration:none;
&:before{
font-size: 1rem;
margin-top: .17rem;
}
&:hover,&:focus,&:active{
color: @color-nav;
}
}
}
}
.page-attributes{
float:right;
display: inline-block;
list-style: none;
margin:0; padding:0;
max-width: 30%;
> li{
display: inline-block;
//float: right;
margin: 0 .1rem;
padding: 0;
font-size: .8rem;
#plugin__qc__wrapper{
position:absolute;
right:0;
width: auto;
border: 0 none;
background: @color-site-bg;
}
a[aria-expanded="false"] + #plugin__qc__wrapper{
display: none;
}
#plugin__qc__wrapper[aria-hidden="false"]{
margin-top: .7rem;
}
#plugin__qc__icon{
display: none;
}
&.plugin__qc{
display: inline-block;
overflow: visible;
}
#plugin__qc__link{
font-size: .8rem;
position: relative;
display: block;
height: 1rem;
width: 1rem;
border: 1px solid @color-border;
background-color: @color-site-bg;
border-radius: @border-radius;
color: @color-nav;
min-height: 1.2em;
min-width: 1.4em;
box-sizing: content-box;
padding: .3em .25em .15em;
.prefix{
font-size: .8rem;
.fontello();
.hide-text-show-before();
.icon-emo-happy();
color: @color-nav;
}
.num{
position: absolute;
padding: .2em .3em .1em;
text-align: center;
font-size: .6rem;
line-height: 100%;
font-weight: 400;
right: -0.3em;
top: -0.4em;
background-color: @color-border;
border-radius: 2px;
color: @color-nav;
}
}
}
}
}

View file

@ -0,0 +1,16 @@
/**
* This file provides the design styles for the page specific tool bar.
*
* @author Jana Deutschlaender <deutschlaender@cosmocode.de>
*/
nav#dokuwiki__pagetools{
&:hover{
ul{
background-color: #fff;
}
}
ul li a{
background-image: none;
}
}

View file

@ -11,7 +11,7 @@
}
ul{
float: right;
padding: 0; margin: .2rem 0 0 0;
padding: 0; margin: .2rem -.2rem 0 0;
li{
display: inline-block;
float: right;
@ -72,19 +72,19 @@
}
&.user-task{
&.noopentasks{
border: 1px solid @color-border;
border-radius: @border-radius;
color: @color-nav;
display: inline-block;
height: 1rem;
min-height: 20px;
min-width: 24px;
box-sizing: content-box;
padding: .3em .25em .15em;
margin-top: 2px;
position: relative;
}
border: 1px solid @color-border;
border-radius: @border-radius;
color: @color-nav;
display: inline-block;
height: 1rem;
width: 1rem;
min-height: 1.2em;
min-width: 1.4em;
box-sizing: content-box;
padding: .3em .25em .15em;
margin-top: 2px;
position: relative;
a{
position: relative;
@ -133,8 +133,8 @@
color: @color-nav;
display: inline-block;
height: 1rem;
min-height: 20px;
min-width: 24px;
min-height: 1.2em;
min-width: 1.4em;
box-sizing: content-box;
padding: .3em .25em .15em;
margin-top: 2px;

View file

@ -96,6 +96,9 @@
@color-nav-hover: __nav_menu_hover_color__;
@color-nav-hover-bg:__nav_menu_hover_bg__;
@color-content-bg: __background_content__;
@color-site-bg: __background_site__;
@color-link: __existing__;
@height-context-bar: 50px;

View file

@ -7,9 +7,492 @@
html, body{
background-color: @ini_background;
background-color: @color-site-bg;
}
a{
color: @ini_existing;
}
/* highlight selected tool */
.mode_admin a.action.admin,
.mode_login a.action.login,
.mode_register a.action.register,
.mode_profile a.action.profile,
.mode_recent a.action.recent,
.mode_index a.action.index,
.mode_media a.action.media,
.mode_revisions a.action.revs,
.mode_backlink a.action.backlink,
.mode_subscribe a.action.subscribe {
font-weight: bold;
}
.dokuwiki .pageId {
float: right;
margin-right: -1em;
margin-bottom: -1px;
margin-top: -1.5em;
overflow: hidden;
padding: 0.5em 1em 0;
span {
font-size: 0.875em;
border: solid @ini_background_alt;
border-width: 1px 1px 0;
background-color: @ini_background;
color: @ini_text_alt;
padding: .1em .35em;
border-top-left-radius: 2px;
border-top-right-radius: 2px;
box-shadow: 0 0 .5em @ini_text_alt;
display: block;
}
}
.dokuwiki div.page {
clear: both;
background: @color-content-bg;
color: inherit;
padding: 1rem 2rem 2rem;
margin-bottom: .5rem;
overflow: hidden;
word-wrap: break-word;
}
.dokuwiki .docInfo {
font-size: 0.5rem;
text-align: right;
}
/* license note under edit window */
.dokuwiki div.license {
font-size: 93.75%;
}
[dir=rtl] .dokuwiki .docInfo {
text-align: left;
}
[dir=rtl] .dokuwiki .pageId {
float: left;
margin-left: -1em;
margin-right: 0;
}
caption,
figcaption,
summary,
legend {
padding: 0;
margin: 0 0 .35em;
line-height: 1.2;
}
h1,
h2,
h3,
h4,
h5,
h6 {
font-weight: bold;
padding: 0;
line-height: 1.2;
clear: both;
}
[dir=rtl] h1,
[dir=rtl] h2,
[dir=rtl] h3,
[dir=rtl] h4,
[dir=rtl] h5,
[dir=rtl] h6 {
clear: right;
}
h1 {
font-size: 1.4rem;
margin: 0 0 0.444em;
}
h2 {
font-size: 1.12rem;
margin: 0 0 0.666em;
}
h3 {
font-size: 1rem;
margin: 0 0 0.888em;
}
h4 {
font-size: .93rem;
margin: 0 0 1.0em;
}
h5 {
font-size: .82rem;
margin: 0 0 1.1428em;
}
h6 {
font-size: .75rem;
margin: 0 0 1.333em;
}
p,
ul,
ol,
dl,
pre,
table,
hr,
blockquote,
figure,
details,
fieldset,
address {
margin: 0 0 1.4em 0; /* bottom margin = line-height */
padding: 0;
}
div,
video,
audio {
margin: 0;
padding: 0;
}
/*____________ lists ____________*/
ul,
ol {
padding: 0 0 0 1.5em;
}
[dir=rtl] ul,
[dir=rtl] ol {
padding: 0 1.5em 0 0;
}
li,
dd {
padding: 0;
margin: 0 0 0 1.5em;
}
[dir=rtl] li,
[dir=rtl] dd {
margin: 0 1.5em 0 0;
}
dt {
font-weight: bold;
margin: 0;
padding: 0;
}
li ul,
li ol,
li dl,
dl ul,
dl ol,
dl dl {
margin-bottom: 0;
padding: 0;
}
li li {
font-size: 100%;
}
ul { list-style: square outside; }
ol { list-style: decimal outside; }
ol ol { list-style-type: lower-alpha; }
ol ol ol { list-style-type: upper-roman; }
ol ol ol ol { list-style-type: upper-alpha; }
ol ol ol ol ol { list-style-type: lower-roman; }
table {
border-collapse: collapse;
empty-cells: show;
border-spacing: 0;
border: 1px solid @ini_border;
}
caption {
caption-side: top;
text-align: left;
}
[dir=rtl] caption {
text-align: right;
}
th,
td {
padding: .3em .5em;
margin: 0;
vertical-align: top;
border: 1px solid @ini_border;
}
th {
font-weight: bold;
background-color: @ini_background_alt;
text-align: left;
}
[dir=rtl] th {
text-align: right;
}
a {
outline: none;
}
a:link,
a:visited {
text-decoration: none;
color: @ini_link;
}
a:hover,
a:focus,
a:active {
text-decoration: underline;
}
img {
border-width: 0;
vertical-align: middle;
color: #666;
background-color: transparent;
font-style: italic;
height: auto;
}
img,
object,
embed,
iframe,
video,
audio {
max-width: 100%;
}
button img {
max-width: none;
}
hr {
border-top: solid @ini_border;
border-bottom: solid @ini_background;
border-width: 1px 0;
height: 0;
text-align: center;
clear: both;
}
acronym,
abbr {
cursor: help;
border-bottom: 1px dotted;
font-style: normal;
}
em acronym,
em abbr {
font-style: italic;
}
mark {
background-color: @ini_highlight;
color: inherit;
}
pre,
code,
samp,
kbd {
font-family: Consolas, "Andale Mono WT", "Andale Mono", "Bitstream Vera Sans Mono", "Nimbus Mono L", Monaco, "Courier New", monospace;
/* same font stack should be used for ".dokuwiki table.diff td" in _diff.css */
font-size: 1em;
direction: ltr;
text-align: left;
background-color: @ini_background_site;
color: @ini_text;
box-shadow: inset 0 0 .3em @ini_border;
border-radius: 2px;
}
pre {
overflow: auto;
word-wrap: normal;
border: 1px solid @ini_border;
border-radius: 2px;
box-shadow: inset 0 0 .5em @ini_border;
padding: .7em 1em;
}
blockquote {
padding: 0 .5em;
border: solid @ini_border;
border-width: 0 0 0 .25em;
}
[dir=rtl] blockquote {
border-width: 0 .25em 0 0;
}
q:before,
q:after {
content: '';
}
sub,
sup {
font-size: .8em;
line-height: 1;
}
sub {
vertical-align: sub;
}
sup {
vertical-align: super;
}
small {
font-size: .8em;
}
/*____________ forms ____________*/
/* for all of the form styles, style.ini colours are not used on purpose (except for fieldset border) */
form {
display: inline;
margin: 0;
padding: 0;
}
fieldset {
padding: .7em 1em 0;
padding: .7rem 1rem; /* for those browsers understanding :last-child */
border: 1px solid @ini_text_alt;
}
fieldset > :last-child {
margin-bottom: 0;
}
legend {
margin: 0;
padding: 0 .1em;
}
label {
vertical-align: middle;
cursor: pointer;
}
input,
textarea,
button,
select,
optgroup,
option,
keygen,
output,
meter,
progress {
font: inherit;
font-weight: normal;
color: #333;
background-color: #fff;
line-height: normal;
margin: 0;
vertical-align: middle;
box-sizing: border-box;
}
select {
max-width: 100%;
}
optgroup {
font-style: italic;
font-weight: bold;
}
option {
font-style: normal;
font-weight: normal;
}
input,
textarea,
select,
keygen {
border: 1px solid #ccc;
box-shadow: inset 0 0 1px #eee;
border-radius: 2px;
}
input:active,
input:focus,
textarea:active,
textarea:focus,
select:active,
select:focus,
keygen:active,
keygen:focus {
border-color: #999;
}
input[type=radio],
input[type=checkbox],
input[type=image] {
padding: 0;
border-style: none;
box-shadow: none;
}
/* all types of buttons */
input[type=submit],
input[type=button],
input[type=reset],
input.button,
a.button,
button,
.qq-upload-button {
color: #333;
background-color: #eee;
background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIHZpZXdCb3g9IjAgMCAxIDEiIHByZXNlcnZlQXNwZWN0UmF0aW89Im5vbmUiPgo8bGluZWFyR3JhZGllbnQgaWQ9Imc4MjQiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIiB4MT0iMCUiIHkxPSIwJSIgeDI9IjAlIiB5Mj0iMTAwJSI+CjxzdG9wIHN0b3AtY29sb3I9IiNGRkZGRkYiIG9mZnNldD0iMCIvPjxzdG9wIHN0b3AtY29sb3I9IiNGNEY0RjQiIG9mZnNldD0iMC4zIi8+PHN0b3Agc3RvcC1jb2xvcj0iI0VFRUVFRSIgb2Zmc2V0PSIwLjk5Ii8+PHN0b3Agc3RvcC1jb2xvcj0iI0NDQ0NDQyIgb2Zmc2V0PSIuOTkiLz4KPC9saW5lYXJHcmFkaWVudD4KPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNnODI0KSIgLz4KPC9zdmc+);
background-image: linear-gradient(to bottom, #ffffff 0%, #f4f4f4 30%, #eeeeee 99%, #cccccc 99%);
border: 1px solid #ccc;
border-radius: 2px;
padding: .1em .5em;
cursor: pointer;
}
input[type=submit]:hover,
input[type=submit]:active,
input[type=submit]:focus,
input[type=button]:hover,
input[type=button]:active,
input[type=button]:hover,
input[type=reset]:hover,
input[type=reset]:active,
input[type=reset]:hover,
input.button:hover,
input.button:active,
input.button:focus,
a.button:hover,
a.button:active,
a.button:focus,
button:hover,
button:active,
button:focus,
.qq-upload-button:hover {
border-color: #999;
background-color: #ddd;
background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIHZpZXdCb3g9IjAgMCAxIDEiIHByZXNlcnZlQXNwZWN0UmF0aW89Im5vbmUiPgo8bGluZWFyR3JhZGllbnQgaWQ9Imc2NzAiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIiB4MT0iMCUiIHkxPSIwJSIgeDI9IjAlIiB5Mj0iMTAwJSI+CjxzdG9wIHN0b3AtY29sb3I9IiNGRkZGRkYiIG9mZnNldD0iMCIvPjxzdG9wIHN0b3AtY29sb3I9IiNGNEY0RjQiIG9mZnNldD0iMC4zIi8+PHN0b3Agc3RvcC1jb2xvcj0iI0RERERERCIgb2Zmc2V0PSIwLjk5Ii8+PHN0b3Agc3RvcC1jb2xvcj0iI0JCQkJCQiIgb2Zmc2V0PSIuOTkiLz4KPC9saW5lYXJHcmFkaWVudD4KPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNnNjcwKSIgLz4KPC9zdmc+);
background-image: linear-gradient(to bottom, #ffffff 0%, #f4f4f4 30%, #dddddd 99%, #bbbbbb 99%);
}
input::-moz-focus-inner,
button::-moz-focus-inner {
border: 0;
padding: 0;
}
input[disabled],
button[disabled],
select[disabled],
textarea[disabled],
option[disabled],
input[readonly],
button[readonly],
select[readonly],
textarea[readonly] {
cursor: auto;
opacity: .5;
background-color: #eee;
}

View file

@ -236,5 +236,29 @@
}
}
.icon-doc-new{
&::before {
content: '\e81d';
}
}
.icon-book-open{
&::before {
content: '\e81c';
}
}
.icon-plus{
&::before {
content: '\e81e';
}
}
.icon-doc{
&::before {
content: '\e81b';
}
}

View file

@ -146,10 +146,10 @@
overflow: hidden;
white-space: nowrap;
text-indent: -9999px;
width: 1rem;
height: 1rem;
min-height: 20px;
min-width: 24px;
width: 1rem;
min-height: 1.2em;
min-width: 1.4em;
&::before{
text-indent: 0;
float: left;

View file

@ -120,23 +120,45 @@
.content{
.row > .col-xs-12{
width: 73%;
position: relative;
float: right;
width: 100%;
background-color: #fff;
}
}
.showSidebar{
.content{
.row > .col-xs-12{
width: 73%;
position: relative;
float: right;
}
}
}
.claim{
.logo{
position: absolute;
bottom: 0;
height: 1px;
bottom: 1em;
overflow: visible;
}
.logo img{
max-width: 100%;
height: auto;
height: 60px;
width: auto;
}
}
.showSidebar{
.claim{
.logo{
position: absolute;
bottom: 0;
height: 1px;
overflow: visible;
}
.logo img{
max-width: 100%;
height: auto;
}
}
}

40
css/plugins/do_tasks.less Normal file
View file

@ -0,0 +1,40 @@
/* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + */
/* all media */
/* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + */
ul.page-attributes{
.plugin__do_pagetasks{
&.do_none{
border: 1px solid @color-border;
border-radius: @border-radius;
color: @color-nav;
display: inline-block;
height: 1rem;
min-height: 1.2em;
min-width: 1.4em;
box-sizing: content-box;
padding: .3em .25em .15em;
position: relative;
}
.num{
position: absolute;
padding: .2em .3em .1em;
text-align: center;
font-size: .6rem;
line-height: 100%;
font-weight: 400;
right: -0.3em;
top: -0.4em;
background-color: @color-border;
border-radius: 2px;
color: @color-nav;
}
.prefix{
.fontello();
.hide-text-show-before();
.icon-clipboard();
color: @color-nav;
font-size: .8rem;
}
}
}

View file

@ -221,6 +221,36 @@
"css": "help",
"code": 59418,
"src": "entypo"
},
{
"uid": "c8585e1e5b0467f28b70bce765d5840c",
"css": "docs",
"code": 61637,
"src": "fontawesome"
},
{
"uid": "1b5a5d7b7e3c71437f5a26befdd045ed",
"css": "doc",
"code": 59419,
"src": "fontawesome"
},
{
"uid": "8fc56819afcd07e2786e34f18d39b71b",
"css": "book-open",
"code": 59420,
"src": "iconic"
},
{
"uid": "9e0404ba55575a540164db9a5ad511df",
"css": "doc-new",
"code": 59421,
"src": "elusive"
},
{
"uid": "44e04715aecbca7f266a17d5a7863c68",
"css": "plus",
"code": 59422,
"src": "fontawesome"
}
]
}

Binary file not shown.

Binary file not shown.

View file

@ -60,8 +60,18 @@
<glyph glyph-name="help" unicode="&#xe81a;" d="M494 740q86-62 86-184 0-64-42-124-12-20-88-80l-46-30q-40-34-48-60-6-16-8-44 0-14-16-14l-128 0q-16 0-16 12 4 98 28 124 16 22 48 48t56 42l24 14q22 16 34 34 28 44 28 70 0 40-26 78-28 36-92 36-68 0-94-44-28-42-28-92l-166 0q6 162 114 232 70 42 166 42 130 0 214-60z m-216-636q44 0 73-30t27-74q-2-46-32-73t-74-25q-44 0-73 29t-27 75 32 73 74 25z" horiz-adv-x="580" />
<glyph glyph-name="doc" unicode="&#xe81b;" d="M819 638q16-16 27-42t11-50v-642q0-23-15-38t-38-16h-750q-23 0-38 16t-16 38v892q0 23 16 38t38 16h500q22 0 49-11t42-27z m-248 136v-210h210q-5 17-12 23l-175 175q-6 7-23 12z m215-853v572h-232q-23 0-38 16t-16 37v233h-429v-858h715z" horiz-adv-x="857.1" />
<glyph glyph-name="book-open" unicode="&#xe81c;" d="M464 629q5 5 15 12t47 26 83 35 127 27 175 12l0-670q-95 0-176-12t-128-27-82-34-47-29l-14-10q-4 4-13 12t-46 26-83 35-127 27-177 12l0 670q94 0 174-12t128-27 83-33 48-29z m-334 0l0-450q172-14 279-71l0 449q-110 58-279 72z m669-450l0 450q-168-14-278-72l0-449q108 57 278 71z" horiz-adv-x="928" />
<glyph glyph-name="doc-new" unicode="&#xe81d;" d="M0-150l0 818 188 182 519 0 0-348-86 0 0 260-369 0 0-156-166 0 0-668 418 0 0-88-504 0z m373 207l0 162 209 0 0 207 160 0 0-207 207 0 0-162-207 0 0-207-160 0 0 207-209 0z" horiz-adv-x="949" />
<glyph glyph-name="plus" unicode="&#xe81e;" d="M786 439v-107q0-22-16-38t-38-15h-232v-233q0-22-16-37t-38-16h-107q-22 0-38 16t-15 37v233h-232q-23 0-38 15t-16 38v107q0 23 16 38t38 16h232v232q0 22 15 38t38 16h107q23 0 38-16t16-38v-232h232q23 0 38-16t16-38z" horiz-adv-x="785.7" />
<glyph glyph-name="bookmark-empty" unicode="&#xf097;" d="M643 707h-572v-693l237 227 49 47 50-47 236-227v693z m7 72q12 0 24-5 19-8 29-23t11-35v-719q0-19-11-35t-29-23q-10-4-24-4-27 0-47 18l-246 236-246-236q-20-19-46-19-13 0-25 5-18 7-29 23t-11 35v719q0 19 11 35t29 23q12 5 25 5h585z" horiz-adv-x="714.3" />
<glyph glyph-name="docs" unicode="&#xf0c5;" d="M946 636q23 0 38-16t16-38v-678q0-23-16-38t-38-16h-535q-23 0-38 16t-16 38v160h-303q-23 0-38 16t-16 38v375q0 22 11 49t27 42l228 228q15 16 42 27t49 11h232q23 0 38-16t16-38v-183q38 23 71 23h232z m-303-119l-167-167h167v167z m-357 214l-167-167h167v167z m109-361l176 176v233h-214v-233q0-22-15-37t-38-16h-233v-357h286v143q0 22 11 49t27 42z m534-449v643h-215v-232q0-22-15-38t-38-15h-232v-358h500z" horiz-adv-x="1000" />
<glyph glyph-name="menu" unicode="&#xf0c9;" d="M857 100v-71q0-15-10-25t-26-11h-785q-15 0-25 11t-11 25v71q0 15 11 25t25 11h785q15 0 26-11t10-25z m0 286v-72q0-14-10-25t-26-10h-785q-15 0-25 10t-11 25v72q0 14 11 25t25 10h785q15 0 26-10t10-25z m0 285v-71q0-14-10-25t-26-11h-785q-15 0-25 11t-11 25v71q0 15 11 26t25 10h785q15 0 26-10t10-26z" horiz-adv-x="857.1" />
<glyph glyph-name="sitemap" unicode="&#xf0e8;" d="M1000 154v-179q0-22-16-38t-38-16h-178q-22 0-38 16t-16 38v179q0 22 16 38t38 15h53v107h-285v-107h53q23 0 38-15t16-38v-179q0-22-16-38t-38-16h-178q-23 0-38 16t-16 38v179q0 22 16 38t38 15h53v107h-285v-107h53q23 0 38-15t16-38v-179q0-22-16-38t-38-16h-178q-23 0-38 16t-16 38v179q0 22 16 38t38 15h53v107q0 29 21 51t51 21h285v107h-53q-23 0-38 16t-16 37v179q0 22 16 38t38 16h178q23 0 38-16t16-38v-179q0-22-16-37t-38-16h-53v-107h285q29 0 51-21t21-51v-107h53q23 0 38-15t16-38z" horiz-adv-x="1000" />

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Before After
Before After

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
images/pagetools-sprite.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

79
js/base/helper.js Normal file
View file

@ -0,0 +1,79 @@
/**
* @file helper funcs
*
*/
// + + + + + + + + + + + + + + + + + + + + + + + + + + + +
// shuffle func for random values
// + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Array.prototype.shuffle = function(){
var tmp, rand;
for(var i =0; i < this.length; i++){
rand = Math.floor(Math.random() * this.length);
tmp = this[i];
this[i] = this[rand];
this[rand] =tmp;
}
};
// + + + + + + + + + + + + + + + + + + + + + + + + + + + +
// js trim func for ie
// + + + + + + + + + + + + + + + + + + + + + + + + + + + +
if(typeof String.prototype.trim !== 'function') {
String.prototype.trim = function() {
return this.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
};
}
var linkTo_UnCryptMailto = function(s){
location.href=decryptString(s,-2);
};
var decryptCharcode = function(n, start, end, offset) {
n = n + offset;
if (offset > 0 && n > end) {
n = start + (n - end - 1);
} else if (offset < 0 && n < start) {
n = end - (start - n - 1);
}
return String.fromCharCode(n);
};
var decryptString = function(enc, offset) {
var dec = '';
var len = enc.length;
for (var i = 0; i < len; i++) {
var n = enc.charCodeAt(i);
if (n >= 43 && n <= 58) {
dec += decryptCharcode(n, 43, 58, offset);
} else if (n >= 64 && n <= 90) {
dec += decryptCharcode(n, 64, 90, offset);
} else if (n >= 97 && n <= 122) {
dec += decryptCharcode(n, 97, 122, offset);
} else {
dec += enc.charAt(i);
}
}
return dec;
};
/**
* simplify setting and getting state out of a node
* $("#my_id").data("my_data_attr") equals $$("#my_id").my_data_attr and
* $("#my_id").data("my_data_attr", "my_data_val") equals $$("#my_id").my_data_attr = my_data_val
* you can also do
* $$("#my_id").my_data_val = $$("#my_id").my_data_val + 1.
*/
var $$ = function(param) {
var node = $(param)[0];
var id = $.data(node);
$.cache[id] = $.cache[id] || {};
$.cache[id].node = node;
return $.cache[id];
};
var alertFB = false;
if (typeof console === "undefined" || typeof console.log === "undefined") {
console = {};
if (alertFB) {
console.log = function(msg) {
alert(msg);
};
} else {
console.log = function() {};
}
}

Some files were not shown because too many files have changed in this diff Show more